diff options
author | martinm <martinm@f5534014-38df-0310-8fa8-9805f1628bb7> | 2007-07-04 17:27:46 +0000 |
---|---|---|
committer | martinm <martinm@f5534014-38df-0310-8fa8-9805f1628bb7> | 2007-07-04 17:27:46 +0000 |
commit | ea84d55ab5b697c9e7f64b0ad2bc14fe9623ae8d (patch) | |
tree | 1dc4e7743b0ca7ac6cce75a70509357a94aa3c08 /epan/dissectors/packet-sip.c | |
parent | 618226113975221f520b6cb8572a2acfdfb7c925 (diff) |
Make lines of raw SIP filterable. Fix a little whitespace.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@22242 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-sip.c')
-rw-r--r-- | epan/dissectors/packet-sip.c | 46 |
1 files changed, 27 insertions, 19 deletions
diff --git a/epan/dissectors/packet-sip.c b/epan/dissectors/packet-sip.c index 03f7389a9d..9bc1f180e0 100644 --- a/epan/dissectors/packet-sip.c +++ b/epan/dissectors/packet-sip.c @@ -79,6 +79,7 @@ static dissector_handle_t sip_tcp_handle = NULL; /* Initialize the protocol and registered fields */ static gint proto_sip = -1; static gint proto_raw_sip = -1; +static gint hf_raw_sip_line = -1; static gint hf_msg_hdr = -1; static gint hf_Method = -1; static gint hf_Request_Line = -1; @@ -2634,26 +2635,28 @@ static gint sip_is_known_sip_header(tvbuff_t *tvb, int offset, guint header_len) static void tvb_raw_text_add(tvbuff_t *tvb, int offset, int length, proto_tree *tree) { - proto_tree *raw_tree = NULL; - proto_item *ti = NULL; - int next_offset, linelen, end_offset; - - if(tree) { - ti = proto_tree_add_item(tree, proto_raw_sip, tvb, offset, length, FALSE); - raw_tree = proto_item_add_subtree(ti, ett_raw_text); - } - - end_offset = offset + length; - - while (offset < end_offset) { - tvb_find_line_end(tvb, offset, -1, &next_offset, FALSE); - linelen = next_offset - offset; - if(raw_tree) { - proto_tree_add_text(raw_tree, tvb, offset, linelen, - "%s", tvb_format_text(tvb, offset, linelen)); - } - offset = next_offset; + proto_tree *raw_tree = NULL; + proto_item *ti = NULL; + int next_offset, linelen, end_offset; + + if (tree) { + ti = proto_tree_add_item(tree, proto_raw_sip, tvb, offset, length, FALSE); + raw_tree = proto_item_add_subtree(ti, ett_raw_text); + } + + end_offset = offset + length; + + while (offset < end_offset) { + tvb_find_line_end(tvb, offset, -1, &next_offset, FALSE); + linelen = next_offset - offset; + if (raw_tree) { + proto_tree_add_string_format(raw_tree, hf_raw_sip_line, tvb, offset, linelen, + tvb_format_text(tvb, offset, linelen), + "%s", + tvb_format_text(tvb, offset, linelen)); } + offset = next_offset; + } } /* Check to see if this packet is a resent request. Return value is number @@ -2821,6 +2824,11 @@ void proto_register_sip(void) /* Setup list of header fields */ static hf_register_info hf[] = { + { &hf_raw_sip_line, + { "Raw SIP Line", "raw_sip.line", + FT_STRING, BASE_NONE,NULL,0x0, + "Raw SIP Line", HFILL } + }, { &hf_msg_hdr, { "Message Header", "sip.msg_hdr", FT_NONE, 0, NULL, 0, |