suricata
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_
 

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

#define GRE_CHKSUM_LEN   2

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

Referenced by DecodeGRE().

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

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

Referenced by DecodeGRE().

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

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

Referenced by DecodeGRE().

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

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

Referenced by DecodeGRE().

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

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

Referenced by DecodeGRE().

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

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

Referenced by DecodeGRE().

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

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

Referenced by DecodeGRE().

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

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

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

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

Referenced by DecodeGRE().

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

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

Referenced by DecodeGRE().

#define GRE_HDR_LEN   4

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

Referenced by DecodeGRE().

#define GRE_KEY_LEN   4

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

Referenced by DecodeGRE().

#define GRE_OFFSET_LEN   2

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

Referenced by DecodeGRE().

#define GRE_PROTO_PPP   0x880b

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

Referenced by DecodeGRE().

#define GRE_SEQ_LEN   4

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

Referenced by DecodeGRE().

#define GRE_SRE_HDR_LEN   4

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

Referenced by DecodeGRE().

#define GRE_VERSION_0   0x0000

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

Referenced by DecodeGRE().

#define GRE_VERSION_1   0x0001

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

Referenced by DecodeGRE().

#define GREV1_ACK_LEN   4

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

Referenced by DecodeGRE().

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

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

Referenced by DecodeGRE().

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

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

Referenced by DecodeGRE().

#define GREV1_HDR_LEN   8

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

#define IPPROTO_GRE   47

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

Referenced by DecodeIPV4(), and DecodeIPV6().

Function Documentation

void DecodeGRERegisterTests ( void  )

this function registers unit tests for GRE decoder

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

References UtRegisterTest().

Here is the call graph for this function:

Variable Documentation

uint16_t af

Address family

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

Referenced by Defrag(), and DefragRbFragCompare().

uint16_t ether_type

ether type of the encapsulated traffic

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

uint8_t flags

GRE packet flags

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

uint8_t sre_length

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

uint8_t sre_offset

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