libnl 1.1
include/netlink/route/classifier.h
00001 /*
00002  * netlink/route/classifier.h       Classifiers
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_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 struct nl_cache *rtnl_cls_alloc_cache(struct nl_handle *, int, uint32_t);
00030 
00031 /* classifier addition */
00032 extern int              rtnl_cls_add(struct nl_handle *, struct rtnl_cls *,
00033                                      int);
00034 extern struct nl_msg *  rtnl_cls_build_add_request(struct rtnl_cls *, int);
00035 
00036 extern struct nl_msg *rtnl_cls_build_change_request(struct rtnl_cls *, int);
00037 extern struct nl_msg *rtnl_cls_build_delete_request(struct rtnl_cls *, int);
00038 extern int  rtnl_cls_delete(struct nl_handle *, struct rtnl_cls *, int);
00039 
00040 /* attribute modification */
00041 extern void rtnl_cls_set_ifindex(struct rtnl_cls *, int);
00042 extern void rtnl_cls_set_handle(struct rtnl_cls *, uint32_t);
00043 extern void rtnl_cls_set_parent(struct rtnl_cls *, uint32_t);
00044 extern void rtnl_cls_set_kind(struct rtnl_cls *, const char *);
00045 
00046 extern void rtnl_cls_set_prio(struct rtnl_cls *, int);
00047 extern int  rtnl_cls_get_prio(struct rtnl_cls *);
00048 
00049 extern void rtnl_cls_set_protocol(struct rtnl_cls *, int);
00050 extern int  rtnl_cls_get_protocol(struct rtnl_cls *);
00051 
00052 #ifdef __cplusplus
00053 }
00054 #endif
00055 
00056 #endif