Changeset 36 for trunk/src/renetcol.c

Show
Ignore:
Timestamp:
05/19/07 11:57:44 (16 years ago)
Author:
andreu
Message:

ticket #1 #2 #7 closed - release 0.0.9beta

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/renetcol.c

    r31 r36  
    2626#include "renetcol.h" 
    2727 
    28 struct MyPtrs myPtrs; /* defined in dataflowset.h */ 
     28struct MyPtrs myPtrs; /* defined in routers_mgmt.h */ 
    2929 
    3030struct SHMForAgg *shmForAgg; 
     
    6969unsigned long indexedRouterList[ROUTER_INDEX_MAX]; 
    7070int routerNb = 0;                                  /* routers number */ 
    71 /* unsigned short v4PrefixNb = 0;                    IPv4 prefix number */  
    72 /* struct PrefixV4 prefixV4Tab[2][MAX_IPV4_PREFIX];  IPv4 prefix structure */ 
    73  
    74  
    75 key_t myKey = 0; /* FIXME to delete in futur */ 
    76 int myQueue = 0; /* FIXME to delete in futur */ 
     71 
     72key_t myKey = 0;  
     73int myQueue = 0; 
    7774 
    7875/* Next structure used as cache in rules reading */ 
     
    109106  int shmid; 
    110107  key_t key; 
     108  int i,j; 
    111109   
    112110  if ( argc != 4) { 
     
    159157 
    160158  myPtrs.rulesListPtr = NULL; 
    161   myPtrs.rulesListPtr = getLightRules(myPtrs.rulesListPtr, rulesFileName); 
     159/*   myPtrs.rulesListPtr = getLightRules(myPtrs.rulesListPtr, rulesFileName); */ 
     160  myPtrs.rulesListPtr = getRules(myPtrs.rulesListPtr, rulesFileName); 
    162161  tmp = myPtrs.rulesListPtr; 
    163162  for ( ; tmp->next; tmp=tmp->next) { 
     
    166165    } 
    167166  } 
     167  tmp = NULL; 
    168168/*   printRule(rulesListPtr); */ 
    169169/*   exit(1); */ 
     
    204204  myPtrs.routersID = &indexedRouterList; 
    205205  myPtrs.currentV4Tab = shmForAgg->prefixV4Tab[shmForAgg->currentTable]; 
    206   myPtrs.secondV4Tab = shmForAgg->prefixV4Tab[shmForAgg->secondTable];   
    207   
     206  myPtrs.secondV4Tab = shmForAgg->prefixV4Tab[shmForAgg->secondTable]; 
     207  myPtrs.matrixPOP = &(shmForAgg->matrixPOP[shmForAgg->currentTable][0][0]); 
     208 
     209  myPtrs.nbFluxSR4 =0; 
     210  myPtrs.nbFluxSE =0; 
     211  myPtrs.nbFluxIR4 =0; 
     212  myPtrs.nbFluxUK = 0; 
     213  myPtrs.nbFluxTT = 0; 
     214 
     215  for (i=0; i<ROUTER_INDEX_MAX; i++){ 
     216    for (j=0; j<ROUTER_INDEX_MAX; j++) { 
     217      shmForAgg->matrixPOP[0][i][j].bytesNb = 0; 
     218      shmForAgg->matrixPOP[0][i][j].pktsNb = 0; 
     219      shmForAgg->matrixPOP[0][i][j].flowNb = 0; 
     220      shmForAgg->matrixPOP[1][i][j].bytesNb = 0; 
     221      shmForAgg->matrixPOP[1][i][j].pktsNb = 0; 
     222      shmForAgg->matrixPOP[1][i][j].flowNb = 0; 
     223    } 
     224  } 
     225 
    208226  if (myPtrs.pcktPtr==NULL) { 
    209227    fprintf(stderr, "ERROR in struct Datagram allocation\n"); 
     
    300318  } 
    301319  myPtrs.rulesListPtr = NULL; 
    302   myPtrs.rulesListPtr = getLightRules(myPtrs.rulesListPtr, rulesFileName); 
     320  myPtrs.rulesListPtr = getRules(myPtrs.rulesListPtr, rulesFileName); 
    303321  tmp = myPtrs.rulesListPtr; 
    304322  for ( ; tmp; tmp=tmp->next) { 
     
    379397  int regRouter = 0; 
    380398  time_t now = time((time_t *)NULL); 
    381   int iIP, iMPLS, i; 
     399  int iIP, iMPLS, i, z, x; 
    382400  int loopNb = 0; 
    383401  int gardeFou = 0; 
     
    404422      } 
    405423      shmForAgg->readed = 1; 
     424      myPtrs.matrixPOP = &(shmForAgg->matrixPOP[shmForAgg->currentTable][0][0]); 
     425      fprintf(stderr,"\n\nComptage FLUX:\n SR4: %llu\n SE: %llu\n IR4: %llu\n UK: %llu\n TT: %llu\n", 
     426              myPtrs.nbFluxSR4, 
     427              myPtrs.nbFluxSE, 
     428              myPtrs.nbFluxIR4, 
     429              myPtrs.nbFluxUK, 
     430              myPtrs.nbFluxTT 
     431              ); 
     432      myPtrs.nbFluxSR4 =0; 
     433      myPtrs.nbFluxSE =0; 
     434      myPtrs.nbFluxIR4 =0; 
     435      myPtrs.nbFluxUK = 0; 
     436      myPtrs.nbFluxTT = 0; 
    406437    } 
    407438    if (sigusr1Up == 1){