libnl  1.1.4
prio.h
1 /*
2  * netlink/route/sch/prio.c PRIO Qdisc
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation version 2.1
7  * of the License.
8  *
9  * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch>
10  */
11 
12 #ifndef NETLINK_PRIO_H_
13 #define NETLINK_PRIO_H_
14 
15 #include <netlink/netlink.h>
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 /**
22  * @name Default Values
23  * @{
24  */
25 
26 /**
27  * Default number of bands.
28  * @ingroup prio
29  */
30 #define QDISC_PRIO_DEFAULT_BANDS 3
31 
32 /**
33  * Default priority mapping.
34  * @ingroup prio
35  */
36 #define QDISC_PRIO_DEFAULT_PRIOMAP \
37  { 1, 2, 2, 2, 1, 2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1 }
38 
39 /** @} */
40 
41 extern int rtnl_qdisc_prio_set_bands(struct rtnl_qdisc *, int);
42 extern int rtnl_qdisc_prio_get_bands(struct rtnl_qdisc *);
43 extern int rtnl_qdisc_prio_set_priomap(struct rtnl_qdisc *, uint8_t[], int);
44 extern uint8_t *rtnl_qdisc_prio_get_priomap(struct rtnl_qdisc *);
45 
46 extern char * rtnl_prio2str(int, char *, size_t);
47 extern int rtnl_str2prio(const char *);
48 
49 #ifdef __cplusplus
50 }
51 #endif
52 
53 #endif
char * rtnl_prio2str(int, char *, size_t)
Convert priority to character string.
Definition: prio.c:281
int rtnl_qdisc_prio_get_bands(struct rtnl_qdisc *)
Get number of bands of PRIO qdisc.
Definition: prio.c:189
int rtnl_str2prio(const char *)
Convert character string to priority.
Definition: prio.c:295
int rtnl_qdisc_prio_set_bands(struct rtnl_qdisc *, int)
Set number of bands of PRIO qdisc.
Definition: prio.c:170
int rtnl_qdisc_prio_set_priomap(struct rtnl_qdisc *, uint8_t[], int)
Set priomap of the PRIO qdisc.
Definition: prio.c:207
uint8_t * rtnl_qdisc_prio_get_priomap(struct rtnl_qdisc *)
Get priomap of a PRIO qdisc.
Definition: prio.c:241