libnl 1.1.4
Modules

Modules

 Blackhole
 
 Class Based Queueing (CBQ)
 
 Differentiated Services Marker (DSMARK)
 
 Packet/Bytes FIFO (pfifo/bfifo)
 The FIFO qdisc comes in two flavours:
 
 Hierachical Token Bucket (HTB)
 
 Network Emulator
 For further documentation see http://linux-net.osdl.org/index.php/Netem.
 
 (Fast) Prio
 
 Random Early Detection (RED)
 
 Stochastic Fairness Queueing (SFQ)
 
 Token Bucket Filter (TBF)
 

Module API

int rtnl_qdisc_register (struct rtnl_qdisc_ops *qops)
 Register a qdisc module.
 
int rtnl_qdisc_unregister (struct rtnl_qdisc_ops *qops)
 Unregister a qdisc module.
 
struct rtnl_qdisc_ops__rtnl_qdisc_lookup_ops (const char *kind)
 
struct rtnl_qdisc_opsrtnl_qdisc_lookup_ops (struct rtnl_qdisc *qdisc)
 

Detailed Description

Function Documentation

◆ rtnl_qdisc_register()

int rtnl_qdisc_register ( struct rtnl_qdisc_ops qops)
Parameters
qopsqdisc module operations

Definition at line 40 of file qdisc_api.c.

41{
42 struct rtnl_qdisc_ops *o, **op;
43
44 if (!qops->qo_kind[0])
45 BUG();
46
47 for (op = &qdisc_ops_list; (o = *op) != NULL; op = &o->qo_next)
48 if (!strcasecmp(qops->qo_kind, o->qo_kind))
49 return nl_errno(EEXIST);
50
51 qops->qo_next = NULL;
52 *op = qops;
53
54 return 0;
55}
Qdisc Operations.
Definition: qdisc-modules.h:26
struct rtnl_qdisc_ops * qo_next
INTERNAL (Do not use)
Definition: qdisc-modules.h:61
char qo_kind[32]
Kind/Name of Qdisc.
Definition: qdisc-modules.h:30

References rtnl_qdisc_ops::qo_kind, and rtnl_qdisc_ops::qo_next.

◆ rtnl_qdisc_unregister()

int rtnl_qdisc_unregister ( struct rtnl_qdisc_ops qops)
Parameters
qopsqdisc module operations

Definition at line 61 of file qdisc_api.c.

62{
63 struct rtnl_qdisc_ops *o, **op;
64
65 for (op = &qdisc_ops_list; (o = *op) != NULL; op = &o->qo_next)
66 if (!strcasecmp(qops->qo_kind, o->qo_kind))
67 break;
68
69 if (!o)
70 return nl_errno(ENOENT);
71
72 *op = qops->qo_next;
73
74 return 0;
75}

References rtnl_qdisc_ops::qo_kind, and rtnl_qdisc_ops::qo_next.

◆ __rtnl_qdisc_lookup_ops()

struct rtnl_qdisc_ops * __rtnl_qdisc_lookup_ops ( const char *  kind)

Definition at line 77 of file qdisc_api.c.

78{
79 struct rtnl_qdisc_ops *qops;
80
81 for (qops = qdisc_ops_list; qops; qops = qops->qo_next)
82 if (!strcmp(kind, qops->qo_kind))
83 return qops;
84
85 return NULL;
86}

◆ rtnl_qdisc_lookup_ops()

struct rtnl_qdisc_ops * rtnl_qdisc_lookup_ops ( struct rtnl_qdisc *  qdisc)

Definition at line 88 of file qdisc_api.c.

89{
90 if (!qdisc->q_ops)
91 qdisc->q_ops = __rtnl_qdisc_lookup_ops(qdisc->q_kind);
92
93 return qdisc->q_ops;
94}