aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-sip.c
diff options
context:
space:
mode:
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>2010-05-05 17:22:40 +0000
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>2010-05-05 17:22:40 +0000
commit19cb8aaf4614efac6e623a2f9b760b2e59370cdd (patch)
treea6f2c1df6ac94d8fc5652fc27f118a8c0236408b /epan/dissectors/packet-sip.c
parent78ecc42c47bd38183d9715b0fe26b32c6d2a9f36 (diff)
- Remove check_col()
- only read method string once. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32677 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-sip.c')
-rw-r--r--epan/dissectors/packet-sip.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/epan/dissectors/packet-sip.c b/epan/dissectors/packet-sip.c
index 2123b143af..281c3eb9c3 100644
--- a/epan/dissectors/packet-sip.c
+++ b/epan/dissectors/packet-sip.c
@@ -4,8 +4,6 @@
*
* TODO:
* hf_ display filters for headers of SIP extension RFCs (ongoing)
- * Use hash table for list of headers
- * Align SIP methods with recent Internet Drafts or RFCs
*
* Copyright 2000, Heikki Vatiainen <hessu@cs.tut.fi>
* Copyright 2001, Jean-Francois Mule <jfm@cablelabs.com>
@@ -1422,6 +1420,7 @@ static void dissect_sip_via_header(tvbuff_t *tvb, proto_tree *tree, gint start_o
gboolean ipv6_address;
guchar c;
gchar *param_name = NULL;
+ return;
current_offset = start_offset;
@@ -2728,28 +2727,25 @@ dissect_sip_common(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tr
/* Add to info column interesting things learned from header fields. */
- if (check_col(pinfo->cinfo, COL_INFO))
+ /* Registration requests */
+ if (current_method_idx == SIP_METHOD_REGISTER)
{
- /* Registration requests */
- if (current_method_idx == SIP_METHOD_REGISTER)
+ if (contact_is_star && expires_is_0)
{
- if (contact_is_star && expires_is_0)
- {
- col_append_str(pinfo->cinfo, COL_INFO, " (remove all bindings)");
- }
- else
- if (!contacts)
- {
- col_append_str(pinfo->cinfo, COL_INFO, " (fetch bindings)");
- }
+ col_append_str(pinfo->cinfo, COL_INFO, " (remove all bindings)");
}
-
- /* Registration responses */
- if (line_type == STATUS_LINE && (strcmp(cseq_method, "REGISTER") == 0))
+ else
+ if (!contacts)
{
- col_append_fstr(pinfo->cinfo, COL_INFO, " (%d bindings)", contacts);
+ col_append_str(pinfo->cinfo, COL_INFO, " (fetch bindings)");
}
}
+
+ /* Registration responses */
+ if (line_type == STATUS_LINE && (strcmp(cseq_method, "REGISTER") == 0))
+ {
+ col_append_fstr(pinfo->cinfo, COL_INFO, " (%d bindings)", contacts);
+ }
/* Find the total setup time, Must be done before checking for resend
* As that will overwrite the "Request packet no".
*/
@@ -3020,10 +3016,13 @@ static gboolean sip_is_known_request(tvbuff_t *tvb, int meth_offset,
guint meth_len, guint *meth_idx)
{
guint i;
+ gchar *meth_name;
+
+ meth_name = tvb_get_ephemeral_string(tvb, meth_offset, meth_len);
for (i = 1; i < array_length(sip_methods); i++) {
if (meth_len == strlen(sip_methods[i]) &&
- tvb_strneql(tvb, meth_offset, sip_methods[i], meth_len) == 0)
+ strncmp(meth_name, sip_methods[i], meth_len) == 0)
{
*meth_idx = i;
return TRUE;