diff options
-rw-r--r-- | sys/netinet6/dest6.c | 6 | ||||
-rw-r--r-- | sys/netinet6/frag6.c | 21 | ||||
-rw-r--r-- | sys/netinet6/icmp6.c | 114 | ||||
-rw-r--r-- | sys/netinet6/in6.c | 131 | ||||
-rw-r--r-- | sys/netinet6/in6_cksum.c | 7 | ||||
-rw-r--r-- | sys/netinet6/in6_gif.c | 16 | ||||
-rw-r--r-- | sys/netinet6/in6_ifattach.c | 52 | ||||
-rw-r--r-- | sys/netinet6/in6_pcb.c | 35 | ||||
-rw-r--r-- | sys/netinet6/ip6_forward.c | 6 | ||||
-rw-r--r-- | sys/netinet6/ip6_input.c | 65 | ||||
-rw-r--r-- | sys/netinet6/ip6_mroute.c | 81 | ||||
-rw-r--r-- | sys/netinet6/ip6_output.c | 125 | ||||
-rw-r--r-- | sys/netinet6/mld6.c | 17 | ||||
-rw-r--r-- | sys/netinet6/nd6.c | 120 | ||||
-rw-r--r-- | sys/netinet6/nd6_nbr.c | 70 | ||||
-rw-r--r-- | sys/netinet6/nd6_rtr.c | 89 | ||||
-rw-r--r-- | sys/netinet6/raw_ip6.c | 25 | ||||
-rw-r--r-- | sys/netinet6/route6.c | 15 | ||||
-rw-r--r-- | sys/netinet6/udp6_output.c | 8 |
19 files changed, 324 insertions, 679 deletions
diff --git a/sys/netinet6/dest6.c b/sys/netinet6/dest6.c index ecc4a1a6287..1e8a5e67417 100644 --- a/sys/netinet6/dest6.c +++ b/sys/netinet6/dest6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dest6.c,v 1.10 2003/05/14 14:24:44 itojun Exp $ */ +/* $OpenBSD: dest6.c,v 1.11 2008/06/11 19:00:50 mcbride Exp $ */ /* $KAME: dest6.c,v 1.25 2001/02/22 01:39:16 itojun Exp $ */ /* @@ -54,9 +54,7 @@ * Destination options header processing. */ int -dest6_input(mp, offp, proto) - struct mbuf **mp; - int *offp, proto; +dest6_input(struct mbuf **mp, int *offp, int proto) { struct mbuf *m = *mp; int off = *offp, dstoptlen, optlen; diff --git a/sys/netinet6/frag6.c b/sys/netinet6/frag6.c index bcf2387b73a..102fcdfb1f8 100644 --- a/sys/netinet6/frag6.c +++ b/sys/netinet6/frag6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: frag6.c,v 1.25 2007/12/09 21:24:58 hshoexer Exp $ */ +/* $OpenBSD: frag6.c,v 1.26 2008/06/11 19:00:50 mcbride Exp $ */ /* $KAME: frag6.c,v 1.40 2002/05/27 21:40:31 itojun Exp $ */ /* @@ -171,9 +171,7 @@ frag6_init() * Fragment input */ int -frag6_input(mp, offp, proto) - struct mbuf **mp; - int *offp, proto; +frag6_input(struct mbuf **mp, int *offp, int proto) { struct mbuf *m = *mp, *t; struct ip6_hdr *ip6; @@ -620,8 +618,7 @@ insert: * associated datagrams. */ void -frag6_freef(q6) - struct ip6q *q6; +frag6_freef(struct ip6q *q6) { struct ip6asfrag *af6, *down6; @@ -665,8 +662,7 @@ frag6_freef(q6) * Like insque, but pointers in middle of structure. */ void -frag6_enq(af6, up6) - struct ip6asfrag *af6, *up6; +frag6_enq(struct ip6asfrag *af6, struct ip6asfrag *up6) { IP6Q_LOCK_CHECK(); @@ -681,8 +677,7 @@ frag6_enq(af6, up6) * To frag6_enq as remque is to insque. */ void -frag6_deq(af6) - struct ip6asfrag *af6; +frag6_deq(struct ip6asfrag *af6) { IP6Q_LOCK_CHECK(); @@ -692,8 +687,7 @@ frag6_deq(af6) } void -frag6_insque(new, old) - struct ip6q *new, *old; +frag6_insque(struct ip6q *new, struct ip6q *old) { IP6Q_LOCK_CHECK(); @@ -705,8 +699,7 @@ frag6_insque(new, old) } void -frag6_remque(p6) - struct ip6q *p6; +frag6_remque(struct ip6q *p6) { IP6Q_LOCK_CHECK(); diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index b3158b756aa..2bf6a7e8cdf 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: icmp6.c,v 1.98 2008/06/11 06:30:36 mcbride Exp $ */ +/* $OpenBSD: icmp6.c,v 1.99 2008/06/11 19:00:50 mcbride Exp $ */ /* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */ /* @@ -189,9 +189,7 @@ icmp6_init() } static void -icmp6_errcount(stat, type, code) - struct icmp6errstat *stat; - int type, code; +icmp6_errcount(struct icmp6errstat *stat, int type, int code) { switch (type) { case ICMP6_DST_UNREACH: @@ -250,8 +248,7 @@ icmp6_errcount(stat, type, code) * Register a Path MTU Discovery callback. */ void -icmp6_mtudisc_callback_register(func) - void (*func)(struct in6_addr *); +icmp6_mtudisc_callback_register(void (*func)(struct in6_addr *)) { struct icmp6_mtudisc_callback *mc; @@ -273,9 +270,7 @@ icmp6_mtudisc_callback_register(func) * Generate an error packet of type error in response to bad IP6 packet. */ void -icmp6_error(m, type, code, param) - struct mbuf *m; - int type, code, param; +icmp6_error(struct mbuf *m, int type, int code, int param) { struct ip6_hdr *oip6, *nip6; struct icmp6_hdr *icmp6; @@ -416,9 +411,7 @@ icmp6_error(m, type, code, param) * Process a received ICMP6 message. */ int -icmp6_input(mp, offp, proto) - struct mbuf **mp; - int *offp, proto; +icmp6_input(struct mbuf **mp, int *offp, int proto) { struct mbuf *m = *mp, *n; struct ip6_hdr *ip6, *nip6; @@ -892,9 +885,7 @@ icmp6_input(mp, offp, proto) } static int -icmp6_notify_error(m, off, icmp6len, code) - struct mbuf *m; - int off, icmp6len, code; +icmp6_notify_error(struct mbuf *m, int off, int icmp6len, int code) { struct icmp6_hdr *icmp6; struct ip6_hdr *eip6; @@ -1097,9 +1088,7 @@ icmp6_notify_error(m, off, icmp6len, code) } void -icmp6_mtudisc_update(ip6cp, validated) - struct ip6ctlparam *ip6cp; - int validated; +icmp6_mtudisc_update(struct ip6ctlparam *ip6cp, int validated) { unsigned long rtcount; struct icmp6_mtudisc_callback *mc; @@ -1177,9 +1166,7 @@ icmp6_mtudisc_update(ip6cp, validated) #define offsetof(type, member) ((size_t)(&((type *)0)->member)) #endif static struct mbuf * -ni6_input(m, off) - struct mbuf *m; - int off; +ni6_input(struct mbuf *m, int off) { struct icmp6_nodeinfo *ni6, *nni6; struct mbuf *n = NULL; @@ -1475,12 +1462,11 @@ ni6_input(m, off) * * XXX names with less than 2 dots (like "foo" or "foo.section") will be * treated as truncated name (two \0 at the end). this is a wild guess. + * + * old - return pascal string if non-zero */ static struct mbuf * -ni6_nametodns(name, namelen, old) - const char *name; - int namelen; - int old; /* return pascal string if non-zero */ +ni6_nametodns(const char *name, int namelen, int old) { struct mbuf *m; char *cp, *ep; @@ -1587,11 +1573,7 @@ ni6_nametodns(name, namelen, old) * XXX upper/lowercase match (see RFC2065) */ static int -ni6_dnsmatch(a, alen, b, blen) - const char *a; - int alen; - const char *b; - int blen; +ni6_dnsmatch(const char *a, int alen, const char *b, int blen) { const char *a0, *b0; int l; @@ -1651,11 +1633,8 @@ ni6_dnsmatch(a, alen, b, blen) * calculate the number of addresses to be returned in the node info reply. */ static int -ni6_addrs(ni6, m, ifpp, subj) - struct icmp6_nodeinfo *ni6; - struct mbuf *m; - struct ifnet **ifpp; - char *subj; +ni6_addrs(struct icmp6_nodeinfo *ni6, struct mbuf *m, struct ifnet **ifpp, + char *subj) { struct ifnet *ifp; struct in6_ifaddr *ifa6; @@ -1742,10 +1721,8 @@ ni6_addrs(ni6, m, ifpp, subj) } static int -ni6_store_addrs(ni6, nni6, ifp0, resid) - struct icmp6_nodeinfo *ni6, *nni6; - struct ifnet *ifp0; - int resid; +ni6_store_addrs(struct icmp6_nodeinfo *ni6, struct icmp6_nodeinfo *nni6, + struct ifnet *ifp0, int resid) { struct ifnet *ifp = ifp0 ? ifp0 : TAILQ_FIRST(&ifnet); struct in6_ifaddr *ifa6; @@ -1882,9 +1859,7 @@ ni6_store_addrs(ni6, nni6, ifp0, resid) * XXX almost dup'ed code with rip6_input. */ static int -icmp6_rip6_input(mp, off) - struct mbuf **mp; - int off; +icmp6_rip6_input(struct mbuf **mp, int off) { struct mbuf *m = *mp; struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); @@ -1976,9 +1951,7 @@ icmp6_rip6_input(mp, off) * up, and to make the code simpler at this stage. */ void -icmp6_reflect(m, off) - struct mbuf *m; - size_t off; +icmp6_reflect(struct mbuf *m, size_t off) { struct ip6_hdr *ip6; struct icmp6_hdr *icmp6; @@ -2154,10 +2127,8 @@ icmp6_fasttimo() } static const char * -icmp6_redirect_diag(src6, dst6, tgt6) - struct in6_addr *src6; - struct in6_addr *dst6; - struct in6_addr *tgt6; +icmp6_redirect_diag(struct in6_addr *src6, struct in6_addr *dst6, + struct in6_addr *tgt6) { static char buf[1024]; snprintf(buf, sizeof(buf), "(src=%s dst=%s tgt=%s)", @@ -2166,9 +2137,7 @@ icmp6_redirect_diag(src6, dst6, tgt6) } void -icmp6_redirect_input(m, off) - struct mbuf *m; - int off; +icmp6_redirect_input(struct mbuf *m, int off) { struct ifnet *ifp = m->m_pkthdr.rcvif; struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); @@ -2384,9 +2353,7 @@ icmp6_redirect_input(m, off) } void -icmp6_redirect_output(m0, rt) - struct mbuf *m0; - struct rtentry *rt; +icmp6_redirect_output(struct mbuf *m0, struct rtentry *rt) { struct ifnet *ifp; /* my outgoing interface */ struct in6_addr *ifp_ll6; @@ -2658,11 +2625,8 @@ fail: * ICMPv6 socket option processing. */ int -icmp6_ctloutput(op, so, level, optname, mp) - int op; - struct socket *so; - int level, optname; - struct mbuf **mp; +icmp6_ctloutput(int op, struct socket *so, int level, int optname, + struct mbuf **mp) { int error = 0; int optlen; @@ -2748,12 +2712,13 @@ icmp6_ctloutput(op, so, level, optname, mp) * limitation. * * XXX per-destination/type check necessary? + * + * dst - not used at this moment + * type - not used at this moment + * code - not used at this moment */ static int -icmp6_ratelimit(dst, type, code) - const struct in6_addr *dst; /* not used at this moment */ - const int type; /* not used at this moment */ - const int code; /* not used at this moment */ +icmp6_ratelimit(const struct in6_addr *dst, const int type, const int code) { int ret; @@ -2770,8 +2735,7 @@ icmp6_ratelimit(dst, type, code) } static struct rtentry * -icmp6_mtudisc_clone(dst) - struct sockaddr *dst; +icmp6_mtudisc_clone(struct sockaddr *dst) { struct rtentry *rt; int error; @@ -2809,9 +2773,7 @@ icmp6_mtudisc_clone(dst) } static void -icmp6_mtudisc_timeout(rt, r) - struct rtentry *rt; - struct rttimer *r; +icmp6_mtudisc_timeout(struct rtentry *rt, struct rttimer *r) { if (rt == NULL) panic("icmp6_mtudisc_timeout: bad route to timeout"); @@ -2832,9 +2794,7 @@ icmp6_mtudisc_timeout(rt, r) } static void -icmp6_redirect_timeout(rt, r) - struct rtentry *rt; - struct rttimer *r; +icmp6_redirect_timeout(struct rtentry *rt, struct rttimer *r) { if (rt == NULL) panic("icmp6_redirect_timeout: bad route to timeout"); @@ -2857,15 +2817,9 @@ icmp6_redirect_timeout(rt, r) int *icmpv6ctl_vars[ICMPV6CTL_MAXID] = ICMPV6CTL_VARS; int -icmp6_sysctl(name, namelen, oldp, oldlenp, newp, newlen) - int *name; - u_int namelen; - void *oldp; - size_t *oldlenp; - void *newp; - size_t newlen; +icmp6_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, + void *newp, size_t newlen) { - /* All sysctl names at this level are terminal. */ if (namelen != 1) return ENOTDIR; diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index fc24a021ec4..6c57d476969 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6.c,v 1.76 2008/06/11 06:30:36 mcbride Exp $ */ +/* $OpenBSD: in6.c,v 1.77 2008/06/11 19:00:50 mcbride Exp $ */ /* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */ /* @@ -285,9 +285,7 @@ in6_ifremloop(struct ifaddr *ifa) } int -in6_mask2len(mask, lim0) - struct in6_addr *mask; - u_char *lim0; +in6_mask2len(struct in6_addr *mask, u_char *lim0) { int x = 0, y; u_char *lim = lim0, *p; @@ -326,12 +324,8 @@ in6_mask2len(mask, lim0) #define ia62ifa(ia6) (&((ia6)->ia_ifa)) int -in6_control(so, cmd, data, ifp, p) - struct socket *so; - u_long cmd; - caddr_t data; - struct ifnet *ifp; - struct proc *p; +in6_control(struct socket *so, u_long cmd, caddr_t data, + struct ifnet *ifp, struct proc *p) { struct in6_ifreq *ifr = (struct in6_ifreq *)data; struct in6_ifaddr *ia = NULL; @@ -773,10 +767,8 @@ in6_control(so, cmd, data, ifp, p) * XXX: should this be performed under splnet()? */ int -in6_update_ifa(ifp, ifra, ia) - struct ifnet *ifp; - struct in6_aliasreq *ifra; - struct in6_ifaddr *ia; +in6_update_ifa(struct ifnet *ifp, struct in6_aliasreq *ifra, + struct in6_ifaddr *ia) { int error = 0, hostIsNew = 0, plen = -1; struct in6_ifaddr *oia; @@ -1225,8 +1217,7 @@ in6_update_ifa(ifp, ifra, ia) } void -in6_purgeaddr(ifa) - struct ifaddr *ifa; +in6_purgeaddr(struct ifaddr *ifa) { struct ifnet *ifp = ifa->ifa_ifp; struct in6_ifaddr *ia = (struct in6_ifaddr *) ifa; @@ -1270,9 +1261,7 @@ in6_purgeaddr(ifa) } static void -in6_unlink_ifa(ia, ifp) - struct in6_ifaddr *ia; - struct ifnet *ifp; +in6_unlink_ifa(struct in6_ifaddr *ia, struct ifnet *ifp) { struct in6_ifaddr *oia; int s = splnet(); @@ -1326,8 +1315,7 @@ in6_unlink_ifa(ia, ifp) } void -in6_purgeif(ifp) - struct ifnet *ifp; +in6_purgeif(struct ifnet *ifp) { struct ifaddr *ifa, *nifa; @@ -1366,12 +1354,8 @@ in6_purgeif(ifp) * address encoding scheme. (see figure on page 8) */ static int -in6_lifaddr_ioctl(so, cmd, data, ifp, p) - struct socket *so; - u_long cmd; - caddr_t data; - struct ifnet *ifp; - struct proc *p; +in6_lifaddr_ioctl(struct socket *so, u_long cmd, caddr_t data, + struct ifnet *ifp, struct proc *p) { struct if_laddrreq *iflr = (struct if_laddrreq *)data; struct ifaddr *ifa; @@ -1587,11 +1571,8 @@ in6_lifaddr_ioctl(so, cmd, data, ifp, p) * and routing table entry. */ static int -in6_ifinit(ifp, ia, sin6, newhost) - struct ifnet *ifp; - struct in6_ifaddr *ia; - struct sockaddr_in6 *sin6; - int newhost; +in6_ifinit(struct ifnet *ifp, struct in6_ifaddr *ia, + struct sockaddr_in6 *sin6, int newhost) { int error = 0, plen, ifacount = 0; int s = splnet(); @@ -1657,8 +1638,7 @@ in6_ifinit(ifp, ia, sin6, newhost) * such time as this interface is reconfigured for IPv6. */ void -in6_savemkludge(oia) - struct in6_ifaddr *oia; +in6_savemkludge(struct in6_ifaddr *oia) { struct in6_ifaddr *ia; struct in6_multi *in6m, *next; @@ -1699,9 +1679,7 @@ in6_savemkludge(oia) * then we re-attach it to the first address configured on the i/f. */ void -in6_restoremkludge(ia, ifp) - struct in6_ifaddr *ia; - struct ifnet *ifp; +in6_restoremkludge(struct in6_ifaddr *ia, struct ifnet *ifp) { struct multi6_kludge *mk; @@ -1736,8 +1714,7 @@ in6_restoremkludge(ia, ifp) * it is a global function. */ void -in6_createmkludge(ifp) - struct ifnet *ifp; +in6_createmkludge(struct ifnet *ifp) { struct multi6_kludge *mk; @@ -1755,8 +1732,7 @@ in6_createmkludge(ifp) } void -in6_purgemkludge(ifp) - struct ifnet *ifp; +in6_purgemkludge(struct ifnet *ifp) { struct multi6_kludge *mk; struct in6_multi *in6m; @@ -1778,11 +1754,8 @@ in6_purgemkludge(ifp) * Add an address to the list of IP6 multicast addresses for a * given interface. */ -struct in6_multi * -in6_addmulti(maddr6, ifp, errorp) - struct in6_addr *maddr6; - struct ifnet *ifp; - int *errorp; +struct in6_multi * +in6_addmulti(struct in6_addr *maddr6, struct ifnet *ifp, int *errorp) { struct in6_ifaddr *ia; struct in6_ifreq ifr; @@ -1859,8 +1832,7 @@ in6_addmulti(maddr6, ifp, errorp) * Delete a multicast address record. */ void -in6_delmulti(in6m) - struct in6_multi *in6m; +in6_delmulti(struct in6_multi *in6m) { struct in6_ifreq ifr; int s = splsoftnet(); @@ -1896,10 +1868,7 @@ in6_delmulti(in6m) } struct in6_multi_mship * -in6_joingroup(ifp, addr, errorp) - struct ifnet *ifp; - struct in6_addr *addr; - int *errorp; +in6_joingroup(struct ifnet *ifp, struct in6_addr *addr, int *errorp) { struct in6_multi_mship *imm; @@ -1932,9 +1901,7 @@ in6_leavegroup(imm) * Find an IPv6 interface link-local address specific to an interface. */ struct in6_ifaddr * -in6ifa_ifpforlinklocal(ifp, ignoreflags) - struct ifnet *ifp; - int ignoreflags; +in6ifa_ifpforlinklocal(struct ifnet *ifp, int ignoreflags) { struct ifaddr *ifa; @@ -1959,9 +1926,7 @@ in6ifa_ifpforlinklocal(ifp, ignoreflags) * find the internet address corresponding to a given interface and address. */ struct in6_ifaddr * -in6ifa_ifpwithaddr(ifp, addr) - struct ifnet *ifp; - struct in6_addr *addr; +in6ifa_ifpwithaddr(struct ifnet *ifp, struct in6_addr *addr) { struct ifaddr *ifa; @@ -1983,8 +1948,7 @@ in6ifa_ifpwithaddr(ifp, addr) static char digits[] = "0123456789abcdef"; static int ip6round = 0; char * -ip6_sprintf(addr) - struct in6_addr *addr; +ip6_sprintf(struct in6_addr *addr) { static char ip6buf[8][48]; int i; @@ -2035,8 +1999,7 @@ ip6_sprintf(addr) * Get a scope of the address. Node-local, link-local, site-local or global. */ int -in6_addrscope (addr) -struct in6_addr *addr; +in6_addrscope(struct in6_addr *addr) { int scope; @@ -2090,10 +2053,13 @@ struct in6_addr *addr; return IPV6_ADDR_SCOPE_GLOBAL; } +/* + * ifp - must not be NULL + * addr - must not be NULL + */ + int -in6_addr2scopeid(ifp, addr) - struct ifnet *ifp; /* must not be NULL */ - struct in6_addr *addr; /* must not be NULL */ +in6_addr2scopeid(struct ifnet *ifp, struct in6_addr *addr) { int scope = in6_addrscope(addr); @@ -2112,8 +2078,7 @@ in6_addr2scopeid(ifp, addr) } int -in6_is_addr_deprecated(sa6) - struct sockaddr_in6 *sa6; +in6_is_addr_deprecated(struct sockaddr_in6 *sa6) { struct in6_ifaddr *ia; @@ -2134,8 +2099,7 @@ in6_is_addr_deprecated(sa6) * hard coding... */ int -in6_matchlen(src, dst) -struct in6_addr *src, *dst; +in6_matchlen(struct in6_addr *src, struct in6_addr *dst) { int match = 0; u_char *s = (u_char *)src, *d = (u_char *)dst; @@ -2154,9 +2118,7 @@ struct in6_addr *src, *dst; } int -in6_are_prefix_equal(p1, p2, len) - struct in6_addr *p1, *p2; - int len; +in6_are_prefix_equal(struct in6_addr *p1, struct in6_addr *p2, int len) { int bytelen, bitlen; @@ -2182,9 +2144,7 @@ in6_are_prefix_equal(p1, p2, len) } void -in6_prefixlen2mask(maskp, len) - struct in6_addr *maskp; - int len; +in6_prefixlen2mask(struct in6_addr *maskp, int len) { u_char maskarray[8] = {0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff}; int bytelen, bitlen, i; @@ -2210,9 +2170,7 @@ in6_prefixlen2mask(maskp, len) * return the best address out of the same scope */ struct in6_ifaddr * -in6_ifawithscope(oifp, dst) - struct ifnet *oifp; - struct in6_addr *dst; +in6_ifawithscope(struct ifnet *oifp, struct in6_addr *dst) { int dst_scope = in6_addrscope(dst), src_scope, best_scope = 0; int blen = -1; @@ -2458,9 +2416,7 @@ in6_ifawithscope(oifp, dst) * found, return the first valid address from designated IF. */ struct in6_ifaddr * -in6_ifawithifp(ifp, dst) - struct ifnet *ifp; - struct in6_addr *dst; +in6_ifawithifp(struct ifnet *ifp, struct in6_addr *dst) { int dst_scope = in6_addrscope(dst), blen = -1, tlen; struct ifaddr *ifa; @@ -2540,8 +2496,7 @@ in6_ifawithifp(ifp, dst) * perform DAD when interface becomes IFF_UP. */ void -in6_if_up(ifp) - struct ifnet *ifp; +in6_if_up(struct ifnet *ifp) { struct ifaddr *ifa; struct in6_ifaddr *ia; @@ -2563,8 +2518,7 @@ in6_if_up(ifp) } int -in6if_do_dad(ifp) - struct ifnet *ifp; +in6if_do_dad(struct ifnet *ifp) { if ((ifp->if_flags & IFF_LOOPBACK) != 0) return (0); @@ -2620,8 +2574,7 @@ in6_setmaxmtu() } void * -in6_domifattach(ifp) - struct ifnet *ifp; +in6_domifattach(struct ifnet *ifp) { struct in6_ifextra *ext; @@ -2640,9 +2593,7 @@ in6_domifattach(ifp) } void -in6_domifdetach(ifp, aux) - struct ifnet *ifp; - void *aux; +in6_domifdetach(struct ifnet *ifp, void *aux) { struct in6_ifextra *ext = (struct in6_ifextra *)aux; diff --git a/sys/netinet6/in6_cksum.c b/sys/netinet6/in6_cksum.c index 164b2859ffa..a98b2004b6d 100644 --- a/sys/netinet6/in6_cksum.c +++ b/sys/netinet6/in6_cksum.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6_cksum.c,v 1.14 2006/11/17 01:11:23 itojun Exp $ */ +/* $OpenBSD: in6_cksum.c,v 1.15 2008/06/11 19:00:50 mcbride Exp $ */ /* $KAME: in6_cksum.c,v 1.10 2000/12/03 00:53:59 itojun Exp $ */ /* @@ -85,10 +85,7 @@ */ int -in6_cksum(m, nxt, off, len) - struct mbuf *m; - u_int8_t nxt; - u_int32_t off, len; +in6_cksum(struct mbuf *m, u_int8_t nxt, u_int32_t off, u_int32_t len) { u_int16_t *w; int sum = 0; diff --git a/sys/netinet6/in6_gif.c b/sys/netinet6/in6_gif.c index 886b4f4d881..939d1c1ad89 100644 --- a/sys/netinet6/in6_gif.c +++ b/sys/netinet6/in6_gif.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6_gif.c,v 1.25 2007/06/01 00:52:38 henning Exp $ */ +/* $OpenBSD: in6_gif.c,v 1.26 2008/06/11 19:00:50 mcbride Exp $ */ /* $KAME: in6_gif.c,v 1.43 2001/01/22 07:27:17 itojun Exp $ */ /* @@ -68,14 +68,14 @@ #define offsetof(s, e) ((int)&((s *)0)->e) #endif +/* + * family - family of the packet to be encapsulate. + */ int -in6_gif_output(ifp, family, m) - struct ifnet *ifp; - int family; /* family of the packet to be encapsulate. */ - struct mbuf *m; +in6_gif_output(struct ifnet *ifp, int family, struct mbuf *m) { struct gif_softc *sc = (struct gif_softc*)ifp; - struct sockaddr_in6 *dst = (struct sockaddr_in6 *)&sc->gif_ro6.ro_dst; + struct sockaddr_in6 *dst = (struct sockaddr_in6 *)&sc->gif_ro6.ro_dst; struct sockaddr_in6 *sin6_src = (struct sockaddr_in6 *)sc->gif_psrc; struct sockaddr_in6 *sin6_dst = (struct sockaddr_in6 *)sc->gif_pdst; struct tdb tdb; @@ -171,9 +171,7 @@ in6_gif_output(ifp, family, m) return error; } -int in6_gif_input(mp, offp, proto) - struct mbuf **mp; - int *offp, proto; +int in6_gif_input(struct mbuf **mp, int *offp, int proto) { struct mbuf *m = *mp; struct gif_softc *sc; diff --git a/sys/netinet6/in6_ifattach.c b/sys/netinet6/in6_ifattach.c index f8ad0e655a7..61540994c94 100644 --- a/sys/netinet6/in6_ifattach.c +++ b/sys/netinet6/in6_ifattach.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6_ifattach.c,v 1.46 2008/05/11 08:13:02 claudio Exp $ */ +/* $OpenBSD: in6_ifattach.c,v 1.47 2008/06/11 19:00:50 mcbride Exp $ */ /* $KAME: in6_ifattach.c,v 1.124 2001/07/18 08:32:51 jinmei Exp $ */ /* @@ -84,11 +84,11 @@ static int in6_ifattach_loopback(struct ifnet *); * The goal here is to get an interface identifier that is * (1) random enough and (2) does not change across reboot. * We currently use MD5(hostname) for it. + * + * in6 - upper 64bits are preserved */ static int -get_rand_ifid(ifp, in6) - struct ifnet *ifp; - struct in6_addr *in6; /* upper 64bits are preserved */ +get_rand_ifid(struct ifnet *ifp, struct in6_addr *in6) { MD5_CTX ctxt; u_int8_t digest[16]; @@ -121,11 +121,11 @@ get_rand_ifid(ifp, in6) /* * Get interface identifier for the specified interface. * XXX assumes single sockaddr_dl (AF_LINK address) per an interface + * + * in6 - upper 64bits are preserved */ static int -get_hw_ifid(ifp, in6) - struct ifnet *ifp; - struct in6_addr *in6; /* upper 64bits are preserved */ +get_hw_ifid(struct ifnet *ifp, struct in6_addr *in6) { struct ifaddr *ifa; struct sockaddr_dl *sdl; @@ -238,12 +238,11 @@ found: * Get interface identifier for the specified interface. If it is not * available on ifp0, borrow interface identifier from other information * sources. + * + * altifp - secondary EUI64 source */ static int -get_ifid(ifp0, altifp, in6) - struct ifnet *ifp0; - struct ifnet *altifp; /* secondary EUI64 source */ - struct in6_addr *in6; +get_ifid(struct ifnet *ifp0, struct ifnet *altifp, struct in6_addr *in6) { struct ifnet *ifp; @@ -299,10 +298,12 @@ success: return 0; } +/* + * altifp - secondary EUI64 source + */ + int -in6_ifattach_linklocal(ifp, altifp) - struct ifnet *ifp; - struct ifnet *altifp; /*secondary EUI64 source*/ +in6_ifattach_linklocal(struct ifnet *ifp, struct ifnet *altifp) { struct in6_ifaddr *ia; struct in6_aliasreq ifra; @@ -431,9 +432,12 @@ in6_ifattach_linklocal(ifp, altifp) return 0; } +/* + * ifp - must be IFT_LOOP + */ + static int -in6_ifattach_loopback(ifp) - struct ifnet *ifp; /* must be IFT_LOOP */ +in6_ifattach_loopback(struct ifnet *ifp) { struct in6_aliasreq ifra; int error; @@ -490,11 +494,8 @@ in6_ifattach_loopback(ifp) * when ifp == NULL, the caller is responsible for filling scopeid. */ int -in6_nigroup(ifp, name, namelen, sa6) - struct ifnet *ifp; - const char *name; - int namelen; - struct sockaddr_in6 *sa6; +in6_nigroup(struct ifnet *ifp, const char *name, int namelen, + struct sockaddr_in6 *sa6) { const char *p; u_int8_t *q; @@ -542,11 +543,11 @@ in6_nigroup(ifp, name, namelen, sa6) * XXX multiple loopback interface needs more care. for instance, * nodelocal address needs to be configured onto only one of them. * XXX multiple link-local address case + * + * altifp - secondary EUI64 source */ void -in6_ifattach(ifp, altifp) - struct ifnet *ifp; - struct ifnet *altifp; /* secondary EUI64 source */ +in6_ifattach(struct ifnet *ifp, struct ifnet *altifp) { struct in6_ifaddr *ia; struct in6_addr in6; @@ -627,8 +628,7 @@ in6_ifattach(ifp, altifp) * NOTE: in6_ifdetach() does not support loopback if at this moment. */ void -in6_ifdetach(ifp) - struct ifnet *ifp; +in6_ifdetach(struct ifnet *ifp) { struct in6_ifaddr *ia, *oia; struct ifaddr *ifa, *next; diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index e9bc2efb6c2..3ff0a17d3ba 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6_pcb.c,v 1.46 2008/05/23 15:51:12 thib Exp $ */ +/* $OpenBSD: in6_pcb.c,v 1.47 2008/06/11 19:00:50 mcbride Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -162,10 +162,7 @@ u_char inet6ctlerrmap[PRC_NCMDS] = { * Bind an address (or at least a port) to an PF_INET6 socket. */ int -in6_pcbbind(inp, nam, p) - struct inpcb *inp; - struct mbuf *nam; - struct proc *p; +in6_pcbbind(struct inpcb *inp, struct mbuf *nam, struct proc *p) { struct socket *so = inp->inp_socket; @@ -300,10 +297,7 @@ in6_pcbbind(inp, nam, p) } int -in6_pcbsetport(laddr, inp, p) - struct in6_addr *laddr; - struct inpcb *inp; - struct proc *p; +in6_pcbsetport(struct in6_addr *laddr, struct inpcb *inp, struct proc *p) { struct socket *so = inp->inp_socket; struct inpcbtable *table = inp->inp_table; @@ -401,9 +395,7 @@ in6_pcbsetport(laddr, inp, p) * I believe this has to be called at splnet(). */ int -in6_pcbconnect(inp, nam) - struct inpcb *inp; - struct mbuf *nam; +in6_pcbconnect(struct inpcb *inp, struct mbuf *nam) { struct in6_addr *in6a = NULL; struct sockaddr_in6 *sin6 = mtod(nam, struct sockaddr_in6 *); @@ -493,14 +485,9 @@ in6_pcbconnect(inp, nam) * Must be called at splnet. */ int -in6_pcbnotify(head, dst, fport_arg, src, lport_arg, cmd, cmdarg, notify) - struct inpcbtable *head; - struct sockaddr *dst, *src; - uint fport_arg; - uint lport_arg; - int cmd; - void *cmdarg; - void (*notify)(struct inpcb *, int); +in6_pcbnotify(struct inpcbtable *head, struct sockaddr *dst, + uint fport_arg, struct sockaddr *src, uint lport_arg, int cmd, + void *cmdarg, void (*notify)(struct inpcb *, int)) { struct inpcb *inp, *ninp; u_short fport = fport_arg, lport = lport_arg; @@ -632,9 +619,7 @@ in6_pcbnotify(head, dst, fport_arg, src, lport_arg, cmd, cmdarg, notify) * This services the getsockname(2) call. */ int -in6_setsockaddr(inp, nam) - struct inpcb *inp; - struct mbuf *nam; +in6_setsockaddr(struct inpcb *inp, struct mbuf *nam) { struct sockaddr_in6 *sin6; @@ -657,9 +642,7 @@ in6_setsockaddr(inp, nam) * This services the getpeername(2) call. */ int -in6_setpeeraddr(inp, nam) - struct inpcb *inp; - struct mbuf *nam; +in6_setpeeraddr(struct inpcb *inp, struct mbuf *nam) { struct sockaddr_in6 *sin6; diff --git a/sys/netinet6/ip6_forward.c b/sys/netinet6/ip6_forward.c index 3a215794d73..60942fd9e5f 100644 --- a/sys/netinet6/ip6_forward.c +++ b/sys/netinet6/ip6_forward.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_forward.c,v 1.39 2007/06/01 00:52:38 henning Exp $ */ +/* $OpenBSD: ip6_forward.c,v 1.40 2008/06/11 19:00:50 mcbride Exp $ */ /* $KAME: ip6_forward.c,v 1.75 2001/06/29 12:42:13 jinmei Exp $ */ /* @@ -85,9 +85,7 @@ int ip6_forward_rtableid; */ void -ip6_forward(m, srcrt) - struct mbuf *m; - int srcrt; +ip6_forward(struct mbuf *m, int srcrt) { struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); struct sockaddr_in6 *dst; diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c index fb99a69a989..d4f360847ec 100644 --- a/sys/netinet6/ip6_input.c +++ b/sys/netinet6/ip6_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_input.c,v 1.85 2008/06/09 22:47:42 djm Exp $ */ +/* $OpenBSD: ip6_input.c,v 1.86 2008/06/11 19:00:50 mcbride Exp $ */ /* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */ /* @@ -167,8 +167,7 @@ ip6_init() } static void -ip6_init2(dummy) - void *dummy; +ip6_init2(void *dummy) { /* nd6_timer_init */ @@ -200,8 +199,7 @@ extern struct route_in6 ip6_forward_rt; extern int ip6_forward_rtableid; void -ip6_input(m) - struct mbuf *m; +ip6_input(struct mbuf *m) { struct ip6_hdr *ip6; int off = sizeof(struct ip6_hdr), nest; @@ -794,13 +792,12 @@ ip6_check_rh0hdr(struct mbuf *m) /* * Hop-by-Hop options header processing. If a valid jumbo payload option is * included, the real payload length will be stored in plenp. + * + * rtalertp - XXX: should be stored in a more smart way */ static int -ip6_hopopts_input(plenp, rtalertp, mp, offp) - u_int32_t *plenp; - u_int32_t *rtalertp; /* XXX: should be stored more smart way */ - struct mbuf **mp; - int *offp; +ip6_hopopts_input(u_int32_t *plenp, u_int32_t *rtalertp, struct mbuf **mp, + int *offp) { struct mbuf *m = *mp; int off = *offp, hbhlen; @@ -845,12 +842,8 @@ ip6_hopopts_input(plenp, rtalertp, mp, offp) * opthead + hbhlen is located in continuous memory region. */ int -ip6_process_hopopts(m, opthead, hbhlen, rtalertp, plenp) - struct mbuf *m; - u_int8_t *opthead; - int hbhlen; - u_int32_t *rtalertp; - u_int32_t *plenp; +ip6_process_hopopts(struct mbuf *m, u_int8_t *opthead, int hbhlen, + u_int32_t *rtalertp, u_int32_t *plenp) { struct ip6_hdr *ip6; int optlen = 0; @@ -982,10 +975,7 @@ ip6_process_hopopts(m, opthead, hbhlen, rtalertp, plenp) * is not continuous in order to return an ICMPv6 error. */ int -ip6_unknown_opt(optp, m, off) - u_int8_t *optp; - struct mbuf *m; - int off; +ip6_unknown_opt(u_int8_t *optp, struct mbuf *m, int off) { struct ip6_hdr *ip6; @@ -1027,10 +1017,7 @@ ip6_unknown_opt(optp, m, off) * you are using IP6_EXTHDR_CHECK() not m_pulldown()) */ void -ip6_savecontrol(in6p, m, mp) - struct inpcb *in6p; - struct mbuf *m; - struct mbuf **mp; +ip6_savecontrol(struct inpcb *in6p, struct mbuf *m, struct mbuf **mp) { #define IS2292(x, y) ((in6p->in6p_flags & IN6P_RFC2292) ? (x) : (y)) # define in6p_flags inp_flags @@ -1240,10 +1227,7 @@ ip6_savecontrol(in6p, m, mp) * contains the result, or NULL on error. */ static struct mbuf * -ip6_pullexthdr(m, off, nxt) - struct mbuf *m; - size_t off; - int nxt; +ip6_pullexthdr(struct mbuf *m, size_t off, int nxt) { struct ip6_ext ip6e; size_t elen; @@ -1302,9 +1286,7 @@ ip6_pullexthdr(m, off, nxt) * we develop `neater' mechanism to process extension headers. */ u_int8_t * -ip6_get_prevhdr(m, off) - struct mbuf *m; - int off; +ip6_get_prevhdr(struct mbuf *m, int off) { struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); @@ -1343,11 +1325,7 @@ ip6_get_prevhdr(m, off) * get next header offset. m will be retained. */ int -ip6_nexthdr(m, off, proto, nxtp) - struct mbuf *m; - int off; - int proto; - int *nxtp; +ip6_nexthdr(struct mbuf *m, int off, int proto, int *nxtp) { struct ip6_hdr ip6; struct ip6_ext ip6e; @@ -1425,11 +1403,7 @@ ip6_nexthdr(m, off, proto, nxtp) * get offset for the last header in the chain. m will be kept untainted. */ int -ip6_lasthdr(m, off, proto, nxtp) - struct mbuf *m; - int off; - int proto; - int *nxtp; +ip6_lasthdr(struct mbuf *m, int off, int proto, int *nxtp) { int newoff; int nxt; @@ -1471,13 +1445,8 @@ u_char inet6ctlerrmap[PRC_NCMDS] = { int *ipv6ctl_vars[IPV6CTL_MAXID] = IPV6CTL_VARS; int -ip6_sysctl(name, namelen, oldp, oldlenp, newp, newlen) - int *name; - u_int namelen; - void *oldp; - size_t *oldlenp; - void *newp; - size_t newlen; +ip6_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, + void *newp, size_t newlen) { #ifdef MROUTING extern int ip6_mrtproto; diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c index 5b4e46243b9..d780b2f7977 100644 --- a/sys/netinet6/ip6_mroute.c +++ b/sys/netinet6/ip6_mroute.c @@ -258,10 +258,7 @@ static struct timeout expire_upcalls_ch; * Handle MRT setsockopt commands to modify the multicast routing tables. */ int -ip6_mrouter_set(cmd, so, m) - int cmd; - struct socket *so; - struct mbuf *m; +ip6_mrouter_set(int cmd, struct socket *so, struct mbuf *m) { if (cmd != MRT6_INIT && so != ip6_mrouter) return (EACCES); @@ -305,10 +302,7 @@ ip6_mrouter_set(cmd, so, m) * Handle MRT getsockopt commands */ int -ip6_mrouter_get(cmd, so, m) - int cmd; - struct socket *so; - struct mbuf **m; +ip6_mrouter_get(int cmd, struct socket *so, struct mbuf **m) { struct mbuf *mb; @@ -329,9 +323,7 @@ ip6_mrouter_get(cmd, so, m) * Handle ioctl commands to obtain information from the cache */ int -mrt6_ioctl(cmd, data) - int cmd; - caddr_t data; +mrt6_ioctl(int cmd, caddr_t data) { switch (cmd) { @@ -348,8 +340,7 @@ mrt6_ioctl(cmd, data) * returns the packet, byte, rpf-failure count for the source group provided */ static int -get_sg_cnt(req) - struct sioc_sg_req6 *req; +get_sg_cnt(struct sioc_sg_req6 *req) { struct mf6c *rt; int s; @@ -375,8 +366,7 @@ get_sg_cnt(req) * returns the input and output packet and byte counts on the mif provided */ static int -get_mif6_cnt(req) - struct sioc_mif_req6 *req; +get_mif6_cnt(struct sioc_mif_req6 *req) { mifi_t mifi = req->mifi; @@ -395,8 +385,7 @@ get_mif6_cnt(req) * Get PIM processiong global */ static int -get_pim6(m) - struct mbuf *m; +get_pim6(struct mbuf *m) { int *i; @@ -408,8 +397,7 @@ get_pim6(m) } static int -set_pim6(i) - int *i; +set_pim6(int *i) { if ((*i != 1) && (*i != 0)) return EINVAL; @@ -423,10 +411,7 @@ set_pim6(i) * Enable multicast routing */ static int -ip6_mrouter_init(so, v, cmd) - struct socket *so; - int v; - int cmd; +ip6_mrouter_init(struct socket *so, int v, int cmd) { #ifdef MRT6DEBUG if (mrt6debug) @@ -560,8 +545,7 @@ ip6_mrouter_done() } void -ip6_mrouter_detach(ifp) - struct ifnet *ifp; +ip6_mrouter_detach(struct ifnet *ifp) { struct rtdetq *rte; struct mf6c *mfc; @@ -595,8 +579,7 @@ ip6_mrouter_detach(ifp) * Add a mif to the mif table */ static int -add_m6if(mifcp) - struct mif6ctl *mifcp; +add_m6if(struct mif6ctl *mifcp) { struct mif6 *mifp; struct ifnet *ifp; @@ -684,8 +667,7 @@ add_m6if(mifcp) * Delete a mif from the mif table */ static int -del_m6if(mifip) - mifi_t *mifip; +del_m6if(mifi_t *mifip) { struct mif6 *mifp = mif6table + *mifip; mifi_t mifi; @@ -738,8 +720,7 @@ del_m6if(mifip) * Add an mfc entry */ static int -add_m6fc(mfccp) - struct mf6cctl *mfccp; +add_m6fc(struct mf6cctl *mfccp) { struct mf6c *rt; u_long hash; @@ -898,8 +879,7 @@ add_m6fc(mfccp) * collect delay statistics on the upcalls */ static void -collate(t) - struct timeval *t; +collate(struct timeval *t) { u_long d; struct timeval tp; @@ -924,8 +904,7 @@ collate(t) * Delete an mfc entry */ static int -del_m6fc(mfccp) - struct mf6cctl *mfccp; +del_m6fc(struct mf6cctl *mfccp) { struct sockaddr_in6 origin; struct sockaddr_in6 mcastgrp; @@ -972,10 +951,7 @@ del_m6fc(mfccp) } static int -socket_send(s, mm, src) - struct socket *s; - struct mbuf *mm; - struct sockaddr_in6 *src; +socket_send(struct socket *s, struct mbuf *mm, struct sockaddr_in6 *src) { if (s) { if (sbappendaddr(&s->so_rcv, @@ -1001,10 +977,7 @@ socket_send(s, mm, src) */ int -ip6_mforward(ip6, ifp, m) - struct ip6_hdr *ip6; - struct ifnet *ifp; - struct mbuf *m; +ip6_mforward(struct ip6_hdr *ip6, struct ifnet *ifp, struct mbuf *m) { struct mf6c *rt; struct mif6 *mifp; @@ -1271,8 +1244,7 @@ ip6_mforward(ip6, ifp, m) * Call from the Slow Timeout mechanism, every half second. */ static void -expire_upcalls(unused) - void *unused; +expire_upcalls(void *unused) { struct rtdetq *rte; struct mf6c *mfc, **nptr; @@ -1330,10 +1302,7 @@ expire_upcalls(unused) * Packet forwarding routine once entry in the cache is made */ static int -ip6_mdq(m, ifp, rt) - struct mbuf *m; - struct ifnet *ifp; - struct mf6c *rt; +ip6_mdq(struct mbuf *m, struct ifnet *ifp, struct mf6c *rt) { struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); mifi_t mifi, iif; @@ -1505,10 +1474,7 @@ ip6_mdq(m, ifp, rt) } static void -phyint_send(ip6, mifp, m) - struct ip6_hdr *ip6; - struct mif6 *mifp; - struct mbuf *m; +phyint_send(struct ip6_hdr *ip6, struct mif6 *mifp, struct mbuf *m) { struct mbuf *mb_copy; struct ifnet *ifp = mifp->m6_ifp; @@ -1615,10 +1581,7 @@ phyint_send(ip6, mifp, m) } static int -register_send(ip6, mif, m) - struct ip6_hdr *ip6; - struct mif6 *mif; - struct mbuf *m; +register_send(struct ip6_hdr *ip6, struct mif6 *mif, struct mbuf *m) { struct mbuf *mm; int i, len = m->m_pkthdr.len; @@ -1689,9 +1652,7 @@ register_send(ip6, mif, m) * is stripped off, and the inner packet is passed to register_mforward. */ int -pim6_input(mp, offp, proto) - struct mbuf **mp; - int *offp, proto; +pim6_input(struct mbuf **mp, int *offp, int proto) { struct pim *pim; /* pointer to a pim struct */ struct ip6_hdr *ip6; diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index d8faf8bbabf..93d6cd418cb 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_output.c,v 1.101 2008/06/09 22:47:42 djm Exp $ */ +/* $OpenBSD: ip6_output.c,v 1.102 2008/06/11 19:00:50 mcbride Exp $ */ /* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */ /* @@ -147,16 +147,13 @@ struct idgen32_ctx ip6_id_ctx; * type of "mtu": rt_rmx.rmx_mtu is u_long, ifnet.ifr_mtu is int, and * nd_ifinfo.linkmtu is u_int32_t. so we use u_long to hold largest one, * which is rt_rmx.rmx_mtu. + * + * ifpp - XXX: just for statistics */ int -ip6_output(m0, opt, ro, flags, im6o, ifpp, inp) - struct mbuf *m0; - struct ip6_pktopts *opt; - struct route_in6 *ro; - int flags; - struct ip6_moptions *im6o; - struct ifnet **ifpp; /* XXX: just for statistics */ - struct inpcb *inp; +ip6_output(struct mbuf *m0, struct ip6_pktopts *opt, struct route_in6 *ro, + int flags, struct ip6_moptions *im6o, struct ifnet **ifpp, + struct inpcb *inp) { struct ip6_hdr *ip6, *mhip6; struct ifnet *ifp, *origifp = NULL; @@ -1005,10 +1002,7 @@ bad: } static int -ip6_copyexthdr(mp, hdr, hlen) - struct mbuf **mp; - caddr_t hdr; - int hlen; +ip6_copyexthdr(struct mbuf **mp, caddr_t hdr, int hlen) { struct mbuf *m; @@ -1038,9 +1032,7 @@ ip6_copyexthdr(mp, hdr, hlen) * Insert jumbo payload option. */ static int -ip6_insert_jumboopt(exthdrs, plen) - struct ip6_exthdrs *exthdrs; - u_int32_t plen; +ip6_insert_jumboopt(struct ip6_exthdrs *exthdrs, u_int32_t plen) { struct mbuf *mopt; u_int8_t *optbuf; @@ -1135,10 +1127,8 @@ ip6_insert_jumboopt(exthdrs, plen) * Insert fragment header and copy unfragmentable header portions. */ static int -ip6_insertfraghdr(m0, m, hlen, frghdrp) - struct mbuf *m0, *m; - int hlen; - struct ip6_frag **frghdrp; +ip6_insertfraghdr(struct mbuf *m0, struct mbuf *m, int hlen, + struct ip6_frag **frghdrp) { struct mbuf *n, *mlast; @@ -1178,12 +1168,9 @@ ip6_insertfraghdr(m0, m, hlen, frghdrp) } static int -ip6_getpmtu(ro_pmtu, ro, ifp, dst, mtup, alwaysfragp) - struct route_in6 *ro_pmtu, *ro; - struct ifnet *ifp; - struct in6_addr *dst; - u_long *mtup; - int *alwaysfragp; +ip6_getpmtu(struct route_in6 *ro_pmtu, struct route_in6 *ro, + struct ifnet *ifp, struct in6_addr *dst, u_long *mtup, + int *alwaysfragp) { u_int32_t mtu = 0; int alwaysfrag = 0; @@ -1256,11 +1243,8 @@ ip6_getpmtu(ro_pmtu, ro, ifp, dst, mtup, alwaysfragp) * IP6 socket option processing. */ int -ip6_ctloutput(op, so, level, optname, mp) - int op; - struct socket *so; - int level, optname; - struct mbuf **mp; +ip6_ctloutput(int op, struct socket *so, int level, int optname, + struct mbuf **mp) { int privileged, optdatalen, uproto; void *optdata; @@ -1941,11 +1925,8 @@ do { \ } int -ip6_raw_ctloutput(op, so, level, optname, mp) - int op; - struct socket *so; - int level, optname; - struct mbuf **mp; +ip6_raw_ctloutput(int op, struct socket *so, int level, int optname, + struct mbuf **mp) { int error = 0, optval, optlen; const int icmp6off = offsetof(struct icmp6_hdr, icmp6_cksum); @@ -2021,10 +2002,7 @@ ip6_raw_ctloutput(op, so, level, optname, mp) * with destination address if source routed. */ static int -ip6_pcbopts(pktopt, m, so) - struct ip6_pktopts **pktopt; - struct mbuf *m; - struct socket *so; +ip6_pcbopts(struct ip6_pktopts **pktopt, struct mbuf *m, struct socket *so) { struct ip6_pktopts *opt = *pktopt; int error = 0; @@ -2065,8 +2043,7 @@ ip6_pcbopts(pktopt, m, so) * the struct. */ void -ip6_initpktopts(opt) - struct ip6_pktopts *opt; +ip6_initpktopts(struct ip6_pktopts *opt) { bzero(opt, sizeof(*opt)); @@ -2077,11 +2054,8 @@ ip6_initpktopts(opt) #define sin6tosa(sin6) ((struct sockaddr *)(sin6)) /* XXX */ static int -ip6_pcbopt(optname, buf, len, pktopt, priv, uproto) - int optname, len, priv; - u_char *buf; - struct ip6_pktopts **pktopt; - int uproto; +ip6_pcbopt(int optname, u_char *buf, int len, struct ip6_pktopts **pktopt, + int priv, int uproto) { struct ip6_pktopts *opt; @@ -2096,10 +2070,7 @@ ip6_pcbopt(optname, buf, len, pktopt, priv, uproto) } static int -ip6_getpcbopt(pktopt, optname, mp) - struct ip6_pktopts *pktopt; - int optname; - struct mbuf **mp; +ip6_getpcbopt(struct ip6_pktopts *pktopt, int optname, struct mbuf **mp) { void *optdata = NULL; int optdatalen = 0; @@ -2197,9 +2168,7 @@ ip6_getpcbopt(pktopt, optname, mp) } void -ip6_clearpktopts(pktopt, optname) - struct ip6_pktopts *pktopt; - int optname; +ip6_clearpktopts(struct ip6_pktopts *pktopt, int optname) { if (optname == -1 || optname == IPV6_PKTINFO) { if (pktopt->ip6po_pktinfo) @@ -2257,9 +2226,7 @@ do {\ } while (/*CONSTCOND*/ 0) static int -copypktopts(dst, src, canwait) - struct ip6_pktopts *dst, *src; - int canwait; +copypktopts(struct ip6_pktopts *dst, struct ip6_pktopts *src, int canwait) { dst->ip6po_hlim = src->ip6po_hlim; dst->ip6po_tclass = src->ip6po_tclass; @@ -2298,9 +2265,7 @@ copypktopts(dst, src, canwait) #undef PKTOPT_EXTHDRCPY struct ip6_pktopts * -ip6_copypktopts(src, canwait) - struct ip6_pktopts *src; - int canwait; +ip6_copypktopts(struct ip6_pktopts *src, int canwait) { int error; struct ip6_pktopts *dst; @@ -2319,8 +2284,7 @@ ip6_copypktopts(src, canwait) } void -ip6_freepcbopts(pktopt) - struct ip6_pktopts *pktopt; +ip6_freepcbopts(struct ip6_pktopts *pktopt) { if (pktopt == NULL) return; @@ -2334,10 +2298,7 @@ ip6_freepcbopts(pktopt) * Set the IP6 multicast options in response to user setsockopt(). */ static int -ip6_setmoptions(optname, im6op, m) - int optname; - struct ip6_moptions **im6op; - struct mbuf *m; +ip6_setmoptions(int optname, struct ip6_moptions **im6op, struct mbuf *m) { int error = 0; u_int loop, ifindex; @@ -2622,10 +2583,7 @@ ip6_setmoptions(optname, im6op, m) * Return the IP6 multicast options in response to user getsockopt(). */ static int -ip6_getmoptions(optname, im6o, mp) - int optname; - struct ip6_moptions *im6o; - struct mbuf **mp; +ip6_getmoptions(int optname, struct ip6_moptions *im6o, struct mbuf **mp) { u_int *hlim, *loop, *ifindex; @@ -2669,8 +2627,7 @@ ip6_getmoptions(optname, im6o, mp) * Discard the IP6 multicast options. */ void -ip6_freemoptions(im6o) - struct ip6_moptions *im6o; +ip6_freemoptions(struct ip6_moptions *im6o) { struct in6_multi_mship *imm; @@ -2689,10 +2646,8 @@ ip6_freemoptions(im6o) * Set IPv6 outgoing packet options based on advanced API. */ int -ip6_setpktopts(control, opt, stickyopt, priv, uproto) - struct mbuf *control; - struct ip6_pktopts *opt, *stickyopt; - int priv, uproto; +ip6_setpktopts(struct mbuf *control, struct ip6_pktopts *opt, + struct ip6_pktopts *stickyopt, int priv, int uproto) { u_int clen; struct cmsghdr *cm = 0; @@ -2759,10 +2714,8 @@ ip6_setpktopts(control, opt, stickyopt, priv, uproto) * "sticky=1, cmsg=1": RFC2292 socket option */ static int -ip6_setpktopt(optname, buf, len, opt, priv, sticky, cmsg, uproto) - int optname, len, priv, sticky, cmsg, uproto; - u_char *buf; - struct ip6_pktopts *opt; +ip6_setpktopt(int optname, u_char *buf, int len, struct ip6_pktopts *opt, + int priv, int sticky, int cmsg, int uproto) { int minmtupolicy; @@ -3133,10 +3086,7 @@ ip6_setpktopt(optname, buf, len, opt, priv, sticky, cmsg, uproto) * pointer that might NOT be lo0ifp -- easier than replicating that code here. */ void -ip6_mloopback(ifp, m, dst) - struct ifnet *ifp; - struct mbuf *m; - struct sockaddr_in6 *dst; +ip6_mloopback(struct ifnet *ifp, struct mbuf *m, struct sockaddr_in6 *dst) { struct mbuf *copym; struct ip6_hdr *ip6; @@ -3180,9 +3130,7 @@ ip6_mloopback(ifp, m, dst) * Chop IPv6 header off from the payload. */ static int -ip6_splithdr(m, exthdrs) - struct mbuf *m; - struct ip6_exthdrs *exthdrs; +ip6_splithdr(struct mbuf *m, struct ip6_exthdrs *exthdrs) { struct mbuf *mh; struct ip6_hdr *ip6; @@ -3211,8 +3159,7 @@ ip6_splithdr(m, exthdrs) * Compute IPv6 extension header length. */ int -ip6_optlen(inp) - struct inpcb *inp; +ip6_optlen(struct inpcb *inp) { int len; diff --git a/sys/netinet6/mld6.c b/sys/netinet6/mld6.c index 5f8a130db23..19da4d2e58f 100644 --- a/sys/netinet6/mld6.c +++ b/sys/netinet6/mld6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mld6.c,v 1.24 2007/06/01 00:52:38 henning Exp $ */ +/* $OpenBSD: mld6.c,v 1.25 2008/06/11 19:00:50 mcbride Exp $ */ /* $KAME: mld6.c,v 1.26 2001/02/16 14:50:35 itojun Exp $ */ /* @@ -125,8 +125,7 @@ mld6_init() } void -mld6_start_listening(in6m) - struct in6_multi *in6m; +mld6_start_listening(struct in6_multi *in6m) { int s = splsoftnet(); @@ -155,8 +154,7 @@ mld6_start_listening(in6m) } void -mld6_stop_listening(in6m) - struct in6_multi *in6m; +mld6_stop_listening(struct in6_multi *in6m) { mld_all_nodes_linklocal.s6_addr16[1] = htons(in6m->in6m_ifp->if_index); /* XXX */ @@ -171,9 +169,7 @@ mld6_stop_listening(in6m) } void -mld6_input(m, off) - struct mbuf *m; - int off; +mld6_input(struct mbuf *m, int off) { struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); struct mld_hdr *mldh; @@ -363,10 +359,7 @@ mld6_fasttimeo() } static void -mld6_sendpkt(in6m, type, dst) - struct in6_multi *in6m; - int type; - const struct in6_addr *dst; +mld6_sendpkt(struct in6_multi *in6m, int type, const struct in6_addr *dst) { struct mbuf *mh, *md; struct mld_hdr *mldh; diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 018e26fb8da..6957a254c42 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6.c,v 1.78 2008/06/11 06:30:36 mcbride Exp $ */ +/* $OpenBSD: nd6.c,v 1.79 2008/06/11 19:00:50 mcbride Exp $ */ /* $KAME: nd6.c,v 1.280 2002/06/08 19:52:07 itojun Exp $ */ /* @@ -146,8 +146,7 @@ nd6_init() } struct nd_ifinfo * -nd6_ifattach(ifp) - struct ifnet *ifp; +nd6_ifattach(struct ifnet *ifp) { struct nd_ifinfo *nd; @@ -173,24 +172,20 @@ nd6_ifattach(ifp) } void -nd6_ifdetach(nd) - struct nd_ifinfo *nd; +nd6_ifdetach(struct nd_ifinfo *nd) { free(nd, M_IP6NDP); } void -nd6_setmtu(ifp) - struct ifnet *ifp; +nd6_setmtu(struct ifnet *ifp) { nd6_setmtu0(ifp, ND_IFINFO(ifp)); } void -nd6_setmtu0(ifp, ndi) - struct ifnet *ifp; - struct nd_ifinfo *ndi; +nd6_setmtu0(struct ifnet *ifp, struct nd_ifinfo *ndi) { u_int32_t omaxmtu; @@ -218,12 +213,8 @@ nd6_setmtu0(ifp, ndi) } void -nd6_option_init(opt, icmp6len, ndopts) - void *opt; - int icmp6len; - union nd_opts *ndopts; +nd6_option_init(void *opt, int icmp6len, union nd_opts *ndopts) { - bzero(ndopts, sizeof(*ndopts)); ndopts->nd_opts_search = (struct nd_opt_hdr *)opt; ndopts->nd_opts_last @@ -239,8 +230,7 @@ nd6_option_init(opt, icmp6len, ndopts) * Take one ND option. */ struct nd_opt_hdr * -nd6_option(ndopts) - union nd_opts *ndopts; +nd6_option(union nd_opts *ndopts) { struct nd_opt_hdr *nd_opt; int olen; @@ -291,8 +281,7 @@ nd6_option(ndopts) * multiple options of the same type. */ int -nd6_options(ndopts) - union nd_opts *ndopts; +nd6_options(union nd_opts *ndopts) { struct nd_opt_hdr *nd_opt; int i = 0; @@ -515,8 +504,7 @@ nd6_llinfo_timer(void *arg) * ND6 timer routine to expire default route list and prefix list */ void -nd6_timer(ignored_arg) - void *ignored_arg; +nd6_timer(void *ignored_arg) { int s; struct nd_defrouter *dr; @@ -595,8 +583,7 @@ nd6_timer(ignored_arg) * ifp goes away. */ void -nd6_purge(ifp) - struct ifnet *ifp; +nd6_purge(struct ifnet *ifp) { struct llinfo_nd6 *ln, *nln; struct nd_defrouter *dr, *ndr; @@ -681,10 +668,7 @@ nd6_purge(ifp) } struct rtentry * -nd6_lookup(addr6, create, ifp) - struct in6_addr *addr6; - int create; - struct ifnet *ifp; +nd6_lookup(struct in6_addr *addr6, int create, struct ifnet *ifp) { struct rtentry *rt; struct sockaddr_in6 sin6; @@ -789,9 +773,7 @@ nd6_lookup(addr6, create, ifp) * XXX: should take care of the destination of a p2p link? */ int -nd6_is_addr_neighbor(addr, ifp) - struct sockaddr_in6 *addr; - struct ifnet *ifp; +nd6_is_addr_neighbor(struct sockaddr_in6 *addr, struct ifnet *ifp) { struct nd_prefix *pr; struct rtentry *rt; @@ -850,9 +832,7 @@ nd6_is_addr_neighbor(addr, ifp) * that the change is safe. */ static struct llinfo_nd6 * -nd6_free(rt, gc) - struct rtentry *rt; - int gc; +nd6_free(struct rtentry *rt, int gc) { struct rt_addrinfo info; struct llinfo_nd6 *ln = (struct llinfo_nd6 *)rt->rt_llinfo, *next; @@ -961,10 +941,7 @@ nd6_free(rt, gc) * XXX cost-effective methods? */ void -nd6_nud_hint(rt, dst6, force) - struct rtentry *rt; - struct in6_addr *dst6; - int force; +nd6_nud_hint(struct rtentry *rt, struct in6_addr *dst6, int force) { struct llinfo_nd6 *ln; @@ -1008,11 +985,12 @@ nd6_nud_hint(rt, dst6, force) } } +/* + * info - XXX: unused + */ + void -nd6_rtrequest(req, rt, info) - int req; - struct rtentry *rt; - struct rt_addrinfo *info; /* xxx unused */ +nd6_rtrequest(int req, struct rtentry *rt, struct rt_addrinfo *info) { struct sockaddr *gate = rt->rt_gateway; struct llinfo_nd6 *ln = (struct llinfo_nd6 *)rt->rt_llinfo; @@ -1288,10 +1266,7 @@ nd6_rtrequest(req, rt, info) } int -nd6_ioctl(cmd, data, ifp) - u_long cmd; - caddr_t data; - struct ifnet *ifp; +nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp) { struct in6_drlist *drl = (struct in6_drlist *)data; struct in6_oprlist *oprl = (struct in6_oprlist *)data; @@ -1502,15 +1477,13 @@ nd6_ioctl(cmd, data, ifp) /* * Create neighbor cache entry and cache link-layer address, * on reception of inbound ND6 packets. (RS/RA/NS/redirect) + * + * type - ICMP6 type + * code - type dependent information */ struct rtentry * -nd6_cache_lladdr(ifp, from, lladdr, lladdrlen, type, code) - struct ifnet *ifp; - struct in6_addr *from; - char *lladdr; - int lladdrlen; - int type; /* ICMP6 type */ - int code; /* type dependent information */ +nd6_cache_lladdr(struct ifnet *ifp, struct in6_addr *from, char *lladdr, + int lladdrlen, int type, int code) { struct rtentry *rt = NULL; struct llinfo_nd6 *ln = NULL; @@ -1740,8 +1713,7 @@ fail: } static void -nd6_slowtimo(ignored_arg) - void *ignored_arg; +nd6_slowtimo(void *ignored_arg) { int s = splsoftnet(); struct nd_ifinfo *nd6if; @@ -1769,12 +1741,8 @@ nd6_slowtimo(ignored_arg) #define senderr(e) { error = (e); goto bad;} int -nd6_output(ifp, origifp, m0, dst, rt0) - struct ifnet *ifp; - struct ifnet *origifp; - struct mbuf *m0; - struct sockaddr_in6 *dst; - struct rtentry *rt0; +nd6_output(struct ifnet *ifp, struct ifnet *origifp, struct mbuf *m0, + struct sockaddr_in6 *dst, struct rtentry *rt0) { struct mbuf *m = m0; struct rtentry *rt = rt0; @@ -1974,8 +1942,7 @@ nd6_output(ifp, origifp, m0, dst, rt0) #undef senderr int -nd6_need_cache(ifp) - struct ifnet *ifp; +nd6_need_cache(struct ifnet *ifp) { /* * XXX: we currently do not make neighbor cache on any interface @@ -2000,12 +1967,8 @@ nd6_need_cache(ifp) } int -nd6_storelladdr(ifp, rt, m, dst, desten) - struct ifnet *ifp; - struct rtentry *rt; - struct mbuf *m; - struct sockaddr *dst; - u_char *desten; +nd6_storelladdr(struct ifnet *ifp, struct rtentry *rt, struct mbuf *m, + struct sockaddr *dst, u_char *desten) { struct sockaddr_dl *sdl; @@ -2046,13 +2009,14 @@ nd6_storelladdr(ifp, rt, m, dst, desten) return (1); } +/* + * oldp - syscall arg, need copyout + * newp - syscall arg, need copyin + */ + int -nd6_sysctl(name, oldp, oldlenp, newp, newlen) - int name; - void *oldp; /* syscall arg, need copyout */ - size_t *oldlenp; - void *newp; /* syscall arg, need copyin */ - size_t newlen; +nd6_sysctl(int name, void *oldp, size_t *oldlenp, void *newp, + size_t newlen) { void *p; size_t ol, l; @@ -2097,9 +2061,7 @@ nd6_sysctl(name, oldp, oldlenp, newp, newlen) } static int -fill_drlist(oldp, oldlenp, ol) - void *oldp; - size_t *oldlenp, ol; +fill_drlist(void *oldp, size_t *oldlenp, size_t ol) { int error = 0, s; struct in6_defrouter *d = NULL, *de = NULL; @@ -2148,9 +2110,7 @@ fill_drlist(oldp, oldlenp, ol) } static int -fill_prlist(oldp, oldlenp, ol) - void *oldp; - size_t *oldlenp, ol; +fill_prlist(void *oldp, size_t *oldlenp, size_t ol) { int error = 0, s; struct nd_prefix *pr; diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c index 355af558a00..7a0acfc950b 100644 --- a/sys/netinet6/nd6_nbr.c +++ b/sys/netinet6/nd6_nbr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6_nbr.c,v 1.50 2008/05/11 03:50:23 krw Exp $ */ +/* $OpenBSD: nd6_nbr.c,v 1.51 2008/06/11 19:00:50 mcbride Exp $ */ /* $KAME: nd6_nbr.c,v 1.61 2001/02/10 16:06:14 jinmei Exp $ */ /* @@ -85,9 +85,7 @@ static int dad_maxtry = 15; /* max # of *tries* to transmit DAD packet */ * Based on RFC 2462 (duplicated address detection) */ void -nd6_ns_input(m, off, icmp6len) - struct mbuf *m; - int off, icmp6len; +nd6_ns_input(struct mbuf *m, int off, int icmp6len) { struct ifnet *ifp = m->m_pkthdr.rcvif; struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); @@ -328,13 +326,13 @@ nd6_ns_input(m, off, icmp6len) * * Based on RFC 2461 * Based on RFC 2462 (duplicated address detection) + * + * ln - for source address determination + * dad - duplicated address detection */ void -nd6_ns_output(ifp, daddr6, taddr6, ln, dad) - struct ifnet *ifp; - struct in6_addr *daddr6, *taddr6; - struct llinfo_nd6 *ln; /* for source address determination */ - int dad; /* duplicated address detection */ +nd6_ns_output(struct ifnet *ifp, struct in6_addr *daddr6, + struct in6_addr *taddr6, struct llinfo_nd6 *ln, int dad) { struct mbuf *m; struct ip6_hdr *ip6; @@ -537,9 +535,7 @@ nd6_ns_output(ifp, daddr6, taddr6, ln, dad) * - anycast advertisement delay rule (RFC2461 7.2.7, SHOULD) */ void -nd6_na_input(m, off, icmp6len) - struct mbuf *m; - int off, icmp6len; +nd6_na_input(struct mbuf *m, int off, int icmp6len) { struct ifnet *ifp = m->m_pkthdr.rcvif; struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); @@ -834,14 +830,14 @@ nd6_na_input(m, off, icmp6len) * the following items are not implemented yet: * - proxy advertisement delay rule (RFC2461 7.2.8, last paragraph, SHOULD) * - anycast advertisement delay rule (RFC2461 7.2.7, SHOULD) + * + * tlladdr - 1 if include target link-layer address + * sdl0 - sockaddr_dl (= proxy NA) or NULL */ void -nd6_na_output(ifp, daddr6, taddr6, flags, tlladdr, sdl0) - struct ifnet *ifp; - struct in6_addr *daddr6, *taddr6; - u_long flags; - int tlladdr; /* 1 if include target link-layer address */ - struct sockaddr *sdl0; /* sockaddr_dl (= proxy NA) or NULL */ +nd6_na_output(struct ifnet *ifp, struct in6_addr *daddr6, + struct in6_addr *taddr6, u_long flags, int tlladdr, + struct sockaddr *sdl0) { struct mbuf *m; struct ip6_hdr *ip6; @@ -999,8 +995,7 @@ nd6_na_output(ifp, daddr6, taddr6, flags, tlladdr, sdl0) } caddr_t -nd6_ifptomac(ifp) - struct ifnet *ifp; +nd6_ifptomac(struct ifnet *ifp) { switch (ifp->if_type) { case IFT_ETHER: @@ -1032,8 +1027,7 @@ static struct dadq_head dadq; static int dad_init = 0; static struct dadq * -nd6_dad_find(ifa) - struct ifaddr *ifa; +nd6_dad_find(struct ifaddr *ifa) { struct dadq *dp; @@ -1045,9 +1039,7 @@ nd6_dad_find(ifa) } static void -nd6_dad_starttimer(dp, ticks) - struct dadq *dp; - int ticks; +nd6_dad_starttimer(struct dadq *dp, int ticks) { timeout_set(&dp->dad_timer_ch, (void (*)(void *))nd6_dad_timer, @@ -1056,8 +1048,7 @@ nd6_dad_starttimer(dp, ticks) } static void -nd6_dad_stoptimer(dp) - struct dadq *dp; +nd6_dad_stoptimer(struct dadq *dp) { timeout_del(&dp->dad_timer_ch); @@ -1065,11 +1056,11 @@ nd6_dad_stoptimer(dp) /* * Start Duplicated Address Detection (DAD) for specified interface address. + * + * tick - minimum delay ticks for IFF_UP event */ void -nd6_dad_start(ifa, tick) - struct ifaddr *ifa; - int *tick; /* minimum delay ticks for IFF_UP event */ +nd6_dad_start(struct ifaddr *ifa, int *tick) { struct in6_ifaddr *ia = (struct in6_ifaddr *)ifa; struct dadq *dp; @@ -1156,8 +1147,7 @@ nd6_dad_start(ifa, tick) * terminate DAD unconditionally. used for address removals. */ void -nd6_dad_stop(ifa) - struct ifaddr *ifa; +nd6_dad_stop(struct ifaddr *ifa) { struct dadq *dp; @@ -1178,8 +1168,7 @@ nd6_dad_stop(ifa) } static void -nd6_dad_timer(ifa) - struct ifaddr *ifa; +nd6_dad_timer(struct ifaddr *ifa) { int s; struct in6_ifaddr *ia = (struct in6_ifaddr *)ifa; @@ -1282,8 +1271,7 @@ done: } void -nd6_dad_duplicated(ifa) - struct ifaddr *ifa; +nd6_dad_duplicated(struct ifaddr *ifa) { struct in6_ifaddr *ia = (struct in6_ifaddr *)ifa; struct dadq *dp; @@ -1317,9 +1305,7 @@ nd6_dad_duplicated(ifa) } static void -nd6_dad_ns_output(dp, ifa) - struct dadq *dp; - struct ifaddr *ifa; +nd6_dad_ns_output(struct dadq *dp, struct ifaddr *ifa) { struct in6_ifaddr *ia = (struct in6_ifaddr *)ifa; struct ifnet *ifp = ifa->ifa_ifp; @@ -1343,8 +1329,7 @@ nd6_dad_ns_output(dp, ifa) } static void -nd6_dad_ns_input(ifa) - struct ifaddr *ifa; +nd6_dad_ns_input(struct ifaddr *ifa) { struct in6_ifaddr *ia; struct ifnet *ifp; @@ -1393,8 +1378,7 @@ nd6_dad_ns_input(ifa) } static void -nd6_dad_na_input(ifa) - struct ifaddr *ifa; +nd6_dad_na_input(struct ifaddr *ifa) { struct dadq *dp; diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index cb41a3f7778..f0013ca8864 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6_rtr.c,v 1.46 2008/06/11 06:30:36 mcbride Exp $ */ +/* $OpenBSD: nd6_rtr.c,v 1.47 2008/06/11 19:00:50 mcbride Exp $ */ /* $KAME: nd6_rtr.c,v 1.97 2001/02/07 11:09:13 itojun Exp $ */ /* @@ -89,9 +89,7 @@ int nd6_defifindex; * Based on RFC 2461 */ void -nd6_rs_input(m, off, icmp6len) - struct mbuf *m; - int off, icmp6len; +nd6_rs_input(struct mbuf *m, int off, int icmp6len) { struct ifnet *ifp = m->m_pkthdr.rcvif; struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); @@ -177,9 +175,7 @@ nd6_rs_input(m, off, icmp6len) * TODO: ND_RA_FLAG_{OTHER,MANAGED} processing */ void -nd6_ra_input(m, off, icmp6len) - struct mbuf *m; - int off, icmp6len; +nd6_ra_input(struct mbuf *m, int off, int icmp6len) { struct ifnet *ifp = m->m_pkthdr.rcvif; struct nd_ifinfo *ndi = ND_IFINFO(ifp); @@ -417,9 +413,7 @@ nd6_ra_input(m, off, icmp6len) /* tell the change to user processes watching the routing socket. */ static void -nd6_rtmsg(cmd, rt) - int cmd; - struct rtentry *rt; +nd6_rtmsg(int cmd, struct rtentry *rt) { struct rt_addrinfo info; @@ -437,8 +431,7 @@ nd6_rtmsg(cmd, rt) } void -defrouter_addreq(new) - struct nd_defrouter *new; +defrouter_addreq(struct nd_defrouter *new) { struct rt_addrinfo info; struct sockaddr_in6 def, mask, gate; @@ -475,9 +468,7 @@ defrouter_addreq(new) } struct nd_defrouter * -defrouter_lookup(addr, ifp) - struct in6_addr *addr; - struct ifnet *ifp; +defrouter_lookup(struct in6_addr *addr, struct ifnet *ifp) { struct nd_defrouter *dr; @@ -545,8 +536,7 @@ defrtrlist_del(dr) * not be called from anywhere else. */ static void -defrouter_delreq(dr) - struct nd_defrouter *dr; +defrouter_delreq(struct nd_defrouter *dr) { struct rt_addrinfo info; struct sockaddr_in6 def, mask, gw; @@ -629,7 +619,7 @@ defrouter_reset() * complicated and the possibility of introducing bugs. */ void -defrouter_select() +defrouter_select(void) { int s = splsoftnet(); struct nd_defrouter *dr, *selected_dr = NULL, *installed_dr = NULL; @@ -749,8 +739,7 @@ rtpref(struct nd_defrouter *dr) } static struct nd_defrouter * -defrtrlist_update(new) - struct nd_defrouter *new; +defrtrlist_update(struct nd_defrouter *new) { struct nd_defrouter *dr, *n; struct in6_ifextra *ext = new->ifp->if_afdata[AF_INET6]; @@ -843,9 +832,7 @@ insert: } static struct nd_pfxrouter * -pfxrtr_lookup(pr, dr) - struct nd_prefix *pr; - struct nd_defrouter *dr; +pfxrtr_lookup(struct nd_prefix *pr, struct nd_defrouter *dr) { struct nd_pfxrouter *search; @@ -858,9 +845,7 @@ pfxrtr_lookup(pr, dr) } static void -pfxrtr_add(pr, dr) - struct nd_prefix *pr; - struct nd_defrouter *dr; +pfxrtr_add(struct nd_prefix *pr, struct nd_defrouter *dr) { struct nd_pfxrouter *new; @@ -875,16 +860,14 @@ pfxrtr_add(pr, dr) } static void -pfxrtr_del(pfr) - struct nd_pfxrouter *pfr; +pfxrtr_del(struct nd_pfxrouter *pfr) { LIST_REMOVE(pfr, pfr_entry); free(pfr, M_IP6NDP); } struct nd_prefix * -nd6_prefix_lookup(pr) - struct nd_prefix *pr; +nd6_prefix_lookup(struct nd_prefix *pr) { struct nd_prefix *search; @@ -901,8 +884,7 @@ nd6_prefix_lookup(pr) } static void -purge_detached(ifp) - struct ifnet *ifp; +purge_detached(struct ifnet *ifp) { struct nd_prefix *pr, *pr_next; struct in6_ifaddr *ia; @@ -940,9 +922,8 @@ purge_detached(ifp) } int -nd6_prelist_add(pr, dr, newp) - struct nd_prefix *pr, **newp; - struct nd_defrouter *dr; +nd6_prelist_add(struct nd_prefix *pr, struct nd_defrouter *dr, + struct nd_prefix **newp) { struct nd_prefix *new = NULL; int i, s; @@ -997,8 +978,7 @@ nd6_prelist_add(pr, dr, newp) } void -prelist_remove(pr) - struct nd_prefix *pr; +prelist_remove(struct nd_prefix *pr) { struct nd_pfxrouter *pfr, *next; int e, s; @@ -1051,11 +1031,13 @@ prelist_remove(pr) pfxlist_onlink_check(); } +/* + * dr - may be NULL + */ + int -prelist_update(new, dr, m) - struct nd_prefix *new; - struct nd_defrouter *dr; /* may be NULL */ - struct mbuf *m; +prelist_update(struct nd_prefix *new, struct nd_defrouter *dr, + struct mbuf *m) { struct in6_ifaddr *ia6 = NULL, *ia6_match = NULL; struct ifaddr *ifa; @@ -1311,8 +1293,7 @@ prelist_update(new, dr, m) * XXX: lengthy function name... */ static struct nd_pfxrouter * -find_pfxlist_reachable_router(pr) - struct nd_prefix *pr; +find_pfxlist_reachable_router(struct nd_prefix *pr) { struct nd_pfxrouter *pfxrtr; struct rtentry *rt; @@ -1344,7 +1325,7 @@ find_pfxlist_reachable_router(pr) * is no router around us. */ void -pfxlist_onlink_check() +pfxlist_onlink_check(void) { struct nd_prefix *pr; struct in6_ifaddr *ifa; @@ -1489,8 +1470,7 @@ pfxlist_onlink_check() } int -nd6_prefix_onlink(pr) - struct nd_prefix *pr; +nd6_prefix_onlink(struct nd_prefix *pr) { struct rt_addrinfo info; struct ifaddr *ifa; @@ -1605,8 +1585,7 @@ nd6_prefix_onlink(pr) } int -nd6_prefix_offlink(pr) - struct nd_prefix *pr; +nd6_prefix_offlink(struct nd_prefix *pr) { struct rt_addrinfo info; int error = 0; @@ -1701,8 +1680,7 @@ nd6_prefix_offlink(pr) } static struct in6_ifaddr * -in6_ifadd(pr) - struct nd_prefix *pr; +in6_ifadd(struct nd_prefix *pr) { struct ifnet *ifp = pr->ndpr_ifp; struct ifaddr *ifa; @@ -1868,9 +1846,7 @@ in6_init_address_ltimes(struct nd_prefix *new, struct in6_addrlifetime *lt6) * it shouldn't be called when acting as a router. */ void -rt6_flush(gateway, ifp) - struct in6_addr *gateway; - struct ifnet *ifp; +rt6_flush(struct in6_addr *gateway, struct ifnet *ifp) { struct radix_node_head *rnh = rt_gettable(AF_INET6, 0); int s = splsoftnet(); @@ -1888,9 +1864,7 @@ rt6_flush(gateway, ifp) } static int -rt6_deleteroute(rn, arg) - struct radix_node *rn; - void *arg; +rt6_deleteroute(struct radix_node *rn, void *arg) { #define SIN6(s) ((struct sockaddr_in6 *)s) struct rt_addrinfo info; @@ -1928,8 +1902,7 @@ rt6_deleteroute(rn, arg) } int -nd6_setdefaultiface(ifindex) - int ifindex; +nd6_setdefaultiface(int ifindex) { int error = 0; diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c index 5bbb3baaf14..e6c8c64e44d 100644 --- a/sys/netinet6/raw_ip6.c +++ b/sys/netinet6/raw_ip6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: raw_ip6.c,v 1.35 2007/12/14 18:33:41 deraadt Exp $ */ +/* $OpenBSD: raw_ip6.c,v 1.36 2008/06/11 19:00:50 mcbride Exp $ */ /* $KAME: raw_ip6.c,v 1.69 2001/03/04 15:55:44 itojun Exp $ */ /* @@ -142,9 +142,7 @@ rip6_init() * mbuf chain. */ int -rip6_input(mp, offp, proto) - struct mbuf **mp; - int *offp, proto; +rip6_input(struct mbuf **mp, int *offp, int proto) { struct mbuf *m = *mp; struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); @@ -252,10 +250,7 @@ rip6_input(mp, offp, proto) } void -rip6_ctlinput(cmd, sa, d) - int cmd; - struct sockaddr *sa; - void *d; +rip6_ctlinput(int cmd, struct sockaddr *sa, void *d) { struct ip6_hdr *ip6; struct mbuf *m; @@ -522,11 +517,8 @@ rip6_output(struct mbuf *m, ...) * Raw IPv6 socket option processing. */ int -rip6_ctloutput(op, so, level, optname, mp) - int op; - struct socket *so; - int level, optname; - struct mbuf **mp; +rip6_ctloutput(int op, struct socket *so, int level, int optname, + struct mbuf **mp) { #ifdef MROUTING int error = 0; @@ -577,11 +569,8 @@ extern u_long rip6_sendspace; extern u_long rip6_recvspace; int -rip6_usrreq(so, req, m, nam, control, p) - struct socket *so; - int req; - struct mbuf *m, *nam, *control; - struct proc *p; +rip6_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam, + struct mbuf *control, struct proc *p) { struct in6pcb *in6p = sotoin6pcb(so); int s; diff --git a/sys/netinet6/route6.c b/sys/netinet6/route6.c index b0e8c8f3079..62aa3de5b1f 100644 --- a/sys/netinet6/route6.c +++ b/sys/netinet6/route6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route6.c,v 1.16 2007/05/31 23:17:38 mcbride Exp $ */ +/* $OpenBSD: route6.c,v 1.17 2008/06/11 19:00:50 mcbride Exp $ */ /* $KAME: route6.c,v 1.22 2000/12/03 00:54:00 itojun Exp $ */ /* @@ -48,10 +48,12 @@ static int ip6_rthdr0(struct mbuf *, struct ip6_hdr *, struct ip6_rthdr0 *); #endif +/* + * proto is unused + */ + int -route6_input(mp, offp, proto) - struct mbuf **mp; - int *offp, proto; /* proto is unused */ +route6_input(struct mbuf **mp, int *offp, int proto) { struct ip6_hdr *ip6; struct mbuf *m = *mp; @@ -127,10 +129,7 @@ route6_input(mp, offp, proto) * as it was dropped between RFC1883 and RFC2460. */ static int -ip6_rthdr0(m, ip6, rh0) - struct mbuf *m; - struct ip6_hdr *ip6; - struct ip6_rthdr0 *rh0; +ip6_rthdr0(struct mbuf *m, struct ip6_hdr *ip6, struct ip6_rthdr0 *rh0) { int addrs, index; struct in6_addr *nextaddr, tmpaddr; diff --git a/sys/netinet6/udp6_output.c b/sys/netinet6/udp6_output.c index f0062c6a58e..f6c6315a3db 100644 --- a/sys/netinet6/udp6_output.c +++ b/sys/netinet6/udp6_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udp6_output.c,v 1.14 2007/06/01 00:52:39 henning Exp $ */ +/* $OpenBSD: udp6_output.c,v 1.15 2008/06/11 19:00:50 mcbride Exp $ */ /* $KAME: udp6_output.c,v 1.21 2001/02/07 11:51:54 itojun Exp $ */ /* @@ -112,10 +112,8 @@ #define udp6s_opackets udps_opackets int -udp6_output(in6p, m, addr6, control) - struct in6pcb *in6p; - struct mbuf *m; - struct mbuf *addr6, *control; +udp6_output(struct in6pcb *in6p, struct mbuf *m, struct mbuf *addr6, + struct mbuf *control) { u_int32_t ulen = m->m_pkthdr.len; u_int32_t plen = sizeof(struct udphdr) + ulen; |