libnl 2.0

/tmp/buildd/libnl2-2.0/include/netlink/route/classifier-modules.h

00001 /*
00002  * netlink/route/classifier-modules.h   Classifier Module API
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-2009 Thomas Graf <tgraf@suug.ch>
00010  */
00011 
00012 #ifndef NETLINK_CLASS_MODULES_H_
00013 #define NETLINK_CLASS_MODULES_H_
00014 
00015 #include <netlink/netlink.h>
00016 
00017 #ifdef __cplusplus
00018 extern "C" {
00019 #endif
00020 
00021 /**
00022  * Classifier operations
00023  * @ingroup cls_api
00024  */
00025 struct rtnl_cls_ops
00026 {
00027         /**
00028          * Name of classifier module
00029          */
00030         char co_kind[32];
00031 
00032 
00033         /**
00034          * Size of private classifier data
00035          */
00036         size_t co_size;
00037 
00038         /**
00039          * Dump callbacks
00040          */
00041         void (*co_dump[NL_DUMP_MAX+1])(struct rtnl_cls *,
00042                                        struct nl_dump_params *);
00043         /**
00044          * Must return the contents supposed to be in TCA_OPTIONS
00045          */
00046         int (*co_get_opts)(struct rtnl_cls *, struct nl_msg *);
00047 
00048         /**
00049          * TCA_OPTIONS message parser
00050          */
00051         int (*co_msg_parser)(struct rtnl_cls *);
00052 
00053         /**
00054          * Called before a class object gets destroyed
00055          */
00056         void (*co_free_data)(struct rtnl_cls *);
00057 
00058         /**
00059          * Called whenever a classifier object needs to be cloned
00060          */
00061         int (*co_clone)(struct rtnl_cls *, struct rtnl_cls *);
00062 
00063         /**
00064          * INTERNAL (Do not use)
00065          */
00066         struct rtnl_cls_ops *co_next;
00067 };
00068 
00069 extern int                      rtnl_cls_register(struct rtnl_cls_ops *);
00070 extern int                      rtnl_cls_unregister(struct rtnl_cls_ops *);
00071 extern struct rtnl_cls_ops *    rtnl_cls_lookup_ops(struct rtnl_cls *);
00072 extern struct rtnl_cls_ops *    __rtnl_cls_lookup_ops(const char *kind);
00073 
00074 #ifdef __cplusplus
00075 }
00076 #endif
00077 
00078 #endif