Fixed CSV output
This commit is contained in:
@@ -694,8 +694,6 @@ static void parseOptions(int argc, char **argv) {
|
|||||||
case 'C':
|
case 'C':
|
||||||
if((csv_fp = fopen(optarg, "w")) == NULL)
|
if((csv_fp = fopen(optarg, "w")) == NULL)
|
||||||
printf("Unable to write on CSV file %s\n", optarg);
|
printf("Unable to write on CSV file %s\n", optarg);
|
||||||
else
|
|
||||||
printCSVHeader();
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 's':
|
case 's':
|
||||||
@@ -830,6 +828,9 @@ static void parseOptions(int argc, char **argv) {
|
|||||||
if(_pcap_file[0] == NULL)
|
if(_pcap_file[0] == NULL)
|
||||||
help(0);
|
help(0);
|
||||||
|
|
||||||
|
if(csv_fp)
|
||||||
|
printCSVHeader();
|
||||||
|
|
||||||
#ifndef USE_DPDK
|
#ifndef USE_DPDK
|
||||||
if(strchr(_pcap_file[0], ',')) { /* multiple ingress interfaces */
|
if(strchr(_pcap_file[0], ',')) { /* multiple ingress interfaces */
|
||||||
num_threads = 0; /* setting number of threads = number of interfaces */
|
num_threads = 0; /* setting number of threads = number of interfaces */
|
||||||
@@ -1099,9 +1100,9 @@ static void printFlow(u_int16_t id, struct ndpi_flow_info *flow, u_int16_t threa
|
|||||||
if((verbose != 1) && (verbose != 2)) {
|
if((verbose != 1) && (verbose != 2)) {
|
||||||
if(csv_fp && enable_joy_stats) {
|
if(csv_fp && enable_joy_stats) {
|
||||||
flowGetBDMeanandVariance(flow);
|
flowGetBDMeanandVariance(flow);
|
||||||
fprintf(csv_fp, "\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fprintf(csv_fp, "\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user