Commit 1b3bc4e6 authored by 's avatar

Added timestamp of the end of the flow. Packetloss client must be upgraded to...

Added timestamp of the end of the flow. Packetloss client must be upgraded to work with this revision too.


git-svn-id: file:///home/svn/mapi/trunk@1474 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent 96260bac
......@@ -3,8 +3,10 @@
#include "protocols.h"
typedef struct eflow_data {
unsigned long long timestamp;
unsigned long long packets_count, bytes_count;
unsigned long long timestamp_first;
unsigned long long timestamp_last;
unsigned long long packets_count;
unsigned long long bytes_count;
ip_addr saddr, daddr;
u_short sport, dport;
u_char ptcl;
......@@ -14,8 +16,10 @@ typedef struct eflow_data {
} eflow_data;
typedef struct flow_data {
unsigned long long timestamp;
unsigned long long packets_count, bytes_count;
unsigned long long timestamp_first;
unsigned long long timestamp_last;
unsigned long long packets_count;
unsigned long long bytes_count;
ip_addr saddr, daddr;
u_short sport, dport;
u_char ptcl;
......
......@@ -73,6 +73,7 @@ void add_toflow(struct exfl_data *data, eflow_data record, flows_stat *stats) {
lookup->node->flow.packets_count++;
lookup->node->flow.bytes_count += record.bytes_count;
lookup->node->flow.epoch = data->epoch;
lookup->node->flow.timestamp_last = record.timestamp_last;
shift_node(data, lookup->node);
pthread_mutex_unlock( &(data->mutex) );
......@@ -533,7 +534,8 @@ static int exprflow_process(mapidflib_function_instance_t *instance, MAPI_UNUSED
record.daddr = ip->daddr;
record.sport = ntohs(tcp->sport);
record.dport = ntohs(tcp->dport);
record.timestamp = pkt_head->ts;
record.timestamp_first = pkt_head->ts;
record.timestamp_last = pkt_head->ts;
record.epoch = data->epoch;
record.valid = data->epoch > TIMEOUT;
record.ptcl = ip->ptcl;
......@@ -548,7 +550,8 @@ static int exprflow_process(mapidflib_function_instance_t *instance, MAPI_UNUSED
record.daddr = ip->daddr;
record.sport = ntohs(udp->sport);
record.dport = ntohs(udp->dport);
record.timestamp = pkt_head->ts;
record.timestamp_first = pkt_head->ts;
record.timestamp_last = pkt_head->ts;
record.epoch = data->epoch;
record.valid = data->epoch > TIMEOUT;
record.ptcl = ip->ptcl;
......@@ -561,7 +564,8 @@ static int exprflow_process(mapidflib_function_instance_t *instance, MAPI_UNUSED
record.saddr = ip->saddr;
record.daddr = ip->daddr;
record.sport = record.dport = ntohs(0);
record.timestamp = pkt_head->ts;
record.timestamp_first = pkt_head->ts;
record.timestamp_last = pkt_head->ts;
record.epoch = data->epoch;
record.valid = data->epoch > TIMEOUT;
record.ptcl = ip->ptcl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment