suricata
decode-vlan.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  VLANHdr_
 

Macros

#define ETHERNET_TYPE_VLAN   0x8100
 
#define GET_VLAN_PRIORITY(vlanh)   ((SCNtohs((vlanh)->vlan_cfi) & 0xe000) >> 13)
 
#define GET_VLAN_CFI(vlanh)   ((SCNtohs((vlanh)->vlan_cfi) & 0x0100) >> 12)
 
#define GET_VLAN_ID(vlanh)   ((uint16_t)(SCNtohs((vlanh)->vlan_cfi) & 0x0FFF))
 
#define GET_VLAN_PROTO(vlanh)   ((SCNtohs((vlanh)->protocol)))
 
#define VLAN_GET_ID1(p)   DecodeVLANGetId((p), 0)
 
#define VLAN_GET_ID2(p)   DecodeVLANGetId((p), 1)
 
#define VLAN_HEADER_LEN   4
 

Functions

uint16_t DecodeVLANGetId (const struct Packet_ *, uint8_t layer)
 
struct VLANHdr_ __attribute__ ((__packed__)) VLANHdr
 DNP3 link header. More...
 
void DecodeVLANRegisterTests (void)
 

Variables

uint16_t vlan_cfi
 
uint16_t protocol
 

Detailed Description

Macro Definition Documentation

#define ETHERNET_TYPE_VLAN   0x8100

Vlan type

Definition at line 31 of file decode-vlan.h.

Referenced by __attribute__(), DecodeEthernet(), DecodeGRE(), DecodeSll(), and DecodeVLAN().

#define GET_VLAN_CFI (   vlanh)    ((SCNtohs((vlanh)->vlan_cfi) & 0x0100) >> 12)

Definition at line 35 of file decode-vlan.h.

Referenced by DecodeVLAN().

#define GET_VLAN_ID (   vlanh)    ((uint16_t)(SCNtohs((vlanh)->vlan_cfi) & 0x0FFF))

Definition at line 36 of file decode-vlan.h.

Referenced by DecodeVLAN().

#define GET_VLAN_PRIORITY (   vlanh)    ((SCNtohs((vlanh)->vlan_cfi) & 0xe000) >> 13)

Vlan macros to access Vlan priority, Vlan CFI and VID

Definition at line 34 of file decode-vlan.h.

Referenced by DecodeVLAN().

#define GET_VLAN_PROTO (   vlanh)    ((SCNtohs((vlanh)->protocol)))

Definition at line 37 of file decode-vlan.h.

Referenced by DecodeVLAN().

#define VLAN_GET_ID1 (   p)    DecodeVLANGetId((p), 0)

Definition at line 40 of file decode-vlan.h.

#define VLAN_GET_ID2 (   p)    DecodeVLANGetId((p), 1)

Definition at line 41 of file decode-vlan.h.

#define VLAN_HEADER_LEN   4

VLAN header length

Definition at line 50 of file decode-vlan.h.

Referenced by AFPGetLinkType(), DecodeVLAN(), and TmModuleDecodeAFPRegister().

Function Documentation

uint16_t DecodeVLANGetId ( const struct Packet_ ,
uint8_t  layer 
)
void DecodeVLANRegisterTests ( void  )

Definition at line 309 of file decode-vlan.c.

References UtRegisterTest().

Here is the call graph for this function:

Variable Documentation

uint16_t protocol

protocol field

Definition at line 30 of file decode-vlan.h.

uint16_t vlan_cfi

Definition at line 29 of file decode-vlan.h.