4 #include <asm/byteorder.h>
6 #if __BYTE_ORDER == __LITTLE_ENDIAN
7 # define __bpf_ntohs(x) __builtin_bswap16(x)
8 # define __bpf_htons(x) __builtin_bswap16(x)
9 #elif __BYTE_ORDER == __BIG_ENDIAN
10 # define __bpf_ntohs(x) (x)
11 # define __bpf_htons(x) (x)
13 # error "Fix your __BYTE_ORDER?!"
16 #define bpf_htons(x) \
17 (__builtin_constant_p(x) ? \
18 __constant_htons(x) : __bpf_htons(x))
19 #define bpf_ntohs(x) \
20 (__builtin_constant_p(x) ? \
21 __constant_ntohs(x) : __bpf_ntohs(x))