libnl: IPIP

libnl 3.12.0

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

ipip link module More...

## Data Structures
struct | ipip_info

## Macros
#define | IPIP_ATTR_LINK (1 << 0)
#define | IPIP_ATTR_LOCAL (1 << 1)
#define | IPIP_ATTR_REMOTE (1 << 2)
#define | IPIP_ATTR_TTL (1 << 3)
#define | IPIP_ATTR_TOS (1 << 4)
#define | IPIP_ATTR_PMTUDISC (1 << 5)
#define | IPIP_ATTR_FWMARK (1 << 6)
#define | IS_IPIP_LINK_ASSERT(link)

## Functions
struct rtnl_link * | rtnl_link_ipip_alloc (void)
int | rtnl_link_is_ipip (struct rtnl_link *link)
| Check if link is a IPIP link.
int | rtnl_link_ipip_add (struct nl_sock *sk, const char *name)
| Create a new ipip tunnel device.
int | rtnl_link_ipip_set_link (struct rtnl_link *link, uint32_t index)
| Set IPIP tunnel interface index.
uint32_t | rtnl_link_ipip_get_link (struct rtnl_link *link)
| Get IPIP tunnel interface index.
int | rtnl_link_ipip_set_local (struct rtnl_link *link, uint32_t addr)
| Set IPIP tunnel local address.
uint32_t | rtnl_link_ipip_get_local (struct rtnl_link *link)
| Get IPIP tunnel local address.
int | rtnl_link_ipip_set_remote (struct rtnl_link *link, uint32_t addr)
| Set IPIP tunnel remote address.
uint32_t | rtnl_link_ipip_get_remote (struct rtnl_link *link)
| Get IPIP tunnel remote address.
int | rtnl_link_ipip_set_ttl (struct rtnl_link *link, uint8_t ttl)
| Set IPIP tunnel ttl.
uint8_t | rtnl_link_ipip_get_ttl (struct rtnl_link *link)
| Get IPIP tunnel ttl.
int | rtnl_link_ipip_set_tos (struct rtnl_link *link, uint8_t tos)
| Set IPIP tunnel tos.
uint8_t | rtnl_link_ipip_get_tos (struct rtnl_link *link)
| Get IPIP tunnel tos.
int | rtnl_link_ipip_set_pmtudisc (struct rtnl_link *link, uint8_t pmtudisc)
| Set IPIP tunnel path MTU discovery.
uint8_t | rtnl_link_ipip_get_pmtudisc (struct rtnl_link *link)
| Get IPIP path MTU discovery.
int | rtnl_link_ipip_set_fwmark (struct rtnl_link *link, uint32_t fwmark)
| Set IPIP tunnel fwmark.
int | rtnl_link_ipip_get_fwmark (struct rtnl_link *link, uint32_t *fwmark)
| Get IPIP tunnel fwmark.

## Variables
uint8_t | ipip_info::ttl
uint8_t | ipip_info::tos
uint8_t | ipip_info::pmtudisc
uint32_t | ipip_info::link
uint32_t | ipip_info::local
uint32_t | ipip_info::remote
uint32_t | ipip_info::fwmark
uint32_t | ipip_info::ipip_mask

## Detailed Description

ipip link module

Link Type Name: "ipip"

IPIP Documentation (Netlink Routing Development Guide)

## Macro Definition Documentation

## ◆ IPIP_ATTR_LINK

#define IPIP_ATTR_LINK (1 << 0)

Definition at line 34 of file ipip.c.

## ◆ IPIP_ATTR_LOCAL

#define IPIP_ATTR_LOCAL (1 << 1)

Definition at line 35 of file ipip.c.

## ◆ IPIP_ATTR_REMOTE

#define IPIP_ATTR_REMOTE (1 << 2)

Definition at line 36 of file ipip.c.

## ◆ IPIP_ATTR_TTL

#define IPIP_ATTR_TTL (1 << 3)

Definition at line 37 of file ipip.c.

## ◆ IPIP_ATTR_TOS

#define IPIP_ATTR_TOS (1 << 4)

Definition at line 38 of file ipip.c.

## ◆ IPIP_ATTR_PMTUDISC

#define IPIP_ATTR_PMTUDISC (1 << 5)

Definition at line 39 of file ipip.c.

## ◆ IPIP_ATTR_FWMARK

#define IPIP_ATTR_FWMARK (1 << 6)

Definition at line 40 of file ipip.c.

## ◆ IS_IPIP_LINK_ASSERT

#define IS_IPIP_LINK_ASSERT | ( |  | link | ) |

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

Definition at line 279 of file ipip.c.

## Function Documentation

## ◆ rtnl_link_ipip_alloc()

struct rtnl_link * rtnl_link_ipip_alloc | ( | void |  | ) |

Definition at line 285 of file ipip.c.

## ◆ rtnl_link_is_ipip()

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

Check if link is a IPIP link.

Parameters

  link | Link object

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

Definition at line 309 of file ipip.c.

References rtnl_link_info_ops::io_name.

## ◆ rtnl_link_ipip_add()

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

Create a new ipip tunnel device.

Parameters

  sock | netlink socket
  name | name of the tunnel deviceL

Creates a new ipip tunnel device in the kernel

Returns
  0 on success or a negative error code

Definition at line 322 of file ipip.c.

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

Here is the call graph for this function:

## ◆ rtnl_link_ipip_set_link()

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

Set IPIP tunnel interface index.

Parameters

  link | Link object
  index | interface index

Returns
  0 on success or a negative error code

Definition at line 347 of file ipip.c.

## ◆ rtnl_link_ipip_get_link()

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

Get IPIP tunnel interface index.

Parameters

  link | Link object

Returns
  interface index value

Definition at line 365 of file ipip.c.

## ◆ rtnl_link_ipip_set_local()

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

Set IPIP tunnel local address.

Parameters

  link | Link object
  addr | local address

Returns
  0 on success or a negative error code

Definition at line 381 of file ipip.c.

## ◆ rtnl_link_ipip_get_local()

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

Get IPIP tunnel local address.

Parameters

  link | Link object

Returns
  local address value

Definition at line 399 of file ipip.c.

## ◆ rtnl_link_ipip_set_remote()

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

Set IPIP tunnel remote address.

Parameters

  link | Link object
  remote | remote address

Returns
  0 on success or a negative error code

Definition at line 415 of file ipip.c.

## ◆ rtnl_link_ipip_get_remote()

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

Get IPIP tunnel remote address.

Parameters

  link | Link object

Returns
  remote address

Definition at line 433 of file ipip.c.

## ◆ rtnl_link_ipip_set_ttl()

int rtnl_link_ipip_set_ttl | ( | struct rtnl_link * | link,
|  | uint8_t | ttl )

Set IPIP tunnel ttl.

Parameters

  link | Link object
  ttl | tunnel ttl

Returns
  0 on success or a negative error code

Definition at line 449 of file ipip.c.

## ◆ rtnl_link_ipip_get_ttl()

uint8_t rtnl_link_ipip_get_ttl | ( | struct rtnl_link * | link | ) |

Get IPIP tunnel ttl.

Parameters

  link | Link object

Returns
  ttl value

Definition at line 467 of file ipip.c.

## ◆ rtnl_link_ipip_set_tos()

int rtnl_link_ipip_set_tos | ( | struct rtnl_link * | link,
|  | uint8_t | tos )

Set IPIP tunnel tos.

Parameters

  link | Link object
  tos | tunnel tos

Returns
  0 on success or a negative error code

Definition at line 483 of file ipip.c.

## ◆ rtnl_link_ipip_get_tos()

uint8_t rtnl_link_ipip_get_tos | ( | struct rtnl_link * | link | ) |

Get IPIP tunnel tos.

Parameters

  link | Link object

Returns
  tos value

Definition at line 501 of file ipip.c.

## ◆ rtnl_link_ipip_set_pmtudisc()

int rtnl_link_ipip_set_pmtudisc | ( | struct rtnl_link * | link,
|  | uint8_t | pmtudisc )

Set IPIP tunnel path MTU discovery.

Parameters

  link | Link object
  pmtudisc | path MTU discovery

Returns
  0 on success or a negative error code

Definition at line 517 of file ipip.c.

## ◆ rtnl_link_ipip_get_pmtudisc()

uint8_t rtnl_link_ipip_get_pmtudisc | ( | struct rtnl_link * | link | ) |

Get IPIP path MTU discovery.

Parameters

  link | Link object

Returns
  pmtudisc value

Definition at line 535 of file ipip.c.

## ◆ rtnl_link_ipip_set_fwmark()

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

Set IPIP tunnel fwmark.

Parameters

  link | Link object
  fwmark | fwmark

Returns
  0 on success or a negative error code

Definition at line 551 of file ipip.c.

## ◆ rtnl_link_ipip_get_fwmark()

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

Get IPIP 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 570 of file ipip.c.

## Variable Documentation

## ◆ ttl

uint8_t ipip_info::ttl

Definition at line 44 of file ipip.c.

## ◆ tos

uint8_t ipip_info::tos

Definition at line 45 of file ipip.c.

## ◆ pmtudisc

uint8_t ipip_info::pmtudisc

Definition at line 46 of file ipip.c.

## ◆ link

uint32_t ipip_info::link

Definition at line 47 of file ipip.c.

## ◆ local

uint32_t ipip_info::local

Definition at line 48 of file ipip.c.

## ◆ remote

uint32_t ipip_info::remote

Definition at line 49 of file ipip.c.

## ◆ fwmark

uint32_t ipip_info::fwmark

Definition at line 50 of file ipip.c.

## ◆ ipip_mask

uint32_t ipip_info::ipip_mask

Definition at line 51 of file ipip.c.