suricata
decode-icmpv6.h File Reference
#include "decode-tcp.h"
#include "decode-sctp.h"
#include "decode-udp.h"
#include "decode-ipv6.h"
Include dependency graph for decode-icmpv6.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ICMPV6Info_
 
struct  ICMPV6Hdr_
 
struct  ICMPV6Vars_
 

Macros

#define ICMPV6_HEADER_LEN   8
 
#define ICMPV6_HEADER_PKT_OFFSET   8
 
#define ICMP6_DST_UNREACH   1
 
#define ICMP6_PACKET_TOO_BIG   2
 
#define ICMP6_TIME_EXCEEDED   3
 
#define ICMP6_PARAM_PROB   4
 
#define ICMP6_ECHO_REQUEST   128
 
#define ICMP6_ECHO_REPLY   129
 
#define MLD_LISTENER_QUERY   130
 
#define MLD_LISTENER_REPORT   131
 
#define MLD_LISTENER_REDUCTION   132
 
#define ND_ROUTER_SOLICIT   133
 
#define ND_ROUTER_ADVERT   134
 
#define ND_NEIGHBOR_SOLICIT   135
 
#define ND_NEIGHBOR_ADVERT   136
 
#define ND_REDIRECT   137
 
#define ICMP6_RR   138
 
#define ICMP6_NI_QUERY   139
 
#define ICMP6_NI_REPLY   140
 
#define ND_INVERSE_SOLICIT   141
 
#define ND_INVERSE_ADVERT   142
 
#define MLD_V2_LIST_REPORT   143
 
#define HOME_AGENT_AD_REQUEST   144
 
#define HOME_AGENT_AD_REPLY   145
 
#define MOBILE_PREFIX_SOLICIT   146
 
#define MOBILE_PREFIX_ADVERT   147
 
#define CERT_PATH_SOLICIT   148
 
#define CERT_PATH_ADVERT   149
 
#define ICMP6_MOBILE_EXPERIMENTAL   150
 
#define MC_ROUTER_ADVERT   151
 
#define MC_ROUTER_SOLICIT   152
 
#define MC_ROUTER_TERMINATE   153
 
#define FMIPV6_MSG   154
 
#define RPL_CONTROL_MSG   155
 
#define LOCATOR_UDATE_MSG   156
 
#define DUPL_ADDR_REQUEST   157
 
#define DUPL_ADDR_CONFIRM   158
 
#define MPL_CONTROL_MSG   159
 
#define ICMP6_DST_UNREACH_NOROUTE   0 /* no route to destination */
 
#define ICMP6_DST_UNREACH_ADMIN   1 /* communication with destination */
 
#define ICMP6_DST_UNREACH_BEYONDSCOPE   2 /* beyond scope of source address */
 
#define ICMP6_DST_UNREACH_ADDR   3 /* address unreachable */
 
#define ICMP6_DST_UNREACH_NOPORT   4 /* bad port */
 
#define ICMP6_DST_UNREACH_FAILEDPOLICY   5 /* Source address failed ingress/egress policy */
 
#define ICMP6_DST_UNREACH_REJECTROUTE   6 /* Reject route to destination */
 
#define ICMP6_TIME_EXCEED_TRANSIT   0 /* Hop Limit == 0 in transit */
 
#define ICMP6_TIME_EXCEED_REASSEMBLY   1 /* Reassembly time out */
 
#define ICMP6_PARAMPROB_HEADER   0 /* erroneous header field */
 
#define ICMP6_PARAMPROB_NEXTHEADER   1 /* unrecognized Next Header */
 
#define ICMP6_PARAMPROB_OPTION   2 /* unrecognized IPv6 option */
 
#define ICMPV6_GET_TYPE(p)   (p)->icmpv6h->type
 
#define ICMPV6_GET_CODE(p)   (p)->icmpv6h->code
 
#define ICMPV6_GET_RAW_CSUM(p)   SCNtohs((p)->icmpv6h->csum)
 
#define ICMPV6_GET_CSUM(p)   (p)->icmpv6h->csum
 
#define ICMPV6_GET_ID(p)   (p)->icmpv6vars.id
 
#define ICMPV6_GET_SEQ(p)   (p)->icmpv6vars.seq
 
#define ICMPV6_GET_UNUSED(p)   (p)->icmpv6h->icmpv6b.icmpv6e.unused
 
#define ICMPV6_GET_ERROR_PTR(p)   (p)->icmpv6h->icmpv6b.icmpv6e.error_ptr
 
#define ICMPV6_GET_MTU(p)   (p)->icmpv6h->icmpv6b.icmpv6e.mtu
 
#define ICMPV6_GET_EMB_PROTO(p)   (p)->icmpv6vars.emb_ip6_proto_next
 
#define ICMPV6_GET_EMB_IPV6(p)   (p)->icmpv6vars.emb_ipv6h
 
#define ICMPV6_GET_EMB_TCP(p)   (p)->icmpv6vars.emb_tcph
 
#define ICMPV6_GET_EMB_UDP(p)   (p)->icmpv6vars.emb_udph
 
#define ICMPV6_GET_EMB_icmpv6h(p)   (p)->icmpv6vars.emb_icmpv6h
 
#define CLEAR_ICMPV6_PACKET(p)
 

Typedefs

typedef struct ICMPV6Info_ ICMPV6Info
 
typedef struct ICMPV6Hdr_ ICMPV6Hdr
 
typedef struct ICMPV6Vars_ ICMPV6Vars
 

Functions

void DecodeICMPV6RegisterTests (void)
 Registers ICMPV6 unit tests. More...
 
int ICMPv6GetCounterpart (uint8_t type)
 

Detailed Description

Macro Definition Documentation

#define CERT_PATH_ADVERT   149

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

Referenced by DecodeICMPV6(), and ICMPv6GetCounterpart().

#define CERT_PATH_SOLICIT   148

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

Referenced by DecodeICMPV6(), and ICMPv6GetCounterpart().

#define CLEAR_ICMPV6_PACKET (   p)
Value:
do { \
(p)->level4_comp_csum = -1; \
(p)->icmpv6h = NULL; \
} while(0)
#define PACKET_CLEAR_L4VARS(p)
Definition: decode.h:706

Definition at line 184 of file decode-icmpv6.h.

#define DUPL_ADDR_CONFIRM   158

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

Referenced by DecodeICMPV6(), and ICMPv6GetCounterpart().

#define DUPL_ADDR_REQUEST   157

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

Referenced by DecodeICMPV6(), and ICMPv6GetCounterpart().

#define FMIPV6_MSG   154

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

Referenced by DecodeICMPV6().

#define HOME_AGENT_AD_REPLY   145

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

Referenced by DecodeICMPV6(), and ICMPv6GetCounterpart().

#define HOME_AGENT_AD_REQUEST   144

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

Referenced by DecodeICMPV6(), and ICMPv6GetCounterpart().

#define ICMP6_DST_UNREACH   1

ICMPV6 Message Types: Error Messages: (type <128)

Definition at line 37 of file decode-icmpv6.h.

Referenced by DecodeICMPV6().

#define ICMP6_DST_UNREACH_ADDR   3 /* address unreachable */

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

#define ICMP6_DST_UNREACH_ADMIN   1 /* communication with destination */

Definition at line 82 of file decode-icmpv6.h.

#define ICMP6_DST_UNREACH_BEYONDSCOPE   2 /* beyond scope of source address */

Definition at line 84 of file decode-icmpv6.h.

#define ICMP6_DST_UNREACH_FAILEDPOLICY   5 /* Source address failed ingress/egress policy */

Definition at line 87 of file decode-icmpv6.h.

#define ICMP6_DST_UNREACH_NOPORT   4 /* bad port */

Definition at line 86 of file decode-icmpv6.h.

#define ICMP6_DST_UNREACH_NOROUTE   0 /* no route to destination */

Destination Unreachable Message (type=1) Code:

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

#define ICMP6_DST_UNREACH_REJECTROUTE   6 /* Reject route to destination */

Definition at line 88 of file decode-icmpv6.h.

Referenced by DecodeICMPV6().

#define ICMP6_ECHO_REPLY   129
#define ICMP6_ECHO_REQUEST   128

Informational Messages (type>=128)

Definition at line 43 of file decode-icmpv6.h.

