freebsd-nq/sys/netinet6
Marko Zec f6dfe47a14 Permit buiding kernels with options VIMAGE, restricted to only a single
active network stack instance.  Turning on options VIMAGE at compile
time yields the following changes relative to default kernel build:

1) V_ accessor macros for virtualized variables resolve to structure
fields via base pointers, instead of being resolved as fields in global
structs or plain global variables.  As an example, V_ifnet becomes:

    options VIMAGE:          ((struct vnet_net *) vnet_net)->_ifnet
    default build:           vnet_net_0._ifnet
    options VIMAGE_GLOBALS:  ifnet

2) INIT_VNET_* macros will declare and set up base pointers to be used
by V_ accessor macros, instead of resolving to whitespace:

    INIT_VNET_NET(ifp->if_vnet); becomes

    struct vnet_net *vnet_net = (ifp->if_vnet)->mod_data[VNET_MOD_NET];

3) Memory for vnet modules registered via vnet_mod_register() is now
allocated at run time in sys/kern/kern_vimage.c, instead of per vnet
module structs being declared as globals.  If required, vnet modules
can now request the framework to provide them with allocated bzeroed
memory by filling in the vmi_size field in their vmi_modinfo structures.

4) structs socket, ifnet, inpcbinfo, tcpcb and syncache_head are
extended to hold a pointer to the parent vnet.  options VIMAGE builds
will fill in those fields as required.

5) curvnet is introduced as a new global variable in options VIMAGE
builds, always pointing to the default and only struct vnet.

6) struct sysctl_oid has been extended with additional two fields to
store major and minor virtualization module identifiers, oid_v_subs and
oid_v_mod.  SYSCTL_V_* family of macros will fill in those fields
accordingly, and store the offset in the appropriate vnet container
struct in oid_arg1.
In sysctl handlers dealing with virtualized sysctls, the
SYSCTL_RESOLVE_V_ARG1() macro will compute the address of the target
variable and make it available in arg1 variable for further processing.

Unused fields in structs vnet_inet, vnet_inet6 and vnet_ipfw have
been deleted.

Reviewed by:	bz, rwatson
Approved by:	julian (mentor)
2009-04-30 13:36:26 +00:00
..
dest6.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
frag6.c First pass at separating per-vnet initializer functions 2009-04-06 22:29:41 +00:00
icmp6.c Bite the bullet, and make the IPv6 SSM and MLDv2 mega-commit: 2009-04-29 19:19:13 +00:00
icmp6.h
in6_cksum.c Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
in6_gif.c On architectures with strict alignment requirements compensate 2009-03-07 19:08:58 +00:00
in6_gif.h Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
in6_ifattach.c Permit buiding kernels with options VIMAGE, restricted to only a single 2009-04-30 13:36:26 +00:00
in6_ifattach.h Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
in6_mcast.c Permit buiding kernels with options VIMAGE, restricted to only a single 2009-04-30 13:36:26 +00:00
in6_pcb.c Bite the bullet, and make the IPv6 SSM and MLDv2 mega-commit: 2009-04-29 19:19:13 +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 Permit buiding kernels with options VIMAGE, restricted to only a single 2009-04-30 13:36:26 +00:00
in6_rmx.c In preparation for turning on options VIMAGE in next commits, 2009-04-26 22:06:42 +00:00
in6_src.c First pass at separating per-vnet initializer functions 2009-04-06 22:29:41 +00:00
in6_var.h Bite the bullet, and make the IPv6 SSM and MLDv2 mega-commit: 2009-04-29 19:19:13 +00:00
in6.c Bite the bullet, and make the IPv6 SSM and MLDv2 mega-commit: 2009-04-29 19:19:13 +00:00
in6.h Add IN6ADDR_LINKLOCAL_ALLV2ROUTERS_INIT, in6addr_linklocal_allv2routers 2009-04-29 10:22:44 +00:00
ip6_ecn.h Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
ip6_forward.c Try to remove/assimilate as much of formerly IPv4/6 specific 2009-02-08 09:27:07 +00:00
ip6_id.c Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
ip6_input.c Permit buiding kernels with options VIMAGE, restricted to only a single 2009-04-30 13:36:26 +00:00
ip6_ipsec.c Try to remove/assimilate as much of formerly IPv4/6 specific 2009-02-08 09:27:07 +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 Bite the bullet, and make the IPv6 SSM and MLDv2 mega-commit: 2009-04-29 19:19:13 +00:00
ip6_mroute.h Introduce a number of changes to the MROUTING code. 2009-03-19 01:43:03 +00:00
ip6_output.c Bite the bullet, and make the IPv6 SSM and MLDv2 mega-commit: 2009-04-29 19:19:13 +00:00
ip6_var.h Bite the bullet, and make the IPv6 SSM and MLDv2 mega-commit: 2009-04-29 19:19:13 +00:00
ip6.h
ip6protosw.h struct ip6protosw is a copy of struct protosw, so remove pr_usrreq there 2009-01-04 21:13:51 +00:00
mld6_var.h Bite the bullet, and make the IPv6 SSM and MLDv2 mega-commit: 2009-04-29 19:19:13 +00:00
mld6.c Permit buiding kernels with options VIMAGE, restricted to only a single 2009-04-30 13:36:26 +00:00
mld6.h Add MLDv2 protocol header, but do not connect it to the build. 2009-04-29 11:31:23 +00:00
nd6_nbr.c Update stats in struct icmpstat and icmp6stat using four new 2009-04-12 13:22:33 +00:00
nd6_rtr.c In preparation for turning on options VIMAGE in next commits, 2009-04-26 22:06:42 +00:00
nd6.c Permit buiding kernels with options VIMAGE, restricted to only a single 2009-04-30 13:36:26 +00:00
nd6.h Change if_output to take a struct route as its fourth argument in order 2009-04-16 20:30:28 +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 Permit buiding kernels with options VIMAGE, restricted to only a single 2009-04-30 13:36:26 +00:00
raw_ip6.h Second round of putting global variables, which were virtualized 2008-12-13 19:13:03 +00:00
route6.c Start removing IPv6 Type 0 Routing header code. 2009-03-03 13:12:12 +00:00
scope6_var.h Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
scope6.c First pass at separating per-vnet initializer functions 2009-04-06 22:29:41 +00:00
sctp6_usrreq.c - Cleanup checksum code. 2009-02-03 11:04:03 +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 Put a global variables, which were virtualized but formerly 2008-12-11 16:26:38 +00:00
udp6_usrreq.c Bite the bullet, and make the IPv6 SSM and MLDv2 mega-commit: 2009-04-29 19:19:13 +00:00
udp6_var.h Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
vinet6.h Permit buiding kernels with options VIMAGE, restricted to only a single 2009-04-30 13:36:26 +00:00