libnl  3.6.0
qdisc.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_QDISC_H_
7 #define NETLINK_QDISC_H_
8 
9 #include <netlink/netlink.h>
10 #include <netlink/cache.h>
11 #include <netlink/route/tc.h>
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 struct rtnl_qdisc;
18 
19 extern struct rtnl_qdisc *
20  rtnl_qdisc_alloc(void);
21 extern void rtnl_qdisc_put(struct rtnl_qdisc *);
22 
23 extern int rtnl_qdisc_alloc_cache(struct nl_sock *, struct nl_cache **);
24 
25 extern struct rtnl_qdisc *
26  rtnl_qdisc_get(struct nl_cache *, int, uint32_t);
27 
28 extern struct rtnl_qdisc *
29  rtnl_qdisc_get_by_parent(struct nl_cache *, int, uint32_t);
30 extern struct rtnl_qdisc *rtnl_qdisc_get_by_kind(struct nl_cache *cache,
31  int ifindex, char *kind);
32 
33 extern int rtnl_qdisc_build_add_request(struct rtnl_qdisc *, int,
34  struct nl_msg **);
35 extern int rtnl_qdisc_add(struct nl_sock *, struct rtnl_qdisc *, int);
36 
37 extern int rtnl_qdisc_build_update_request(struct rtnl_qdisc *,
38  struct rtnl_qdisc *,
39  int, struct nl_msg **);
40 
41 extern int rtnl_qdisc_update(struct nl_sock *, struct rtnl_qdisc *,
42  struct rtnl_qdisc *, int);
43 
44 extern int rtnl_qdisc_build_delete_request(struct rtnl_qdisc *,
45  struct nl_msg **);
46 extern int rtnl_qdisc_delete(struct nl_sock *, struct rtnl_qdisc *);
47 
48 /* Deprecated functions */
49 extern void rtnl_qdisc_foreach_child(struct rtnl_qdisc *, struct nl_cache *,
50  void (*cb)(struct nl_object *, void *),
51  void *) __attribute__ ((deprecated));
52 
53 extern void rtnl_qdisc_foreach_cls(struct rtnl_qdisc *, struct nl_cache *,
54  void (*cb)(struct nl_object *, void *),
55  void *) __attribute__ ((deprecated));
56 
57 extern int rtnl_qdisc_build_change_request(struct rtnl_qdisc *,
58  struct rtnl_qdisc *,
59  struct nl_msg **)
60  __attribute__ ((deprecated));
61 
62 extern int rtnl_qdisc_change(struct nl_sock *, struct rtnl_qdisc *,
63  struct rtnl_qdisc *) __attribute__ ((deprecated));
64 
65 #ifdef __cplusplus
66 }
67 #endif
68 
69 #endif
int rtnl_qdisc_alloc_cache(struct nl_sock *, struct nl_cache **)
Allocate a cache and fill it with all configured qdiscs.
Definition: qdisc.c:362
int rtnl_qdisc_delete(struct nl_sock *, struct rtnl_qdisc *)
Delete qdisc.
Definition: qdisc.c:334
int rtnl_qdisc_build_change_request(struct rtnl_qdisc *, struct rtnl_qdisc *, struct nl_msg **) __attribute__((deprecated))
Build a netlink message requesting the update of a qdisc.
Definition: qdisc.c:522
int rtnl_qdisc_build_delete_request(struct rtnl_qdisc *, struct nl_msg **)
Build netlink message requesting the deletion of a qdisc.
Definition: qdisc.c:267
struct rtnl_qdisc * rtnl_qdisc_get(struct nl_cache *, int, uint32_t)
Search qdisc by interface index and handle.
Definition: qdisc.c:445
struct rtnl_qdisc * rtnl_qdisc_get_by_kind(struct nl_cache *cache, int ifindex, char *kind)
Search qdisc by kind.
Definition: qdisc.c:413
int rtnl_qdisc_change(struct nl_sock *, struct rtnl_qdisc *, struct rtnl_qdisc *) __attribute__((deprecated))
Change attributes of a qdisc.
Definition: qdisc.c:537
void rtnl_qdisc_foreach_cls(struct rtnl_qdisc *, struct nl_cache *, void(*cb)(struct nl_object *, void *), void *) __attribute__((deprecated))
Call a callback for each filter attached to the qdisc (deprecated)
Definition: qdisc.c:500
struct rtnl_qdisc * rtnl_qdisc_get_by_parent(struct nl_cache *, int, uint32_t)
Search qdisc by interface index and parent.
Definition: qdisc.c:381
int rtnl_qdisc_build_add_request(struct rtnl_qdisc *, int, struct nl_msg **)
Build a netlink message requesting the addition of a qdisc.
Definition: qdisc.c:108
int rtnl_qdisc_update(struct nl_sock *, struct rtnl_qdisc *, struct rtnl_qdisc *, int)
Update qdisc.
Definition: qdisc.c:241
int rtnl_qdisc_add(struct nl_sock *, struct rtnl_qdisc *, int)
Add qdisc.
Definition: qdisc.c:156
void rtnl_qdisc_foreach_child(struct rtnl_qdisc *, struct nl_cache *, void(*cb)(struct nl_object *, void *), void *) __attribute__((deprecated))
Call a callback for each child class of a qdisc (deprecated)
Definition: qdisc.c:476
int rtnl_qdisc_build_update_request(struct rtnl_qdisc *, struct rtnl_qdisc *, int, struct nl_msg **)
Build netlink message requesting the update of a qdisc.
Definition: qdisc.c:182