suricata
decode-gre.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  GREHdr_
 
struct  GREPPtPHdr_
 
struct  GRESreHdr_
 

Macros

#define IPPROTO_GRE   47
 
#define GRE_VERSION_0   0x0000
 
#define GRE_VERSION_1   0x0001
 
#define GRE_HDR_LEN   4
 
#define GRE_CHKSUM_LEN   2
 
#define GRE_OFFSET_LEN   2
 
#define GRE_KEY_LEN   4
 
#define GRE_SEQ_LEN   4
 
#define GRE_SRE_HDR_LEN   4
 
#define GRE_PROTO_PPP   0x880b
 
#define GRE_FLAG_ISSET_CHKSUM(r)   (r->flags & 0x80)
 
#define GRE_FLAG_ISSET_ROUTE(r)   (r->flags & 0x40)
 
#define GRE_FLAG_ISSET_KY(r)   (r->flags & 0x20)
 
#define GRE_FLAG_ISSET_SQ(r)   (r->flags & 0x10)
 
#define GRE_FLAG_ISSET_SSR(r)   (r->flags & 0x08)
 
#define GRE_FLAG_ISSET_RECUR(r)   (r->flags & 0x07)
 
#define GRE_GET_VERSION(r)   (r->version & 0x07)
 
#define GRE_GET_FLAGS(r)   (r->version & 0xF8)
 
#define GRE_GET_PROTO(r)   SCNtohs(r->ether_type)
 
#define GREV1_HDR_LEN   8
 
#define GREV1_ACK_LEN   4
 
#define GREV1_FLAG_ISSET_FLAGS(r)   (r->version & 0x78)
 
#define GREV1_FLAG_ISSET_ACK(r)   (r->version & 0x80)
 

Functions

struct GREHdr_ __attribute__ ((__packed__)) GREHdr
 DNP3 link header. More...
 
void DecodeGRERegisterTests (void)
 this function registers unit tests for GRE decoder More...
 

Variables

uint8_t flags
 
uint8_t version
 
uint16_t ether_type
 
GREHdr greh
 
uint16_t payload_length
 
uint16_t call_id
 
uint16_t af
 
uint8_t sre_offset
 
uint8_t sre_length
 

Detailed Description

Author
Breno Silva breno.nosp@m..sil.nosp@m.va@gm.nosp@m.ail..nosp@m.com

Generic Route Encapsulation (GRE) from RFC 1701.

Definition in file decode-gre.h.

Macro Definition Documentation

◆ GRE_CHKSUM_LEN

#define GRE_CHKSUM_LEN   2

Definition at line 64 of file decode-gre.h.

◆ GRE_FLAG_ISSET_CHKSUM

#define GRE_FLAG_ISSET_CHKSUM (   r)    (r->flags & 0x80)

Definition at line 71 of file decode-gre.h.

◆ GRE_FLAG_ISSET_KY

#define GRE_FLAG_ISSET_KY (   r)    (r->flags & 0x20)

Definition at line 73 of file decode-gre.h.

◆ GRE_FLAG_ISSET_RECUR

#define GRE_FLAG_ISSET_RECUR (   r)    (r->flags & 0x07)

Definition at line 76 of file decode-gre.h.

◆ GRE_FLAG_ISSET_ROUTE

#define GRE_FLAG_ISSET_ROUTE (   r)    (r->flags & 0x40)

Definition at line 72 of file decode-gre.h.

◆ GRE_FLAG_ISSET_SQ

#define GRE_FLAG_ISSET_SQ (   r)    (r->flags & 0x10)

Definition at line 74 of file decode-gre.h.

◆ GRE_FLAG_ISSET_SSR

#define GRE_FLAG_ISSET_SSR (   r)    (r->flags & 0x08)

Definition at line 75 of file decode-gre.h.

◆ GRE_GET_FLAGS

#define GRE_GET_FLAGS (   r)    (r->version & 0xF8)

Definition at line 78 of file decode-gre.h.

◆ GRE_GET_PROTO

#define GRE_GET_PROTO (   r)    SCNtohs(r->ether_type)

Definition at line 79 of file decode-gre.h.

◆ GRE_GET_VERSION

#define GRE_GET_VERSION (   r)    (r->version & 0x07)

Definition at line 77 of file decode-gre.h.

◆ GRE_HDR_LEN

#define GRE_HDR_LEN   4

Definition at line 63 of file decode-gre.h.

◆ GRE_KEY_LEN

#define GRE_KEY_LEN   4

Definition at line 66 of file decode-gre.h.

◆ GRE_OFFSET_LEN

#define GRE_OFFSET_LEN   2

Definition at line 65 of file decode-gre.h.

◆ GRE_PROTO_PPP

#define GRE_PROTO_PPP   0x880b

Definition at line 69 of file decode-gre.h.

◆ GRE_SEQ_LEN

#define GRE_SEQ_LEN   4

Definition at line 67 of file decode-gre.h.

◆ GRE_SRE_HDR_LEN

#define GRE_SRE_HDR_LEN   4

Definition at line 68 of file decode-gre.h.

◆ GRE_VERSION_0

#define GRE_VERSION_0   0x0000

Definition at line 60 of file decode-gre.h.

◆ GRE_VERSION_1

#define GRE_VERSION_1   0x0001

Definition at line 61 of file decode-gre.h.

◆ GREV1_ACK_LEN

#define GREV1_ACK_LEN   4

Definition at line 82 of file decode-gre.h.

◆ GREV1_FLAG_ISSET_ACK

#define GREV1_FLAG_ISSET_ACK (   r)    (r->version & 0x80)

Definition at line 84 of file decode-gre.h.

◆ GREV1_FLAG_ISSET_FLAGS

#define GREV1_FLAG_ISSET_FLAGS (   r)    (r->version & 0x78)

Definition at line 83 of file decode-gre.h.

◆ GREV1_HDR_LEN

#define GREV1_HDR_LEN   8

Definition at line 81 of file decode-gre.h.

◆ IPPROTO_GRE

#define IPPROTO_GRE   47

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

Function Documentation

◆ DecodeGRERegisterTests()

void DecodeGRERegisterTests ( void  )

this function registers unit tests for GRE decoder

Definition at line 395 of file decode-gre.c.

References UtRegisterTest().

Here is the call graph for this function:

Variable Documentation

◆ af

uint16_t af

Address family

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

Referenced by Defrag(), and PrintInet().

◆ call_id

uint16_t call_id

PPP payload length

Definition at line 2 of file decode-gre.h.

◆ ether_type

uint16_t ether_type

ether type of the encapsulated traffic

Definition at line 2 of file decode-gre.h.

◆ flags

◆ greh

GREHdr greh

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

◆ payload_length

uint16_t payload_length

base GRE packet header

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

◆ sre_length

uint8_t sre_length

Definition at line 2 of file decode-gre.h.

◆ sre_offset

uint8_t sre_offset

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

◆ version

uint8_t version

GRE version

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

Referenced by DetectEngineGetVersion(), and SSLVersionToString().