decode-gre.h File Reference
#include "decode.h"
#include "threadvars.h"
Include dependency graph for decode-gre.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  GREHdr_
struct  GRESreHdr_


#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)


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


uint8_t flags
uint8_t version
uint16_t ether_type
uint16_t af
uint8_t sre_offset
uint8_t sre_length

Detailed Description

Breno Silva

Generic Route Encapsulation (GRE) from RFC 1701.

Definition in file decode-gre.h.

Macro Definition Documentation


#define GRE_CHKSUM_LEN   2

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


#define GRE_HDR_LEN   4

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


#define GRE_KEY_LEN   4

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


#define GRE_OFFSET_LEN   2

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


#define GRE_PROTO_PPP   0x880b

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


#define GRE_SEQ_LEN   4

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


#define GRE_SRE_HDR_LEN   4

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


#define GRE_VERSION_0   0x0000

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


#define GRE_VERSION_1   0x0001

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


#define GREV1_ACK_LEN   4

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


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

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


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

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


#define GREV1_HDR_LEN   8

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


#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 385 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().

◆ ether_type

uint16_t ether_type

ether type of the encapsulated traffic

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

◆ flags

◆ 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(), ReceivePfringThreadInit(), and SSLVersionToString().