X-Git-Url: http://git.onelab.eu/?p=distributedratelimiting.git;a=blobdiff_plain;f=drl%2Fstandard.c;h=f0352153a3750976149fb44fe4423bc9b4b42ac7;hp=5c6a6d8537fe05f1f7bee39599d67e8b6a14388f;hb=9891ed21bcd3ff9f72a92e867ac7e8e0b9abb533;hpb=da2e1847da1c3ece4b1a8685de49d972aed48178 diff --git a/drl/standard.c b/drl/standard.c index 5c6a6d8..f035215 100644 --- a/drl/standard.c +++ b/drl/standard.c @@ -242,6 +242,7 @@ void standard_table_update_flows(standard_flow_table table, struct timeval now, 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; @@ -301,6 +302,11 @@ void standard_table_update_flows(standard_flow_table table, struct timeval now, 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) { @@ -342,4 +348,5 @@ void standard_table_update_flows(standard_flow_table table, struct timeval now, 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); }