aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/asn1/q932
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/asn1/q932')
-rw-r--r--epan/dissectors/asn1/q932/Addressing-Data-Elements.asn157
-rw-r--r--epan/dissectors/asn1/q932/CMakeLists.txt55
-rw-r--r--epan/dissectors/asn1/q932/Interpretation-component.asn24
-rw-r--r--epan/dissectors/asn1/q932/Makefile.am23
-rw-r--r--epan/dissectors/asn1/q932/Makefile.common48
-rw-r--r--epan/dissectors/asn1/q932/Makefile.nmake30
-rw-r--r--epan/dissectors/asn1/q932/Network-Facility-Extension.asn33
-rw-r--r--epan/dissectors/asn1/q932/Network-Protocol-Profile-component.asn20
-rw-r--r--epan/dissectors/asn1/q932/packet-q932-template.c398
-rw-r--r--epan/dissectors/asn1/q932/packet-q932-template.h30
-rw-r--r--epan/dissectors/asn1/q932/q932.cnf32
11 files changed, 850 insertions, 0 deletions
diff --git a/epan/dissectors/asn1/q932/Addressing-Data-Elements.asn b/epan/dissectors/asn1/q932/Addressing-Data-Elements.asn
new file mode 100644
index 0000000000..f5903945fc
--- /dev/null
+++ b/epan/dissectors/asn1/q932/Addressing-Data-Elements.asn
@@ -0,0 +1,157 @@
+-- Addressing-Data-Elements.asn
+--
+-- Taken from ITU ASN.1 database
+-- http://www.itu.int/ITU-T/asn1/database/itu-t/q/q932/1998-Amd1/Addressing-Data-Elements.asn
+--
+
+-- Module Addressing-Data-Elements (Q.932:05/1998)
+Addressing-Data-Elements {itu-t recommendation q 932
+ addressing-data-elements(7)} DEFINITIONS EXPLICIT TAGS ::=
+BEGIN
+
+EXPORTS
+ PresentedAddressScreened, PresentedAddressUnscreened,
+ PresentedNumberScreened, PresentedNumberUnscreened, Address, PartyNumber,
+ PartySubaddress, ScreeningIndicator, PresentationAllowedIndicator;
+
+PresentedAddressScreened ::= CHOICE {
+ presentationAlIowedAddress [0] IMPLICIT AddressScreened,
+ presentationRestricted [1] IMPLICIT NULL,
+ numberNotAvailableDueTolnterworking [2] IMPLICIT NULL,
+ presentationRestrictedAddress [3] IMPLICIT AddressScreened
+}
+
+PresentedAddressUnscreened ::= CHOICE {
+ presentationAllowedAddress [0] IMPLICIT Address,
+ presentationRestricted [1] IMPLICIT NULL,
+ numberNotAvailableDueTolnterworking [2] IMPLICIT NULL,
+ presentationRestrictedAddress [3] IMPLICIT Address
+}
+
+PresentedNumberScreened ::= CHOICE {
+ presentationAllowedNumber [0] IMPLICIT NumberScreened,
+ presentationRestricted [1] IMPLICIT NULL,
+ numberNotAvailableDueToInterworking [2] IMPLICIT NULL,
+ presentationRestrictedNumber [3] IMPLICIT NumberScreened
+}
+
+PresentedNumberUnscreened ::= CHOICE {
+ presentationAllowedNumber [0] PartyNumber,
+ presentationRestricted [1] IMPLICIT NULL,
+ numberNotAvailableDueToInterworking [2] IMPLICIT NULL,
+ presentationRestrictedNumber [3] PartyNumber
+}
+
+AddressScreened ::= SEQUENCE {
+ partyNumber PartyNumber,
+ screeninglndicator ScreeningIndicator,
+ partySubaddress PartySubaddress OPTIONAL
+}
+
+NumberScreened ::= SEQUENCE {
+ partyNumber PartyNumber,
+ screeningIndicator ScreeningIndicator
+}
+
+Address ::= SEQUENCE {
+ partyNumber PartyNumber,
+ partySubaddress PartySubaddress OPTIONAL
+}
+
+PartyNumber ::= CHOICE {
+ unknownPartyNumber [0] IMPLICIT NumberDigits,
+ -- the numbering plan is the default numbering plan
+ -- of the network. It is recommended that this value
+ -- is used.
+ publicPartyNumber [1] IMPLICIT PublicPartyNumber,
+ -- the numbering plan is according to ITU-T
+ -- Recommendation E.164.
+ nsapEncodedNumber [2] IMPLICIT NsapEncodedNumber,
+ -- ATM endsystem address encoded as an NSAP address.
+ dataPartyNumber [3] IMPLICIT NumberDigits,
+ -- not used, value reserved.
+ telexPartyNumber [4] IMPLICIT NumberDigits,
+ -- not used, value reserved.
+ privatePartyNumber [5] IMPLICIT PrivatePartyNumber,
+ nationalStandardPartyNumber [8] IMPLICIT NumberDigits
+}
+
+-- not used, value reserved.
+NsapEncodedNumber ::= OCTET STRING(SIZE (20))
+
+PublicPartyNumber ::= SEQUENCE {
+ publicTypeOfNumber PublicTypeOfNumber,
+ publicNumberDigits NumberDigits
+}
+
+PrivatePartyNumber ::= SEQUENCE {
+ privateTypeOfNumber PrivateTypeOfNumber,
+ privateNumberDigits NumberDigits
+}
+
+NumberDigits ::= NumericString(SIZE (1..20))
+
+PublicTypeOfNumber ::= ENUMERATED {
+ unknown(0),
+ -- if used number digits carry prefix indicating type
+ -- of number according to national
+ -- recommendations
+ internationalNumber(1), nationalNumber(2),
+ networkSpecificNumber(3),
+ -- not used, value reserved
+ subscriberNumber(4), abbreviatedNumber(6)}
+
+-- valid only for called party number at the
+-- outgoing access, network substitutes
+-- appropriate number
+PrivateTypeOfNumber ::= ENUMERATED {
+ unknown(0), level2RegionalNumber(1), level1RegionalNumber(2),
+ pTNSpecificNumber(3), localNumber(4), abbreviatedNumber(6)}
+
+PartySubaddress ::= CHOICE {
+ userSpecifiedSubaddress UserSpecifiedSubaddress,
+ -- not recommended
+ nSAPSubaddress NSAPSubaddress
+}
+
+-- according to ITU-T Recommendation X.213
+UserSpecifiedSubaddress ::= SEQUENCE {
+ subaddressInformation SubaddressInformation,
+ oddCountIndicator BOOLEAN OPTIONAL
+}
+
+-- used when the coding of subaddress is BCD
+NSAPSubaddress ::= OCTET STRING(SIZE (1..20))
+
+-- specified according to ITU-T Recommendation X.213. Some networks
+-- may limit the subaddress value to some other
+-- length, e.g. 4 octets
+SubaddressInformation ::= OCTET STRING(SIZE (1..20))
+
+-- coded according to user requirements. Some
+-- networks may limit the subaddress value to some
+-- other length, e.g. 4 octets
+ScreeningIndicator ::= ENUMERATED {
+ userProvidedNotScreened(0),
+ -- number was provided by a remote user terminal
+ -- equipment, and has been screened by a
+ -- network that is not the local public or local
+ -- private network.
+ userProvidedVerifiedAndPassed(1),
+ -- number was provided by a remote user terminal
+ -- equipment (or by a remote private network), and
+ -- has been screened by the local public or local
+ -- private network.
+ userProvidedVerifiedAndFailed(2),
+ -- not used, value reserved
+ networkProvided(3)}
+
+-- number was provided by local
+-- public or local
+-- private network
+PresentationAllowedIndicator ::= BOOLEAN
+
+END -- of addressing data elements
+
+-- Generated by Asnp, the ASN.1 pretty-printer of France Telecom R&D
+
diff --git a/epan/dissectors/asn1/q932/CMakeLists.txt b/epan/dissectors/asn1/q932/CMakeLists.txt
new file mode 100644
index 0000000000..f5727a7144
--- /dev/null
+++ b/epan/dissectors/asn1/q932/CMakeLists.txt
@@ -0,0 +1,55 @@
+# CMakeLists.txt
+#
+# Wireshark - Network traffic analyzer
+# By Gerald Combs <gerald@wireshark.org>
+# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+
+set( PROTOCOL_NAME q932 )
+
+set( PROTO_OPT )
+
+set( EXPORT_FILES
+ ${PROTOCOL_NAME}-exp.cnf
+)
+
+set( EXT_ASN_FILE_LIST
+)
+
+set( ASN_FILE_LIST
+ Addressing-Data-Elements.asn
+ Network-Facility-Extension.asn
+ Network-Protocol-Profile-component.asn
+ Interpretation-component.asn
+)
+
+set( EXTRA_DIST
+ ${ASN_FILE_LIST}
+ packet-${PROTOCOL_NAME}-template.c
+ packet-${PROTOCOL_NAME}-template.h
+ ${PROTOCOL_NAME}.cnf
+)
+
+set( SRC_FILES
+ ${EXTRA_DIST}
+ ${EXT_ASN_FILE_LIST}
+)
+
+set( A2W_FLAGS -b )
+
+ASN2WRS()
+
diff --git a/epan/dissectors/asn1/q932/Interpretation-component.asn b/epan/dissectors/asn1/q932/Interpretation-component.asn
new file mode 100644
index 0000000000..ebc9676379
--- /dev/null
+++ b/epan/dissectors/asn1/q932/Interpretation-component.asn
@@ -0,0 +1,24 @@
+-- Interpretation-component.asn
+--
+-- Taken from ITU ASN.1 database
+-- http://www.itu.int/ITU-T/asn1/database/itu-t/q/q932/1998-Amd1/Interpretation-component.asn
+--
+
+-- Module Interpretation-component (Q.932:05/1998)
+Interpretation-component {iso(1) standard(0) pss1-generic-procedures(11582)
+ interpretation-component(3)} DEFINITIONS ::=
+BEGIN
+
+EXPORTS InterpretationComponent;
+
+InterpretationComponent ::= [11] IMPLICIT ENUMERATED {
+ discardAnyUnrecognisedInvokePdu(0), clearCallIfAnyInvokePduNotRecognised(1),
+ rejectAnyUnrecognisedInvokePdu(2)
+ -- this coding is implied by the absence of an
+ -- Interpretation Component.
+ }
+
+END -- component
+
+-- Generated by Asnp, the ASN.1 pretty-printer of France Telecom R&D
+
diff --git a/epan/dissectors/asn1/q932/Makefile.am b/epan/dissectors/asn1/q932/Makefile.am
new file mode 100644
index 0000000000..72d28e600b
--- /dev/null
+++ b/epan/dissectors/asn1/q932/Makefile.am
@@ -0,0 +1,23 @@
+# Wireshark - Network traffic analyzer
+# By Gerald Combs <gerald@wireshark.org>
+# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+
+include ../Makefile.preinc
+include Makefile.common
+include ../Makefile.inc
+
diff --git a/epan/dissectors/asn1/q932/Makefile.common b/epan/dissectors/asn1/q932/Makefile.common
new file mode 100644
index 0000000000..7e49b4c087
--- /dev/null
+++ b/epan/dissectors/asn1/q932/Makefile.common
@@ -0,0 +1,48 @@
+# Wireshark - Network traffic analyzer
+# By Gerald Combs <gerald@wireshark.org>
+# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+
+PROTOCOL_NAME = q932
+
+EXPORT_FILES = $(PROTOCOL_NAME)-exp.cnf
+
+EXT_ASN_FILE_LIST =
+
+ASN_FILE_LIST = \
+ Addressing-Data-Elements.asn \
+ Network-Facility-Extension.asn \
+ Network-Protocol-Profile-component.asn \
+ Interpretation-component.asn
+
+# The packet-$(PROTOCOL_NAME)-template.h and $(PROTOCOL_NAME).asn
+# files do not exist for all protocols: Please add/remove as required.
+EXTRA_DIST = \
+ $(EXTRA_DIST_COMMON) \
+ $(ASN_FILE_LIST) \
+ packet-$(PROTOCOL_NAME)-template.c \
+ packet-$(PROTOCOL_NAME)-template.h \
+ $(PROTOCOL_NAME).cnf
+
+SRC_FILES = \
+ $(EXTRA_DIST) \
+ $(EXT_ASN_FILE_LIST)
+
+A2W_FLAGS= -b
+
+EXTRA_CNF =
+
diff --git a/epan/dissectors/asn1/q932/Makefile.nmake b/epan/dissectors/asn1/q932/Makefile.nmake
new file mode 100644
index 0000000000..270082fb45
--- /dev/null
+++ b/epan/dissectors/asn1/q932/Makefile.nmake
@@ -0,0 +1,30 @@
+## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
+#
+# Wireshark - Network traffic analyzer
+# By Gerald Combs <gerald@wireshark.org>
+# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+
+include ../../../../config.nmake
+include ../Makefile.preinc.nmake
+include Makefile.common
+include ../Makefile.inc.nmake
+
+checkapi:
+ $(PERL) ../../tools/checkAPIs.pl -build \
+ $(PROTOCOL_NAME).cnf \
+ packet-$(PROTOCOL_NAME)-template.c \ No newline at end of file
diff --git a/epan/dissectors/asn1/q932/Network-Facility-Extension.asn b/epan/dissectors/asn1/q932/Network-Facility-Extension.asn
new file mode 100644
index 0000000000..eb1a007dbc
--- /dev/null
+++ b/epan/dissectors/asn1/q932/Network-Facility-Extension.asn
@@ -0,0 +1,33 @@
+-- Network-Facility-Extension.asn
+--
+-- Taken from ITU ASN.1 database
+-- http://www.itu.int/ITU-T/asn1/database/itu-t/q/q932/1998-Amd1/Network-Facility-Extension.asn
+--
+
+-- Module Network-Facility-Extension (Q.932:05/1998)
+Network-Facility-Extension {iso(1) standard(0) pss1-generic-procedures(11582)
+ network-facility-extension(2)} DEFINITIONS ::=
+BEGIN
+
+EXPORTS NetworkFacilityExtension;
+
+IMPORTS
+ PartyNumber
+ FROM Addressing-Data-Elements {itu-t recommendation q 932
+ addressing-data-elements(7)};
+
+NetworkFacilityExtension ::= [10] IMPLICIT SEQUENCE {
+ sourceEntity [0] IMPLICIT EntityType,
+ sourceEntityAddress [1] AddressInformation OPTIONAL,
+ destinationEntity [2] IMPLICIT EntityType,
+ destinationEntityAddress [3] AddressInformation OPTIONAL
+}
+
+EntityType ::= ENUMERATED {endPINX(0), anyTypeOfPINX(1)}
+
+AddressInformation ::= PartyNumber
+
+END -- of Network Facility Extension
+
+-- Generated by Asnp, the ASN.1 pretty-printer of France Telecom R&D
+
diff --git a/epan/dissectors/asn1/q932/Network-Protocol-Profile-component.asn b/epan/dissectors/asn1/q932/Network-Protocol-Profile-component.asn
new file mode 100644
index 0000000000..6364214dfe
--- /dev/null
+++ b/epan/dissectors/asn1/q932/Network-Protocol-Profile-component.asn
@@ -0,0 +1,20 @@
+-- Network-Protocol-Profile-component.asn
+--
+-- Taken from ITU ASN.1 database
+-- http://www.itu.int/ITU-T/asn1/database/itu-t/q/q932/1998-Amd1/Network-Protocol-Profile-component.asn
+--
+
+-- Module Network-Protocol-Profile-component (Q.932:05/1998)
+Network-Protocol-Profile-component {iso(1) standard(0)
+ pss1-generic-procedures(11582) network-protocol-profile-component(8)}
+DEFINITIONS ::=
+BEGIN
+
+EXPORTS NetworkProtocolProfile;
+
+NetworkProtocolProfile ::= [18] IMPLICIT INTEGER {acse(19), dse(32)}(0..254)
+
+END -- of Network-Protocol-Profile-component
+
+-- Generated by Asnp, the ASN.1 pretty-printer of France Telecom R&D
+
diff --git a/epan/dissectors/asn1/q932/packet-q932-template.c b/epan/dissectors/asn1/q932/packet-q932-template.c
new file mode 100644
index 0000000000..2386e36bfa
--- /dev/null
+++ b/epan/dissectors/asn1/q932/packet-q932-template.c
@@ -0,0 +1,398 @@
+/* packet-q932.c
+ * Routines for Q.932 packet dissection
+ * 2007 Tomas Kukosa
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "config.h"
+
+#include <epan/packet.h>
+#include <epan/expert.h>
+#include <epan/strutil.h>
+#include <epan/asn1.h>
+#include <epan/prefs.h>
+
+#include "packet-ber.h"
+#include "packet-q932.h"
+
+#define PNAME "Q.932"
+#define PSNAME "Q932"
+#define PFNAME "q932"
+
+void proto_register_q932(void);
+
+/* Initialize the protocol and registered fields */
+static int proto_q932 = -1;
+static int hf_q932_ie_type = -1;
+static int hf_q932_ie_len = -1;
+static int hf_q932_ie_data = -1;
+static int hf_q932_pp = -1;
+static int hf_q932_nd = -1;
+#include "packet-q932-hf.c"
+
+/* Initialize the subtree pointers */
+static gint ett_q932 = -1;
+static gint ett_q932_ie = -1;
+#include "packet-q932-ett.c"
+
+static expert_field ei_q932_dse_not_supported = EI_INIT;
+static expert_field ei_q932_acse_not_supported = EI_INIT;
+static expert_field ei_q932_unknown_component = EI_INIT;
+static expert_field ei_q932_asn1_encoded = EI_INIT;
+
+
+/* Preferences */
+
+/* ROSE context */
+static rose_ctx_t q932_rose_ctx;
+
+dissector_table_t qsig_arg_local_dissector_table;
+dissector_table_t qsig_res_local_dissector_table;
+dissector_table_t qsig_err_local_dissector_table;
+
+dissector_table_t etsi_arg_local_dissector_table;
+dissector_table_t etsi_res_local_dissector_table;
+dissector_table_t etsi_err_local_dissector_table;
+
+#define FACILITY_QSIG 0
+#define FACILITY_ETSI 1
+static gint g_facility_encoding = FACILITY_QSIG;
+
+void proto_reg_handoff_q932(void);
+/* Subdissectors */
+static dissector_handle_t q932_ros_handle;
+
+#define Q932_IE_EXTENDED_FACILITY 0x0D
+#define Q932_IE_FACILITY 0x1C
+#define Q932_IE_NOTIFICATION_INDICATOR 0x27
+#define Q932_IE_INFORMATION_REQUEST 0x32
+#define Q932_IE_FEATURE_ACTIVATION 0x38
+#define Q932_IE_FEATURE_INDICATION 0x39
+#define Q932_IE_SERVICE_PROFILE_ID 0x3A
+#define Q932_IE_ENDPOINT_IDENTIFIER 0x3B
+static const value_string q932_str_ie_type[] = {
+ { Q932_IE_EXTENDED_FACILITY , "Extended facility" },
+ { Q932_IE_FACILITY , "Facility" },
+ { Q932_IE_NOTIFICATION_INDICATOR, "Notification indicator" },
+ { Q932_IE_INFORMATION_REQUEST, "Information request" },
+ { Q932_IE_FEATURE_ACTIVATION , "Feature activation" },
+ { Q932_IE_FEATURE_INDICATION , "Feature indication" },
+ { Q932_IE_SERVICE_PROFILE_ID , "Service profile identification" },
+ { Q932_IE_ENDPOINT_IDENTIFIER, "Endpoint identifier" },
+ { 0, NULL}
+};
+
+static const value_string str_pp[] = {
+ { 0x11 , "Remote Operations Protocol" },
+ { 0x12 , "CMIP Protocol" },
+ { 0x13 , "ACSE Protocol" },
+ { 0x1F , "Networking extensions" },
+ { 0, NULL}
+};
+
+static const value_string str_nd[] = {
+ { 0x00 , "User suspended" },
+ { 0x01 , "User resume" },
+ { 0x02 , "Bearer service change" },
+ { 0x04 , "Call completion delay" },
+ { 0x03 , "Discriminator for extension to ASN.1 encoded component" },
+ { 0x40 , "Discriminator for extension to ASN.1 encoded component for ISO" },
+ { 0x42 , "Conference established" },
+ { 0x43 , "Conference disconnected" },
+ { 0x44 , "Other party added" },
+ { 0x45 , "Isolated" },
+ { 0x46 , "Reattached" },
+ { 0x47 , "Other party isolated" },
+ { 0x48 , "Other party reattached" },
+ { 0x49 , "Other party split" },
+ { 0x4A , "Other party disconnected" },
+ { 0x4B , "Conference floating" },
+ { 0x4C , "Conference disconnected, pre-emption" },
+ { 0x4F , "Conference floating, served user pre-empted" },
+ { 0x60 , "Call is a waiting call" },
+ { 0x68 , "Diversion activated" },
+ { 0x69 , "call transferred, alerting" },
+ { 0x6A , "call transferred, answered" },
+ { 0x6E , "reverse charging (whole call)" },
+ { 0x6F , "reverse charging (for the rest of the call)" },
+ { 0x74 , "service profile update" },
+ { 0x79 , "Remote hold" },
+ { 0x7A , "Remote retrieval" },
+ { 0x7B , "Call is diverting" },
+ { 0, NULL}
+};
+
+#include "packet-q932-fn.c"
+
+/*--- dissect_q932_facility_ie -------------------------------------------------------*/
+static void
+dissect_q932_facility_ie(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int length) {
+ gint8 appclass;
+ gboolean pc;
+ gint32 tag;
+ guint32 len;
+ int hoffset, eoffset;
+ int ie_end;
+ tvbuff_t *next_tvb;
+
+ ie_end = offset + length;
+ proto_tree_add_item(tree, hf_q932_pp, tvb, offset, 1, ENC_BIG_ENDIAN);
+ offset++;
+ while (offset < ie_end) {
+ hoffset = offset;
+ offset = get_ber_identifier(tvb, offset, &appclass, &pc, &tag);
+ offset = get_ber_length(tvb, offset, &len, NULL);
+ eoffset = offset + len;
+ next_tvb = tvb_new_subset_length(tvb, hoffset, eoffset - hoffset);
+ switch (appclass) {
+ case BER_CLASS_CON:
+ switch (tag) {
+ case 10 : /* Network Facility Extension */
+ dissect_NetworkFacilityExtension_PDU(next_tvb, pinfo, tree, NULL);
+ break;
+ case 18 : /* Network Protocol Profile */
+ dissect_NetworkProtocolProfile_PDU(next_tvb, pinfo, tree, NULL);
+ break;
+ case 11 : /* Interpretation Component */
+ dissect_InterpretationComponent_PDU(next_tvb, pinfo, tree, NULL);
+ break;
+ /* ROSE APDU */
+ case 1 : /* invoke */
+ case 2 : /* returnResult */
+ case 3 : /* returnError */
+ case 4 : /* reject */
+ q932_rose_ctx.apdu_depth = 1;
+ call_dissector_with_data(q932_ros_handle, next_tvb, pinfo, tree, &q932_rose_ctx);
+ break;
+ /* DSE APDU */
+ case 12 : /* begin */
+ case 14 : /* end */
+ case 15 : /* continue */
+ case 17 : /* abort */
+ offset = dissect_ber_identifier(pinfo, tree, tvb, hoffset, NULL, NULL, NULL);
+ offset = dissect_ber_length(pinfo, tree, tvb, offset, NULL, NULL);
+ proto_tree_add_expert(tree, pinfo, &ei_q932_dse_not_supported, tvb, offset, len);
+ break;
+ default:
+ offset = dissect_ber_identifier(pinfo, tree, tvb, hoffset, NULL, NULL, NULL);
+ offset = dissect_ber_length(pinfo, tree, tvb, offset, NULL, NULL);
+ proto_tree_add_expert(tree, pinfo, &ei_q932_unknown_component, tvb, offset, len);
+ }
+ break;
+ case BER_CLASS_APP:
+ switch (tag) {
+ /* ACSE APDU */
+ case 0 : /* aarq */
+ case 1 : /* aare */
+ case 2 : /* rlrq */
+ case 3 : /* rlre */
+ case 4 : /* abrt */
+ offset = dissect_ber_identifier(pinfo, tree, tvb, hoffset, NULL, NULL, NULL);
+ offset = dissect_ber_length(pinfo, tree, tvb, offset, NULL, NULL);
+ proto_tree_add_expert(tree, pinfo, &ei_q932_acse_not_supported, tvb, offset, len);
+ break;
+ default:
+ offset = dissect_ber_identifier(pinfo, tree, tvb, hoffset, NULL, NULL, NULL);
+ offset = dissect_ber_length(pinfo, tree, tvb, offset, NULL, NULL);
+ proto_tree_add_expert(tree, pinfo, &ei_q932_unknown_component, tvb, offset, len);
+ }
+ break;
+ default:
+ offset = dissect_ber_identifier(pinfo, tree, tvb, hoffset, NULL, NULL, NULL);
+ offset = dissect_ber_length(pinfo, tree, tvb, offset, NULL, NULL);
+ proto_tree_add_expert(tree, pinfo, &ei_q932_unknown_component, tvb, offset, len);
+ }
+ offset = eoffset;
+ }
+}
+
+/*--- dissect_q932_ni_ie -------------------------------------------------------*/
+static void
+dissect_q932_ni_ie(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int length) {
+ int remain = length;
+ guint8 octet = 0;
+ guint32 value = 0;
+ proto_item* ti;
+
+ while ((remain > 0) && !(octet & 0x80)) {
+ octet = tvb_get_guint8(tvb, offset++);
+ remain--;
+ value <<= 7;
+ value |= octet & 0x7F;
+ }
+ ti = proto_tree_add_uint(tree, hf_q932_nd, tvb, offset - (length - remain), length - remain, value);
+
+ if (remain > 0) {
+ expert_add_info(pinfo, ti, &ei_q932_asn1_encoded);
+ }
+}
+
+/*--- dissect_q932_ie -------------------------------------------------------*/
+static int
+dissect_q932_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) {
+ gint offset;
+ proto_item *ti;
+ proto_tree *ie_tree;
+ guint8 ie_type, ie_len;
+
+ offset = 0;
+
+ ti = proto_tree_add_item(tree, proto_q932, tvb, offset, -1, ENC_NA);
+ PROTO_ITEM_SET_HIDDEN(ti);
+
+ ie_type = tvb_get_guint8(tvb, offset);
+ ie_len = tvb_get_guint8(tvb, offset + 1);
+
+ ie_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_q932_ie, NULL,
+ val_to_str(ie_type, VALS(q932_str_ie_type), "unknown (0x%02X)"));
+
+ proto_tree_add_item(ie_tree, hf_q932_ie_type, tvb, offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ie_tree, hf_q932_ie_len, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
+ offset += 2;
+ if (tvb_reported_length_remaining(tvb, offset) <= 0)
+ return offset;
+ switch (ie_type) {
+ case Q932_IE_FACILITY :
+ dissect_q932_facility_ie(tvb, offset, pinfo, ie_tree, ie_len);
+ break;
+ case Q932_IE_NOTIFICATION_INDICATOR :
+ dissect_q932_ni_ie(tvb, offset, pinfo, ie_tree, ie_len);
+ break;
+ default:
+ if (ie_len > 0) {
+ proto_tree_add_item(ie_tree, hf_q932_ie_data, tvb, offset, ie_len, ENC_NA);
+ }
+ }
+ return tvb_captured_length(tvb);
+}
+
+/*--- dissect_q932_apdu -----------------------------------------------------*/
+static int
+dissect_q932_apdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) {
+ return call_dissector(q932_ros_handle, tvb, pinfo, tree);
+}
+
+/*--- proto_register_q932 ---------------------------------------------------*/
+void proto_register_q932(void) {
+
+ /* List of fields */
+ static hf_register_info hf[] = {
+ { &hf_q932_ie_type, { "Type", "q932.ie.type",
+ FT_UINT8, BASE_HEX, VALS(q932_str_ie_type), 0x0,
+ "Information Element Type", HFILL }},
+ { &hf_q932_ie_len, { "Length", "q932.ie.len",
+ FT_UINT8, BASE_DEC, NULL, 0x0,
+ "Information Element Length", HFILL }},
+ { &hf_q932_ie_data, { "Data", "q932.ie.data",
+ FT_BYTES, BASE_NONE, NULL, 0x0,
+ NULL, HFILL }},
+ { &hf_q932_pp, { "Protocol profile", "q932.pp",
+ FT_UINT8, BASE_HEX, VALS(str_pp), 0x1F,
+ NULL, HFILL }},
+ { &hf_q932_nd, { "Notification description", "q932.nd",
+ FT_UINT8, BASE_HEX, VALS(str_nd), 0x0,
+ NULL, HFILL }},
+#include "packet-q932-hfarr.c"
+ };
+
+ /* List of subtrees */
+ static gint *ett[] = {
+ &ett_q932,
+ &ett_q932_ie,
+#include "packet-q932-ettarr.c"
+ };
+
+ static ei_register_info ei[] = {
+ { &ei_q932_dse_not_supported, { "q932.dse_not_supported", PI_UNDECODED, PI_WARN, "DSE APDU (not supported)", EXPFILL }},
+ { &ei_q932_acse_not_supported, { "q932.acse_not_supported", PI_UNDECODED, PI_WARN, "ACSE APDU (not supported)", EXPFILL }},
+ { &ei_q932_unknown_component, { "q932.unknown_component", PI_UNDECODED, PI_WARN, "Unknown Component", EXPFILL }},
+ { &ei_q932_asn1_encoded, { "q932.asn1_encoded", PI_UNDECODED, PI_WARN, "ASN.1 Encoded Data Structure(NOT IMPLEMENTED)", EXPFILL }},
+ };
+
+ module_t *q932_module;
+ expert_module_t* expert_q932;
+
+ static const enum_val_t facility_encoding[] = {
+ {"Facility as QSIG", "Dissect facility as QSIG", FACILITY_QSIG},
+ {"Facility as ETSI", "Dissect facility as ETSI", FACILITY_ETSI},
+ {NULL, NULL, -1}
+ };
+
+ /* Register protocol and dissector */
+ proto_q932 = proto_register_protocol(PNAME, PSNAME, PFNAME);
+ register_dissector("q932.apdu", dissect_q932_apdu, proto_q932);
+
+ /* Register fields and subtrees */
+ proto_register_field_array(proto_q932, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
+ expert_q932 = expert_register_protocol(proto_q932);
+ expert_register_field_array(expert_q932, ei, array_length(ei));
+
+ rose_ctx_init(&q932_rose_ctx);
+
+ /* Register dissector tables */
+ q932_rose_ctx.arg_global_dissector_table = register_dissector_table("q932.ros.global.arg", "Q.932 Operation Argument (global opcode)", FT_STRING, BASE_NONE, DISSECTOR_TABLE_ALLOW_DUPLICATE);
+ q932_rose_ctx.res_global_dissector_table = register_dissector_table("q932.ros.global.res", "Q.932 Operation Result (global opcode)", FT_STRING, BASE_NONE, DISSECTOR_TABLE_ALLOW_DUPLICATE);
+ q932_rose_ctx.err_global_dissector_table = register_dissector_table("q932.ros.global.err", "Q.932 Error (global opcode)", FT_STRING, BASE_NONE, DISSECTOR_TABLE_ALLOW_DUPLICATE);
+
+ qsig_arg_local_dissector_table = register_dissector_table("q932.ros.local.arg", "Q.932 Operation Argument (local opcode)", FT_UINT32, BASE_HEX, DISSECTOR_TABLE_ALLOW_DUPLICATE);
+ qsig_res_local_dissector_table = register_dissector_table("q932.ros.local.res", "Q.932 Operation Result (local opcode)", FT_UINT32, BASE_HEX, DISSECTOR_TABLE_ALLOW_DUPLICATE);
+ qsig_err_local_dissector_table = register_dissector_table("q932.ros.local.err", "Q.932 Error (local opcode)", FT_UINT32, BASE_HEX, DISSECTOR_TABLE_ALLOW_DUPLICATE);
+
+ etsi_arg_local_dissector_table = register_dissector_table("q932.ros.etsi.local.arg", "Q.932 ETSI Operation Argument (local opcode)", FT_UINT32, BASE_HEX, DISSECTOR_TABLE_ALLOW_DUPLICATE);
+ etsi_res_local_dissector_table = register_dissector_table("q932.ros.etsi.local.res", "Q.932 ETSI Operation Result (local opcode)", FT_UINT32, BASE_HEX, DISSECTOR_TABLE_ALLOW_DUPLICATE);
+ etsi_err_local_dissector_table = register_dissector_table("q932.ros.etsi.local.err", "Q.932 ETSI Error (local opcode)", FT_UINT32, BASE_HEX, DISSECTOR_TABLE_ALLOW_DUPLICATE);
+
+ q932_module = prefs_register_protocol(proto_q932, proto_reg_handoff_q932);
+
+ prefs_register_enum_preference(q932_module, "facility_encoding",
+ "Type of Facility encoding",
+ "Type of Facility encoding",
+ &g_facility_encoding, facility_encoding, FALSE);
+}
+
+/*--- proto_reg_handoff_q932 ------------------------------------------------*/
+void proto_reg_handoff_q932(void) {
+ dissector_handle_t q932_ie_handle;
+
+ static gboolean q931_prefs_initialized = FALSE;
+
+ if (!q931_prefs_initialized) {
+ q932_ie_handle = create_dissector_handle(dissect_q932_ie, proto_q932);
+ /* Facility */
+ dissector_add_uint("q931.ie", (0x00 << 8) | Q932_IE_FACILITY, q932_ie_handle);
+ /* Notification indicator */
+ dissector_add_uint("q931.ie", (0x00 << 8) | Q932_IE_NOTIFICATION_INDICATOR, q932_ie_handle);
+ q932_ros_handle = find_dissector("q932.ros");
+ }
+
+ if(g_facility_encoding == FACILITY_QSIG){
+ q932_rose_ctx.arg_local_dissector_table = qsig_arg_local_dissector_table;
+ q932_rose_ctx.res_local_dissector_table = qsig_res_local_dissector_table;
+ q932_rose_ctx.err_local_dissector_table = qsig_err_local_dissector_table;
+ }else{
+ q932_rose_ctx.arg_local_dissector_table = etsi_arg_local_dissector_table;
+ q932_rose_ctx.res_local_dissector_table = etsi_res_local_dissector_table;
+ q932_rose_ctx.err_local_dissector_table = etsi_err_local_dissector_table;
+ }
+
+}
+
+/*---------------------------------------------------------------------------*/
diff --git a/epan/dissectors/asn1/q932/packet-q932-template.h b/epan/dissectors/asn1/q932/packet-q932-template.h
new file mode 100644
index 0000000000..24a8b072ad
--- /dev/null
+++ b/epan/dissectors/asn1/q932/packet-q932-template.h
@@ -0,0 +1,30 @@
+/* packet-q932.h
+ * Routines for Q.932 packet dissection
+ * 2007 Tomas Kukosa
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef PACKET_Q932_H
+#define PACKET_Q932_H
+
+#include "packet-q932-exp.h"
+
+#endif /* PACKET_Q932_H */
+
diff --git a/epan/dissectors/asn1/q932/q932.cnf b/epan/dissectors/asn1/q932/q932.cnf
new file mode 100644
index 0000000000..b2dbcb4da0
--- /dev/null
+++ b/epan/dissectors/asn1/q932/q932.cnf
@@ -0,0 +1,32 @@
+# q932.cnf
+# Q.932 conformation file
+# 2007 Tomas Kukosa
+
+#.PDU
+
+InterpretationComponent
+NetworkFacilityExtension
+NetworkProtocolProfile
+
+#.EXPORTS EXTERN
+
+# Addressing-Data-Elements
+PresentedAddressScreened
+PresentedAddressUnscreened
+PresentedNumberScreened WS_DLL
+PresentedNumberUnscreened WS_DLL
+Address
+PartyNumber WS_DLL
+PartySubaddress WS_DLL
+ScreeningIndicator
+PresentationAllowedIndicator
+
+#.FIELD_RENAME
+
+# Addressing-Data-Elements
+PresentedNumberScreened/presentationAllowedNumber presentationAllowedNumberScreened
+PresentedAddressScreened/presentationRestrictedAddress presentationRestrictedAddressScreened
+PresentedNumberScreened/presentationRestrictedNumber presentationRestrictedNumberScreened
+
+#.END
+