Skip to content

Commit

Permalink
reputation: double category and score
Browse files Browse the repository at this point in the history
This doubles number of categories and reputation score.

Ticket OISF#2759.
  • Loading branch information
glongo committed Mar 9, 2019
1 parent 1394fad commit 6b4eca0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/reputation.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@

#include "host.h"

#define SREP_MAX_CATS 60
#define SREP_MAX_VAL 127
#define SREP_MAX_CATS 120
#define SREP_MAX_VAL 255

typedef struct SRepCIDRTree_ {
SCRadixTree *srepIPV4_tree[SREP_MAX_CATS];
Expand Down
15 changes: 15 additions & 0 deletions src/tests/reputation.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,20 @@ static int SRepTest07(void) {
PASS;
}

static int SRepTest08(void)
{
TEST_INIT;

char str[] = "1.2.3.4,100,255";
FAIL_IF(SRepSplitLine(de_ctx->srepCIDR_ctx, str, &ip_addr, &cat, &value) != 0);
FAIL_IF(strcmp(ip_addr, "1.2.3.4") != 0);
FAIL_IF(cat != 100);
FAIL_IF(value != 255);

TEST_CLEANUP;
PASS;
}

/** Register the following unittests for the Reputation module */
void SCReputationRegisterTests(void)
{
Expand All @@ -154,4 +168,5 @@ void SCReputationRegisterTests(void)
UtRegisterTest("SRepTest05", SRepTest05);
UtRegisterTest("SRepTest06", SRepTest06);
UtRegisterTest("SRepTest07", SRepTest07);
UtRegisterTest("SRepTest08", SRepTest08);
}

0 comments on commit 6b4eca0

Please sign in to comment.