Logo Search packages:      
Sourcecode: hlbr version File versions  Download package

int TCPListContentAddNode ( int  TestID,
int  RuleID,
char *  Args 

Add a rule node to this test

TestID Number of this test in the Globals.Tests[] array
RuleID Number of the rule in the Globals.Rules[] array
Args File name of the word list
TRUE if successful or FALSE in case of failure

Definition at line 95 of file test_tcp_listcontent.c.

Referenced by InitTestTCPListContent().

      TCPListContentData*     data;
      FILE*             listf;
      char              LineBuff[10240];

      printf("In TCPListContentAddNode\n");

      listf = fopen(Args, "r");
      if (!listf){
            printf("Couldn't open file %s for 'tcp listcontent' test\n", Args);
            return FALSE;

#ifdef DEBUG
      printf("Adding a Node with args from file %s\n", Args);

//                data=calloc(sizeof(TCPListContentData),1);
//                snprintf(data->tcp_content, MAX_CONTENT_LEN, "%s", Args);

      while (GetLine(listf, LineBuff, 10240)) {
#ifdef DEBUG
                  printf("Adding: %s\n", LineBuff);

                  if (!AddStringJTree(&TCPListContentTree, LineBuff, strlen(LineBuff), RuleID)) {
                              printf("Failed to add to tree\n");
//                            free(data);
//                            data=NULL;
                              return FALSE;

      return TestAddNode(TestID, RuleID, (void*)data);

Generated by  Doxygen 1.6.0   Back to index