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 54 of file reputation.c.

◆ TEST_CLEANUP_WITH_PACKET

#define TEST_CLEANUP_WITH_PACKET
Value:
#define TEST_CLEANUP
Definition reputation.c:54
void UTHFreePacket(Packet *p)
UTHFreePacket: function to release the allocated data from UTHBuildPacket and the packet itself.

Definition at line 57 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;
DetectEngineCtx * DetectEngineCtxInit(void)
DetectEngineCtx * de_ctx
main detection engine ctx
Definition detect.h:932
Author
Giuseppe Longo giuse.nosp@m.ppe@.nosp@m.glong.nosp@m.o.it

Definition at line 31 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); \
Address src
Definition decode.h:505
#define TEST_INIT
Definition reputation.c:31
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.
uint32_t UTHSetIPv4Address(const char *str)
return the uint32_t for a ipv4 address string

Definition at line 46 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); \
uint16_t dst
uint16_t src
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 at line 39 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: