libnl 3.7.0

sit link module More...

Data Structures

struct  sit_info
 

Macros

#define SIT_ATTR_LINK   (1 << 0)
 
#define SIT_ATTR_LOCAL   (1 << 1)
 
#define SIT_ATTR_REMOTE   (1 << 2)
 
#define SIT_ATTR_TTL   (1 << 3)
 
#define SIT_ATTR_TOS   (1 << 4)
 
#define SIT_ATTR_PMTUDISC   (1 << 5)
 
#define SIT_ATTR_FLAGS   (1 << 6)
 
#define SIT_ATTR_PROTO   (1 << 7)
 
#define SIT_ATTR_6RD_PREFIX   (1 << 8)
 
#define SIT_ATTR_6RD_RELAY_PREFIX   (1 << 9)
 
#define SIT_ATTR_6RD_PREFIXLEN   (1 << 10)
 
#define SIT_ATTR_6RD_RELAY_PREFIXLEN   (1 << 11)
 
#define SIT_ATTR_FWMARK   (1 << 12)
 
#define IS_SIT_LINK_ASSERT(link, sit)
 

Functions

struct rtnl_linkrtnl_link_sit_alloc (void)
 
int rtnl_link_is_sit (struct rtnl_link *link)
 Check if link is a SIT link. More...
 
int rtnl_link_sit_add (struct nl_sock *sk, const char *name)
 Create a new sit tunnel device. More...
 
int rtnl_link_sit_set_link (struct rtnl_link *link, uint32_t index)
 Set SIT tunnel interface index. More...
 
uint32_t rtnl_link_sit_get_link (struct rtnl_link *link)
 Get SIT tunnel interface index. More...
 
int rtnl_link_sit_set_local (struct rtnl_link *link, uint32_t addr)
 Set SIT tunnel local address. More...
 
uint32_t rtnl_link_sit_get_local (struct rtnl_link *link)
 Get SIT tunnel local address. More...
 
int rtnl_link_sit_set_remote (struct rtnl_link *link, uint32_t addr)
 Set SIT tunnel remote address. More...
 
uint32_t rtnl_link_sit_get_remote (struct rtnl_link *link)
 Get SIT tunnel remote address. More...
 
int rtnl_link_sit_set_ttl (struct rtnl_link *link, uint8_t ttl)
 Set SIT tunnel ttl. More...
 
uint8_t rtnl_link_sit_get_ttl (struct rtnl_link *link)
 Get SIT tunnel ttl. More...
 
int rtnl_link_sit_set_tos (struct rtnl_link *link, uint8_t tos)
 Set SIT tunnel tos. More...
 
uint8_t rtnl_link_sit_get_tos (struct rtnl_link *link)
 Get SIT tunnel tos. More...
 
int rtnl_link_sit_set_pmtudisc (struct rtnl_link *link, uint8_t pmtudisc)
 Set SIT tunnel path MTU discovery. More...
 
uint8_t rtnl_link_sit_get_pmtudisc (struct rtnl_link *link)
 Get SIT path MTU discovery. More...
 
int rtnl_link_sit_set_flags (struct rtnl_link *link, uint16_t flags)
 Set SIT tunnel flags. More...
 
uint16_t rtnl_link_sit_get_flags (struct rtnl_link *link)
 Get SIT path flags. More...
 
int rtnl_link_sit_set_proto (struct rtnl_link *link, uint8_t proto)
 Set SIT tunnel proto. More...
 
uint8_t rtnl_link_sit_get_proto (struct rtnl_link *link)
 Get SIT proto. More...
 
int rtnl_link_sit_set_ip6rd_prefix (struct rtnl_link *link, const struct in6_addr *prefix)
 Set ip6rd prefix. More...
 
int rtnl_link_sit_get_ip6rd_prefix (const struct rtnl_link *link, struct in6_addr *prefix)
 Get ip6rd prefix. More...
 
int rtnl_link_sit_set_ip6rd_prefixlen (struct rtnl_link *link, uint16_t prefixlen)
 Set ip6rd prefix length. More...
 
int rtnl_link_sit_get_ip6rd_prefixlen (struct rtnl_link *link, uint16_t *prefixlen)
 Get ip6rd prefix length. More...
 
int rtnl_link_sit_set_ip6rd_relay_prefix (struct rtnl_link *link, uint32_t prefix)
 Set ip6rd relay prefix. More...
 
int rtnl_link_sit_get_ip6rd_relay_prefix (const struct rtnl_link *link, uint32_t *prefix)
 Get ip6rd prefix length. More...
 
