diff options
Diffstat (limited to 'lib/libc/net/ip6opt.c')
-rw-r--r-- | lib/libc/net/ip6opt.c | 41 |
1 files changed, 12 insertions, 29 deletions
diff --git a/lib/libc/net/ip6opt.c b/lib/libc/net/ip6opt.c index cbd49f0c22c..565c0ed3694 100644 --- a/lib/libc/net/ip6opt.c +++ b/lib/libc/net/ip6opt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6opt.c,v 1.1 1999/12/11 08:09:11 itojun Exp $ */ +/* $OpenBSD: ip6opt.c,v 1.2 2005/03/25 13:24:12 otto Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -52,8 +52,7 @@ static void inet6_insert_padopt(u_char *p, int len); * byte, the length byte, and the option data. */ int -inet6_option_space(nbytes) - int nbytes; +inet6_option_space(int nbytes) { nbytes += 2; /* we need space for nxt-hdr and length fields */ return(CMSG_SPACE((nbytes + 7) & ~7)); @@ -65,12 +64,9 @@ inet6_option_space(nbytes) * success or -1 on an error. */ int -inet6_option_init(bp, cmsgp, type) - void *bp; - struct cmsghdr **cmsgp; - int type; +inet6_option_init(void *bp, struct cmsghdr **cmsgp, int type) { - register struct cmsghdr *ch = (struct cmsghdr *)bp; + struct cmsghdr *ch = (struct cmsghdr *)bp; /* argument validation */ if (type != IPV6_HOPOPTS && type != IPV6_DSTOPTS) @@ -95,14 +91,11 @@ inet6_option_init(bp, cmsgp, type) * earlier. It must have a value between 0 and 7, inclusive. */ int -inet6_option_append(cmsg, typep, multx, plusy) - struct cmsghdr *cmsg; - const u_int8_t *typep; - int multx; - int plusy; +inet6_option_append(struct cmsghdr *cmsg, const u_int8_t *typep, int multx, + int plusy) { int padlen, optlen, off; - register u_char *bp = (u_char *)cmsg + cmsg->cmsg_len; + u_char *bp = (u_char *)cmsg + cmsg->cmsg_len; struct ip6_ext *eh = (struct ip6_ext *)CMSG_DATA(cmsg); /* argument validation */ @@ -170,14 +163,10 @@ inet6_option_append(cmsg, typep, multx, plusy) * */ u_int8_t * -inet6_option_alloc(cmsg, datalen, multx, plusy) - struct cmsghdr *cmsg; - int datalen; - int multx; - int plusy; +inet6_option_alloc(struct cmsghdr *cmsg, int datalen, int multx, int plusy) { int padlen, off; - register u_int8_t *bp = (u_char *)cmsg + cmsg->cmsg_len; + u_int8_t *bp = (u_char *)cmsg + cmsg->cmsg_len; u_int8_t *retval; struct ip6_ext *eh = (struct ip6_ext *)CMSG_DATA(cmsg); @@ -237,9 +226,7 @@ inet6_option_alloc(cmsg, datalen, multx, plusy) * (RFC 2292, 6.3.5) */ int -inet6_option_next(cmsg, tptrp) - const struct cmsghdr *cmsg; - u_int8_t **tptrp; +inet6_option_next(const struct cmsghdr *cmsg, u_int8_t **tptrp) { struct ip6_ext *ip6e; int hdrlen, optlen; @@ -295,10 +282,7 @@ inet6_option_next(cmsg, tptrp) * it's a typo. The variable should be type of u_int8_t **. */ int -inet6_option_find(cmsg, tptrp, type) - const struct cmsghdr *cmsg; - u_int8_t **tptrp; - int type; +inet6_option_find(const struct cmsghdr *cmsg, u_int8_t **tptrp, int type) { struct ip6_ext *ip6e; int hdrlen, optlen; @@ -351,8 +335,7 @@ inet6_option_find(cmsg, tptrp, type) * calculated length and the limitation of the buffer. */ static int -ip6optlen(opt, lim) - u_int8_t *opt, *lim; +ip6optlen(u_int8_t *opt, u_int8_t *lim) { int optlen; |