54 const uint8_t *pkt, uint32_t
len)
71 if (!PacketIncreaseCheckLayers(
p)) {
79 VLANHdr *vlan_hdr = (VLANHdr *)pkt;
83 SCLogDebug(
"p %p pkt %p VLAN protocol %04x VLAN PRI %d VLAN CFI %d VLAN ID %d Len: %" PRIu32
"",
103 #define IEEE8021AH_HEADER_LEN sizeof(IEEE8021ahHdr)
106 const uint8_t *pkt, uint32_t
len)
117 if (!PacketIncreaseCheckLayers(
p)) {
120 IEEE8021ahHdr *hdr = (IEEE8021ahHdr *)pkt;
121 const uint16_t next_proto =
SCNtohs(hdr->type);
123 DecodeNetworkLayer(
tv,
dtv, next_proto,
p,
145 static int DecodeVLANtest01 (
void)
147 uint8_t raw_vlan[] = { 0x00, 0x20, 0x08 };
168 static int DecodeVLANtest02 (
void)
170 uint8_t raw_vlan[] = {
171 0x00, 0x20, 0x01, 0x00, 0x45, 0x00, 0x00, 0x34,
172 0x3b, 0x36, 0x40, 0x00, 0x40, 0x06, 0xb7, 0xc9,
173 0x83, 0x97, 0x20, 0x81, 0x83, 0x97, 0x20, 0x15,
174 0x04, 0x8a, 0x17, 0x70, 0x4e, 0x14, 0xdf, 0x55,
175 0x4d, 0x3d, 0x5a, 0x61, 0x80, 0x10, 0x6b, 0x50,
176 0x3c, 0x4c, 0x00, 0x00, 0x01, 0x01, 0x08, 0x0a,
177 0x00, 0x04, 0xf0, 0xc8, 0x01, 0x99, 0xa3, 0xf3};
198 static int DecodeVLANtest03 (
void)
200 uint8_t raw_vlan[] = {
201 0x00, 0x20, 0x08, 0x00, 0x45, 0x00, 0x00, 0x34,
202 0x3b, 0x36, 0x40, 0x00, 0x40, 0x06, 0xb7, 0xc9,
203 0x83, 0x97, 0x20, 0x81, 0x83, 0x97, 0x20, 0x15,
204 0x04, 0x8a, 0x17, 0x70, 0x4e, 0x14, 0xdf, 0x55,
205 0x4d, 0x3d, 0x5a, 0x61, 0x80, 0x10, 0x6b, 0x50,
206 0x3c, 0x4c, 0x00, 0x00, 0x01, 0x01, 0x08, 0x0a,
207 0x00, 0x04, 0xf0, 0xc8, 0x01, 0x99, 0xa3, 0xf3};
243 static int DecodeVLANtest04(
void)
246 uint8_t raw_qinqinq[] = { 0x00, 0x20, 0x81, 0x00, 0x01, 0x01, 0x81, 0x00, 0x0f, 0x03, 0x08,
247 0x00, 0x45, 0x00, 0x00, 0x34, 0x3b, 0x36, 0x40, 0x00, 0x40, 0x06, 0xb7, 0xc9, 0x83, 0x97,
248 0x20, 0x81, 0x83, 0x97, 0x20, 0x15, 0x04, 0x8a, 0x17, 0x70, 0x4e, 0x14, 0xdf, 0x55, 0x4d,
249 0x3d, 0x5a, 0x61, 0x80, 0x10, 0x6b, 0x50, 0x3c, 0x4c, 0x00, 0x00, 0x01, 0x01, 0x08, 0x0a,
250 0x00, 0x04, 0xf0, 0xc8, 0x01, 0x99, 0xa3, 0xf3 };
252 uint8_t raw_qinq[] = { 0x00, 0x20, 0x81, 0x00, 0x01, 0x01, 0x08, 0x00, 0x45, 0x00, 0x00, 0x34,
253 0x3b, 0x36, 0x40, 0x00, 0x40, 0x06, 0xb7, 0xc9, 0x83, 0x97, 0x20, 0x81, 0x83, 0x97, 0x20,
254 0x15, 0x04, 0x8a, 0x17, 0x70, 0x4e, 0x14, 0xdf, 0x55, 0x4d, 0x3d, 0x5a, 0x61, 0x80, 0x10,
255 0x6b, 0x50, 0x3c, 0x4c, 0x00, 0x00, 0x01, 0x01, 0x08, 0x0a, 0x00, 0x04, 0xf0, 0xc8, 0x01,
295 FAIL_IF(recycled_hash != fresh_hash);