From b6a09b6cff8b42459b19569e3f94f156b16ab029 Mon Sep 17 00:00:00 2001 From: AndersBroman Date: Tue, 3 May 2016 16:52:09 +0200 Subject: [H.248] Implement export PDU functionality. Change-Id: Ibc7da9306077fd67db348f26a327253242e3d1a2 Reviewed-on: https://code.wireshark.org/review/15258 Petri-Dish: Anders Broman Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- epan/dissectors/asn1/h248/packet-h248-template.c | 29 ++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'epan/dissectors/asn1') diff --git a/epan/dissectors/asn1/h248/packet-h248-template.c b/epan/dissectors/asn1/h248/packet-h248-template.c index c5c6866f37..c2fa50b963 100644 --- a/epan/dissectors/asn1/h248/packet-h248-template.c +++ b/epan/dissectors/asn1/h248/packet-h248-template.c @@ -28,6 +28,7 @@ #include #include #include +#include #include "packet-tpkt.h" #include "packet-mtp3.h" #include "packet-h248.h" @@ -87,6 +88,9 @@ static int h248_tap = -1; static gcp_hf_ett_t h248_arrel = {{-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1}}; +static gint exported_pdu_tap = -1; + + #include "packet-h248-ett.c" static expert_field ei_h248_errored_command = EI_INIT; @@ -698,6 +702,27 @@ static guint32 h248_version = 0; /* h248v1 support */ static gcp_wildcard_t wild_term; static guint8 wild_card = 0xFF; /* place to store wildcardField */ + /* Call the export PDU tap with relevant data */ +static void +export_h248_pdu(packet_info *pinfo, tvbuff_t *tvb) +{ + + exp_pdu_data_t *exp_pdu_data; + guint8 tags_bit_field; + + tags_bit_field = EXP_PDU_TAG_IP_SRC_BIT + EXP_PDU_TAG_IP_DST_BIT + EXP_PDU_TAG_SRC_PORT_BIT + + EXP_PDU_TAG_DST_PORT_BIT + EXP_PDU_TAG_ORIG_FNO_BIT; + + exp_pdu_data = load_export_pdu_tags(pinfo, EXP_PDU_TAG_PROTO_NAME, "h248", &tags_bit_field, 1); + + exp_pdu_data->tvb_captured_length = tvb_captured_length(tvb); + exp_pdu_data->tvb_reported_length = tvb_reported_length(tvb); + exp_pdu_data->pdu_tvb = tvb; + + tap_queue_packet(exported_pdu_tap, pinfo, exp_pdu_data); + +} + extern void h248_param_ber_integer(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, int hfid, h248_curr_info_t* u _U_, void* implicit) { asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); @@ -1469,6 +1494,8 @@ dissect_h248(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ } } + export_h248_pdu(pinfo, tvb); + /* Make entry in the Protocol column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "H.248"); @@ -1686,5 +1713,7 @@ void proto_reg_handoff_h248(void) { if (tcp_port != 0) { dissector_add_uint("tcp.port", tcp_port, h248_tpkt_handle); } + + exported_pdu_tap = find_tap_id(EXPORT_PDU_TAP_NAME_LAYER_7); } -- cgit v1.2.1