[GTPv2] Make dissect_gtpv2_uli() external and add more info when calling

dissectors for private extensions.

Change-Id: I5762fdff2b25bca8d29520780c55367b636a2871
Reviewed-on: https://code.wireshark.org/review/22604
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
AndersBroman 2017-07-13 12:41:12 +02:00 committed by Anders Broman
parent 3c3c845f33
commit 9a29b96d2e
2 changed files with 14 additions and 3 deletions

View File

@ -2599,7 +2599,7 @@ decode_gtpv2_uli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item
}
static void
void
dissect_gtpv2_uli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, guint16 length, guint8 message_type _U_, guint8 instance _U_, session_args_t * args _U_)
{
proto_tree *flag_tree;
@ -5199,11 +5199,15 @@ dissect_gtpv2_fqdn(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, prot
* 8.67 Private Extension
*/
static void
dissect_gtpv2_private_ext(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance, session_args_t * args _U_)
dissect_gtpv2_private_ext(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, guint16 length, guint8 message_type _U_, guint8 instance, session_args_t * args _U_)
{
int offset = 0;
tvbuff_t *next_tvb;
guint16 ext_id;
gtpv2_priv_ext_info_t gtpv2_inf;
gtpv2_inf.instance = instance;
gtpv2_inf.item = item;
/* oct 5 -7 Enterprise ID */
ext_id = tvb_get_ntohs(tvb, offset);
@ -5213,7 +5217,7 @@ dissect_gtpv2_private_ext(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tre
proto_item_append_text(item, "%s (%u)", enterprises_lookup(ext_id, "Unknown"), ext_id);
next_tvb = tvb_new_subset_length(tvb, offset, length-2);
if (dissector_try_uint_new(gtpv2_priv_ext_dissector_table, ext_id, next_tvb, pinfo, tree, FALSE, GUINT_TO_POINTER((guint32)instance))){
if (dissector_try_uint_new(gtpv2_priv_ext_dissector_table, ext_id, next_tvb, pinfo, tree, FALSE, &gtpv2_inf)){
return;
}

View File

@ -30,4 +30,11 @@ extern void dissect_gtpv2_epc_timer(tvbuff_t *tvb, packet_info *pinfo _U_, proto
extern void dissect_gtpv2_twan_identifier(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_, session_args_t * args _U_);
/*Used by custom dissector*/
extern gchar* dissect_gtpv2_tai(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset);
extern void dissect_gtpv2_uli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, guint16 length, guint8 message_type _U_, guint8 instance _U_, session_args_t * args _U_);
extern value_string_ext gtpv2_cause_vals_ext;
typedef struct _gtpv2_priv_ext_info {
guint8 instance;
proto_item *item;
} gtpv2_priv_ext_info_t;