blob: 2d87d6898b0a99f13ad66c31c53eebbb34e09b86 [file] [log] [blame]
Yotam Gigi1ce84602017-02-01 15:30:02 +02001#ifndef __NET_IFE_H
2#define __NET_IFE_H
3
4#include <linux/etherdevice.h>
5#include <linux/rtnetlink.h>
6#include <linux/module.h>
7#include <uapi/linux/ife.h>
8
9#if IS_ENABLED(CONFIG_NET_IFE)
10
11void *ife_encode(struct sk_buff *skb, u16 metalen);
12void *ife_decode(struct sk_buff *skb, u16 *metalen);
13
14void *ife_tlv_meta_decode(void *skbdata, u16 *attrtype, u16 *dlen, u16 *totlen);
15int ife_tlv_meta_encode(void *skbdata, u16 attrtype, u16 dlen,
16 const void *dval);
17
18void *ife_tlv_meta_next(void *skbdata);
19
20#else
21
22static inline void *ife_encode(struct sk_buff *skb, u16 metalen)
23{
24 return NULL;
25}
26
27static inline void *ife_decode(struct sk_buff *skb, u16 *metalen)
28{
29 return NULL;
30}
31
32static inline void *ife_tlv_meta_decode(void *skbdata, u16 *attrtype, u16 *dlen,
33 u16 *totlen)
34{
35 return NULL;
36}
37
38static inline int ife_tlv_meta_encode(void *skbdata, u16 attrtype, u16 dlen,
39 const void *dval)
40{
41 return 0;
42}
43
44static inline void *ife_tlv_meta_next(void *skbdata)
45{
46 return NULL;
47}
48
49#endif
50
51#endif /* __NET_IFE_H */