int rtnl_link_sit_set_ip6rd_relay_prefixlen (struct rtnl_link *link, uint16_t prefixlen)
 Set ip6rd relay prefix length. More...
 
int rtnl_link_sit_get_ip6rd_relay_prefixlen (struct rtnl_link *link, uint16_t *prefixlen)
 Get ip6rd relay prefix length. More...
 
int rtnl_link_sit_set_fwmark (struct rtnl_link *link, uint32_t fwmark)
 Set SIT tunnel fwmark. More...
 
int rtnl_link_sit_get_fwmark (struct rtnl_link *link, uint32_t *fwmark)
 Get SIT tunnel fwmark. More...
 

Variables

uint8_t sit_info::ttl
 
uint8_t sit_info::tos
 
uint8_t sit_info::pmtudisc
 
uint8_t sit_info::proto
 
uint16_t sit_info::flags
 
uint32_t sit_info::link
 
uint32_t sit_info::local
 
uint32_t sit_info::remote
 
struct in6_addr sit_info::ip6rd_prefix
 
uint32_t sit_info::ip6rd_relay_prefix
 
uint16_t sit_info::ip6rd_prefixlen
 
uint16_t sit_info::ip6rd_relay_prefixlen
 
uint32_t sit_info::fwmark
 
uint32_t sit_info::sit_mask
 

Detailed Description

sit link module

Link Type Name: "sit"

SIT Documentation (Netlink Routing Development Guide)

Macro Definition Documentation

◆ SIT_ATTR_LINK

#define SIT_ATTR_LINK   (1 << 0)

Definition at line 29 of file sit.c.

◆ SIT_ATTR_LOCAL

#define SIT_ATTR_LOCAL   (1 << 1)

Definition at line 30 of file sit.c.

◆ SIT_ATTR_REMOTE

#define SIT_ATTR_REMOTE   (1 << 2)

Definition at line 31 of file sit.c.

◆ SIT_ATTR_TTL

#define SIT_ATTR_TTL   (1 << 3)

Definition at line 32 of file sit.c.

◆ SIT_ATTR_TOS

#define SIT_ATTR_TOS   (1 << 4)

Definition at line 33 of file sit.c.

◆ SIT_ATTR_PMTUDISC

#define SIT_ATTR_PMTUDISC   (1 << 5)

Definition at line 34 of file sit.c.

◆ SIT_ATTR_FLAGS

#define SIT_ATTR_FLAGS   (1 << 6)

Definition at line 35 of file sit.c.

◆ SIT_ATTR_PROTO

#define SIT_ATTR_PROTO   (1 << 7)

Definition at line 36 of file sit.c.

◆ SIT_ATTR_6RD_PREFIX

#define SIT_ATTR_6RD_PREFIX   (1 << 8)

Definition at line 37 of file sit.c.

◆ SIT_ATTR_6RD_RELAY_PREFIX

#define SIT_ATTR_6RD_RELAY_PREFIX   (1 << 9)

Definition at line 38 of file sit.c.

◆ SIT_ATTR_6RD_PREFIXLEN

#define SIT_ATTR_6RD_PREFIXLEN   (1 << 10)

Definition at line 39 of file sit.c.

◆ SIT_ATTR_6RD_RELAY_PREFIXLEN

#define SIT_ATTR_6RD_RELAY_PREFIXLEN   (1 << 11)

Definition at line 40 of file sit.c.

◆ SIT_ATTR_FWMARK

#define SIT_ATTR_FWMARK   (1 << 12)

Definition at line 41 of file sit.c.

◆ IS_SIT_LINK_ASSERT

#define IS_SIT_LINK_ASSERT (   link,
  sit 
)
Value:
struct sit_info *sit; \
do { \
const struct rtnl_link *_link = (link); \
if (!_link || _link->l_info_ops != &sit_info_ops) { \
APPBUG("Link is not a sit link. set type \"sit\" first."); \
return -NLE_OPNOTSUPP; \
} \
(sit) = _link->l_info; \
} while (0)
Definition: sit.c:44

Definition at line 375 of file sit.c.

Function Documentation

◆ rtnl_link_sit_alloc()

struct rtnl_link * rtnl_link_sit_alloc ( void  )

Definition at line 386 of file sit.c.

◆ rtnl_link_is_sit()

int rtnl_link_is_sit ( struct rtnl_link link)

Check if link is a SIT link.

Parameters
linkLink object
Returns
True if link is a SIT link, otherwise false is returned.

Definition at line 410 of file sit.c.

◆ rtnl_link_sit_add()

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

Create a new sit tunnel device.

Parameters
socknetlink socket
namename of the tunnel device

Creates a new sit tunnel device in the kernel

