diff options
author | Thomas Graf <tgraf@suug.ch> | 2011-03-29 10:41:59 (GMT) |
---|---|---|
committer | Thomas Graf <tgraf@suug.ch> | 2011-03-29 10:41:59 (GMT) |
commit | 7c620500bbca24c3d18b731756c375a45bb0fcba (patch) | |
tree | f5a507f13dc3039bff8e5fabcf054fbbc9a3adde /include | |
parent | 747b892c91de7a852664f015405d6d37ea2b66b6 (diff) | |
download | libnl-7c620500bbca24c3d18b731756c375a45bb0fcba.zip libnl-7c620500bbca24c3d18b731756c375a45bb0fcba.tar.gz libnl-7c620500bbca24c3d18b731756c375a45bb0fcba.tar.bz2 |
trafic class/classifer API improvements and documentation
- removed dead functions in header files
- deprecated rtnl_class_foreach_*() functions due to their missing
handling possibility of OOM situations
- improved API documentation
Diffstat (limited to 'include')
-rw-r--r-- | include/netlink/route/class.h | 32 | ||||
-rw-r--r-- | include/netlink/route/classifier.h | 33 |
2 files changed, 35 insertions, 30 deletions
diff --git a/include/netlink/route/class.h b/include/netlink/route/class.h index ad3bacf..e73b60a 100644 --- a/include/netlink/route/class.h +++ b/include/netlink/route/class.h @@ -1,12 +1,12 @@ /* - * netlink/route/class.h Classes + * netlink/route/class.h Traffic Classes * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation version 2.1 * of the License. * - * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch> + * Copyright (c) 2003-2011 Thomas Graf <tgraf@suug.ch> */ #ifndef NETLINK_CLASS_H_ @@ -22,14 +22,17 @@ extern "C" { struct rtnl_class; -extern struct rtnl_class * rtnl_class_alloc(void); +extern struct rtnl_class * + rtnl_class_alloc(void); extern void rtnl_class_put(struct rtnl_class *); + extern int rtnl_class_alloc_cache(struct nl_sock *, int, struct nl_cache **); -extern struct rtnl_class *rtnl_class_get(struct nl_cache *, int, uint32_t); +extern struct rtnl_class * + rtnl_class_get(struct nl_cache *, int, uint32_t); -/* leaf qdisc access */ -extern struct rtnl_qdisc * rtnl_class_leaf_qdisc(struct rtnl_class *, +extern struct rtnl_qdisc * + rtnl_class_leaf_qdisc(struct rtnl_class *, struct nl_cache *); extern int rtnl_class_build_add_request(struct rtnl_class *, int, @@ -37,23 +40,24 @@ extern int rtnl_class_build_add_request(struct rtnl_class *, int, extern int rtnl_class_add(struct nl_sock *, struct rtnl_class *, int); -extern int rtnl_class_build_delete_request(struct rtnl_class *, - struct nl_msg **); -extern int rtnl_class_delete(struct nl_sock *, struct rtnl_class *); - -extern void rtnl_class_set_kind(struct rtnl_class *, const char *); +extern int rtnl_class_build_delete_request(struct rtnl_class *, + struct nl_msg **); +extern int rtnl_class_delete(struct nl_sock *, + struct rtnl_class *); -/* iterators */ +/* deprecated functions */ extern void rtnl_class_foreach_child(struct rtnl_class *, struct nl_cache *, void (*cb)(struct nl_object *, void *), - void *); + void *) + __attribute__((deprecated)); extern void rtnl_class_foreach_cls(struct rtnl_class *, struct nl_cache *, void (*cb)(struct nl_object *, void *), - void *); + void *) + __attribute__((deprecated)); #ifdef __cplusplus } diff --git a/include/netlink/route/classifier.h b/include/netlink/route/classifier.h index 23af837..647bf1e 100644 --- a/include/netlink/route/classifier.h +++ b/include/netlink/route/classifier.h @@ -6,7 +6,7 @@ * License as published by the Free Software Foundation version 2.1 * of the License. * - * Copyright (c) 2003-2010 Thomas Graf <tgraf@suug.ch> + * Copyright (c) 2003-2011 Thomas Graf <tgraf@suug.ch> */ #ifndef NETLINK_CLASSIFIER_H_ @@ -22,26 +22,27 @@ extern "C" { #endif extern struct rtnl_cls *rtnl_cls_alloc(void); -extern void rtnl_cls_put(struct rtnl_cls *); +extern void rtnl_cls_put(struct rtnl_cls *); -extern int rtnl_cls_alloc_cache(struct nl_sock *, int, uint32_t, - struct nl_cache **); +extern int rtnl_cls_alloc_cache(struct nl_sock *, int, uint32_t, + struct nl_cache **); -extern int rtnl_cls_build_add_request(struct rtnl_cls *, int, - struct nl_msg **); -extern int rtnl_cls_add(struct nl_sock *, struct rtnl_cls *, int); +extern int rtnl_cls_build_add_request(struct rtnl_cls *, int, + struct nl_msg **); +extern int rtnl_cls_add(struct nl_sock *, struct rtnl_cls *, int); -extern int rtnl_cls_build_change_request(struct rtnl_cls *, int, - struct nl_msg **); -extern int rtnl_cls_build_delete_request(struct rtnl_cls *, int, - struct nl_msg **); -extern int rtnl_cls_delete(struct nl_sock *, struct rtnl_cls *, int); +extern int rtnl_cls_build_change_request(struct rtnl_cls *, int, + struct nl_msg **); +extern int rtnl_cls_build_delete_request(struct rtnl_cls *, int, + struct nl_msg **); +extern int rtnl_cls_delete(struct nl_sock *, struct rtnl_cls *, + int); -extern void rtnl_cls_set_prio(struct rtnl_cls *, uint16_t); -extern uint16_t rtnl_cls_get_prio(struct rtnl_cls *); +extern void rtnl_cls_set_prio(struct rtnl_cls *, uint16_t); +extern uint16_t rtnl_cls_get_prio(struct rtnl_cls *); -extern void rtnl_cls_set_protocol(struct rtnl_cls *, uint16_t); -extern uint16_t rtnl_cls_get_protocol(struct rtnl_cls *); +extern void rtnl_cls_set_protocol(struct rtnl_cls *, uint16_t); +extern uint16_t rtnl_cls_get_protocol(struct rtnl_cls *); #ifdef __cplusplus } |