suricata
|
#include "suricata-common.h"
#include "decode-icmpv6.h"
#include "decode.h"
#include "flow.h"
#include "util-print.h"
#include "util-validate.h"
#include "packet.h"
#include "util-unittest-helper.h"
Go to the source code of this file.
Macros | |
#define | CASE_CODE(t, r) case (t): return r; case (r): return t; |
Functions | |
int | ICMPv6GetCounterpart (uint8_t type) |
int | DecodeICMPV6 (ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, const uint8_t *pkt, uint32_t len) |
Decode ICMPV6 packets and fill the Packet with the decoded info. | |
void | DecodeICMPV6RegisterTests (void) |
Registers ICMPV6 unit tests. | |
Decode ICMPv6
Definition in file decode-icmpv6.c.
#define CASE_CODE | ( | t, | |
r | |||
) | case (t): return r; case (r): return t; |
int DecodeICMPV6 | ( | ThreadVars * | tv, |
DecodeThreadVars * | dtv, | ||
Packet * | p, | ||
const uint8_t * | pkt, | ||
uint32_t | len | ||
) |
Decode ICMPV6 packets and fill the Packet with the decoded info.
tv | Pointer to the thread variables |
dtv | Pointer to the decode thread variables |
p | Pointer to the packet we are filling |
pkt | Pointer to the raw packet buffer |
len | the len of the rest of the packet not processed yet |
void | No return value |
Definition at line 177 of file decode-icmpv6.c.
References CERT_PATH_ADVERT, CERT_PATH_SOLICIT, ICMPV6Hdr_::code, Packet_::code, DecodeThreadVars_::counter_icmpv6, DEBUG_VALIDATE_BUG_ON, dtv, DUPL_ADDR_CONFIRM, DUPL_ADDR_REQUEST, ENGINE_ISSET_EVENT, ENGINE_SET_EVENT, ENGINE_SET_INVALID_EVENT, FlowSetupPacket(), FMIPV6_MSG, HOME_AGENT_AD_REPLY, HOME_AGENT_AD_REQUEST, ICMP6_DST_UNREACH, ICMP6_DST_UNREACH_REJECTROUTE, ICMP6_ECHO_REPLY, ICMP6_ECHO_REQUEST, ICMP6_MOBILE_EXPERIMENTAL, ICMP6_NI_QUERY, ICMP6_NI_REPLY, ICMP6_PACKET_TOO_BIG, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_OPTION, ICMP6_RR, ICMP6_TIME_EXCEED_REASSEMBLY, ICMP6_TIME_EXCEEDED, Packet_::icmp_d, Packet_::icmp_s, PacketL4::L4Vars::icmpv6, ICMPV6_EXPERIMENTATION_TYPE, ICMPV6_GET_MTU, ICMPV6_HEADER_LEN, ICMPV6_MLD_MESSAGE_WITH_INVALID_HL, ICMPV6_PKT_TOO_SMALL, ICMPV6_UNASSIGNED_TYPE, ICMPV6_UNKNOWN_CODE, ICMPV6_UNKNOWN_TYPE, ICMPV6Hdr_::icmpv6b, ICMPv6GetCounterpart(), ICMPV6Hdr_::icmpv6i, ICMPV6Info_::id, ICMPV6Vars_::id, IPV6_GET_RAW_HLIM, Packet_::l4, len, LOCATOR_UDATE_MSG, MC_ROUTER_ADVERT, MC_ROUTER_SOLICIT, MC_ROUTER_TERMINATE, MLD_LISTENER_QUERY, MLD_LISTENER_REDUCTION, MLD_LISTENER_REPORT, MLD_V2_LIST_REPORT, MOBILE_PREFIX_ADVERT, MOBILE_PREFIX_SOLICIT, MPL_CONTROL_MSG, ICMPV6Vars_::mtu, ND_INVERSE_ADVERT, ND_INVERSE_SOLICIT, ND_NEIGHBOR_ADVERT, ND_NEIGHBOR_SOLICIT, ND_REDIRECT, ND_ROUTER_ADVERT, ND_ROUTER_SOLICIT, Packet_::payload, Packet_::payload_len, Packet_::proto, RPL_CONTROL_MSG, SCLogDebug, ICMPV6Info_::seq, ICMPV6Vars_::seq, StatsIncr(), TM_ECODE_FAILED, TM_ECODE_OK, tv, ICMPV6Hdr_::type, type, Packet_::type, unlikely, and PacketL4::vars.
Referenced by DecodeIPV6().
void DecodeICMPV6RegisterTests | ( | void | ) |
Registers ICMPV6 unit tests.
Definition at line 1535 of file decode-icmpv6.c.
References UtRegisterTest().
int ICMPv6GetCounterpart | ( | uint8_t | type | ) |
type | counterpart type or -1 |
Definition at line 145 of file decode-icmpv6.c.
References CASE_CODE, CERT_PATH_ADVERT, CERT_PATH_SOLICIT, DUPL_ADDR_CONFIRM, DUPL_ADDR_REQUEST, HOME_AGENT_AD_REPLY, HOME_AGENT_AD_REQUEST, ICMP6_ECHO_REPLY, ICMP6_ECHO_REQUEST, ICMP6_NI_QUERY, ICMP6_NI_REPLY, MC_ROUTER_ADVERT, MC_ROUTER_SOLICIT, MLD_LISTENER_QUERY, MLD_LISTENER_REPORT, MOBILE_PREFIX_ADVERT, MOBILE_PREFIX_SOLICIT, ND_NEIGHBOR_ADVERT, ND_NEIGHBOR_SOLICIT, ND_ROUTER_ADVERT, ND_ROUTER_SOLICIT, and type.
Referenced by DecodeICMPV6().