Small cleanups.

remotes/origin/master-1.0.x
Victor Julien 16 years ago
parent 3046cf391d
commit 646262a755

@ -245,7 +245,7 @@ error:
} }
/** /**
* \brief this fucntion is used to add the parsed flowdata into the current signature * \brief this function is used to add the parsed flowdata into the current signature
* *
* \param de_ctx pointer to the Detection Engine Context * \param de_ctx pointer to the Detection Engine Context
* \param s pointer to the Current Signature * \param s pointer to the Current Signature
@ -321,7 +321,7 @@ int DetectFlowTestParse02 (void) {
if (fd->flags == FLOW_PKT_ESTABLISHED && fd->match_cnt == 1) { if (fd->flags == FLOW_PKT_ESTABLISHED && fd->match_cnt == 1) {
result = 1; result = 1;
} else { } else {
printf("We Expected 0x%02X cnt %d got 0x%02X cnt %d: ", FLOW_PKT_ESTABLISHED, 1, fd->flags, fd->match_cnt); printf("expected 0x%02X cnt %d got 0x%02X cnt %d: ", FLOW_PKT_ESTABLISHED, 1, fd->flags, fd->match_cnt);
} }
DetectFlowFree(fd); DetectFlowFree(fd);
} }
@ -340,7 +340,7 @@ int DetectFlowTestParse03 (void) {
if (fd->flags == FLOW_PKT_STATELESS && fd->match_cnt == 1) { if (fd->flags == FLOW_PKT_STATELESS && fd->match_cnt == 1) {
result = 1; result = 1;
} else { } else {
printf("We Expected 0x%02X cnt %d got 0x%02X cnt %d: ", FLOW_PKT_STATELESS, 1, fd->flags, fd->match_cnt); printf("expected 0x%02X cnt %d got 0x%02X cnt %d: ", FLOW_PKT_STATELESS, 1, fd->flags, fd->match_cnt);
} }
DetectFlowFree(fd); DetectFlowFree(fd);
} }
@ -359,7 +359,7 @@ int DetectFlowTestParse04 (void) {
if (fd->flags == FLOW_PKT_TOCLIENT && fd->match_cnt == 1) { if (fd->flags == FLOW_PKT_TOCLIENT && fd->match_cnt == 1) {
result = 1; result = 1;
} else { } else {
printf("We Expected 0x%02X cnt %d got 0x%02X cnt %d: ", FLOW_PKT_TOCLIENT, 1, fd->flags, fd->match_cnt); printf("expected 0x%02X cnt %d got 0x%02X cnt %d: ", FLOW_PKT_TOCLIENT, 1, fd->flags, fd->match_cnt);
} }
DetectFlowFree(fd); DetectFlowFree(fd);
} }
@ -378,7 +378,7 @@ int DetectFlowTestParse05 (void) {
if (fd->flags == FLOW_PKT_TOSERVER && fd->match_cnt == 1) { if (fd->flags == FLOW_PKT_TOSERVER && fd->match_cnt == 1) {
result = 1; result = 1;
} else { } else {
printf("We Expected 0x%02X cnt %d got 0x%02X cnt %d: ", FLOW_PKT_TOSERVER, 1, fd->flags, fd->match_cnt); printf("expected 0x%02X cnt %d got 0x%02X cnt %d: ", FLOW_PKT_TOSERVER, 1, fd->flags, fd->match_cnt);
} }
DetectFlowFree(fd); DetectFlowFree(fd);
} }
@ -397,7 +397,7 @@ int DetectFlowTestParse06 (void) {
if (fd->flags == FLOW_PKT_TOCLIENT && fd->match_cnt == 1) { if (fd->flags == FLOW_PKT_TOCLIENT && fd->match_cnt == 1) {
result = 1; result = 1;
} else { } else {
printf("We Expected 0x%02X cnt %d got 0x%02X cnt %d: ", FLOW_PKT_TOCLIENT, 1, fd->flags, fd->match_cnt); printf("expected 0x%02X cnt %d got 0x%02X cnt %d: ", FLOW_PKT_TOCLIENT, 1, fd->flags, fd->match_cnt);
} }
DetectFlowFree(fd); DetectFlowFree(fd);
} }
@ -416,7 +416,7 @@ int DetectFlowTestParse07 (void) {
if (fd->flags == FLOW_PKT_TOSERVER && fd->match_cnt == 1) { if (fd->flags == FLOW_PKT_TOSERVER && fd->match_cnt == 1) {
result = 1; result = 1;
} else { } else {
printf("We Expected 0x%02X cnt %d got 0x%02X cnt %d: ", FLOW_PKT_TOSERVER, 1, fd->flags, fd->match_cnt); printf("expected 0x%02X cnt %d got 0x%02X cnt %d: ", FLOW_PKT_TOSERVER, 1, fd->flags, fd->match_cnt);
} }
DetectFlowFree(fd); DetectFlowFree(fd);
} }
@ -435,7 +435,7 @@ int DetectFlowTestParse08 (void) {
if (fd->flags & FLOW_PKT_ESTABLISHED && fd->flags & FLOW_PKT_TOCLIENT && fd->match_cnt == 2) { if (fd->flags & FLOW_PKT_ESTABLISHED && fd->flags & FLOW_PKT_TOCLIENT && fd->match_cnt == 2) {
result = 1; result = 1;
} else { } else {
printf("We expected: 0x%02X cnt %d got 0x%02X cnt %d: ", FLOW_PKT_ESTABLISHED + FLOW_PKT_TOCLIENT, 2, fd->flags, fd->match_cnt); printf("expected: 0x%02X cnt %d got 0x%02X cnt %d: ", FLOW_PKT_ESTABLISHED + FLOW_PKT_TOCLIENT, 2, fd->flags, fd->match_cnt);
} }
DetectFlowFree(fd); DetectFlowFree(fd);
} }
@ -454,7 +454,7 @@ int DetectFlowTestParse09 (void) {
if (fd->flags & FLOW_PKT_STATELESS && fd->flags & FLOW_PKT_TOCLIENT && fd->match_cnt == 2) { if (fd->flags & FLOW_PKT_STATELESS && fd->flags & FLOW_PKT_TOCLIENT && fd->match_cnt == 2) {
result = 1; result = 1;
} else { } else {
printf("We expected: 0x%02X cnt %d got 0x%02X cnt %d: ", FLOW_PKT_STATELESS + FLOW_PKT_TOCLIENT, 2, fd->flags, fd->match_cnt); printf("expected: 0x%02X cnt %d got 0x%02X cnt %d: ", FLOW_PKT_STATELESS + FLOW_PKT_TOCLIENT, 2, fd->flags, fd->match_cnt);
} }
DetectFlowFree(fd); DetectFlowFree(fd);
} }
@ -473,7 +473,7 @@ int DetectFlowTestParse10 (void) {
if (fd->flags & FLOW_PKT_STATELESS && fd->flags & FLOW_PKT_TOCLIENT && fd->match_cnt == 2){ if (fd->flags & FLOW_PKT_STATELESS && fd->flags & FLOW_PKT_TOCLIENT && fd->match_cnt == 2){
result = 1; result = 1;
} else { } else {
printf("We expected: 0x%02X cnt %d got 0x%02X cnt %d: ", FLOW_PKT_STATELESS + FLOW_PKT_TOCLIENT, 2, fd->flags, fd->match_cnt); printf("expected: 0x%02X cnt %d got 0x%02X cnt %d: ", FLOW_PKT_STATELESS + FLOW_PKT_TOCLIENT, 2, fd->flags, fd->match_cnt);
} }
DetectFlowFree(fd); DetectFlowFree(fd);
} }
@ -492,7 +492,7 @@ int DetectFlowTestParse11 (void) {
if (fd->flags & FLOW_PKT_STATELESS && fd->flags & FLOW_PKT_TOCLIENT && fd->match_cnt == 2){ if (fd->flags & FLOW_PKT_STATELESS && fd->flags & FLOW_PKT_TOCLIENT && fd->match_cnt == 2){
result = 1; result = 1;
} else { } else {
printf("We expected: 0x%02X cnt %d got 0x%02X cnt %d: ", FLOW_PKT_STATELESS + FLOW_PKT_TOCLIENT, 2, fd->flags, fd->match_cnt); printf("expected: 0x%02X cnt %d got 0x%02X cnt %d: ", FLOW_PKT_STATELESS + FLOW_PKT_TOCLIENT, 2, fd->flags, fd->match_cnt);
} }
DetectFlowFree(fd); DetectFlowFree(fd);
} }
@ -508,7 +508,7 @@ int DetectFlowTestParse12 (void) {
DetectFlowData *fd = NULL; DetectFlowData *fd = NULL;
fd = DetectFlowParse("from_server:stateless"); fd = DetectFlowParse("from_server:stateless");
if (fd != NULL) { if (fd != NULL) {
printf("We expected: NULL got 0x%02X %d: ",fd->flags, fd->match_cnt); printf("expected: NULL got 0x%02X %d: ",fd->flags, fd->match_cnt);
result = 0; result = 0;
DetectFlowFree(fd); DetectFlowFree(fd);
} }
@ -524,7 +524,7 @@ int DetectFlowTestParse13 (void) {
DetectFlowData *fd = NULL; DetectFlowData *fd = NULL;
fd = DetectFlowParse("invalidoptiontest"); fd = DetectFlowParse("invalidoptiontest");
if (fd != NULL) { if (fd != NULL) {
printf("We expected: NULL got 0x%02X %d: ",fd->flags, fd->match_cnt); printf("expected: NULL got 0x%02X %d: ",fd->flags, fd->match_cnt);
result = 0; result = 0;
DetectFlowFree(fd); DetectFlowFree(fd);
} }
@ -539,7 +539,7 @@ int DetectFlowTestParse14 (void) {
DetectFlowData *fd = NULL; DetectFlowData *fd = NULL;
fd = DetectFlowParse(""); fd = DetectFlowParse("");
if (fd != NULL) { if (fd != NULL) {
printf("We expected: NULL got 0x%02X %d: ",fd->flags, fd->match_cnt); printf("expected: NULL got 0x%02X %d: ",fd->flags, fd->match_cnt);
result = 0; result = 0;
DetectFlowFree(fd); DetectFlowFree(fd);
} }
@ -555,7 +555,7 @@ int DetectFlowTestParse15 (void) {
DetectFlowData *fd = NULL; DetectFlowData *fd = NULL;
fd = DetectFlowParse("established,stateless"); fd = DetectFlowParse("established,stateless");
if (fd != NULL) { if (fd != NULL) {
printf("We expected: NULL got 0x%02X %d: ",fd->flags, fd->match_cnt); printf("expected: NULL got 0x%02X %d: ",fd->flags, fd->match_cnt);
result = 0; result = 0;
DetectFlowFree(fd); DetectFlowFree(fd);
} }
@ -571,7 +571,7 @@ int DetectFlowTestParse16 (void) {
DetectFlowData *fd = NULL; DetectFlowData *fd = NULL;
fd = DetectFlowParse("to_client,to_server"); fd = DetectFlowParse("to_client,to_server");
if (fd != NULL) { if (fd != NULL) {
printf("We expected: NULL got 0x%02X %d: ",fd->flags, fd->match_cnt); printf("expected: NULL got 0x%02X %d: ",fd->flags, fd->match_cnt);
result = 0; result = 0;
DetectFlowFree(fd); DetectFlowFree(fd);
} }
@ -588,7 +588,7 @@ int DetectFlowTestParse17 (void) {
DetectFlowData *fd = NULL; DetectFlowData *fd = NULL;
fd = DetectFlowParse("to_client,from_server"); fd = DetectFlowParse("to_client,from_server");
if (fd != NULL) { if (fd != NULL) {
printf("We expected: NULL got 0x%02X %d: ",fd->flags, fd->match_cnt); printf("expected: NULL got 0x%02X %d: ",fd->flags, fd->match_cnt);
result = 0; result = 0;
DetectFlowFree(fd); DetectFlowFree(fd);
} }
@ -607,7 +607,7 @@ int DetectFlowTestParse18 (void) {
if (fd->flags & FLOW_PKT_ESTABLISHED && fd->flags & FLOW_PKT_TOCLIENT && fd->flags & FLOW_PKT_STREAMONLY && fd->match_cnt == 3) { if (fd->flags & FLOW_PKT_ESTABLISHED && fd->flags & FLOW_PKT_TOCLIENT && fd->flags & FLOW_PKT_STREAMONLY && fd->match_cnt == 3) {
result = 1; result = 1;
} else { } else {
printf("We Expected 0x%02X cnt %d got 0x%02X cnt %d: ", FLOW_PKT_ESTABLISHED + FLOW_PKT_TOCLIENT + FLOW_PKT_STREAMONLY, 3, printf("expected 0x%02X cnt %d got 0x%02X cnt %d: ", FLOW_PKT_ESTABLISHED + FLOW_PKT_TOCLIENT + FLOW_PKT_STREAMONLY, 3,
fd->flags, fd->match_cnt); fd->flags, fd->match_cnt);
} }
DetectFlowFree(fd); DetectFlowFree(fd);
@ -624,7 +624,7 @@ int DetectFlowTestParse19 (void) {
DetectFlowData *fd = NULL; DetectFlowData *fd = NULL;
fd = DetectFlowParse("from_server,established,stream_only,a"); fd = DetectFlowParse("from_server,established,stream_only,a");
if (fd != NULL) { if (fd != NULL) {
printf("We expected: NULL got 0x%02X %d: ",fd->flags, fd->match_cnt); printf("expected: NULL got 0x%02X %d: ",fd->flags, fd->match_cnt);
result = 0; result = 0;
DetectFlowFree(fd); DetectFlowFree(fd);
} }
@ -642,7 +642,7 @@ int DetectFlowTestParse20 (void) {
if (fd->flags & FLOW_PKT_ESTABLISHED && fd->flags & FLOW_PKT_TOCLIENT && fd->flags & FLOW_PKT_NOSTREAM && fd->match_cnt == 3) { if (fd->flags & FLOW_PKT_ESTABLISHED && fd->flags & FLOW_PKT_TOCLIENT && fd->flags & FLOW_PKT_NOSTREAM && fd->match_cnt == 3) {
result = 1; result = 1;
} else { } else {
printf("We Expected 0x%02X cnt %d got 0x%02X cnt %d: ", FLOW_PKT_ESTABLISHED + FLOW_PKT_TOCLIENT + FLOW_PKT_NOSTREAM, 3, printf("expected 0x%02X cnt %d got 0x%02X cnt %d: ", FLOW_PKT_ESTABLISHED + FLOW_PKT_TOCLIENT + FLOW_PKT_NOSTREAM, 3,
fd->flags, fd->match_cnt); fd->flags, fd->match_cnt);
} }
@ -660,7 +660,7 @@ int DetectFlowTestParse21 (void) {
DetectFlowData *fd = NULL; DetectFlowData *fd = NULL;
fd = DetectFlowParse("from_server,a,no_stream"); fd = DetectFlowParse("from_server,a,no_stream");
if (fd != NULL) { if (fd != NULL) {
printf("We expected: NULL got 0x%02X %d: ",fd->flags, fd->match_cnt); printf("expected: NULL got 0x%02X %d: ",fd->flags, fd->match_cnt);
result = 0; result = 0;
DetectFlowFree(fd); DetectFlowFree(fd);
} }

Loading…
Cancel
Save