suricata
decode-ipv6.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  IPV6Hdr_
 
struct  IPV6Vars_
 get the highest proto/next header field we know More...
 
struct  IPV6FragHdr_
 
struct  IPV6AuthHdr_
 
struct  IPV6OptHAO_
 
struct  IPV6OptRA_
 
struct  IPV6OptJumbo_
 
struct  IPV6ExtHdrs_
 

Macros

#define IPV6_HEADER_LEN   40
 
#define IPV6_MAXPACKET   65535 /* maximum packet size */
 
#define IPV6_MAX_OPT   40
 
#define s_ip6_src   ip6_hdrun2.ip6_un2.ip6_src
 
#define s_ip6_dst   ip6_hdrun2.ip6_un2.ip6_dst
 
#define s_ip6_addrs   ip6_hdrun2.ip6_addrs
 
#define s_ip6_vfc   ip6_hdrun.ip6_un2_vfc
 
#define s_ip6_flow   ip6_hdrun.ip6_un1.ip6_un1_flow
 
#define s_ip6_plen   ip6_hdrun.ip6_un1.ip6_un1_plen
 
#define s_ip6_nxt   ip6_hdrun.ip6_un1.ip6_un1_nxt
 
#define s_ip6_hlim   ip6_hdrun.ip6_un1.ip6_un1_hlim
 
#define IPV6_GET_RAW_VER(ip6h)   (((ip6h)->s_ip6_vfc & 0xf0) >> 4)
 
#define IPV6_GET_RAW_CLASS(ip6h)   ((SCNtohl((ip6h)->s_ip6_flow) & 0x0FF00000) >> 20)
 
#define IPV6_GET_RAW_FLOW(ip6h)   (SCNtohl((ip6h)->s_ip6_flow) & 0x000FFFFF)
 
#define IPV6_GET_RAW_NH(ip6h)   ((ip6h)->s_ip6_nxt)
 
#define IPV6_GET_RAW_PLEN(ip6h)   (SCNtohs((ip6h)->s_ip6_plen))
 
#define IPV6_GET_RAW_HLIM(ip6h)   ((ip6h)->s_ip6_hlim)
 
#define IPV6_SET_RAW_VER(ip6h, value)   ((ip6h)->s_ip6_vfc = (((ip6h)->s_ip6_vfc & 0x0f) | (value << 4)))
 
#define IPV6_SET_RAW_NH(ip6h, value)   ((ip6h)->s_ip6_nxt = (value))
 
#define IPV6_SET_L4PROTO(p, proto)   (p)->l3.vars.ip6.v.l4proto = (proto)
 
#define IPV6_SET_EXTHDRS_LEN(p, len)   (p)->l3.vars.ip6.v.exthdrs_len = (len)
 
#define IPV6_GET_L4PROTO(p)   ((p)->l3.vars.ip6.v.l4proto)
 
#define IPV6_GET_EXTHDRS_LEN(p)   ((p)->l3.vars.ip6.v.exthdrs_len)
 
#define IPV6_EXTHDR_GET_FH_NH(p)   (p)->l3.vars.ip6.eh.fh_nh
 
#define IPV6_EXTHDR_GET_FH_OFFSET(p)   (p)->l3.vars.ip6.eh.fh_offset
 
#define IPV6_EXTHDR_GET_FH_FLAG(p)   (p)->l3.vars.ip6.eh.fh_more_frags_set
 
#define IPV6_EXTHDR_GET_FH_ID(p)   (p)->l3.vars.ip6.eh.fh_id
 
#define IPV6OPT_PAD1   0x00
 
#define IPV6OPT_PADN   0x01
 
#define IPV6OPT_RA   0x05
 
#define IPV6OPT_JUMBO   0xC2
 
#define IPV6OPT_HAO   0xC9
 
#define IPV6_EXTHDR_SET_FH(p)   (p)->l3.vars.ip6.eh.fh_set = true
 
#define IPV6_EXTHDR_ISSET_FH(p)   (p)->l3.vars.ip6.eh.fh_set
 
#define IPV6_EXTHDR_SET_RH(p)   (p)->l3.vars.ip6.eh.rh_set = true
 
#define IPV6_EXTHDR_ISSET_RH(p)   (p)->l3.vars.ip6.eh.rh_set
 

Typedefs

typedef struct IPV6Hdr_ IPV6Hdr
 
typedef struct IPV6Vars_ IPV6Vars
 get the highest proto/next header field we know More...
 
typedef struct IPV6OptHAO_ IPV6OptHAO
 
