Put a global variables, which were virtualized but formerly

missed under VIMAGE_GLOBAL.

Start putting 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.

While there garbage collect a few dead externs from ip6_var.h.

Sponsored by:	The FreeBSD Foundation
This commit is contained in:
bz 2008-12-11 16:26:38 +00:00
parent 83955c51af
commit 83a32f8750
14 changed files with 37 additions and 19 deletions

View File

@ -55,7 +55,9 @@ struct rawcb {
#define RAWRCVQ 8192
#ifdef _KERNEL
#ifdef VIMAGE_GLOBALS
extern LIST_HEAD(rawcb_list_head, rawcb) rawcb_list;
#endif
extern struct mtx rawcb_mtx;
/*

View File

@ -450,6 +450,7 @@ void inp_4tuple_get(struct inpcb *inp, uint32_t *laddr, uint16_t *lp,
#define INP_CHECK_SOCKAF(so, af) (INP_SOCKAF(so) == af)
#ifdef _KERNEL
#ifdef VIMAGE_GLOBALS
extern int ipport_reservedhigh;
extern int ipport_reservedlow;
extern int ipport_lowfirstauto;
@ -463,6 +464,7 @@ extern int ipport_randomcps;
extern int ipport_randomtime;
extern int ipport_stoprandom;
extern int ipport_tcpallocs;
#endif
extern struct callout ipport_tick_callout;
void in_pcbpurgeif0(struct inpcbinfo *, struct ifnet *);

View File

@ -149,7 +149,9 @@ struct ip_fw_ugid {
/*
* list of rules for layer 3
*/
#ifdef VIMAGE_GLOBALS
struct ip_fw_chain layer3_chain;
#endif
MALLOC_DEFINE(M_IPFW, "IpFw/IpAcct", "IpFw/IpAcct chain's");
MALLOC_DEFINE(M_IPFW_TBL, "ipfw_tbl", "IpFw tables");

View File

@ -69,9 +69,8 @@ __FBSDID("$FreeBSD$");
MALLOC_DECLARE(M_IPFW);
extern struct ip_fw_chain layer3_chain;
#ifdef VIMAGE_GLOBALS
extern struct ip_fw_chain layer3_chain;
static eventhandler_tag ifaddr_event_tag;
#endif

View File

@ -68,10 +68,12 @@ __FBSDID("$FreeBSD$");
#include <machine/in_cksum.h>
#ifdef VIMAGE_GLOBALS
int fw_enable = 1;
#ifdef INET6
int fw6_enable = 1;
#endif
#endif
int ipfw_chg_hook(SYSCTL_HANDLER_ARGS);

View File

@ -175,6 +175,7 @@ struct inpcb;
struct route;
struct sockopt;
#ifdef VIMAGE_GLOBALS
extern struct ipstat ipstat;
extern u_short ip_id; /* ip packet ctr, for ids */
extern int ip_do_randomid;
@ -183,12 +184,13 @@ extern int ipforwarding; /* ip forwarding */
#ifdef IPSTEALTH
extern int ipstealth; /* stealth forwarding */
#endif
extern u_char ip_protox[];
extern int rsvp_on;
extern struct socket *ip_rsvpd; /* reservation protocol daemon */
extern struct socket *ip_mrouter; /* multicast routing daemon */
#endif
extern u_char ip_protox[];
extern int (*legal_vif_num)(int);
extern u_long (*ip_mcast_src)(int);
extern int rsvp_on;
extern struct pr_usrreqs rip_usrreqs;
void inp_freemoptions(struct ip_moptions *);

View File

@ -513,10 +513,12 @@ SYSCTL_DECL(_net_inet_tcp_sack);
MALLOC_DECLARE(M_TCPLOG);
#endif
extern int tcp_log_in_vain;
#ifdef VIMAGE_GLOBALS
extern struct inpcbhead tcb; /* head of queue of active tcpcb's */
extern struct inpcbinfo tcbinfo;
extern struct tcpstat tcpstat; /* tcp statistics */
extern int tcp_log_in_vain;
extern int tcp_mssdflt; /* XXX */
extern int tcp_minmss;
extern int tcp_delack_enabled;
@ -548,6 +550,7 @@ extern int tcp_sack_globalholes;
extern int tcp_sc_rst_sock_fail; /* RST on sock alloc failure */
extern int tcp_do_ecn; /* TCP ECN enabled/disabled */
extern int tcp_ecn_maxretries;
#endif /* VIMAGE_GLOBALS */
int tcp_addoptions(struct tcpopt *, u_char *);
struct tcpcb *

View File

@ -94,12 +94,15 @@ struct udpstat {
SYSCTL_DECL(_net_inet_udp);
extern struct pr_usrreqs udp_usrreqs;
#ifdef VIMAGE_GLOBALS
extern struct inpcbhead udb;
extern struct inpcbinfo udbinfo;
extern u_long udp_sendspace;
extern u_long udp_recvspace;
extern struct udpstat udpstat;
extern int udp_blackhole;
#endif
extern u_long udp_sendspace;
extern u_long udp_recvspace;
extern int udp_log_in_vain;
void udp_ctlinput(int, struct sockaddr *, void *);

View File

@ -390,9 +390,7 @@ int ip6_keepfaith;
time_t ip6_log_time;
int ip6stealth;
int nd6_onlink_ns_rfc4861;
#endif
#ifdef VIMAGE_GLOBALS
/* icmp6 */
/*
* BSDI4 defines these variables in in_proto.c...

View File

@ -470,9 +470,11 @@ struct in6_rrenumreq {
#endif
#ifdef _KERNEL
#ifdef VIMAGE_GLOBALS
extern struct in6_ifaddr *in6_ifaddr;
extern struct icmp6stat icmp6stat;
#endif /* VIMAGE_GLOBALS */
#define in6_ifstat_inc(ifp, tag) \
do { \
if (ifp) \

View File

@ -279,6 +279,7 @@ struct ip6aux {
#define IP6_HDR_ALIGNED_P(ip) ((((intptr_t) (ip)) & 3) == 0)
#endif
#ifdef VIMAGE_GLOBALS
extern struct ip6stat ip6stat; /* statistics */
extern int ip6_defhlim; /* default hop limit */
extern int ip6_defmcasthlim; /* default multicast hop limit */
@ -290,8 +291,10 @@ extern int ip6_rr_prune; /* router renumbering prefix
* walk list every 5 sec. */
extern int ip6_mcast_pmtu; /* enable pMTU discovery for multicast? */
extern int ip6_v6only;
#endif /* VIMAGE_GLOBALS */
extern struct socket *ip6_mrouter; /* multicast routing daemon */
#ifdef VIMAGE_GLOBALS
extern int ip6_sendredirects; /* send IP redirects when forwarding? */
extern int ip6_maxfragpackets; /* Maximum packets in reassembly queue */
extern int ip6_maxfrags; /* Maximum fragments in reassembly queue */
@ -304,17 +307,13 @@ extern time_t ip6_log_time;
extern int ip6_hdrnestlimit; /* upper limit of # of extension headers */
extern int ip6_dad_count; /* DupAddrDetectionTransmits */
extern int ip6_auto_flowlabel;
extern int ip6_auto_linklocal;
extern int ip6_anonportmin; /* minimum ephemeral port */
extern int ip6_anonportmax; /* maximum ephemeral port */
extern int ip6_lowportmin; /* minimum reserved port */
extern int ip6_lowportmax; /* maximum reserved port */
extern int ip6_auto_flowlabel;
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 */

View File

@ -328,6 +328,7 @@ struct nd_pfxrouter {
LIST_HEAD(nd_prhead, nd_prefix);
/* nd6.c */
#ifdef VIMAGE_GLOBALS
extern int nd6_prune;
extern int nd6_delay;
extern int nd6_umaxtries;
@ -341,8 +342,6 @@ extern struct nd_prhead nd_prefix;
extern int nd6_debug;
extern int nd6_onlink_ns_rfc4861;
#define nd6log(x) do { if (V_nd6_debug) log x; } while (/*CONSTCOND*/ 0)
extern struct callout nd6_timer_ch;
/* nd6_rtr.c */
@ -351,6 +350,9 @@ extern int ip6_desync_factor; /* seconds */
extern u_int32_t ip6_temp_preferred_lifetime; /* seconds */
extern u_int32_t ip6_temp_valid_lifetime; /* seconds */
extern int ip6_temp_regen_advance; /* seconds */
#endif /* VIMAGE_GLOBALS */
#define nd6log(x) do { if (V_nd6_debug) log x; } while (/*CONSTCOND*/ 0)
union nd_opts {
struct nd_opt_hdr *nd_opt_array[8]; /* max = target address list */

View File

@ -67,7 +67,9 @@
SYSCTL_DECL(_net_inet6_tcp6);
#endif
#ifdef VIMAGE_GLOBALS
extern int tcp_v6mssdflt; /* XXX */
#endif
struct ip6_hdr;
void tcp6_ctlinput __P((int, struct sockaddr *, void *));

View File

@ -77,6 +77,7 @@ struct vnet_inet6 {
int _nd6_inuse;
int _nd6_allocated;
int _nd6_onlink_ns_rfc4861;
struct llinfo_nd6 _llinfo_nd6;
struct nd_drhead _nd_defrouter;
struct nd_prhead _nd_prefix;
@ -109,7 +110,6 @@ struct vnet_inet6 {
int _ip6_keepfaith;
int _ip6stealth;
time_t _ip6_log_time;
int _nd6_onlink_ns_rfc4861;
int _pmtu_expire;
int _pmtu_probe;