libnl: Hierachical Token Bucket (HTB)

libnl 3.12.0

Hierachical Token Bucket (HTB)
Routing Library (libnl-route) » Traffic Control » Queueing Disciplines | Routing Library (libnl-route) » Traffic Control » Traffic Classes

## Attribute Modifications
uint32_t | rtnl_htb_get_rate2quantum (struct rtnl_qdisc *qdisc)
| Return rate/quantum ratio of HTB qdisc.
int | rtnl_htb_set_rate2quantum (struct rtnl_qdisc *qdisc, uint32_t rate2quantum)
uint32_t | rtnl_htb_get_defcls (struct rtnl_qdisc *qdisc)
| Return default class of HTB qdisc.
int | rtnl_htb_set_defcls (struct rtnl_qdisc *qdisc, uint32_t defcls)
| Set default class of the htb qdisc to the specified value.
uint32_t | rtnl_htb_get_prio (struct rtnl_class *class)
int | rtnl_htb_set_prio (struct rtnl_class *class, uint32_t prio)
uint32_t | rtnl_htb_get_rate (struct rtnl_class *class)
| Return rate of HTB class.
int | rtnl_htb_get_rate64 (struct rtnl_class *class, uint64_t *out_rate64)
| Return rate of HTB class.
int | rtnl_htb_set_rate (struct rtnl_class *class, uint32_t rate)
| Set rate of HTB class.
int | rtnl_htb_set_rate64 (struct rtnl_class *class, uint64_t rate)
| Set rate of HTB class.
uint32_t | rtnl_htb_get_ceil (struct rtnl_class *class)
| Return ceil rate of HTB class.
int | rtnl_htb_get_ceil64 (struct rtnl_class *class, uint64_t *out_ceil64)
| Return ceil rate of HTB class.
int | rtnl_htb_set_ceil (struct rtnl_class *class, uint32_t ceil)
| Set ceil rate of HTB class.
int | rtnl_htb_set_ceil64 (struct rtnl_class *class, uint64_t ceil64)
| Set ceil rate of HTB class.
uint32_t | rtnl_htb_get_rbuffer (struct rtnl_class *class)
| Return burst buffer size of HTB class.
int | rtnl_htb_set_rbuffer (struct rtnl_class *class, uint32_t rbuffer)
| Set size of the rate bucket of HTB class.
uint32_t | rtnl_htb_get_cbuffer (struct rtnl_class *class)
| Return ceil burst buffer size of HTB class.
int | rtnl_htb_set_cbuffer (struct rtnl_class *class, uint32_t cbuffer)
| Set size of the ceil bucket of HTB class.
uint32_t | rtnl_htb_get_quantum (struct rtnl_class *class)
| Return quantum of HTB class.
int | rtnl_htb_set_quantum (struct rtnl_class *class, uint32_t quantum)
| Set quantum of HTB class (overwrites value calculated based on r2q)
int | rtnl_htb_get_level (struct rtnl_class *class)
| Return level of HTB class.
int | rtnl_htb_set_level (struct rtnl_class *class, int level)
| Set level of HTB class.

## Detailed Description

## Function Documentation

## ◆ rtnl_htb_get_rate2quantum()

uint32_t rtnl_htb_get_rate2quantum | ( | struct rtnl_qdisc * | qdisc | ) |

Return rate/quantum ratio of HTB qdisc.

Parameters

  qdisc | htb qdisc object

Returns
  rate/quantum ratio or 0 if unspecified

Definition at line 323 of file htb.c.

## ◆ rtnl_htb_set_rate2quantum()

int rtnl_htb_set_rate2quantum | ( | struct rtnl_qdisc * | qdisc,
|  | uint32_t | rate2quantum )

Definition at line 334 of file htb.c.

## ◆ rtnl_htb_get_defcls()

uint32_t rtnl_htb_get_defcls | ( | struct rtnl_qdisc * | qdisc | ) |

Return default class of HTB qdisc.

Parameters

  qdisc | htb qdisc object

Returns the classid of the class where all unclassified traffic goes to.

Returns
  classid or TC_H_UNSPEC if unspecified.

Definition at line 357 of file htb.c.

## ◆ rtnl_htb_set_defcls()

int rtnl_htb_set_defcls | ( | struct rtnl_qdisc * | qdisc,
|  | uint32_t | defcls )

Set default class of the htb qdisc to the specified value.

Parameters

  qdisc | qdisc to change
  defcls | new default class

Definition at line 373 of file htb.c.

## ◆ rtnl_htb_get_prio()

uint32_t rtnl_htb_get_prio | ( | struct rtnl_class * | class | ) |

Definition at line 387 of file htb.c.

## ◆ rtnl_htb_set_prio()

int rtnl_htb_set_prio | ( | struct rtnl_class * | class,
|  | uint32_t | prio )

Definition at line 398 of file htb.c.

## ◆ rtnl_htb_get_rate()

uint32_t rtnl_htb_get_rate | ( | struct rtnl_class * | class | ) |

Return rate of HTB class.

Parameters

  class | htb class object

Returns
  Rate in bytes/s or 0 if unspecified. If the value cannot be represented as 32 bit integer, (1<<32) is returned. Use rtnl_htb_get_rate64() instead.

Definition at line 420 of file htb.c.

## ◆ rtnl_htb_get_rate64()

int rtnl_htb_get_rate64 | ( | struct rtnl_class * | class,
|  | uint64_t * | out_rate64 )

Return rate of HTB class.

Parameters

  class | htb class object
  out_rate64 | on success, the set rate.

Returns
  0 on success or a negative error code.

