/** The average flow rate. */
uint32_t avg_rate;
+ /** The hash of the flow whose rate is the max_flow_rate. */
+ uint32_t max_flow_rate_flow_hash;
+
} common_accounting_t;
/** Determines the difference between two timeval structs (in seconds, with
gettimeofday(&tv, NULL);
time_now = (double) tv.tv_sec + (double) ((double) tv.tv_usec / (double) 1000000);
- printlog(LOG_WARN, "%.2f %d %.2f %.2f %.2f %d %d %d %d %d %d ", time_now, ftable->inst_rate, idealweight,
- ident->localweight, total_weight, ftable->num_flows, ftable->num_flows_5k, ftable->num_flows_10k,
- ftable->num_flows_20k, ftable->num_flows_50k, ftable->avg_rate);
+ printlog(LOG_WARN, "%.2f %d %.2f %.2f %.2f %d %d %d %d %d %d %d %d", time_now, ftable->inst_rate,
+ idealweight, ident->localweight, total_weight, ftable->num_flows, ftable->num_flows_5k,
+ ftable->num_flows_10k, ftable->num_flows_20k, ftable->num_flows_50k, ftable->avg_rate,
+ ftable->max_flow_rate, ftable->max_flow_rate_flow_hash);
+
printcounter = PRINT_COUNTER_RESET;
} else {
printcounter -= 1;
standard_flow *current;
struct in_addr src, dst;
char sip[22], dip[22];
+ key_flow largest_flow_info;
/* Reset statistics. */
table->common->num_flows = 0;
if (current->rate > maxflowrate) {
maxflowrate = current->rate;
+ largest_flow_info.source_ip = current->source_ip;
+ largest_flow_info.dest_ip = current->dest_ip;
+ largest_flow_info.source_port = current->source_port;
+ largest_flow_info.dest_port = current->dest_port;
+ largest_flow_info.protocol = current->protocol;
}
if (current->rate > 51200) {
printlog(LOG_DEBUG, "FLOW:--\n--\n");
table->common->max_flow_rate = maxflowrate;
+ table->common->max_flow_rate_flow_hash = table->hash_function(&largest_flow_info);
}