- Timestamp:
- 08/30/07 17:46:34 (16 years ago)
- Location:
- trunk/src
- Files:
-
- 2 removed
- 9 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/Makefile.am
r36 r47 11 11 remote_output.c fields_mgmt.h fields_mgmt.c pop.h renetcolParam.h 12 12 renetcolMsgCtl_SOURCES = renetcolMsgCtl.c 13 renetcolAgg_SOURCES = renetcolAgg.c renetcolAgg.h rrdwrap.h rrdwrap.cpop.h renetcolParam.h13 renetcolAgg_SOURCES = renetcolAgg.c renetcolAgg.h pop.h renetcolParam.h 14 14 BUILT_SOURCES = renetcol.o renetcolSender.o renetcolAgg.o 15 15 renetcol_LDADD = -ldl -lc_p -
trunk/src/dataFlowSet.c
r36 r47 173 173 cpt++; 174 174 j = 0; 175 pos = (pftmp->fieldType)* 10+j;175 pos = (pftmp->fieldType)*MAX_RULES_PER_FIELD+j; 176 176 field_size = (int) pftmp->fieldLength; 177 177 178 178 /* 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 ) { 180 181 if ( (((RuleDefPtr)(*(myPtrs->rulesAddressPtr+j)))->value->stor.lvalue) 181 182 == myPtrs->pcktPtr->ipH->srcAdd ) … … 791 792 * In a first time (until release 0.0.7, the information was sent via 792 793 * 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. 795 796 */ 796 797 tmpRuleList = myPtrs->rulesListPtr; … … 834 835 /* NEW transfert type */ 835 836 for ( ; tmpRL; tmpRL=tmpRL->next){ 836 if (tmpRL->id == tmpRuleList->id){ 837 if (tmpRL->id == tmpRuleList->id){ 837 838 s = sendMessage(tmpRL->host->sockId, myMsg.text, sizeof(myMsg.text), 838 839 tmpRL->host->hostAddressPtr); … … 844 845 } /* end if check */ 845 846 tmpRuleList = tmpRuleList->next; 847 tmpRL = myPtrs->rulesListPtr; /* ticket #11 */ 846 848 secondPftmp = tmp->lastField; 847 849 } /* end while tmpRuleList */ -
trunk/src/mysql_mgmt.c
r2 r47 2 2 * File: mysql_mgmt.c 3 3 * 4 * Authors: ANDREU Fran çois-Xavier4 * Authors: ANDREU Francois-Xavier 5 5 * 6 6 * Copyright (C) 2005 GIP RENATER -
trunk/src/mysql_mgmt.h
r2 r47 2 2 * File: mysql_mgmt.h 3 3 * 4 * Authors: ANDREU Fran çois-Xavier4 * Authors: ANDREU Francois-Xavier 5 5 * 6 6 * Copyright (C) 2005 GIP RENATER -
trunk/src/renetcol.c
r36 r47 155 155 shmForAgg->currentTable = 0; 156 156 shmForAgg->secondTable = 1; 157 shmForAgg->readed = 0; 157 158 158 159 myPtrs.rulesListPtr = NULL; … … 166 167 } 167 168 tmp = NULL; 168 /* printRule(rulesListPtr); */ 169 /* exit(1); */ 169 #ifdef DEBUG 170 printRule(rulesListPtr); 171 #endif 172 170 173 171 174 fprintf(stderr, "renetcol: I become a deamon, next messages via syslogd. By.\n"); … … 329 332 setCache(myPtrs.rulesListPtr); 330 333 sendReadRulesSignal(myQueue); 334 #ifdef DEBUG 335 printRule(myPtrs.rulesListPtr); 336 #endif 331 337 } 332 338 … … 355 361 RuleDefPtr def = NULL; 356 362 363 #ifdef DEBUG 364 fprintf(stderr,"Cache for Rules\n"); 365 #endif 357 366 while (tmp) { 358 367 def = tmp->def; … … 364 373 rulesAddress[def->fieldType][i] = def; 365 374 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 367 382 tmp = tmp->next; 368 383 } -
trunk/src/renetcolAgg.c
r36 r47 381 381 } 382 382 } 383 } 384 } 383 } /* end is first update */ 384 } /* end read ok */ 385 385 sleep(10); 386 386 } while (1); -
trunk/src/renetcolDB.c
r23 r47 2 2 * File: renetcolDB.c 3 3 * 4 * Authors: ANDREU Fran çois-Xavier4 * Authors: ANDREU Francois-Xavier 5 5 * 6 6 * Copyright (C) 2007 GIP RENATER -
trunk/src/renetcolDB.h
r23 r47 2 2 * File: renetcolDB.h 3 3 * 4 * Authors: ANDREU Fran çois-Xavier4 * Authors: ANDREU Francois-Xavier 5 5 * 6 6 * Copyright (C) 2007 GIP RENATER -
trunk/src/renetcolSender.c
r35 r47 70 70 if (length < 0){ 71 71 syslog(LOG_ERR, " read : %s", strerror(errno)); 72 close(sock); 72 73 return 1; 73 74 } … … 79 80 if (!(ruleFile = fopen(rulesFileName, "r"))) { 80 81 syslog (LOG_ERR, "error during %s opening\n", rulesFileName); 82 close(sock); 81 83 exit(1); 82 84 } else { … … 94 96 } 95 97 } else { 98 close(sock); 96 99 return 1; 97 100 } … … 106 109 if (!(tmpFile = fopen(FILE_TEMPO, "w"))) { 107 110 syslog (LOG_ERR, "error during %s opening", FILE_TEMPO); 111 close(sock); 108 112 return 1; 109 113 } else { … … 114 118 if (remove(rulesFileName)!=0){ 115 119 syslog(LOG_ERR, "rules.txt remove pb: %s", strerror(errno)); 120 close(sock); 116 121 return 1; 117 122 } 118 123 if (rename(FILE_TEMPO, rulesFileName)!=0){ 119 124 syslog(LOG_ERR, "rename file pb: %s", strerror(errno)); 125 close(sock); 120 126 return 1; 121 127 } … … 130 136 value) == 0) { 131 137 syslog (LOG_ERR, "error in recept rule: %s", buffer); 138 close(sock); 132 139 return 1; 133 140 } 134 141 if (!(ruleFile = fopen(rulesFileName, "a"))) { 135 142 syslog (LOG_ERR, "error during %s opening", rulesFileName); 143 close(sock); 136 144 return 1; 137 145 } else { … … 217 225 if (getnameinfo((struct sockaddr *) &clientAddress, 218 226 clientAddressLen, host, sizeof host, 219 NULL, (size_t) 0, 0) == 0) {227 NULL, (size_t) 0, NI_NUMERICHOST) == 0) { 220 228 syslog(LOG_INFO, 221 229 "New connection from %s", host);