netfilter
firewalling, NAT, and packet mangling for linux
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Collaboration diagram for (Fast) Prio:

Default Values

#define QDISC_PRIO_DEFAULT_BANDS   3
 Default number of bands. More...
 
#define QDISC_PRIO_DEFAULT_PRIOMAP   { 1, 2, 2, 2, 1, 2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1 }
 Default priority mapping. More...
 

Attribute Modification

int rtnl_qdisc_prio_set_bands (struct rtnl_qdisc *qdisc, int bands)
 Set number of bands of PRIO qdisc. More...
 
int rtnl_qdisc_prio_get_bands (struct rtnl_qdisc *qdisc)
 Get number of bands of PRIO qdisc. More...
 
int rtnl_qdisc_prio_set_priomap (struct rtnl_qdisc *qdisc, uint8_t priomap[], int len)
 Set priomap of the PRIO qdisc. More...
 
uint8_t * rtnl_qdisc_prio_get_priomap (struct rtnl_qdisc *qdisc)
 Get priomap of a PRIO qdisc. More...
 

Priority Band Translations

char * rtnl_prio2str (int prio, char *buf, size_t size)
 Convert priority to character string. More...
 
int rtnl_str2prio (const char *name)
 Convert character string to priority. More...
 

Detailed Description

1) Typical PRIO configuration
// Specify the maximal number of bands to be used for this PRIO qdisc.
// Provide a map assigning each priority to a band number.
rtnl_qdisc_prio_set_priomap(qdisc, map, sizeof(map));

Macro Definition Documentation

#define QDISC_PRIO_DEFAULT_BANDS   3

Default number of bands.

#define QDISC_PRIO_DEFAULT_PRIOMAP   { 1, 2, 2, 2, 1, 2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1 }

Default priority mapping.

Function Documentation

char* rtnl_prio2str ( int  prio,
char *  buf,
size_t  size 
)

Convert priority to character string.

  • prio Priority.
  • buf Destination buffer
  • size Size of destination buffer.

Converts a priority to a character string and stores the result in the specified destination buffer.

Returns
Name of priority as character string.

References __type2str(), and ARRAY_SIZE.

Here is the call graph for this function:

int rtnl_qdisc_prio_get_bands ( struct rtnl_qdisc qdisc)

Get number of bands of PRIO qdisc.

  • qdisc PRIO qdisc.
    Returns
    Number of bands or a negative error code.

References NLE_NOMEM, rtnl_prio::qp_bands, and rtnl_prio::qp_mask.

uint8_t* rtnl_qdisc_prio_get_priomap ( struct rtnl_qdisc qdisc)

Get priomap of a PRIO qdisc.

  • qdisc PRIO qdisc.
    Returns
    Priority mapping as array of size TC_PRIO_MAX+1 or NULL if an error occured.

References NULL, rtnl_prio::qp_mask, and rtnl_prio::qp_priomap.

int rtnl_qdisc_prio_set_bands ( struct rtnl_qdisc qdisc,
int  bands 
)

Set number of bands of PRIO qdisc.

  • qdisc PRIO qdisc to be modified.
  • bands New number of bands.
    Returns
    0 on success or a negative error code.

References NLE_NOMEM, rtnl_prio::qp_bands, and rtnl_prio::qp_mask.

int rtnl_qdisc_prio_set_priomap ( struct rtnl_qdisc qdisc,
uint8_t  priomap[],
int  len 
)

Set priomap of the PRIO qdisc.

  • qdisc PRIO qdisc to be modified.
  • priomap New priority mapping.
  • len Length of priomap (# of elements).
    Returns
    0 on success or a negative error code.

References NLE_MISSING_ATTR, NLE_NOMEM, NLE_RANGE, rtnl_prio::qp_bands, rtnl_prio::qp_mask, rtnl_prio::qp_priomap, and TC_PRIO_MAX.

int rtnl_str2prio ( const char *  name)

Convert character string to priority.

  • name Name of priority.

Converts the provided character string specifying a priority to the corresponding numeric value.

Returns
Numeric priority or a negative value if no match was found.

References __str2type(), and ARRAY_SIZE.

Here is the call graph for this function: