FIXUP: WIP: verification_trailer
[wireshark-wip.git] / epan / dissectors / packet-q932.c
blobe2ebb1b91527418b5f2885e4864697de633d7c71
1 /* Do not modify this file. Changes will be overwritten. */
2 /* Generated automatically by the ASN.1 to Wireshark dissector compiler */
3 /* packet-q932.c */
4 /* ../../tools/asn2wrs.py -b -p q932 -c ./q932.cnf -s ./packet-q932-template -D . -O ../../epan/dissectors Addressing-Data-Elements.asn Network-Facility-Extension.asn Network-Protocol-Profile-component.asn Interpretation-component.asn */
6 /* Input file: packet-q932-template.c */
8 #line 1 "../../asn1/q932/packet-q932-template.c"
9 /* packet-q932.c
10 * Routines for Q.932 packet dissection
11 * 2007 Tomas Kukosa
13 * $Id$
15 * Wireshark - Network traffic analyzer
16 * By Gerald Combs <gerald@wireshark.org>
17 * Copyright 1998 Gerald Combs
19 * This program is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU General Public License
21 * as published by the Free Software Foundation; either version 2
22 * of the License, or (at your option) any later version.
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * GNU General Public License for more details.
29 * You should have received a copy of the GNU General Public License
30 * along with this program; if not, write to the Free Software
31 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
34 #include "config.h"
36 #include <epan/packet.h>
37 #include <epan/strutil.h>
38 #include <epan/asn1.h>
39 #include <epan/prefs.h>
41 #include "packet-ber.h"
42 #include "packet-q932.h"
44 #define PNAME "Q.932"
45 #define PSNAME "Q932"
46 #define PFNAME "q932"
48 /* Initialize the protocol and registered fields */
49 static int proto_q932 = -1;
50 static int hf_q932_ie_type = -1;
51 static int hf_q932_ie_len = -1;
52 static int hf_q932_ie_data = -1;
53 static int hf_q932_pp = -1;
54 static int hf_q932_nd = -1;
56 /*--- Included file: packet-q932-hf.c ---*/
57 #line 1 "../../asn1/q932/packet-q932-hf.c"
58 static int hf_q932_NetworkFacilityExtension_PDU = -1; /* NetworkFacilityExtension */
59 static int hf_q932_NetworkProtocolProfile_PDU = -1; /* NetworkProtocolProfile */
60 static int hf_q932_InterpretationComponent_PDU = -1; /* InterpretationComponent */
61 static int hf_q932_presentationAlIowedAddress = -1; /* AddressScreened */
62 static int hf_q932_presentationRestricted = -1; /* NULL */
63 static int hf_q932_numberNotAvailableDueTolnterworking = -1; /* NULL */
64 static int hf_q932_presentationRestrictedAddressScreened = -1; /* AddressScreened */
65 static int hf_q932_presentationAllowedAddress = -1; /* Address */
66 static int hf_q932_presentationRestrictedAddress = -1; /* Address */
67 static int hf_q932_presentationAllowedNumberScreened = -1; /* NumberScreened */
68 static int hf_q932_numberNotAvailableDueToInterworking = -1; /* NULL */
69 static int hf_q932_presentationRestrictedNumberScreened = -1; /* NumberScreened */
70 static int hf_q932_presentationAllowedNumber = -1; /* PartyNumber */
71 static int hf_q932_presentationRestrictedNumber = -1; /* PartyNumber */
72 static int hf_q932_partyNumber = -1; /* PartyNumber */
73 static int hf_q932_screeninglndicator = -1; /* ScreeningIndicator */
74 static int hf_q932_partySubaddress = -1; /* PartySubaddress */
75 static int hf_q932_screeningIndicator = -1; /* ScreeningIndicator */
76 static int hf_q932_unknownPartyNumber = -1; /* NumberDigits */
77 static int hf_q932_publicPartyNumber = -1; /* PublicPartyNumber */
78 static int hf_q932_nsapEncodedNumber = -1; /* NsapEncodedNumber */
79 static int hf_q932_dataPartyNumber = -1; /* NumberDigits */
80 static int hf_q932_telexPartyNumber = -1; /* NumberDigits */
81 static int hf_q932_privatePartyNumber = -1; /* PrivatePartyNumber */
82 static int hf_q932_nationalStandardPartyNumber = -1; /* NumberDigits */
83 static int hf_q932_publicTypeOfNumber = -1; /* PublicTypeOfNumber */
84 static int hf_q932_publicNumberDigits = -1; /* NumberDigits */
85 static int hf_q932_privateTypeOfNumber = -1; /* PrivateTypeOfNumber */
86 static int hf_q932_privateNumberDigits = -1; /* NumberDigits */
87 static int hf_q932_userSpecifiedSubaddress = -1; /* UserSpecifiedSubaddress */
88 static int hf_q932_nSAPSubaddress = -1; /* NSAPSubaddress */
89 static int hf_q932_subaddressInformation = -1; /* SubaddressInformation */
90 static int hf_q932_oddCountIndicator = -1; /* BOOLEAN */
91 static int hf_q932_sourceEntity = -1; /* EntityType */
92 static int hf_q932_sourceEntityAddress = -1; /* AddressInformation */
93 static int hf_q932_destinationEntity = -1; /* EntityType */
94 static int hf_q932_destinationEntityAddress = -1; /* AddressInformation */
96 /*--- End of included file: packet-q932-hf.c ---*/
97 #line 48 "../../asn1/q932/packet-q932-template.c"
99 /* Initialize the subtree pointers */
100 static gint ett_q932 = -1;
101 static gint ett_q932_ie = -1;
103 /*--- Included file: packet-q932-ett.c ---*/
104 #line 1 "../../asn1/q932/packet-q932-ett.c"
105 static gint ett_q932_PresentedAddressScreened = -1;
106 static gint ett_q932_PresentedAddressUnscreened = -1;
107 static gint ett_q932_PresentedNumberScreened = -1;
108 static gint ett_q932_PresentedNumberUnscreened = -1;
109 static gint ett_q932_AddressScreened = -1;
110 static gint ett_q932_NumberScreened = -1;
111 static gint ett_q932_Address = -1;
112 static gint ett_q932_PartyNumber = -1;
113 static gint ett_q932_PublicPartyNumber = -1;
114 static gint ett_q932_PrivatePartyNumber = -1;
115 static gint ett_q932_PartySubaddress = -1;
116 static gint ett_q932_UserSpecifiedSubaddress = -1;
117 static gint ett_q932_NetworkFacilityExtension_U = -1;
119 /*--- End of included file: packet-q932-ett.c ---*/
120 #line 53 "../../asn1/q932/packet-q932-template.c"
122 /* Preferences */
124 /* ROSE context */
125 static rose_ctx_t q932_rose_ctx;
127 dissector_table_t qsig_arg_local_dissector_table;
128 dissector_table_t qsig_res_local_dissector_table;
129 dissector_table_t qsig_err_local_dissector_table;
131 dissector_table_t etsi_arg_local_dissector_table;
132 dissector_table_t etsi_res_local_dissector_table;
133 dissector_table_t etsi_err_local_dissector_table;
135 static gint g_facility_encoding = 0; /* Default to QSIG */
137 void proto_reg_handoff_q932(void);
138 /* Subdissectors */
139 static dissector_handle_t q932_ros_handle;
141 #define Q932_IE_EXTENDED_FACILITY 0x0D
142 #define Q932_IE_FACILITY 0x1C
143 #define Q932_IE_NOTIFICATION_INDICATOR 0x27
144 #define Q932_IE_INFORMATION_REQUEST 0x32
145 #define Q932_IE_FEATURE_ACTIVATION 0x38
146 #define Q932_IE_FEATURE_INDICATION 0x39
147 #define Q932_IE_SERVICE_PROFILE_ID 0x3A
148 #define Q932_IE_ENDPOINT_IDENTIFIER 0x3B
149 static const value_string q932_str_ie_type[] = {
150 { Q932_IE_EXTENDED_FACILITY , "Extended facility" },
151 { Q932_IE_FACILITY , "Facility" },
152 { Q932_IE_NOTIFICATION_INDICATOR, "Notification indicator" },
153 { Q932_IE_INFORMATION_REQUEST, "Information request" },
154 { Q932_IE_FEATURE_ACTIVATION , "Feature activation" },
155 { Q932_IE_FEATURE_INDICATION , "Feature indication" },
156 { Q932_IE_SERVICE_PROFILE_ID , "Service profile identification" },
157 { Q932_IE_ENDPOINT_IDENTIFIER, "Endpoint identifier" },
158 { 0, NULL}
161 static const value_string str_pp[] = {
162 { 0x11 , "Remote Operations Protocol" },
163 { 0x12 , "CMIP Protocol" },
164 { 0x13 , "ACSE Protocol" },
165 { 0x1F , "Networking extensions" },
166 { 0, NULL}
169 static const value_string str_nd[] = {
170 { 0x00 , "User suspended" },
171 { 0x01 , "User resume" },
172 { 0x02 , "Bearer service change" },
173 { 0x04 , "Call completion delay" },
174 { 0x03 , "Discriminator for extension to ASN.1 encoded component" },
175 { 0x40 , "Discriminator for extension to ASN.1 encoded component for ISO" },
176 { 0x42 , "Conference established" },
177 { 0x43 , "Conference disconnected" },
178 { 0x44 , "Other party added" },
179 { 0x45 , "Isolated" },
180 { 0x46 , "Reattached" },
181 { 0x47 , "Other party isolated" },
182 { 0x48 , "Other party reattached" },
183 { 0x49 , "Other party split" },
184 { 0x4A , "Other party disconnected" },
185 { 0x4B , "Conference floating" },
186 { 0x4C , "Conference disconnected, pre-emption" },
187 { 0x4F , "Conference floating, served user pre-empted" },
188 { 0x60 , "Call is a waiting call" },
189 { 0x68 , "Diversion activated" },
190 { 0x69 , "call transferred, alerting" },
191 { 0x6A , "call transferred, answered" },
192 { 0x6E , "reverse charging (whole call)" },
193 { 0x6F , "reverse charging (for the rest of the call)" },
194 { 0x74 , "service profile update" },
195 { 0x79 , "Remote hold" },
196 { 0x7A , "Remote retrieval" },
197 { 0x7B , "Call is diverting" },
198 { 0, NULL}
202 /*--- Included file: packet-q932-fn.c ---*/
203 #line 1 "../../asn1/q932/packet-q932-fn.c"
206 static int
207 dissect_q932_NumberDigits(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
208 offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_NumericString,
209 actx, tree, tvb, offset, hf_index,
210 NULL);
212 return offset;
216 static const value_string q932_PublicTypeOfNumber_vals[] = {
217 { 0, "unknown" },
218 { 1, "internationalNumber" },
219 { 2, "nationalNumber" },
220 { 3, "networkSpecificNumber" },
221 { 4, "subscriberNumber" },
222 { 6, "abbreviatedNumber" },
223 { 0, NULL }
227 static int
228 dissect_q932_PublicTypeOfNumber(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
229 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
230 NULL);
232 return offset;
236 static const ber_sequence_t PublicPartyNumber_sequence[] = {
237 { &hf_q932_publicTypeOfNumber, BER_CLASS_UNI, BER_UNI_TAG_ENUMERATED, BER_FLAGS_NOOWNTAG, dissect_q932_PublicTypeOfNumber },
238 { &hf_q932_publicNumberDigits, BER_CLASS_UNI, BER_UNI_TAG_NumericString, BER_FLAGS_NOOWNTAG, dissect_q932_NumberDigits },
239 { NULL, 0, 0, 0, NULL }
242 static int
243 dissect_q932_PublicPartyNumber(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
244 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
245 PublicPartyNumber_sequence, hf_index, ett_q932_PublicPartyNumber);
247 return offset;
252 static int
253 dissect_q932_NsapEncodedNumber(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
254 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
255 NULL);
257 return offset;
261 static const value_string q932_PrivateTypeOfNumber_vals[] = {
262 { 0, "unknown" },
263 { 1, "level2RegionalNumber" },
264 { 2, "level1RegionalNumber" },
265 { 3, "pTNSpecificNumber" },
266 { 4, "localNumber" },
267 { 6, "abbreviatedNumber" },
268 { 0, NULL }
272 static int
273 dissect_q932_PrivateTypeOfNumber(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
274 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
275 NULL);
277 return offset;
281 static const ber_sequence_t PrivatePartyNumber_sequence[] = {
282 { &hf_q932_privateTypeOfNumber, BER_CLASS_UNI, BER_UNI_TAG_ENUMERATED, BER_FLAGS_NOOWNTAG, dissect_q932_PrivateTypeOfNumber },
283 { &hf_q932_privateNumberDigits, BER_CLASS_UNI, BER_UNI_TAG_NumericString, BER_FLAGS_NOOWNTAG, dissect_q932_NumberDigits },
284 { NULL, 0, 0, 0, NULL }
287 static int
288 dissect_q932_PrivatePartyNumber(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
289 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
290 PrivatePartyNumber_sequence, hf_index, ett_q932_PrivatePartyNumber);
292 return offset;
296 static const ber_choice_t PartyNumber_choice[] = {
297 { 0, &hf_q932_unknownPartyNumber, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_q932_NumberDigits },
298 { 1, &hf_q932_publicPartyNumber, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_q932_PublicPartyNumber },
299 { 2, &hf_q932_nsapEncodedNumber, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_q932_NsapEncodedNumber },
300 { 3, &hf_q932_dataPartyNumber, BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_q932_NumberDigits },
301 { 4, &hf_q932_telexPartyNumber, BER_CLASS_CON, 4, BER_FLAGS_IMPLTAG, dissect_q932_NumberDigits },
302 { 5, &hf_q932_privatePartyNumber, BER_CLASS_CON, 5, BER_FLAGS_IMPLTAG, dissect_q932_PrivatePartyNumber },
303 { 8, &hf_q932_nationalStandardPartyNumber, BER_CLASS_CON, 8, BER_FLAGS_IMPLTAG, dissect_q932_NumberDigits },
304 { 0, NULL, 0, 0, 0, NULL }
308 dissect_q932_PartyNumber(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
309 offset = dissect_ber_choice(actx, tree, tvb, offset,
310 PartyNumber_choice, hf_index, ett_q932_PartyNumber,
311 NULL);
313 return offset;
319 dissect_q932_ScreeningIndicator(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
320 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
321 NULL);
323 return offset;
328 static int
329 dissect_q932_SubaddressInformation(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
330 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
331 NULL);
333 return offset;
338 static int
339 dissect_q932_BOOLEAN(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
340 offset = dissect_ber_boolean(implicit_tag, actx, tree, tvb, offset, hf_index, NULL);
342 return offset;
346 static const ber_sequence_t UserSpecifiedSubaddress_sequence[] = {
347 { &hf_q932_subaddressInformation, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_q932_SubaddressInformation },
348 { &hf_q932_oddCountIndicator, BER_CLASS_UNI, BER_UNI_TAG_BOOLEAN, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_q932_BOOLEAN },
349 { NULL, 0, 0, 0, NULL }
352 static int
353 dissect_q932_UserSpecifiedSubaddress(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
354 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
355 UserSpecifiedSubaddress_sequence, hf_index, ett_q932_UserSpecifiedSubaddress);
357 return offset;
362 static int
363 dissect_q932_NSAPSubaddress(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
364 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
365 NULL);
367 return offset;
371 static const ber_choice_t PartySubaddress_choice[] = {
372 { 0, &hf_q932_userSpecifiedSubaddress, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_q932_UserSpecifiedSubaddress },
373 { 1, &hf_q932_nSAPSubaddress , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_q932_NSAPSubaddress },
374 { 0, NULL, 0, 0, 0, NULL }
378 dissect_q932_PartySubaddress(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
379 offset = dissect_ber_choice(actx, tree, tvb, offset,
380 PartySubaddress_choice, hf_index, ett_q932_PartySubaddress,
381 NULL);
383 return offset;
387 static const ber_sequence_t AddressScreened_sequence[] = {
388 { &hf_q932_partyNumber , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_PartyNumber },
389 { &hf_q932_screeninglndicator, BER_CLASS_UNI, BER_UNI_TAG_ENUMERATED, BER_FLAGS_NOOWNTAG, dissect_q932_ScreeningIndicator },
390 { &hf_q932_partySubaddress, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_PartySubaddress },
391 { NULL, 0, 0, 0, NULL }
394 static int
395 dissect_q932_AddressScreened(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
396 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
397 AddressScreened_sequence, hf_index, ett_q932_AddressScreened);
399 return offset;
404 static int
405 dissect_q932_NULL(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
406 offset = dissect_ber_null(implicit_tag, actx, tree, tvb, offset, hf_index);
408 return offset;
412 static const ber_choice_t PresentedAddressScreened_choice[] = {
413 { 0, &hf_q932_presentationAlIowedAddress, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_q932_AddressScreened },
414 { 1, &hf_q932_presentationRestricted, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_q932_NULL },
415 { 2, &hf_q932_numberNotAvailableDueTolnterworking, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_q932_NULL },
416 { 3, &hf_q932_presentationRestrictedAddressScreened, BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_q932_AddressScreened },
417 { 0, NULL, 0, 0, 0, NULL }
421 dissect_q932_PresentedAddressScreened(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
422 offset = dissect_ber_choice(actx, tree, tvb, offset,
423 PresentedAddressScreened_choice, hf_index, ett_q932_PresentedAddressScreened,
424 NULL);
426 return offset;
430 static const ber_sequence_t Address_sequence[] = {
431 { &hf_q932_partyNumber , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_PartyNumber },
432 { &hf_q932_partySubaddress, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_PartySubaddress },
433 { NULL, 0, 0, 0, NULL }
437 dissect_q932_Address(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
438 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
439 Address_sequence, hf_index, ett_q932_Address);
441 return offset;
445 static const ber_choice_t PresentedAddressUnscreened_choice[] = {
446 { 0, &hf_q932_presentationAllowedAddress, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_q932_Address },
447 { 1, &hf_q932_presentationRestricted, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_q932_NULL },
448 { 2, &hf_q932_numberNotAvailableDueTolnterworking, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_q932_NULL },
449 { 3, &hf_q932_presentationRestrictedAddress, BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_q932_Address },
450 { 0, NULL, 0, 0, 0, NULL }
454 dissect_q932_PresentedAddressUnscreened(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
455 offset = dissect_ber_choice(actx, tree, tvb, offset,
456 PresentedAddressUnscreened_choice, hf_index, ett_q932_PresentedAddressUnscreened,
457 NULL);
459 return offset;
463 static const ber_sequence_t NumberScreened_sequence[] = {
464 { &hf_q932_partyNumber , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_PartyNumber },
465 { &hf_q932_screeningIndicator, BER_CLASS_UNI, BER_UNI_TAG_ENUMERATED, BER_FLAGS_NOOWNTAG, dissect_q932_ScreeningIndicator },
466 { NULL, 0, 0, 0, NULL }
469 static int
470 dissect_q932_NumberScreened(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
471 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
472 NumberScreened_sequence, hf_index, ett_q932_NumberScreened);
474 return offset;
478 static const ber_choice_t PresentedNumberScreened_choice[] = {
479 { 0, &hf_q932_presentationAllowedNumberScreened, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_q932_NumberScreened },
480 { 1, &hf_q932_presentationRestricted, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_q932_NULL },
481 { 2, &hf_q932_numberNotAvailableDueToInterworking, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_q932_NULL },
482 { 3, &hf_q932_presentationRestrictedNumberScreened, BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_q932_NumberScreened },
483 { 0, NULL, 0, 0, 0, NULL }
487 dissect_q932_PresentedNumberScreened(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
488 offset = dissect_ber_choice(actx, tree, tvb, offset,
489 PresentedNumberScreened_choice, hf_index, ett_q932_PresentedNumberScreened,
490 NULL);
492 return offset;
496 static const ber_choice_t PresentedNumberUnscreened_choice[] = {
497 { 0, &hf_q932_presentationAllowedNumber, BER_CLASS_CON, 0, 0, dissect_q932_PartyNumber },
498 { 1, &hf_q932_presentationRestricted, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_q932_NULL },
499 { 2, &hf_q932_numberNotAvailableDueToInterworking, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_q932_NULL },
500 { 3, &hf_q932_presentationRestrictedNumber, BER_CLASS_CON, 3, 0, dissect_q932_PartyNumber },
501 { 0, NULL, 0, 0, 0, NULL }
505 dissect_q932_PresentedNumberUnscreened(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
506 offset = dissect_ber_choice(actx, tree, tvb, offset,
507 PresentedNumberUnscreened_choice, hf_index, ett_q932_PresentedNumberUnscreened,
508 NULL);
510 return offset;
516 dissect_q932_PresentationAllowedIndicator(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
517 offset = dissect_ber_boolean(implicit_tag, actx, tree, tvb, offset, hf_index, NULL);
519 return offset;
523 static const value_string q932_EntityType_vals[] = {
524 { 0, "endPINX" },
525 { 1, "anyTypeOfPINX" },
526 { 0, NULL }
530 static int
531 dissect_q932_EntityType(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
532 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
533 NULL);
535 return offset;
540 static int
541 dissect_q932_AddressInformation(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
542 offset = dissect_q932_PartyNumber(implicit_tag, tvb, offset, actx, tree, hf_index);
544 return offset;
548 static const ber_sequence_t NetworkFacilityExtension_U_sequence[] = {
549 { &hf_q932_sourceEntity , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_q932_EntityType },
550 { &hf_q932_sourceEntityAddress, BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_NOTCHKTAG, dissect_q932_AddressInformation },
551 { &hf_q932_destinationEntity, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_q932_EntityType },
552 { &hf_q932_destinationEntityAddress, BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL|BER_FLAGS_NOTCHKTAG, dissect_q932_AddressInformation },
553 { NULL, 0, 0, 0, NULL }
556 static int
557 dissect_q932_NetworkFacilityExtension_U(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
558 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
559 NetworkFacilityExtension_U_sequence, hf_index, ett_q932_NetworkFacilityExtension_U);
561 return offset;
566 static int
567 dissect_q932_NetworkFacilityExtension(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
568 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
569 hf_index, BER_CLASS_CON, 10, TRUE, dissect_q932_NetworkFacilityExtension_U);
571 return offset;
575 static const value_string q932_NetworkProtocolProfile_U_vals[] = {
576 { 19, "acse" },
577 { 32, "dse" },
578 { 0, NULL }
582 static int
583 dissect_q932_NetworkProtocolProfile_U(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
584 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
585 NULL);
587 return offset;
592 static int
593 dissect_q932_NetworkProtocolProfile(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
594 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
595 hf_index, BER_CLASS_CON, 18, TRUE, dissect_q932_NetworkProtocolProfile_U);
597 return offset;
601 static const value_string q932_InterpretationComponent_U_vals[] = {
602 { 0, "discardAnyUnrecognisedInvokePdu" },
603 { 1, "clearCallIfAnyInvokePduNotRecognised" },
604 { 2, "rejectAnyUnrecognisedInvokePdu" },
605 { 0, NULL }
609 static int
610 dissect_q932_InterpretationComponent_U(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
611 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
612 NULL);
614 return offset;
619 static int
620 dissect_q932_InterpretationComponent(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
621 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
622 hf_index, BER_CLASS_CON, 11, TRUE, dissect_q932_InterpretationComponent_U);
624 return offset;
627 /*--- PDUs ---*/
629 static void dissect_NetworkFacilityExtension_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
630 asn1_ctx_t asn1_ctx;
631 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
632 dissect_q932_NetworkFacilityExtension(FALSE, tvb, 0, &asn1_ctx, tree, hf_q932_NetworkFacilityExtension_PDU);
634 static void dissect_NetworkProtocolProfile_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
635 asn1_ctx_t asn1_ctx;
636 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
637 dissect_q932_NetworkProtocolProfile(FALSE, tvb, 0, &asn1_ctx, tree, hf_q932_NetworkProtocolProfile_PDU);
639 static void dissect_InterpretationComponent_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
640 asn1_ctx_t asn1_ctx;
641 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
642 dissect_q932_InterpretationComponent(FALSE, tvb, 0, &asn1_ctx, tree, hf_q932_InterpretationComponent_PDU);
646 /*--- End of included file: packet-q932-fn.c ---*/
647 #line 134 "../../asn1/q932/packet-q932-template.c"
649 /*--- dissect_q932_facility_ie -------------------------------------------------------*/
650 /*static*/ void
651 dissect_q932_facility_ie(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int length) {
652 gint8 appclass;
653 gboolean pc;
654 gint32 tag;
655 guint32 len;
656 int hoffset, eoffset;
657 int ie_end;
658 tvbuff_t *next_tvb;
660 ie_end = offset + length;
661 proto_tree_add_item(tree, hf_q932_pp, tvb, offset, 1, ENC_BIG_ENDIAN);
662 offset++;
663 while (offset < ie_end) {
664 hoffset = offset;
665 offset = get_ber_identifier(tvb, offset, &appclass, &pc, &tag);
666 offset = get_ber_length(tvb, offset, &len, NULL);
667 eoffset = offset + len;
668 next_tvb = tvb_new_subset(tvb, hoffset, eoffset - hoffset, eoffset - hoffset);
669 switch (appclass) {
670 case BER_CLASS_CON:
671 switch (tag) {
672 case 10 : /* Network Facility Extension */
673 dissect_NetworkFacilityExtension_PDU(next_tvb, pinfo, tree);
674 break;
675 case 18 : /* Network Protocol Profile */
676 dissect_NetworkProtocolProfile_PDU(next_tvb, pinfo, tree);
677 break;
678 case 11 : /* Interpretation Component */
679 dissect_InterpretationComponent_PDU(next_tvb, pinfo, tree);
680 break;
681 /* ROSE APDU */
682 case 1 : /* invoke */
683 case 2 : /* returnResult */
684 case 3 : /* returnError */
685 case 4 : /* reject */
686 q932_rose_ctx.apdu_depth = 1;
687 call_dissector_with_data(q932_ros_handle, next_tvb, pinfo, tree, &q932_rose_ctx);
688 break;
689 /* DSE APDU */
690 case 12 : /* begin */
691 case 14 : /* end */
692 case 15 : /* continue */
693 case 17 : /* abort */
694 offset = dissect_ber_identifier(pinfo, tree, tvb, hoffset, NULL, NULL, NULL);
695 offset = dissect_ber_length(pinfo, tree, tvb, offset, NULL, NULL);
696 proto_tree_add_text(tree, tvb, offset, len, "DSE APDU (not supported)");
697 break;
698 default:
699 offset = dissect_ber_identifier(pinfo, tree, tvb, hoffset, NULL, NULL, NULL);
700 offset = dissect_ber_length(pinfo, tree, tvb, offset, NULL, NULL);
701 proto_tree_add_text(tree, tvb, offset, len, "Unknown Component");
703 break;
704 case BER_CLASS_APP:
705 switch (tag) {
706 /* ACSE APDU */
707 case 0 : /* aarq */
708 case 1 : /* aare */
709 case 2 : /* rlrq */
710 case 3 : /* rlre */
711 case 4 : /* abrt */
712 offset = dissect_ber_identifier(pinfo, tree, tvb, hoffset, NULL, NULL, NULL);
713 offset = dissect_ber_length(pinfo, tree, tvb, offset, NULL, NULL);
714 proto_tree_add_text(tree, tvb, offset, len, "ACSE APDU (not supported)");
715 break;
716 default:
717 offset = dissect_ber_identifier(pinfo, tree, tvb, hoffset, NULL, NULL, NULL);
718 offset = dissect_ber_length(pinfo, tree, tvb, offset, NULL, NULL);
719 proto_tree_add_text(tree, tvb, offset, len, "Unknown Component");
721 break;
722 default:
723 offset = dissect_ber_identifier(pinfo, tree, tvb, hoffset, NULL, NULL, NULL);
724 offset = dissect_ber_length(pinfo, tree, tvb, offset, NULL, NULL);
725 proto_tree_add_text(tree, tvb, offset, len, "Unknown Component");
727 offset = eoffset;
731 /*--- dissect_q932_ni_ie -------------------------------------------------------*/
732 static void
733 dissect_q932_ni_ie(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int length) {
734 int remain = length;
735 guint8 octet = 0;
736 guint32 value = 0;
738 while ((remain > 0) && !(octet & 0x80)) {
739 octet = tvb_get_guint8(tvb, offset++);
740 remain--;
741 value <<= 7;
742 value |= octet & 0x7F;
744 proto_tree_add_uint(tree, hf_q932_nd, tvb, offset - (length - remain), length - remain, value);
746 if (remain > 0) {
747 proto_tree_add_text(tree, tvb, offset - remain, remain, "ASN.1 Encoded Data Structure(NOT IMPLEMENTED): %s", tvb_bytes_to_str(tvb, offset - remain, remain));
751 /*--- dissect_q932_ie -------------------------------------------------------*/
752 static void
753 dissect_q932_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
754 gint offset;
755 proto_item *ti, *ti_ie;
756 proto_tree *ie_tree;
757 guint8 ie_type, ie_len;
759 offset = 0;
761 ti = proto_tree_add_item(tree, proto_q932, tvb, offset, -1, ENC_NA);
762 PROTO_ITEM_SET_HIDDEN(ti);
764 ie_type = tvb_get_guint8(tvb, offset);
765 ie_len = tvb_get_guint8(tvb, offset + 1);
767 ti_ie = proto_tree_add_text(tree, tvb, offset, -1, "%s",
768 val_to_str(ie_type, VALS(q932_str_ie_type), "unknown (0x%02X)"));
769 ie_tree = proto_item_add_subtree(ti_ie, ett_q932_ie);
770 proto_tree_add_item(ie_tree, hf_q932_ie_type, tvb, offset, 1, ENC_BIG_ENDIAN);
771 proto_tree_add_item(ie_tree, hf_q932_ie_len, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
772 offset += 2;
773 if (tvb_length_remaining(tvb, offset) <= 0)
774 return;
775 switch (ie_type) {
776 case Q932_IE_FACILITY :
777 dissect_q932_facility_ie(tvb, offset, pinfo, ie_tree, ie_len);
778 break;
779 case Q932_IE_NOTIFICATION_INDICATOR :
780 dissect_q932_ni_ie(tvb, offset, pinfo, ie_tree, ie_len);
781 break;
782 default:
783 if (ie_len > 0) {
784 if (tree) proto_tree_add_item(ie_tree, hf_q932_ie_data, tvb, offset, ie_len, ENC_NA);
789 /*--- dissect_q932_apdu -----------------------------------------------------*/
790 static void
791 dissect_q932_apdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
792 call_dissector(q932_ros_handle, tvb, pinfo, tree);
795 /*--- proto_register_q932 ---------------------------------------------------*/
796 void proto_register_q932(void) {
798 /* List of fields */
799 static hf_register_info hf[] = {
800 { &hf_q932_ie_type, { "Type", "q932.ie.type",
801 FT_UINT8, BASE_HEX, VALS(q932_str_ie_type), 0x0,
802 "Information Element Type", HFILL }},
803 { &hf_q932_ie_len, { "Length", "q932.ie.len",
804 FT_UINT8, BASE_DEC, NULL, 0x0,
805 "Information Element Length", HFILL }},
806 { &hf_q932_ie_data, { "Data", "q932.ie.data",
807 FT_BYTES, BASE_NONE, NULL, 0x0,
808 NULL, HFILL }},
809 { &hf_q932_pp, { "Protocol profile", "q932.pp",
810 FT_UINT8, BASE_HEX, VALS(str_pp), 0x1F,
811 NULL, HFILL }},
812 { &hf_q932_nd, { "Notification description", "q932.nd",
813 FT_UINT8, BASE_HEX, VALS(str_nd), 0x0,
814 NULL, HFILL }},
816 /*--- Included file: packet-q932-hfarr.c ---*/
817 #line 1 "../../asn1/q932/packet-q932-hfarr.c"
818 { &hf_q932_NetworkFacilityExtension_PDU,
819 { "NetworkFacilityExtension", "q932.NetworkFacilityExtension_element",
820 FT_NONE, BASE_NONE, NULL, 0,
821 NULL, HFILL }},
822 { &hf_q932_NetworkProtocolProfile_PDU,
823 { "NetworkProtocolProfile", "q932.NetworkProtocolProfile",
824 FT_UINT32, BASE_DEC, VALS(q932_NetworkProtocolProfile_U_vals), 0,
825 NULL, HFILL }},
826 { &hf_q932_InterpretationComponent_PDU,
827 { "InterpretationComponent", "q932.InterpretationComponent",
828 FT_UINT32, BASE_DEC, VALS(q932_InterpretationComponent_U_vals), 0,
829 NULL, HFILL }},
830 { &hf_q932_presentationAlIowedAddress,
831 { "presentationAlIowedAddress", "q932.presentationAlIowedAddress_element",
832 FT_NONE, BASE_NONE, NULL, 0,
833 "AddressScreened", HFILL }},
834 { &hf_q932_presentationRestricted,
835 { "presentationRestricted", "q932.presentationRestricted_element",
836 FT_NONE, BASE_NONE, NULL, 0,
837 NULL, HFILL }},
838 { &hf_q932_numberNotAvailableDueTolnterworking,
839 { "numberNotAvailableDueTolnterworking", "q932.numberNotAvailableDueTolnterworking_element",
840 FT_NONE, BASE_NONE, NULL, 0,
841 NULL, HFILL }},
842 { &hf_q932_presentationRestrictedAddressScreened,
843 { "presentationRestrictedAddress", "q932.presentationRestrictedAddress_element",
844 FT_NONE, BASE_NONE, NULL, 0,
845 "AddressScreened", HFILL }},
846 { &hf_q932_presentationAllowedAddress,
847 { "presentationAllowedAddress", "q932.presentationAllowedAddress_element",
848 FT_NONE, BASE_NONE, NULL, 0,
849 "Address", HFILL }},
850 { &hf_q932_presentationRestrictedAddress,
851 { "presentationRestrictedAddress", "q932.presentationRestrictedAddress_element",
852 FT_NONE, BASE_NONE, NULL, 0,
853 "Address", HFILL }},
854 { &hf_q932_presentationAllowedNumberScreened,
855 { "presentationAllowedNumber", "q932.presentationAllowedNumber_element",
856 FT_NONE, BASE_NONE, NULL, 0,
857 "NumberScreened", HFILL }},
858 { &hf_q932_numberNotAvailableDueToInterworking,
859 { "numberNotAvailableDueToInterworking", "q932.numberNotAvailableDueToInterworking_element",
860 FT_NONE, BASE_NONE, NULL, 0,
861 NULL, HFILL }},
862 { &hf_q932_presentationRestrictedNumberScreened,
863 { "presentationRestrictedNumber", "q932.presentationRestrictedNumber_element",
864 FT_NONE, BASE_NONE, NULL, 0,
865 "NumberScreened", HFILL }},
866 { &hf_q932_presentationAllowedNumber,
867 { "presentationAllowedNumber", "q932.presentationAllowedNumber",
868 FT_UINT32, BASE_DEC, VALS(q932_PartyNumber_vals), 0,
869 "PartyNumber", HFILL }},
870 { &hf_q932_presentationRestrictedNumber,
871 { "presentationRestrictedNumber", "q932.presentationRestrictedNumber",
872 FT_UINT32, BASE_DEC, VALS(q932_PartyNumber_vals), 0,
873 "PartyNumber", HFILL }},
874 { &hf_q932_partyNumber,
875 { "partyNumber", "q932.partyNumber",
876 FT_UINT32, BASE_DEC, VALS(q932_PartyNumber_vals), 0,
877 NULL, HFILL }},
878 { &hf_q932_screeninglndicator,
879 { "screeninglndicator", "q932.screeninglndicator",
880 FT_UINT32, BASE_DEC, VALS(q932_ScreeningIndicator_vals), 0,
881 "ScreeningIndicator", HFILL }},
882 { &hf_q932_partySubaddress,
883 { "partySubaddress", "q932.partySubaddress",
884 FT_UINT32, BASE_DEC, VALS(q932_PartySubaddress_vals), 0,
885 NULL, HFILL }},
886 { &hf_q932_screeningIndicator,
887 { "screeningIndicator", "q932.screeningIndicator",
888 FT_UINT32, BASE_DEC, VALS(q932_ScreeningIndicator_vals), 0,
889 NULL, HFILL }},
890 { &hf_q932_unknownPartyNumber,
891 { "unknownPartyNumber", "q932.unknownPartyNumber",
892 FT_STRING, BASE_NONE, NULL, 0,
893 "NumberDigits", HFILL }},
894 { &hf_q932_publicPartyNumber,
895 { "publicPartyNumber", "q932.publicPartyNumber_element",
896 FT_NONE, BASE_NONE, NULL, 0,
897 NULL, HFILL }},
898 { &hf_q932_nsapEncodedNumber,
899 { "nsapEncodedNumber", "q932.nsapEncodedNumber",
900 FT_BYTES, BASE_NONE, NULL, 0,
901 NULL, HFILL }},
902 { &hf_q932_dataPartyNumber,
903 { "dataPartyNumber", "q932.dataPartyNumber",
904 FT_STRING, BASE_NONE, NULL, 0,
905 "NumberDigits", HFILL }},
906 { &hf_q932_telexPartyNumber,
907 { "telexPartyNumber", "q932.telexPartyNumber",
908 FT_STRING, BASE_NONE, NULL, 0,
909 "NumberDigits", HFILL }},
910 { &hf_q932_privatePartyNumber,
911 { "privatePartyNumber", "q932.privatePartyNumber_element",
912 FT_NONE, BASE_NONE, NULL, 0,
913 NULL, HFILL }},
914 { &hf_q932_nationalStandardPartyNumber,
915 { "nationalStandardPartyNumber", "q932.nationalStandardPartyNumber",
916 FT_STRING, BASE_NONE, NULL, 0,
917 "NumberDigits", HFILL }},
918 { &hf_q932_publicTypeOfNumber,
919 { "publicTypeOfNumber", "q932.publicTypeOfNumber",
920 FT_UINT32, BASE_DEC, VALS(q932_PublicTypeOfNumber_vals), 0,
921 NULL, HFILL }},
922 { &hf_q932_publicNumberDigits,
923 { "publicNumberDigits", "q932.publicNumberDigits",
924 FT_STRING, BASE_NONE, NULL, 0,
925 "NumberDigits", HFILL }},
926 { &hf_q932_privateTypeOfNumber,
927 { "privateTypeOfNumber", "q932.privateTypeOfNumber",
928 FT_UINT32, BASE_DEC, VALS(q932_PrivateTypeOfNumber_vals), 0,
929 NULL, HFILL }},
930 { &hf_q932_privateNumberDigits,
931 { "privateNumberDigits", "q932.privateNumberDigits",
932 FT_STRING, BASE_NONE, NULL, 0,
933 "NumberDigits", HFILL }},
934 { &hf_q932_userSpecifiedSubaddress,
935 { "userSpecifiedSubaddress", "q932.userSpecifiedSubaddress_element",
936 FT_NONE, BASE_NONE, NULL, 0,
937 NULL, HFILL }},
938 { &hf_q932_nSAPSubaddress,
939 { "nSAPSubaddress", "q932.nSAPSubaddress",
940 FT_BYTES, BASE_NONE, NULL, 0,
941 NULL, HFILL }},
942 { &hf_q932_subaddressInformation,
943 { "subaddressInformation", "q932.subaddressInformation",
944 FT_BYTES, BASE_NONE, NULL, 0,
945 NULL, HFILL }},
946 { &hf_q932_oddCountIndicator,
947 { "oddCountIndicator", "q932.oddCountIndicator",
948 FT_BOOLEAN, BASE_NONE, NULL, 0,
949 "BOOLEAN", HFILL }},
950 { &hf_q932_sourceEntity,
951 { "sourceEntity", "q932.sourceEntity",
952 FT_UINT32, BASE_DEC, VALS(q932_EntityType_vals), 0,
953 "EntityType", HFILL }},
954 { &hf_q932_sourceEntityAddress,
955 { "sourceEntityAddress", "q932.sourceEntityAddress",
956 FT_UINT32, BASE_DEC, VALS(q932_PartyNumber_vals), 0,
957 "AddressInformation", HFILL }},
958 { &hf_q932_destinationEntity,
959 { "destinationEntity", "q932.destinationEntity",
960 FT_UINT32, BASE_DEC, VALS(q932_EntityType_vals), 0,
961 "EntityType", HFILL }},
962 { &hf_q932_destinationEntityAddress,
963 { "destinationEntityAddress", "q932.destinationEntityAddress",
964 FT_UINT32, BASE_DEC, VALS(q932_PartyNumber_vals), 0,
965 "AddressInformation", HFILL }},
967 /*--- End of included file: packet-q932-hfarr.c ---*/
968 #line 302 "../../asn1/q932/packet-q932-template.c"
971 /* List of subtrees */
972 static gint *ett[] = {
973 &ett_q932,
974 &ett_q932_ie,
976 /*--- Included file: packet-q932-ettarr.c ---*/
977 #line 1 "../../asn1/q932/packet-q932-ettarr.c"
978 &ett_q932_PresentedAddressScreened,
979 &ett_q932_PresentedAddressUnscreened,
980 &ett_q932_PresentedNumberScreened,
981 &ett_q932_PresentedNumberUnscreened,
982 &ett_q932_AddressScreened,
983 &ett_q932_NumberScreened,
984 &ett_q932_Address,
985 &ett_q932_PartyNumber,
986 &ett_q932_PublicPartyNumber,
987 &ett_q932_PrivatePartyNumber,
988 &ett_q932_PartySubaddress,
989 &ett_q932_UserSpecifiedSubaddress,
990 &ett_q932_NetworkFacilityExtension_U,
992 /*--- End of included file: packet-q932-ettarr.c ---*/
993 #line 309 "../../asn1/q932/packet-q932-template.c"
996 module_t *q932_module;
998 static const enum_val_t facility_encoding[] = {
999 {"Facility as QSIG", "Dissect facility as QSIG", 0},
1000 {"Facility as ETSI", "Dissect facility as ETSI", 1},
1001 {NULL, NULL, -1}
1004 /* Register protocol and dissector */
1005 proto_q932 = proto_register_protocol(PNAME, PSNAME, PFNAME);
1006 register_dissector("q932.apdu", dissect_q932_apdu, proto_q932);
1008 /* Register fields and subtrees */
1009 proto_register_field_array(proto_q932, hf, array_length(hf));
1010 proto_register_subtree_array(ett, array_length(ett));
1012 rose_ctx_init(&q932_rose_ctx);
1014 /* Register dissector tables */
1015 q932_rose_ctx.arg_global_dissector_table = register_dissector_table("q932.ros.global.arg", "Q.932 Operation Argument (global opcode)", FT_STRING, BASE_NONE);
1016 q932_rose_ctx.res_global_dissector_table = register_dissector_table("q932.ros.global.res", "Q.932 Operation Result (global opcode)", FT_STRING, BASE_NONE);
1017 q932_rose_ctx.err_global_dissector_table = register_dissector_table("q932.ros.global.err", "Q.932 Error (global opcode)", FT_STRING, BASE_NONE);
1019 qsig_arg_local_dissector_table = register_dissector_table("q932.ros.local.arg", "Q.932 Operation Argument (local opcode)", FT_UINT32, BASE_HEX);
1020 qsig_res_local_dissector_table = register_dissector_table("q932.ros.local.res", "Q.932 Operation Result (local opcode)", FT_UINT32, BASE_HEX);
1021 qsig_err_local_dissector_table = register_dissector_table("q932.ros.local.err", "Q.932 Error (local opcode)", FT_UINT32, BASE_HEX);
1023 etsi_arg_local_dissector_table = register_dissector_table("q932.ros.etsi.local.arg", "Q.932 ETSI Operation Argument (local opcode)", FT_UINT32, BASE_HEX);
1024 etsi_res_local_dissector_table = register_dissector_table("q932.ros.etsi.local.res", "Q.932 ETSI Operation Result (local opcode)", FT_UINT32, BASE_HEX);
1025 etsi_err_local_dissector_table = register_dissector_table("q932.ros.etsi.local.err", "Q.932 ETSI Error (local opcode)", FT_UINT32, BASE_HEX);
1027 q932_module = prefs_register_protocol(proto_q932, proto_reg_handoff_q932);
1029 prefs_register_enum_preference(q932_module, "facility_encoding",
1030 "Type of Facility encoding",
1031 "Type of Facility encoding",
1032 &g_facility_encoding, facility_encoding, FALSE);
1035 /*--- proto_reg_handoff_q932 ------------------------------------------------*/
1036 void proto_reg_handoff_q932(void) {
1037 dissector_handle_t q932_ie_handle;
1039 static gboolean q931_prefs_initialized = FALSE;
1041 if (!q931_prefs_initialized) {
1042 q932_ie_handle = create_dissector_handle(dissect_q932_ie, proto_q932);
1043 /* Facility */
1044 dissector_add_uint("q931.ie", (0x00 << 8) | Q932_IE_FACILITY, q932_ie_handle);
1045 /* Notification indicator */
1046 dissector_add_uint("q931.ie", (0x00 << 8) | Q932_IE_NOTIFICATION_INDICATOR, q932_ie_handle);
1047 q932_ros_handle = find_dissector("q932.ros");
1050 if(g_facility_encoding == 0){
1051 q932_rose_ctx.arg_local_dissector_table = qsig_arg_local_dissector_table;
1052 q932_rose_ctx.res_local_dissector_table = qsig_res_local_dissector_table;
1053 q932_rose_ctx.err_local_dissector_table = qsig_err_local_dissector_table;
1054 }else{
1055 q932_rose_ctx.arg_local_dissector_table = etsi_arg_local_dissector_table;
1056 q932_rose_ctx.res_local_dissector_table = etsi_res_local_dissector_table;
1057 q932_rose_ctx.err_local_dissector_table = etsi_err_local_dissector_table;
1062 /*---------------------------------------------------------------------------*/