libnl 3.7.0
prio.h
1/* SPDX-License-Identifier: LGPL-2.1-only */
2/*
3 * Copyright (c) 2003-2011 Thomas Graf <tgraf@suug.ch>
4 */
5
6#ifndef NETLINK_PRIO_H_
7#define NETLINK_PRIO_H_
8
9#include <netlink/netlink.h>
10#include <netlink/route/qdisc.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16/**
17 * @name Default Values
18 * @{
19 */
20
21/**
22 * Default number of bands.
23 * @ingroup prio
24 */
25#define QDISC_PRIO_DEFAULT_BANDS 3
26
27/**
28 * Default priority mapping.
29 * @ingroup prio
30 */
31#define QDISC_PRIO_DEFAULT_PRIOMAP \
32 { 1, 2, 2, 2, 1, 2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1 }
33
34/** @} */
35
36extern void rtnl_qdisc_prio_set_bands(struct rtnl_qdisc *, int);
37extern int rtnl_qdisc_prio_get_bands(struct rtnl_qdisc *);
38extern int rtnl_qdisc_prio_set_priomap(struct rtnl_qdisc *, uint8_t[], int);
39extern uint8_t *rtnl_qdisc_prio_get_priomap(struct rtnl_qdisc *);
40
41extern char * rtnl_prio2str(int, char *, size_t);
42extern int rtnl_str2prio(const char *);
43
44#ifdef __cplusplus
45}
46#endif
47
48#endif
int rtnl_qdisc_prio_get_bands(struct rtnl_qdisc *)
Get number of bands of PRIO qdisc.
Definition: prio.c:139
int rtnl_str2prio(const char *)
Convert character string to priority.
Definition: prio.c:245
int rtnl_qdisc_prio_set_priomap(struct rtnl_qdisc *, uint8_t[], int)
Set priomap of the PRIO qdisc.
Definition: prio.c:159
uint8_t * rtnl_qdisc_prio_get_priomap(struct rtnl_qdisc *)
Get priomap of a PRIO qdisc.
Definition: prio.c:191
char * rtnl_prio2str(int, char *, size_t)
Convert priority to character string.
Definition: prio.c:231
void rtnl_qdisc_prio_set_bands(struct rtnl_qdisc *, int)
Set number of bands of PRIO qdisc.
Definition: prio.c:123