libnl 3.7.0

ip6gre link module More...

Data Structures

struct  ip6gre_info
 

Macros

#define IP6GRE_ATTR_LINK   (1 << 0)
 
#define IP6GRE_ATTR_IFLAGS   (1 << 1)
 
#define IP6GRE_ATTR_OFLAGS   (1 << 2)
 
#define IP6GRE_ATTR_IKEY   (1 << 3)
 
#define IP6GRE_ATTR_OKEY   (1 << 4)
 
#define IP6GRE_ATTR_LOCAL   (1 << 5)
 
#define IP6GRE_ATTR_REMOTE   (1 << 6)
 
#define IP6GRE_ATTR_TTL   (1 << 7)
 
#define IP6GRE_ATTR_ENCAPLIMIT   (1 << 8)
 
#define IP6GRE_ATTR_FLOWINFO   (1 << 9)
 
#define IP6GRE_ATTR_FLAGS   (1 << 10)
 
#define IP6GRE_ATTR_FWMARK   (1 << 11)
 
#define IS_IP6GRE_LINK_ASSERT(link)
 
#define HAS_IP6GRE_ATTR_ASSERT(link, attr)
 

Functions

struct rtnl_linkrtnl_link_ip6gre_alloc (void)
 
int rtnl_link_is_ip6gre (struct rtnl_link *link)
 Check if link is a IP6GRE link. More...
 
int rtnl_link_ip6gre_add (struct nl_sock *sk, const char *name)
 Create a new IP6GRE tunnel device. More...
 
int rtnl_link_ip6gre_set_link (struct rtnl_link *link, uint32_t index)
 Set IP6GRE tunnel interface index. More...
 
int rtnl_link_ip6gre_get_link (struct rtnl_link *link, uint32_t *index)
 Get IP6GRE tunnel interface index. More...
 
int rtnl_link_ip6gre_set_iflags (struct rtnl_link *link, uint16_t iflags)
 Set IP6GRE tunnel set iflags. More...
 
int rtnl_link_ip6gre_get_iflags (struct rtnl_link *link, uint16_t *iflags)
 Get IP6GRE tunnel iflags. More...
 
int rtnl_link_ip6gre_set_oflags (struct rtnl_link *link, uint16_t oflags)
 Set IP6GRE tunnel set oflags. More...
 
int rtnl_link_ip6gre_get_oflags (struct rtnl_link *link, uint16_t *oflags)
 Get IP6GRE tunnel oflags. More...
 
int rtnl_link_ip6gre_set_ikey (struct rtnl_link *link, uint32_t ikey)
 Set IP6GRE tunnel set ikey. More...
 
int rtnl_link_ip6gre_get_ikey (struct rtnl_link *link, uint32_t *ikey)
 Get IP6GRE tunnel ikey. More...
 
int rtnl_link_ip6gre_set_okey (struct rtnl_link *link, uint32_t okey)
 Set IP6GRE tunnel set okey. More...
 
int rtnl_link_ip6gre_get_okey (struct rtnl_link *link, uint32_t *okey)
 Get IP6GRE tunnel okey. More...
 
int rtnl_link_ip6gre_set_local (struct rtnl_link *link, struct in6_addr *local)
 Set IP6GRE tunnel local address. More...
 
int rtnl_link_ip6gre_get_local (struct rtnl_link *link, struct in6_addr *local)
 Get IP6GRE tunnel local address. More...
 
int rtnl_link_ip6gre_set_remote (struct rtnl_link *link, struct in6_addr *remote)
 Set IP6GRE tunnel remote address. More...
 
int rtnl_link_ip6gre_get_remote (struct rtnl_link *link, struct in6_addr *remote)
 Get IP6GRE tunnel remote address. More...
 
int rtnl_link_ip6gre_set_ttl (struct rtnl_link *link, uint8_t ttl)
 Set IP6GRE tunnel ttl. More...
 
int rtnl_link_ip6gre_get_ttl (struct rtnl_link *link, uint8_t *ttl)
 Set IP6GRE tunnel ttl. More...
 
int rtnl_link_ip6gre_set_encaplimit (struct rtnl_link *link, uint8_t encaplimit)
 Set IP6GRE tunnel encap limit. More...
 
