libnl 3.7.0

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

Attribute Modification

void 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...
 

Detailed Description

1) Typical PRIO configuration
// Specify the maximal number of bands to be used for this PRIO qdisc.
rtnl_qdisc_prio_set_bands(qdisc, QDISC_PRIO_DEFAULT_BANDS);
// Provide a map assigning each priority to a band number.
uint8_t map[] = QDISC_PRIO_DEFAULT_PRIOMAP;
rtnl_qdisc_prio_set_priomap(qdisc, map, sizeof(map));
int rtnl_qdisc_prio_set_priomap(struct rtnl_qdisc *qdisc, uint8_t priomap[], int len)
Set priomap of the PRIO qdisc.
Definition: prio.c:159
void rtnl_qdisc_prio_set_bands(struct rtnl_qdisc *qdisc, int bands)
Set number of bands of PRIO qdisc.
Definition: prio.c:123

Function Documentation

◆ rtnl_qdisc_prio_set_bands()

void rtnl_qdisc_prio_set_bands ( struct rtnl_qdisc *  qdisc,
int  bands 
)

Set number of bands of PRIO qdisc.

Parameters
qdiscPRIO qdisc to be modified.
bandsNew number of bands.
Returns
0 on success or a negative error code.

Definition at line 123 of file prio.c.

References rtnl_tc_data(), and TC_CAST.

+ Here is the call graph for this function:

◆ rtnl_qdisc_prio_get_bands()

int rtnl_qdisc_prio_get_bands ( struct rtnl_qdisc *  qdisc)

Get number of bands of PRIO qdisc.

Parameters
qdiscPRIO qdisc.
Returns
Number of bands or a negative error code.

Definition at line 139 of file prio.c.

References rtnl_tc_data(), and TC_CAST.

+ Here is the call graph for this function:

◆ rtnl_qdisc_prio_set_priomap()

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

Set priomap of the PRIO qdisc.

Parameters
qdiscPRIO qdisc to be modified.
priomapNew priority mapping.
lenLength of priomap (# of elements).
Returns
0 on success or a negative error code.

Definition at line 159 of file prio.c.

References rtnl_tc_data(), and TC_CAST.

+ Here is the call graph for this function:

◆ rtnl_qdisc_prio_get_priomap()

uint8_t * rtnl_qdisc_prio_get_priomap ( struct rtnl_qdisc *  qdisc)

Get priomap of a PRIO qdisc.

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

Definition at line 191 of file prio.c.

References rtnl_tc_data(), and TC_CAST.

+ Here is the call graph for this function:

◆ rtnl_prio2str()

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

Convert priority to character string.

Parameters
prioPriority.
bufDestination buffer
sizeSize 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.

Definition at line 231 of file prio.c.

◆ rtnl_str2prio()

int rtnl_str2prio ( const char *  name)

Convert character string to priority.

Parameters
nameName 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.

Definition at line 245 of file prio.c.