libipsec: ansify

Sponsored by:	Nvidia networking
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2023-04-03 04:18:40 +03:00
parent f14ceae498
commit 650d6cc122
2 changed files with 88 additions and 229 deletions

View File

@ -93,8 +93,7 @@ static int supported_map[] = {
}; };
static int static int
findsupportedmap(satype) findsupportedmap(int satype)
int satype;
{ {
int i; int i;
@ -105,8 +104,7 @@ findsupportedmap(satype)
} }
static struct sadb_alg * static struct sadb_alg *
findsupportedalg(satype, alg_id) findsupportedalg(u_int satype, u_int alg_id)
u_int satype, alg_id;
{ {
int algno; int algno;
int tlen; int tlen;
@ -143,8 +141,7 @@ findsupportedalg(satype, alg_id)
} }
static int static int
setsupportedmap(sup) setsupportedmap(struct sadb_supported *sup)
struct sadb_supported *sup;
{ {
struct sadb_supported **ipsup; struct sadb_supported **ipsup;
@ -183,10 +180,7 @@ setsupportedmap(sup)
* 0: valid. * 0: valid.
*/ */
int int
ipsec_check_keylen(supported, alg_id, keylen) ipsec_check_keylen(u_int supported, u_int alg_id, u_int keylen)
u_int supported;
u_int alg_id;
u_int keylen;
{ {
int satype; int satype;
@ -215,10 +209,7 @@ ipsec_check_keylen(supported, alg_id, keylen)
* 0: valid. * 0: valid.
*/ */
int int
ipsec_check_keylen2(satype, alg_id, keylen) ipsec_check_keylen2(u_int satype, u_int alg_id, u_int keylen)
u_int satype;
u_int alg_id;
u_int keylen;
{ {
struct sadb_alg *alg; struct sadb_alg *alg;
@ -244,9 +235,7 @@ ipsec_check_keylen2(satype, alg_id, keylen)
* 0: valid. * 0: valid.
*/ */
int int
ipsec_get_keylen(supported, alg_id, alg0) ipsec_get_keylen(u_int supported, u_int alg_id, struct sadb_alg *alg0)
u_int supported, alg_id;
struct sadb_alg *alg0;
{ {
struct sadb_alg *alg; struct sadb_alg *alg;
u_int satype; u_int satype;
@ -289,8 +278,7 @@ static u_int soft_lifetime_addtime_rate = PFKEY_SOFT_LIFETIME_RATE;
static u_int soft_lifetime_usetime_rate = PFKEY_SOFT_LIFETIME_RATE; static u_int soft_lifetime_usetime_rate = PFKEY_SOFT_LIFETIME_RATE;
u_int u_int
pfkey_set_softrate(type, rate) pfkey_set_softrate(u_int type, u_int rate)
u_int type, rate;
{ {
__ipsec_errcode = EIPSEC_NO_ERROR; __ipsec_errcode = EIPSEC_NO_ERROR;
@ -321,8 +309,7 @@ pfkey_set_softrate(type, rate)
* ATTENTION: ~0 is returned if invalid type was passed. * ATTENTION: ~0 is returned if invalid type was passed.
*/ */
u_int u_int
pfkey_get_softrate(type) pfkey_get_softrate(u_int type)
u_int type;
{ {
switch (type) { switch (type) {
case SADB_X_LIFETIME_ALLOCATIONS: case SADB_X_LIFETIME_ALLOCATIONS:
@ -345,11 +332,9 @@ pfkey_get_softrate(type)
* -1 : error occurred, and set errno. * -1 : error occurred, and set errno.
*/ */
int int
pfkey_send_getspi(so, satype, mode, src, dst, min, max, reqid, seq) pfkey_send_getspi(int so, u_int satype, u_int mode, struct sockaddr *src,
int so; struct sockaddr *dst, u_int32_t min, uint32_t max, uint32_t reqid,
u_int satype, mode; uint32_t seq)
struct sockaddr *src, *dst;
u_int32_t min, max, reqid, seq;
{ {
struct sadb_msg *newmsg; struct sadb_msg *newmsg;
caddr_t ep; caddr_t ep;
@ -474,18 +459,11 @@ pfkey_send_getspi(so, satype, mode, src, dst, min, max, reqid, seq)
* -1 : error occurred, and set errno. * -1 : error occurred, and set errno.
*/ */
int int
pfkey_send_update(so, satype, mode, src, dst, spi, reqid, wsize, pfkey_send_update(int so, u_int satype, u_int mode, struct sockaddr *src,
keymat, e_type, e_keylen, a_type, a_keylen, flags, struct sockaddr *dst, u_int32_t spi, u_int32_t reqid, u_int wsize,
l_alloc, l_bytes, l_addtime, l_usetime, seq) caddr_t keymat, u_int e_type, u_int e_keylen, u_int a_type, u_int a_keylen,
int so; u_int flags, u_int32_t l_alloc, u_int64_t l_bytes, u_int64_t l_addtime,
u_int satype, mode, wsize; u_int64_t l_usetime, u_int32_t seq)
struct sockaddr *src, *dst;
u_int32_t spi, reqid;
caddr_t keymat;
u_int e_type, e_keylen, a_type, a_keylen, flags;
u_int32_t l_alloc;
u_int64_t l_bytes, l_addtime, l_usetime;
u_int32_t seq;
{ {
int len; int len;
if ((len = pfkey_send_x1(so, SADB_UPDATE, satype, mode, src, dst, spi, if ((len = pfkey_send_x1(so, SADB_UPDATE, satype, mode, src, dst, spi,
@ -505,18 +483,11 @@ pfkey_send_update(so, satype, mode, src, dst, spi, reqid, wsize,
* -1 : error occurred, and set errno. * -1 : error occurred, and set errno.
*/ */
int int
pfkey_send_add(so, satype, mode, src, dst, spi, reqid, wsize, pfkey_send_add(int so, u_int satype, u_int mode, struct sockaddr *src,
keymat, e_type, e_keylen, a_type, a_keylen, flags, struct sockaddr *dst, u_int32_t spi, u_int32_t reqid, u_int wsize,
l_alloc, l_bytes, l_addtime, l_usetime, seq) caddr_t keymat, u_int e_type, u_int e_keylen, u_int a_type, u_int a_keylen,
int so; u_int flags, u_int32_t l_alloc, u_int64_t l_bytes, u_int64_t l_addtime,
u_int satype, mode, wsize; u_int64_t l_usetime, u_int32_t seq)
struct sockaddr *src, *dst;
u_int32_t spi, reqid;
caddr_t keymat;
u_int e_type, e_keylen, a_type, a_keylen, flags;
u_int32_t l_alloc;
u_int64_t l_bytes, l_addtime, l_usetime;
u_int32_t seq;
{ {
int len; int len;
if ((len = pfkey_send_x1(so, SADB_ADD, satype, mode, src, dst, spi, if ((len = pfkey_send_x1(so, SADB_ADD, satype, mode, src, dst, spi,
@ -535,11 +506,8 @@ pfkey_send_add(so, satype, mode, src, dst, spi, reqid, wsize,
* -1 : error occurred, and set errno. * -1 : error occurred, and set errno.
*/ */
int int
pfkey_send_delete(so, satype, mode, src, dst, spi) pfkey_send_delete(int so, u_int satype, u_int mode, struct sockaddr *src,
int so; struct sockaddr *dst, u_int32_t spi)
u_int satype, mode;
struct sockaddr *src, *dst;
u_int32_t spi;
{ {
int len; int len;
if ((len = pfkey_send_x2(so, SADB_DELETE, satype, mode, src, dst, spi)) < 0) if ((len = pfkey_send_x2(so, SADB_DELETE, satype, mode, src, dst, spi)) < 0)
@ -558,10 +526,8 @@ pfkey_send_delete(so, satype, mode, src, dst, spi)
* -1 : error occurred, and set errno * -1 : error occurred, and set errno
*/ */
int int
pfkey_send_delete_all(so, satype, mode, src, dst) pfkey_send_delete_all(int so, u_int satype, u_int mode, struct sockaddr *src,
int so; struct sockaddr *dst)
u_int satype, mode;
struct sockaddr *src, *dst;
{ {
struct sadb_msg *newmsg; struct sadb_msg *newmsg;
int len; int len;
@ -640,11 +606,8 @@ pfkey_send_delete_all(so, satype, mode, src, dst)
* -1 : error occurred, and set errno. * -1 : error occurred, and set errno.
*/ */
int int
pfkey_send_get(so, satype, mode, src, dst, spi) pfkey_send_get(int so, u_int satype, u_int mode, struct sockaddr *src,
int so; struct sockaddr *dst, u_int32_t spi)
u_int satype, mode;
struct sockaddr *src, *dst;
u_int32_t spi;
{ {
int len; int len;
if ((len = pfkey_send_x2(so, SADB_GET, satype, mode, src, dst, spi)) < 0) if ((len = pfkey_send_x2(so, SADB_GET, satype, mode, src, dst, spi)) < 0)
@ -660,9 +623,7 @@ pfkey_send_get(so, satype, mode, src, dst, spi)
* -1 : error occurred, and set errno. * -1 : error occurred, and set errno.
*/ */
int int
pfkey_send_register(so, satype) pfkey_send_register(int so, u_int satype)
int so;
u_int satype;
{ {
int len, algno; int len, algno;
@ -702,8 +663,7 @@ pfkey_send_register(so, satype)
* -1: error occurred, and set errno. * -1: error occurred, and set errno.
*/ */
int int
pfkey_recv_register(so) pfkey_recv_register(int so)
int so;
{ {
pid_t pid = getpid(); pid_t pid = getpid();
struct sadb_msg *newmsg; struct sadb_msg *newmsg;
@ -742,9 +702,7 @@ pfkey_recv_register(so)
* -1: error occurred, and set errno. * -1: error occurred, and set errno.
*/ */
int int
pfkey_set_supported(msg, tlen) pfkey_set_supported(struct sadb_msg *msg, int tlen)
struct sadb_msg *msg;
int tlen;
{ {
struct sadb_supported *sup; struct sadb_supported *sup;
caddr_t p; caddr_t p;
@ -806,9 +764,7 @@ pfkey_set_supported(msg, tlen)
* -1 : error occurred, and set errno. * -1 : error occurred, and set errno.
*/ */
int int
pfkey_send_flush(so, satype) pfkey_send_flush(int so, u_int satype)
int so;
u_int satype;
{ {
int len; int len;
@ -825,9 +781,7 @@ pfkey_send_flush(so, satype)
* -1 : error occurred, and set errno. * -1 : error occurred, and set errno.
*/ */
int int
pfkey_send_dump(so, satype) pfkey_send_dump(int so, u_int satype)
int so;
u_int satype;
{ {
int len; int len;
@ -850,9 +804,7 @@ pfkey_send_dump(so, satype)
* algorithms is. * algorithms is.
*/ */
int int
pfkey_send_promisc_toggle(so, flag) pfkey_send_promisc_toggle(int so, int flag)
int so;
int flag;
{ {
int len; int len;
@ -869,13 +821,9 @@ pfkey_send_promisc_toggle(so, flag)
* -1 : error occurred, and set errno. * -1 : error occurred, and set errno.
*/ */
int int
pfkey_send_spdadd(so, src, prefs, dst, prefd, proto, policy, policylen, seq) pfkey_send_spdadd(int so, struct sockaddr *src, u_int prefs,
int so; struct sockaddr *dst, u_int prefd, u_int proto, caddr_t policy,
struct sockaddr *src, *dst; int policylen, u_int32_t seq)
u_int prefs, prefd, proto;
caddr_t policy;
int policylen;
u_int32_t seq;
{ {
int len; int len;
@ -895,15 +843,9 @@ pfkey_send_spdadd(so, src, prefs, dst, prefd, proto, policy, policylen, seq)
* -1 : error occurred, and set errno. * -1 : error occurred, and set errno.
*/ */
int int
pfkey_send_spdadd2(so, src, prefs, dst, prefd, proto, ltime, vtime, pfkey_send_spdadd2(int so, struct sockaddr *src, u_int prefs,
policy, policylen, seq) struct sockaddr *dst, u_int prefd, u_int proto, u_int64_t ltime,
int so; u_int64_t vtime, caddr_t policy, int policylen, u_int32_t seq)
struct sockaddr *src, *dst;
u_int prefs, prefd, proto;
u_int64_t ltime, vtime;
caddr_t policy;
int policylen;
u_int32_t seq;
{ {
int len; int len;
@ -923,13 +865,9 @@ pfkey_send_spdadd2(so, src, prefs, dst, prefd, proto, ltime, vtime,
* -1 : error occurred, and set errno. * -1 : error occurred, and set errno.
*/ */
int int
pfkey_send_spdupdate(so, src, prefs, dst, prefd, proto, policy, policylen, seq) pfkey_send_spdupdate(int so, struct sockaddr *src, u_int prefs,
int so; struct sockaddr *dst, u_int prefd, u_int proto, caddr_t policy,
struct sockaddr *src, *dst; int policylen, u_int32_t seq)
u_int prefs, prefd, proto;
caddr_t policy;
int policylen;
u_int32_t seq;
{ {
int len; int len;
@ -949,15 +887,9 @@ pfkey_send_spdupdate(so, src, prefs, dst, prefd, proto, policy, policylen, seq)
* -1 : error occurred, and set errno. * -1 : error occurred, and set errno.
*/ */
int int
pfkey_send_spdupdate2(so, src, prefs, dst, prefd, proto, ltime, vtime, pfkey_send_spdupdate2(int so, struct sockaddr *src, u_int prefs,
policy, policylen, seq) struct sockaddr *dst, u_int prefd, u_int proto, u_int64_t ltime,
int so; u_int64_t vtime, caddr_t policy, int policylen, u_int32_t seq)
struct sockaddr *src, *dst;
u_int prefs, prefd, proto;
u_int64_t ltime, vtime;
caddr_t policy;
int policylen;
u_int32_t seq;
{ {
int len; int len;
@ -977,13 +909,9 @@ pfkey_send_spdupdate2(so, src, prefs, dst, prefd, proto, ltime, vtime,
* -1 : error occurred, and set errno. * -1 : error occurred, and set errno.
*/ */
int int
pfkey_send_spddelete(so, src, prefs, dst, prefd, proto, policy, policylen, seq) pfkey_send_spddelete(int so, struct sockaddr *src, u_int prefs,
int so; struct sockaddr *dst, u_int prefd, u_int proto, caddr_t policy,
struct sockaddr *src, *dst; int policylen, u_int32_t seq)
u_int prefs, prefd, proto;
caddr_t policy;
int policylen;
u_int32_t seq;
{ {
int len; int len;
@ -1008,9 +936,7 @@ pfkey_send_spddelete(so, src, prefs, dst, prefd, proto, policy, policylen, seq)
* -1 : error occurred, and set errno. * -1 : error occurred, and set errno.
*/ */
int int
pfkey_send_spddelete2(so, spid) pfkey_send_spddelete2(int so, u_int32_t spid)
int so;
u_int32_t spid;
{ {
int len; int len;
@ -1027,9 +953,7 @@ pfkey_send_spddelete2(so, spid)
* -1 : error occurred, and set errno. * -1 : error occurred, and set errno.
*/ */
int int
pfkey_send_spdget(so, spid) pfkey_send_spdget(int so, u_int32_t spid)
int so;
u_int32_t spid;
{ {
int len; int len;
@ -1046,13 +970,9 @@ pfkey_send_spdget(so, spid)
* -1 : error occurred, and set errno. * -1 : error occurred, and set errno.
*/ */
int int
pfkey_send_spdsetidx(so, src, prefs, dst, prefd, proto, policy, policylen, seq) pfkey_send_spdsetidx(int so, struct sockaddr *src, u_int prefs,
int so; struct sockaddr *dst, u_int prefd, u_int proto, caddr_t policy,
struct sockaddr *src, *dst; int policylen, u_int32_t seq)
u_int prefs, prefd, proto;
caddr_t policy;
int policylen;
u_int32_t seq;
{ {
int len; int len;
@ -1077,8 +997,7 @@ pfkey_send_spdsetidx(so, src, prefs, dst, prefd, proto, policy, policylen, seq)
* -1 : error occurred, and set errno. * -1 : error occurred, and set errno.
*/ */
int int
pfkey_send_spdflush(so) pfkey_send_spdflush(int so)
int so;
{ {
int len; int len;
@ -1095,8 +1014,7 @@ pfkey_send_spdflush(so)
* -1 : error occurred, and set errno. * -1 : error occurred, and set errno.
*/ */
int int
pfkey_send_spddump(so) pfkey_send_spddump(int so)
int so;
{ {
int len; int len;
@ -1108,17 +1026,11 @@ pfkey_send_spddump(so)
/* sending SADB_ADD or SADB_UPDATE message to the kernel */ /* sending SADB_ADD or SADB_UPDATE message to the kernel */
static int static int
pfkey_send_x1(so, type, satype, mode, src, dst, spi, reqid, wsize, pfkey_send_x1(int so, u_int type, u_int satype, u_int mode,
keymat, e_type, e_keylen, a_type, a_keylen, flags, struct sockaddr *src, struct sockaddr *dst, u_int32_t spi, u_int32_t reqid,
l_alloc, l_bytes, l_addtime, l_usetime, seq) u_int wsize, caddr_t keymat, u_int e_type, u_int e_keylen, u_int a_type,
int so; u_int a_keylen, u_int flags, u_int32_t l_alloc, u_int32_t l_bytes,
u_int type, satype, mode; u_int32_t l_addtime, u_int32_t l_usetime, u_int32_t seq)
struct sockaddr *src, *dst;
u_int32_t spi, reqid;
u_int wsize;
caddr_t keymat;
u_int e_type, e_keylen, a_type, a_keylen, flags;
u_int32_t l_alloc, l_bytes, l_addtime, l_usetime, seq;
{ {
struct sadb_msg *newmsg; struct sadb_msg *newmsg;
int len; int len;
@ -1298,11 +1210,8 @@ pfkey_send_x1(so, type, satype, mode, src, dst, spi, reqid, wsize,
/* sending SADB_DELETE or SADB_GET message to the kernel */ /* sending SADB_DELETE or SADB_GET message to the kernel */
static int static int
pfkey_send_x2(so, type, satype, mode, src, dst, spi) pfkey_send_x2(int so, u_int type, u_int satype, u_int mode,
int so; struct sockaddr *src, struct sockaddr *dst, u_int32_t spi)
u_int type, satype, mode;
struct sockaddr *src, *dst;
u_int32_t spi;
{ {
struct sadb_msg *newmsg; struct sadb_msg *newmsg;
int len; int len;
@ -1385,9 +1294,7 @@ pfkey_send_x2(so, type, satype, mode, src, dst, spi)
* to the kernel * to the kernel
*/ */
static int static int
pfkey_send_x3(so, type, satype) pfkey_send_x3(int so, u_int type, u_int satype)
int so;
u_int type, satype;
{ {
struct sadb_msg *newmsg; struct sadb_msg *newmsg;
int len; int len;
@ -1445,15 +1352,9 @@ pfkey_send_x3(so, type, satype)
/* sending SADB_X_SPDADD message to the kernel */ /* sending SADB_X_SPDADD message to the kernel */
static int static int
pfkey_send_x4(so, type, src, prefs, dst, prefd, proto, pfkey_send_x4(int so, u_int type, struct sockaddr *src, u_int prefs,
ltime, vtime, policy, policylen, seq) struct sockaddr *dst, u_int prefd, u_int proto, u_int64_t ltime,
int so; u_int64_t vtime, char *policy, int policylen, u_int32_t seq)
struct sockaddr *src, *dst;
u_int type, prefs, prefd, proto;
u_int64_t ltime, vtime;
char *policy;
int policylen;
u_int32_t seq;
{ {
struct sadb_msg *newmsg; struct sadb_msg *newmsg;
int len; int len;
@ -1539,10 +1440,7 @@ pfkey_send_x4(so, type, src, prefs, dst, prefd, proto,
/* sending SADB_X_SPDGET or SADB_X_SPDDELETE message to the kernel */ /* sending SADB_X_SPDGET or SADB_X_SPDDELETE message to the kernel */
static int static int
pfkey_send_x5(so, type, spid) pfkey_send_x5(int so, u_int type, u_int32_t spid)
int so;
u_int type;
u_int32_t spid;
{ {
struct sadb_msg *newmsg; struct sadb_msg *newmsg;
struct sadb_x_policy xpl; struct sadb_x_policy xpl;
@ -1645,8 +1543,7 @@ pfkey_open(void)
* -1: fail. * -1: fail.
*/ */
void void
pfkey_close(so) pfkey_close(int so)
int so;
{ {
(void)close(so); (void)close(so);
@ -1664,8 +1561,7 @@ pfkey_close(so)
* XXX should be rewritten to pass length explicitly * XXX should be rewritten to pass length explicitly
*/ */
struct sadb_msg * struct sadb_msg *
pfkey_recv(so) pfkey_recv(int so)
int so;
{ {
struct sadb_msg buf, *newmsg; struct sadb_msg buf, *newmsg;
int len, reallen; int len, reallen;
@ -1722,10 +1618,7 @@ pfkey_recv(so)
* -1 : fail. * -1 : fail.
*/ */
int int
pfkey_send(so, msg, len) pfkey_send(int so, struct sadb_msg *msg, int len)
int so;
struct sadb_msg *msg;
int len;
{ {
if ((len = send(so, (caddr_t)msg, len, 0)) < 0) { if ((len = send(so, (caddr_t)msg, len, 0)) < 0) {
__ipsec_set_strerror(strerror(errno)); __ipsec_set_strerror(strerror(errno));
@ -1751,9 +1644,7 @@ pfkey_send(so, msg, len)
* XXX should be rewritten to obtain length explicitly * XXX should be rewritten to obtain length explicitly
*/ */
int int
pfkey_align(msg, mhp) pfkey_align(struct sadb_msg *msg, caddr_t *mhp)
struct sadb_msg *msg;
caddr_t *mhp;
{ {
struct sadb_ext *ext; struct sadb_ext *ext;
int i; int i;
@ -1856,8 +1747,7 @@ pfkey_align(msg, mhp)
* 0: valid. * 0: valid.
*/ */
int int
pfkey_check(mhp) pfkey_check(caddr_t *mhp)
caddr_t *mhp;
{ {
struct sadb_msg *msg; struct sadb_msg *msg;
@ -1968,13 +1858,8 @@ pfkey_check(mhp)
* `buf' must has been allocated sufficiently. * `buf' must has been allocated sufficiently.
*/ */
static caddr_t static caddr_t
pfkey_setsadbmsg(buf, lim, type, tlen, satype, seq, pid) pfkey_setsadbmsg(caddr_t buf, caddr_t lim, u_int type, u_int tlen,
caddr_t buf; u_int satype, u_int32_t seq, pid_t pid)
caddr_t lim;
u_int type, satype;
u_int tlen;
u_int32_t seq;
pid_t pid;
{ {
struct sadb_msg *p; struct sadb_msg *p;
u_int len; u_int len;
@ -2003,11 +1888,8 @@ pfkey_setsadbmsg(buf, lim, type, tlen, satype, seq, pid)
* `buf' must has been allocated sufficiently. * `buf' must has been allocated sufficiently.
*/ */
static caddr_t static caddr_t
pfkey_setsadbsa(buf, lim, spi, wsize, auth, enc, flags) pfkey_setsadbsa(caddr_t buf, caddr_t lim, u_int32_t spi, u_int wsize,
caddr_t buf; u_int auth, u_int enc, u_int32_t flags)
caddr_t lim;
u_int32_t spi, flags;
u_int wsize, auth, enc;
{ {
struct sadb_sa *p; struct sadb_sa *p;
u_int len; u_int len;
@ -2062,13 +1944,8 @@ pfkey_setsadbxreplay(caddr_t buf, caddr_t lim, uint32_t wsize)
* prefixlen is in bits. * prefixlen is in bits.
*/ */
static caddr_t static caddr_t
pfkey_setsadbaddr(buf, lim, exttype, saddr, prefixlen, ul_proto) pfkey_setsadbaddr(caddr_t buf, caddr_t lim, u_int exttype,
caddr_t buf; struct sockaddr *saddr, u_int prefixlen, u_int ul_proto)
caddr_t lim;
u_int exttype;
struct sockaddr *saddr;
u_int prefixlen;
u_int ul_proto;
{ {
struct sadb_address *p; struct sadb_address *p;
u_int len; u_int len;
@ -2096,11 +1973,7 @@ pfkey_setsadbaddr(buf, lim, exttype, saddr, prefixlen, ul_proto)
* OUT: the pointer of buf + len. * OUT: the pointer of buf + len.
*/ */
static caddr_t static caddr_t
pfkey_setsadbkey(buf, lim, type, key, keylen) pfkey_setsadbkey(caddr_t buf, caddr_t lim, u_int type, caddr_t key, u_int keylen)
caddr_t buf;
caddr_t lim;
caddr_t key;
u_int type, keylen;
{ {
struct sadb_key *p; struct sadb_key *p;
u_int len; u_int len;
@ -2127,11 +2000,8 @@ pfkey_setsadbkey(buf, lim, type, key, keylen)
* OUT: the pointer of buf + len. * OUT: the pointer of buf + len.
*/ */
static caddr_t static caddr_t
pfkey_setsadblifetime(buf, lim, type, l_alloc, l_bytes, l_addtime, l_usetime) pfkey_setsadblifetime(caddr_t buf, caddr_t lim, u_int type, u_int32_t l_alloc,
caddr_t buf; u_int32_t l_bytes, u_int32_t l_addtime, u_int32_t l_usetime)
caddr_t lim;
u_int type;
u_int32_t l_alloc, l_bytes, l_addtime, l_usetime;
{ {
struct sadb_lifetime *p; struct sadb_lifetime *p;
u_int len; u_int len;
@ -2173,11 +2043,7 @@ pfkey_setsadblifetime(buf, lim, type, l_alloc, l_bytes, l_addtime, l_usetime)
* `buf' must has been allocated sufficiently. * `buf' must has been allocated sufficiently.
*/ */
static caddr_t static caddr_t
pfkey_setsadbxsa2(buf, lim, mode0, reqid) pfkey_setsadbxsa2(caddr_t buf, caddr_t lim, u_int32_t mode0, u_int32_t reqid)
caddr_t buf;
caddr_t lim;
u_int32_t mode0;
u_int32_t reqid;
{ {
struct sadb_x_sa2 *p; struct sadb_x_sa2 *p;
u_int8_t mode = mode0 & 0xff; u_int8_t mode = mode0 & 0xff;

View File

@ -199,8 +199,7 @@ static struct val2str str_sp_scope[] = {
* dump SADB_MSG formatted. For debugging, you should use kdebug_sadb(). * dump SADB_MSG formatted. For debugging, you should use kdebug_sadb().
*/ */
void void
pfkey_sadump(m) pfkey_sadump(struct sadb_msg *m)
struct sadb_msg *m;
{ {
caddr_t mhp[SADB_EXT_MAX + 1]; caddr_t mhp[SADB_EXT_MAX + 1];
struct sadb_sa *m_sa; struct sadb_sa *m_sa;
@ -517,8 +516,7 @@ pfkey_spdump(struct sadb_msg *m)
* set "ipaddress" to buffer. * set "ipaddress" to buffer.
*/ */
static char * static char *
str_ipaddr(sa) str_ipaddr(struct sockaddr *sa)
struct sockaddr *sa;
{ {
static char buf[NI_MAXHOST]; static char buf[NI_MAXHOST];
const int niflag = NI_NUMERICHOST; const int niflag = NI_NUMERICHOST;
@ -535,8 +533,7 @@ str_ipaddr(sa)
* set "/prefix[port number]" to buffer. * set "/prefix[port number]" to buffer.
*/ */
static char * static char *
str_prefport(family, pref, port, ulp) str_prefport(u_int family, u_int pref, u_int port, u_int ulp)
u_int family, pref, port, ulp;
{ {
static char buf[128]; static char buf[128];
char prefbuf[128]; char prefbuf[128];
@ -574,8 +571,7 @@ str_prefport(family, pref, port, ulp)
} }
static void static void
str_upperspec(ulp, p1, p2) str_upperspec(u_int ulp, u_int p1, u_int p2)
u_int ulp, p1, p2;
{ {
if (ulp == IPSEC_ULPROTO_ANY) if (ulp == IPSEC_ULPROTO_ANY)
printf("any"); printf("any");
@ -607,8 +603,7 @@ str_upperspec(ulp, p1, p2)
* set "Mon Day Time Year" to buffer * set "Mon Day Time Year" to buffer
*/ */
static char * static char *
str_time(t) str_time(time_t t)
time_t t;
{ {
static char buf[128]; static char buf[128];
@ -627,9 +622,7 @@ str_time(t)
} }
static void static void
str_lifetime_byte(x, str) str_lifetime_byte(struct sadb_lifetime *x, char *str)
struct sadb_lifetime *x;
char *str;
{ {
double y; double y;
char *unit; char *unit;