libnl: IPVTI

libnl 3.12.0

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

ipvti link module More...

## Data Structures
struct | ipvti_info

## Macros
#define | IPVTI_ATTR_LINK (1 << 0)
#define | IPVTI_ATTR_IKEY (1 << 1)
#define | IPVTI_ATTR_OKEY (1 << 2)
#define | IPVTI_ATTR_LOCAL (1 << 3)
#define | IPVTI_ATTR_REMOTE (1 << 4)
#define | IPVTI_ATTR_FWMARK (1 << 5)
#define | IS_IPVTI_LINK_ASSERT(link)

## Functions
struct rtnl_link * | rtnl_link_ipvti_alloc (void)
int | rtnl_link_is_ipvti (struct rtnl_link *link)
| Check if link is a IPVTI link.
int | rtnl_link_ipvti_add (struct nl_sock *sk, const char *name)
| Create a new ipvti tunnel device.
int | rtnl_link_ipvti_set_link (struct rtnl_link *link, uint32_t index)
| Set IPVTI tunnel interface index.
uint32_t | rtnl_link_ipvti_get_link (struct rtnl_link *link)
| Get IPVTI tunnel interface index.
int | rtnl_link_ipvti_set_ikey (struct rtnl_link *link, uint32_t ikey)
| Set IPVTI tunnel set ikey.
uint32_t | rtnl_link_ipvti_get_ikey (struct rtnl_link *link)
| Get IPVTI tunnel ikey.
int | rtnl_link_ipvti_set_okey (struct rtnl_link *link, uint32_t okey)
| Set IPVTI tunnel set okey.
uint32_t | rtnl_link_ipvti_get_okey (struct rtnl_link *link)
| Get IPVTI tunnel okey.
int | rtnl_link_ipvti_set_local (struct rtnl_link *link, uint32_t addr)
| Set IPVTI tunnel local address.
uint32_t | rtnl_link_ipvti_get_local (struct rtnl_link *link)
| Get IPVTI tunnel local address.
int | rtnl_link_ipvti_set_remote (struct rtnl_link *link, uint32_t remote)
| Set IPVTI tunnel remote address.
uint32_t | rtnl_link_ipvti_get_remote (struct rtnl_link *link)
| Get IPVTI tunnel remote address.
int | rtnl_link_ipvti_set_fwmark (struct rtnl_link *link, uint32_t fwmark)
| Set IPVTI tunnel fwmark.
int | rtnl_link_ipvti_get_fwmark (struct rtnl_link *link, uint32_t *fwmark)
| Get IPVTI tunnel fwmark.

## Variables
uint32_t | ipvti_info::link
uint32_t | ipvti_info::ikey
uint32_t | ipvti_info::okey
uint32_t | ipvti_info::local
uint32_t | ipvti_info::remote
uint32_t | ipvti_info::fwmark
uint32_t | ipvti_info::ipvti_mask

## Detailed Description

ipvti link module

Link Type Name: "ipvti"

IPVTI Documentation (Netlink Routing Development Guide)

## Macro Definition Documentation

## ◆ IPVTI_ATTR_LINK

#define IPVTI_ATTR_LINK (1 << 0)

Definition at line 34 of file ipvti.c.

## ◆ IPVTI_ATTR_IKEY

#define IPVTI_ATTR_IKEY (1 << 1)

Definition at line 35 of file ipvti.c.

## ◆ IPVTI_ATTR_OKEY

#define IPVTI_ATTR_OKEY (1 << 2)

Definition at line 36 of file ipvti.c.

## ◆ IPVTI_ATTR_LOCAL

#define IPVTI_ATTR_LOCAL (1 << 3)

Definition at line 37 of file ipvti.c.

## ◆ IPVTI_ATTR_REMOTE

#define IPVTI_ATTR_REMOTE (1 << 4)

Definition at line 38 of file ipvti.c.

## ◆ IPVTI_ATTR_FWMARK

#define IPVTI_ATTR_FWMARK (1 << 5)

Definition at line 39 of file ipvti.c.

## ◆ IS_IPVTI_LINK_ASSERT

#define IS_IPVTI_LINK_ASSERT | ( |  | link | ) |

Value:
if ((link)->l_info_ops != &ipvti_info_ops) { \
APPBUG("Link is not a ipvti link. set type \"vti\" first.");\
return -NLE_OPNOTSUPP; \
}

Definition at line 264 of file ipvti.c.

## Function Documentation

## ◆ rtnl_link_ipvti_alloc()

struct rtnl_link * rtnl_link_ipvti_alloc | ( | void |  | ) |

Definition at line 270 of file ipvti.c.

## ◆ rtnl_link_is_ipvti()

int rtnl_link_is_ipvti | ( | struct rtnl_link * | link | ) |

Check if link is a IPVTI link.

Parameters

  link | Link object

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

Definition at line 294 of file ipvti.c.

References rtnl_link_info_ops::io_name.

## ◆ rtnl_link_ipvti_add()

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

