summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2008-12-13 19:13:03 +0000
committerbz <bz@FreeBSD.org>2008-12-13 19:13:03 +0000
commit98e7fe0e6a4b7ee298fffadcf232867ffeecbad6 (patch)
tree000c543641151e45c9fe34f2fa0d6c678def8f4c
parent03bced1c702a5a7827ac78973cb39290752dbfcc (diff)
downloadFreeBSD-src-98e7fe0e6a4b7ee298fffadcf232867ffeecbad6.zip
FreeBSD-src-98e7fe0e6a4b7ee298fffadcf232867ffeecbad6.tar.gz
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
-rw-r--r--sys/contrib/pf/net/pf_if.c2
-rw-r--r--sys/net/if_var.h4
-rw-r--r--sys/netinet/icmp6.h2
-rw-r--r--sys/netinet/icmp_var.h2
-rw-r--r--sys/netinet/in_var.h13
-rw-r--r--sys/netinet/ip_fw.h2
-rw-r--r--sys/netinet/ip_fw2.c7
-rw-r--r--sys/netinet/tcp_var.h4
-rw-r--r--sys/netinet6/in6_var.h3
-rw-r--r--sys/netinet6/ip6_input.c6
-rw-r--r--sys/netinet6/ip6_var.h9
-rw-r--r--sys/netinet6/raw_ip6.h2
-rw-r--r--sys/netipsec/ipip_var.h2
13 files changed, 41 insertions, 17 deletions
diff --git a/sys/contrib/pf/net/pf_if.c b/sys/contrib/pf/net/pf_if.c
index 62dbbf2..1972edc 100644
--- a/sys/contrib/pf/net/pf_if.c
+++ b/sys/contrib/pf/net/pf_if.c
@@ -115,8 +115,10 @@ void pfi_change_group_event(void * __unused, char *);
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);
diff --git a/sys/net/if_var.h b/sys/net/if_var.h
index 0724488..62c2b99 100644
--- a/sys/net/if_var.h
+++ b/sys/net/if_var.h
@@ -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 *);
diff --git a/sys/netinet/icmp6.h b/sys/netinet/icmp6.h
index 91b1658..fcdc9ce 100644
--- a/sys/netinet/icmp6.h
+++ b/sys/netinet/icmp6.h
@@ -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
diff --git a/sys/netinet/icmp_var.h b/sys/netinet/icmp_var.h
index dda84f2..cd9ee00 100644
--- a/sys/netinet/icmp_var.h
+++ b/sys/netinet/icmp_var.h
@@ -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
diff --git a/sys/netinet/in_var.h b/sys/netinet/in_var.h
index 1190826..7facfa8 100644
--- a/sys/netinet/in_var.h
+++ b/sys/netinet/in_var.h
@@ -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
diff --git a/sys/netinet/ip_fw.h b/sys/netinet/ip_fw.h
index 6e7db99..831686d 100644
--- a/sys/netinet/ip_fw.h
+++ b/sys/netinet/ip_fw.h
@@ -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
diff --git a/sys/netinet/ip_fw2.c b/sys/netinet/ip_fw2.c
index 5c3ac59..826be2b 100644
--- a/sys/netinet/ip_fw2.c
+++ b/sys/netinet/ip_fw2.c
@@ -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_ip_fw, OID_AUTO, debug, CTLFLAG_RW,
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,
diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h
index ed872b9..a4392cb 100644
--- a/sys/netinet/tcp_var.h
+++ b/sys/netinet/tcp_var.h
@@ -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 {
diff --git a/sys/netinet6/in6_var.h b/sys/netinet6/in6_var.h
index e906d7c..957155a 100644
--- a/sys/netinet6/in6_var.h
+++ b/sys/netinet6/in6_var.h
@@ -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 */
diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c
index 7edcaa3..0c259e3 100644
--- a/sys/netinet6/ip6_input.c
+++ b/sys/netinet6/ip6_input.c
@@ -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)
{
diff --git a/sys/netinet6/ip6_var.h b/sys/netinet6/ip6_var.h
index e384da1..5975cc9 100644
--- a/sys/netinet6/ip6_var.h
+++ b/sys/netinet6/ip6_var.h
@@ -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;
diff --git a/sys/netinet6/raw_ip6.h b/sys/netinet6/raw_ip6.h
index 9ebd823..a57253e 100644
--- a/sys/netinet6/raw_ip6.h
+++ b/sys/netinet6/raw_ip6.h
@@ -48,7 +48,9 @@ struct rip6stat {
};
#ifdef _KERNEL
+#ifdef VIMAGE_GLOBALS
extern struct rip6stat rip6stat;
#endif
+#endif
#endif
diff --git a/sys/netipsec/ipip_var.h b/sys/netipsec/ipip_var.h
index 7fbc643..3d4ee15 100644
--- a/sys/netipsec/ipip_var.h
+++ b/sys/netipsec/ipip_var.h
@@ -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_ */
OpenPOWER on IntegriCloud