typedef struct IPV6OptRA_ IPV6OptRA
 
typedef struct IPV6OptJumbo_ IPV6OptJumbo
 
typedef struct IPV6ExtHdrs_ IPV6ExtHdrs
 

Functions

struct IPV6FragHdr_ __attribute__ ((__packed__)) IPV6FragHdr
 DNP3 link header. More...
 
void DecodeIPV6RegisterTests (void)
 this function registers unit tests for IPV6 decoder More...
 

Variables

uint8_t ip6fh_nxt
 
uint8_t ip6fh_reserved
 
uint16_t ip6fh_offlg
 
uint32_t ip6fh_ident
 
uint8_t ip6ah_nxt
 
uint8_t ip6ah_len
 
uint16_t ip6ah_reserved
 
uint32_t ip6ah_spi
 
uint32_t ip6ah_seq
 

Detailed Description

Macro Definition Documentation

◆ IPV6_EXTHDR_GET_FH_FLAG

#define IPV6_EXTHDR_GET_FH_FLAG (   p)    (p)->l3.vars.ip6.eh.fh_more_frags_set

Definition at line 103 of file decode-ipv6.h.

◆ IPV6_EXTHDR_GET_FH_ID

#define IPV6_EXTHDR_GET_FH_ID (   p)    (p)->l3.vars.ip6.eh.fh_id

Definition at line 104 of file decode-ipv6.h.

◆ IPV6_EXTHDR_GET_FH_NH

#define IPV6_EXTHDR_GET_FH_NH (   p)    (p)->l3.vars.ip6.eh.fh_nh

Definition at line 101 of file decode-ipv6.h.

◆ IPV6_EXTHDR_GET_FH_OFFSET

#define IPV6_EXTHDR_GET_FH_OFFSET (   p)    (p)->l3.vars.ip6.eh.fh_offset

Definition at line 102 of file decode-ipv6.h.

◆ IPV6_EXTHDR_ISSET_FH

#define IPV6_EXTHDR_ISSET_FH (   p)    (p)->l3.vars.ip6.eh.fh_set

Definition at line 175 of file decode-ipv6.h.

◆ IPV6_EXTHDR_ISSET_RH

#define IPV6_EXTHDR_ISSET_RH (   p)    (p)->l3.vars.ip6.eh.rh_set

Definition at line 177 of file decode-ipv6.h.

◆ IPV6_EXTHDR_SET_FH

#define IPV6_EXTHDR_SET_FH (   p)    (p)->l3.vars.ip6.eh.fh_set = true

Definition at line 174 of file decode-ipv6.h.

◆ IPV6_EXTHDR_SET_RH

#define IPV6_EXTHDR_SET_RH (   p)    (p)->l3.vars.ip6.eh.rh_set = true

Definition at line 176 of file decode-ipv6.h.

◆ IPV6_GET_EXTHDRS_LEN

#define IPV6_GET_EXTHDRS_LEN (   p)    ((p)->l3.vars.ip6.v.exthdrs_len)

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

◆ IPV6_GET_L4PROTO

#define IPV6_GET_L4PROTO (   p)    ((p)->l3.vars.ip6.v.l4proto)

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

◆ IPV6_GET_RAW_CLASS

#define IPV6_GET_RAW_CLASS (   ip6h)    ((SCNtohl((ip6h)->s_ip6_flow) & 0x0FF00000) >> 20)

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

◆ IPV6_GET_RAW_FLOW

#define IPV6_GET_RAW_FLOW (   ip6h)    (SCNtohl((ip6h)->s_ip6_flow) & 0x000FFFFF)

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

◆ IPV6_GET_RAW_HLIM

#define IPV6_GET_RAW_HLIM (   ip6h)    ((ip6h)->s_ip6_hlim)

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

◆ IPV6_GET_RAW_NH

#define IPV6_GET_RAW_NH (   ip6h)    ((ip6h)->s_ip6_nxt)

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

◆ IPV6_GET_RAW_PLEN

#define IPV6_GET_RAW_PLEN (   ip6h)    (SCNtohs((ip6h)->s_ip6_plen))

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

◆ IPV6_GET_RAW_VER

#define IPV6_GET_RAW_VER (   ip6h)    (((ip6h)->s_ip6_vfc & 0xf0) >> 4)

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

◆ IPV6_HEADER_LEN

#define IPV6_HEADER_LEN   40

Definition at line 28 of file decode-ipv6.h.

◆ IPV6_MAX_OPT

#define IPV6_MAX_OPT   40

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

