.. | .. |
---|
2 | 2 | #define __LINUX_ERSPAN_H |
---|
3 | 3 | |
---|
4 | 4 | /* |
---|
5 | | - * GRE header for ERSPAN encapsulation (8 octets [34:41]) -- 8 bytes |
---|
| 5 | + * GRE header for ERSPAN type I encapsulation (4 octets [34:37]) |
---|
| 6 | + * 0 1 2 3 |
---|
| 7 | + * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 |
---|
| 8 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
---|
| 9 | + * |0|0|0|0|0|00000|000000000|00000| Protocol Type for ERSPAN | |
---|
| 10 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
---|
| 11 | + * |
---|
| 12 | + * The Type I ERSPAN frame format is based on the barebones IP + GRE |
---|
| 13 | + * encapsulation (as described above) on top of the raw mirrored frame. |
---|
| 14 | + * There is no extra ERSPAN header. |
---|
| 15 | + * |
---|
| 16 | + * |
---|
| 17 | + * GRE header for ERSPAN type II and II encapsulation (8 octets [34:41]) |
---|
6 | 18 | * 0 1 2 3 |
---|
7 | 19 | * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 |
---|
8 | 20 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
---|
.. | .. |
---|
43 | 55 | * | Platform Specific Info | |
---|
44 | 56 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
---|
45 | 57 | * |
---|
46 | | - * GRE proto ERSPAN type II = 0x88BE, type III = 0x22EB |
---|
| 58 | + * GRE proto ERSPAN type I/II = 0x88BE, type III = 0x22EB |
---|
47 | 59 | */ |
---|
48 | 60 | |
---|
49 | 61 | #include <uapi/linux/erspan.h> |
---|
.. | .. |
---|
139 | 151 | |
---|
140 | 152 | static inline int erspan_hdr_len(int version) |
---|
141 | 153 | { |
---|
| 154 | + if (version == 0) |
---|
| 155 | + return 0; |
---|
| 156 | + |
---|
142 | 157 | return sizeof(struct erspan_base_hdr) + |
---|
143 | 158 | (version == 1 ? ERSPAN_V1_MDSIZE : ERSPAN_V2_MDSIZE); |
---|
144 | 159 | } |
---|