libnl 3.7.0

ip6tnl link module More...

Data Structures

struct  ip6_tnl_info
 

Macros

#define IP6_TNL_ATTR_LINK   (1 << 0)
 
#define IP6_TNL_ATTR_LOCAL   (1 << 1)
 
#define IP6_TNL_ATTR_REMOTE   (1 << 2)
 
#define IP6_TNL_ATTR_TTL   (1 << 3)
 
#define IP6_TNL_ATTR_TOS   (1 << 4)
 
#define IP6_TNL_ATTR_ENCAPLIMIT   (1 << 5)
 
#define IP6_TNL_ATTR_FLAGS   (1 << 6)
 
#define IP6_TNL_ATTR_PROTO   (1 << 7)
 
#define IP6_TNL_ATTR_FLOWINFO   (1 << 8)
 
#define IP6_TNL_ATTR_FWMARK   (1 << 9)
 
#define IS_IP6_TNL_LINK_ASSERT(link)
 

Functions

struct rtnl_linkrtnl_link_ip6_tnl_alloc (void)
 
int rtnl_link_is_ip6_tnl (struct rtnl_link *link)
 Check if link is a IP6_TNL link. More...
 
int rtnl_link_ip6_tnl_add (struct nl_sock *sk, const char *name)
 Create a new ip6_tnl tunnel device. More...
 
int rtnl_link_ip6_tnl_set_link (struct rtnl_link *link, uint32_t index)
 Set IP6_TNL tunnel interface index. More...
 
uint32_t rtnl_link_ip6_tnl_get_link (struct rtnl_link *link)
 Get IP6_TNL tunnel interface index. More...
 
int rtnl_link_ip6_tnl_set_local (struct rtnl_link *link, struct in6_addr *addr)
 Set IP6_TNL tunnel local address. More...
 
int rtnl_link_ip6_tnl_get_local (struct rtnl_link *link, struct in6_addr *addr)
 Get IP6_TNL tunnel local address. More...
 
int rtnl_link_ip6_tnl_set_remote (struct rtnl_link *link, struct in6_addr *addr)
 Set IP6_TNL tunnel remote address. More...
 
int rtnl_link_ip6_tnl_get_remote (struct rtnl_link *link, struct in6_addr *addr)
 Get IP6_TNL tunnel remote address. More...
 
int rtnl_link_ip6_tnl_set_ttl (struct rtnl_link *link, uint8_t ttl)
 Set IP6_TNL tunnel ttl. More...
 
uint8_t rtnl_link_ip6_tnl_get_ttl (struct rtnl_link *link)
 Get IP6_TNL tunnel ttl. More...
 
int rtnl_link_ip6_tnl_set_tos (struct rtnl_link *link, uint8_t tos)
 Set IP6_TNL tunnel tos. More...
 
uint8_t rtnl_link_ip6_tnl_get_tos (struct rtnl_link *link)
 Get IP6_TNL tunnel tos. More...
 
int rtnl_link_ip6_tnl_set_encaplimit (struct rtnl_link *link, uint8_t encap_limit)
 Set IP6_TNL tunnel encap limit. More...
 
uint8_t rtnl_link_ip6_tnl_get_encaplimit (struct rtnl_link *link)
 Get IP6_TNL encaplimit. More...
 
int rtnl_link_ip6_tnl_set_flowinfo (struct rtnl_link *link, uint32_t flowinfo)
 Set IP6_TNL tunnel flowinfo. More...
 
uint32_t rtnl_link_ip6_tnl_get_flowinfo (struct rtnl_link *link)
 Get IP6_TNL flowinfo. More...
 
int rtnl_link_ip6_tnl_set_flags (struct rtnl_link *link, uint32_t flags)
 Set IP6_TNL tunnel flags. More...
 
uint32_t rtnl_link_ip6_tnl_get_flags (struct rtnl_link *link)
 Get IP6_TNL path flags. More...
 
