162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0
262306a36Sopenharmony_ci#ifndef _NET_SHARED_H
362306a36Sopenharmony_ci#define _NET_SHARED_H
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci#define AF_INET		2
662306a36Sopenharmony_ci#define AF_INET6	10
762306a36Sopenharmony_ci
862306a36Sopenharmony_ci#define ETH_ALEN 6
962306a36Sopenharmony_ci#define ETH_P_802_3_MIN 0x0600
1062306a36Sopenharmony_ci#define ETH_P_8021Q 0x8100
1162306a36Sopenharmony_ci#define ETH_P_8021AD 0x88A8
1262306a36Sopenharmony_ci#define ETH_P_IP 0x0800
1362306a36Sopenharmony_ci#define ETH_P_IPV6 0x86DD
1462306a36Sopenharmony_ci#define ETH_P_ARP 0x0806
1562306a36Sopenharmony_ci#define IPPROTO_ICMPV6 58
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ci#define TC_ACT_OK		0
1862306a36Sopenharmony_ci#define TC_ACT_SHOT		2
1962306a36Sopenharmony_ci
2062306a36Sopenharmony_ci#define IFNAMSIZ 16
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_ci#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && \
2362306a36Sopenharmony_ci	__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
2462306a36Sopenharmony_ci#define bpf_ntohs(x)		__builtin_bswap16(x)
2562306a36Sopenharmony_ci#define bpf_htons(x)		__builtin_bswap16(x)
2662306a36Sopenharmony_ci#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && \
2762306a36Sopenharmony_ci	__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
2862306a36Sopenharmony_ci#define bpf_ntohs(x)		(x)
2962306a36Sopenharmony_ci#define bpf_htons(x)		(x)
3062306a36Sopenharmony_ci#else
3162306a36Sopenharmony_ci# error "Endianness detection needs to be set up for your compiler?!"
3262306a36Sopenharmony_ci#endif
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_ci#endif
35