Changeset 29 for trunk/src/renetcol.c

Show
Ignore:
Timestamp:
04/13/07 17:40:49 (16 years ago)
Author:
andreu
Message:

sampling information in rrd filename - optional template first step

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/renetcol.c

    r28 r29  
    134134 
    135135  initCache(); 
    136   fprintf(stderr, "renetcol: reading the routers list...\n"); 
    137136  routerNb = getRegisteredRouters(configFileName, &sortedRouterList[0],  
    138137                                  &indexedRouterList[0]); 
    139   fprintf(stderr, "renetcol: OK\n"); 
    140  
    141138  key = 8765; 
    142139  if ((shmid = shmget(key, SHMSIZE, IPC_CREAT | 0666)) < 0) { 
     
    149146  } 
    150147 
    151   fprintf(stderr, "renetcol: reading the IPv4 prefix...\n"); 
    152148  if ( (shmForAgg->v4PrefixNb = getPrefixV4(prefixV4FileName, &(shmForAgg->prefixV4Tab[0][0]))) < 1){ 
    153149    fprintf(stderr, "renetcol: Error \n"); 
    154150    exit(1); 
    155   } else { 
    156     fprintf(stderr, "renetcol: OK \n"); 
    157151  } 
    158152  if ( (shmForAgg->v4PrefixNb = getPrefixV4(prefixV4FileName, &(shmForAgg->prefixV4Tab[1][0]))) < 1){ 
    159153    fprintf(stderr, "renetcol:  Error \n"); 
    160154    exit(1); 
    161   } else { 
    162     fprintf(stderr, "renetcol: OK \n"); 
    163   } 
     155  } 
     156 
     157  shmForAgg->currentTable = 0; 
     158  shmForAgg->secondTable = 1; 
     159 
    164160  myPtrs.rulesListPtr = NULL; 
    165   fprintf(stderr, "renetcol: reading the rules...\n"); 
    166161  myPtrs.rulesListPtr = getLightRules(myPtrs.rulesListPtr, rulesFileName); 
    167   fprintf(stderr, "renetcol: OK \n"); 
    168162  tmp = myPtrs.rulesListPtr; 
    169163  for ( ; tmp->next; tmp=tmp->next) { 
     
    209203  myPtrs.mplsNbPtr =  &mplsNb; 
    210204  myPtrs.routersID = &indexedRouterList; 
     205  myPtrs.currentV4Tab = shmForAgg->prefixV4Tab[shmForAgg->currentTable]; 
     206  myPtrs.secondV4Tab = shmForAgg->prefixV4Tab[shmForAgg->secondTable];   
    211207  
    212208  if (myPtrs.pcktPtr==NULL) { 
     
    402398      if (shmForAgg->currentTable == 0) { 
    403399        shmForAgg->currentTable = 1; 
     400        shmForAgg->secondTable = 0; 
    404401      }else{ 
    405402        shmForAgg->currentTable = 0; 
     403        shmForAgg->secondTable = 1; 
    406404      } 
    407405      shmForAgg->readed = 1; 
     
    756754    if ((tmpOP = tmp->tplOptList) != NULL){ 
    757755      for (; tmpOP; tmpOP=tmpOP->next) { 
    758         fprintf(TPLFILE,"OpTId %hu (sourceId: %lu) >\n lg: %hu, opScopeLg: %hu, opLg: %hu\n",  
     756        fprintf(TPLFILE,"OpTId %hu (sourceId: %lu) last %d brackets are Scope >\n lg: %hu, opScopeLg: %hu, opLg: %hu\n",  
    759757                tmpOP->templateOptionId, 
    760758                tmpOP->sourceId, 
     759                tmpOP->optionScopeLg/4, 
    761760                tmpOP->length, 
    762761                tmpOP->optionScopeLg,