- Timestamp:
- 10/25/07 07:23:46 (15 years ago)
- Location:
- trunk/src
- Files:
-
- 2 added
- 11 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/Makefile.am
r47 r60 6 6 dataFlowSet.h get_conf.c get_conf.h rules_mgmt.c rules_mgmt.h \ 7 7 remote_output.h remote_output.c prefix_mgmt.h prefix_mgmt.c \ 8 pop.h renetcolParam.h 8 pop.h renetcolParam.h as.h as.c 9 9 renetcolSender_SOURCES = renetcolSender.c renetcolSender.h msg_mgmt.h \ 10 10 msg_mgmt.c rules_mgmt.c rules_mgmt.h remote_output.h \ 11 remote_output.c fields_mgmt.h fields_mgmt.c pop.h renetcolParam.h 11 remote_output.c fields_mgmt.h fields_mgmt.c pop.h renetcolParam.h\ 12 as.h as.c 12 13 renetcolMsgCtl_SOURCES = renetcolMsgCtl.c 13 renetcolAgg_SOURCES = renetcolAgg.c renetcolAgg.h pop.h renetcolParam.h 14 renetcolAgg_SOURCES = renetcolAgg.c renetcolAgg.h pop.h renetcolParam.h as.h 14 15 BUILT_SOURCES = renetcol.o renetcolSender.o renetcolAgg.o 15 16 renetcol_LDADD = -ldl -lc_p -
trunk/src/dataFlowSet.c
r59 r60 66 66 unsigned short tplMsgType = 11; 67 67 struct PrefixV4 prefixKey, *res, *res2; /* for bsearch */ 68 #if defined(IPV4AGGIDSNMP) 69 struct PrefixV4 *res3; 70 #endif 71 #ifdef ASACC 72 struct AS asKey, *asres; /* for bsearch */ 73 #endif 68 74 struct AggCache agCache; 69 75 int bool = 0; /* in IPV4 Agg mode enabled, we need to now if it's an IPv4 */ … … 229 235 } 230 236 #endif 237 #ifdef ASACC 238 if (pftmp->fieldType==16){ 239 agCache.asS = *((unsigned short*)&buffer2); 240 } 241 if (pftmp->fieldType==17){ 242 agCache.asD = *((unsigned short*)&buffer2); 243 } 244 #endif 231 245 break; 232 246 case 3: … … 482 496 } 483 497 #endif 498 #ifdef ASACC 499 if (pftmp->fieldType==16){ 500 agCache.asS = *((unsigned short*)&buffer2); 501 } 502 if (pftmp->fieldType==17){ 503 agCache.asD = *((unsigned short*)&buffer2); 504 } 505 #endif 484 506 break; 485 507 case 3: … … 548 570 /* Aggregation mode must be enable in ./configure options */ 549 571 /* first we must know if the address belong to our prefix */ 572 /* 573 * AS ACCOUNTING 574 */ 575 #if defined(ASACC) && defined(IPV4AGGIDSNMP) 576 if ( (bool == 1) && (isMplsFlow == 0) ){ 577 asKey.as = agCache.asS; 578 asres = bsearch(&asKey, myPtrs->currentASTab, myPtrs->asNb, sizeof(struct AS), asGlobalCmp); 579 if (asres != NULL) { 580 if ( myPtrs->currentRouterPtr->snmpIndexList[agCache.inputSnmp] == 1 ) { 581 if (myPtrs->currentRouterPtr->sampled != 0 ){ 582 /* OUT ("traffic from the AS") */ 583 asres->bytesNbOUT += agCache.bytes; 584 asres->pktsNbOUT += agCache.pkts; 585 (asres->flowNbOUT)++; 586 } 587 if (asres->sampling == 0 588 && myPtrs->currentRouterPtr->sampled != 0){ 589 asres->sampling = myPtrs->currentRouterPtr->sampled; 590 } 591 asres = NULL; 592 asKey.as = agCache.asD; 593 asres = bsearch(&asKey, myPtrs->currentASTab, myPtrs->asNb, sizeof(struct AS), asGlobalCmp); 594 if (asres!=NULL){ 595 if (myPtrs->currentRouterPtr->sampled != 0 ){ 596 /* IN ("traffic to the AS") */ 597 asres->bytesNbIN += agCache.bytes; 598 asres->pktsNbIN += agCache.pkts; 599 (asres->flowNbIN)++; 600 } 601 if (asres->sampling == 0 602 && myPtrs->currentRouterPtr->sampled != 0){ 603 asres->sampling = myPtrs->currentRouterPtr->sampled; 604 } 605 asres = NULL; 606 } 607 } 608 } else { 609 asres = NULL; 610 asKey.as = agCache.asD; 611 asres = bsearch(&asKey, myPtrs->currentASTab, myPtrs->asNb, sizeof(struct AS), asGlobalCmp); 612 if (asres!=NULL){ 613 if ( myPtrs->currentRouterPtr->snmpIndexList[agCache.inputSnmp] == 1 ) { 614 if (myPtrs->currentRouterPtr->sampled != 0 ){ 615 /* IN ("traffic to the AS") */ 616 asres->bytesNbIN += agCache.bytes; 617 asres->pktsNbIN += agCache.pkts; 618 (asres->flowNbIN)++; 619 } 620 if (asres->sampling == 0 621 && myPtrs->currentRouterPtr->sampled != 0){ 622 asres->sampling = myPtrs->currentRouterPtr->sampled; 623 } 624 } 625 } 626 } 627 } 628 #endif 629 /* 630 * PREFIX &/or MATRIX ACCOUNTING 631 */ 550 632 #if defined(IPV4AGGIDR) || defined(IPV4AGGIDSNMP) 551 633 if ( (bool == 1) && (isMplsFlow == 0) ){ … … 569 651 res->sampling = myPtrs->currentRouterPtr->sampled; 570 652 } 653 #if defined(IPV4AGGIDSNMP) 654 prefixKey.beginning = agCache.v4AdD>>(32-agCache.maskD)<<(32-agCache.maskD); 655 res3 = bsearch(&prefixKey, V4PTab, nbPV4, 656 sizeof(struct PrefixV4), prefGlobalCmp); 657 if (res3!=NULL){ 658 if (myPtrs->currentRouterPtr->sampled != 0 ){ 659 /* IN ("traffic to the prefix/subnet") */ 660 res3->bytesNbIN += agCache.bytes; 661 res3->pktsNbIN += agCache.pkts; 662 (res3->flowNbIN)++; 663 } 664 if (res3->sampling == 0 665 && myPtrs->currentRouterPtr->sampled != 0){ 666 res3->sampling = myPtrs->currentRouterPtr->sampled; 667 } 668 } 669 #endif 571 670 #if defined(MATRIX) && defined(IPV4AGGIDR) 572 671 /* inter-pop matrix Accounting */ … … 603 702 /* doublon or bad reference in prefix list */ 604 703 } 605 } else { 704 } else { /* the prefix in source don't exist in your prefix list */ 606 705 prefixKey.beginning = agCache.v4AdD>>(32-agCache.maskD)<<(32-agCache.maskD); 607 706 res = bsearch(&prefixKey, V4PTab, nbPV4, 608 707 sizeof(struct PrefixV4), prefGlobalCmp); 609 708 if (res!=NULL){ 610 if ( myPtrs->currentRouterPtr->snmpIndexList[agCache.inputSnmp] == 1 ) { 709 if ( myPtrs->currentRouterPtr->snmpIndexList[agCache.inputSnmp] == 1 ) { 611 710 if (myPtrs->currentRouterPtr->sampled != 0 ){ 612 711 /* IN ("traffic to the prefix/subnet") */ … … 628 727 res->sampling = myPtrs->currentRouterPtr->sampled; 629 728 } 630 /* } else { */ 729 } else { 631 730 /* doublon or bad reference in prefix list */ 632 731 } 633 732 } else { 733 /* UNKNOW SUBNET CASE */ 734 /* */ 634 735 /* HERE : we are in the cases of the address/mask don't */ 635 736 /* belong to a prefix listed in the IPv4 prefix file */ … … 663 764 #endif /* (IPV4AGGIDR) || (IPV4AGGIDSNMP) */ 664 765 /* 665 * Redirection if needed 766 * 767 * SOCKET OUTPUT TO A REMOTE CLIENT 768 * 666 769 * switch the rules definition (check & fieldToRecord), 667 770 * we send the flow or a part of the flow to a remote host or a file. … … 772 875 * 773 876 * 774 * Optional template877 * OPTIONAL TEMPLATE 775 878 * 776 879 * -
trunk/src/dataFlowSet.h
r58 r60 32 32 #include "msg_mgmt.h" 33 33 #include "get_conf.h" 34 #include "as.h" 34 35 #include "pop.h" 35 36 #include "prefix_mgmt.h" … … 84 85 uint32_t tabAdd6S[4]; 85 86 uint32_t tabAdd6D[4]; 87 #ifdef ASACC 88 unsigned short asS; 89 unsigned short asD; 90 #endif 86 91 /* unsigned short mplsLabel1; 87 92 unsigned long ifAdd; */ -
trunk/src/get_conf.c
r59 r60 66 66 67 67 if (!(routerFile = fopen(filename, "r"))) { 68 fprintf (stderr, "error during %sopening\n", filename);68 fprintf (stderr, "error during file \"%s\" opening\n", filename); 69 69 exit(1); 70 70 } … … 147 147 148 148 if (!(prefixFile = fopen(filename, "r"))) { 149 fprintf (stderr, "error during %sopening\n", filename);149 fprintf (stderr, "error during file \"%s\" opening\n", filename); 150 150 exit(1); 151 151 } … … 229 229 } 230 230 } 231 232 /* 233 * 234 */ 235 int compASStr(a,b) 236 { 237 static unsigned short a0; 238 static unsigned short b0; 239 sscanf((char *)a,"%hu\n",&a0); 240 sscanf((char *)b,"%hu\n",&b0); 241 if (a0 > b0) return(1); 242 if (a0 < b0) return(-1); 243 return(0); 244 } 245 246 /* 247 * getAS() 248 * 249 * read AS file and sort the list 250 */ 251 unsigned short getAS(char *filename, struct AS *ASTabPtr) 252 { 253 FILE *asFile; 254 char line[200]; 255 unsigned short counter = 0; 256 unsigned short n0; 257 unsigned short buffer; 258 int i = 0; 259 char ASStrTab[MAX_AS][7]; 260 261 if (!(asFile = fopen(filename, "r"))) { 262 fprintf (stderr, "error during file \"%s\" opening\n", filename); 263 exit(1); 264 } 265 for(i=0;i<MAX_AS;i++){ 266 ASTabPtr[i].as = 0; 267 ASTabPtr[i].sampling = 0; 268 } 269 while (fgets(line, 7, asFile) != 0) 270 { 271 strcpy(ASStrTab[counter], line); 272 counter++; 273 if (counter > MAX_AS) { 274 fprintf(stderr, "bufferoverflow in getAS function (get_conf.c)\ 275 change the value of MAX_AS declaration and recompile, counter: %hu \n", 276 counter); 277 exit(1); 278 } 279 } 280 qsort(ASStrTab, counter, 7, compASStr); 281 for(i=0;i<counter;i++) 282 { 283 sscanf(ASStrTab[i],"%hu\n", 284 &n0); 285 buffer = (unsigned short)n0; 286 ASTabPtr[i].as = *((unsigned short*)&buffer); 287 ASTabPtr[i].sampling = 0; 288 } 289 if( fclose(asFile) == 0) { 290 return (counter); 291 } else { 292 fprintf(stderr,"%s not closed, \n", filename); 293 exit(1); 294 return(counter); 295 } 296 } 297 -
trunk/src/get_conf.h
r59 r60 27 27 28 28 #include "renetcolParam.h" 29 #include "as.h" 29 30 30 31 struct PrefixV4{ … … 57 58 int getRegisteredRouters(char *, unsigned long *, unsigned long *); 58 59 unsigned short getPrefixV4(char *, struct PrefixV4 *); 60 unsigned short getAS(char *, struct AS *); 59 61 60 62 #endif /* GET_CONF_H */ -
trunk/src/renetcol.c
r59 r60 167 167 #endif 168 168 169 #ifdef ASACC 170 /* get the AS list */ 171 if ( (shmForAgg->ASNb = getAS(AS_LIST, &(shmForAgg->ASTab[0][0]))) < 1){ 172 fprintf(stderr, "renetcol: Error in %s\n", AS_LIST); 173 exit(1); 174 } else { 175 fprintf(stderr, "%hu AS are readed from %s\n", 176 shmForAgg->ASNb, 177 AS_LIST); 178 } 179 if ( (shmForAgg->ASNb = getAS(AS_LIST, &(shmForAgg->ASTab[1][0]))) < 1){ 180 fprintf(stderr, "renetcol: Error in %s\n", AS_LIST); 181 exit(1); 182 } 183 #endif 184 169 185 /* the fork */ 170 186 fprintf(stderr, "renetcol: I become a deamon, next messages via syslogd. By.\n"); … … 207 223 myPtrs.currentV4Tab = shmForAgg->prefixV4Tab[shmForAgg->currentTable]; 208 224 myPtrs.secondV4Tab = shmForAgg->prefixV4Tab[shmForAgg->secondTable]; 225 #ifdef ASACC 226 myPtrs.asNb = shmForAgg->ASNb; 227 myPtrs.currentASTab = shmForAgg->ASTab[shmForAgg->currentTable]; 228 myPtrs.secondASTab = shmForAgg->ASTab[shmForAgg->secondTable]; 229 #endif 209 230 #ifdef MATRIX 210 231 myPtrs.matrixPOP = &(shmForAgg->matrixPOP[shmForAgg->currentTable][0][0]); … … 433 454 } 434 455 shmForAgg->readed = 1; 456 #ifdef ASACC 457 myPtrs.currentASTab = shmForAgg->ASTab[shmForAgg->currentTable]; 458 #endif 435 459 #ifdef MATRIX 436 460 myPtrs.matrixPOP = &(shmForAgg->matrixPOP[shmForAgg->currentTable][0][0]); -
trunk/src/renetcol.h
r59 r60 61 61 #include "pop.h" 62 62 #include "renetcolParam.h" 63 #include "as.h" 63 64 64 /* #include "mysql_mgmt.h" */ 65 66 struct SHMForAgg { 65 struct SHMForAgg {/* if you change it, you must change renetcolAgg.h struct */ 67 66 unsigned short currentTable; 68 67 unsigned short secondTable; 69 68 unsigned short readed; 70 69 unsigned short v4PrefixNb; 70 #ifdef ASACC 71 unsigned short ASNb; 72 struct AS ASTab[2][MAX_AS]; 73 #endif 71 74 struct PrefixV4 prefixV4Tab[2][MAX_IPV4_PREFIX]; 72 75 struct PrefixV4 prefixV4SubnetTab[2][MAX_IPV4_SUBNET]; … … 75 78 #endif 76 79 /* struct PrefixV6 ; */ 77 }; /* if you change it, you must change renetcolAgg.h structure */80 }; 78 81 79 82 -
trunk/src/renetcolAgg.c
r59 r60 54 54 static char ipStr[24]; 55 55 static char indexStr[24]; 56 static char asStr[7]; 56 57 static char createstr[2048]; 57 58 char *opt[27]; … … 480 481 /* END MATRIX INTER POP ACC */ 481 482 #endif /* MATRIX */ 483 #ifdef ASACC 484 /* 485 * 486 * AS ACCOUNTING 487 * 488 */ 489 for (i=0; i<shmForAgg->ASNb; i++){ 490 /* HERE create or update RRD FILE */ 491 if (shmForAgg->ASTab[index][i].sampling != 0) { 492 for (j=0; j<strlen(name); j++) {name[j] = '\0';} 493 for (j=0; j<strlen(createstr); j++) {createstr[j] = '\0';} 494 for (j=0; j<strlen(asStr); j++) {asStr[j] = '\0';} 495 for (j=0; j<strlen(buf); j++) {buf[j] = '\0';} 496 strcat(name, AS_RRD_LOCATION); 497 sprintf(asStr, "%hu_%lu", 498 shmForAgg->ASTab[index][i].as, 499 shmForAgg->ASTab[index][i].sampling 500 ); 501 strcat(name, asStr); 502 strcat(name, RRD_EXTENSION); 503 if ( (fp=fopen(name,"r")) == NULL ){ 504 opt[0]= (char *) malloc((strlen(RRD_PARAM_AS_0) + 1) * sizeof(char)); 505 strcpy(opt[0], RRD_PARAM_AS_0); 506 opt[1]= (char *) malloc((strlen(name) + 1) * sizeof(char)); 507 strcpy(opt[1], name); 508 opt[2]= (char *) malloc((strlen(RRD_PARAM_AS_1) + 1) * sizeof(char)); 509 strcpy(opt[2], RRD_PARAM_AS_1); 510 opt[3]= (char *) malloc((strlen(RRD_PARAM_AS_2) + 1) * sizeof(char)); 511 strcpy(opt[3], RRD_PARAM_AS_2); 512 opt[4]= (char *) malloc((strlen(RRD_PARAM_AS_3) + 1) * sizeof(char)); 513 strcpy(opt[4], RRD_PARAM_AS_3); 514 opt[5]= (char *) malloc((strlen(RRD_PARAM_AS_4) + 1) * sizeof(char)); 515 strcpy(opt[5], RRD_PARAM_AS_4); 516 opt[6]= (char *) malloc((strlen(RRD_PARAM_AS_5) + 1) * sizeof(char)); 517 strcpy(opt[6], RRD_PARAM_AS_5); 518 opt[7]= (char *) malloc((strlen(RRD_PARAM_AS_6) + 1) * sizeof(char)); 519 strcpy(opt[7], RRD_PARAM_AS_6); 520 opt[8]= (char *) malloc((strlen(RRD_PARAM_AS_7) + 1) * sizeof(char)); 521 strcpy(opt[8], RRD_PARAM_AS_7); 522 opt[9]= (char *) malloc((strlen(RRD_PARAM_AS_8) + 1) * sizeof(char)); 523 strcpy(opt[9], RRD_PARAM_AS_8); 524 opt[10]= (char *) malloc((strlen(RRD_PARAM_AS_9) + 1) * sizeof(char)); 525 strcpy(opt[10], RRD_PARAM_AS_9); 526 opt[11]= (char *) malloc((strlen(RRD_PARAM_AS_10) + 1) * sizeof(char)); 527 strcpy(opt[11], RRD_PARAM_AS_10); 528 opt[12]= (char *) malloc((strlen(RRD_PARAM_AS_11) + 1) * sizeof(char)); 529 strcpy(opt[12], RRD_PARAM_AS_11); 530 opt[13]= (char *) malloc((strlen(RRD_PARAM_AS_12) + 1) * sizeof(char)); 531 strcpy(opt[13], RRD_PARAM_AS_12); 532 opt[14]= (char *) malloc((strlen(RRD_PARAM_AS_13) + 1) * sizeof(char)); 533 strcpy(opt[14], RRD_PARAM_AS_13); 534 opt[15]= (char *) malloc((strlen(RRD_PARAM_AS_14) + 1) * sizeof(char)); 535 strcpy(opt[15], RRD_PARAM_AS_14); 536 opt[16]= (char *) malloc((strlen(RRD_PARAM_AS_15) + 1) * sizeof(char)); 537 strcpy(opt[16], RRD_PARAM_AS_15); 538 opt[17]= (char *) malloc((strlen(RRD_PARAM_AS_16) + 1) * sizeof(char)); 539 strcpy(opt[17], RRD_PARAM_AS_16); 540 opt[18]= (char *) malloc((strlen(RRD_PARAM_AS_17) + 1) * sizeof(char)); 541 strcpy(opt[18], RRD_PARAM_AS_17); 542 optind = opterr = 0; 543 rrd_clear_error(); 544 if ( rrd_create(19,opt) < 0) { 545 syslog(LOG_ERR, "RRD create file %s, error: %s\n", name, rrd_get_error()); 546 rrd_create_er_ct++; 547 } else { 548 rrd_create_ok_ct++; 549 } 550 for ( j=0; j<19; j++) { 551 free(opt[j]); 552 opt[j] = NULL; 553 } 554 }else{ 555 fclose(fp); 556 rrd_already_created_ct++; 557 snprintf(buf, 558 2048, 559 "%lu:%llu:%llu:%llu:%llu:%llu:%llu", 560 now-300, /* or ctime(&now) with %s */ 561 shmForAgg->ASTab[index][i].flowNbIN, /* 1 */ 562 shmForAgg->ASTab[index][i].flowNbOUT, 563 shmForAgg->ASTab[index][i].bytesNbIN, 564 shmForAgg->ASTab[index][i].bytesNbOUT, 565 shmForAgg->ASTab[index][i].pktsNbIN, /* 5 */ 566 shmForAgg->ASTab[index][i].pktsNbOUT 567 ); 568 optUpdate[0]= (char *) malloc((strlen(RRD_UPDATE_0) + 1) * sizeof(char)); 569 strcpy(optUpdate[0], RRD_UPDATE_0); 570 optUpdate[1]= (char *) malloc((strlen(name) + 1) * sizeof(char)); 571 strcpy(optUpdate[1], name); 572 optUpdate[2]= (char *) malloc((strlen(buf) + 1) * sizeof(char)); 573 strcpy(optUpdate[2], buf); 574 optind = opterr = 0; 575 rrd_clear_error(); 576 if ( rrd_update(3, optUpdate) < 0 ) { 577 syslog(LOG_ERR, "RRD update file %s, error: %s\n", name, rrd_get_error()); 578 rrd_update_er_ct++; 579 } else { 580 rrd_update_ok_ct++; 581 } 582 for ( j=0; j<3; j++) { 583 free(optUpdate[j]); 584 optUpdate[j] = NULL; 585 } 586 } 587 /* Reinit the shared tables */ 588 shmForAgg->ASTab[index][i].flowNbIN = 0; 589 shmForAgg->ASTab[index][i].bytesNbIN = 0; 590 shmForAgg->ASTab[index][i].pktsNbIN = 0; 591 shmForAgg->ASTab[index][i].flowNbOUT = 0; 592 shmForAgg->ASTab[index][i].bytesNbOUT = 0; 593 shmForAgg->ASTab[index][i].pktsNbOUT = 0; 594 } 595 } 596 #endif /* AS */ 482 597 now2 = time((time_t *)NULL); 483 598 #ifdef DEBUGAGG … … 541 656 } 542 657 #endif 658 #ifdef ASACC 659 for (i=0; i<shmForAgg->ASNb; i++){ 660 shmForAgg->ASTab[index][i].flowNbIN = 0; 661 shmForAgg->ASTab[index][i].bytesNbIN = 0; 662 shmForAgg->ASTab[index][i].pktsNbIN = 0; 663 shmForAgg->ASTab[index][i].flowNbOUT = 0; 664 shmForAgg->ASTab[index][i].bytesNbOUT = 0; 665 shmForAgg->ASTab[index][i].pktsNbOUT = 0; 666 } 667 #endif 543 668 } /* end is first update */ 544 669 } /* end read ok */ -
trunk/src/renetcolAgg.h
r59 r60 42 42 #include "pop.h" 43 43 #include "renetcolParam.h" 44 #include "as.h" 44 45 45 struct SHMForAgg { 46 struct SHMForAgg { /* if you change it, you must change renetcol.h structure */ 46 47 unsigned short currentTable; 47 48 unsigned short secondTable; 48 49 unsigned short readed; 49 50 unsigned short v4PrefixNb; 51 #ifdef ASACC 52 unsigned short ASNb; 53 struct AS ASTab[2][MAX_AS]; 54 #endif 50 55 struct PrefixV4 prefixV4Tab[2][MAX_IPV4_PREFIX]; 51 56 struct PrefixV4 prefixV4SubnetTab[2][MAX_IPV4_SUBNET]; … … 54 59 #endif 55 60 /* struct PrefixV6 ; */ 56 }; /* if you change it, you must change renetcol.h structure */61 }; -
trunk/src/renetcolParam.h
r59 r60 44 44 * FILE with your routers IP address 45 45 */ 46 #define ROUTERS_LIST "/home/andreu/renetcol-0.0.12beta/ src/routers.txt"46 #define ROUTERS_LIST "/home/andreu/renetcol-0.0.12beta/conf/routers.txt" 47 47 /* 48 48 * FILE with your prefix/subnet 49 49 */ 50 #define SUBNETS_LIST "/home/andreu/renetcol-0.0.12beta/ src/IPv4_prefix.txt"50 #define SUBNETS_LIST "/home/andreu/renetcol-0.0.12beta/conf/IPv4_prefix.txt" 51 51 /* 52 * two constants, here a subnet is include in a prefix 52 * FILE with the list of AS with accounting 53 */ 54 #define AS_LIST "/home/andreu/renetcol-0.0.12beta/conf/AS.txt" 55 /* 56 * constants, here a subnet is include in a prefix 53 57 */ 54 58 #define MAX_IPV4_PREFIX 4000 55 59 #define MAX_IPV4_SUBNET 1000 60 #define MAX_AS 3 56 61 /* 57 62 * FILE for the rules 58 63 */ 59 #define RULES_FILE "/home/andreu/renetcol-0.0.12beta/ src/rules.txt"64 #define RULES_FILE "/home/andreu/renetcol-0.0.12beta/conf/rules.txt" 60 65 /* 61 66 * FILE with SNMP index of the interfaces … … 72 77 #define PREFIX_RRD_LOCATION "/mnt/data/RRD/RENATER/IPv4_SUBNET/" 73 78 #define MATRIX_RRD_LOCATION "/mnt/data/RRD/RENATER/MATRIX/" 74 79 #define AS_RRD_LOCATION "/mnt/data/RRD/RENATER/AS/" 75 80 76 81 /**************************************************************** … … 125 130 #define RRD_PARAM_MATRIX_13 "RRA:MAX:0.5:24:1550" 126 131 #define RRD_PARAM_MATRIX_14 "RRA:MAX:0.5:288:1594" 132 #define RRD_PARAM_AS_0 "rrdcreate" 133 #define RRD_PARAM_AS_1 "--start" 134 #define RRD_PARAM_AS_2 "1106560200" 135 #define RRD_PARAM_AS_3 "--step" 136 #define RRD_PARAM_AS_4 "300" 137 #define RRD_PARAM_AS_5 "DS:inFlows:GAUGE:600:U:U" 138 #define RRD_PARAM_AS_6 "DS:outFlows:GAUGE:600:U:U" 139 #define RRD_PARAM_AS_7 "DS:inBytes:GAUGE:600:U:U" 140 #define RRD_PARAM_AS_8 "DS:outBytes:GAUGE:600:U:U" 141 #define RRD_PARAM_AS_9 "DS:inPkts:GAUGE:600:U:U" 142 #define RRD_PARAM_AS_10 "DS:outPkts:GAUGE:600:U:U" 143 #define RRD_PARAM_AS_11 "RRA:AVERAGE:0.5:1:2100" 144 #define RRD_PARAM_AS_12 "RRA:AVERAGE:0.5:24:1550" 145 #define RRD_PARAM_AS_13 "RRA:AVERAGE:0.5:288:1594" 146 #define RRD_PARAM_AS_14 "RRA:AVERAGE:0.5:2016:1040" 147 #define RRD_PARAM_AS_15 "RRA:MAX:0.5:1:2100" 148 #define RRD_PARAM_AS_16 "RRA:MAX:0.5:24:1550" 149 #define RRD_PARAM_AS_17 "RRA:MAX:0.5:288:1594" 127 150 #define RRD_UPDATE_0 "rrdupdate" 128 151 #define RECEPT_PORT "52571" -
trunk/src/routers_mgmt.h
r59 r60 72 72 struct PrefixV4 *currentV4SubnetTab; 73 73 struct PrefixV4 *secondV4SubnetTab; 74 #ifdef ASACC 75 unsigned short asNb; 76 struct AS *currentASTab; 77 struct AS *secondASTab; 78 #endif 74 79 #ifdef MATRIX 75 80 struct POP *matrixPOP;