libnl 3.12.0

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 IPGRE_ATTR_FWMARK   (1 << 10)
#define IS_IPGRE_LINK_ASSERT(link)

Functions

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

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::fwmark
uint32_t ipgre_info::ipgre_mask

Detailed Description

ipgre link module

Link Type Name: "ipgre"

IPGRE Documentation (Netlink Routing Development Guide)

Macro Definition Documentation

◆ IPGRE_ATTR_LINK

#define IPGRE_ATTR_LINK   (1 << 0)

Definition at line 34 of file ipgre.c.

◆ IPGRE_ATTR_IFLAGS

#define IPGRE_ATTR_IFLAGS   (1 << 1)

Definition at line 35 of file ipgre.c.

◆ IPGRE_ATTR_OFLAGS

#define IPGRE_ATTR_OFLAGS   (1 << 2)

Definition at line 36 of file ipgre.c.

◆ IPGRE_ATTR_IKEY

#define IPGRE_ATTR_IKEY   (1 << 3)

Definition at line 37 of file ipgre.c.

◆ IPGRE_ATTR_OKEY

#define IPGRE_ATTR_OKEY   (1 << 4)

Definition at line 38 of file ipgre.c.

◆ IPGRE_ATTR_LOCAL

#define IPGRE_ATTR_LOCAL   (1 << 5)

Definition at line 39 of file ipgre.c.

◆ IPGRE_ATTR_REMOTE

#define IPGRE_ATTR_REMOTE   (1 << 6)

Definition at line 40 of file ipgre.c.

◆ IPGRE_ATTR_TTL

#define IPGRE_ATTR_TTL   (1 << 7)

Definition at line 41 of file ipgre.c.

◆ IPGRE_ATTR_TOS

#define IPGRE_ATTR_TOS   (1 << 8)

Definition at line 42 of file ipgre.c.

◆ IPGRE_ATTR_PMTUDISC

#define IPGRE_ATTR_PMTUDISC   (1 << 9)

Definition at line 43 of file ipgre.c.

◆ IPGRE_ATTR_FWMARK

#define IPGRE_ATTR_FWMARK   (1 << 10)

Definition at line 44 of file ipgre.c.

◆ 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 378 of file ipgre.c.

Function Documentation

◆ rtnl_link_ipgre_alloc()

struct rtnl_link * rtnl_link_ipgre_alloc ( void )

Definition at line 385 of file ipgre.c.

◆ rtnl_link_is_ipgre()

int rtnl_link_is_ipgre ( struct rtnl_link * link)

Check if link is a IPGRE link.

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

Definition at line 409 of file ipgre.c.

References rtnl_link_info_ops::io_name.

◆ rtnl_link_ipgre_add()

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

Create a new IPGRE tunnel device.

Parameters
socknetlink socket
namename 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 422 of file ipgre.c.

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

Here is the call graph for this function:

◆ rtnl_link_ipgretap_alloc()

struct rtnl_link * rtnl_link_ipgretap_alloc ( void )

Definition at line 440 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
linkLink object
Returns
True if link is a IPGRETAP link, otherwise 0 is returned.

Definition at line 464 of file ipgre.c.

References rtnl_link_info_ops::io_name.

◆ rtnl_link_ipgretap_add()

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

Create a new IPGRETAP tunnel device.

Parameters
socknetlink socket
namename 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 476 of file ipgre.c.

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

Here is the call graph for this function:

◆ rtnl_link_ipgre_set_link()

int rtnl_link_ipgre_set_link ( struct rtnl_link * link,
uint32_t index )

Set IPGRE tunnel interface index.

Parameters
linkLink object
indexinterface index
Returns
0 on success or a negative error code

Definition at line 501 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
linkLink object
Returns
interface index

Definition at line 519 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
linkLink object
iflagsgre iflags
Returns
0 on success or a negative error code

Definition at line 535 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
linkLink object
Returns
iflags

Definition at line 553 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
linkLink object
iflagsgre oflags
Returns
0 on success or a negative error code

Definition at line 569 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
linkLink object
Returns
oflags

Definition at line 587 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
linkLink object
ikeygre ikey
Returns
0 on success or a negative error code

Definition at line 603 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
linkLink object
Returns
ikey

Definition at line 621 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
linkLink object
okeygre okey
Returns
0 on success or a negative error code

Definition at line 637 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
linkLink object
Returns
okey value

Definition at line 655 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
linkLink object
addrlocal address
Returns
0 on success or a negative error code

Definition at line 671 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
linkLink object
Returns
local address

Definition at line 689 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
linkLink object
remoteremote address
Returns
0 on success or a negative error code

Definition at line 705 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
linkLink object
Returns
remote address on success or a negative error code

Definition at line 723 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
linkLink object
ttltunnel ttl
Returns
0 on success or a negative error code

Definition at line 739 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
linkLink object
Returns
ttl value

Definition at line 757 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
linkLink object
tostunnel tos
Returns
0 on success or a negative error code

Definition at line 773 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
linkLink object
Returns
tos value

Definition at line 791 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
linkLink object
pmtudiscpath MTU discovery
Returns
0 on success or a negative error code

Definition at line 807 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
linkLink object
Returns
pmtudisc value

Definition at line 825 of file ipgre.c.

◆ rtnl_link_get_pmtudisc()

uint8_t rtnl_link_get_pmtudisc ( struct rtnl_link * link)

Definition at line 838 of file ipgre.c.

◆ rtnl_link_ipgre_set_fwmark()

int rtnl_link_ipgre_set_fwmark ( struct rtnl_link * link,
uint32_t fwmark )

Set IPGRE tunnel fwmark.

Parameters
linkLink object
fwmarkfwmark
Returns
0 on success or a negative error code

Definition at line 852 of file ipgre.c.

◆ rtnl_link_ipgre_get_fwmark()

int rtnl_link_ipgre_get_fwmark ( struct rtnl_link * link,
uint32_t * fwmark )

Get IPGRE tunnel fwmark.

Parameters
linkLink object
fwmarkaddr to fill in with the fwmark
Returns
0 on success or a negative error code

Definition at line 871 of file ipgre.c.

Variable Documentation

◆ ttl

uint8_t ipgre_info::ttl

Definition at line 48 of file ipgre.c.

◆ tos

uint8_t ipgre_info::tos

Definition at line 49 of file ipgre.c.

◆ pmtudisc

uint8_t ipgre_info::pmtudisc

Definition at line 50 of file ipgre.c.

◆ iflags

uint16_t ipgre_info::iflags

Definition at line 51 of file ipgre.c.

◆ oflags

uint16_t ipgre_info::oflags

Definition at line 52 of file ipgre.c.

◆ ikey

uint32_t ipgre_info::ikey

Definition at line 53 of file ipgre.c.

◆ okey

uint32_t ipgre_info::okey

Definition at line 54 of file ipgre.c.

◆ link

uint32_t ipgre_info::link

Definition at line 55 of file ipgre.c.

◆ local

uint32_t ipgre_info::local

Definition at line 56 of file ipgre.c.

◆ remote

uint32_t ipgre_info::remote

Definition at line 57 of file ipgre.c.

◆ fwmark

uint32_t ipgre_info::fwmark

Definition at line 58 of file ipgre.c.

◆ ipgre_mask

uint32_t ipgre_info::ipgre_mask

Definition at line 59 of file ipgre.c.