libnl: Routing Library (libnl-route)

libnl 3.12.0

Routing Library (libnl-route)

## Topics
| Addresses
| FIB Lookup
| Links (Interfaces)
| Neighbour Tables
| Neighbours
| The neighbour table establishes bindings between protocol addresses and link layer addresses for hosts sharing the same physical link.
| Netconf
| Routing
| Routing Rules
| Traffic Control

## Routing Type Translations
char * | nl_rtntype2str (int type, char *buf, size_t size)
int | nl_str2rtntype (const char *name)

## Scope Translations
char * | rtnl_scope2str (int scope, char *buf, size_t size)
int | rtnl_str2scope (const char *name)

## Sending
int | nl_rtgen_request (struct nl_sock *sk, int type, int family, int flags)
| Send routing netlink request message.

## Realms Translations
char * | rtnl_realms2str (uint32_t realms, char *buf, size_t len)

## Realms
#define | RTNL_REALM_MASK (0xFFFF)
| Mask specying the size of each realm part.
#define | RTNL_REALM_FROM(realm)
| Extract FROM realm from a realms field.
#define | RTNL_REALM_TO(realm)
| Extract TO realm from a realms field.
#define | RTNL_MAKE_REALM(from, to)
| Build a realms field.

## Detailed Description

## Macro Definition Documentation

## ◆ RTNL_REALM_MASK

#define RTNL_REALM_MASK (0xFFFF)

Mask specying the size of each realm part.

Definition at line 24 of file rtnl.h.

## ◆ RTNL_REALM_FROM

#define RTNL_REALM_FROM | ( |  | realm | ) |

Value:
((realm) >> 16)

Extract FROM realm from a realms field.

Definition at line 29 of file rtnl.h.

## ◆ RTNL_REALM_TO

#define RTNL_REALM_TO | ( |  | realm | ) |

Value:
((realm) & RTNL_REALM_MASK)
RTNL_REALM_MASK
#define RTNL_REALM_MASK
Mask specying the size of each realm part.
Definition rtnl.h:24

Extract TO realm from a realms field.

Definition at line 34 of file rtnl.h.

## ◆ RTNL_MAKE_REALM

#define RTNL_MAKE_REALM | ( |  | from,
|  |  | to )

Value:
((RTNL_REALM_TO(from) << 16) & RTNL_REALM_TO(to))
RTNL_REALM_TO
#define RTNL_REALM_TO(realm)
Extract TO realm from a realms field.
Definition rtnl.h:34

Build a realms field.

Definition at line 39 of file rtnl.h.

## Function Documentation

## ◆ nl_rtgen_request()

int nl_rtgen_request | ( | struct nl_sock * | sk,
|  | int | type,
|  | int | family,
|  | int | flags )

Send routing netlink request message.

Parameters

  sk | Netlink socket.
  type | Netlink message type.
  family | Address family.
  flags | Additional netlink message flags.

Fills out a routing netlink request message and sends it out using nl_send_simple().

Returns
  0 on success or a negative error code. Due to a bug in older version of the library, this function returned the number of bytes sent. Treat any non-negative number as success.

Definition at line 38 of file rtnl.c.

References nl_send_simple().

Here is the call graph for this function:

## ◆ nl_rtntype2str()

char * nl_rtntype2str | ( | int | type,
|  | char * | buf,
|  | size_t | size )

Definition at line 72 of file rtnl.c.

## ◆ nl_str2rtntype()

int nl_str2rtntype | ( | const char * | name | ) |

Definition at line 77 of file rtnl.c.

## ◆ rtnl_scope2str()

char * rtnl_scope2str | ( | int | scope,
|  | char * | buf,
|  | size_t | size )

Definition at line 97 of file rtnl.c.

## ◆ rtnl_str2scope()

int rtnl_str2scope | ( | const char * | name | ) |

Definition at line 102 of file rtnl.c.

## ◆ rtnl_realms2str()

char * rtnl_realms2str | ( | uint32_t | realms,
|  | char * | buf,
|  | size_t | len )

Definition at line 114 of file rtnl.c.