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_IPV6(src, dst)
 
#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 55 of file reputation.c.

◆ TEST_CLEANUP_WITH_PACKET

#define TEST_CLEANUP_WITH_PACKET
Value:
TEST_CLEANUP

Definition at line 58 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 47 of file reputation.c.

◆ TEST_INIT_WITH_PACKET_IPV6

#define TEST_INIT_WITH_PACKET_IPV6 (   src,
  dst 
)
Value:
uint8_t *buf = (uint8_t *)"Hi all!"; \
uint16_t buflen = strlen((char *)buf); \
Packet *p = UTHBuildPacketIPV6SrcDst((uint8_t *)buf, buflen, IPPROTO_TCP, (src), (dst)); \
FAIL_IF(p == NULL); \
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 174 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:148
DetectEngineCtx_
main detection engine ctx
Definition: detect.h:841
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:359
de_ctx
DetectEngineCtx * de_ctx
Definition: fuzz_siginit.c:17
UTHBuildPacketIPV6SrcDst
Packet * UTHBuildPacketIPV6SrcDst(uint8_t *payload, uint16_t payload_len, uint8_t ipproto, const char *src, const char *dst)
UTHBuildPacketSrcDst is a wrapper that build packets specifying IPs and defaulting ports (IPV6)
Definition: util-unittest-helper.c:418
UTHFreePacket
void UTHFreePacket(Packet *p)
UTHFreePacket: function to release the allocated data from UTHBuildPacket and the packet itself.
Definition: util-unittest-helper.c:467
src
uint16_t src
Definition: app-layer-dnp3.h:5
DetectEngineCtxInit
DetectEngineCtx * DetectEngineCtxInit(void)
Definition: detect-engine.c:2558
dst
uint16_t dst
Definition: app-layer-dnp3.h:4