diff options
30 files changed, 243 insertions, 357 deletions
diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c index cd0a35e..85b41ee 100644 --- a/sys/netinet/igmp.c +++ b/sys/netinet/igmp.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * @(#)igmp.c 8.1 (Berkeley) 7/19/93 - * $Id: igmp.c,v 1.10 1995/05/16 01:28:29 davidg Exp $ + * $Id: igmp.c,v 1.12 1995/06/13 17:51:05 wollman Exp $ */ /* @@ -53,8 +53,7 @@ #include <sys/mbuf.h> #include <sys/socket.h> #include <sys/protosw.h> -#include <sys/proc.h> /* XXX needed for sysctl.h */ -#include <vm/vm.h> /* XXX needed for sysctl.h */ +#include <sys/kernel.h> #include <sys/sysctl.h> #include <net/if.h> @@ -70,6 +69,9 @@ struct igmpstat igmpstat; +SYSCTL_STRUCT(_net_inet_igmp, IGMPCTL_STATS, stats, CTLFLAG_RD, + &igmpstat, igmpstat, ""); + static int igmp_timers_are_running; static u_long igmp_all_hosts_group; static u_long igmp_local_group; @@ -608,20 +610,3 @@ igmp_sendleave(inm) { igmp_sendpkt(inm, IGMP_HOST_LEAVE_MESSAGE); } - -int -igmp_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, - void *newp, size_t newlen) -{ - /* All sysctl names at this level are terminal. */ - if (namelen != 1) - return ENOTDIR; /* XXX overloaded */ - - switch(name[0]) { - case IGMPCTL_STATS: - return sysctl_rdstruct(oldp, oldlenp, newp, &igmpstat, - sizeof igmpstat); - default: - return ENOPROTOOPT; - } -} diff --git a/sys/netinet/igmp_var.h b/sys/netinet/igmp_var.h index 1c013c7..55ee6da1 100644 --- a/sys/netinet/igmp_var.h +++ b/sys/netinet/igmp_var.h @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * @(#)igmp_var.h 8.1 (Berkeley) 7/19/93 - * $Id: igmp_var.h,v 1.5 1995/02/16 00:27:42 wollman Exp $ + * $Id: igmp_var.h,v 1.6 1995/06/13 17:51:07 wollman Exp $ */ #ifndef _NETINET_IGMP_VAR_H_ @@ -73,7 +73,6 @@ void igmp_joingroup __P((struct in_multi *)); void igmp_leavegroup __P((struct in_multi *)); void igmp_fasttimo __P((void)); void igmp_slowtimo __P((void)); -int igmp_sysctl(int *, u_int, void *, size_t *, void *, size_t); #endif /* diff --git a/sys/netinet/in.c b/sys/netinet/in.c index f2ee490..9e4778d 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)in.c 8.4 (Berkeley) 1/9/95 - * $Id: in.c,v 1.16 1995/09/21 17:50:43 wollman Exp $ + * $Id: in.c,v 1.17 1995/10/29 15:32:21 phk Exp $ */ #include <sys/param.h> @@ -65,10 +65,15 @@ struct multi_kludge { struct in_multihead mk_head; }; +static u_long in_netof __P((struct in_addr)); +static void in_socktrim __P((struct sockaddr_in *)); +static int in_ifinit __P((struct ifnet *, + struct in_ifaddr *, struct sockaddr_in *, int)); +static void in_ifscrub __P((struct ifnet *, struct in_ifaddr *)); /* * Return the network number from an internet address. */ -u_long +static u_long in_netof(in) struct in_addr in; { @@ -151,7 +156,7 @@ in_canforward(in) /* * Trim a mask in a sockaddr */ -void +static void in_socktrim(ap) struct sockaddr_in *ap; { @@ -452,7 +457,7 @@ in_control(so, cmd, data, ifp) /* * Delete any existing route for an interface. */ -void +static void in_ifscrub(ifp, ia) register struct ifnet *ifp; register struct in_ifaddr *ia; @@ -471,7 +476,7 @@ in_ifscrub(ifp, ia) * Initialize an interface's internet address * and routing table entry. */ -int +static int in_ifinit(ifp, ia, sin, scrub) register struct ifnet *ifp; register struct in_ifaddr *ia; diff --git a/sys/netinet/in.h b/sys/netinet/in.h index 09e5bc9..175269e 100644 --- a/sys/netinet/in.h +++ b/sys/netinet/in.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)in.h 8.3 (Berkeley) 1/3/94 - * $Id: in.h,v 1.11 1995/07/18 09:56:42 peter Exp $ + * $Id: in.h,v 1.12 1995/11/01 17:18:26 wollman Exp $ */ #ifndef _NETINET_IN_H_ @@ -260,8 +260,6 @@ int in_broadcast __P((struct in_addr, struct ifnet *)); int in_canforward __P((struct in_addr)); int in_cksum __P((struct mbuf *, int)); int in_localaddr __P((struct in_addr)); -u_long in_netof __P((struct in_addr)); -void in_socktrim __P((struct sockaddr_in *)); char *inet_ntoa __P((struct in_addr)); /* in libkern */ #endif diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 6162d84..73d564f 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)in_pcb.c 8.4 (Berkeley) 5/24/95 - * $Id: in_pcb.c,v 1.13 1995/09/21 17:55:49 wollman Exp $ + * $Id: in_pcb.c,v 1.14 1995/10/29 15:32:25 phk Exp $ */ #include <sys/param.h> @@ -59,6 +59,9 @@ struct in_addr zeroin_addr; +static void in_pcbinshash __P((struct inpcb *)); +static void in_rtchange __P((struct inpcb *, int)); + int in_pcballoc(so, pcbinfo) struct socket *so; @@ -484,7 +487,7 @@ in_losing(inp) * After a routing change, flush old routing * and allocate a (hopefully) better one. */ -void +static void in_rtchange(inp, errno) register struct inpcb *inp; int errno; @@ -593,7 +596,7 @@ in_pcblookuphash(pcbinfo, faddr, fport_arg, laddr, lport_arg) /* * Insert PCB into hash chain. Must be called at splnet. */ -void +static void in_pcbinshash(inp) struct inpcb *inp; { diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index 248ad7a..a956c70 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)in_pcb.h 8.1 (Berkeley) 6/10/93 - * $Id: in_pcb.h,v 1.7 1995/04/09 16:46:47 jkh Exp $ + * $Id: in_pcb.h,v 1.8 1995/04/10 00:43:18 davidg Exp $ */ #ifndef _NETINET_IN_PCB_H_ @@ -88,7 +88,6 @@ int in_pcbbind __P((struct inpcb *, struct mbuf *)); int in_pcbconnect __P((struct inpcb *, struct mbuf *)); void in_pcbdetach __P((struct inpcb *)); void in_pcbdisconnect __P((struct inpcb *)); -void in_pcbinshash __P((struct inpcb *)); int in_pcbladdr __P((struct inpcb *, struct mbuf *, struct sockaddr_in **)); struct inpcb * @@ -100,7 +99,6 @@ struct inpcb * void in_pcbnotify __P((struct inpcbhead *, struct sockaddr *, u_int, struct in_addr, u_int, int, void (*)(struct inpcb *, int))); void in_pcbrehash __P((struct inpcb *)); -void in_rtchange __P((struct inpcb *, int)); void in_setpeeraddr __P((struct inpcb *, struct mbuf *)); void in_setsockaddr __P((struct inpcb *, struct mbuf *)); #endif diff --git a/sys/netinet/in_proto.c b/sys/netinet/in_proto.c index 6d3c2f0..f181d78 100644 --- a/sys/netinet/in_proto.c +++ b/sys/netinet/in_proto.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)in_proto.c 8.2 (Berkeley) 2/9/95 - * $Id: in_proto.c,v 1.19 1995/10/26 20:30:42 julian Exp $ + * $Id: in_proto.c,v 1.20 1995/11/09 20:22:55 phk Exp $ */ #include <sys/param.h> @@ -95,18 +95,18 @@ struct protosw inetsw[] = { { 0, &inetdomain, 0, 0, 0, ip_output, 0, 0, 0, - ip_init, 0, ip_slowtimo, ip_drain, ip_sysctl + ip_init, 0, ip_slowtimo, ip_drain }, { SOCK_DGRAM, &inetdomain, IPPROTO_UDP, PR_ATOMIC|PR_ADDR, udp_input, 0, udp_ctlinput, ip_ctloutput, udp_usrreq, - udp_init, 0, 0, 0, udp_sysctl + udp_init }, { SOCK_STREAM, &inetdomain, IPPROTO_TCP, PR_CONNREQUIRED|PR_IMPLOPCL|PR_WANTRCVD, tcp_input, 0, tcp_ctlinput, tcp_ctloutput, tcp_usrreq, - tcp_init, tcp_fasttimo, tcp_slowtimo, tcp_drain, tcp_sysctl + tcp_init, tcp_fasttimo, tcp_slowtimo, tcp_drain }, { SOCK_RAW, &inetdomain, IPPROTO_RAW, PR_ATOMIC|PR_ADDR, rip_input, rip_output, 0, rip_ctloutput, @@ -115,13 +115,12 @@ struct protosw inetsw[] = { }, { SOCK_RAW, &inetdomain, IPPROTO_ICMP, PR_ATOMIC|PR_ADDR, icmp_input, rip_output, 0, rip_ctloutput, - rip_usrreq, - 0, 0, 0, 0, icmp_sysctl + rip_usrreq }, { SOCK_RAW, &inetdomain, IPPROTO_IGMP, PR_ATOMIC|PR_ADDR, igmp_input, rip_output, 0, rip_ctloutput, rip_usrreq, - igmp_init, igmp_fasttimo, igmp_slowtimo, 0, igmp_sysctl + igmp_init, igmp_fasttimo, igmp_slowtimo }, { SOCK_RAW, &inetdomain, IPPROTO_RSVP, PR_ATOMIC|PR_ADDR, rsvp_input, rip_output, 0, rip_ctloutput, diff --git a/sys/netinet/in_rmx.c b/sys/netinet/in_rmx.c index cd8738b..ee3be35 100644 --- a/sys/netinet/in_rmx.c +++ b/sys/netinet/in_rmx.c @@ -26,7 +26,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: in_rmx.c,v 1.17 1995/10/29 15:32:28 phk Exp $ + * $Id: in_rmx.c,v 1.18 1995/11/09 20:22:59 phk Exp $ */ /* @@ -147,17 +147,17 @@ in_matroute(void *v_arg, struct radix_node_head *head) return rn; } -int rtq_reallyold = 60*60; +static int rtq_reallyold = 60*60; /* one hour is ``really old'' */ SYSCTL_INT(_net_inet_ip, IPCTL_RTEXPIRE, rtexpire, CTLFLAG_RW, &rtq_reallyold , 0, ""); -int rtq_minreallyold = 10; +static int rtq_minreallyold = 10; /* never automatically crank down to less */ SYSCTL_INT(_net_inet_ip, IPCTL_RTMINEXPIRE, rtminexpire, CTLFLAG_RW, &rtq_minreallyold , 0, ""); -int rtq_toomany = 128; +static int rtq_toomany = 128; /* 128 cached routes is ``too many'' */ SYSCTL_INT(_net_inet_ip, IPCTL_RTMAXCACHE, rtmaxcache, CTLFLAG_RW, &rtq_toomany , 0, ""); @@ -251,7 +251,7 @@ in_rtqkill(struct radix_node *rn, void *rock) } #define RTQ_TIMEOUT 60*10 /* run no less than once every ten minutes */ -int rtq_timeout = RTQ_TIMEOUT; +static int rtq_timeout = RTQ_TIMEOUT; static void in_rtqtimo(void *rock) @@ -301,7 +301,8 @@ in_rtqtimo(void *rock) timeout(in_rtqtimo, rock, hzto(&atv)); } -void +#ifdef never_used +static void in_rtqdrain(void) { struct radix_node_head *rnh = rt_tables[AF_INET]; @@ -316,6 +317,7 @@ in_rtqdrain(void) rnh->rnh_walktree(rnh, in_rtqkill, &arg); splx(s); } +#endif /* * Initialize our routing tree. diff --git a/sys/netinet/in_var.h b/sys/netinet/in_var.h index 15c059e..9b3017a 100644 --- a/sys/netinet/in_var.h +++ b/sys/netinet/in_var.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)in_var.h 8.2 (Berkeley) 1/9/95 - * $Id: in_var.h,v 1.10 1995/05/30 08:09:32 rgrimes Exp $ + * $Id: in_var.h,v 1.11 1995/09/21 17:50:45 wollman Exp $ */ #ifndef _NETINET_IN_VAR_H_ @@ -217,11 +217,8 @@ struct in_multistep { IN_NEXT_MULTI((step), (inm)); \ } -int in_ifinit __P((struct ifnet *, - struct in_ifaddr *, struct sockaddr_in *, int)); struct in_multi *in_addmulti __P((struct in_addr *, struct ifnet *)); void in_delmulti __P((struct in_multi *)); -void in_ifscrub __P((struct ifnet *, struct in_ifaddr *)); int in_control __P((struct socket *, u_long, caddr_t, struct ifnet *)); #endif /* KERNEL */ diff --git a/sys/netinet/ip_fw.c b/sys/netinet/ip_fw.c index d6cfa42..fc55aa8 100644 --- a/sys/netinet/ip_fw.c +++ b/sys/netinet/ip_fw.c @@ -11,7 +11,7 @@ * * This software is provided ``AS IS'' without any warranties of any kind. * - * $Id: ip_fw.c,v 1.24 1995/10/23 03:58:06 ugen Exp $ + * $Id: ip_fw.c,v 1.25 1995/10/29 15:32:31 phk Exp $ */ /* @@ -75,7 +75,7 @@ /* * Returns TRUE if the port is matched by the vector, FALSE otherwise */ -inline int +static inline int port_match(portptr, nports, port, range_flag) u_short *portptr; int nports; @@ -99,7 +99,7 @@ port_match(portptr, nports, port, range_flag) return FALSE; } -int +static int tcpflg_match(tcp, f) struct tcphdr *tcp; struct ip_fw *f; @@ -118,7 +118,7 @@ tcpflg_match(tcp, f) } -int +static int ipopts_match(ip, f) struct ip *ip; struct ip_fw *f; @@ -894,7 +894,7 @@ clr_entry(chainptr, frwl) return (EINVAL); } -struct ip_fw * +static struct ip_fw * check_ipfw_struct(m) struct mbuf *m; { diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index 507d770..8078f99 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ip_icmp.c 8.2 (Berkeley) 1/4/94 - * $Id: ip_icmp.c,v 1.9 1995/08/29 17:49:04 wollman Exp $ + * $Id: ip_icmp.c,v 1.10 1995/09/18 15:51:35 wollman Exp $ */ #include <sys/param.h> @@ -64,11 +64,20 @@ */ struct icmpstat icmpstat; -int icmpmaskrepl = 0; +SYSCTL_STRUCT(_net_inet_icmp, ICMPCTL_STATS, stats, CTLFLAG_RD, + &icmpstat, icmpstat, ""); + +static int icmpmaskrepl = 0; +SYSCTL_INT(_net_inet_icmp, ICMPCTL_MASKREPL, maskrepl, CTLFLAG_RW, + &icmpmaskrepl, 0, ""); + #ifdef ICMPPRINTFS int icmpprintfs = 0; #endif +static void icmp_reflect __P((struct mbuf *)); +static void icmp_send __P((struct mbuf *, struct mbuf *)); + extern struct protosw inetsw[]; /* @@ -171,7 +180,6 @@ freeit: static struct sockaddr_in icmpsrc = { sizeof (struct sockaddr_in), AF_INET }; static struct sockaddr_in icmpdst = { sizeof (struct sockaddr_in), AF_INET }; static struct sockaddr_in icmpgw = { sizeof (struct sockaddr_in), AF_INET }; -struct sockaddr_in icmpmask = { 8, 0 }; /* * Process a received ICMP message. @@ -464,7 +472,7 @@ freeit: /* * Reflect the ip packet back to the source */ -void +static void icmp_reflect(m) struct mbuf *m; { @@ -589,7 +597,7 @@ done: * Send an icmp packet back to the ip level, * after supplying a checksum. */ -void +static void icmp_send(m, opts) register struct mbuf *m; struct mbuf *opts; @@ -628,31 +636,6 @@ iptime() return (htonl(t)); } -int -icmp_sysctl(name, namelen, oldp, oldlenp, newp, newlen) - int *name; - u_int namelen; - void *oldp; - size_t *oldlenp; - void *newp; - size_t newlen; -{ - /* All sysctl names at this level are terminal. */ - if (namelen != 1) - return (ENOTDIR); /* XXX overloaded */ - - switch (name[0]) { - case ICMPCTL_MASKREPL: - return (sysctl_int(oldp, oldlenp, newp, newlen, &icmpmaskrepl)); - case ICMPCTL_STATS: - return (sysctl_rdstruct(oldp, oldlenp, newp, &icmpstat, - sizeof icmpstat)); - default: - return (ENOPROTOOPT); - } - /* NOTREACHED */ -} - #ifdef MTUDISC /* * Return the next larger or smaller MTU plateau (table from RFC 1191) diff --git a/sys/netinet/ip_icmp.h b/sys/netinet/ip_icmp.h index aa0e3e1..8de1a69 100644 --- a/sys/netinet/ip_icmp.h +++ b/sys/netinet/ip_icmp.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ip_icmp.h 8.1 (Berkeley) 6/10/93 - * $Id: ip_icmp.h,v 1.3 1994/08/21 05:27:31 paul Exp $ + * $Id: ip_icmp.h,v 1.4 1995/05/30 08:09:43 rgrimes Exp $ */ #ifndef _NETINET_IP_ICMP_H_ @@ -158,9 +158,6 @@ struct icmp { #ifdef KERNEL void icmp_error __P((struct mbuf *, int, int, n_long, struct ifnet *)); void icmp_input __P((struct mbuf *, int)); -void icmp_reflect __P((struct mbuf *)); -void icmp_send __P((struct mbuf *, struct mbuf *)); -int icmp_sysctl __P((int *, u_int, void *, size_t *, void *, size_t)); #endif #endif diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 383573b..b3df6fe 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ip_input.c 8.2 (Berkeley) 1/4/94 - * $Id: ip_input.c,v 1.26 1995/07/18 09:56:44 peter Exp $ + * $Id: ip_input.c,v 1.27 1995/11/01 17:18:27 wollman Exp $ */ #include <sys/param.h> @@ -82,25 +82,49 @@ struct socket *ip_rsvpd; #ifndef DIRECTED_BROADCAST #define DIRECTED_BROADCAST 0 #endif -int ipforwarding = IPFORWARDING; -int ipsendredirects = IPSENDREDIRECTS; -int ipdirbroadcast = DIRECTED_BROADCAST; + +static int ipforwarding = IPFORWARDING; +SYSCTL_INT(_net_inet_ip, IPCTL_FORWARDING, forwarding, CTLFLAG_RW, + &ipforwarding, 0, ""); + +static int ipsendredirects = IPSENDREDIRECTS; +SYSCTL_INT(_net_inet_ip, IPCTL_SENDREDIRECTS, redirect, CTLFLAG_RW, + &ipsendredirects, 0, ""); + +static int ipdirbroadcast = DIRECTED_BROADCAST; +SYSCTL_INT(_net_inet_ip, IPCTL_DIRECTEDBROADCAST, directed_broadcast, + CTLFLAG_RW, &ipdirbroadcast, 0, ""); + int ip_defttl = IPDEFTTL; -int ip_dosourceroute = 0; +SYSCTL_INT(_net_inet_ip, IPCTL_DEFTTL, ttl, CTLFLAG_RW, + &ip_defttl, 0, ""); + +static int ip_dosourceroute = 0; +SYSCTL_INT(_net_inet_ip, IPCTL_SOURCEROUTE, sourceroute, CTLFLAG_RW, + &ip_dosourceroute, 0, ""); #ifdef DIAGNOSTIC -int ipprintfs = 0; +static int ipprintfs = 0; #endif extern struct domain inetdomain; extern struct protosw inetsw[]; u_char ip_protox[IPPROTO_MAX]; -int ipqmaxlen = IFQ_MAXLEN; +static int ipqmaxlen = IFQ_MAXLEN; struct in_ifaddr *in_ifaddr; /* first inet address */ struct ifqueue ipintrq; +SYSCTL_INT(_net_inet_ip, IPCTL_INTRQMAXLEN, intr_queue_maxlen, CTLFLAG_RD, + &ipintrq.ifq_maxlen, 0, ""); +SYSCTL_INT(_net_inet_ip, IPCTL_INTRQDROPS, intr_queue_drops, CTLFLAG_RD, + &ipintrq.ifq_drops, 0, ""); struct ipstat ipstat; struct ipq ipq; +#ifdef IPCTL_DEFMTU +SYSCTL_INT(_net_inet_ip, IPCTL_DEFMTU, mtu, CTLFLAG_RW, + &ip_mtu, 0, ""); +#endif + /* * We need to save the IP options in case a protocol wants to respond * to an incoming packet over the same route if the packet got here @@ -108,7 +132,7 @@ struct ipq ipq; * maintenance when the remote end is on a network that is not known * to us. */ -int ip_nhops = 0; +static int ip_nhops = 0; static struct ip_srcrt { struct in_addr dst; /* final destination */ char nop; /* one NOP to align */ @@ -117,6 +141,16 @@ static struct ip_srcrt { } ip_srcrt; static void save_rte __P((u_char *, struct in_addr)); +static void ip_deq __P((struct ipasfrag *)); +static int ip_dooptions __P((struct mbuf *)); +static void ip_enq __P((struct ipasfrag *, struct ipasfrag *)); +static void ip_forward __P((struct mbuf *, int)); +static void ip_freef __P((struct ipq *)); +static struct ip * + ip_reass __P((struct ipasfrag *, struct ipq *)); +static struct in_ifaddr * + ip_rtaddr __P((struct in_addr)); +static void ipintr __P((void)); /* * IP initialization: fill in IP protocol switch table. * All protocols not implemented in kernel go to raw IP protocol handler. @@ -142,14 +176,14 @@ ip_init() ipintrq.ifq_maxlen = ipqmaxlen; } -struct sockaddr_in ipaddr = { sizeof(ipaddr), AF_INET }; +static struct sockaddr_in ipaddr = { sizeof(ipaddr), AF_INET }; struct route ipforward_rt; /* * Ip input routine. Checksum and byte swap header. If fragmented * try to reassemble. Process options. Pass to next level. */ -void +static void ipintr(void) { register struct ip *ip; @@ -444,7 +478,7 @@ NETISR_SET(NETISR_IP, ipintr); * reassembly of this datagram already exists, then it * is given as fp; otherwise have to make a chain. */ -struct ip * +static struct ip * ip_reass(ip, fp) register struct ipasfrag *ip; register struct ipq *fp; @@ -585,7 +619,7 @@ dropfrag: * Free a fragment reassembly header and all * associated datagrams. */ -void +static void ip_freef(fp) struct ipq *fp; { @@ -604,7 +638,7 @@ ip_freef(fp) * Put an ip fragment on a reassembly chain. * Like insque, but pointers in middle of structure. */ -void +static void ip_enq(p, prev) register struct ipasfrag *p, *prev; { @@ -618,7 +652,7 @@ ip_enq(p, prev) /* * To ip_enq as remque is to insque. */ -void +static void ip_deq(p) register struct ipasfrag *p; { @@ -674,7 +708,7 @@ ip_drain() * Returns 1 if packet has been forwarded/freed, * 0 if the packet should be processed further. */ -int +static int ip_dooptions(m) struct mbuf *m; { @@ -880,7 +914,7 @@ bad: * Given address of next destination (final or next hop), * return internet address info of interface to be used to get there. */ -struct in_ifaddr * +static struct in_ifaddr * ip_rtaddr(dst) struct in_addr dst; { @@ -1046,7 +1080,7 @@ u_char inetctlerrmap[PRC_NCMDS] = { * The srcrt parameter indicates whether the packet is being forwarded * via a source route. */ -void +static void ip_forward(m, srcrt) struct mbuf *m; int srcrt; @@ -1189,57 +1223,6 @@ ip_forward(m, srcrt) } int -ip_sysctl(name, namelen, oldp, oldlenp, newp, newlen) - int *name; - u_int namelen; - void *oldp; - size_t *oldlenp; - void *newp; - size_t newlen; -{ - /* All sysctl names at this level are terminal. */ - if (namelen != 1) - return (ENOTDIR); - - switch (name[0]) { - case IPCTL_FORWARDING: - return (sysctl_int(oldp, oldlenp, newp, newlen, &ipforwarding)); - case IPCTL_SENDREDIRECTS: - return (sysctl_int(oldp, oldlenp, newp, newlen, - &ipsendredirects)); - case IPCTL_DIRECTEDBROADCAST: - return (sysctl_int(oldp, oldlenp, newp, newlen, - &ipdirbroadcast)); - case IPCTL_DEFTTL: - return (sysctl_int(oldp, oldlenp, newp, newlen, &ip_defttl)); - case IPCTL_SOURCEROUTE: - return (sysctl_int(oldp, oldlenp, newp, newlen, - &ip_dosourceroute)); -#ifdef notyet - case IPCTL_DEFMTU: - return (sysctl_int(oldp, oldlenp, newp, newlen, &ip_mtu)); -#endif - case IPCTL_RTEXPIRE: - return (sysctl_int(oldp, oldlenp, newp, newlen, - &rtq_reallyold)); - case IPCTL_RTMINEXPIRE: - return (sysctl_int(oldp, oldlenp, newp, newlen, - &rtq_minreallyold)); - case IPCTL_RTMAXCACHE: - return (sysctl_int(oldp, oldlenp, newp, newlen, - &rtq_toomany)); - case IPCTL_INTRQMAXLEN: - return (sysctl_rdint(oldp, oldlenp, newp, - ipintrq.ifq_maxlen)); - case IPCTL_INTRQDROPS: - return (sysctl_rdint(oldp, oldlenp, newp, ipintrq.ifq_drops)); - default: - return (EOPNOTSUPP); - } - /* NOTREACHED */ -} - -int ip_rsvp_init(struct socket *so) { if (so->so_type != SOCK_RAW || diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c index 0d74d83..593ea8c 100644 --- a/sys/netinet/ip_mroute.c +++ b/sys/netinet/ip_mroute.c @@ -9,7 +9,7 @@ * Modified by Bill Fenner, PARC, April 1995 * * MROUTING Revision: 3.5 - * $Id: ip_mroute.c,v 1.23 1995/10/06 19:30:43 wollman Exp $ + * $Id: ip_mroute.c,v 1.24 1995/10/29 15:32:35 phk Exp $ */ @@ -58,7 +58,7 @@ */ struct socket *ip_mrouter = NULL; -u_int ip_mrtproto = 0; +static u_int ip_mrtproto = 0; struct mrtstat mrtstat; u_int rsvpdebug = 0; @@ -197,7 +197,7 @@ struct mrtstat mrtstat; int ip_mrtproto = IGMP_DVMRP; /* for netstat only */ #else /* MROUTE_LKM */ extern struct mrtstat mrtstat; -extern int ip_mrtproto; +static int ip_mrtproto; #endif #define NO_RTE_FOUND 0x1 @@ -206,13 +206,13 @@ extern int ip_mrtproto; struct mbuf *mfctable[MFCTBLSIZ]; u_char nexpire[MFCTBLSIZ]; struct vif viftable[MAXVIFS]; -u_int mrtdebug = 0; /* debug level */ +static u_int mrtdebug = 0; /* debug level */ #define DEBUG_MFC 0x02 #define DEBUG_FORWARD 0x04 #define DEBUG_EXPIRE 0x08 #define DEBUG_XMIT 0x10 -u_int tbfdebug = 0; /* tbf debug level */ -u_int rsvpdebug = 0; /* rsvp debug level */ +static u_int tbfdebug = 0; /* tbf debug level */ +static u_int rsvpdebug = 0; /* rsvp debug level */ #define EXPIRE_TIMEOUT (hz / 4) /* 4x / second */ #define UPCALL_EXPIRE 6 /* number of timeouts */ @@ -239,7 +239,7 @@ struct ifnet multicast_decap_if[MAXVIFS]; #define ENCAP_PROTO IPPROTO_IPIP /* 4 */ /* prototype IP hdr for encapsulated packets */ -struct ip multicast_encap_iphdr = { +static struct ip multicast_encap_iphdr = { #if BYTE_ORDER == LITTLE_ENDIAN sizeof(struct ip) >> 2, IPVERSION, #else @@ -257,7 +257,6 @@ struct ip multicast_encap_iphdr = { * Private variables. */ static vifi_t numvifs = 0; -static void (*encap_oldrawip)() = 0; static int have_encap_tunnel = 0; /* @@ -269,7 +268,7 @@ static struct vif *last_encap_vif; static int get_sg_cnt(struct sioc_sg_req *); static int get_vif_cnt(struct sioc_vif_req *); -int ip_mrouter_init(struct socket *, struct mbuf *); +static int ip_mrouter_init(struct socket *, struct mbuf *); static int add_vif(struct vifctl *); static int del_vif(vifi_t *); static int add_mfc(struct mfcctl *); @@ -367,7 +366,7 @@ static void collate(struct timeval *); /* * Handle MRT setsockopt commands to modify the multicast routing tables. */ -int +static int X_ip_mrouter_set(cmd, so, m) int cmd; struct socket *so; @@ -394,7 +393,7 @@ int (*ip_mrouter_set)(int, struct socket *, struct mbuf *) = X_ip_mrouter_set; /* * Handle MRT getsockopt commands */ -int +static int X_ip_mrouter_get(cmd, so, m) int cmd; struct socket *so; @@ -420,7 +419,7 @@ int (*ip_mrouter_get)(int, struct socket *, struct mbuf **) = X_ip_mrouter_get; /* * Handle ioctl commands to obtain information from the cache */ -int +static int X_mrt_ioctl(cmd, data) int cmd; caddr_t data; @@ -490,7 +489,7 @@ get_vif_cnt(req) /* * Enable multicast routing */ -int +static int ip_mrouter_init(so, m) struct socket *so; struct mbuf *m; @@ -531,7 +530,7 @@ ip_mrouter_init(so, m) /* * Disable multicast routing */ -int +static int X_ip_mrouter_done() { vifi_t vifi; @@ -1075,7 +1074,7 @@ socket_send(s, mm, src) #define IP_HDR_LEN 20 /* # bytes of fixed IP header (excluding options) */ #define TUNNEL_LEN 12 /* # bytes of IP option for tunnel encapsulation */ -int +static int X_ip_mforward(ip, ifp, m, imo) register struct ip *ip; struct ifnet *ifp; @@ -1118,7 +1117,7 @@ X_ip_mforward(ip, ifp, m, imo) ip->ip_ttl++; /* compensate for -1 in *_send routines */ if (rsvpdebug && ip->ip_p == IPPROTO_RSVP) { vifp = viftable + vifi; - printf("Sending IPPROTO_RSVP from %x to %x on vif %d (%s%s%d)\n", + printf("Sending IPPROTO_RSVP from %lx to %lx on vif %d (%s%s%d)\n", ntohl(ip->ip_src.s_addr), ntohl(ip->ip_dst.s_addr), vifi, (vifp->v_flags & VIFF_TUNNEL) ? "tunnel on " : "", vifp->v_ifp->if_name, vifp->v_ifp->if_unit); @@ -1126,7 +1125,7 @@ X_ip_mforward(ip, ifp, m, imo) return (ip_mdq(m, ifp, rt, vifi)); } if (rsvpdebug && ip->ip_p == IPPROTO_RSVP) { - printf("Warning: IPPROTO_RSVP from %x to %x without vif option\n", + printf("Warning: IPPROTO_RSVP from %lx to %lx without vif option\n", ntohl(ip->ip_src.s_addr), ntohl(ip->ip_dst.s_addr)); if(!imo) printf("In fact, no options were specified at all\n"); @@ -1482,7 +1481,7 @@ ip_mdq(m, ifp, rt, xmt_vif) * check if a vif number is legal/ok. This is used by ip_output, to export * numvifs there, */ -int +static int X_legal_vif_num(vif) int vif; { @@ -1499,7 +1498,7 @@ int (*legal_vif_num)(int) = X_legal_vif_num; /* * Return the local address used by this vif */ -u_long +static u_long X_ip_mcast_src(vifi) int vifi; { @@ -2067,7 +2066,7 @@ ip_rsvp_vif_done(so, m) } if (rsvpdebug) - printf("ip_rsvp_vif_done: v_rsvpd = %x so = %x\n", + printf("ip_rsvp_vif_done: v_rsvpd = %p so = %p\n", viftable[i].v_rsvpd, so); viftable[i].v_rsvpd = NULL; @@ -2190,7 +2189,7 @@ rsvp_input(m, iphlen) rsvp_src.sin_addr = ip->ip_src; if (rsvpdebug && m) - printf("rsvp_input: m->m_len = %d, sbspace() = %d\n", + printf("rsvp_input: m->m_len = %d, sbspace() = %ld\n", m->m_len,sbspace(&(viftable[vifi].v_rsvpd->so_rcv))); if (socket_send(viftable[vifi].v_rsvpd, m, &rsvp_src) < 0) diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index d536a83..4ad5674 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ip_output.c 8.3 (Berkeley) 1/21/94 - * $Id: ip_output.c,v 1.23 1995/07/26 18:05:13 wollman Exp $ + * $Id: ip_output.c,v 1.24 1995/10/16 18:21:09 wollman Exp $ */ #include <sys/param.h> @@ -63,8 +63,14 @@ u_short ip_id; static struct mbuf *ip_insertoptions __P((struct mbuf *, struct mbuf *, int *)); -static void ip_mloopback +static void ip_mloopback __P((struct ifnet *, struct mbuf *, struct sockaddr_in *)); +static int ip_getmoptions + __P((int, struct ip_moptions *, struct mbuf **)); +static int ip_optcopy __P((struct ip *, struct ip *)); +static int ip_pcbopts __P((struct mbuf **, struct mbuf *)); +static int ip_setmoptions + __P((int, struct ip_moptions **, struct mbuf *)); /* * IP output. The packet in mbuf chain m contains a skeletal IP @@ -498,7 +504,7 @@ ip_insertoptions(m, opt, phlen) * Copy options from ip to jp, * omitting those not copied during fragmentation. */ -int +static int ip_optcopy(ip, jp) struct ip *ip, *jp; { @@ -690,7 +696,7 @@ ip_ctloutput(op, so, level, optname, mp) * Store in mbuf with pointer in pcbopt, adding pseudo-option * with destination address if source routed. */ -int +static int #ifdef notyet ip_pcbopts(optname, pcbopt, m) int optname; @@ -795,7 +801,7 @@ bad: /* * Set the IP multicast options in response to user setsockopt(). */ -int +static int ip_setmoptions(optname, imop, m) int optname; struct ip_moptions **imop; @@ -1069,7 +1075,7 @@ ip_setmoptions(optname, imop, m) /* * Return the IP multicast options in response to user getsockopt(). */ -int +static int ip_getmoptions(optname, imo, mp) int optname; register struct ip_moptions *imo; diff --git a/sys/netinet/ip_var.h b/sys/netinet/ip_var.h index 564835f..d22cf06 100644 --- a/sys/netinet/ip_var.h +++ b/sys/netinet/ip_var.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ip_var.h 8.2 (Berkeley) 1/9/95 - * $Id: ip_var.h,v 1.14 1995/09/18 15:51:37 wollman Exp $ + * $Id: ip_var.h,v 1.15 1995/09/21 18:04:43 wollman Exp $ */ #ifndef _NETINET_IP_VAR_H_ @@ -164,35 +164,20 @@ extern u_long (*ip_mcast_src) __P((int)); extern int rsvp_on; int ip_ctloutput __P((int, struct socket *, int, int, struct mbuf **)); -void ip_deq __P((struct ipasfrag *)); -int ip_dooptions __P((struct mbuf *)); void ip_drain __P((void)); -void ip_enq __P((struct ipasfrag *, struct ipasfrag *)); -void ip_forward __P((struct mbuf *, int)); -void ip_freef __P((struct ipq *)); void ip_freemoptions __P((struct ip_moptions *)); -int ip_getmoptions __P((int, struct ip_moptions *, struct mbuf **)); void ip_init __P((void)); extern int (*ip_mforward) __P((struct ip *, struct ifnet *, struct mbuf *, struct ip_moptions *)); #ifdef MTUDISC int ip_next_mtu __P((int, int)); #endif /* MTUDISC */ -int ip_optcopy __P((struct ip *, struct ip *)); int ip_output __P((struct mbuf *, struct mbuf *, struct route *, int, struct ip_moptions *)); -int ip_pcbopts __P((struct mbuf **, struct mbuf *)); -struct ip * - ip_reass __P((struct ipasfrag *, struct ipq *)); -struct in_ifaddr * - ip_rtaddr __P((struct in_addr)); -int ip_setmoptions __P((int, struct ip_moptions **, struct mbuf *)); void ip_slowtimo __P((void)); struct mbuf * ip_srcroute __P((void)); void ip_stripoptions __P((struct mbuf *, struct mbuf *)); -int ip_sysctl __P((int *, u_int, void *, size_t *, void *, size_t)); -void ipintr __P((void)); int rip_ctloutput __P((int, struct socket *, int, int, struct mbuf **)); void rip_init __P((void)); void rip_input __P((struct mbuf *)); diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 6142e2b..6a656b0 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)raw_ip.c 8.7 (Berkeley) 5/15/95 - * $Id: raw_ip.c,v 1.22 1995/09/21 19:59:43 wollman Exp $ + * $Id: raw_ip.c,v 1.23 1995/10/21 02:12:20 davidg Exp $ */ #include <sys/param.h> @@ -292,8 +292,8 @@ rip_ctloutput(op, so, level, optname, m) return (ip_ctloutput(op, so, level, optname, m)); } -u_long rip_sendspace = RIPSNDQ; -u_long rip_recvspace = RIPRCVQ; +static u_long rip_sendspace = RIPSNDQ; /* XXX sysctl ? */ +static u_long rip_recvspace = RIPRCVQ; /* XXX sysctl ? */ /*ARGSUSED*/ int diff --git a/sys/netinet/tcp_debug.c b/sys/netinet/tcp_debug.c index cef966c..367aabb 100644 --- a/sys/netinet/tcp_debug.c +++ b/sys/netinet/tcp_debug.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_debug.c 8.1 (Berkeley) 6/10/93 - * $Id: tcp_debug.c,v 1.3 1995/02/09 23:13:22 wollman Exp $ + * $Id: tcp_debug.c,v 1.4 1995/04/19 10:26:04 olah Exp $ */ #ifdef TCPDEBUG @@ -68,7 +68,7 @@ #include <netinet/tcp_debug.h> #ifdef TCPDEBUG -int tcpconsdebug = 0; +static int tcpconsdebug = 0; #endif /* * Tcp debug routines diff --git a/sys/netinet/tcp_debug.h b/sys/netinet/tcp_debug.h index 159b798..02af11e 100644 --- a/sys/netinet/tcp_debug.h +++ b/sys/netinet/tcp_debug.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_debug.h 8.1 (Berkeley) 6/10/93 - * $Id: tcp_debug.h,v 1.2 1994/08/02 07:48:56 davidg Exp $ + * $Id: tcp_debug.h,v 1.3 1994/08/21 05:27:35 paul Exp $ */ #ifndef _NETINET_TCP_DEBUG_H_ @@ -54,7 +54,7 @@ struct tcp_debug { #define TA_DROP 4 #ifdef TANAMES -char *tanames[] = +static char *tanames[] = { "input", "output", "user", "respond", "drop" }; #endif diff --git a/sys/netinet/tcp_fsm.h b/sys/netinet/tcp_fsm.h index 28f04f0..95839c3 100644 --- a/sys/netinet/tcp_fsm.h +++ b/sys/netinet/tcp_fsm.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_fsm.h 8.1 (Berkeley) 6/10/93 - * $Id: tcp_fsm.h,v 1.5 1995/02/16 01:53:31 wollman Exp $ + * $Id: tcp_fsm.h,v 1.6 1995/03/30 23:35:55 davidg Exp $ */ #ifndef _NETINET_TCP_FSM_H_ @@ -70,7 +70,7 @@ * determined by state, with the proviso that TH_FIN is sent only * if all data queued for output is included in the segment. */ -u_char tcp_outflags[TCP_NSTATES] = { +static u_char tcp_outflags[TCP_NSTATES] = { TH_RST|TH_ACK, 0, TH_SYN, TH_SYN|TH_ACK, TH_ACK, TH_ACK, TH_FIN|TH_ACK, TH_FIN|TH_ACK, TH_FIN|TH_ACK, TH_ACK, TH_ACK, diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 771e57c..d208752 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_input.c 8.12 (Berkeley) 5/24/95 - * $Id: tcp_input.c,v 1.31 1995/11/03 22:31:54 olah Exp $ + * $Id: tcp_input.c,v 1.32 1995/11/09 20:23:02 phk Exp $ */ #ifndef TUBA_INCLUDE @@ -68,16 +68,25 @@ struct tcpiphdr tcp_saveti; #endif -int tcprexmtthresh = 3; +static int tcprexmtthresh = 3; tcp_seq tcp_iss; tcp_cc tcp_ccgen; + struct tcpstat tcpstat; SYSCTL_STRUCT(_net_inet_tcp, TCPCTL_STATS, stats, CTLFLAG_RD, &tcpstat , tcpstat, ""); + u_long tcp_now; struct inpcbhead tcb; struct inpcbinfo tcbinfo; +static void tcp_dooptions __P((struct tcpcb *, + u_char *, int, struct tcpiphdr *, struct tcpopt *)); +static void tcp_pulloutofband __P((struct socket *, + struct tcpiphdr *, struct mbuf *)); +static int tcp_reass __P((struct tcpcb *, struct tcpiphdr *, struct mbuf *)); +static void tcp_xmit_timer __P((struct tcpcb *, int)); + #endif /* TUBA_INCLUDE */ /* @@ -130,7 +139,7 @@ struct inpcbinfo tcbinfo; #endif #ifndef TUBA_INCLUDE -int +static int tcp_reass(tp, ti, m) register struct tcpcb *tp; register struct tcpiphdr *ti; @@ -1662,7 +1671,7 @@ drop: #ifndef TUBA_INCLUDE } -void +static void tcp_dooptions(tp, cp, cnt, ti, to) struct tcpcb *tp; u_char *cp; @@ -1779,7 +1788,7 @@ tcp_dooptions(tp, cp, cnt, ti, to) * It is still reflected in the segment length for * sequencing purposes. */ -void +static void tcp_pulloutofband(so, ti, m) struct socket *so; struct tcpiphdr *ti; @@ -1810,7 +1819,7 @@ tcp_pulloutofband(so, ti, m) * Collect new round-trip time estimate * and update averages and current timeout. */ -void +static void tcp_xmit_timer(tp, rtt) register struct tcpcb *tp; short rtt; diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c index 771e57c..d208752 100644 --- a/sys/netinet/tcp_reass.c +++ b/sys/netinet/tcp_reass.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_input.c 8.12 (Berkeley) 5/24/95 - * $Id: tcp_input.c,v 1.31 1995/11/03 22:31:54 olah Exp $ + * $Id: tcp_input.c,v 1.32 1995/11/09 20:23:02 phk Exp $ */ #ifndef TUBA_INCLUDE @@ -68,16 +68,25 @@ struct tcpiphdr tcp_saveti; #endif -int tcprexmtthresh = 3; +static int tcprexmtthresh = 3; tcp_seq tcp_iss; tcp_cc tcp_ccgen; + struct tcpstat tcpstat; SYSCTL_STRUCT(_net_inet_tcp, TCPCTL_STATS, stats, CTLFLAG_RD, &tcpstat , tcpstat, ""); + u_long tcp_now; struct inpcbhead tcb; struct inpcbinfo tcbinfo; +static void tcp_dooptions __P((struct tcpcb *, + u_char *, int, struct tcpiphdr *, struct tcpopt *)); +static void tcp_pulloutofband __P((struct socket *, + struct tcpiphdr *, struct mbuf *)); +static int tcp_reass __P((struct tcpcb *, struct tcpiphdr *, struct mbuf *)); +static void tcp_xmit_timer __P((struct tcpcb *, int)); + #endif /* TUBA_INCLUDE */ /* @@ -130,7 +139,7 @@ struct inpcbinfo tcbinfo; #endif #ifndef TUBA_INCLUDE -int +static int tcp_reass(tp, ti, m) register struct tcpcb *tp; register struct tcpiphdr *ti; @@ -1662,7 +1671,7 @@ drop: #ifndef TUBA_INCLUDE } -void +static void tcp_dooptions(tp, cp, cnt, ti, to) struct tcpcb *tp; u_char *cp; @@ -1779,7 +1788,7 @@ tcp_dooptions(tp, cp, cnt, ti, to) * It is still reflected in the segment length for * sequencing purposes. */ -void +static void tcp_pulloutofband(so, ti, m) struct socket *so; struct tcpiphdr *ti; @@ -1810,7 +1819,7 @@ tcp_pulloutofband(so, ti, m) * Collect new round-trip time estimate * and update averages and current timeout. */ -void +static void tcp_xmit_timer(tp, rtt) register struct tcpcb *tp; short rtt; diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 591fb40..2a2a5da 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95 - * $Id: tcp_subr.c,v 1.20 1995/10/16 18:21:20 wollman Exp $ + * $Id: tcp_subr.c,v 1.21 1995/11/09 20:23:05 phk Exp $ */ #include <sys/param.h> @@ -67,20 +67,24 @@ #include <netinet/tcp_debug.h> #endif -/* patchable/settable parameters for tcp */ int tcp_mssdflt = TCP_MSS; SYSCTL_INT(_net_inet_tcp, TCPCTL_MSSDFLT, mssdflt, CTLFLAG_RW, &tcp_mssdflt , 0, ""); -int tcp_rttdflt = TCPTV_SRTTDFLT / PR_SLOWHZ; + +static int tcp_rttdflt = TCPTV_SRTTDFLT / PR_SLOWHZ; SYSCTL_INT(_net_inet_tcp, TCPCTL_RTTDFLT, rttdflt, CTLFLAG_RW, &tcp_rttdflt , 0, ""); -int tcp_do_rfc1323 = 1; + +static int tcp_do_rfc1323 = 1; SYSCTL_INT(_net_inet_tcp, TCPCTL_DO_RFC1323, rfc1323, CTLFLAG_RW, &tcp_do_rfc1323 , 0, ""); -int tcp_do_rfc1644 = 1; + +static int tcp_do_rfc1644 = 1; SYSCTL_INT(_net_inet_tcp, TCPCTL_DO_RFC1644, rfc1644, CTLFLAG_RW, &tcp_do_rfc1644 , 0, ""); -static void tcp_cleartaocache(void); + +static void tcp_cleartaocache(void); +static void tcp_notify __P((struct inpcb *, int)); /* * Target size of TCP PCB hash table. Will be rounded down to a prime @@ -410,7 +414,7 @@ tcp_drain() * store error as soft error, but wake up user * (for now, won't do anything until can select for soft error). */ -void +static void tcp_notify(inp, error) struct inpcb *inp; int error; diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c index 4db44cf..23068b7 100644 --- a/sys/netinet/tcp_timer.c +++ b/sys/netinet/tcp_timer.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_timer.c 8.2 (Berkeley) 5/24/95 - * $Id: tcp_timer.c,v 1.10 1995/11/03 22:19:50 olah Exp $ + * $Id: tcp_timer.c,v 1.11 1995/11/09 20:23:07 phk Exp $ */ #ifndef TUBA_INCLUDE @@ -68,16 +68,18 @@ int tcp_keepidle = TCPTV_KEEP_IDLE; SYSCTL_INT(_net_inet_tcp, TCPCTL_KEEPIDLE, keepidle, CTLFLAG_RW, &tcp_keepidle , 0, ""); -int tcp_keepintvl = TCPTV_KEEPINTVL; +static int tcp_keepintvl = TCPTV_KEEPINTVL; SYSCTL_INT(_net_inet_tcp, TCPCTL_KEEPINTVL, keepintvl, CTLFLAG_RW, &tcp_keepintvl , 0, ""); -int tcp_keepcnt = TCPTV_KEEPCNT; /* max idle probes */ -int tcp_maxpersistidle = TCPTV_KEEP_IDLE; /* max idle time in persist */ +static int tcp_keepcnt = TCPTV_KEEPCNT; + /* max idle probes */ +static int tcp_maxpersistidle = TCPTV_KEEP_IDLE; + /* max idle time in persist */ int tcp_maxidle; #else /* TUBA_INCLUDE */ -extern int tcp_maxpersistidle; +static int tcp_maxpersistidle; #endif /* TUBA_INCLUDE */ /* @@ -175,7 +177,7 @@ tcp_canceltimers(tp) int tcp_backoff[TCP_MAXRXTSHIFT + 1] = { 1, 2, 4, 8, 16, 32, 64, 64, 64, 64, 64, 64, 64 }; -int tcp_totbackoff = 511; /* sum of tcp_backoff[] */ +static int tcp_totbackoff = 511; /* sum of tcp_backoff[] */ /* * TCP timer processing. diff --git a/sys/netinet/tcp_timer.h b/sys/netinet/tcp_timer.h index b9af05f..aa304b4 100644 --- a/sys/netinet/tcp_timer.h +++ b/sys/netinet/tcp_timer.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_timer.h 8.1 (Berkeley) 6/10/93 - * $Id: tcp_timer.h,v 1.5 1995/02/08 20:18:47 wollman Exp $ + * $Id: tcp_timer.h,v 1.6 1995/02/14 02:35:18 wollman Exp $ */ #ifndef _NETINET_TCP_TIMER_H_ @@ -110,7 +110,7 @@ #define TCP_MAXRXTSHIFT 12 /* maximum retransmits */ #ifdef TCPTIMERS -char *tcptimers[] = +static char *tcptimers[] = { "REXMT", "PERSIST", "KEEP", "2MSL" }; #endif diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index 591fb40..2a2a5da 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95 - * $Id: tcp_subr.c,v 1.20 1995/10/16 18:21:20 wollman Exp $ + * $Id: tcp_subr.c,v 1.21 1995/11/09 20:23:05 phk Exp $ */ #include <sys/param.h> @@ -67,20 +67,24 @@ #include <netinet/tcp_debug.h> #endif -/* patchable/settable parameters for tcp */ int tcp_mssdflt = TCP_MSS; SYSCTL_INT(_net_inet_tcp, TCPCTL_MSSDFLT, mssdflt, CTLFLAG_RW, &tcp_mssdflt , 0, ""); -int tcp_rttdflt = TCPTV_SRTTDFLT / PR_SLOWHZ; + +static int tcp_rttdflt = TCPTV_SRTTDFLT / PR_SLOWHZ; SYSCTL_INT(_net_inet_tcp, TCPCTL_RTTDFLT, rttdflt, CTLFLAG_RW, &tcp_rttdflt , 0, ""); -int tcp_do_rfc1323 = 1; + +static int tcp_do_rfc1323 = 1; SYSCTL_INT(_net_inet_tcp, TCPCTL_DO_RFC1323, rfc1323, CTLFLAG_RW, &tcp_do_rfc1323 , 0, ""); -int tcp_do_rfc1644 = 1; + +static int tcp_do_rfc1644 = 1; SYSCTL_INT(_net_inet_tcp, TCPCTL_DO_RFC1644, rfc1644, CTLFLAG_RW, &tcp_do_rfc1644 , 0, ""); -static void tcp_cleartaocache(void); + +static void tcp_cleartaocache(void); +static void tcp_notify __P((struct inpcb *, int)); /* * Target size of TCP PCB hash table. Will be rounded down to a prime @@ -410,7 +414,7 @@ tcp_drain() * store error as soft error, but wake up user * (for now, won't do anything until can select for soft error). */ -void +static void tcp_notify(inp, error) struct inpcb *inp; int error; diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index e5cbd66..be2cfc1 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * From: @(#)tcp_usrreq.c 8.2 (Berkeley) 1/3/94 - * $Id: tcp_usrreq.c,v 1.18 1995/11/03 22:08:11 olah Exp $ + * $Id: tcp_usrreq.c,v 1.19 1995/11/09 20:23:09 phk Exp $ */ #include <sys/param.h> @@ -71,6 +71,12 @@ */ extern char *tcpstates[]; +static int tcp_attach __P((struct socket *)); +static int tcp_connect __P((struct tcpcb *, struct mbuf *)); +static struct tcpcb * + tcp_disconnect __P((struct tcpcb *)); +static struct tcpcb * + tcp_usrclosed __P((struct tcpcb *)); /* * Process a TCP user request for TCP tb. If this is a send request * then m is the mbuf chain of send data. If this is a timer expiration @@ -396,7 +402,7 @@ tcp_usrreq(so, req, m, nam, control) * truncate the previous TIME-WAIT state and proceed. * Initialize connection parameters and enter SYN-SENT state. */ -int +static int tcp_connect(tp, nam) register struct tcpcb *tp; struct mbuf *nam; @@ -603,7 +609,7 @@ SYSCTL_INT(_net_inet_tcp, TCPCTL_RECVSPACE, recvspace, * internet protocol control block, tcp control block, * bufer space, and entering LISTEN state if to accept connections. */ -int +static int tcp_attach(so) struct socket *so; { @@ -641,7 +647,7 @@ tcp_attach(so) * current input data; switch states based on user close, and * send segment to peer (with FIN). */ -struct tcpcb * +static struct tcpcb * tcp_disconnect(tp) register struct tcpcb *tp; { @@ -671,7 +677,7 @@ tcp_disconnect(tp) * for peer to send FIN or not respond to keep-alives, etc. * We can let the user exit from the close as soon as the FIN is acked. */ -struct tcpcb * +static struct tcpcb * tcp_usrclosed(tp) register struct tcpcb *tp; { @@ -706,51 +712,3 @@ tcp_usrclosed(tp) return (tp); } -/* - * Sysctl for tcp variables. - */ -int -tcp_sysctl(name, namelen, oldp, oldlenp, newp, newlen) - int *name; - u_int namelen; - void *oldp; - size_t *oldlenp; - void *newp; - size_t newlen; -{ - /* All sysctl names at this level are terminal. */ - if (namelen != 1) - return (ENOTDIR); - - switch (name[0]) { - case TCPCTL_DO_RFC1323: - return (sysctl_int(oldp, oldlenp, newp, newlen, - &tcp_do_rfc1323)); - case TCPCTL_DO_RFC1644: - return (sysctl_int(oldp, oldlenp, newp, newlen, - &tcp_do_rfc1644)); - case TCPCTL_MSSDFLT: - return (sysctl_int(oldp, oldlenp, newp, newlen, - &tcp_mssdflt)); - case TCPCTL_STATS: - return (sysctl_rdstruct(oldp, oldlenp, newp, &tcpstat, - sizeof tcpstat)); - case TCPCTL_RTTDFLT: - return (sysctl_int(oldp, oldlenp, newp, newlen, &tcp_rttdflt)); - case TCPCTL_KEEPIDLE: - return (sysctl_int(oldp, oldlenp, newp, newlen, - &tcp_keepidle)); - case TCPCTL_KEEPINTVL: - return (sysctl_int(oldp, oldlenp, newp, newlen, - &tcp_keepintvl)); - case TCPCTL_SENDSPACE: - return (sysctl_int(oldp, oldlenp, newp, newlen, - (int *)&tcp_sendspace)); /* XXX */ - case TCPCTL_RECVSPACE: - return (sysctl_int(oldp, oldlenp, newp, newlen, - (int *)&tcp_recvspace)); /* XXX */ - default: - return (ENOPROTOOPT); - } - /* NOTREACHED */ -} diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 595d639..847931f 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_var.h 8.4 (Berkeley) 5/24/95 - * $Id: tcp_var.h,v 1.21 1995/10/16 18:21:26 wollman Exp $ + * $Id: tcp_var.h,v 1.22 1995/11/03 22:08:13 olah Exp $ */ #ifndef _NETINET_TCP_VAR_H_ @@ -329,19 +329,13 @@ extern u_long tcp_now; /* for RFC 1323 timestamps */ extern int tcp_rttdflt; /* XXX */ extern u_short tcp_lastport; /* last assigned port */ -int tcp_attach __P((struct socket *)); void tcp_canceltimers __P((struct tcpcb *)); struct tcpcb * tcp_close __P((struct tcpcb *)); -int tcp_connect __P((struct tcpcb *, struct mbuf *)); void tcp_ctlinput __P((int, struct sockaddr *, struct ip *)); int tcp_ctloutput __P((int, struct socket *, int, int, struct mbuf **)); struct tcpcb * - tcp_disconnect __P((struct tcpcb *)); -struct tcpcb * tcp_drop __P((struct tcpcb *, int)); -void tcp_dooptions __P((struct tcpcb *, - u_char *, int, struct tcpiphdr *, struct tcpopt *)); void tcp_drain __P((void)); void tcp_fasttimo __P((void)); struct rmxp_tao * @@ -355,29 +349,21 @@ void tcp_mtudisc __P((struct inpcb *, int)); #endif /* MTUDISC */ struct tcpcb * tcp_newtcpcb __P((struct inpcb *)); -void tcp_notify __P((struct inpcb *, int)); int tcp_output __P((struct tcpcb *)); -void tcp_pulloutofband __P((struct socket *, - struct tcpiphdr *, struct mbuf *)); void tcp_quench __P((struct inpcb *, int)); -int tcp_reass __P((struct tcpcb *, struct tcpiphdr *, struct mbuf *)); void tcp_respond __P((struct tcpcb *, struct tcpiphdr *, struct mbuf *, u_long, u_long, int)); struct rtentry * tcp_rtlookup __P((struct inpcb *)); void tcp_setpersist __P((struct tcpcb *)); void tcp_slowtimo __P((void)); -int tcp_sysctl __P((int *, u_int, void *, size_t *, void *, size_t)); struct tcpiphdr * tcp_template __P((struct tcpcb *)); struct tcpcb * tcp_timers __P((struct tcpcb *, int)); void tcp_trace __P((int, int, struct tcpcb *, struct tcpiphdr *, int)); -struct tcpcb * - tcp_usrclosed __P((struct tcpcb *)); int tcp_usrreq __P((struct socket *, int, struct mbuf *, struct mbuf *, struct mbuf *)); -void tcp_xmit_timer __P((struct tcpcb *, int)); extern u_long tcp_sendspace; extern u_long tcp_recvspace; diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index dbe6568..a801fab 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)udp_usrreq.c 8.6 (Berkeley) 5/23/95 - * $Id: udp_usrreq.c,v 1.13 1995/08/17 22:09:14 olah Exp $ + * $Id: udp_usrreq.c,v 1.14 1995/09/22 19:56:26 wollman Exp $ */ #include <sys/param.h> @@ -45,6 +45,7 @@ #include <sys/stat.h> #include <sys/queue.h> #include <vm/vm.h> +#include <sys/kernel.h> #include <sys/sysctl.h> #include <net/if.h> @@ -65,10 +66,12 @@ * Per RFC 768, August, 1980. */ #ifndef COMPAT_42 -int udpcksum = 1; +static int udpcksum = 1; #else -int udpcksum = 0; /* XXX */ +static int udpcksum = 0; /* XXX */ #endif +SYSCTL_INT(_net_inet_udp, UDPCTL_CHECKSUM, checksum, CTLFLAG_RW, + &udpcksum, 0, ""); struct inpcbhead udb; /* from udp_var.h */ struct inpcbinfo udbinfo; @@ -78,8 +81,10 @@ struct inpcbinfo udbinfo; #endif struct udpstat udpstat; /* from udp_var.h */ +SYSCTL_STRUCT(_net_inet_udp, UDPCTL_STATS, stats, CTLFLAG_RD, + &udpstat, udpstat, ""); -struct sockaddr_in udp_in = { sizeof(udp_in), AF_INET }; +static struct sockaddr_in udp_in = { sizeof(udp_in), AF_INET }; static void udp_detach __P((struct inpcb *)); static void udp_notify __P((struct inpcb *, int)); @@ -385,7 +390,7 @@ udp_ctlinput(cmd, sa, ip) in_pcbnotify(&udb, sa, 0, zeroin_addr, 0, cmd, udp_notify); } -int +static int udp_output(inp, m, addr, control) register struct inpcb *inp; register struct mbuf *m; @@ -475,9 +480,14 @@ release: return (error); } -u_long udp_sendspace = 9216; /* really max datagram size */ -u_long udp_recvspace = 40 * (1024 + sizeof(struct sockaddr_in)); +static u_long udp_sendspace = 9216; /* really max datagram size */ /* 40 1K datagrams */ +SYSCTL_INT(_net_inet_udp, UDPCTL_MAXDGRAM, maxdgram, CTLFLAG_RW, + &udp_sendspace, 0, ""); + +static u_long udp_recvspace = 40 * (1024 + sizeof(struct sockaddr_in)); +SYSCTL_INT(_net_inet_udp, UDPCTL_RECVSPACE, recvspace, CTLFLAG_RW, + &udp_recvspace, 0, ""); /*ARGSUSED*/ int @@ -626,37 +636,3 @@ udp_detach(inp) in_pcbdetach(inp); splx(s); } - -/* - * Sysctl for udp variables. - */ -int -udp_sysctl(name, namelen, oldp, oldlenp, newp, newlen) - int *name; - u_int namelen; - void *oldp; - size_t *oldlenp; - void *newp; - size_t newlen; -{ - /* All sysctl names at this level are terminal. */ - if (namelen != 1) - return (ENOTDIR); - - switch (name[0]) { - case UDPCTL_CHECKSUM: - return (sysctl_int(oldp, oldlenp, newp, newlen, &udpcksum)); - case UDPCTL_STATS: - return (sysctl_rdstruct(oldp, oldlenp, newp, &udpstat, - sizeof udpstat)); - case UDPCTL_MAXDGRAM: - return (sysctl_int(oldp, oldlenp, newp, newlen, - (int *)&udp_sendspace)); /* XXX */ - case UDPCTL_RECVSPACE: - return (sysctl_int(oldp, oldlenp, newp, newlen, - (int *)&udp_recvspace)); /* XXX */ - default: - return (ENOPROTOOPT); - } - /* NOTREACHED */ -} diff --git a/sys/netinet/udp_var.h b/sys/netinet/udp_var.h index 6e98e9c..7488888 100644 --- a/sys/netinet/udp_var.h +++ b/sys/netinet/udp_var.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)udp_var.h 8.1 (Berkeley) 6/10/93 - * $Id: udp_var.h,v 1.4 1995/02/16 00:27:47 wollman Exp $ + * $Id: udp_var.h,v 1.5 1995/04/09 01:29:31 davidg Exp $ */ #ifndef _NETINET_UDP_VAR_H_ @@ -97,7 +97,6 @@ void udp_init __P((void)); void udp_input __P((struct mbuf *, int)); int udp_output __P((struct inpcb *, struct mbuf *, struct mbuf *, struct mbuf *)); -int udp_sysctl __P((int *, u_int, void *, size_t *, void *, size_t)); int udp_usrreq __P((struct socket *, int, struct mbuf *, struct mbuf *, struct mbuf *)); #endif |