18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef __NET_IFE_H
38c2ecf20Sopenharmony_ci#define __NET_IFE_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#include <linux/etherdevice.h>
68c2ecf20Sopenharmony_ci#include <linux/rtnetlink.h>
78c2ecf20Sopenharmony_ci#include <uapi/linux/ife.h>
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#if IS_ENABLED(CONFIG_NET_IFE)
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_civoid *ife_encode(struct sk_buff *skb, u16 metalen);
128c2ecf20Sopenharmony_civoid *ife_decode(struct sk_buff *skb, u16 *metalen);
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_civoid *ife_tlv_meta_decode(void *skbdata, const void *ifehdr_end, u16 *attrtype,
158c2ecf20Sopenharmony_ci			  u16 *dlen, u16 *totlen);
168c2ecf20Sopenharmony_ciint ife_tlv_meta_encode(void *skbdata, u16 attrtype, u16 dlen,
178c2ecf20Sopenharmony_ci			const void *dval);
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_civoid *ife_tlv_meta_next(void *skbdata);
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci#else
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_cistatic inline void *ife_encode(struct sk_buff *skb, u16 metalen)
248c2ecf20Sopenharmony_ci{
258c2ecf20Sopenharmony_ci	return NULL;
268c2ecf20Sopenharmony_ci}
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_cistatic inline void *ife_decode(struct sk_buff *skb, u16 *metalen)
298c2ecf20Sopenharmony_ci{
308c2ecf20Sopenharmony_ci	return NULL;
318c2ecf20Sopenharmony_ci}
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_cistatic inline void *ife_tlv_meta_decode(void *skbdata, u16 *attrtype, u16 *dlen,
348c2ecf20Sopenharmony_ci					u16 *totlen)
358c2ecf20Sopenharmony_ci{
368c2ecf20Sopenharmony_ci	return NULL;
378c2ecf20Sopenharmony_ci}
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_cistatic inline int ife_tlv_meta_encode(void *skbdata, u16 attrtype, u16 dlen,
408c2ecf20Sopenharmony_ci			const void *dval)
418c2ecf20Sopenharmony_ci{
428c2ecf20Sopenharmony_ci	return 0;
438c2ecf20Sopenharmony_ci}
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_cistatic inline void *ife_tlv_meta_next(void *skbdata)
468c2ecf20Sopenharmony_ci{
478c2ecf20Sopenharmony_ci	return NULL;
488c2ecf20Sopenharmony_ci}
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci#endif
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci#endif /* __NET_IFE_H */
53