81 VLANHdr *vlan_hdr = (VLANHdr *)pkt;
87 SCLogDebug(
"p %p pkt %p VLAN protocol %04x VLAN PRI %d VLAN CFI %d VLAN ID %d Len: %" PRIu32
"",
139 SCLogDebug(
"unknown VLAN type: %" PRIx32
"", proto);
164 #define IEEE8021AH_HEADER_LEN sizeof(IEEE8021ahHdr) 176 IEEE8021ahHdr *hdr = (IEEE8021ahHdr *)pkt;
177 uint16_t next_proto =
SCNtohs(hdr->type);
179 switch (next_proto) {
201 static int DecodeVLANtest01 (
void)
203 uint8_t raw_vlan[] = { 0x00, 0x20, 0x08 };
213 DecodeVLAN(&tv, &dtv, p, raw_vlan,
sizeof(raw_vlan), NULL);
230 static int DecodeVLANtest02 (
void)
232 uint8_t raw_vlan[] = {
233 0x00, 0x20, 0x01, 0x00, 0x45, 0x00, 0x00, 0x34,
234 0x3b, 0x36, 0x40, 0x00, 0x40, 0x06, 0xb7, 0xc9,
235 0x83, 0x97, 0x20, 0x81, 0x83, 0x97, 0x20, 0x15,
236 0x04, 0x8a, 0x17, 0x70, 0x4e, 0x14, 0xdf, 0x55,
237 0x4d, 0x3d, 0x5a, 0x61, 0x80, 0x10, 0x6b, 0x50,
238 0x3c, 0x4c, 0x00, 0x00, 0x01, 0x01, 0x08, 0x0a,
239 0x00, 0x04, 0xf0, 0xc8, 0x01, 0x99, 0xa3, 0xf3};
249 DecodeVLAN(&tv, &dtv, p, raw_vlan,
sizeof(raw_vlan), NULL);
267 static int DecodeVLANtest03 (
void)
269 uint8_t raw_vlan[] = {
270 0x00, 0x20, 0x08, 0x00, 0x45, 0x00, 0x00, 0x34,
271 0x3b, 0x36, 0x40, 0x00, 0x40, 0x06, 0xb7, 0xc9,
272 0x83, 0x97, 0x20, 0x81, 0x83, 0x97, 0x20, 0x15,
273 0x04, 0x8a, 0x17, 0x70, 0x4e, 0x14, 0xdf, 0x55,
274 0x4d, 0x3d, 0x5a, 0x61, 0x80, 0x10, 0x6b, 0x50,
275 0x3c, 0x4c, 0x00, 0x00, 0x01, 0x01, 0x08, 0x0a,
276 0x00, 0x04, 0xf0, 0xc8, 0x01, 0x99, 0xa3, 0xf3};
288 DecodeVLAN(&tv, &dtv, p, raw_vlan,
sizeof(raw_vlan), NULL);
#define ETHERNET_TYPE_8021AH
#define ENGINE_SET_EVENT(p, e)
uint16_t DecodeVLANGetId(const Packet *p, uint8_t layer)
uint16_t counter_ieee8021ah
int DecodePPPOEDiscovery(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, const uint8_t *pkt, uint32_t len, PacketQueue *pq)
Main decoding function for PPPOE Discovery packets.
#define ENGINE_ISSET_EVENT(p, e)
int DecodePPPOESession(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, const uint8_t *pkt, uint32_t len, PacketQueue *pq)
Main decoding function for PPPOE Session packets.
uint16_t counter_vlan_qinq
#define ETHERNET_TYPE_VLAN
#define PACKET_RECYCLE(p)
#define GET_VLAN_PROTO(vlanh)
#define ETHERNET_TYPE_8021AD
#define ETHERNET_TYPE_ARP
int DecodeVLAN(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, const uint8_t *pkt, uint32_t len, PacketQueue *pq)
#define ETHERNET_TYPE_PPPOE_DISC
void UtRegisterTest(const char *name, int(*TestFn)(void))
Register unit test.
Structure to hold thread specific data for all decode modules.
#define GET_VLAN_ID(vlanh)
#define ETHERNET_TYPE_MPLS_MULTICAST
void StatsIncr(ThreadVars *tv, uint16_t id)
Increments the local counter.
#define GET_VLAN_PRIORITY(vlanh)
void DecodeVLANRegisterTests(void)
#define GET_VLAN_CFI(vlanh)
#define ETHERNET_TYPE_PPPOE_SESS
int DecodeIPV6(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, const uint8_t *pkt, uint16_t len, PacketQueue *pq)
int DecodeIPV4(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, const uint8_t *pkt, uint16_t len, PacketQueue *pq)
void FlowShutdown(void)
shutdown the flow engine
int DecodeMPLS(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, const uint8_t *pkt, uint32_t len, PacketQueue *pq)
Per thread variable structure.
#define ETHERNET_TYPE_IPV6
#define ETHERNET_TYPE_MPLS_UNICAST
#define ETHERNET_TYPE_8021QINQ
#define ENGINE_SET_INVALID_EVENT(p, e)
Packet * PacketGetFromAlloc(void)
Get a malloced packet.
struct IEEE8021ahHdr_ __attribute__((__packed__))
DNP3 link header.
#define IEEE8021AH_HEADER_LEN
void FlowInitConfig(char quiet)
initialize the configuration