libnl 3.5.0

class.h
1 /*
2 * netlink/route/class.h Traffic Classes
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-2011 Thomas Graf <tgraf@suug.ch>
10 */
11
12 #ifndef NETLINK_CLASS_H_
13 #define NETLINK_CLASS_H_
14
15 #include <netlink/netlink.h>
16 #include <netlink/route/tc.h>
17 #include <netlink/route/qdisc.h>
18
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
23 struct rtnl_class;
24
25 extern struct rtnl_class *
26 rtnl_class_alloc(void);
27 extern void rtnl_class_put(struct rtnl_class *);
28
29 extern int rtnl_class_alloc_cache(struct nl_sock *, int,
30 struct nl_cache **);
31 extern struct rtnl_class *
32 rtnl_class_get(struct nl_cache *, int, uint32_t);
33
34 extern struct rtnl_class *
35 rtnl_class_get_by_parent(struct nl_cache *, int, uint32_t);
36
37 extern struct rtnl_qdisc *
38 rtnl_class_leaf_qdisc(struct rtnl_class *,
39 struct nl_cache *);
40
41 extern int rtnl_class_build_add_request(struct rtnl_class *, int,
42 struct nl_msg **);
43 extern int rtnl_class_add(struct nl_sock *, struct rtnl_class *,
44 int);
45
46 extern int rtnl_class_build_delete_request(struct rtnl_class *,
47 struct nl_msg **);
48 extern int rtnl_class_delete(struct nl_sock *,
49 struct rtnl_class *);
50
51 /* deprecated functions */
52 extern void rtnl_class_foreach_child(struct rtnl_class *,
53 struct nl_cache *,
54 void (*cb)(struct nl_object *,
55 void *),
56 void *)
57 __attribute__((deprecated));
58 extern void rtnl_class_foreach_cls(struct rtnl_class *,
59 struct nl_cache *,
60 void (*cb)(struct nl_object *,
61 void *),
62 void *)
63 __attribute__((deprecated));
64
65 #ifdef __cplusplus
66 }
67 #endif
68
69 #endif
rtnl_class_leaf_qdisc
struct rtnl_qdisc * rtnl_class_leaf_qdisc(struct rtnl_class *, struct nl_cache *)
Lookup the leaf qdisc of a traffic class.
Definition: class.c:278
rtnl_class_alloc_cache
int rtnl_class_alloc_cache(struct nl_sock *, int, struct nl_cache **)
Allocate a cache and fill it with all configured traffic classes.
Definition: class.c:313
rtnl_class_foreach_child
void rtnl_class_foreach_child(struct rtnl_class *, struct nl_cache *, void(*cb)(struct nl_object *, void *), void *) __attribute__((deprecated))
Call a callback for each child of a class.
Definition: class.c:416
rtnl_class_get
struct rtnl_class * rtnl_class_get(struct nl_cache *, int, uint32_t)
Search traffic class by interface index and handle.
Definition: class.c:354
rtnl_class_add
int rtnl_class_add(struct nl_sock *, struct rtnl_class *, int)
Add/Update traffic class.
Definition: class.c:172
rtnl_class_get_by_parent
struct rtnl_class * rtnl_class_get_by_parent(struct nl_cache *, int, uint32_t)
Search class by interface index and parent.
Definition: class.c:385
rtnl_class_build_delete_request
int rtnl_class_build_delete_request(struct rtnl_class *, struct nl_msg **)
Build netlink message requesting the deletion of a traffic class.
Definition: class.c:196
rtnl_class_delete
int rtnl_class_delete(struct nl_sock *, struct rtnl_class *)
Delete traffic class.
Definition: class.c:253
rtnl_class_build_add_request
int rtnl_class_build_add_request(struct rtnl_class *, int, struct nl_msg **)
Build a netlink message requesting the addition of a traffic class.
Definition: class.c:130
rtnl_class_foreach_cls
void rtnl_class_foreach_cls(struct rtnl_class *, struct nl_cache *, void(*cb)(struct nl_object *, void *), void *) __attribute__((deprecated))
Call a callback for each classifier attached to the class.
Definition: class.c:439