aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-sip.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2010-05-28 23:00:29 +0000
committerGerald Combs <gerald@wireshark.org>2010-05-28 23:00:29 +0000
commitccd0726178b123ba88729f0146a2c237b448cd0f (patch)
tree96e600cd2d0a67ceb39663ad9f20d03d1f454edb /epan/dissectors/packet-sip.c
parent600d32434f3b8eef1e9c3d44eaf43b4a9497d014 (diff)
From Karl Heinz Wolf via bug 3571 (with minor changes):
Patch for the SIP dissector: the raw SIP message can be shown with our without the "\r\n". User may want to remove the \r\n for clarity (by selecting a checkbox). svn path=/trunk/; revision=33014
Diffstat (limited to 'epan/dissectors/packet-sip.c')
-rw-r--r--epan/dissectors/packet-sip.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/epan/dissectors/packet-sip.c b/epan/dissectors/packet-sip.c
index 8b647f9601..24c573cdff 100644
--- a/epan/dissectors/packet-sip.c
+++ b/epan/dissectors/packet-sip.c
@@ -675,6 +675,9 @@ static guint sip_tls_port = TLS_PORT_SIP;
/* global_sip_raw_text determines whether we are going to display */
/* the raw text of the SIP message, much like the MEGACO dissector does. */
static gboolean global_sip_raw_text = FALSE;
+/* global_sip_raw_text_without_crlf determines whether we are going to display */
+/* the raw text of the SIP message with or without the '\r\n'. */
+static gboolean global_sip_raw_text_without_crlf = FALSE;
/* strict_sip_version determines whether the SIP dissector enforces
* the SIP version to be "SIP/2.0". */
static gboolean strict_sip_version = TRUE;
@@ -3080,7 +3083,10 @@ tvb_raw_text_add(tvbuff_t *tvb, int offset, int length, proto_tree *tree)
tvb_find_line_end(tvb, offset, -1, &next_offset, FALSE);
linelen = next_offset - offset;
if (raw_tree) {
- str = tvb_format_text(tvb, offset, linelen);
+ if (global_sip_raw_text_without_crlf)
+ str = tvb_format_text_wsp(tvb, offset, linelen);
+ else
+ str = tvb_format_text(tvb, offset, linelen);
proto_tree_add_string_format(raw_tree, hf_raw_sip_line, tvb, offset, linelen,
str,
"%s",
@@ -4520,6 +4526,12 @@ void proto_register_sip(void)
"SIP message should be displayed "
"in addition to the dissection tree",
&global_sip_raw_text);
+ prefs_register_bool_preference(sip_module, "display_raw_text_without_crlf",
+ "Don't show '\\r\\n' in raw SIP messages",
+ "If the raw text of the SIP message "
+ "is displayed, the trailing carriage "
+ "return and line feed are not shown",
+ &global_sip_raw_text_without_crlf);
prefs_register_bool_preference(sip_module, "strict_sip_version",
"Enforce strict SIP version check (" SIP2_HDR ")",
"If enabled, only " SIP2_HDR " traffic will be dissected as SIP. "