55 const uint8_t *pkt, uint32_t
len)
72 if (!PacketIncreaseCheckLayers(p)) {
80 VLANHdr *vlan_hdr = (VLANHdr *)pkt;
84 SCLogDebug(
"p %p pkt %p VLAN protocol %04x VLAN PRI %d VLAN CFI %d VLAN ID %d Len: %" PRIu32
"",
104#define IEEE8021AH_HEADER_LEN sizeof(IEEE8021ahHdr)
107 const uint8_t *pkt, uint32_t
len)
118 IEEE8021ahHdr *hdr = (IEEE8021ahHdr *)pkt;
119 const uint16_t next_proto =
SCNtohs(hdr->type);
121 DecodeNetworkLayer(
tv,
dtv, next_proto, p,
141static int DecodeVLANtest01 (
void)
143 uint8_t raw_vlan[] = { 0x00, 0x20, 0x08 };
170static int DecodeVLANtest02 (
void)
172 uint8_t raw_vlan[] = {
173 0x00, 0x20, 0x01, 0x00, 0x45, 0x00, 0x00, 0x34,
174 0x3b, 0x36, 0x40, 0x00, 0x40, 0x06, 0xb7, 0xc9,
175 0x83, 0x97, 0x20, 0x81, 0x83, 0x97, 0x20, 0x15,
176 0x04, 0x8a, 0x17, 0x70, 0x4e, 0x14, 0xdf, 0x55,
177 0x4d, 0x3d, 0x5a, 0x61, 0x80, 0x10, 0x6b, 0x50,
178 0x3c, 0x4c, 0x00, 0x00, 0x01, 0x01, 0x08, 0x0a,
179 0x00, 0x04, 0xf0, 0xc8, 0x01, 0x99, 0xa3, 0xf3};
207static int DecodeVLANtest03 (
void)
209 uint8_t raw_vlan[] = {
210 0x00, 0x20, 0x08, 0x00, 0x45, 0x00, 0x00, 0x34,
211 0x3b, 0x36, 0x40, 0x00, 0x40, 0x06, 0xb7, 0xc9,
212 0x83, 0x97, 0x20, 0x81, 0x83, 0x97, 0x20, 0x15,
213 0x04, 0x8a, 0x17, 0x70, 0x4e, 0x14, 0xdf, 0x55,
214 0x4d, 0x3d, 0x5a, 0x61, 0x80, 0x10, 0x6b, 0x50,
215 0x3c, 0x4c, 0x00, 0x00, 0x01, 0x01, 0x08, 0x0a,
216 0x00, 0x04, 0xf0, 0xc8, 0x01, 0x99, 0xa3, 0xf3};
void StatsIncr(ThreadVars *tv, uint16_t id)
Increments the local counter.
@ IEEE8021AH_HEADER_TOO_SMALL
@ VLAN_HEADER_TOO_MANY_LAYERS
void DecodeVLANRegisterTests(void)
int DecodeVLAN(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, const uint8_t *pkt, uint32_t len)
#define IEEE8021AH_HEADER_LEN
#define VLAN_MAX_LAYER_IDX
#define GET_VLAN_CFI(vlanh)
#define GET_VLAN_PROTO(vlanh)
#define GET_VLAN_PRIORITY(vlanh)
#define GET_VLAN_ID(vlanh)
#define ENGINE_SET_INVALID_EVENT(p, e)
#define ENGINE_ISSET_EVENT(p, e)
int DecodeIEEE8021ah(ThreadVars *, DecodeThreadVars *, Packet *, const uint8_t *, uint32_t)
#define ENGINE_SET_EVENT(p, e)
struct PrefilterEngineFlowbits __attribute__
DNP3 application header.
void FlowInitConfig(bool quiet)
initialize the configuration
void FlowShutdown(void)
shutdown the flow engine
void UtRegisterTest(const char *name, int(*TestFn)(void))
Register unit test.
Packet * PacketGetFromAlloc(void)
Get a malloced packet.
void PacketRecycle(Packet *p)
Structure to hold thread specific data for all decode modules.
uint16_t counter_vlan_qinqinq
uint16_t counter_ieee8021ah
uint16_t counter_vlan_qinq
uint16_t vlan_id[VLAN_MAX_LAYERS]
Per thread variable structure.
#define DEBUG_VALIDATE_BUG_ON(exp)