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/routers_mgmt.c

    r84 r95  
    3939} 
    4040 
    41 RouterPtr addRouter(RouterPtr routersList, unsigned long address)  
     41RouterPtr addRouter(RouterPtr routersList, unsigned long address, unsigned short id)  
    4242{ 
    4343  RouterPtr tmp = (RouterPtr) malloc(sizeof(struct Router)); 
    4444  if (tmp==NULL) { 
    45     syslog(LOG_ERR, "ERROR in malloc in add_routers function\n"); 
     45    syslog(LOG_ERR, "ERROR in malloc in addRouter function\n"); 
    4646    exit(1); 
    4747  } else { 
    4848    tmp->IpAddress = address; 
     49    tmp->ID = id; 
    4950    tmp->tplList = NULL; 
    5051    tmp->tplOptList = NULL; 
     
    167168  unsigned long ipAddress; 
    168169  RouterPtr routerTmp = NULL; 
     170  unsigned short snmpIndex = 0; 
     171  unsigned short snmpCpt = 0; 
    169172 
    170173  if (!(indexFile = fopen(filename, "r"))) { 
     
    198201        exit(1); 
    199202      } 
     203      snmpCpt = 0; 
    200204    }else{ 
    201205      if ( strspn(line, "I") == 1 ) { 
     
    211215        if ( strcmp(tid, "B") == 0 ) { 
    212216          routerTmp->snmpIndexList[index] = 0; 
     217          routerTmp->snmpIndexID[snmpCpt] = index; 
     218          routerTmp->snmpIndexType[snmpCpt] = 0; 
    213219        } else if ( strcmp(tid, "C") == 0 ) { 
    214220          routerTmp->snmpIndexList[index] = 1; 
     221          routerTmp->snmpIndexID[snmpCpt] = index; 
     222          routerTmp->snmpIndexType[snmpCpt] = 1; 
    215223        } else { 
    216224          fprintf(stderr, "Error in file %s, line %d : bad code B or C \n",