Changeset 59 for trunk/src/renetcol.c

Show
Ignore:
Timestamp:
10/18/07 11:41:05 (15 years ago)
Author:
andreu
Message:

new aggregation method, based on SNMP index. New parameters in renetcolParam.h and new compilation options in configure.in.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/renetcol.c

    r58 r59  
    9999  int k; 
    100100 
    101 #ifdef IPV4AGG 
    102   fprintf(stderr, "renetcol compilation and execution with IPv4 Aggregation feature enable\n"); 
     101#ifdef IPV4AGGIDR 
     102  fprintf(stderr, "renetcol compilation and execution with IPv4 Aggregation feature enable based on routers ID in %s file.\n", ROUTERS_LIST); 
     103#endif 
     104 
     105#ifdef IPV4AGGIDSNMP 
     106  fprintf(stderr, "renetcol compilation and execution with IPv4 Aggregation feature enable based on SNMP ID in %s file.\n", INTERFACES_TYPE_LIST); 
    103107#endif 
    104108   
     
    133137 
    134138  if ( (shmForAgg->v4PrefixNb = getPrefixV4(SUBNETS_LIST, &(shmForAgg->prefixV4Tab[0][0]))) < 1){ 
    135     fprintf(stderr, "renetcol: Error \n"); 
    136     exit(1); 
     139    fprintf(stderr, "renetcol: Error in %s\n", SUBNETS_LIST); 
     140    exit(1); 
     141  } else { 
     142    fprintf(stderr, "%hu prefix are readed from %s\n",  
     143            shmForAgg->v4PrefixNb, 
     144            SUBNETS_LIST); 
    137145  } 
    138146  if ( (shmForAgg->v4PrefixNb = getPrefixV4(SUBNETS_LIST, &(shmForAgg->prefixV4Tab[1][0]))) < 1){ 
    139     fprintf(stderr, "renetcol:  Error \n"); 
     147    fprintf(stderr, "renetcol: Error in %s\n", SUBNETS_LIST); 
    140148    exit(1); 
    141149  } 
     
    194202  myPtrs.pcktPtr = (DatagramPtr) malloc(sizeof(struct Datagram)); 
    195203  myPtrs.currentFlowsetNumberPtr = &currentFlowsetNumber; 
     204#ifdef IPV4AGGIDR 
    196205  myPtrs.routersID = &indexedRouterList; 
     206#endif 
    197207  myPtrs.currentV4Tab = shmForAgg->prefixV4Tab[shmForAgg->currentTable]; 
    198208  myPtrs.secondV4Tab = shmForAgg->prefixV4Tab[shmForAgg->secondTable]; 
     209#ifdef MATRIX 
    199210  myPtrs.matrixPOP = &(shmForAgg->matrixPOP[shmForAgg->currentTable][0][0]); 
     211#endif 
    200212 
    201213  /* INIT MATRIX TABLES */ 
     214#ifdef MATRIX 
    202215  for (i=0; i<ROUTER_INDEX_MAX; i++){ 
    203216    for (j=0; j<ROUTER_INDEX_MAX; j++) { 
     
    210223    } 
    211224  } 
     225#endif 
    212226 
    213227  /* Checkup */ 
     
    419433      } 
    420434      shmForAgg->readed = 1; 
     435#ifdef MATRIX 
    421436      myPtrs.matrixPOP = &(shmForAgg->matrixPOP[shmForAgg->currentTable][0][0]); 
     437#endif 
    422438    } 
    423439    if (sigusr1Up == 1){