libnl: IP6TNL

libnl 3.7.0

Data Structures | Macros | Functions | Variables
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 | 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. 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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  link | Link object
  fwmark | fwmark

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

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

Returns
  0 on success or a negative error code

Definition at line 721 of file ip6tnl.c.