- Timestamp:
- 07/24/08 10:47:32 (15 years ago)
- Location:
- trunk/src
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/dataFlowSet.c
r72 r73 153 153 * progression in a data flow Set 154 154 * notes: 155 * 48=header ip + header netf 156 * shift = shift if there is a template declaration 155 * 48= IP header size + NetFlow header size 156 * shift = shift because we have a template declaration 157 * inside data templates 157 158 */ 158 159 cpt++; … … 273 274 (*myPtrs->offsetV9Ptr)++; 274 275 /* FIXME : here , add a check on the field type */ 275 if ((pftmp->fieldType==8)||(pftmp->fieldType==12)){ 276 if ((pftmp->fieldType==8)||(pftmp->fieldType==12) 277 ||(pftmp->fieldType==15)||(pftmp->fieldType==18)){ 276 278 if ((((RuleDefPtr)(*(myPtrs->rulesAddressPtr+pos)))->value->stor.lvalue) 277 279 == (*((unsigned long*)&buffer4))>>(32-((RuleDefPtr)(*(myPtrs->rulesAddressPtr+pos)))->value->mask)<<(32-((RuleDefPtr)(*(myPtrs->rulesAddressPtr+pos)))->value->mask) ) … … 804 806 * the process renetcolSender with an IPC message queue. But, the perf 805 807 * of IPC Msg was very bad with a default system compilation. 806 * So, now, we send information directly from here viasockets.808 * So, now, we send information directly from here through sockets. 807 809 */ 808 810 tmpRuleList = myPtrs->rulesListPtr; -
trunk/src/renetcolParam.h
r65 r73 48 48 * FILE with your prefix/subnet 49 49 */ 50 #define SUBNETS_LIST "<path to renetcol>/renetcol-0.0.12beta/conf/IPv4_ prefix.txt"50 #define SUBNETS_LIST "<path to renetcol>/renetcol-0.0.12beta/conf/IPv4_Subnet_Aggregation_based_on_SNMP_index.txt" 51 51 /* 52 52 * FILE with the list of AS with accounting … … 67 67 * tagged "C"ustomers or "B"ackbone 68 68 */ 69 #define INTERFACES_TYPE_LIST " "69 #define INTERFACES_TYPE_LIST "<path to renetcol>/renetcol-0.0.12beta/conf/SNMP_INDEX.txt" 70 70 /* 71 71 * maximum SNMP index -
trunk/src/renetcolSender.c
r72 r73 52 52 FILE *ruleFile; 53 53 FILE *tmpFile; 54 char field[4];55 54 char port[6]; 56 char value[44];57 55 char filters[249]; 58 char operator[2];59 char poubelle[2];60 56 char lines[256][256]; 61 57 char line[256]; … … 66 62 int i = 0; 67 63 int ruleToDelete = 0; 64 static char * fields; 68 65 69 66 while (1){ … … 131 128 } else { 132 129 /* NEW RULE */ 133 /* if (sscanf(buffer, "%s %s %1s %s\n",*/ 134 /* port, */ 135 /* field, */ 136 /* operator, */ 137 /* value) == 0) { */ 138 if (sscanf(buffer, "%s %1s %s\n", 139 port, 140 poubelle, 141 filters) == 0) { 142 syslog (LOG_ERR, "error in recept rule: %s", buffer); 143 close(sock); 144 return 1; 145 } 130 if (sscanf(buffer, "%s %s\n", 131 port, 132 filters) == 0) { 133 syslog (LOG_ERR, "error in rule syntax: %s", filters); 134 close(sock); 135 return 1; 136 } 137 subsstr(filters); 146 138 if (!(ruleFile = fopen(RULES_FILE, "a"))) { 147 148 149 139 syslog (LOG_ERR, "error during %s opening", RULES_FILE); 140 close(sock); 141 return 1; 150 142 } else { 151 152 153 /* fprintf(ruleFile, "C %s %s %s\n", field, operator, value); */ 154 fprintf(ruleFile, "%s\n", filters);155 fclose(ruleFile); 156 } 143 fprintf(ruleFile, "N %s\n", host); 144 fprintf(ruleFile, "O socket %s %s\n", host, port); 145 fprintf(ruleFile, "%s\n", filters); 146 fclose(ruleFile); 147 } 148 157 149 } 158 150 }