prevent adding fb it already exists
[ana-net.git] / src / xt_skb.h
blob513747067f7207d37e68211544af7b5dd1cc388f
1 /*
2 * Lightweight Autonomic Network Architecture
4 * Copyright 2011 Daniel Borkmann <dborkma@tik.ee.ethz.ch>,
5 * Swiss federal institute of technology (ETH Zurich)
6 * Subject to the GPL.
7 */
9 #ifndef XT_SKB_H
10 #define XT_SKB_H
12 #include <linux/skbuff.h>
13 #include "xt_idp.h"
15 struct sock_lana_inf {
16 idp_t idp_dst;
17 idp_t idp_src;
18 __u32 flags;
19 __u32 errno;
22 #define SKB_LANA_INF(skb) ((struct sock_lana_inf *) ((skb)->cb))
24 static inline void write_next_idp_to_skb(struct sk_buff *skb, idp_t from,
25 idp_t to)
27 struct sock_lana_inf *sli = SKB_LANA_INF(skb);
28 sli->idp_dst = to;
29 sli->idp_src = from;
32 static inline idp_t read_next_idp_from_skb(struct sk_buff *skb)
34 return SKB_LANA_INF(skb)->idp_dst;
37 #endif /* XT_SKB_H */