diff options
author | sobomax <sobomax@FreeBSD.org> | 2002-09-06 18:16:03 +0000 |
---|---|---|
committer | sobomax <sobomax@FreeBSD.org> | 2002-09-06 18:16:03 +0000 |
commit | afb7f17e9677a446ee8901e93fbea079175d3106 (patch) | |
tree | e7789df4ce2409eec88ed29699c5f732253f2307 /sys/net | |
parent | 8775a5b27af9ae378077709867de8c9945a10f09 (diff) | |
download | FreeBSD-src-afb7f17e9677a446ee8901e93fbea079175d3106.zip FreeBSD-src-afb7f17e9677a446ee8901e93fbea079175d3106.tar.gz |
Reduce namespace pollution by staticizing everything, which doesn't need to
be visible from outside of the module.
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if_gre.c | 28 | ||||
-rw-r--r-- | sys/net/if_gre.h | 4 |
2 files changed, 15 insertions, 17 deletions
diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c index 22d7e94..101bad6 100644 --- a/sys/net/if_gre.c +++ b/sys/net/if_gre.c @@ -115,17 +115,19 @@ __RCSID("@(#) $FreeBSD$"); static MALLOC_DEFINE(M_GRE, GRENAME, "Generic Routing Encapsulation"); struct gre_softc_head gre_softc_list; -int ip_gre_ttl = GRE_TTL; -int gre_clone_create __P((struct if_clone *, int)); -void gre_clone_destroy __P((struct ifnet *)); +static int gre_clone_create __P((struct if_clone *, int)); +static void gre_clone_destroy __P((struct ifnet *)); +static int gre_ioctl(struct ifnet *, u_long, caddr_t); +static int gre_output(struct ifnet *, struct mbuf *, struct sockaddr *, + struct rtentry *rt); -struct if_clone gre_cloner = +static struct if_clone gre_cloner = IF_CLONE_INITIALIZER("gre", gre_clone_create, gre_clone_destroy, 0, IF_MAXUNIT); -int gre_compute_route(struct gre_softc *sc); +static int gre_compute_route(struct gre_softc *sc); -void greattach __P((void)); +static void greattach __P((void)); #ifdef INET extern struct domain inetdomain; @@ -164,7 +166,7 @@ SYSCTL_INT(_net_link_gre, OID_AUTO, max_nesting, CTLFLAG_RW, &max_gre_nesting, 0, "Max nested tunnels"); /* ARGSUSED */ -void +static void greattach(void) { @@ -172,7 +174,7 @@ greattach(void) if_clone_attach(&gre_cloner); } -int +static int gre_clone_create(ifc, unit) struct if_clone *ifc; int unit; @@ -206,7 +208,7 @@ gre_clone_create(ifc, unit) return (0); } -void +static void gre_clone_destroy(ifp) struct ifnet *ifp; { @@ -228,7 +230,7 @@ gre_clone_destroy(ifp) * The output routine. Takes a packet and encapsulates it in the protocol * given by sc->g_proto. See also RFC 1701 and RFC 2004 */ -int +static int gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, struct rtentry *rt) { @@ -400,7 +402,7 @@ gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, gh->gi_src = sc->g_src; gh->gi_dst = sc->g_dst; ((struct ip*)gh)->ip_hl = (sizeof(struct ip)) >> 2; - ((struct ip*)gh)->ip_ttl = ip_gre_ttl; + ((struct ip*)gh)->ip_ttl = GRE_TTL; ((struct ip*)gh)->ip_tos = ip->ip_tos; ((struct ip*)gh)->ip_id = ip->ip_id; gh->gi_len = m->m_pkthdr.len; @@ -417,7 +419,7 @@ gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, return (error); } -int +static int gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { struct ifreq *ifr = (struct ifreq *)data; @@ -658,7 +660,7 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) * a-->b. We know that this one exists as in normal operation we have * at least a default route which matches. */ -int +static int gre_compute_route(struct gre_softc *sc) { struct route *ro; diff --git a/sys/net/if_gre.h b/sys/net/if_gre.h index 2254b3b..3196378 100644 --- a/sys/net/if_gre.h +++ b/sys/net/if_gre.h @@ -140,7 +140,6 @@ struct mobip_h { #define MOB_H_SBIT 0x0080 #define GRE_TTL 30 -extern int ip_gre_ttl; /* * ioctls needed to manipulate the interface @@ -157,9 +156,6 @@ extern int ip_gre_ttl; LIST_HEAD(gre_softc_head, gre_softc); extern struct gre_softc_head gre_softc_list; -int gre_ioctl __P((struct ifnet *, u_long, caddr_t)); -int gre_output __P((struct ifnet *, struct mbuf *, struct sockaddr *, - struct rtentry *rt)); u_short gre_in_cksum(u_short *p, u_int len); #endif /* _KERNEL */ |