int rtnl_link_ip6gre_get_encaplimit (struct rtnl_link *link, uint8_t *encaplimit)
 Get IP6GRE tunnel encap limit. More...
 
int rtnl_link_ip6gre_set_flowinfo (struct rtnl_link *link, uint32_t flowinfo)
 Set IP6GRE tunnel flowinfo. More...
 
int rtnl_link_ip6gre_get_flowinfo (struct rtnl_link *link, uint32_t *flowinfo)
 Get IP6GRE flowinfo. More...
 
int rtnl_link_ip6gre_set_flags (struct rtnl_link *link, uint32_t flags)
 Set IP6GRE tunnel flags. More...
 
int rtnl_link_ip6gre_get_flags (struct rtnl_link *link, uint32_t *flags)
 Get IP6GRE flags. More...
 
int rtnl_link_ip6gre_set_fwmark (struct rtnl_link *link, uint32_t fwmark)
 Set IP6GRE tunnel fwmark. More...
 
int rtnl_link_ip6gre_get_fwmark (struct rtnl_link *link, uint32_t *fwmark)
 Get IP6GRE tunnel fwmark. More...
 

Variables

uint8_t ip6gre_info::ttl
 
uint8_t ip6gre_info::encaplimit
 
uint16_t ip6gre_info::iflags
 
uint16_t ip6gre_info::oflags
 
uint32_t ip6gre_info::ikey
 
uint32_t ip6gre_info::okey
 
uint32_t ip6gre_info::link
 
uint32_t ip6gre_info::flowinfo
 
uint32_t ip6gre_info::flags
 
struct in6_addr ip6gre_info::local
 
struct in6_addr ip6gre_info::remote
 
uint32_t ip6gre_info::fwmark
 
uint32_t ip6gre_info::ip6gre_mask
 

Detailed Description

ip6gre link module

Link Type Name: "ip6gre"

IP6GRE Documentation (Netlink Routing Development Guide)

Macro Definition Documentation

◆ IP6GRE_ATTR_LINK

#define IP6GRE_ATTR_LINK   (1 << 0)

Definition at line 26 of file ip6gre.c.

◆ IP6GRE_ATTR_IFLAGS

#define IP6GRE_ATTR_IFLAGS   (1 << 1)

Definition at line 27 of file ip6gre.c.

◆ IP6GRE_ATTR_OFLAGS

#define IP6GRE_ATTR_OFLAGS   (1 << 2)

Definition at line 28 of file ip6gre.c.

◆ IP6GRE_ATTR_IKEY

#define IP6GRE_ATTR_IKEY   (1 << 3)

Definition at line 29 of file ip6gre.c.

◆ IP6GRE_ATTR_OKEY

#define IP6GRE_ATTR_OKEY   (1 << 4)

Definition at line 30 of file ip6gre.c.

◆ IP6GRE_ATTR_LOCAL

#define IP6GRE_ATTR_LOCAL   (1 << 5)

Definition at line 31 of file ip6gre.c.

◆ IP6GRE_ATTR_REMOTE

#define IP6GRE_ATTR_REMOTE   (1 << 6)

Definition at line 32 of file ip6gre.c.

◆ IP6GRE_ATTR_TTL

#define IP6GRE_ATTR_TTL   (1 << 7)

Definition at line 33 of file ip6gre.c.

◆ IP6GRE_ATTR_ENCAPLIMIT

#define IP6GRE_ATTR_ENCAPLIMIT   (1 << 8)

Definition at line 34 of file ip6gre.c.

◆ IP6GRE_ATTR_FLOWINFO

#define IP6GRE_ATTR_FLOWINFO   (1 << 9)

Definition at line 35 of file ip6gre.c.

◆ IP6GRE_ATTR_FLAGS

#define IP6GRE_ATTR_FLAGS   (1 << 10)

Definition at line 36 of file ip6gre.c.

◆ IP6GRE_ATTR_FWMARK

#define IP6GRE_ATTR_FWMARK   (1 << 11)

Definition at line 37 of file ip6gre.c.

◆ IS_IP6GRE_LINK_ASSERT

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

Definition at line 345 of file ip6gre.c.

◆ HAS_IP6GRE_ATTR_ASSERT

#define HAS_IP6GRE_ATTR_ASSERT (   link,
  attr 
)
Value:
if (!((link)->ip6gre_mask & (attr))) \
return -NLE_NOATTR;

