00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef NETLINK_CLASSIFIER_H_
00013 #define NETLINK_CLASSIFIER_H_
00014
00015 #include <netlink/netlink.h>
00016 #include <netlink/cache.h>
00017 #include <netlink/route/tc.h>
00018 #include <netlink/utils.h>
00019
00020 #ifdef __cplusplus
00021 extern "C" {
00022 #endif
00023
00024 extern struct nl_object_ops cls_obj_ops;
00025
00026 extern struct rtnl_cls *rtnl_cls_alloc(void);
00027 extern void rtnl_cls_put(struct rtnl_cls *);
00028
00029 extern int rtnl_cls_alloc_cache(struct nl_sock *, int, uint32_t,
00030 struct nl_cache **);
00031
00032 extern int rtnl_cls_build_add_request(struct rtnl_cls *, int,
00033 struct nl_msg **);
00034 extern int rtnl_cls_add(struct nl_sock *, struct rtnl_cls *, int);
00035
00036 extern int rtnl_cls_build_change_request(struct rtnl_cls *, int,
00037 struct nl_msg **);
00038 extern int rtnl_cls_build_delete_request(struct rtnl_cls *, int,
00039 struct nl_msg **);
00040 extern int rtnl_cls_delete(struct nl_sock *, struct rtnl_cls *, int);
00041
00042 extern void rtnl_cls_set_ifindex(struct rtnl_cls *, int);
00043 extern int rtnl_cls_get_ifindex(struct rtnl_cls *);
00044 extern void rtnl_cls_set_handle(struct rtnl_cls *, uint32_t);
00045 extern void rtnl_cls_set_parent(struct rtnl_cls *, uint32_t);
00046 extern uint32_t rtnl_cls_get_parent(struct rtnl_cls *);
00047 extern int rtnl_cls_set_kind(struct rtnl_cls *, const char *);
00048 extern struct rtnl_cls_ops *rtnl_cls_get_ops(struct rtnl_cls *);
00049
00050 extern void rtnl_cls_set_prio(struct rtnl_cls *, uint16_t);
00051 extern uint16_t rtnl_cls_get_prio(struct rtnl_cls *);
00052
00053 extern void rtnl_cls_set_protocol(struct rtnl_cls *, uint16_t);
00054 extern uint16_t rtnl_cls_get_protocol(struct rtnl_cls *);
00055
00056 extern void *rtnl_cls_data(struct rtnl_cls *);
00057
00058 #ifdef __cplusplus
00059 }
00060 #endif
00061
00062 #endif