aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-jxta.c
diff options
context:
space:
mode:
authormorriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7>2012-06-20 13:30:07 +0000
committermorriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7>2012-06-20 13:30:07 +0000
commitc8391561bf16bde475344593e7987bc45c94944e (patch)
tree7f1ac290c1925812ef8d63c739a0e558ed2cd958 /epan/dissectors/packet-jxta.c
parentade3bd548ae4b02c8cb9bb8344b9329997ed62d8 (diff)
Use separate filters for the RTT found on a SACK and the RTT found on a
DATA chunk: having them in both places is helpful when looking at the messages but having them separate is helpful when graphing the RTTs. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@43406 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-jxta.c')
-rw-r--r--epan/dissectors/packet-jxta.c37
1 files changed, 12 insertions, 25 deletions
diff --git a/epan/dissectors/packet-jxta.c b/epan/dissectors/packet-jxta.c
index a0a40e8d41..0cc718cc5a 100644
--- a/epan/dissectors/packet-jxta.c
+++ b/epan/dissectors/packet-jxta.c
@@ -203,7 +203,7 @@ static gboolean dissect_jxta_SCTP_heur(tvbuff_t * tvb, packet_info * pinfo, prot
static int dissect_jxta_udp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree);
static int dissect_jxta_stream(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree);
-static conversation_t *get_tpt_conversation(packet_info * pinfo, gboolean create);
+static jxta_stream_conversation_data *get_tpt_conversation(packet_info * pinfo);
static conversation_t *get_peer_conversation(packet_info * pinfo, jxta_stream_conversation_data* tpt_conv_data, gboolean create);
static int dissect_jxta_welcome(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, address * found_addr, gboolean initiator);
@@ -517,7 +517,6 @@ static int dissect_jxta_stream(tvbuff_t * tvb, packet_info * pinfo, proto_tree *
guint available = tvb_reported_length_remaining(tvb, offset);
gint processed = 0;
gint needed = 0;
- conversation_t *tpt_conversation = NULL;
jxta_stream_conversation_data *tpt_conv_data = NULL;
proto_item *jxta_tree_item = NULL;
proto_tree *jxta_tree = NULL;
@@ -534,8 +533,7 @@ static int dissect_jxta_stream(tvbuff_t * tvb, packet_info * pinfo, proto_tree *
address *welcome_addr;
gboolean initiator = FALSE;
- tpt_conversation = get_tpt_conversation(pinfo, TRUE);
- tpt_conv_data = (jxta_stream_conversation_data *) conversation_get_proto_data(tpt_conversation, proto_jxta);
+ tpt_conv_data = get_tpt_conversation(pinfo);
if (0 == tpt_conv_data->initiator_welcome_frame) {
/* The initiator welcome frame */
@@ -617,14 +615,8 @@ static int dissect_jxta_stream(tvbuff_t * tvb, packet_info * pinfo, proto_tree *
/* Redo header processing, this time populating the tree. */
headers_len = dissect_jxta_message_framing(tvb, pinfo, jxta_tree, &content_length, &content_type);
- tpt_conversation = get_tpt_conversation(pinfo, TRUE);
-
- if (NULL != tpt_conversation) {
- tpt_conv_data = (jxta_stream_conversation_data *) conversation_get_proto_data(tpt_conversation, proto_jxta);
- if (tpt_conv_data) {
- peer_conversation = get_peer_conversation(pinfo, tpt_conv_data, TRUE);
- }
- }
+ tpt_conv_data = get_tpt_conversation(pinfo);
+ peer_conversation = get_peer_conversation(pinfo, tpt_conv_data, TRUE);
/* Use our source and destination addresses if we have them */
if (NULL != peer_conversation) {
@@ -687,19 +679,14 @@ Common_Exit:
* which is associated with the packet info.
*
* @param pinfo The packet info from the underlying transport.
-* @param create If TRUE then create a new conversation object if necessary.
**/
-static conversation_t *get_tpt_conversation(packet_info * pinfo, gboolean create)
+static jxta_stream_conversation_data *get_tpt_conversation(packet_info * pinfo)
{
conversation_t *tpt_conversation =
find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst, pinfo->ptype, pinfo->srcport, pinfo->destport, 0);
jxta_stream_conversation_data *tpt_conv_data;
if (tpt_conversation == NULL) {
- if (!create) {
- return NULL;
- }
-
/*
* No conversation exists yet - create one.
*/
@@ -732,7 +719,7 @@ static conversation_t *get_tpt_conversation(packet_info * pinfo, gboolean create
conversation_add_proto_data(tpt_conversation, proto_jxta, tpt_conv_data);
}
- return tpt_conversation;
+ return tpt_conv_data;
}
/**
@@ -1080,7 +1067,7 @@ static int dissect_jxta_message_framing(tvbuff_t * tvb, packet_info * pinfo, pro
/*
* Put header name into the protocol tree
*/
- proto_tree_add_item(framing_header_tree, hf_jxta_framing_header_name, tvb, tree_offset, sizeof(gint8), ENC_ASCII|ENC_BIG_ENDIAN);
+ proto_tree_add_item(framing_header_tree, hf_jxta_framing_header_name, tvb, tree_offset, sizeof(gint8), ENC_ASCII|ENC_NA);
/*
* Append header name into the header protocol item. It's a nice hint so you don't have to reveal all headers.
@@ -1389,7 +1376,7 @@ static int dissect_jxta_message(tvbuff_t * tvb, packet_info * pinfo, proto_tree
guint16 name_len = tvb_get_ntohs(tvb, tree_offset);
names_table[2 + each_name] = tvb_get_ephemeral_string(tvb, tree_offset + sizeof(name_len), name_len);
- proto_tree_add_item(jxta_msg_tree, hf_jxta_message_names_name, tvb, tree_offset, sizeof(name_len), ENC_ASCII|ENC_BIG_ENDIAN);
+ proto_tree_add_item(jxta_msg_tree, hf_jxta_message_names_name, tvb, tree_offset, sizeof(name_len), ENC_ASCII|ENC_NA);
tree_offset += sizeof(name_len) + name_len;
}
@@ -1630,13 +1617,13 @@ static int dissect_jxta_message_element_1(tvbuff_t * tvb, packet_info * pinfo, p
name_len = tvb_get_ntohs(tvb, tree_offset);
proto_item_append_text(jxta_elem_tree_item, " \"%s\"", tvb_format_text(tvb, tree_offset + sizeof(guint16), name_len));
- proto_tree_add_item(jxta_elem_tree, hf_jxta_element_name, tvb, tree_offset, sizeof(guint16), ENC_ASCII|ENC_BIG_ENDIAN);
+ proto_tree_add_item(jxta_elem_tree, hf_jxta_element_name, tvb, tree_offset, sizeof(guint16), ENC_ASCII|ENC_NA);
tree_offset += sizeof(guint16) + name_len;
/* process type */
if ((flags & JXTAMSG1_ELMFLAG_TYPE) != 0) {
guint16 type_len = tvb_get_ntohs(tvb, tree_offset);
- proto_tree_add_item(jxta_elem_tree, hf_jxta_element_type, tvb, tree_offset, sizeof(guint16), ENC_ASCII|ENC_BIG_ENDIAN);
+ proto_tree_add_item(jxta_elem_tree, hf_jxta_element_type, tvb, tree_offset, sizeof(guint16), ENC_ASCII|ENC_NA);
tree_offset += sizeof(guint16);
mediatype = tvb_get_ephemeral_string(tvb, tree_offset, type_len);
@@ -1647,7 +1634,7 @@ static int dissect_jxta_message_element_1(tvbuff_t * tvb, packet_info * pinfo, p
/* process encoding */
if ((flags & JXTAMSG1_ELMFLAG_ENCODING) != 0) {
guint16 encoding_len = tvb_get_ntohs(tvb, tree_offset);
- proto_tree_add_item(jxta_elem_tree, hf_jxta_element_encoding, tvb, tree_offset, sizeof(guint16), ENC_ASCII|ENC_BIG_ENDIAN);
+ proto_tree_add_item(jxta_elem_tree, hf_jxta_element_encoding, tvb, tree_offset, sizeof(guint16), ENC_ASCII|ENC_NA);
tree_offset += sizeof(guint16) + encoding_len;
}
@@ -1905,7 +1892,7 @@ static int dissect_jxta_message_element_2(tvbuff_t * tvb, packet_info * pinfo, p
/* literal name */
guint16 name_len = tvb_get_ntohs(tvb, tree_offset);
proto_item_append_text(jxta_elem_tree_item, " \"%s\"", tvb_format_text(tvb, tree_offset + sizeof(guint16), name_len));
- proto_tree_add_item(jxta_elem_tree, hf_jxta_element_name, tvb, tree_offset, sizeof(guint16), ENC_ASCII|ENC_BIG_ENDIAN);
+ proto_tree_add_item(jxta_elem_tree, hf_jxta_element_name, tvb, tree_offset, sizeof(guint16), ENC_ASCII|ENC_NA);
tree_offset += sizeof(guint16) + name_len;
}