libnl: SIT

libnl 3.12.0

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

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

## 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 34 of file sit.c.

## ◆ SIT_ATTR_LOCAL

#define SIT_ATTR_LOCAL (1 << 1)

Definition at line 35 of file sit.c.

## ◆ SIT_ATTR_REMOTE

#define SIT_ATTR_REMOTE (1 << 2)

Definition at line 36 of file sit.c.

## ◆ SIT_ATTR_TTL

#define SIT_ATTR_TTL (1 << 3)

Definition at line 37 of file sit.c.

## ◆ SIT_ATTR_TOS

#define SIT_ATTR_TOS (1 << 4)

Definition at line 38 of file sit.c.

## ◆ SIT_ATTR_PMTUDISC

#define SIT_ATTR_PMTUDISC (1 << 5)

Definition at line 39 of file sit.c.

## ◆ SIT_ATTR_FLAGS

#define SIT_ATTR_FLAGS (1 << 6)

Definition at line 40 of file sit.c.

## ◆ SIT_ATTR_PROTO

#define SIT_ATTR_PROTO (1 << 7)

Definition at line 41 of file sit.c.

## ◆ SIT_ATTR_6RD_PREFIX

#define SIT_ATTR_6RD_PREFIX (1 << 8)

Definition at line 42 of file sit.c.

## ◆ SIT_ATTR_6RD_RELAY_PREFIX

#define SIT_ATTR_6RD_RELAY_PREFIX (1 << 9)

Definition at line 43 of file sit.c.

## ◆ SIT_ATTR_6RD_PREFIXLEN

#define SIT_ATTR_6RD_PREFIXLEN (1 << 10)

Definition at line 44 of file sit.c.

## ◆ SIT_ATTR_6RD_RELAY_PREFIXLEN

#define SIT_ATTR_6RD_RELAY_PREFIXLEN (1 << 11)

Definition at line 45 of file sit.c.

## ◆ SIT_ATTR_FWMARK

#define SIT_ATTR_FWMARK (1 << 12)

Definition at line 46 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)
rtnl_link
Link object.
Definition nl-route.h:29
sit_info
Definition sit.c:49

Definition at line 374 of file sit.c.

## Function Documentation

## ◆ rtnl_link_sit_alloc()

struct rtnl_link * rtnl_link_sit_alloc | ( | void |  | ) |

Definition at line 385 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

  link | Link object

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

Definition at line 409 of file sit.c.

References rtnl_link_info_ops::io_name.

## ◆ rtnl_link_sit_add()

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

Create a new sit tunnel device.

Parameters

  sock | netlink socket
  name | name 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 422 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

  link | Link object
  index | interface index

Returns
  0 on success or a negative error code

Definition at line 447 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

  link | Link object

Returns
  interface index value

Definition at line 463 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

  link | Link object
  addr | local address

Returns
  0 on success or a negative error code

Definition at line 477 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

  link | Link object

Returns
  local address value

Definition at line 493 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

  link | Link object
  remote | remote address

Returns
  0 on success or a negative error code

Definition at line 507 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

  link | Link object

Returns
  remote address

Definition at line 523 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

  link | Link object
  ttl | tunnel ttl

Returns
  0 on success or a negative error code

Definition at line 537 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

  link | Link object

Returns
  ttl value

Definition at line 553 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

  link | Link object
  tos | tunnel tos

Returns
  0 on success or a negative error code

Definition at line 567 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

  link | Link object

Returns
  tos value

Definition at line 583 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

  link | Link object
  pmtudisc | path MTU discovery

Returns
  0 on success or a negative error code

Definition at line 597 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

  link | Link object

Returns
  pmtudisc value

Definition at line 613 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

  link | Link object
  flags | tunnel flags

Returns
  0 on success or a negative error code

Definition at line 627 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

  link | Link object

Returns
  flags value

Definition at line 643 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

  link | Link object
  proto | tunnel proto

Returns
  0 on success or a negative error code

Definition at line 657 of file sit.c.

## ◆ rtnl_link_sit_get_proto()

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

Get SIT proto.

Parameters

  link | Link object

Returns
  proto value

Definition at line 673 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

  link | Link object
  prefix | The IPv6 prefix

Returns
  0 on success or an error code.

Definition at line 687 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

  link | Link object
  prefix | The output IPv6 prefix

Returns
  0 on success or an error code. If the property is unset, this call fails too.

Definition at line 704 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

  link | Link object
  prefixlen | The IPv6 prefix length

Returns
  0 on success or an error code.

Definition at line 723 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

  link | Link object
  prefixlen | Output pointer for the prefix length

Returns
  0 on success or an error code. If the property is unset, this call fails.

Definition at line 740 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

  link | Link object
  prefix | The IPv6 prefix length

Returns
  0 on success or an error code.

Definition at line 759 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

  link | Link object
  prefixlen | Output pointer for the prefix length

Returns
  0 on success or an error code. If the property is unset, this call fails.

Definition at line 776 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

  link | Link object
  prefixlen | The IPv6 prefix length

Returns
  0 on success or an error code.

Definition at line 795 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

  link | Link object
  prefixlen | Output pointer for the prefix length

Returns
  0 on success or an error code. If the property is unset, this call fails.

Definition at line 812 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

  link | Link object
  fwmark | fwmark

Returns
  0 on success or a negative error code

Definition at line 831 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

  link | Link object
  fwmark | addr to fill in with the fwmark

Returns
  0 on success or a negative error code

Definition at line 848 of file sit.c.

## Variable Documentation

## ◆ ttl

uint8_t sit_info::ttl

Definition at line 50 of file sit.c.

## ◆ tos

uint8_t sit_info::tos

Definition at line 51 of file sit.c.

## ◆ pmtudisc

uint8_t sit_info::pmtudisc

Definition at line 52 of file sit.c.

## ◆ proto

uint8_t sit_info::proto

Definition at line 53 of file sit.c.

## ◆ flags

uint16_t sit_info::flags

Definition at line 54 of file sit.c.

## ◆ link

uint32_t sit_info::link

Definition at line 55 of file sit.c.

## ◆ local

uint32_t sit_info::local

Definition at line 56 of file sit.c.

## ◆ remote

uint32_t sit_info::remote

Definition at line 57 of file sit.c.

## ◆ ip6rd_prefix

struct in6_addr sit_info::ip6rd_prefix

Definition at line 58 of file sit.c.

## ◆ ip6rd_relay_prefix

uint32_t sit_info::ip6rd_relay_prefix

Definition at line 59 of file sit.c.

## ◆ ip6rd_prefixlen

uint16_t sit_info::ip6rd_prefixlen

Definition at line 60 of file sit.c.

## ◆ ip6rd_relay_prefixlen

uint16_t sit_info::ip6rd_relay_prefixlen

Definition at line 61 of file sit.c.

## ◆ fwmark

uint32_t sit_info::fwmark

Definition at line 62 of file sit.c.

## ◆ sit_mask

uint32_t sit_info::sit_mask

Definition at line 63 of file sit.c.