◆ IPV6_MAXPACKET

#define IPV6_MAXPACKET   65535 /* maximum packet size */

Definition at line 29 of file decode-ipv6.h.

◆ IPV6_SET_EXTHDRS_LEN

#define IPV6_SET_EXTHDRS_LEN (   p,
  len 
)    (p)->l3.vars.ip6.v.exthdrs_len = (len)

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

◆ IPV6_SET_L4PROTO

#define IPV6_SET_L4PROTO (   p,
  proto 
)    (p)->l3.vars.ip6.v.l4proto = (proto)

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

◆ IPV6_SET_RAW_NH

#define IPV6_SET_RAW_NH (   ip6h,
  value 
)    ((ip6h)->s_ip6_nxt = (value))

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

◆ IPV6_SET_RAW_VER

#define IPV6_SET_RAW_VER (   ip6h,
  value 
)    ((ip6h)->s_ip6_vfc = (((ip6h)->s_ip6_vfc & 0x0f) | (value << 4)))

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

◆ IPV6OPT_HAO

#define IPV6OPT_HAO   0xC9

Definition at line 124 of file decode-ipv6.h.

◆ IPV6OPT_JUMBO

#define IPV6OPT_JUMBO   0xC2

Definition at line 123 of file decode-ipv6.h.

◆ IPV6OPT_PAD1

#define IPV6OPT_PAD1   0x00

Definition at line 120 of file decode-ipv6.h.

◆ IPV6OPT_PADN

#define IPV6OPT_PADN   0x01

Definition at line 121 of file decode-ipv6.h.

◆ IPV6OPT_RA

#define IPV6OPT_RA   0x05

Definition at line 122 of file decode-ipv6.h.

◆ s_ip6_addrs

#define s_ip6_addrs   ip6_hdrun2.ip6_addrs

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

◆ s_ip6_dst

#define s_ip6_dst   ip6_hdrun2.ip6_un2.ip6_dst

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

◆ s_ip6_flow

#define s_ip6_flow   ip6_hdrun.ip6_un1.ip6_un1_flow

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

◆ s_ip6_hlim

#define s_ip6_hlim   ip6_hdrun.ip6_un1.ip6_un1_hlim

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

◆ s_ip6_nxt

#define s_ip6_nxt   ip6_hdrun.ip6_un1.ip6_un1_nxt

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

◆ s_ip6_plen

#define s_ip6_plen   ip6_hdrun.ip6_un1.ip6_un1_plen

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

◆ s_ip6_src

#define s_ip6_src   ip6_hdrun2.ip6_un2.ip6_src

Definition at line 53 of file decode-ipv6.h.

◆ s_ip6_vfc

#define s_ip6_vfc   ip6_hdrun.ip6_un2_vfc

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

Typedef Documentation

◆ IPV6ExtHdrs

typedef struct IPV6ExtHdrs_ IPV6ExtHdrs

◆ IPV6Hdr

typedef struct IPV6Hdr_ IPV6Hdr

◆ IPV6OptHAO

typedef struct IPV6OptHAO_ IPV6OptHAO

◆ IPV6OptJumbo

typedef struct IPV6OptJumbo_ IPV6OptJumbo

◆ IPV6OptRA

typedef struct IPV6OptRA_ IPV6OptRA

◆ IPV6Vars

typedef struct IPV6Vars_ IPV6Vars

get the highest proto/next header field we know

Function Documentation

◆ DecodeIPV6RegisterTests()

void DecodeIPV6RegisterTests ( void  )

this function registers unit tests for IPV6 decoder

Definition at line 900 of file decode-ipv6.c.

References UtRegisterTest().

Here is the call graph for this function:

Variable Documentation

◆ ip6ah_len

uint8_t ip6ah_len

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

◆ ip6ah_nxt

uint8_t ip6ah_nxt

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

◆ ip6ah_reserved

uint16_t ip6ah_reserved

Definition at line 3 of file decode-ipv6.h.

◆ ip6ah_seq

uint32_t ip6ah_seq

Definition at line 5 of file decode-ipv6.h.

◆ ip6ah_spi

uint32_t ip6ah_spi

Definition at line 4 of file decode-ipv6.h.

◆ ip6fh_ident

uint32_t ip6fh_ident

Definition at line 3 of file decode-ipv6.h.

◆ ip6fh_nxt

uint8_t ip6fh_nxt

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

◆ ip6fh_offlg

uint16_t ip6fh_offlg

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

◆ ip6fh_reserved

uint8_t ip6fh_reserved

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