diff options
author | delphij <delphij@FreeBSD.org> | 2007-07-05 16:23:49 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2007-07-05 16:23:49 +0000 |
commit | e6f8b0995d59e493018009921005c7f50759dc53 (patch) | |
tree | 81174e8101271154426447c99842b2b14728c14e /sys/netinet6/nd6.c | |
parent | 181b33ba1c42e4a3281278639aae08ff32ebbc29 (diff) | |
download | FreeBSD-src-e6f8b0995d59e493018009921005c7f50759dc53.zip FreeBSD-src-e6f8b0995d59e493018009921005c7f50759dc53.tar.gz |
ANSIfy[1] plus some style cleanup nearby.
Discussed with: gnn, rwatson
Submitted by: Karl Sj?dahl - dunceor <dunceor gmail com> [1]
Approved by: re (rwatson)
Diffstat (limited to 'sys/netinet6/nd6.c')
-rw-r--r-- | sys/netinet6/nd6.c | 117 |
1 files changed, 38 insertions, 79 deletions
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 6faae89..bab778e 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -120,7 +120,7 @@ struct callout nd6_timer_ch; extern struct callout in6_tmpaddrtimer_ch; void -nd6_init() +nd6_init(void) { static int nd6_init_done = 0; int i; @@ -147,8 +147,7 @@ nd6_init() } struct nd_ifinfo * -nd6_ifattach(ifp) - struct ifnet *ifp; +nd6_ifattach(struct ifnet *ifp) { struct nd_ifinfo *nd; @@ -175,8 +174,7 @@ nd6_ifattach(ifp) } void -nd6_ifdetach(nd) - struct nd_ifinfo *nd; +nd6_ifdetach(struct nd_ifinfo *nd) { free(nd, M_IP6NDP); @@ -187,8 +185,7 @@ nd6_ifdetach(nd) * changes, which means we might have to adjust the ND level MTU. */ void -nd6_setmtu(ifp) - struct ifnet *ifp; +nd6_setmtu(struct ifnet *ifp) { nd6_setmtu0(ifp, ND_IFINFO(ifp)); @@ -196,9 +193,7 @@ nd6_setmtu(ifp) /* XXX todo: do not maintain copy of ifp->if_mtu in ndi->maxmtu */ 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; @@ -238,10 +233,7 @@ 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)); @@ -259,8 +251,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; @@ -311,8 +302,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; @@ -391,9 +381,7 @@ skip1: * ND6 timer routine to handle ND6 entries */ void -nd6_llinfo_settimer(ln, tick) - struct llinfo_nd6 *ln; - long tick; +nd6_llinfo_settimer(struct llinfo_nd6 *ln, long tick) { if (tick < 0) { ln->ln_expire = 0; @@ -414,8 +402,7 @@ nd6_llinfo_settimer(ln, tick) } static void -nd6_llinfo_timer(arg) - void *arg; +nd6_llinfo_timer(void *arg) { struct llinfo_nd6 *ln; struct rtentry *rt; @@ -539,8 +526,7 @@ nd6_llinfo_timer(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; @@ -663,9 +649,11 @@ nd6_timer(ignored_arg) splx(s); } +/* + * ia6 - deprecated/invalidated temporary address + */ static int -regen_tmpaddr(ia6) - struct in6_ifaddr *ia6; /* deprecated/invalidated temporary address */ +regen_tmpaddr(struct in6_ifaddr *ia6) { struct ifaddr *ifa; struct ifnet *ifp; @@ -731,8 +719,7 @@ regen_tmpaddr(ia6) * 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; @@ -819,10 +806,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; @@ -927,9 +911,7 @@ nd6_lookup(addr6, create, ifp) * to not reenter the routing code from within itself. */ static int -nd6_is_new_addr_neighbor(addr, ifp) - struct sockaddr_in6 *addr; - struct ifnet *ifp; +nd6_is_new_addr_neighbor(struct sockaddr_in6 *addr, struct ifnet *ifp) { struct nd_prefix *pr; struct ifaddr *dstaddr; @@ -1003,9 +985,7 @@ nd6_is_new_addr_neighbor(addr, 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) { if (nd6_is_new_addr_neighbor(addr, ifp)) @@ -1028,9 +1008,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 llinfo_nd6 *ln = (struct llinfo_nd6 *)rt->rt_llinfo, *next; struct in6_addr in6 = ((struct sockaddr_in6 *)rt_key(rt))->sin6_addr; @@ -1139,10 +1117,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; @@ -1186,11 +1161,11 @@ 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; @@ -1435,10 +1410,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; @@ -1670,15 +1642,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; @@ -1910,8 +1880,7 @@ fail: } static void -nd6_slowtimo(ignored_arg) - void *ignored_arg; +nd6_slowtimo(void *ignored_arg) { struct nd_ifinfo *nd6if; struct ifnet *ifp; @@ -1938,12 +1907,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; @@ -2163,8 +2128,7 @@ again: #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 @@ -2199,12 +2163,8 @@ nd6_need_cache(ifp) } int -nd6_storelladdr(ifp, rt0, m, dst, desten) - struct ifnet *ifp; - struct rtentry *rt0; - struct mbuf *m; - struct sockaddr *dst; - u_char *desten; +nd6_storelladdr(struct ifnet *ifp, struct rtentry *rt0, struct mbuf *m, + struct sockaddr *dst, u_char *desten) { struct sockaddr_dl *sdl; struct rtentry *rt; @@ -2275,8 +2235,7 @@ nd6_storelladdr(ifp, rt0, m, dst, desten) } static void -clear_llinfo_pqueue(ln) - struct llinfo_nd6 *ln; +clear_llinfo_pqueue(struct llinfo_nd6 *ln) { struct mbuf *m_hold, *m_hold_next; |