0001
0002 #ifndef __NET_IFE_H
0003 #define __NET_IFE_H
0004
0005 #include <linux/etherdevice.h>
0006 #include <linux/rtnetlink.h>
0007 #include <uapi/linux/ife.h>
0008
0009 #if IS_ENABLED(CONFIG_NET_IFE)
0010
0011 void *ife_encode(struct sk_buff *skb, u16 metalen);
0012 void *ife_decode(struct sk_buff *skb, u16 *metalen);
0013
0014 void *ife_tlv_meta_decode(void *skbdata, const void *ifehdr_end, u16 *attrtype,
0015 u16 *dlen, u16 *totlen);
0016 int ife_tlv_meta_encode(void *skbdata, u16 attrtype, u16 dlen,
0017 const void *dval);
0018
0019 void *ife_tlv_meta_next(void *skbdata);
0020
0021 #else
0022
0023 static inline void *ife_encode(struct sk_buff *skb, u16 metalen)
0024 {
0025 return NULL;
0026 }
0027
0028 static inline void *ife_decode(struct sk_buff *skb, u16 *metalen)
0029 {
0030 return NULL;
0031 }
0032
0033 static inline void *ife_tlv_meta_decode(void *skbdata, u16 *attrtype, u16 *dlen,
0034 u16 *totlen)
0035 {
0036 return NULL;
0037 }
0038
0039 static inline int ife_tlv_meta_encode(void *skbdata, u16 attrtype, u16 dlen,
0040 const void *dval)
0041 {
0042 return 0;
0043 }
0044
0045 static inline void *ife_tlv_meta_next(void *skbdata)
0046 {
0047 return NULL;
0048 }
0049
0050 #endif
0051
0052 #endif