svn commit: r186048 - in head/sys: contrib/pf/net net netinet netinet6 netipsec

Bjoern A. Zeeb bz at FreeBSD.org
Sat Dec 13 19:13:04 UTC 2008


Author: bz
Date: Sat Dec 13 19:13:03 2008
New Revision: 186048
URL: http://svn.freebsd.org/changeset/base/186048

Log:
  Second round of putting global variables, which were virtualized
  but formerly missed under VIMAGE_GLOBAL.
  
  Put the extern declarations of the  virtualized globals
  under VIMAGE_GLOBAL as the globals themsevles are already.
  This will help by the time when we are going to remove the globals
  entirely.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/contrib/pf/net/pf_if.c
  head/sys/net/if_var.h
  head/sys/netinet/icmp6.h
  head/sys/netinet/icmp_var.h
  head/sys/netinet/in_var.h
  head/sys/netinet/ip_fw.h
  head/sys/netinet/ip_fw2.c
  head/sys/netinet/tcp_var.h
  head/sys/netinet6/in6_var.h
  head/sys/netinet6/ip6_input.c
  head/sys/netinet6/ip6_var.h
  head/sys/netinet6/raw_ip6.h
  head/sys/netipsec/ipip_var.h

Modified: head/sys/contrib/pf/net/pf_if.c
==============================================================================
--- head/sys/contrib/pf/net/pf_if.c	Sat Dec 13 19:11:46 2008	(r186047)
+++ head/sys/contrib/pf/net/pf_if.c	Sat Dec 13 19:13:03 2008	(r186048)
@@ -115,8 +115,10 @@ void		 pfi_change_group_event(void * __u
 void		 pfi_detach_group_event(void * __unused, struct ifg_group *);
 void		 pfi_ifaddr_event(void * __unused, struct ifnet *);
 
+#ifdef VIMAGE_GLOBALS
 extern struct ifgrouphead ifg_head;
 #endif
+#endif
 
 RB_PROTOTYPE(pfi_ifhead, pfi_kif, pfik_tree, pfi_if_compare);
 RB_GENERATE(pfi_ifhead, pfi_kif, pfik_tree, pfi_if_compare);

Modified: head/sys/net/if_var.h
==============================================================================
--- head/sys/net/if_var.h	Sat Dec 13 19:11:46 2008	(r186047)
+++ head/sys/net/if_var.h	Sat Dec 13 19:13:03 2008	(r186048)
@@ -659,10 +659,12 @@ struct ifnet	*ifnet_byindex(u_short idx)
 struct ifaddr	*ifaddr_byindex(u_short idx);
 struct cdev	*ifdev_byindex(u_short idx);
 
+#ifdef VIMAGE_GLOBALS
 extern	struct ifnethead ifnet;
-extern	int ifqmaxlen;
 extern	struct ifnet *loif;	/* first loopback interface */
 extern	int if_index;
+#endif
+extern	int ifqmaxlen;
 
 int	if_addgroup(struct ifnet *, const char *);
 int	if_delgroup(struct ifnet *, const char *);

Modified: head/sys/netinet/icmp6.h
==============================================================================
--- head/sys/netinet/icmp6.h	Sat Dec 13 19:11:46 2008	(r186047)
+++ head/sys/netinet/icmp6.h	Sat Dec 13 19:13:03 2008	(r186048)
@@ -707,8 +707,10 @@ do { \
 		} \
 } while (/*CONSTCOND*/ 0)
 
+#ifdef VIMAGE_GLOBALS
 extern int	icmp6_rediraccept;	/* accept/process redirects */
 extern int	icmp6_redirtimeout;	/* cache time for redirect routes */
+#endif
 
 #define ICMP6_NODEINFO_FQDNOK		0x1
 #define ICMP6_NODEINFO_NODEADDROK	0x2

