From 19cb8aaf4614efac6e623a2f9b760b2e59370cdd Mon Sep 17 00:00:00 2001 From: etxrab Date: Wed, 5 May 2010 17:22:40 +0000 Subject: - Remove check_col() - only read method string once. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32677 f5534014-38df-0310-8fa8-9805f1628bb7 --- epan/dissectors/packet-sip.c | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) (limited to 'epan/dissectors/packet-sip.c') 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 * Copyright 2001, Jean-Francois Mule @@ -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; -- cgit v1.2.3