summaryrefslogtreecommitdiffstats
path: root/sys/net/if_gre.c
diff options
context:
space:
mode:
authorsobomax <sobomax@FreeBSD.org>2002-09-06 18:16:03 +0000
committersobomax <sobomax@FreeBSD.org>2002-09-06 18:16:03 +0000
commitafb7f17e9677a446ee8901e93fbea079175d3106 (patch)
treee7789df4ce2409eec88ed29699c5f732253f2307 /sys/net/if_gre.c
parent8775a5b27af9ae378077709867de8c9945a10f09 (diff)
downloadFreeBSD-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/if_gre.c')
-rw-r--r--sys/net/if_gre.c28
1 files changed, 15 insertions, 13 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;
OpenPOWER on IntegriCloud