Modified: head/sys/netinet/icmp_var.h
==============================================================================
--- head/sys/netinet/icmp_var.h	Sat Dec 13 19:11:46 2008	(r186047)
+++ head/sys/netinet/icmp_var.h	Sat Dec 13 19:13:03 2008	(r186048)
@@ -74,7 +74,9 @@ struct	icmpstat {
 
 #ifdef _KERNEL
 SYSCTL_DECL(_net_inet_icmp);
+#ifdef VIMAGE_GLOBALS
 extern struct icmpstat icmpstat;	/* icmp statistics */
+#endif
 extern int badport_bandlim(int);
 #define BANDLIM_UNLIMITED -1
 #define BANDLIM_ICMP_UNREACH 0

Modified: head/sys/netinet/in_var.h
==============================================================================
--- head/sys/netinet/in_var.h	Sat Dec 13 19:11:46 2008	(r186047)
+++ head/sys/netinet/in_var.h	Sat Dec 13 19:13:03 2008	(r186048)
@@ -84,9 +84,13 @@ extern	u_char	inetctlerrmap[];
 /*
  * Hash table for IP addresses.
  */
-extern	LIST_HEAD(in_ifaddrhashhead, in_ifaddr) *in_ifaddrhashtbl;
-extern	TAILQ_HEAD(in_ifaddrhead, in_ifaddr) in_ifaddrhead;
+TAILQ_HEAD(in_ifaddrhead, in_ifaddr);
+LIST_HEAD(in_ifaddrhashhead, in_ifaddr);
+#ifdef VIMAGE_GLOBALS
+extern	struct in_ifaddrhashhead *in_ifaddrhashtbl;
+extern	struct in_ifaddrhead in_ifaddrhead;
 extern	u_long in_ifaddrhmask;			/* mask for hash table */
+#endif
 
 #define INADDR_NHASH_LOG2       9
 #define INADDR_NHASH		(1 << INADDR_NHASH_LOG2)
@@ -227,7 +231,10 @@ SYSCTL_DECL(_net_inet_ip);
 SYSCTL_DECL(_net_inet_raw);
 #endif
 
-extern LIST_HEAD(in_multihead, in_multi) in_multihead;
+LIST_HEAD(in_multihead, in_multi);
+#ifdef VIMAGE_GLOBALS
+extern struct in_multihead in_multihead;
+#endif
 
 /*
  * Lock macros for IPv4 layer multicast address lists.  IPv4 lock goes

Modified: head/sys/netinet/ip_fw.h
==============================================================================
--- head/sys/netinet/ip_fw.h	Sat Dec 13 19:11:46 2008	(r186047)
+++ head/sys/netinet/ip_fw.h	Sat Dec 13 19:13:03 2008	(r186048)
@@ -637,7 +637,7 @@ void ipfw_nat_destroy(void);
 typedef int ip_fw_ctl_t(struct sockopt *);
 extern ip_fw_ctl_t *ip_fw_ctl_ptr;
 
-#ifndef VIMAGE
+#ifdef VIMAGE_GLOBALS
 extern int fw_one_pass;
 extern int fw_enable;
 #ifdef INET6

Modified: head/sys/netinet/ip_fw2.c
==============================================================================
--- head/sys/netinet/ip_fw2.c	Sat Dec 13 19:11:46 2008	(r186047)
+++ head/sys/netinet/ip_fw2.c	Sat Dec 13 19:13:03 2008	(r186048)
@@ -128,8 +128,8 @@ struct vnet_ipfw vnet_ipfw_0;
 static u_int32_t set_disable;
 static int fw_verbose;
 static struct callout ipfw_timeout;
-#endif
 static int verbose_limit;
+#endif
 
 static uma_zone_t ipfw_dyn_rule_zone;
 
@@ -190,8 +190,9 @@ SYSCTL_V_INT(V_NET, vnet_ipfw, _net_inet
 SYSCTL_V_INT(V_NET, vnet_ipfw, _net_inet_ip_fw, OID_AUTO, verbose,
     CTLFLAG_RW | CTLFLAG_SECURE3,
     fw_verbose, 0, "Log matches to ipfw rules");
-SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, verbose_limit, CTLFLAG_RW,
-    &verbose_limit, 0, "Set upper limit of matches of ipfw rules logged");
+SYSCTL_V_INT(V_NET, vnet_ipfw, _net_inet_ip_fw, OID_AUTO, verbose_limit,
+    CTLFLAG_RW, verbose_limit, 0,
+    "Set upper limit of matches of ipfw rules logged");
 SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, default_rule, CTLFLAG_RD,
     NULL, IPFW_DEFAULT_RULE, "The default/max possible rule number.");
 SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, tables_max, CTLFLAG_RD,

Modified: head/sys/netinet/tcp_var.h
==============================================================================
--- head/sys/netinet/tcp_var.h	Sat Dec 13 19:11:46 2008	(r186047)
+++ head/sys/netinet/tcp_var.h	Sat Dec 13 19:13:03 2008	(r186048)
@@ -38,7 +38,9 @@
 /*
  * Kernel variables for tcp.
  */
+#ifdef VIMAGE_GLOBALS
 extern int	tcp_do_rfc1323;
+#endif
 
 /* TCP segment queue entry */
 struct tseg_qent {
@@ -48,7 +50,9 @@ struct tseg_qent {
 	struct	mbuf	*tqe_m;		/* mbuf contains packet */
 };
 LIST_HEAD(tsegqe_head, tseg_qent);
+#ifdef VIMAGE_GLOBALS
 extern int	tcp_reass_qsize;
+#endif
 extern struct uma_zone *tcp_reass_zone;
 
 struct sackblk {

Modified: head/sys/netinet6/in6_var.h
==============================================================================
--- head/sys/netinet6/in6_var.h	Sat Dec 13 19:11:46 2008	(r186047)
+++ head/sys/netinet6/in6_var.h	Sat Dec 13 19:13:03 2008	(r186048)
@@ -474,6 +474,8 @@ struct	in6_rrenumreq {
 extern struct in6_ifaddr *in6_ifaddr;
 
 extern struct icmp6stat icmp6stat;
+
+extern unsigned long in6_maxmtu;
 #endif /* VIMAGE_GLOBALS */
 #define in6_ifstat_inc(ifp, tag) \
 do {								\
@@ -483,7 +485,6 @@ do {								\
 
 extern struct in6_addr zeroin6_addr;
 extern u_char inet6ctlerrmap[];
-extern unsigned long in6_maxmtu;
 #ifdef MALLOC_DECLARE
 MALLOC_DECLARE(M_IP6MADDR);
 #endif /* MALLOC_DECLARE */

Modified: head/sys/netinet6/ip6_input.c
==============================================================================
--- head/sys/netinet6/ip6_input.c	Sat Dec 13 19:11:46 2008	(r186047)
+++ head/sys/netinet6/ip6_input.c	Sat Dec 13 19:13:03 2008	(r186048)
@@ -130,7 +130,6 @@ struct vnet_inet6 vnet_inet6_0;
 static int ip6qmaxlen;
 struct in6_ifaddr *in6_ifaddr;
 struct ip6stat ip6stat;
-#endif
 
 extern struct callout in6_tmpaddrtimer_ch;
 
@@ -144,7 +143,8 @@ extern int icmp6_nodeinfo;
 extern int udp6_sendspace;
 extern int udp6_recvspace;
 
-#ifdef VIMAGE_GLOBALS
+extern struct	route_in6 ip6_forward_rt;
+
 int ip6_forward_srcrt;			/* XXX */
 int ip6_sourcecheck;			/* XXX */
 int ip6_sourcecheck_interval;		/* XXX */
@@ -301,8 +301,6 @@ ip6_init2(void *dummy)
 /* This must be after route_init(), which is now SI_ORDER_THIRD */
 SYSINIT(netinet6init2, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, ip6_init2, NULL);
 
-extern struct	route_in6 ip6_forward_rt;
-
 void
 ip6_input(struct mbuf *m)
 {

Modified: head/sys/netinet6/ip6_var.h
==============================================================================
--- head/sys/netinet6/ip6_var.h	Sat Dec 13 19:11:46 2008	(r186047)
+++ head/sys/netinet6/ip6_var.h	Sat Dec 13 19:13:03 2008	(r186048)
@@ -313,15 +313,16 @@ extern int	ip6_auto_linklocal;
 extern int	ip6_use_tempaddr; /* whether to use temporary addresses. */
 extern int	ip6_prefer_tempaddr; /* whether to prefer temporary addresses
 					in the source address selection */
-#endif /* VIMAGE_GLOBALS */
+
+#ifdef IPSTEALTH
+extern int	ip6stealth;
+#endif
 
 extern int	ip6_use_defzone; /* whether to use the default scope zone
 				    when unspecified */
+#endif /* VIMAGE_GLOBALS */
 
 extern	struct pfil_head inet6_pfil_hook;	/* packet filter hooks */
-#ifdef IPSTEALTH
-extern int	ip6stealth;
-#endif
 
 extern struct	pr_usrreqs rip6_usrreqs;
 struct sockopt;

Modified: head/sys/netinet6/raw_ip6.h
==============================================================================
--- head/sys/netinet6/raw_ip6.h	Sat Dec 13 19:11:46 2008	(r186047)
+++ head/sys/netinet6/raw_ip6.h	Sat Dec 13 19:13:03 2008	(r186048)
@@ -48,7 +48,9 @@ struct rip6stat {
 };
 
 #ifdef _KERNEL
+#ifdef VIMAGE_GLOBALS
 extern struct rip6stat rip6stat;
 #endif
+#endif
 
 #endif

Modified: head/sys/netipsec/ipip_var.h
==============================================================================
--- head/sys/netipsec/ipip_var.h	Sat Dec 13 19:11:46 2008	(r186047)
+++ head/sys/netipsec/ipip_var.h	Sat Dec 13 19:13:03 2008	(r186048)
@@ -60,6 +60,8 @@ struct ipipstat
 
 #ifdef _KERNEL
 extern	int ipip_allow;
+#ifdef VIMAGE_GLOBALS
 extern	struct ipipstat ipipstat;
+#endif
 #endif /* _KERNEL */
 #endif /* _NETINET_IPIP_H_ */


More information about the svn-src-all mailing list