suricata
reputation.c File Reference
Include dependency graph for reputation.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define TEST_INIT
 
#define TEST_INIT_WITH_PACKET(ip)
 
#define TEST_CLEANUP   DetectEngineCtxFree(de_ctx);
 
#define TEST_CLEANUP_WITH_PACKET
 

Functions

void SCReputationRegisterTests (void)
 

Macro Definition Documentation

◆ TEST_CLEANUP

#define TEST_CLEANUP   DetectEngineCtxFree(de_ctx);

Definition at line 48 of file reputation.c.

◆ TEST_CLEANUP_WITH_PACKET

#define TEST_CLEANUP_WITH_PACKET
Value:
TEST_CLEANUP

Definition at line 51 of file reputation.c.

◆ TEST_INIT

#define TEST_INIT
Value:
FAIL_IF(de_ctx == NULL); \
SRepInit(de_ctx); \
\
Address a; \
uint8_t cat = 0, value = 0;
Author
Giuseppe Longo giuse.nosp@m.ppe@.nosp@m.glong.nosp@m.o.it

Definition at line 32 of file reputation.c.

◆ TEST_INIT_WITH_PACKET

#define TEST_INIT_WITH_PACKET (   ip)
Value:
uint8_t *buf = (uint8_t *)"Hi all!"; \
uint16_t buflen = strlen((char *)buf); \
Packet *p = UTHBuildPacket((uint8_t *)buf, buflen, IPPROTO_TCP); \
FAIL_IF(p == NULL); \
p->src.addr_data32[0] = UTHSetIPv4Address(ip); \
TEST_INIT

Definition at line 40 of file reputation.c.

Function Documentation

◆ SCReputationRegisterTests()

void SCReputationRegisterTests ( void  )

Register the following unittests for the Reputation module

Definition at line 147 of file reputation.c.

References UtRegisterTest().

Here is the call graph for this function:
UTHSetIPv4Address
uint32_t UTHSetIPv4Address(const char *str)
return the uint32_t for a ipv4 address string
Definition: util-unittest-helper.c:131
DetectEngineCtx_
main detection engine ctx
Definition: detect.h:766
UTHBuildPacket
Packet * UTHBuildPacket(uint8_t *payload, uint16_t payload_len, uint8_t ipproto)
UTHBuildPacket is a wrapper that build packets with default ip and port fields.
Definition: util-unittest-helper.c:336
de_ctx
DetectEngineCtx * de_ctx
Definition: fuzz_siginit.c:17
UTHFreePacket
void UTHFreePacket(Packet *p)
UTHFreePacket: function to release the allocated data from UTHBuildPacket and the packet itself.
Definition: util-unittest-helper.c:484
DetectEngineCtxInit
DetectEngineCtx * DetectEngineCtxInit(void)
Definition: detect-engine.c:2044