libnl  3.6.0

ip6vti link module More...

Data Structures

struct  ip6vti_info
 

Macros

#define IP6VTI_ATTR_LINK   (1 << 0)
 
#define IP6VTI_ATTR_IKEY   (1 << 1)
 
#define IP6VTI_ATTR_OKEY   (1 << 2)
 
#define IP6VTI_ATTR_LOCAL   (1 << 3)
 
#define IP6VTI_ATTR_REMOTE   (1 << 4)
 
#define IP6VTI_ATTR_FWMARK   (1 << 5)
 
#define IS_IP6VTI_LINK_ASSERT(link)
 
#define HAS_IP6VTI_ATTR_ASSERT(ip6vti, attr)
 

Functions

struct rtnl_linkrtnl_link_ip6vti_alloc (void)
 
int rtnl_link_is_ip6vti (struct rtnl_link *link)
 Check if link is a IP6VTI link. More...
 
int rtnl_link_ip6vti_add (struct nl_sock *sk, const char *name)
 Create a new vti6 tunnel device. More...
 
int rtnl_link_ip6vti_set_link (struct rtnl_link *link, uint32_t index)
 Set IP6VTI tunnel interface index. More...
 
int rtnl_link_ip6vti_get_link (struct rtnl_link *link, uint32_t *index)
 Get IP6VTI tunnel interface index. More...
 
int rtnl_link_ip6vti_set_ikey (struct rtnl_link *link, uint32_t ikey)
 Set IP6VTI tunnel set ikey. More...
 
int rtnl_link_ip6vti_get_ikey (struct rtnl_link *link, uint32_t *ikey)
 Get IP6VTI tunnel ikey. More...
 
int rtnl_link_ip6vti_set_okey (struct rtnl_link *link, uint32_t okey)
 Set IP6VTI tunnel set okey. More...
 
int rtnl_link_ip6vti_get_okey (struct rtnl_link *link, uint32_t *okey)
 Get IP6VTI tunnel okey. More...
 
int rtnl_link_ip6vti_set_local (struct rtnl_link *link, struct in6_addr *local)
 Set IP6VTI tunnel local address. More...
 
int rtnl_link_ip6vti_get_local (struct rtnl_link *link, struct in6_addr *local)
 Get IP6VTI tunnel local address. More...
 
int rtnl_link_ip6vti_set_remote (struct rtnl_link *link, struct in6_addr *remote)
 Set IP6VTI tunnel remote address. More...
 
int rtnl_link_ip6vti_get_remote (struct rtnl_link *link, struct in6_addr *remote)
 Get IP6VTI tunnel remote address. More...
 
int rtnl_link_ip6vti_set_fwmark (struct rtnl_link *link, uint32_t fwmark)
 Set IP6VTI tunnel fwmark. More...
 
int rtnl_link_ip6vti_get_fwmark (struct rtnl_link *link, uint32_t *fwmark)
 Get IP6VTI tunnel fwmark. More...
 

Variables

uint32_t ip6vti_info::link
 
uint32_t ip6vti_info::ikey
 
uint32_t ip6vti_info::okey
 
struct in6_addr ip6vti_info::local
 
struct in6_addr ip6vti_info::remote
 
uint32_t ip6vti_info::fwmark
 
uint32_t ip6vti_info::ip6vti_mask
 

Detailed Description

ip6vti link module

Link Type Name: "vti6"

IP6VTI Documentation (Netlink Routing Development Guide)

Macro Definition Documentation

◆ IS_IP6VTI_LINK_ASSERT

#define IS_IP6VTI_LINK_ASSERT (   link)
Value:
if ((link)->l_info_ops != &ip6vti_info_ops) { \
APPBUG("Link is not a ip6vti link. set type \"vti6\" first."); \
return -NLE_OPNOTSUPP; \
}

Definition at line 252 of file ip6vti.c.

◆ HAS_IP6VTI_ATTR_ASSERT

#define HAS_IP6VTI_ATTR_ASSERT (   ip6vti,
  attr 
)
Value:
if (!((ip6vti)->ip6vti_mask & (attr))) \
return -NLE_NOATTR;

Definition at line 258 of file ip6vti.c.

Function Documentation

◆ rtnl_link_is_ip6vti()

int rtnl_link_is_ip6vti ( struct rtnl_link link)

Check if link is a IP6VTI link.

Parameters
linkLink object
Returns
True if link is a IP6VTI link, otherwise 0 is returned.

Definition at line 286 of file ip6vti.c.

◆ rtnl_link_ip6vti_add()

int rtnl_link_ip6vti_add ( struct nl_sock *  sk,
const char *  name 
)

Create a new vti6 tunnel device.

Parameters
socknetlink socket
namename of the tunnel deviceL

Creates a new vti6 tunnel device in the kernel

Returns
0 on success or a negative error code

Definition at line 298 of file ip6vti.c.

◆ rtnl_link_ip6vti_set_link()

int rtnl_link_ip6vti_set_link ( struct rtnl_link link,
uint32_t  index 
)

Set IP6VTI tunnel interface index.

Parameters
linkLink object
indexinterface index
Returns
0 on success or a negative error code

Definition at line 322 of file ip6vti.c.

◆ rtnl_link_ip6vti_get_link()

int rtnl_link_ip6vti_get_link ( struct rtnl_link link,
uint32_t *  index 
)

Get IP6VTI tunnel interface index.

Parameters
linkLink object
indexaddr to fill in with the interface index
Returns
0 on success or a negative error code

Definition at line 341 of file ip6vti.c.

◆ rtnl_link_ip6vti_set_ikey()

int rtnl_link_ip6vti_set_ikey ( struct rtnl_link link,
uint32_t  ikey 
)

Set IP6VTI tunnel set ikey.

Parameters
linkLink object
ikeygre ikey
Returns
0 on success or a negative error code

Definition at line 361 of file ip6vti.c.

◆ rtnl_link_ip6vti_get_ikey()

int rtnl_link_ip6vti_get_ikey ( struct rtnl_link link,
uint32_t *  ikey 
)

Get IP6VTI tunnel ikey.

Parameters
linkLink object
ikeyaddr to fill in with the ikey
Returns
0 on success or a negative error code

Definition at line 380 of file ip6vti.c.

◆ rtnl_link_ip6vti_set_okey()

int rtnl_link_ip6vti_set_okey ( struct rtnl_link link,
uint32_t  okey 
)

Set IP6VTI tunnel set okey.

Parameters
linkLink object
okeygre okey
Returns
0 on success or a negative error code

Definition at line 400 of file ip6vti.c.

◆ rtnl_link_ip6vti_get_okey()

int rtnl_link_ip6vti_get_okey ( struct rtnl_link link,
uint32_t *  okey 
)

Get IP6VTI tunnel okey.

Parameters
linkLink object
okeyaddr to fill in with the okey
Returns
0 on success or a negative error code

Definition at line 419 of file ip6vti.c.

◆ rtnl_link_ip6vti_set_local()

int rtnl_link_ip6vti_set_local ( struct rtnl_link link,
struct in6_addr *  local 
)

Set IP6VTI tunnel local address.

Parameters
linkLink object
locallocal address
Returns
0 on success or a negative error code

Definition at line 439 of file ip6vti.c.

◆ rtnl_link_ip6vti_get_local()

int rtnl_link_ip6vti_get_local ( struct rtnl_link link,
struct in6_addr *  local 
)

Get IP6VTI tunnel local address.

Parameters
linkLink object
localaddr to fill in with remote address
Returns
0 on success or a negative error code

Definition at line 458 of file ip6vti.c.

◆ rtnl_link_ip6vti_set_remote()

int rtnl_link_ip6vti_set_remote ( struct rtnl_link link,
struct in6_addr *  remote 
)

Set IP6VTI tunnel remote address.

Parameters
linkLink object
remoteremote address
Returns
0 on success or a negative error code

Definition at line 478 of file ip6vti.c.

◆ rtnl_link_ip6vti_get_remote()

int rtnl_link_ip6vti_get_remote ( struct rtnl_link link,
struct in6_addr *  remote 
)

Get IP6VTI tunnel remote address.

Parameters
linkLink object
remoteaddr to fill in with remote address
Returns
0 on success or a negative error code

Definition at line 497 of file ip6vti.c.

◆ rtnl_link_ip6vti_set_fwmark()

int rtnl_link_ip6vti_set_fwmark ( struct rtnl_link link,
uint32_t  fwmark 
)

Set IP6VTI tunnel fwmark.

Parameters
linkLink object
fwmarkfwmark
Returns
0 on success or a negative error code

Definition at line 517 of file ip6vti.c.

◆ rtnl_link_ip6vti_get_fwmark()

int rtnl_link_ip6vti_get_fwmark ( struct rtnl_link link,
uint32_t *  fwmark 
)

Get IP6VTI tunnel fwmark.

Parameters
linkLink object
fwmarkaddr to fill in with the fwmark
Returns
0 on success or a negative error code

Definition at line 536 of file ip6vti.c.