freebsd-nq/sys/netipsec
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
..
ah_var.h
ah.h
esp_var.h
esp.h
ipcomp_var.h
ipcomp.h
ipip_var.h
ipsec6.h Unify ipsec[46]_delete_pcbpolicy in ipsec_delete_pcbpolicy. 2008-11-27 10:43:08 +00:00
ipsec_input.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
ipsec_mbuf.c Step 1.5 of importing the network stack virtualization infrastructure 2008-10-02 15:37:58 +00:00
ipsec_output.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
ipsec.c Conditionally compile out V_ globals while instantiating the appropriate 2008-12-10 23:12:39 +00:00
ipsec.h Unify ipsec[46]_delete_pcbpolicy in ipsec_delete_pcbpolicy. 2008-11-27 10:43:08 +00:00
key_debug.c Fix bugs when allocating and passing information of current lifetime and 2008-03-02 17:12:28 +00:00
key_debug.h Commit step 1 of the vimage project, (network stack) 2008-08-17 23:27:27 +00:00
key_var.h
key.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
key.h
keydb.h
keysock.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
keysock.h Unhide declarations of network stack virtualization structs from 2008-11-28 23:30:51 +00:00
vipsec.h Conditionally compile out V_ globals while instantiating the appropriate 2008-12-10 23:12:39 +00:00
xform_ah.c Change the initialization methodology for global variables scheduled 2008-11-19 09:39:34 +00:00
xform_esp.c Change the initialization methodology for global variables scheduled 2008-11-19 09:39:34 +00:00
xform_ipcomp.c Change the initialization methodology for global variables scheduled 2008-11-19 09:39:34 +00:00
xform_ipip.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
xform_tcp.c Add ';' missed with the SYSINIT changes. 2008-03-21 18:31:42 +00:00
xform.h Add sysctls to if_enc(4) to control whether the firewalls or 2007-11-28 22:33:53 +00:00