libnl: IP6TNL

libnl 3.12.0

IP6TNL
Routing Library (libnl-route) » Links (Interfaces)

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 | IP6_TNL_ATTR_CMTD (1 << 10)
#define | IS_IP6_TNL_LINK_ASSERT(link)

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

## 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 34 of file ip6tnl.c.

## ◆ IP6_TNL_ATTR_LOCAL

#define IP6_TNL_ATTR_LOCAL (1 << 1)

Definition at line 35 of file ip6tnl.c.

## ◆ IP6_TNL_ATTR_REMOTE

#define IP6_TNL_ATTR_REMOTE (1 << 2)

Definition at line 36 of file ip6tnl.c.

## ◆ IP6_TNL_ATTR_TTL

#define IP6_TNL_ATTR_TTL (1 << 3)

Definition at line 37 of file ip6tnl.c.

## ◆ IP6_TNL_ATTR_TOS

#define IP6_TNL_ATTR_TOS (1 << 4)

Definition at line 38 of file ip6tnl.c.

## ◆ IP6_TNL_ATTR_ENCAPLIMIT

#define IP6_TNL_ATTR_ENCAPLIMIT (1 << 5)

Definition at line 39 of file ip6tnl.c.

## ◆ IP6_TNL_ATTR_FLAGS

#define IP6_TNL_ATTR_FLAGS (1 << 6)

Definition at line 40 of file ip6tnl.c.

## ◆ IP6_TNL_ATTR_PROTO

#define IP6_TNL_ATTR_PROTO (1 << 7)

Definition at line 41 of file ip6tnl.c.

## ◆ IP6_TNL_ATTR_FLOWINFO

#define IP6_TNL_ATTR_FLOWINFO (1 << 8)

Definition at line 42 of file ip6tnl.c.

## ◆ IP6_TNL_ATTR_FWMARK

#define IP6_TNL_ATTR_FWMARK (1 << 9)

Definition at line 43 of file ip6tnl.c.

## ◆ IP6_TNL_ATTR_CMTD

#define IP6_TNL_ATTR_CMTD (1 << 10)

Definition at line 44 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 346 of file ip6tnl.c.

## Function Documentation

## ◆ rtnl_link_ip6_tnl_alloc()

struct rtnl_link * rtnl_link_ip6_tnl_alloc | ( | void |  | ) |

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

  link | Link object

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

Definition at line 376 of file ip6tnl.c.

References rtnl_link_info_ops::io_name.

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

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

  link | Link object
  index | interface index

Returns
  0 on success or a negative error code

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

  link | Link object

Returns
  interface index value

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

  link | Link object
  addr | local address

Returns
  0 on success or a negative error code

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

  link | Link object

Returns
  0 on success or a negative error code

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

  link | Link object
  remote | remote address

Returns
  0 on success or a negative error code

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

  link | Link object

Returns
  0 on success or a negative error code

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

  link | Link object
  ttl | tunnel ttl

Returns
  0 on success or a negative error code

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

  link | Link object

Returns
  ttl value

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

  link | Link object
  tos | tunnel tos

Returns
  0 on success or a negative error code

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

  link | Link object

Returns
  tos value

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

  link | Link object
  encap_limit | encaplimit value

Returns
  0 on success or a negative error code

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

  link | Link object

Returns
  encaplimit value

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

  link | Link object
  flowinfo | flowinfo value

Returns
  0 on success or a negative error code

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

  link | Link object

Returns
  flowinfo value

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

  link | Link object
  flags | tunnel flags

Returns
  0 on success or a negative error code

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

  link | Link object

Returns
  flags value

Definition at line 675 of file ip6tnl.c.

## ◆ rtnl_link_ip6_tnl_set_collect_metadata()

int rtnl_link_ip6_tnl_set_collect_metadata | ( | struct rtnl_link * | link,
|  | int | enable )

Set IP6_TNL collect-metadata flag.

Parameters

  link | Link object
  enable | 0 to disable, non-zero to enable

Enable or disable the collect-metadata mode on the ip6tnl link.

Returns
  0 on success or a negative error code

Definition at line 693 of file ip6tnl.c.

## ◆ rtnl_link_ip6_tnl_get_collect_metadata()

int rtnl_link_ip6_tnl_get_collect_metadata | ( | struct rtnl_link * | link,
|  | int * | enable )

Get IP6_TNL collect-metadata flag.

Parameters

  link | Link object
  enable | Pointer to int which will be set to the current state (0 if disabled, non-zero if enabled)

Returns
  0 on success or a negative error code

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

  link | Link object
  proto | tunnel proto

Returns
  0 on success or a negative error code

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

  link | Link object

Returns
  proto value

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

  link | Link object
  fwmark | fwmark

Returns
  0 on success or a negative error code

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

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

Returns
  0 on success or a negative error code

Definition at line 789 of file ip6tnl.c.

## Variable Documentation

## ◆ ttl

uint8_t ip6_tnl_info::ttl

Definition at line 47 of file ip6tnl.c.

## ◆ tos

uint8_t ip6_tnl_info::tos

Definition at line 48 of file ip6tnl.c.

## ◆ encap_limit

uint8_t ip6_tnl_info::encap_limit

Definition at line 49 of file ip6tnl.c.

## ◆ proto

uint8_t ip6_tnl_info::proto

Definition at line 50 of file ip6tnl.c.

## ◆ flags

uint32_t ip6_tnl_info::flags

Definition at line 51 of file ip6tnl.c.

## ◆ link

uint32_t ip6_tnl_info::link

Definition at line 52 of file ip6tnl.c.

## ◆ flowinfo

uint32_t ip6_tnl_info::flowinfo

Definition at line 53 of file ip6tnl.c.

## ◆ local

struct in6_addr ip6_tnl_info::local

Definition at line 54 of file ip6tnl.c.

## ◆ remote

struct in6_addr ip6_tnl_info::remote

Definition at line 55 of file ip6tnl.c.

## ◆ fwmark

uint32_t ip6_tnl_info::fwmark

Definition at line 56 of file ip6tnl.c.

## ◆ ip6_tnl_mask

uint32_t ip6_tnl_info::ip6_tnl_mask

Definition at line 57 of file ip6tnl.c.