diff options
| author | Feng Lu <lu.feng@6wind.com> | 2014-07-03 18:24:34 +0800 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-09-09 12:15:14 -0400 |
| commit | 13460c44a22415dd55846aca6fc31cf8607c90e9 (patch) | |
| tree | ccd21cfc7fbd813e01607cf959ee19ac865b93a1 /lib/command.h | |
| parent | 32bcb8b0a54e1468e8fe9e303ba78a71ce05cf3d (diff) | |
lib, vtysh: support multiple VRFs by using linux netns
We realize VRFs with linux netns by default. The main job is
to associate a VRF with a netns. Currently this is done by
the configuration:
[no] vrf N netns <netns-name>
This command is also available in vtysh and goes to only
zebra, because presently only zebra supports multiple VRF.
A file descriptor is added to "struct vrf". This is for the
associated netns file. Once the command "vrf N netns NAME"
is executed, the specified file is opened and the file
descriptor is stored in the VRF N. In this way the
association is formed.
In vrf_socket(), we first switch to the specified VRF by
using the stored file descriptor, and then can allocate
a socket which is working in the associated netns.
Signed-off-by: Feng Lu <lu.feng@6wind.com>
Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
(cherry picked from commit 55cfa2f190620f7c711944637659bc208970324d)
Diffstat (limited to 'lib/command.h')
| -rw-r--r-- | lib/command.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/command.h b/lib/command.h index 8f20a92807..0415834b09 100644 --- a/lib/command.h +++ b/lib/command.h @@ -74,6 +74,7 @@ enum node_type AAA_NODE, /* AAA node. */ KEYCHAIN_NODE, /* Key-chain node. */ KEYCHAIN_KEY_NODE, /* Key-chain key node. */ + NS_NODE, /* Logical-Router node. */ VRF_NODE, /* VRF mode node. */ INTERFACE_NODE, /* Interface mode node. */ ZEBRA_NODE, /* zebra connection node. */ |
