Changeset 25 for trunk/src/renetcolAgg.c

Show
Ignore:
Timestamp:
02/08/07 22:44:36 (16 years ago)
Author:
andreu
Message:

aggregation feature : prefix selection even if no routed subnet

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/renetcolAgg.c

    r24 r25  
    6969      now = time((time_t *)NULL); 
    7070      for (i=0; i<shmForAgg->v4PrefixNb; i++){ 
    71          
    7271        /* HERE Put in RRD FILE */ 
    73          
    74         name[0] = '\0'; 
     72        name[0] = '\0'; 
    7573        createstr[0] = '\0'; 
    7674        ipStr[0] = '\0'; 
    7775        buf[0] = '\0'; 
    78 /*      strcat(name, RRD_LOCATION); */ 
     76        strcat(name, RRD_LOCATION); 
    7977        sprintf(ipStr, "%lu", shmForAgg->prefixV4Tab[index][i].beginning);  
    8078        strcat(name, ipStr); 
    81 /*      strcat(name, SAMPLING_HERE); */ 
     79        /*      strcat(name, SAMPLING_HERE); */ 
    8280        strcat(name, RRD_EXTENSION); 
    8381        fprintf(stderr, "%s\n", name); 
     
    8785          fprintf(stderr, "%s\n", createstr); 
    8886          res_rrd = wrap_rrd_create(createstr); 
    89 /*        printf("%d\n", res_rrd); */ 
    9087        }else{ 
    9188          fclose(fp); 
    9289        } 
    9390     
    94         snprintf(buf, 1024, "%s%s %lu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu",  
    95 /*               RRD_LOCATION, */ 
     91        snprintf(buf, 2048, "%s%s%s %lu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu",  
     92                 RRD_LOCATION,  
    9693                 ipStr, 
    9794                 RRD_EXTENSION,  
    98                  now,  /* or ctime(&now) with %s */ 
     95                 now,  /* or ctime(&now) with %s FIXME -300 */ 
    9996                 shmForAgg->prefixV4Tab[index][i].flowNbIN,  /* 1  */ 
    10097                 shmForAgg->prefixV4Tab[index][i].flowNbOUT, 
     
    129126                 ); 
    130127        printf("\n%s\n", buf);  
    131         res_rrd = wrap_rrd_update(buf); 
    132         printf("resultat wrap_rrd_update : %d\n", res_rrd); 
    133          
    134 /*      fprintf(stderr, "%lu \n %llu flows,\t %llu bytes,\t %llu pkts\n Pkts (udp tcp icmp others): %llu \t %llu \t %llu \t %llu\n Bytes (udp tcp icmp others): %llu \t %llu \t %llu \t %llu\n Flows (udp tcp icmp others): %llu \t %llu \t %llu \t %llu\n \n %llu flows,\t %llu bytes,\t %llu pkts\n Pkts (udp tcp icmp others): %llu \t %llu \t %llu \t %llu\n Bytes (udp tcp icmp others): %llu \t %llu \t %llu \t %llu\n Flows (udp tcp icmp others): %llu \t %llu \t %llu \t %llu\n \n", */ 
    135 /*              shmForAgg->prefixV4Tab[index][i].beginning, */ 
    136 /*              shmForAgg->prefixV4Tab[index][i].flowNbIN, */ 
    137 /*              shmForAgg->prefixV4Tab[index][i].bytesNbIN, */ 
    138 /*              shmForAgg->prefixV4Tab[index][i].pktsNbIN, */ 
    139 /*              shmForAgg->prefixV4Tab[index][i].udpPktsNbIN, */ 
    140 /*              shmForAgg->prefixV4Tab[index][i].tcpPktsNbIN, */ 
    141 /*              shmForAgg->prefixV4Tab[index][i].icmpPktsNbIN, */ 
    142 /*              shmForAgg->prefixV4Tab[index][i].othersPktsNbIN, */ 
    143 /*              shmForAgg->prefixV4Tab[index][i].udpBytesNbIN, */ 
    144 /*              shmForAgg->prefixV4Tab[index][i].tcpBytesNbIN, */ 
    145 /*              shmForAgg->prefixV4Tab[index][i].icmpBytesNbIN, */ 
    146 /*              shmForAgg->prefixV4Tab[index][i].othersBytesNbIN, */ 
    147 /*              shmForAgg->prefixV4Tab[index][i].udpFlowNbIN, */ 
    148 /*              shmForAgg->prefixV4Tab[index][i].tcpFlowNbIN, */ 
    149 /*              shmForAgg->prefixV4Tab[index][i].icmpFlowNbIN, */ 
    150 /*              shmForAgg->prefixV4Tab[index][i].othersFlowNbIN, */ 
    151 /*              shmForAgg->prefixV4Tab[index][i].flowNbOUT, */ 
    152 /*              shmForAgg->prefixV4Tab[index][i].bytesNbOUT, */ 
    153 /*              shmForAgg->prefixV4Tab[index][i].pktsNbOUT, */ 
    154 /*              shmForAgg->prefixV4Tab[index][i].udpPktsNbOUT, */ 
    155 /*              shmForAgg->prefixV4Tab[index][i].tcpPktsNbOUT, */ 
    156 /*              shmForAgg->prefixV4Tab[index][i].icmpPktsNbOUT, */ 
    157 /*              shmForAgg->prefixV4Tab[index][i].othersPktsNbOUT, */ 
    158 /*              shmForAgg->prefixV4Tab[index][i].udpBytesNbOUT, */ 
    159 /*              shmForAgg->prefixV4Tab[index][i].tcpBytesNbOUT, */ 
    160 /*              shmForAgg->prefixV4Tab[index][i].icmpBytesNbOUT, */ 
    161 /*              shmForAgg->prefixV4Tab[index][i].othersBytesNbOUT, */ 
    162 /*              shmForAgg->prefixV4Tab[index][i].udpFlowNbOUT, */ 
    163 /*              shmForAgg->prefixV4Tab[index][i].tcpFlowNbOUT, */ 
    164 /*              shmForAgg->prefixV4Tab[index][i].icmpFlowNbOUT, */ 
    165 /*              shmForAgg->prefixV4Tab[index][i].othersFlowNbOUT */ 
    166 /*              ); */ 
     128        if ( 0 == (res_rrd = wrap_rrd_update(buf) )) {  
     129          syslog(LOG_ERR, "wrap_rrd_update return : %d, param were : %s", res_rrd, buf); 
     130        } 
     131        /* Reinit the shared table */ 
    167132        shmForAgg->prefixV4Tab[index][i].flowNbIN = 0; 
    168133        shmForAgg->prefixV4Tab[index][i].bytesNbIN = 0;