Referenced by DecodeICMPV6(), DetectIcmpIdRegister(), DetectIcmpSeqRegister(), and ICMPv6GetCounterpart().

#define ICMP6_MOBILE_EXPERIMENTAL   150

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

Referenced by DecodeICMPV6().

#define ICMP6_NI_QUERY   139

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

Referenced by DecodeICMPV6(), and ICMPv6GetCounterpart().

#define ICMP6_NI_REPLY   140

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

Referenced by DecodeICMPV6(), and ICMPv6GetCounterpart().

#define ICMP6_PACKET_TOO_BIG   2

Definition at line 38 of file decode-icmpv6.h.

Referenced by DecodeICMPV6().

#define ICMP6_PARAM_PROB   4

Definition at line 40 of file decode-icmpv6.h.

Referenced by DecodeICMPV6().

#define ICMP6_PARAMPROB_HEADER   0 /* erroneous header field */

Parameter Problem Message (type=4) Code:

Definition at line 96 of file decode-icmpv6.h.

#define ICMP6_PARAMPROB_NEXTHEADER   1 /* unrecognized Next Header */

Definition at line 97 of file decode-icmpv6.h.

#define ICMP6_PARAMPROB_OPTION   2 /* unrecognized IPv6 option */

Definition at line 98 of file decode-icmpv6.h.

Referenced by DecodeICMPV6().

#define ICMP6_RR   138

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

Referenced by DecodeICMPV6().

#define ICMP6_TIME_EXCEED_REASSEMBLY   1 /* Reassembly time out */

Definition at line 93 of file decode-icmpv6.h.

Referenced by DecodeICMPV6().

#define ICMP6_TIME_EXCEED_TRANSIT   0 /* Hop Limit == 0 in transit */

Time Exceeded Message (type=3) Code:

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

#define ICMP6_TIME_EXCEEDED   3

Definition at line 39 of file decode-icmpv6.h.

Referenced by DecodeICMPV6().

#define ICMPV6_GET_CODE (   p)    (p)->icmpv6h->code

macro for icmpv6 "code" access

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

Referenced by DecodeICMPV6(), and DetectICodeFree().

#define ICMPV6_GET_CSUM (   p)    (p)->icmpv6h->csum

Definition at line 107 of file decode-icmpv6.h.

#define ICMPV6_GET_EMB_icmpv6h (   p)    (p)->icmpv6vars.emb_icmpv6h

macro for icmpv6 embedded "icmpv6h" header access

Definition at line 132 of file decode-icmpv6.h.

#define ICMPV6_GET_EMB_IPV6 (   p)    (p)->icmpv6vars.emb_ipv6h

macro for icmpv6 embedded "ipv6h" header access

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

Referenced by DecodeICMPV6().

#define ICMPV6_GET_EMB_PROTO (   p)    (p)->icmpv6vars.emb_ip6_proto_next

macro for icmpv6 embedded "protocol" access

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

Referenced by DecodeICMPV6().

#define ICMPV6_GET_EMB_TCP (   p)    (p)->icmpv6vars.emb_tcph

macro for icmpv6 embedded "tcph" header access

Definition at line 128 of file decode-icmpv6.h.

#define ICMPV6_GET_EMB_UDP (   p)    (p)->icmpv6vars.emb_udph

macro for icmpv6 embedded "udph" header access

Definition at line 130 of file decode-icmpv6.h.

#define ICMPV6_GET_ERROR_PTR (   p)    (p)->icmpv6h->icmpv6b.icmpv6e.error_ptr

macro for icmpv6 "error_ptr" access

Definition at line 119 of file decode-icmpv6.h.

Referenced by DecodeICMPV6().

#define ICMPV6_GET_ID (   p)    (p)->icmpv6vars.id

If message is informational macro for icmpv6 "id" access

Definition at line 111 of file decode-icmpv6.h.

Referenced by DecodeICMPV6(), and DetectIcmpIdRegister().

#define ICMPV6_GET_MTU (   p)    (p)->icmpv6h->icmpv6b.icmpv6e.mtu

macro for icmpv6 "mtu" access

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

Referenced by DecodeICMPV6().

