libnl 3.11.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.
 
int rtnl_link_ip6vti_add (struct nl_sock *sk, const char *name)
 Create a new vti6 tunnel device.
 
int rtnl_link_ip6vti_set_link (struct rtnl_link *link, uint32_t index)
 Set IP6VTI tunnel interface index.
 
int rtnl_link_ip6vti_get_link (struct rtnl_link *link, uint32_t *index)
 Get IP6VTI tunnel interface index.
 
int rtnl_link_ip6vti_set_ikey (struct rtnl_link *link, uint32_t ikey)
 Set IP6VTI tunnel set ikey.
 
int rtnl_link_ip6vti_get_ikey (struct rtnl_link *link, uint32_t *ikey)
 Get IP6VTI tunnel ikey.
 
int rtnl_link_ip6vti_set_okey (struct rtnl_link *link, uint32_t okey)
 Set IP6VTI tunnel set okey.
 
int rtnl_link_ip6vti_get_okey (struct rtnl_link *link, uint32_t *okey)
 Get IP6VTI tunnel okey.
 
int rtnl_link_ip6vti_set_local (struct rtnl_link *link, struct in6_addr *local)
 Set IP6VTI tunnel local address.
 
int rtnl_link_ip6vti_get_local (struct rtnl_link *link, struct in6_addr *local)
 Get IP6VTI tunnel local address.
 
int rtnl_link_ip6vti_set_remote (struct rtnl_link *link, struct in6_addr *remote)
 Set IP6VTI tunnel remote address.
 
int rtnl_link_ip6vti_get_remote (struct rtnl_link *link, struct in6_addr *remote)
 Get IP6VTI tunnel remote address.
 
int rtnl_link_ip6vti_set_fwmark (struct rtnl_link *link, uint32_t fwmark)
 Set IP6VTI tunnel fwmark.
 
int rtnl_link_ip6vti_get_fwmark (struct rtnl_link *link, uint32_t *fwmark)
 Get IP6VTI tunnel fwmark.
 

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

◆ IP6VTI_ATTR_LINK

#define IP6VTI_ATTR_LINK   (1 << 0)

Definition at line 30 of file ip6vti.c.

◆ IP6VTI_ATTR_IKEY

#define IP6VTI_ATTR_IKEY   (1 << 1)

Definition at line 31 of file ip6vti.c.

◆ IP6VTI_ATTR_OKEY

#define IP6VTI_ATTR_OKEY   (1 << 2)

Definition at line 32 of file ip6vti.c.

◆ IP6VTI_ATTR_LOCAL

#define IP6VTI_ATTR_LOCAL   (1 << 3)

Definition at line 33 of file ip6vti.c.

◆ IP6VTI_ATTR_REMOTE

#define IP6VTI_ATTR_REMOTE   (1 << 4)

Definition at line 34 of file ip6vti.c.

◆ IP6VTI_ATTR_FWMARK

#define IP6VTI_ATTR_FWMARK   (1 << 5)

Definition at line 35 of file ip6vti.c.

◆ 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 253 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 259 of file ip6vti.c.

Function Documentation

◆ rtnl_link_ip6vti_alloc()

struct rtnl_link * rtnl_link_ip6vti_alloc ( void )

Definition at line 263 of file ip6vti.c.

◆ 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 287 of file ip6vti.c.

References rtnl_link_info_ops::io_name.

◆ 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 299 of file ip6vti.c.

References rtnl_link_add(), rtnl_link_put(), and rtnl_link_set_name().

+ Here is the call graph for this function:

◆ 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 323 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 342 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 362 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 381 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 401 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 420 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 440 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 459 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 479 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 498 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 518 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 537 of file ip6vti.c.

Variable Documentation

◆ link

uint32_t ip6vti_info::link

Definition at line 39 of file ip6vti.c.

◆ ikey

uint32_t ip6vti_info::ikey

Definition at line 40 of file ip6vti.c.

◆ okey

uint32_t ip6vti_info::okey

Definition at line 41 of file ip6vti.c.

◆ local

struct in6_addr ip6vti_info::local

Definition at line 42 of file ip6vti.c.

◆ remote

struct in6_addr ip6vti_info::remote

Definition at line 43 of file ip6vti.c.

◆ fwmark

uint32_t ip6vti_info::fwmark

Definition at line 44 of file ip6vti.c.

◆ ip6vti_mask

uint32_t ip6vti_info::ip6vti_mask

Definition at line 45 of file ip6vti.c.