Changeset 80 for trunk/src/get_conf.c

Show
Ignore:
Timestamp:
11/06/08 10:38:20 (14 years ago)
Author:
andreu
Message:

bug correction in prefix reading

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/get_conf.c

    r61 r80  
    239239    } 
    240240  qsort(prefixStrTab, counter, 50, compStr); 
     241#ifdef DEBUG 
     242  for(i=0;i<counter;i++) { 
     243    fprintf(stderr,"i : %hu - line : %s\n", i,prefixStrTab[i]); 
     244  } 
     245#endif 
    241246  for(i=0;i<counter;i++) 
    242247    { 
     
    257262        lastSuperNet.beginning = *((unsigned long*)&buffer4[0]); 
    258263        lastSuperNet.end = *((unsigned long*)&buffer4[0]) +~(~0<<(32-n4)); 
     264#ifdef DEBUG 
     265        fprintf(stderr,"First SUPERNET : %lu.%lu.%lu.%lu", 
     266                (lastSuperNet.beginning>>24), 
     267                (lastSuperNet.beginning<<8>>24), 
     268                (lastSuperNet.beginning<<16>>24), 
     269                (lastSuperNet.beginning<<24>>24)); 
     270#endif 
    259271        lastSuperNet.mask = n4; 
    260272        lastSuperNetIndex = i; 
     
    282294        pV4TabPtr[i].secondCoSOUT = 0; 
    283295        pV4TabPtr[i].thirdCoSOUT = 0; 
    284         pV4TabPtr[i].fourthCoSOUT = 0; 
    285          
     296        pV4TabPtr[i].fourthCoSOUT = 0;   
    286297      } else if ( (lastSuperNet.beginning <= *((unsigned long*)&buffer4[0])) 
    287298                  && (lastSuperNet.end>=*((unsigned long*)&buffer4[0]) +~(~0<<(32-n4))) ) { 
    288299        /* we are in the case of subnet */ 
    289300        *subnetNb += 1; 
    290         fprintf(stderr,"SUBNET %lu SUPERNET %lu %lu, subnetnb : %hu\n", 
    291                 *((unsigned long*)&buffer4[0]), 
    292                 pV4TabPtr[lastSuperNetIndex].beginning, 
    293                 pV4TabPtr[lastSuperNetIndex].end, 
    294                 *subnetNb); 
    295          
     301#ifdef DEBUG 
     302        fprintf(stderr,"SUBNET %lu.%lu.%lu.%lu FROM SUPERNET %lu.%lu.%lu.%lu %lu.%lu.%lu.%lu , subnetnb : %hu\n", 
     303                (*((unsigned long*)&buffer4[0])>>24), 
     304                (*((unsigned long*)&buffer4[0])<<8>>24), 
     305                (*((unsigned long*)&buffer4[0])<<16>>24), 
     306                (*((unsigned long*)&buffer4[0])<<24>>24), 
     307                (pV4TabPtr[lastSuperNetIndex].beginning)>>24, 
     308                (pV4TabPtr[lastSuperNetIndex].beginning)<<8>>24, 
     309                (pV4TabPtr[lastSuperNetIndex].beginning)<<16>>24, 
     310                (pV4TabPtr[lastSuperNetIndex].beginning)<<24>>24, 
     311                (pV4TabPtr[lastSuperNetIndex].end)>>24, 
     312                (pV4TabPtr[lastSuperNetIndex].end)<<8>>24, 
     313                (pV4TabPtr[lastSuperNetIndex].end)<<16>>24, 
     314                (pV4TabPtr[lastSuperNetIndex].end)<<24>>24,  
     315                *subnetNb); 
     316#endif 
    296317        pV4TabPtr[lastSuperNetIndex].hasSubnet = 1; 
    297318        pV4SubTabPtr[subNetIndex].beginning =  
     
    323344        lastSuperNet.beginning = *((unsigned long*)&buffer4[0]); 
    324345        lastSuperNet.end = *((unsigned long*)&buffer4[0]) +~(~0<<(32-n4)); 
     346#ifdef DEBUG 
     347        fprintf(stderr,"SUPERNET %lu.%lu.%lu.%lu \n", 
     348                (*((unsigned long*)&buffer4[0])>>24), 
     349                (*((unsigned long*)&buffer4[0])<<8>>24), 
     350                (*((unsigned long*)&buffer4[0])<<16>>24), 
     351                (*((unsigned long*)&buffer4[0])<<24>>24)); 
     352#endif 
    325353        lastSuperNet.mask = n4; 
    326         lastSuperNetIndex = i; 
     354        lastSuperNetIndex = superNetIndex; 
    327355        pV4TabPtr[superNetIndex].beginning =  
    328356          *((unsigned long*)&buffer4[0]);