1 /* SPDX-License-Identifier: LGPL-2.1-only */ 2 /* 3 * Copyright (c) 2003-2011 Thomas Graf <[email protected]> 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 70