pktloc.h

00001 /*
00002  * netlink/route/pktloc.h         Packet Location Aliasing
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) 2010 Thomas Graf <tgraf@suug.ch>
00010  */
00011 
00012 #ifndef NETLINK_PKTLOC_H_
00013 #define NETLINK_PKTLOC_H_
00014 
00015 #include <netlink/netlink.h>
00016 #include <netlink/cache.h>
00017 #include <netlink/route/tc.h>
00018 
00019 #include <linux/tc_ematch/tc_em_cmp.h>
00020 
00021 #ifdef __cplusplus
00022 extern "C" {
00023 #endif
00024 
00025 struct rtnl_pktloc
00026 {
00027         char *                  name;
00028         uint8_t                 layer;
00029         uint8_t                 shift;
00030         uint16_t                offset;
00031         uint16_t                align;
00032         uint32_t                mask;
00033         uint32_t                refcnt;
00034 
00035         struct nl_list_head     list;
00036 };
00037 
00038 extern int      rtnl_pktloc_lookup(const char *, struct rtnl_pktloc **);
00039 extern struct rtnl_pktloc *rtnl_pktloc_alloc(void);
00040 extern void     rtnl_pktloc_put(struct rtnl_pktloc *);
00041 extern int      rtnl_pktloc_add(struct rtnl_pktloc *);
00042 extern void     rtnl_pktloc_foreach(void (*cb)(struct rtnl_pktloc *, void *),
00043                                     void *);
00044 
00045 #ifdef __cplusplus
00046 }
00047 #endif
00048 
00049 #endif