libnl 3.5.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 | 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...

## 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::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)
sit_info
Definition: sit.c:48
rtnl_link
Link object.

Definition at line 365 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 400 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 413 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 438 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 454 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 468 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 484 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 498 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 514 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 528 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 544 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 558 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 574 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 588 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 604 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 618 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 634 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 648 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 664 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 678 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 695 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 714 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 731 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 750 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 767 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 786 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 803 of file sit.c.