summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2010-02-08 11:56:10 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2010-02-08 11:56:10 +0000
commitc4a31f95c338fb93b05f66d46792fd5e218b0419 (patch)
treea02b3fcd43800aee7f597a989e640015c0002018
parent8fabf22e375b501498f3545da69844e22e56fdbc (diff)
Destatic and ansify.
ok claudio@ naddy@
-rw-r--r--sys/netinet6/nd6.c35
-rw-r--r--sys/netinet6/nd6_nbr.c36
-rw-r--r--sys/netinet6/nd6_rtr.c62
3 files changed, 64 insertions, 69 deletions
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index ae523e08db8..0f00bd887d8 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6.c,v 1.82 2009/01/30 11:56:59 rainer Exp $ */
+/* $OpenBSD: nd6.c,v 1.83 2010/02/08 11:56:09 jsing Exp $ */
/* $KAME: nd6.c,v 1.280 2002/06/08 19:52:07 itojun Exp $ */
/*
@@ -96,17 +96,17 @@ struct nd_prhead nd_prefix = { 0 };
int nd6_recalc_reachtm_interval = ND6_RECALC_REACHTM_INTERVAL;
static struct sockaddr_in6 all1_sa;
-static void nd6_setmtu0(struct ifnet *, struct nd_ifinfo *);
-static void nd6_slowtimo(void *);
-static struct llinfo_nd6 *nd6_free(struct rtentry *, int);
-static void nd6_llinfo_timer(void *);
+void nd6_setmtu0(struct ifnet *, struct nd_ifinfo *);
+void nd6_slowtimo(void *);
+struct llinfo_nd6 *nd6_free(struct rtentry *, int);
+void nd6_llinfo_timer(void *);
struct timeout nd6_slowtimo_ch;
struct timeout nd6_timer_ch;
extern struct timeout in6_tmpaddrtimer_ch;
-static int fill_drlist(void *, size_t *, size_t);
-static int fill_prlist(void *, size_t *, size_t);
+int fill_drlist(void *, size_t *, size_t);
+int fill_prlist(void *, size_t *, size_t);
#define LN_DEQUEUE(ln) do { \
(ln)->ln_next->ln_prev = (ln)->ln_prev; \
@@ -120,7 +120,7 @@ static int fill_prlist(void *, size_t *, size_t);
} while (0)
void
-nd6_init()
+nd6_init(void)
{
static int nd6_init_done = 0;
int i;
@@ -384,7 +384,7 @@ nd6_llinfo_settimer(struct llinfo_nd6 *ln, long tick)
splx(s);
}
-static void
+void
nd6_llinfo_timer(void *arg)
{
int s;
@@ -829,7 +829,7 @@ nd6_is_addr_neighbor(struct sockaddr_in6 *addr, struct ifnet *ifp)
* make it global, unless you have a strong reason for the change, and are sure
* that the change is safe.
*/
-static struct llinfo_nd6 *
+struct llinfo_nd6 *
nd6_free(struct rtentry *rt, int gc)
{
struct rt_addrinfo info;
@@ -1490,7 +1490,7 @@ nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp)
*/
struct rtentry *
nd6_cache_lladdr(struct ifnet *ifp, struct in6_addr *from, char *lladdr,
- int lladdrlen, int type, int code)
+ int lladdrlen, int type, int code)
{
struct rtentry *rt = NULL;
struct llinfo_nd6 *ln = NULL;
@@ -1719,7 +1719,7 @@ fail:
return rt;
}
-static void
+void
nd6_slowtimo(void *ignored_arg)
{
int s = splsoftnet();
@@ -1749,7 +1749,7 @@ nd6_slowtimo(void *ignored_arg)
#define senderr(e) { error = (e); goto bad;}
int
nd6_output(struct ifnet *ifp, struct ifnet *origifp, struct mbuf *m0,
- struct sockaddr_in6 *dst, struct rtentry *rt0)
+ struct sockaddr_in6 *dst, struct rtentry *rt0)
{
struct mbuf *m = m0;
struct rtentry *rt = rt0;
@@ -1975,7 +1975,7 @@ nd6_need_cache(struct ifnet *ifp)
int
nd6_storelladdr(struct ifnet *ifp, struct rtentry *rt, struct mbuf *m,
- struct sockaddr *dst, u_char *desten)
+ struct sockaddr *dst, u_char *desten)
{
struct sockaddr_dl *sdl;
@@ -2022,8 +2022,7 @@ nd6_storelladdr(struct ifnet *ifp, struct rtentry *rt, struct mbuf *m,
*/
int
-nd6_sysctl(int name, void *oldp, size_t *oldlenp, void *newp,
- size_t newlen)
+nd6_sysctl(int name, void *oldp, size_t *oldlenp, void *newp, size_t newlen)
{
void *p;
size_t ol;
@@ -2066,7 +2065,7 @@ nd6_sysctl(int name, void *oldp, size_t *oldlenp, void *newp,
return (error);
}
-static int
+int
fill_drlist(void *oldp, size_t *oldlenp, size_t ol)
{
int error = 0, s;
@@ -2115,7 +2114,7 @@ fill_drlist(void *oldp, size_t *oldlenp, size_t ol)
return (error);
}
-static int
+int
fill_prlist(void *oldp, size_t *oldlenp, size_t ol)
{
int error = 0, s;
diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c
index 213929cca6c..66640769cf3 100644
--- a/sys/netinet6/nd6_nbr.c
+++ b/sys/netinet6/nd6_nbr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6_nbr.c,v 1.54 2008/11/25 12:11:45 markus Exp $ */
+/* $OpenBSD: nd6_nbr.c,v 1.55 2010/02/08 11:56:09 jsing Exp $ */
/* $KAME: nd6_nbr.c,v 1.61 2001/02/10 16:06:14 jinmei Exp $ */
/*
@@ -67,13 +67,13 @@
#define SDL(s) ((struct sockaddr_dl *)s)
struct dadq;
-static struct dadq *nd6_dad_find(struct ifaddr *);
-static void nd6_dad_starttimer(struct dadq *, int);
-static void nd6_dad_stoptimer(struct dadq *);
-static void nd6_dad_timer(struct ifaddr *);
-static void nd6_dad_ns_output(struct dadq *, struct ifaddr *);
-static void nd6_dad_ns_input(struct ifaddr *);
-static void nd6_dad_na_input(struct ifaddr *);
+struct dadq *nd6_dad_find(struct ifaddr *);
+void nd6_dad_starttimer(struct dadq *, int);
+void nd6_dad_stoptimer(struct dadq *);
+void nd6_dad_timer(struct ifaddr *);
+void nd6_dad_ns_output(struct dadq *, struct ifaddr *);
+void nd6_dad_ns_input(struct ifaddr *);
+void nd6_dad_na_input(struct ifaddr *);
static int dad_ignore_ns = 0; /* ignore NS in DAD - specwise incorrect*/
static int dad_maxtry = 15; /* max # of *tries* to transmit DAD packet */
@@ -342,7 +342,7 @@ nd6_ns_input(struct mbuf *m, int off, int icmp6len)
*/
void
nd6_ns_output(struct ifnet *ifp, struct in6_addr *daddr6,
- struct in6_addr *taddr6, struct llinfo_nd6 *ln, int dad)
+ struct in6_addr *taddr6, struct llinfo_nd6 *ln, int dad)
{
struct mbuf *m;
struct ip6_hdr *ip6;
@@ -852,8 +852,8 @@ nd6_na_input(struct mbuf *m, int off, int icmp6len)
*/
void
nd6_na_output(struct ifnet *ifp, struct in6_addr *daddr6,
- struct in6_addr *taddr6, u_long flags, int tlladdr,
- struct sockaddr *sdl0)
+ struct in6_addr *taddr6, u_long flags, int tlladdr,
+ struct sockaddr *sdl0)
{
struct mbuf *m;
struct ip6_hdr *ip6;
@@ -1042,7 +1042,7 @@ struct dadq {
static struct dadq_head dadq;
static int dad_init = 0;
-static struct dadq *
+struct dadq *
nd6_dad_find(struct ifaddr *ifa)
{
struct dadq *dp;
@@ -1054,7 +1054,7 @@ nd6_dad_find(struct ifaddr *ifa)
return NULL;
}
-static void
+void
nd6_dad_starttimer(struct dadq *dp, int ticks)
{
@@ -1063,7 +1063,7 @@ nd6_dad_starttimer(struct dadq *dp, int ticks)
timeout_add(&dp->dad_timer_ch, ticks);
}
-static void
+void
nd6_dad_stoptimer(struct dadq *dp)
{
@@ -1185,7 +1185,7 @@ nd6_dad_stop(struct ifaddr *ifa)
ip6_dad_pending--;
}
-static void
+void
nd6_dad_timer(struct ifaddr *ifa)
{
int s;
@@ -1325,7 +1325,7 @@ nd6_dad_duplicated(struct ifaddr *ifa)
ip6_dad_pending--;
}
-static void
+void
nd6_dad_ns_output(struct dadq *dp, struct ifaddr *ifa)
{
struct in6_ifaddr *ia = (struct in6_ifaddr *)ifa;
@@ -1349,7 +1349,7 @@ nd6_dad_ns_output(struct dadq *dp, struct ifaddr *ifa)
nd6_ns_output(ifp, NULL, &ia->ia_addr.sin6_addr, NULL, 1);
}
-static void
+void
nd6_dad_ns_input(struct ifaddr *ifa)
{
struct in6_ifaddr *ia;
@@ -1396,7 +1396,7 @@ nd6_dad_ns_input(struct ifaddr *ifa)
}
}
-static void
+void
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 1158ff2f0c6..d706afa184c 100644
--- a/sys/netinet6/nd6_rtr.c
+++ b/sys/netinet6/nd6_rtr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6_rtr.c,v 1.50 2009/01/30 11:56:59 rainer Exp $ */
+/* $OpenBSD: nd6_rtr.c,v 1.51 2010/02/08 11:56:09 jsing Exp $ */
/* $KAME: nd6_rtr.c,v 1.97 2001/02/07 11:09:13 itojun Exp $ */
/*
@@ -59,22 +59,20 @@
#define SDL(s) ((struct sockaddr_dl *)s)
-static int rtpref(struct nd_defrouter *);
-static struct nd_defrouter *defrtrlist_update(struct nd_defrouter *);
-static struct in6_ifaddr *in6_ifadd(struct nd_prefix *);
-static struct nd_pfxrouter *pfxrtr_lookup(struct nd_prefix *,
- struct nd_defrouter *);
-static void pfxrtr_add(struct nd_prefix *, struct nd_defrouter *);
-static void pfxrtr_del(struct nd_pfxrouter *);
-static struct nd_pfxrouter *find_pfxlist_reachable_router(struct nd_prefix *);
-static void defrouter_delreq(struct nd_defrouter *);
-static void nd6_rtmsg(int, struct rtentry *);
-static void purge_detached(struct ifnet *);
+int rtpref(struct nd_defrouter *);
+struct nd_defrouter *defrtrlist_update(struct nd_defrouter *);
+struct in6_ifaddr *in6_ifadd(struct nd_prefix *);
+struct nd_pfxrouter *pfxrtr_lookup(struct nd_prefix *, struct nd_defrouter *);
+void pfxrtr_add(struct nd_prefix *, struct nd_defrouter *);
+void pfxrtr_del(struct nd_pfxrouter *);
+struct nd_pfxrouter *find_pfxlist_reachable_router(struct nd_prefix *);
+void defrouter_delreq(struct nd_defrouter *);
+void nd6_rtmsg(int, struct rtentry *);
+void purge_detached(struct ifnet *);
-static void in6_init_address_ltimes(struct nd_prefix *,
- struct in6_addrlifetime *);
+void in6_init_address_ltimes(struct nd_prefix *, struct in6_addrlifetime *);
-static int rt6_deleteroute(struct radix_node *, void *);
+int rt6_deleteroute(struct radix_node *, void *);
extern int nd6_recalc_reachtm_interval;
@@ -412,7 +410,7 @@ nd6_ra_input(struct mbuf *m, int off, int icmp6len)
*/
/* tell the change to user processes watching the routing socket. */
-static void
+void
nd6_rtmsg(int cmd, struct rtentry *rt)
{
struct rt_addrinfo info;
@@ -483,8 +481,7 @@ defrouter_lookup(struct in6_addr *addr, struct ifnet *ifp)
}
void
-defrtrlist_del(dr)
- struct nd_defrouter *dr;
+defrtrlist_del(struct nd_defrouter *dr)
{
struct nd_defrouter *deldr = NULL;
struct in6_ifextra *ext = dr->ifp->if_afdata[AF_INET6];
@@ -535,7 +532,7 @@ defrtrlist_del(dr)
* This is just a subroutine function for defrouter_select(), and should
* not be called from anywhere else.
*/
-static void
+void
defrouter_delreq(struct nd_defrouter *dr)
{
struct rt_addrinfo info;
@@ -583,7 +580,7 @@ defrouter_delreq(struct nd_defrouter *dr)
* remove all default routes from default router list
*/
void
-defrouter_reset()
+defrouter_reset(void)
{
struct nd_defrouter *dr;
@@ -711,7 +708,7 @@ defrouter_select(void)
* for default router selection
* regards router-preference field as a 2-bit signed integer
*/
-static int
+int
rtpref(struct nd_defrouter *dr)
{
#ifdef RTPREF
@@ -738,7 +735,7 @@ rtpref(struct nd_defrouter *dr)
#endif
}
-static struct nd_defrouter *
+struct nd_defrouter *
defrtrlist_update(struct nd_defrouter *new)
{
struct nd_defrouter *dr, *n;
@@ -834,7 +831,7 @@ insert:
return (n);
}
-static struct nd_pfxrouter *
+struct nd_pfxrouter *
pfxrtr_lookup(struct nd_prefix *pr, struct nd_defrouter *dr)
{
struct nd_pfxrouter *search;
@@ -847,7 +844,7 @@ pfxrtr_lookup(struct nd_prefix *pr, struct nd_defrouter *dr)
return (search);
}
-static void
+void
pfxrtr_add(struct nd_prefix *pr, struct nd_defrouter *dr)
{
struct nd_pfxrouter *new;
@@ -862,7 +859,7 @@ pfxrtr_add(struct nd_prefix *pr, struct nd_defrouter *dr)
pfxlist_onlink_check();
}
-static void
+void
pfxrtr_del(struct nd_pfxrouter *pfr)
{
LIST_REMOVE(pfr, pfr_entry);
@@ -886,7 +883,7 @@ nd6_prefix_lookup(struct nd_prefix *pr)
return (search);
}
-static void
+void
purge_detached(struct ifnet *ifp)
{
struct nd_prefix *pr, *pr_next;
@@ -926,7 +923,7 @@ purge_detached(struct ifnet *ifp)
int
nd6_prelist_add(struct nd_prefix *pr, struct nd_defrouter *dr,
- struct nd_prefix **newp)
+ struct nd_prefix **newp)
{
struct nd_prefix *new = NULL;
int i, s;
@@ -1039,8 +1036,7 @@ prelist_remove(struct nd_prefix *pr)
*/
int
-prelist_update(struct nd_prefix *new, struct nd_defrouter *dr,
- 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;
@@ -1292,7 +1288,7 @@ prelist_update(struct nd_prefix *new, struct nd_defrouter *dr,
* detect if a given prefix has a (probably) reachable advertising router.
* XXX: lengthy function name...
*/
-static struct nd_pfxrouter *
+struct nd_pfxrouter *
find_pfxlist_reachable_router(struct nd_prefix *pr)
{
struct nd_pfxrouter *pfxrtr;
@@ -1679,7 +1675,7 @@ nd6_prefix_offlink(struct nd_prefix *pr)
return (error);
}
-static struct in6_ifaddr *
+struct in6_ifaddr *
in6_ifadd(struct nd_prefix *pr)
{
struct ifnet *ifp = pr->ndpr_ifp;
@@ -1822,7 +1818,7 @@ in6_init_prefix_ltimes(struct nd_prefix *ndpr)
return 0;
}
-static void
+void
in6_init_address_ltimes(struct nd_prefix *new, struct in6_addrlifetime *lt6)
{
@@ -1867,7 +1863,7 @@ rt6_flush(struct in6_addr *gateway, struct ifnet *ifp)
splx(s);
}
-static int
+int
rt6_deleteroute(struct radix_node *rn, void *arg)
{
#define SIN6(s) ((struct sockaddr_in6 *)s)