libnl: SIT

libnl 3.7.0

Data Structures | Macros | Functions | Variables
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. 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

## ◆ 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.
sit_info
Definition: sit.c:44

Definition at line 375 of file sit.c.

## Function Documentation

## ◆ 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 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

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

## ◆ 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 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

  link | Link 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

  link | Link object
  addr | local 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

  link | Link 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

  link | Link object
  remote | remote 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

  link | Link 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

  link | Link object
  ttl | tunnel 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

  link | Link 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

  link | Link object
  tos | tunnel 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

  link | Link 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

  link | Link object
  pmtudisc | path 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

  link | Link 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

  link | Link object
  flags | tunnel 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

  link | Link 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

  link | Link object
  proto | tunnel 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

  link | Link 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

  link | Link object
  prefix | The 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

  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 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

  link | Link object
  prefixlen | The 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

  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 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

  link | Link object
  prefix | The 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

  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 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

  link | Link object
  prefixlen | The 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

  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 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

  link | Link object
  fwmark | fwmark

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

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

Returns
  0 on success or a negative error code

Definition at line 849 of file sit.c.