0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef _UAPI_ERSPAN_H
0014 #define _UAPI_ERSPAN_H
0015
0016 #include <linux/types.h> /* For __beXX in userspace */
0017 #include <asm/byteorder.h>
0018
0019
0020 struct erspan_md2 {
0021 __be32 timestamp;
0022 __be16 sgt;
0023 #if defined(__LITTLE_ENDIAN_BITFIELD)
0024 __u8 hwid_upper:2,
0025 ft:5,
0026 p:1;
0027 __u8 o:1,
0028 gra:2,
0029 dir:1,
0030 hwid:4;
0031 #elif defined(__BIG_ENDIAN_BITFIELD)
0032 __u8 p:1,
0033 ft:5,
0034 hwid_upper:2;
0035 __u8 hwid:4,
0036 dir:1,
0037 gra:2,
0038 o:1;
0039 #else
0040 #error "Please fix <asm/byteorder.h>"
0041 #endif
0042 };
0043
0044 struct erspan_metadata {
0045 int version;
0046 union {
0047 __be32 index;
0048 struct erspan_md2 md2;
0049 } u;
0050 };
0051
0052 #endif