/build/buildd/libnl-1.0~pre6/include/netlink/route/class.h

00001 /*
00002  * netlink/route/class.h       Classes
00003  *
00004  *      This library is free software; you can redistribute it and/or
00005  *      modify it under the terms of the GNU Lesser General Public
00006  *      License as published by the Free Software Foundation version 2.1
00007  *      of the License.
00008  *
00009  * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch>
00010  */
00011 
00012 #ifndef NETLINK_CLASS_H_
00013 #define NETLINK_CLASS_H_
00014 
00015 #include <netlink/netlink.h>
00016 #include <netlink/route/tc.h>
00017 #include <netlink/route/qdisc.h>
00018 
00019 struct rtnl_class;
00020 
00021 /* General */
00022 extern struct rtnl_class *      rtnl_class_alloc(void);
00023 extern void                     rtnl_class_put(struct rtnl_class *);
00024 extern void                     rtnl_class_free(struct rtnl_class *);
00025 extern struct nl_cache *        rtnl_class_alloc_cache(struct nl_handle *, int);
00026 
00027 /* leaf qdisc access */
00028 extern int                      rtnl_class_has_leaf_qdisc(struct rtnl_class *);
00029 extern struct rtnl_qdisc *      rtnl_class_leaf_qdisc(struct rtnl_class *,
00030                                                       struct nl_cache *);
00031 
00032 /* class addition */
00033 extern struct nl_msg * rtnl_class_build_add_request(struct rtnl_class *, int);
00034 extern int rtnl_class_add(struct nl_handle *, struct rtnl_class *, int);
00035 
00036 /* attribute modification */
00037 extern void             rtnl_class_set_ifindex(struct rtnl_class *, int);
00038 extern int              rtnl_class_get_ifindex(struct rtnl_class *);
00039 extern void             rtnl_class_set_handle(struct rtnl_class *, uint32_t);
00040 extern uint32_t         rtnl_class_get_handle(struct rtnl_class *);
00041 extern void             rtnl_class_set_parent(struct rtnl_class *, uint32_t);
00042 extern uint32_t         rtnl_class_get_parent(struct rtnl_class *);
00043 extern void             rtnl_class_set_kind(struct rtnl_class *, const char *);
00044 extern char *           rtnl_class_get_kind(struct rtnl_class *);
00045 extern uint64_t         rtnl_class_get_stat(struct rtnl_class *,
00046                                             enum rtnl_tc_stats_id);
00047 
00048 /* iterators */
00049 extern void             rtnl_class_foreach_child(struct rtnl_class *,
00050                                                  struct nl_cache *,
00051                                                  void (*cb)(struct nl_object *,
00052                                                             void *),
00053                                                  void *);
00054 extern void             rtnl_class_foreach_cls(struct rtnl_class *,
00055                                                struct nl_cache *,
00056                                                void (*cb)(struct nl_object *,
00057                                                           void *),
00058                                                void *);
00059 
00060 #endif

Generated on Fri Apr 27 14:14:07 2007 for libnl by  doxygen 1.5.1