Vimage Coding - beginners guide / FAQ







struct vimage *vimage        /* The vimage */
    struct vnet *v_net       /* The virtualize network stack. */
        void *mod_data[n]    /* The different subsystem types like INET, INET6, GIF, ... */

Obviously lower levels might be cached somewhere else to not always need the full indirections from *vimage. In case virtualization is compiled out, there will always be only a single instance of a container struct for each subsystem type. Those are globals then, like:

#ifndef VIMAGE
struct vnet_inet vnet_inet_0;
struct vnet_ipfw vnet_ipfw_0;
struct vnet_netgraph vnet_netgraph_0;
struct vnet_gif vnet_gif_0;
...
#endif

(obviously not under a single #ifndef but each of the globals in the file close(st) to the subsystem they represent).