diff options
Diffstat (limited to 'epan/dissectors/packet-mgcp.c')
-rw-r--r-- | epan/dissectors/packet-mgcp.c | 373 |
1 files changed, 192 insertions, 181 deletions
diff --git a/epan/dissectors/packet-mgcp.c b/epan/dissectors/packet-mgcp.c index f25e8e9bcc..59c1e1d25f 100644 --- a/epan/dissectors/packet-mgcp.c +++ b/epan/dissectors/packet-mgcp.c @@ -30,9 +30,12 @@ #include <epan/prefs.h> #include <epan/conversation.h> #include <epan/tap.h> +#include <epan/strutil.h> #include <epan/rtd_table.h> #include <epan/expert.h> +#include "packet-media-type.h" #include "packet-mgcp.h" +#include "packet-sdp.h" #include <wsutil/strtoi.h> @@ -43,123 +46,124 @@ /* Define the mgcp proto */ -static int proto_mgcp = -1; +static int proto_mgcp; /* Define many many headers for mgcp */ -static int hf_mgcp_req = -1; -static int hf_mgcp_req_verb = -1; -static int hf_mgcp_req_endpoint = -1; -static int hf_mgcp_req_frame = -1; -static int hf_mgcp_rsp = -1; -static int hf_mgcp_rsp_frame = -1; -static int hf_mgcp_time = -1; -static int hf_mgcp_transid = -1; -static int hf_mgcp_version = -1; -static int hf_mgcp_rsp_rspcode = -1; -static int hf_mgcp_rsp_rspstring = -1; -static int hf_mgcp_params = -1; -static int hf_mgcp_param_rspack = -1; -static int hf_mgcp_param_bearerinfo = -1; -static int hf_mgcp_param_callid = -1; -static int hf_mgcp_param_connectionid = -1; -static int hf_mgcp_param_secondconnectionid = -1; -static int hf_mgcp_param_notifiedentity = -1; -static int hf_mgcp_param_requestid = -1; -static int hf_mgcp_param_localconnoptions = -1; -static int hf_mgcp_param_localconnoptions_p = -1; -static int hf_mgcp_param_localconnoptions_a = -1; -static int hf_mgcp_param_localconnoptions_s = -1; -static int hf_mgcp_param_localconnoptions_e = -1; -static int hf_mgcp_param_localconnoptions_scrtp = -1; -static int hf_mgcp_param_localconnoptions_scrtcp = -1; -static int hf_mgcp_param_localconnoptions_b = -1; -static int hf_mgcp_param_localconnoptions_esccd = -1; -static int hf_mgcp_param_localconnoptions_escci = -1; -static int hf_mgcp_param_localconnoptions_dqgi = -1; -static int hf_mgcp_param_localconnoptions_dqrd = -1; -static int hf_mgcp_param_localconnoptions_dqri = -1; -static int hf_mgcp_param_localconnoptions_dqrr = -1; -static int hf_mgcp_param_localconnoptions_k = -1; -static int hf_mgcp_param_localconnoptions_gc = -1; -static int hf_mgcp_param_localconnoptions_fmtp = -1; -static int hf_mgcp_param_localconnoptions_nt = -1; -static int hf_mgcp_param_localconnoptions_ofmtp = -1; -static int hf_mgcp_param_localconnoptions_r = -1; -static int hf_mgcp_param_localconnoptions_t = -1; -static int hf_mgcp_param_localconnoptions_rcnf = -1; -static int hf_mgcp_param_localconnoptions_rdir = -1; -static int hf_mgcp_param_localconnoptions_rsh = -1; -static int hf_mgcp_param_localconnoptions_mp = -1; -static int hf_mgcp_param_localconnoptions_fxr = -1; -static int hf_mgcp_param_localvoicemetrics = -1; -static int hf_mgcp_param_remotevoicemetrics = -1; -static int hf_mgcp_param_voicemetrics_nlr = -1; -static int hf_mgcp_param_voicemetrics_jdr = -1; -static int hf_mgcp_param_voicemetrics_bld = -1; -static int hf_mgcp_param_voicemetrics_gld = -1; -static int hf_mgcp_param_voicemetrics_bd = -1; -static int hf_mgcp_param_voicemetrics_gd = -1; -static int hf_mgcp_param_voicemetrics_rtd = -1; -static int hf_mgcp_param_voicemetrics_esd = -1; -static int hf_mgcp_param_voicemetrics_sl = -1; -static int hf_mgcp_param_voicemetrics_nl = -1; -static int hf_mgcp_param_voicemetrics_rerl = -1; -static int hf_mgcp_param_voicemetrics_gmn = -1; -static int hf_mgcp_param_voicemetrics_nsr = -1; -static int hf_mgcp_param_voicemetrics_xsr = -1; -static int hf_mgcp_param_voicemetrics_mlq = -1; -static int hf_mgcp_param_voicemetrics_mcq = -1; -static int hf_mgcp_param_voicemetrics_plc = -1; -static int hf_mgcp_param_voicemetrics_jba = -1; -static int hf_mgcp_param_voicemetrics_jbr = -1; -static int hf_mgcp_param_voicemetrics_jbn = -1; -static int hf_mgcp_param_voicemetrics_jbm = -1; -static int hf_mgcp_param_voicemetrics_jbs = -1; -static int hf_mgcp_param_voicemetrics_iaj = -1; -static int hf_mgcp_param_connectionmode = -1; -static int hf_mgcp_param_reqevents = -1; -static int hf_mgcp_param_restartmethod = -1; -static int hf_mgcp_param_restartdelay = -1; -static int hf_mgcp_param_signalreq = -1; -static int hf_mgcp_param_digitmap = -1; -static int hf_mgcp_param_observedevent = -1; -static int hf_mgcp_param_connectionparam = -1; -static int hf_mgcp_param_connectionparam_ps = -1; -static int hf_mgcp_param_connectionparam_os = -1; -static int hf_mgcp_param_connectionparam_pr = -1; -static int hf_mgcp_param_connectionparam_or = -1; -static int hf_mgcp_param_connectionparam_pl = -1; -static int hf_mgcp_param_connectionparam_ji = -1; -static int hf_mgcp_param_connectionparam_la = -1; -static int hf_mgcp_param_connectionparam_pcrps = -1; -static int hf_mgcp_param_connectionparam_pcros = -1; -static int hf_mgcp_param_connectionparam_pcrpl = -1; -static int hf_mgcp_param_connectionparam_pcrji = -1; -static int hf_mgcp_param_connectionparam_x = -1; -static int hf_mgcp_param_reasoncode = -1; -static int hf_mgcp_param_eventstates = -1; -static int hf_mgcp_param_specificendpoint = -1; -static int hf_mgcp_param_secondendpointid = -1; -static int hf_mgcp_param_reqinfo = -1; -static int hf_mgcp_param_quarantinehandling = -1; -static int hf_mgcp_param_detectedevents = -1; -static int hf_mgcp_param_capabilities = -1; -static int hf_mgcp_param_maxmgcpdatagram = -1; -static int hf_mgcp_param_packagelist = -1; -static int hf_mgcp_param_extension = -1; -static int hf_mgcp_param_extension_critical = -1; -static int hf_mgcp_param_resourceid = -1; -static int hf_mgcp_param_invalid = -1; -static int hf_mgcp_messagecount = -1; -static int hf_mgcp_dup = -1; -static int hf_mgcp_req_dup = -1; -static int hf_mgcp_req_dup_frame = -1; -static int hf_mgcp_rsp_dup = -1; -static int hf_mgcp_rsp_dup_frame = -1; -static int hf_mgcp_unknown_parameter = -1; -static int hf_mgcp_malformed_parameter = -1; - -static expert_field ei_mgcp_rsp_rspcode_invalid = EI_INIT; +static int hf_mgcp_req; +static int hf_mgcp_req_verb; +static int hf_mgcp_req_endpoint; +static int hf_mgcp_req_frame; +static int hf_mgcp_rsp; +static int hf_mgcp_rsp_frame; +static int hf_mgcp_time; +static int hf_mgcp_transid; +static int hf_mgcp_version; +static int hf_mgcp_rsp_rspcode; +static int hf_mgcp_rsp_rspstring; +static int hf_mgcp_params; +static int hf_mgcp_param_rspack; +static int hf_mgcp_param_bearerinfo; +static int hf_mgcp_param_callid; +static int hf_mgcp_param_connectionid; +static int hf_mgcp_param_secondconnectionid; +static int hf_mgcp_param_notifiedentity; +static int hf_mgcp_param_requestid; +static int hf_mgcp_param_localconnoptions; +static int hf_mgcp_param_localconnoptions_p; +static int hf_mgcp_param_localconnoptions_a; +static int hf_mgcp_param_localconnoptions_s; +static int hf_mgcp_param_localconnoptions_e; +static int hf_mgcp_param_localconnoptions_scrtp; +static int hf_mgcp_param_localconnoptions_scrtcp; +static int hf_mgcp_param_localconnoptions_b; +static int hf_mgcp_param_localconnoptions_esccd; +static int hf_mgcp_param_localconnoptions_escci; +static int hf_mgcp_param_localconnoptions_dqgi; +static int hf_mgcp_param_localconnoptions_dqrd; +static int hf_mgcp_param_localconnoptions_dqri; +static int hf_mgcp_param_localconnoptions_dqrr; +static int hf_mgcp_param_localconnoptions_k; +static int hf_mgcp_param_localconnoptions_gc; +static int hf_mgcp_param_localconnoptions_fmtp; +static int hf_mgcp_param_localconnoptions_nt; +static int hf_mgcp_param_localconnoptions_ofmtp; +static int hf_mgcp_param_localconnoptions_r; +static int hf_mgcp_param_localconnoptions_t; +static int hf_mgcp_param_localconnoptions_rcnf; +static int hf_mgcp_param_localconnoptions_rdir; +static int hf_mgcp_param_localconnoptions_rsh; +static int hf_mgcp_param_localconnoptions_mp; +static int hf_mgcp_param_localconnoptions_fxr; +static int hf_mgcp_param_localvoicemetrics; +static int hf_mgcp_param_remotevoicemetrics; +static int hf_mgcp_param_voicemetrics_nlr; +static int hf_mgcp_param_voicemetrics_jdr; +static int hf_mgcp_param_voicemetrics_bld; +static int hf_mgcp_param_voicemetrics_gld; +static int hf_mgcp_param_voicemetrics_bd; +static int hf_mgcp_param_voicemetrics_gd; +static int hf_mgcp_param_voicemetrics_rtd; +static int hf_mgcp_param_voicemetrics_esd; +static int hf_mgcp_param_voicemetrics_sl; +static int hf_mgcp_param_voicemetrics_nl; +static int hf_mgcp_param_voicemetrics_rerl; +static int hf_mgcp_param_voicemetrics_gmn; +static int hf_mgcp_param_voicemetrics_nsr; +static int hf_mgcp_param_voicemetrics_xsr; +static int hf_mgcp_param_voicemetrics_mlq; +static int hf_mgcp_param_voicemetrics_mcq; +static int hf_mgcp_param_voicemetrics_plc; +static int hf_mgcp_param_voicemetrics_jba; +static int hf_mgcp_param_voicemetrics_jbr; +static int hf_mgcp_param_voicemetrics_jbn; +static int hf_mgcp_param_voicemetrics_jbm; +static int hf_mgcp_param_voicemetrics_jbs; +static int hf_mgcp_param_voicemetrics_iaj; +static int hf_mgcp_param_connectionmode; +static int hf_mgcp_param_reqevents; +static int hf_mgcp_param_restartmethod; +static int hf_mgcp_param_restartdelay; +static int hf_mgcp_param_signalreq; +static int hf_mgcp_param_digitmap; +static int hf_mgcp_param_observedevent; +static int hf_mgcp_param_connectionparam; +static int hf_mgcp_param_connectionparam_ps; +static int hf_mgcp_param_connectionparam_os; +static int hf_mgcp_param_connectionparam_pr; +static int hf_mgcp_param_connectionparam_or; +static int hf_mgcp_param_connectionparam_pl; +static int hf_mgcp_param_connectionparam_ji; +static int hf_mgcp_param_connectionparam_la; +static int hf_mgcp_param_connectionparam_pcrps; +static int hf_mgcp_param_connectionparam_pcros; +static int hf_mgcp_param_connectionparam_pcrpl; +static int hf_mgcp_param_connectionparam_pcrji; +static int hf_mgcp_param_connectionparam_x; +static int hf_mgcp_param_reasoncode; +static int hf_mgcp_param_eventstates; +static int hf_mgcp_param_specificendpoint; +static int hf_mgcp_param_secondendpointid; +static int hf_mgcp_param_reqinfo; +static int hf_mgcp_param_quarantinehandling; +static int hf_mgcp_param_detectedevents; +static int hf_mgcp_param_capabilities; +static int hf_mgcp_param_maxmgcpdatagram; +static int hf_mgcp_param_packagelist; +static int hf_mgcp_param_extension; +static int hf_mgcp_param_extension_critical; +static int hf_mgcp_param_resourceid; +static int hf_mgcp_param_invalid; +static int hf_mgcp_messagecount; +static int hf_mgcp_dup; +static int hf_mgcp_req_dup; +static int hf_mgcp_req_dup_frame; +static int hf_mgcp_rsp_dup; +static int hf_mgcp_rsp_dup_frame; +static int hf_mgcp_param_x_osmux; +static int hf_mgcp_unknown_parameter; +static int hf_mgcp_malformed_parameter; + +static expert_field ei_mgcp_rsp_rspcode_invalid; static const value_string mgcp_return_code_vals[] = { {000, "Response Acknowledgement"}, @@ -243,17 +247,17 @@ static const value_string mgcp_reason_code_vals[] = { * We need one for MGCP itself, one for the MGCP paramters and one * for each of the dissected parameters */ -static int ett_mgcp = -1; -static int ett_mgcp_param = -1; -static int ett_mgcp_param_connectionparam = -1; -static int ett_mgcp_param_localconnectionoptions = -1; -static int ett_mgcp_param_localvoicemetrics = -1; -static int ett_mgcp_param_remotevoicemetrics = -1; +static int ett_mgcp; +static int ett_mgcp_param; +static int ett_mgcp_param_connectionparam; +static int ett_mgcp_param_localconnectionoptions; +static int ett_mgcp_param_localvoicemetrics; +static int ett_mgcp_param_remotevoicemetrics; /* * Define the tap for mgcp */ -static int mgcp_tap = -1; +static int mgcp_tap; /* * Here are the global variables associated with @@ -322,7 +326,7 @@ static const value_string mgcp_message_type[] = { }; static tap_packet_status -mgcpstat_packet(void *pms, packet_info *pinfo, epan_dissect_t *edt _U_, const void *pmi) +mgcpstat_packet(void *pms, packet_info *pinfo, epan_dissect_t *edt _U_, const void *pmi, tap_flags_t flags _U_) { rtd_data_t* rtd_data = (rtd_data_t*)pms; rtd_stat_table* ms = &rtd_data->stat_table; @@ -577,7 +581,9 @@ static void dissect_mgcp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree * gint tvb_sectionend, tvb_sectionbegin, tvb_len; tvbuff_t *next_tvb; const gchar *verb_name = ""; - mgcp_info_t* mi = wmem_new0(pinfo->pool, mgcp_info_t); + mgcp_info_t* mi = wmem_new0(pinfo->pool, mgcp_info_t); + sdp_setup_info_t setup_info = { .hf_id = 0, .hf_type = SDP_TRACE_ID_HF_TYPE_GUINT32 }; + media_content_info_t content_info = { MEDIA_CONTAINER_SIP_DATA, NULL, NULL, &setup_info }; mi->mgcp_type = MGCP_OTHERS; @@ -631,8 +637,9 @@ static void dissect_mgcp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree * /* Dissect sdp payload */ if (tvb_sectionend < tvb_len) { + setup_info.is_osmux = mi->is_osmux; next_tvb = tvb_new_subset_remaining(tvb, tvb_sectionend); - call_dissector(sdp_handle, next_tvb, pinfo, tree); + call_dissector_with_data(sdp_handle, next_tvb, pinfo, tree, &content_info); } } } @@ -779,7 +786,7 @@ static gboolean is_mgcp_rspcode(tvbuff_t *tvb, gint offset, gint maxlength) */ static gint tvb_parse_param(tvbuff_t* tvb, gint offset, gint len, int** hf, mgcp_info_t* mi) { - gint returnvalue = -1, tvb_current_offset, counter; + gint returnvalue = -1, tvb_current_offset, ext_off; guint8 tempchar, plus_minus; gchar **buf; @@ -881,25 +888,33 @@ static gint tvb_parse_param(tvbuff_t* tvb, gint offset, gint len, int** hf, mgcp tvb_current_offset++; /* Keep going, through possible vendor param name */ - for (counter = 1; - ((len > (counter + tvb_current_offset-offset)) && - (g_ascii_isalpha(tempchar = tvb_get_guint8(tvb, tvb_current_offset+counter)) || - g_ascii_isdigit(tempchar))) ; - counter++); + /* We have a mempbrk; perhaps an equivalent of strspn + * for tvbs would be useful. + */ + for (ext_off = 0; len > (ext_off + tvb_current_offset-offset); ext_off++) { + tempchar = tvb_get_guint8(tvb, tvb_current_offset + ext_off); + if (!g_ascii_isalpha(tempchar) && !g_ascii_isdigit(tempchar)) break; + } if (tempchar == ':') { /* Looks like a valid vendor param name */ - tvb_current_offset += counter; + //fprintf(stderr, "MGCP Extension: %s\n", tvb_get_string_enc(wmem_packet_scope(), tvb, tvb_current_offset, ext_off, ENC_ASCII)); switch (plus_minus) { case '+': *hf = &hf_mgcp_param_extension_critical; break; case '-': - *hf = &hf_mgcp_param_extension; + if (tvb_strncaseeql(tvb, tvb_current_offset, "OSMUX", ext_off) == 0) { + *hf = &hf_mgcp_param_x_osmux; + } else { + *hf = &hf_mgcp_param_extension; + } break; } + /* -1: Final generic path below expects us to point to char before the ':'. */ + tvb_current_offset += ext_off - 1; } } break; @@ -1172,7 +1187,7 @@ static void dissect_mgcp_firstline(tvbuff_t *tvb, packet_info *pinfo, proto_tree if (verb_description != NULL) { /* Can show verb along with code if known */ - g_snprintf(code_with_verb, 64, "%s (%s)", code, verb_description); + snprintf(code_with_verb, 64, "%s (%s)", code, verb_description); } proto_tree_add_string_format(tree, hf_mgcp_req_verb, tvb, @@ -1292,7 +1307,7 @@ static void dissect_mgcp_firstline(tvbuff_t *tvb, packet_info *pinfo, proto_tree * if you do that. */ conversation = find_conversation(pinfo->num, &null_address, - &pinfo->dst, conversation_pt_to_endpoint_type(pinfo->ptype), pinfo->srcport, + &pinfo->dst, conversation_pt_to_conversation_type(pinfo->ptype), pinfo->srcport, pinfo->destport, 0); } if (conversation != NULL) @@ -1393,7 +1408,7 @@ static void dissect_mgcp_firstline(tvbuff_t *tvb, packet_info *pinfo, proto_tree * if you do that. */ conversation = find_conversation(pinfo->num, &pinfo->src, - &null_address, conversation_pt_to_endpoint_type(pinfo->ptype), pinfo->srcport, + &null_address, conversation_pt_to_conversation_type(pinfo->ptype), pinfo->srcport, pinfo->destport, 0); } if (conversation == NULL) @@ -1402,13 +1417,13 @@ static void dissect_mgcp_firstline(tvbuff_t *tvb, packet_info *pinfo, proto_tree if (pinfo->ptype == PT_TCP) { conversation = conversation_new(pinfo->num, &pinfo->src, - &pinfo->dst, ENDPOINT_TCP, pinfo->srcport, + &pinfo->dst, CONVERSATION_TCP, pinfo->srcport, pinfo->destport, 0); } else { conversation = conversation_new(pinfo->num, &pinfo->src, - &null_address, conversation_pt_to_endpoint_type(pinfo->ptype), pinfo->srcport, + &null_address, conversation_pt_to_conversation_type(pinfo->ptype), pinfo->srcport, pinfo->destport, 0); } } @@ -1526,40 +1541,33 @@ static void dissect_mgcp_params(tvbuff_t *tvb, proto_tree *tree, mgcp_info_t* mi if (my_param) { - if (*my_param == hf_mgcp_param_connectionparam) - { - tokenlen = tvb_find_line_end(tvb, tvb_tokenbegin, -1, &tvb_lineend, FALSE); + tokenlen = tvb_find_line_end(tvb, tvb_tokenbegin, -1, &tvb_lineend, FALSE); + if (*my_param == hf_mgcp_param_connectionparam) { dissect_mgcp_connectionparams(mgcp_param_tree, tvb, tvb_linebegin, - tvb_tokenbegin - tvb_linebegin, tokenlen); - } - else - if (*my_param == hf_mgcp_param_localconnoptions) - { - tokenlen = tvb_find_line_end(tvb, tvb_tokenbegin, -1, &tvb_lineend, FALSE); - dissect_mgcp_localconnectionoptions(mgcp_param_tree, tvb, tvb_linebegin, - tvb_tokenbegin - tvb_linebegin, tokenlen); - } - else - if (*my_param == hf_mgcp_param_localvoicemetrics) - { - tokenlen = tvb_find_line_end(tvb,tvb_tokenbegin,-1,&tvb_lineend,FALSE); - dissect_mgcp_localvoicemetrics(mgcp_param_tree, tvb, tvb_linebegin, - tvb_tokenbegin - tvb_linebegin, tokenlen); - } - else - if (*my_param == hf_mgcp_param_remotevoicemetrics) - { - tokenlen = tvb_find_line_end(tvb,tvb_tokenbegin,-1,&tvb_lineend,FALSE); - dissect_mgcp_remotevoicemetrics(mgcp_param_tree, tvb, tvb_linebegin, - tvb_tokenbegin - tvb_linebegin, tokenlen); - } - else - { - tokenlen = tvb_find_line_end(tvb, tvb_tokenbegin, -1, &tvb_lineend, FALSE); + tvb_tokenbegin - tvb_linebegin, tokenlen); + } else if (*my_param == hf_mgcp_param_localconnoptions) { + dissect_mgcp_localconnectionoptions(mgcp_param_tree, tvb, tvb_linebegin, + tvb_tokenbegin - tvb_linebegin, tokenlen); + } else if (*my_param == hf_mgcp_param_localvoicemetrics) { + dissect_mgcp_localvoicemetrics(mgcp_param_tree, tvb, tvb_linebegin, + tvb_tokenbegin - tvb_linebegin, tokenlen); + } else if (*my_param == hf_mgcp_param_remotevoicemetrics) { + dissect_mgcp_remotevoicemetrics(mgcp_param_tree, tvb, tvb_linebegin, + tvb_tokenbegin - tvb_linebegin, tokenlen); + } else if (*my_param == hf_mgcp_param_x_osmux) { proto_tree_add_string(mgcp_param_tree, *my_param, tvb, - tvb_linebegin, linelen, - tvb_format_text(wmem_packet_scope(), tvb, tvb_tokenbegin, tokenlen)); - } + tvb_linebegin, linelen, + tvb_format_text(wmem_packet_scope(), + tvb, tvb_tokenbegin, tokenlen)); + /* Mark that Osmux is used, so that packet-sdp.c doesn't call + * srtp_add_address() and decodes it as RTP. */ + mi->is_osmux = TRUE; + } else { + proto_tree_add_string(mgcp_param_tree, *my_param, tvb, + tvb_linebegin, linelen, + tvb_format_text(wmem_packet_scope(), + tvb, tvb_tokenbegin, tokenlen)); + } } tvb_linebegin = tvb_lineend; @@ -1583,7 +1591,7 @@ dissect_mgcp_connectionparams(proto_tree *parent_tree, tvbuff_t *tvb, gint offse gchar **tokens; guint i; - item = proto_tree_add_item(parent_tree, hf_mgcp_param_connectionparam, tvb, offset, param_type_len+param_val_len, ENC_ASCII|ENC_NA); + item = proto_tree_add_item(parent_tree, hf_mgcp_param_connectionparam, tvb, offset, param_type_len+param_val_len, ENC_ASCII); tree = proto_item_add_subtree(item, ett_mgcp_param_connectionparam); /* The P: line */ @@ -1657,11 +1665,11 @@ dissect_mgcp_connectionparams(proto_tree *parent_tree, tvbuff_t *tvb, gint offse hf_string = -1; } - if (hf_uint != -1) + if (hf_uint > 0) { proto_tree_add_uint(tree, hf_uint, tvb, offset, tokenlen, (guint32)strtoul(typval[1], NULL, 10)); } - else if (hf_string != -1) + else if (hf_string > 0) { proto_tree_add_string(tree, hf_string, tvb, offset, tokenlen, g_strstrip(typval[1])); } @@ -1690,7 +1698,7 @@ dissect_mgcp_localconnectionoptions(proto_tree *parent_tree, tvbuff_t *tvb, gint gchar **tokens; guint i; - item = proto_tree_add_item(parent_tree, hf_mgcp_param_localconnoptions, tvb, offset, param_type_len+param_val_len, ENC_ASCII|ENC_NA); + item = proto_tree_add_item(parent_tree, hf_mgcp_param_localconnoptions, tvb, offset, param_type_len+param_val_len, ENC_ASCII); tree = proto_item_add_subtree(item, ett_mgcp_param_localconnectionoptions); /* The L: line */ @@ -1820,11 +1828,11 @@ dissect_mgcp_localconnectionoptions(proto_tree *parent_tree, tvbuff_t *tvb, gint } /* Add item */ - if (hf_uint != -1) + if (hf_uint > 0) { proto_tree_add_uint(tree, hf_uint, tvb, offset, tokenlen, (guint32)strtoul(typval[1], NULL, 10)); } - else if (hf_string != -1) + else if (hf_string > 0) { proto_tree_add_string(tree, hf_string, tvb, offset, tokenlen, g_strstrip(typval[1])); } @@ -1852,7 +1860,7 @@ dissect_mgcp_localvoicemetrics(proto_tree *parent_tree, tvbuff_t *tvb, gint offs if (parent_tree) { - item = proto_tree_add_item(parent_tree, hf_mgcp_param_localvoicemetrics, tvb, offset, param_type_len+param_val_len, ENC_ASCII|ENC_NA); + item = proto_tree_add_item(parent_tree, hf_mgcp_param_localvoicemetrics, tvb, offset, param_type_len+param_val_len, ENC_ASCII); tree = proto_item_add_subtree(item, ett_mgcp_param_localvoicemetrics); } @@ -1969,7 +1977,7 @@ dissect_mgcp_localvoicemetrics(proto_tree *parent_tree, tvbuff_t *tvb, gint offs /* Add item */ if (tree) { - if (hf_string != -1) + if (hf_string > 0) { proto_tree_add_string(tree, hf_string, tvb, offset, tokenlen, g_strstrip(typval[1])); } @@ -2003,7 +2011,7 @@ dissect_mgcp_remotevoicemetrics(proto_tree *parent_tree, tvbuff_t *tvb, gint off if (parent_tree) { - item = proto_tree_add_item(parent_tree, hf_mgcp_param_remotevoicemetrics, tvb, offset, param_type_len+param_val_len, ENC_ASCII|ENC_NA); + item = proto_tree_add_item(parent_tree, hf_mgcp_param_remotevoicemetrics, tvb, offset, param_type_len+param_val_len, ENC_ASCII); tree = proto_item_add_subtree(item, ett_mgcp_param_remotevoicemetrics); } @@ -2119,7 +2127,7 @@ dissect_mgcp_remotevoicemetrics(proto_tree *parent_tree, tvbuff_t *tvb, gint off /* Add item */ if (tree) { - if (hf_string != -1) + if (hf_string > 0) { proto_tree_add_string(tree, hf_string, tvb, offset, tokenlen, g_strstrip(typval[1])); } @@ -2259,7 +2267,7 @@ static gint tvb_find_dot_line(tvbuff_t* tvb, gint offset, gint len, gint* next_o /* Are the characters that follow the dot a newline or carriage return ? */ if (tempchar == '\r' || tempchar == '\n') { - /* Do we have any charaters that proceed the . ? */ + /* Do we have any characters that proceed the . ? */ if (tvb_current_offset == 0) { break; @@ -2663,6 +2671,9 @@ void proto_register_mgcp(void) { &hf_mgcp_rsp_dup_frame, { "Original Response Frame", "mgcp.rsp.dup.frame", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "Frame containing original response", HFILL }}, + { &hf_mgcp_param_x_osmux, + { "X-Osmux", "mgcp.param.x_osmux", FT_STRING, BASE_NONE, NULL, 0x0, + "Osmux CID", HFILL }}, { &hf_mgcp_unknown_parameter, { "Unknown parameter", "mgcp.unknown_parameter", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, |