/* packet-diameter_3gpp.c * Routines for dissecting 3GPP OctetSting AVP:s * Copyright 2008, Anders Broman * * $Id$ * * Wireshark - Network traffic analyzer * By Gerald Combs * Copyright 1998 Gerald Combs * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* This dissector registers a dissector table for 3GPP Vendor specific * AVP:s which will be called from the Diameter dissector to dissect * the content of AVP:s of the OctetString type(or similar). */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #include #include #include #include #include "packet-gsm_map.h" #include "packet-gsm_a_common.h" #include "packet-e164.h" #include "packet-e212.h" /* Initialize the protocol and registered fields */ static int proto_diameter_3gpp = -1; static int hf_diameter_3gpp_msisdn = -1; static int hf_diameter_3gpp_user_data = -1; static int hf_diameter_3gpp_ipaddr = -1; static int hf_diameter_3gpp_mbms_required_qos_prio = -1; static int hf_diameter_3gpp_tmgi = -1; static int hf_diameter_mbms_service_id = -1; static int hf_diameter_address_digits = -1; static gint diameter_3gpp_msisdn_ett = -1; static gint diameter_3gpp_tmgi_ett = -1; /* Used for Diameter */ /* dissector handles */ static dissector_handle_t xml_handle; /* AVP Code: 701 MSISDN */ static int dissect_diameter_3gpp_msisdn(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) { proto_item* item; proto_tree *sub_tree; int offset = 0; const char *digit_str; item = proto_tree_add_item(tree, hf_diameter_3gpp_msisdn, tvb, offset, 6, FALSE); sub_tree = proto_item_add_subtree(item,diameter_3gpp_msisdn_ett); dissect_e164_cc(tvb, sub_tree, offset, TRUE); digit_str = unpack_digits(tvb, 1); proto_tree_add_string(sub_tree, hf_diameter_address_digits, tvb, 1, -1, digit_str); return tvb_length(tvb); } /* AVP Code: 702 User-Data */ static int dissect_diameter_3gpp_user_data(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) { guint8 word[6]; int length = tvb_length(tvb); /* If there is less than 38 characters this is not XML * */ if(length < 38) return length; tvb_get_nstringz0(tvb, 0, sizeof(word),word); if (g_ascii_strncasecmp(word, "