suricata
|
#include "suricata-common.h"
#include "decode.h"
#include "decode-geneve.h"
#include "decode-events.h"
#include "detect.h"
#include "detect-engine-port.h"
#include "flow.h"
#include "util-validate.h"
#include "util-unittest.h"
#include "util-debug.h"
#include "pkt-var.h"
#include "util-profiling.h"
#include "host.h"
Go to the source code of this file.
Data Structures | |
struct | GeneveOption_ |
struct | GeneveHeader_ |
Macros | |
#define | VALID_GENEVE_VERSIONS |
#define | GENEVE_VERSION(hdr_ptr) (hdr_ptr->ver_plus_len >> 6) |
#define | GENEVE_RESERVED_FLAGS(hdr_ptr) (hdr_ptr->flags & 0x3F) |
#define | GENEVE_MIN_HEADER_LEN sizeof(GeneveHeader) |
#define | GENEVE_TOTAL_OPT_LEN(hdr_ptr) ((uint8_t)((hdr_ptr->ver_plus_len & 0x3F) << 2)) |
#define | GENEVE_TOTAL_HEADER_LEN(hdr_ptr) (GENEVE_MIN_HEADER_LEN + GENEVE_TOTAL_OPT_LEN(hdr_ptr)) |
#define | GENEVE_MIN_SINGLE_OPT_LEN sizeof(GeneveOption) |
#define | GENEVE_SINGLE_OPT_LEN(option_ptr) ((uint8_t)((option_ptr->flags_plus_len & 0x1F) << 2)) |
#define | GENEVE_SINGLE_OPT_TOTAL_LEN(option_ptr) (GENEVE_MIN_SINGLE_OPT_LEN + GENEVE_SINGLE_OPT_LEN(option_ptr)) |
#define | GENEVE_MAX_PORTS 4 |
#define | GENEVE_UNSET_PORT -1 |
#define | GENEVE_DEFAULT_PORT 6081 |
#define | GENEVE_DEFAULT_PORT_S "6081" |
Typedefs | |
typedef struct GeneveOption_ | GeneveOption |
typedef struct GeneveHeader_ | GeneveHeader |
Functions | |
bool | DecodeGeneveEnabledForPort (const uint16_t sp, const uint16_t dp) |
void | DecodeGeneveConfig (void) |
int | DecodeGeneve (ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, const uint8_t *pkt, uint32_t len) |
void | DecodeGeneveRegisterTests (void) |
Geneve tunneling scheme decoder.
This implementation is based on the following specification doc: https://tools.ietf.org/html/draft-ietf-nvo3-geneve-16#section-3
Definition in file decode-geneve.c.
#define GENEVE_DEFAULT_PORT 6081 |
Definition at line 66 of file decode-geneve.c.
#define GENEVE_DEFAULT_PORT_S "6081" |
Definition at line 67 of file decode-geneve.c.
#define GENEVE_MAX_PORTS 4 |
Definition at line 64 of file decode-geneve.c.
#define GENEVE_MIN_HEADER_LEN sizeof(GeneveHeader) |
Definition at line 55 of file decode-geneve.c.
#define GENEVE_MIN_SINGLE_OPT_LEN sizeof(GeneveOption) |
Definition at line 59 of file decode-geneve.c.
#define GENEVE_RESERVED_FLAGS | ( | hdr_ptr | ) | (hdr_ptr->flags & 0x3F) |
Definition at line 53 of file decode-geneve.c.
#define GENEVE_SINGLE_OPT_LEN | ( | option_ptr | ) | ((uint8_t)((option_ptr->flags_plus_len & 0x1F) << 2)) |
Definition at line 60 of file decode-geneve.c.
#define GENEVE_SINGLE_OPT_TOTAL_LEN | ( | option_ptr | ) | (GENEVE_MIN_SINGLE_OPT_LEN + GENEVE_SINGLE_OPT_LEN(option_ptr)) |
Definition at line 61 of file decode-geneve.c.
#define GENEVE_TOTAL_HEADER_LEN | ( | hdr_ptr | ) | (GENEVE_MIN_HEADER_LEN + GENEVE_TOTAL_OPT_LEN(hdr_ptr)) |
Definition at line 57 of file decode-geneve.c.
#define GENEVE_TOTAL_OPT_LEN | ( | hdr_ptr | ) | ((uint8_t)((hdr_ptr->ver_plus_len & 0x3F) << 2)) |
Definition at line 56 of file decode-geneve.c.
#define GENEVE_UNSET_PORT -1 |
Definition at line 65 of file decode-geneve.c.
#define GENEVE_VERSION | ( | hdr_ptr | ) | (hdr_ptr->ver_plus_len >> 6) |
Definition at line 52 of file decode-geneve.c.
#define VALID_GENEVE_VERSIONS |
Definition at line 48 of file decode-geneve.c.
typedef struct GeneveHeader_ GeneveHeader |
typedef struct GeneveOption_ GeneveOption |
int DecodeGeneve | ( | ThreadVars * | tv, |
DecodeThreadVars * | dtv, | ||
Packet * | p, | ||
const uint8_t * | pkt, | ||
uint32_t | len | ||
) |
pkt | payload data directly above UDP header |
len | length in bytes of pkt |
Definition at line 185 of file decode-geneve.c.
References DEBUG_VALIDATE_BUG_ON, DECODE_TUNNEL_UNSET, eth_type, and unlikely.
void DecodeGeneveConfig | ( | void | ) |
Definition at line 128 of file decode-geneve.c.
References ConfGetBool().
Referenced by DecodeGlobalConfig().
bool DecodeGeneveEnabledForPort | ( | const uint16_t | sp, |
const uint16_t | dp | ||
) |
Definition at line 91 of file decode-geneve.c.
References SCLogDebug.
void DecodeGeneveRegisterTests | ( | void | ) |
Definition at line 490 of file decode-geneve.c.
References UtRegisterTest().