From 25e8c4059269348e5c197d06cc04ab2262e90978 Mon Sep 17 00:00:00 2001 From: Quentin De Coninck Date: Wed, 16 Mar 2016 11:18:53 +0100 Subject: [PATCH] [ADD] tcp: add tcp_complete key to know if all data is available or not --- common.py | 2 ++ tcp.py | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/common.py b/common.py index 19ca7a0..3c6dbe9 100644 --- a/common.py +++ b/common.py @@ -111,6 +111,8 @@ class TSharkError(Exception): TYPE = 'type' # Interface: CELL or WIFI IF = 'interface' +# Indicate if the connection has full info or only a subset +TCP_COMPLETE = 'tcp_complete' # Source IP address SADDR = 'saddr' # Destination IP address diff --git a/tcp.py b/tcp.py index 4ff2d85..417a8df 100644 --- a/tcp.py +++ b/tcp.py @@ -94,6 +94,7 @@ def extract_tstat_data_tcp_complete(filename, connections, conn_id): info = line.split() conn_id += 1 connection = TCPConnection(conn_id) + connection.flow.attr[co.TCP_COMPLETE] = True connection.flow.attr[co.SADDR] = co.long_ipv6_address(info[0]) connection.flow.attr[co.DADDR] = co.long_ipv6_address(info[14]) connection.flow.attr[co.SPORT] = info[1] @@ -214,6 +215,8 @@ def extract_tstat_data_tcp_nocomplete(filename, connections, conn_id): conn_id += 1 connection = TCPConnection(conn_id) + connection.flow.attr[co.TCP_COMPLETE] = False + connection.flow.attr[co.SADDR] = co.long_ipv6_address(info[0]) connection.flow.attr[co.DADDR] = co.long_ipv6_address(info[14]) connection.flow.attr[co.SPORT] = info[1] @@ -530,6 +533,7 @@ def copy_info_to_mptcp_connections(connections, mptcp_connections, failed_conns, conn_id, flow_id = get_flow_name_connection_optimized(connection, mptcp_connections, fast_conns=fast_conns) if isinstance(conn_id, (int, long)): mptcp_connections[conn_id].flows[flow_id].subflow_id = flow_name + mptcp_connections[conn_id].flows[flow_id].attr[co.TCP_COMPLETE] = connection.flow.attr[co.TCP_COMPLETE] mptcp_connections[conn_id].flows[flow_id].attr[co.START] = connection.flow.attr[co.START] mptcp_connections[conn_id].flows[flow_id].attr[co.DURATION] = connection.flow.attr[co.DURATION] if co.BACKUP in connection.attr: