libnl 3.5.0

Data Structures | Macros | Functions | Variables
IPGRE
Routing Library (libnl-route) » Links (Interfaces)

ipgre link module More...

## Data Structures
struct | ipgre_info

## Macros
#define | IPGRE_ATTR_LINK (1 << 0)
#define | IPGRE_ATTR_IFLAGS (1 << 1)
#define | IPGRE_ATTR_OFLAGS (1 << 2)
#define | IPGRE_ATTR_IKEY (1 << 3)
#define | IPGRE_ATTR_OKEY (1 << 4)
#define | IPGRE_ATTR_LOCAL (1 << 5)
#define | IPGRE_ATTR_REMOTE (1 << 6)
#define | IPGRE_ATTR_TTL (1 << 7)
#define | IPGRE_ATTR_TOS (1 << 8)
#define | IPGRE_ATTR_PMTUDISC (1 << 9)
#define | IS_IPGRE_LINK_ASSERT(link)

## Functions
struct rtnl_link * | rtnl_link_ipgre_alloc (void)
int | rtnl_link_is_ipgre (struct rtnl_link *link)
| Check if link is a IPGRE link. More...
int | rtnl_link_ipgre_add (struct nl_sock *sk, const char *name)
| Create a new IPGRE tunnel device. More...
struct rtnl_link * | rtnl_link_ipgretap_alloc (void)
int | rtnl_link_is_ipgretap (struct rtnl_link *link)
| Check if link is a IPGRETAP link. More...
int | rtnl_link_ipgretap_add (struct nl_sock *sk, const char *name)
| Create a new IPGRETAP tunnel device. More...
int | rtnl_link_ipgre_set_link (struct rtnl_link *link, uint32_t index)
| Set IPGRE tunnel interface index. More...
uint32_t | rtnl_link_ipgre_get_link (struct rtnl_link *link)
| Get IPGRE tunnel interface index. More...
int | rtnl_link_ipgre_set_iflags (struct rtnl_link *link, uint16_t iflags)
| Set IPGRE tunnel set iflags. More...
uint16_t | rtnl_link_ipgre_get_iflags (struct rtnl_link *link)
| Get IPGRE tunnel iflags. More...
int | rtnl_link_ipgre_set_oflags (struct rtnl_link *link, uint16_t oflags)
| Set IPGRE tunnel set oflags. More...
uint16_t | rtnl_link_ipgre_get_oflags (struct rtnl_link *link)
| Get IPGRE tunnel oflags. More...
int | rtnl_link_ipgre_set_ikey (struct rtnl_link *link, uint32_t ikey)
| Set IPGRE tunnel set ikey. More...
uint32_t | rtnl_link_ipgre_get_ikey (struct rtnl_link *link)
| Get IPGRE tunnel ikey. More...
int | rtnl_link_ipgre_set_okey (struct rtnl_link *link, uint32_t okey)
| Set IPGRE tunnel set okey. More...
uint32_t | rtnl_link_ipgre_get_okey (struct rtnl_link *link)
| Get IPGRE tunnel okey. More...
int | rtnl_link_ipgre_set_local (struct rtnl_link *link, uint32_t addr)
| Set IPGRE tunnel local address. More...
uint32_t | rtnl_link_ipgre_get_local (struct rtnl_link *link)
| Get IPGRE tunnel local address. More...
int | rtnl_link_ipgre_set_remote (struct rtnl_link *link, uint32_t remote)
| Set IPGRE tunnel remote address. More...
uint32_t | rtnl_link_ipgre_get_remote (struct rtnl_link *link)
| Get IPGRE tunnel remote address. More...
int | rtnl_link_ipgre_set_ttl (struct rtnl_link *link, uint8_t ttl)
| Set IPGRE tunnel ttl. More...
uint8_t | rtnl_link_ipgre_get_ttl (struct rtnl_link *link)
| Set IPGRE tunnel ttl. More...
int | rtnl_link_ipgre_set_tos (struct rtnl_link *link, uint8_t tos)
| Set IPGRE tunnel tos. More...
uint8_t | rtnl_link_ipgre_get_tos (struct rtnl_link *link)
| Get IPGRE tunnel tos. More...
int | rtnl_link_ipgre_set_pmtudisc (struct rtnl_link *link, uint8_t pmtudisc)
| Set IPGRE tunnel path MTU discovery. More...
uint8_t | rtnl_link_ipgre_get_pmtudisc (struct rtnl_link *link)
| Get IPGRE path MTU discovery. More...
uint8_t | rtnl_link_get_pmtudisc (struct rtnl_link *link)

## Variables
uint8_t | ipgre_info::ttl
uint8_t | ipgre_info::tos
uint8_t | ipgre_info::pmtudisc
uint16_t | ipgre_info::iflags
uint16_t | ipgre_info::oflags
uint32_t | ipgre_info::ikey
uint32_t | ipgre_info::okey
uint32_t | ipgre_info::link
uint32_t | ipgre_info::local
uint32_t | ipgre_info::remote
uint32_t | ipgre_info::ipgre_mask

## Detailed Description

ipgre link module

Link Type Name: "ipgre"

IPGRE Documentation (Netlink Routing Development Guide)

## Macro Definition Documentation

## ◆ IS_IPGRE_LINK_ASSERT

#define IS_IPGRE_LINK_ASSERT | ( |  | link | ) |

Value:
if ((link)->l_info_ops != &ipgre_info_ops && \
(link)->l_info_ops != &ipgretap_info_ops) { \
APPBUG("Link is not a ipgre link. set type \"gre/gretap\" first.");\
return -NLE_OPNOTSUPP; \
}

Definition at line 365 of file ipgre.c.

## Function Documentation

## ◆ rtnl_link_is_ipgre()

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

Check if link is a IPGRE link.

Parameters

  link | Link object

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

Definition at line 396 of file ipgre.c.

## ◆ rtnl_link_ipgre_add()

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

Create a new IPGRE 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 409 of file ipgre.c.

## ◆ rtnl_link_is_ipgretap()

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

Check if link is a IPGRETAP link.

Parameters

  link | Link object

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

Definition at line 451 of file ipgre.c.

## ◆ rtnl_link_ipgretap_add()

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

Create a new IPGRETAP tunnel device.

Parameters

  sock | netlink socket
  name | name of the tunnel deviceL

Creates a new IPGRETAP tunnel device in the kernel

Returns
  0 on success or a negative error code

Definition at line 463 of file ipgre.c.

## ◆ rtnl_link_ipgre_set_link()

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

Set IPGRE tunnel interface index.

Parameters

  link | Link object
  index | interface index

Returns
  0 on success or a negative error code

Definition at line 488 of file ipgre.c.

## ◆ rtnl_link_ipgre_get_link()

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

Get IPGRE tunnel interface index.

Parameters

  link | Link object

Returns
  interface index

Definition at line 506 of file ipgre.c.

## ◆ rtnl_link_ipgre_set_iflags()

int rtnl_link_ipgre_set_iflags | ( | struct rtnl_link * | link,
|  | uint16_t | iflags
| ) |  |

Set IPGRE tunnel set iflags.

Parameters

  link | Link object
  iflags | gre iflags

Returns
  0 on success or a negative error code

Definition at line 522 of file ipgre.c.

## ◆ rtnl_link_ipgre_get_iflags()

uint16_t rtnl_link_ipgre_get_iflags | ( | struct rtnl_link * | link | ) |

Get IPGRE tunnel iflags.

Parameters

  link | Link object

Returns
  iflags

Definition at line 540 of file ipgre.c.

## ◆ rtnl_link_ipgre_set_oflags()

int rtnl_link_ipgre_set_oflags | ( | struct rtnl_link * | link,
|  | uint16_t | oflags
| ) |  |

Set IPGRE tunnel set oflags.

Parameters

  link | Link object
  iflags | gre oflags

Returns
  0 on success or a negative error code

Definition at line 556 of file ipgre.c.

## ◆ rtnl_link_ipgre_get_oflags()

uint16_t rtnl_link_ipgre_get_oflags | ( | struct rtnl_link * | link | ) |

Get IPGRE tunnel oflags.

Parameters

  link | Link object

Returns
  oflags

Definition at line 574 of file ipgre.c.

## ◆ rtnl_link_ipgre_set_ikey()

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

Set IPGRE tunnel set ikey.

Parameters

  link | Link object
  ikey | gre ikey

Returns
  0 on success or a negative error code

Definition at line 590 of file ipgre.c.

## ◆ rtnl_link_ipgre_get_ikey()

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

Get IPGRE tunnel ikey.

Parameters

  link | Link object

Returns
  ikey

Definition at line 608 of file ipgre.c.

## ◆ rtnl_link_ipgre_set_okey()

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

Set IPGRE tunnel set okey.

Parameters

  link | Link object
  okey | gre okey

Returns
  0 on success or a negative error code

Definition at line 624 of file ipgre.c.

## ◆ rtnl_link_ipgre_get_okey()

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

Get IPGRE tunnel okey.

Parameters

  link | Link object

Returns
  okey value

Definition at line 642 of file ipgre.c.

## ◆ rtnl_link_ipgre_set_local()

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

Set IPGRE tunnel local address.

Parameters

  link | Link object
  addr | local address

Returns
  0 on success or a negative error code

Definition at line 658 of file ipgre.c.

## ◆ rtnl_link_ipgre_get_local()

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

Get IPGRE tunnel local address.

Parameters

  link | Link object

Returns
  local address

Definition at line 676 of file ipgre.c.

## ◆ rtnl_link_ipgre_set_remote()

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

Set IPGRE tunnel remote address.

Parameters

  link | Link object
  remote | remote address

Returns
  0 on success or a negative error code

Definition at line 692 of file ipgre.c.

## ◆ rtnl_link_ipgre_get_remote()

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

Get IPGRE tunnel remote address.

Parameters

  link | Link object

Returns
  remote address on success or a negative error code

Definition at line 710 of file ipgre.c.

## ◆ rtnl_link_ipgre_set_ttl()

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

Set IPGRE tunnel ttl.

Parameters

  link | Link object
  ttl | tunnel ttl

Returns
  0 on success or a negative error code

Definition at line 726 of file ipgre.c.

## ◆ rtnl_link_ipgre_get_ttl()

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

Set IPGRE tunnel ttl.

Parameters

  link | Link object

Returns
  ttl value

Definition at line 744 of file ipgre.c.

## ◆ rtnl_link_ipgre_set_tos()

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

Set IPGRE tunnel tos.

Parameters

  link | Link object
  tos | tunnel tos

Returns
  0 on success or a negative error code

Definition at line 760 of file ipgre.c.

## ◆ rtnl_link_ipgre_get_tos()

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

Get IPGRE tunnel tos.

Parameters

  link | Link object

Returns
  tos value

Definition at line 778 of file ipgre.c.

## ◆ rtnl_link_ipgre_set_pmtudisc()

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

Set IPGRE tunnel path MTU discovery.

Parameters

  link | Link object
  pmtudisc | path MTU discovery

Returns
  0 on success or a negative error code

Definition at line 794 of file ipgre.c.

## ◆ rtnl_link_ipgre_get_pmtudisc()

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

Get IPGRE path MTU discovery.

Parameters

  link | Link object

Returns
  pmtudisc value

Definition at line 812 of file ipgre.c.