Create a new ipvti tunnel device.

Parameters

  sock | netlink socket
  name | name of the tunnel deviceL

Creates a new ipvti tunnel device in the kernel

Returns
  0 on success or a negative error code

Definition at line 306 of file ipvti.c.

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

Here is the call graph for this function:

## ◆ rtnl_link_ipvti_set_link()

int rtnl_link_ipvti_set_link | ( | struct rtnl_link * | link,
|  | uint32_t | index )

Set IPVTI tunnel interface index.

Parameters

  link | Link object
  index | interface index

Returns
  0 on success or a negative error code

Definition at line 330 of file ipvti.c.

## ◆ rtnl_link_ipvti_get_link()

uint32_t rtnl_link_ipvti_get_link | ( | struct rtnl_link * | link | ) |

Get IPVTI tunnel interface index.

Parameters

  link | Link object

Returns
  interface index

Definition at line 348 of file ipvti.c.

## ◆ rtnl_link_ipvti_set_ikey()

int rtnl_link_ipvti_set_ikey | ( | struct rtnl_link * | link,
|  | uint32_t | ikey )

Set IPVTI tunnel set ikey.

Parameters

  link | Link object
  ikey | gre ikey

Returns
  0 on success or a negative error code

Definition at line 364 of file ipvti.c.

## ◆ rtnl_link_ipvti_get_ikey()

uint32_t rtnl_link_ipvti_get_ikey | ( | struct rtnl_link * | link | ) |

Get IPVTI tunnel ikey.

Parameters

  link | Link object

Returns
  ikey

Definition at line 382 of file ipvti.c.

## ◆ rtnl_link_ipvti_set_okey()

int rtnl_link_ipvti_set_okey | ( | struct rtnl_link * | link,
|  | uint32_t | okey )

Set IPVTI tunnel set okey.

Parameters

  link | Link object
  okey | gre okey

Returns
  0 on success or a negative error code

Definition at line 398 of file ipvti.c.

## ◆ rtnl_link_ipvti_get_okey()

uint32_t rtnl_link_ipvti_get_okey | ( | struct rtnl_link * | link | ) |

Get IPVTI tunnel okey.

Parameters

  link | Link object

Returns
  okey value

Definition at line 416 of file ipvti.c.

## ◆ rtnl_link_ipvti_set_local()

int rtnl_link_ipvti_set_local | ( | struct rtnl_link * | link,
|  | uint32_t | addr )

Set IPVTI tunnel local address.

Parameters

  link | Link object
  addr | local address

Returns
  0 on success or a negative error code

Definition at line 432 of file ipvti.c.

## ◆ rtnl_link_ipvti_get_local()

uint32_t rtnl_link_ipvti_get_local | ( | struct rtnl_link * | link | ) |

Get IPVTI tunnel local address.

Parameters

  link | Link object

Returns
  local address

Definition at line 450 of file ipvti.c.

## ◆ rtnl_link_ipvti_set_remote()

int rtnl_link_ipvti_set_remote | ( | struct rtnl_link * | link,
|  | uint32_t | remote )

Set IPVTI tunnel remote address.

Parameters

  link | Link object
  remote | remote address

Returns
  0 on success or a negative error code

Definition at line 466 of file ipvti.c.

## ◆ rtnl_link_ipvti_get_remote()

uint32_t rtnl_link_ipvti_get_remote | ( | struct rtnl_link * | link | ) |

Get IPVTI tunnel remote address.

Parameters

  link | Link object

Returns
  remote address on success or a negative error code

Definition at line 484 of file ipvti.c.

## ◆ rtnl_link_ipvti_set_fwmark()

int rtnl_link_ipvti_set_fwmark | ( | struct rtnl_link * | link,
|  | uint32_t | fwmark )

Set IPVTI tunnel fwmark.

Parameters

  link | Link object
  fwmark | fwmark

Returns
  0 on success or a negative error code

Definition at line 500 of file ipvti.c.

## ◆ rtnl_link_ipvti_get_fwmark()

int rtnl_link_ipvti_get_fwmark | ( | struct rtnl_link * | link,
|  | uint32_t * | fwmark )

Get IPVTI 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 519 of file ipvti.c.

## Variable Documentation

## ◆ link

uint32_t ipvti_info::link

Definition at line 43 of file ipvti.c.

## ◆ ikey

uint32_t ipvti_info::ikey

Definition at line 44 of file ipvti.c.

## ◆ okey

uint32_t ipvti_info::okey

Definition at line 45 of file ipvti.c.

## ◆ local

uint32_t ipvti_info::local

Definition at line 46 of file ipvti.c.

## ◆ remote

uint32_t ipvti_info::remote

Definition at line 47 of file ipvti.c.

## ◆ fwmark

uint32_t ipvti_info::fwmark

Definition at line 48 of file ipvti.c.

## ◆ ipvti_mask

uint32_t ipvti_info::ipvti_mask

Definition at line 49 of file ipvti.c.