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  IPV6EspHdr_
 
struct  IPV6RouteHdr_
 
struct  IPV6OptHAO_
 
struct  IPV6OptRA_
 
struct  IPV6OptJumbo_
 
struct  IPV6HopOptsHdr_
 
struct  IPV6DstOptsHdr_
 
struct  IPV6GenOptHdr_
 
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)->ip6vars.l4proto = proto
 
#define IPV6_GET_VER(p)   IPV6_GET_RAW_VER((p)->ip6h)
 
#define IPV6_GET_CLASS(p)   IPV6_GET_RAW_CLASS((p)->ip6h)
 
#define IPV6_GET_FLOW(p)   IPV6_GET_RAW_FLOW((p)->ip6h)
 
#define IPV6_GET_NH(p)   (IPV6_GET_RAW_NH((p)->ip6h))
 
#define IPV6_GET_PLEN(p)   IPV6_GET_RAW_PLEN((p)->ip6h)
 
#define IPV6_GET_HLIM(p)   (IPV6_GET_RAW_HLIM((p)->ip6h))
 
#define IPV6_GET_L4PROTO(p)   ((p)->ip6vars.l4proto)
 
#define CLEAR_IPV6_PACKET(p)
 
#define IPV6_EXTHDR_GET_FH_NH(p)   (p)->ip6eh.fh_nh
 
#define IPV6_EXTHDR_GET_FH_OFFSET(p)   (p)->ip6eh.fh_offset
 
#define IPV6_EXTHDR_GET_FH_FLAG(p)   (p)->ip6eh.fh_more_frags_set
 
#define IPV6_EXTHDR_GET_FH_ID(p)   (p)->ip6eh.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)->ip6eh.fh_set = TRUE
 
#define IPV6_EXTHDR_ISSET_FH(p)   (p)->ip6eh.fh_set
 
#define IPV6_EXTHDR_SET_RH(p)   (p)->ip6eh.rh_set = TRUE
 
#define IPV6_EXTHDR_ISSET_RH(p)   (p)->ip6eh.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 IPV6GenOptHdr_ IPV6GenOptHdr
 
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
 
uint32_t ip6esph_spi
 
uint32_t ip6esph_seq
 
uint8_t ip6rh_nxt
 
uint8_t ip6rh_len
 
uint8_t ip6rh_type
 
uint8_t ip6rh_segsleft
 
uint8_t ip6hh_nxt
 
uint8_t ip6hh_len
 
uint8_t ip6dh_nxt
 
uint8_t ip6dh_len
 

Detailed Description

Macro Definition Documentation

#define CLEAR_IPV6_PACKET (   p)
Value:
do { \
(p)->ip6h = NULL; \
(p)->ip6vars.ip_opts_len = 0; \
(p)->ip6vars.l4proto = 0; \
memset(&(p)->ip6eh, 0x00, sizeof((p)->ip6eh)); \
} while (0)

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

#define IPV6_EXTHDR_GET_FH_FLAG (   p)    (p)->ip6eh.fh_more_frags_set

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

Referenced by Defrag(), and DefragRbFragCompare().

#define IPV6_EXTHDR_GET_FH_ID (   p)    (p)->ip6eh.fh_id

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

#define IPV6_EXTHDR_GET_FH_NH (   p)    (p)->ip6eh.fh_nh

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

Referenced by DefragRbFragCompare().

#define IPV6_EXTHDR_GET_FH_OFFSET (   p)    (p)->ip6eh.fh_offset
#define IPV6_EXTHDR_ISSET_FH (   p)    (p)->ip6eh.fh_set
#define IPV6_EXTHDR_ISSET_RH (   p)    (p)->ip6eh.rh_set

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

Referenced by DecodeIPV6().

#define IPV6_EXTHDR_SET_FH (   p)    (p)->ip6eh.fh_set = TRUE

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

Referenced by DecodeIPV6FragHeader().

#define IPV6_EXTHDR_SET_RH (   p)    (p)->ip6eh.rh_set = TRUE

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

Referenced by DecodeIPV6FragHeader().

#define IPV6_GET_CLASS (   p)    IPV6_GET_RAW_CLASS((p)->ip6h)

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

Referenced by DecodeIPV6().