int rtnl_link_ip6_tnl_set_proto (struct rtnl_link *link, uint8_t proto)
 Set IP6_TNL tunnel proto. More...
 
uint8_t rtnl_link_ip6_tnl_get_proto (struct rtnl_link *link)
 Get IP6_TNL proto. More...
 
int rtnl_link_ip6_tnl_set_fwmark (struct rtnl_link *link, uint32_t fwmark)
 Set IP6_TNL tunnel fwmark. More...
 
int rtnl_link_ip6_tnl_get_fwmark (struct rtnl_link *link, uint32_t *fwmark)
 Get IP6_TNL tunnel fwmark. More...
 

Variables

uint8_t ip6_tnl_info::ttl
 
uint8_t ip6_tnl_info::tos
 
uint8_t ip6_tnl_info::encap_limit
 
uint8_t ip6_tnl_info::proto
 
uint32_t ip6_tnl_info::flags
 
uint32_t ip6_tnl_info::link
 
uint32_t ip6_tnl_info::flowinfo
 
struct in6_addr ip6_tnl_info::local
 
struct in6_addr ip6_tnl_info::remote
 
uint32_t ip6_tnl_info::fwmark
 
uint32_t ip6_tnl_info::ip6_tnl_mask
 

Detailed Description

ip6tnl link module

Link Type Name: "ip6tnl"

IP6TNL Documentation (Netlink Routing Development Guide)

Macro Definition Documentation

◆ IP6_TNL_ATTR_LINK

#define IP6_TNL_ATTR_LINK   (1 << 0)

Definition at line 30 of file ip6tnl.c.

◆ IP6_TNL_ATTR_LOCAL

#define IP6_TNL_ATTR_LOCAL   (1 << 1)

Definition at line 31 of file ip6tnl.c.

◆ IP6_TNL_ATTR_REMOTE

#define IP6_TNL_ATTR_REMOTE   (1 << 2)

Definition at line 32 of file ip6tnl.c.

◆ IP6_TNL_ATTR_TTL

#define IP6_TNL_ATTR_TTL   (1 << 3)

Definition at line 33 of file ip6tnl.c.

◆ IP6_TNL_ATTR_TOS

#define IP6_TNL_ATTR_TOS   (1 << 4)

Definition at line 34 of file ip6tnl.c.

◆ IP6_TNL_ATTR_ENCAPLIMIT

#define IP6_TNL_ATTR_ENCAPLIMIT   (1 << 5)

Definition at line 35 of file ip6tnl.c.

◆ IP6_TNL_ATTR_FLAGS

#define IP6_TNL_ATTR_FLAGS   (1 << 6)

Definition at line 36 of file ip6tnl.c.

◆ IP6_TNL_ATTR_PROTO

#define IP6_TNL_ATTR_PROTO   (1 << 7)

Definition at line 37 of file ip6tnl.c.

◆ IP6_TNL_ATTR_FLOWINFO

#define IP6_TNL_ATTR_FLOWINFO   (1 << 8)

Definition at line 38 of file ip6tnl.c.

◆ IP6_TNL_ATTR_FWMARK

#define IP6_TNL_ATTR_FWMARK   (1 << 9)

Definition at line 39 of file ip6tnl.c.

◆ IS_IP6_TNL_LINK_ASSERT

#define IS_IP6_TNL_LINK_ASSERT (   link)
Value:
if ((link)->l_info_ops != &ip6_tnl_info_ops) {\
APPBUG("Link is not a ip6_tnl link. set type \"ip6tnl\" first.");\
return -NLE_OPNOTSUPP;\
}

Definition at line 324 of file ip6tnl.c.

Function Documentation

◆ rtnl_link_ip6_tnl_alloc()

struct rtnl_link * rtnl_link_ip6_tnl_alloc ( void  )

Definition at line 330 of file ip6tnl.c.

