libnl: IP6GRE

libnl 3.10.0

Data Structures | Macros | Functions | Variables
IP6GRE
Routing Library (libnl-route) » Links (Interfaces)

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

## 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 30 of file ip6gre.c.

## ◆ IP6GRE_ATTR_IFLAGS

#define IP6GRE_ATTR_IFLAGS (1 << 1)

Definition at line 31 of file ip6gre.c.

## ◆ IP6GRE_ATTR_OFLAGS

#define IP6GRE_ATTR_OFLAGS (1 << 2)

Definition at line 32 of file ip6gre.c.

## ◆ IP6GRE_ATTR_IKEY

#define IP6GRE_ATTR_IKEY (1 << 3)

Definition at line 33 of file ip6gre.c.

## ◆ IP6GRE_ATTR_OKEY

#define IP6GRE_ATTR_OKEY (1 << 4)

Definition at line 34 of file ip6gre.c.

## ◆ IP6GRE_ATTR_LOCAL

#define IP6GRE_ATTR_LOCAL (1 << 5)

Definition at line 35 of file ip6gre.c.

## ◆ IP6GRE_ATTR_REMOTE

#define IP6GRE_ATTR_REMOTE (1 << 6)

Definition at line 36 of file ip6gre.c.

## ◆ IP6GRE_ATTR_TTL

#define IP6GRE_ATTR_TTL (1 << 7)

Definition at line 37 of file ip6gre.c.

## ◆ IP6GRE_ATTR_ENCAPLIMIT

#define IP6GRE_ATTR_ENCAPLIMIT (1 << 8)

Definition at line 38 of file ip6gre.c.

## ◆ IP6GRE_ATTR_FLOWINFO

#define IP6GRE_ATTR_FLOWINFO (1 << 9)

Definition at line 39 of file ip6gre.c.

## ◆ IP6GRE_ATTR_FLAGS

#define IP6GRE_ATTR_FLAGS (1 << 10)

Definition at line 40 of file ip6gre.c.

## ◆ IP6GRE_ATTR_FWMARK

#define IP6GRE_ATTR_FWMARK (1 << 11)

Definition at line 41 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 349 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 355 of file ip6gre.c.

## Function Documentation

## ◆ rtnl_link_ip6gre_alloc()

struct rtnl_link * rtnl_link_ip6gre_alloc | ( | void |  | ) |

Definition at line 359 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

  link | Link object

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

Definition at line 383 of file ip6gre.c.

References rtnl_link_info_ops::io_name.

## ◆ rtnl_link_ip6gre_add()

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

Create a new IP6GRE tunnel device.

Parameters

  sock | netlink socket
  name | name 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 396 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

  link | Link object
  index | interface index

Returns
  0 on success or a negative error code

Definition at line 421 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

  link | Link object
  index | addr to fill in with the interface index

Returns
  0 on success or a negative error code

Definition at line 440 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

  link | Link object
  iflags | ip6gre iflags

Returns
  0 on success or a negative error code

Definition at line 460 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

  link | Link object
  iflags | addr to fill in with the iflags

Returns
  0 on success or a negative error code

Definition at line 479 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

  link | Link object
  oflags | ip6gre oflags

Returns
  0 on success or a negative error code

Definition at line 499 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

  link | Link object
  oflags | addr to fill in with the oflags

Returns
  0 on success or a negative error code

Definition at line 518 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

  link | Link object
  ikey | ip6gre ikey

Returns
  0 on success or a negative error code

Definition at line 538 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

  link | Link object
  ikey | addr to fill in with the ikey

Returns
  0 on success or a negative error code

Definition at line 557 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

  link | Link object
  okey | ip6gre okey

Returns
  0 on success or a negative error code

Definition at line 577 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

  link | Link object
  okey | addr to fill in with the okey

Returns
  okey value

Definition at line 596 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

  link | Link object
  local | local address

Returns
  0 on success or a negative error code

Definition at line 616 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

  link | Link object
  local | addr to fill in with local address

Returns
  0 on success or a negative error code

Definition at line 635 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

  link | Link object
  remote | remote address

Returns
  0 on success or a negative error code

Definition at line 655 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

  link | Link object
  remote | addr to fill in with remote address

Returns
  0 on success or a negative error code

Definition at line 674 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

  link | Link object
  ttl | tunnel ttl

Returns
  0 on success or a negative error code

Definition at line 694 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

  link | Link object
  ttl | addr to fill in with the ttl

Returns
  0 on success or a negative error code

Definition at line 713 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

  link | Link object
  encaplimit | tunnel encap limit value

Returns
  0 on success or a negative error code

Definition at line 733 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

  link | Link object
  encaplimit | addr to fill in with the encaplimit

Returns
  0 on success or a negative error code

Definition at line 752 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

  link | Link object
  flowinfo | flowinfo value

Returns
  0 on success or a negative error code

Definition at line 772 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

  link | Link object
  flowinfo | addr to fill in with the flowinfo

Returns
  0 on success or a negative error code

Definition at line 791 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

  link | Link object
  flags | tunnel flags

Returns
  0 on success or a negative error code

Definition at line 811 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

  link | Link object
  flags | addr to fill in with the tunnel flags

Returns
  0 on success or a negative error code

Definition at line 830 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

  link | Link object
  fwmark | fwmark

Returns
  0 on success or a negative error code

Definition at line 850 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

  link | Link object
  fwmark | addr to fill in with the fwmark

Returns
  0 on success or a negative error code

Definition at line 869 of file ip6gre.c.

## Variable Documentation

## ◆ ttl

uint8_t ip6gre_info::ttl

Definition at line 45 of file ip6gre.c.

## ◆ encaplimit

uint8_t ip6gre_info::encaplimit

Definition at line 46 of file ip6gre.c.

## ◆ iflags

uint16_t ip6gre_info::iflags

Definition at line 47 of file ip6gre.c.

## ◆ oflags

uint16_t ip6gre_info::oflags

Definition at line 48 of file ip6gre.c.

## ◆ ikey

uint32_t ip6gre_info::ikey

Definition at line 49 of file ip6gre.c.

## ◆ okey

uint32_t ip6gre_info::okey

Definition at line 50 of file ip6gre.c.

## ◆ link

uint32_t ip6gre_info::link

Definition at line 51 of file ip6gre.c.

## ◆ flowinfo

uint32_t ip6gre_info::flowinfo

Definition at line 52 of file ip6gre.c.

## ◆ flags

uint32_t ip6gre_info::flags

Definition at line 53 of file ip6gre.c.

## ◆ local

struct in6_addr ip6gre_info::local

Definition at line 54 of file ip6gre.c.

## ◆ remote

struct in6_addr ip6gre_info::remote

Definition at line 55 of file ip6gre.c.

## ◆ fwmark

uint32_t ip6gre_info::fwmark

Definition at line 56 of file ip6gre.c.

## ◆ ip6gre_mask

uint32_t ip6gre_info::ip6gre_mask

Definition at line 57 of file ip6gre.c.