Reduce namespace pollution by staticizing everything, which doesn't need to

be visible from outside of the module.
This commit is contained in:
sobomax 2002-09-06 18:16:03 +00:00
parent 8775a5b27a
commit afb7f17e96
3 changed files with 19 additions and 21 deletions

View File

@ -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;

View File

@ -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 */

View File

@ -100,9 +100,9 @@ __RCSID("@(#) $FreeBSD$");
void gre_inet_ntoa(struct in_addr in); /* XXX */
#endif
struct gre_softc *gre_lookup __P((struct mbuf *, u_int8_t));
static struct gre_softc *gre_lookup __P((struct mbuf *, u_int8_t));
int gre_input2 __P((struct mbuf *, int, u_char));
static int gre_input2 __P((struct mbuf *, int, u_char));
/*
* De-encapsulate a packet and feed it back through ip input (this
@ -146,7 +146,7 @@ gre_input(m, va_alist)
* routine.
*/
int
static int
gre_input2(struct mbuf *m ,int hlen, u_char proto)
{
struct greip *gip = mtod(m, struct greip *);
@ -339,7 +339,7 @@ gre_mobile_input(m, va_alist)
/*
* Find the gre interface associated with our src/dst/proto set.
*/
struct gre_softc *
static struct gre_softc *
gre_lookup(m, proto)
struct mbuf *m;
u_int8_t proto;