libnl  3.5.0
veth.h
1 /*
2  * netlink/route/link/veth.h VETH interface
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation version 2.1
7  * of the License.
8  *
9  * Copyright (c) 2013 Cong Wang <xiyou.wangcong@gmail.com>
10  */
11 
12 #ifndef NETLINK_LINK_VETH_H_
13 #define NETLINK_LINK_VETH_H_
14 
15 #include <netlink/netlink.h>
16 #include <netlink/route/link.h>
17 #include <sys/types.h>
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 extern struct rtnl_link *rtnl_link_veth_alloc(void);
24 extern void rtnl_link_veth_release(struct rtnl_link *);
25 
26 extern int rtnl_link_is_veth(struct rtnl_link *);
27 
28 extern struct rtnl_link *rtnl_link_veth_get_peer(struct rtnl_link *);
29 extern int rtnl_link_veth_add(struct nl_sock *sock, const char *name,
30  const char *peer, pid_t pid);
31 
32 #ifdef __cplusplus
33 }
34 #endif
35 
36 #endif
int rtnl_link_veth_add(struct nl_sock *sock, const char *name, const char *peer, pid_t pid)
Create a new kernel veth device.
Definition: veth.c:275
int rtnl_link_is_veth(struct rtnl_link *)
Check if link is a veth link.
Definition: veth.c:256
struct rtnl_link * rtnl_link_veth_alloc(void)
Allocate link object of type veth.
Definition: veth.c:213
void rtnl_link_veth_release(struct rtnl_link *)
Release a veth link and its peer.
Definition: veth.c:244
struct rtnl_link * rtnl_link_veth_get_peer(struct rtnl_link *)
Get the peer link of a veth link.
Definition: veth.c:233