From 8cf28016080c1f47c139dd9c75419b6341e3eea6 Mon Sep 17 00:00:00 2001 From: phk Date: Sat, 9 Dec 1995 20:47:15 +0000 Subject: Staticize, clean lint. --- sys/net/if.c | 39 ++++++++++++++------------------------- sys/net/if.h | 9 +-------- sys/net/if_ethersubr.c | 14 +++++++++----- sys/net/if_loop.c | 9 ++++++--- sys/net/if_tun.c | 18 +++++++++--------- 5 files changed, 39 insertions(+), 50 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index f0ebb23..bcebdb2 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)if.c 8.3 (Berkeley) 1/4/94 - * $Id: if.c,v 1.22 1995/11/18 13:01:19 bde Exp $ + * $Id: if.c,v 1.23 1995/12/05 02:01:36 davidg Exp $ */ #include @@ -56,7 +56,13 @@ * System initialization */ +static int ifconf __P((int, caddr_t)); static void ifinit __P((void *)); +static void if_qflush __P((struct ifqueue *)); +static void if_slowtimo __P((void *)); +static void link_rtrequest __P((int, struct rtentry *, struct sockaddr *)); +static char *sprint_d __P((u_int, char *, int)); + SYSINIT(interfaces, SI_SUB_PROTO_IF, SI_ORDER_FIRST, ifinit, NULL) @@ -84,9 +90,9 @@ ifinit(dummy) if_slowtimo(0); } -int if_index = 0; -struct ifaddr **ifnet_addrs; -static char *sprint_d __P((u_int, char *, int)); +static int if_index = 0; +static struct ifaddr **ifnet_addrs; + /* * Attach an interface to the @@ -260,23 +266,6 @@ ifa_ifwithnet(addr) } /* - * Find an interface using a specific address family - */ -struct ifaddr * -ifa_ifwithaf(af) - register int af; -{ - register struct ifnet *ifp; - register struct ifaddr *ifa; - - for (ifp = ifnet; ifp; ifp = ifp->if_next) - for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next) - if (ifa->ifa_addr->sa_family == af) - return (ifa); - return ((struct ifaddr *)0); -} - -/* * Find an interface address specific to an interface best matching * a given address. */ @@ -328,7 +317,7 @@ ifaof_ifpforaddr(addr, ifp) * Lookup an appropriate real ifa to point to. * This should be moved to /sys/net/link.c eventually. */ -void +static void link_rtrequest(cmd, rt, sa) int cmd; register struct rtentry *rt; @@ -392,7 +381,7 @@ if_up(ifp) /* * Flush an interface queue. */ -void +static void if_qflush(ifq) register struct ifqueue *ifq; { @@ -413,7 +402,7 @@ if_qflush(ifq) * from softclock, we decrement timers (if set) and * call the appropriate interface routine on expiration. */ -void +static void if_slowtimo(arg) void *arg; { @@ -678,7 +667,7 @@ ifpromisc(ifp, pswitch) * other information. */ /*ARGSUSED*/ -int +static int ifconf(cmd, data) int cmd; caddr_t data; diff --git a/sys/net/if.h b/sys/net/if.h index 19bd37d..5a0e035 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)if.h 8.1 (Berkeley) 6/10/93 - * $Id: if.h,v 1.23 1995/10/13 19:48:00 wollman Exp $ + * $Id: if.h,v 1.24 1995/12/05 02:01:37 davidg Exp $ */ #ifndef _NET_IF_H_ @@ -365,32 +365,25 @@ char *ether_sprintf __P((u_char *)); void if_attach __P((struct ifnet *)); void if_down __P((struct ifnet *)); -void if_qflush __P((struct ifqueue *)); -void if_slowtimo __P((void *)); void if_up __P((struct ifnet *)); #ifdef vax void ifubareset __P((int)); #endif -int ifconf __P((int, caddr_t)); /*void ifinit __P((void));*/ /* declared in systm.h for main() */ int ifioctl __P((struct socket *, int, caddr_t, struct proc *)); int ifpromisc __P((struct ifnet *, int)); struct ifnet *ifunit __P((char *)); struct ifaddr *ifa_ifwithaddr __P((struct sockaddr *)); -struct ifaddr *ifa_ifwithaf __P((int)); struct ifaddr *ifa_ifwithdstaddr __P((struct sockaddr *)); struct ifaddr *ifa_ifwithnet __P((struct sockaddr *)); struct ifaddr *ifa_ifwithroute __P((int, struct sockaddr *, struct sockaddr *)); struct ifaddr *ifaof_ifpforaddr __P((struct sockaddr *, struct ifnet *)); void ifafree __P((struct ifaddr *)); -void link_rtrequest __P((int, struct rtentry *, struct sockaddr *)); -int loioctl __P((struct ifnet *, int, caddr_t)); int looutput __P((struct ifnet *, struct mbuf *, struct sockaddr *, struct rtentry *)); -void lortrequest __P((int, struct rtentry *, struct sockaddr *)); #endif /* KERNEL */ #endif /* !_NET_IF_H_ */ diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 086626c..b349efa 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)if_ethersubr.c 8.1 (Berkeley) 6/10/93 - * $Id: if_ethersubr.c,v 1.10 1995/10/26 20:30:09 julian Exp $ + * $Id: if_ethersubr.c,v 1.11 1995/10/29 15:32:03 phk Exp $ */ #include @@ -116,9 +116,11 @@ ether_output(ifp, m0, dst, rt0) if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) senderr(ENETDOWN); ifp->if_lastchange = time; - if (rt = rt0) { + rt = rt0; + if (rt) { if ((rt->rt_flags & RTF_UP) == 0) { - if (rt0 = rt = rtalloc1(dst, 1, 0UL)) + rt0 = rt = rtalloc1(dst, 1, 0UL); + if (rt0) rt->rt_refcnt--; else senderr(EHOSTUNREACH); @@ -529,8 +531,10 @@ ether_ifattach(ifp) } } -u_char ether_ipmulticast_min[6] = { 0x01, 0x00, 0x5e, 0x00, 0x00, 0x00 }; -u_char ether_ipmulticast_max[6] = { 0x01, 0x00, 0x5e, 0x7f, 0xff, 0xff }; +static u_char ether_ipmulticast_min[6] = + { 0x01, 0x00, 0x5e, 0x00, 0x00, 0x00 }; +static u_char ether_ipmulticast_max[6] = + { 0x01, 0x00, 0x5e, 0x7f, 0xff, 0xff }; /* * Add an Ethernet multicast address or range of addresses to the list for a * given interface. diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c index 8cb5951..cd8568f 100644 --- a/sys/net/if_loop.c +++ b/sys/net/if_loop.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)if_loop.c 8.1 (Berkeley) 6/10/93 - * $Id: if_loop.c,v 1.14 1995/10/26 20:30:13 julian Exp $ + * $Id: if_loop.c,v 1.15 1995/12/02 17:11:11 bde Exp $ */ /* @@ -80,6 +80,9 @@ #include "bpfilter.h" +static int loioctl __P((struct ifnet *, int, caddr_t)); +static void lortrequest __P((int, struct rtentry *, struct sockaddr *)); + static void loopattach __P((void *)); PSEUDO_SET(loopattach, if_loop); @@ -214,7 +217,7 @@ looutput(ifp, m, dst, rt) } /* ARGSUSED */ -void +static void lortrequest(cmd, rt, sa) int cmd; struct rtentry *rt; @@ -229,7 +232,7 @@ lortrequest(cmd, rt, sa) * Process an ioctl request. */ /* ARGSUSED */ -int +static int loioctl(ifp, cmd, data) register struct ifnet *ifp; int cmd; diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index 97678c5..7764be6 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -30,9 +30,8 @@ #include #include #include -#ifdef __FreeBSD__ #include -#endif +#include #ifdef DEVFS #include #endif /*DEVFS*/ @@ -72,13 +71,14 @@ PSEUDO_SET(tunattach, if_tun); #define TUNDEBUG if (tundebug) printf -int tundebug = 0; +static int tundebug = 0; +SYSCTL_INT(_debug, OID_AUTO, if_tun_debug, CTLFLAG_RD, &tundebug, 0, ""); -struct tun_softc tunctl[NTUN]; +static struct tun_softc tunctl[NTUN]; -int tunoutput __P((struct ifnet *, struct mbuf *, struct sockaddr *, +static int tunoutput __P((struct ifnet *, struct mbuf *, struct sockaddr *, struct rtentry *rt)); -int tunifioctl __P((struct ifnet *, int, caddr_t)); +static int tunifioctl __P((struct ifnet *, int, caddr_t)); static int tuninit __P((int)); static d_open_t tunopen; @@ -108,7 +108,6 @@ tunattach(dummy) register int i; struct ifnet *ifp; dev_t dev; - char name[32]; if( tun_devsw_installed ) return; dev = makedev(CDEV_MAJOR, 0); @@ -157,7 +156,8 @@ tunopen(dev, flag, mode, p) struct tun_softc *tp; register int unit, error; - if (error = suser(p->p_ucred, &p->p_acflag)) + error = suser(p->p_ucred, &p->p_acflag); + if (error) return (error); if ((unit = minor(dev)) >= NTUN) @@ -376,7 +376,7 @@ tunoutput(ifp, m0, dst, rt) if (tp->tun_flags & TUN_ASYNC && tp->tun_pgrp) { if (tp->tun_pgrp > 0) gsignal(tp->tun_pgrp, SIGIO); - else if (p = pfind(-tp->tun_pgrp)) + else if ((p = pfind(-tp->tun_pgrp)) != 0) psignal(p, SIGIO); } selwakeup(&tp->tun_rsel); -- cgit v1.1