diff --git a/sys/net/raw_cb.h b/sys/net/raw_cb.h index 34dd875a8a0b..ffdf7317ac36 100644 --- a/sys/net/raw_cb.h +++ b/sys/net/raw_cb.h @@ -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; /* diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index 081f49067fa0..f0275bd53ff8 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -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 *); diff --git a/sys/netinet/ip_fw2.c b/sys/netinet/ip_fw2.c index 61c76cfd9431..5c3ac591e335 100644 --- a/sys/netinet/ip_fw2.c +++ b/sys/netinet/ip_fw2.c @@ -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"); diff --git a/sys/netinet/ip_fw_nat.c b/sys/netinet/ip_fw_nat.c index d770d5c248cb..54c91d94109c 100644 --- a/sys/netinet/ip_fw_nat.c +++ b/sys/netinet/ip_fw_nat.c @@ -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 diff --git a/sys/netinet/ip_fw_pfil.c b/sys/netinet/ip_fw_pfil.c index 246fdefca64a..952574d7b7d2 100644 --- a/sys/netinet/ip_fw_pfil.c +++ b/sys/netinet/ip_fw_pfil.c @@ -68,10 +68,12 @@ __FBSDID("$FreeBSD$"); #include +#ifdef VIMAGE_GLOBALS int fw_enable = 1; #ifdef INET6 int fw6_enable = 1; #endif +#endif int ipfw_chg_hook(SYSCTL_HANDLER_ARGS); diff --git a/sys/netinet/ip_var.h b/sys/netinet/ip_var.h index a4e73db48456..f023051eb200 100644 --- a/sys/netinet/ip_var.h +++ b/sys/netinet/ip_var.h @@ -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 *); diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index bb5c96847d03..ed872b92bd6e 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -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 * diff --git a/sys/netinet/udp_var.h b/sys/netinet/udp_var.h index c4c077a4cf1d..39805ed20b10 100644 --- a/sys/netinet/udp_var.h +++ b/sys/netinet/udp_var.h @@ -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 *); diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c index 380ee5508576..7090243b51b2 100644 --- a/sys/netinet6/in6_proto.c +++ b/sys/netinet6/in6_proto.c @@ -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... diff --git a/sys/netinet6/in6_var.h b/sys/netinet6/in6_var.h index c5642e2fdfb0..e906d7c61981 100644 --- a/sys/netinet6/in6_var.h +++ b/sys/netinet6/in6_var.h @@ -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) \ diff --git a/sys/netinet6/ip6_var.h b/sys/netinet6/ip6_var.h index 8f0c2c582c4a..e384da11bb55 100644 --- a/sys/netinet6/ip6_var.h +++ b/sys/netinet6/ip6_var.h @@ -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 */ diff --git a/sys/netinet6/nd6.h b/sys/netinet6/nd6.h index 4b4d6eccefbf..4d3c06bfecde 100644 --- a/sys/netinet6/nd6.h +++ b/sys/netinet6/nd6.h @@ -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 */ diff --git a/sys/netinet6/tcp6_var.h b/sys/netinet6/tcp6_var.h index f3611c2333f5..18a48a3ca002 100644 --- a/sys/netinet6/tcp6_var.h +++ b/sys/netinet6/tcp6_var.h @@ -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 *)); diff --git a/sys/netinet6/vinet6.h b/sys/netinet6/vinet6.h index d509977434b1..d6c3f336772b 100644 --- a/sys/netinet6/vinet6.h +++ b/sys/netinet6/vinet6.h @@ -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;