◆ rtnl_link_is_ip6_tnl()

int rtnl_link_is_ip6_tnl ( struct rtnl_link link)

Check if link is a IP6_TNL link.

Parameters
linkLink object
Returns
True if link is a IP6_TNL link, otherwise false is returned.

Definition at line 354 of file ip6tnl.c.

◆ rtnl_link_ip6_tnl_add()

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

Create a new ip6_tnl tunnel device.

Parameters
socknetlink socket
namename of the tunnel device

Creates a new ip6_tnl tunnel device in the kernel

Returns
0 on success or a negative error code

Definition at line 367 of file ip6tnl.c.

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

+ Here is the call graph for this function:

◆ rtnl_link_ip6_tnl_set_link()

int rtnl_link_ip6_tnl_set_link ( struct rtnl_link link,
uint32_t  index 
)

Set IP6_TNL tunnel interface index.

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

Definition at line 392 of file ip6tnl.c.

◆ rtnl_link_ip6_tnl_get_link()

uint32_t rtnl_link_ip6_tnl_get_link ( struct rtnl_link link)

Get IP6_TNL tunnel interface index.

Parameters
linkLink object
Returns
interface index value

Definition at line 410 of file ip6tnl.c.

◆ rtnl_link_ip6_tnl_set_local()

int rtnl_link_ip6_tnl_set_local ( struct rtnl_link link,
struct in6_addr *  addr 
)

Set IP6_TNL tunnel local address.

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

Definition at line 426 of file ip6tnl.c.

◆ rtnl_link_ip6_tnl_get_local()

int rtnl_link_ip6_tnl_get_local ( struct rtnl_link link,
struct in6_addr *  addr 
)

Get IP6_TNL tunnel local address.

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

Definition at line 444 of file ip6tnl.c.

◆ rtnl_link_ip6_tnl_set_remote()

int rtnl_link_ip6_tnl_set_remote ( struct rtnl_link link,
struct in6_addr *  addr 
)

Set IP6_TNL tunnel remote address.

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

Definition at line 462 of file ip6tnl.c.

◆ rtnl_link_ip6_tnl_get_remote()

int rtnl_link_ip6_tnl_get_remote ( struct rtnl_link link,
struct in6_addr *  addr 
)

Get IP6_TNL tunnel remote address.

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

Definition at line 480 of file ip6tnl.c.

◆ rtnl_link_ip6_tnl_set_ttl()

int rtnl_link_ip6_tnl_set_ttl ( struct rtnl_link link,
uint8_t  ttl 
)

Set IP6_TNL tunnel ttl.

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

Definition at line 498 of file ip6tnl.c.

◆ rtnl_link_ip6_tnl_get_ttl()

uint8_t rtnl_link_ip6_tnl_get_ttl ( struct rtnl_link link)

Get IP6_TNL tunnel ttl.

Parameters
linkLink object
Returns
ttl value

Definition at line 516 of file ip6tnl.c.

◆ rtnl_link_ip6_tnl_set_tos()

int rtnl_link_ip6_tnl_set_tos ( struct rtnl_link link,
uint8_t  tos 
)

Set IP6_TNL tunnel tos.

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

Definition at line 532 of file ip6tnl.c.

◆ rtnl_link_ip6_tnl_get_tos()

uint8_t rtnl_link_ip6_tnl_get_tos ( struct rtnl_link link)

Get IP6_TNL tunnel tos.

Parameters
linkLink object
Returns
tos value

Definition at line 550 of file ip6tnl.c.

◆ rtnl_link_ip6_tnl_set_encaplimit()

int rtnl_link_ip6_tnl_set_encaplimit ( struct rtnl_link link,
uint8_t  encap_limit 
)

Set IP6_TNL tunnel encap limit.

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

Definition at line 566 of file ip6tnl.c.

◆ rtnl_link_ip6_tnl_get_encaplimit()

