summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/nd6_rtr.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet6/nd6_rtr.c')
-rw-r--r--sys/netinet6/nd6_rtr.c97
1 files changed, 34 insertions, 63 deletions
diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c
index ea9eb4b..29f1a83 100644
--- a/sys/netinet6/nd6_rtr.c
+++ b/sys/netinet6/nd6_rtr.c
@@ -114,9 +114,7 @@ int ip6_temp_regen_advance = TEMPADDR_REGEN_ADVANCE;
* 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 *);
@@ -200,9 +198,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);
@@ -431,9 +427,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;
@@ -451,8 +445,7 @@ nd6_rtmsg(cmd, rt)
}
void
-defrouter_addreq(new)
- struct nd_defrouter *new;
+defrouter_addreq(struct nd_defrouter *new)
{
struct sockaddr_in6 def, mask, gate;
struct rtentry *newrt = NULL;
@@ -485,9 +478,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;
@@ -506,8 +497,7 @@ defrouter_lookup(addr, ifp)
* not be called from anywhere else.
*/
static void
-defrouter_delreq(dr)
- struct nd_defrouter *dr;
+defrouter_delreq(struct nd_defrouter *dr)
{
struct sockaddr_in6 def, mask, gate;
struct rtentry *oldrt = NULL;
@@ -536,7 +526,7 @@ defrouter_delreq(dr)
* remove all default routes from default router list
*/
void
-defrouter_reset()
+defrouter_reset(void)
{
struct nd_defrouter *dr;
@@ -551,8 +541,7 @@ defrouter_reset()
}
void
-defrtrlist_del(dr)
- struct nd_defrouter *dr;
+defrtrlist_del(struct nd_defrouter *dr)
{
struct nd_defrouter *deldr = NULL;
struct nd_prefix *pr;
@@ -613,7 +602,7 @@ defrtrlist_del(dr)
* complicated and the possibility of introducing bugs.
*/
void
-defrouter_select()
+defrouter_select(void)
{
int s = splnet();
struct nd_defrouter *dr, *selected_dr = NULL, *installed_dr = NULL;
@@ -729,8 +718,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;
int s = splnet();
@@ -815,9 +803,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;
@@ -830,9 +816,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;
@@ -848,16 +832,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(key)
- struct nd_prefixctl *key;
+nd6_prefix_lookup(struct nd_prefixctl *key)
{
struct nd_prefix *search;
@@ -874,10 +856,8 @@ nd6_prefix_lookup(key)
}
int
-nd6_prelist_add(pr, dr, newp)
- struct nd_prefixctl *pr;
- struct nd_prefix **newp;
- struct nd_defrouter *dr;
+nd6_prelist_add(struct nd_prefixctl *pr, struct nd_defrouter *dr,
+ struct nd_prefix **newp)
{
struct nd_prefix *new = NULL;
int error = 0;
@@ -935,8 +915,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;
@@ -982,12 +961,13 @@ prelist_remove(pr)
pfxlist_onlink_check();
}
+/*
+ * dr - may be NULL
+ */
+
static int
-prelist_update(new, dr, m, mcast)
- struct nd_prefixctl *new;
- struct nd_defrouter *dr; /* may be NULL */
- struct mbuf *m;
- int mcast;
+prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr,
+ struct mbuf *m, int mcast)
{
struct in6_ifaddr *ia6 = NULL, *ia6_match = NULL;
struct ifaddr *ifa;
@@ -1325,8 +1305,7 @@ prelist_update(new, dr, m, mcast)
* 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;
@@ -1537,8 +1516,7 @@ pfxlist_onlink_check()
}
int
-nd6_prefix_onlink(pr)
- struct nd_prefix *pr;
+nd6_prefix_onlink(struct nd_prefix *pr)
{
struct ifaddr *ifa;
struct ifnet *ifp = pr->ndpr_ifp;
@@ -1651,8 +1629,7 @@ nd6_prefix_onlink(pr)
}
int
-nd6_prefix_offlink(pr)
- struct nd_prefix *pr;
+nd6_prefix_offlink(struct nd_prefix *pr)
{
int error = 0;
struct ifnet *ifp = pr->ndpr_ifp;
@@ -1743,9 +1720,7 @@ nd6_prefix_offlink(pr)
}
static struct in6_ifaddr *
-in6_ifadd(pr, mcast)
- struct nd_prefixctl *pr;
- int mcast;
+in6_ifadd(struct nd_prefixctl *pr, int mcast)
{
struct ifnet *ifp = pr->ndpr_ifp;
struct ifaddr *ifa;
@@ -1869,10 +1844,11 @@ in6_ifadd(pr, mcast)
return (ia); /* this is always non-NULL */
}
+/*
+ * ia0 - corresponding public address
+ */
int
-in6_tmpifadd(ia0, forcegen, delay)
- const struct in6_ifaddr *ia0; /* corresponding public address */
- int forcegen, delay;
+in6_tmpifadd(const struct in6_ifaddr *ia0, int forcegen, int delay)
{
struct ifnet *ifp = ia0->ia_ifa.ifa_ifp;
struct in6_ifaddr *newia, *ia;
@@ -2039,9 +2015,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_tables[AF_INET6];
int s = splnet();
@@ -2059,9 +2033,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 rtentry *rt = (struct rtentry *)rn;
@@ -2095,8 +2067,7 @@ rt6_deleteroute(rn, arg)
}
int
-nd6_setdefaultiface(ifindex)
- int ifindex;
+nd6_setdefaultiface(int ifindex)
{
int error = 0;
OpenPOWER on IntegriCloud