#define IPV6_GET_FLOW (   p)    IPV6_GET_RAW_FLOW((p)->ip6h)

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

Referenced by DecodeIPV6().

#define IPV6_GET_HLIM (   p)    (IPV6_GET_RAW_HLIM((p)->ip6h))
#define IPV6_GET_L4PROTO (   p)    ((p)->ip6vars.l4proto)

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

Referenced by DecodeIPV6().

#define IPV6_GET_NH (   p)    (IPV6_GET_RAW_NH((p)->ip6h))

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

Referenced by AFPSetBPFFilter(), DecodeIPV6(), and DecodeIPV6FragHeader().

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

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

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

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

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

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

Referenced by DecodeTeredo().

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

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

Referenced by DecodeTeredo().

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

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

Referenced by DecodeICMPV6(), DecodeTeredo(), and DetectCsumRegister().

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

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

Referenced by DecodeIPFW(), DecodeNFQ(), NoNFLOGSupportExit(), and NoWinDivertSupportExit().

#define IPV6_GET_VER (   p)    IPV6_GET_RAW_VER((p)->ip6h)

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

#define IPV6_MAX_OPT   40

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

#define IPV6_MAXPACKET   65535 /* maximum packet size */

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

Referenced by DefragRbFragCompare().

#define IPV6_SET_L4PROTO (   p,
  proto 
)    (p)->ip6vars.l4proto = proto

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

Referenced by DecodeIPV6(), and DecodeIPV6FragHeader().

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

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

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

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

#define IPV6OPT_HAO   0xC9

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

Referenced by DecodeIPV6FragHeader().

#define IPV6OPT_JUMBO   0xC2

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

Referenced by DecodeIPV6FragHeader().

#define IPV6OPT_PAD1   0x00

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

Referenced by DecodeIPV6FragHeader().

#define IPV6OPT_PADN   0x01

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

Referenced by DecodeIPV6FragHeader().

#define IPV6OPT_RA   0x05

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

Referenced by DecodeIPV6FragHeader().

#define s_ip6_addrs   ip6_hdrun2.ip6_addrs

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

#define s_ip6_dst   ip6_hdrun2.ip6_un2.ip6_dst

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

#define s_ip6_flow   ip6_hdrun.ip6_un1.ip6_un1_flow

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

#define s_ip6_hlim   ip6_hdrun.ip6_un1.ip6_un1_hlim

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

#define s_ip6_nxt   ip6_hdrun.ip6_un1.ip6_un1_nxt

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

#define s_ip6_plen   ip6_hdrun.ip6_un1.ip6_un1_plen

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

#define s_ip6_src   ip6_hdrun2.ip6_un2.ip6_src

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

#define s_ip6_vfc   ip6_hdrun.ip6_un2_vfc

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

Typedef Documentation

typedef struct IPV6ExtHdrs_ IPV6ExtHdrs
typedef struct IPV6GenOptHdr_ IPV6GenOptHdr
typedef struct IPV6Hdr_ IPV6Hdr
typedef struct IPV6OptHAO_ IPV6OptHAO
typedef struct IPV6OptJumbo_ IPV6OptJumbo
typedef struct IPV6OptRA_ IPV6OptRA
typedef struct IPV6Vars_ IPV6Vars

get the highest proto/next header field we know

Function Documentation

void DecodeIPV6RegisterTests ( void  )

this function registers unit tests for IPV6 decoder

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

References UtRegisterTest().

Here is the call graph for this function:

Variable Documentation

uint8_t ip6ah_len

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

uint8_t ip6ah_nxt

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

uint16_t ip6ah_reserved

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

uint32_t ip6ah_seq

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

uint32_t ip6ah_spi

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

uint8_t ip6dh_len

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

uint8_t ip6dh_nxt

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

uint32_t ip6esph_seq

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

uint32_t ip6esph_spi

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

uint32_t ip6fh_ident

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

uint8_t ip6fh_nxt

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

uint16_t ip6fh_offlg

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

uint8_t ip6fh_reserved

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

uint8_t ip6hh_len

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

uint8_t ip6hh_nxt

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

uint8_t ip6rh_len

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

uint8_t ip6rh_nxt

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

uint8_t ip6rh_segsleft

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

uint8_t ip6rh_type

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

Referenced by DecodeIPV6FragHeader().