Yotam Gigi | 1ce8460 | 2017-02-01 15:30:02 +0200 | [diff] [blame] | 1 | #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 | |
| 11 | void *ife_encode(struct sk_buff *skb, u16 metalen); |
| 12 | void *ife_decode(struct sk_buff *skb, u16 *metalen); |
| 13 | |
| 14 | void *ife_tlv_meta_decode(void *skbdata, u16 *attrtype, u16 *dlen, u16 *totlen); |
| 15 | int ife_tlv_meta_encode(void *skbdata, u16 attrtype, u16 dlen, |
| 16 | const void *dval); |
| 17 | |
| 18 | void *ife_tlv_meta_next(void *skbdata); |
| 19 | |
| 20 | #else |
| 21 | |
| 22 | static inline void *ife_encode(struct sk_buff *skb, u16 metalen) |
| 23 | { |
| 24 | return NULL; |
| 25 | } |
| 26 | |
| 27 | static inline void *ife_decode(struct sk_buff *skb, u16 *metalen) |
| 28 | { |
| 29 | return NULL; |
| 30 | } |
| 31 | |
| 32 | static inline void *ife_tlv_meta_decode(void *skbdata, u16 *attrtype, u16 *dlen, |
| 33 | u16 *totlen) |
| 34 | { |
| 35 | return NULL; |
| 36 | } |
| 37 | |
| 38 | static inline int ife_tlv_meta_encode(void *skbdata, u16 attrtype, u16 dlen, |
| 39 | const void *dval) |
| 40 | { |
| 41 | return 0; |
| 42 | } |
| 43 | |
| 44 | static inline void *ife_tlv_meta_next(void *skbdata) |
| 45 | { |
| 46 | return NULL; |
| 47 | } |
| 48 | |
| 49 | #endif |
| 50 | |
| 51 | #endif /* __NET_IFE_H */ |