1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-29 12:03:03 +00:00
freebsd/sys/netinet6
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
..
dest6.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
frag6.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
icmp6.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
icmp6.h
in6_cksum.c Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
in6_gif.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
in6_gif.h Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
in6_ifattach.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
in6_ifattach.h Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
in6_pcb.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
in6_pcb.h Merge in6_pcbfree() into in_pcbfree() which after the previous 2008-11-27 12:04:35 +00:00
in6_proto.c Conditionally compile out V_ globals while instantiating the appropriate 2008-12-10 23:12:39 +00:00
in6_rmx.c Add missing include to sys/lock.h before sys/rwlock.h 2008-12-08 00:28:21 +00:00
in6_src.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
in6_var.h Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
in6.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
in6.h Default to ignoring potentially evil IPv6 Neighbor Solicitation 2008-10-02 00:32:59 +00:00
ip6_ecn.h Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
ip6_forward.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
ip6_id.c Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
ip6_input.c Conditionally compile out V_ globals while instantiating the appropriate 2008-12-10 23:12:39 +00:00
ip6_ipsec.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
ip6_ipsec.h #if 0 out a currently unsued (and incomplete) function: ip6_ipsec_mtu(). 2008-03-14 11:44:30 +00:00
ip6_mroute.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
ip6_mroute.h Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
ip6_output.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
ip6_var.h Add a MAC label, MAC Framework, and MAC policy entry points for IPv6 2008-10-26 22:45:18 +00:00
ip6.h
ip6protosw.h Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
mld6_var.h Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
mld6.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
nd6_nbr.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
nd6_rtr.c Add missing include to sys/lock.h before sys/rwlock.h 2008-12-08 00:28:21 +00:00
nd6.c Conditionally compile out V_ globals while instantiating the appropriate 2008-12-10 23:12:39 +00:00
nd6.h Default to ignoring potentially evil IPv6 Neighbor Solicitation 2008-10-02 00:32:59 +00:00
pim6_var.h Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
pim6.h Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
raw_ip6.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
raw_ip6.h Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
route6.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
scope6_var.h Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
scope6.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
sctp6_usrreq.c Code from the hack-session known as the IETF (and a 2008-12-06 13:19:54 +00:00
sctp6_var.h 1) Adds the rest of the VIMAGE change macros 2008-07-09 16:45:30 +00:00
tcp6_var.h Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
udp6_usrreq.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
udp6_var.h Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
vinet6.h Conditionally compile out V_ globals while instantiating the appropriate 2008-12-10 23:12:39 +00:00