MEGACO: fix dissection of Remote Descriptor

Display the right field name.

Bug: 15430
Change-Id: I1d7da96a351bfad275142a36975df294bfec1a50
Reviewed-on: https://code.wireshark.org/review/31608
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
This commit is contained in:
Pascal Quantin 2019-01-19 14:26:54 +01:00
parent cc3ac2a568
commit d89d98b66d
1 changed files with 16 additions and 12 deletions

View File

@ -88,7 +88,7 @@ static int hf_megaco_error_descriptor = -1;
static int hf_megaco_error_code = -1;
static int hf_megaco_error_string = -1;
static int hf_megaco_TerminationState_descriptor= -1;
/* static int hf_megaco_Remote_descriptor = -1; */
static int hf_megaco_Remote_descriptor = -1;
static int hf_megaco_LocalControl_descriptor = -1;
static int hf_megaco_packages_descriptor = -1;
static int hf_megaco_Service_State = -1;
@ -449,7 +449,7 @@ dissect_megaco_errordescriptor(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tr
static void
dissect_megaco_TerminationStatedescriptor(tvbuff_t *tvb, proto_tree *tree, gint tvb_next_offset, gint tvb_current_offset);
static void
dissect_megaco_Localdescriptor(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gint tvb_next_offset, gint tvb_current_offset, guint32 context);
dissect_megaco_LocalRemotedescriptor(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gint tvb_next_offset, gint tvb_current_offset, guint32 context, gboolean is_local);
static void
dissect_megaco_LocalControldescriptor(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gint tvb_next_offset, gint tvb_current_offset, proto_tree *top_tree);
static void
@ -1772,14 +1772,14 @@ dissect_megaco_mediadescriptor(tvbuff_t *tvb, proto_tree *megaco_tree_command_li
switch ( mediaParm ){
case MEGACO_LOCAL_TOKEN:
tvb_current_offset = megaco_tvb_skip_wsp(tvb, tvb_LBRKT+1);
dissect_megaco_Localdescriptor(tvb, megaco_mediadescriptor_tree, pinfo,
tvb_RBRKT, tvb_current_offset, context);
dissect_megaco_LocalRemotedescriptor(tvb, megaco_mediadescriptor_tree, pinfo,
tvb_RBRKT, tvb_current_offset, context, TRUE);
tvb_current_offset = tvb_RBRKT;
break;
case MEGACO_REMOTE_TOKEN:
tvb_current_offset = megaco_tvb_skip_wsp(tvb, tvb_LBRKT+1);
dissect_megaco_Localdescriptor(tvb, megaco_mediadescriptor_tree, pinfo,
tvb_RBRKT, tvb_current_offset, context);
dissect_megaco_LocalRemotedescriptor(tvb, megaco_mediadescriptor_tree, pinfo,
tvb_RBRKT, tvb_current_offset, context, FALSE);
tvb_current_offset = tvb_RBRKT;
break;
case MEGACO_LOCAL_CONTROL_TOKEN:
@ -3017,7 +3017,8 @@ dissect_megaco_TerminationStatedescriptor(tvbuff_t *tvb, proto_tree *megaco_medi
}
static void
dissect_megaco_Localdescriptor(tvbuff_t *tvb, proto_tree *megaco_mediadescriptor_tree,packet_info *pinfo, gint tvb_next_offset, gint tvb_current_offset, guint32 context)
dissect_megaco_LocalRemotedescriptor(tvbuff_t *tvb, proto_tree *megaco_mediadescriptor_tree, packet_info *pinfo,
gint tvb_next_offset, gint tvb_current_offset, guint32 context, gboolean is_local)
{
gint tokenlen;
tvbuff_t *next_tvb;
@ -3039,8 +3040,13 @@ dissect_megaco_Localdescriptor(tvbuff_t *tvb, proto_tree *megaco_mediadescriptor
tokenlen = tvb_next_offset - tvb_current_offset;
megaco_localdescriptor_item = proto_tree_add_item(megaco_mediadescriptor_tree, hf_megaco_Local_descriptor, tvb, tvb_current_offset, tokenlen, ENC_NA);
megaco_localdescriptor_tree = proto_item_add_subtree(megaco_localdescriptor_item, ett_megaco_Localdescriptor);
if (is_local) {
megaco_localdescriptor_item = proto_tree_add_item(megaco_mediadescriptor_tree, hf_megaco_Local_descriptor, tvb, tvb_current_offset, tokenlen, ENC_NA);
megaco_localdescriptor_tree = proto_item_add_subtree(megaco_localdescriptor_item, ett_megaco_Localdescriptor);
} else {
megaco_localdescriptor_item = proto_tree_add_item(megaco_mediadescriptor_tree, hf_megaco_Remote_descriptor, tvb, tvb_current_offset, tokenlen, ENC_NA);
megaco_localdescriptor_tree = proto_item_add_subtree(megaco_localdescriptor_item, ett_megaco_Remotedescriptor);
}
if ( tokenlen > 3 ){
next_tvb = tvb_new_subset_length(tvb, tvb_current_offset, tokenlen);
@ -3653,11 +3659,9 @@ proto_register_megaco(void)
{ &hf_megaco_pkgdname,
{ "pkgdName", "megaco.pkgdname", FT_STRING, BASE_NONE, NULL, 0x0,
"PackageName SLASH ItemID", HFILL }},
#if 0
{ &hf_megaco_Remote_descriptor,
{ "Remote Descriptor", "megaco.remotedescriptor", FT_STRING, BASE_NONE, NULL, 0x0,
{ "Remote Descriptor", "megaco.remotedescriptor", FT_NONE, BASE_NONE, NULL, 0x0,
"Remote Descriptor in Media Descriptor", HFILL }},
#endif
{ &hf_megaco_reserve_group,
{ "Reserve Group", "megaco.reservegroup", FT_STRING, BASE_NONE, NULL, 0x0,
"Reserve Group on or off", HFILL }},