libnl 3.7.0
|
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)
struct rtnl_link * rtnl_link_veth_alloc | ( | void | ) |
Allocate link object of type veth.
Definition at line 207 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 226 of file veth.c.
References nl_object_get().
void rtnl_link_veth_release | ( | struct rtnl_link * | link | ) |
Release a veth link and its peer.
Definition at line 237 of file veth.c.
References rtnl_link_put().
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 268 of file veth.c.
References rtnl_link_add(), rtnl_link_put(), rtnl_link_set_name(), and rtnl_link_veth_alloc().