suricata
decode-mpls.c File Reference
#include "suricata-common.h"
#include "decode.h"
#include "util-validate.h"
#include "util-unittest.h"
Include dependency graph for decode-mpls.c:

Go to the source code of this file.

Macros

#define MPLS_HEADER_LEN   4
 
#define MPLS_PW_LEN   4
 
#define MPLS_MAX_RESERVED_LABEL   15
 
#define MPLS_LABEL_IPV4   0
 
#define MPLS_LABEL_ROUTER_ALERT   1
 
#define MPLS_LABEL_IPV6   2
 
#define MPLS_LABEL_NULL   3
 
#define MPLS_LABEL(shim)   SCNtohl(shim) >> 12
 
#define MPLS_BOTTOM(shim)   ((SCNtohl(shim) >> 8) & 0x1)
 
#define MPLS_PROTO_ETHERNET_PW   0
 
#define MPLS_PROTO_IPV4   4
 
#define MPLS_PROTO_IPV6   6
 

Functions

int DecodeMPLS (ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, const uint8_t *pkt, uint32_t len)
 
void DecodeMPLSRegisterTests (void)
 

Detailed Description

Author
Jason Ish jason.nosp@m..ish.nosp@m.@emul.nosp@m.ex.c.nosp@m.om

MPLS decoder.

Definition in file decode-mpls.c.

Macro Definition Documentation

◆ MPLS_BOTTOM

#define MPLS_BOTTOM (   shim)    ((SCNtohl(shim) >> 8) & 0x1)

Definition at line 43 of file decode-mpls.c.

◆ MPLS_HEADER_LEN

#define MPLS_HEADER_LEN   4

Definition at line 33 of file decode-mpls.c.

◆ MPLS_LABEL

#define MPLS_LABEL (   shim)    SCNtohl(shim) >> 12

Definition at line 42 of file decode-mpls.c.

◆ MPLS_LABEL_IPV4

#define MPLS_LABEL_IPV4   0

Definition at line 37 of file decode-mpls.c.

◆ MPLS_LABEL_IPV6

#define MPLS_LABEL_IPV6   2

Definition at line 39 of file decode-mpls.c.

◆ MPLS_LABEL_NULL

#define MPLS_LABEL_NULL   3

Definition at line 40 of file decode-mpls.c.

◆ MPLS_LABEL_ROUTER_ALERT

#define MPLS_LABEL_ROUTER_ALERT   1

Definition at line 38 of file decode-mpls.c.

◆ MPLS_MAX_RESERVED_LABEL

#define MPLS_MAX_RESERVED_LABEL   15

Definition at line 35 of file decode-mpls.c.

◆ MPLS_PROTO_ETHERNET_PW

#define MPLS_PROTO_ETHERNET_PW   0

Definition at line 46 of file decode-mpls.c.

◆ MPLS_PROTO_IPV4

#define MPLS_PROTO_IPV4   4

Definition at line 47 of file decode-mpls.c.

◆ MPLS_PROTO_IPV6

#define MPLS_PROTO_IPV6   6

Definition at line 48 of file decode-mpls.c.

◆ MPLS_PW_LEN

#define MPLS_PW_LEN   4

Definition at line 34 of file decode-mpls.c.

Function Documentation

◆ DecodeMPLS()

int DecodeMPLS ( ThreadVars tv,
DecodeThreadVars dtv,
Packet p,
const uint8_t *  pkt,
uint32_t  len 
)

Definition at line 49 of file decode-mpls.c.

References DecodeThreadVars_::counter_mpls, DEBUG_VALIDATE_BUG_ON, dtv, StatsIncr(), and tv.

Here is the call graph for this function:

◆ DecodeMPLSRegisterTests()

void DecodeMPLSRegisterTests ( void  )

Definition at line 342 of file decode-mpls.c.

References UtRegisterTest().

Here is the call graph for this function: