forked from osmocom/wireshark
Several improvements:
- Split SEQ/ACK analysis into SEQ analysis (pr msg) and ACK analysis (pr dest/ackinfo entry) to correctly handle multicast messages. - Improved dump of timestamp (in units of 100ms). - Show Address PDU with 0 dest entries as Ack-Ack PDU. - Print correct number of missing sequence numbers in Ack. - Indicate end of list entry in Ack. - Message ID is unsigned. svn path=/trunk/; revision=26345
This commit is contained in:
parent
8a3dcb7922
commit
6882a5cd1a
1 changed files with 371 additions and 185 deletions
|
@ -69,6 +69,7 @@
|
||||||
#define FEC_Address_PDU 0x08
|
#define FEC_Address_PDU 0x08
|
||||||
#define Extra_Address_PDU 0x12
|
#define Extra_Address_PDU 0x12
|
||||||
#define Extra_FEC_Address_PDU 0x18
|
#define Extra_FEC_Address_PDU 0x18
|
||||||
|
#define Ack_Ack_PDU 0xFF /* Fake type to indicate Ack-Ack */
|
||||||
|
|
||||||
/* Type of content to decode from Data_PDU */
|
/* Type of content to decode from Data_PDU */
|
||||||
#define DECODE_NONE 0
|
#define DECODE_NONE 0
|
||||||
|
@ -149,7 +150,9 @@ static gint ett_dest_entry = -1;
|
||||||
static gint ett_ack_entry = -1;
|
static gint ett_ack_entry = -1;
|
||||||
static gint ett_range_entry = -1;
|
static gint ett_range_entry = -1;
|
||||||
static gint ett_checksum = -1;
|
static gint ett_checksum = -1;
|
||||||
static gint ett_analysis = -1;
|
static gint ett_seq_analysis = -1;
|
||||||
|
static gint ett_ack_analysis = -1;
|
||||||
|
static gint ett_seq_ack_analysis = -1;
|
||||||
static gint ett_msg_fragment = -1;
|
static gint ett_msg_fragment = -1;
|
||||||
static gint ett_msg_fragments = -1;
|
static gint ett_msg_fragments = -1;
|
||||||
|
|
||||||
|
@ -162,25 +165,33 @@ typedef struct _p_mul_id_key {
|
||||||
address addr;
|
address addr;
|
||||||
} p_mul_id_key;
|
} p_mul_id_key;
|
||||||
|
|
||||||
typedef struct _p_mul_id_val {
|
typedef struct _p_mul_seq_val {
|
||||||
gint msg_type; /* Message type */
|
gint msg_type; /* Message type */
|
||||||
guint32 prev_msg_id; /* Previous message package num */
|
guint32 prev_msg_id; /* Previous message package num */
|
||||||
nstime_t prev_msg_time; /* Previous message receive time */
|
nstime_t prev_msg_time; /* Previous message receive time */
|
||||||
guint32 addr_id; /* PDU package num for Address_PDU */
|
guint32 addr_id; /* PDU package num for Address_PDU */
|
||||||
nstime_t addr_time; /* PDU received time for Address_PDU */
|
nstime_t addr_time; /* PDU received time for Address_PDU */
|
||||||
guint32 pdu_id; /* PDU package num */
|
guint32 pdu_id; /* PDU package num */
|
||||||
nstime_t pdu_time; /* PDU receive time */
|
nstime_t pdu_time; /* PDU receive time */
|
||||||
guint32 prev_pdu_id; /* Previous PDU package num */
|
guint32 prev_pdu_id; /* Previous PDU package num */
|
||||||
nstime_t prev_pdu_time; /* Previous PDU receive time */
|
nstime_t prev_pdu_time; /* Previous PDU receive time */
|
||||||
guint32 ack_id; /* Ack PDU package num */
|
guint16 last_found_pdu; /* Last PDU num */
|
||||||
guint16 last_found_pdu; /* Last PDU num */
|
nstime_t first_msg_time; /* First message receive time */
|
||||||
nstime_t first_msg_time; /* First message receive time */
|
guint32 msg_resend_count; /* Message resend counter */
|
||||||
guint32 msg_resend_count; /* Message resend counter */
|
GHashTable *ack_data;
|
||||||
guint32 ack_resend_count; /* Ack resend counter */
|
} p_mul_seq_val;
|
||||||
} p_mul_id_val;
|
|
||||||
|
|
||||||
|
typedef struct _p_mul_ack_data {
|
||||||
|
guint32 ack_id; /* Ack PDU package num */
|
||||||
|
guint32 ack_resend_count; /* Ack resend counter */
|
||||||
|
} p_mul_ack_data;
|
||||||
|
|
||||||
|
/* Hash table with current data for seq/ack analysis */
|
||||||
static GHashTable *p_mul_id_hash_table = NULL;
|
static GHashTable *p_mul_id_hash_table = NULL;
|
||||||
|
|
||||||
|
/* List of hash tables stored in each frame */
|
||||||
|
static GList *p_mul_package_data_list = NULL;
|
||||||
|
|
||||||
/* User definable values to use for dissection */
|
/* User definable values to use for dissection */
|
||||||
static range_t *global_p_mul_port_range;
|
static range_t *global_p_mul_port_range;
|
||||||
static gboolean p_mul_reassemble = TRUE;
|
static gboolean p_mul_reassemble = TRUE;
|
||||||
|
@ -223,6 +234,7 @@ static const value_string pdu_vals[] = {
|
||||||
{ FEC_Address_PDU, "FEC Address PDU" },
|
{ FEC_Address_PDU, "FEC Address PDU" },
|
||||||
{ Extra_Address_PDU, "Extra Address PDU" },
|
{ Extra_Address_PDU, "Extra Address PDU" },
|
||||||
{ Extra_FEC_Address_PDU, "Extra FEC Address PDU" },
|
{ Extra_FEC_Address_PDU, "Extra FEC Address PDU" },
|
||||||
|
{ Ack_Ack_PDU, "Ack-Ack PDU" },
|
||||||
{ 0, NULL }
|
{ 0, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -285,6 +297,7 @@ static gint p_mul_id_hash_equal (gconstpointer k1, gconstpointer k2)
|
||||||
{
|
{
|
||||||
p_mul_id_key *p_mul1=(p_mul_id_key *)k1;
|
p_mul_id_key *p_mul1=(p_mul_id_key *)k1;
|
||||||
p_mul_id_key *p_mul2=(p_mul_id_key *)k2;
|
p_mul_id_key *p_mul2=(p_mul_id_key *)k2;
|
||||||
|
|
||||||
if (p_mul1->id != p_mul2->id)
|
if (p_mul1->id != p_mul2->id)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -294,16 +307,56 @@ static gint p_mul_id_hash_equal (gconstpointer k1, gconstpointer k2)
|
||||||
return (ADDRESSES_EQUAL (&p_mul1->addr, &p_mul2->addr));
|
return (ADDRESSES_EQUAL (&p_mul1->addr, &p_mul2->addr));
|
||||||
}
|
}
|
||||||
|
|
||||||
static p_mul_id_val *register_p_mul_id (packet_info *pinfo, guint8 pdu_type,
|
static p_mul_seq_val *lookup_seq_val (guint32 message_id, guint16 seq_no,
|
||||||
guint32 message_id, guint16 seq_no,
|
address *addr)
|
||||||
gint no_missing)
|
|
||||||
{
|
{
|
||||||
p_mul_id_val *p_mul_data = NULL, *pkg_data = NULL;
|
p_mul_seq_val *pkg_data = NULL;
|
||||||
|
p_mul_id_key *p_mul_key = se_alloc (sizeof (p_mul_id_key));
|
||||||
|
|
||||||
|
p_mul_key->id = message_id;
|
||||||
|
p_mul_key->seq = seq_no;
|
||||||
|
SE_COPY_ADDRESS(&p_mul_key->addr, addr);
|
||||||
|
|
||||||
|
pkg_data = (p_mul_seq_val *) g_hash_table_lookup (p_mul_id_hash_table, p_mul_key);
|
||||||
|
|
||||||
|
return pkg_data;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void p_mul_id_value_destroy (p_mul_seq_val *pkg_data)
|
||||||
|
{
|
||||||
|
if (pkg_data->ack_data) {
|
||||||
|
g_hash_table_destroy (pkg_data->ack_data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void p_mul_package_data_destroy (GHashTable *pkg_list, gpointer user_data _U_)
|
||||||
|
{
|
||||||
|
g_hash_table_destroy (pkg_list);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void copy_hashtable_data (gpointer key, p_mul_ack_data *ack_data1, GHashTable *table)
|
||||||
|
{
|
||||||
|
p_mul_ack_data *ack_data2;
|
||||||
|
|
||||||
|
ack_data2 = se_alloc (sizeof (p_mul_ack_data));
|
||||||
|
ack_data2->ack_id = ack_data1->ack_id;
|
||||||
|
ack_data2->ack_resend_count = ack_data1->ack_resend_count;
|
||||||
|
|
||||||
|
g_hash_table_insert (table, key, ack_data2);
|
||||||
|
}
|
||||||
|
|
||||||
|
static p_mul_seq_val *register_p_mul_id (packet_info *pinfo, address *addr, guint32 dstIP,
|
||||||
|
guint8 pdu_type, guint32 message_id,
|
||||||
|
guint16 seq_no, gint no_missing)
|
||||||
|
{
|
||||||
|
p_mul_seq_val *p_mul_data = NULL, *pkg_data = NULL;
|
||||||
p_mul_id_key *p_mul_key = NULL;
|
p_mul_id_key *p_mul_key = NULL;
|
||||||
|
p_mul_ack_data *ack_data = NULL;
|
||||||
nstime_t addr_time = { 0, 0 }, prev_time = { 0, 0 };
|
nstime_t addr_time = { 0, 0 }, prev_time = { 0, 0 };
|
||||||
guint addr_id = 0, prev_id = 0;
|
guint addr_id = 0, prev_id = 0;
|
||||||
guint16 last_found_pdu = 0;
|
guint16 last_found_pdu = 0;
|
||||||
gboolean missing_pdu = FALSE, set_address = FALSE;
|
gboolean missing_pdu = FALSE, set_address = FALSE;
|
||||||
|
GHashTable *pkg_list = NULL;
|
||||||
|
|
||||||
if (pinfo->in_error_pkt) {
|
if (pinfo->in_error_pkt) {
|
||||||
/* No analysis of error packets */
|
/* No analysis of error packets */
|
||||||
|
@ -318,10 +371,10 @@ static p_mul_id_val *register_p_mul_id (packet_info *pinfo, guint8 pdu_type,
|
||||||
/* Try to match corresponding address PDU */
|
/* Try to match corresponding address PDU */
|
||||||
p_mul_key->id = message_id;
|
p_mul_key->id = message_id;
|
||||||
p_mul_key->seq = 0;
|
p_mul_key->seq = 0;
|
||||||
SE_COPY_ADDRESS(&p_mul_key->addr, &(pinfo->src));
|
SE_COPY_ADDRESS(&p_mul_key->addr, addr);
|
||||||
set_address = TRUE;
|
set_address = TRUE;
|
||||||
|
|
||||||
p_mul_data = (p_mul_id_val *) g_hash_table_lookup (p_mul_id_hash_table, p_mul_key);
|
p_mul_data = (p_mul_seq_val *) g_hash_table_lookup (p_mul_id_hash_table, p_mul_key);
|
||||||
|
|
||||||
if (p_mul_data) {
|
if (p_mul_data) {
|
||||||
/* Found address PDU */
|
/* Found address PDU */
|
||||||
|
@ -342,7 +395,7 @@ static p_mul_id_val *register_p_mul_id (packet_info *pinfo, guint8 pdu_type,
|
||||||
if (last_found_pdu) {
|
if (last_found_pdu) {
|
||||||
/* Try to match previous data PDU */
|
/* Try to match previous data PDU */
|
||||||
p_mul_key->seq = last_found_pdu;
|
p_mul_key->seq = last_found_pdu;
|
||||||
p_mul_data = (p_mul_id_val *) g_hash_table_lookup (p_mul_id_hash_table, p_mul_key);
|
p_mul_data = (p_mul_seq_val *) g_hash_table_lookup (p_mul_id_hash_table, p_mul_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_mul_data) {
|
if (p_mul_data) {
|
||||||
|
@ -357,27 +410,35 @@ static p_mul_id_val *register_p_mul_id (packet_info *pinfo, guint8 pdu_type,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
p_mul_key->id = message_id;
|
pkg_list = p_get_proto_data (pinfo->fd, proto_p_mul);
|
||||||
p_mul_key->seq = seq_no;
|
if (!pkg_list) {
|
||||||
if (pdu_type == Ack_PDU) {
|
/* Never saved list for this packet, create a new */
|
||||||
SE_COPY_ADDRESS(&p_mul_key->addr, &(pinfo->dst));
|
pkg_list = g_hash_table_new (NULL, NULL);
|
||||||
} else if (!set_address) {
|
p_mul_package_data_list = g_list_append (p_mul_package_data_list, pkg_list);
|
||||||
SE_COPY_ADDRESS(&p_mul_key->addr, &(pinfo->src));
|
p_add_proto_data (pinfo->fd, proto_p_mul, pkg_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
p_mul_data = (p_mul_id_val *) g_hash_table_lookup (p_mul_id_hash_table, p_mul_key);
|
|
||||||
|
|
||||||
if (!pinfo->fd->flags.visited) {
|
if (!pinfo->fd->flags.visited) {
|
||||||
|
p_mul_key->id = message_id;
|
||||||
|
p_mul_key->seq = seq_no;
|
||||||
|
if (!set_address) {
|
||||||
|
SE_COPY_ADDRESS(&p_mul_key->addr, addr);
|
||||||
|
}
|
||||||
|
p_mul_data = (p_mul_seq_val *) g_hash_table_lookup (p_mul_id_hash_table, p_mul_key);
|
||||||
|
|
||||||
if (p_mul_data) {
|
if (p_mul_data) {
|
||||||
if (pdu_type == Ack_PDU) {
|
if (pdu_type == Ack_PDU) {
|
||||||
/* Only save this data if positive ack */
|
/* Only save this data if positive ack */
|
||||||
if (no_missing == 0) {
|
if (no_missing == 0) {
|
||||||
if (p_mul_data->ack_id == 0) {
|
ack_data = g_hash_table_lookup (p_mul_data->ack_data, (gpointer)dstIP);
|
||||||
|
if (!ack_data) {
|
||||||
/* Only save reference to first ACK */
|
/* Only save reference to first ACK */
|
||||||
p_mul_data->ack_id = pinfo->fd->num;
|
ack_data = se_alloc0 (sizeof (p_mul_ack_data));
|
||||||
|
ack_data->ack_id = pinfo->fd->num;
|
||||||
|
g_hash_table_insert (p_mul_data->ack_data, (gpointer)dstIP, ack_data);
|
||||||
} else {
|
} else {
|
||||||
/* Only count when resending */
|
/* Only count when resending */
|
||||||
p_mul_data->ack_resend_count++;
|
ack_data->ack_resend_count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -394,13 +455,17 @@ static p_mul_id_val *register_p_mul_id (packet_info *pinfo, guint8 pdu_type,
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* New message */
|
/* New message */
|
||||||
p_mul_data = se_alloc (sizeof (p_mul_id_val));
|
p_mul_data = se_alloc0 (sizeof (p_mul_seq_val));
|
||||||
memset (p_mul_data, 0, sizeof (p_mul_id_val));
|
|
||||||
p_mul_data->msg_type = pdu_type;
|
p_mul_data->msg_type = pdu_type;
|
||||||
|
if (pdu_type == Address_PDU || pdu_type == Ack_PDU) {
|
||||||
|
p_mul_data->ack_data = g_hash_table_new (NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
if (pdu_type == Ack_PDU) {
|
if (pdu_type == Ack_PDU) {
|
||||||
/* No matching message for this ack */
|
/* No matching message for this ack */
|
||||||
p_mul_data->ack_id = pinfo->fd->num;
|
ack_data = se_alloc0 (sizeof (p_mul_ack_data));
|
||||||
|
ack_data->ack_id = pinfo->fd->num;
|
||||||
|
g_hash_table_insert (p_mul_data->ack_data, (gpointer)dstIP, ack_data);
|
||||||
} else {
|
} else {
|
||||||
p_mul_data->pdu_id = pinfo->fd->num;
|
p_mul_data->pdu_id = pinfo->fd->num;
|
||||||
p_mul_data->pdu_time = pinfo->fd->abs_ts;
|
p_mul_data->pdu_time = pinfo->fd->abs_ts;
|
||||||
|
@ -417,33 +482,160 @@ static p_mul_id_val *register_p_mul_id (packet_info *pinfo, guint8 pdu_type,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pkg_data = se_alloc (sizeof (p_mul_id_val));
|
/* Copy the current package data to the frame */
|
||||||
|
pkg_data = se_alloc (sizeof (p_mul_seq_val));
|
||||||
*pkg_data = *p_mul_data;
|
*pkg_data = *p_mul_data;
|
||||||
p_add_proto_data (pinfo->fd, proto_p_mul, pkg_data);
|
if (p_mul_data->ack_data) {
|
||||||
|
/* Copy the hash table for ack data */
|
||||||
|
pkg_data->ack_data = g_hash_table_new (NULL, NULL);
|
||||||
|
g_hash_table_foreach (p_mul_data->ack_data, (GHFunc) copy_hashtable_data, pkg_data->ack_data);
|
||||||
|
}
|
||||||
|
g_hash_table_insert (pkg_list, (gpointer)message_id, pkg_data);
|
||||||
} else {
|
} else {
|
||||||
/* Fetch last values from data saved in packet */
|
/* Fetch last values from data saved in packet */
|
||||||
pkg_data = p_get_proto_data (pinfo->fd, proto_p_mul);
|
pkg_data = g_hash_table_lookup (pkg_list, (gpointer)message_id);
|
||||||
|
|
||||||
if (p_mul_data && pdu_type != Ack_PDU && pkg_data->ack_id == 0) {
|
|
||||||
pkg_data->ack_id = p_mul_data->ack_id;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DISSECTOR_ASSERT (pkg_data);
|
DISSECTOR_ASSERT (pkg_data);
|
||||||
return pkg_data;
|
return pkg_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
static p_mul_id_val *p_mul_add_seq_ack (tvbuff_t *tvb, packet_info *pinfo,
|
static void add_ack_analysis (tvbuff_t *tvb, packet_info *pinfo, proto_tree *p_mul_tree,
|
||||||
proto_tree *p_mul_tree, gint offset,
|
gint offset, guint8 pdu_type, address *src, address *dst,
|
||||||
|
guint32 message_id, gint no_missing)
|
||||||
|
{
|
||||||
|
proto_tree *analysis_tree = NULL;
|
||||||
|
proto_item *sa = NULL, *en = NULL;
|
||||||
|
p_mul_seq_val *pkg_data = NULL;
|
||||||
|
p_mul_ack_data *ack_data = NULL;
|
||||||
|
gboolean item_added = FALSE;
|
||||||
|
guint32 dstIp;
|
||||||
|
nstime_t ns;
|
||||||
|
|
||||||
|
if (pinfo->in_error_pkt) {
|
||||||
|
/* No analysis of error packets */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
dstIp = *((guint32*) dst->data);
|
||||||
|
if (pdu_type == Address_PDU) {
|
||||||
|
sa = proto_tree_add_text (p_mul_tree, tvb, 0, 0, "ACK analysis");
|
||||||
|
PROTO_ITEM_SET_GENERATED (sa);
|
||||||
|
analysis_tree = proto_item_add_subtree (sa, ett_ack_analysis);
|
||||||
|
|
||||||
|
/* Fetch package data */
|
||||||
|
if ((pkg_data = lookup_seq_val (message_id, 0, src)) == NULL) {
|
||||||
|
/* No need for seq/ack analysis yet */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (pkg_data->ack_data) {
|
||||||
|
ack_data = g_hash_table_lookup (pkg_data->ack_data, (gpointer)dstIp);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Add reference to Ack_PDU */
|
||||||
|
if (ack_data && ack_data->ack_id) {
|
||||||
|
en = proto_tree_add_uint (analysis_tree, hf_analysis_ack_num, tvb,
|
||||||
|
0, 0, ack_data->ack_id);
|
||||||
|
PROTO_ITEM_SET_GENERATED (en);
|
||||||
|
item_added = TRUE;
|
||||||
|
} else if (!pkg_data->msg_resend_count) {
|
||||||
|
en = proto_tree_add_item (analysis_tree,
|
||||||
|
hf_analysis_ack_missing,
|
||||||
|
tvb, offset, 0, FALSE);
|
||||||
|
if (pinfo->fd->flags.visited) {
|
||||||
|
/* We do not know this on first visit and we do not want to
|
||||||
|
add a entry in the "Expert Severity Info" for this note */
|
||||||
|
expert_add_info_format (pinfo, en, PI_SEQUENCE, PI_NOTE,
|
||||||
|
"Ack PDU missing");
|
||||||
|
PROTO_ITEM_SET_GENERATED (en);
|
||||||
|
}
|
||||||
|
item_added = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!item_added) {
|
||||||
|
PROTO_ITEM_SET_HIDDEN (sa);
|
||||||
|
}
|
||||||
|
} else if (pdu_type == Ack_PDU) {
|
||||||
|
sa = proto_tree_add_text (p_mul_tree, tvb, 0, 0, "SEQ/ACK analysis");
|
||||||
|
PROTO_ITEM_SET_GENERATED (sa);
|
||||||
|
analysis_tree = proto_item_add_subtree (sa, ett_seq_ack_analysis);
|
||||||
|
|
||||||
|
/* Fetch package data */
|
||||||
|
if ((pkg_data = register_p_mul_id (pinfo, src, dstIp, pdu_type, message_id, 0, no_missing)) == NULL) {
|
||||||
|
/* No need for seq/ack analysis yet */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (pkg_data->ack_data) {
|
||||||
|
ack_data = g_hash_table_lookup (pkg_data->ack_data, (gpointer)dstIp);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Add reference to Address_PDU */
|
||||||
|
if (pkg_data->msg_type != Ack_PDU) {
|
||||||
|
en = proto_tree_add_uint (analysis_tree, hf_analysis_addr_pdu_num, tvb,
|
||||||
|
0, 0, pkg_data->pdu_id);
|
||||||
|
PROTO_ITEM_SET_GENERATED (en);
|
||||||
|
|
||||||
|
if (no_missing == 0) {
|
||||||
|
nstime_delta (&ns, &pinfo->fd->abs_ts, &pkg_data->first_msg_time);
|
||||||
|
en = proto_tree_add_time (analysis_tree, hf_analysis_total_time,
|
||||||
|
tvb, 0, 0, &ns);
|
||||||
|
PROTO_ITEM_SET_GENERATED (en);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
en = proto_tree_add_item (analysis_tree,
|
||||||
|
hf_analysis_addr_pdu_missing,
|
||||||
|
tvb, offset, 0, FALSE);
|
||||||
|
expert_add_info_format (pinfo, en, PI_SEQUENCE, PI_NOTE,
|
||||||
|
"Address PDU missing");
|
||||||
|
PROTO_ITEM_SET_GENERATED (en);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pkg_data->msg_type != Ack_PDU && pkg_data->prev_pdu_id) {
|
||||||
|
/* Add reference to previous PDU */
|
||||||
|
en = proto_tree_add_uint (analysis_tree, hf_analysis_last_pdu_num,
|
||||||
|
tvb, 0, 0, pkg_data->prev_pdu_id);
|
||||||
|
PROTO_ITEM_SET_GENERATED (en);
|
||||||
|
|
||||||
|
nstime_delta (&ns, &pinfo->fd->abs_ts, &pkg_data->prev_pdu_time);
|
||||||
|
en = proto_tree_add_time (analysis_tree, hf_analysis_ack_time,
|
||||||
|
tvb, 0, 0, &ns);
|
||||||
|
PROTO_ITEM_SET_GENERATED (en);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ack_data && ack_data->ack_resend_count) {
|
||||||
|
/* Add resend statistics */
|
||||||
|
en = proto_tree_add_uint (analysis_tree, hf_analysis_ack_dup_no,
|
||||||
|
tvb, 0, 0, ack_data->ack_resend_count);
|
||||||
|
PROTO_ITEM_SET_GENERATED (en);
|
||||||
|
|
||||||
|
expert_add_info_format (pinfo, en, PI_SEQUENCE, PI_NOTE,
|
||||||
|
"Dup ACK #%d", ack_data->ack_resend_count);
|
||||||
|
|
||||||
|
en = proto_tree_add_uint (analysis_tree, hf_analysis_ack_resend_from,
|
||||||
|
tvb, 0, 0, ack_data->ack_id);
|
||||||
|
PROTO_ITEM_SET_GENERATED (en);
|
||||||
|
|
||||||
|
if (check_col (pinfo->cinfo, COL_INFO)) {
|
||||||
|
col_append_fstr (pinfo->cinfo, COL_INFO, "[Dup ACK %d#%d] ",
|
||||||
|
ack_data->ack_id, ack_data->ack_resend_count);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static p_mul_seq_val *add_seq_analysis (tvbuff_t *tvb, packet_info *pinfo,
|
||||||
|
proto_tree *p_mul_tree, address *src,
|
||||||
|
gint offset,
|
||||||
guint8 pdu_type, guint32 message_id,
|
guint8 pdu_type, guint32 message_id,
|
||||||
guint16 seq_no, gint no_missing)
|
guint16 seq_no, gint no_missing)
|
||||||
{
|
{
|
||||||
p_mul_id_val *pkg_data = NULL;
|
p_mul_seq_val *pkg_data = NULL;
|
||||||
proto_tree *analysis_tree = NULL;
|
proto_tree *analysis_tree = NULL;
|
||||||
proto_item *en = NULL, *eh = NULL;
|
proto_item *sa = NULL, *en = NULL, *eh = NULL;
|
||||||
|
gboolean item_added = FALSE;
|
||||||
nstime_t ns;
|
nstime_t ns;
|
||||||
|
|
||||||
pkg_data = register_p_mul_id (pinfo, pdu_type, message_id, seq_no,
|
pkg_data = register_p_mul_id (pinfo, src, 0, pdu_type, message_id, seq_no,
|
||||||
no_missing);
|
no_missing);
|
||||||
|
|
||||||
if (!pkg_data) {
|
if (!pkg_data) {
|
||||||
|
@ -451,70 +643,59 @@ static p_mul_id_val *p_mul_add_seq_ack (tvbuff_t *tvb, packet_info *pinfo,
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
en = proto_tree_add_text (p_mul_tree, tvb, 0, 0, "SEQ/ACK analysis");
|
sa = proto_tree_add_text (p_mul_tree, tvb, 0, 0, "SEQ analysis");
|
||||||
PROTO_ITEM_SET_GENERATED (en);
|
PROTO_ITEM_SET_GENERATED (sa);
|
||||||
analysis_tree = proto_item_add_subtree (en, ett_analysis);
|
analysis_tree = proto_item_add_subtree (sa, ett_seq_analysis);
|
||||||
|
|
||||||
|
if (pdu_type == Data_PDU || pdu_type == Discard_Message_PDU) {
|
||||||
|
/* Add reference to Address_PDU */
|
||||||
|
if (pkg_data->addr_id) {
|
||||||
|
en = proto_tree_add_uint (analysis_tree, hf_analysis_addr_pdu_num, tvb,
|
||||||
|
0, 0, pkg_data->addr_id);
|
||||||
|
PROTO_ITEM_SET_GENERATED (en);
|
||||||
|
|
||||||
|
nstime_delta (&ns, &pinfo->fd->abs_ts, &pkg_data->addr_time);
|
||||||
|
en = proto_tree_add_time (analysis_tree, hf_analysis_addr_pdu_time,
|
||||||
|
tvb, 0, 0, &ns);
|
||||||
|
PROTO_ITEM_SET_GENERATED (en);
|
||||||
|
item_added = TRUE;
|
||||||
|
} else if (!pkg_data->msg_resend_count) {
|
||||||
|
en = proto_tree_add_item (analysis_tree,
|
||||||
|
hf_analysis_addr_pdu_missing,
|
||||||
|
tvb, offset, 0, FALSE);
|
||||||
|
expert_add_info_format (pinfo, en, PI_SEQUENCE, PI_NOTE,
|
||||||
|
"Address PDU missing");
|
||||||
|
PROTO_ITEM_SET_GENERATED (en);
|
||||||
|
item_added = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((pdu_type == Data_PDU) && (pkg_data->prev_pdu_id != pkg_data->addr_id)) {
|
||||||
|
/* Add reference to previous Data_PDU */
|
||||||
|
if (pkg_data->prev_pdu_id) {
|
||||||
|
en = proto_tree_add_uint (analysis_tree, hf_analysis_prev_pdu_num, tvb,
|
||||||
|
0, 0, pkg_data->prev_pdu_id);
|
||||||
|
PROTO_ITEM_SET_GENERATED (en);
|
||||||
|
|
||||||
|
nstime_delta (&ns, &pinfo->fd->abs_ts, &pkg_data->prev_pdu_time);
|
||||||
|
en = proto_tree_add_time (analysis_tree, hf_analysis_prev_pdu_time,
|
||||||
|
tvb, 0, 0, &ns);
|
||||||
|
PROTO_ITEM_SET_GENERATED (en);
|
||||||
|
item_added = TRUE;
|
||||||
|
} else if (!pkg_data->msg_resend_count) {
|
||||||
|
en = proto_tree_add_item (analysis_tree,
|
||||||
|
hf_analysis_prev_pdu_missing,
|
||||||
|
tvb, offset, 0, FALSE);
|
||||||
|
expert_add_info_format (pinfo, en, PI_SEQUENCE, PI_NOTE,
|
||||||
|
"Previous PDU missing");
|
||||||
|
PROTO_ITEM_SET_GENERATED (en);
|
||||||
|
item_added = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ((pdu_type == Address_PDU) || (pdu_type == Data_PDU) ||
|
if ((pdu_type == Address_PDU) || (pdu_type == Data_PDU) ||
|
||||||
(pdu_type == Discard_Message_PDU))
|
(pdu_type == Discard_Message_PDU)) {
|
||||||
{
|
/* Add resend statistics */
|
||||||
if (pdu_type == Address_PDU) {
|
|
||||||
if (pkg_data->ack_id) {
|
|
||||||
en = proto_tree_add_uint (analysis_tree, hf_analysis_ack_num, tvb,
|
|
||||||
0, 0, pkg_data->ack_id);
|
|
||||||
PROTO_ITEM_SET_GENERATED (en);
|
|
||||||
} else if (!pkg_data->msg_resend_count) {
|
|
||||||
en = proto_tree_add_item (analysis_tree,
|
|
||||||
hf_analysis_ack_missing,
|
|
||||||
tvb, offset, 0, FALSE);
|
|
||||||
if (pinfo->fd->flags.visited) {
|
|
||||||
/* We do not know this on first visit and we do not want to
|
|
||||||
add a entry in the "Expert Severity Info" for this note */
|
|
||||||
expert_add_info_format (pinfo, en, PI_SEQUENCE, PI_NOTE,
|
|
||||||
"Ack PDU missing");
|
|
||||||
PROTO_ITEM_SET_GENERATED (en);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (pkg_data->addr_id) {
|
|
||||||
en = proto_tree_add_uint (analysis_tree, hf_analysis_addr_pdu_num, tvb,
|
|
||||||
0, 0, pkg_data->addr_id);
|
|
||||||
PROTO_ITEM_SET_GENERATED (en);
|
|
||||||
|
|
||||||
nstime_delta (&ns, &pinfo->fd->abs_ts, &pkg_data->addr_time);
|
|
||||||
en = proto_tree_add_time (analysis_tree, hf_analysis_addr_pdu_time,
|
|
||||||
tvb, 0, 0, &ns);
|
|
||||||
PROTO_ITEM_SET_GENERATED (en);
|
|
||||||
} else if (!pkg_data->msg_resend_count) {
|
|
||||||
en = proto_tree_add_item (analysis_tree,
|
|
||||||
hf_analysis_addr_pdu_missing,
|
|
||||||
tvb, offset, 0, FALSE);
|
|
||||||
expert_add_info_format (pinfo, en, PI_SEQUENCE, PI_NOTE,
|
|
||||||
"Address PDU missing");
|
|
||||||
PROTO_ITEM_SET_GENERATED (en);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((pdu_type == Data_PDU) && (pkg_data->prev_pdu_id != pkg_data->addr_id)) {
|
|
||||||
if (pkg_data->prev_pdu_id) {
|
|
||||||
en = proto_tree_add_uint (analysis_tree, hf_analysis_prev_pdu_num, tvb,
|
|
||||||
0, 0, pkg_data->prev_pdu_id);
|
|
||||||
PROTO_ITEM_SET_GENERATED (en);
|
|
||||||
|
|
||||||
nstime_delta (&ns, &pinfo->fd->abs_ts, &pkg_data->prev_pdu_time);
|
|
||||||
en = proto_tree_add_time (analysis_tree, hf_analysis_prev_pdu_time,
|
|
||||||
tvb, 0, 0, &ns);
|
|
||||||
PROTO_ITEM_SET_GENERATED (en);
|
|
||||||
} else if (!pkg_data->msg_resend_count) {
|
|
||||||
en = proto_tree_add_item (analysis_tree,
|
|
||||||
hf_analysis_prev_pdu_missing,
|
|
||||||
tvb, offset, 0, FALSE);
|
|
||||||
expert_add_info_format (pinfo, en, PI_SEQUENCE, PI_NOTE,
|
|
||||||
"Previous PDU missing");
|
|
||||||
PROTO_ITEM_SET_GENERATED (en);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pkg_data->msg_resend_count) {
|
if (pkg_data->msg_resend_count) {
|
||||||
en = proto_tree_add_uint (analysis_tree, hf_analysis_retrans_no,
|
en = proto_tree_add_uint (analysis_tree, hf_analysis_retrans_no,
|
||||||
tvb, 0, 0, pkg_data->msg_resend_count);
|
tvb, 0, 0, pkg_data->msg_resend_count);
|
||||||
|
@ -543,51 +724,17 @@ static p_mul_id_val *p_mul_add_seq_ack (tvbuff_t *tvb, packet_info *pinfo,
|
||||||
/* Time values does not differ, hide the total time */
|
/* Time values does not differ, hide the total time */
|
||||||
PROTO_ITEM_SET_HIDDEN (eh);
|
PROTO_ITEM_SET_HIDDEN (eh);
|
||||||
}
|
}
|
||||||
}
|
item_added = TRUE;
|
||||||
} else if (pdu_type == Ack_PDU) {
|
|
||||||
if (pkg_data->msg_type != Ack_PDU) {
|
|
||||||
en = proto_tree_add_uint (analysis_tree, hf_analysis_addr_pdu_num,
|
|
||||||
tvb, 0, 0, pkg_data->pdu_id);
|
|
||||||
PROTO_ITEM_SET_GENERATED (en);
|
|
||||||
|
|
||||||
if (no_missing == 0) {
|
if (check_col (pinfo->cinfo, COL_INFO)) {
|
||||||
nstime_delta (&ns, &pinfo->fd->abs_ts, &pkg_data->first_msg_time);
|
col_append_fstr (pinfo->cinfo, COL_INFO, "[Retrans %d#%d] ",
|
||||||
eh = proto_tree_add_time (analysis_tree, hf_analysis_total_time,
|
pkg_data->pdu_id, pkg_data->msg_resend_count);
|
||||||
tvb, 0, 0, &ns);
|
|
||||||
PROTO_ITEM_SET_GENERATED (eh);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pkg_data->prev_pdu_id) {
|
|
||||||
en = proto_tree_add_uint (analysis_tree, hf_analysis_last_pdu_num,
|
|
||||||
tvb, 0, 0, pkg_data->prev_pdu_id);
|
|
||||||
PROTO_ITEM_SET_GENERATED (en);
|
|
||||||
|
|
||||||
nstime_delta (&ns, &pinfo->fd->abs_ts, &pkg_data->prev_pdu_time);
|
|
||||||
en = proto_tree_add_time (analysis_tree, hf_analysis_ack_time,
|
|
||||||
tvb, 0, 0, &ns);
|
|
||||||
PROTO_ITEM_SET_GENERATED (en);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
en = proto_tree_add_item (analysis_tree, hf_analysis_addr_pdu_missing,
|
|
||||||
tvb, 0, 0, FALSE);
|
|
||||||
PROTO_ITEM_SET_GENERATED (en);
|
|
||||||
|
|
||||||
expert_add_info_format (pinfo, en, PI_SEQUENCE, PI_NOTE,
|
|
||||||
"Address PDU missing");
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (pkg_data->ack_resend_count) {
|
if (!item_added) {
|
||||||
en = proto_tree_add_uint (analysis_tree, hf_analysis_ack_dup_no,
|
PROTO_ITEM_SET_HIDDEN (sa);
|
||||||
tvb, 0, 0, pkg_data->ack_resend_count);
|
|
||||||
PROTO_ITEM_SET_GENERATED (en);
|
|
||||||
|
|
||||||
expert_add_info_format (pinfo, en, PI_SEQUENCE, PI_NOTE,
|
|
||||||
"Dup ACK #%d", pkg_data->ack_resend_count);
|
|
||||||
|
|
||||||
en = proto_tree_add_uint (analysis_tree, hf_analysis_ack_resend_from,
|
|
||||||
tvb, 0, 0, pkg_data->ack_id);
|
|
||||||
PROTO_ITEM_SET_GENERATED (en);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return pkg_data;
|
return pkg_data;
|
||||||
|
@ -601,7 +748,7 @@ static void dissect_reassembled_data (tvbuff_t *tvb, packet_info *pinfo _U_,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(decode_option) {
|
switch (decode_option) {
|
||||||
case DECODE_BER:
|
case DECODE_BER:
|
||||||
dissect_unknown_ber (pinfo, tvb, 0, tree);
|
dissect_unknown_ber (pinfo, tvb, 0, tree);
|
||||||
break;
|
break;
|
||||||
|
@ -619,14 +766,15 @@ static void dissect_p_mul (tvbuff_t *tvb, packet_info *pinfo _U_,
|
||||||
{
|
{
|
||||||
proto_tree *p_mul_tree = NULL, *field_tree = NULL, *checksum_tree = NULL;
|
proto_tree *p_mul_tree = NULL, *field_tree = NULL, *checksum_tree = NULL;
|
||||||
proto_item *ti = NULL, *en = NULL, *len_en = NULL;
|
proto_item *ti = NULL, *en = NULL, *len_en = NULL;
|
||||||
p_mul_id_val *pkg_data = NULL;
|
p_mul_seq_val *pkg_data = NULL;
|
||||||
gboolean save_fragmented;
|
gboolean save_fragmented;
|
||||||
fragment_data *frag_msg = NULL;
|
fragment_data *frag_msg = NULL;
|
||||||
guint32 message_id = 0;
|
guint32 message_id = 0, ip;
|
||||||
guint16 no_dest = 0, count = 0, len = 0, data_len = 0;
|
guint16 no_dest = 0, count = 0, len = 0, data_len = 0;
|
||||||
guint16 checksum1, checksum2, pdu_length = 0, no_pdus = 0, seq_no = 0;
|
guint16 checksum1, checksum2, pdu_length = 0, no_pdus = 0, seq_no = 0;
|
||||||
guint8 pdu_type = 0, *value = NULL, map = 0, fec_len;
|
guint8 pdu_type = 0, *value = NULL, map = 0, fec_len;
|
||||||
gint i, tot_no_missing = 0, no_missing = 0, offset = 0;
|
gint i, tot_no_missing = 0, no_missing = 0, offset = 0;
|
||||||
|
address src, dst;
|
||||||
GString *message_id_list = NULL;
|
GString *message_id_list = NULL;
|
||||||
nstime_t ts;
|
nstime_t ts;
|
||||||
|
|
||||||
|
@ -766,6 +914,8 @@ static void dissect_p_mul (tvbuff_t *tvb, packet_info *pinfo _U_,
|
||||||
|
|
||||||
if (pdu_type == Ack_PDU) {
|
if (pdu_type == Ack_PDU) {
|
||||||
/* Source ID of Ack Sender */
|
/* Source ID of Ack Sender */
|
||||||
|
ip = tvb_get_ipv4 (tvb, offset);
|
||||||
|
SET_ADDRESS (&dst, AT_IPv4, sizeof(ip), ep_memdup (&ip, 4));
|
||||||
proto_tree_add_item (p_mul_tree, hf_source_id_ack, tvb, offset, 4, FALSE);
|
proto_tree_add_item (p_mul_tree, hf_source_id_ack, tvb, offset, 4, FALSE);
|
||||||
offset += 4;
|
offset += 4;
|
||||||
|
|
||||||
|
@ -775,6 +925,8 @@ static void dissect_p_mul (tvbuff_t *tvb, packet_info *pinfo _U_,
|
||||||
offset += 2;
|
offset += 2;
|
||||||
} else {
|
} else {
|
||||||
/* Source Id */
|
/* Source Id */
|
||||||
|
ip = tvb_get_ipv4 (tvb, offset);
|
||||||
|
SET_ADDRESS (&src, AT_IPv4, sizeof(ip), ep_memdup (&ip, 4));
|
||||||
proto_tree_add_item (p_mul_tree, hf_source_id, tvb, offset, 4, FALSE);
|
proto_tree_add_item (p_mul_tree, hf_source_id, tvb, offset, 4, FALSE);
|
||||||
offset += 4;
|
offset += 4;
|
||||||
|
|
||||||
|
@ -850,6 +1002,8 @@ static void dissect_p_mul (tvbuff_t *tvb, packet_info *pinfo _U_,
|
||||||
field_tree = proto_item_add_subtree (en, ett_dest_entry);
|
field_tree = proto_item_add_subtree (en, ett_dest_entry);
|
||||||
|
|
||||||
/* Destination Id */
|
/* Destination Id */
|
||||||
|
ip = tvb_get_ipv4 (tvb, offset);
|
||||||
|
SET_ADDRESS (&dst, AT_IPv4, sizeof(ip), ep_memdup(&ip, 4));
|
||||||
proto_tree_add_item (field_tree, hf_dest_id, tvb, offset, 4, FALSE);
|
proto_tree_add_item (field_tree, hf_dest_id, tvb, offset, 4, FALSE);
|
||||||
offset += 4;
|
offset += 4;
|
||||||
|
|
||||||
|
@ -864,6 +1018,11 @@ static void dissect_p_mul (tvbuff_t *tvb, packet_info *pinfo _U_,
|
||||||
len, plurality (len, "", "s"));
|
len, plurality (len, "", "s"));
|
||||||
offset += len;
|
offset += len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (use_seq_ack_analysis) {
|
||||||
|
add_ack_analysis (tvb, pinfo, field_tree, offset, pdu_type, &src, &dst,
|
||||||
|
message_id, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
proto_item_append_text (ti, ", Count of Dest: %u", no_dest);
|
proto_item_append_text (ti, ", Count of Dest: %u", no_dest);
|
||||||
|
@ -903,6 +1062,8 @@ static void dissect_p_mul (tvbuff_t *tvb, packet_info *pinfo _U_,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Source Id */
|
/* Source Id */
|
||||||
|
ip = tvb_get_ipv4 (tvb, offset);
|
||||||
|
SET_ADDRESS (&src, AT_IPv4, sizeof(ip), ep_memdup (&ip, 4));
|
||||||
proto_tree_add_item (field_tree, hf_source_id, tvb, offset, 4, FALSE);
|
proto_tree_add_item (field_tree, hf_source_id, tvb, offset, 4, FALSE);
|
||||||
offset += 4;
|
offset += 4;
|
||||||
|
|
||||||
|
@ -924,18 +1085,19 @@ static void dissect_p_mul (tvbuff_t *tvb, packet_info *pinfo _U_,
|
||||||
|
|
||||||
if (check_col (pinfo->cinfo, COL_INFO)) {
|
if (check_col (pinfo->cinfo, COL_INFO)) {
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
g_string_printf (message_id_list, "%d", message_id);
|
g_string_printf (message_id_list, "%u", message_id);
|
||||||
} else {
|
} else {
|
||||||
g_string_append_printf (message_id_list, ",%d", message_id);
|
g_string_append_printf (message_id_list, ",%u", message_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (len > 10) {
|
if (len > 10) {
|
||||||
gint num_seq_no = (len - 10) / 2;
|
gint num_seq_no = (len - 10) / 2;
|
||||||
|
guint16 ack_seq_no, prev_ack_seq_no = 0;
|
||||||
for (no_missing = 0; no_missing < num_seq_no; no_missing++) {
|
for (no_missing = 0; no_missing < num_seq_no; no_missing++) {
|
||||||
/* Missing Data PDU Seq Number */
|
/* Missing Data PDU Seq Number */
|
||||||
seq_no = tvb_get_ntohs (tvb, offset);
|
ack_seq_no = tvb_get_ntohs (tvb, offset);
|
||||||
if ((seq_no != 0) && (no_missing < num_seq_no - 2) && tvb_get_ntohs (tvb, offset + 2) == 0) {
|
if ((ack_seq_no != 0) && (no_missing < num_seq_no - 2) && tvb_get_ntohs (tvb, offset + 2) == 0) {
|
||||||
/* We are handling a range */
|
/* We are handling a range */
|
||||||
guint16 end_seq_no = tvb_get_ntohs (tvb, offset + 4);
|
guint16 end_seq_no = tvb_get_ntohs (tvb, offset + 4);
|
||||||
|
|
||||||
|
@ -943,8 +1105,8 @@ static void dissect_p_mul (tvbuff_t *tvb, packet_info *pinfo _U_,
|
||||||
tvb, offset, 6,
|
tvb, offset, 6,
|
||||||
tvb_get_ptr (tvb, offset, 6),
|
tvb_get_ptr (tvb, offset, 6),
|
||||||
"Missing Data PDU Seq Range: %d - %d",
|
"Missing Data PDU Seq Range: %d - %d",
|
||||||
seq_no, end_seq_no);
|
ack_seq_no, end_seq_no);
|
||||||
if (seq_no >= end_seq_no) {
|
if (ack_seq_no >= end_seq_no) {
|
||||||
proto_item_append_text (en, " (invalid)");
|
proto_item_append_text (en, " (invalid)");
|
||||||
expert_add_info_format (pinfo, en, PI_UNDECODED, PI_WARN,
|
expert_add_info_format (pinfo, en, PI_UNDECODED, PI_WARN,
|
||||||
"Invalid missing sequence range");
|
"Invalid missing sequence range");
|
||||||
|
@ -954,37 +1116,55 @@ static void dissect_p_mul (tvbuff_t *tvb, packet_info *pinfo _U_,
|
||||||
|
|
||||||
missing_tree = proto_item_add_subtree (en, ett_range_entry);
|
missing_tree = proto_item_add_subtree (en, ett_range_entry);
|
||||||
|
|
||||||
for (sno = seq_no; sno <= end_seq_no; sno++) {
|
for (sno = ack_seq_no; sno <= end_seq_no; sno++) {
|
||||||
en = proto_tree_add_uint_format (missing_tree, hf_miss_seq_no,
|
en = proto_tree_add_uint_format (missing_tree, hf_miss_seq_no,
|
||||||
tvb, offset, 6, sno,
|
tvb, offset, 6, sno,
|
||||||
"Missing Data PDU Seq Number: %d", sno);
|
"Missing Data PDU Seq Number: %d", sno);
|
||||||
PROTO_ITEM_SET_GENERATED (en);
|
PROTO_ITEM_SET_GENERATED (en);
|
||||||
}
|
}
|
||||||
tot_no_missing += (end_seq_no - seq_no + 1);
|
tot_no_missing += (end_seq_no - ack_seq_no + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
offset += 6;
|
offset += 6;
|
||||||
no_missing += 2; /* Skip the next two */
|
no_missing += 2; /* Skip the next two */
|
||||||
|
prev_ack_seq_no = end_seq_no;
|
||||||
} else {
|
} else {
|
||||||
/* No range, handle one seq no */
|
/* No range, handle one seq no */
|
||||||
en = proto_tree_add_item (field_tree, hf_miss_seq_no, tvb,offset,
|
en = proto_tree_add_item (field_tree, hf_miss_seq_no, tvb,offset,
|
||||||
2, FALSE);
|
2, FALSE);
|
||||||
offset += 2;
|
offset += 2;
|
||||||
|
|
||||||
if (seq_no == 0) {
|
if (ack_seq_no == 0) {
|
||||||
proto_item_append_text (en, " (invalid)");
|
proto_item_append_text (en, " (invalid)");
|
||||||
expert_add_info_format (pinfo, en, PI_UNDECODED, PI_WARN,
|
expert_add_info_format (pinfo, en, PI_UNDECODED, PI_WARN,
|
||||||
"Invalid missing seq number");
|
"Invalid missing seq number");
|
||||||
|
} else if (ack_seq_no <= prev_ack_seq_no) {
|
||||||
|
proto_item_append_text (en, " (end of list indicator)");
|
||||||
|
} else {
|
||||||
|
tot_no_missing++;
|
||||||
}
|
}
|
||||||
tot_no_missing++;
|
prev_ack_seq_no = ack_seq_no;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (use_seq_ack_analysis) {
|
||||||
|
add_ack_analysis (tvb, pinfo, field_tree, offset, pdu_type, &src, &dst,
|
||||||
|
message_id, no_missing);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
proto_item_append_text (ti, ", Count of Ack: %u", count);
|
||||||
|
|
||||||
if (tvb_length_remaining (tvb, offset) >= 8) {
|
if (tvb_length_remaining (tvb, offset) >= 8) {
|
||||||
/* Timestamp Option */
|
/* Timestamp Option (in units of 100ms) */
|
||||||
proto_tree_add_item (p_mul_tree, hf_timestamp_option, tvb, offset, 8, FALSE);
|
guint64 timestamp;
|
||||||
|
|
||||||
|
timestamp = tvb_get_ntoh64 (tvb, offset);
|
||||||
|
proto_tree_add_uint64_format (p_mul_tree, hf_timestamp_option, tvb,
|
||||||
|
offset, 8, timestamp,
|
||||||
|
"Timestamp: %" G_GINT64_MODIFIER "d.%d second%s (%" G_GINT64_MODIFIER "u)",
|
||||||
|
timestamp / 10, (int) timestamp % 10,
|
||||||
|
(timestamp == 10) ? "" : "s", timestamp);
|
||||||
offset += 8;
|
offset += 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1029,23 +1209,19 @@ static void dissect_p_mul (tvbuff_t *tvb, packet_info *pinfo _U_,
|
||||||
|
|
||||||
/* Add SEQ/ACK analysis entry */
|
/* Add SEQ/ACK analysis entry */
|
||||||
if (use_seq_ack_analysis && (pdu_type <= Discard_Message_PDU) &&
|
if (use_seq_ack_analysis && (pdu_type <= Discard_Message_PDU) &&
|
||||||
(pdu_type != Address_PDU || no_dest != 0))
|
(pdu_type != Ack_PDU) && (pdu_type != Address_PDU || no_dest != 0))
|
||||||
{
|
{
|
||||||
pkg_data = p_mul_add_seq_ack (tvb, pinfo, p_mul_tree, offset, pdu_type,
|
pkg_data = add_seq_analysis (tvb, pinfo, p_mul_tree, &src, offset, pdu_type,
|
||||||
message_id, seq_no, tot_no_missing);
|
message_id, seq_no, tot_no_missing);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (check_col (pinfo->cinfo, COL_INFO)) {
|
if (check_col (pinfo->cinfo, COL_INFO)) {
|
||||||
if (pkg_data) {
|
/* Check if printing Ack-Ack */
|
||||||
if (pdu_type != Ack_PDU && pkg_data->msg_resend_count) {
|
if (pdu_type == Address_PDU && no_dest == 0) {
|
||||||
col_append_fstr (pinfo->cinfo, COL_INFO, "[Retrans %d#%d] ",
|
col_append_str (pinfo->cinfo, COL_INFO, get_type (Ack_Ack_PDU));
|
||||||
pkg_data->pdu_id, pkg_data->msg_resend_count);
|
} else {
|
||||||
} else if (pdu_type == Ack_PDU && pkg_data->ack_resend_count) {
|
col_append_str (pinfo->cinfo, COL_INFO, get_type (pdu_type));
|
||||||
col_append_fstr (pinfo->cinfo, COL_INFO, "[Dup ACK %d#%d] ",
|
|
||||||
pkg_data->ack_id, pkg_data->ack_resend_count);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
col_append_str (pinfo->cinfo, COL_INFO, get_type (pdu_type));
|
|
||||||
if (pdu_type == Address_PDU || pdu_type == Extra_Address_PDU ||
|
if (pdu_type == Address_PDU || pdu_type == Extra_Address_PDU ||
|
||||||
pdu_type == FEC_Address_PDU || pdu_type == Extra_FEC_Address_PDU) {
|
pdu_type == FEC_Address_PDU || pdu_type == Extra_FEC_Address_PDU) {
|
||||||
col_append_fstr (pinfo->cinfo, COL_INFO, ", No PDUs: %u", no_pdus);
|
col_append_fstr (pinfo->cinfo, COL_INFO, ", No PDUs: %u", no_pdus);
|
||||||
|
@ -1054,7 +1230,9 @@ static void dissect_p_mul (tvbuff_t *tvb, packet_info *pinfo _U_,
|
||||||
}
|
}
|
||||||
if (pdu_type == Address_PDU || pdu_type == Extra_Address_PDU ||
|
if (pdu_type == Address_PDU || pdu_type == Extra_Address_PDU ||
|
||||||
pdu_type == FEC_Address_PDU || pdu_type == Extra_FEC_Address_PDU) {
|
pdu_type == FEC_Address_PDU || pdu_type == Extra_FEC_Address_PDU) {
|
||||||
col_append_fstr (pinfo->cinfo, COL_INFO, ", Count of Dest: %u", no_dest);
|
if (no_dest > 0) {
|
||||||
|
col_append_fstr (pinfo->cinfo, COL_INFO, ", Count of Dest: %u", no_dest);
|
||||||
|
}
|
||||||
} else if (pdu_type == Ack_PDU) {
|
} else if (pdu_type == Ack_PDU) {
|
||||||
if (tot_no_missing) {
|
if (tot_no_missing) {
|
||||||
col_append_fstr (pinfo->cinfo, COL_INFO, ", Missing seq numbers: %u",
|
col_append_fstr (pinfo->cinfo, COL_INFO, ", Missing seq numbers: %u",
|
||||||
|
@ -1063,7 +1241,7 @@ static void dissect_p_mul (tvbuff_t *tvb, packet_info *pinfo _U_,
|
||||||
col_append_fstr (pinfo->cinfo, COL_INFO, ", Count of Ack: %u", count);
|
col_append_fstr (pinfo->cinfo, COL_INFO, ", Count of Ack: %u", count);
|
||||||
}
|
}
|
||||||
if (pdu_type != Ack_PDU) {
|
if (pdu_type != Ack_PDU) {
|
||||||
col_append_fstr (pinfo->cinfo, COL_INFO, ", MSID: %d", message_id);
|
col_append_fstr (pinfo->cinfo, COL_INFO, ", MSID: %u", message_id);
|
||||||
} else {
|
} else {
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
col_append_fstr (pinfo->cinfo, COL_INFO, ", MSID: %s", message_id_list->str);
|
col_append_fstr (pinfo->cinfo, COL_INFO, ", MSID: %s", message_id_list->str);
|
||||||
|
@ -1128,7 +1306,13 @@ static void p_mul_init_routine (void)
|
||||||
g_hash_table_destroy (p_mul_id_hash_table);
|
g_hash_table_destroy (p_mul_id_hash_table);
|
||||||
}
|
}
|
||||||
|
|
||||||
p_mul_id_hash_table = g_hash_table_new (p_mul_id_hash, p_mul_id_hash_equal);
|
if (p_mul_package_data_list) {
|
||||||
|
g_list_foreach (p_mul_package_data_list, (GFunc)p_mul_package_data_destroy, NULL);
|
||||||
|
g_list_free (p_mul_package_data_list);
|
||||||
|
}
|
||||||
|
|
||||||
|
p_mul_id_hash_table = g_hash_table_new_full (p_mul_id_hash, p_mul_id_hash_equal, NULL, (GDestroyNotify)p_mul_id_value_destroy);
|
||||||
|
p_mul_package_data_list = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void proto_register_p_mul (void)
|
void proto_register_p_mul (void)
|
||||||
|
@ -1341,7 +1525,9 @@ void proto_register_p_mul (void)
|
||||||
&ett_ack_entry,
|
&ett_ack_entry,
|
||||||
&ett_range_entry,
|
&ett_range_entry,
|
||||||
&ett_checksum,
|
&ett_checksum,
|
||||||
&ett_analysis,
|
&ett_seq_analysis,
|
||||||
|
&ett_ack_analysis,
|
||||||
|
&ett_seq_ack_analysis,
|
||||||
&ett_msg_fragment,
|
&ett_msg_fragment,
|
||||||
&ett_msg_fragments
|
&ett_msg_fragments
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue