libnl: IP6GRE

libnl 3.7.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. 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

## ◆ 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_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 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

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

## ◆ 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 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

  link | Link object
  index | addr 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

  link | Link object
  iflags | ip6gre 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

  link | Link object
  iflags | addr 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

  link | Link object
  oflags | ip6gre 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

  link | Link object
  oflags | addr 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

  link | Link object
  ikey | ip6gre 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

  link | Link object
  ikey | addr 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

  link | Link object
  okey | ip6gre 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

  link | Link object
  okey | addr 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

  link | Link object
  local | local 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

  link | Link object
  local | addr 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

  link | Link object
  remote | remote 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

  link | Link object
  remote | addr 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

  link | Link object
  ttl | tunnel 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

  link | Link object
  ttl | addr 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

  link | Link object
  encaplimit | tunnel 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

  link | Link object
  encaplimit | addr 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

  link | Link object
  flowinfo | flowinfo 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

  link | Link object
  flowinfo | addr 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

  link | Link object
  flags | tunnel 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

  link | Link object
  flags | addr 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

  link | Link object
  fwmark | fwmark

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

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

Returns
  0 on success or a negative error code

Definition at line 865 of file ip6gre.c.