Definition at line 441 of file htb.c.

## ◆ rtnl_htb_set_rate()

int rtnl_htb_set_rate | ( | struct rtnl_class * | class,
|  | uint32_t | rate )

Set rate of HTB class.

Parameters

  class | htb class object
  rate | new rate in bytes per second

Returns
  0 on success or a negative error code.

Definition at line 461 of file htb.c.

References rtnl_htb_set_rate64().

Here is the call graph for this function:

## ◆ rtnl_htb_set_rate64()

int rtnl_htb_set_rate64 | ( | struct rtnl_class * | class,
|  | uint64_t | rate )

Set rate of HTB class.

Parameters

  class | htb class object
  rate | new rate in bytes per second

Returns
  0 on success or a negative error code.

Definition at line 473 of file htb.c.

Referenced by rtnl_htb_set_rate().

Here is the caller graph for this function:

## ◆ rtnl_htb_get_ceil()

uint32_t rtnl_htb_get_ceil | ( | struct rtnl_class * | class | ) |

Return ceil rate of HTB class.

Parameters

  class | htb class object

Returns
  Ceil rate in bytes/s or 0 if unspecified. If the value cannot be represented as 32 bit integer, (1<<32) is returned. Use rtnl_htb_get_ceil64() instead.

Definition at line 496 of file htb.c.

## ◆ rtnl_htb_get_ceil64()

int rtnl_htb_get_ceil64 | ( | struct rtnl_class * | class,
|  | uint64_t * | out_ceil64 )

Return ceil rate of HTB class.

Parameters

  class | htb class object
  out_ceil64 | on success, the set ceil value.

Returns
  0 on success or a negative error code.

Definition at line 517 of file htb.c.

## ◆ rtnl_htb_set_ceil()

int rtnl_htb_set_ceil | ( | struct rtnl_class * | class,
|  | uint32_t | ceil )

Set ceil rate of HTB class.

Parameters

  class | htb class object
  ceil | new ceil rate number of bytes per second

Returns
  0 on success or a negative error code.

Definition at line 537 of file htb.c.

References rtnl_htb_set_ceil64().

Here is the call graph for this function:

## ◆ rtnl_htb_set_ceil64()

int rtnl_htb_set_ceil64 | ( | struct rtnl_class * | class,
|  | uint64_t | ceil64 )

Set ceil rate of HTB class.

Parameters

  class | htb class object
  ceil64 | new ceil rate number of bytes per second

Returns
  0 on success or a negative error code.

Definition at line 549 of file htb.c.

Referenced by rtnl_htb_set_ceil().

Here is the caller graph for this function:

## ◆ rtnl_htb_get_rbuffer()

uint32_t rtnl_htb_get_rbuffer | ( | struct rtnl_class * | class | ) |

Return burst buffer size of HTB class.

Parameters

  class | htb class object

Returns
  Burst buffer size or 0 if unspecified

Definition at line 570 of file htb.c.

## ◆ rtnl_htb_set_rbuffer()

int rtnl_htb_set_rbuffer | ( | struct rtnl_class * | class,
|  | uint32_t | rbuffer )

Set size of the rate bucket of HTB class.

Parameters

  class | HTB class to be modified.
  rbuffer | New size in bytes.

Definition at line 586 of file htb.c.

## ◆ rtnl_htb_get_cbuffer()

uint32_t rtnl_htb_get_cbuffer | ( | struct rtnl_class * | class | ) |

Return ceil burst buffer size of HTB class.

Parameters

  class | htb class object

Returns
  Ceil burst buffer size or 0 if unspecified

Definition at line 606 of file htb.c.

## ◆ rtnl_htb_set_cbuffer()

int rtnl_htb_set_cbuffer | ( | struct rtnl_class * | class,
|  | uint32_t | cbuffer )

Set size of the ceil bucket of HTB class.

Parameters

  class | HTB class to be modified.
  cbuffer | New size in bytes.

Definition at line 622 of file htb.c.

## ◆ rtnl_htb_get_quantum()

uint32_t rtnl_htb_get_quantum | ( | struct rtnl_class * | class | ) |

Return quantum of HTB class.

Parameters

  class | htb class object

See XXX[quantum def]

Returns
  Quantum or 0 if unspecified.

Definition at line 644 of file htb.c.

## ◆ rtnl_htb_set_quantum()

int rtnl_htb_set_quantum | ( | struct rtnl_class * | class,
|  | uint32_t | quantum )

Set quantum of HTB class (overwrites value calculated based on r2q)

Parameters

  class | htb class object
  quantum | new quantum in number of bytes

See XXX[quantum def]

Returns
  0 on success or a negative error code.

Definition at line 664 of file htb.c.

## ◆ rtnl_htb_get_level()

int rtnl_htb_get_level | ( | struct rtnl_class * | class | ) |

Return level of HTB class.

Parameters

  class | htb class object

Returns the level of the HTB class. Leaf classes are assigned level 0, root classes have level (TC_HTB_MAXDEPTH - 1). Interior classes have a level of one less than their parent.

Returns
  Level or a negative error code.

Definition at line 688 of file htb.c.

## ◆ rtnl_htb_set_level()

int rtnl_htb_set_level | ( | struct rtnl_class * | class,
|  | int | level )

Set level of HTB class.

Parameters

  class | htb class object
  level | new level of HTB class

Sets the level of a HTB class. Note that changing the level of a HTB class does not change the level of its in kernel counterpart. This function is provided only to create HTB objects which can be compared against or filtered upon.

Returns
  0 on success or a negative error code.

Definition at line 712 of file htb.c.