Returns
0 on success or a negative error code

Definition at line 423 of file sit.c.

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

+ Here is the call graph for this function:

◆ rtnl_link_sit_set_link()

int rtnl_link_sit_set_link ( struct rtnl_link link,
uint32_t  index 
)

Set SIT tunnel interface index.

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

Definition at line 448 of file sit.c.

◆ rtnl_link_sit_get_link()

uint32_t rtnl_link_sit_get_link ( struct rtnl_link link)

Get SIT tunnel interface index.

Parameters
linkLink object
Returns
interface index value

Definition at line 464 of file sit.c.

◆ rtnl_link_sit_set_local()

int rtnl_link_sit_set_local ( struct rtnl_link link,
uint32_t  addr 
)

Set SIT tunnel local address.

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

Definition at line 478 of file sit.c.

◆ rtnl_link_sit_get_local()

uint32_t rtnl_link_sit_get_local ( struct rtnl_link link)

Get SIT tunnel local address.

Parameters
linkLink object
Returns
local address value

Definition at line 494 of file sit.c.

◆ rtnl_link_sit_set_remote()

int rtnl_link_sit_set_remote ( struct rtnl_link link,
uint32_t  addr 
)

Set SIT tunnel remote address.

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

Definition at line 508 of file sit.c.

◆ rtnl_link_sit_get_remote()

uint32_t rtnl_link_sit_get_remote ( struct rtnl_link link)

Get SIT tunnel remote address.

Parameters
linkLink object
Returns
remote address

Definition at line 524 of file sit.c.

◆ rtnl_link_sit_set_ttl()

int rtnl_link_sit_set_ttl ( struct rtnl_link link,
uint8_t  ttl 
)

Set SIT tunnel ttl.

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

Definition at line 538 of file sit.c.

◆ rtnl_link_sit_get_ttl()

uint8_t rtnl_link_sit_get_ttl ( struct rtnl_link link)

Get SIT tunnel ttl.

Parameters
linkLink object
Returns
ttl value

Definition at line 554 of file sit.c.

◆ rtnl_link_sit_set_tos()

int rtnl_link_sit_set_tos ( struct rtnl_link link,
uint8_t  tos 
)

Set SIT tunnel tos.

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

Definition at line 568 of file sit.c.

◆ rtnl_link_sit_get_tos()

uint8_t rtnl_link_sit_get_tos ( struct rtnl_link link)

Get SIT tunnel tos.

Parameters
linkLink object
Returns
tos value

Definition at line 584 of file sit.c.

◆ rtnl_link_sit_set_pmtudisc()

int rtnl_link_sit_set_pmtudisc ( struct rtnl_link link,
uint8_t  pmtudisc 
)

Set SIT tunnel path MTU discovery.

Parameters
linkLink object
pmtudiscpath MTU discovery
Returns
0 on success or a negative error code

Definition at line 598 of file sit.c.

◆ rtnl_link_sit_get_pmtudisc()

uint8_t rtnl_link_sit_get_pmtudisc ( struct rtnl_link link)

Get SIT path MTU discovery.

Parameters
linkLink object
Returns
pmtudisc value

Definition at line 614 of file sit.c.

◆ rtnl_link_sit_set_flags()

int rtnl_link_sit_set_flags ( struct rtnl_link link,
uint16_t  flags 
)

Set SIT tunnel flags.

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

Definition at line 628 of file sit.c.

◆ rtnl_link_sit_get_flags()

uint16_t rtnl_link_sit_get_flags ( struct rtnl_link link)

Get SIT path flags.

Parameters
linkLink object
Returns
flags value

Definition at line 644 of file sit.c.

◆ rtnl_link_sit_set_proto()

int rtnl_link_sit_set_proto ( struct rtnl_link link,
uint8_t  proto 
)

Set SIT tunnel proto.

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

Definition at line 658 of file sit.c.

◆ rtnl_link_sit_get_proto()

uint8_t rtnl_link_sit_get_proto ( struct rtnl_link link)

Get SIT proto.

Parameters
linkLink object
Returns
proto value

Definition at line 674 of file sit.c.

◆ rtnl_link_sit_set_ip6rd_prefix()

int rtnl_link_sit_set_ip6rd_prefix ( struct rtnl_link link,
const struct in6_addr *  prefix 
)

Set ip6rd prefix.

Parameters
linkLink object
prefixThe IPv6 prefix
Returns
0 on success or an error code.

Definition at line 688 of file sit.c.

◆ rtnl_link_sit_get_ip6rd_prefix()

int rtnl_link_sit_get_ip6rd_prefix ( const struct rtnl_link link,
struct in6_addr *  prefix 
)

