libnl 1.1.4
qdisc.h
1/*
2 * netlink/route/qdisc.h Queueing Disciplines
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_QDISC_H_
13#define NETLINK_QDISC_H_
14
15#include <netlink/netlink.h>
16#include <netlink/cache.h>
17#include <netlink/route/tc.h>
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23struct rtnl_qdisc;
24
25extern struct nl_object_ops qdisc_obj_ops;
26
27/* General */
28extern struct rtnl_qdisc * rtnl_qdisc_alloc(void);
29extern void rtnl_qdisc_put(struct rtnl_qdisc *);
30
31/* Cache Management */
32extern struct nl_cache * rtnl_qdisc_alloc_cache(struct nl_handle *);
33extern struct rtnl_qdisc * rtnl_qdisc_get(struct nl_cache *,
34 int, uint32_t);
35extern struct rtnl_qdisc * rtnl_qdisc_get_by_parent(struct nl_cache *,
36 int, uint32_t);
37
38/* qdisc addition */
39extern struct nl_msg * rtnl_qdisc_build_add_request(struct rtnl_qdisc *, int);
40extern int rtnl_qdisc_add(struct nl_handle *, struct rtnl_qdisc *,
41 int);
42
43/* qdisc modification */
44extern struct nl_msg * rtnl_qdisc_build_change_request(struct rtnl_qdisc *,
45 struct rtnl_qdisc *);
46extern int rtnl_qdisc_change(struct nl_handle *,
47 struct rtnl_qdisc *,
48 struct rtnl_qdisc *);
49
50/* qdisc deletion */
51extern struct nl_msg * rtnl_qdisc_build_delete_request(struct rtnl_qdisc *);
52extern int rtnl_qdisc_delete(struct nl_handle *,
53 struct rtnl_qdisc *);
54
55/* attribute modifications */
56extern void rtnl_qdisc_set_ifindex(struct rtnl_qdisc *, int);
57extern int rtnl_qdisc_get_ifindex(struct rtnl_qdisc *);
58extern void rtnl_qdisc_set_handle(struct rtnl_qdisc *, uint32_t);
59extern uint32_t rtnl_qdisc_get_handle(struct rtnl_qdisc *);
60extern void rtnl_qdisc_set_parent(struct rtnl_qdisc *, uint32_t);
61extern uint32_t rtnl_qdisc_get_parent(struct rtnl_qdisc *);
62extern void rtnl_qdisc_set_kind(struct rtnl_qdisc *, const char *);
63extern char * rtnl_qdisc_get_kind(struct rtnl_qdisc *);
64extern uint64_t rtnl_qdisc_get_stat(struct rtnl_qdisc *,
65 enum rtnl_tc_stats_id);
66
67/* iterators */
68extern void rtnl_qdisc_foreach_child(struct rtnl_qdisc *,
69 struct nl_cache *,
70 void (*cb)(struct nl_object *,
71 void *),
72 void *);
73
74extern void rtnl_qdisc_foreach_cls(struct rtnl_qdisc *,
75 struct nl_cache *,
76 void (*cb)(struct nl_object *,
77 void *),
78 void *);
79
80/* qdisc specific options */
81extern struct nl_msg * rtnl_qdisc_get_opts(struct rtnl_qdisc *);
82
83#ifdef __cplusplus
84}
85#endif
86
87#endif
struct nl_msg * rtnl_qdisc_get_opts(struct rtnl_qdisc *)
Return qdisc specific options for use in TCA_OPTIONS.
Definition: qdisc_obj.c:248
void rtnl_qdisc_foreach_cls(struct rtnl_qdisc *, struct nl_cache *, void(*cb)(struct nl_object *, void *), void *)
Call a callback for each filter attached to the qdisc.
Definition: qdisc_obj.c:165
void rtnl_qdisc_foreach_child(struct rtnl_qdisc *, struct nl_cache *, void(*cb)(struct nl_object *, void *), void *)
Call a callback for each child class of a qdisc.
Definition: qdisc_obj.c:139
struct nl_msg * rtnl_qdisc_build_add_request(struct rtnl_qdisc *, int)
Build a netlink message to add a new qdisc.
Definition: qdisc.c:197
struct nl_msg * rtnl_qdisc_build_change_request(struct rtnl_qdisc *, struct rtnl_qdisc *)
Build a netlink message to change attributes of a existing qdisc.
Definition: qdisc.c:261
int rtnl_qdisc_add(struct nl_handle *, struct rtnl_qdisc *, int)
Add a new qdisc.
Definition: qdisc.c:224
struct nl_cache * rtnl_qdisc_alloc_cache(struct nl_handle *)
Build a qdisc cache including all qdiscs currently configured in the kernel.
Definition: qdisc.c:384
int rtnl_qdisc_change(struct nl_handle *, struct rtnl_qdisc *, struct rtnl_qdisc *)
Change attributes of a qdisc.
Definition: qdisc.c:279
int rtnl_qdisc_delete(struct nl_handle *, struct rtnl_qdisc *)
Delete a qdisc.
Definition: qdisc.c:348
struct rtnl_qdisc * rtnl_qdisc_get_by_parent(struct nl_cache *, int, uint32_t)
Look up qdisc by its parent in the provided cache.
Definition: qdisc.c:407
struct rtnl_qdisc * rtnl_qdisc_get(struct nl_cache *, int, uint32_t)
Look up qdisc by its handle in the provided cache.
Definition: qdisc.c:432
struct nl_msg * rtnl_qdisc_build_delete_request(struct rtnl_qdisc *)
Build a netlink request message to delete a qdisc.
Definition: qdisc.c:315
rtnl_tc_stats_id
TC statistics identifiers.
Definition: tc.h:27
Object Operations.
Definition: object-api.h:255