Definition at line 351 of file ip6gre.c.

Function Documentation

◆ rtnl_link_ip6gre_alloc()

struct rtnl_link * rtnl_link_ip6gre_alloc ( void  )

Definition at line 355 of file ip6gre.c.

◆ rtnl_link_is_ip6gre()

int rtnl_link_is_ip6gre ( struct rtnl_link link)

Check if link is a IP6GRE link.

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

Definition at line 379 of file ip6gre.c.

◆ rtnl_link_ip6gre_add()

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

Create a new IP6GRE tunnel device.

Parameters
socknetlink socket
namename of the tunnel deviceL

Creates a new ip6gre tunnel device in the kernel

Returns
0 on success or a negative error code

Definition at line 392 of file ip6gre.c.

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

+ Here is the call graph for this function:

◆ rtnl_link_ip6gre_set_link()

int rtnl_link_ip6gre_set_link ( struct rtnl_link link,
uint32_t  index 
)

Set IP6GRE tunnel interface index.

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

Definition at line 417 of file ip6gre.c.

◆ rtnl_link_ip6gre_get_link()

int rtnl_link_ip6gre_get_link ( struct rtnl_link link,
uint32_t *  index 
)

Get IP6GRE 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 436 of file ip6gre.c.

◆ rtnl_link_ip6gre_set_iflags()

int rtnl_link_ip6gre_set_iflags ( struct rtnl_link link,
uint16_t  iflags 
)

Set IP6GRE tunnel set iflags.

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

Definition at line 456 of file ip6gre.c.

◆ rtnl_link_ip6gre_get_iflags()

int rtnl_link_ip6gre_get_iflags ( struct rtnl_link link,
uint16_t *  iflags 
)

Get IP6GRE tunnel iflags.

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

Definition at line 475 of file ip6gre.c.

◆ rtnl_link_ip6gre_set_oflags()

int rtnl_link_ip6gre_set_oflags ( struct rtnl_link link,
uint16_t  oflags 
)

Set IP6GRE tunnel set oflags.

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

Definition at line 495 of file ip6gre.c.

◆ rtnl_link_ip6gre_get_oflags()

int rtnl_link_ip6gre_get_oflags ( struct rtnl_link link,
uint16_t *  oflags 
)

Get IP6GRE tunnel oflags.

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

Definition at line 514 of file ip6gre.c.

◆ rtnl_link_ip6gre_set_ikey()

int rtnl_link_ip6gre_set_ikey ( struct rtnl_link link,
uint32_t  ikey 
)

Set IP6GRE tunnel set ikey.

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

Definition at line 534 of file ip6gre.c.

◆ rtnl_link_ip6gre_get_ikey()

int rtnl_link_ip6gre_get_ikey ( struct rtnl_link link,
uint32_t *  ikey 
)

Get IP6GRE tunnel ikey.

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

Definition at line 553 of file ip6gre.c.

◆ rtnl_link_ip6gre_set_okey()

int rtnl_link_ip6gre_set_okey ( struct rtnl_link link,
uint32_t  okey 
)

Set IP6GRE tunnel set okey.

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

Definition at line 573 of file ip6gre.c.

◆ rtnl_link_ip6gre_get_okey()

int rtnl_link_ip6gre_get_okey ( struct rtnl_link link,
uint32_t *  okey 
)

Get IP6GRE tunnel okey.

Parameters
linkLink object
okeyaddr to fill in with the okey
Returns
okey value

Definition at line 592 of file ip6gre.c.

◆ rtnl_link_ip6gre_set_local()

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

Set IP6GRE tunnel local address.

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

Definition at line 612 of file ip6gre.c.

◆ rtnl_link_ip6gre_get_local()

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

Get IP6GRE tunnel local address.

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

Definition at line 631 of file ip6gre.c.

◆ rtnl_link_ip6gre_set_remote()

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

Set IP6GRE tunnel remote address.

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

Definition at line 651 of file ip6gre.c.

◆ rtnl_link_ip6gre_get_remote()

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

Get IP6GRE 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 670 of file ip6gre.c.

◆ rtnl_link_ip6gre_set_ttl()

int rtnl_link_ip6gre_set_ttl ( struct rtnl_link link,
uint8_t  ttl 
)

Set IP6GRE tunnel ttl.

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

Definition at line 690 of file ip6gre.c.

◆ rtnl_link_ip6gre_get_ttl()

int rtnl_link_ip6gre_get_ttl ( struct rtnl_link link,
uint8_t *  ttl 
)

Set IP6GRE tunnel ttl.

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

Definition at line 709 of file ip6gre.c.

◆ rtnl_link_ip6gre_set_encaplimit()

int rtnl_link_ip6gre_set_encaplimit ( struct rtnl_link link,
uint8_t  encaplimit 
)

Set IP6GRE tunnel encap limit.

Parameters
linkLink object
encaplimittunnel encap limit value
Returns
0 on success or a negative error code

Definition at line 729 of file ip6gre.c.

◆ rtnl_link_ip6gre_get_encaplimit()

int rtnl_link_ip6gre_get_encaplimit ( struct rtnl_link link,
uint8_t *  encaplimit 
)

Get IP6GRE tunnel encap limit.

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

Definition at line 748 of file ip6gre.c.

◆ rtnl_link_ip6gre_set_flowinfo()

int rtnl_link_ip6gre_set_flowinfo ( struct rtnl_link link,
uint32_t  flowinfo 
)

Set IP6GRE tunnel flowinfo.

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

Definition at line 768 of file ip6gre.c.

◆ rtnl_link_ip6gre_get_flowinfo()

int rtnl_link_ip6gre_get_flowinfo ( struct rtnl_link link,
uint32_t *  flowinfo 
)

Get IP6GRE flowinfo.

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

Definition at line 787 of file ip6gre.c.

◆ rtnl_link_ip6gre_set_flags()

int rtnl_link_ip6gre_set_flags ( struct rtnl_link link,
uint32_t  flags 
)

Set IP6GRE tunnel flags.

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

Definition at line 807 of file ip6gre.c.

◆ rtnl_link_ip6gre_get_flags()

int rtnl_link_ip6gre_get_flags ( struct rtnl_link link,
uint32_t *  flags 
)

Get IP6GRE flags.

Parameters
linkLink object
flagsaddr to fill in with the tunnel flags
Returns
0 on success or a negative error code

Definition at line 826 of file ip6gre.c.

◆ rtnl_link_ip6gre_set_fwmark()

int rtnl_link_ip6gre_set_fwmark ( struct rtnl_link link,
uint32_t  fwmark 
)

Set IP6GRE tunnel fwmark.

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

Definition at line 846 of file ip6gre.c.

◆ rtnl_link_ip6gre_get_fwmark()

int rtnl_link_ip6gre_get_fwmark ( struct rtnl_link link,
uint32_t *  fwmark 
)

Get IP6GRE tunnel fwmark.

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

Definition at line 865 of file ip6gre.c.

Variable Documentation

◆ ttl

uint8_t ip6gre_info::ttl

Definition at line 41 of file ip6gre.c.

◆ encaplimit

uint8_t ip6gre_info::encaplimit

Definition at line 42 of file ip6gre.c.

◆ iflags

uint16_t ip6gre_info::iflags

Definition at line 43 of file ip6gre.c.

◆ oflags

uint16_t ip6gre_info::oflags

Definition at line 44 of file ip6gre.c.

◆ ikey

uint32_t ip6gre_info::ikey

Definition at line 45 of file ip6gre.c.

◆ okey

uint32_t ip6gre_info::okey

Definition at line 46 of file ip6gre.c.

◆ link

uint32_t ip6gre_info::link

Definition at line 47 of file ip6gre.c.

◆ flowinfo

uint32_t ip6gre_info::flowinfo

Definition at line 48 of file ip6gre.c.

◆ flags

uint32_t ip6gre_info::flags

Definition at line 49 of file ip6gre.c.

◆ local

struct in6_addr ip6gre_info::local

Definition at line 50 of file ip6gre.c.

◆ remote

struct in6_addr ip6gre_info::remote

Definition at line 51 of file ip6gre.c.

◆ fwmark

uint32_t ip6gre_info::fwmark

Definition at line 52 of file ip6gre.c.

◆ ip6gre_mask

uint32_t ip6gre_info::ip6gre_mask

Definition at line 53 of file ip6gre.c.