Get ip6rd prefix.

Parameters
linkLink object
prefixThe output IPv6 prefix
Returns
0 on success or an error code. If the property is unset, this call fails too.

Definition at line 705 of file sit.c.

◆ rtnl_link_sit_set_ip6rd_prefixlen()

int rtnl_link_sit_set_ip6rd_prefixlen ( struct rtnl_link link,
uint16_t  prefixlen 
)

Set ip6rd prefix length.

Parameters
linkLink object
prefixlenThe IPv6 prefix length
Returns
0 on success or an error code.

Definition at line 724 of file sit.c.

◆ rtnl_link_sit_get_ip6rd_prefixlen()

int rtnl_link_sit_get_ip6rd_prefixlen ( struct rtnl_link link,
uint16_t *  prefixlen 
)

Get ip6rd prefix length.

Parameters
linkLink object
prefixlenOutput pointer for the prefix length
Returns
0 on success or an error code. If the property is unset, this call fails.

Definition at line 741 of file sit.c.

◆ rtnl_link_sit_set_ip6rd_relay_prefix()

int rtnl_link_sit_set_ip6rd_relay_prefix ( struct rtnl_link link,
uint32_t  prefix 
)

Set ip6rd relay prefix.

Parameters
linkLink object
prefixThe IPv6 prefix length
Returns
0 on success or an error code.

Definition at line 760 of file sit.c.

◆ rtnl_link_sit_get_ip6rd_relay_prefix()

int rtnl_link_sit_get_ip6rd_relay_prefix ( const struct rtnl_link link,
uint32_t *  prefix 
)

Get ip6rd prefix length.

Parameters
linkLink object
prefixlenOutput pointer for the prefix length
Returns
0 on success or an error code. If the property is unset, this call fails.

Definition at line 777 of file sit.c.

◆ rtnl_link_sit_set_ip6rd_relay_prefixlen()

int rtnl_link_sit_set_ip6rd_relay_prefixlen ( struct rtnl_link link,
uint16_t  prefixlen 
)

Set ip6rd relay prefix length.

Parameters
linkLink object
prefixlenThe IPv6 prefix length
Returns
0 on success or an error code.

Definition at line 796 of file sit.c.

◆ rtnl_link_sit_get_ip6rd_relay_prefixlen()

int rtnl_link_sit_get_ip6rd_relay_prefixlen ( struct rtnl_link link,
uint16_t *  prefixlen 
)

Get ip6rd relay prefix length.

Parameters
linkLink object
prefixlenOutput pointer for the prefix length
Returns
0 on success or an error code. If the property is unset, this call fails.

Definition at line 813 of file sit.c.

◆ rtnl_link_sit_set_fwmark()

int rtnl_link_sit_set_fwmark ( struct rtnl_link link,
uint32_t  fwmark 
)

Set SIT tunnel fwmark.

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

Definition at line 832 of file sit.c.

◆ rtnl_link_sit_get_fwmark()

int rtnl_link_sit_get_fwmark ( struct rtnl_link link,
uint32_t *  fwmark 
)

Get SIT tunnel fwmark.

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

Definition at line 849 of file sit.c.

Variable Documentation

◆ ttl

uint8_t sit_info::ttl

Definition at line 45 of file sit.c.

◆ tos

uint8_t sit_info::tos

Definition at line 46 of file sit.c.

◆ pmtudisc

uint8_t sit_info::pmtudisc

Definition at line 47 of file sit.c.

◆ proto

uint8_t sit_info::proto

Definition at line 48 of file sit.c.

◆ flags

uint16_t sit_info::flags

Definition at line 49 of file sit.c.

◆ link

uint32_t sit_info::link

Definition at line 50 of file sit.c.

◆ local

uint32_t sit_info::local

Definition at line 51 of file sit.c.

◆ remote

uint32_t sit_info::remote

Definition at line 52 of file sit.c.

◆ ip6rd_prefix

struct in6_addr sit_info::ip6rd_prefix

Definition at line 53 of file sit.c.

◆ ip6rd_relay_prefix

uint32_t sit_info::ip6rd_relay_prefix

Definition at line 54 of file sit.c.

◆ ip6rd_prefixlen

uint16_t sit_info::ip6rd_prefixlen

Definition at line 55 of file sit.c.

◆ ip6rd_relay_prefixlen

uint16_t sit_info::ip6rd_relay_prefixlen

Definition at line 56 of file sit.c.

◆ fwmark

uint32_t sit_info::fwmark

Definition at line 57 of file sit.c.

◆ sit_mask

uint32_t sit_info::sit_mask

Definition at line 58 of file sit.c.