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
This commit is contained in:
Bjoern A. Zeeb 2008-12-13 19:13:03 +00:00
parent 011ad8e791
commit 1b193af610
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=186048
13 changed files with 42 additions and 18 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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)
{

View File

@ -313,16 +313,17 @@ 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 */
extern int ip6_use_defzone; /* whether to use the default scope zone
when unspecified */
extern struct pfil_head inet6_pfil_hook; /* packet filter hooks */
#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 */
extern struct pr_usrreqs rip6_usrreqs;
struct sockopt;

View File

@ -48,7 +48,9 @@ struct rip6stat {
};
#ifdef _KERNEL
#ifdef VIMAGE_GLOBALS
extern struct rip6stat rip6stat;
#endif
#endif
#endif

View File

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