libnl
3.2.24-rc1
|
Virtual Ethernet. More...
VETH Object | |
struct rtnl_link * | rtnl_link_veth_alloc (void) |
Allocate link object of type veth. More... | |
struct rtnl_link * | rtnl_link_veth_get_peer (struct rtnl_link *link) |
Get the peer link of a veth link. More... | |
void | rtnl_link_veth_release (struct rtnl_link *link) |
Release a veth link and its peer. More... | |
int | rtnl_link_is_veth (struct rtnl_link *link) |
Check if link is a veth link. More... | |
int | rtnl_link_veth_add (struct nl_sock *sock, const char *name, const char *peer_name, pid_t pid) |
Create a new kernel veth device. More... | |
Virtual Ethernet.
Link Type Name: "veth"
VETH Documentation (Netlink Routing Development Guide)
|
read |
Allocate link object of type veth.
Definition at line 173 of file veth.c.
References rtnl_link_alloc(), rtnl_link_put(), and rtnl_link_set_type().
Referenced by rtnl_link_veth_add().
Get the peer link of a veth link.
Definition at line 206 of file veth.c.
Referenced by rtnl_link_veth_add(), and rtnl_link_veth_release().
void rtnl_link_veth_release | ( | struct rtnl_link * | link | ) |
Release a veth link and its peer.
Definition at line 216 of file veth.c.
References rtnl_link_put(), and rtnl_link_veth_get_peer().
int rtnl_link_is_veth | ( | struct rtnl_link * | link | ) |
int rtnl_link_veth_add | ( | struct nl_sock * | sock, |
const char * | name, | ||
const char * | peer_name, | ||
pid_t | pid | ||
) |
Create a new kernel veth device.
sock | netlink socket |
name | name of the veth device or NULL |
peer_name | name of its peer or NULL |
pid | pid of the process in the new netns |
Creates a new veth device pair in the kernel and move the peer to the network namespace where the process is. If no name is provided, the kernel will automatically pick a name of the form "veth%d" (e.g. veth0, veth1, etc.)
Definition at line 248 of file veth.c.
References rtnl_link_add(), rtnl_link_put(), rtnl_link_set_name(), rtnl_link_veth_alloc(), and rtnl_link_veth_get_peer().