#define ICMPV6_GET_RAW_CSUM (   p)    SCNtohs((p)->icmpv6h->csum)

macro for icmpv6 "csum" access

Definition at line 106 of file decode-icmpv6.h.

#define ICMPV6_GET_SEQ (   p)    (p)->icmpv6vars.seq

macro for icmpv6 "seq" access

Definition at line 113 of file decode-icmpv6.h.

Referenced by DecodeICMPV6(), and DetectIcmpSeqRegister().

#define ICMPV6_GET_TYPE (   p)    (p)->icmpv6h->type

macro for icmpv6 "type" access

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

Referenced by DecodeICMPV6(), DetectIcmpIdRegister(), DetectIcmpSeqRegister(), and DetectITypeFree().

#define ICMPV6_GET_UNUSED (   p)    (p)->icmpv6h->icmpv6b.icmpv6e.unused

If message is Error macro for icmpv6 "unused" access

Definition at line 117 of file decode-icmpv6.h.

#define ICMPV6_HEADER_LEN   8

Definition at line 32 of file decode-icmpv6.h.

Referenced by DecodeICMPV6().

#define ICMPV6_HEADER_PKT_OFFSET   8

Definition at line 33 of file decode-icmpv6.h.

#define LOCATOR_UDATE_MSG   156

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

Referenced by DecodeICMPV6().

#define MC_ROUTER_ADVERT   151

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

Referenced by DecodeICMPV6(), and ICMPv6GetCounterpart().

#define MC_ROUTER_SOLICIT   152

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

Referenced by DecodeICMPV6(), and ICMPv6GetCounterpart().

#define MC_ROUTER_TERMINATE   153

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

Referenced by DecodeICMPV6().

#define MLD_LISTENER_QUERY   130

Definition at line 46 of file decode-icmpv6.h.

Referenced by DecodeICMPV6(), and ICMPv6GetCounterpart().

#define MLD_LISTENER_REDUCTION   132

Definition at line 48 of file decode-icmpv6.h.

Referenced by DecodeICMPV6().

#define MLD_LISTENER_REPORT   131

Definition at line 47 of file decode-icmpv6.h.

Referenced by DecodeICMPV6(), and ICMPv6GetCounterpart().

#define MLD_V2_LIST_REPORT   143

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

Referenced by DecodeICMPV6().

#define MOBILE_PREFIX_ADVERT   147

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

Referenced by DecodeICMPV6(), and ICMPv6GetCounterpart().

#define MOBILE_PREFIX_SOLICIT   146

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

Referenced by DecodeICMPV6(), and ICMPv6GetCounterpart().

#define MPL_CONTROL_MSG   159

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

Referenced by DecodeICMPV6().

#define ND_INVERSE_ADVERT   142

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

Referenced by DecodeICMPV6().

#define ND_INVERSE_SOLICIT   141

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

Referenced by DecodeICMPV6().

#define ND_NEIGHBOR_ADVERT   136

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

Referenced by DecodeICMPV6(), and ICMPv6GetCounterpart().

#define ND_NEIGHBOR_SOLICIT   135

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

Referenced by DecodeICMPV6(), and ICMPv6GetCounterpart().

#define ND_REDIRECT   137

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

Referenced by DecodeICMPV6().

#define ND_ROUTER_ADVERT   134

Definition at line 51 of file decode-icmpv6.h.

Referenced by DecodeICMPV6(), and ICMPv6GetCounterpart().

#define ND_ROUTER_SOLICIT   133

Definition at line 50 of file decode-icmpv6.h.

Referenced by DecodeICMPV6(), and ICMPv6GetCounterpart().

#define RPL_CONTROL_MSG   155

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

Referenced by DecodeICMPV6().

Typedef Documentation

typedef struct ICMPV6Hdr_ ICMPV6Hdr

ICMPv6 header structure

typedef struct ICMPV6Info_ ICMPV6Info
typedef struct ICMPV6Vars_ ICMPV6Vars

Data available from the decoded packet

Function Documentation

void DecodeICMPV6RegisterTests ( void  )

Registers ICMPV6 unit tests.

Todo:
More ICMPv6 tests

Definition at line 1586 of file decode-icmpv6.c.

References UtRegisterTest().

Here is the call graph for this function: