freebsd-nq/sys/netinet
Marko Zec 385195c062 Conditionally compile out V_ globals while instantiating the appropriate
container structures, depending on VIMAGE_GLOBALS compile time option.

Make VIMAGE_GLOBALS a new compile-time option, which by default will not
be defined, resulting in instatiations of global variables selected for
V_irtualization (enclosed in #ifdef VIMAGE_GLOBALS blocks) to be
effectively compiled out.  Instantiate new global container structures
to hold V_irtualized variables: vnet_net_0, vnet_inet_0, vnet_inet6_0,
vnet_ipsec_0, vnet_netgraph_0, and vnet_gif_0.

Update the VSYM() macro so that depending on VIMAGE_GLOBALS the V_
macros resolve either to the original globals, or to fields inside
container structures, i.e. effectively

#ifdef VIMAGE_GLOBALS
#define V_rt_tables rt_tables
#else
#define V_rt_tables vnet_net_0._rt_tables
#endif

Update SYSCTL_V_*() macros to operate either on globals or on fields
inside container structs.

Extend the internal kldsym() lookups with the ability to resolve
selected fields inside the virtualization container structs.  This
applies only to the fields which are explicitly registered for kldsym()
visibility via VNET_MOD_DECLARE() and vnet_mod_register(), currently
this is done only in sys/net/if.c.

Fix a few broken instances of MODULE_GLOBAL() macro use in SCTP code,
and modify the MODULE_GLOBAL() macro to resolve to V_ macros, which in
turn result in proper code being generated depending on VIMAGE_GLOBALS.

De-virtualize local static variables in sys/contrib/pf/net/pf_subr.c
which were prematurely V_irtualized by automated V_ prepending scripts
during earlier merging steps.  PF virtualization will be done
separately, most probably after next PF import.

Convert a few variable initializations at instantiation to
initialization in init functions, most notably in ipfw.  Also convert
TUNABLE_INT() initializers for V_ variables to TUNABLE_FETCH_INT() in
initializer functions.

Discussed at:	devsummit Strassburg
Reviewed by:	bz, julian
Approved by:	julian (mentor)
Obtained from:	//depot/projects/vimage-commit2/...
X-MFC after:	never
Sponsored by:	NLnet Foundation, The FreeBSD Foundation
2008-12-10 23:12:39 +00:00
..
libalias Conditionally compile out V_ globals while instantiating the appropriate 2008-12-10 23:12:39 +00:00
accf_data.c Add FBSDID to all files in netinet so that people can more 2007-10-07 20:44:24 +00:00
accf_dns.c Add an accept filter for TCP based DNS requests. It waits until the 2008-07-18 14:44:51 +00:00
accf_http.c Add FBSDID to all files in netinet so that people can more 2007-10-07 20:44:24 +00:00
icmp6.h - Disabled responding to NI queries from a global address by default as 2007-05-17 21:20:24 +00:00
icmp_var.h Attempt to improve feature parity between UDPv4 and UDPv6 by merging 2007-07-19 22:34:25 +00:00
if_atm.c Add code to allow the system to handle multiple routing tables. 2008-05-09 23:03:00 +00:00
if_atm.h
if_ether.c in_rtalloc1(9) returns a locked route, so make sure that we use 2008-12-06 19:09:38 +00:00
if_ether.h Don't duplicate the whole of arpresolve to arpresolve 2 for the sake 2007-12-31 23:48:06 +00:00
igmp_var.h Import rewrite of IPv4 socket multicast layer to support source-specific 2007-06-12 16:24:56 +00:00
igmp.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
igmp.h Stub out imported IGMPv3 definitions which clash with those of 2007-06-15 18:59:10 +00:00
in_cksum.c Add FBSDID to all files in netinet so that people can more 2007-10-07 20:44:24 +00:00
in_gif.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
in_gif.h
in_mcast.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
in_pcb.c Remove inconsistent white space from in_pcballoc(). 2008-12-10 13:24:38 +00:00
in_pcb.h Update comment on INP_TIMEWAIT to say what it's about, as we caution 2008-12-09 23:57:09 +00:00
in_proto.c Conditionally compile out V_ globals while instantiating the appropriate 2008-12-10 23:12:39 +00:00
in_rmx.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
in_systm.h
in_var.h Change the initialization methodology for global variables scheduled 2008-11-19 09:39:34 +00:00
in.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
in.h Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
ip6.h Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
ip_carp.c In a case of CARP status change run through the if_link_state_change() 2008-12-05 14:37:14 +00:00
ip_carp.h Make sure that carp_header is 36 bytes long 2006-12-01 18:37:41 +00:00
ip_divert.c Conditionally compile out V_ globals while instantiating the appropriate 2008-12-10 23:12:39 +00:00
ip_divert.h
ip_dummynet.c Conditionally compile out V_ globals while instantiating the appropriate 2008-12-10 23:12:39 +00:00
ip_dummynet.h Type of q_time (start of queue idle time) has changed: uint32_t -> uint64_t. 2008-10-28 14:14:57 +00:00
ip_ecn.c Add FBSDID to all files in netinet so that people can more 2007-10-07 20:44:24 +00:00
ip_ecn.h
ip_encap.c Add FBSDID to all files in netinet so that people can more 2007-10-07 20:44:24 +00:00
ip_encap.h
ip_fastfwd.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
ip_fw2.c Conditionally compile out V_ globals while instantiating the appropriate 2008-12-10 23:12:39 +00:00
ip_fw_nat.c Conditionally compile out V_ globals while instantiating the appropriate 2008-12-10 23:12:39 +00:00
ip_fw_pfil.c Conditionally compile out V_ globals while instantiating the appropriate 2008-12-10 23:12:39 +00:00
ip_fw.h Conditionally compile out V_ globals while instantiating the appropriate 2008-12-10 23:12:39 +00:00
ip_gre.c Enqueue de-capsulated packet instead of performing direct dispatch. It's 2008-07-04 21:01:30 +00:00
ip_gre.h
ip_icmp.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
ip_icmp.h Change the initialization methodology for global variables scheduled 2008-11-19 09:39:34 +00:00
ip_id.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
ip_input.c Conditionally compile out V_ globals while instantiating the appropriate 2008-12-10 23:12:39 +00:00
ip_ipsec.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
ip_ipsec.h Take the route mtu into account, if available, when sending an 2008-04-09 05:17:18 +00:00
ip_mroute.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
ip_mroute.h Add code to allow the system to handle multiple routing tables. 2008-05-09 23:03:00 +00:00
ip_options.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
ip_options.h Normalize style a bit: reduce pseudo-randomness of comment layout and 2007-05-11 10:48:30 +00:00
ip_output.c Conditionally compile out V_ globals while instantiating the appropriate 2008-12-10 23:12:39 +00:00
ip_var.h Conditionally compile out V_ globals while instantiating the appropriate 2008-12-10 23:12:39 +00:00
ip.h Move CTASSERT from header file to source file, per implementation note now 2008-09-26 18:30:11 +00:00
ipprotosw.h
pim_var.h
pim.h
raw_ip.c Conditionally compile out V_ globals while instantiating the appropriate 2008-12-10 23:12:39 +00:00
sctp_asconf.c Code from the hack-session known as the IETF (and a 2008-12-06 13:19:54 +00:00
sctp_asconf.h Code from the hack-session known as the IETF (and a 2008-12-06 13:19:54 +00:00
sctp_auth.c Code from the hack-session known as the IETF (and a 2008-12-06 13:19:54 +00:00
sctp_auth.h Code from the hack-session known as the IETF (and a 2008-12-06 13:19:54 +00:00
sctp_bsd_addr.c Nit 2008-08-09 11:28:57 +00:00
sctp_bsd_addr.h 1) Adds the rest of the VIMAGE change macros 2008-07-09 16:45:30 +00:00
sctp_cc_functions.c - Macro-izes the packed declaration in all headers. 2008-06-14 07:58:05 +00:00
sctp_cc_functions.h 1) Adds the rest of the VIMAGE change macros 2008-07-09 16:45:30 +00:00
sctp_constants.h Code from the hack-session known as the IETF (and a 2008-12-06 13:19:54 +00:00
sctp_crc32.c Reported by Yehuda Weinraub (yehudasa@gamil.com) - CRC32C algorithm 2008-10-18 15:53:31 +00:00
sctp_crc32.h 1) Adds the rest of the VIMAGE change macros 2008-07-09 16:45:30 +00:00
sctp_header.h Code from the hack-session known as the IETF (and a 2008-12-06 13:19:54 +00:00
sctp_indata.c Code from the hack-session known as the IETF (and a 2008-12-06 13:19:54 +00:00
sctp_indata.h Code from the hack-session known as the IETF (and a 2008-12-06 13:19:54 +00:00
sctp_input.c Code from the hack-session known as the IETF (and a 2008-12-06 13:19:54 +00:00
sctp_input.h 1) Adds the rest of the VIMAGE change macros 2008-07-09 16:45:30 +00:00
sctp_lock_bsd.h - Make strict-sacks be the default. 2008-08-28 09:44:07 +00:00
sctp_os_bsd.h Conditionally compile out V_ globals while instantiating the appropriate 2008-12-10 23:12:39 +00:00
sctp_os.h - Fix address add handling to clear cached routes and source addresses 2007-08-24 00:53:53 +00:00
sctp_output.c Code from the hack-session known as the IETF (and a 2008-12-06 13:19:54 +00:00
sctp_output.h Code from the hack-session known as the IETF (and a 2008-12-06 13:19:54 +00:00
sctp_pcb.c Conditionally compile out V_ globals while instantiating the appropriate 2008-12-10 23:12:39 +00:00
sctp_pcb.h Code from the hack-session known as the IETF (and a 2008-12-06 13:19:54 +00:00
sctp_peeloff.c - Macro-izes the packed declaration in all headers. 2008-06-14 07:58:05 +00:00
sctp_peeloff.h - Copyright change, cisco's silly tool wants it to say: 2007-05-08 17:01:12 +00:00
sctp_structs.h Code from the hack-session known as the IETF (and a 2008-12-06 13:19:54 +00:00
sctp_sysctl.c Code from the hack-session known as the IETF (and a 2008-12-06 13:19:54 +00:00
sctp_sysctl.h Code from the hack-session known as the IETF (and a 2008-12-06 13:19:54 +00:00
sctp_timer.c Code from the hack-session known as the IETF (and a 2008-12-06 13:19:54 +00:00
sctp_timer.h Invariants changes that make more sense. 2008-10-27 13:53:31 +00:00
sctp_uio.h Code from the hack-session known as the IETF (and a 2008-12-06 13:19:54 +00:00
sctp_usrreq.c Code from the hack-session known as the IETF (and a 2008-12-06 13:19:54 +00:00
sctp_var.h Code from the hack-session known as the IETF (and a 2008-12-06 13:19:54 +00:00
sctp.h Code from the hack-session known as the IETF (and a 2008-12-06 13:19:54 +00:00
sctputil.c Code from the hack-session known as the IETF (and a 2008-12-06 13:19:54 +00:00
sctputil.h Code from the hack-session known as the IETF (and a 2008-12-06 13:19:54 +00:00
tcp_debug.c To my reading there are no real consumers of ip6_plen (IPv6 2008-09-07 20:44:45 +00:00
tcp_debug.h o Use a define for a buffer size. 2007-03-24 22:15:02 +00:00
tcp_fsm.h Make tcpstates[] static, and make sure TCPSTATES is defined before 2007-07-30 11:06:42 +00:00
tcp_hostcache.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
tcp_hostcache.h Add an essential .h file that skipped from the last commit (r185419). 2008-11-28 23:39:25 +00:00
tcp_input.c Enhance one comment relating to recent TCP locking changes, and fix a 2008-12-09 15:49:02 +00:00
tcp_lro.c Don't calculate checksum if it has already been validated 2008-08-24 02:31:09 +00:00
tcp_lro.h Add generic TCP LOR into netinet 2008-06-11 22:12:50 +00:00
tcp_offload.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
tcp_offload.h - Switch to INP_WLOCK macro from inp_wlock 2008-07-21 21:22:56 +00:00
tcp_output.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
tcp_reass.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
tcp_sack.c Conditionally compile out V_ globals while instantiating the appropriate 2008-12-10 23:12:39 +00:00
tcp_seq.h
tcp_subr.c Conditionally compile out V_ globals while instantiating the appropriate 2008-12-10 23:12:39 +00:00
tcp_syncache.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
tcp_syncache.h Move syncache flag definitions below data structure, compress some vertical 2008-12-10 11:11:43 +00:00
tcp_timer.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
tcp_timer.h Two changes: 2007-09-24 05:26:24 +00:00
tcp_timewait.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
tcp_usrreq.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
tcp_var.h Move flag definitions for t_flags and t_oobflags below the definition of 2008-12-10 11:03:16 +00:00
tcp.h add rcv_nxt, snd_nxt, and toe offload id to FreeBSD-specific 2008-05-05 20:13:31 +00:00
tcpip.h
toedev.h Don't check if an interface can do tcp offload if there are no offload devices registered on the system. 2008-09-01 05:30:22 +00:00
udp_usrreq.c Conditionally compile out V_ globals while instantiating the appropriate 2008-12-10 23:12:39 +00:00
udp_var.h Further cleanup of UDPv4: 2007-07-10 09:30:46 +00:00
udp.h Gratuitous UDP restyling toward style(9) in 7.x. 2007-02-20 10:13:11 +00:00
vinet.h Conditionally compile out V_ globals while instantiating the appropriate 2008-12-10 23:12:39 +00:00