suricata
|
#include "suricata-common.h"
#include "decode.h"
#include "decode-events.h"
#include "decode-ipv4.h"
#include "decode-icmpv4.h"
#include "flow.h"
#include "util-unittest.h"
#include "util-unittest-helper.h"
#include "util-debug.h"
#include "util-print.h"
#include "util-validate.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 | DecodeICMPV4 (ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, const uint8_t *pkt, uint32_t len) |
Main ICMPv4 decoding function. | |
int | ICMPv4GetCounterpart (uint8_t type) |
void | DecodeICMPV4RegisterTests (void) |
Registers ICMPV4 unit test. | |
Decode ICMPv4
Definition in file decode-icmpv4.c.
#define CASE_CODE | ( | t, | |
r | |||
) | case (t): return r; case (r): return t; |
int DecodeICMPV4 | ( | ThreadVars * | tv, |
DecodeThreadVars * | dtv, | ||
Packet * | p, | ||
const uint8_t * | pkt, | ||
uint32_t | len | ||
) |
Main ICMPv4 decoding function.
DecodeICMPV4
Definition at line 143 of file decode-icmpv4.c.
References ICMPV4Hdr_::code, Packet_::code, DecodeThreadVars_::counter_icmpv4, DEBUG_VALIDATE_BUG_ON, dtv, ENGINE_SET_EVENT, ENGINE_SET_INVALID_EVENT, FlowSetupPacket(), ICMPV4Vars_::hlen, ICMP_ADDRESS, ICMP_ADDRESSREPLY, Packet_::icmp_d, ICMP_DEST_UNREACH, ICMP_ECHO, ICMP_ECHOREPLY, ICMP_EXC_FRAGTIME, ICMP_INFO_REPLY, ICMP_INFO_REQUEST, ICMP_PARAMETERPROB, ICMP_REDIR_HOSTTOS, ICMP_REDIRECT, ICMP_ROUTERADVERT, Packet_::icmp_s, ICMP_SOURCE_QUENCH, ICMP_TIME_EXCEEDED, ICMP_TIMESTAMP, ICMP_TIMESTAMPREPLY, PacketL4::L4Vars::icmpv4, ICMPV4_HEADER_LEN, ICMPV4_HEADER_PKT_OFFSET, ICMPV4_IPV4_TRUNC_PKT, ICMPV4_PKT_TOO_SMALL, ICMPV4_UNKNOWN_CODE, ICMPV4_UNKNOWN_TYPE, ICMPv4GetCounterpart(), ICMPV4ExtHdr_::id, ICMPV4Vars_::id, Packet_::l4, len, NR_ICMP_UNREACH, Packet_::payload, Packet_::payload_len, Packet_::proto, SCLogDebug, ICMPV4ExtHdr_::seq, ICMPV4Vars_::seq, StatsIncr(), TM_ECODE_FAILED, TM_ECODE_OK, tv, ICMPV4Hdr_::type, type, Packet_::type, unlikely, and PacketL4::vars.
Referenced by DecodeIPV4().
void DecodeICMPV4RegisterTests | ( | void | ) |
Registers ICMPV4 unit test.
Definition at line 793 of file decode-icmpv4.c.
References UtRegisterTest().
int ICMPv4GetCounterpart | ( | uint8_t | type | ) |
type | counterpart type or -1 |
Definition at line 345 of file decode-icmpv4.c.
References CASE_CODE, ICMP_ADDRESS, ICMP_ADDRESSREPLY, ICMP_ECHO, ICMP_ECHOREPLY, ICMP_INFO_REPLY, ICMP_INFO_REQUEST, ICMP_ROUTERADVERT, ICMP_ROUTERSOLICIT, ICMP_TIMESTAMP, ICMP_TIMESTAMPREPLY, and type.
Referenced by DecodeICMPV4().