Changeset 47 for trunk/src

Show
Ignore:
Timestamp:
08/30/07 17:46:34 (16 years ago)
Author:
andreu
Message:

merge from tag REL-0.0.11beta

Location:
trunk/src
Files:
2 removed
9 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/Makefile.am

    r36 r47  
    1111        remote_output.c fields_mgmt.h fields_mgmt.c pop.h renetcolParam.h 
    1212renetcolMsgCtl_SOURCES = renetcolMsgCtl.c 
    13 renetcolAgg_SOURCES = renetcolAgg.c renetcolAgg.h rrdwrap.h rrdwrap.c pop.h renetcolParam.h 
     13renetcolAgg_SOURCES = renetcolAgg.c renetcolAgg.h pop.h renetcolParam.h 
    1414BUILT_SOURCES = renetcol.o renetcolSender.o renetcolAgg.o 
    1515renetcol_LDADD = -ldl -lc_p 
  • trunk/src/dataFlowSet.c

    r36 r47  
    173173      cpt++; 
    174174      j = 0; 
    175       pos = (pftmp->fieldType)*10+j; 
     175      pos = (pftmp->fieldType)*MAX_RULES_PER_FIELD+j; 
    176176      field_size = (int) pftmp->fieldLength; 
    177177       
    178178      /* special case: check yes on all flows from one router (phantom field nb 0) */ 
    179       while ( ((RuleDefPtr)(*(myPtrs->rulesAddressPtr+j))) != NULL ) {   
     179      /* FIXME : this code is repeated, perhaps past before */ 
     180      while ( ((RuleDefPtr)(*(myPtrs->rulesAddressPtr+j))) != NULL ) { 
    180181        if  ( (((RuleDefPtr)(*(myPtrs->rulesAddressPtr+j)))->value->stor.lvalue) 
    181182              == myPtrs->pcktPtr->ipH->srcAdd ) 
     
    791792         * In a first time (until release 0.0.7, the information was sent via 
    792793         * the process renetcolSender with an IPC message queue. But, the perf 
    793          * of IPC Msg was very bad with a system compilation by default. 
    794          * So now, we send information directly from here. 
     794         * of IPC Msg was very bad with a default system compilation. 
     795         * So, now, we send information directly from here. 
    795796         */ 
    796797        tmpRuleList = myPtrs->rulesListPtr; 
     
    834835            /* NEW transfert type */ 
    835836            for ( ; tmpRL; tmpRL=tmpRL->next){ 
    836               if (tmpRL->id == tmpRuleList->id){ 
     837              if (tmpRL->id == tmpRuleList->id){         
    837838                s = sendMessage(tmpRL->host->sockId, myMsg.text, sizeof(myMsg.text), 
    838839                                tmpRL->host->hostAddressPtr); 
     
    844845          } /* end if check */ 
    845846          tmpRuleList = tmpRuleList->next; 
     847          tmpRL = myPtrs->rulesListPtr; /* ticket #11 */ 
    846848          secondPftmp = tmp->lastField; 
    847849        } /* end while tmpRuleList */ 
  • trunk/src/mysql_mgmt.c

    r2 r47  
    22 * File: mysql_mgmt.c 
    33 *  
    4  * Authors: ANDREU François-Xavier  
     4 * Authors: ANDREU Francois-Xavier  
    55 * 
    66 * Copyright (C) 2005 GIP RENATER  
  • trunk/src/mysql_mgmt.h

    r2 r47  
    22 * File: mysql_mgmt.h 
    33 *  
    4  * Authors: ANDREU François-Xavier  
     4 * Authors: ANDREU Francois-Xavier  
    55 * 
    66 * Copyright (C) 2005 GIP RENATER  
  • trunk/src/renetcol.c

    r36 r47  
    155155  shmForAgg->currentTable = 0; 
    156156  shmForAgg->secondTable = 1; 
     157  shmForAgg->readed = 0; 
    157158 
    158159  myPtrs.rulesListPtr = NULL; 
     
    166167  } 
    167168  tmp = NULL; 
    168 /*   printRule(rulesListPtr); */ 
    169 /*   exit(1); */ 
     169#ifdef DEBUG 
     170  printRule(rulesListPtr); 
     171#endif 
     172 
    170173 
    171174  fprintf(stderr, "renetcol: I become a deamon, next messages via syslogd. By.\n"); 
     
    329332  setCache(myPtrs.rulesListPtr); 
    330333  sendReadRulesSignal(myQueue); 
     334#ifdef DEBUG 
     335  printRule(myPtrs.rulesListPtr); 
     336#endif 
    331337} 
    332338 
     
    355361  RuleDefPtr def = NULL; 
    356362 
     363#ifdef DEBUG 
     364  fprintf(stderr,"Cache for Rules\n"); 
     365#endif  
    357366  while (tmp) { 
    358367    def = tmp->def; 
     
    364373      rulesAddress[def->fieldType][i] = def; 
    365374      def = def->next; 
    366     } 
     375#ifdef DEBUG 
     376      fprintf(stderr,"%d: %d ", def->fieldType, i); 
     377#endif      
     378    } 
     379#ifdef DEBUG 
     380    fprintf(stderr,"\n"); 
     381#endif       
    367382    tmp = tmp->next; 
    368383  } 
  • trunk/src/renetcolAgg.c

    r36 r47  
    381381          } 
    382382        } 
    383       }  
    384     }  
     383      } /* end is first update */  
     384    } /* end read ok */ 
    385385    sleep(10); 
    386386  } while (1); 
  • trunk/src/renetcolDB.c

    r23 r47  
    22 * File: renetcolDB.c 
    33 *  
    4  * Authors: ANDREU François-Xavier  
     4 * Authors: ANDREU Francois-Xavier  
    55 * 
    66 * Copyright (C) 2007 GIP RENATER  
  • trunk/src/renetcolDB.h

    r23 r47  
    22 * File: renetcolDB.h 
    33 *  
    4  * Authors: ANDREU François-Xavier  
     4 * Authors: ANDREU Francois-Xavier  
    55 * 
    66 * Copyright (C) 2007 GIP RENATER  
  • trunk/src/renetcolSender.c

    r35 r47  
    7070    if (length < 0){ 
    7171      syslog(LOG_ERR, " read : %s", strerror(errno)); 
     72      close(sock); 
    7273      return 1; 
    7374    } 
     
    7980      if (!(ruleFile = fopen(rulesFileName, "r"))) { 
    8081        syslog (LOG_ERR, "error during %s opening\n", rulesFileName); 
     82        close(sock); 
    8183        exit(1); 
    8284      } else { 
     
    9496              } 
    9597            } else { 
     98              close(sock); 
    9699              return 1; 
    97100            } 
     
    106109        if (!(tmpFile = fopen(FILE_TEMPO, "w"))) { 
    107110          syslog (LOG_ERR, "error during %s opening", FILE_TEMPO); 
     111          close(sock); 
    108112          return 1; 
    109113        } else { 
     
    114118          if (remove(rulesFileName)!=0){ 
    115119            syslog(LOG_ERR, "rules.txt remove pb: %s", strerror(errno)); 
     120            close(sock); 
    116121            return 1; 
    117122          } 
    118123          if (rename(FILE_TEMPO, rulesFileName)!=0){ 
    119124            syslog(LOG_ERR, "rename file pb: %s", strerror(errno)); 
     125            close(sock); 
    120126            return 1; 
    121127          } 
     
    130136                 value) == 0) { 
    131137        syslog (LOG_ERR, "error in recept rule: %s", buffer); 
     138        close(sock); 
    132139        return 1; 
    133140      } 
    134141      if (!(ruleFile = fopen(rulesFileName, "a"))) { 
    135142        syslog (LOG_ERR, "error during %s opening", rulesFileName); 
     143        close(sock); 
    136144        return 1; 
    137145      } else { 
     
    217225    if (getnameinfo((struct sockaddr *) &clientAddress, 
    218226                    clientAddressLen, host, sizeof host, 
    219                     NULL, (size_t) 0, 0) == 0) { 
     227                    NULL, (size_t) 0, NI_NUMERICHOST) == 0) { 
    220228      syslog(LOG_INFO,  
    221229             "New connection from %s", host);