43 const uint8_t *pkt, uint32_t
len)
84static int DecodeRawTest01 (
void)
89 0x60, 0x00, 0x00, 0x00, 0x00, 0x28, 0x06, 0x40,
90 0x20, 0x01, 0x06, 0x18, 0x04, 0x00, 0x00, 0x00,
91 0x00, 0x00, 0x00, 0x00, 0x51, 0x99, 0xcc, 0x70,
92 0x20, 0x01, 0x06, 0x18, 0x00, 0x01, 0x80, 0x00,
93 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05,
94 0x8c, 0x9b, 0x00, 0x50, 0x6a, 0xe7, 0x07, 0x36,
95 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 0x16, 0x30,
96 0x29, 0x9c, 0x00, 0x00, 0x02, 0x04, 0x05, 0x8c,
97 0x04, 0x02, 0x08, 0x0a, 0x00, 0xdd, 0x1a, 0x39,
98 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x03, 0x02 };
128static int DecodeRawTest02 (
void)
133 0x45, 0x00, 0x00, 0x30, 0x00, 0xad, 0x40, 0x00,
134 0x7f, 0x06, 0xac, 0xc5, 0xc0, 0xa8, 0x67, 0x02,
135 0xc0, 0xa8, 0x66, 0x02, 0x0b, 0xc7, 0x00, 0x50,
136 0x1d, 0xb3, 0x12, 0x37, 0x00, 0x00, 0x00, 0x00,
137 0x70, 0x02, 0x40, 0x00, 0xb8, 0xc8, 0x00, 0x00,
138 0x02, 0x04, 0x05, 0xb4, 0x01, 0x01, 0x04, 0x02 };
168static int DecodeRawTest03 (
void)
173 0xdf, 0x00, 0x00, 0x3d, 0x49, 0x42, 0x40, 0x00,
174 0x40, 0x06, 0xcf, 0x8a, 0x0a, 0x1f, 0x03, 0xaf,
175 0x0a, 0x1f, 0x0a, 0x02, 0xa5, 0xe7, 0xde, 0xad,
176 0x00, 0x0c, 0xe2, 0x0e, 0x8b, 0xfe, 0x0c, 0xe7,
177 0x80, 0x18, 0x00, 0xb7, 0xaf, 0xeb, 0x00, 0x00,
178 0x01, 0x01, 0x08, 0x0a, 0x00, 0x08, 0xab, 0x4f,
179 0x34, 0x40, 0x67, 0x31, 0x3b, 0x63, 0x61, 0x74,
180 0x20, 0x6b, 0x65, 0x79, 0x3b };
200 printf(
"expected IPRAW_INVALID_IPV to be set but it wasn't: ");
void StatsIncr(ThreadVars *tv, uint16_t id)
Increments the local counter.
int DecodeIPV4(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, const uint8_t *pkt, uint16_t len)
int DecodeIPV6(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, const uint8_t *pkt, uint16_t len)
void DecodeRawRegisterTests(void)
Registers Raw unit tests.
int DecodeRaw(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, const uint8_t *pkt, uint32_t len)
#define ENGINE_SET_INVALID_EVENT(p, e)
#define ENGINE_ISSET_EVENT(p, e)
#define IP_GET_RAW_VER(pkt)
#define ENGINE_SET_EVENT(p, e)
void FlowInitConfig(bool quiet)
initialize the configuration
void FlowShutdown(void)
shutdown the flow engine
void UtRegisterTest(const char *name, int(*TestFn)(void))
Register unit test.
#define FAIL_IF_NOT(expr)
Fail a test if expression evaluates to false.
Packet * PacketGetFromAlloc(void)
Get a malloced packet.
int PacketCopyData(Packet *p, const uint8_t *pktdata, uint32_t pktlen)
Copy data to Packet payload and set packet length.
void PacketRecycle(Packet *p)
Structure to hold thread specific data for all decode modules.
Per thread variable structure.
#define DEBUG_VALIDATE_BUG_ON(exp)