Changeset 95 for trunk/src/renetcol.c

Show
Ignore:
Timestamp:
02/09/09 17:55:11 (14 years ago)
Author:
andreu
Message:

IPv6 link aggregation mode (first step : identify flows)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/renetcol.c

    r94 r95  
    9898  int i,j; 
    9999  int k; 
     100  unsigned short routerIndex = 0; 
    100101 
    101102#if defined(IPV4AGGIDR) 
     
    108109#if defined(IPV6AGGIDSNMP) 
    109110  fprintf(stderr, "renetcol compilation and execution with IPv6 Aggregation feature enable based on SNMP ID in %s file.\n", INTERFACES_TYPE_LIST); 
     111#endif 
     112#if defined(IPV6LINKAGG) 
     113  fprintf(stderr, "renetcol compilation and execution with IPv6 Links Aggregation.\n"); 
    110114#endif 
    111115   
     
    123127  } 
    124128  /* Create the list of routers */ 
    125   for (i=0; i<routerNb; i++){ 
    126     routersListPtr = addRouter(routersListPtr, sortedRouterList[i]); 
     129  for (routerIndex=0; routerIndex<routerNb; routerIndex++){ 
     130    routersListPtr = addRouter(routersListPtr, sortedRouterList[routerIndex],routerIndex); 
    127131  } 
    128132   
     
    162166  } 
    163167#if defined(IPV6AGGIDSNMP) 
     168fprintf(stderr, "ci0\n"); 
    164169  if ( (shmForAgg->v6PrefixNb =  
    165170        getPrefixV6(SUBNETS_V6_LIST,  
     
    179184    exit(1); 
    180185  } 
     186fprintf(stderr, "ci00\n"); 
    181187#endif 
    182188 
     
    230236    exit(4); 
    231237  } 
    232  
     238fprintf(stderr, " handler, SIGUSR1 from renetcolSender\n"); 
    233239  /* handler, SIGUSR1 from renetcolSender */ 
    234240  myAction.sa_handler = sigusr1Mgmt; 
     
    238244  sigaction (SIGUSR1, &myAction, NULL); 
    239245 
     246fprintf(stderr, " Cache for fast rules access\n"); 
    240247  /* Cache for fast rules access */ 
    241248  setCache(myPtrs.rulesListPtr); 
    242249  myPtrs.rulesAddressPtr = (RuleDefPtr *)rulesAddress; 
    243  
     250fprintf(stderr, "IPC messages queue init\n"); 
    244251  /* IPC messages queue init */ 
    245252  myKey = createKey(argv[0]); 
    246253  myQueue = createQueue(myKey); 
    247254  sendMyPid(myQueue); 
    248  
     255fprintf(stderr, "get SNMP index information\n"); 
    249256  /* get SNMP index information */ 
    250257#ifdef IPV4AGGIDSNMP 
     
    264271  myPtrs.currentV4Tab = shmForAgg->prefixV4Tab[shmForAgg->currentTable]; 
    265272  myPtrs.secondV4Tab = shmForAgg->prefixV4Tab[shmForAgg->secondTable]; 
     273#ifdef IPV6AGGIDSNMP 
     274fprintf(stderr, "ci1\n"); 
     275  myPtrs.currentV6Tab = shmForAgg->prefixV6Tab[shmForAgg->currentTable]; 
     276  myPtrs.secondV6Tab = shmForAgg->prefixV6Tab[shmForAgg->secondTable]; 
     277#endif 
     278#ifdef IPV6LINKAGG 
     279fprintf(stderr, "ci2\n"); 
     280  myPtrs.currentV6IndexTab = shmForAgg->indexV6Tab[shmForAgg->currentTable]; 
     281  myPtrs.secondV6IndexTab = shmForAgg->indexV6Tab[shmForAgg->secondTable]; 
     282fprintf(stderr, "ci3\n"); 
     283#endif 
    266284#ifdef ASACC 
    267285  myPtrs.asNb = shmForAgg->ASNb; 
     
    285303    } 
    286304  } 
     305#endif 
     306  /* INIT IPV6 index TABLES */ 
     307#ifdef IPV6LINKAGG 
     308fprintf(stderr, "ci\n"); 
     309  for (i=0; i<ROUTER_INDEX_MAX; i++){ 
     310    for (j=0; j<MAX_INDEX_BY_ROUTER; j++) { 
     311      shmForAgg->indexV6Tab[0][i][j].bytesNbIN = 0; 
     312      shmForAgg->indexV6Tab[0][i][j].pktsNbIN = 0; 
     313      shmForAgg->indexV6Tab[0][i][j].flowNbIN = 0; 
     314      shmForAgg->indexV6Tab[1][i][j].bytesNbOUT = 0; 
     315      shmForAgg->indexV6Tab[1][i][j].pktsNbOUT = 0; 
     316      shmForAgg->indexV6Tab[1][i][j].flowNbOUT = 0; 
     317    } 
     318  } 
     319fprintf(stderr, "icci\n"); 
    287320#endif 
    288321