Commit 4f37f554 authored by Stig Bjørlykke's avatar Stig Bjørlykke Committed by Evan Huus

RTSE: Return dissected length from call_rtse_oid_callback

Change-Id: I6766135ddcdfe25d9bcc060bb2a47376abb36794
Reviewed-on: https://code.wireshark.org/review/4642Reviewed-by: default avatarAnders Broman <a.broman58@gmail.com>
Reviewed-by: default avatarEvan Huus <eapache@gmail.com>
parent 748e5228
......@@ -144,24 +144,23 @@ static int
call_rtse_oid_callback(const char *oid, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data)
{
tvbuff_t *next_tvb;
int len;
next_tvb = tvb_new_subset_remaining(tvb, offset);
if(!dissector_try_string(rtse_oid_dissector_table, oid, next_tvb, pinfo, tree, data)){
if((len = dissector_try_string(rtse_oid_dissector_table, oid, next_tvb, pinfo, tree, data)) == 0) {
proto_item *item;
proto_tree *next_tree;
next_tree = proto_tree_add_subtree_format(tree, next_tvb, 0, -1, ett_rtse_unknown, &item,
"RTSE: Dissector for OID:%s not implemented. Contact Wireshark developers if you want this supported", oid);
"RTSE: Dissector for OID:%s not implemented. Contact Wireshark developers if you want this supported", oid);
expert_add_info_format(pinfo, item, &ei_rtse_dissector_oid_not_implemented,
"RTSE: Dissector for OID %s not implemented", oid);
dissect_unknown_ber(pinfo, next_tvb, offset, next_tree);
"RTSE: Dissector for OID %s not implemented", oid);
len = dissect_unknown_ber(pinfo, next_tvb, offset, next_tree);
}
/*XXX until we change the #.REGISTER signature for _PDU()s
* into new_dissector_t we have to do this kludge with
* manually step past the content in the ANY type.
*/
offset+=tvb_captured_length_remaining(tvb, offset);
offset += len;
return offset;
}
......
......@@ -194,24 +194,23 @@ static int
call_rtse_oid_callback(const char *oid, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data)
{
tvbuff_t *next_tvb;
int len;
next_tvb = tvb_new_subset_remaining(tvb, offset);
if(!dissector_try_string(rtse_oid_dissector_table, oid, next_tvb, pinfo, tree, data)){
if((len = dissector_try_string(rtse_oid_dissector_table, oid, next_tvb, pinfo, tree, data)) == 0) {
proto_item *item;
proto_tree *next_tree;
next_tree = proto_tree_add_subtree_format(tree, next_tvb, 0, -1, ett_rtse_unknown, &item,
"RTSE: Dissector for OID:%s not implemented. Contact Wireshark developers if you want this supported", oid);
"RTSE: Dissector for OID:%s not implemented. Contact Wireshark developers if you want this supported", oid);
expert_add_info_format(pinfo, item, &ei_rtse_dissector_oid_not_implemented,
"RTSE: Dissector for OID %s not implemented", oid);
dissect_unknown_ber(pinfo, next_tvb, offset, next_tree);
"RTSE: Dissector for OID %s not implemented", oid);
len = dissect_unknown_ber(pinfo, next_tvb, offset, next_tree);
}
/*XXX until we change the #.REGISTER signature for _PDU()s
* into new_dissector_t we have to do this kludge with
* manually step past the content in the ANY type.
*/
offset+=tvb_captured_length_remaining(tvb, offset);
offset += len;
return offset;
}
......@@ -729,7 +728,7 @@ dissect_rtse_RTSE_apdus(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset
/*--- End of included file: packet-rtse-fn.c ---*/
#line 187 "../../asn1/rtse/packet-rtse-template.c"
#line 186 "../../asn1/rtse/packet-rtse-template.c"
/*
* Dissect RTSE PDUs inside a PPDU.
......@@ -996,7 +995,7 @@ void proto_register_rtse(void) {
NULL, HFILL }},
/*--- End of included file: packet-rtse-hfarr.c ---*/
#line 353 "../../asn1/rtse/packet-rtse-template.c"
#line 352 "../../asn1/rtse/packet-rtse-template.c"
};
/* List of subtrees */
......@@ -1018,7 +1017,7 @@ void proto_register_rtse(void) {
&ett_rtse_CallingSSuserReference,
/*--- End of included file: packet-rtse-ettarr.c ---*/
#line 362 "../../asn1/rtse/packet-rtse-template.c"
#line 361 "../../asn1/rtse/packet-rtse-template.c"
};
static ei_register_info ei[] = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment