qdisc.h revision 8a3efffa5b3fde252675239914118664d36a2c24
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-2008 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 27extern struct rtnl_qdisc *rtnl_qdisc_alloc(void); 28extern void rtnl_qdisc_put(struct rtnl_qdisc *); 29 30extern int rtnl_qdisc_alloc_cache(struct nl_handle *, struct nl_cache **); 31extern struct rtnl_qdisc *rtnl_qdisc_get(struct nl_cache *, int, uint32_t); 32extern struct rtnl_qdisc *rtnl_qdisc_get_by_parent(struct nl_cache *, 33 int, uint32_t); 34 35extern int rtnl_qdisc_build_add_request(struct rtnl_qdisc *, int, 36 struct nl_msg **); 37extern int rtnl_qdisc_add(struct nl_handle *, struct rtnl_qdisc *, int); 38 39extern int rtnl_qdisc_build_change_request(struct rtnl_qdisc *, 40 struct rtnl_qdisc *, 41 struct nl_msg **); 42extern int rtnl_qdisc_change(struct nl_handle *, struct rtnl_qdisc *, 43 struct rtnl_qdisc *); 44 45extern int rtnl_qdisc_build_delete_request(struct rtnl_qdisc *, 46 struct nl_msg **); 47extern int rtnl_qdisc_delete(struct nl_handle *, struct rtnl_qdisc *); 48 49extern void rtnl_qdisc_set_ifindex(struct rtnl_qdisc *, int); 50extern int rtnl_qdisc_get_ifindex(struct rtnl_qdisc *); 51extern void rtnl_qdisc_set_handle(struct rtnl_qdisc *, uint32_t); 52extern uint32_t rtnl_qdisc_get_handle(struct rtnl_qdisc *); 53extern void rtnl_qdisc_set_parent(struct rtnl_qdisc *, uint32_t); 54extern uint32_t rtnl_qdisc_get_parent(struct rtnl_qdisc *); 55extern void rtnl_qdisc_set_kind(struct rtnl_qdisc *, const char *); 56extern char * rtnl_qdisc_get_kind(struct rtnl_qdisc *); 57extern uint64_t rtnl_qdisc_get_stat(struct rtnl_qdisc *, enum rtnl_tc_stats_id); 58 59extern void rtnl_qdisc_foreach_child(struct rtnl_qdisc *, struct nl_cache *, 60 void (*cb)(struct nl_object *, void *), 61 void *); 62 63extern void rtnl_qdisc_foreach_cls(struct rtnl_qdisc *, struct nl_cache *, 64 void (*cb)(struct nl_object *, void *), 65 void *); 66 67extern struct nl_msg * rtnl_qdisc_get_opts(struct rtnl_qdisc *); 68 69#ifdef __cplusplus 70} 71#endif 72 73#endif 74