uint8_t rtnl_link_ip6_tnl_get_encaplimit ( struct rtnl_link link)

Get IP6_TNL encaplimit.

Parameters
linkLink object
Returns
encaplimit value

Definition at line 584 of file ip6tnl.c.

◆ rtnl_link_ip6_tnl_set_flowinfo()

int rtnl_link_ip6_tnl_set_flowinfo ( struct rtnl_link link,
uint32_t  flowinfo 
)

Set IP6_TNL tunnel flowinfo.

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

Definition at line 600 of file ip6tnl.c.

◆ rtnl_link_ip6_tnl_get_flowinfo()

uint32_t rtnl_link_ip6_tnl_get_flowinfo ( struct rtnl_link link)

Get IP6_TNL flowinfo.

Parameters
linkLink object
Returns
flowinfo value

Definition at line 618 of file ip6tnl.c.

◆ rtnl_link_ip6_tnl_set_flags()

int rtnl_link_ip6_tnl_set_flags ( struct rtnl_link link,
uint32_t  flags 
)

Set IP6_TNL tunnel flags.

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

Definition at line 634 of file ip6tnl.c.

◆ rtnl_link_ip6_tnl_get_flags()

uint32_t rtnl_link_ip6_tnl_get_flags ( struct rtnl_link link)

Get IP6_TNL path flags.

Parameters
linkLink object
Returns
flags value

Definition at line 652 of file ip6tnl.c.

◆ rtnl_link_ip6_tnl_set_proto()

int rtnl_link_ip6_tnl_set_proto ( struct rtnl_link link,
uint8_t  proto 
)

Set IP6_TNL tunnel proto.

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

Definition at line 668 of file ip6tnl.c.

◆ rtnl_link_ip6_tnl_get_proto()

uint8_t rtnl_link_ip6_tnl_get_proto ( struct rtnl_link link)

Get IP6_TNL proto.

Parameters
linkLink object
Returns
proto value

Definition at line 686 of file ip6tnl.c.

◆ rtnl_link_ip6_tnl_set_fwmark()

int rtnl_link_ip6_tnl_set_fwmark ( struct rtnl_link link,
uint32_t  fwmark 
)

Set IP6_TNL tunnel fwmark.

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

Definition at line 702 of file ip6tnl.c.

◆ rtnl_link_ip6_tnl_get_fwmark()

int rtnl_link_ip6_tnl_get_fwmark ( struct rtnl_link link,
uint32_t *  fwmark 
)

Get IP6_TNL tunnel fwmark.

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

Definition at line 721 of file ip6tnl.c.

Variable Documentation

◆ ttl

uint8_t ip6_tnl_info::ttl

Definition at line 43 of file ip6tnl.c.

◆ tos

uint8_t ip6_tnl_info::tos

Definition at line 44 of file ip6tnl.c.

◆ encap_limit

uint8_t ip6_tnl_info::encap_limit

Definition at line 45 of file ip6tnl.c.

◆ proto

uint8_t ip6_tnl_info::proto

Definition at line 46 of file ip6tnl.c.

◆ flags

uint32_t ip6_tnl_info::flags

Definition at line 47 of file ip6tnl.c.

◆ link

uint32_t ip6_tnl_info::link

Definition at line 48 of file ip6tnl.c.

◆ flowinfo

uint32_t ip6_tnl_info::flowinfo

Definition at line 49 of file ip6tnl.c.

◆ local

struct in6_addr ip6_tnl_info::local

Definition at line 50 of file ip6tnl.c.

◆ remote

struct in6_addr ip6_tnl_info::remote

Definition at line 51 of file ip6tnl.c.

◆ fwmark

uint32_t ip6_tnl_info::fwmark

Definition at line 52 of file ip6tnl.c.

◆ ip6_tnl_mask

uint32_t ip6_tnl_info::ip6_tnl_mask

Definition at line 53 of file ip6tnl.c.