libnl: ClassID Management

libnl 3.10.0

Data Structures | Macros
ClassID Management
Routing Library (libnl-route) » Traffic Control

## Data Structures
struct | classid_map

## Macros
#define | CLASSID_NAME_HT_SIZ 256

## Traffic Control Handle Translations
char * | rtnl_tc_handle2str (uint32_t handle, char *buf, size_t len)
| Convert a traffic control handle to a character string (Reentrant).
int | rtnl_tc_str2handle (const char *str, uint32_t *res)
| Convert a charactering strint to a traffic control handle.
int | rtnl_tc_read_classid_file (void)
| (Re-)read classid file
int | rtnl_classid_generate (const char *name, uint32_t *result, uint32_t parent)

## Detailed Description

## Macro Definition Documentation

## ◆ CLASSID_NAME_HT_SIZ

#define CLASSID_NAME_HT_SIZ 256

Definition at line 31 of file classid.c.

## Function Documentation

## ◆ rtnl_tc_handle2str()

char * rtnl_tc_handle2str | ( | uint32_t | handle,
|  | char * | buf,
|  | size_t | len )

Convert a traffic control handle to a character string (Reentrant).

Parameters

  handle | traffic control handle
  buf | destination buffer
  len | buffer length

Converts a tarffic control handle to a character string in the form of `MAJ:MIN` and stores it in the specified destination buffer.

Returns
  The destination buffer or the type encoded in hexidecimal form if no match was found.

Definition at line 109 of file classid.c.

## ◆ rtnl_tc_str2handle()

int rtnl_tc_str2handle | ( | const char * | str,
|  | uint32_t * | res )

Convert a charactering strint to a traffic control handle.

Parameters

  str | traffic control handle as character string
  res | destination buffer

Converts the provided character string specifying a traffic control handle to the corresponding numeric value.

The handle must be provided in one of the following formats:

- NAME
- root
- none
- MAJ:
- :MIN
- NAME:MIN
- MAJ:MIN
- MAJMIN

Returns
  0 on success or a negative error code

Definition at line 154 of file classid.c.

Referenced by rtnl_tc_read_classid_file().

Here is the caller graph for this function:

## ◆ rtnl_tc_read_classid_file()

int rtnl_tc_read_classid_file | ( | void |  | ) |

(Re-)read classid file

Rereads the contents of the classid file (typically found at the location /etc/libnl/classid) and refreshes the classid maps.

Returns
  0 on success or a negative error code.

Definition at line 311 of file classid.c.

References rtnl_tc_str2handle().

Here is the call graph for this function:

## ◆ rtnl_classid_generate()

int rtnl_classid_generate | ( | const char * | name,
|  | uint32_t * | result,
|  | uint32_t | parent )

Definition at line 376 of file classid.c.