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_HEADER_LEN   4
 
#define VLAN_MAX_LAYERS   3
 
#define VLAN_MAX_LAYER_IDX   (VLAN_MAX_LAYERS - 1)
 

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

◆ ETHERNET_TYPE_VLAN

#define ETHERNET_TYPE_VLAN   0x8100

Vlan type

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

◆ GET_VLAN_CFI

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

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

◆ GET_VLAN_ID

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

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

◆ GET_VLAN_PRIORITY

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

Vlan macros to access Vlan priority, Vlan CFI and VID

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

◆ GET_VLAN_PROTO

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

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

◆ VLAN_HEADER_LEN

#define VLAN_HEADER_LEN   4

VLAN header length

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

◆ VLAN_MAX_LAYER_IDX

#define VLAN_MAX_LAYER_IDX   (VLAN_MAX_LAYERS - 1)

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

◆ VLAN_MAX_LAYERS

#define VLAN_MAX_LAYERS   3

VLAN max encapsulation layer count/index

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

Function Documentation

◆ DecodeVLANGetId()

uint16_t DecodeVLANGetId ( const struct Packet_ ,
uint8_t  layer 
)

◆ DecodeVLANRegisterTests()

void DecodeVLANRegisterTests ( void  )

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

References UtRegisterTest().

Here is the call graph for this function:

Variable Documentation

◆ protocol

uint16_t protocol

protocol field

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

◆ vlan_cfi

uint16_t vlan_cfi

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