Vnet Module Command Interface
Mike Wray <mike.wray@hp.com>
2005/08/25

When insmod the vnet-module creates /proc/vnet/policy which
can be used to control the module by writing commands into it.
The return code from the command should be returned by close.
Xend uses these commands to implement its vnet interface.

The commands are:

(vnet.add (id <id>) [(vnetif <ifname>)] [(security { none | auth | conf } )] )

Create the vnet with id <id> and the given security level (default none).
Vnet ids are 128-bit and can be specified as 8 fields of 1 to 4 hex digits
separated by colons. A vnet id with no colons is treated as one with the first
7 fields zero. Examples:

1500 - equivalent to 0:0:0:0:0:0:0:1500
aaff:0:0:0:0:0:77:88

Security levels:
- none: no security
- auth: message authentication (IPSEC hmac)
- conf: message confidentiality (IPSEC hmac and encryption)

The <ifname> is the name of the network device created for the vnet.
If not given it defaults to vnif<N>, where <N> is the hex for the
8-th field in the id. Note that network device names can have a
maximum of 14 characters.

(vnet.del (id <id>))

Delete the vnet with id <id>.

(vif.add (vnet <vnetid>) (vmac <macaddr>))

Add the vif with MAC address <macaddr> to the vnet with id <vnetid>.
This makes the vnet module respond to VARP requests for <macaddr>
on vnet <vnetid>.

(vif.del (vnet <vnetid>) (vmac <macaddr>))

Remove the vif with MAC address <macaddr> from the vnet with id <vnetid>.
The vnet module will stop responding to VARP for the vif.

(vif.print)

Print the known vnets, vifs and varp cache on the console.

Examples:

To create vnet 10 with no security:

echo '(vnet.add (id 10))' > /proc/vnet/policy

This creates a device vnif0010.

To create vnet 11 with message authentication:

echo '(vnet.add (id 11) (security auth))' > /proc/vnet/policy

To add the vif with vmac "aa:00:00:bc:34:ae" to vnet 10:

echo '(vif.add (vnet 10) (vmac aa:00:00:bc:34:ae))' > /proc/vnet/policy

To remove the vif from the vnet:

echo '(vif.del (vnet 10) (vmac aa:00:00:bc:34:ae))' > /proc/vnet/policy
