c42c2c6940921e27b96fed559ec023e65133f59c
[metze/wireshark/wip.git] / epan / dissectors / packet-ansi_map.c
1 /* packet-ansi_map.c
2  * Routines for ANSI 41 Mobile Application Part (IS41 MAP) dissection
3  * Specications from 3GPP2 (www.3gpp2.org)
4  *
5  * Copyright 2003, Michael Lum <mlum [AT] telostech.com>
6  * In association with Telos Technology Inc.
7  *
8  * Should be very close to what ANSI/TIA/EIA-41-E will be as most known
9  * changes have been added:  i.e. IS-778, IS-751, IS-725, IS-841, ...
10  *
11  * Title                3GPP2                   Other
12  *
13  *   Cellular Radiotelecommunications Intersystem Operations
14  *                      3GPP2 N.S0005-0         ANSI/TIA/EIA-41-D
15  *
16  *   Network Support for MDN-Based Message Centers
17  *                      3GPP2 N.S0024-0 v1.0    IS-841
18  *
19  *   Enhanced International Calling
20  *                      3GPP2 N.S0027           IS-875
21  *
22  *   E-911 Phase 2
23  *                      3GPP2 N.S0030           J-STD-036-A
24  *      XXX Teleservice_Priority not implemented, no parameter ID given!
25  *
26  *   ANSI-41-D Miscellaneous Enhancements Revision 0
27  *                      3GPP2 N.S0015           PN-3590 (ANSI-41-E)
28  *
29  *   TIA/EIA-41-D Internationalization
30  *                      3GPP2 N.S0016-0 v1.0
31  *
32  *   Authentication Enhancements
33  *                      3GPP2 N.S0014-0 v1.0    IS-778
34  *
35  *   PCS Multi-band-Based on IS-41C
36  *                      3GPP2 N.S0006-0 v1.0    TIA/EIA TSB-76
37  *
38  *   Roamer Database Verification Revision B
39  *                      3GPP2 N.S0025-B v1.0    IS-947 (aka IS-847 ?)
40  *      XXX InvokingNEType not implemented, no parameter ID given!
41  *
42  *   Features In CDMA
43  *                      3GPP2 N.S0010-0 v1.0    IS-735
44  *
45  *   TIA/EIA-41-D Based Network Enhancements for CDMA Packet Data Service (C-PDS), Phase 1
46  *                      3GPP2 N.S0029-0 v1.0    IS-880
47  *
48  *   OTASP and OTAPA
49  *                      3GPP2 N.S0011-0 v1.0    IS-725-A
50  *
51  *   Circuit Mode Services
52  *                      3GPP2 N.S0008-0 v1.0    IS-737
53  *      XXX SecondInterMSCCircuitID not implemented, parameter ID conflicts with ISLP Information!
54  *
55  *   IMSI
56  *                      3GPP2 N.S0009-0 v1.0    IS-751
57  *
58  *   WIN Phase 1
59  *                      3GPP2 N.S0013-0 v1.0    IS-771
60  *
61  *   WIN Phase 2
62  *                      3GPP2 N.S0004-0 v1.0    IS-848
63  *
64  *   TIA/EIA-41-D Pre-Paid Charging
65  *                      3GPP2 N.S0018-0 v1.0    IS-826
66  *
67  *   User Selective Call Forwarding
68  *                      3GPP2 N.S0021-0 v1.0    IS-838
69  *
70  *   CNAP/CNAR
71  *                      3GPP2 N.S0012-0 v1.0
72  *
73  *   Answer Hold
74  *                      3GPP2 N.S0022-0 v1.0    IS-837
75  *
76  *   Automatic Code Gapping
77  *                      3GPP2 N.S0023-0 v1.0
78  *
79  *   UIM
80  *                      3GPP2 N.S0003
81  *
82  * $Id$
83  *
84  * Ethereal - Network traffic analyzer
85  * By Gerald Combs <gerald@ethereal.com>
86  * Copyright 1998 Gerald Combs
87  *
88  * This program is free software; you can redistribute it and/or
89  * modify it under the terms of the GNU General Public License
90  * as published by the Free Software Foundation; either version 2
91  * of the License, or (at your option) any later version.
92  *
93  * This program is distributed in the hope that it will be useful,
94  * but WITHOUT ANY WARRANTY; without even the implied warranty of
95  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
96  * GNU General Public License for more details.
97  *
98  * You should have received a copy of the GNU General Public License
99  * along with this program; if not, write to the Free Software
100  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
101  */
102
103 #ifdef HAVE_CONFIG_H
104 # include "config.h"
105 #endif
106
107 #include <stdio.h>
108 #include <stdlib.h>
109
110 #include <string.h>
111
112 #include "epan/packet.h"
113 #include <epan/asn1.h>
114 #include <epan/tap.h>
115 #include <epan/emem.h>
116
117 #include "packet-ansi_a.h"
118 #include "packet-ansi_map.h"
119 #include "packet-tcap.h"
120
121 /* PROTOTYPES/FORWARDS */
122
123 static gboolean dissect_ansi_param(ASN1_SCK *asn1, proto_tree *tree);
124
125 /* ANSI PARAM STRINGS */
126 static const value_string ansi_param_1_strings[] = {
127     { 0x81,     "Billing ID" },
128     { 0x82,     "Serving Cell ID" },
129     { 0x83,     "Target Cell ID" },
130     { 0x84,     "Digits" },
131     { 0x85,     "Channel Data" },
132     { 0x86,     "Inter MSC Circuit ID" },
133     { 0x87,     "Inter Switch Count" },
134     { 0x88,     "Mobile Identification Number" },
135     { 0x89,     "Electronic Serial Number" },
136     { 0x8A,     "Release Reason" },
137     { 0x8B,     "Signal Quality" },
138     { 0x8C,     "Station Class Mark" },
139     { 0x8D,     "Authorization Denied" },
140     { 0x8E,     "Authorization Period" },
141     { 0x8F,     "Seizure Type" },
142     { 0x90,     "Trunk Status" },
143     { 0x91,     "Qualification Information Code" },
144     { 0x92,     "Feature Result" },
145     { 0x93,     "Redirection Reason" },
146     { 0x94,     "Access Denied Reason" },
147     { 0x95,     "MSCID" },
148     { 0x96,     "System My Type Code" },
149     { 0x97,     "Origination Indicator" },
150     { 0x98,     "Termination Restriction Code" },
151     { 0x99,     "Calling Features Indicator" },
152     { 0x9A,     "Faulty Parameter" },
153     { 0x9B,     "Usage Indicator" },
154     { 0x9C,     "TDMA Channel Data" },
155     { 0x9D,     "TDMA Call Mode" },
156     { 0x9E,     "Handoff Reason" },
157     { 0, NULL },
158 };
159
160 static const value_string ansi_param_2_strings[] = {
161     { 0x9F1F,   "TDMA Burst Indicator" },
162     { 0x9F20,   "PC_SSN" },
163     { 0x9F21,   "Location Area ID" },
164     { 0x9F22,   "System Access Type" },
165     { 0x9F23,   "Authentication Response" },
166     { 0x9F24,   "Authentication Response Base Station" },
167     { 0x9F25,   "Authentication Response Unique Challenge" },
168     { 0x9F26,   "Call History Count" },
169     { 0x9F27,   "Confidentiality Modes" },
170     { 0x9F28,   "Random Variable" },
171     { 0x9F29,   "Random Variable Base Station" },
172     { 0x9F2A,   "Random Variable SSD" },
173     { 0x9F2B,   "Random Variable Unique Challenge" },
174     { 0x9F2C,   "Report Type" },
175     { 0x9F2D,   "Signaling Message Encryption Key" },
176     { 0x9F2E,   "Shared Secret Data" },
177     { 0x9F2F,   "Terminal Type" },
178     { 0x9F30,   "Voice Privacy Mask" },
179     { 0x9F31,   "System Capabilities" },
180     { 0x9F32,   "Deny Access" },
181     { 0x9F33,   "Update Count" },
182     { 0x9F34,   "SSD Not Shared" },
183     { 0x9F35,   "Extended MSCID" },
184     { 0x9F36,   "Extended System My Type Code" },
185     { 0x9F37,   "Control Channel Data" },
186     { 0x9F38,   "System Access Data" },
187     { 0x9F39,   "Cancellation Denied" },
188     { 0x9F3A,   "Border Cell Access" },
189     { 0x9F3B,   "CDMA Station Class Mark" },
190     { 0x9F3C,   "CDMA Serving One Way Delay" },
191     { 0x9F3D,   "CDMA Target One Way Delay" },
192     { 0x9F3E,   "CDMA Call Mode" },
193     { 0x9F3F,   "CDMA Channel Data" },
194     { 0x9F40,   "CDMA Signal Quality" },
195     { 0x9F41,   "CDMA Pilot Strength" },
196     { 0x9F42,   "CDMA Mobile Protocol Revision" },
197     { 0x9F43,   "CDMA Private Long Code Mask" },
198     { 0x9F44,   "CDMA Code Channel" },
199     { 0x9F45,   "CDMA Search Window" },
200     { 0x9F46,   "MS Location" },
201     { 0x9F47,   "Page Indicator" },
202     { 0x9F48,   "Received Signal Quality" },
203     { 0x9F49,   "Deregistration Type" },
204     { 0x9F4A,   "NAMPS Channel Data" },
205     { 0x9F4B,   "Alert Code" },
206     { 0x9F4C,   "Announcement Code" },
207     { 0x9F4D,   "Authentication Algorithm Version" },
208     { 0x9F4E,   "Authentication Capability" },
209     { 0x9F4F,   "Call History Count Expected" },
210     { 0x9F50,   "Calling Party Number Digits 1" },
211     { 0x9F51,   "Calling Party Number Digits 2" },
212     { 0x9F52,   "Calling Party Number String 1" },
213     { 0x9F53,   "Calling Party Number String 2" },
214     { 0x9F54,   "Calling Party Subaddress" },
215     { 0x9F55,   "Cancellation Type" },
216     { 0x9F56,   "Carrier Digits" },
217     { 0x9F57,   "Destination Digits" },
218     { 0x9F58,   "DMH Redirection Indicator" },
219     { 0xBF59,   "Inter System Termination" },
220     { 0x9F5A,   "Availability Type" },
221     { 0xBF5B,   "Local Termination" },
222     { 0x9F5C,   "Message Waiting Notification Count" },
223     { 0x9F5D,   "Mobile Directory Number" },
224     { 0x9F5E,   "MSCID Number" },
225     { 0xBF5F,   "PSTN Termination" },
226     { 0x9F60,   "No Answer Time" },
227     { 0x9F61,   "One Time Feature Indicator" },
228     { 0x9F62,   "Origination Triggers" },
229     { 0x9F63,   "RANDC" },
230     { 0x9F64,   "Redirecting Number Digits" },
231     { 0x9F65,   "Redirecting Number String" },
232     { 0x9F66,   "Redirecting Subaddress" },
233     { 0x9F67,   "Sender Identification Number" },
234     { 0x9F68,   "SMS Address" },
235     { 0x9F69,   "SMS Bearer Data" },
236     { 0x9F6A,   "SMS Charge Indicator" },
237     { 0x9F6B,   "SMS Destination Address" },
238     { 0x9F6C,   "SMS Message Count" },
239     { 0x9F6D,   "SMS Notification Indicator" },
240     { 0x9F6E,   "SMS Original Destination Address" },
241     { 0x9F6F,   "SMS Original Destination Subaddress" },
242     { 0x9F70,   "SMS Original Originating Address" },
243     { 0x9F71,   "SMS Original Originating Subaddress" },
244     { 0x9F72,   "SMS Originating Address" },
245     { 0x9F73,   "SMS Originating Restrictions" },
246     { 0x9F74,   "SMS Teleservice Identifier" },
247     { 0x9F75,   "SMS Termination Restrictions" },
248     { 0x9F76,   "SMS Message Waiting Indicator" },
249     { 0x9F77,   "Termination Access Type" },
250     { 0xBF78,   "Termination List" },
251     { 0x9F79,   "Termination Treatment" },
252     { 0x9F7A,   "Termination Triggers" },
253     { 0x9F7B,   "Transaction Capability" },
254     { 0x9F7C,   "Unique Challenge Report" },
255     { 0, NULL },
256 };
257
258 static const value_string ansi_param_3_strings[] = {
259     { 0x9F8100, "Action Code" },
260     { 0x9F8101, "Alert Result" },
261     { 0xBF8102, "Announcement List" },
262     { 0xBF8103, "CDMA Code Channel Information" },
263     { 0xBF8104, "CDMA Code Channel List" },
264     { 0xBF8105, "CDMA Target Measurement Information" },
265     { 0xBF8106, "CDMA Target Measurement List" },
266     { 0xBF8107, "CDMA Target MAHO Information" },
267     { 0xBF8108, "CDMA Target MAHO List" },
268     { 0x9F8109, "Conference Calling Indicator" },
269     { 0x9F810A, "Count Update Report" },
270     { 0x9F810B, "Digit Collection Control" },
271     { 0x9F810C, "DMH Account Code Digits" },
272     { 0x9F810D, "DMH Alternate Billing Digits" },
273     { 0x9F810E, "DMH Billing Digits" },
274     { 0x9F810F, "Geographic Authorization" },
275     { 0x9F8110, "Leg Information" },
276     { 0x9F8111, "Message Waiting Notification Type" },
277     { 0x9F8112, "PACA Indicator" },
278     { 0x9F8113, "Preferred Language Indicator" },
279     { 0x9F8114, "Random Valid Time" },
280     { 0x9F8115, "Restriction Digits" },
281     { 0x9F8116, "Routing Digits" },
282     { 0x9F8117, "Setup Result" },
283     { 0x9F8118, "SMS Access Denied Reason" },
284     { 0x9F8119, "SMS Cause Code" },
285     { 0x9F811A, "SPINI PIN" },
286     { 0x9F811B, "SPINI Triggers" },
287     { 0x9F811C, "SSD Update Report" },
288     { 0xBF811D, "Target Measurement Information" },
289     { 0xBF811E, "Target Measurement List" },
290     { 0x9F811F, "Voice Mailbox PIN" },
291     { 0x9F8120, "Voice Mailbox Number" },
292     { 0x9F8121, "Authentication Data" },
293     { 0x9F8122, "Conditionally Denied Reason" },
294     { 0x9F8123, "Group Information" },
295     { 0x9F8124, "Handoff State" },
296     { 0x9F8125, "NAMPS Call Mode" },
297     { 0x9F8126, "CDMA Slot Cycle Index" },
298     { 0x9F8127, "Denied Authorization Period" },
299     { 0x9F8128, "Pilot Number" },
300     { 0x9F8129, "Pilot Billing ID" },
301     { 0x9F812A, "CDMA Band Class" },
302     { 0xBF812B, "CDMA Band Class Information" },
303     { 0xBF812C, "CDMA Band Class List" },
304     { 0x9F812D, "CDMA Pilot PN" },
305     { 0x9F812E, "CDMA Service Configuration Record" },
306     { 0x9F812F, "CDMA Service Option" },
307     { 0xBF8130, "CDMA Service Option List" },
308     { 0x9F8131, "CDMA Station Class Mark 2" },
309     { 0x9F8132, "TDMA Service Code" },
310     { 0x9F8133, "TDMA Terminal Capability" },
311     { 0x9F8134, "TDMA Voice Coder" },
312     { 0x9F8135, "A-Key Protocol Version" },
313     { 0x9F8136, "Authentication Response Reauthentication" },
314     { 0x9F8137, "Base Station Partial Key" },
315     { 0x9F8138, "Mobile Station MIN" },
316     { 0x9F8139, "Mobile Station Partial Key" },
317     { 0x9F813A, "Modulus Value" },
318     { 0x9F813B, "Newly Assigned MIN" },
319     { 0x9F813D, "OTASP Result Code" },
320     { 0x9F813E, "Primitive Value" },
321     { 0x9F813F, "Random Variable Reauthentication" },
322     { 0x9F8140, "Reauthentication Report" },
323     { 0x9F8141, "Service Indicator" },
324     { 0x9F8142, "Signaling Message Encryption Report" },
325     { 0x9F8143, "Temporary Reference Number" },
326     { 0x9F8144, "Voice Privacy Report" },
327     { 0x9F8145, "Base Station Manufacturer Code" },
328     { 0x9F8146, "BSMC Status" },
329     { 0x9F8147, "Control Channel Mode" },
330     { 0x9F8148, "Non Public Data" },
331     { 0x9F8149, "Paging Frame Class" },
332     { 0x9F814A, "PSID RSID Information" },
333     { 0xBF814B, "PSID RSID List" },
334     { 0x9F814C, "Services Result" },
335     { 0x9F814D, "SOC Status" },
336     { 0x9F814E, "System Operator Code" },
337     { 0xBF814F, "Target Cell ID List" },
338     { 0x9F8150, "User Group" },
339     { 0x9F8151, "User Zone Data" },
340     { 0x9F8152, "CDMA Connection Reference" },
341     { 0xBF8153, "CDMA Connection Reference Information" },
342     { 0xBF8154, "CDMA Connection Reference List" },
343     { 0x9F8155, "CDMA State" },
344     { 0x9F8156, "Change Service Attributes" },
345     { 0x9F8157, "Data Key" },
346     { 0x9F8158, "Data Privacy Parameters" },
347     { 0x9F8159, "ISLP Information" }, /* IS-737 *SPEC CONFLICT* */
348     { 0x9F815A, "Reason List" },
349     { 0x9F815B, "Second Inter MSC Circuit ID" },
350     { 0x9F815C, "TDMA Bandwidth" },
351     { 0x9F815D, "TDMA Data Features Indicator" },
352     { 0x9F815E, "TDMA Data Mode" },
353     { 0x9F815F, "TDMA Voice Mode" },
354     { 0x9F8160, "Analog Redirect Info" },
355     { 0xBF8161, "Analog Redirect Record" },
356     { 0x9F8162, "CDMA Channel Number" },
357     { 0xBF8163, "CDMA Channel Number List" },
358     { 0xBF8164, "CDMA Power Combined Indicator" },
359     { 0x9F8165, "CDMA Redirect Record" },
360     { 0x9F8166, "CDMA Search Parameters" },
361     { 0x9F8168, "CDMA Network Identification" },
362     { 0x9F8169, "Network TMSI" },
363     { 0x9F816A, "Network TMSI Expiration Time" },
364     { 0x9F816B, "New Network TMSI" },
365     { 0x9F816C, "Required Parameters Mask" },
366     { 0x9F816D, "Service Redirection Cause" },
367     { 0x9F816E, "Service Redirection Info" },
368     { 0x9F816F, "Roaming Indication" },
369     { 0x9F8170, "Emergency Services Routing Digits" },
370     { 0x9F8171, "Special Handling" },
371     { 0x9F8172, "International Mobile Subscriber Identity" },
372     { 0x9F8173, "Calling Party Name" },
373     { 0x9F8174, "Display Text" },
374     { 0x9F8175, "Redirecting Party Name" },
375     { 0x9F8176, "Service ID" },
376     { 0x9F8177, "All Or None" },
377     { 0x9F8178, "Change" },
378     { 0xBF8179, "Data Access Element" },
379     { 0xBF817A, "Data Access Element List" },
380     { 0x9F817B, "Data ID" },
381     { 0x9F817C, "Database Key" },
382     { 0x9F817D, "Data Result" },
383     { 0xBF817E, "Data Update Result" },
384     { 0xBF817F, "Data Update Result List" },
385     { 0x9F8200, "Data Value" },
386     { 0xBF8202, "Execute Script" },
387     { 0x9F8203, "Failure Cause" },
388     { 0x9F8204, "Failure Type" },
389     { 0x9F8205, "Global Title" },
390     { 0xBF8206, "Modification Request" },
391     { 0xBF8207, "Modification Request List" },
392     { 0xBF8208, "Modification Result List" },
393     { 0x9F8209, "Private Specialized Resource" },
394     { 0x9F820B, "Script Argument" },
395     { 0x9F820C, "Script Name" },
396     { 0x9F820D, "Script Result" },
397     { 0xBF820E, "Service Data Access Element" },
398     { 0xBF820F, "Service Data Access Element List" },
399     { 0xBF8210, "Service Data Result" },
400     { 0xBF8211, "Service Data Result List" },
401     { 0x9F8212, "Specialized Resource" },
402     { 0x9F8213, "Time Date Offset" },
403     { 0xBF8214, "Trigger Address List" },
404     { 0x9F8215, "Trigger Capability" },
405     { 0xBF8216, "Trigger List" },
406     { 0x9F8217, "Trigger Type" },
407     { 0xBF8218, "WIN Capability" },
408     { 0x9F8219, "WIN Operations Capability" },
409     { 0x9F821B, "WIN Trigger List" },
410     { 0x9F821C, "MSC Address" },
411     { 0x9F821D, "Suspicious Access" },
412     { 0x9F821E, "Mobile Station IMSI" },
413     { 0x9F821F, "Newly Assigned IMSI" },
414     { 0x9F822A, "Command Code" },
415     { 0x9F822B, "Display Text 2" },
416     { 0x9F822C, "Page Count" },
417     { 0x9F822D, "Page Response Time" },
418     { 0x9F822E, "SMS Transaction ID" },
419     { 0x9F823C, "CAVE Key" },
420     { 0x9F8241, "CDMA2000 Mobile Supported Capabilities" },
421     { 0x9F8245, "Enhanced Privacy Encryption Report" },
422     { 0x9F8246, "Inter Message Time" },
423     { 0x9F8247, "MSID Usage" },
424     { 0x9F8248, "New MIN Extension" },
425     { 0x9F825C, "QoS Priority" },
426     { 0x9F825F, "CDMA MS Measured Channel Identity" },
427     { 0x9F8264, "CDMA2000 Handoff Invoke IOS Data" },
428     { 0x9F8265, "CDMA2000 Handoff Response IOS Data" },
429     { 0x9F8304, "MIN Extension" },
430
431     { 0xBF822F, "Call Recovery ID" },
432     { 0xBF8230, "Call Recovery ID List" },
433     { 0xBF8250, "Position Information" },
434     { 0xBF825A, "CDMA PSMM List" },
435     { 0x9F820A, "Resume PIC" },
436     { 0x9F8231, "DMH Service ID" },
437     { 0x9F8232, "Feature Indicator" },
438     { 0x9F8233, "Control Network ID" },
439     { 0x9F8234, "Release Cause" },
440     { 0x9F8235, "Time Of Day" },
441     { 0x9F8236, "Call Status" },
442     { 0x9F8237, "DMH Charge Information" },
443     { 0x9F8238, "DMH Billing Indicator" },
444     { 0x9F8239, "MS Status" },
445     { 0x9F823B, "Position Information Code" },
446     { 0x9F8249, "DTX Indication" },
447     { 0x9F824A, "CDMA Mobile Capabilities" },
448     { 0x9F824B, "Generalized Time" },
449     { 0x9F824C, "Generic Digits" },
450     { 0x9F824D, "Geographic Position" },
451     { 0x9F824E, "Mobile Call Status" },
452     { 0x9F824F, "Mobile Position Capability" },
453     { 0x9F8251, "Position Request Type" },
454     { 0x9F8252, "Position Result" },
455     { 0x9F8253, "Position Source" },
456     { 0x9F8254, "ACG Encountered" },
457     { 0x9F8255, "Control Type" },
458     { 0x9F8256, "Gap Duration" },
459     { 0x9F8257, "SCF Overload Gap Interval" },
460     { 0x9F8258, "Service Management System Gap Interval" },
461     { 0x9F8259, "CDMA PSMM Count" },
462     { 0x9F825B, "CDMA Serving One Way Delay 2" },
463     { 0x9F825D, "PDSN Address" },
464     { 0x9F825E, "PDSN Protocol Type" },
465     { 0x9F8261, "Range" },
466     { 0x9F8263, "Calling Party Category" },
467     { 0x9F8266, "LCS Client ID" },
468     { 0x9F8267, "TDMA MAHO Cell ID" },
469     { 0x9F8268, "TDMA MAHO Channel" },
470     { 0x9F8269, "CDMA Service Option Connection Identifier" },
471     { 0x9F826A, "TDMA Time Alignment" },
472     { 0x9F826C, "TDMA MAHO Request" },
473     { 0, NULL },
474 };
475
476 /* ANSI TCAP component type */
477 #define ANSI_TC_INVOKE_L 0xe9
478 #define ANSI_TC_RRL 0xea
479 #define ANSI_TC_RE 0xeb
480 #define ANSI_TC_REJECT 0xec
481 #define ANSI_TC_INVOKE_N 0xed
482 #define ANSI_TC_RRN 0xee
483
484 static const value_string ansi_cmp_type_strings[] = {
485     { ANSI_TC_INVOKE_L,         "Invoke(Last)" },
486     { ANSI_TC_RRL,              "RetRes(Last)" },
487     { ANSI_TC_RE,               "RetErr" },
488     { ANSI_TC_REJECT,           "Reject" },
489     { ANSI_TC_INVOKE_N,         "Invoke(Not Last)" },
490     { ANSI_TC_RRN,              "RetRes(Not Last)" },
491     { 0, NULL },
492 };
493
494 const value_string ansi_map_opr_code_strings[] = {
495     { 1,        "Handoff Measurement Request" },
496     { 2,        "Facilities Directive" },
497     { 3,        "Mobile On Channel" },
498     { 4,        "Handoff Back" },
499     { 5,        "Facilities Release" },
500     { 6,        "Qualification Request" },
501     { 7,        "Qualification Directive" },
502     { 8,        "Blocking" },
503     { 9,        "Unblocking" },
504     { 10,       "Reset Circuit" },
505     { 11,       "Trunk Test" },
506     { 12,       "Trunk Test Disconnect" },
507     { 13,       "Registration Notification" },
508     { 14,       "Registration Cancellation" },
509     { 15,       "Location Request" },
510     { 16,       "Routing Request" },
511     { 17,       "Feature Request" },
512     { 18,       "Reserved 18 (Service Profile Request, IS-41-C)" },
513     { 19,       "Reserved 19 (Service Profile Directive, IS-41-C)" },
514     { 20,       "Unreliable Roamer Data Directive" },
515     { 21,       "Reserved 21 (Call Data Request, IS-41-C)" },
516     { 22,       "MS Inactive" },
517     { 23,       "Transfer To Number Request" },
518     { 24,       "Redirection Request" },
519     { 25,       "Handoff To Third" },
520     { 26,       "Flash Request" },
521     { 27,       "Authentication Directive" },
522     { 28,       "Authentication Request" },
523     { 29,       "Base Station Challenge" },
524     { 30,       "Authentication Failure Report" },
525     { 31,       "Count Request" },
526     { 32,       "Inter System Page" },
527     { 33,       "Unsolicited Response" },
528     { 34,       "Bulk Deregistration" },
529     { 35,       "Handoff Measurement Request 2" },
530     { 36,       "Facilities Directive 2" },
531     { 37,       "Handoff Back 2" },
532     { 38,       "Handoff To Third 2" },
533     { 39,       "Authentication Directive Forward" },
534     { 40,       "Authentication Status Report" },
535     { 41,       "Reserved 41" },
536     { 42,       "Information Directive" },
537     { 43,       "Information Forward" },
538     { 44,       "Inter System Answer" },
539     { 45,       "Inter System Page 2" },
540     { 46,       "Inter System Setup" },
541     { 47,       "Origination Request" },
542     { 48,       "Random Variable Request" },
543     { 49,       "Redirection Directive" },
544     { 50,       "Remote User Interaction Directive" },
545     { 51,       "SMS Delivery Backward" },
546     { 52,       "SMS Delivery Forward" },
547     { 53,       "SMS Delivery Point to Point" },
548     { 54,       "SMS Notification" },
549     { 55,       "SMS Request" },
550     { 56,       "OTASP Request" },
551     { 57,       "Information Backward" },
552     { 58,       "Change Facilities" },
553     { 59,       "Change Service" },
554     { 60,       "Parameter Request" },
555     { 61,       "TMSI Directive" },
556     { 62,       "Reserved 62" },
557     { 63,       "Service Request" },
558     { 64,       "Analyzed Information Request" },
559     { 65,       "Connection Failure Report" },
560     { 66,       "Connect Resource" },
561     { 67,       "Disconnect Resource" },
562     { 68,       "Facility Selected and Available" },
563     { 69,       "Instruction Request" },
564     { 70,       "Modify" },
565     { 71,       "Reset Timer" },
566     { 72,       "Search" },
567     { 73,       "Seize Resource" },
568     { 74,       "SRF Directive" },
569     { 75,       "T Busy" },
570     { 76,       "T NoAnswer" },
571     { 77,       "Release" },
572     { 78,       "SMS Delivery Point to Point Ack" },
573     { 79,       "Message Directive" },
574     { 80,       "Bulk Disconnection" },
575     { 81,       "Call Control Directive" },
576     { 82,       "O Answer" },
577     { 83,       "O Disconnect" },
578     { 84,       "Call Recovery Report" },
579     { 85,       "T Answer" },
580     { 86,       "T Disconnect" },
581     { 87,       "Unreliable Call Data" },
582     { 88,       "O CalledPartyBusy" },
583     { 89,       "O NoAnswer" },
584     { 90,       "Position Request" },
585     { 91,       "Position Request Forward" },
586     { 92,       "Call Termination Report" },
587     { 93,       "Geo Position Directive" },
588     { 94,       "Geo Position Request" },
589     { 95,       "Inter System Position Request" },
590     { 96,       "Inter System Position Request Forward" },
591     { 97,       "ACG Directive" },
592     { 98,       "Roamer Database Verification Request" },
593     { 99,       "Add Service" },
594     { 100,      "Drop Service" },
595     { 0, NULL },
596 };
597
598 static const value_string ansi_tele_strings[] = {
599     { 1,        "Reserved for maintenance" },
600     { 4096,     "AMPS Extended Protocol Enhanced Services" },
601     { 4097,     "CDMA Cellular Paging Teleservice" },
602     { 4098,     "CDMA Cellular Messaging Teleservice" },
603     { 4099,     "CDMA Voice Mail Notification" },
604     { 32513,    "TDMA Cellular Messaging Teleservice" },
605     { 32520,    "TDMA System Assisted Mobile Positioning through Satellite (SAMPS)" },
606     { 32584,    "TDMA Segmented System Assisted Mobile Positioning Service" },
607     { 0, NULL },
608 };
609
610 #define NUM_BAND_CLASS_STR      (sizeof(band_class_str)/sizeof(gchar *))
611 static const gchar *band_class_str[] = {
612     "800 MHz Cellular System",
613     "1.850 to 1.990 GHz Broadband PCS",
614     "872 to 960 MHz TACS Band",
615     "832 to 925 MHz JTACS Band",
616     "1.750 to 1.870 GHz Korean PCS",
617     "450 MHz NMT",
618     "2 GHz IMT-2000 Band",
619     "North American 700 MHz Cellular Band",
620     "1.710 to 1.880 GHz PCS",
621     "880 to 960 MHz Band",
622     "Secondary 800 MHz Band",
623     "400 MHz European PAMR Band",
624     "800 MHz European PAMR Band"
625 };
626
627 #define NUM_QOS_PRI_STR         (sizeof(qos_pri_str)/sizeof(gchar *))
628 static const gchar *qos_pri_str[] = {
629     "Priority Level 0.  This is the lowest level",
630     "Priority Level 1",
631     "Priority Level 2",
632     "Priority Level 3",
633     "Priority Level 4",
634     "Priority Level 5",
635     "Priority Level 6",
636     "Priority Level 7",
637     "Priority Level 8",
638     "Priority Level 9",
639     "Priority Level 10",
640     "Priority Level 11",
641     "Priority Level 12",
642     "Priority Level 13",
643     "Reserved, treat as Priority Level 14",
644     "Reserved, treat as Priority Level 15"
645 };
646
647 /*
648  * would prefer to have had the define set to the exact number of
649  * elements in the array but that is not without it's own problems
650  * (sizeof(ansi_a_ios401_elem_1_strings)/sizeof(value_string))
651  */
652 #define NUM_IOS401_ELEM ANSI_A_MAX_NUM_IOS401_ELEM_1_STRINGS
653 static gint ett_ansi_map_ios401_elem[NUM_IOS401_ELEM];
654
655
656 /* Initialize the protocol and registered fields */
657 static int proto_ansi_map = -1;
658
659 static int ansi_map_tap = -1;
660
661 static int hf_ansi_map_tag = -1;
662 static int hf_ansi_map_length = -1;
663 static int hf_ansi_map_id = -1;
664 static int hf_ansi_map_opr_code = -1;
665 static int hf_ansi_map_param_id = -1;
666 static int hf_ansi_map_ios401_elem_id = -1;
667 static int hf_ansi_map_min = -1;
668 static int hf_ansi_map_number = -1;
669
670 static int hf_ansi_map_billing_id = -1;
671
672 /* Initialize the subtree pointers */
673 static gint ett_ansi_map = -1;
674 static gint ett_opr_code = -1;
675 static gint ett_component = -1;
676 static gint ett_components = -1;
677 static gint ett_params = -1;
678 static gint ett_param = -1;
679 static gint ett_error = -1;
680 static gint ett_problem = -1;
681 static gint ett_natnum = -1;
682 static gint ett_call_mode = -1;
683 static gint ett_chan_data = -1;
684 static gint ett_code_chan = -1;
685 static gint ett_clr_dig_mask = -1;
686 static gint ett_ent_dig_mask = -1;
687 static gint ett_all_dig_mask = -1;
688
689
690 static char bigbuf[1024];
691 static dissector_handle_t data_handle;
692 static dissector_table_t is637_tele_id_dissector_table; /* IS-637 Teleservice ID */
693 static dissector_table_t is683_dissector_table; /* IS-683-A (OTA) */
694 static dissector_table_t is801_dissector_table; /* IS-801 (PLD) */
695 static packet_info *g_pinfo;
696 static proto_tree *g_tree;
697 static gint32 ansi_map_sms_tele_id = -1;
698 static gboolean is683_ota;
699 static gboolean is801_pld;
700 static gboolean ansi_map_is_invoke;
701 static tvbuff_t *bd_tvb;
702
703
704 typedef struct dgt_set_t
705 {
706     unsigned char out[15];
707 }
708 dgt_set_t;
709
710 static dgt_set_t Dgt_tbcd = {
711     {
712   /*  0   1   2   3   4   5   6   7   8   9   a   b   c   d   e */
713      '0','1','2','3','4','5','6','7','8','9','?','B','C','*','#'
714     }
715 };
716
717 static dgt_set_t Dgt_msid = {
718     {
719   /*  0   1   2   3   4   5   6   7   8   9   a   b   c   d   e */
720      '0','1','2','3','4','5','6','7','8','9','?','?','?','?','?'
721     }
722 };
723
724 /* FUNCTIONS */
725
726 /*
727  * Unpack BCD input pattern into output ASCII pattern
728  *
729  * Input Pattern is supplied using the same format as the digits
730  *
731  * Returns: length of unpacked pattern
732  */
733 static int
734 my_dgt_tbcd_unpack(
735     char        *out,           /* ASCII pattern out */
736     guchar      *in,            /* packed pattern in */
737     int         num_octs,       /* Number of octets to unpack */
738     dgt_set_t   *dgt            /* Digit definitions */
739     )
740 {
741     int cnt = 0;
742     unsigned char i;
743
744     while (num_octs)
745     {
746         /*
747          * unpack first value in byte
748          */
749         i = *in++;
750         *out++ = dgt->out[i & 0x0f];
751         cnt++;
752
753         /*
754          * unpack second value in byte
755          */
756         i >>= 4;
757
758         if (i == 0x0f)  /* odd number bytes - hit filler */
759             break;
760
761         *out++ = dgt->out[i];
762         cnt++;
763         num_octs--;
764     }
765
766     *out = '\0';
767
768     return(cnt);
769 }
770
771 /* PARAM FUNCTIONS */
772
773 #define EXTRANEOUS_DATA_CHECK(edc_len, edc_max_len) \
774     if ((edc_len) > (edc_max_len)) \
775     { \
776         proto_tree_add_text(tree, asn1->tvb, \
777             asn1->offset, (edc_len) - (edc_max_len), "Extraneous Data"); \
778         asn1->offset += ((edc_len) - (edc_max_len)); \
779     }
780
781 #define SHORT_DATA_CHECK(sdc_len, sdc_min_len) \
782     if ((sdc_len) < (sdc_min_len)) \
783     { \
784         proto_tree_add_text(tree, asn1->tvb, \
785             asn1->offset, (sdc_len), "Short Data (?)"); \
786         asn1->offset += (sdc_len); \
787         return; \
788     }
789
790 #define EXACT_DATA_CHECK(edc_len, edc_eq_len) \
791     if ((edc_len) != (edc_eq_len)) \
792     { \
793         proto_tree_add_text(tree, asn1->tvb, \
794             asn1->offset, (edc_len), "Unexpected Data Length"); \
795         asn1->offset += (edc_len); \
796         return; \
797     }
798
799 static void
800 param_mscid(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
801 {
802     gint32 market_id, switch_num;
803     guint saved_offset;
804
805     EXACT_DATA_CHECK(len, 3);
806
807     saved_offset = asn1->offset;
808
809     asn1_int32_value_decode(asn1, 2, &market_id);
810     asn1_int32_value_decode(asn1, 1, &switch_num);
811
812     proto_tree_add_text(tree, asn1->tvb,
813         saved_offset, asn1->offset - saved_offset,
814         "Market ID %u  Switch Number %u",
815         market_id, switch_num);
816 }
817
818 static void
819 param_page_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
820 {
821     gint32 value;
822     guint saved_offset;
823     const gchar *str = NULL;
824
825     saved_offset = asn1->offset;
826
827     asn1_int32_value_decode(asn1, 1, &value);
828
829     switch (value)
830     {
831     case 0: str = "Not used"; break;
832     case 1: str = "Page"; break;
833     case 2: str = "Listen only"; break;
834     default:
835         if ((value >= 3) && (value <= 223)) { str = "Reserved, treat as Page"; }
836         else { str = "Reserved for protocol extension, treat as Page"; }
837         break;
838     }
839
840     proto_tree_add_text(tree, asn1->tvb,
841         saved_offset, asn1->offset - saved_offset,
842         str);
843
844     EXTRANEOUS_DATA_CHECK(len, 1);
845 }
846
847 static void
848 param_srvc_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
849 {
850     gint32 value;
851     guint saved_offset;
852     const gchar *str = NULL;
853
854     EXACT_DATA_CHECK(len, 1);
855
856     saved_offset = asn1->offset;
857
858     asn1_int32_value_decode(asn1, 1, &value);
859
860     switch (value)
861     {
862     case 0: str = "Undefined Service"; break;
863     case 1: str = "CDMA OTASP Service"; is683_ota = TRUE; break;
864     case 2: str = "TDMA OTASP Service"; break;
865     case 3: str = "CDMA OTAPA Service"; is683_ota = TRUE; break;
866     case 4: str = "CDMA Position Determination Service";  is801_pld = TRUE; break;
867     case 5: str = "AMPS Position Determination Service"; break;
868     default:
869         if ((value >= 6) && (value <= 223)) { str = "Reserved, treat as Undefined Service"; }
870         else { str = "Reserved for protocol extension, treat as Undefined Service"; }
871         break;
872     }
873
874     proto_tree_add_text(tree, asn1->tvb,
875         saved_offset, asn1->offset - saved_offset,
876         "%s (%u)",
877         str,
878         value);
879 }
880
881 static void
882 param_sme_report(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
883 {
884     gint32 value;
885     guint saved_offset;
886     const gchar *str = NULL;
887
888     EXACT_DATA_CHECK(len, 1);
889
890     saved_offset = asn1->offset;
891
892     asn1_int32_value_decode(asn1, 1, &value);
893
894     switch (value)
895     {
896     case 0: str = "Not used"; break;
897     case 1: str = "Signaling Message Encryption enabling not attempted"; break;
898     case 2: str = "Signaling Message Encryption enabling no response"; break;
899     case 3: str = "Signaling Message Encryption is enabled"; break;
900     case 4: str = "Signaling Message Encryption enabling failed"; break;
901     default:
902         if ((value >= 5) && (value <= 223)) { str = "Reserved, treat as Signaling Message Encryption enabling not attempted"; }
903         else { str = "Reserved for protocol extension, treat as Signaling Message Encryption enabling not attempted"; }
904         break;
905     }
906
907     proto_tree_add_text(tree, asn1->tvb,
908         saved_offset, asn1->offset - saved_offset,
909         "%s (%u)",
910         str,
911         value);
912 }
913
914 static void
915 param_alert_code(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
916 {
917     gint32 value;
918     guint saved_offset;
919     const gchar *str = NULL;
920
921     SHORT_DATA_CHECK(len, 2);
922
923     saved_offset = asn1->offset;
924
925     asn1_int32_value_decode(asn1, 1, &value);
926
927     switch ((value & 0xc0) >> 6)
928     {
929     case 0: str = "Medium"; break;
930     case 1: str = "High"; break;
931     case 2: str = "Low"; break;
932     case 3: str = "Reserved"; break;
933     }
934
935     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
936     proto_tree_add_text(tree, asn1->tvb,
937         saved_offset, asn1->offset - saved_offset,
938         "%s :  Pitch, %s",
939         bigbuf,
940         str);
941
942     switch (value & 0x3f)
943     {
944     case 0: str = "NoTone"; break;
945     case 1: str = "Long"; break;
946     case 2: str = "ShortShort"; break;
947     case 3: str = "ShortShortLong"; break;
948     case 4: str = "ShortShort2"; break;
949     case 5: str = "ShortLongShort"; break;
950     case 6: str = "ShortShortShortShort"; break;
951     case 7: str = "PBXLong"; break;
952     case 8: str = "PBXShortShort"; break;
953     case 9: str = "PBXShortShortLong"; break;
954     case 10: str = "PBXShortLongShort"; break;
955     case 11: str = "PBXShortShortShortShort"; break;
956     case 12: str = "PipPipPipPip"; break;
957     default:
958         str = "Reserved, treat as NoTone";
959         break;
960     }
961
962     other_decode_bitfield_value(bigbuf, value, 0x3f, 8);
963     proto_tree_add_text(tree, asn1->tvb,
964         saved_offset, asn1->offset - saved_offset,
965         "%s :  Cadence, %s",
966         bigbuf,
967         str);
968
969     saved_offset = asn1->offset;
970
971     asn1_int32_value_decode(asn1, 1, &value);
972
973     other_decode_bitfield_value(bigbuf, value, 0xf8, 8);
974     proto_tree_add_text(tree, asn1->tvb,
975         saved_offset, asn1->offset - saved_offset,
976         "%s :  Reserved",
977         bigbuf);
978
979     switch (value & 0x07)
980     {
981     case 0: str = "Alert without waiting to report"; break;
982     case 1: str = "Apply a reminder alert once"; break;
983     default:
984         str = "Reserved, treat as Alert without waiting to report";
985         break;
986     }
987
988     other_decode_bitfield_value(bigbuf, value, 0x07, 8);
989     proto_tree_add_text(tree, asn1->tvb,
990         saved_offset, asn1->offset - saved_offset,
991         "%s :  Alert Action, %s",
992         bigbuf,
993         str);
994
995     EXTRANEOUS_DATA_CHECK(len, 2);
996 }
997
998 static void
999 param_term_acc_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
1000 {
1001     gint32 value;
1002     guint saved_offset;
1003     const gchar *str = NULL;
1004
1005     saved_offset = asn1->offset;
1006
1007     asn1_int32_value_decode(asn1, 1, &value);
1008
1009     switch (value)
1010     {
1011     case 0: str = "Not used"; break;
1012     case 252: str = "Mobile-to-Mobile Directory Number access"; break;
1013     case 253: str = "Land-to-Mobile Directory Number access"; break;
1014     case 254: str = "Land-to-Mobile Directory Number access"; break;
1015     case 255: str = "Roamer port access"; break;
1016     default:
1017         if ((value >= 1) && (value <= 127)) { str = "Reserved for controlling system assignment"; }
1018         else if ((value >= 128) && (value <= 160)) { str = "Reserved for protocol extension, treat as Land-to-Mobile Directory Number access"; }
1019         else { str = "Reserved"; }
1020         break;
1021     }
1022
1023     proto_tree_add_text(tree, asn1->tvb,
1024         saved_offset, asn1->offset - saved_offset,
1025         str);
1026
1027     EXTRANEOUS_DATA_CHECK(len, 1);
1028 }
1029
1030 static void
1031 param_term_treat(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
1032 {
1033     gint32 value;
1034     guint saved_offset;
1035     const gchar *str = NULL;
1036
1037     saved_offset = asn1->offset;
1038
1039     asn1_int32_value_decode(asn1, 1, &value);
1040
1041     switch (value)
1042     {
1043     case 0: str = "Not used"; break;
1044     case 1: str = "MS Termination"; break;
1045     case 2: str = "Voice Mail Storage"; break;
1046     case 3: str = "Voice Mail Retrieval"; break;
1047     case 4: str = "Dialogue Termination"; break;
1048     default:
1049         if ((value >= 5) && (value <= 223)) { str = "Reserved, treat as Unrecognized parameter value"; }
1050         else { str = "Reserved for protocol extension, treat as Unrecognized parameter value"; }
1051         break;
1052     }
1053
1054     proto_tree_add_text(tree, asn1->tvb,
1055         saved_offset, asn1->offset - saved_offset,
1056         str);
1057
1058     EXTRANEOUS_DATA_CHECK(len, 1);
1059 }
1060
1061 static void
1062 param_term_trig(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
1063 {
1064     gint32 value;
1065     guint saved_offset;
1066     const gchar *str = NULL;
1067
1068     SHORT_DATA_CHECK(len, 2);
1069
1070     saved_offset = asn1->offset;
1071
1072     asn1_int32_value_decode(asn1, 1, &value);
1073
1074     switch ((value & 0xc0) >> 6)
1075     {
1076     case 0: str = "No Answer Call"; break;
1077     case 1: str = "No Answer Trigger"; break;
1078     case 2: str = "No Answer Leg"; break;
1079     case 3: str = "Reserved"; break;
1080     }
1081
1082     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
1083     proto_tree_add_text(tree, asn1->tvb,
1084         saved_offset, asn1->offset - saved_offset,
1085         "%s :  No Answer (NA), %s",
1086         bigbuf,
1087         str);
1088
1089     switch ((value & 0x30) >> 4)
1090     {
1091     case 0: str = "No Page Response Call"; break;
1092     case 1: str = "No Page Response Trigger"; break;
1093     case 2: str = "No Page Response Leg"; break;
1094     case 3: str = "Reserved"; break;
1095     }
1096
1097     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
1098     proto_tree_add_text(tree, asn1->tvb,
1099         saved_offset, asn1->offset - saved_offset,
1100         "%s :  No Page Response (NPR), %s",
1101         bigbuf,
1102         str);
1103
1104     switch ((value & 0x0c) >> 2)
1105     {
1106     case 0: str = "Failed Call"; break;
1107     case 1: str = "Routing Failure Trigger"; break;
1108     case 2: str = "Failed Leg"; break;
1109     case 3: str = "Reserved"; break;
1110     }
1111
1112     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
1113     proto_tree_add_text(tree, asn1->tvb,
1114         saved_offset, asn1->offset - saved_offset,
1115         "%s :  Routing Failure (RF), %s",
1116         bigbuf,
1117         str);
1118
1119     switch (value & 0x03)
1120     {
1121     case 0: str = "Busy Call"; break;
1122     case 1: str = "Busy Trigger"; break;
1123     case 2: str = "Busy Leg"; break;
1124     case 3: str = "Reserved"; break;
1125     }
1126
1127     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
1128     proto_tree_add_text(tree, asn1->tvb,
1129         saved_offset, asn1->offset - saved_offset,
1130         "%s :  Busy, %s",
1131         bigbuf,
1132         str);
1133
1134     saved_offset = asn1->offset;
1135
1136     asn1_int32_value_decode(asn1, 1, &value);
1137
1138     other_decode_bitfield_value(bigbuf, value, 0xfe, 8);
1139     proto_tree_add_text(tree, asn1->tvb,
1140         saved_offset, asn1->offset - saved_offset,
1141         "%s :  Reserved",
1142         bigbuf);
1143
1144     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
1145     proto_tree_add_text(tree, asn1->tvb,
1146         saved_offset, asn1->offset - saved_offset,
1147         "%s :  None Reachable (NR), %s",
1148         bigbuf,
1149         (value & 0x01) ? "Group Not Reachable" : "Member Not Reachable");
1150
1151     EXTRANEOUS_DATA_CHECK(len, 2);
1152 }
1153
1154 static void
1155 param_aav(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
1156 {
1157     gint32 value;
1158     guint saved_offset;
1159
1160     saved_offset = asn1->offset;
1161
1162     asn1_int32_value_decode(asn1, 1, &value);
1163
1164     proto_tree_add_text(tree, asn1->tvb,
1165         saved_offset, asn1->offset - saved_offset,
1166         "Value as used in the CAVE algorithm (%u)",
1167         value);
1168
1169     EXTRANEOUS_DATA_CHECK(len, 1);
1170 }
1171
1172 static void
1173 param_ann_code(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
1174 {
1175     gint32 value;
1176     guint saved_offset;
1177     const gchar *str = NULL;
1178
1179     SHORT_DATA_CHECK(len, 3);
1180
1181     saved_offset = asn1->offset;
1182
1183     asn1_int32_value_decode(asn1, 1, &value);
1184
1185     switch (value)
1186     {
1187     case 0: str = "Dialtone"; break;
1188     case 1: str = "Ringback or Audible Alerting"; break;
1189     case 2: str = "Intercept or Mobile Reorder"; break;
1190     case 3: str = "Congestion or Reorder"; break;
1191     case 4: str = "Busy"; break;
1192     case 5: str = "Confirmation"; break;
1193     case 6: str = "Answer"; break;
1194     case 7: str = "Call Waiting"; break;
1195     case 8: str = "Offhook"; break;
1196     case 17: str = "Recall Dial"; break;
1197     case 18: str = "Barge In"; break;
1198     case 20: str = "PPC Insufficient"; break;
1199     case 21: str = "PPC Warning 1"; break;
1200     case 22: str = "PPC Warning 2"; break;
1201     case 23: str = "PPC Warning 3"; break;
1202     case 24: str = "PPC Disconnect"; break;
1203     case 25: str = "PPC Redirect"; break;
1204     case 63: str = "Tones Off"; break;
1205     case 192: str = "Pip"; break;
1206     case 193: str = "Abbreviated Intercept"; break;
1207     case 194: str = "Abbreviated Congestion"; break;
1208     case 195: str = "Warning"; break;
1209     case 196: str = "Denial Tone Burst"; break;
1210     case 197: str = "Dial Tone Burst"; break;
1211     case 250: str = "Incoming Additional Call"; break;
1212     case 251: str = "Priority Additional Call"; break;
1213     default:
1214         str = "Reserved, treat as Tones Off";
1215         break;
1216     }
1217
1218     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
1219     proto_tree_add_text(tree, asn1->tvb,
1220         saved_offset, asn1->offset - saved_offset,
1221         "%s :  Tone %u, %s",
1222         bigbuf,
1223         value,
1224         str);
1225
1226     saved_offset = asn1->offset;
1227
1228     asn1_int32_value_decode(asn1, 1, &value);
1229
1230     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
1231     proto_tree_add_text(tree, asn1->tvb,
1232         saved_offset, asn1->offset - saved_offset,
1233         "%s :  Reserved",
1234         bigbuf);
1235
1236     switch (value & 0x0f)
1237     {
1238     case 0: str = "Concurrent"; break;
1239     case 1: str = "Sequential"; break;
1240     default:
1241         if ((value >= 2) && (value <= 7)) { str = "Reserved, treat as Concurrent"; }
1242         else { str = "Reserved, treat as Sequential"; }
1243         break;
1244     }
1245
1246     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
1247     proto_tree_add_text(tree, asn1->tvb,
1248         saved_offset, asn1->offset - saved_offset,
1249         "%s :  Class %s",
1250         bigbuf,
1251         str);
1252
1253     saved_offset = asn1->offset;
1254
1255     asn1_int32_value_decode(asn1, 1, &value);
1256
1257     switch (value)
1258     {
1259     case 0: str = "None"; break;
1260     case 1: str = "Unauthorized User"; break;
1261     case 2: str = "Invalid ESN"; break;
1262     case 3: str = "Unauthorized Mobile"; break;
1263     case 4: str = "Suspended Origination"; break;
1264     case 5: str = "Origination Denied"; break;
1265     case 6: str = "Service Area Denial"; break;
1266     case 16: str = "Partial Dial"; break;
1267     case 17: str = "Require 1 Plus"; break;
1268     case 18: str = "Require 1 Plus NPA"; break;
1269     case 19: str = "Require 0 Plus"; break;
1270     case 20: str = "Require 0 Plus NPA"; break;
1271     case 21: str = "Deny 1 Plus"; break;
1272     case 22: str = "Unsupported 10 plus"; break;
1273     case 23: str = "Deny 10 plus"; break;
1274     case 24: str = "Unsupported 10 XXX"; break;
1275     case 25: str = "Deny 10 XXX"; break;
1276     case 26: str = "Deny 10 XXX Locally"; break;
1277     case 27: str = "Require 10 Plus"; break;
1278     case 28: str = "Require NPA"; break;
1279     case 29: str = "Deny Toll Origination"; break;
1280     case 30: str = "Deny International Origination"; break;
1281     case 31: str = "Deny 0 Minus"; break;
1282     case 48: str = "Deny Number"; break;
1283     case 49: str = "Alternate Operator Services"; break;
1284     case 64: str = "No Circuit or All Circuits Busy or FacilityProblem"; break;
1285     case 65: str = "Overload"; break;
1286     case 66: str = "Internal Office Failure"; break;
1287     case 67: str = "No Wink Received"; break;
1288     case 68: str = "Interoffice Link Failure"; break;
1289     case 69: str = "Vacant"; break;
1290     case 70: str = "Invalid Prefix or Invalid Access Code"; break;
1291     case 71: str = "Other Dialing Irregularity"; break;
1292     case 80: str = "Vacant Number or Disconnected Number"; break;
1293     case 81: str = "Deny Termination"; break;
1294     case 82: str = "Suspended Termination"; break;
1295     case 83: str = "Changed Number"; break;
1296     case 84: str = "Inaccessible Subscriber"; break;
1297     case 85: str = "Deny Incoming Toll"; break;
1298     case 86: str = "Roamer Access Screening"; break;
1299     case 87: str = "Refuse Call"; break;
1300     case 88: str = "Redirect Call"; break;
1301     case 89: str = "No Page Response"; break;
1302     case 90: str = "No Answer"; break;
1303     case 96: str = "Roamer Intercept"; break;
1304     case 97: str = "General Information"; break;
1305     case 112: str = "Unrecognized Feature Code"; break;
1306     case 113: str = "Unauthorized Feature Code"; break;
1307     case 114: str = "Restricted Feature Code"; break;
1308     case 115: str = "Invalid Modifier Digits"; break;
1309     case 116: str = "Successful Feature Registration"; break;
1310     case 117: str = "Successful Feature Deregistration"; break;
1311     case 118: str = "Successful Feature Activation"; break;
1312     case 119: str = "Successful Feature Deactivation"; break;
1313     case 120: str = "Invalid Forward To Number"; break;
1314     case 121: str = "Courtesy Call Warning"; break;
1315     case 128: str = "Enter PIN Send Prompt"; break;
1316     case 129: str = "Enter PIN Prompt"; break;
1317     case 130: str = "Reenter PIN Send Prompt"; break;
1318     case 131: str = "Reenter PIN Prompt"; break;
1319     case 132: str = "Enter Old PIN Send Prompt"; break;
1320     case 133: str = "Enter Old PIN Prompt"; break;
1321     case 134: str = "Enter New PIN Send Prompt"; break;
1322     case 135: str = "Enter New PIN Prompt"; break;
1323     case 136: str = "Reenter New PIN Send Prompt"; break;
1324     case 137: str = "Reenter New PIN Prompt"; break;
1325     case 138: str = "Enter Password Prompt"; break;
1326     case 139: str = "Enter Directory Number Prompt"; break;
1327     case 140: str = "Reenter Directory Number Prompt"; break;
1328     case 141: str = "Enter Feature Code Prompt"; break;
1329     case 142: str = "Enter Credit Card Number Prompt"; break;
1330     case 143: str = "Enter Destination Number Prompt"; break;
1331     case 152: str = "PPC Insufficient Account Balance"; break;
1332     case 153: str = "PPC Five Minute Warning"; break;
1333     case 154: str = "PPC Three Minute Warning"; break;
1334     case 155: str = "PPC Two Minute Warning"; break;
1335     case 156: str = "PPC One Minute Warning"; break;
1336     case 157: str = "PPC Disconnect"; break;
1337     case 158: str = "PPC Redirect"; break;
1338     default:
1339         str = "Reserved, treat as None";
1340         break;
1341     }
1342
1343     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
1344     proto_tree_add_text(tree, asn1->tvb,
1345         saved_offset, asn1->offset - saved_offset,
1346         "%s :  Standard Announcement, %s",
1347         bigbuf,
1348         str);
1349
1350     if (len == 3) return;
1351
1352     saved_offset = asn1->offset;
1353
1354     asn1_int32_value_decode(asn1, 1, &value);
1355
1356     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
1357     proto_tree_add_text(tree, asn1->tvb,
1358         saved_offset, asn1->offset - saved_offset,
1359         "%s :  Custom Announcement %u",
1360         bigbuf,
1361         value);
1362
1363     EXTRANEOUS_DATA_CHECK(len, 4);
1364 }
1365
1366 static void
1367 param_alert_res(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
1368 {
1369     gint32 value;
1370     guint saved_offset;
1371     const gchar *str = NULL;
1372
1373     saved_offset = asn1->offset;
1374
1375     asn1_int32_value_decode(asn1, 1, &value);
1376
1377     switch (value)
1378     {
1379     case 0: str = "Not specified"; break;
1380     case 1: str = "Success"; break;
1381     case 2: str = "Failure"; break;
1382     case 3: str = "Denied"; break;
1383     case 4: str = "Not attempted"; break;
1384     case 5: str = "No page response"; break;
1385     case 6: str = "Busy"; break;
1386     default:
1387         str = "Reserved, treat as Not specified";
1388         break;
1389     }
1390
1391     proto_tree_add_text(tree, asn1->tvb,
1392         saved_offset, asn1->offset - saved_offset,
1393         str);
1394
1395     EXTRANEOUS_DATA_CHECK(len, 1);
1396 }
1397
1398 static void
1399 param_conf_call_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
1400 {
1401     gint32 value;
1402     guint saved_offset;
1403     const gchar *str = NULL;
1404
1405     saved_offset = asn1->offset;
1406
1407     asn1_int32_value_decode(asn1, 1, &value);
1408
1409     switch (value)
1410     {
1411     case 0: str = ", Not specified"; break;
1412     case 255: str = ", Unlimited number of conferees"; break;
1413     default:
1414         str = "";
1415         break;
1416     }
1417
1418     proto_tree_add_text(tree, asn1->tvb,
1419         saved_offset, asn1->offset - saved_offset,
1420         "Maximum Number of Conferees, (%u)%s",
1421         value,
1422         str);
1423
1424     EXTRANEOUS_DATA_CHECK(len, 1);
1425 }
1426
1427 static void
1428 param_count_upd_report(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
1429 {
1430     gint32 value;
1431     guint saved_offset;
1432     const gchar *str = NULL;
1433
1434     saved_offset = asn1->offset;
1435
1436     asn1_int32_value_decode(asn1, 1, &value);
1437
1438     switch (value)
1439     {
1440     case 0: str = "Not used"; break;
1441     case 1: str = "COUNT Update not attempted"; break;
1442     case 2: str = "COUNT Update no response"; break;
1443     case 3: str = "COUNT Update successful"; break;
1444     default:
1445         if ((value >= 4) && (value <= 223)) { str = "Reserved, treat as COUNT Update not attempted"; }
1446         else { str = "Reserved for protocol extension, treat as COUNT Update not attempted"; }
1447         break;
1448     }
1449
1450     proto_tree_add_text(tree, asn1->tvb,
1451         saved_offset, asn1->offset - saved_offset,
1452         str);
1453
1454     EXTRANEOUS_DATA_CHECK(len, 1);
1455 }
1456
1457 static void
1458 param_ssd_upd_report(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
1459 {
1460     gint32 value;
1461     guint saved_offset;
1462     const gchar *str = NULL;
1463
1464     saved_offset = asn1->offset;
1465
1466     asn1_int32_value_decode(asn1, 1, &value);
1467
1468     switch (value)
1469     {
1470     case 0: str = "Not used"; break;
1471     case 1: str = "SSD Update not attempted"; break;
1472     case 2: str = "SSD Update no response"; break;
1473     case 3: str = "SSD Update successful"; break;
1474     case 4: str = "SSD Update failed"; break;
1475     default:
1476         if ((value >= 5) && (value <= 223)) { str = "Reserved, treat as SSD Update not attempted"; }
1477         else { str = "Reserved for protocol extension, treat as SSD Update not attempted"; }
1478         break;
1479     }
1480
1481     proto_tree_add_text(tree, asn1->tvb,
1482         saved_offset, asn1->offset - saved_offset,
1483         str);
1484
1485     EXTRANEOUS_DATA_CHECK(len, 1);
1486 }
1487
1488 static void
1489 param_cond_den_reason(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
1490 {
1491     gint32 value;
1492     guint saved_offset;
1493     const gchar *str = NULL;
1494
1495     EXACT_DATA_CHECK(len, 1);
1496
1497     saved_offset = asn1->offset;
1498
1499     asn1_int32_value_decode(asn1, 1, &value);
1500
1501     switch (value)
1502     {
1503     case 0: str = "Not used"; break;
1504     case 1: str = "Waitable (i.e., Call Waiting is possible)"; break;
1505     default:
1506         if ((value >= 2) && (value <= 223)) { str = "Reserved, treat as Waitable"; }
1507         else { str = "Reserved for protocol extension, treat as Waitable"; }
1508         break;
1509     }
1510
1511     proto_tree_add_text(tree, asn1->tvb,
1512         saved_offset, asn1->offset - saved_offset,
1513         str);
1514 }
1515
1516 static void
1517 param_den_auth_per(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
1518 {
1519     gint32 value;
1520     guint saved_offset;
1521     const gchar *str = NULL;
1522
1523     SHORT_DATA_CHECK(len, 2);
1524
1525     saved_offset = asn1->offset;
1526
1527     asn1_int32_value_decode(asn1, 1, &value);
1528
1529     switch (value)
1530     {
1531     case 0: str = "Not used"; break;
1532     case 1: str = "Per Call. Re-authorization should be attempted on the next call attempt"; break;
1533     case 2: str = "Hours"; break;
1534     case 3: str = "Days"; break;
1535     case 4: str = "Weeks"; break;
1536     case 5: str = "Per Agreement"; break;
1537     case 6: str = "Reserved"; break;
1538     case 7: str = "Number of calls. Re-authorization should be attempted after this number of (rejected) call attempts"; break;
1539     case 8: str = "Minutes"; break;
1540     default:
1541         if ((value >= 9) && (value <= 223)) { str = "Reserved, treat as Per Call"; }
1542         else { str = "Reserved for protocol extension, treat as Per Call"; }
1543         break;
1544     }
1545
1546     proto_tree_add_text(tree, asn1->tvb,
1547         saved_offset, asn1->offset - saved_offset,
1548         "Period, %s",
1549         str);
1550
1551     saved_offset = asn1->offset;
1552
1553     asn1_int32_value_decode(asn1, 1, &value);
1554
1555     proto_tree_add_text(tree, asn1->tvb,
1556         saved_offset, asn1->offset - saved_offset,
1557         "Value %u",
1558         value);
1559
1560     EXTRANEOUS_DATA_CHECK(len, 2);
1561 }
1562
1563 static void
1564 param_ho_state(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
1565 {
1566     gint32 value;
1567     guint saved_offset;
1568
1569     saved_offset = asn1->offset;
1570
1571     asn1_int32_value_decode(asn1, 1, &value);
1572
1573     other_decode_bitfield_value(bigbuf, value, 0xfe, 8);
1574     proto_tree_add_text(tree, asn1->tvb,
1575         saved_offset, asn1->offset - saved_offset,
1576         "%s :  Reserved",
1577         bigbuf);
1578
1579     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
1580     proto_tree_add_text(tree, asn1->tvb,
1581         saved_offset, asn1->offset - saved_offset,
1582         "%s :  Party Involved (PI), %s",
1583         bigbuf,
1584         (value & 0x01) ? "Terminator is handing off" : "Originator is handing off");
1585
1586     EXTRANEOUS_DATA_CHECK(len, 1);
1587 }
1588
1589 static void
1590 param_geo_auth(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
1591 {
1592     gint32 value;
1593     guint saved_offset;
1594     const gchar *str = NULL;
1595
1596     saved_offset = asn1->offset;
1597
1598     asn1_int32_value_decode(asn1, 1, &value);
1599
1600     switch (value)
1601     {
1602     case 0: str = "Not used"; break;
1603     case 1: str = "Authorized for all Market IDs served by the VLR"; break;
1604     case 2: str = "Authorized for this Market ID only"; break;
1605     case 3: str = "Authorized for this Market ID and Switch Number only"; break;
1606     case 4: str = "Authorized for this Location Area ID within a Market ID only"; break;
1607     default:
1608         if ((value >= 5) && (value <= 95)) { str = "Reserved, treat as Authorized for all Market IDs served by the VLR"; }
1609         else if ((value >= 96) && (value <= 127)) { str = "Reserved for protocol extension, treat as Authorized for all Market IDs served by the VLR"; }
1610         else if ((value >= 128) && (value <= 223)) { str = "Reserved, treat as Authorized for this Location Area ID within a Market ID only"; }
1611         else { str = "Reserved for protocol extension, treat as Authorized for this Location Area ID within a Market ID only"; }
1612         break;
1613     }
1614
1615     proto_tree_add_text(tree, asn1->tvb,
1616         saved_offset, asn1->offset - saved_offset,
1617         str);
1618
1619     EXTRANEOUS_DATA_CHECK(len, 1);
1620 }
1621
1622 static void
1623 param_mw_noti_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
1624 {
1625     gint32 value;
1626     guint saved_offset;
1627     const gchar *str = NULL;
1628
1629     saved_offset = asn1->offset;
1630
1631     asn1_int32_value_decode(asn1, 1, &value);
1632
1633     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
1634     proto_tree_add_text(tree, asn1->tvb,
1635         saved_offset, asn1->offset - saved_offset,
1636         "%s :  Reserved",
1637         bigbuf);
1638
1639     switch ((value & 0x0c) >> 2)
1640     {
1641     case 0: str = "No MWI. Notification is not authorized or notification is not required"; break;
1642     case 1: str = "Reserved"; break;
1643     case 2: str = "MWI On. Notification is required. Messages waiting"; break;
1644     case 3: str = "MWI Off. Notification is required. No messages waiting"; break;
1645     }
1646
1647     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
1648     proto_tree_add_text(tree, asn1->tvb,
1649         saved_offset, asn1->offset - saved_offset,
1650         "%s :  Message Waiting Indication (MWI), %s",
1651         bigbuf,
1652         str);
1653
1654     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
1655     proto_tree_add_text(tree, asn1->tvb,
1656         saved_offset, asn1->offset - saved_offset,
1657         "%s :  Alert Pip Tone (APT), %s",
1658         bigbuf,
1659         (value & 0x02) ? "notification is required" : "notification is not authorized or notification is not required");
1660
1661     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
1662     proto_tree_add_text(tree, asn1->tvb,
1663         saved_offset, asn1->offset - saved_offset,
1664         "%s :  Pip Tone (PT), %s",
1665         bigbuf,
1666         (value & 0x01) ? "notification is required" : "notification is not authorized or notification is not required");
1667
1668     EXTRANEOUS_DATA_CHECK(len, 1);
1669 }
1670
1671 static void
1672 param_paca_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
1673 {
1674     gint32 value;
1675     guint saved_offset;
1676     const gchar *str = NULL;
1677
1678     saved_offset = asn1->offset;
1679
1680     asn1_int32_value_decode(asn1, 1, &value);
1681
1682     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
1683     proto_tree_add_text(tree, asn1->tvb,
1684         saved_offset, asn1->offset - saved_offset,
1685         "%s :  Reserved",
1686         bigbuf);
1687
1688     switch ((value & 0x1e) >> 1)
1689     {
1690     case 0: str = "Not used"; break;
1691     case 1: str = "Priority Level 1"; break;
1692     case 2: str = "Priority Level 2"; break;
1693     case 3: str = "Priority Level 3"; break;
1694     case 4: str = "Priority Level 4"; break;
1695     case 5: str = "Priority Level 5"; break;
1696     case 6: str = "Priority Level 6"; break;
1697     case 7: str = "Priority Level 7"; break;
1698     case 8: str = "Priority Level 8"; break;
1699     case 9: str = "Priority Level 9"; break;
1700     case 10: str = "Priority Level 10"; break;
1701     case 11: str = "Priority Level 11"; break;
1702     case 12: str = "Priority Level 12"; break;
1703     case 13: str = "Priority Level 13"; break;
1704     case 14: str = "Priority Level 14"; break;
1705     case 15: str = "Priority Level 15"; break;
1706     }
1707
1708     other_decode_bitfield_value(bigbuf, value, 0x1e, 8);
1709     proto_tree_add_text(tree, asn1->tvb,
1710         saved_offset, asn1->offset - saved_offset,
1711         "%s :  PACA Level, %s",
1712         bigbuf,
1713         str);
1714
1715     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
1716     proto_tree_add_text(tree, asn1->tvb,
1717         saved_offset, asn1->offset - saved_offset,
1718         "%s :  PACA is %spermanently activated",
1719         bigbuf,
1720         (value & 0x01) ? "" : "not ");
1721
1722     EXTRANEOUS_DATA_CHECK(len, 1);
1723 }
1724
1725 static void
1726 param_digit_collect_ctrl(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
1727 {
1728     gint32 value;
1729     guint saved_offset;
1730     proto_item *item;
1731     proto_tree *subtree;
1732
1733     saved_offset = asn1->offset;
1734
1735     asn1_int32_value_decode(asn1, 1, &value);
1736
1737     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
1738     proto_tree_add_text(tree, asn1->tvb,
1739         saved_offset, asn1->offset - saved_offset,
1740         "%s :  Break (BRK), %s",
1741         bigbuf,
1742         (value & 0x80) ? "Break In (default)" : "No Break");
1743
1744     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
1745     proto_tree_add_text(tree, asn1->tvb,
1746         saved_offset, asn1->offset - saved_offset,
1747         "%s :  Type Ahead (TA), %s",
1748         bigbuf,
1749         (value & 0x40) ? "Buffer (default)" : "No Type Ahead");
1750
1751     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
1752     proto_tree_add_text(tree, asn1->tvb,
1753         saved_offset, asn1->offset - saved_offset,
1754         "%s :  Reserved",
1755         bigbuf);
1756
1757     other_decode_bitfield_value(bigbuf, value, 0x1f, 8);
1758     proto_tree_add_text(tree, asn1->tvb,
1759         saved_offset, asn1->offset - saved_offset,
1760         "%s :  Maximum Collect (%u)",
1761         bigbuf,
1762         (value & 0x1f));
1763
1764     if (len == 1) return;
1765
1766     saved_offset = asn1->offset;
1767
1768     asn1_int32_value_decode(asn1, 1, &value);
1769
1770     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
1771     proto_tree_add_text(tree, asn1->tvb,
1772         saved_offset, asn1->offset - saved_offset,
1773         "%s :  Reserved",
1774         bigbuf);
1775
1776     other_decode_bitfield_value(bigbuf, value, 0x1f, 8);
1777     proto_tree_add_text(tree, asn1->tvb,
1778         saved_offset, asn1->offset - saved_offset,
1779         "%s :  Minimum Collect (%u)",
1780         bigbuf,
1781         (value & 0x1f));
1782
1783     if (len == 2) return;
1784
1785     saved_offset = asn1->offset;
1786
1787     asn1_int32_value_decode(asn1, 1, &value);
1788
1789     proto_tree_add_text(tree, asn1->tvb,
1790         saved_offset, asn1->offset - saved_offset,
1791         "Maximum Interaction Time (%u) seconds",
1792         value);
1793
1794     if (len == 3) return;
1795
1796     saved_offset = asn1->offset;
1797
1798     asn1_int32_value_decode(asn1, 1, &value);
1799
1800     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
1801     proto_tree_add_text(tree, asn1->tvb,
1802         saved_offset, asn1->offset - saved_offset,
1803         "%s :  Reserved",
1804         bigbuf);
1805
1806     other_decode_bitfield_value(bigbuf, value, 0x1f, 8);
1807     proto_tree_add_text(tree, asn1->tvb,
1808         saved_offset, asn1->offset - saved_offset,
1809         "%s :  Initial Interdigit Time (%u) seconds",
1810         bigbuf,
1811         (value & 0x1f));
1812
1813     if (len == 4) return;
1814
1815     saved_offset = asn1->offset;
1816
1817     asn1_int32_value_decode(asn1, 1, &value);
1818
1819     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
1820     proto_tree_add_text(tree, asn1->tvb,
1821         saved_offset, asn1->offset - saved_offset,
1822         "%s :  Reserved",
1823         bigbuf);
1824
1825     other_decode_bitfield_value(bigbuf, value, 0x1f, 8);
1826     proto_tree_add_text(tree, asn1->tvb,
1827         saved_offset, asn1->offset - saved_offset,
1828         "%s :  Normal Interdigit Time (%u) seconds",
1829         bigbuf,
1830         (value & 0x1f));
1831
1832     if (len == 5) return;
1833
1834     saved_offset = asn1->offset;
1835
1836     item =
1837         proto_tree_add_text(tree, asn1->tvb,
1838             saved_offset, (len > 6) ? 2 : 1,
1839             "Clear Digits Digit Mask");
1840
1841     subtree = proto_item_add_subtree(item, ett_clr_dig_mask);
1842
1843     asn1_int32_value_decode(asn1, 1, &value);
1844
1845     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
1846     proto_tree_add_text(subtree, asn1->tvb,
1847         saved_offset, asn1->offset - saved_offset,
1848         "%s :  7 Digit",
1849         bigbuf);
1850
1851     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
1852     proto_tree_add_text(subtree, asn1->tvb,
1853         saved_offset, asn1->offset - saved_offset,
1854         "%s :  6 Digit",
1855         bigbuf);
1856
1857     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
1858     proto_tree_add_text(subtree, asn1->tvb,
1859         saved_offset, asn1->offset - saved_offset,
1860         "%s :  5 Digit",
1861         bigbuf);
1862
1863     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
1864     proto_tree_add_text(subtree, asn1->tvb,
1865         saved_offset, asn1->offset - saved_offset,
1866         "%s :  4 Digit",
1867         bigbuf);
1868
1869     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
1870     proto_tree_add_text(subtree, asn1->tvb,
1871         saved_offset, asn1->offset - saved_offset,
1872         "%s :  3 Digit",
1873         bigbuf);
1874
1875     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
1876     proto_tree_add_text(subtree, asn1->tvb,
1877         saved_offset, asn1->offset - saved_offset,
1878         "%s :  2 Digit",
1879         bigbuf);
1880
1881     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
1882     proto_tree_add_text(subtree, asn1->tvb,
1883         saved_offset, asn1->offset - saved_offset,
1884         "%s :  1 Digit",
1885         bigbuf);
1886
1887     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
1888     proto_tree_add_text(subtree, asn1->tvb,
1889         saved_offset, asn1->offset - saved_offset,
1890         "%s :  0 Digit",
1891         bigbuf);
1892
1893     if (len == 6) return;
1894
1895     saved_offset = asn1->offset;
1896
1897     asn1_int32_value_decode(asn1, 1, &value);
1898
1899     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
1900     proto_tree_add_text(subtree, asn1->tvb,
1901         saved_offset, asn1->offset - saved_offset,
1902         "%s :  Reserved",
1903         bigbuf);
1904
1905     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
1906     proto_tree_add_text(subtree, asn1->tvb,
1907         saved_offset, asn1->offset - saved_offset,
1908         "%s :  # Digit",
1909         bigbuf);
1910
1911     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
1912     proto_tree_add_text(subtree, asn1->tvb,
1913         saved_offset, asn1->offset - saved_offset,
1914         "%s :  * Digit",
1915         bigbuf);
1916
1917     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
1918     proto_tree_add_text(subtree, asn1->tvb,
1919         saved_offset, asn1->offset - saved_offset,
1920         "%s :  Reserved",
1921         bigbuf);
1922
1923     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
1924     proto_tree_add_text(subtree, asn1->tvb,
1925         saved_offset, asn1->offset - saved_offset,
1926         "%s :  9 Digit",
1927         bigbuf);
1928
1929     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
1930     proto_tree_add_text(subtree, asn1->tvb,
1931         saved_offset, asn1->offset - saved_offset,
1932         "%s :  8 Digit",
1933         bigbuf);
1934
1935     if (len == 7) return;
1936
1937     saved_offset = asn1->offset;
1938
1939     item =
1940         proto_tree_add_text(tree, asn1->tvb,
1941             saved_offset, (len > 8) ? 2 : 1,
1942             "Enter Digits Digit Mask");
1943
1944     subtree = proto_item_add_subtree(item, ett_ent_dig_mask);
1945
1946     asn1_int32_value_decode(asn1, 1, &value);
1947
1948     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
1949     proto_tree_add_text(subtree, asn1->tvb,
1950         saved_offset, asn1->offset - saved_offset,
1951         "%s :  7 Digit",
1952         bigbuf);
1953
1954     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
1955     proto_tree_add_text(subtree, asn1->tvb,
1956         saved_offset, asn1->offset - saved_offset,
1957         "%s :  6 Digit",
1958         bigbuf);
1959
1960     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
1961     proto_tree_add_text(subtree, asn1->tvb,
1962         saved_offset, asn1->offset - saved_offset,
1963         "%s :  5 Digit",
1964         bigbuf);
1965
1966     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
1967     proto_tree_add_text(subtree, asn1->tvb,
1968         saved_offset, asn1->offset - saved_offset,
1969         "%s :  4 Digit",
1970         bigbuf);
1971
1972     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
1973     proto_tree_add_text(subtree, asn1->tvb,
1974         saved_offset, asn1->offset - saved_offset,
1975         "%s :  3 Digit",
1976         bigbuf);
1977
1978     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
1979     proto_tree_add_text(subtree, asn1->tvb,
1980         saved_offset, asn1->offset - saved_offset,
1981         "%s :  2 Digit",
1982         bigbuf);
1983
1984     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
1985     proto_tree_add_text(subtree, asn1->tvb,
1986         saved_offset, asn1->offset - saved_offset,
1987         "%s :  1 Digit",
1988         bigbuf);
1989
1990     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
1991     proto_tree_add_text(subtree, asn1->tvb,
1992         saved_offset, asn1->offset - saved_offset,
1993         "%s :  0 Digit",
1994         bigbuf);
1995
1996     if (len == 8) return;
1997
1998     saved_offset = asn1->offset;
1999
2000     asn1_int32_value_decode(asn1, 1, &value);
2001
2002     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
2003     proto_tree_add_text(subtree, asn1->tvb,
2004         saved_offset, asn1->offset - saved_offset,
2005         "%s :  Reserved",
2006         bigbuf);
2007
2008     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
2009     proto_tree_add_text(subtree, asn1->tvb,
2010         saved_offset, asn1->offset - saved_offset,
2011         "%s :  # Digit",
2012         bigbuf);
2013
2014     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
2015     proto_tree_add_text(subtree, asn1->tvb,
2016         saved_offset, asn1->offset - saved_offset,
2017         "%s :  * Digit",
2018         bigbuf);
2019
2020     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
2021     proto_tree_add_text(subtree, asn1->tvb,
2022         saved_offset, asn1->offset - saved_offset,
2023         "%s :  Reserved",
2024         bigbuf);
2025
2026     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
2027     proto_tree_add_text(subtree, asn1->tvb,
2028         saved_offset, asn1->offset - saved_offset,
2029         "%s :  9 Digit",
2030         bigbuf);
2031
2032     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
2033     proto_tree_add_text(subtree, asn1->tvb,
2034         saved_offset, asn1->offset - saved_offset,
2035         "%s :  8 Digit",
2036         bigbuf);
2037
2038     if (len == 9) return;
2039
2040     saved_offset = asn1->offset;
2041
2042     item =
2043         proto_tree_add_text(tree, asn1->tvb,
2044             saved_offset, (len > 10) ? 2 : 1,
2045             "Allowed Digits Digit Mask");
2046
2047     subtree = proto_item_add_subtree(item, ett_all_dig_mask);
2048
2049     asn1_int32_value_decode(asn1, 1, &value);
2050
2051     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
2052     proto_tree_add_text(subtree, asn1->tvb,
2053         saved_offset, asn1->offset - saved_offset,
2054         "%s :  7 Digit",
2055         bigbuf);
2056
2057     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
2058     proto_tree_add_text(subtree, asn1->tvb,
2059         saved_offset, asn1->offset - saved_offset,
2060         "%s :  6 Digit",
2061         bigbuf);
2062
2063     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
2064     proto_tree_add_text(subtree, asn1->tvb,
2065         saved_offset, asn1->offset - saved_offset,
2066         "%s :  5 Digit",
2067         bigbuf);
2068
2069     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
2070     proto_tree_add_text(subtree, asn1->tvb,
2071         saved_offset, asn1->offset - saved_offset,
2072         "%s :  4 Digit",
2073         bigbuf);
2074
2075     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
2076     proto_tree_add_text(subtree, asn1->tvb,
2077         saved_offset, asn1->offset - saved_offset,
2078         "%s :  3 Digit",
2079         bigbuf);
2080
2081     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
2082     proto_tree_add_text(subtree, asn1->tvb,
2083         saved_offset, asn1->offset - saved_offset,
2084         "%s :  2 Digit",
2085         bigbuf);
2086
2087     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
2088     proto_tree_add_text(subtree, asn1->tvb,
2089         saved_offset, asn1->offset - saved_offset,
2090         "%s :  1 Digit",
2091         bigbuf);
2092
2093     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
2094     proto_tree_add_text(subtree, asn1->tvb,
2095         saved_offset, asn1->offset - saved_offset,
2096         "%s :  0 Digit",
2097         bigbuf);
2098
2099     if (len == 10) return;
2100
2101     saved_offset = asn1->offset;
2102
2103     asn1_int32_value_decode(asn1, 1, &value);
2104
2105     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
2106     proto_tree_add_text(subtree, asn1->tvb,
2107         saved_offset, asn1->offset - saved_offset,
2108         "%s :  Reserved",
2109         bigbuf);
2110
2111     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
2112     proto_tree_add_text(subtree, asn1->tvb,
2113         saved_offset, asn1->offset - saved_offset,
2114         "%s :  # Digit",
2115         bigbuf);
2116
2117     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
2118     proto_tree_add_text(subtree, asn1->tvb,
2119         saved_offset, asn1->offset - saved_offset,
2120         "%s :  * Digit",
2121         bigbuf);
2122
2123     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
2124     proto_tree_add_text(subtree, asn1->tvb,
2125         saved_offset, asn1->offset - saved_offset,
2126         "%s :  Reserved",
2127         bigbuf);
2128
2129     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
2130     proto_tree_add_text(subtree, asn1->tvb,
2131         saved_offset, asn1->offset - saved_offset,
2132         "%s :  9 Digit",
2133         bigbuf);
2134
2135     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
2136     proto_tree_add_text(subtree, asn1->tvb,
2137         saved_offset, asn1->offset - saved_offset,
2138         "%s :  8 Digit",
2139         bigbuf);
2140
2141     if (len == 11) return;
2142
2143     saved_offset = asn1->offset;
2144
2145     asn1_int32_value_decode(asn1, 1, &value);
2146
2147     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
2148     proto_tree_add_text(tree, asn1->tvb,
2149         saved_offset, asn1->offset - saved_offset,
2150         "%s :  Reserved",
2151         bigbuf);
2152
2153     other_decode_bitfield_value(bigbuf, value, 0x1f, 8);
2154     proto_tree_add_text(tree, asn1->tvb,
2155         saved_offset, asn1->offset - saved_offset,
2156         "%s :  Special Interdigit Time (%u)",
2157         bigbuf,
2158         value & 0x1f);
2159
2160     if (len == 12) return;
2161
2162     saved_offset = asn1->offset;
2163
2164     asn1_int32_value_decode(asn1, 1, &value);
2165
2166     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
2167     proto_tree_add_text(tree, asn1->tvb,
2168         saved_offset, asn1->offset - saved_offset,
2169         "%s :  SIT 8",
2170         bigbuf);
2171
2172     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
2173     proto_tree_add_text(tree, asn1->tvb,
2174         saved_offset, asn1->offset - saved_offset,
2175         "%s :  SIT 7",
2176         bigbuf);
2177
2178     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
2179     proto_tree_add_text(tree, asn1->tvb,
2180         saved_offset, asn1->offset - saved_offset,
2181         "%s :  SIT 6",
2182         bigbuf);
2183
2184     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
2185     proto_tree_add_text(tree, asn1->tvb,
2186         saved_offset, asn1->offset - saved_offset,
2187         "%s :  SIT 5",
2188         bigbuf);
2189
2190     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
2191     proto_tree_add_text(tree, asn1->tvb,
2192         saved_offset, asn1->offset - saved_offset,
2193         "%s :  SIT 4",
2194         bigbuf);
2195
2196     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
2197     proto_tree_add_text(tree, asn1->tvb,
2198         saved_offset, asn1->offset - saved_offset,
2199         "%s :  SIT 3",
2200         bigbuf);
2201
2202     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
2203     proto_tree_add_text(tree, asn1->tvb,
2204         saved_offset, asn1->offset - saved_offset,
2205         "%s :  SIT 2",
2206         bigbuf);
2207
2208     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
2209     proto_tree_add_text(tree, asn1->tvb,
2210         saved_offset, asn1->offset - saved_offset,
2211         "%s :  SIT 1",
2212         bigbuf);
2213
2214     if (len == 13) return;
2215
2216     saved_offset = asn1->offset;
2217
2218     asn1_int32_value_decode(asn1, 1, &value);
2219
2220     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
2221     proto_tree_add_text(tree, asn1->tvb,
2222         saved_offset, asn1->offset - saved_offset,
2223         "%s :  SIT 16",
2224         bigbuf);
2225
2226     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
2227     proto_tree_add_text(tree, asn1->tvb,
2228         saved_offset, asn1->offset - saved_offset,
2229         "%s :  SIT 15",
2230         bigbuf);
2231
2232     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
2233     proto_tree_add_text(tree, asn1->tvb,
2234         saved_offset, asn1->offset - saved_offset,
2235         "%s :  SIT 14",
2236         bigbuf);
2237
2238     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
2239     proto_tree_add_text(tree, asn1->tvb,
2240         saved_offset, asn1->offset - saved_offset,
2241         "%s :  SIT 13",
2242         bigbuf);
2243
2244     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
2245     proto_tree_add_text(tree, asn1->tvb,
2246         saved_offset, asn1->offset - saved_offset,
2247         "%s :  SIT 12",
2248         bigbuf);
2249
2250     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
2251     proto_tree_add_text(tree, asn1->tvb,
2252         saved_offset, asn1->offset - saved_offset,
2253         "%s :  SIT 11",
2254         bigbuf);
2255
2256     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
2257     proto_tree_add_text(tree, asn1->tvb,
2258         saved_offset, asn1->offset - saved_offset,
2259         "%s :  SIT 10",
2260         bigbuf);
2261
2262     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
2263     proto_tree_add_text(tree, asn1->tvb,
2264         saved_offset, asn1->offset - saved_offset,
2265         "%s :  SIT 9",
2266         bigbuf);
2267
2268     if (len == 14) return;
2269
2270     saved_offset = asn1->offset;
2271
2272     asn1_int32_value_decode(asn1, 1, &value);
2273
2274     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
2275     proto_tree_add_text(tree, asn1->tvb,
2276         saved_offset, asn1->offset - saved_offset,
2277         "%s :  SIT 24",
2278         bigbuf);
2279
2280     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
2281     proto_tree_add_text(tree, asn1->tvb,
2282         saved_offset, asn1->offset - saved_offset,
2283         "%s :  SIT 23",
2284         bigbuf);
2285
2286     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
2287     proto_tree_add_text(tree, asn1->tvb,
2288         saved_offset, asn1->offset - saved_offset,
2289         "%s :  SIT 22",
2290         bigbuf);
2291
2292     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
2293     proto_tree_add_text(tree, asn1->tvb,
2294         saved_offset, asn1->offset - saved_offset,
2295         "%s :  SIT 21",
2296         bigbuf);
2297
2298     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
2299     proto_tree_add_text(tree, asn1->tvb,
2300         saved_offset, asn1->offset - saved_offset,
2301         "%s :  SIT 20",
2302         bigbuf);
2303
2304     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
2305     proto_tree_add_text(tree, asn1->tvb,
2306         saved_offset, asn1->offset - saved_offset,
2307         "%s :  SIT 19",
2308         bigbuf);
2309
2310     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
2311     proto_tree_add_text(tree, asn1->tvb,
2312         saved_offset, asn1->offset - saved_offset,
2313         "%s :  SIT 18",
2314         bigbuf);
2315
2316     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
2317     proto_tree_add_text(tree, asn1->tvb,
2318         saved_offset, asn1->offset - saved_offset,
2319         "%s :  SIT 17",
2320         bigbuf);
2321
2322     if (len == 15) return;
2323
2324     saved_offset = asn1->offset;
2325
2326     asn1_int32_value_decode(asn1, 1, &value);
2327
2328     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
2329     proto_tree_add_text(tree, asn1->tvb,
2330         saved_offset, asn1->offset - saved_offset,
2331         "%s :  Reserved",
2332         bigbuf);
2333
2334     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
2335     proto_tree_add_text(tree, asn1->tvb,
2336         saved_offset, asn1->offset - saved_offset,
2337         "%s :  SIT 31",
2338         bigbuf);
2339
2340     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
2341     proto_tree_add_text(tree, asn1->tvb,
2342         saved_offset, asn1->offset - saved_offset,
2343         "%s :  SIT 30",
2344         bigbuf);
2345
2346     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
2347     proto_tree_add_text(tree, asn1->tvb,
2348         saved_offset, asn1->offset - saved_offset,
2349         "%s :  SIT 29",
2350         bigbuf);
2351
2352     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
2353     proto_tree_add_text(tree, asn1->tvb,
2354         saved_offset, asn1->offset - saved_offset,
2355         "%s :  SIT 28",
2356         bigbuf);
2357
2358     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
2359     proto_tree_add_text(tree, asn1->tvb,
2360         saved_offset, asn1->offset - saved_offset,
2361         "%s :  SIT 27",
2362         bigbuf);
2363
2364     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
2365     proto_tree_add_text(tree, asn1->tvb,
2366         saved_offset, asn1->offset - saved_offset,
2367         "%s :  SIT 26",
2368         bigbuf);
2369
2370     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
2371     proto_tree_add_text(tree, asn1->tvb,
2372         saved_offset, asn1->offset - saved_offset,
2373         "%s :  SIT 25",
2374         bigbuf);
2375
2376     EXTRANEOUS_DATA_CHECK(len, 16);
2377 }
2378
2379 static void
2380 param_no_ans_time(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
2381 {
2382     gint32 value;
2383     guint saved_offset;
2384
2385     saved_offset = asn1->offset;
2386
2387     asn1_int32_value_decode(asn1, 1, &value);
2388
2389     proto_tree_add_text(tree, asn1->tvb,
2390         saved_offset, asn1->offset - saved_offset,
2391         "(%u) The number of seconds to wait after alerting an MS or after seizing an outgoing trunk before applying no answer trigger treatment.",
2392         value);
2393
2394     EXTRANEOUS_DATA_CHECK(len, 1);
2395 }
2396
2397 static void
2398 param_mw_noti_count(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
2399 {
2400     gint32 value;
2401     guint saved_offset, orig_offset;
2402     const gchar *str = NULL;
2403     char *buf;
2404
2405     SHORT_DATA_CHECK(len, 2);
2406
2407     orig_offset = asn1->offset;
2408     saved_offset = asn1->offset;
2409
2410     do
2411     {
2412         asn1_int32_value_decode(asn1, 1, &value);
2413
2414         switch (value)
2415         {
2416         case 0: str = "Voice Messages"; break;
2417         case 1: str = "Short Message Services (SMS) messages"; break;
2418         case 2: str = "Group 3 (G3) Fax messages"; break;
2419         case 255: str = "Not specified"; break;
2420         default:
2421             str = "Reserved, treat as Not specified";
2422             break;
2423         }
2424
2425         proto_tree_add_text(tree, asn1->tvb,
2426             saved_offset, asn1->offset - saved_offset,
2427             "Type of messages, %s",
2428             str);
2429
2430         saved_offset = asn1->offset;
2431
2432         asn1_int32_value_decode(asn1, 1, &value);
2433
2434         switch (value)
2435         {
2436         case 0: str = "No messages are waiting"; break;
2437         case 254: str = "254 or more messages are waiting"; break;
2438         case 255: str = "An unknown number of messages are waiting (greater than zero)"; break;
2439         default:
2440             buf=ep_alloc(512);
2441             g_snprintf(buf, 512, "%u messages are waiting", value);
2442             str = buf;
2443             break;
2444         }
2445
2446         proto_tree_add_text(tree, asn1->tvb,
2447             saved_offset, asn1->offset - saved_offset,
2448             str);
2449
2450         saved_offset = asn1->offset;
2451     }
2452     while ((len - (saved_offset - orig_offset)) >= 2);
2453
2454     EXTRANEOUS_DATA_CHECK((len - (saved_offset - orig_offset)), 0);
2455 }
2456
2457 static void
2458 param_otfi(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
2459 {
2460     gint32 value;
2461     guint saved_offset;
2462     const gchar *str = NULL;
2463
2464     saved_offset = asn1->offset;
2465
2466     asn1_int32_value_decode(asn1, 1, &value);
2467
2468     switch ((value & 0xc0) >> 6)
2469     {
2470     case 0: str = "Ignore"; break;
2471     case 1: str = "Presentation Allowed"; break;
2472     case 2: str = "Presentation Restricted"; break;
2473     case 3: str = "Reserved"; break;
2474     }
2475
2476     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
2477     proto_tree_add_text(tree, asn1->tvb,
2478         saved_offset, asn1->offset - saved_offset,
2479         "%s :  Calling Number ID Restriction, %s",
2480         bigbuf,
2481         str);
2482
2483     switch ((value & 0x30) >> 4)
2484     {
2485     case 0: str = "Ignore"; break;
2486     case 1: str = "Pip Tone Inactive"; break;
2487     case 2: str = "Pip Tone Active"; break;
2488     case 3: str = "Reserved"; break;
2489     }
2490
2491     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
2492     proto_tree_add_text(tree, asn1->tvb,
2493         saved_offset, asn1->offset - saved_offset,
2494         "%s :  Message Waiting Notification, %s",
2495         bigbuf,
2496         str);
2497
2498     switch ((value & 0x0c) >> 2)
2499     {
2500     case 0: str = "Ignore"; break;
2501     case 1: str = "No CW"; break;
2502     case 2: str = "Normal CW"; break;
2503     case 3: str = "Priority CW"; break;
2504     }
2505
2506     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
2507     proto_tree_add_text(tree, asn1->tvb,
2508         saved_offset, asn1->offset - saved_offset,
2509         "%s :  Call Waiting for Incoming Call (CWIC), %s",
2510         bigbuf,
2511         str);
2512
2513     switch (value & 0x03)
2514     {
2515     case 0: str = "Ignore"; break;
2516     case 1: str = "No CW"; break;
2517     case 2: str = "Normal CW"; break;
2518     case 3: str = "Priority CW"; break;
2519     }
2520
2521     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
2522     proto_tree_add_text(tree, asn1->tvb,
2523         saved_offset, asn1->offset - saved_offset,
2524         "%s :  Call Waiting for Future Incoming Call (CWFI), %s",
2525         bigbuf,
2526         str);
2527
2528     if (len == 1) return;
2529
2530     saved_offset = asn1->offset;
2531
2532     asn1_int32_value_decode(asn1, 1, &value);
2533
2534     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
2535     proto_tree_add_text(tree, asn1->tvb,
2536         saved_offset, asn1->offset - saved_offset,
2537         "%s :  Reserved",
2538         bigbuf);
2539
2540     switch ((value & 0x30) >> 4)
2541     {
2542     case 0: str = "Ignore"; break;
2543     case 1: str = "Presentation Allowed"; break;
2544     case 2: str = "Presentation Restricted"; break;
2545     case 3: str = "Blocking Toggle"; break;
2546     }
2547
2548     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
2549     proto_tree_add_text(tree, asn1->tvb,
2550         saved_offset, asn1->offset - saved_offset,
2551         "%s :  Calling Name Restriction (CNAR), %s",
2552         bigbuf,
2553         str);
2554
2555     switch ((value & 0x0c) >> 2)
2556     {
2557     case 0: str = "Ignore"; break;
2558     case 1: str = "Flash Inactive"; break;
2559     case 2: str = "Flash Active"; break;
2560     case 3: str = "Reserved"; break;
2561     }
2562
2563     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
2564     proto_tree_add_text(tree, asn1->tvb,
2565         saved_offset, asn1->offset - saved_offset,
2566         "%s :  Flash Privileges (Flash), %s",
2567         bigbuf,
2568         str);
2569
2570     switch (value & 0x03)
2571     {
2572     case 0: str = "Ignore"; break;
2573     case 1: str = "PACA Demand Inactive"; break;
2574     case 2: str = "PACA Demand Actived"; break;
2575     case 3: str = "Reserved"; break;
2576     }
2577
2578     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
2579     proto_tree_add_text(tree, asn1->tvb,
2580         saved_offset, asn1->offset - saved_offset,
2581         "%s :  Priority Access and Channel Assignment (PACA), %s",
2582         bigbuf,
2583         str);
2584
2585     EXTRANEOUS_DATA_CHECK(len, 2);
2586 }
2587
2588 /*
2589  * For:
2590  *      Authentication Response
2591  *      Authentication Response Base Station
2592  *      Authentication Response Unique Challenge
2593  */
2594 static void
2595 param_auth_resp_all(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
2596 {
2597     gint32 value;
2598     guint saved_offset;
2599
2600     EXACT_DATA_CHECK(len, 3);
2601
2602     saved_offset = asn1->offset;
2603
2604     asn1_int32_value_decode(asn1, 1, &value);
2605
2606     other_decode_bitfield_value(bigbuf, value, 0xfc, 8);
2607     proto_tree_add_text(tree, asn1->tvb,
2608         saved_offset, asn1->offset - saved_offset,
2609         "%s :  Reserved",
2610         bigbuf);
2611
2612     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
2613     proto_tree_add_text(tree, asn1->tvb,
2614         saved_offset, asn1->offset - saved_offset,
2615         "%s :  Response (MSB)",
2616         bigbuf);
2617
2618     saved_offset = asn1->offset;
2619
2620     asn1_int32_value_decode(asn1, 1, &value);
2621
2622     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
2623     proto_tree_add_text(tree, asn1->tvb,
2624         saved_offset, asn1->offset - saved_offset,
2625         "%s :  Response",
2626         bigbuf);
2627
2628     saved_offset = asn1->offset;
2629
2630     asn1_int32_value_decode(asn1, 1, &value);
2631
2632     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
2633     proto_tree_add_text(tree, asn1->tvb,
2634         saved_offset, asn1->offset - saved_offset,
2635         "%s :  Response (LSB)",
2636         bigbuf);
2637 }
2638
2639 static void
2640 param_sys_acc_data(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string, int string_len _U_)
2641 {
2642     gint32 value;
2643     guint saved_offset;
2644
2645     EXACT_DATA_CHECK(len, 5);
2646
2647     param_mscid(asn1, tree, 3, add_string, string_len);
2648
2649     saved_offset = asn1->offset;
2650     asn1_int32_value_decode(asn1, 2, &value);
2651
2652     proto_tree_add_text(tree, asn1->tvb,
2653         saved_offset, asn1->offset - saved_offset,
2654         "Serving Cell ID %u",
2655         value);
2656 }
2657
2658 static void
2659 param_bill_id(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string, int string_len)
2660 {
2661     gint32 id, segcount;
2662     guint saved_offset;
2663     const gchar *str = NULL;
2664
2665     EXACT_DATA_CHECK(len, 7);
2666
2667     param_mscid(asn1, tree, 3, add_string, string_len);
2668
2669     saved_offset = asn1->offset;
2670     asn1_int32_value_decode(asn1, 3, &id);
2671
2672     proto_tree_add_int_format(tree, hf_ansi_map_billing_id, asn1->tvb,
2673         saved_offset, asn1->offset - saved_offset,id,
2674         "ID Number %d",
2675         id);
2676
2677     saved_offset = asn1->offset;
2678     asn1_int32_value_decode(asn1, 1, &segcount);
2679
2680     if (segcount == 255) { str = "Unspecified"; }
2681     else if ((segcount >= 0) && (segcount <= 127)) { str = "Number of call segments"; }
2682     else if ((segcount >= 128) && (segcount < 255)) { str = "Not used in TIA/EIA-41"; }
2683
2684     proto_tree_add_text(tree, asn1->tvb,
2685         saved_offset, asn1->offset - saved_offset,
2686         "Segment Counter %u:  %s",
2687         segcount, str);
2688 }
2689
2690 static void
2691 param_cdma_so(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string, int string_len)
2692 {
2693     gint32 so;
2694     guint saved_offset;
2695     const gchar *str = NULL;
2696
2697     SHORT_DATA_CHECK(len, 2);
2698
2699     saved_offset = asn1->offset;
2700     asn1_int32_value_decode(asn1, 2, &so);
2701
2702     switch (so)
2703     {
2704     case 1: str = "Basic Variable Rate Voice Service (8 kbps)"; break;
2705     case 2: str = "Mobile Station Loopback (8 kbps)"; break;
2706     case 3: str = "Enhanced Variable Rate Voice Service (8 kbps)"; break;
2707     case 4: str = "Asynchronous Data Service (9.6 kbps)"; break;
2708     case 5: str = "Group 3 Facsimile (9.6 kbps)"; break;
2709     case 6: str = "Short Message Services (Rate Set 1)"; break;
2710     case 7: str = "Packet Data Service: Internet or ISO Protocol Stack (9.6 kbps)"; break;
2711     case 8: str = "Packet Data Service: CDPD Protocol Stack (9.6 kbps)"; break;
2712     case 9: str = "Mobile Station Loopback (13 kbps)"; break;
2713     case 10: str = "STU-III Transparent Service"; break;
2714     case 11: str = "STU-III Non-Transparent Service"; break;
2715     case 12: str = "Asynchronous Data Service (14.4 or 9.6 kbps)"; break;
2716     case 13: str = "Group 3 Facsimile (14.4 or 9.6 kbps)"; break;
2717     case 14: str = "Short Message Services (Rate Set 2)"; break;
2718     case 15: str = "Packet Data Service: Internet or ISO Protocol Stack (14.4 kbps)"; break;
2719     case 16: str = "Packet Data Service: CDPD Protocol Stack (14.4 kbps)"; break;
2720     case 17: str = "High Rate Voice Service (13 kbps)"; break;
2721     case 32768: str = "QCELP (13 kbps)"; break;
2722     case 18: str = "Over-the-Air Parameter Administration (Rate Set 1)"; break;
2723     case 19: str = "Over-the-Air Parameter Administration (Rate Set 2)"; break;
2724     case 20: str = "Group 3 Analog Facsimile (Rate Set 1)"; break;
2725     case 21: str = "Group 3 Analog Facsimile (Rate Set 2)"; break;
2726     case 22: str = "High Speed Packet Data Service: Internet or ISO Protocol Stack (RS1 forward, RS1 reverse)"; break;
2727     case 23: str = "High Speed Packet Data Service: Internet or ISO Protocol Stack (RS1 forward, RS2 reverse)"; break;
2728     case 24: str = "High Speed Packet Data Service: Internet or ISO Protocol Stack (RS2 forward, RS1 reverse)"; break;
2729     case 25: str = "High Speed Packet Data Service: Internet or ISO Protocol Stack (RS2 forward, RS2 reverse)"; break;
2730     case 26: str = "High Speed Packet Data Service: CDPD Protocol Stack (RS1 forward, RS1 reverse)"; break;
2731     case 27: str = "High Speed Packet Data Service: CDPD Protocol Stack (RS1 forward, RS2 reverse)"; break;
2732     case 28: str = "High Speed Packet Data Service: CDPD Protocol Stack (RS2 forward, RS1 reverse)"; break;
2733     case 29: str = "High Speed Packet Data Service: CDPD Protocol Stack (RS2 forward, RS2 reverse)"; break;
2734     case 30: str = "Supplemental Channel Loopback Test for Rate Set 1"; break;
2735     case 31: str = "Supplemental Channel Loopback Test for Rate Set 2"; break;
2736     case 32: str = "Test Data Service Option (TDSO)"; break;
2737     case 33: str = "cdma2000 High Speed Packet Data Service, Internet or ISO Protocol Stack"; break;
2738     case 34: str = "cdma2000 High Speed Packet Data Service, CDPD Protocol Stack"; break;
2739     case 35: str = "Location Services, Rate Set 1 (9.6 kbps)"; break;
2740     case 36: str = "Location Services, Rate Set 2 (14.4 kbps)"; break;
2741     case 37: str = "ISDN Interworking Service (64 kbps)"; break;
2742     case 38: str = "GSM Voice"; break;
2743     case 39: str = "GSM Circuit Data"; break;
2744     case 40: str = "GSM Packet Data"; break;
2745     case 41: str = "GSM Short Message Service"; break;
2746     case 42: str = "None Reserved for MC-MAP standard service options"; break;
2747     case 54: str = "Markov Service Option (MSO)"; break;
2748     case 55: str = "Loopback Service Option (LSO)"; break;
2749     case 56: str = "Selectable Mode Vocoder"; break;
2750     case 57: str = "32 kbps Circuit Video Conferencing"; break;
2751     case 58: str = "64 kbps Circuit Video Conferencing"; break;
2752     case 59: str = "HRPD Accounting Records Identifier"; break;
2753     case 60: str = "Link Layer Assisted Robust Header Compression (LLA ROHC) - Header Removal"; break;
2754     case 61: str = "Link Layer Assisted Robust Header Compression (LLA ROHC) - Header Compression"; break;
2755     case 62: str = "- 4099 None Reserved for standard service options"; break;
2756     case 4100: str = "Asynchronous Data Service, Revision 1 (9.6 or 14.4 kbps)"; break;
2757     case 4101: str = "Group 3 Facsimile, Revision 1 (9.6 or 14.4 kbps)"; break;
2758     case 4102: str = "Reserved for standard service option"; break;
2759     case 4103: str = "Packet Data Service: Internet or ISO Protocol Stack, Revision 1 (9.6 or 14.4 kbps)"; break;
2760     case 4104: str = "Packet Data Service: CDPD Protocol Stack, Revision 1 (9.6 or 14.4 kbps)"; break;
2761     default:
2762         if ((so >= 4105) && (so <= 32767)) { str = "Reserved for standard service options"; }
2763         else if ((so >= 32769) && (so <= 32771)) { str = "Proprietary QUALCOMM Incorporated"; }
2764         else if ((so >= 32772) && (so <= 32775)) { str = "Proprietary OKI Telecom"; }
2765         else if ((so >= 32776) && (so <= 32779)) { str = "Proprietary Lucent Technologies"; }
2766         else if ((so >= 32780) && (so <=32783)) { str = "Nokia"; }
2767         else if ((so >= 32784) && (so <=32787)) { str = "NORTEL NETWORKS"; }
2768         else if ((so >= 32788) && (so <=32791)) { str = "Sony Electronics Inc."; }
2769         else if ((so >= 32792) && (so <=32795)) { str = "Motorola"; }
2770         else if ((so >= 32796) && (so <=32799)) { str = "QUALCOMM Incorporated"; }
2771         else if ((so >= 32800) && (so <=32803)) { str = "QUALCOMM Incorporated"; }
2772         else if ((so >= 32804) && (so <=32807)) { str = "QUALCOMM Incorporated"; }
2773         else if ((so >= 32808) && (so <=32811)) { str = "QUALCOMM Incorporated"; }
2774         else if ((so >= 32812) && (so <=32815)) { str = "Lucent Technologies"; }
2775         else if ((so >= 32816) && (so <=32819)) { str = "Denso International"; }
2776         else if ((so >= 32820) && (so <=32823)) { str = "Motorola"; }
2777         else if ((so >= 32824) && (so <=32827)) { str = "Denso International"; }
2778         else if ((so >= 32828) && (so <=32831)) { str = "Denso International"; }
2779         else if ((so >= 32832) && (so <=32835)) { str = "Denso International"; }
2780         else if ((so >= 32836) && (so <=32839)) { str = "NEC America"; }
2781         else if ((so >= 32840) && (so <=32843)) { str = "Samsung Electronics"; }
2782         else if ((so >= 32844) && (so <=32847)) { str = "Texas Instruments Incorporated"; }
2783         else if ((so >= 32848) && (so <=32851)) { str = "Toshiba Corporation"; }
2784         else if ((so >= 32852) && (so <=32855)) { str = "LG Electronics Inc."; }
2785         else if ((so >= 32856) && (so <=32859)) { str = "VIA Telecom Inc."; }
2786         else { str = "Reserved"; }
2787         break;
2788     }
2789
2790     proto_tree_add_text(tree, asn1->tvb,
2791         saved_offset, asn1->offset - saved_offset,
2792         "%s %u/0x%04x",
2793         str, so, so);
2794
2795     g_snprintf(add_string, string_len, " - (SO=0x%04x)", so);
2796
2797     EXTRANEOUS_DATA_CHECK(len, 2);
2798 }
2799
2800 static void
2801 param_tdma_sc(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
2802 {
2803     gint32 value;
2804     guint saved_offset;
2805     const gchar *str = NULL;
2806
2807     saved_offset = asn1->offset;
2808
2809     asn1_int32_value_decode(asn1, 1, &value);
2810
2811     switch (value)
2812     {
2813     case 0: str = "Analog Speech Only"; break;
2814     case 1: str = "Digital Speech Only"; break;
2815     case 2: str = "Analog or Digital Speech, Analog Preferred"; break;
2816     case 3: str = "Analog or Digital Speech, Digital Preferred"; break;
2817     case 4: str = "Asynchronous Data"; break;
2818     case 5: str = "G3 Fax"; break;
2819     case 6: str = "Not Used (Service Rejected)"; break;
2820     case 7: str = "STU III (Secure Telephone Unit)"; break;
2821     default:
2822         str = "Reserved, treat as Analog Speech Only";
2823         break;
2824     }
2825
2826     proto_tree_add_text(tree, asn1->tvb,
2827         saved_offset, asn1->offset - saved_offset,
2828         "%s %u",
2829         str, value);
2830
2831     EXTRANEOUS_DATA_CHECK(len, 1);
2832 }
2833
2834 static void
2835 param_dmh_red_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
2836 {
2837     gint32 redind;
2838     guint saved_offset;
2839     const gchar *str = NULL;
2840
2841     EXACT_DATA_CHECK(len, 1);
2842
2843     saved_offset = asn1->offset;
2844
2845     asn1_int32_value_decode(asn1, 1, &redind);
2846
2847     switch (redind)
2848     {
2849     case 0: str = "Not used"; break;
2850     case 1: str = "Call Forwarding Unconditional (CFU)"; break;
2851     case 2: str = "Call Forwarding Busy (CFB)"; break;
2852     case 3: str = "Call Forwarding No Answer (CFNA)"; break;
2853     case 4: str = "Call Forwarding Other (CFO)"; break;
2854     case 5: str = "CD Unspecified"; break;
2855     case 6: str = "CD PSTN"; break;
2856     case 7: str = "CD Private"; break;
2857     case 8: str = "PSTN Tandem"; break;
2858     case 9: str = "Private Tandem"; break;
2859     case 10: str = "Busy"; break;
2860     case 11: str = "Inactive"; break;
2861     case 12: str = "Unassigned"; break;
2862     case 13: str = "Termination Denied"; break;
2863     case 14: str = "CD Failure"; break;
2864     case 15: str = "Explicit Call Transfer (ECT)"; break;
2865     case 16: str = "Mobile Access Hunting (MAH)"; break;
2866     case 17: str = "Flexible Alerting (FA)"; break;
2867     case 18: str = "Abandoned Call Leg"; break;
2868     case 19: str = "Password Call Acceptance (PCA) Call Refused"; break;
2869     case 20: str = "Selective Call Acceptance (SCA) Call Refused"; break;
2870     case 21: str = "Dialogue"; break;
2871     case 22: str = "Call Forwarding Default (CFD)"; break;
2872     case 23: str = "CD Local"; break;
2873     case 24: str = "Voice Mail Retrieval"; break;
2874     default:
2875         if ((redind >= 25) && (redind <= 127))
2876         {
2877             str = "Reserved/Unknown";
2878         }
2879         else
2880         {
2881             str = "Reserved for bilateral agreements";
2882         }
2883         break;
2884     }
2885
2886     proto_tree_add_text(tree, asn1->tvb,
2887         saved_offset, asn1->offset - saved_offset,
2888         "%s (%u)",
2889         str, redind);
2890 }
2891
2892 static void
2893 param_cic(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string, int string_len)
2894 {
2895     gint32 tg, mem;
2896     guint saved_offset;
2897
2898     EXACT_DATA_CHECK(len, 2);
2899
2900     saved_offset = asn1->offset;
2901
2902     asn1_int32_value_decode(asn1, 1, &tg);
2903     asn1_int32_value_decode(asn1, 1, &mem);
2904
2905     proto_tree_add_text(tree, asn1->tvb,
2906         saved_offset, len,
2907         "Trunk Group %u  Member %u",
2908         tg, mem);
2909
2910     g_snprintf(add_string, string_len, "- (%u/%u)", tg, mem);
2911 }
2912
2913 static void
2914 param_qic(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
2915 {
2916     gint32 qic;
2917     guint saved_offset;
2918     const gchar *str = NULL;
2919
2920     EXACT_DATA_CHECK(len, 1);
2921
2922     saved_offset = asn1->offset;
2923
2924     asn1_int32_value_decode(asn1, 1, &qic);
2925
2926     switch (qic)
2927     {
2928     case 0: str = "Not used"; break;
2929     case 1: str = "No information"; break;
2930     case 2: str = "Validation only"; break;
2931     case 3: str = "Validation and profile"; break;
2932     case 4: str = "Profile only"; break;
2933     default:
2934         if ((qic >= 5) && (qic <= 223))
2935         {
2936             str = "Reserved, treat as Validation and profile";
2937         }
2938         else
2939         {
2940             str = "Reserved for extension, treat as Validation and profile";
2941         }
2942         break;
2943     }
2944
2945     proto_tree_add_text(tree, asn1->tvb,
2946         saved_offset, asn1->offset - saved_offset,
2947         str);
2948 }
2949
2950 static void
2951 param_feat_result(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
2952 {
2953     gint32 value;
2954     guint saved_offset;
2955     const gchar *str = NULL;
2956
2957     EXACT_DATA_CHECK(len, 1);
2958
2959     saved_offset = asn1->offset;
2960
2961     asn1_int32_value_decode(asn1, 1, &value);
2962
2963     switch (value)
2964     {
2965     case 0: str = "Not used"; break;
2966     case 1: str = "Unsuccessful"; break;
2967     case 2: str = "Successful"; break;
2968     default:
2969         if ((value >= 3) && (value <= 95)) { str = "Reserved, treat as Unsuccessful"; }
2970         else if ((value >= 96) && (value <= 127)) { str = "Reserved, treat as Unsuccessful"; }
2971         else if ((value >= 128) && (value <= 223)) { str = "Reserved, treat as Successful"; }
2972         else { str = "Reserved for protocol extension, treat as Successful"; }
2973         break;
2974     }
2975
2976     proto_tree_add_text(tree, asn1->tvb,
2977         saved_offset, asn1->offset - saved_offset,
2978         str);
2979 }
2980
2981 const gchar *calling_feat_ind_str[] = {
2982     "Not used",
2983     "Not authorized",
2984     "Authorized but de-activated",
2985     "Authorized and activated"
2986 };
2987
2988 static void
2989 param_calling_feat_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
2990 {
2991     gint32 value;
2992     guint saved_offset;
2993
2994     SHORT_DATA_CHECK(len, 2);
2995
2996     saved_offset = asn1->offset;
2997
2998     asn1_int32_value_decode(asn1, 1, &value);
2999
3000     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3001     proto_tree_add_text(tree, asn1->tvb,
3002         saved_offset, asn1->offset - saved_offset,
3003         "%s :  Call Waiting Feature Activity (CW-FA), %s",
3004         bigbuf,
3005         calling_feat_ind_str[(value & 0xc0) >> 6]);
3006
3007     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
3008     proto_tree_add_text(tree, asn1->tvb,
3009         saved_offset, asn1->offset - saved_offset,
3010         "%s :  Call Forwarding No Answer Feature Activity (CFNA-FA), %s",
3011         bigbuf,
3012         calling_feat_ind_str[(value & 0x30) >> 4]);
3013
3014     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
3015     proto_tree_add_text(tree, asn1->tvb,
3016         saved_offset, asn1->offset - saved_offset,
3017         "%s :  Call Forwarding Busy Feature Activity (CFB-FA), %s",
3018         bigbuf,
3019         calling_feat_ind_str[(value & 0x0c) >> 2]);
3020
3021     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3022     proto_tree_add_text(tree, asn1->tvb,
3023         saved_offset, asn1->offset - saved_offset,
3024         "%s :  Call Forwarding Unconditional Feature Activity (CFU-FA), %s",
3025         bigbuf,
3026         calling_feat_ind_str[value & 0x03]);
3027
3028     saved_offset = asn1->offset;
3029
3030     asn1_int32_value_decode(asn1, 1, &value);
3031
3032     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3033     proto_tree_add_text(tree, asn1->tvb,
3034         saved_offset, asn1->offset - saved_offset,
3035         "%s :  Call Transfer Feature Activity (CT-FA), %s",
3036         bigbuf,
3037         calling_feat_ind_str[(value & 0xc0) >> 6]);
3038
3039     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
3040     proto_tree_add_text(tree, asn1->tvb,
3041         saved_offset, asn1->offset - saved_offset,
3042         "%s :  Voice Privacy Feature Activity (VP-FA), %s",
3043         bigbuf,
3044         calling_feat_ind_str[(value & 0x30) >> 4]);
3045
3046     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
3047     proto_tree_add_text(tree, asn1->tvb,
3048         saved_offset, asn1->offset - saved_offset,
3049         "%s :  Call Delivery Feature Activity (CD-FA), %s",
3050         bigbuf,
3051         calling_feat_ind_str[(value & 0x0c) >> 2]);
3052
3053     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3054     proto_tree_add_text(tree, asn1->tvb,
3055         saved_offset, asn1->offset - saved_offset,
3056         "%s :  Three-Way Calling Feature Activity (3WC-FA), %s",
3057         bigbuf,
3058         calling_feat_ind_str[value & 0x03]);
3059
3060     if (len == 2) return;
3061
3062     saved_offset = asn1->offset;
3063
3064     asn1_int32_value_decode(asn1, 1, &value);
3065
3066     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3067     proto_tree_add_text(tree, asn1->tvb,
3068         saved_offset, asn1->offset - saved_offset,
3069         "%s :  Calling Number ID Restriction Override Feature Activity (CNIROver-FA), %s",
3070         bigbuf,
3071         calling_feat_ind_str[(value & 0xc0) >> 6]);
3072
3073     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
3074     proto_tree_add_text(tree, asn1->tvb,
3075         saved_offset, asn1->offset - saved_offset,
3076         "%s :  Calling Number ID Restriction Feature Activity (CNIR-FA), %s",
3077         bigbuf,
3078         calling_feat_ind_str[(value & 0x30) >> 4]);
3079
3080     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
3081     proto_tree_add_text(tree, asn1->tvb,
3082         saved_offset, asn1->offset - saved_offset,
3083         "%s :  Two number Calling Number ID Presentation Feature Activity (CNIP2-FA), %s",
3084         bigbuf,
3085         calling_feat_ind_str[(value & 0x0c) >> 2]);
3086
3087     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3088     proto_tree_add_text(tree, asn1->tvb,
3089         saved_offset, asn1->offset - saved_offset,
3090         "%s :  One number Calling Number ID Presentation Feature Activity (CNIP1-FA), %s",
3091         bigbuf,
3092         calling_feat_ind_str[value & 0x03]);
3093
3094     if (len == 3) return;
3095
3096     saved_offset = asn1->offset;
3097
3098     asn1_int32_value_decode(asn1, 1, &value);
3099
3100     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3101     proto_tree_add_text(tree, asn1->tvb,
3102         saved_offset, asn1->offset - saved_offset,
3103         "%s :  USCF divert to voice mail Feature Activity (USCFvm-FA), %s",
3104         bigbuf,
3105         calling_feat_ind_str[(value & 0xc0) >> 6]);
3106
3107     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
3108     proto_tree_add_text(tree, asn1->tvb,
3109         saved_offset, asn1->offset - saved_offset,
3110         "%s :  Answer Hold Feature Activity (AH-FA), %s",
3111         bigbuf,
3112         calling_feat_ind_str[(value & 0x30) >> 4]);
3113
3114     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
3115     proto_tree_add_text(tree, asn1->tvb,
3116         saved_offset, asn1->offset - saved_offset,
3117         "%s :  Data Privacy Feature Activity (DP-FA), %s",
3118         bigbuf,
3119         calling_feat_ind_str[(value & 0x0c) >> 2]);
3120
3121     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3122     proto_tree_add_text(tree, asn1->tvb,
3123         saved_offset, asn1->offset - saved_offset,
3124         "%s :  Priority Call Waiting Feature Activity (PCW-FA), %s",
3125         bigbuf,
3126         calling_feat_ind_str[value & 0x03]);
3127
3128     if (len == 4) return;
3129
3130     saved_offset = asn1->offset;
3131
3132     asn1_int32_value_decode(asn1, 1, &value);
3133
3134     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3135     proto_tree_add_text(tree, asn1->tvb,
3136         saved_offset, asn1->offset - saved_offset,
3137         "%s :  CDMA-Concurrent Service Feature Activity (CCS-FA), %s",
3138         bigbuf,
3139         calling_feat_ind_str[(value & 0xc0) >> 6]);
3140
3141     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
3142     proto_tree_add_text(tree, asn1->tvb,
3143         saved_offset, asn1->offset - saved_offset,
3144         "%s :  CDMA-Packet Data Service Feature Activity (CPDS-FA), %s",
3145         bigbuf,
3146         calling_feat_ind_str[(value & 0x30) >> 4]);
3147
3148     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
3149     proto_tree_add_text(tree, asn1->tvb,
3150         saved_offset, asn1->offset - saved_offset,
3151         "%s :  USCF divert to network registered DN Feature Activity (USCFnr-FA), %s",
3152         bigbuf,
3153         calling_feat_ind_str[(value & 0x0c) >> 2]);
3154
3155     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3156     proto_tree_add_text(tree, asn1->tvb,
3157         saved_offset, asn1->offset - saved_offset,
3158         "%s :  USCF divert to mobile station provided DN Feature Activity (USCFms-FA), %s",
3159         bigbuf,
3160         calling_feat_ind_str[value & 0x03]);
3161
3162     if (len == 5) return;
3163
3164     saved_offset = asn1->offset;
3165
3166     asn1_int32_value_decode(asn1, 1, &value);
3167
3168     other_decode_bitfield_value(bigbuf, value, 0xfc, 8);
3169     proto_tree_add_text(tree, asn1->tvb,
3170         saved_offset, asn1->offset - saved_offset,
3171         "%s :  Reserved",
3172         bigbuf);
3173
3174     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3175     proto_tree_add_text(tree, asn1->tvb,
3176         saved_offset, asn1->offset - saved_offset,
3177         "%s :  TDMA Enhanced Privacy and Encryption Feature Activity (TDMA EPE-FA), %s",
3178         bigbuf,
3179         calling_feat_ind_str[value & 0x03]);
3180
3181     EXTRANEOUS_DATA_CHECK(len, 6);
3182 }
3183
3184 static void
3185 param_usage_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
3186 {
3187     gint32 value;
3188     guint saved_offset;
3189     const gchar *str = NULL;
3190
3191     EXACT_DATA_CHECK(len, 1);
3192
3193     saved_offset = asn1->offset;
3194
3195     asn1_int32_value_decode(asn1, 1, &value);
3196
3197     switch (value)
3198     {
3199     case 0: str = "Unspecified"; break;
3200     case 1: str = "Sent-paid call"; break;
3201     case 2: str = "3rd number bill"; break;
3202     default:
3203         str = "Reserved, treat as Unspecified";
3204         break;
3205     }
3206
3207     proto_tree_add_text(tree, asn1->tvb,
3208         saved_offset, asn1->offset - saved_offset,
3209         "%s (%u)",
3210         str,
3211         value);
3212 }
3213
3214 const gchar *tdma_data_feat_ind_str[] = {
3215     "Not used",
3216     "Not authorized",
3217     "Authorized but de-activated",
3218     "Authorized and activated"
3219 };
3220
3221 static void
3222 param_tdma_data_feat_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
3223 {
3224     gint32 value;
3225     guint saved_offset;
3226
3227     SHORT_DATA_CHECK(len, 2);
3228
3229     saved_offset = asn1->offset;
3230
3231     asn1_int32_value_decode(asn1, 1, &value);
3232
3233     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3234     proto_tree_add_text(tree, asn1->tvb,
3235         saved_offset, asn1->offset - saved_offset,
3236         "%s :  Reserved",
3237         bigbuf);
3238
3239     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
3240     proto_tree_add_text(tree, asn1->tvb,
3241         saved_offset, asn1->offset - saved_offset,
3242         "%s :  STU-III Feature Activity (STUIII-FA), %s",
3243         bigbuf,
3244         tdma_data_feat_ind_str[(value & 0x30) >> 4]);
3245
3246     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
3247     proto_tree_add_text(tree, asn1->tvb,
3248         saved_offset, asn1->offset - saved_offset,
3249         "%s :  G3 Fax Feature Activity (G3FAX-FA), %s",
3250         bigbuf,
3251         tdma_data_feat_ind_str[(value & 0x0c) >> 2]);
3252
3253     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3254     proto_tree_add_text(tree, asn1->tvb,
3255         saved_offset, asn1->offset - saved_offset,
3256         "%s :  ADS Feature Activity (ADS-FA), %s",
3257         bigbuf,
3258         tdma_data_feat_ind_str[value & 0x03]);
3259
3260     saved_offset = asn1->offset;
3261
3262     asn1_int32_value_decode(asn1, 1, &value);
3263
3264     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3265     proto_tree_add_text(tree, asn1->tvb,
3266         saved_offset, asn1->offset - saved_offset,
3267         "%s :  Triple Rate data Feature Activity (3RATE-FA), %s",
3268         bigbuf,
3269         tdma_data_feat_ind_str[(value & 0xc0) >> 6]);
3270
3271     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
3272     proto_tree_add_text(tree, asn1->tvb,
3273         saved_offset, asn1->offset - saved_offset,
3274         "%s :  Double Rate data Feature Activity (2RATE-FA), %s",
3275         bigbuf,
3276         tdma_data_feat_ind_str[(value & 0x30) >> 4]);
3277
3278     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
3279     proto_tree_add_text(tree, asn1->tvb,
3280         saved_offset, asn1->offset - saved_offset,
3281         "%s :  Full Rate data Feature Activity (FRATE-FA), %s",
3282         bigbuf,
3283         tdma_data_feat_ind_str[(value & 0x0c) >> 2]);
3284
3285     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3286     proto_tree_add_text(tree, asn1->tvb,
3287         saved_offset, asn1->offset - saved_offset,
3288         "%s :  Half Rate data Feature Activity (HRATE-FA), %s",
3289         bigbuf,
3290         tdma_data_feat_ind_str[value & 0x03]);
3291
3292     EXTRANEOUS_DATA_CHECK(len, 2);
3293 }
3294
3295 static void
3296 param_faulty(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
3297 {
3298     gint32 value;
3299     guint saved_offset;
3300     const gchar *str = NULL;
3301     gint idx;
3302
3303     saved_offset = asn1->offset;
3304     asn1_int32_value_decode(asn1, 1, &value);
3305
3306     str = match_strval_idx((guint32) value, ansi_param_1_strings, &idx);
3307
3308     if (NULL == str)
3309     {
3310         if (len < 2)
3311         {
3312             proto_tree_add_text(tree, asn1->tvb,
3313                 saved_offset, len,
3314                 "Unrecognized parameter ID");
3315             return;
3316         }
3317
3318         asn1->offset = saved_offset;
3319         asn1_uint32_value_decode(asn1, 2, &value);
3320
3321         str = match_strval_idx((guint32) value, ansi_param_2_strings, &idx);
3322
3323         if (NULL == str)
3324         {
3325             if (len < 3)
3326             {
3327                 proto_tree_add_text(tree, asn1->tvb,
3328                     saved_offset, len,
3329                     "Unrecognized parameter ID");
3330                 return;
3331             }
3332
3333             asn1->offset = saved_offset;
3334             asn1_int32_value_decode(asn1, 3, &value);
3335
3336             str = match_strval_idx((guint32) value, ansi_param_3_strings, &idx);
3337
3338             if (NULL == str)
3339             {
3340                 if (((value >= 0x9FFF00) && (value <= 0x9FFF7F)) ||
3341                     ((value >= 0xBFFF00) && (value <= 0xBFFF7F)))
3342                 {
3343                     str = "Reserved for protocol extension";
3344                 }
3345                 else if (((value >= 0x9FFE76) && (value <= 0x9FFE7F)) ||
3346                     ((value >= 0xBFFE76) && (value <= 0xBFFE7F)))
3347                 {
3348                     str = "Reserved for National Network Use";
3349                 }
3350                 else
3351                 {
3352                     str = "Unrecognized parameter ID";
3353                 }
3354             }
3355         }
3356     }
3357
3358     proto_tree_add_text(tree, asn1->tvb,
3359         saved_offset, asn1->offset - saved_offset,
3360         str);
3361
3362     EXTRANEOUS_DATA_CHECK(len, asn1->offset - saved_offset);
3363 }
3364
3365 static void
3366 param_sys_type_code(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
3367 {
3368     gint32 sys_type_code;
3369     guint saved_offset;
3370     const gchar *str = NULL;
3371
3372     EXACT_DATA_CHECK(len, 1);
3373
3374     saved_offset = asn1->offset;
3375
3376     asn1_int32_value_decode(asn1, 1, &sys_type_code);
3377
3378     switch (sys_type_code)
3379     {
3380     case 0: str = "Not used"; break;
3381     case 1: str = "EDS"; break;
3382     case 2: str = "Astronet"; break;
3383     case 3: str = "Lucent Technologies"; break;
3384     case 4: str = "Ericsson"; break;
3385     case 5: str = "GTE"; break;
3386     case 6: str = "Motorola"; break;
3387     case 7: str = "NEC"; break;
3388     case 8: str = "NORTEL"; break;
3389     case 9: str = "NovAtel"; break;
3390     case 10: str = "Plexsys"; break;
3391     case 11: str = "Digital Equipment Corp"; break;
3392     case 12: str = "INET"; break;
3393     case 13: str = "Bellcore"; break;
3394     case 14: str = "Alcatel SEL"; break;
3395     case 15: str = "Compaq (Tandem)"; break;
3396     case 16: str = "QUALCOMM"; break;
3397     case 17: str = "Aldiscon"; break;
3398     case 18: str = "Celcore"; break;
3399     case 19: str = "TELOS"; break;
3400     case 20: str = "ADI Limited (Stanilite)"; break;
3401     case 21: str = "Coral Systems"; break;
3402     case 22: str = "Synacom Technology"; break;
3403     case 23: str = "DSC"; break;
3404     case 24: str = "MCI"; break;
3405     case 25: str = "NewNet"; break;
3406     case 26: str = "Sema Group Telecoms"; break;
3407     case 27: str = "LG Information and Communications"; break;
3408     case 28: str = "CBIS"; break;
3409     case 29: str = "Siemens"; break;
3410     case 30: str = "Samsung Electronics"; break;
3411     case 31: str = "ReadyCom Inc."; break;
3412     case 32: str = "AG Communication Systems"; break;
3413     case 33: str = "Hughes Network Systems"; break;
3414     case 34: str = "Phoenix Wireless Group"; break;
3415     default:
3416         str = "Reserved/Unknown";
3417         break;
3418     }
3419
3420     proto_tree_add_text(tree, asn1->tvb,
3421         saved_offset, asn1->offset - saved_offset,
3422         "Vendor ID (%u) %s",
3423         sys_type_code, str);
3424 }
3425
3426 static void
3427 param_ext_sys_type_code(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string, int string_len)
3428 {
3429     gint32 type;
3430     guint saved_offset;
3431     const gchar *str = NULL;
3432
3433     EXACT_DATA_CHECK(len, 2);
3434
3435     saved_offset = asn1->offset;
3436
3437     asn1_int32_value_decode(asn1, 1, &type);
3438
3439     switch (type)
3440     {
3441     case 0: str = "Not specified"; break;
3442     case 1: str = "Serving MSC"; break;
3443     case 2: str = "Home MSC"; break;
3444     case 3: str = "Gateway MSC"; break;
3445     case 4: str = "HLR"; break;
3446     case 5: str = "VLR"; break;
3447     case 6: str = "EIR (reserved)"; break;
3448     case 7: str = "AC"; break;
3449     case 8: str = "Border MSC"; break;
3450     case 9: str = "Originating MSC"; break;
3451     default:
3452         if ((type >= 10) && (type <= 223)) { str = "Reserved, treat as Not specified"; }
3453         else { str = "Reserved for protocol extension, treat as Not specified"; }
3454         break;
3455     }
3456
3457     proto_tree_add_text(tree, asn1->tvb,
3458         saved_offset, asn1->offset - saved_offset,
3459         "Type (%u) %s",
3460         type,
3461         str);
3462
3463     param_sys_type_code(asn1, tree, len-1, add_string, string_len);
3464 }
3465
3466 static void
3467 param_cdma_sea_win(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
3468 {
3469     gint32 value;
3470     guint saved_offset;
3471
3472     EXACT_DATA_CHECK(len, 1);
3473
3474     saved_offset = asn1->offset;
3475
3476     asn1_int32_value_decode(asn1, 1, &value);
3477
3478     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
3479     proto_tree_add_text(tree, asn1->tvb,
3480         saved_offset, asn1->offset - saved_offset,
3481         "%s :  Reserved",
3482         bigbuf);
3483
3484     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
3485     proto_tree_add_text(tree, asn1->tvb,
3486         saved_offset, asn1->offset - saved_offset,
3487         "%s :  Value %u",
3488         bigbuf,
3489         value & 0x0f);
3490 }
3491
3492 static void
3493 param_cdma_sea_param(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
3494 {
3495     gint32 value;
3496     guint saved_offset;
3497
3498     SHORT_DATA_CHECK(len, 4);
3499
3500     saved_offset = asn1->offset;
3501
3502     asn1_int32_value_decode(asn1, 1, &value);
3503
3504     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
3505     proto_tree_add_text(tree, asn1->tvb,
3506         saved_offset, asn1->offset - saved_offset,
3507         "%s :  Reserved",
3508         bigbuf);
3509
3510     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
3511     proto_tree_add_text(tree, asn1->tvb,
3512         saved_offset, asn1->offset - saved_offset,
3513         "%s :  CDMA Search Window, %u",
3514         bigbuf,
3515         value & 0x0f);
3516
3517     saved_offset = asn1->offset;
3518
3519     asn1_int32_value_decode(asn1, 1, &value);
3520
3521     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3522     proto_tree_add_text(tree, asn1->tvb,
3523         saved_offset, asn1->offset - saved_offset,
3524         "%s :  Reserved",
3525         bigbuf);
3526
3527     other_decode_bitfield_value(bigbuf, value, 0x3f, 8);
3528     proto_tree_add_text(tree, asn1->tvb,
3529         saved_offset, asn1->offset - saved_offset,
3530         "%s :  T_ADD, %u",
3531         bigbuf,
3532         value & 0x3f);
3533
3534     saved_offset = asn1->offset;
3535
3536     asn1_int32_value_decode(asn1, 1, &value);
3537
3538     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3539     proto_tree_add_text(tree, asn1->tvb,
3540         saved_offset, asn1->offset - saved_offset,
3541         "%s :  Reserved",
3542         bigbuf);
3543
3544     other_decode_bitfield_value(bigbuf, value, 0x3f, 8);
3545     proto_tree_add_text(tree, asn1->tvb,
3546         saved_offset, asn1->offset - saved_offset,
3547         "%s :  T_DROP, %u",
3548         bigbuf,
3549         value & 0x3f);
3550
3551     saved_offset = asn1->offset;
3552
3553     asn1_int32_value_decode(asn1, 1, &value);
3554
3555     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
3556     proto_tree_add_text(tree, asn1->tvb,
3557         saved_offset, asn1->offset - saved_offset,
3558         "%s :  T_TDROP, %u",
3559         bigbuf,
3560         value & 0xf0);
3561
3562     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
3563     proto_tree_add_text(tree, asn1->tvb,
3564         saved_offset, asn1->offset - saved_offset,
3565         "%s :  T_COMP, %u",
3566         bigbuf,
3567         value & 0x0f);
3568
3569     EXTRANEOUS_DATA_CHECK(len, 4);
3570 }
3571
3572 static void
3573 param_cdma_code_chan(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
3574 {
3575     gint32 value;
3576     guint saved_offset;
3577
3578     saved_offset = asn1->offset;
3579
3580     asn1_int32_value_decode(asn1, 1, &value);
3581
3582     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3583     proto_tree_add_text(tree, asn1->tvb,
3584         saved_offset, asn1->offset - saved_offset,
3585         "%s :  Reserved",
3586         bigbuf);
3587
3588     other_decode_bitfield_value(bigbuf, value, 0x3f, 8);
3589     proto_tree_add_text(tree, asn1->tvb,
3590         saved_offset, asn1->offset - saved_offset,
3591         "%s :  CDMA Code Channel %u",
3592         bigbuf,
3593         value & 0x3f);
3594
3595     EXTRANEOUS_DATA_CHECK(len, 1);
3596 }
3597
3598 static void
3599 param_chan_data(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
3600 {
3601     gint32 value;
3602     guint saved_offset;
3603     const gchar *str = NULL;
3604
3605     SHORT_DATA_CHECK(len, 3);
3606
3607     saved_offset = asn1->offset;
3608
3609     asn1_int32_value_decode(asn1, 1, &value);
3610
3611     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3612     proto_tree_add_text(tree, asn1->tvb,
3613         saved_offset, asn1->offset - saved_offset,
3614         "%s :  SAT Color Code %u",
3615         bigbuf,
3616         (value & 0xc0 >> 6));
3617
3618     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
3619     proto_tree_add_text(tree, asn1->tvb,
3620         saved_offset, asn1->offset - saved_offset,
3621         "%s :  %s",
3622         (value & 0x20) ? "Reserved" : "Analog Band Class",
3623         bigbuf);
3624
3625     switch ((value & 0x18) >> 3)
3626     {
3627     case 0: str = "DTX disabled (not active/acceptable)"; break;
3628     case 1: str = "Reserved, treat as DTX disabled"; break;
3629     case 2: str = "DTX-low mode (i.e., 8 dB below DTX active/acceptable)"; break;
3630     case 3: str = "DTX mode active or acceptable"; break;
3631     }
3632
3633     other_decode_bitfield_value(bigbuf, value, 0x18, 8);
3634     proto_tree_add_text(tree, asn1->tvb,
3635         saved_offset, asn1->offset - saved_offset,
3636         "%s :  %s",
3637         bigbuf,
3638         str);
3639
3640     other_decode_bitfield_value(bigbuf, value, 0x07, 8);
3641     proto_tree_add_text(tree, asn1->tvb,
3642         saved_offset, asn1->offset - saved_offset,
3643         "%s :  Voice Mobile Attenuation Code (VMAC) %u",
3644         bigbuf,
3645         value & 0x07);
3646
3647     saved_offset = asn1->offset;
3648
3649     asn1_int32_value_decode(asn1, 2, &value);
3650
3651     proto_tree_add_text(tree, asn1->tvb,
3652         saved_offset, asn1->offset - saved_offset,
3653         "Channel Number %u",
3654         value);
3655
3656     EXTRANEOUS_DATA_CHECK(len, 3);
3657 }
3658
3659 static void
3660 param_cdma_plcm(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
3661 {
3662     gint32 value;
3663     guint saved_offset;
3664
3665     EXACT_DATA_CHECK(len, 6);
3666
3667     saved_offset = asn1->offset;
3668
3669     asn1_int32_value_decode(asn1, 1, &value);
3670
3671     other_decode_bitfield_value(bigbuf, value, 0xfc, 8);
3672     proto_tree_add_text(tree, asn1->tvb,
3673         saved_offset, asn1->offset - saved_offset,
3674         "%s :  Reserved",
3675         bigbuf);
3676
3677     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3678     proto_tree_add_text(tree, asn1->tvb,
3679         saved_offset, asn1->offset - saved_offset,
3680         "%s :  CDMA Private Long Code Mask (PLCM) (MSB)",
3681         bigbuf);
3682
3683     saved_offset = asn1->offset;
3684
3685     proto_tree_add_text(tree, asn1->tvb,
3686         saved_offset, len - 1,
3687         "CDMA Private Long Code Mask (PLCM)");
3688
3689     asn1->offset += (len - 1);
3690 }
3691
3692 static void
3693 param_ctrl_chan_data(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
3694 {
3695     gint32 value;
3696     guint saved_offset;
3697
3698     EXACT_DATA_CHECK(len, 4);
3699
3700     saved_offset = asn1->offset;
3701
3702     asn1_int32_value_decode(asn1, 1, &value);
3703
3704     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3705     proto_tree_add_text(tree, asn1->tvb,
3706         saved_offset, asn1->offset - saved_offset,
3707         "%s :  Digital Color Code (DCC)",
3708         bigbuf);
3709
3710     other_decode_bitfield_value(bigbuf, value, 0x38, 8);
3711     proto_tree_add_text(tree, asn1->tvb,
3712         saved_offset, asn1->offset - saved_offset,
3713         "%s :  Reserved",
3714         bigbuf);
3715
3716     other_decode_bitfield_value(bigbuf, value, 0x07, 8);
3717     proto_tree_add_text(tree, asn1->tvb,
3718         saved_offset, asn1->offset - saved_offset,
3719         "%s :  Control Mobile Attenuation Code (CMAC)",
3720         bigbuf);
3721
3722     saved_offset = asn1->offset;
3723
3724     asn1_int32_value_decode(asn1, 2, &value);
3725
3726     proto_tree_add_text(tree, asn1->tvb,
3727         saved_offset, asn1->offset - saved_offset,
3728         "Channel Number (CHNO), %u",
3729         value);
3730
3731     saved_offset = asn1->offset;
3732
3733     asn1_int32_value_decode(asn1, 1, &value);
3734
3735     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
3736     proto_tree_add_text(tree, asn1->tvb,
3737         saved_offset, asn1->offset - saved_offset,
3738         "%s :  Reserved",
3739         bigbuf);
3740
3741     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
3742     proto_tree_add_text(tree, asn1->tvb,
3743         saved_offset, asn1->offset - saved_offset,
3744         "%s :  Supplementary Digital Color Codes (SDCC1)",
3745         bigbuf);
3746
3747     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3748     proto_tree_add_text(tree, asn1->tvb,
3749         saved_offset, asn1->offset - saved_offset,
3750         "%s :  Supplementary Digital Color Codes (SDCC2)",
3751         bigbuf);
3752 }
3753
3754 static void
3755 param_cdma_chan_data(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
3756 {
3757     gint32 value, temp_int;
3758     guint saved_offset;
3759     const gchar *str = NULL;
3760
3761     SHORT_DATA_CHECK(len, 8);
3762
3763     saved_offset = asn1->offset;
3764
3765     asn1_int32_value_decode(asn1, 2, &value);
3766
3767     other_decode_bitfield_value(bigbuf, value >> 8, 0x80, 8);
3768     proto_tree_add_text(tree, asn1->tvb,
3769         saved_offset, 1,
3770         "%s :  Reserved",
3771         bigbuf);
3772
3773     other_decode_bitfield_value(bigbuf, value >> 8, 0x78, 8);
3774     proto_tree_add_text(tree, asn1->tvb,
3775         saved_offset, 1,
3776         "%s :  Frame Offset (%u), %.2f ms",
3777         bigbuf,
3778         (value & 0x7800) >> 11,
3779         ((value & 0x7800) >> 11) * 1.25);
3780
3781     other_decode_bitfield_value(bigbuf, value >> 8, 0x07, 8);
3782     proto_tree_add_text(tree, asn1->tvb,
3783         saved_offset, 1,
3784         "%s :  CDMA Channel Number (MSB), %u",
3785         bigbuf,
3786         value & 0x07ff);
3787
3788     other_decode_bitfield_value(bigbuf, value & 0x00ff, 0xff, 8);
3789     proto_tree_add_text(tree, asn1->tvb,
3790         saved_offset+1, 1,
3791         "%s :  CDMA Channel Number (LSB)",
3792         bigbuf);
3793
3794     saved_offset = asn1->offset;
3795
3796     asn1_int32_value_decode(asn1, 1, &value);
3797
3798     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
3799     proto_tree_add_text(tree, asn1->tvb,
3800         saved_offset, asn1->offset - saved_offset,
3801         "%s :  Reserved",
3802         bigbuf);
3803
3804     temp_int = (value & 0x7c) >> 2;
3805     if ((temp_int < 0) || (temp_int >= (gint) NUM_BAND_CLASS_STR))
3806     {
3807         str = "Reserved";
3808     }
3809     else
3810     {
3811         str = band_class_str[temp_int];
3812     }
3813
3814     other_decode_bitfield_value(bigbuf, value, 0x7c, 8);
3815     proto_tree_add_text(tree, asn1->tvb,
3816         saved_offset, asn1->offset - saved_offset,
3817         "%s :  Band Class, %s",
3818         bigbuf,
3819         str);
3820
3821     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3822     proto_tree_add_text(tree, asn1->tvb,
3823         saved_offset, asn1->offset - saved_offset,
3824         "%s :  Long Code Mask (MSB)",
3825         bigbuf);
3826
3827     asn1_int32_value_decode(asn1, 1, &value);
3828
3829     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
3830     proto_tree_add_text(tree, asn1->tvb,
3831         saved_offset + 1, 1,
3832         "%s :  Long Code Mask",
3833         bigbuf);
3834
3835     asn1_int32_value_decode(asn1, 1, &value);
3836
3837     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
3838     proto_tree_add_text(tree, asn1->tvb,
3839         saved_offset + 2, 1,
3840         "%s :  Long Code Mask",
3841         bigbuf);
3842
3843     asn1_int32_value_decode(asn1, 1, &value);
3844
3845     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
3846     proto_tree_add_text(tree, asn1->tvb,
3847         saved_offset + 3, 1,
3848         "%s :  Long Code Mask",
3849         bigbuf);
3850
3851     asn1_int32_value_decode(asn1, 1, &value);
3852
3853     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
3854     proto_tree_add_text(tree, asn1->tvb,
3855         saved_offset + 4, 1,
3856         "%s :  Long Code Mask",
3857         bigbuf);
3858
3859     asn1_int32_value_decode(asn1, 1, &value);
3860
3861     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
3862     proto_tree_add_text(tree, asn1->tvb,
3863         saved_offset + 5, 1,
3864         "%s :  Long Code Mask (LSB)",
3865         bigbuf);
3866
3867     if (len == 8) return;
3868
3869     saved_offset = asn1->offset;
3870
3871     asn1_int32_value_decode(asn1, 1, &value);
3872
3873     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
3874     proto_tree_add_text(tree, asn1->tvb,
3875         saved_offset, asn1->offset - saved_offset,
3876         "%s :  NP Extension",
3877         bigbuf);
3878
3879     other_decode_bitfield_value(bigbuf, value, 0x78, 8);
3880     proto_tree_add_text(tree, asn1->tvb,
3881         saved_offset, asn1->offset - saved_offset,
3882         "%s :  Nominal Power, %u",
3883         bigbuf,
3884         (value & 0x78) >> 3);
3885
3886     other_decode_bitfield_value(bigbuf, value, 0x07, 8);
3887     proto_tree_add_text(tree, asn1->tvb,
3888         saved_offset, asn1->offset - saved_offset,
3889         "%s :  Number Preamble, %u",
3890         bigbuf,
3891         value & 0x07);
3892
3893     if (len == 9) return;
3894
3895     saved_offset = asn1->offset;
3896
3897     asn1_int32_value_decode(asn1, 1, &value);
3898
3899     proto_tree_add_text(tree, asn1->tvb,
3900         saved_offset, asn1->offset - saved_offset,
3901         "Base Station Protocol Revision, %u",
3902         value);
3903
3904     EXTRANEOUS_DATA_CHECK(len, 10);
3905 }
3906
3907 static void
3908 param_namps_chan_data(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
3909 {
3910     gint32 value;
3911     guint saved_offset;
3912     const gchar *str = NULL;
3913
3914     saved_offset = asn1->offset;
3915
3916     asn1_int32_value_decode(asn1, 1, &value);
3917
3918     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
3919     proto_tree_add_text(tree, asn1->tvb,
3920         saved_offset, asn1->offset - saved_offset,
3921         "%s :  Reserved",
3922         bigbuf);
3923
3924     switch ((value & 0x1c) >> 2)
3925     {
3926     case 0: str = "Channel Data parameter SCC field applies"; break;
3927     case 1: str = "Digital SAT Color Code 1 (ignore SCC field)"; break;
3928     case 2: str = "Digital SAT Color Code 2 (ignore SCC field)"; break;
3929     case 3: str = "Digital SAT Color Code 3 (ignore SCC field)"; break;
3930     case 4: str = "Digital SAT Color Code 4 (ignore SCC field)"; break;
3931     case 5: str = "Digital SAT Color Code 5 (ignore SCC field)"; break;
3932     case 6: str = "Digital SAT Color Code 6 (ignore SCC field)"; break;
3933     case 7: str = "Digital SAT Color Code 7 (ignore SCC field)"; break;
3934     }
3935
3936     other_decode_bitfield_value(bigbuf, value, 0x1c, 8);
3937     proto_tree_add_text(tree, asn1->tvb,
3938         saved_offset, asn1->offset - saved_offset,
3939         "%s :  Color Code Indicator (CCIndicator), %s",
3940         bigbuf,
3941         str);
3942
3943     switch (value & 0x03)
3944     {
3945     case 0: str = "Wide. 30 kHz AMPS voice channel"; break;
3946     case 1: str = "Upper. 10 kHz NAMPS voice channel"; break;
3947     case 2: str = "Middle. 10 kHz NAMPS voice channel"; break;
3948     case 3: str = "Lower. 10 kHz NAMPS voice channel"; break;
3949     }
3950
3951     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3952     proto_tree_add_text(tree, asn1->tvb,
3953         saved_offset, asn1->offset - saved_offset,
3954         "%s :  Narrow Analog Voice Channel Assignment (NAVCA), %s",
3955         bigbuf,
3956         str);
3957
3958     EXTRANEOUS_DATA_CHECK(len, 1);
3959 }
3960
3961 static void
3962 param_cdma_ms_meas_chan_id(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
3963 {
3964     gint32 value, temp_int;
3965     guint saved_offset;
3966     const gchar *str = NULL;
3967
3968     SHORT_DATA_CHECK(len, 2);
3969
3970     saved_offset = asn1->offset;
3971
3972     asn1_int32_value_decode(asn1, 2, &value);
3973
3974     temp_int = (value & 0xf800) >> 11;
3975     if ((temp_int < 0) || (temp_int >= (gint) NUM_BAND_CLASS_STR))
3976     {
3977         str = "Reserved";
3978     }
3979     else
3980     {
3981         str = band_class_str[temp_int];
3982     }
3983
3984     other_decode_bitfield_value(bigbuf, value >> 8, 0xf8, 8);
3985     proto_tree_add_text(tree, asn1->tvb,
3986         saved_offset, 1,
3987         "%s :  Band Class, %s",
3988         bigbuf,
3989         str);
3990
3991     other_decode_bitfield_value(bigbuf, value >> 8, 0x07, 8);
3992     proto_tree_add_text(tree, asn1->tvb,
3993         saved_offset, 1,
3994         "%s :  CDMA Channel Number (MSB), %u",
3995         bigbuf,
3996         value & 0x07ff);
3997
3998     other_decode_bitfield_value(bigbuf, value & 0x00ff, 0xff, 8);
3999     proto_tree_add_text(tree, asn1->tvb,
4000         saved_offset+1, 1,
4001         "%s :  CDMA Channel Number (LSB)",
4002         bigbuf);
4003
4004     EXTRANEOUS_DATA_CHECK(len, 2);
4005 }
4006
4007 static void
4008 param_tdma_chan_data(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
4009 {
4010     gint32 value;
4011     guint saved_offset;
4012     const gchar *str = NULL;
4013
4014     SHORT_DATA_CHECK(len, 5);
4015
4016     saved_offset = asn1->offset;
4017
4018     asn1_int32_value_decode(asn1, 1, &value);
4019
4020     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
4021     proto_tree_add_text(tree, asn1->tvb,
4022         saved_offset, asn1->offset - saved_offset,
4023         "%s :  Reserved",
4024         bigbuf);
4025
4026     switch (value & 0x1f)
4027     {
4028     case 0: str = "Analog (not used if ChannelData is present)"; break;
4029     case 1: str = "Assigned to timeslot 1, full rate"; break;
4030     case 2: str = "Assigned to timeslot 2, full rate"; break;
4031     case 3: str = "Assigned to timeslot 3, full rate"; break;
4032     case 4: str = "Assigned to timeslots 1, 4 and 2, 5 Double rate"; break;
4033     case 5: str = "Assigned to timeslots 1, 4 and 3, 6 Double rate"; break;
4034     case 6: str = "Assigned to timeslots 2, 5 and 3, 6 Double rate"; break;
4035     case 9: str = "Assigned to timeslot 1, half rate"; break;
4036     case 10: str = "Assigned to timeslot 2, half rate"; break;
4037     case 11: str = "Assigned to timeslot 3, half rate"; break;
4038     case 12: str = "Assigned to timeslot 4, half rate"; break;
4039     case 13: str = "Assigned to timeslot 5, half rate"; break;
4040     case 14: str = "Assigned to timeslot 6, half rate"; break;
4041     case 15: str = "Assigned to timeslot 1, 2, 3, 4, 5, 6 Triple rate"; break;
4042     default:
4043         str = "Reserved, treat as Analog";
4044         break;
4045     }
4046
4047     other_decode_bitfield_value(bigbuf, value, 0x1f, 8);
4048     proto_tree_add_text(tree, asn1->tvb,
4049         saved_offset, asn1->offset - saved_offset,
4050         "%s :  Time Slot and Rate indicator (TSR), %s",
4051         bigbuf,
4052         str);
4053
4054     saved_offset = asn1->offset;
4055
4056     asn1_int32_value_decode(asn1, 1, &value);
4057
4058     proto_tree_add_text(tree, asn1->tvb,
4059         saved_offset, asn1->offset - saved_offset,
4060         "Digital Verification Color Code (DVCC) %u",
4061         value);
4062
4063     saved_offset = asn1->offset;
4064
4065     asn1_int32_value_decode(asn1, 1, &value);
4066
4067     switch ((value & 0xf0) >> 4)
4068     {
4069     case 0: str = "800 MHz"; break;
4070     case 1: str = "1800 MHz"; break;
4071     default:
4072         str = "Reserved, treat as 800 MHz";
4073         break;
4074     }
4075
4076     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
4077     proto_tree_add_text(tree, asn1->tvb,
4078         saved_offset, asn1->offset - saved_offset,
4079         "%s :  Hyper Band, %s",
4080         bigbuf,
4081         str);
4082
4083     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
4084     proto_tree_add_text(tree, asn1->tvb,
4085         saved_offset, asn1->offset - saved_offset,
4086         "%s :  Digital Mobile Attenuation Code (DMAC) %u",
4087         bigbuf,
4088         value & 0x0f);
4089
4090     saved_offset = asn1->offset;
4091
4092     asn1_int32_value_decode(asn1, 2, &value);
4093
4094     other_decode_bitfield_value(bigbuf, value >> 8, 0xff, 8);
4095     proto_tree_add_text(tree, asn1->tvb,
4096         saved_offset, 1,
4097         "%s :  Channel Number (MSB), %u",
4098         bigbuf,
4099         value);
4100
4101     other_decode_bitfield_value(bigbuf, value & 0x00ff, 0xff, 8);
4102     proto_tree_add_text(tree, asn1->tvb,
4103         saved_offset + 1, 1,
4104         "%s :  Channel Number (LSB)",
4105         bigbuf);
4106
4107     EXTRANEOUS_DATA_CHECK(len, 5);
4108 }
4109
4110 static void
4111 param_tdma_call_mode(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
4112 {
4113     gint32 value;
4114     guint saved_offset;
4115
4116     saved_offset = asn1->offset;
4117
4118     asn1_int32_value_decode(asn1, 1, &value);
4119
4120     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
4121     proto_tree_add_text(tree, asn1->tvb,
4122         saved_offset, asn1->offset - saved_offset,
4123         "%s :  Reserved",
4124         bigbuf);
4125
4126     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
4127     proto_tree_add_text(tree, asn1->tvb,
4128         saved_offset, asn1->offset - saved_offset,
4129         "%s :  %sxtended modulation and framing",
4130         bigbuf,
4131         (value & 0x20) ? "E" : "No e");
4132
4133     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
4134     proto_tree_add_text(tree, asn1->tvb,
4135         saved_offset, asn1->offset - saved_offset,
4136         "%s :  Other voice coding %sacceptable",
4137         bigbuf,
4138         (value & 0x10) ? "" : "not ");
4139
4140     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
4141     proto_tree_add_text(tree, asn1->tvb,
4142         saved_offset, asn1->offset - saved_offset,
4143         "%s :  Other DQPSK channel %sacceptable",
4144         bigbuf,
4145         (value & 0x08) ? "" : "not ");
4146
4147     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
4148     proto_tree_add_text(tree, asn1->tvb,
4149         saved_offset, asn1->offset - saved_offset,
4150         "%s :  Half rate digital traffic channel %sacceptable",
4151         bigbuf,
4152         (value & 0x04) ? "" : "not ");
4153
4154     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
4155     proto_tree_add_text(tree, asn1->tvb,
4156         saved_offset, asn1->offset - saved_offset,
4157         "%s :  Full rate digital traffic channel %sacceptable",
4158         bigbuf,
4159         (value & 0x02) ? "" : "not ");
4160
4161     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
4162     proto_tree_add_text(tree, asn1->tvb,
4163         saved_offset, asn1->offset - saved_offset,
4164         "%s :  AMPS channel %sacceptable",
4165         bigbuf,
4166         (value & 0x01) ? "" : "not ");
4167
4168     EXTRANEOUS_DATA_CHECK(len, 1);
4169 }
4170
4171 static void
4172 param_cdma_call_mode(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
4173 {
4174     gint32 value;
4175     guint saved_offset;
4176
4177     saved_offset = asn1->offset;
4178
4179     asn1_int32_value_decode(asn1, 1, &value);
4180
4181     if (len == 1)
4182     {
4183         /* assuming older spec. no IS-880 */
4184
4185         other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
4186         proto_tree_add_text(tree, asn1->tvb,
4187             saved_offset, asn1->offset - saved_offset,
4188             "%s :  Reserved",
4189             bigbuf);
4190     }
4191     else
4192     {
4193         other_decode_bitfield_value(bigbuf, value, 0x80, 8);
4194         proto_tree_add_text(tree, asn1->tvb,
4195             saved_offset, asn1->offset - saved_offset,
4196             "%s :  450 MHz channel (Band Class 5) %sacceptable",
4197             bigbuf,
4198             (value & 0x80) ? "" : "not ");
4199
4200         other_decode_bitfield_value(bigbuf, value, 0x40, 8);
4201         proto_tree_add_text(tree, asn1->tvb,
4202             saved_offset, asn1->offset - saved_offset,
4203             "%s :  Korean PCS channel (Band Class 4) %sacceptable",
4204             bigbuf,
4205             (value & 0x40) ? "" : "not ");
4206
4207         other_decode_bitfield_value(bigbuf, value, 0x20, 8);
4208         proto_tree_add_text(tree, asn1->tvb,
4209             saved_offset, asn1->offset - saved_offset,
4210             "%s :  JTACS channel (Band Class 3) %sacceptable",
4211             bigbuf,
4212             (value & 0x20) ? "" : "not ");
4213
4214         other_decode_bitfield_value(bigbuf, value, 0x10, 8);
4215         proto_tree_add_text(tree, asn1->tvb,
4216             saved_offset, asn1->offset - saved_offset,
4217             "%s :  TACS channel (Band Class 2) %sacceptable",
4218             bigbuf,
4219             (value & 0x10) ? "" : "not ");
4220     }
4221
4222     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
4223     proto_tree_add_text(tree, asn1->tvb,
4224         saved_offset, asn1->offset - saved_offset,
4225         "%s :  CDMA 1900 MHz channel (Band Class 1) %sacceptable",
4226         bigbuf,
4227         (value & 0x08) ? "" : "not ");
4228
4229     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
4230     proto_tree_add_text(tree, asn1->tvb,
4231         saved_offset, asn1->offset - saved_offset,
4232         "%s :  NAMPS 800 MHz channel %sacceptable",
4233         bigbuf,
4234         (value & 0x04) ? "" : "not ");
4235
4236     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
4237     proto_tree_add_text(tree, asn1->tvb,
4238         saved_offset, asn1->offset - saved_offset,
4239         "%s :  AMPS 800 MHz channel %sacceptable",
4240         bigbuf,
4241         (value & 0x02) ? "" : "not ");
4242
4243     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
4244     proto_tree_add_text(tree, asn1->tvb,
4245         saved_offset, asn1->offset - saved_offset,
4246         "%s :  CDMA 800 MHz channel (Band Class 0) %sacceptable",
4247         bigbuf,
4248         (value & 0x01) ? "" : "not ");
4249
4250     if (len == 1) return;
4251
4252     saved_offset = asn1->offset;
4253
4254     asn1_int32_value_decode(asn1, 1, &value);
4255
4256     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
4257     proto_tree_add_text(tree, asn1->tvb,
4258         saved_offset, asn1->offset - saved_offset,
4259         "%s :  Reserved",
4260         bigbuf);
4261
4262     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
4263     proto_tree_add_text(tree, asn1->tvb,
4264         saved_offset, asn1->offset - saved_offset,
4265         "%s :  Secondary 800 MHz channel (Band Class 10) %sacceptable",
4266         bigbuf,
4267         (value & 0x10) ? "" : "not ");
4268
4269     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
4270     proto_tree_add_text(tree, asn1->tvb,
4271         saved_offset, asn1->offset - saved_offset,
4272         "%s :  900 MHz channel (Band Class 9) %sacceptable",
4273         bigbuf,
4274         (value & 0x08) ? "" : "not ");
4275
4276     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
4277     proto_tree_add_text(tree, asn1->tvb,
4278         saved_offset, asn1->offset - saved_offset,
4279         "%s :  1800 MHz channel (Band Class 8) %sacceptable",
4280         bigbuf,
4281         (value & 0x04) ? "" : "not ");
4282
4283     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
4284     proto_tree_add_text(tree, asn1->tvb,
4285         saved_offset, asn1->offset - saved_offset,
4286         "%s :  700 MHz channel (Band Class 7) %sacceptable",
4287         bigbuf,
4288         (value & 0x02) ? "" : "not ");
4289
4290     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
4291     proto_tree_add_text(tree, asn1->tvb,
4292         saved_offset, asn1->offset - saved_offset,
4293         "%s :  2 GHz channel (Band Class 6) %sacceptable",
4294         bigbuf,
4295         (value & 0x01) ? "" : "not ");
4296
4297     EXTRANEOUS_DATA_CHECK(len, 2);
4298 }
4299
4300 static void
4301 param_namps_call_mode(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
4302 {
4303     gint32 value;
4304     guint saved_offset;
4305
4306     saved_offset = asn1->offset;
4307
4308     asn1_int32_value_decode(asn1, 1, &value);
4309
4310     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
4311     proto_tree_add_text(tree, asn1->tvb,
4312         saved_offset, asn1->offset - saved_offset,
4313         "%s :  Reserved",
4314         bigbuf);
4315
4316     proto_tree_add_text(tree, asn1->tvb,
4317         saved_offset, asn1->offset - saved_offset,
4318         ".... %u... :  AMPS 1800 MHz channel %sacceptable",
4319         (value & 0x08) >> 3, (value & 0x08) ? "" : "not ");
4320
4321     proto_tree_add_text(tree, asn1->tvb,
4322         saved_offset, asn1->offset - saved_offset,
4323         ".... .%u.. :  NAMPS 1800 MHz channel %sacceptable",
4324         (value & 0x04) >> 2, (value & 0x04) ? "" : "not ");
4325
4326     proto_tree_add_text(tree, asn1->tvb,
4327         saved_offset, asn1->offset - saved_offset,
4328         ".... ..%u. :  AMPS 800 MHz channel %sacceptable",
4329         (value & 0x02) >> 1, (value & 0x02) ? "" : "not ");
4330
4331     proto_tree_add_text(tree, asn1->tvb,
4332         saved_offset, asn1->offset - saved_offset,
4333         ".... ...%u :  NAMPS 800 MHz channel %sacceptable",
4334         value & 0x01, (value & 0x01) ? "" : "not ");
4335
4336     EXTRANEOUS_DATA_CHECK(len, 1);
4337 }
4338
4339 static void
4340 param_mob_rev(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
4341 {
4342     gint32 value;
4343     guint saved_offset;
4344
4345     saved_offset = asn1->offset;
4346
4347     asn1_int32_value_decode(asn1, 1, &value);
4348
4349     proto_tree_add_text(tree, asn1->tvb,
4350         saved_offset, asn1->offset - saved_offset,
4351         "Revision %u",
4352         value);
4353
4354     EXTRANEOUS_DATA_CHECK(len, 1);
4355 }
4356
4357 static void
4358 param_cdma_band_class(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
4359 {
4360     gint32 value, temp_int;
4361     guint saved_offset;
4362     const gchar *str = NULL;
4363
4364     saved_offset = asn1->offset;
4365
4366     asn1_int32_value_decode(asn1, 1, &value);
4367
4368     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
4369     proto_tree_add_text(tree, asn1->tvb,
4370         saved_offset, asn1->offset - saved_offset,
4371         "%s :  Reserved",
4372         bigbuf);
4373
4374     temp_int = value & 0x1f;
4375     if ((temp_int < 0) || (temp_int >= (gint) NUM_BAND_CLASS_STR))
4376     {
4377         str = "Reserved";
4378     }
4379     else
4380     {
4381         str = band_class_str[temp_int];
4382     }
4383
4384     other_decode_bitfield_value(bigbuf, value, 0x1f, 8);
4385     proto_tree_add_text(tree, asn1->tvb,
4386         saved_offset, asn1->offset - saved_offset,
4387         "%s :  Band Class %s",
4388         bigbuf,
4389         str);
4390
4391     EXTRANEOUS_DATA_CHECK(len, 1);
4392 }
4393
4394 static void
4395 param_calling_party_name(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
4396 {
4397     gint32 value;
4398     guint saved_offset;
4399     const gchar *str = NULL;
4400
4401     SHORT_DATA_CHECK(len, 1);
4402
4403     saved_offset = asn1->offset;
4404
4405     asn1_int32_value_decode(asn1, 1, &value);
4406
4407     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
4408     proto_tree_add_text(tree, asn1->tvb,
4409         saved_offset, asn1->offset - saved_offset,
4410         "%s :  Spec. has hardcoded as 0 0 1",
4411         bigbuf);
4412
4413     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
4414     proto_tree_add_text(tree, asn1->tvb,
4415         saved_offset, asn1->offset - saved_offset,
4416         "%s :  Availability, %s",
4417         bigbuf,
4418         (value & 0x10) ?  "Name not available" : "Name available/unknown");
4419
4420     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
4421     proto_tree_add_text(tree, asn1->tvb,
4422         saved_offset, asn1->offset - saved_offset,
4423         "%s :  Reserved",
4424         bigbuf);
4425
4426     switch (value & 0x03)
4427     {
4428     case 0: str = "Presentation allowed"; break;
4429     case 1: str = "Presentation restricted"; break;
4430     case 2: str = "Blocking toggle"; break;
4431     case 3: str = "No indication"; break;
4432     }
4433
4434     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
4435     proto_tree_add_text(tree, asn1->tvb,
4436         saved_offset, asn1->offset - saved_offset,
4437         "%s :  Presentation Status, %s",
4438         bigbuf,
4439         str);
4440
4441     if (len == 1) return;
4442
4443     saved_offset = asn1->offset;
4444
4445     proto_tree_add_text(tree, asn1->tvb,
4446         asn1->offset, len - 1,
4447         "IA5 Digits");
4448
4449     asn1->offset += (len - 1);
4450 }
4451
4452 static void
4453 param_red_party_name(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
4454 {
4455     gint32 value;
4456     guint saved_offset;
4457     const gchar *str = NULL;
4458
4459     SHORT_DATA_CHECK(len, 1);
4460
4461     saved_offset = asn1->offset;
4462
4463     asn1_int32_value_decode(asn1, 1, &value);
4464
4465     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
4466     proto_tree_add_text(tree, asn1->tvb,
4467         saved_offset, asn1->offset - saved_offset,
4468         "%s :  Spec. has hardcoded as 0 1 1",
4469         bigbuf);
4470
4471     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
4472     proto_tree_add_text(tree, asn1->tvb,
4473         saved_offset, asn1->offset - saved_offset,
4474         "%s :  Availability, %s",
4475         bigbuf,
4476         (value & 0x10) ?  "Name not available" : "Name available/unknown");
4477
4478     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
4479     proto_tree_add_text(tree, asn1->tvb,
4480         saved_offset, asn1->offset - saved_offset,
4481         "%s :  Reserved",
4482         bigbuf);
4483
4484     switch (value & 0x03)
4485     {
4486     case 0: str = "Presentation allowed"; break;
4487     case 1: str = "Presentation restricted"; break;
4488     case 2: str = "Blocking toggle"; break;
4489     case 3: str = "No indication"; break;
4490     }
4491
4492     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
4493     proto_tree_add_text(tree, asn1->tvb,
4494         saved_offset, asn1->offset - saved_offset,
4495         "%s :  Presentation Status, %s",
4496         bigbuf,
4497         str);
4498
4499     if (len == 1) return;
4500
4501     saved_offset = asn1->offset;
4502
4503     proto_tree_add_text(tree, asn1->tvb,
4504         asn1->offset, len - 1,
4505         "IA5 Digits");
4506
4507     asn1->offset += (len - 1);
4508 }
4509
4510 static void
4511 param_srvc_id(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
4512 {
4513     proto_tree_add_text(tree, asn1->tvb,
4514         asn1->offset, len,
4515         "Service Identifier (Spec. does not define clearly)");
4516
4517     asn1->offset += len;
4518 }
4519
4520 static void
4521 param_all_or_none(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
4522 {
4523     gint32 value;
4524     guint saved_offset;
4525     const gchar *str = NULL;
4526
4527     EXACT_DATA_CHECK(len, 1);
4528
4529     saved_offset = asn1->offset;
4530
4531     asn1_int32_value_decode(asn1, 1, &value);
4532
4533     switch (value)
4534     {
4535     case 0: str = "Not used"; break;
4536     case 1: str = "All changes must succeed or none should be applied"; break;
4537     case 2: str = "Treat each change independently"; break;
4538     default:
4539         if ((value >= 3) && (value <= 223)) { str = "Reserved, treat as All changes must succeed or none should be applied"; }
4540         else { str = "Reserved for protocol extension, treat as All changes must succeed or none should be applied"; }
4541         break;
4542     }
4543
4544     proto_tree_add_text(tree, asn1->tvb,
4545         saved_offset, asn1->offset - saved_offset,
4546         str);
4547 }
4548
4549 static void
4550 param_change(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
4551 {
4552     gint32 value;
4553     guint saved_offset;
4554     const gchar *str = NULL;
4555
4556     EXACT_DATA_CHECK(len, 1);
4557
4558     saved_offset = asn1->offset;
4559
4560     asn1_int32_value_decode(asn1, 1, &value);
4561
4562     switch (value)
4563     {
4564     case 0: str = "Not used"; break;
4565     case 1: str = "Set Data Item to Default Value"; break;
4566     case 2: str = "Add Data Item"; break;
4567     case 3: str = "Delete Data Item"; break;
4568     case 4: str = "Replace Data Item with associated DataValue"; break;
4569     default:
4570         if ((value >= 5) && (value <= 223)) { str = "Reserved, treat as Set Data Item to Default Value"; }
4571         else { str = "Reserved for protocol extension, treat as Set Data Item to Default Value"; }
4572         break;
4573     }
4574
4575     proto_tree_add_text(tree, asn1->tvb,
4576         saved_offset, asn1->offset - saved_offset,
4577         str);
4578 }
4579
4580 static void
4581 param_data_result(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
4582 {
4583     gint32 value;
4584     guint saved_offset;
4585     const gchar *str = NULL;
4586
4587     EXACT_DATA_CHECK(len, 1);
4588
4589     saved_offset = asn1->offset;
4590
4591     asn1_int32_value_decode(asn1, 1, &value);
4592
4593     switch (value)
4594     {
4595     case 0: str = "Not used"; break;
4596     case 1: str = "Successful"; break;
4597     case 2: str = "Unsuccessful, unspecified"; break;
4598     case 3: str = "Unsuccessful, no default value available"; break;
4599     default:
4600         if ((value >= 4) && (value <= 95)) { str = "Reserved, treat as Unsuccessful"; }
4601         else if ((value >= 96) && (value <= 127)) { str = "Reserved for protocol extension, treat as Unsuccessful"; }
4602         else if ((value >= 128) && (value <= 223)) { str = "Reserved, treat as Successful"; }
4603         else { str = "Reserved for protocol extension, treat as Successful"; }
4604         break;
4605     }
4606
4607     proto_tree_add_text(tree, asn1->tvb,
4608         saved_offset, asn1->offset - saved_offset,
4609         str);
4610 }
4611
4612 static void
4613 param_fail_cause(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
4614 {
4615     guint saved_offset;
4616
4617     SHORT_DATA_CHECK(len, 2);
4618
4619     saved_offset = asn1->offset;
4620
4621     proto_tree_add_text(tree, asn1->tvb,
4622         saved_offset, len,
4623         "ISUP Cause Indicator");
4624
4625     asn1->offset += len;
4626 }
4627
4628 static void
4629 param_fail_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
4630 {
4631     gint32 value;
4632     guint saved_offset;
4633     const gchar *str = NULL;
4634
4635     EXACT_DATA_CHECK(len, 1);
4636
4637     saved_offset = asn1->offset;
4638
4639     asn1_int32_value_decode(asn1, 1, &value);
4640
4641     switch (value)
4642     {
4643     case 0: str = "Not used"; break;
4644     case 1: str = "Call abandoned"; break;
4645     case 2: str = "Resource disconnect"; break;
4646     case 3: str = "Failure at MSC"; break;
4647     case 4: str = "SSFT expiration"; break;
4648     default:
4649         if ((value >= 5) && (value <= 223)) { str = "Reserved, ignore"; }
4650         else { str = "Reserved for protocol extension, ignore"; }
4651         break;
4652     }
4653
4654     proto_tree_add_text(tree, asn1->tvb,
4655         saved_offset, asn1->offset - saved_offset,
4656         str);
4657 }
4658
4659 static void
4660 param_resume_pic(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
4661 {
4662     gint32 value;
4663     guint saved_offset;
4664     const gchar *str = NULL;
4665
4666     EXACT_DATA_CHECK(len, 1);
4667
4668     saved_offset = asn1->offset;
4669
4670     asn1_int32_value_decode(asn1, 1, &value);
4671
4672     switch (value)
4673     {
4674     case 0: str = "Not used"; break;
4675     case 1: str = "Continue Call Processing"; break;
4676     case 2: str = "Collect Information PIC"; break;
4677     case 3: str = "Analyze Information PIC"; break;
4678     case 4: str = "Select Route PIC"; break;
4679     case 5: str = "Authorize Origination_Attempt PIC"; break;
4680     case 6: str = "Authorize Call Setup PIC"; break;
4681     case 7: str = "Send Call PIC"; break;
4682     case 8: str = "O Alerting PIC"; break;
4683     case 9: str = "O Active PIC"; break;
4684     case 10: str = "O Suspended PIC"; break;
4685     case 11: str = "O Null PIC"; break;
4686     case 32: str = "Select Facility PIC"; break;
4687     case 33: str = "Present Call PIC"; break;
4688     case 34: str = "Authorize Termination Attempt PIC"; break;
4689     case 35: str = "T Alerting PIC"; break;
4690     case 36: str = "T Active PIC"; break;
4691     case 37: str = "T Suspended PIC"; break;
4692     case 38: str = "T Null PIC"; break;
4693     default:
4694         if ((value >= 12) && (value <= 31)) { str = "Reserved, treat as Not used"; }
4695         else if ((value >= 39) && (value <= 223)) { str = "Reserved, ignore"; }
4696         else { str = "Reserved for protocol extension, ignore"; }
4697         break;
4698     }
4699
4700     proto_tree_add_text(tree, asn1->tvb,
4701         saved_offset, asn1->offset - saved_offset,
4702         "Point in Call, %s (%u)",
4703         str,
4704         value);
4705 }
4706
4707 static void
4708 param_special_rsc(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
4709 {
4710     gint32 value, i;
4711     guint saved_offset;
4712     const gchar *str = NULL;
4713
4714     saved_offset = asn1->offset;
4715
4716     i = 0;
4717
4718     do
4719     {
4720         asn1_int32_value_decode(asn1, 1, &value);
4721
4722         switch (value)
4723         {
4724         case 0: str = "Not used"; break;
4725         case 1: str = "DTMF tone detector"; break;
4726         case 2: str = "Automatic Speech Recognition - Speaker Independent - Digits"; break;
4727         case 3: str = "Automatic Speech Recognition - Speaker Independent - Speech User Interface Version 1"; break;
4728         default:
4729             if ((value >= 4) && (value <= 223)) { str = "Reserved, treat as Not used"; }
4730             else { str = "Reserved for protocol extension, treat as Not used"; }
4731             break;
4732         }
4733
4734         proto_tree_add_text(tree, asn1->tvb,
4735             saved_offset, asn1->offset - saved_offset,
4736             "[%u] Resource Type, %s",
4737             i++,
4738             str);
4739
4740         saved_offset = asn1->offset;
4741     }
4742     while ((len - i) > 0);
4743 }
4744
4745 static void
4746 param_time_date_offset(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
4747 {
4748     gint32 value;
4749     guint saved_offset;
4750
4751     EXACT_DATA_CHECK(len, 2);
4752
4753     saved_offset = asn1->offset;
4754
4755     asn1_int32_value_decode(asn1, 2, &value);
4756
4757     proto_tree_add_text(tree, asn1->tvb,
4758         saved_offset, asn1->offset - saved_offset,
4759         "In minutes (%u)",
4760         value);
4761 }
4762
4763 static void
4764 param_network_tmsi(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
4765 {
4766     gint32 value, addr_type, first_dig;
4767     guint saved_offset;
4768     const gchar *str = NULL;
4769     guchar *poctets;
4770
4771     SHORT_DATA_CHECK(len, 4);
4772
4773     saved_offset = asn1->offset;
4774
4775     asn1_int32_value_decode(asn1, 4, &value);
4776
4777     proto_tree_add_text(tree, asn1->tvb,
4778         saved_offset, asn1->offset - saved_offset,
4779         "TMSI Code, %u",
4780         value);
4781
4782     if (len == 4) return;
4783
4784     saved_offset = asn1->offset;
4785
4786     asn1_int32_value_decode(asn1, 1, &value);
4787
4788     first_dig = Dgt_tbcd.out[(value & 0xf0) >> 4];
4789
4790     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
4791     proto_tree_add_text(tree, asn1->tvb,
4792         saved_offset, asn1->offset - saved_offset,
4793         "%s :  First digit of TMSI Zone, %c",
4794         bigbuf,
4795         first_dig);
4796
4797     addr_type = value & 0x0f;
4798     switch (addr_type)
4799     {
4800     case 0: str = "Not used"; break;
4801     case 1: str = "E.212 based routing"; break;
4802     case 2: str = "20-bit TDMA TMSI"; break;
4803     case 3: str = "24-bit TDMA TMSI"; break;
4804     default:
4805         str = "Reserved for protocol extension, treat as Not used";
4806         break;
4807     }
4808
4809     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
4810     proto_tree_add_text(tree, asn1->tvb,
4811         saved_offset, asn1->offset - saved_offset,
4812         "%s :  Type of addressing, %s",
4813         bigbuf,
4814         str);
4815
4816     if (len == 5) return;
4817
4818     saved_offset = asn1->offset;
4819
4820     asn1_string_value_decode(asn1, (len-5), &poctets);
4821
4822     bigbuf[0] = first_dig;
4823
4824     my_dgt_tbcd_unpack(bigbuf+1, poctets, (len-5), &Dgt_tbcd);
4825     g_free(poctets);
4826
4827     proto_tree_add_text(tree, asn1->tvb,
4828         saved_offset - 1, (len-5)+1,
4829         "TMSI Zone, %s",
4830         bigbuf);
4831 }
4832
4833 static void
4834 param_reqd_param_mask(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
4835 {
4836     gint32 value;
4837     guint saved_offset;
4838
4839     saved_offset = asn1->offset;
4840
4841     asn1_int32_value_decode(asn1, 1, &value);
4842
4843     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
4844     proto_tree_add_text(tree, asn1->tvb,
4845         saved_offset, asn1->offset - saved_offset,
4846         "%s :  Reserved",
4847         bigbuf);
4848
4849     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
4850     proto_tree_add_text(tree, asn1->tvb,
4851         saved_offset, asn1->offset - saved_offset,
4852         "%s :  Location Area ID (LOCID) %srequired",
4853         bigbuf,
4854         (value & 0x10) ? "" : "not ");
4855
4856     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
4857     proto_tree_add_text(tree, asn1->tvb,
4858         saved_offset, asn1->offset - saved_offset,
4859         "%s :  TMSI %srequired",
4860         bigbuf,
4861         (value & 0x08) ? "" : "not ");
4862
4863     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
4864     proto_tree_add_text(tree, asn1->tvb,
4865         saved_offset, asn1->offset - saved_offset,
4866         "%s :  ESN %srequired",
4867         bigbuf,
4868         (value & 0x04) ? "" : "not ");
4869
4870     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
4871     proto_tree_add_text(tree, asn1->tvb,
4872         saved_offset, asn1->offset - saved_offset,
4873         "%s :  MIN %srequired",
4874         bigbuf,
4875         (value & 0x02) ? "" : "not ");
4876
4877     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
4878     proto_tree_add_text(tree, asn1->tvb,
4879         saved_offset, asn1->offset - saved_offset,
4880         "%s :  IMSI %srequired",
4881         bigbuf,
4882         (value & 0x01) ? "" : "not ");
4883
4884     EXTRANEOUS_DATA_CHECK(len, 1);
4885 }
4886
4887 static void
4888 param_srvc_red_cause(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
4889 {
4890     gint32 value;
4891     guint saved_offset;
4892     const gchar *str = NULL;
4893
4894     saved_offset = asn1->offset;
4895
4896     asn1_int32_value_decode(asn1, 1, &value);
4897
4898     switch (value)
4899     {
4900     case 0: str = "Not used"; break;
4901     case 1: str = "Normal Registration"; break;
4902     case 2: str = "System Not Found"; break;
4903     case 3: str = "Protocol Mismatch"; break;
4904     case 4: str = "Registration Rejection"; break;
4905     case 5: str = "Wrong SID"; break;
4906     case 6: str = "Wrong NID"; break;
4907     default:
4908         if ((value >= 7) && (value <= 223)) { str = "Reserved, treat as Normal Registration"; }
4909         else { str = "Reserved for protocol extension. If unknown, treat as Normal Registration"; }
4910         break;
4911     }
4912
4913     proto_tree_add_text(tree, asn1->tvb,
4914         saved_offset, asn1->offset - saved_offset,
4915         str);
4916
4917     EXTRANEOUS_DATA_CHECK(len, 1);
4918 }
4919
4920 static void
4921 param_srvc_red_info(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
4922 {
4923     gint32 value;
4924     guint saved_offset;
4925
4926     saved_offset = asn1->offset;
4927
4928     asn1_int32_value_decode(asn1, 1, &value);
4929
4930     other_decode_bitfield_value(bigbuf, value, 0xfc, 8);
4931     proto_tree_add_text(tree, asn1->tvb,
4932         saved_offset, asn1->offset - saved_offset,
4933         "%s :  Reserved",
4934         bigbuf);
4935
4936     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
4937     proto_tree_add_text(tree, asn1->tvb,
4938         saved_offset, asn1->offset - saved_offset,
4939         "%s :  NDSS Status (NDS), %ssuppressed",
4940         bigbuf,
4941         (value & 0x02) ? "" : "not ");
4942
4943     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
4944     proto_tree_add_text(tree, asn1->tvb,
4945         saved_offset, asn1->offset - saved_offset,
4946         "%s :  Return If Fail (RIF), If MS fails to access the redirected system, MS shall %sreturn to the serving system",
4947         bigbuf,
4948         (value & 0x01) ? "" : "not ");
4949
4950     EXTRANEOUS_DATA_CHECK(len, 1);
4951 }
4952
4953 static void
4954 param_roaming_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
4955 {
4956     gint32 value;
4957     guint saved_offset;
4958     const gchar *str = NULL;
4959
4960     saved_offset = asn1->offset;
4961
4962     asn1_int32_value_decode(asn1, 1, &value);
4963
4964     switch (value)
4965     {
4966     case 0: str = "Roaming Indicator On"; break;
4967     case 1: str = "Roaming Indicator Off"; break;
4968     case 2: str = "Roaming Indicator Flashing"; break;
4969     case 3: str = "Out of Neighborhood"; break;
4970     case 4: str = "Out of Building"; break;
4971     case 5: str = "Roaming - Preferred System"; break;
4972     case 6: str = "Roaming - Available System"; break;
4973     case 7: str = "Roaming - Alliance Partner"; break;
4974     case 8: str = "Roaming - Premium Partner"; break;
4975     case 9: str = "Roaming - Full Service Functionality"; break;
4976     case 10: str = "Roaming - Partial Service Functionality"; break;
4977     case 11: str = "Roaming Banner On"; break;
4978     case 12: str = "Roaming Banner Off"; break;
4979     default:
4980         if ((value >= 13) && (value <= 63)) { str = "Reserved for Standard Enhanced Roaming Indicator Numbers"; }
4981         else if ((value >= 64) && (value <= 127)) { str = "Reserved for Non-Standard Enhanced Roaming Indicator Numbers"; }
4982         else { str = "Reserved"; }
4983         break;
4984     }
4985
4986     proto_tree_add_text(tree, asn1->tvb,
4987         saved_offset, asn1->offset - saved_offset,
4988         str);
4989
4990     EXTRANEOUS_DATA_CHECK(len, 1);
4991 }
4992
4993 static void
4994 param_cdma_pci(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
4995 {
4996     gint32 value;
4997     guint saved_offset;
4998
4999     EXACT_DATA_CHECK(len, 1);
5000
5001     saved_offset = asn1->offset;
5002
5003     asn1_int32_value_decode(asn1, 1, &value);
5004
5005     other_decode_bitfield_value(bigbuf, value, 0xfe, 8);
5006     proto_tree_add_text(tree, asn1->tvb,
5007         saved_offset, asn1->offset - saved_offset,
5008         "%s :  Reserved",
5009         bigbuf);
5010
5011     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
5012     proto_tree_add_text(tree, asn1->tvb,
5013         saved_offset, asn1->offset - saved_offset,
5014         "%s :  CDMA PWR_COMB_IND",
5015         bigbuf);
5016 }
5017
5018 static void
5019 param_cdma_chan_num(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
5020 {
5021     gint32 value;
5022     guint saved_offset;
5023
5024     SHORT_DATA_CHECK(len, 2);
5025
5026     saved_offset = asn1->offset;
5027
5028     asn1_int32_value_decode(asn1, 2, &value);
5029
5030     other_decode_bitfield_value(bigbuf, value >> 8, 0xf8, 8);
5031     proto_tree_add_text(tree, asn1->tvb,
5032         saved_offset, 1,
5033         "%s :  Reserved",
5034         bigbuf);
5035
5036     other_decode_bitfield_value(bigbuf, value >> 8, 0x07, 8);
5037     proto_tree_add_text(tree, asn1->tvb,
5038         saved_offset, 1,
5039         "%s :  CDMA Channel Number (MSB) %u",
5040         bigbuf,
5041         value & 0x07ff);
5042
5043     other_decode_bitfield_value(bigbuf, value & 0x00ff, 0xff, 8);
5044     proto_tree_add_text(tree, asn1->tvb,
5045         saved_offset+1, 1,
5046         "%s :  CDMA Channel Number (LSB)",
5047         bigbuf);
5048
5049     EXTRANEOUS_DATA_CHECK(len, 2);
5050 }
5051
5052 static void
5053 param_cdma_sci(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
5054 {
5055     gint32 value;
5056     guint saved_offset;
5057
5058     EXACT_DATA_CHECK(len, 1);
5059
5060     saved_offset = asn1->offset;
5061
5062     asn1_int32_value_decode(asn1, 1, &value);
5063
5064     other_decode_bitfield_value(bigbuf, value, 0xf8, 8);
5065     proto_tree_add_text(tree, asn1->tvb,
5066         saved_offset, asn1->offset - saved_offset,
5067         "%s :  Reserved",
5068         bigbuf);
5069
5070     other_decode_bitfield_value(bigbuf, value, 0x07, 8);
5071     proto_tree_add_text(tree, asn1->tvb,
5072         saved_offset, asn1->offset - saved_offset,
5073         "%s :  Slot Cycle Index, %u",
5074         bigbuf,
5075         (value & 0x07));
5076 }
5077
5078 static void
5079 param_vp_report(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
5080 {
5081     gint32 value;
5082     guint saved_offset;
5083     const gchar *str = NULL;
5084
5085     EXACT_DATA_CHECK(len, 1);
5086
5087     saved_offset = asn1->offset;
5088
5089     asn1_int32_value_decode(asn1, 1, &value);
5090
5091     switch (value)
5092     {
5093     case 0: str = "Not used"; break;
5094     case 1: str = "Voice Privacy not attempted"; break;
5095     case 2: str = "Voice Privacy no response"; break;
5096     case 3: str = "Voiec Privacy successful is active"; break;
5097     case 4: str = "Voice Privacy failed"; break;
5098     default:
5099         if ((value >= 5) && (value <= 223)) { str = "Reserved, treat as Voice Privacy not attempted"; }
5100         else { str = "Reserved for protocol extension, treat as Voice Privacy not attempted"; }
5101         break;
5102     }
5103
5104     proto_tree_add_text(tree, asn1->tvb,
5105         saved_offset, asn1->offset - saved_offset,
5106         "%s (%u)",
5107         str,
5108         value);
5109 }
5110
5111 static void
5112 param_cdma_scm(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
5113 {
5114     gint32 value;
5115     guint saved_offset;
5116     const gchar *str = NULL;
5117
5118     saved_offset = asn1->offset;
5119
5120     asn1_int32_value_decode(asn1, 1, &value);
5121
5122     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
5123     proto_tree_add_text(tree, asn1->tvb,
5124         saved_offset, asn1->offset - saved_offset,
5125         "%s :  Reserved",
5126         bigbuf);
5127
5128     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
5129     proto_tree_add_text(tree, asn1->tvb,
5130         saved_offset, asn1->offset - saved_offset,
5131         "%s :  Dual-mode Indicator, %s",
5132         bigbuf,
5133         (value & 0x40) ? "Dual mode CDMA" : "CDMA only");
5134
5135     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
5136     proto_tree_add_text(tree, asn1->tvb,
5137         saved_offset, asn1->offset - saved_offset,
5138         "%s :  Slotted mode Indicator, %s",
5139         bigbuf,
5140         (value & 0x20) ? "slotted capable" : "slotted incapable");
5141
5142     other_decode_bitfield_value(bigbuf, value, 0x18, 8);
5143     proto_tree_add_text(tree, asn1->tvb,
5144         saved_offset, asn1->offset - saved_offset,
5145         "%s :  Reserved",
5146         bigbuf);
5147
5148     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
5149     proto_tree_add_text(tree, asn1->tvb,
5150         saved_offset, asn1->offset - saved_offset,
5151         "%s :  Analog Transmission, %s",
5152         bigbuf,
5153         (value & 0x04) ? "discontinuous" : "continuous");
5154
5155     switch (value & 0x03)
5156     {
5157     case 0: str = "Power Class I"; break;
5158     case 1: str = "Power Class II"; break;
5159     case 2: str = "Power Class III"; break;
5160     case 3: str = "Reserved"; break;
5161     }
5162
5163     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
5164     proto_tree_add_text(tree, asn1->tvb,
5165         saved_offset, asn1->offset - saved_offset,
5166         "%s :  %s",
5167         bigbuf,
5168         str);
5169
5170     EXTRANEOUS_DATA_CHECK(len, 1);
5171 }
5172
5173 static void
5174 param_ota_result_code(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
5175 {
5176     gint32 value;
5177     guint saved_offset;
5178     const gchar *str = NULL;
5179
5180     saved_offset = asn1->offset;
5181
5182     asn1_int32_value_decode(asn1, 1, &value);
5183
5184     switch (value)
5185     {
5186     case 0: str = "Accepted - Successful"; break;
5187     case 1: str = "Rejected - Unknown cause"; break;
5188     case 2: str = "Computation Failure - E.g., unable to compute A-key"; break;
5189     case 3: str = "CSC Rejected - CSC challenge failure"; break;
5190     case 4: str = "Unrecognized OTASPCallEntry"; break;
5191     case 5: str = "Unsupported AKeyProtocolVersion(s)"; break;
5192     case 6: str = "Unable to Commit"; break;
5193     default:
5194         if ((value >= 7) && (value <= 223)) { str = "Reserved, treat as Rejected - Unknown cause"; }
5195         else { str = "Reserved for protocol extension, treat as Rejected - Unknown cause"; }
5196         break;
5197     }
5198
5199     proto_tree_add_text(tree, asn1->tvb,
5200         saved_offset, asn1->offset - saved_offset,
5201         "%s (%u)",
5202         str,
5203         value);
5204
5205     EXTRANEOUS_DATA_CHECK(len, 1);
5206 }
5207
5208 static void
5209 param_cdma_scm2(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
5210 {
5211     gint32 value;
5212     guint saved_offset;
5213
5214     saved_offset = asn1->offset;
5215
5216     asn1_int32_value_decode(asn1, 1, &value);
5217
5218     proto_tree_add_text(tree, asn1->tvb,
5219         saved_offset, asn1->offset - saved_offset,
5220         "Value %u",
5221         value);
5222
5223     EXTRANEOUS_DATA_CHECK(len, 1);
5224 }
5225
5226 static void
5227 param_tdma_term_cap(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
5228 {
5229     gint32 value;
5230     guint saved_offset;
5231     const gchar *str = NULL;
5232
5233     SHORT_DATA_CHECK(len, 4);
5234
5235     saved_offset = asn1->offset;
5236
5237     asn1_int32_value_decode(asn1, 1, &value);
5238
5239     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
5240     proto_tree_add_text(tree, asn1->tvb,
5241         saved_offset, asn1->offset - saved_offset,
5242         "%s :  Reserved",
5243         bigbuf);
5244
5245     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
5246     proto_tree_add_text(tree, asn1->tvb,
5247         saved_offset, asn1->offset - saved_offset,
5248         "%s :  1800 MHz F channel %sacceptable",
5249         bigbuf,
5250         (value & 0x40) ? "" : "not ");
5251
5252     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
5253     proto_tree_add_text(tree, asn1->tvb,
5254         saved_offset, asn1->offset - saved_offset,
5255         "%s :  1800 MHz E channel %sacceptable",
5256         bigbuf,
5257         (value & 0x20) ? "" : "not ");
5258
5259     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
5260     proto_tree_add_text(tree, asn1->tvb,
5261         saved_offset, asn1->offset - saved_offset,
5262         "%s :  1800 MHz D channel %sacceptable",
5263         bigbuf,
5264         (value & 0x10) ? "" : "not ");
5265
5266     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
5267     proto_tree_add_text(tree, asn1->tvb,
5268         saved_offset, asn1->offset - saved_offset,
5269         "%s :  1800 MHz C channel %sacceptable",
5270         bigbuf,
5271         (value & 0x08) ? "" : "not ");
5272
5273     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
5274     proto_tree_add_text(tree, asn1->tvb,
5275         saved_offset, asn1->offset - saved_offset,
5276         "%s :  1800 MHz B channel %sacceptable",
5277         bigbuf,
5278         (value & 0x04) ? "" : "not ");
5279
5280     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
5281     proto_tree_add_text(tree, asn1->tvb,
5282         saved_offset, asn1->offset - saved_offset,
5283         "%s :  %s acceptable",
5284         bigbuf,
5285         (value & 0x02) ? "1800 MHz A channel" : "1800 MHz A&B Digital channel not");
5286
5287     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
5288     proto_tree_add_text(tree, asn1->tvb,
5289         saved_offset, asn1->offset - saved_offset,
5290         "%s :  800 MHz A&B channel %sacceptable",
5291         bigbuf,
5292         (value & 0x01) ? "" : "not ");
5293
5294     saved_offset = asn1->offset;
5295
5296     asn1_int32_value_decode(asn1, 1, &value);
5297
5298     other_decode_bitfield_value(bigbuf, value, 0xfc, 8);
5299     proto_tree_add_text(tree, asn1->tvb,
5300         saved_offset, asn1->offset - saved_offset,
5301         "%s :  Reserved",
5302         bigbuf);
5303
5304     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
5305     proto_tree_add_text(tree, asn1->tvb,
5306         saved_offset, asn1->offset - saved_offset,
5307         "%s :  IS-641 Voice Coder %sacceptable",
5308         bigbuf,
5309         (value & 0x02) ? "" : "not ");
5310
5311     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
5312     proto_tree_add_text(tree, asn1->tvb,
5313         saved_offset, asn1->offset - saved_offset,
5314         "%s :  VSELP Voice Coder %sacceptable",
5315         bigbuf,
5316         (value & 0x01) ? "" : "not ");
5317
5318     saved_offset = asn1->offset;
5319
5320     asn1_int32_value_decode(asn1, 1, &value);
5321
5322     switch (value)
5323     {
5324     case 0: str = "EIA-553 or IS-54-A"; break;
5325     case 1: str = "TIA/EIA-627 (IS-54-B)"; break;
5326     case 2: str = "IS-136"; break;
5327     case 3: str = "Reserved (ANSI J-STD-011)"; break;
5328     case 4: str = "PV 0 as published in TIA/EIA-136-0 and IS-136-A"; break;
5329     case 5: str = "PV 1 as published in TIA/EIA-136-A"; break;
5330     case 6: str = "PV 2 as published in TIA/EIA-136-A"; break;
5331     case 7: str = "PV 3 as published in TIA/EIA-136-A"; break;
5332     default:
5333         str = "Reserved, treat as EIA-553 or IS-54-A";
5334         break;
5335     }
5336
5337     proto_tree_add_text(tree, asn1->tvb,
5338         saved_offset, 1,
5339         "Protocol Version, %s",
5340         str);
5341
5342     saved_offset = asn1->offset;
5343
5344     asn1_int32_value_decode(asn1, 1, &value);
5345
5346     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
5347     proto_tree_add_text(tree, asn1->tvb,
5348         saved_offset, asn1->offset - saved_offset,
5349         "%s :  Triple Rate (3RATE) %ssupported",
5350         bigbuf,
5351         (value & 0x80) ? "" : "not ");
5352
5353     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
5354     proto_tree_add_text(tree, asn1->tvb,
5355         saved_offset, asn1->offset - saved_offset,
5356         "%s :  Double Rate (2RATE) %ssupported",
5357         bigbuf,
5358         (value & 0x40) ? "" : "not ");
5359
5360     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
5361     proto_tree_add_text(tree, asn1->tvb,
5362         saved_offset, asn1->offset - saved_offset,
5363         "%s :  Full Rate (FRATE) %ssupported",
5364         bigbuf,
5365         (value & 0x20) ? "" : "not ");
5366
5367     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
5368     proto_tree_add_text(tree, asn1->tvb,
5369         saved_offset, asn1->offset - saved_offset,
5370         "%s :  Half Rate (HRATE) %ssupported",
5371         bigbuf,
5372         (value & 0x10) ? "" : "not ");
5373
5374     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
5375     proto_tree_add_text(tree, asn1->tvb,
5376         saved_offset, asn1->offset - saved_offset,
5377         "%s :  Analog Voice (AVOX) %ssupported",
5378         bigbuf,
5379         (value & 0x08) ? "" : "not ");
5380
5381     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
5382     proto_tree_add_text(tree, asn1->tvb,
5383         saved_offset, asn1->offset - saved_offset,
5384         "%s :  Secure Telephone Unit III (STU3) %ssupported",
5385         bigbuf,
5386         (value & 0x04) ? "" : "not ");
5387
5388     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
5389     proto_tree_add_text(tree, asn1->tvb,
5390         saved_offset, asn1->offset - saved_offset,
5391         "%s :  Group 3 Fax (G3FAX) %ssupported",
5392         bigbuf,
5393         (value & 0x02) ? "" : "not ");
5394
5395     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
5396     proto_tree_add_text(tree, asn1->tvb,
5397         saved_offset, asn1->offset - saved_offset,
5398         "%s :  Asynchronous Data (ADS) %ssupported",
5399         bigbuf,
5400         (value & 0x01) ? "" : "not ");
5401
5402     EXTRANEOUS_DATA_CHECK(len, 4);
5403 }
5404
5405 static void
5406 param_tdma_voice_coder(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
5407 {
5408     gint32 value, vc;
5409     guint orig_offset, saved_offset;
5410     const gchar *str = NULL;
5411
5412     SHORT_DATA_CHECK(len, 2);
5413
5414     orig_offset = asn1->offset;
5415     saved_offset = asn1->offset;
5416
5417     do
5418     {
5419         asn1_int32_value_decode(asn1, 1, &value);
5420
5421         other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
5422         proto_tree_add_text(tree, asn1->tvb,
5423             saved_offset, asn1->offset - saved_offset,
5424             "%s :  Reserved",
5425             bigbuf);
5426
5427         vc = (value & 0x0f);
5428         switch (vc)
5429         {
5430         case 0: str = "Not used"; break;
5431         case 1: str = "VSELP Voice Coder acceptable"; break;
5432         case 2: str = "IS-641 Voice Coder acceptable"; break;
5433         case 6: str = "Reserved for SOC/BSMC Specific signaling. If unknown, use any acceptable value"; break;
5434         default:
5435             if ((vc >= 3) && (vc <= 5)) { str = "Reserved. Ignore on reception, use any acceptable value"; }
5436             else if ((vc >= 7) && (vc <= 12)) { str = "Reserved. Ignore on reception, use any acceptable value"; }
5437             else if ((vc >= 13) && (vc <= 15)) { str = "Reserved for protocol extension. If unknown, use any acceptable value"; }
5438             break;
5439         }
5440
5441         other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
5442         proto_tree_add_text(tree, asn1->tvb,
5443             saved_offset, asn1->offset - saved_offset,
5444             "%s :  Voice Coder, %s",
5445             bigbuf,
5446             str);
5447
5448         saved_offset = asn1->offset;
5449     }
5450     while ((len - (saved_offset - orig_offset)) > 0);
5451 }
5452
5453 static void
5454 param_cdma_pilot_pn(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
5455 {
5456     gint32 value;
5457     guint saved_offset;
5458
5459     SHORT_DATA_CHECK(len, 2);
5460
5461     saved_offset = asn1->offset;
5462
5463     asn1_int32_value_decode(asn1, 2, &value);
5464
5465     other_decode_bitfield_value(bigbuf, value >> 8, 0xfe, 8);
5466     proto_tree_add_text(tree, asn1->tvb,
5467         saved_offset, 1,
5468         "%s :  Reserved",
5469         bigbuf);
5470
5471     other_decode_bitfield_value(bigbuf, value >> 8, 0x01, 8);
5472     proto_tree_add_text(tree, asn1->tvb,
5473         saved_offset, 1,
5474         "%s :  Pilot PN (MSB), %u",
5475         bigbuf, value & 0x01ff);
5476
5477     other_decode_bitfield_value(bigbuf, value & 0x00ff, 0xff, 8);
5478     proto_tree_add_text(tree, asn1->tvb,
5479         saved_offset + 1, 1,
5480         "%s :  Pilot PN (LSB)",
5481         bigbuf);
5482
5483     EXTRANEOUS_DATA_CHECK(len, 2);
5484 }
5485
5486 static void
5487 param_cdma_pilot_strength(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
5488 {
5489     gint32 value;
5490     guint saved_offset;
5491
5492     EXACT_DATA_CHECK(len, 1);
5493
5494     saved_offset = asn1->offset;
5495
5496     asn1_int32_value_decode(asn1, 1, &value);
5497
5498     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
5499     proto_tree_add_text(tree, asn1->tvb,
5500         saved_offset, asn1->offset - saved_offset,
5501         "%s :  Reserved",
5502         bigbuf);
5503
5504     other_decode_bitfield_value(bigbuf, value, 0x3f, 8);
5505     proto_tree_add_text(tree, asn1->tvb,
5506         saved_offset, asn1->offset - saved_offset,
5507         "%s :  Value %u",
5508         bigbuf,
5509         value & 0x3f);
5510 }
5511
5512 static void
5513 param_trunk_stat(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
5514 {
5515     gint32 value;
5516     guint saved_offset;
5517     const gchar *str = NULL;
5518
5519     EXACT_DATA_CHECK(len, 1);
5520
5521     saved_offset = asn1->offset;
5522
5523     asn1_int32_value_decode(asn1, 1, &value);
5524
5525     switch (value)
5526     {
5527     case 0: str = "Idle"; break;
5528     case 1: str = "Blocked"; break;
5529     default:
5530         if ((value >= 2) && (value <= 223)) { str = "Reserved, treat as ERROR or Blocked"; }
5531         else { str = "Reserved for protocol extension, treat as ERROR or Blocked"; }
5532         break;
5533     }
5534
5535     proto_tree_add_text(tree, asn1->tvb,
5536         saved_offset, asn1->offset - saved_offset,
5537         "Trunk Status, %s",
5538         str);
5539 }
5540
5541 static void
5542 param_pref_lang_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
5543 {
5544     gint32 value;
5545     guint saved_offset;
5546     const gchar *str = NULL;
5547
5548     saved_offset = asn1->offset;
5549
5550     asn1_int32_value_decode(asn1, 1, &value);
5551
5552     switch (value)
5553     {
5554     case 0: str = "Unspecified"; break;
5555     case 1: str = "English"; break;
5556     case 2: str = "French"; break;
5557     case 3: str = "Spanish"; break;
5558     case 4: str = "German"; break;
5559     case 5: str = "Portuguese"; break;
5560     default:
5561         str = "Reserved, treat as Unspecified";
5562         break;
5563     }
5564
5565     proto_tree_add_text(tree, asn1->tvb,
5566         saved_offset, asn1->offset - saved_offset,
5567         "Preferred Language, %s",
5568         str);
5569
5570     EXTRANEOUS_DATA_CHECK(len, 1);
5571 }
5572
5573 static void
5574 param_rand_valtime(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
5575 {
5576     gint32 value;
5577     guint saved_offset;
5578     const gchar *str = NULL;
5579     char *buf;
5580
5581     saved_offset = asn1->offset;
5582
5583     asn1_int32_value_decode(asn1, 1, &value);
5584
5585     if (value == 0)
5586     {
5587         str = "RAND shall not be stored";
5588     }
5589     else
5590     {
5591         buf=ep_alloc(64);
5592         g_snprintf(buf, 64, "RAND may be used for %u minutes", value);
5593         str = buf;
5594     }
5595
5596     proto_tree_add_text(tree, asn1->tvb,
5597         saved_offset, asn1->offset - saved_offset,
5598         str);
5599
5600     EXTRANEOUS_DATA_CHECK(len, 1);
5601 }
5602
5603 static void
5604 param_tdma_burst_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
5605 {
5606     gint32 value;
5607     guint saved_offset;
5608     const gchar *str = NULL;
5609
5610     EXACT_DATA_CHECK(len, 1);
5611
5612     saved_offset = asn1->offset;
5613
5614     asn1_int32_value_decode(asn1, 1, &value);
5615
5616     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
5617     proto_tree_add_text(tree, asn1->tvb,
5618         saved_offset, asn1->offset - saved_offset,
5619         "%s :  Reserved",
5620         bigbuf);
5621
5622     other_decode_bitfield_value(bigbuf, value, 0x7c, 8);
5623     proto_tree_add_text(tree, asn1->tvb,
5624         saved_offset, asn1->offset - saved_offset,
5625         "%s :  Time Alignment Offset (TA), %u",
5626         bigbuf,
5627         (value & 0x7c) >> 2);
5628
5629     switch (value & 0x03)
5630     {
5631     case 0: str = "Transmit normal burst after cell-to-cell handoff"; break;
5632     case 1: str = "Transmit normal burst after handoff within cell"; break;
5633     case 2: str = "Transmit shortened burst after cell-to-cell handoff"; break;
5634     case 3: str = "Reserved, treat with RETURN ERROR"; break;
5635     }
5636
5637     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
5638     proto_tree_add_text(tree, asn1->tvb,
5639         saved_offset, asn1->offset - saved_offset,
5640         "%s :  Burst Code, %s",
5641         bigbuf,
5642         str);
5643 }
5644
5645 static void
5646 param_orig_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
5647 {
5648     gint32 value;
5649     guint saved_offset;
5650     const gchar *str = NULL;
5651
5652     EXACT_DATA_CHECK(len, 1);
5653
5654     saved_offset = asn1->offset;
5655
5656     asn1_int32_value_decode(asn1, 1, &value);
5657
5658     switch (value)
5659     {
5660     case 0: str = "Not used"; break;
5661     case 1: str = "Prior agreement"; break;
5662     case 2: str = "Origination denied"; break;
5663     case 3: str = "Local calls only"; break;
5664     case 4: str = "Selected leading digits of directory number or of international E.164 number, see Digits(Destination)"; break;
5665     case 5: str = "Selected leading digits of directory number or of international E.164 number and local calls only, see Digits(Destination)"; break;
5666     case 6: str = "National long distance"; break;
5667     case 7: str = "International calls"; break;
5668     case 8: str = "Single directory number or international E.164 number, see Digits(Destination)"; break;
5669     default:
5670         if ((value >= 9) && (value <= 223)) { str = "Reserved, treat as Local calls only"; }
5671         else { str = "Reserved for protocol extension, treat as Local calls only"; }
5672         break;
5673     }
5674
5675     proto_tree_add_text(tree, asn1->tvb,
5676         saved_offset, asn1->offset - saved_offset,
5677         "Allowed Call Types, %s",
5678         str);
5679 }
5680
5681 static void
5682 param_ms_loc(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
5683 {
5684     gint32 value;
5685     guint saved_offset;
5686
5687     SHORT_DATA_CHECK(len, 7);
5688
5689     saved_offset = asn1->offset;
5690
5691     asn1_int32_value_decode(asn1, 3, &value);
5692
5693     proto_tree_add_text(tree, asn1->tvb,
5694         saved_offset, asn1->offset - saved_offset,
5695         "Latitude in tenths of a second, %u",
5696         value);
5697
5698     saved_offset = asn1->offset;
5699
5700     asn1_int32_value_decode(asn1, 3, &value);
5701
5702     proto_tree_add_text(tree, asn1->tvb,
5703         saved_offset, asn1->offset - saved_offset,
5704         "Longitude in tenths of a second, %u",
5705         value);
5706
5707     saved_offset = asn1->offset;
5708
5709     asn1_int32_value_decode(asn1, MIN(len - 6, 2), &value);
5710
5711     proto_tree_add_text(tree, asn1->tvb,
5712         saved_offset, asn1->offset - saved_offset,
5713         "Resolution in units of 1 foot, %u",
5714         value);
5715
5716     EXTRANEOUS_DATA_CHECK(len, 8);
5717 }
5718
5719 static void
5720 param_unique_chal_rep(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
5721 {
5722     gint32 value;
5723     guint saved_offset;
5724     const gchar *str = NULL;
5725
5726     saved_offset = asn1->offset;
5727
5728     asn1_int32_value_decode(asn1, 1, &value);
5729
5730     switch (value)
5731     {
5732     case 0: str = "Not used"; break;
5733     case 1: str = "Unique Challenge not attempted"; break;
5734     case 2: str = "Unique Challenge no response"; break;
5735     case 3: str = "Unique Challenge successful"; break;
5736     case 4: str = "Unique Challenge failed"; break;
5737     default:
5738         if ((value >= 5) && (value <= 223)) { str = "Reserved, treat as Unique Challenge not attempted"; }
5739         else { str = "Reserved for protocol extension, treat as Unique Challenge not attempted"; }
5740         break;
5741     }
5742
5743     proto_tree_add_text(tree, asn1->tvb,
5744         saved_offset, asn1->offset - saved_offset,
5745         str);
5746
5747     EXTRANEOUS_DATA_CHECK(len, 1);
5748 }
5749
5750 static void
5751 param_rand_unique(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
5752 {
5753     guint saved_offset;
5754
5755     EXACT_DATA_CHECK(len, 3);
5756
5757     saved_offset = asn1->offset;
5758
5759     proto_tree_add_text(tree, asn1->tvb,
5760         saved_offset, len,
5761         "24-bit random number used as input to the CAVE algorithm for authenticating a specific MS");
5762
5763     asn1->offset += len;
5764 }
5765
5766 static void
5767 param_vpmask(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
5768 {
5769     gint32 value;
5770     guint saved_offset;
5771
5772     EXACT_DATA_CHECK(len, 66);
5773
5774     saved_offset = asn1->offset;
5775
5776     asn1_int32_value_decode(asn1, 1, &value);
5777
5778     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
5779     proto_tree_add_text(tree, asn1->tvb,
5780         saved_offset, asn1->offset - saved_offset,
5781         "%s :  Reserved",
5782         bigbuf);
5783
5784     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
5785     proto_tree_add_text(tree, asn1->tvb,
5786         saved_offset, asn1->offset - saved_offset,
5787         "%s :  Voice Privacy Mask-A (VPMASK-A) (MSB)",
5788         bigbuf);
5789
5790     saved_offset = asn1->offset;
5791
5792     proto_tree_add_text(tree, asn1->tvb,
5793         saved_offset, 32,
5794         "Voice Privacy Mask-A (VPMASK-A)");
5795
5796     asn1->offset += 32;
5797
5798     saved_offset = asn1->offset;
5799
5800     asn1_int32_value_decode(asn1, 1, &value);
5801
5802     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
5803     proto_tree_add_text(tree, asn1->tvb,
5804         saved_offset, asn1->offset - saved_offset,
5805         "%s :  Reserved",
5806         bigbuf);
5807
5808     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
5809     proto_tree_add_text(tree, asn1->tvb,
5810         saved_offset, asn1->offset - saved_offset,
5811         "%s :  Voice Privacy Mask-B (VPMASK-B) (MSB)",
5812         bigbuf);
5813
5814     saved_offset = asn1->offset;
5815
5816     proto_tree_add_text(tree, asn1->tvb,
5817         saved_offset, 32,
5818         "Voice Privacy Mask-B (VPMASK-B)");
5819
5820     asn1->offset += 32;
5821 }
5822
5823 static void
5824 param_ssd(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
5825 {
5826     guint saved_offset;
5827
5828     EXACT_DATA_CHECK(len, 16);
5829
5830     saved_offset = asn1->offset;
5831
5832     proto_tree_add_text(tree, asn1->tvb,
5833         saved_offset, 8,
5834         "Shared Secret Data-A (SSD-A)");
5835
5836     proto_tree_add_text(tree, asn1->tvb,
5837         saved_offset+8, 8,
5838         "Shared Secret Data-B (SSD-B)");
5839
5840     asn1->offset += len;
5841 }
5842
5843 static void
5844 param_upd_count(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
5845 {
5846     gint32 value;
5847     guint saved_offset;
5848     const gchar *str = NULL;
5849
5850     EXACT_DATA_CHECK(len, 1);
5851
5852     saved_offset = asn1->offset;
5853
5854     asn1_int32_value_decode(asn1, 1, &value);
5855
5856     switch (value)
5857     {
5858     case 0: str = "Not used"; break;
5859     case 1: str = "Update COUNT"; break;
5860     default:
5861         if ((value >= 2) && (value <= 223)) { str = "Reserved, treat as Update COUNT"; }
5862         else { str = "Reserved for protocol extension, treat as Update COUNT"; }
5863         break;
5864     }
5865
5866     proto_tree_add_text(tree, asn1->tvb,
5867         saved_offset, asn1->offset - saved_offset,
5868         "%s",
5869         str);
5870 }
5871
5872 static void
5873 param_sme_key(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
5874 {
5875     guint saved_offset;
5876
5877     EXACT_DATA_CHECK(len, 8);
5878
5879     saved_offset = asn1->offset;
5880
5881     proto_tree_add_text(tree, asn1->tvb,
5882         saved_offset, len,
5883         "Signaling Message Encryption Key (SMEKEY)");
5884
5885     asn1->offset += len;
5886 }
5887
5888 static void
5889 param_rand_ssd(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
5890 {
5891     guint saved_offset;
5892
5893     EXACT_DATA_CHECK(len, 7);
5894
5895     saved_offset = asn1->offset;
5896
5897     proto_tree_add_text(tree, asn1->tvb,
5898         saved_offset, len,
5899         "56-bit random number used as input to the CAVE algorithm for generating Shared Secret Data");
5900
5901     asn1->offset += len;
5902 }
5903
5904 static void
5905 param_setup_result(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
5906 {
5907     gint32 value;
5908     guint saved_offset;
5909     const gchar *str = NULL;
5910
5911     saved_offset = asn1->offset;
5912
5913     asn1_int32_value_decode(asn1, 1, &value);
5914
5915     switch (value)
5916     {
5917     case 0: str = "Not used"; break;
5918     case 1: str = "Unsuccessful"; break;
5919     case 2: str = "Successful"; break;
5920     default:
5921         str = "Reserved, treat as Unsuccessful";
5922         break;
5923     }
5924
5925     proto_tree_add_text(tree, asn1->tvb,
5926         saved_offset, asn1->offset - saved_offset,
5927         str);
5928
5929     EXTRANEOUS_DATA_CHECK(len, 1);
5930 }
5931
5932 static void
5933 param_randc(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
5934 {
5935     guint saved_offset;
5936
5937     saved_offset = asn1->offset;
5938
5939     proto_tree_add_text(tree, asn1->tvb,
5940         saved_offset, 1,
5941         "The 8 most significant bits of the 32-bit Random Variable used to compute the Authentication Response");
5942
5943     asn1->offset += 1;
5944
5945     EXTRANEOUS_DATA_CHECK(len, 1);
5946 }
5947
5948 static void
5949 param_ext_mscid(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string, int string_len)
5950 {
5951     gint32 type;
5952     guint saved_offset;
5953     const gchar *str = NULL;
5954
5955     EXACT_DATA_CHECK(len, 4);
5956
5957     saved_offset = asn1->offset;
5958
5959     asn1_int32_value_decode(asn1, 1, &type);
5960
5961     switch (type)
5962     {
5963     case 0: str = "Not specified"; break;
5964     case 1: str = "Serving MSC"; break;
5965     case 2: str = "Home MSC"; break;
5966     case 3: str = "Gateway MSC"; break;
5967     case 4: str = "HLR"; break;
5968     case 5: str = "VLR"; break;
5969     case 6: str = "EIR (reserved)"; break;
5970     case 7: str = "AC"; break;
5971     case 8: str = "Border MSC"; break;
5972     case 9: str = "Originating MSC"; break;
5973     default:
5974         if ((type >= 10) && (type <= 223)) { str = "Reserved, treat as Not specified"; }
5975         else { str = "Reserved for protocol extension, treat as Not specified"; }
5976         break;
5977     }
5978
5979     proto_tree_add_text(tree, asn1->tvb,
5980         saved_offset, asn1->offset - saved_offset,
5981         "Type (%u), %s",
5982         type,
5983         str);
5984
5985     param_mscid(asn1, tree, len-1, add_string, string_len);
5986 }
5987
5988 static void
5989 param_sub_addr(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
5990 {
5991     gint32 value;
5992     guint saved_offset;
5993     const gchar *str = NULL;
5994
5995     saved_offset = asn1->offset;
5996     asn1_int32_value_decode(asn1, 1, &value);
5997
5998     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
5999     proto_tree_add_text(tree, asn1->tvb,
6000         saved_offset, asn1->offset - saved_offset,
6001         "%s :  Should be 1",
6002         bigbuf);
6003
6004     switch ((value & 0x70) >> 4)
6005     {
6006     case 0x00: str = "NSAP (CCITT Rec. X.213 or ISO 8348 AD2)"; break;
6007     case 0x02: str = "User specified"; break;
6008     default:
6009         str = "Reserved";
6010         break;
6011     }
6012
6013     other_decode_bitfield_value(bigbuf, value, 0x70, 8);
6014     proto_tree_add_text(tree, asn1->tvb,
6015         saved_offset, asn1->offset - saved_offset,
6016         "%s :  Type of Subaddress %s",
6017         bigbuf, str);
6018
6019     switch ((value & 0x08) >> 3)
6020     {
6021     case 0x00: str = "Even number of subaddress signals follow"; break;
6022     case 0x01: str = "Odd number of subaddress signals follow"; break;
6023     }
6024
6025     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
6026     proto_tree_add_text(tree, asn1->tvb,
6027         saved_offset, asn1->offset - saved_offset,
6028         "%s :  %s",
6029         bigbuf, str);
6030
6031     proto_tree_add_text(tree, asn1->tvb,
6032         asn1->offset, len - 1,
6033         "Subaddress");
6034
6035     asn1->offset += len - 1;
6036 }
6037
6038 static void
6039 param_digits_basic(ASN1_SCK *asn1, proto_tree *tree, guint len, gboolean searchable)
6040 {
6041     gint32 value, b1, b2, b3, b4, enc, plan;
6042     guint saved_offset;
6043     const gchar *str = NULL;
6044     proto_item *item;
6045     proto_tree *subtree;
6046     guchar *poctets;
6047
6048     SHORT_DATA_CHECK(len, 4);
6049
6050     saved_offset = asn1->offset;
6051     asn1_int32_value_decode(asn1, 1, &value);
6052
6053     switch (value)
6054     {
6055     case 0: str = "Not used"; break;
6056     case 1: str = "Dialed Numer or Called Party Number"; break;
6057     case 2: str = "Calling Party Number"; break;
6058     case 3: str = "Caller Interaction (Not used)"; break;
6059     case 4: str = "Routing Number"; break;
6060     case 5: str = "Billing Number"; break;
6061     case 6: str = "Destination Number"; break;
6062     case 7: str = "LATA (Not used)"; break;
6063     case 8: str = "Carrier"; break;
6064     case 13: str = "ESRD"; break;
6065     default:
6066         str = "Reserved";
6067         break;
6068     }
6069
6070     proto_tree_add_text(tree, asn1->tvb,
6071         saved_offset, asn1->offset - saved_offset,
6072         "Type of Digits %u: %s",
6073         value, str);
6074
6075     saved_offset = asn1->offset;
6076     asn1_int32_value_decode(asn1, 1, &value);
6077
6078     item =
6079         proto_tree_add_text(tree, asn1->tvb,
6080             saved_offset, asn1->offset - saved_offset,
6081             "Nature of Number");
6082
6083     subtree = proto_item_add_subtree(item, ett_natnum);
6084
6085     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
6086     proto_tree_add_text(subtree, asn1->tvb,
6087         saved_offset, asn1->offset - saved_offset,
6088         "%s :  Reserved",
6089         bigbuf);
6090
6091     switch ((value & 0x30) >> 4)
6092     {
6093     case 0x00: str = "User provided, not screened"; break;
6094     case 0x01: str = "User provided, screening passed"; break;
6095     case 0x02: str = "User provided, screening failed"; break;
6096     case 0x03: str = "Network provided"; break;
6097     }
6098
6099     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
6100     proto_tree_add_text(subtree, asn1->tvb,
6101         saved_offset, asn1->offset - saved_offset,
6102         "%s :  %s",
6103         bigbuf, str);
6104
6105     proto_tree_add_text(subtree, asn1->tvb,
6106         saved_offset, asn1->offset - saved_offset,
6107         ".... %u... :  Reserved",
6108         (value & 0x08) >> 3);
6109
6110     proto_tree_add_text(subtree, asn1->tvb,
6111         saved_offset, asn1->offset - saved_offset,
6112         ".... .%u.. :  Number is %savailable",
6113         (value & 0x04) >> 2, (value & 0x04) ? "not " : "");
6114
6115     proto_tree_add_text(subtree, asn1->tvb,
6116         saved_offset, asn1->offset - saved_offset,
6117         ".... ..%u. :  Presentation %s",
6118         (value & 0x02) >> 1, (value & 0x02) ? "Restricted" : "Allowed");
6119
6120     proto_tree_add_text(subtree, asn1->tvb,
6121         saved_offset, asn1->offset - saved_offset,
6122         ".... ...%u :  %s",
6123         value & 0x01, (value & 0x01) ? "International" : "National");
6124
6125     saved_offset = asn1->offset;
6126     asn1_int32_value_decode(asn1, 1, &value);
6127
6128     plan = (value & 0xf0) >> 4;
6129     switch (plan)
6130     {
6131     case 0x00: str = "Unknown or not applicable"; break;
6132     case 0x01: str = "ISDN Numbering (Not used)"; break;
6133     case 0x02: str = "Telephony Numbering (ITU-T Rec. E.164, E.163)"; break;
6134     case 0x03: str = "Data Numbering (ITU-T Rec. X.121)(Not used)"; break;
6135     case 0x04: str = "Telex Numbering (ITU-T Rec. F.69)(Not used)"; break;
6136     case 0x05: str = "Maritime Mobile Numbering (Not used)"; break;
6137     case 0x06: str = "Land Mobile Numbering (ITU-T Rec. E.212)"; break;
6138     case 0x07: str = "Private Numbering Plan (service provider defined)"; break;
6139     case 0x0d: str = "ANSI SS7 Point Code (PC) and Subsystem Number (SSN)"; break;
6140     case 0x0e: str = "Internet Protocol (IP) Address"; break;
6141     case 0x0f: str = "Reserved for extension"; break;
6142     default:
6143         str = "Reserved";
6144         break;
6145     }
6146
6147     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
6148     proto_tree_add_text(tree, asn1->tvb,
6149         saved_offset, asn1->offset - saved_offset,
6150         "%s :  Numbering Plan: %s",
6151         bigbuf, str);
6152
6153     enc = value & 0x0f;
6154     switch (enc)
6155     {
6156     case 0x00: str = "Not used"; break;
6157     case 0x01: str = "BCD"; break;
6158     case 0x02: str = "IA5"; break;
6159     case 0x03: str = "Octet String"; break;
6160     default:
6161         str = "Reserved";
6162         break;
6163     }
6164
6165     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
6166     proto_tree_add_text(tree, asn1->tvb,
6167         saved_offset, asn1->offset - saved_offset,
6168         "%s :  Encoding: %s",
6169         bigbuf, str);
6170
6171     saved_offset = asn1->offset;
6172
6173     if (plan == 0x0d)
6174     {
6175         asn1_int32_value_decode(asn1, 1, &b1);
6176         asn1_int32_value_decode(asn1, 1, &b2);
6177         asn1_int32_value_decode(asn1, 1, &b3);
6178         asn1_int32_value_decode(asn1, 1, &b4);
6179
6180         proto_tree_add_text(tree, asn1->tvb,
6181             saved_offset, asn1->offset - saved_offset,
6182             "Point Code %u-%u-%u  SSN %u",
6183             b3, b2, b1, b4);
6184     }
6185     else if (plan == 0x0e)
6186     {
6187         asn1_int32_value_decode(asn1, 1, &b1);
6188         asn1_int32_value_decode(asn1, 1, &b2);
6189         asn1_int32_value_decode(asn1, 1, &b3);
6190         asn1_int32_value_decode(asn1, 1, &b4);
6191
6192         proto_tree_add_text(tree, asn1->tvb,
6193             saved_offset, asn1->offset - saved_offset,
6194             "IP Address %u.%u.%u.%u",
6195             b1, b2, b3, b4);
6196     }
6197     else
6198     {
6199         asn1_int32_value_decode(asn1, 1, &value);
6200
6201         proto_tree_add_text(tree, asn1->tvb,
6202             saved_offset, asn1->offset - saved_offset,
6203             "Number of Digits: %u",
6204             value);
6205
6206         if (enc == 0x02)
6207         {
6208             proto_tree_add_text(tree, asn1->tvb,
6209                 asn1->offset, value,
6210                 "IA5 Digits: %s",
6211                 tvb_format_text(asn1->tvb, asn1->offset, value));
6212
6213             asn1->offset += value;
6214         }
6215         else if (enc == 0x01)
6216         {
6217             saved_offset = asn1->offset;
6218             asn1_string_value_decode(asn1, (value+1)/2, &poctets);
6219
6220             my_dgt_tbcd_unpack(bigbuf, poctets, (value+1)/2, &Dgt_tbcd);
6221             g_free(poctets);
6222
6223             if (searchable)
6224             {
6225                         proto_tree_add_string_format(tree, hf_ansi_map_number, asn1->tvb,
6226                                 saved_offset, (value+1)/2,
6227                                 bigbuf,
6228                                 "BCD Digits: %s",
6229                                 bigbuf);
6230             }
6231             else
6232             {
6233                         proto_tree_add_text(tree, asn1->tvb,
6234                                 saved_offset, (value+1)/2,
6235                                 "BCD Digits: %s",
6236                                 bigbuf);
6237                 }
6238         }
6239         }
6240 }
6241
6242 static void
6243 param_digits(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
6244 {
6245     param_digits_basic(asn1, tree, len, FALSE);
6246 }
6247
6248 static void
6249 param_mdn(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
6250 {
6251     param_digits_basic(asn1, tree, len, TRUE);
6252 }
6253
6254 static void
6255 param_esn(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string, int string_len)
6256 {
6257     gint32 value;
6258     guint saved_offset;
6259
6260     EXACT_DATA_CHECK(len, 4);
6261
6262     saved_offset = asn1->offset;
6263
6264     asn1_int32_value_decode(asn1, 4, &value);
6265
6266     proto_tree_add_text(tree, asn1->tvb,
6267         saved_offset, asn1->offset - saved_offset,
6268         "ESN 0x%04x",
6269         value);
6270
6271     g_snprintf(add_string, string_len, " - 0x%04x", value);
6272 }
6273
6274 static void
6275 param_sms_noti(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
6276 {
6277     gint32 value;
6278     guint saved_offset;
6279     const gchar *str = NULL;
6280
6281     saved_offset = asn1->offset;
6282
6283     asn1_int32_value_decode(asn1, 1, &value);
6284
6285     switch (value)
6286     {
6287     case 0: str = "Not used"; break;
6288     case 1: str = "Notify when available"; break;
6289     case 2: str = "Do not notify when available"; break;
6290     default:
6291         if ((value >= 3) && (value <= 127)) { str = "Reserved, treat as Notify when available"; }
6292         else if ((value >= 128) && (value <= 223)) { str = "Reserved, treat as Do not notify when available"; }
6293         else { str = "Reserved for protocol extension"; }
6294         break;
6295     }
6296
6297     proto_tree_add_text(tree, asn1->tvb,
6298         saved_offset, asn1->offset - saved_offset,
6299         "%s (%u)",
6300         str,
6301         value);
6302
6303     EXTRANEOUS_DATA_CHECK(len, 1);
6304 }
6305
6306 static void
6307 param_sms_orig_restric(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
6308 {
6309     gint32 value;
6310     guint saved_offset;
6311     const gchar *str = NULL;
6312
6313     saved_offset = asn1->offset;
6314
6315     asn1_int32_value_decode(asn1, 1, &value);
6316
6317     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
6318     proto_tree_add_text(tree, asn1->tvb,
6319         saved_offset, asn1->offset - saved_offset,
6320         "%s :  Reserved",
6321         bigbuf);
6322
6323     switch (value & 0x08)
6324     {
6325     case 0x00: str = "No effect"; break;
6326     default:
6327         str = "Force indirect";
6328         break;
6329     }
6330
6331     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
6332     proto_tree_add_text(tree, asn1->tvb,
6333         saved_offset, asn1->offset - saved_offset,
6334         "%s :  Force Message Center, %s",
6335         bigbuf, str);
6336
6337     switch (value & 0x04)
6338     {
6339     case 0x00: str = "Block direct"; break;
6340     default:
6341         str = "Allow direct";
6342         break;
6343     }
6344
6345     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
6346     proto_tree_add_text(tree, asn1->tvb,
6347         saved_offset, asn1->offset - saved_offset,
6348         "%s :  DIRECT, %s",
6349         bigbuf, str);
6350
6351     switch (value & 0x03)
6352     {
6353     case 0x00: str = "Block all"; break;
6354     case 0x02: str = "Allow specific"; break;
6355     case 0x03: str = "Allow all"; break;
6356     default:
6357         str = "Reserved";
6358         break;
6359     }
6360
6361     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
6362     proto_tree_add_text(tree, asn1->tvb,
6363         saved_offset, asn1->offset - saved_offset,
6364         "%s :  DEFAULT, %s",
6365         bigbuf, str);
6366
6367     EXTRANEOUS_DATA_CHECK(len, 1);
6368 }
6369
6370 static void
6371 param_seizure(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
6372 {
6373     gint32 value;
6374     guint saved_offset;
6375     const gchar *str = NULL;
6376
6377     saved_offset = asn1->offset;
6378
6379     asn1_int32_value_decode(asn1, 1, &value);
6380
6381     switch (value)
6382     {
6383     case 0: str = "Unspecified"; break;
6384     case 1: str = "Loopback"; break;
6385     default:
6386         if ((value >= 2) && (value <= 223)) { str = "Reserved"; }
6387         else { str = "Reserved for protocol extension"; }
6388         break;
6389     }
6390
6391     proto_tree_add_text(tree, asn1->tvb,
6392         saved_offset, asn1->offset - saved_offset,
6393         str);
6394
6395     EXTRANEOUS_DATA_CHECK(len, 1);
6396 }
6397
6398 static void
6399 param_sms_tele(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
6400 {
6401     gint32 value;
6402     guint saved_offset;
6403     const gchar *str = NULL;
6404
6405     ansi_map_sms_tele_id = -1;
6406
6407     SHORT_DATA_CHECK(len, 2);
6408
6409     saved_offset = asn1->offset;
6410
6411     asn1_int32_value_decode(asn1, 2, &value);
6412
6413     str = match_strval(value, ansi_tele_strings);
6414     if (str == NULL)
6415     {
6416         switch (value)
6417         {
6418         case 0: str = "Not used"; break;
6419         default:
6420             if ((value >= 2) && (value <= 4095)) { str = "Reserved for assignment by TIA/EIA-41"; }
6421             else if ((value >= 4100) && (value <= 32512)) { str = "Reserved for assignment by TIA/EIA-41"; }
6422             else if ((value >= 32514) && (value <= 32639)) { str = "Reserved for assignment by this Standard for TDMA MS-based SMEs."; }
6423             else if ((value >= 32640) && (value <= 32767)) { str = "Reserved for carrier specific teleservices for TDMA MS-based SMEs."; }
6424             else if ((value >= 32768) && (value <= 49151)) { str = "Reserved for node specific teleservices."; }
6425             else if ((value >= 49152) && (value <= 65535)) { str = "Reserved for carrier specific teleservices."; }
6426             else { str = "Unknown teleservice ID"; }
6427             break;
6428         }
6429     }
6430
6431     ansi_map_sms_tele_id = value;
6432
6433     proto_tree_add_text(tree, asn1->tvb,
6434         saved_offset, asn1->offset - saved_offset,
6435         "%s (%u)",
6436         str,
6437         value);
6438
6439     EXTRANEOUS_DATA_CHECK(len, 2);
6440 }
6441
6442 static void
6443 param_sms_term_restric(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
6444 {
6445     gint32 value;
6446     guint saved_offset;
6447     const gchar *str = NULL;
6448
6449     saved_offset = asn1->offset;
6450
6451     asn1_int32_value_decode(asn1, 1, &value);
6452
6453     other_decode_bitfield_value(bigbuf, value, 0xf8, 8);
6454     proto_tree_add_text(tree, asn1->tvb,
6455         saved_offset, asn1->offset - saved_offset,
6456         "%s :  Reserved",
6457         bigbuf);
6458
6459     switch (value & 0x04)
6460     {
6461     case 0x00: str = "Block messages charged to destination"; break;
6462     default:
6463         str = "Allow messages charged to destination";
6464         break;
6465     }
6466
6467     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
6468     proto_tree_add_text(tree, asn1->tvb,
6469         saved_offset, asn1->offset - saved_offset,
6470         "%s :  Reverse Charges, %s",
6471         bigbuf, str);
6472
6473     switch (value & 0x03)
6474     {
6475     case 0x00: str = "Block all"; break;
6476     case 0x02: str = "Allow specific"; break;
6477     case 0x03: str = "Allow all"; break;
6478     default:
6479         str = "Reserved";
6480         break;
6481     }
6482
6483     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
6484     proto_tree_add_text(tree, asn1->tvb,
6485         saved_offset, asn1->offset - saved_offset,
6486         "%s :  DEFAULT, %s",
6487         bigbuf, str);
6488
6489     EXTRANEOUS_DATA_CHECK(len, 1);
6490 }
6491
6492 static void
6493 param_sms_msg_count(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
6494 {
6495     gint32 value;
6496     guint saved_offset;
6497     const gchar *str = NULL;
6498     char *buf;
6499
6500     saved_offset = asn1->offset;
6501
6502     asn1_int32_value_decode(asn1, 1, &value);
6503
6504     switch (value)
6505     {
6506     case 0: str = "No more pending SMS messages"; break;
6507     default:
6508         buf=ep_alloc(64);
6509         g_snprintf(buf, 64, "%u pending SMS messages", value);
6510         str = buf;
6511         break;
6512     }
6513
6514     proto_tree_add_text(tree, asn1->tvb,
6515         saved_offset, asn1->offset - saved_offset,
6516         str);
6517
6518     EXTRANEOUS_DATA_CHECK(len, 1);
6519 }
6520
6521 static void
6522 param_qos_pri(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
6523 {
6524     gint32 value, temp_int;
6525     guint saved_offset;
6526     const gchar *str = NULL;
6527
6528     saved_offset = asn1->offset;
6529
6530     asn1_int32_value_decode(asn1, 1, &value);
6531
6532     temp_int = (value & 0xf0) >> 4;
6533     if ((temp_int < 0) || (temp_int >= (gint) NUM_QOS_PRI_STR))
6534     {
6535         str = "Reserved";
6536     }
6537     else
6538     {
6539         str = qos_pri_str[temp_int];
6540     }
6541
6542     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
6543     proto_tree_add_text(tree, asn1->tvb,
6544         saved_offset, asn1->offset - saved_offset,
6545         "%s :  Assured Priority, %s",
6546         bigbuf,
6547         str);
6548
6549     temp_int = value & 0x0f;
6550     if ((temp_int < 0) || (temp_int >= (gint) NUM_QOS_PRI_STR))
6551     {
6552         str = "Reserved";
6553     }
6554     else
6555     {
6556         str = qos_pri_str[temp_int];
6557     }
6558
6559     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
6560     proto_tree_add_text(tree, asn1->tvb,
6561         saved_offset, asn1->offset - saved_offset,
6562         "%s :  Non-Assured Priority, %s",
6563         bigbuf,
6564         str);
6565
6566     EXTRANEOUS_DATA_CHECK(len, 1);
6567 }
6568
6569 static void
6570 param_calling_party_cat(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
6571 {
6572     gint32 value;
6573     guint saved_offset;
6574
6575     EXACT_DATA_CHECK(len, 1);
6576
6577     saved_offset = asn1->offset;
6578
6579     asn1_int32_value_decode(asn1, 1, &value);
6580
6581     proto_tree_add_text(tree, asn1->tvb,
6582         saved_offset, asn1->offset - saved_offset,
6583         "Calling Party's Category, Refer to ITU-T Q.763 (Signalling System No. 7 ISDN user part formats and codes) for encoding of this parameter");
6584 }
6585
6586 /*
6587  * Dissect IOS data parameters expected to be in TLV format
6588  */
6589 static void
6590 dissect_cdma2000_ios_data(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string, int string_len)
6591 {
6592     gint32      value;
6593     guint       num_elems;
6594     guchar      elem_len;
6595     guint32     orig_offset, saved_offset;
6596     proto_tree  *subtree;
6597     proto_item  *item;
6598     const gchar *str;
6599     gint        idx;
6600
6601     num_elems = 0;
6602     orig_offset = saved_offset = asn1->offset;
6603
6604     while ((saved_offset - orig_offset + 2) <= len)
6605     {
6606         num_elems++;
6607
6608         asn1_int32_value_decode(asn1, 1, &value);
6609         str = match_strval_idx((guint32) value, ansi_a_ios401_elem_1_strings, &idx);
6610
6611         asn1_octet_decode(asn1, &elem_len);
6612
6613         item =
6614             proto_tree_add_text(tree,
6615                 asn1->tvb, saved_offset, elem_len + 2,
6616                 "IOS - %s",
6617                 str);
6618
6619         subtree = proto_item_add_subtree(item, ett_ansi_map_ios401_elem[idx]);
6620
6621         proto_tree_add_none_format(subtree, hf_ansi_map_ios401_elem_id, asn1->tvb,
6622             saved_offset, 1, "Element ID");
6623
6624         proto_tree_add_uint(subtree, hf_ansi_map_length, asn1->tvb,
6625             saved_offset + 1, 1, elem_len);
6626
6627         if (elem_len > 0)
6628         {
6629             proto_tree_add_text(subtree,
6630                 asn1->tvb, saved_offset + 2, elem_len,
6631                 "Element Value");
6632
6633             asn1->offset += elem_len;
6634         }
6635
6636         saved_offset += elem_len + 2;
6637     }
6638
6639     g_snprintf(add_string, string_len, " - (%u)", num_elems);
6640
6641     EXTRANEOUS_DATA_CHECK((len - (saved_offset - orig_offset)), 0);
6642 }
6643
6644 static void
6645 param_cdma2000_ho_ivk_ios(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string, int string_len)
6646 {
6647
6648     dissect_cdma2000_ios_data(asn1, tree, len, add_string, string_len);
6649 }
6650
6651 static void
6652 param_cdma2000_ho_rsp_ios(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string, int string_len)
6653 {
6654
6655     dissect_cdma2000_ios_data(asn1, tree, len, add_string, string_len);
6656 }
6657
6658 static void
6659 param_msid_usage(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
6660 {
6661     gint32 value;
6662     guint saved_offset;
6663     const gchar *str = NULL;
6664
6665     saved_offset = asn1->offset;
6666
6667     asn1_int32_value_decode(asn1, 1, &value);
6668
6669     other_decode_bitfield_value(bigbuf, value, 0xfc, 8);
6670     proto_tree_add_text(tree, asn1->tvb,
6671         saved_offset, asn1->offset - saved_offset,
6672         "%s :  Reserved",
6673         bigbuf);
6674
6675     switch (value & 0x03)
6676     {
6677     case 0: str = "Not used"; break;
6678     case 1: str = "MIN last used"; break;
6679     case 2: str = "IMSI last used"; break;
6680     case 3: str = "Reserved"; break;
6681     }
6682
6683     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
6684     proto_tree_add_text(tree, asn1->tvb,
6685         saved_offset, asn1->offset - saved_offset,
6686         "%s :  %s",
6687         bigbuf,
6688         str);
6689
6690     EXTRANEOUS_DATA_CHECK(len, 1);
6691 }
6692
6693 static void
6694 param_new_min_ext(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
6695 {
6696     gint32 value;
6697     guint saved_offset;
6698     const gchar *str = NULL;
6699
6700     EXACT_DATA_CHECK(len, 3);
6701
6702     saved_offset = asn1->offset;
6703
6704     asn1_int32_value_decode(asn1, 1, &value);
6705
6706     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
6707     proto_tree_add_text(tree, asn1->tvb,
6708         saved_offset, asn1->offset - saved_offset,
6709         "%s :  MCC_M (MSB), see CDMA",
6710         bigbuf);
6711
6712     other_decode_bitfield_value(bigbuf, value, 0x0e, 8);
6713     proto_tree_add_text(tree, asn1->tvb,
6714         saved_offset, asn1->offset - saved_offset,
6715         "%s :  IMSI_M_ADDR_NUM, see CDMA",
6716         bigbuf);
6717
6718     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
6719     proto_tree_add_text(tree, asn1->tvb,
6720         saved_offset, asn1->offset - saved_offset,
6721         "%s :  IMSI_M_CLASS, see CDMA",
6722         bigbuf);
6723
6724     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
6725     proto_tree_add_text(tree, asn1->tvb,
6726         saved_offset, asn1->offset - saved_offset,
6727         "%s :  %s",
6728         bigbuf,
6729         str);
6730
6731     bigbuf[0] = Dgt_tbcd.out[(value & 0xf0) >> 4];
6732
6733     saved_offset = asn1->offset;
6734
6735     asn1_int32_value_decode(asn1, 1, &value);
6736
6737     bigbuf[1] = Dgt_tbcd.out[value & 0x0f];
6738     bigbuf[2] = Dgt_tbcd.out[(value & 0xf0) >> 4];
6739     bigbuf[3] = '\0';
6740
6741     proto_tree_add_text(tree, asn1->tvb,
6742         saved_offset, asn1->offset - saved_offset,
6743         "MCC_M, %s, see CDMA",
6744         bigbuf);
6745
6746     saved_offset = asn1->offset;
6747
6748     asn1_int32_value_decode(asn1, 1, &value);
6749
6750     bigbuf[0] = Dgt_tbcd.out[value & 0x0f];
6751     bigbuf[1] = Dgt_tbcd.out[(value & 0xf0) >> 4];
6752     bigbuf[2] = '\0';
6753
6754     proto_tree_add_text(tree, asn1->tvb,
6755         saved_offset, asn1->offset - saved_offset,
6756         "IMSI_11_12, %s, see CDMA",
6757         bigbuf);
6758 }
6759
6760 static void
6761 param_dtx_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
6762 {
6763     gint32 value;
6764     guint saved_offset;
6765     const gchar *str = NULL;
6766
6767     saved_offset = asn1->offset;
6768
6769     asn1_int32_value_decode(asn1, 1, &value);
6770
6771     other_decode_bitfield_value(bigbuf, value, 0xfe, 8);
6772     proto_tree_add_text(tree, asn1->tvb,
6773         saved_offset, asn1->offset - saved_offset,
6774         "%s :  Reserved",
6775         bigbuf);
6776
6777     switch (value & 0x01)
6778     {
6779     case 0: str = "Discontinuous Transmission mode is not active"; break;
6780     case 1: str = "Discontinuous Transmission mode is active"; break;
6781     }
6782
6783     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
6784     proto_tree_add_text(tree, asn1->tvb,
6785         saved_offset, asn1->offset - saved_offset,
6786         "%s :  %s",
6787         bigbuf,
6788         str);
6789
6790     EXTRANEOUS_DATA_CHECK(len, 1);
6791 }
6792
6793 static void
6794 param_cdma_mob_cap(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
6795 {
6796     gint32 value;
6797     guint saved_offset;
6798     const gchar *str = NULL;
6799
6800     saved_offset = asn1->offset;
6801
6802     asn1_int32_value_decode(asn1, 1, &value);
6803
6804     other_decode_bitfield_value(bigbuf, value, 0xfe, 8);
6805     proto_tree_add_text(tree, asn1->tvb,
6806         saved_offset, asn1->offset - saved_offset,
6807         "%s :  Reserved",
6808         bigbuf);
6809
6810     switch (value & 0x01)
6811     {
6812     case 0: str = "No MS-initiated position determination"; break;
6813     case 1: str = "MS-initiated position determination"; break;
6814     }
6815
6816     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
6817     proto_tree_add_text(tree, asn1->tvb,
6818         saved_offset, asn1->offset - saved_offset,
6819         "%s :  %s",
6820         bigbuf,
6821         str);
6822
6823     EXTRANEOUS_DATA_CHECK(len, 1);
6824 }
6825
6826 static void
6827 param_gen_time(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
6828 {
6829     gint32 value;
6830     gint32 h, m, s, ts;
6831     guint saved_offset;
6832
6833     SHORT_DATA_CHECK(len, 6);
6834
6835     saved_offset = asn1->offset;
6836
6837     asn1_int32_value_decode(asn1, 1, &value);
6838
6839     proto_tree_add_text(tree, asn1->tvb,
6840         saved_offset, asn1->offset - saved_offset,
6841         "Year-2000, %u",
6842         value);
6843
6844     saved_offset = asn1->offset;
6845
6846     asn1_int32_value_decode(asn1, 1, &value);
6847
6848     proto_tree_add_text(tree, asn1->tvb,
6849         saved_offset, asn1->offset - saved_offset,
6850         "Month, %u",
6851         value);
6852
6853     saved_offset = asn1->offset;
6854
6855     asn1_int32_value_decode(asn1, 1, &value);
6856
6857     proto_tree_add_text(tree, asn1->tvb,
6858         saved_offset, asn1->offset - saved_offset,
6859         "Day of month, %u",
6860         value);
6861
6862     saved_offset = asn1->offset;
6863
6864     asn1_int32_value_decode(asn1, 3, &value);
6865
6866     h = value / (3600 * 10);
6867     m = (value - (h * (3600 * 10))) / (60 * 10);
6868     s = (value - (h * (3600 * 10)) - (m * (60 * 10))) / 10;
6869     ts = (value - (h * (3600 * 10)) - (m * (60 * 10)) - (s * 10));
6870
6871     proto_tree_add_text(tree, asn1->tvb,
6872         saved_offset, asn1->offset - saved_offset,
6873         "Time of day (UTC) (in tenths of seconds - 1), %u (%u:%u:%u.%u)",
6874         value,
6875         h,
6876         m,
6877         s,
6878         ts);
6879
6880     EXTRANEOUS_DATA_CHECK(len, 6);
6881 }
6882
6883 static void
6884 param_geo_pos(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
6885 {
6886     guint saved_offset;
6887
6888     saved_offset = asn1->offset;
6889
6890     proto_tree_add_text(tree, asn1->tvb,
6891         saved_offset, len,
6892         "Calling Geodetic Location (CGL), see T1.628 CallingGeodeticLocation TCAP parameter for encoding");
6893 }
6894
6895 static void
6896 param_mob_call_status(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
6897 {
6898     gint32 value, auth;
6899     guint saved_offset;
6900     const gchar *str = NULL;
6901
6902     saved_offset = asn1->offset;
6903
6904     asn1_int32_value_decode(asn1, 1, &value);
6905
6906     auth = (value & 0xf0) >> 4;
6907     switch (auth)
6908     {
6909     case 0: str = "Authorization not performed"; break;
6910     case 1: str = "Authorization successful"; break;
6911     case 2: str = "Invalid Electronic Serial Number (ESN)"; break;
6912     case 3: str = "Unassigned Directory Number (DN)"; break;
6913     case 4: str = "Duplicate Unit"; break;
6914     case 5: str = "Delinquent Account"; break;
6915     case 6: str = "Stolen Unit"; break;
6916     case 7: str = "Not authorized for MSC"; break;
6917     case 8: str = "Unspecified"; break;
6918     default:
6919         str = "Reserved, treat as Authorization not performed";
6920         break;
6921     }
6922
6923     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
6924     proto_tree_add_text(tree, asn1->tvb,
6925         saved_offset, asn1->offset - saved_offset,
6926         "%s :  Authorization, %s",
6927         bigbuf,
6928         str);
6929
6930     auth = value & 0x0f;
6931     switch (auth)
6932     {
6933     case 0: str = "Authentication not performed. Authentication has not yet occurred or the MS is not capable of authentication"; break;
6934     case 1: str = "Authentication successful. Authentication has successfully occurred on the MS"; break;
6935     case 2: str = "Authentication failure. An authentication failure has occurred on the MS"; break;
6936     default:
6937         str = "Reserved, treat as Authentication not performed";
6938         break;
6939     }
6940
6941     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
6942     proto_tree_add_text(tree, asn1->tvb,
6943         saved_offset, asn1->offset - saved_offset,
6944         "%s :  Authentication, %s",
6945         bigbuf,
6946         str);
6947
6948     EXTRANEOUS_DATA_CHECK(len, 1);
6949 }
6950
6951 static void
6952 param_pos_req_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
6953 {
6954     gint32 value;
6955     guint saved_offset;
6956     const gchar *str = NULL;
6957
6958     saved_offset = asn1->offset;
6959
6960     asn1_int32_value_decode(asn1, 1, &value);
6961
6962     switch (value)
6963     {
6964     case 0: str = "Not used"; break;
6965     case 1: str = "Initial position. Return updated position only if initial position is unavailable."; break;
6966     case 2: str = "Return the updated position"; break;
6967     case 3: str = "Return the updated or last known position"; break;
6968     case 4: str = "Reserved for LSP interface. Treat as Not used"; break;
6969     default:
6970         if ((value >= 5) && (value <= 95)) { str = "Reserved, treat as Initial position"; }
6971         else { str = "Reserved for protocol extension, treat as Initial position"; }
6972         break;
6973     }
6974
6975     proto_tree_add_text(tree, asn1->tvb,
6976         saved_offset, asn1->offset - saved_offset,
6977         "Position Request Type, %s",
6978         str);
6979
6980     EXTRANEOUS_DATA_CHECK(len, 1);
6981 }
6982
6983 static void
6984 param_pos_result(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
6985 {
6986     gint32 value;
6987     guint saved_offset;
6988     const gchar *str = NULL;
6989
6990     saved_offset = asn1->offset;
6991
6992     asn1_int32_value_decode(asn1, 1, &value);
6993
6994     switch (value)
6995     {
6996     case 0: str = "Not used"; break;
6997     case 1: str = "Initial position returned"; break;
6998     case 2: str = "Updated position returned"; break;
6999     case 3: str = "Last known position returned"; break;
7000     case 4: str = "Requested position is not available"; break;
7001     case 5: str = "Caller disconnected. No call in progress for caller identified"; break;
7002     case 6: str = "Caller has handed-off. Position is unavailable due to a hand-off (e.g. handoff to a position incapable system)"; break;
7003     case 7: str = "Identified MS is inactive or has roamed to another system"; break;
7004     case 8: str = "Unresponsive"; break;
7005     case 9: str = "Identified MS is responsive, but refused position request"; break;
7006     case 10: str = "System Failure"; break;
7007     case 11: str = "MSID is not known"; break;
7008     case 12: str = "Callback number is not known"; break;
7009     case 13: str = "Improper request (e.g. invalid channel information, invalid ESN)"; break;
7010     case 14: str = "Mobile channel information returned"; break;
7011     case 15: str = "Signal not detected"; break;
7012     case 16: str = "PDE Timeout"; break;
7013     case 17: str = "Position pending"; break;
7014     case 18: str = "TDMA MAHO Information Returned"; break;
7015     case 19: str = "TDMA MAHO Information is not available"; break;
7016     default:
7017         if ((value >= 20) && (value <= 223)) { str = "Reserved, treat as Not used"; }
7018         else { str = "Reserved for protocol extension, treat as Not used"; }
7019         break;
7020     }
7021
7022     proto_tree_add_text(tree, asn1->tvb,
7023         saved_offset, asn1->offset - saved_offset,
7024         "Position Result, %s",
7025         str);
7026
7027     EXTRANEOUS_DATA_CHECK(len, 1);
7028 }
7029
7030 static void
7031 param_pos_source(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
7032 {
7033     gint32 value;
7034     guint saved_offset;
7035     const gchar *str = NULL;
7036
7037     saved_offset = asn1->offset;
7038
7039     asn1_int32_value_decode(asn1, 1, &value);
7040
7041     switch (value)
7042     {
7043     case 0: str = "Not used"; break;
7044     case 1: str = "Network Unspecified"; break;
7045     case 2: str = "Network AOA (Angle of Arrival)"; break;
7046     case 3: str = "Network TOA (Time of Arrival)"; break;
7047     case 4: str = "Network TDOA (Time Difference of Arrival)"; break;
7048     case 5: str = "Network RF Fingerprinting"; break;
7049     case 6: str = "Network Cell/Sector"; break;
7050     case 7: str = "Network Cell/Sector with Timing"; break;
7051     case 16: str = "Handset Unspecified"; break;
7052     case 17: str = "Handset GPS"; break;
7053     case 18: str = "Handset AGPS (Assisted GPS)"; break;
7054     case 19: str = "Handset EOTD (Enhanced Observed Time Difference)"; break;
7055     case 20: str = "Handset AFLT (Advanced Forward Link Trilateration)"; break;
7056     case 21: str = "Handset EFLT (Enhanced Forward Link Trilateration)"; break;
7057     default:
7058         if ((value >= 8) && (value <= 15)) { str = "Reserved, treat as Network Unspecified"; }
7059         else if ((value >= 22) && (value <= 31)) { str = "Reserved, treat as Handset Unspecified"; }
7060         else { str = "Reserved for protocol extension, treat as Not used"; }
7061         break;
7062     }
7063
7064     proto_tree_add_text(tree, asn1->tvb,
7065         saved_offset, asn1->offset - saved_offset,
7066         "Position Source, %s",
7067         str);
7068
7069     EXTRANEOUS_DATA_CHECK(len, 1);
7070 }
7071
7072 static void
7073 param_acg_encounter(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
7074 {
7075     gint32 value;
7076     guint saved_offset;
7077     const gchar *str = NULL;
7078
7079     EXACT_DATA_CHECK(len, 1);
7080
7081     saved_offset = asn1->offset;
7082
7083     asn1_int32_value_decode(asn1, 1, &value);
7084
7085     switch ((value & 0xc0) >> 6)
7086     {
7087     case 0: str = "Not used"; break;
7088     case 1: str = "Service Management System Initiated control encountered"; break;
7089     case 2: str = "SCF Overload control encountered"; break;
7090     case 3: str = "Reserved, treat as Not used"; break;
7091     }
7092
7093     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
7094     proto_tree_add_text(tree, asn1->tvb,
7095         saved_offset, asn1->offset - saved_offset,
7096         "%s :  Control Type, %s",
7097         bigbuf,
7098         str);
7099
7100     switch (value & 0x3f)
7101     {
7102     case 0: str = "PC_SSN"; break;
7103     case 1: str = "1-digit control"; break;
7104     case 2: str = "2-digit control"; break;
7105     case 3: str = "3-digit control"; break;
7106     case 4: str = "4-digit control"; break;
7107     case 5: str = "5-digit control"; break;
7108     case 6: str = "6-digit control"; break;
7109     case 7: str = "7-digit control"; break;
7110     case 8: str = "8-digit control"; break;
7111     case 9: str = "9-digit control"; break;
7112     case 10: str = "10-digit control"; break;
7113     case 11: str = "11-digit control"; break;
7114     case 12: str = "12-digit control"; break;
7115     case 13: str = "13-digit control"; break;
7116     case 14: str = "14-digit control"; break;
7117     case 15: str = "15-digit control"; break;
7118     default:
7119         str = "Reserved, treat as 15-digit control";
7120         break;
7121     }
7122
7123     other_decode_bitfield_value(bigbuf, value, 0x3f, 8);
7124     proto_tree_add_text(tree, asn1->tvb,
7125         saved_offset, asn1->offset - saved_offset,
7126         "%s :  %s",
7127         bigbuf,
7128         str);
7129 }
7130
7131 static void
7132 param_ctrl_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
7133 {
7134     gint32 value;
7135     guint saved_offset;
7136     const gchar *str = NULL;
7137
7138     EXACT_DATA_CHECK(len, 1);
7139
7140     saved_offset = asn1->offset;
7141
7142     asn1_int32_value_decode(asn1, 1, &value);
7143
7144     switch ((value & 0xc0) >> 6)
7145     {
7146     case 0: str = "Not used"; break;
7147     case 1: str = "Service Management System Initiated control"; break;
7148     case 2: str = "SCF Overload control"; break;
7149     case 3: str = "Reserved, treat as Not used"; break;
7150     }
7151
7152     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
7153     proto_tree_add_text(tree, asn1->tvb,
7154         saved_offset, asn1->offset - saved_offset,
7155         "%s :  Control Type, %s",
7156         bigbuf,
7157         str);
7158
7159     switch (value & 0x3f)
7160     {
7161     case 0: str = "PC_SSN"; break;
7162     case 1: str = "1-digit control"; break;
7163     case 2: str = "2-digit control"; break;
7164     case 3: str = "3-digit control"; break;
7165     case 4: str = "4-digit control"; break;
7166     case 5: str = "5-digit control"; break;
7167     case 6: str = "6-digit control"; break;
7168     case 7: str = "7-digit control"; break;
7169     case 8: str = "8-digit control"; break;
7170     case 9: str = "9-digit control"; break;
7171     case 10: str = "10-digit control"; break;
7172     case 11: str = "11-digit control"; break;
7173     case 12: str = "12-digit control"; break;
7174     case 13: str = "13-digit control"; break;
7175     case 14: str = "14-digit control"; break;
7176     case 15: str = "15-digit control"; break;
7177     default:
7178         str = "Reserved, treat as 15-digit control";
7179         break;
7180     }
7181
7182     other_decode_bitfield_value(bigbuf, value, 0x3f, 8);
7183     proto_tree_add_text(tree, asn1->tvb,
7184         saved_offset, asn1->offset - saved_offset,
7185         "%s :  %s",
7186         bigbuf,
7187         str);
7188 }
7189
7190 static void
7191 param_gap_duration(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
7192 {
7193     gint32 value;
7194     guint saved_offset;
7195     const gchar *str = NULL;
7196
7197     EXACT_DATA_CHECK(len, 1);
7198
7199     saved_offset = asn1->offset;
7200
7201     asn1_int32_value_decode(asn1, 1, &value);
7202
7203     switch (value)
7204     {
7205     case 0: str = "Not used"; break;
7206     case 1: str = "1 second"; break;
7207     case 2: str = "2 seconds"; break;
7208     case 3: str = "4 seconds"; break;
7209     case 4: str = "8 seconds"; break;
7210     case 5: str = "16 seconds"; break;
7211     case 6: str = "32 seconds"; break;
7212     case 7: str = "64 seconds"; break;
7213     case 8: str = "128 seconds"; break;
7214     case 9: str = "256 seconds"; break;
7215     case 10: str = "512 seconds"; break;
7216     case 11: str = "1024 seconds"; break;
7217     case 12: str = "2048 seconds"; break;
7218     case 13: str = "Infinity"; break;
7219     default:
7220         str = "Reserved, treat as Not used";
7221         break;
7222     }
7223
7224     proto_tree_add_text(tree, asn1->tvb,
7225         saved_offset, asn1->offset - saved_offset,
7226         str);
7227 }
7228
7229 static void
7230 param_scf_overload_gap_int(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
7231 {
7232     gint32 value;
7233     guint saved_offset;
7234     const gchar *str = NULL;
7235
7236     EXACT_DATA_CHECK(len, 1);
7237
7238     saved_offset = asn1->offset;
7239
7240     asn1_int32_value_decode(asn1, 1, &value);
7241
7242     switch (value)
7243     {
7244     case 0: str = "0 seconds"; break;
7245     case 1: str = "3 seconds"; break;
7246     case 2: str = "4 seconds"; break;
7247     case 3: str = "6 seconds"; break;
7248     case 4: str = "8 seconds"; break;
7249     case 5: str = "11 seconds"; break;
7250     case 6: str = "16 seconds"; break;
7251     case 7: str = "22 seconds"; break;
7252     case 8: str = "30 seconds"; break;
7253     case 9: str = "42 seconds"; break;
7254     case 10: str = "58 seconds"; break;
7255     case 11: str = "81 seconds"; break;
7256     case 12: str = "112 seconds"; break;
7257     case 13: str = "156 seconds"; break;
7258     case 14: str = "217 seconds"; break;
7259     case 15: str = "300 seconds"; break;
7260     case 16: str = "Remove gap control"; break;
7261     case 17: str = "0.10 seconds"; break;
7262     case 18: str = "0.25 seconds"; break;
7263     case 19: str = "0.5 seconds"; break;
7264     case 20: str = "1 second"; break;
7265     case 21: str = "2 seconds"; break;
7266     default:
7267         str = "Reserved, treat as 0 seconds";
7268         break;
7269     }
7270
7271     proto_tree_add_text(tree, asn1->tvb,
7272         saved_offset, asn1->offset - saved_offset,
7273         str);
7274 }
7275
7276 static void
7277 param_tdma_time_align(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
7278 {
7279     gint32 value;
7280     guint saved_offset;
7281
7282     saved_offset = asn1->offset;
7283
7284     asn1_int32_value_decode(asn1, 1, &value);
7285
7286     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
7287     proto_tree_add_text(tree, asn1->tvb,
7288         saved_offset, asn1->offset - saved_offset,
7289         "%s :  Reserved",
7290         bigbuf);
7291
7292
7293     other_decode_bitfield_value(bigbuf, value, 0x1f, 8);
7294     proto_tree_add_text(tree, asn1->tvb,
7295         saved_offset, asn1->offset - saved_offset,
7296         "%s :  Time Alignment Offset (TA), %u",
7297         bigbuf,
7298         value & 0x1f);
7299
7300     EXTRANEOUS_DATA_CHECK(len, 1);
7301 }
7302
7303 static void
7304 dump_rssi(ASN1_SCK *asn1, proto_tree *tree, const gchar *leader)
7305 {
7306     gint32 value;
7307     guint saved_offset;
7308     const gchar *str = NULL;
7309
7310     saved_offset = asn1->offset;
7311
7312     asn1_int32_value_decode(asn1, 1, &value);
7313
7314     switch ((value & 0xc0) >> 6)
7315     {
7316     case 0: str = "800 MHz"; break;
7317     case 1: str = "1900 MHz"; break;
7318     default:
7319         str = "Reserved";
7320         break;
7321     }
7322
7323     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
7324     proto_tree_add_text(tree, asn1->tvb,
7325         saved_offset, asn1->offset - saved_offset,
7326         "%s :  %sHyper, %s",
7327         bigbuf,
7328         leader,
7329         str);
7330
7331     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
7332     proto_tree_add_text(tree, asn1->tvb,
7333         saved_offset, asn1->offset - saved_offset,
7334         "%s :  Reserved",
7335         bigbuf);
7336
7337     other_decode_bitfield_value(bigbuf, value, 0x1f, 8);
7338     proto_tree_add_text(tree, asn1->tvb,
7339         saved_offset, asn1->offset - saved_offset,
7340         "%s :  %sRSSI, %u",
7341         bigbuf,
7342         leader,
7343         value & 0x1f);
7344 }
7345
7346 static void
7347 param_tdma_maho_cell_id(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string, int string_len)
7348 {
7349     gint32 value, num_rssi, num_msc;
7350     guint saved_offset, orig_offset;
7351     gint32 i, j;
7352
7353     SHORT_DATA_CHECK(len, 3);
7354
7355     orig_offset = asn1->offset;
7356
7357     dump_rssi(asn1, tree, "Serving Cell ");
7358
7359     saved_offset = asn1->offset;
7360
7361     asn1_int32_value_decode(asn1, 1, &num_rssi);
7362
7363     proto_tree_add_text(tree, asn1->tvb,
7364         saved_offset, asn1->offset - saved_offset,
7365         "Number of RSSI %u",
7366         num_rssi);
7367
7368     for (i = 0; i < num_rssi; i++)
7369     {
7370         if ((len - (asn1->offset - orig_offset)) < 3)
7371         {
7372             proto_tree_add_text(tree, asn1->tvb,
7373                 asn1->offset, len - (asn1->offset - orig_offset),
7374                 "Short Data (?)");
7375
7376             asn1->offset += len - (asn1->offset - orig_offset);
7377             return;
7378         }
7379
7380         dump_rssi(asn1, tree, "");
7381
7382         saved_offset = asn1->offset;
7383
7384         asn1_int32_value_decode(asn1, 2, &value);
7385
7386         proto_tree_add_text(tree, asn1->tvb,
7387             saved_offset, asn1->offset - saved_offset,
7388             "Measured Cell ID %u",
7389             value);
7390     }
7391
7392     saved_offset = asn1->offset;
7393
7394     asn1_int32_value_decode(asn1, 1, &num_msc);
7395
7396     proto_tree_add_text(tree, asn1->tvb,
7397         saved_offset, asn1->offset - saved_offset,
7398         "Number of MSC %u",
7399         num_msc);
7400
7401     for (i = 0; i < num_msc; i++)
7402     {
7403         if ((len - (asn1->offset - orig_offset)) < 4)
7404         {
7405             proto_tree_add_text(tree, asn1->tvb,
7406                 asn1->offset, len - (asn1->offset - orig_offset),
7407                 "Short Data (?)");
7408
7409             asn1->offset += len - (asn1->offset - orig_offset);
7410             return;
7411         }
7412
7413         param_mscid(asn1, tree, 3, add_string, string_len);
7414
7415         saved_offset = asn1->offset;
7416
7417         asn1_int32_value_decode(asn1, 1, &num_rssi);
7418
7419         proto_tree_add_text(tree, asn1->tvb,
7420             saved_offset, asn1->offset - saved_offset,
7421             "Number of RSSI %u",
7422             num_rssi);
7423
7424         for (j = 0; j < num_rssi; j++)
7425         {
7426             if ((len - (asn1->offset - orig_offset)) < 3)
7427             {
7428                 proto_tree_add_text(tree, asn1->tvb,
7429                     asn1->offset, len - (asn1->offset - orig_offset),
7430                     "Short Data (?)");
7431
7432                 asn1->offset += len - (asn1->offset - orig_offset);
7433                 return;
7434             }
7435
7436             dump_rssi(asn1, tree, "");
7437
7438             saved_offset = asn1->offset;
7439
7440             asn1_int32_value_decode(asn1, 2, &value);
7441
7442             proto_tree_add_text(tree, asn1->tvb,
7443                 saved_offset, asn1->offset - saved_offset,
7444                 "Measured Cell ID %u",
7445                 value);
7446         }
7447     }
7448
7449     EXTRANEOUS_DATA_CHECK((len - (asn1->offset - orig_offset)), 0);
7450 }
7451
7452 static void
7453 param_tdma_maho_chan(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string, int string_len)
7454 {
7455     gint32 value, num_rssi, num_msc;
7456     guint saved_offset, orig_offset;
7457     gint32 i, j;
7458
7459     SHORT_DATA_CHECK(len, 3);
7460
7461     orig_offset = asn1->offset;
7462
7463     dump_rssi(asn1, tree, "Serving Cell ");
7464
7465     saved_offset = asn1->offset;
7466
7467     asn1_int32_value_decode(asn1, 1, &num_rssi);
7468
7469     proto_tree_add_text(tree, asn1->tvb,
7470         saved_offset, asn1->offset - saved_offset,
7471         "Number of RSSI %u",
7472         num_rssi);
7473
7474     for (i = 0; i < num_rssi; i++)
7475     {
7476         if ((len - (asn1->offset - orig_offset)) < 3)
7477         {
7478             proto_tree_add_text(tree, asn1->tvb,
7479                 asn1->offset, len - (asn1->offset - orig_offset),
7480                 "Short Data (?)");
7481
7482             asn1->offset += len - (asn1->offset - orig_offset);
7483             return;
7484         }
7485
7486         dump_rssi(asn1, tree, "");
7487
7488         saved_offset = asn1->offset;
7489
7490         asn1_int32_value_decode(asn1, 2, &value);
7491
7492         other_decode_bitfield_value(bigbuf, value >> 8, 0xff, 8);
7493         proto_tree_add_text(tree, asn1->tvb,
7494             saved_offset, 1,
7495             "%s :  Measured Channel (MSB), %u",
7496             bigbuf,
7497             (value & 0xffe0) >> 5);
7498
7499         other_decode_bitfield_value(bigbuf, value & 0xff, 0xe0, 8);
7500         proto_tree_add_text(tree, asn1->tvb,
7501             saved_offset+1, 1,
7502             "%s :  Measured Channel (LSB)",
7503             bigbuf);
7504     }
7505
7506     saved_offset = asn1->offset;
7507
7508     asn1_int32_value_decode(asn1, 1, &num_msc);
7509
7510     proto_tree_add_text(tree, asn1->tvb,
7511         saved_offset, asn1->offset - saved_offset,
7512         "Number of MSC %u",
7513         num_msc);
7514
7515     for (i = 0; i < num_msc; i++)
7516     {
7517         if ((len - (asn1->offset - orig_offset)) < 4)
7518         {
7519             proto_tree_add_text(tree, asn1->tvb,
7520                 asn1->offset, len - (asn1->offset - orig_offset),
7521                 "Short Data (?)");
7522
7523             asn1->offset += len - (asn1->offset - orig_offset);
7524             return;
7525         }
7526
7527         param_mscid(asn1, tree, 3, add_string, string_len);
7528
7529         saved_offset = asn1->offset;
7530
7531         asn1_int32_value_decode(asn1, 1, &num_rssi);
7532
7533         proto_tree_add_text(tree, asn1->tvb,
7534             saved_offset, asn1->offset - saved_offset,
7535             "Number of RSSI %u",
7536             num_rssi);
7537
7538         for (j = 0; j < num_rssi; j++)
7539         {
7540             if ((len - (asn1->offset - orig_offset)) < 3)
7541             {
7542                 proto_tree_add_text(tree, asn1->tvb,
7543                     asn1->offset, len - (asn1->offset - orig_offset),
7544                     "Short Data (?)");
7545
7546                 asn1->offset += len - (asn1->offset - orig_offset);
7547                 return;
7548             }
7549
7550             dump_rssi(asn1, tree, "");
7551
7552             saved_offset = asn1->offset;
7553
7554             asn1_int32_value_decode(asn1, 2, &value);
7555
7556             other_decode_bitfield_value(bigbuf, value >> 8, 0xff, 8);
7557             proto_tree_add_text(tree, asn1->tvb,
7558                 saved_offset, 1,
7559                 "%s :  Measured Channel (MSB), %u",
7560                 bigbuf,
7561                 (value & 0xffe0) >> 5);
7562
7563             other_decode_bitfield_value(bigbuf, value & 0xff, 0xe0, 8);
7564             proto_tree_add_text(tree, asn1->tvb,
7565                 saved_offset+1, 1,
7566                 "%s :  Measured Channel (LSB)",
7567                 bigbuf);
7568         }
7569     }
7570
7571     EXTRANEOUS_DATA_CHECK((len - (asn1->offset - orig_offset)), 0);
7572 }
7573
7574 static void
7575 param_tdma_maho_req(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
7576 {
7577     gint32 value;
7578     guint saved_offset;
7579     const gchar *str = NULL;
7580
7581     EXACT_DATA_CHECK(len, 1);
7582
7583     saved_offset = asn1->offset;
7584
7585     asn1_int32_value_decode(asn1, 1, &value);
7586
7587     switch (value)
7588     {
7589     case 0: str = "No MAHO information requested"; break;
7590     case 1: str = "MAHO information requested"; break;
7591     default:
7592         str = "Reserved, treat as No MAHO information requested";
7593         break;
7594     }
7595
7596     proto_tree_add_text(tree, asn1->tvb,
7597         saved_offset, asn1->offset - saved_offset,
7598         str);
7599 }
7600
7601 static void
7602 param_sm_gap_int(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
7603 {
7604     gint32 value;
7605     guint saved_offset;
7606     const gchar *str = NULL;
7607
7608     EXACT_DATA_CHECK(len, 1);
7609
7610     saved_offset = asn1->offset;
7611
7612     asn1_int32_value_decode(asn1, 1, &value);
7613
7614     switch (value)
7615     {
7616     case 0: str = "Remove gap control"; break;
7617     case 1: str = "0 seconds"; break;
7618     case 2: str = "0.10 seconds"; break;
7619     case 3: str = "0.25 seconds"; break;
7620     case 4: str = "0.50 seconds"; break;
7621     case 5: str = "1 second"; break;
7622     case 6: str = "2 seconds"; break;
7623     case 7: str = "5 seconds"; break;
7624     case 8: str = "10 seconds"; break;
7625     case 9: str = "15 seconds"; break;
7626     case 10: str = "30 seconds"; break;
7627     case 11: str = "60 seconds"; break;
7628     case 12: str = "120 seconds"; break;
7629     case 13: str = "300 seconds"; break;
7630     case 14: str = "600 seconds"; break;
7631     case 15: str = "Stop all queries"; break;
7632     default:
7633         str = "Reserved, treat as Remove gap control";
7634         break;
7635     }
7636
7637     proto_tree_add_text(tree, asn1->tvb,
7638         saved_offset, asn1->offset - saved_offset,
7639         str);
7640 }
7641
7642 static void
7643 param_mob_cap(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
7644 {
7645     gint32 value;
7646     guint saved_offset, i;
7647     const gchar *str = NULL;
7648
7649     for (i=0; i < len; i++)
7650     {
7651         saved_offset = asn1->offset;
7652
7653         asn1_int32_value_decode(asn1, 1, &value);
7654
7655         switch (value)
7656         {
7657         case 0: str = "Undefined Mobile Position Capabilities"; break;
7658         case 1: str = "CDMA None"; break;
7659         case 2: str = "CDMA Pilot Phase + GPS - MS shall be capable of supporting A-FLT and GPS for position determination"; break;
7660         case 3: str = "CDMA Pilot Phase Only - MS shall be capable of supporting A-FLT only for position determination"; break;
7661         case 4: str = "CDMA GPS Only - MS shall be capable of supporting GPS only for position determination"; break;
7662         case 51: str = "TDMA None. See TIA/EIA-136-740"; break;
7663         case 52: str = "TDMA MS-Based with Network Assistance SAMPS Supported. See TIA/EIA-136-740"; break;
7664         case 53: str = "TDMA MS-Assisted SAMPS Supported. See TIA/EIA-136-740"; break;
7665         case 54: str = "TDMA SAMPS Time Measurement Capability Supported. See TIA/EIA-136-740"; break;
7666         case 55: str = "TDMA MS-Based Stand-alone SAMPS Supported. See TIA/EIA-136-740"; break;
7667         case 101: str = "AMPS None"; break;
7668         case 102: str = "AMPS MS-based - MS shall be capable of autonomously determining the position without assistance from the network"; break;
7669         case 103: str = "AMPS assisted GPS - MS shall be capable of utilizing network assistance in providing GPS satellite measurements for position determination in the network or of utilizing network assistance in position determination in the MS"; break;
7670         default:
7671             if ((value >= 5) && (value <= 50)) { str = "Reserved for CDMA, treat as CDMA None"; }
7672             else if ((value >= 56) && (value <= 100)) { str = "Reserved for TDMA, treat as TDMA None"; }
7673             else if ((value >= 104) && (value <= 150)) { str = "Reserved for AMPS, treat as AMPS None"; }
7674             else if ((value >= 151) && (value <= 223)) { str = "Reserved, treat as Undefined"; }
7675             else { str = "Reserved for protocol extension, treat as Undefined"; }
7676             break;
7677         }
7678
7679         proto_tree_add_text(tree, asn1->tvb,
7680             saved_offset, asn1->offset - saved_offset,
7681             "Mobile Position Capability, %s",
7682             str);
7683     }
7684 }
7685
7686 static void
7687 param_cdma_psmm_count(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
7688 {
7689     gint32 value;
7690     guint saved_offset;
7691
7692     EXACT_DATA_CHECK(len, 1);
7693
7694     saved_offset = asn1->offset;
7695
7696     asn1_int32_value_decode(asn1, 1, &value);
7697
7698     proto_tree_add_text(tree, asn1->tvb,
7699         saved_offset, asn1->offset - saved_offset,
7700         "Number of CDMA Pilot Strength Measurements to return, %u",
7701         value);
7702 }
7703
7704 static void
7705 param_cdma_sowd2(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
7706 {
7707     gint32 value;
7708     guint saved_offset;
7709     const gchar *str = NULL;
7710
7711     SHORT_DATA_CHECK(len, 5);
7712
7713     saved_offset = asn1->offset;
7714
7715     asn1_int32_value_decode(asn1, 2, &value);
7716
7717     proto_tree_add_text(tree, asn1->tvb,
7718         saved_offset, asn1->offset - saved_offset,
7719         "CDMA Serving One Way Delay, %u",
7720         value);
7721
7722     saved_offset = asn1->offset;
7723
7724     asn1_int32_value_decode(asn1, 1, &value);
7725
7726     other_decode_bitfield_value(bigbuf, value, 0xfc, 8);
7727     proto_tree_add_text(tree, asn1->tvb,
7728         saved_offset, asn1->offset - saved_offset,
7729         "%s :  Reserved",
7730         bigbuf);
7731
7732     switch (value & 0x03)
7733     {
7734     case 0: str = "100 nsec"; break;
7735     case 1: str = "50 nsec"; break;
7736     case 2: str = "1/16 CDMA PN Chip"; break;
7737     case 3: str = "Reserved"; break;
7738     }
7739
7740     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
7741     proto_tree_add_text(tree, asn1->tvb,
7742         saved_offset, asn1->offset - saved_offset,
7743         "%s :  Resolution, %s",
7744         bigbuf,
7745         str);
7746
7747     saved_offset = asn1->offset;
7748
7749     asn1_int32_value_decode(asn1, 2, &value);
7750
7751     proto_tree_add_text(tree, asn1->tvb,
7752         saved_offset, asn1->offset - saved_offset,
7753         "Serving One Way Delay TimeStamp, %u",
7754         value);
7755
7756     EXTRANEOUS_DATA_CHECK(len, 5);
7757 }
7758
7759 static void
7760 param_sms_charge_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
7761 {
7762     gint32 value;
7763     guint saved_offset;
7764     const gchar *str = NULL;
7765
7766     saved_offset = asn1->offset;
7767
7768     asn1_int32_value_decode(asn1, 1, &value);
7769
7770     switch (value)
7771     {
7772     case 0: str = "Not used"; break;
7773     case 1: str = "No charge"; break;
7774     case 2: str = "Charge original originator"; break;
7775     case 3: str = "Charge original destination"; break;
7776     default:
7777         str = "Reserved";
7778         break;
7779     }
7780
7781     proto_tree_add_text(tree, asn1->tvb,
7782         saved_offset, asn1->offset - saved_offset,
7783         "Charge %u, %s",
7784         value,
7785         str);
7786
7787     EXTRANEOUS_DATA_CHECK(len, 1);
7788 }
7789
7790 static void
7791 param_auth_per(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
7792 {
7793     gint32 value;
7794     guint saved_offset;
7795     const gchar *str = NULL;
7796
7797     EXACT_DATA_CHECK(len, 2);
7798
7799     saved_offset = asn1->offset;
7800
7801     asn1_int32_value_decode(asn1, 1, &value);
7802
7803     switch (value)
7804     {
7805     case 0: str = "Not used"; break;
7806     case 1: str = "Per call"; break;
7807     case 2: str = "Hours"; break;
7808     case 3: str = "Days"; break;
7809     case 4: str = "Weeks"; break;
7810     case 5: str = "Per agreement"; break;
7811     case 6: str = "Indefinite"; break;
7812     case 7: str = "Number of calls"; break;
7813     default:
7814         if ((value >= 8) && (value <= 223)) { str = "Reserved, treat as Per call"; }
7815         else { str = "Reserved for protocol extension, treat as Per call"; }
7816         break;
7817     }
7818
7819     proto_tree_add_text(tree, asn1->tvb,
7820         saved_offset, asn1->offset - saved_offset,
7821         "Period (%u) %s",
7822         value,
7823         str);
7824
7825     saved_offset = asn1->offset;
7826
7827     asn1_int32_value_decode(asn1, 1, &value);
7828
7829     proto_tree_add_text(tree, asn1->tvb,
7830         saved_offset, asn1->offset - saved_offset,
7831         "Value %u",
7832         value);
7833 }
7834
7835 static void
7836 param_ctrl_chan_mode(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
7837 {
7838     gint32 value;
7839     guint saved_offset;
7840     const gchar *str = NULL;
7841
7842     saved_offset = asn1->offset;
7843
7844     asn1_int32_value_decode(asn1, 1, &value);
7845
7846     switch (value)
7847     {
7848     case 0: str = "Unknown"; break;
7849     case 1: str = "MS is in Analog CC Mode"; break;
7850     case 2: str = "MS is in Digital CC Mode"; break;
7851     case 3: str = "MS is in NAMPS CC Mode"; break;
7852     default:
7853         if ((value >= 4) && (value <= 223)) { str = "Reserved, treat as Unknown"; }
7854         else { str = "Reserved for protocol extension, treat as Unknown"; }
7855         break;
7856     }
7857
7858     proto_tree_add_text(tree, asn1->tvb,
7859         saved_offset, asn1->offset - saved_offset,
7860         str);
7861
7862     EXTRANEOUS_DATA_CHECK(len, 1);
7863 }
7864
7865 static void
7866 param_tdma_data_mode(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
7867 {
7868     gint32 value;
7869     guint saved_offset;
7870     const gchar *str = NULL;
7871
7872     SHORT_DATA_CHECK(len, 2);
7873
7874     saved_offset = asn1->offset;
7875
7876     asn1_int32_value_decode(asn1, 1, &value);
7877
7878     switch ((value & 0xe0) >> 5)
7879     {
7880     case 0: str = "As per IS-135"; break;
7881     case 1: str = "As per FSVS - 211 (STU-III)"; break;
7882     default:
7883         str = "Reserved";
7884         break;
7885     }
7886
7887     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
7888     proto_tree_add_text(tree, asn1->tvb,
7889         saved_offset, asn1->offset - saved_offset,
7890         "%s :  Data Part, %s",
7891         bigbuf,
7892         str);
7893
7894     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
7895     proto_tree_add_text(tree, asn1->tvb,
7896         saved_offset, asn1->offset - saved_offset,
7897         "%s :  AD, %s",
7898         bigbuf,
7899         (value & 0x10) ? "unacknowledged data only" : "unacked data or both");
7900
7901     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
7902     proto_tree_add_text(tree, asn1->tvb,
7903         saved_offset, asn1->offset - saved_offset,
7904         "%s :  %s",
7905         bigbuf,
7906         (value & 0x08) ? "SAP 0 and 1" : "SAP 0 only");
7907
7908     switch (value & 0x07)
7909     {
7910     case 0: str = "No Data Privacy"; break;
7911     case 1: str = "Data Privacy Algorithm A"; break;
7912     default:
7913         str = "Reserved, treat as No Data Privacy";
7914         break;
7915     }
7916
7917     other_decode_bitfield_value(bigbuf, value, 0x07, 8);
7918     proto_tree_add_text(tree, asn1->tvb,
7919         saved_offset, asn1->offset - saved_offset,
7920         "%s :  Data Privacy Mode, %s",
7921         bigbuf,
7922         str);
7923
7924     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
7925     proto_tree_add_text(tree, asn1->tvb,
7926         saved_offset, asn1->offset - saved_offset,
7927         "%s :  Reserved",
7928         bigbuf);
7929
7930     switch ((value & 0x0c) >> 2)
7931     {
7932     case 0: str = "RLP1"; break;
7933     case 1: str = "RLP2"; break;
7934     default:
7935         str = "Reserved";
7936         break;
7937     }
7938
7939     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
7940     proto_tree_add_text(tree, asn1->tvb,
7941         saved_offset, asn1->offset - saved_offset,
7942         "%s :  %s",
7943         bigbuf,
7944         str);
7945
7946     switch (value & 0x03)
7947     {
7948     case 0: str = "16-bit Cyclic Redundancy Check"; break;
7949     case 1: str = "24-bit Cyclic Redundancy Check"; break;
7950     case 2: str = "No Cyclic Redundancy Check"; break;
7951     default:
7952         str = "Reserved";
7953         break;
7954     }
7955
7956     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
7957     proto_tree_add_text(tree, asn1->tvb,
7958         saved_offset, asn1->offset - saved_offset,
7959         "%s :  %s",
7960         bigbuf,
7961         str);
7962
7963     EXTRANEOUS_DATA_CHECK(len, 2);
7964 }
7965
7966 static void
7967 param_tdma_voice_mode(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
7968 {
7969     gint32 value;
7970     guint saved_offset;
7971     const gchar *str = NULL;
7972
7973     saved_offset = asn1->offset;
7974
7975     asn1_int32_value_decode(asn1, 1, &value);
7976
7977     switch ((value & 0xf0) >> 4)
7978     {
7979     case 0: str = "No Voice Privacy"; break;
7980     case 1: str = "Voice Privacy Algorithm A"; break;
7981     case 2: str = "Reserved, treat as No Voice Privacy"; break;
7982     case 3: str = "Reserved, treat as No Voice Privacy"; break;
7983     case 4: str = "Reserved for SOC/BMSC Specific signaling"; break;
7984     default:
7985         str = "Reserved, treat as No Voice Privacy";
7986         break;
7987     }
7988
7989     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
7990     proto_tree_add_text(tree, asn1->tvb,
7991         saved_offset, asn1->offset - saved_offset,
7992         "%s :  Voice Privacy Mode, %s",
7993         bigbuf,
7994         str);
7995
7996     switch (value & 0x0f)
7997     {
7998     case 0: str = "No Voice Coder"; break;
7999     case 1: str = "VSELP Voice Coder"; break;
8000     case 2: str = "IS-641 Voice Coder"; break;
8001     case 6: str = "Reserved for SOC/BMSC Specific signaling"; break;
8002     default:
8003         str = "Reserved, treat as No Voice Coder";
8004         break;
8005     }
8006
8007     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
8008     proto_tree_add_text(tree, asn1->tvb,
8009         saved_offset, asn1->offset - saved_offset,
8010         "%s :  Voice Coder, %s",
8011         bigbuf,
8012         str);
8013
8014     EXTRANEOUS_DATA_CHECK(len, 1);
8015 }
8016
8017 static void
8018 param_tdma_bandwidth(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
8019 {
8020     gint32 value;
8021     guint saved_offset;
8022     const gchar *str = NULL;
8023
8024     saved_offset = asn1->offset;
8025
8026     asn1_int32_value_decode(asn1, 1, &value);
8027
8028     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
8029     proto_tree_add_text(tree, asn1->tvb,
8030         saved_offset, asn1->offset - saved_offset,
8031         "%s :  Reserved",
8032         bigbuf);
8033
8034     switch (value & 0x0f)
8035     {
8036     case 0: str = "Half-Rate Digital Traffic Channel Only"; break;
8037     case 1: str = "Full-Rate Digital Traffic Channel Only"; break;
8038     case 2: str = "Half-Rate or Full-rate Digital Traffic Channel - Full-Rate Preferred"; break;
8039     case 3: str = "Half-rate or Full-rate Digital Traffic Channel - Half-rate Preferred"; break;
8040     case 4: str = "Double Full-Rate Digital Traffic Channel Only"; break;
8041     case 5: str = "Triple Full-Rate Digital Traffic Channel Only"; break;
8042     default:
8043         str = "Reserved, treat as Full-Rate Digital Traffic Channel Only";
8044         break;
8045     }
8046
8047     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
8048     proto_tree_add_text(tree, asn1->tvb,
8049         saved_offset, asn1->offset - saved_offset,
8050         "%s :  Bandwidth, %s",
8051         bigbuf,
8052         str);
8053
8054     EXTRANEOUS_DATA_CHECK(len, 1);
8055 }
8056
8057 static void
8058 param_change_srvc_attr(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
8059 {
8060     gint32 value;
8061     guint saved_offset;
8062     const gchar *str = NULL;
8063
8064     saved_offset = asn1->offset;
8065
8066     asn1_int32_value_decode(asn1, 1, &value);
8067
8068     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
8069     proto_tree_add_text(tree, asn1->tvb,
8070         saved_offset, asn1->offset - saved_offset,
8071         "%s :  Reserved",
8072         bigbuf);
8073
8074     switch ((value & 0x0c) >> 2)
8075     {
8076     case 0: str = "Service Negotiation Used"; break;
8077     case 1: str = "Service Negotiation Not Used"; break;
8078     case 2: str = "Service Negotiation Required"; break;
8079     case 3: str = "Service Negotiation Not Required"; break;
8080     }
8081
8082     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
8083     proto_tree_add_text(tree, asn1->tvb,
8084         saved_offset, asn1->offset - saved_offset,
8085         "%s :  Service Negotiate Flag (SRVNEG), %s",
8086         bigbuf,
8087         str);
8088
8089     switch (value & 0x03)
8090     {
8091     case 0 : str = "Change Facilities Operation Requested"; break;
8092     case 1 : str = "Change Facilities Operation Not Requested"; break;
8093     case 2 : str = "Change Facilities Operation Used"; break;
8094     case 3 : str = "Change Facilities Operation Not Used"; break;
8095     }
8096
8097     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
8098     proto_tree_add_text(tree, asn1->tvb,
8099         saved_offset, asn1->offset - saved_offset,
8100         "%s :  Change Facilities Flag (CHGFAC), %s",
8101         bigbuf,
8102         str);
8103
8104     EXTRANEOUS_DATA_CHECK(len, 1);
8105 }
8106
8107 static void
8108 param_dp_params(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
8109 {
8110     gint32 value;
8111     guint saved_offset;
8112     const gchar *str = NULL;
8113
8114     SHORT_DATA_CHECK(len, 4);
8115
8116     saved_offset = asn1->offset;
8117
8118     asn1_int32_value_decode(asn1, 1, &value);
8119
8120     other_decode_bitfield_value(bigbuf, value, 0xfc, 8);
8121     proto_tree_add_text(tree, asn1->tvb,
8122         saved_offset, asn1->offset - saved_offset,
8123         "%s :  Reserved",
8124         bigbuf);
8125
8126     switch (value & 0x03)
8127     {
8128     case 0: str = "Privacy inactive or not supported"; break;
8129     case 1: str = "Privacy Requested or Acknowledged"; break;
8130     default:
8131         str = "Reserved, treat as Privacy inactive or not supported";
8132         break;
8133     }
8134
8135     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
8136     proto_tree_add_text(tree, asn1->tvb,
8137         saved_offset, asn1->offset - saved_offset,
8138         "%s :  Privacy Mode, %s",
8139         bigbuf,
8140         str);
8141
8142     saved_offset = asn1->offset;
8143
8144     asn1_int32_value_decode(asn1, 1, &value);
8145
8146     switch (value)
8147     {
8148     case 0: str = "Not used"; break;
8149     case 1: str = "Data Privacy Version 1"; break;
8150     default:
8151         if ((value >= 2) && (value <= 223)) { str = "Reserved, treat as Not used"; }
8152         else { str = "Reserved for protocol extension, treat as Not used"; }
8153         break;
8154     }
8155
8156     proto_tree_add_text(tree, asn1->tvb,
8157         saved_offset, asn1->offset - saved_offset,
8158         "Data Privacy Version, %s",
8159         str);
8160
8161     saved_offset = asn1->offset;
8162
8163     proto_tree_add_text(tree, asn1->tvb,
8164         saved_offset, len - 2,
8165         "Data Privacy data");
8166
8167     asn1->offset += (len - 2);
8168 }
8169
8170 static void
8171 param_trn(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
8172 {
8173     guint saved_offset;
8174     guchar *poctets;
8175
8176     saved_offset = asn1->offset;
8177
8178     asn1_string_value_decode(asn1, len, &poctets);
8179
8180     my_dgt_tbcd_unpack(bigbuf, poctets, len, &Dgt_msid);
8181     g_free(poctets);
8182
8183     proto_tree_add_text(tree, asn1->tvb,
8184         saved_offset, len, "TRN %s", bigbuf);
8185 }
8186
8187 static void
8188 param_islp_info(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
8189 {
8190     gint32 value;
8191     guint saved_offset;
8192     const gchar *str = NULL;
8193
8194     saved_offset = asn1->offset;
8195
8196     asn1_int32_value_decode(asn1, 1, &value);
8197
8198     switch (value)
8199     {
8200     case 0: str = "No ISLP supported"; break;
8201     case 1: str = "ISLP supported (see ISLP)"; break;
8202     default:
8203         if ((value >= 2) && (value <= 112)) { str = "Reserved, treat as No ISLP supported"; }
8204         else if ((value >= 113) && (value <= 223)) { str = "Reserved, treat as ISLP supported"; }
8205         else if ((value >= 224) && (value <= 240)) { str = "Reserved for protocol extension, treat as No ISLP supported"; }
8206         else { str = "Reserved for protocol extension, treat as ISLP supported"; }
8207         break;
8208     }
8209
8210     proto_tree_add_text(tree, asn1->tvb,
8211         saved_offset, asn1->offset - saved_offset,
8212         str);
8213
8214     EXTRANEOUS_DATA_CHECK(len, 1);
8215 }
8216
8217 static void
8218 param_ana_red_info(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
8219 {
8220     gint32 value;
8221     guint saved_offset;
8222     const gchar *str = NULL;
8223
8224     saved_offset = asn1->offset;
8225
8226     asn1_int32_value_decode(asn1, 1, &value);
8227
8228     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
8229     proto_tree_add_text(tree, asn1->tvb,
8230         saved_offset, asn1->offset - saved_offset,
8231         "%s :  Reserved",
8232         bigbuf);
8233
8234     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
8235     proto_tree_add_text(tree, asn1->tvb,
8236         saved_offset, asn1->offset - saved_offset,
8237         "%s :  Ignore CDMA, %s",
8238         bigbuf,
8239         (value & 0x20) ?  "Ignore the CDMA Capability Message on the analog system to which it is being redirected" :
8240             "Don't ignore the CDMA Capability Message on the analog system to which it is being redirected");
8241
8242     switch (value & 0x1f)
8243     {
8244     case 0: str = "Attempt to obtain service on either System A or B in accordance with the custom system selection process"; break;
8245     case 1: str = "Attempt to obtain service on System A only"; break;
8246     case 2: str = "Error in IS-735, text was unspecified but not reserved"; break;
8247     case 3: str = "Attempt to obtain service on System A first.  If unsuccessful, attempt to obtain service on System B"; break;
8248     case 4: str = "Attempt to obtain service on System B first.  If unsuccessful, attempt to obtain service on System A"; break;
8249     case 5: str = "Attempt to obtain service on either System A or System B. If unsuccessful, attempt to obtain service on the alternate system (System A or System B)"; break;
8250
8251     default:
8252         str = "Reserved for protocol extension";
8253         break;
8254     }
8255
8256     other_decode_bitfield_value(bigbuf, value, 0x1f, 8);
8257     proto_tree_add_text(tree, asn1->tvb,
8258         saved_offset, asn1->offset - saved_offset,
8259         "%s :  Sys Ordering, %s",
8260         bigbuf,
8261         str);
8262
8263     EXTRANEOUS_DATA_CHECK(len, 1);
8264 }
8265
8266 static void
8267 param_reason_list(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
8268 {
8269     gint32 value;
8270     gint i;
8271     guint saved_offset;
8272     const gchar *str = NULL;
8273
8274     saved_offset = asn1->offset;
8275
8276     i = 0;
8277
8278     do
8279     {
8280         asn1_int32_value_decode(asn1, 1, &value);
8281
8282         switch (value)
8283         {
8284         case 0: str = "Unknown"; break;
8285         case 1: str = "Unable to configure ISLP"; break;
8286         case 2: str = "ISLP failure"; break;
8287         case 3: str = "Service allowed but facilities not available"; break;
8288         case 4: str = "Service not allowed"; break;
8289         case 5: str = "No Response to TMSI assignment"; break;
8290         case 6: str = "Required parameters unavailable. (e.g., as indicated by the RequiredParametersMask parameter)"; break;
8291         default:
8292             if ((value >= 7) && (value <= 110)) { str = "Reserved for common CDMA and TDMA network error causes. If unknown, treat as Unknown"; }
8293             else if ((value >= 111) && (value <= 127)) { str = "Reserved for common CDMA and TDMA network error causes for protocol extension. If unknown, treat as Unknown"; }
8294             else if ((value >= 128) && (value <= 174)) { str = "CDMA Specific error causes. If unknown, treat as Unknown"; }
8295             else if ((value >= 175) && (value <= 191)) { str = "CDMA Specific error causes for protocol extension. If unknown treat as Unknown"; }
8296             else if ((value >= 192) && (value <= 237)) { str = "TDMA Specific error causes as defined by the TDMACause parameter. If unknown treat as Unknown"; }
8297             else { str = "TDMA Specific error causes for protocol extension. If unknown, treat as Unknown"; }
8298             break;
8299         }
8300
8301         proto_tree_add_text(tree, asn1->tvb,
8302             saved_offset, asn1->offset - saved_offset,
8303             "[%u] %s",
8304             i++,
8305             str);
8306
8307         saved_offset = asn1->offset;
8308     }
8309     while ((len - i) > 0);
8310 }
8311
8312 static void
8313 param_imsi(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string, int string_len)
8314 {
8315     guint saved_offset;
8316     guchar *poctets;
8317
8318     saved_offset = asn1->offset;
8319     asn1_string_value_decode(asn1, len, &poctets);
8320
8321     my_dgt_tbcd_unpack(bigbuf, poctets, len, &Dgt_msid);
8322     g_free(poctets);
8323
8324     proto_tree_add_text(tree, asn1->tvb,
8325         saved_offset, len,
8326         "IMSI %s",
8327         bigbuf);
8328
8329     g_snprintf(add_string, string_len, " - %s", bigbuf);
8330 }
8331
8332 static void
8333 param_min_basic(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string, int string_len, gboolean true_min)
8334 {
8335     guint saved_offset;
8336     guchar *poctets;
8337
8338     EXACT_DATA_CHECK(len, 5);
8339
8340     saved_offset = asn1->offset;
8341     asn1_string_value_decode(asn1, len, &poctets);
8342
8343     my_dgt_tbcd_unpack(bigbuf, poctets, len, &Dgt_msid);
8344     g_free(poctets);
8345
8346     if (true_min)
8347     {
8348         proto_tree_add_string_format(tree, hf_ansi_map_min, asn1->tvb,
8349             saved_offset, len,
8350             bigbuf,
8351             "MIN %s",
8352             bigbuf);
8353     }
8354     else
8355     {
8356     proto_tree_add_text(tree, asn1->tvb,
8357                 saved_offset, len,
8358                 "MIN %s",
8359                 bigbuf);
8360         }
8361
8362     g_snprintf(add_string, string_len, " - %s", bigbuf);
8363 }
8364
8365 static void
8366 param_ms_min(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string, int string_len)
8367 {
8368     param_min_basic(asn1, tree, len, add_string, string_len, FALSE);
8369 }
8370
8371 static void
8372 param_new_min(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string, int string_len)
8373 {
8374     param_min_basic(asn1, tree, len, add_string, string_len, FALSE);
8375 }
8376
8377 static void
8378 param_min(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string, int string_len)
8379 {
8380     param_min_basic(asn1, tree, len, add_string, string_len, TRUE);
8381 }
8382
8383 static void
8384 param_auth_cap(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
8385 {
8386     gint32 value;
8387     guint saved_offset;
8388     const gchar *str = NULL;
8389
8390     EXACT_DATA_CHECK(len, 1);
8391
8392     saved_offset = asn1->offset;
8393
8394     asn1_int32_value_decode(asn1, 1, &value);
8395
8396     switch (value)
8397     {
8398     case 0: str = "Not used"; break;
8399     case 1: str = "No authentication required"; break;
8400     case 2: str = "Authentication required"; break;
8401     case 128: str = "Authentication required and UIM capable"; break;
8402     default:
8403         if ((value >= 3) && (value <= 95)) { str = "Reserved, treat as No authentication required"; }
8404         else if ((value >= 96) && (value <= 127)) { str = "Reserved for protocol extension, treat as No authentication required"; }
8405         else if ((value >= 129) && (value <= 223)) { str = "Reserved, treat as Authentication required"; }
8406         else { str = "Reserved for protocol extension, treat as Authentication required"; }
8407         break;
8408     }
8409
8410     proto_tree_add_text(tree, asn1->tvb,
8411         saved_offset, asn1->offset - saved_offset,
8412         str);
8413 }
8414
8415 static void
8416 param_sus_acc(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
8417 {
8418     gint32 value;
8419     guint saved_offset;
8420     const gchar *str = NULL;
8421
8422     EXACT_DATA_CHECK(len, 1);
8423
8424     saved_offset = asn1->offset;
8425
8426     asn1_int32_value_decode(asn1, 1, &value);
8427
8428     switch (value)
8429     {
8430     case 0: str = "Not used"; break;
8431     case 1: str = "Anomalous digits"; break;
8432     case 2: str = "Unspecified"; break;
8433     default:
8434         if ((value >= 3) && (value <= 113)) { str = "Reserved, treat as Anomalous digits"; }
8435         else if ((value >= 114) && (value <= 223)) { str = "Reserved, treat as Unspecified"; }
8436         else { str = "Reserved for protocol extension, treat as Unspecified"; }
8437         break;
8438     }
8439
8440     proto_tree_add_text(tree, asn1->tvb,
8441         saved_offset, asn1->offset - saved_offset,
8442         "Reason, %s",
8443         str);
8444 }
8445
8446 static void
8447 param_dis_text(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
8448 {
8449     gint32 value;
8450     guint saved_offset;
8451
8452     SHORT_DATA_CHECK(len, 3);
8453
8454     saved_offset = asn1->offset;
8455
8456     asn1_int32_value_decode(asn1, 1, &value);
8457
8458     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
8459     proto_tree_add_text(tree, asn1->tvb,
8460         saved_offset, asn1->offset - saved_offset,
8461         "%s :  Spec. has hardcoded 1",
8462         bigbuf);
8463
8464     other_decode_bitfield_value(bigbuf, value, 0x7f, 8);
8465     proto_tree_add_text(tree, asn1->tvb,
8466         saved_offset, asn1->offset - saved_offset,
8467         "%s :  Display type, see ANSI T1.610 for encoding",
8468         bigbuf);
8469
8470     saved_offset = asn1->offset;
8471
8472     proto_tree_add_text(tree, asn1->tvb,
8473         saved_offset, len - 1,
8474         "Display data");
8475
8476     asn1->offset += len - 1;
8477 }
8478
8479 static void
8480 param_dis_text2(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
8481 {
8482     gint32 value;
8483     guint orig_offset, saved_offset;
8484     const gchar *str = NULL;
8485
8486     SHORT_DATA_CHECK(len, 4);
8487
8488     orig_offset = asn1->offset;
8489     saved_offset = asn1->offset;
8490
8491     do
8492     {
8493         asn1_int32_value_decode(asn1, 1, &value);
8494
8495         switch (value)
8496         {
8497         case 0: str = "Not used"; break;
8498         case 1: str = "ASCII"; break;
8499         case 2: str = "ITU T.50. The International Reference Alphabet as defined in ITU-R Rec. T.50"; break;
8500         case 3: str = "User Specific"; break;
8501         case 4: str = "ISO 8859-1. The 8-bit single-byte coded character set Latin 1 as defined in ISO/IEC Standard 8859-1"; break;
8502         case 5: str = "ISO 10646. The Universal Multiple-Octet Coded Character Set (USC) as defined in ISO/IEC Standard 10646"; break;
8503         case 6: str = "ISO 8859-8. The 8-bit single-byte coded character set Hebrew as defined in ISO/IEC Standard 8859-8"; break;
8504         case 7: str = "IS-91 Extended Protocol Message. The length is determined by the Message Type; see TIA/EIA/IS-90"; break;
8505         case 8: str = "Shift-JIS. Variable 1-2 byte nonmodal encoding for Kanji, Kana, and Latin character sets defined in JIS X0201 and JIS X0206"; break;
8506         case 9: str = "KC C 5601. Variable 1-2 byte Korean encoding method"; break;
8507         default:
8508             if ((value >= 10) && (value <= 223)) { str = "Reserved, treat as ASCII"; }
8509             else { str = "Reserved, treat as ASCII"; }
8510             break;
8511         }
8512
8513         proto_tree_add_text(tree, asn1->tvb,
8514             saved_offset, asn1->offset - saved_offset,
8515             "Display Character Set, %s",
8516             str);
8517
8518         saved_offset = asn1->offset;
8519
8520         asn1_int32_value_decode(asn1, 1, &value);
8521
8522         proto_tree_add_text(tree, asn1->tvb,
8523             saved_offset, asn1->offset - saved_offset,
8524             "Display Type, %u, see ANSI T1.610",
8525             value);
8526
8527         saved_offset = asn1->offset;
8528
8529         asn1_int32_value_decode(asn1, 1, &value);
8530
8531         proto_tree_add_text(tree, asn1->tvb,
8532             saved_offset, asn1->offset - saved_offset,
8533             "Display Tag, %u",
8534             value);
8535
8536         saved_offset = asn1->offset;
8537
8538         asn1_int32_value_decode(asn1, 1, &value);
8539
8540         proto_tree_add_text(tree, asn1->tvb,
8541             saved_offset, asn1->offset - saved_offset,
8542             "Display Length, %u",
8543             value);
8544
8545         saved_offset = asn1->offset;
8546
8547         if (value > 0)
8548         {
8549             if ((guint32) value > (len - (saved_offset - orig_offset)))
8550             {
8551                 proto_tree_add_text(tree, asn1->tvb,
8552                     saved_offset, len - (saved_offset - orig_offset),
8553                     "Short Data (?)");
8554
8555                 asn1->offset += len - (saved_offset - orig_offset);
8556                 return;
8557             }
8558
8559             proto_tree_add_text(tree, asn1->tvb,
8560                 saved_offset, value,
8561                 "Display data");
8562
8563             asn1->offset += value;
8564
8565             saved_offset = asn1->offset;
8566         }
8567     }
8568     while ((len - (saved_offset - orig_offset)) >= 4);
8569
8570     EXTRANEOUS_DATA_CHECK((len - (saved_offset - orig_offset)), 0);
8571 }
8572
8573 static void
8574 param_dmh_srvc_id(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
8575 {
8576     gint32 value;
8577     guint orig_offset, saved_offset;
8578
8579     SHORT_DATA_CHECK(len, 5);
8580
8581     orig_offset = asn1->offset;
8582     saved_offset = asn1->offset;
8583
8584     do
8585     {
8586         asn1_int32_value_decode(asn1, 2, &value);
8587
8588         proto_tree_add_text(tree, asn1->tvb,
8589             saved_offset, asn1->offset - saved_offset,
8590             "Market ID %u",
8591             value);
8592
8593         saved_offset = asn1->offset;
8594
8595         asn1_int32_value_decode(asn1, 1, &value);
8596
8597         proto_tree_add_text(tree, asn1->tvb,
8598             saved_offset, asn1->offset - saved_offset,
8599             "Market Segment ID %u",
8600             value);
8601
8602         saved_offset = asn1->offset;
8603
8604         asn1_int32_value_decode(asn1, 2, &value);
8605
8606         proto_tree_add_text(tree, asn1->tvb,
8607             saved_offset, asn1->offset - saved_offset,
8608             "DMH Service ID Value %u",
8609             value);
8610
8611         saved_offset = asn1->offset;
8612     }
8613     while ((len - (saved_offset - orig_offset)) >= 5);
8614
8615     EXTRANEOUS_DATA_CHECK((len - (saved_offset - orig_offset)), 0);
8616 }
8617
8618 static void
8619 param_feat_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
8620 {
8621     gint32 value;
8622     guint orig_offset, saved_offset;
8623
8624     SHORT_DATA_CHECK(len, 5);
8625
8626     orig_offset = asn1->offset;
8627     saved_offset = asn1->offset;
8628
8629     do
8630     {
8631         asn1_int32_value_decode(asn1, 2, &value);
8632
8633         proto_tree_add_text(tree, asn1->tvb,
8634             saved_offset, asn1->offset - saved_offset,
8635             "Market ID %u",
8636             value);
8637
8638         saved_offset = asn1->offset;
8639
8640         asn1_int32_value_decode(asn1, 1, &value);
8641
8642         proto_tree_add_text(tree, asn1->tvb,
8643             saved_offset, asn1->offset - saved_offset,
8644             "Market Segment ID %u",
8645             value);
8646
8647         saved_offset = asn1->offset;
8648
8649         asn1_int32_value_decode(asn1, 2, &value);
8650
8651         proto_tree_add_text(tree, asn1->tvb,
8652             saved_offset, asn1->offset - saved_offset,
8653             "DMH Service ID Value %u",
8654             value);
8655
8656         saved_offset = asn1->offset;
8657     }
8658     while ((len - (saved_offset - orig_offset)) >= 5);
8659
8660     EXTRANEOUS_DATA_CHECK((len - (saved_offset - orig_offset)), 0);
8661 }
8662
8663 static void
8664 param_a_key_ver(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
8665 {
8666     gint32 value;
8667     gint i;
8668     guint saved_offset;
8669     const gchar *str = NULL;
8670
8671     saved_offset = asn1->offset;
8672
8673     i = 0;
8674
8675     do
8676     {
8677         asn1_int32_value_decode(asn1, 1, &value);
8678
8679         switch (value)
8680         {
8681         case 0: str = "Not used"; break;
8682         case 1: str = "A-key Generation not supported"; break;
8683         case 2: str = "Diffie Hellman with 768-bit modulus, 160-bit primitive, and 160-bit exponents"; break;
8684         case 3: str = "Diffie Hellman with 512-bit modulus, 160-bit primitive, and 160-bit exponents"; break;
8685         case 4: str = "Diffie Hellman with 768-bit modulus, 32-bit primitive, and 160-bit exponents"; break;
8686         default:
8687             if ((value >= 5) && (value <= 223)) { str = "Reserved, treat as A-key Generation not supported"; }
8688             else { str = "Reserved for protocol extension, treat as A-key Generation not supported"; }
8689             break;
8690         }
8691
8692         proto_tree_add_text(tree, asn1->tvb,
8693             saved_offset, asn1->offset - saved_offset,
8694             "[%u] %s",
8695             i++,
8696             str);
8697
8698         saved_offset = asn1->offset;
8699     }
8700     while ((len - i) > 0);
8701 }
8702
8703 static void
8704 param_inter_msg_time(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
8705 {
8706     gint32 value;
8707     guint saved_offset;
8708
8709     EXACT_DATA_CHECK(len, 1);
8710
8711     saved_offset = asn1->offset;
8712
8713     asn1_int32_value_decode(asn1, 1, &value);
8714
8715     proto_tree_add_text(tree, asn1->tvb,
8716         saved_offset, asn1->offset - saved_offset,
8717         "Timer Value, %u, %u seconds",
8718         value,
8719         value * 10);
8720
8721         /* XXX * 10 or / 10 ? */
8722 }
8723
8724 static void
8725 param_rel_cause(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
8726 {
8727     gint32 value;
8728     guint saved_offset;
8729     const gchar *str = NULL;
8730
8731     EXACT_DATA_CHECK(len, 1);
8732
8733     saved_offset = asn1->offset;
8734
8735     asn1_int32_value_decode(asn1, 1, &value);
8736
8737     switch (value)
8738     {
8739     case 0: str = "Unspecified"; break;
8740     case 1: str = "Calling Party"; break;
8741     case 2: str = "Called Party"; break;
8742     case 3: str = "Commanded Disconnect"; break;
8743     default:
8744         if ((value >= 4) && (value <= 23)) { str = "Reserved, treat as Calling Party"; }
8745         else if ((value >= 24) && (value <= 31)) { str = "Reserved for protocol extension. If unknown, treat as Calling Party"; }
8746         else if ((value >= 32) && (value <= 55)) { str = "Reserved, treat as Called Party"; }
8747         else if ((value >= 56) && (value <= 63)) { str = "Reserved for protocol extension. If unknown, treat as Called Party"; }
8748         else if ((value >= 64) && (value <= 87)) { str = "Reserved, treat as Commanded Disconnect"; }
8749         else if ((value >= 88) && (value <= 95)) { str = "Reserved for protocol extension. If unknown, treat as Commanded Disconnect"; }
8750         else if ((value >= 96) && (value <= 223)) { str = "Reserved, treat as Unspecified"; }
8751         else { str = "Reserved for protocol extension. If unknown, treat as Unspecified"; }
8752         break;
8753     }
8754
8755     proto_tree_add_text(tree, asn1->tvb,
8756         saved_offset, asn1->offset - saved_offset,
8757         str);
8758 }
8759
8760 static void
8761 param_time_day(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
8762 {
8763     gint32 value;
8764     gint32 h, m, s, ts;
8765     guint saved_offset;
8766
8767     EXACT_DATA_CHECK(len, 3);
8768
8769     saved_offset = asn1->offset;
8770
8771     asn1_int32_value_decode(asn1, 3, &value);
8772
8773     h = value / (3600 * 10);
8774     m = (value - (h * (3600 * 10))) / (60 * 10);
8775     s = (value - (h * (3600 * 10)) - (m * (60 * 10))) / 10;
8776     ts = (value - (h * (3600 * 10)) - (m * (60 * 10)) - (s * 10));
8777
8778     proto_tree_add_text(tree, asn1->tvb,
8779         saved_offset, asn1->offset - saved_offset,
8780         "(UTC) (in tenths of seconds - 1), %u (%u:%u:%u.%u)",
8781         value,
8782         h,
8783         m,
8784         s,
8785         ts);
8786 }
8787
8788 static void
8789 param_call_status(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
8790 {
8791     gint32 value;
8792     guint saved_offset;
8793     const gchar *str = NULL;
8794
8795     if (len > 4)
8796     {
8797         proto_tree_add_text(tree, asn1->tvb,
8798             asn1->offset, len, "Long Data (?)");
8799         asn1->offset += len;
8800         return;
8801     }
8802
8803     saved_offset = asn1->offset;
8804
8805     asn1->offset = saved_offset;
8806
8807     asn1_int32_value_decode(asn1, len, &value);
8808
8809     switch (value)
8810     {
8811     case 0: str = "Not used"; break;
8812     case 1: str = "Call Setup in Progress"; break;
8813     case 2: str = "Locally Allowed Call - No Action"; break;
8814     default:
8815         if (value < 0) { str = "Reserved for bilateral agreements. If unknown, treat as Not used"; }
8816         else { str = "Reserved, treat as Not used"; }
8817         break;
8818     }
8819
8820     proto_tree_add_text(tree, asn1->tvb,
8821         saved_offset, len,
8822         str);
8823 }
8824
8825 static void
8826 param_ms_status(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
8827 {
8828     gint32 value;
8829     guint saved_offset;
8830     const gchar *str = NULL;
8831     gboolean has_chan;
8832     gboolean extended;
8833
8834     saved_offset = asn1->offset;
8835
8836     asn1_int32_value_decode(asn1, 1, &value);
8837
8838     extended = (value & 0x80) >> 7;
8839
8840     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
8841     proto_tree_add_text(tree, asn1->tvb,
8842         saved_offset, asn1->offset - saved_offset,
8843         "%s :  Extension (EXT), %s",
8844         bigbuf,
8845         extended ? "No Extension, last octet of sequence" : "Extension indicator, the octet continues through the next octet");
8846
8847     other_decode_bitfield_value(bigbuf, value, 0x60, 8);
8848     proto_tree_add_text(tree, asn1->tvb,
8849         saved_offset, asn1->offset - saved_offset,
8850         "%s :  Reserved",
8851         bigbuf);
8852
8853     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
8854     proto_tree_add_text(tree, asn1->tvb,
8855         saved_offset, asn1->offset - saved_offset,
8856         "%s :  Location Information (LOC), %s",
8857         bigbuf,
8858         (value & 0x10) ? "MS location information available" : "No MS location information available");
8859
8860     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
8861     proto_tree_add_text(tree, asn1->tvb,
8862         saved_offset, asn1->offset - saved_offset,
8863         "%s :  Contact, %s",
8864         bigbuf,
8865         (value & 0x08) ? "Radio Contact Established" : "No Radio Contact");
8866
8867     has_chan = (value & 0x04) >> 2;
8868
8869     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
8870     proto_tree_add_text(tree, asn1->tvb,
8871         saved_offset, asn1->offset - saved_offset,
8872         "%s :  Channel, %s",
8873         bigbuf,
8874         has_chan ? "Traffic Channel Assigned" : "No Traffic Channel");
8875
8876     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
8877     proto_tree_add_text(tree, asn1->tvb,
8878         saved_offset, asn1->offset - saved_offset,
8879         "%s :  Handoff, %s",
8880         bigbuf,
8881         (value & 0x02) ? "Intersystem Handoff" : "No Intersystem Handoff");
8882
8883     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
8884     proto_tree_add_text(tree, asn1->tvb,
8885         saved_offset, asn1->offset - saved_offset,
8886         "%s :  Inactive, %s",
8887         bigbuf,
8888         (value & 0x01) ? "MS Inactive" : "MS Active");
8889
8890     if (len == 1) return;
8891
8892     saved_offset = asn1->offset;
8893
8894     asn1_int32_value_decode(asn1, 1, &value);
8895
8896     if (extended)
8897     {
8898         proto_tree_add_text(tree, asn1->tvb,
8899             saved_offset, asn1->offset - saved_offset,
8900             "Octet 1a ? spec. does not provide details");
8901
8902         saved_offset = asn1->offset;
8903
8904         EXTRANEOUS_DATA_CHECK(len, 2);
8905
8906         return;
8907     }
8908
8909     if (has_chan)
8910     {
8911         switch (value)
8912         {
8913         case 0: str = "Not used "; break;
8914         case 1: str = "Analog. The MS is currently assigned to an analog traffic channel"; break;
8915         case 2: str = "NAMPS. The MS is currently assigned to an NAMPS traffic channel"; break;
8916         case 3: str = "TDMA. The MS is currently assigned to a TDMA traffic channel"; break;
8917         case 4: str = "CDMA. The MS is currently assigned to a CDMA traffic channel"; break;
8918         default:
8919             if ((value >= 5) && (value <= 223)) { str = "Reserved, treat as Not used"; }
8920             else { str = "Reserved for protocol extension, treat as Not used"; }
8921             break;
8922         }
8923
8924         proto_tree_add_text(tree, asn1->tvb,
8925             saved_offset, asn1->offset - saved_offset,
8926             "Radio Channel Type, %s",
8927             str);
8928
8929         saved_offset = asn1->offset;
8930
8931         EXTRANEOUS_DATA_CHECK(len, 2);
8932
8933         return;
8934     }
8935
8936     asn1->offset -= 1;
8937
8938     EXTRANEOUS_DATA_CHECK(len, 1);
8939 }
8940
8941 static void
8942 param_pos_info_code(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
8943 {
8944     gint32 value;
8945     guint saved_offset;
8946
8947     saved_offset = asn1->offset;
8948
8949     asn1_int32_value_decode(asn1, 1, &value);
8950
8951     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
8952     proto_tree_add_text(tree, asn1->tvb,
8953         saved_offset, asn1->offset - saved_offset,
8954         "%s :  Reserved",
8955         bigbuf);
8956
8957     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
8958     proto_tree_add_text(tree, asn1->tvb,
8959         saved_offset, asn1->offset - saved_offset,
8960         "%s :  MS Identity (MSID), %s",
8961         bigbuf,
8962         (value & 0x10) ? "MS Identity Requested" : "No MS Identity Requested");
8963
8964     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
8965     proto_tree_add_text(tree, asn1->tvb,
8966         saved_offset, asn1->offset - saved_offset,
8967         "%s :  Routing Address (ROUTE), %s",
8968         bigbuf,
8969         (value & 0x08) ? "Routing Address Requested" : "No Routing Address Requested");
8970
8971     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
8972     proto_tree_add_text(tree, asn1->tvb,
8973         saved_offset, asn1->offset - saved_offset,
8974         "%s :  Serving Cell ID (CELLID), %s",
8975         bigbuf,
8976         (value & 0x04) ? "Serving Cell ID Requested" : "No Serving Cell ID Requested");
8977
8978     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
8979     proto_tree_add_text(tree, asn1->tvb,
8980         saved_offset, asn1->offset - saved_offset,
8981         "%s :  Location Area ID (LOCID), %s",
8982         bigbuf,
8983         (value & 0x02) ?  "Location Area ID Requested" : "No Location Area ID Requested");
8984
8985     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
8986     proto_tree_add_text(tree, asn1->tvb,
8987         saved_offset, asn1->offset - saved_offset,
8988         "%s :  Current, %s",
8989         bigbuf,
8990         (value & 0x01) ? "Provide the current MS location" : "Provide the last known MS location information, if known");
8991
8992     EXTRANEOUS_DATA_CHECK(len, 1);
8993 }
8994
8995 static void
8996 param_rel_reason(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
8997 {
8998     gint32 value;
8999     guint saved_offset;
9000     const gchar *str = NULL;
9001
9002     EXACT_DATA_CHECK(len, 1);
9003
9004     saved_offset = asn1->offset;
9005
9006     asn1_int32_value_decode(asn1, 1, &value);
9007
9008     switch (value)
9009     {
9010     case 0: str = "Unspecified"; break;
9011     case 1: str = "Call Over Clear Forward"; break;
9012     case 2: str = "Call Over Clear Backward"; break;
9013     case 3: str = "Handoff Successful"; break;
9014     case 4: str = "Handoff Abort - call over"; break;
9015     case 5: str = "Handoff Abort - not received"; break;
9016     case 6: str = "Abnormal mobile termination"; break;
9017     case 7: str = "Abnormal switch termination"; break;
9018     case 8: str = "Special feature release"; break;
9019     case 9: str = "Session Over Clear Forward"; break;
9020     case 10: str = "Session Over Clear Backward"; break;
9021     case 11: str = "Clear All Services Forward"; break;
9022     case 12: str = "Clear All Services Backward"; break;
9023     case 13: str = "Anchor MSC was removed from the packet data session"; break;
9024     default:
9025         if ((value >= 14) && (value <= 223)) { str = "Reserved, treat as Unspecified"; }
9026         else { str = "Reserved for protocol extension, treat as Unspecified"; }
9027         break;
9028     }
9029
9030     proto_tree_add_text(tree, asn1->tvb,
9031         saved_offset, asn1->offset - saved_offset,
9032         "Reason, %s",
9033         str);
9034 }
9035
9036 static void
9037 param_ho_reason(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
9038 {
9039     gint32 value;
9040     guint saved_offset;
9041     const gchar *str = NULL;
9042
9043     EXACT_DATA_CHECK(len, 1);
9044
9045     saved_offset = asn1->offset;
9046
9047     asn1_int32_value_decode(asn1, 1, &value);
9048
9049     switch (value)
9050     {
9051     case 0: str = "Not used"; break;
9052     case 1: str = "Unspecified"; break;
9053     case 2: str = "Weak signal"; break;
9054     case 3: str = "Off-loading"; break;
9055     case 4: str = "Anticipatory"; break;
9056     default:
9057         if ((value >= 5) && (value <= 223)) { str = "Reserved, treat as Unspecified"; }
9058         else { str = "Reserved for protocol extension, treat as Unspecified"; }
9059         break;
9060     }
9061
9062     proto_tree_add_text(tree, asn1->tvb,
9063         saved_offset, asn1->offset - saved_offset,
9064         str);
9065 }
9066
9067 static void
9068 param_red_reason(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
9069 {
9070     gint32 value;
9071     guint saved_offset;
9072     const gchar *str = NULL;
9073
9074     EXACT_DATA_CHECK(len, 1);
9075
9076     saved_offset = asn1->offset;
9077
9078     asn1_int32_value_decode(asn1, 1, &value);
9079
9080     switch (value)
9081     {
9082     case 0: str = "Not used"; break;
9083     case 1: str = "Busy"; break;
9084     case 2: str = "No answer"; break;
9085     case 3: str = "Unconditional"; break;
9086     case 4: str = "No page response"; break;
9087     case 5: str = "Unavailable"; break;
9088     case 6: str = "Unroutable"; break;
9089     case 7: str = "Call accepted"; break;
9090     case 8: str = "Call refused"; break;
9091     case 9: str = "USCFvm, divert to voice mail"; break;
9092     case 10: str = "USCFms, divert to an MS provided DN"; break;
9093     case 11: str = "USCFnr, divert to a network registered DN"; break;
9094     default:
9095         if ((value >= 12) && (value <= 223)) { str = "Reserved, treat as No answer"; }
9096         else { str = "Reserved for protocol extension, treat as No answer"; }
9097         break;
9098     }
9099
9100     proto_tree_add_text(tree, asn1->tvb,
9101         saved_offset, asn1->offset - saved_offset,
9102         str);
9103 }
9104
9105 static void
9106 param_confid_mode(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
9107 {
9108     gint32 value;
9109     guint saved_offset;
9110
9111     EXACT_DATA_CHECK(len, 1);
9112
9113     saved_offset = asn1->offset;
9114
9115     asn1_int32_value_decode(asn1, 1, &value);
9116
9117     other_decode_bitfield_value(bigbuf, value, 0xf8, 8);
9118     proto_tree_add_text(tree, asn1->tvb,
9119         saved_offset, asn1->offset - saved_offset,
9120         "%s :  Reserved",
9121         bigbuf);
9122
9123     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
9124     proto_tree_add_text(tree, asn1->tvb,
9125         saved_offset, asn1->offset - saved_offset,
9126         "%s :  Data Privacy (DP), %s",
9127         bigbuf,
9128         (value & 0x04) ? "ON" : "OFF");
9129
9130     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
9131     proto_tree_add_text(tree, asn1->tvb,
9132         saved_offset, asn1->offset - saved_offset,
9133         "%s :  Signaling Message Encryption (SE), %s",
9134         bigbuf,
9135         (value & 0x02) ? "ON" : "OFF");
9136
9137     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
9138     proto_tree_add_text(tree, asn1->tvb,
9139         saved_offset, asn1->offset - saved_offset,
9140         "%s :  Voice Privacy (VP), %s",
9141         bigbuf,
9142         (value & 0x01) ? "ON" : "OFF");
9143 }
9144
9145 static void
9146 param_sys_acc_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
9147 {
9148     gint32 value;
9149     guint saved_offset;
9150     const gchar *str = NULL;
9151
9152     EXACT_DATA_CHECK(len, 1);
9153
9154     saved_offset = asn1->offset;
9155
9156     asn1_int32_value_decode(asn1, 1, &value);
9157
9158     switch (value)
9159     {
9160     case 0: str = "Not used"; break;
9161     case 1: str = "Unspecified"; break;
9162     case 2: str = "Flash request"; break;
9163     case 3: str = "Autonomous registration"; break;
9164     case 4: str = "Call origination"; break;
9165     case 5: str = "Page response"; break;
9166     case 6: str = "No access"; break;
9167     case 7: str = "Power down registration"; break;
9168     case 8: str = "SMS page response"; break;
9169     case 9: str = "OTASP"; break;
9170     default:
9171         if ((value >= 10) && (value <= 223)) { str = "Reserved, treat as Unspecified"; }
9172         else { str = "Reserved for protocol extension, treat as Unspecified"; }
9173         break;
9174     }
9175
9176     proto_tree_add_text(tree, asn1->tvb,
9177         saved_offset, asn1->offset - saved_offset,
9178         str);
9179 }
9180
9181 static void
9182 param_scm(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
9183 {
9184     gint32 value, temp_int;
9185     guint saved_offset;
9186     const gchar *str = NULL;
9187
9188     EXACT_DATA_CHECK(len, 1);
9189
9190     saved_offset = asn1->offset;
9191
9192     asn1_int32_value_decode(asn1, 1, &value);
9193
9194     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
9195     proto_tree_add_text(tree, asn1->tvb,
9196         saved_offset, asn1->offset - saved_offset,
9197         "%s :  Reserved",
9198         bigbuf);
9199
9200     temp_int = ((value & 0x10) >> 2) | (value & 0x03);
9201     switch (temp_int)
9202     {
9203     case 0: str = "Class I"; break;
9204     case 1: str = "Class II"; break;
9205     case 2: str = "Class III"; break;
9206     case 3: str = "Class IV"; break;
9207     case 4: str = "Class V"; break;
9208     case 5: str = "Class VI"; break;
9209     case 6: str = "Class VII"; break;
9210     case 7: str = "Class VIII"; break;
9211     }
9212
9213     other_decode_bitfield_value(bigbuf, value, 0x13, 8);
9214     proto_tree_add_text(tree, asn1->tvb,
9215         saved_offset, asn1->offset - saved_offset,
9216         "%s :  Power %s",
9217         bigbuf,
9218         str);
9219
9220     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
9221     proto_tree_add_text(tree, asn1->tvb,
9222         saved_offset, asn1->offset - saved_offset,
9223         "%s :  Bandwidth %s",
9224         bigbuf,
9225         (value & 0x08) ? "25 MHz" : "20 MHz");
9226
9227     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
9228     proto_tree_add_text(tree, asn1->tvb,
9229         saved_offset, asn1->offset - saved_offset,
9230         "%s :  Transmission, %s",
9231         bigbuf,
9232         (value & 0x04) ? "Discontinuous" : "Continuous");
9233 }
9234
9235 static void
9236 param_deny_acc(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
9237 {
9238     gint32 value;
9239     guint saved_offset;
9240     const gchar *str = NULL;
9241
9242     EXACT_DATA_CHECK(len, 1);
9243
9244     saved_offset = asn1->offset;
9245
9246     asn1_int32_value_decode(asn1, 1, &value);
9247
9248     switch (value)
9249     {
9250     case 0: str = "Not used"; break;
9251     case 1: str = "Unspecified"; break;
9252     case 2: str = "SSD Update failure"; break;
9253     case 3: str = "COUNT Update failure"; break;
9254     case 4: str = "Unique Challenge failure"; break;
9255     case 5: str = "AUTHR mismatch"; break;
9256     case 6: str = "COUNT mismatch"; break;
9257     case 7: str = "Process collision"; break;
9258     case 8: str = "Missing authentication parameters"; break;
9259     case 9: str = "TerminalType mismatch"; break;
9260     case 10: str = "MIN, IMSI or ESN authorization failure"; break;
9261     default:
9262         if ((value >= 11) && (value <= 223)) { str = "Reserved, treat as Unspecified"; }
9263         else { str = "Reserved for protocol extension, treat as Unspecified"; }
9264         break;
9265     }
9266
9267     proto_tree_add_text(tree, asn1->tvb,
9268         saved_offset, asn1->offset - saved_offset,
9269         str);
9270 }
9271
9272 static void
9273 param_cdma_sig_qual(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
9274 {
9275     gint32 value;
9276     guint saved_offset;
9277
9278     EXACT_DATA_CHECK(len, 1);
9279
9280     saved_offset = asn1->offset;
9281
9282     asn1_int32_value_decode(asn1, 1, &value);
9283
9284     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
9285     proto_tree_add_text(tree, asn1->tvb,
9286         saved_offset, asn1->offset - saved_offset,
9287         "%s :  Reserved",
9288         bigbuf);
9289
9290     other_decode_bitfield_value(bigbuf, value, 0x3f, 8);
9291     proto_tree_add_text(tree, asn1->tvb,
9292         saved_offset, asn1->offset - saved_offset,
9293         "%s :  Value %u",
9294         bigbuf,
9295         value & 0x3f);
9296 }
9297
9298 static void
9299 param_rec_sig_qual(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
9300 {
9301     gint32 value;
9302     guint saved_offset;
9303     const gchar *str = NULL;
9304
9305     EXACT_DATA_CHECK(len, 1);
9306
9307     saved_offset = asn1->offset;
9308
9309     asn1_int32_value_decode(asn1, 1, &value);
9310
9311     switch (value)
9312     {
9313     case 0: str = "Not a usable signal"; break;
9314     case 255: str = "Interference"; break;
9315     default:
9316         if ((value >= 1) && (value <= 8)) { str = "Reserved, treat as Not a usable signal"; }
9317         else if ((value >= 9) && (value <= 245)) { str = "Usable signal range"; }
9318         else if ((value >= 246) && (value <= 254)) { str = "Reserved, treat as Interference"; }
9319         break;
9320     }
9321
9322     proto_tree_add_text(tree, asn1->tvb,
9323         saved_offset, asn1->offset - saved_offset,
9324         str);
9325 }
9326
9327 static void
9328 param_sig_qual(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
9329 {
9330     gint32 value;
9331     guint saved_offset;
9332     const gchar *str = NULL;
9333
9334     EXACT_DATA_CHECK(len, 1);
9335
9336     saved_offset = asn1->offset;
9337
9338     asn1_int32_value_decode(asn1, 1, &value);
9339
9340     switch (value)
9341     {
9342     case 0: str = "Not a usable signal"; break;
9343     case 255: str = "Interference"; break;
9344     default:
9345         if ((value >= 1) && (value <= 8)) { str = "Reserved, treat as Not a usable signal"; }
9346         else if ((value >= 9) && (value <= 245)) { str = "Usable signal range"; }
9347         else if ((value >= 246) && (value <= 254)) { str = "Reserved, treat as Interference"; }
9348         break;
9349     }
9350
9351     proto_tree_add_text(tree, asn1->tvb,
9352         saved_offset, asn1->offset - saved_offset,
9353         str);
9354 }
9355
9356 static void
9357 param_ssd_no_share(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
9358 {
9359     gint32 value;
9360     guint saved_offset;
9361     const gchar *str = NULL;
9362
9363     EXACT_DATA_CHECK(len, 1);
9364
9365     saved_offset = asn1->offset;
9366
9367     asn1_int32_value_decode(asn1, 1, &value);
9368
9369     switch (value)
9370     {
9371     case 0: str = "Not used"; break;
9372     case 1: str = "Discard SSD"; break;
9373     default:
9374         str = "Reserved, treat as Discard SSD";
9375         break;
9376     }
9377
9378     proto_tree_add_text(tree, asn1->tvb,
9379         saved_offset, asn1->offset - saved_offset,
9380         str);
9381 }
9382
9383 static void
9384 param_report_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
9385 {
9386     gint32 value;
9387     guint saved_offset;
9388     const gchar *str = NULL;
9389
9390     EXACT_DATA_CHECK(len, 1);
9391
9392     saved_offset = asn1->offset;
9393
9394     asn1_int32_value_decode(asn1, 1, &value);
9395
9396     switch (value)
9397     {
9398     case 0: str = "Not used"; break;
9399     case 1: str = "Unspecified security violation"; break;
9400     case 2: str = "MSID/ESN mismatch"; break;
9401     case 3: str = "RANDC mismatch"; break;
9402     case 4: str = "Reserved (see TSB51)"; break;
9403     case 5: str = "SSD Update failed"; break;
9404     case 6: str = "Reserved (see TSB51)"; break;
9405     case 7: str = "COUNT mismatch"; break;
9406     case 8: str = "Reserved (see TSB51)"; break;
9407     case 9: str = "Unique Challenge failed"; break;
9408     case 10: str = "Unsolicited Base Station Challenge"; break;
9409     case 11: str = "SSD Update no response"; break;
9410     case 12: str = "COUNT Update no response"; break;
9411     case 13: str = "Unique Challenge no response"; break;
9412     case 14: str = "AUTHR mismatch"; break;
9413     case 15: str = "TERMTYP mismatch"; break;
9414     case 16: str = "Missing authentication parameters"; break;
9415     default:
9416         if ((value >= 17) && (value <= 223)) { str = "Reserved, treat as Unspecified security violation"; }
9417         else { str = "Reserved for protocol extension, treat as Unspecified security violation"; }
9418         break;
9419     }
9420
9421     proto_tree_add_text(tree, asn1->tvb,
9422         saved_offset, asn1->offset - saved_offset,
9423         str);
9424 }
9425
9426 static void
9427 param_term_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
9428 {
9429     gint32 value;
9430     guint saved_offset;
9431     const gchar *str = NULL;
9432
9433     EXACT_DATA_CHECK(len, 1);
9434
9435     saved_offset = asn1->offset;
9436
9437     asn1_int32_value_decode(asn1, 1, &value);
9438
9439     switch (value)
9440     {
9441     case 0: str = "Not used"; break;
9442     case 1: str = "Not distinguished, EIA/TIA-553, IS-54-A, IS-88, IS-91, IS-94"; break;
9443     case 2: str = "IS-54-B"; break;
9444     case 3: str = "IS-136"; break;
9445     case 4: str = "J-STD-011 (rescinded 11/23/99)"; break;
9446     case 5: str = "IS-136-A or TIA/EIA-136 Revision-0"; break;
9447     case 6: str = "TIA/EIA-136-A"; break;
9448     case 7: str = "TIA/EIA-136-B"; break;
9449     case 32: str = "IS-95"; break;
9450     case 33: str = "IS-95-A"; break;
9451     case 34: str = "J-STD-008"; break;
9452     case 35: str = "IS-95-B"; break;
9453     case 36: str = "IS-2000"; break;
9454     case 64: str = "IS-88"; break;
9455     case 65: str = "IS-94"; break;
9456     case 66: str = "IS-91"; break;
9457     case 67: str = "J-STD-014"; break;
9458     case 68: str = "TIA/EIA-553-A"; break;
9459     case 69: str = "IS-91-A"; break;
9460     default:
9461         if ((value >= 8) && (value <= 31)) { str = "Reserved, treat as IS-54-B"; }
9462         else if ((value >= 37) && (value <= 63)) { str = "Reserved, treat as IS-95-A"; }
9463         else if ((value >= 70) && (value <= 223)) { str = "Reserved, treat as Not distinguished"; }
9464         else { str = "Reserved for protocol extension, treat as Not distinguished"; }
9465         break;
9466     }
9467
9468     proto_tree_add_text(tree, asn1->tvb,
9469         saved_offset, asn1->offset - saved_offset,
9470         str);
9471 }
9472
9473 static void
9474 param_term_res(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
9475 {
9476     gint32 value;
9477     guint saved_offset;
9478     const gchar *str = NULL;
9479
9480     EXACT_DATA_CHECK(len, 1);
9481
9482     saved_offset = asn1->offset;
9483
9484     asn1_int32_value_decode(asn1, 1, &value);
9485
9486     switch (value)
9487     {
9488     case 0: str = "Not used"; break;
9489     case 1: str = "Termination denied"; break;
9490     case 2: str = "Unrestricted"; break;
9491     case 3: str = "Treatment for this value is not specified"; break;
9492     default:
9493         if ((value >= 4) && (value <= 223)) { str = "Reserved, treat as Unrestricted"; }
9494         else { str = "Reserved for protocol extension, treat as Unrestricted"; }
9495         break;
9496     }
9497
9498     proto_tree_add_text(tree, asn1->tvb,
9499         saved_offset, asn1->offset - saved_offset,
9500         str);
9501 }
9502
9503 static void
9504 param_dereg(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
9505 {
9506     gint32 value;
9507     guint saved_offset;
9508     const gchar *str = NULL;
9509
9510     EXACT_DATA_CHECK(len, 1);
9511
9512     saved_offset = asn1->offset;
9513
9514     asn1_int32_value_decode(asn1, 1, &value);
9515
9516     switch (value)
9517     {
9518     case 0: str = "Not used"; break;
9519     case 1: str = "Deregister for an unspecified reason"; break;
9520     case 2: str = "Deregister for an adminstrative reason"; break;
9521     case 3: str = "Deregister due to MS power down"; break;
9522     default:
9523         if ((value >= 4) && (value <= 223)) { str = "Reserved, treat as Deregister for an unspecified reason"; }
9524         else { str = "Reserved for protocol extension, treat as Deregister for an unspecified reason"; }
9525         break;
9526     }
9527
9528     proto_tree_add_text(tree, asn1->tvb,
9529         saved_offset, asn1->offset - saved_offset,
9530         str);
9531 }
9532
9533 static void
9534 param_group_info(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
9535 {
9536     gint32 value;
9537     guint saved_offset;
9538
9539     SHORT_DATA_CHECK(len, 4);
9540
9541     saved_offset = asn1->offset;
9542
9543     asn1_int32_value_decode(asn1, 4, &value);
9544
9545     proto_tree_add_text(tree, asn1->tvb,
9546         saved_offset, asn1->offset - saved_offset,
9547         "Value %u",
9548         value);
9549
9550     EXTRANEOUS_DATA_CHECK(len, 4);
9551 }
9552
9553 static void
9554 param_auth_den(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
9555 {
9556     gint32 value;
9557     guint saved_offset;
9558     const gchar *str = NULL;
9559
9560     EXACT_DATA_CHECK(len, 1);
9561
9562     saved_offset = asn1->offset;
9563
9564     asn1_int32_value_decode(asn1, 1, &value);
9565
9566     switch (value)
9567     {
9568     case 0: str = "Not used"; break;
9569     case 1: str = "Delinquent account"; break;
9570     case 2: str = "Invalid serial number"; break;
9571     case 3: str = "Stolen unit"; break;
9572     case 4: str = "Duplicate unit"; break;
9573     case 5: str = "Unassigned directory number"; break;
9574     case 6: str = "Unspecified"; break;
9575     case 7: str = "Multiple access"; break;
9576     case 8: str = "Not Authorized for the MSC"; break;
9577     case 9: str = "Missing authentication parameters"; break;
9578     case 10: str = "Terminal Type mismatch"; break;
9579     default:
9580         if ((value >= 11) && (value <= 223)) { str = "Reserved, treat as Unspecified"; }
9581         else { str = "Reserved for protocol extension, treat as Unspecified"; }
9582         break;
9583     }
9584
9585     proto_tree_add_text(tree, asn1->tvb,
9586         saved_offset, asn1->offset - saved_offset,
9587         "Reason, %s (%u)",
9588         str,
9589         value);
9590 }
9591
9592 static const gchar *
9593 find_trig_type(gint32 value)
9594 {
9595     const gchar *str = NULL;
9596
9597     switch (value)
9598     {
9599     case 0: str = "Unspecified"; break;
9600     case 1: str = "All Calls"; break;
9601     case 2: str = "Double Introducing Star"; break;
9602     case 3: str = "Single Introducing Star"; break;
9603     case 4: str = "Reserved [for Home System Feature Code"; break;
9604     case 5: str = "Double Introducing Pound"; break;
9605     case 6: str = "Single Introducing Pound"; break;
9606     case 7: str = "Revertive Call"; break;
9607     case 8: str = "0 Digit"; break;
9608     case 9: str = "1 Digit"; break;
9609     case 10: str = "2 Digit"; break;
9610     case 11: str = "3 Digit"; break;
9611     case 12: str = "4 Digit"; break;
9612     case 13: str = "5 Digit"; break;
9613     case 14: str = "6 Digit"; break;
9614     case 15: str = "7 Digit"; break;
9615     case 16: str = "8 Digit"; break;
9616     case 17: str = "9 Digit"; break;
9617     case 18: str = "10 Digit"; break;
9618     case 19: str = "11 Digit"; break;
9619     case 20: str = "12 Digit"; break;
9620     case 21: str = "13 Digit"; break;
9621     case 22: str = "14 Digit"; break;
9622     case 23: str = "15 Digit"; break;
9623     case 24: str = "Local Call"; break;
9624     case 25: str = "Intra-LATA Toll Call"; break;
9625     case 26: str = "Inter-LATA Toll Call"; break;
9626     case 27: str = "World Zone Call"; break;
9627     case 28: str = "International Call"; break;
9628     case 29: str = "Unrecognized Number"; break;
9629     case 30: str = "Prior Agreement"; break;
9630     case 31: str = "Specific Called Party Digit String"; break;
9631     case 32: str = "Mobile Termination"; break;
9632     case 33: str = "Advanced Termination"; break;
9633     case 34: str = "Location"; break;
9634     case 35: str = "Locally Allowed Specific Digit String"; break;
9635     case 36: str = "Origination Attempt Authorized"; break;
9636     case 37: str = "Calling Routing Address Available"; break;
9637     case 38: str = "Initial Termination"; break;
9638     case 39: str = "Called Routing Address Available"; break;
9639     case 40: str = "O Answer"; break;
9640     case 41: str = "O Disconnect"; break;
9641     case 42: str = "O Called Party Busy"; break;
9642     case 43: str = "O No Answer"; break;
9643     case 64: str = "Terminating Resource Available"; break;
9644     case 65: str = "T Busy"; break;
9645     case 66: str = "T No Answer"; break;
9646     case 67: str = "T No Page Response"; break;
9647     case 68: str = "T Unroutable"; break;
9648     case 69: str = "T Answer"; break;
9649     case 70: str = "T Disconnect"; break;
9650     case 220: str = "Reserved for TDP-R DP Type value"; break;
9651     case 221: str = "Reserved for TDP-N DP Type value"; break;
9652     case 222: str = "Reserved for EDP-R DP Type value"; break;
9653     case 223: str = "Reserved for EDP-N DP Type value"; break;
9654     default:
9655         if ((value >= 44) && (value <= 63)) { str = "Reserved, treat as Unspecified"; }
9656         else if ((value >= 71) && (value <= 219)) { str = "Reserved, treat as Unspecified"; }
9657         else { str = "Reserved for protocol extension, treat as Unspecified"; }
9658         break;
9659     }
9660
9661     return(str);
9662 }
9663
9664 static void
9665 param_trig_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
9666 {
9667     gint32 value;
9668     guint saved_offset;
9669
9670     EXACT_DATA_CHECK(len, 1);
9671
9672     saved_offset = asn1->offset;
9673
9674     asn1_int32_value_decode(asn1, 1, &value);
9675
9676     proto_tree_add_text(tree, asn1->tvb,
9677         saved_offset, asn1->offset - saved_offset,
9678         "Trigger (%u) %s",
9679         value,
9680         find_trig_type(value));
9681 }
9682
9683 static void
9684 param_win_op_cap(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
9685 {
9686     gint32 value;
9687     guint saved_offset;
9688     const gchar *str = NULL;
9689
9690     saved_offset = asn1->offset;
9691
9692     asn1_int32_value_decode(asn1, 1, &value);
9693
9694     other_decode_bitfield_value(bigbuf, value, 0xf8, 8);
9695     proto_tree_add_text(tree, asn1->tvb,
9696         saved_offset, asn1->offset - saved_offset,
9697         "%s :  Reserved",
9698         bigbuf);
9699
9700     switch ((value & 0x04) >> 2)
9701     {
9702     case 0x00: str = "Sender does not support PositionRequest OP"; break;
9703     default:
9704         str = "Sender supports PositionRequest OP";
9705         break;
9706     }
9707
9708     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
9709     proto_tree_add_text(tree, asn1->tvb,
9710         saved_offset, asn1->offset - saved_offset,
9711         "%s :  %s",
9712         bigbuf, str);
9713
9714     switch ((value & 0x02) >> 1)
9715     {
9716     case 0x00: str = "Sender does not support CallControlDirective OP"; break;
9717     default:
9718         str = "Sender supports CallControlDirective OP";
9719         break;
9720     }
9721
9722     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
9723     proto_tree_add_text(tree, asn1->tvb,
9724         saved_offset, asn1->offset - saved_offset,
9725         "%s :  %s",
9726         bigbuf, str);
9727
9728     switch (value & 0x01)
9729     {
9730     case 0x00: str = "Sender does not support ConnectResource, DisconnectResource, ConnectionFailureReport and ResetTimer (SSFT timer) OPs"; break;
9731     default:
9732         str = "Sender supports ConnectResource, DisconnectResource, ConnectionFailureReport and ResetTimer (SSFT timer) OPs";
9733         break;
9734     }
9735
9736     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
9737     proto_tree_add_text(tree, asn1->tvb,
9738         saved_offset, asn1->offset - saved_offset,
9739         "%s :  %s",
9740         bigbuf, str);
9741
9742     EXTRANEOUS_DATA_CHECK(len, 1);
9743 }
9744
9745 static void
9746 param_win_trig_list(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
9747 {
9748     gint32 value, i, j;
9749     guint saved_offset;
9750
9751     saved_offset = asn1->offset;
9752
9753     j = 0;
9754     i = 0;
9755
9756     do
9757     {
9758         asn1_int32_value_decode(asn1, 1, &value);
9759
9760         switch (value)
9761         {
9762         case 0xdc:
9763             proto_tree_add_text(tree, asn1->tvb,
9764                 saved_offset, asn1->offset - saved_offset,
9765                 "TDP-R's armed");
9766
9767             j = 0;
9768             break;
9769
9770         case 0xdd:
9771             proto_tree_add_text(tree, asn1->tvb,
9772                 saved_offset, asn1->offset - saved_offset,
9773                 "TDP-N's armed");
9774
9775             j = 0;
9776             break;
9777
9778         case 0xde:
9779             proto_tree_add_text(tree, asn1->tvb,
9780                 saved_offset, asn1->offset - saved_offset,
9781                 "EDP-R's armed");
9782
9783             j = 0;
9784             break;
9785
9786         case 0xdf:
9787             proto_tree_add_text(tree, asn1->tvb,
9788                 saved_offset, asn1->offset - saved_offset,
9789                 "EDP-N's armed");
9790
9791             j = 0;
9792             break;
9793
9794         default:
9795             proto_tree_add_text(tree, asn1->tvb,
9796                 saved_offset, asn1->offset - saved_offset,
9797                 "[%u] (%u) %s",
9798                 j,
9799                 value,
9800                 find_trig_type(value));
9801             j++;
9802             break;
9803         }
9804
9805         saved_offset = asn1->offset;
9806         i++;
9807     }
9808     while ((len - i) > 0);
9809 }
9810
9811 static void
9812 param_trans_cap(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
9813 {
9814     gint32 value;
9815     guint saved_offset;
9816     const gchar *str = NULL;
9817     char *p;
9818     char *buf;
9819
9820     buf=ep_alloc(1024);
9821     saved_offset = asn1->offset;
9822
9823     asn1_int32_value_decode(asn1, 1, &value);
9824
9825     switch ((value & 0x80) >> 7)
9826     {
9827     case 0x00: str = "System is not capable of supporting CNAP/CNAR (NAMI)"; break;
9828     default:
9829         str = "System is capable of supporting CNAP/CNAR (NAMI)";
9830         break;
9831     }
9832
9833     other_decode_bitfield_value(buf, value, 0x80, 8);
9834     proto_tree_add_text(tree, asn1->tvb,
9835         saved_offset, asn1->offset - saved_offset,
9836         "%s :  %s",
9837         buf, str);
9838
9839     switch ((value & 0x40) >> 6)
9840     {
9841     case 0x00: str = "System is not capable of supporting NDSS"; break;
9842     default:
9843         str = "System is capable of supporting NDSS";
9844         break;
9845     }
9846
9847     other_decode_bitfield_value(buf, value, 0x40, 8);
9848     proto_tree_add_text(tree, asn1->tvb,
9849         saved_offset, asn1->offset - saved_offset,
9850         "%s :  %s",
9851         buf, str);
9852
9853     switch ((value & 0x20) >> 5)
9854     {
9855     case 0x00: str = "System is not capable of supporting User Zones (UZCI)"; break;
9856     default:
9857         str = "System is capable of supporting User Zones (UZCI)";
9858         break;
9859     }
9860
9861     other_decode_bitfield_value(buf, value, 0x20, 8);
9862     proto_tree_add_text(tree, asn1->tvb,
9863         saved_offset, asn1->offset - saved_offset,
9864         "%s :  %s",
9865         buf, str);
9866
9867     switch ((value & 0x10) >> 4)
9868     {
9869     case 0x00: str = "System is not capable of supporting local SPINI"; break;
9870     default:
9871         str = "System is capable of supporting local SPINI";
9872         break;
9873     }
9874
9875     other_decode_bitfield_value(buf, value, 0x10, 8);
9876     proto_tree_add_text(tree, asn1->tvb,
9877         saved_offset, asn1->offset - saved_offset,
9878         "%s :  %s",
9879         buf, str);
9880
9881     switch ((value & 0x08) >> 3)
9882     {
9883     case 0x00: str = "System is not capable of interacting with the user (RUI)"; break;
9884     default:
9885         str = "System is capable of interacting with the user (RUI)";
9886         break;
9887     }
9888
9889     other_decode_bitfield_value(buf, value, 0x08, 8);
9890     proto_tree_add_text(tree, asn1->tvb,
9891         saved_offset, asn1->offset - saved_offset,
9892         "%s :  %s",
9893         buf, str);
9894
9895     switch ((value & 0x04) >> 2)
9896     {
9897     case 0x00: str = "System is not capable of honoring the Announcement List parameter (ANN)"; break;
9898     default:
9899         str = "System is capable of honoring the Announcement List parameter (ANN)";
9900         break;
9901     }
9902
9903     other_decode_bitfield_value(buf, value, 0x04, 8);
9904     proto_tree_add_text(tree, asn1->tvb,
9905         saved_offset, asn1->offset - saved_offset,
9906         "%s :  %s",
9907         buf, str);
9908
9909     switch ((value & 0x02) >> 1)
9910     {
9911     case 0x00: str = "System is not capable of detecting a busy condition (BUSY)"; break;
9912     default:
9913         str = "System is capable of detecting a busy condition (BUSY)";
9914         break;
9915     }
9916
9917     other_decode_bitfield_value(buf, value, 0x02, 8);
9918     proto_tree_add_text(tree, asn1->tvb,
9919         saved_offset, asn1->offset - saved_offset,
9920         "%s :  %s",
9921         buf, str);
9922
9923     switch (value & 0x01)
9924     {
9925     case 0x00: str = "System is not capable of supporting the IS-41-C profile parameter (PROFILE)"; break;
9926     default:
9927         str = "System is capable of supporting the IS-41-C profile parameter (PROFILE)";
9928         break;
9929     }
9930
9931     other_decode_bitfield_value(buf, value, 0x01, 8);
9932     proto_tree_add_text(tree, asn1->tvb,
9933         saved_offset, asn1->offset - saved_offset,
9934         "%s :  %s",
9935         buf, str);
9936
9937     if (len == 1) return;
9938
9939     saved_offset = asn1->offset;
9940
9941     asn1_int32_value_decode(asn1, 1, &value);
9942
9943     switch ((value & 0x80) >> 7)
9944     {
9945     case 0x00: str = "System is not capable of supporting the CDMA Over the Air Parameter Administration"; break;
9946     default:
9947         str = "System is capable of supporting the CDMA Over the Air Parameter Administration";
9948         break;
9949     }
9950
9951     other_decode_bitfield_value(buf, value, 0x80, 8);
9952     proto_tree_add_text(tree, asn1->tvb,
9953         saved_offset, asn1->offset - saved_offset,
9954         "%s :  %s",
9955         buf, str);
9956
9957     switch ((value & 0x40) >> 6)
9958     {
9959     case 0x00: str = "System is not capable of supporting lower layer segmentation & reassembly (S&R)"; break;
9960     default:
9961         str = "System is capable of supporting lower layer segmentation & reassembly (S&R)";
9962         break;
9963     }
9964
9965     other_decode_bitfield_value(buf, value, 0x40, 8);
9966     proto_tree_add_text(tree, asn1->tvb,
9967         saved_offset, asn1->offset - saved_offset,
9968         "%s :  %s",
9969         buf, str);
9970
9971     switch ((value & 0x20) >> 5)
9972     {
9973     case 0x00: str = "System is not capable of supporting the Trigger Address List parameter (WADDR)"; break;
9974     default:
9975         str = "System is capable of supporting the Trigger Address List parameter (WADDR)";
9976         break;
9977     }
9978
9979     other_decode_bitfield_value(buf, value, 0x20, 8);
9980     proto_tree_add_text(tree, asn1->tvb,
9981         saved_offset, asn1->offset - saved_offset,
9982         "%s :  %s",
9983         buf, str);
9984
9985     switch ((value & 0x10) >> 4)
9986     {
9987     case 0x00: str = "System is not capable of supporting the Termination List parameter (TL)"; break;
9988     default:
9989         str = "System is capable of supporting the Termination List parameter (TL)";
9990         break;
9991     }
9992
9993     other_decode_bitfield_value(buf, value, 0x10, 8);
9994     proto_tree_add_text(tree, asn1->tvb,
9995         saved_offset, asn1->offset - saved_offset,
9996         "%s :  %s",
9997         buf, str);
9998
9999     p = other_decode_bitfield_value(buf, value, 0x0f, 8);
10000     switch (value & 0x0f)
10001     {
10002     case 0x00: strcat(p, " :  System cannot accept a termination at this time"); break;
10003     default:
10004         g_snprintf(p, 1024-(p-buf), " :  System supports %u call leg(s)", value & 0x0f);
10005         break;
10006     }
10007
10008     proto_tree_add_text(tree, asn1->tvb,
10009         saved_offset, asn1->offset - saved_offset,
10010         "%s",
10011         buf);
10012
10013     if (len == 2) return;
10014
10015     saved_offset = asn1->offset;
10016
10017     asn1_int32_value_decode(asn1, 1, &value);
10018
10019     other_decode_bitfield_value(buf, value, 0xf8, 8);
10020     proto_tree_add_text(tree, asn1->tvb,
10021         saved_offset, asn1->offset - saved_offset,
10022         "%s :  Reserved",
10023         buf);
10024
10025     switch ((value & 0x04) >> 2)
10026     {
10027     case 0x00: str = "The system is not capable of supporting external MAHO requests"; break;
10028     default:
10029         str = "The system is capable of supporting external MAHO requests (e.g. for positioning)";
10030         break;
10031     }
10032
10033     other_decode_bitfield_value(buf, value, 0x04, 8);
10034     proto_tree_add_text(tree, asn1->tvb,
10035         saved_offset, asn1->offset - saved_offset,
10036         "%s :  %s",
10037         buf, str);
10038
10039     other_decode_bitfield_value(buf, value, 0x03, 8);
10040     proto_tree_add_text(tree, asn1->tvb,
10041         saved_offset, asn1->offset - saved_offset,
10042         "%s :  Reserved",
10043         buf);
10044
10045     EXTRANEOUS_DATA_CHECK(len, 3);
10046 }
10047
10048 static void
10049 param_spini_trig(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
10050 {
10051     gint32 value;
10052     guint saved_offset;
10053     const gchar *str = NULL;
10054
10055     SHORT_DATA_CHECK(len, 4);
10056
10057     saved_offset = asn1->offset;
10058
10059     asn1_int32_value_decode(asn1, 1, &value);
10060
10061     switch ((value & 0x80) >> 7)
10062     {
10063     case 0x00: str = "Trigger is not active"; break;
10064     default:
10065         str = "Execute local SPINI procedures for any Revertive Call attempt"; break;
10066         break;
10067     }
10068
10069     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
10070     proto_tree_add_text(tree, asn1->tvb,
10071         saved_offset, asn1->offset - saved_offset,
10072         "%s :  Revertive Call (RvtC), %s",
10073         bigbuf, str);
10074
10075     switch ((value & 0x40) >> 6)
10076     {
10077     case 0x00: str = "Trigger is not active"; break;
10078     default:
10079         str = "Execute local SPINI procedures for any call attempt to an unrecognized number"; break;
10080         break;
10081     }
10082
10083     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
10084     proto_tree_add_text(tree, asn1->tvb,
10085         saved_offset, asn1->offset - saved_offset,
10086         "%s :  Unrecognized Number (Unrec), %s",
10087         bigbuf, str);
10088
10089     switch ((value & 0x20) >> 5)
10090     {
10091     case 0x00: str = "Trigger is not active"; break;
10092     default:
10093         str = "Execute local SPINI procedures for any call attempt outside of the current World Zone (as defined in ITU-T Rec. E.164)";
10094         break;
10095     }
10096
10097     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
10098     proto_tree_add_text(tree, asn1->tvb,
10099         saved_offset, asn1->offset - saved_offset,
10100         "%s :  World Zone (WZ), %s",
10101         bigbuf, str);
10102
10103     switch ((value & 0x10) >> 4)
10104     {
10105     case 0x00: str = "Trigger is not active"; break;
10106     default:
10107         str = "Execute local SPINI procedures for any international call attempt";
10108         break;
10109     }
10110
10111     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
10112     proto_tree_add_text(tree, asn1->tvb,
10113         saved_offset, asn1->offset - saved_offset,
10114         "%s :  International (Intl), %s",
10115         bigbuf, str);
10116
10117     switch ((value & 0x08) >> 3)
10118     {
10119     case 0x00: str = "Trigger is not active"; break;
10120     default:
10121         str = "Execute local SPINI procedures for any toll calls outside the local carrier's serving area";
10122         break;
10123     }
10124
10125     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
10126     proto_tree_add_text(tree, asn1->tvb,
10127         saved_offset, asn1->offset - saved_offset,
10128         "%s :  Non-Local (Inter-LATA) Toll (NLTOLL/OLATA), %s",
10129         bigbuf, str);
10130
10131     switch ((value & 0x04) >> 2)
10132     {
10133     case 0x00: str = "Trigger is not active"; break;
10134     default:
10135         str = "Execute local SPINI procedures for any local toll call attempt.  Refers to intra-LATA toll within the NANP";
10136         break;
10137     }
10138
10139     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
10140     proto_tree_add_text(tree, asn1->tvb,
10141         saved_offset, asn1->offset - saved_offset,
10142         "%s :  Local (Intra-LATA) Toll (LTOLL/ILATA), %s",
10143         bigbuf, str);
10144
10145     switch ((value & 0x02) >> 1)
10146     {
10147     case 0x00: str = "Trigger is not active"; break;
10148     default:
10149         str = "Execute local SPINI procedures for any local call attempt";
10150         break;
10151     }
10152
10153     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
10154     proto_tree_add_text(tree, asn1->tvb,
10155         saved_offset, asn1->offset - saved_offset,
10156         "%s :  Local, %s",
10157         bigbuf, str);
10158
10159     switch (value & 0x01)
10160     {
10161     case 0x00: str = "Trigger is not active"; break;
10162     default:
10163         str = "Execute local SPINI procedures for any call attempt. This overrides all other values.";
10164         break;
10165     }
10166
10167     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
10168     proto_tree_add_text(tree, asn1->tvb,
10169         saved_offset, asn1->offset - saved_offset,
10170         "%s :  All Origination (All), %s",
10171         bigbuf, str);
10172
10173     saved_offset = asn1->offset;
10174
10175     asn1_int32_value_decode(asn1, 1, &value);
10176
10177     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
10178     proto_tree_add_text(tree, asn1->tvb,
10179         saved_offset, asn1->offset - saved_offset,
10180         "%s :  Reserved",
10181         bigbuf);
10182
10183     switch ((value & 0x10) >> 4)
10184     {
10185     case 0x00: str = "Trigger is not active"; break;
10186     default:
10187         str = "Execute local SPINI procedures for any number matching a criteria of a prior agreement";
10188         break;
10189     }
10190
10191     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
10192     proto_tree_add_text(tree, asn1->tvb,
10193         saved_offset, asn1->offset - saved_offset,
10194         "%s :  Prior Agreement (PA), %s",
10195         bigbuf, str);
10196
10197     switch ((value & 0x08) >> 3)
10198     {
10199     case 0x00: str = "Trigger is not active"; break;
10200     default:
10201         str = "Execute local SPINI procedures for any number beginning with two Pound ## digits";
10202         break;
10203     }
10204
10205     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
10206     proto_tree_add_text(tree, asn1->tvb,
10207         saved_offset, asn1->offset - saved_offset,
10208         "%s :  Double Pound (DP), %s",
10209         bigbuf, str);
10210
10211     switch ((value & 0x04) >> 2)
10212     {
10213     case 0x00: str = "Trigger is not active"; break;
10214     default:
10215         str = "Execute local SPINI procedures for any number beginning with a Pound # digit";
10216         break;
10217     }
10218
10219     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
10220     proto_tree_add_text(tree, asn1->tvb,
10221         saved_offset, asn1->offset - saved_offset,
10222         "%s :  Pound, %s",
10223         bigbuf, str);
10224
10225     switch ((value & 0x02) >> 1)
10226     {
10227     case 0x00: str = "Trigger is not active"; break;
10228     default:
10229         str = "Execute local SPINI procedures for any number beginning with two Star ** digits";
10230         break;
10231     }
10232
10233     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
10234     proto_tree_add_text(tree, asn1->tvb,
10235         saved_offset, asn1->offset - saved_offset,
10236         "%s :  Double Star (DS), %s",
10237         bigbuf, str);
10238
10239     switch (value & 0x01)
10240     {
10241     case 0x00: str = "Trigger is not active"; break;
10242     default:
10243         str = "Execute local SPINI procedures for any number beginning with a Star * digit";
10244         break;
10245     }
10246
10247     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
10248     proto_tree_add_text(tree, asn1->tvb,
10249         saved_offset, asn1->offset - saved_offset,
10250         "%s :  Star, %s",
10251         bigbuf, str);
10252
10253     saved_offset = asn1->offset;
10254
10255     asn1_int32_value_decode(asn1, 1, &value);
10256
10257     switch ((value & 0x80) >> 7)
10258     {
10259     case 0x00: str = "Trigger is not active"; break;
10260     default:
10261         str = "Execute local SPINI procedures for any call attempt with 7 digits";
10262         break;
10263     }
10264
10265     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
10266     proto_tree_add_text(tree, asn1->tvb,
10267         saved_offset, asn1->offset - saved_offset,
10268         "%s :  7 digits, %s",
10269         bigbuf, str);
10270
10271     switch ((value & 0x40) >> 6)
10272     {
10273     case 0x00: str = "Trigger is not active"; break;
10274     default:
10275         str = "Execute local SPINI procedures for any call attempt with 6 digits";
10276         break;
10277     }
10278
10279     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
10280     proto_tree_add_text(tree, asn1->tvb,
10281         saved_offset, asn1->offset - saved_offset,
10282         "%s :  6 digits, %s",
10283         bigbuf, str);
10284
10285     switch ((value & 0x20) >> 5)
10286     {
10287     case 0x00: str = "Trigger is not active"; break;
10288     default:
10289         str = "Execute local SPINI procedures for any call attempt with 5 digits";
10290         break;
10291     }
10292
10293     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
10294     proto_tree_add_text(tree, asn1->tvb,
10295         saved_offset, asn1->offset - saved_offset,
10296         "%s :  5 digits, %s",
10297         bigbuf, str);
10298
10299     switch ((value & 0x10) >> 4)
10300     {
10301     case 0x00: str = "Trigger is not active"; break;
10302     default:
10303         str = "Execute local SPINI procedures for any call attempt with 4 digits";
10304         break;
10305     }
10306
10307     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
10308     proto_tree_add_text(tree, asn1->tvb,
10309         saved_offset, asn1->offset - saved_offset,
10310         "%s :  4 digits, %s",
10311         bigbuf, str);
10312
10313     switch ((value & 0x08) >> 3)
10314     {
10315     case 0x00: str = "Trigger is not active"; break;
10316     default:
10317         str = "Execute local SPINI procedures for any call attempt with 3 digits";
10318         break;
10319     }
10320
10321     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
10322     proto_tree_add_text(tree, asn1->tvb,
10323         saved_offset, asn1->offset - saved_offset,
10324         "%s :  3 digits, %s",
10325         bigbuf, str);
10326
10327     switch ((value & 0x04) >> 2)
10328     {
10329     case 0x00: str = "Trigger is not active"; break;
10330     default:
10331         str = "Execute local SPINI procedures for any call attempt with 2 digits";
10332         break;
10333     }
10334
10335     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
10336     proto_tree_add_text(tree, asn1->tvb,
10337         saved_offset, asn1->offset - saved_offset,
10338         "%s :  2 digits, %s",
10339         bigbuf, str);
10340
10341     switch ((value & 0x02) >> 1)
10342     {
10343     case 0x00: str = "Trigger is not active"; break;
10344     default:
10345         str = "Execute local SPINI procedures for any call attempt with 1 digits";
10346         break;
10347     }
10348
10349     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
10350     proto_tree_add_text(tree, asn1->tvb,
10351         saved_offset, asn1->offset - saved_offset,
10352         "%s :  1 digits, %s",
10353         bigbuf, str);
10354
10355     switch (value & 0x01)
10356     {
10357     case 0x00: str = "Trigger is not active"; break;
10358     default:
10359         str = "Execute local SPINI procedures for any call attempt with no digits";
10360         break;
10361     }
10362
10363     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
10364     proto_tree_add_text(tree, asn1->tvb,
10365         saved_offset, asn1->offset - saved_offset,
10366         "%s :  No digits, %s",
10367         bigbuf, str);
10368
10369     saved_offset = asn1->offset;
10370
10371     asn1_int32_value_decode(asn1, 1, &value);
10372
10373     switch ((value & 0x80) >> 7)
10374     {
10375     case 0x00: str = "Trigger is not active"; break;
10376     default:
10377         str = "Execute local SPINI procedures for any call attempt with 15 or more digits";
10378         break;
10379     }
10380
10381     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
10382     proto_tree_add_text(tree, asn1->tvb,
10383         saved_offset, asn1->offset - saved_offset,
10384         "%s :  15 digits, %s",
10385         bigbuf, str);
10386
10387     switch ((value & 0x40) >> 6)
10388     {
10389     case 0x00: str = "Trigger is not active"; break;
10390     default:
10391         str = "Execute local SPINI procedures for any call attempt with 14 digits";
10392         break;
10393     }
10394
10395     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
10396     proto_tree_add_text(tree, asn1->tvb,
10397         saved_offset, asn1->offset - saved_offset,
10398         "%s :  14 digits, %s",
10399         bigbuf, str);
10400
10401     switch ((value & 0x20) >> 5)
10402     {
10403     case 0x00: str = "Trigger is not active"; break;
10404     default:
10405         str = "Execute local SPINI procedures for any call attempt with 13 digits";
10406         break;
10407     }
10408
10409     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
10410     proto_tree_add_text(tree, asn1->tvb,
10411         saved_offset, asn1->offset - saved_offset,
10412         "%s :  13 digits, %s",
10413         bigbuf, str);
10414
10415     switch ((value & 0x10) >> 4)
10416     {
10417     case 0x00: str = "Trigger is not active"; break;
10418     default:
10419         str = "Execute local SPINI procedures for any call attempt with 12 digits";
10420         break;
10421     }
10422
10423     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
10424     proto_tree_add_text(tree, asn1->tvb,
10425         saved_offset, asn1->offset - saved_offset,
10426         "%s :  12 digits, %s",
10427         bigbuf, str);
10428
10429     switch ((value & 0x08) >> 3)
10430     {
10431     case 0x00: str = "Trigger is not active"; break;
10432     default:
10433         str = "Execute local SPINI procedures for any call attempt with 11 digits";
10434         break;
10435     }
10436
10437     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
10438     proto_tree_add_text(tree, asn1->tvb,
10439         saved_offset, asn1->offset - saved_offset,
10440         "%s :  11 digits, %s",
10441         bigbuf, str);
10442
10443     switch ((value & 0x04) >> 2)
10444     {
10445     case 0x00: str = "Trigger is not active"; break;
10446     default:
10447         str = "Execute local SPINI procedures for any call attempt with 10 digits";
10448         break;
10449     }
10450
10451     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
10452     proto_tree_add_text(tree, asn1->tvb,
10453         saved_offset, asn1->offset - saved_offset,
10454         "%s :  10 digits, %s",
10455         bigbuf, str);
10456
10457     switch ((value & 0x02) >> 1)
10458     {
10459     case 0x00: str = "Trigger is not active"; break;
10460     default:
10461         str = "Execute local SPINI procedures for any call attempt with 9 digits";
10462         break;
10463     }
10464
10465     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
10466     proto_tree_add_text(tree, asn1->tvb,
10467         saved_offset, asn1->offset - saved_offset,
10468         "%s :  9 digits, %s",
10469         bigbuf, str);
10470
10471     switch (value & 0x01)
10472     {
10473     case 0x00: str = "Trigger is not active"; break;
10474     default:
10475         str = "Execute local SPINI procedures for any call attempt with 8 digits";
10476         break;
10477     }
10478
10479     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
10480     proto_tree_add_text(tree, asn1->tvb,
10481         saved_offset, asn1->offset - saved_offset,
10482         "%s :  8 digits, %s",
10483         bigbuf, str);
10484
10485     EXTRANEOUS_DATA_CHECK(len, 4);
10486 }
10487
10488 static void
10489 param_orig_trig(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
10490 {
10491     gint32 value;
10492     guint saved_offset;
10493     const gchar *str = NULL;
10494
10495     SHORT_DATA_CHECK(len, 4);
10496
10497     saved_offset = asn1->offset;
10498
10499     asn1_int32_value_decode(asn1, 1, &value);
10500
10501     switch ((value & 0x80) >> 7)
10502     {
10503     case 0x00: str = "Trigger is not active"; break;
10504     default:
10505         str = "Launch an Origination Request for any Revertive Call attempt"; break;
10506         break;
10507     }
10508
10509     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
10510     proto_tree_add_text(tree, asn1->tvb,
10511         saved_offset, asn1->offset - saved_offset,
10512         "%s :  Revertive Call (RvtC), %s",
10513         bigbuf, str);
10514
10515     switch ((value & 0x40) >> 6)
10516     {
10517     case 0x00: str = "Trigger is not active"; break;
10518     default:
10519         str = "Launch an Origination Request for any call attempt to an unrecognized number"; break;
10520         break;
10521     }
10522
10523     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
10524     proto_tree_add_text(tree, asn1->tvb,
10525         saved_offset, asn1->offset - saved_offset,
10526         "%s :  Unrecognized Number (Unrec), %s",
10527         bigbuf, str);
10528
10529     switch ((value & 0x20) >> 5)
10530     {
10531     case 0x00: str = "Trigger is not active"; break;
10532     default:
10533         str = "Launch an Origination Request for any call attempt outside of the current World Zone (as defined in ITU-T Rec. E.164)";
10534         break;
10535     }
10536
10537     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
10538     proto_tree_add_text(tree, asn1->tvb,
10539         saved_offset, asn1->offset - saved_offset,
10540         "%s :  World Zone (WZ), %s",
10541         bigbuf, str);
10542
10543     switch ((value & 0x10) >> 4)
10544     {
10545     case 0x00: str = "Trigger is not active"; break;
10546     default:
10547         str = "Launch an Origination Request for any international call attempt";
10548         break;
10549     }
10550
10551     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
10552     proto_tree_add_text(tree, asn1->tvb,
10553         saved_offset, asn1->offset - saved_offset,
10554         "%s :  International (Intl), %s",
10555         bigbuf, str);
10556
10557     switch ((value & 0x08) >> 3)
10558     {
10559     case 0x00: str = "Trigger is not active"; break;
10560     default:
10561         str = "Launch an Origination Request for any toll calls outside the local carrier's serving area";
10562         break;
10563     }
10564
10565     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
10566     proto_tree_add_text(tree, asn1->tvb,
10567         saved_offset, asn1->offset - saved_offset,
10568         "%s :  Non-Local (Inter-LATA) Toll (NLTOLL/OLATA), %s",
10569         bigbuf, str);
10570
10571     switch ((value & 0x04) >> 2)
10572     {
10573     case 0x00: str = "Trigger is not active"; break;
10574     default:
10575         str = "Launch an Origination Request for any local toll call attempt.  Refers to intra-LATA toll within the NANP";
10576         break;
10577     }
10578
10579     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
10580     proto_tree_add_text(tree, asn1->tvb,
10581         saved_offset, asn1->offset - saved_offset,
10582         "%s :  Local (Intra-LATA) Toll (LTOLL/ILATA), %s",
10583         bigbuf, str);
10584
10585     switch ((value & 0x02) >> 1)
10586     {
10587     case 0x00: str = "Trigger is not active"; break;
10588     default:
10589         str = "Launch an Origination Request for any local call attempt";
10590         break;
10591     }
10592
10593     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
10594     proto_tree_add_text(tree, asn1->tvb,
10595         saved_offset, asn1->offset - saved_offset,
10596         "%s :  Local, %s",
10597         bigbuf, str);
10598
10599     switch (value & 0x01)
10600     {
10601     case 0x00: str = "Trigger is not active"; break;
10602     default:
10603         str = "Launch an Origination Request for any call attempt. This overrides all other values.";
10604         break;
10605     }
10606
10607     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
10608     proto_tree_add_text(tree, asn1->tvb,
10609         saved_offset, asn1->offset - saved_offset,
10610         "%s :  All Origination (All), %s",
10611         bigbuf, str);
10612
10613     saved_offset = asn1->offset;
10614
10615     asn1_int32_value_decode(asn1, 1, &value);
10616
10617     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
10618     proto_tree_add_text(tree, asn1->tvb,
10619         saved_offset, asn1->offset - saved_offset,
10620         "%s :  Reserved",
10621         bigbuf);
10622
10623     switch ((value & 0x10) >> 4)
10624     {
10625     case 0x00: str = "Trigger is not active"; break;
10626     default:
10627         str = "Launch an Origination Request for any number matching a criteria of a prior agreement";
10628         break;
10629     }
10630
10631     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
10632     proto_tree_add_text(tree, asn1->tvb,
10633         saved_offset, asn1->offset - saved_offset,
10634         "%s :  Prior Agreement (PA), %s",
10635         bigbuf, str);
10636
10637     switch ((value & 0x08) >> 3)
10638     {
10639     case 0x00: str = "Trigger is not active"; break;
10640     default:
10641         str = "Launch an Origination Request for any number beginning with two Pound ## digits";
10642         break;
10643     }
10644
10645     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
10646     proto_tree_add_text(tree, asn1->tvb,
10647         saved_offset, asn1->offset - saved_offset,
10648         "%s :  Double Pound (DP), %s",
10649         bigbuf, str);
10650
10651     switch ((value & 0x04) >> 2)
10652     {
10653     case 0x00: str = "Trigger is not active"; break;
10654     default:
10655         str = "Launch an Origination Request for any number beginning with a Pound # digit";
10656         break;
10657     }
10658
10659     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
10660     proto_tree_add_text(tree, asn1->tvb,
10661         saved_offset, asn1->offset - saved_offset,
10662         "%s :  Pound, %s",
10663         bigbuf, str);
10664
10665     switch ((value & 0x02) >> 1)
10666     {
10667     case 0x00: str = "Trigger is not active"; break;
10668     default:
10669         str = "Launch an Origination Request for any number beginning with two Star ** digits";
10670         break;
10671     }
10672
10673     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
10674     proto_tree_add_text(tree, asn1->tvb,
10675         saved_offset, asn1->offset - saved_offset,
10676         "%s :  Double Star (DS), %s",
10677         bigbuf, str);
10678
10679     switch (value & 0x01)
10680     {
10681     case 0x00: str = "Trigger is not active"; break;
10682     default:
10683         str = "Launch an Origination Request for any number beginning with a Star * digit";
10684         break;
10685     }
10686
10687     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
10688     proto_tree_add_text(tree, asn1->tvb,
10689         saved_offset, asn1->offset - saved_offset,
10690         "%s :  Star, %s",
10691         bigbuf, str);
10692
10693     saved_offset = asn1->offset;
10694
10695     asn1_int32_value_decode(asn1, 1, &value);
10696
10697     switch ((value & 0x80) >> 7)
10698     {
10699     case 0x00: str = "Trigger is not active"; break;
10700     default:
10701         str = "Launch an Origination Request for any call attempt with 7 digits";
10702         break;
10703     }
10704
10705     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
10706     proto_tree_add_text(tree, asn1->tvb,
10707         saved_offset, asn1->offset - saved_offset,
10708         "%s :  7 digits, %s",
10709         bigbuf, str);
10710
10711     switch ((value & 0x40) >> 6)
10712     {
10713     case 0x00: str = "Trigger is not active"; break;
10714     default:
10715         str = "Launch an Origination Request for any call attempt with 6 digits";
10716         break;
10717     }
10718
10719     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
10720     proto_tree_add_text(tree, asn1->tvb,
10721         saved_offset, asn1->offset - saved_offset,
10722         "%s :  6 digits, %s",
10723         bigbuf, str);
10724
10725     switch ((value & 0x20) >> 5)
10726     {
10727     case 0x00: str = "Trigger is not active"; break;
10728     default:
10729         str = "Launch an Origination Request for any call attempt with 5 digits";
10730         break;
10731     }
10732
10733     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
10734     proto_tree_add_text(tree, asn1->tvb,
10735         saved_offset, asn1->offset - saved_offset,
10736         "%s :  5 digits, %s",
10737         bigbuf, str);
10738
10739     switch ((value & 0x10) >> 4)
10740     {
10741     case 0x00: str = "Trigger is not active"; break;
10742     default:
10743         str = "Launch an Origination Request for any call attempt with 4 digits";
10744         break;
10745     }
10746
10747     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
10748     proto_tree_add_text(tree, asn1->tvb,
10749         saved_offset, asn1->offset - saved_offset,
10750         "%s :  4 digits, %s",
10751         bigbuf, str);
10752
10753     switch ((value & 0x08) >> 3)
10754     {
10755     case 0x00: str = "Trigger is not active"; break;
10756     default:
10757         str = "Launch an Origination Request for any call attempt with 3 digits";
10758         break;
10759     }
10760
10761     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
10762     proto_tree_add_text(tree, asn1->tvb,
10763         saved_offset, asn1->offset - saved_offset,
10764         "%s :  3 digits, %s",
10765         bigbuf, str);
10766
10767     switch ((value & 0x04) >> 2)
10768     {
10769     case 0x00: str = "Trigger is not active"; break;
10770     default:
10771         str = "Launch an Origination Request for any call attempt with 2 digits";
10772         break;
10773     }
10774
10775     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
10776     proto_tree_add_text(tree, asn1->tvb,
10777         saved_offset, asn1->offset - saved_offset,
10778         "%s :  2 digits, %s",
10779         bigbuf, str);
10780
10781     switch ((value & 0x02) >> 1)
10782     {
10783     case 0x00: str = "Trigger is not active"; break;
10784     default:
10785         str = "Launch an Origination Request for any call attempt with 1 digits";
10786         break;
10787     }
10788
10789     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
10790     proto_tree_add_text(tree, asn1->tvb,
10791         saved_offset, asn1->offset - saved_offset,
10792         "%s :  1 digits, %s",
10793         bigbuf, str);
10794
10795     switch (value & 0x01)
10796     {
10797     case 0x00: str = "Trigger is not active"; break;
10798     default:
10799         str = "Launch an Origination Request for any call attempt with no digits";
10800         break;
10801     }
10802
10803     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
10804     proto_tree_add_text(tree, asn1->tvb,
10805         saved_offset, asn1->offset - saved_offset,
10806         "%s :  No digits, %s",
10807         bigbuf, str);
10808
10809     saved_offset = asn1->offset;
10810
10811     asn1_int32_value_decode(asn1, 1, &value);
10812
10813     switch ((value & 0x80) >> 7)
10814     {
10815     case 0x00: str = "Trigger is not active"; break;
10816     default:
10817         str = "Launch an Origination Request for any call attempt with 15 or more digits";
10818         break;
10819     }
10820
10821     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
10822     proto_tree_add_text(tree, asn1->tvb,
10823         saved_offset, asn1->offset - saved_offset,
10824         "%s :  15 digits, %s",
10825         bigbuf, str);
10826
10827     switch ((value & 0x40) >> 6)
10828     {
10829     case 0x00: str = "Trigger is not active"; break;
10830     default:
10831         str = "Launch an Origination Request for any call attempt with 14 digits";
10832         break;
10833     }
10834
10835     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
10836     proto_tree_add_text(tree, asn1->tvb,
10837         saved_offset, asn1->offset - saved_offset,
10838         "%s :  14 digits, %s",
10839         bigbuf, str);
10840
10841     switch ((value & 0x20) >> 5)
10842     {
10843     case 0x00: str = "Trigger is not active"; break;
10844     default:
10845         str = "Launch an Origination Request for any call attempt with 13 digits";
10846         break;
10847     }
10848
10849     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
10850     proto_tree_add_text(tree, asn1->tvb,
10851         saved_offset, asn1->offset - saved_offset,
10852         "%s :  13 digits, %s",
10853         bigbuf, str);
10854
10855     switch ((value & 0x10) >> 4)
10856     {
10857     case 0x00: str = "Trigger is not active"; break;
10858     default:
10859         str = "Launch an Origination Request for any call attempt with 12 digits";
10860         break;
10861     }
10862
10863     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
10864     proto_tree_add_text(tree, asn1->tvb,
10865         saved_offset, asn1->offset - saved_offset,
10866         "%s :  12 digits, %s",
10867         bigbuf, str);
10868
10869     switch ((value & 0x08) >> 3)
10870     {
10871     case 0x00: str = "Trigger is not active"; break;
10872     default:
10873         str = "Launch an Origination Request for any call attempt with 11 digits";
10874         break;
10875     }
10876
10877     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
10878     proto_tree_add_text(tree, asn1->tvb,
10879         saved_offset, asn1->offset - saved_offset,
10880         "%s :  11 digits, %s",
10881         bigbuf, str);
10882
10883     switch ((value & 0x04) >> 2)
10884     {
10885     case 0x00: str = "Trigger is not active"; break;
10886     default:
10887         str = "Launch an Origination Request for any call attempt with 10 digits";
10888         break;
10889     }
10890
10891     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
10892     proto_tree_add_text(tree, asn1->tvb,
10893         saved_offset, asn1->offset - saved_offset,
10894         "%s :  10 digits, %s",
10895         bigbuf, str);
10896
10897     switch ((value & 0x02) >> 1)
10898     {
10899     case 0x00: str = "Trigger is not active"; break;
10900     default:
10901         str = "Launch an Origination Request for any call attempt with 9 digits";
10902         break;
10903     }
10904
10905     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
10906     proto_tree_add_text(tree, asn1->tvb,
10907         saved_offset, asn1->offset - saved_offset,
10908         "%s :  9 digits, %s",
10909         bigbuf, str);
10910
10911     switch (value & 0x01)
10912     {
10913     case 0x00: str = "Trigger is not active"; break;
10914     default:
10915         str = "Launch an Origination Request for any call attempt with 8 digits";
10916         break;
10917     }
10918
10919     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
10920     proto_tree_add_text(tree, asn1->tvb,
10921         saved_offset, asn1->offset - saved_offset,
10922         "%s :  8 digits, %s",
10923         bigbuf, str);
10924
10925     EXTRANEOUS_DATA_CHECK(len, 4);
10926 }
10927
10928 static void
10929 param_trig_cap(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
10930 {
10931     gint32 value;
10932     guint saved_offset;
10933     const gchar *str = NULL;
10934
10935     saved_offset = asn1->offset;
10936
10937     asn1_int32_value_decode(asn1, 1, &value);
10938
10939     switch ((value & 0x80) >> 7)
10940     {
10941     case 0x00: str = "O No Answer (ONA) cannot be armed"; break;
10942     default:
10943         str = "O No Answer (ONA) can be armed";
10944         break;
10945     }
10946
10947     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
10948     proto_tree_add_text(tree, asn1->tvb,
10949         saved_offset, asn1->offset - saved_offset,
10950         "%s :  %s",
10951         bigbuf, str);
10952
10953     switch ((value & 0x40) >> 6)
10954     {
10955     case 0x00: str = "O Disconnect (ODISC) cannot be armed"; break;
10956     default:
10957         str = "O Disconnect (ODISC) can be armed";
10958         break;
10959     }
10960
10961     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
10962     proto_tree_add_text(tree, asn1->tvb,
10963         saved_offset, asn1->offset - saved_offset,
10964         "%s :  %s",
10965         bigbuf, str);
10966
10967     switch ((value & 0x20) >> 5)
10968     {
10969     case 0x00: str = "O Answer (OANS) cannot be armed"; break;
10970     default:
10971         str = "O Answer (OANS) can be armed";
10972         break;
10973     }
10974
10975     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
10976     proto_tree_add_text(tree, asn1->tvb,
10977         saved_offset, asn1->offset - saved_offset,
10978         "%s :  %s",
10979         bigbuf, str);
10980
10981     switch ((value & 0x10) >> 4)
10982     {
10983     case 0x00: str = "Origination Attempt Authorized (OAA) cannot be armed"; break;
10984     default:
10985         str = "Origination Attempt Authorized (OAA) can be armed";
10986         break;
10987     }
10988
10989     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
10990     proto_tree_add_text(tree, asn1->tvb,
10991         saved_offset, asn1->offset - saved_offset,
10992         "%s :  %s",
10993         bigbuf, str);
10994
10995     switch ((value & 0x08) >> 3)
10996     {
10997     case 0x00: str = "Revertive Call trigger (RvtC) cannot be armed"; break;
10998     default:
10999         str = "Revertive Call trigger (RvtC) can be armed";
11000         break;
11001     }
11002
11003     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
11004     proto_tree_add_text(tree, asn1->tvb,
11005         saved_offset, asn1->offset - saved_offset,
11006         "%s :  %s",
11007         bigbuf, str);
11008
11009     switch ((value & 0x04) >> 2)
11010     {
11011     case 0x00: str = "All Calls trigger (All) cannot be armed"; break;
11012     default:
11013         str = "All Calls trigger (All) can be armed";
11014         break;
11015     }
11016
11017     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
11018     proto_tree_add_text(tree, asn1->tvb,
11019         saved_offset, asn1->offset - saved_offset,
11020         "%s :  %s",
11021         bigbuf, str);
11022
11023     switch ((value & 0x02) >> 1)
11024     {
11025     case 0x00: str = "K-digit triggers (K-digit) cannot be armed"; break;
11026     default:
11027         str = "K-digit triggers (K-digit) can be armed";
11028         break;
11029     }
11030
11031     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
11032     proto_tree_add_text(tree, asn1->tvb,
11033         saved_offset, asn1->offset - saved_offset,
11034         "%s :  %s",
11035         bigbuf, str);
11036
11037     switch (value & 0x01)
11038     {
11039     case 0x00: str = "Introducing Star/Pound triggers (INIT) cannot be armed"; break;
11040     default:
11041         str = "Introducing Star/Pound triggers (INIT) can be armed";
11042         break;
11043     }
11044
11045     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
11046     proto_tree_add_text(tree, asn1->tvb,
11047         saved_offset, asn1->offset - saved_offset,
11048         "%s :  %s",
11049         bigbuf, str);
11050
11051     if (len == 1) return;
11052
11053     saved_offset = asn1->offset;
11054
11055     asn1_int32_value_decode(asn1, 1, &value);
11056
11057     switch ((value & 0x80) >> 7)
11058     {
11059     case 0x00: str = "O Called Party Busy (OBSY) cannot be armed"; break;
11060     default:
11061         str = "O Called Party Busy (OBSY) can be armed";
11062         break;
11063     }
11064
11065     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
11066     proto_tree_add_text(tree, asn1->tvb,
11067         saved_offset, asn1->offset - saved_offset,
11068         "%s :  %s",
11069         bigbuf, str);
11070
11071     switch ((value & 0x40) >> 6)
11072     {
11073     case 0x00: str = "Called Routing Address Available (CdRAA) cannot be armed"; break;
11074     default:
11075         str = "Called Routing Address Available (CdRAA) can be armed";
11076         break;
11077     }
11078
11079     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
11080     proto_tree_add_text(tree, asn1->tvb,
11081         saved_offset, asn1->offset - saved_offset,
11082         "%s :  %s",
11083         bigbuf, str);
11084
11085     switch ((value & 0x20) >> 5)
11086     {
11087     case 0x00: str = "Initial Termination (IT) cannot be armed"; break;
11088     default:
11089         str = "Initial Termination (IT) can be armed";
11090         break;
11091     }
11092
11093     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
11094     proto_tree_add_text(tree, asn1->tvb,
11095         saved_offset, asn1->offset - saved_offset,
11096         "%s :  %s",
11097         bigbuf, str);
11098
11099     switch ((value & 0x10) >> 4)
11100     {
11101     case 0x00: str = "Calling Routing Address Available (CgRAA) cannot be armed"; break;
11102     default:
11103         str = "Calling Routing Address Available (CgRAA) can be armed";
11104         break;
11105     }
11106
11107     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
11108     proto_tree_add_text(tree, asn1->tvb,
11109         saved_offset, asn1->offset - saved_offset,
11110         "%s :  %s",
11111         bigbuf, str);
11112
11113     switch ((value & 0x08) >> 3)
11114     {
11115     case 0x00: str = "Advanced Termination trigger (AT) cannot be armed"; break;
11116     default:
11117         str = "Advanced Termination trigger (AT) can be armed";
11118         break;
11119     }
11120
11121     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
11122     proto_tree_add_text(tree, asn1->tvb,
11123         saved_offset, asn1->offset - saved_offset,
11124         "%s :  %s",
11125         bigbuf, str);
11126
11127     switch ((value & 0x04) >> 2)
11128     {
11129     case 0x00: str = "Prior Agreement trigger (PA) cannot be armed"; break;
11130     default:
11131         str = "Prior Agreement trigger (PA) can be armed";
11132         break;
11133     }
11134
11135     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
11136     proto_tree_add_text(tree, asn1->tvb,
11137         saved_offset, asn1->offset - saved_offset,
11138         "%s :  %s",
11139         bigbuf, str);
11140
11141     switch ((value & 0x02) >> 1)
11142     {
11143     case 0x00: str = "Unrecognized Number trigger (Unrec) cannot be armed"; break;
11144     default:
11145         str = "Unrecognized Number trigger (Unrec) can be armed";
11146         break;
11147     }
11148
11149     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
11150     proto_tree_add_text(tree, asn1->tvb,
11151         saved_offset, asn1->offset - saved_offset,
11152         "%s :  %s",
11153         bigbuf, str);
11154
11155     switch (value & 0x01)
11156     {
11157     case 0x00: str = "Call Type triggers (CT) cannot be armed"; break;
11158     default:
11159         str = "Call Type triggers (CT) can be armed";
11160         break;
11161     }
11162
11163     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
11164     proto_tree_add_text(tree, asn1->tvb,
11165         saved_offset, asn1->offset - saved_offset,
11166         "%s :  %s",
11167         bigbuf, str);
11168
11169     if (len == 2) return;
11170
11171     saved_offset = asn1->offset;
11172
11173     asn1_int32_value_decode(asn1, 1, &value);
11174
11175     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
11176     proto_tree_add_text(tree, asn1->tvb,
11177         saved_offset, asn1->offset - saved_offset,
11178         "%s :  Reserved",
11179         bigbuf);
11180
11181     switch ((value & 0x10) >> 4)
11182     {
11183     case 0x00: str = "T Disconnect (TDISC) cannot be armed"; break;
11184     default:
11185         str = "T Disconnect (TDISC) can be armed";
11186         break;
11187     }
11188
11189     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
11190     proto_tree_add_text(tree, asn1->tvb,
11191         saved_offset, asn1->offset - saved_offset,
11192         "%s :  %s",
11193         bigbuf, str);
11194
11195     switch ((value & 0x08) >> 3)
11196     {
11197     case 0x00: str = "T Answer (TANS) cannot be armed"; break;
11198     default:
11199         str = "T Answer (TANS) can be armed";
11200         break;
11201     }
11202
11203     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
11204     proto_tree_add_text(tree, asn1->tvb,
11205         saved_offset, asn1->offset - saved_offset,
11206         "%s :  %s",
11207         bigbuf, str);
11208
11209     switch ((value & 0x04) >> 2)
11210     {
11211     case 0x00: str = "T No Answer trigger (TNA) cannot be armed"; break;
11212     default:
11213         str = "T No Answer trigger (TNA) can be armed";
11214         break;
11215     }
11216
11217     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
11218     proto_tree_add_text(tree, asn1->tvb,
11219         saved_offset, asn1->offset - saved_offset,
11220         "%s :  %s",
11221         bigbuf, str);
11222
11223     switch ((value & 0x02) >> 1)
11224     {
11225     case 0x00: str = "T Busy trigger (TBusy) cannot be armed"; break;
11226     default:
11227         str = "T Busy trigger (TBusy) can be armed";
11228         break;
11229     }
11230
11231     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
11232     proto_tree_add_text(tree, asn1->tvb,
11233         saved_offset, asn1->offset - saved_offset,
11234         "%s :  %s",
11235         bigbuf, str);
11236
11237     switch (value & 0x01)
11238     {
11239     case 0x00: str = "Terminating Resource Available triggers (TRA) cannot be armed"; break;
11240     default:
11241         str = "Terminating Resource Available triggers (TRA) can be armed";
11242         break;
11243     }
11244
11245     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
11246     proto_tree_add_text(tree, asn1->tvb,
11247         saved_offset, asn1->offset - saved_offset,
11248         "%s :  %s",
11249         bigbuf, str);
11250
11251     EXTRANEOUS_DATA_CHECK(len, 3);
11252 }
11253
11254 static void
11255 param_sys_cap(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
11256 {
11257     gint32 value;
11258     guint saved_offset;
11259     const gchar *str = NULL;
11260
11261     EXACT_DATA_CHECK(len, 1);
11262
11263     saved_offset = asn1->offset;
11264
11265     asn1_int32_value_decode(asn1, 1, &value);
11266
11267     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
11268     proto_tree_add_text(tree, asn1->tvb,
11269         saved_offset, asn1->offset - saved_offset,
11270         "%s :  Reserved",
11271         bigbuf);
11272
11273     switch ((value & 0x20) >> 5)
11274     {
11275     case 0x00: str = "DP is not supported by the system"; break;
11276     default:
11277         str = "DP is supported by the system";
11278         break;
11279     }
11280
11281     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
11282     proto_tree_add_text(tree, asn1->tvb,
11283         saved_offset, asn1->offset - saved_offset,
11284         "%s :  %s",
11285         bigbuf, str);
11286
11287     switch ((value & 0x10) >> 4)
11288     {
11289     case 0x00: str = "SSD is not shared with the system for the indicated MS"; break;
11290     default:
11291         str = "SSD is shared with the system for the indicated MS";
11292         break;
11293     }
11294
11295     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
11296     proto_tree_add_text(tree, asn1->tvb,
11297         saved_offset, asn1->offset - saved_offset,
11298         "%s :  %s",
11299         bigbuf, str);
11300
11301     switch ((value & 0x08) >> 3)
11302     {
11303     case 0x00: str = "System cannot execute CAVE algorithm"; break;
11304     default:
11305         str = "System can execute CAVE algorithm";
11306         break;
11307     }
11308
11309     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
11310     proto_tree_add_text(tree, asn1->tvb,
11311         saved_offset, asn1->offset - saved_offset,
11312         "%s :  %s",
11313         bigbuf, str);
11314
11315     switch ((value & 0x04) >> 2)
11316     {
11317     case 0x00: str = "Voice Privacy is not supported"; break;
11318     default:
11319         str = "Voice Privacy is supported";
11320         break;
11321     }
11322
11323     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
11324     proto_tree_add_text(tree, asn1->tvb,
11325         saved_offset, asn1->offset - saved_offset,
11326         "%s :  %s",
11327         bigbuf, str);
11328
11329     switch ((value & 0x02) >> 1)
11330     {
11331     case 0x00: str = "SME is not supported"; break;
11332     default:
11333         str = "SME is supported";
11334         break;
11335     }
11336
11337     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
11338     proto_tree_add_text(tree, asn1->tvb,
11339         saved_offset, asn1->offset - saved_offset,
11340         "%s :  %s",
11341         bigbuf, str);
11342
11343     switch (value & 0x01)
11344     {
11345     case 0x00: str = "Authentication parameters were not requested"; break;
11346     default:
11347         str = "Authentication parameters were requested";
11348         break;
11349     }
11350
11351     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
11352     proto_tree_add_text(tree, asn1->tvb,
11353         saved_offset, asn1->offset - saved_offset,
11354         "%s :  %s",
11355         bigbuf, str);
11356 }
11357
11358 static void
11359 param_act_code(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
11360 {
11361     gint32 value;
11362     guint saved_offset;
11363     const gchar *str = NULL;
11364
11365     saved_offset = asn1->offset;
11366
11367     asn1_int32_value_decode(asn1, 1, &value);
11368
11369     switch (value)
11370     {
11371     case 0: str = "Not used"; break;
11372     case 1: str = "Continue processing"; break;
11373     case 2: str = "Disconnect call"; break;
11374     case 3: str = "Disconnect call leg"; break;
11375     case 4: str = "Conference calling drop last party"; break;
11376     case 5: str = "Bridge call leg(s) to conference call"; break;
11377     case 6: str = "Drop call leg on busy or routing failure"; break;
11378     case 7: str = "Disconnect all call legs"; break;
11379     case 8: str = "Attach MSC to OTAF"; break;
11380     case 9: str = "Initiate Registration Notification"; break;
11381     case 10: str = "Generate Public Encryption values"; break;
11382     case 11: str = "Generate A-Key"; break;
11383     case 12: str = "Perform SSD Update procedure"; break;
11384     case 13: str = "Perform Re-authentication procedure"; break;
11385     case 14: str = "Release TRN"; break;
11386     case 15: str = "Commit A-key"; break;
11387     case 16: str = "Release Resources"; break;
11388     case 17: str = "Record NEWMSID"; break;
11389     case 18: str = "Allocate Resources"; break;
11390     case 19: str = "Generate Authentication Signature"; break;
11391     case 20: str = "Release leg and redirect subscriber"; break;
11392     case 21: str = "Do Not Wait For MS User Level Response"; break;
11393     default:
11394         if ((value >= 22) && (value <= 95)) { str = "Reserved, treat as Continue processing"; }
11395         if ((value >= 96) && (value <= 127)) { str = "Reserved for protocol extension, treat as Continue processing"; }
11396         if ((value >= 128) && (value <= 223)) { str = "Reserved, treat as Disconnect call"; }
11397         else { str = "Reserved for protocol extension, treat as Disconnect call"; }
11398         break;
11399     }
11400
11401     proto_tree_add_text(tree, asn1->tvb,
11402         saved_offset, asn1->offset - saved_offset,
11403         "Action Code, %s (%u)",
11404         str,
11405         value);
11406
11407     EXTRANEOUS_DATA_CHECK(len, 1);
11408 }
11409
11410 static void
11411 param_border_acc(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
11412 {
11413     gint32 value;
11414     guint saved_offset;
11415     const gchar *str = NULL;
11416
11417     EXACT_DATA_CHECK(len, 1);
11418
11419     saved_offset = asn1->offset;
11420
11421     asn1_int32_value_decode(asn1, 1, &value);
11422
11423     switch (value)
11424     {
11425     case 0: str = "Not used"; break;
11426     case 1: str = "Border Cell Access"; break;
11427     default:
11428         if ((value >= 2) && (value <= 223)) { str = "Reserved, treat as Border Cell Access"; }
11429         else { str = "Reserved for protocol extension, treat as Border Cell Access"; }
11430         break;
11431     }
11432
11433     proto_tree_add_text(tree, asn1->tvb,
11434         saved_offset, asn1->offset - saved_offset,
11435         "Indication, %s (%u)",
11436         str,
11437         value);
11438 }
11439
11440 static void
11441 param_avail_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
11442 {
11443     gint32 value;
11444     guint saved_offset;
11445     const gchar *str = NULL;
11446
11447     saved_offset = asn1->offset;
11448
11449     asn1_int32_value_decode(asn1, 1, &value);
11450
11451     switch (value)
11452     {
11453     case 0: str = "Not used"; break;
11454     case 1: str = "Unspecified MS inactivity type"; break;
11455     default:
11456         if ((value >= 2) && (value <= 223)) { str = "Reserved, treat as Unspecified"; }
11457         else { str = "Reserved for protocol extension, treat as Unspecified"; }
11458         break;
11459     }
11460
11461     proto_tree_add_text(tree, asn1->tvb,
11462         saved_offset, asn1->offset - saved_offset,
11463         str);
11464
11465     EXTRANEOUS_DATA_CHECK(len, 1);
11466 }
11467
11468 static void
11469 param_can_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
11470 {
11471     gint32 value;
11472     guint saved_offset;
11473     const gchar *str = NULL;
11474
11475     saved_offset = asn1->offset;
11476
11477     asn1_int32_value_decode(asn1, 1, &value);
11478
11479     switch (value)
11480     {
11481     case 0: str = "Not used"; break;
11482     case 1: str = "Serving System Option.  The serving system may discontinue a call or service in progress at its option."; break;
11483     case 2: str = "Report In Call.  The serving system shall continue to provide service when a call or service is in progress and just report its incidence."; break;
11484     case 3: str = "Discontinue.  The serving system shall discontinue any call or service in progress, regardless of the MS\92s qualification, profile or authentication."; break;
11485     default:
11486         if ((value >= 4) && (value <= 223)) { str = "Reserved, treat as Serving System Option"; }
11487         else { str = "Reserved for protocol extension, treat as Serving System Option"; }
11488         break;
11489     }
11490
11491     proto_tree_add_text(tree, asn1->tvb,
11492         saved_offset, asn1->offset - saved_offset,
11493         str);
11494
11495     EXTRANEOUS_DATA_CHECK(len, 1);
11496 }
11497
11498 static void
11499 param_can_den(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
11500 {
11501     gint32 value;
11502     guint saved_offset;
11503     const gchar *str = NULL;
11504
11505     EXACT_DATA_CHECK(len, 1);
11506
11507     saved_offset = asn1->offset;
11508
11509     asn1_int32_value_decode(asn1, 1, &value);
11510
11511     switch (value)
11512     {
11513     case 0: str = "Not used"; break;
11514     case 1: str = "Multiple Access"; break;
11515     case 2: str = "Busy"; break;
11516     default:
11517         if ((value >= 3) && (value <= 223)) { str = "Reserved, treat as Multiple Access"; }
11518         else { str = "Reserved for protocol extension, treat as Multiple Access"; }
11519         break;
11520     }
11521
11522     proto_tree_add_text(tree, asn1->tvb,
11523         saved_offset, asn1->offset - saved_offset,
11524         "Indication, %s (%u)",
11525         str,
11526         value);
11527 }
11528
11529 static void
11530 param_acc_den(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
11531 {
11532     gint32 value;
11533     guint saved_offset;
11534     const gchar *str = NULL;
11535
11536     EXACT_DATA_CHECK(len, 1);
11537
11538     saved_offset = asn1->offset;
11539
11540     asn1_int32_value_decode(asn1, 1, &value);
11541
11542     switch (value)
11543     {
11544     case 0: str = "Not used"; break;
11545     case 1: str = "Unassigned directory number"; break;
11546     case 2: str = "Inactive"; break;
11547     case 3: str = "Busy"; break;
11548     case 4: str = "Termination denied"; break;
11549     case 5: str = "No Page response"; break;
11550     case 6: str = "Unavailable"; break;
11551     case 7: str = "Service Rejected by MS"; break;
11552     case 8: str = "Service Rejected by the System"; break;
11553     case 9: str = "Service Type Mismatch"; break;
11554     case 10: str = "Service Denied"; break;
11555     case 11: str = "Call Rejected"; break;
11556     default:
11557         if ((value >= 12) && (value <= 223)) { str = "Reserved, treat as Termination denied"; }
11558         else { str = "Reserved for protocol extension, treat as Termination denied"; }
11559         break;
11560     }
11561
11562     proto_tree_add_text(tree, asn1->tvb,
11563         saved_offset, asn1->offset - saved_offset,
11564         "Access Denied Reason, %s (%u)",
11565         str,
11566         value);
11567 }
11568
11569 static void
11570 param_sms_acc_den_reason(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
11571 {
11572     gint32 value;
11573     guint saved_offset;
11574     const gchar *str = NULL;
11575
11576     saved_offset = asn1->offset;
11577
11578     asn1_int32_value_decode(asn1, 1, &value);
11579
11580     switch (value)
11581     {
11582     case 0: str = "Not used"; break;
11583     case 1: str = "Denied"; break;
11584     case 2: str = "Postponed"; break;
11585     case 3: str = "Unavailable"; break;
11586     case 4: str = "Invalid"; break;
11587     default:
11588         if ((value >= 5) && (value <= 63)) { str = "Reserved, treat as Denied"; }
11589         else if ((value >= 64) && (value <= 127)) { str = "Reserved, treat as Postponed"; }
11590         else if ((value >= 128) && (value <= 223)) { str = "Reserved, treat as Unavailable"; }
11591         else { str = "Reserved for protocol extension, treat as Unavailable"; }
11592         break;
11593     }
11594
11595     proto_tree_add_text(tree, asn1->tvb,
11596         saved_offset, asn1->offset - saved_offset,
11597         "Access Denied Reason, %s (%u)",
11598         str,
11599         value);
11600
11601     EXTRANEOUS_DATA_CHECK(len, 1);
11602 }
11603
11604 static void
11605 param_sms_bd(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
11606 {
11607
11608     bd_tvb = tvb_new_subset(asn1->tvb, asn1->offset, len, len);
11609
11610     proto_tree_add_text(tree, asn1->tvb,
11611         asn1->offset, len,
11612         "Parameter Data");
11613
11614     asn1->offset += len;
11615 }
11616
11617 static void
11618 param_sms_cause(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
11619 {
11620     gint32 value;
11621     guint saved_offset;
11622     const gchar *str = NULL;
11623
11624     saved_offset = asn1->offset;
11625
11626     asn1_int32_value_decode(asn1, 1, &value);
11627
11628     switch (value)
11629     {
11630     case 0: str = "Address vacant"; break;
11631     case 1: str = "Address translation failure"; break;
11632     case 2: str = "Network resource shortage"; break;
11633     case 3: str = "Network failure"; break;
11634     case 4: str = "Invalid Teleservice ID"; break;
11635     case 5: str = "Other network problem"; break;
11636     case 6: str = "Unsupported network interface"; break;
11637     case 32: str = "No page response"; break;
11638     case 33: str = "Destination busy"; break;
11639     case 34: str = "No acknowledgement"; break;
11640     case 35: str = "Destination resource shortage"; break;
11641     case 36: str = "SMS delivery postponed"; break;
11642     case 37: str = "Destination out of service"; break;
11643     case 38: str = "Destination no longer at this address"; break;
11644     case 39: str = "Other terminal problem"; break;
11645     case 64: str = "Radio interface resource shortage"; break;
11646     case 65: str = "Radio interface incompatibility"; break;
11647     case 66: str = "Other radio interface problem"; break;
11648     case 67: str = "Unsupported Base Station Capability"; break;
11649     case 96: str = "Encoding problem"; break;
11650     case 97: str = "Service origination denied"; break;
11651     case 98: str = "Service termination denied"; break;
11652     case 99: str = "Supplementary service not supported"; break;
11653     case 100: str = "Service not supported"; break;
11654     case 101: str = "Reserved"; break;
11655     case 102: str = "Missing expected parameter"; break;
11656     case 103: str = "Missing mandatory parameter"; break;
11657     case 104: str = "Unrecognized parameter value"; break;
11658     case 105: str = "Unexpected parameter value"; break;
11659     case 106: str = "User Data size error"; break;
11660     case 107: str = "Other general problems"; break;
11661     case 108: str = "Session not active"; break;
11662     default:
11663         if ((value >= 7) && (value <= 31)) { str = "Reserved, treat as Other network problem"; }
11664         else if ((value >= 40) && (value <= 47)) { str = "Reserved, treat as Other terminal problem"; }
11665         else if ((value >= 48) && (value <= 63)) { str = "Reserved, treat as SMS delivery postponed"; }
11666         else if ((value >= 68) && (value <= 95)) { str = "Reserved, treat as Other radio interface problem"; }
11667         else if ((value >= 109) && (value <= 223)) { str = "Reserved, treat as Other general problems"; }
11668         else { str = "Reserved for protocol extension, treat as Other general problems"; }
11669         break;
11670     }
11671
11672     proto_tree_add_text(tree, asn1->tvb,
11673         saved_offset, asn1->offset - saved_offset,
11674         "%s (%u)",
11675         str,
11676         value);
11677
11678     EXTRANEOUS_DATA_CHECK(len, 1);
11679 }
11680
11681 static void
11682 param_cdma_soci(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
11683 {
11684     gint32 value;
11685     guint saved_offset;
11686
11687     saved_offset = asn1->offset;
11688
11689     asn1_int32_value_decode(asn1, 1, &value);
11690
11691     proto_tree_add_text(tree, asn1->tvb,
11692         saved_offset, asn1->offset - saved_offset,
11693         "Value %u",
11694         value);
11695
11696     EXTRANEOUS_DATA_CHECK(len, 1);
11697 }
11698
11699 static void
11700 param_int(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
11701 {
11702     gint32 value;
11703     guint saved_offset;
11704
11705     if (len > 4)
11706     {
11707         proto_tree_add_text(tree, asn1->tvb,
11708             asn1->offset, len, "Long Data (?)");
11709         asn1->offset += len;
11710         return;
11711     }
11712
11713     saved_offset = asn1->offset;
11714
11715     asn1_int32_value_decode(asn1, len, &value);
11716
11717     proto_tree_add_text(tree, asn1->tvb,
11718         saved_offset, asn1->offset - saved_offset,
11719         "Value %u",
11720         value);
11721 }
11722
11723 static void
11724 param_pc_ssn(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
11725 {
11726     gint32 value, b1, b2, b3, b4;
11727     guint saved_offset;
11728     const gchar *str = NULL;
11729
11730     EXACT_DATA_CHECK(len, 5);
11731
11732     saved_offset = asn1->offset;
11733
11734     asn1_int32_value_decode(asn1, 1, &value);
11735
11736     switch (value)
11737     {
11738     case 0: str = "Not specified"; break;
11739     case 1: str = "Serving MSC"; break;
11740     case 2: str = "Home MSC"; break;
11741     case 3: str = "Gateway MSC"; break;
11742     case 4: str = "HLR"; break;
11743     case 5: str = "VLR"; break;
11744     case 6: str = "EIR (reserved)"; break;
11745     case 7: str = "AC"; break;
11746     case 8: str = "Border MSC"; break;
11747     case 9: str = "Originating MSC"; break;
11748     default:
11749         if ((value >= 10) && (value <= 223)) { str = "Reserved, treat as Not specified"; }
11750         else { str = "Reserved for protocol extension, treat as Not specified"; }
11751         break;
11752     }
11753
11754     proto_tree_add_text(tree, asn1->tvb,
11755         saved_offset, asn1->offset - saved_offset,
11756         "Type (%u) %s",
11757         value,
11758         str);
11759
11760     asn1_int32_value_decode(asn1, 1, &b1);
11761     asn1_int32_value_decode(asn1, 1, &b2);
11762     asn1_int32_value_decode(asn1, 1, &b3);
11763     asn1_int32_value_decode(asn1, 1, &b4);
11764
11765     proto_tree_add_text(tree, asn1->tvb,
11766         saved_offset, asn1->offset - saved_offset,
11767         "Point Code %u-%u-%u  SSN %u",
11768         b3, b2, b1, b4);
11769 }
11770
11771 static void
11772 param_lai(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_, int string_len _U_)
11773 {
11774     gint32 value;
11775     guint saved_offset;
11776
11777     EXACT_DATA_CHECK(len, 2);
11778
11779     saved_offset = asn1->offset;
11780
11781     asn1_int32_value_decode(asn1, 2, &value);
11782
11783     proto_tree_add_text(tree, asn1->tvb,
11784         saved_offset, asn1->offset - saved_offset,
11785         "LAI %u (0x%04x)",
11786         value,
11787         value);
11788 }
11789
11790 static void
11791 param_list(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string, int string_len)
11792 {
11793     guint saved_offset;
11794     guint num_parms;
11795
11796     num_parms = 0;
11797     saved_offset = asn1->offset;
11798
11799     while (len > (asn1->offset - saved_offset))
11800     {
11801         num_parms++;
11802
11803         if (!dissect_ansi_param(asn1, tree))
11804         {
11805             proto_tree_add_text(tree,
11806                 asn1->tvb, asn1->offset, len - (asn1->offset - saved_offset),
11807                 "Unknown Parameter Data");
11808
11809             asn1->offset = saved_offset + len;
11810             break;
11811         }
11812     }
11813
11814     g_snprintf(add_string, string_len, " - (%u)", num_parms);
11815 }
11816
11817
11818 #define NUM_PARAM_1 (sizeof(ansi_param_1_strings)/sizeof(value_string))
11819 static gint ett_ansi_param_1[NUM_PARAM_1];
11820 static void (*param_1_fcn[])(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string, int string_len) = {
11821     param_bill_id,      /* Billing ID */
11822     param_int,  /* Serving Cell ID */
11823     param_int,  /* Target Cell ID */
11824     param_digits,       /* Digits */
11825     param_chan_data,    /* Channel Data */
11826     param_cic,  /* Inter MSC Circuit ID */
11827     param_int,  /* Inter Switch Count */
11828     param_min,  /* Mobile Identification Number */
11829     param_esn,  /* Electronic Serial Number */
11830     param_rel_reason,   /* Release Reason */
11831     param_sig_qual,     /* Signal Quality */
11832     param_scm,  /* Station Class Mark */
11833     param_auth_den,     /* Authorization Denied */
11834     param_auth_per,     /* Authorization Period */
11835     param_seizure,      /* Seizure Type */
11836     param_trunk_stat,   /* Trunk Status */
11837     param_qic,  /* Qualification Information Code */
11838     param_feat_result,  /* Feature Result */
11839     param_red_reason,   /* Redirection Reason */
11840     param_acc_den,      /* Access Denied Reason */
11841     param_mscid,        /* MSCID */
11842     param_sys_type_code,        /* System My Type Code */
11843     param_orig_ind,     /* Origination Indicator */
11844     param_term_res,     /* Termination Restriction Code */
11845     param_calling_feat_ind,     /* Calling Features Indicator */
11846     param_faulty,       /* Faulty Parameter */
11847     param_usage_ind,    /* Usage Indicator */
11848     param_tdma_chan_data,       /* TDMA Channel Data */
11849     param_tdma_call_mode,       /* TDMA Call Mode */
11850     param_ho_reason,    /* Handoff Reason */
11851     NULL,       /* NONE */
11852 };
11853
11854
11855 #define NUM_PARAM_2 (sizeof(ansi_param_2_strings)/sizeof(value_string))
11856 static gint ett_ansi_param_2[NUM_PARAM_2];
11857 static void (*param_2_fcn[])(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string, int string_len) = {
11858     param_tdma_burst_ind,       /* TDMA Burst Indicator */
11859     param_pc_ssn,       /* PC_SSN */
11860     param_lai,  /* Location Area ID */
11861     param_sys_acc_type, /* System Access Type */
11862     param_auth_resp_all,        /* Authentication Response */
11863     param_auth_resp_all,        /* Authentication Response Base Station */
11864     param_auth_resp_all,        /* Authentication Response Unique Challenge */
11865     param_int,  /* Call History Count */
11866     param_confid_mode,  /* Confidentiality Modes */
11867     param_int,  /* Random Variable */
11868     param_int,  /* Random Variable Base station */
11869     param_rand_ssd,     /* Random Variable SSD */
11870     param_rand_unique,  /* Random Variable Unique Challenge */
11871     param_report_type,  /* Report Type */
11872     param_sme_key,      /* Signaling Message Encryption Key */
11873     param_ssd,  /* Shared Secret Data */
11874     param_term_type,    /* Terminal Type */
11875     param_vpmask,       /* Voice Privacy Mask */
11876     param_sys_cap,      /* System Capabilities */
11877     param_deny_acc,     /* Deny Access */
11878     param_upd_count,    /* Update Count */
11879     param_ssd_no_share, /* SSD Not Shared */
11880     param_ext_mscid,    /* Extended MSCID */
11881     param_ext_sys_type_code,    /* Extended System My Type Code */
11882     param_ctrl_chan_data,       /* Control Channel Data */
11883     param_sys_acc_data, /* System Access Data */
11884     param_can_den,      /* Cancellation Denied */
11885     param_border_acc,   /* Border Cell Access */
11886     param_cdma_scm,     /* CDMA Station Class Mark */
11887     param_int,  /* CDMA Serving One Way Delay */
11888     param_int,  /* CDMA Target One Way Delay */
11889     param_cdma_call_mode,       /* CDMA Call Mode */
11890     param_cdma_chan_data,       /* CDMA Channel Data */
11891     param_cdma_sig_qual,        /* CDMA Signal Quality */
11892     param_cdma_pilot_strength,  /* CDMA Pilot Strength */
11893     param_mob_rev,      /* CDMA Mobile Protocol Revision */
11894     param_cdma_plcm,    /* CDMA Private Long Code Mask */
11895     param_cdma_code_chan,       /* CDMA Code Channel */
11896     param_cdma_sea_win, /* CDMA Search Window */
11897     param_ms_loc,       /* MS Location */
11898     param_page_ind,     /* Page Indicator */
11899     param_rec_sig_qual, /* Received Signal Quality */
11900     param_dereg,        /* Deregistration Type */
11901     param_namps_chan_data,      /* NAMPS Channel Data */
11902     param_alert_code,   /* Alert Code */
11903     param_ann_code,     /* Announcement Code */
11904     param_aav,  /* Authentication Algorithm Version */
11905     param_auth_cap,     /* Authentication Capability */
11906     param_int,  /* Call History Count Expected */
11907     param_digits,       /* Calling Party Number Digits 1 */
11908     param_digits,       /* Calling Party Number Digits 2 */
11909     param_digits,       /* Calling Party Number String 1 */
11910     param_digits,       /* Calling Party Number String 2 */
11911     param_sub_addr,     /* Calling Party Subaddress */
11912     param_can_type,     /* Cancellation Type */
11913     param_digits,       /* Carrier Digits */
11914     param_digits,       /* Destination Digits */
11915     param_dmh_red_ind,  /* DMH Redirection Indicator */
11916     param_list, /* Inter System Termination */
11917     param_avail_type,   /* Availability Type */
11918     param_list, /* Local Termination */
11919     param_mw_noti_count,        /* Message Waiting Notification Count */
11920     param_mdn,  /* Mobile Directory Number */
11921     param_digits,       /* MSCID Number */
11922     param_list, /* PSTN Termination */
11923     param_no_ans_time,  /* No Answer Time */
11924     param_otfi, /* One Time Feature Indicator */
11925     param_orig_trig,    /* Origination Triggers */
11926     param_randc,        /* RANDC */
11927     param_digits,       /* Redirecting Number Digits */
11928     param_digits,       /* Redirecting Number String */
11929     param_sub_addr,     /* Redirecting Number Subaddress */
11930     param_digits,       /* Sender Identification Number */
11931     param_digits,       /* SMS Address */
11932     param_sms_bd,       /* SMS Bearer Data */
11933     param_sms_charge_ind,       /* SMS Charge Indicator */
11934     param_digits,       /* SMS Destination Address */
11935     param_sms_msg_count,        /* SMS Message Count */
11936     param_sms_noti,     /* SMS Notification Indicator */
11937     param_digits,       /* SMS Original Destination Address */
11938     param_sub_addr,     /* SMS Original Destination Subaddress */
11939     param_digits,       /* SMS Original Originating Address */
11940     param_sub_addr,     /* SMS Original Originating Subaddress */
11941     param_digits,       /* SMS Originating Address */
11942     param_sms_orig_restric,     /* SMS Originating Restrictions */
11943     param_sms_tele,     /* SMS Teleservice Identifier */
11944     param_sms_term_restric,     /* SMS Termination Restrictions */
11945     NULL/* no data */,  /* SMS Message Waiting Indicator */
11946     param_term_acc_type,        /* Termination Access Type */
11947     param_list, /* Termination List */
11948     param_term_treat,   /* Termination Treatment */
11949     param_term_trig,    /* Termination Triggers */
11950     param_trans_cap,    /* Transaction Capability */
11951     param_unique_chal_rep,      /* Unique Challenge Report */
11952     NULL,       /* NONE */
11953 };
11954
11955
11956 #define NUM_PARAM_3 (sizeof(ansi_param_3_strings)/sizeof(value_string))
11957 static gint ett_ansi_param_3[NUM_PARAM_3];
11958 static void (*param_3_fcn[])(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string, int string_len) = {
11959     param_act_code,     /* Action Code */
11960     param_alert_res,    /* Alert Result */
11961     param_list, /* Announcement List */
11962     param_list, /* CDMA Code Channel Information */
11963     param_list, /* CDMA Code Channel List */
11964     param_list, /* CDMA Target Measurement Information */
11965     param_list, /* CDMA Target Measurement List */
11966     param_list, /* CDMA Target MAHO Information */
11967     param_list, /* CDMA Target MAHO List */
11968     param_conf_call_ind,        /* Conference Calling Indicator */
11969     param_count_upd_report,     /* Count Update Report */
11970     param_digit_collect_ctrl,   /* Digit Collection Control */
11971     param_digits,       /* DMH Account Code Digits */
11972     param_digits,       /* DMH Alternate Billing Digits */
11973     param_digits,       /* DMH Billing Digits */
11974     param_geo_auth,     /* Geographic Authorization */
11975     param_int,  /* Leg Information */
11976     param_mw_noti_type, /* Message Waiting Notification Type */
11977     param_paca_ind,     /* PACA Indicator */
11978     param_pref_lang_ind,        /* Preferred Language Indicator */
11979     param_rand_valtime, /* Random Valid Time */
11980     param_digits,       /* Restriction Digits */
11981     param_digits,       /* Routing Digits */
11982     param_setup_result, /* Setup Result */
11983     param_sms_acc_den_reason,   /* SMS Access Denied Reason */
11984     param_sms_cause,    /* SMS Cause Code */
11985     param_digits,       /* SPINI PIN */
11986     param_spini_trig,   /* SPINI Triggers */
11987     param_ssd_upd_report,       /* SSD Update Report */
11988     param_list, /* Target Measurement Information */
11989     param_list, /* Target Measurement List */
11990     param_digits,       /* Voice Mailbox PIN */
11991     param_digits,       /* Voice Mailbox Number */
11992     NULL/* no special handling */,      /* Authentication Data */
11993     param_cond_den_reason,      /* Conditionally Denied Reason */
11994     param_group_info,   /* Group Information */
11995     param_ho_state,     /* Handoff State */
11996     param_namps_call_mode,      /* NAMPS Call Mode */
11997     param_cdma_sci,     /* CDMA Slot Cycle Index */
11998     param_den_auth_per, /* Denied Authorization Period */
11999     param_digits,       /* Pilot Number */
12000     param_bill_id,      /* Pilot Billing ID */
12001     param_cdma_band_class,      /* CDMA Band Class */
12002     param_list, /* CDMA Band Class Information */
12003     param_list, /* CDMA Band Class List */
12004     param_cdma_pilot_pn,        /* CDMA Pilot PN */
12005     NULL/* no special handling */,      /* CDMA Service Configuration Record */
12006     param_cdma_so,      /* CDMA Service Option */
12007     param_list, /* CDMA Service Option List */
12008     param_cdma_scm2,    /* CDMA Station Class Mark 2 */
12009     param_tdma_sc,      /* TDMA Service Code */
12010     param_tdma_term_cap,        /* TDMA Terminal Capability */
12011     param_tdma_voice_coder,     /* TDMA Voice Coder */
12012     param_a_key_ver,    /* A-Key Protocol Version */
12013     NULL/* XXX what spec ? */,  /* Authentication Response Reauthentication */
12014     NULL/* no special handling */,      /* Base Station Partial Key */
12015     param_ms_min,       /* Mobile Station MIN */
12016     NULL/* no special handling */,      /* Mobile Station Partial Key */
12017     NULL/* no special handling */,      /* Modulus Value */
12018     param_new_min,      /* Newly Assigned MIN */
12019     param_ota_result_code,      /* OTASP Result Code */
12020     NULL/* no special handling */,      /* Primitive Value */
12021     NULL/* XXX what spec ? */,  /* Random Variable Reauthentication */
12022     NULL/* XXX what spec ? */,  /* Reauthentication Report */
12023     param_srvc_ind,     /* Service Indicator */
12024     param_sme_report,   /* Signaling Message Encryption Report */
12025     param_trn,  /* Temporary Reference Number */
12026     param_vp_report,    /* Voice Privacy Report */
12027     NULL/* XXX */,      /* Base Station Manufacturer Code */
12028     NULL/* XXX */,      /* BSMC Status */
12029     param_ctrl_chan_mode,       /* Control Channel Mode */
12030     NULL/* XXX */,      /* Non Public Data */
12031     NULL/* XXX */,      /* Paging Frame Class */
12032     NULL/* XXX */,      /* PSID RSID Information */
12033     NULL/* XXX */,      /* PSID RSID List */
12034     NULL/* XXX */,      /* Service Result */
12035     NULL/* XXX */,      /* SOC Status */
12036     NULL/* XXX */,      /* System Operator Code */
12037     NULL/* XXX */,      /* Target Cell ID List */
12038     NULL/* XXX */,      /* User Group */
12039     NULL/* XXX */,      /* User Zone Data */
12040     NULL/* no special handling */,      /* CDMA Connection Reference */
12041     param_list, /* CDMA Connection Reference Information */
12042     param_list, /* CDMA Connection Reference List */
12043     NULL/* XXX */,      /* CDMA State */
12044     param_change_srvc_attr,     /* Change Service Attributes */
12045     NULL/* no special handling */,      /* Data Key */
12046     param_dp_params,    /* Data Privacy Parameters */
12047     param_islp_info,    /* ISLP Information */
12048     param_reason_list,  /* Reason List */
12049     NULL/* XXX */,      /* Second Inter MSC Circuit ID */
12050     param_tdma_bandwidth,       /* TDMA Bandwidth */
12051     param_tdma_data_feat_ind,   /* TDMA Data Features Indicator */
12052     param_tdma_data_mode,       /* TDMA Data Mode */
12053     param_tdma_voice_mode,      /* TDMA Voice Mode */
12054     param_ana_red_info, /* Analog Redirect Info */
12055     param_list, /* Analog Redirect Record */
12056     param_cdma_chan_num,        /* CDMA Channel Number */
12057     param_list, /* CDMA Channel Number List */
12058     param_cdma_pci,     /* CDMA Power Combined Indicator */
12059     param_list, /* CDMA Redirect Record */
12060     param_cdma_sea_param,       /* CDMA Search Parameters */
12061     param_int,  /* CDMA Network Identification */
12062     param_network_tmsi, /* Network TMSI */
12063     param_int,  /* Network TMSI Expiration Time */
12064     param_network_tmsi, /* New Network TMSI */
12065     param_reqd_param_mask,      /* Required Parameters Mask */
12066     param_srvc_red_cause,       /* Service Redirection Cause */
12067     param_srvc_red_info,        /* Service Redirection Info */
12068     param_roaming_ind,  /* Roaming Indication */
12069     NULL/* XXX */,      /* Emergency Services Routing Digits */
12070     NULL/* XXX */,      /* Special Handling */
12071     param_imsi, /* International Mobile Subscriber Identity */
12072     param_calling_party_name,   /* Calling Party Name */
12073     param_dis_text,     /* Display Text */
12074     param_red_party_name,       /* Redirecting Party Name */
12075     param_srvc_id,      /* Service ID */
12076     param_all_or_none,  /* All Or None */
12077     param_change,       /* Change */
12078     param_list, /* Data Access Element */
12079     param_list, /* Data Access Element List */
12080     NULL/* no special handling */,      /* Data ID */
12081     NULL/* no special handling */,      /* Database Key */
12082     param_data_result,  /* Data Result */
12083     param_list, /* Data Update Result */
12084     param_list, /* Data Update Result List */
12085     NULL/* no special handling */,      /* Data Value */
12086     param_list, /* Execute Script */
12087     param_fail_cause,   /* Failure Cause */
12088     param_fail_type,    /* Failure Type */
12089     NULL/* no special handling */,      /* Global Title */
12090     param_list, /* Modification Request */
12091     param_list, /* Modification Request List */
12092     param_list, /* Modification Result List */
12093     NULL/* no special handling */,      /* Private Specialized Resource */
12094     NULL/* no special handling */,      /* Script Argument */
12095     NULL/* no special handling */,      /* Script Name */
12096     NULL/* no special handling */,      /* Script Result */
12097     param_list, /* Service Data Access Element */
12098     param_list, /* Service Data Access Element List */
12099     param_list, /* Service Data Result */
12100     param_list, /* Service Data Result List */
12101     param_special_rsc,  /* Specialized Resource */
12102     param_time_date_offset,     /* Time Date Offset */
12103     param_list, /* Trigger Address List */
12104     param_trig_cap,     /* Trigger Capability */
12105     param_list, /* Trigger List */
12106     param_trig_type,    /* Trigger Type */
12107     param_list, /* WIN Capability */
12108     param_win_op_cap,   /* WIN Operations Capability */
12109     param_win_trig_list,        /* WIN Trigger List */
12110     param_digits,       /* MSC Address */
12111     param_sus_acc,      /* Suspicious Access */
12112     param_imsi, /* Mobile Station IMSI */
12113     param_imsi, /* Newly Assigned IMSI */
12114     NULL/* XXX what spec ? */,  /* Command Code */
12115     param_dis_text2,    /* Display Text 2 */
12116     NULL/* XXX what spec ? */,  /* Page Count */
12117     NULL/* XXX what spec ? */,  /* Page Response Time */
12118     NULL/* XXX what spec ? */,  /* SMS Transaction ID */
12119     NULL/* XXX what spec ? */,  /* CAVE Key */
12120     NULL/* XXX what spec ? */,  /* CDMA2000 Mobile Supported Capabilities */
12121     NULL/* XXX what spec ? */,  /* Enhanced Privacy Encryption Report */
12122     param_inter_msg_time,       /* Inter Message Time */
12123     param_msid_usage,   /* MSID Usage */
12124     param_new_min_ext,  /* New MIN Extension */
12125     param_qos_pri,      /* QoS Priority */
12126     param_cdma_ms_meas_chan_id, /* CDMA MS Measured Channel Identity */
12127     param_cdma2000_ho_ivk_ios,  /* CDMA2000 Handoff Invoke IOS Data */
12128     param_cdma2000_ho_rsp_ios,  /* CDMA2000 Handoff Response IOS Data */
12129     NULL/* XXX */,      /* MIN Extension */
12130
12131     param_list, /* Call Recovery ID */
12132     param_list, /* Call Recovery ID List */
12133     param_list, /* Position Information */
12134     param_list, /* CDMA PSMM List */
12135     param_resume_pic,   /* Resume PIC */
12136     param_dmh_srvc_id,  /* DMH Service ID */
12137     param_feat_ind,     /* Feature Indicator */
12138     param_mscid,        /* Control Network ID */
12139     param_rel_cause,    /* Release Cause */
12140     param_time_day,     /* Time Of Day */
12141     param_call_status,  /* Call Status */
12142     NULL/* no special handling */,      /* DMH Charge Information */
12143     NULL/* no special handling */,      /* DMH Billing Indicator */
12144     param_ms_status,    /* MS Status */
12145     param_pos_info_code,        /* Position Information Code */
12146     param_dtx_ind,      /* DTX Indication */
12147     param_cdma_mob_cap, /* CDMA Mobile Capabilities */
12148     param_gen_time,     /* Generalized Time */
12149     param_digits,       /* Generic Digits */
12150     param_geo_pos,      /* Geographic Position */
12151     param_mob_call_status,      /* Mobile Call Status */
12152     param_mob_cap,      /* Mobile Position Capability */
12153     param_pos_req_type, /* Position Request Type */
12154     param_pos_result,   /* Position Result */
12155     param_pos_source,   /* Position Source */
12156     param_acg_encounter,        /* ACG Encountered */
12157     param_ctrl_type,    /* Control Type */
12158     param_gap_duration, /* Gap Duration */
12159     param_scf_overload_gap_int, /* SCF Overload Gap Interval */
12160     param_sm_gap_int,   /* Service Management System Gap Interval */
12161     param_cdma_psmm_count,      /* CDMA PSMM Count */
12162     param_cdma_sowd2,   /* CDMA Serving One Way Delay 2 */
12163     NULL/* no special handling */,      /* PDSN Address */
12164     NULL/* no special handling */,      /* PDSN Protocol Type */
12165     NULL/* no special handling */,      /* Range */
12166     param_calling_party_cat,    /* Calling Party Category */
12167     param_digits,       /* LCS Client ID */
12168     param_tdma_maho_cell_id,    /* TDMA MAHO Cell ID */
12169     param_tdma_maho_chan,       /* TDMA MAHO Channel */
12170     param_cdma_soci,    /* CDMA Service Option Connection Identifier */
12171     param_tdma_time_align,      /* TDMA Time Alignment */
12172     param_tdma_maho_req,        /* TDMA MAHO Request */
12173     NULL,       /* NONE */
12174 };
12175
12176 /* GENERIC MAP DISSECTOR FUNCTIONS */
12177
12178 static void
12179 dissect_ansi_map_len(ASN1_SCK *asn1, proto_tree *tree, gboolean *def_len, guint *len)
12180 {
12181     guint       saved_offset;
12182     int         ret;
12183
12184
12185     saved_offset = asn1->offset;
12186     *def_len = FALSE;
12187     *len = 0;
12188
12189     ret = asn1_length_decode(asn1, def_len, len);
12190
12191     if (*def_len)
12192     {
12193         proto_tree_add_uint(tree, hf_ansi_map_length, asn1->tvb,
12194             saved_offset, asn1->offset - saved_offset,
12195             *len);
12196     }
12197     else
12198     {
12199         proto_tree_add_text(tree, asn1->tvb,
12200             saved_offset, asn1->offset - saved_offset,
12201             "Length: Indefinite");
12202     }
12203
12204 }
12205
12206 static gboolean
12207 check_ansi_map_tag(ASN1_SCK *asn1, guint tag)
12208 {
12209     guint saved_offset, real_tag;
12210
12211
12212     saved_offset = asn1->offset;
12213
12214     asn1_id_decode1(asn1, &real_tag);
12215
12216     asn1->offset = saved_offset;
12217
12218     return(tag == real_tag);
12219 }
12220
12221 static void
12222 dissect_ansi_map_octet(ASN1_SCK *asn1, proto_tree *tree, const guchar * str)
12223 {
12224     guint saved_offset;
12225     guchar my_oct;
12226
12227
12228     saved_offset = asn1->offset;
12229
12230     asn1_octet_decode(asn1, &my_oct);
12231
12232     proto_tree_add_uint_format(tree, hf_ansi_map_id, asn1->tvb,
12233         saved_offset, asn1->offset - saved_offset, my_oct,
12234         "%s %u",
12235         str, my_oct);
12236 }
12237
12238 static proto_tree *
12239 dissect_ansi_map_component(ASN1_SCK *asn1, proto_tree *tree, guint *len_p)
12240 {
12241     guint saved_offset;
12242     guint tag;
12243     proto_item *item;
12244     proto_tree *subtree;
12245     gboolean def_len;
12246
12247
12248     saved_offset = asn1->offset;
12249     asn1_id_decode1(asn1, &tag);
12250
12251     item =
12252         proto_tree_add_text(tree, asn1->tvb,
12253             saved_offset, -1, "Component ID");
12254
12255     subtree = proto_item_add_subtree(item, ett_component);
12256
12257     proto_tree_add_uint_format(subtree, hf_ansi_map_tag, asn1->tvb,
12258         saved_offset, asn1->offset - saved_offset, tag,
12259         "Component ID Identifier");
12260
12261     dissect_ansi_map_len(asn1, subtree, &def_len, len_p);
12262
12263     if ((gint) (asn1->offset - saved_offset + *len_p) < 0)
12264         THROW (ReportedBoundsError);
12265
12266     proto_item_set_len(item, (asn1->offset - saved_offset) + *len_p);
12267
12268     return(subtree);
12269 }
12270
12271 static void
12272 dissect_ansi_opr_code(ASN1_SCK *asn1, packet_info *pinfo, proto_tree *tree, gint32 *opr_code_p)
12273 {
12274     guint saved_offset = 0;
12275     guint len;
12276     guint tag;
12277     gint32 val;
12278     const gchar *str = NULL;
12279     guchar my_oct;
12280     proto_item *item;
12281     proto_tree *subtree;
12282     gboolean def_len;
12283
12284
12285     *opr_code_p = -1;
12286
12287 #define TCAP_NAT_OPR_CODE_TAG 0xd0
12288     if (check_ansi_map_tag(asn1, TCAP_NAT_OPR_CODE_TAG))
12289     {
12290         str = "National TCAP Operation Code Identifier";
12291     }
12292 #define TCAP_PRIV_OPR_CODE_TAG 0xd1
12293     else if (check_ansi_map_tag(asn1, TCAP_PRIV_OPR_CODE_TAG))
12294     {
12295         str = "Private TCAP Operation Code Identifier";
12296     }
12297     else
12298     {
12299         proto_tree_add_text(tree, asn1->tvb,
12300             asn1->offset, -1, "Unexpected tag, not National or Private TCAP Operation Code");
12301         return;
12302     }
12303
12304     saved_offset = asn1->offset;
12305     asn1_id_decode1(asn1, &tag);
12306
12307     item =
12308         proto_tree_add_text(tree, asn1->tvb,
12309             saved_offset, -1, "Operation Code");
12310
12311     subtree = proto_item_add_subtree(item, ett_opr_code);
12312
12313     proto_tree_add_uint_format(subtree, hf_ansi_map_tag, asn1->tvb,
12314         saved_offset, asn1->offset - saved_offset, tag, str);
12315
12316     dissect_ansi_map_len(asn1, subtree, &def_len, &len);
12317
12318     if ((gint) (asn1->offset - saved_offset + len) < 0)
12319         THROW (ReportedBoundsError);
12320
12321     proto_item_set_len(item, (asn1->offset - saved_offset) + len);
12322
12323     if (len > 0)
12324     {
12325         saved_offset = asn1->offset;
12326         asn1_octet_decode(asn1, &my_oct);
12327
12328 #define ANSI_MAP_OPR_FAMILY 0x09
12329         if (my_oct != ANSI_MAP_OPR_FAMILY)
12330         {
12331             asn1->offset = saved_offset;
12332             return;
12333         }
12334
12335         proto_tree_add_text(subtree, asn1->tvb,
12336             saved_offset, 1, "Operation Code Family");
12337
12338         saved_offset = asn1->offset;
12339         asn1_int32_value_decode(asn1, len-1, &val);
12340         proto_tree_add_int(subtree, hf_ansi_map_opr_code, asn1->tvb,
12341             saved_offset, asn1->offset - saved_offset, val);
12342
12343         str = match_strval(val, ansi_map_opr_code_strings);
12344
12345         if (NULL == str) return;
12346
12347         *opr_code_p = val;
12348
12349         if (check_col(pinfo->cinfo, COL_INFO))
12350         {
12351             col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", str);
12352         }
12353     }
12354 }
12355
12356 static void
12357 dissect_ansi_problem(ASN1_SCK *asn1, proto_tree *tree)
12358 {
12359     guint saved_offset = 0;
12360     guint len;
12361     guint tag;
12362     proto_tree *subtree;
12363     proto_item *item = NULL;
12364     const gchar *str = NULL;
12365     const gchar *type_str = NULL;
12366     gint32 type, spec;
12367     gboolean def_len;
12368
12369
12370 #define TCAP_PROB_CODE_TAG 0xd5
12371     if (check_ansi_map_tag(asn1, TCAP_PROB_CODE_TAG))
12372     {
12373         str = "Problem Code Identifier";
12374     }
12375     else
12376     {
12377         /* XXX */
12378         return;
12379     }
12380
12381     saved_offset = asn1->offset;
12382     asn1_id_decode1(asn1, &tag);
12383
12384     item =
12385         proto_tree_add_text(tree, asn1->tvb,
12386             saved_offset, -1, "Problem Code");
12387
12388     subtree = proto_item_add_subtree(item, ett_problem);
12389
12390     proto_tree_add_uint_format(subtree, hf_ansi_map_tag, asn1->tvb,
12391         saved_offset, asn1->offset - saved_offset, tag, str);
12392
12393     dissect_ansi_map_len(asn1, subtree, &def_len, &len);
12394
12395     if ((gint) (asn1->offset - saved_offset + len) < 0)
12396         THROW (ReportedBoundsError);
12397
12398     proto_item_set_len(item, (asn1->offset - saved_offset) + len);
12399
12400     if (len != 2)
12401     {
12402         proto_tree_add_text(subtree, asn1->tvb,
12403             asn1->offset, len, "Unknown encoding of Problem Code");
12404
12405         asn1->offset += len;
12406         return;
12407     }
12408
12409     saved_offset = asn1->offset;
12410     asn1_int32_value_decode(asn1, 1, &type);
12411     asn1_int32_value_decode(asn1, 1, &spec);
12412
12413     switch (type)
12414     {
12415     case 0: type_str = "Not used"; break;
12416
12417     case 1:
12418         type_str = "General";
12419         switch (spec)
12420         {
12421         case 1: str = "Unrecognized Component Type"; break;
12422         case 2: str = "Incorrect Component Portion"; break;
12423         case 3: str = "Badly Structured Component Portion"; break;
12424         default:
12425             str = "Undefined";
12426             break;
12427         }
12428         break;
12429
12430     case 2:
12431         type_str = "Invoke";
12432         switch (spec)
12433         {
12434         case 1: str = "Duplicate Invoke ID"; break;
12435         case 2: str = "Unrecognized Operation Code"; break;
12436         case 3: str = "Incorrect Parameter"; break;
12437         case 4: str = "Unrecognized Correlation ID"; break;
12438         default:
12439             str = "Undefined";
12440             break;
12441         }
12442         break;
12443
12444     case 3:
12445         type_str = "Return Result";
12446         switch (spec)
12447         {
12448         case 1: str = "Unrecognized Correlation ID"; break;
12449         case 2: str = "Unexpected Return Result"; break;
12450         case 3: str = "Incorrect Parameter"; break;
12451         default:
12452             str = "Undefined";
12453             break;
12454         }
12455         break;
12456
12457     case 4:
12458         type_str = "Return Error";
12459         switch (spec)
12460         {
12461         case 1: str = "Unrecognized Correlation ID"; break;
12462         case 2: str = "Unexpected Return Error"; break;
12463         case 3: str = "Unrecognized Error"; break;
12464         case 4: str = "Unexpected Error"; break;
12465         case 5: str = "Incorrect Parameter"; break;
12466         default:
12467             str = "Undefined";
12468             break;
12469         }
12470         break;
12471
12472     case 5:
12473         type_str = "Transaction Portion";
12474         switch (spec)
12475         {
12476         case 1: str = "Unrecognized Package Type"; break;
12477         case 2: str = "Incorrect Transaction Portion"; break;
12478         case 3: str = "Badly Structured Transaction Portion"; break;
12479         case 4: str = "Unrecognized Transaction ID"; break;
12480         case 5: str = "Permission to Release"; break;
12481         case 6: str = "Resource Unavailable"; break;
12482         default:
12483             str = "Undefined";
12484             break;
12485         }
12486         break;
12487
12488     default:
12489         type_str = "Undefined";
12490         break;
12491     }
12492
12493     if (spec == 255) { str = "Reserved"; }
12494     else if (spec == 0) { str = "Not used"; }
12495
12496     proto_tree_add_text(subtree, asn1->tvb,
12497         saved_offset, 1, "Problem Type %s", type_str);
12498
12499     proto_tree_add_text(subtree, asn1->tvb,
12500         saved_offset + 1, 1, "Problem Specifier %s", str);
12501 }
12502
12503 static void
12504 dissect_ansi_error(ASN1_SCK *asn1, proto_tree *tree)
12505 {
12506     guint saved_offset = 0;
12507     guint len;
12508     guint tag;
12509     gint32 value;
12510     proto_tree *subtree;
12511     proto_item *item = NULL;
12512     const gchar *str = NULL;
12513     gboolean def_len;
12514
12515
12516 #define TCAP_NAT_ERR_CODE_TAG 0xd3
12517     if (check_ansi_map_tag(asn1, TCAP_NAT_ERR_CODE_TAG))
12518     {
12519         str = "National TCAP Error Code Identifier";
12520     }
12521 #define TCAP_PRIV_ERR_CODE_TAG 0xd4
12522     else if (check_ansi_map_tag(asn1, TCAP_PRIV_ERR_CODE_TAG))
12523     {
12524         str = "Private TCAP Error Code Identifier";
12525     }
12526     else
12527     {
12528         /* XXX */
12529         return;
12530     }
12531
12532     saved_offset = asn1->offset;
12533     asn1_id_decode1(asn1, &tag);
12534
12535     item =
12536         proto_tree_add_text(tree, asn1->tvb,
12537             saved_offset, -1, "TCAP Error Code");
12538
12539     subtree = proto_item_add_subtree(item, ett_error);
12540
12541     proto_tree_add_uint_format(subtree, hf_ansi_map_tag, asn1->tvb,
12542         saved_offset, asn1->offset - saved_offset, tag, str);
12543
12544     dissect_ansi_map_len(asn1, subtree, &def_len, &len);
12545
12546     if ((gint) (asn1->offset - saved_offset + len) < 0)
12547         THROW (ReportedBoundsError);
12548
12549     proto_item_set_len(item, (asn1->offset - saved_offset) + len);
12550
12551     if ((tag == TCAP_PRIV_ERR_CODE_TAG) &&
12552         (len == 1))
12553     {
12554         saved_offset = asn1->offset;
12555         asn1_int32_value_decode(asn1, 1, &value);
12556
12557         switch (value)
12558         {
12559         case 0x81: str = "Unrecognized MIN"; break;
12560         case 0x82: str = "Unrecognized ESN"; break;
12561         case 0x83: str = "MIN/HLR Mismatch"; break;
12562         case 0x84: str = "Operation Sequence Problem"; break;
12563         case 0x85: str = "Resource Shortage"; break;
12564         case 0x86: str = "Operation Not Supported"; break;
12565         case 0x87: str = "Trunk Unavailable"; break;
12566         case 0x88: str = "Parameter Error"; break;
12567         case 0x89: str = "System Failure"; break;
12568         case 0x8a: str = "Unrecognized Parameter Value"; break;
12569         case 0x8b: str = "Feature Inactive"; break;
12570         case 0x8c: str = "Missing Parameter"; break;
12571         default:
12572             if ((value >= 0xe0) && (value <= 0xff)) { str = "Reserved for protocol extension"; }
12573             else { str = "Reserved"; }
12574             break;
12575         }
12576
12577         proto_tree_add_text(subtree, asn1->tvb,
12578             saved_offset, 1, str);
12579     }
12580     else
12581     {
12582         proto_tree_add_text(subtree, asn1->tvb,
12583             asn1->offset, len, "Error Code");
12584
12585         asn1->offset += len;
12586     }
12587 }
12588
12589
12590 static gboolean
12591 dissect_ansi_param(ASN1_SCK *asn1, proto_tree *tree)
12592 {
12593     void (*param_fcn)(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string, int string_len) = NULL;
12594     guint saved_offset = 0;
12595     guint len;
12596     proto_tree *subtree;
12597     proto_item *item;
12598     guint val;
12599     const gchar *str = NULL;
12600     gint ett_param_idx, idx;
12601     gboolean def_len;
12602
12603
12604     saved_offset = asn1->offset;
12605
12606     asn1_uint32_value_decode(asn1, 1, &val);
12607     str = match_strval_idx((guint32) val, ansi_param_1_strings, &idx);
12608
12609     if (NULL == str)
12610     {
12611         asn1->offset = saved_offset;
12612         asn1_uint32_value_decode(asn1, 2, &val);
12613
12614         str = match_strval_idx((guint32) val, ansi_param_2_strings, &idx);
12615
12616         if (NULL == str)
12617         {
12618             asn1->offset = saved_offset;
12619             asn1_int32_value_decode(asn1, 3, &val);
12620
12621             str = match_strval_idx((guint32) val, ansi_param_3_strings, &idx);
12622
12623             if (NULL == str)
12624             {
12625                 if (((val >= 0x9FFF00) && (val <= 0x9FFF7F)) ||
12626                     ((val >= 0xBFFF00) && (val <= 0xBFFF7F)))
12627                 {
12628                     str = "Reserved for protocol extension";
12629                 }
12630                 else if (((val >= 0x9FFE76) && (val <= 0x9FFE7F)) ||
12631                     ((val >= 0xBFFE76) && (val <= 0xBFFE7F)))
12632                 {
12633                     str = "Reserved for National Network Use";
12634                 }
12635                 else
12636                 {
12637                     str = "Unknown Parameter Data";
12638                     param_fcn = NULL;
12639                 }
12640
12641                 ett_param_idx = ett_param;
12642             }
12643             else
12644             {
12645                 ett_param_idx = ett_ansi_param_3[idx];
12646                 param_fcn = param_3_fcn[idx];
12647             }
12648         }
12649         else
12650         {
12651             ett_param_idx = ett_ansi_param_2[idx];
12652             param_fcn = param_2_fcn[idx];
12653         }
12654     }
12655     else
12656     {
12657         ett_param_idx = ett_ansi_param_1[idx];
12658         param_fcn = param_1_fcn[idx];
12659     }
12660
12661     item =
12662         proto_tree_add_text(tree, asn1->tvb,
12663             saved_offset, -1, str);
12664
12665     subtree = proto_item_add_subtree(item, ett_param_idx);
12666
12667     proto_tree_add_uint_format(subtree, hf_ansi_map_param_id, asn1->tvb,
12668         saved_offset, asn1->offset - saved_offset, val, "Parameter ID");
12669
12670     dissect_ansi_map_len(asn1, subtree, &def_len, &len);
12671
12672     if ((gint) (asn1->offset - saved_offset + len) < 0)
12673         THROW (ReportedBoundsError);
12674
12675     proto_item_set_len(item, asn1->offset - saved_offset + len);
12676
12677     if (len > 0)
12678     {
12679         if (param_fcn == NULL)
12680         {
12681             proto_tree_add_text(subtree, asn1->tvb,
12682                 asn1->offset, len, "Parameter Data");
12683             asn1->offset += len;
12684         }
12685         else
12686         {
12687             gchar *ansi_map_add_string;
12688
12689             ansi_map_add_string=ep_alloc(1024);
12690             ansi_map_add_string[0] = '\0';
12691
12692             (*param_fcn)(asn1, subtree, len, ansi_map_add_string, 1024);
12693
12694             if (ansi_map_add_string[0] != '\0')
12695             {
12696                 proto_item_append_text(item, ansi_map_add_string);
12697             }
12698         }
12699     }
12700
12701     return(TRUE);
12702 }
12703
12704
12705 static void
12706 dissect_ansi_params(ASN1_SCK *asn1, proto_tree *tree)
12707 {
12708     guint saved_offset = 0;
12709     guint len;
12710     guint tag;
12711     proto_tree *subtree;
12712     proto_item *item = NULL;
12713     const gchar *str = NULL;
12714     gboolean def_len;
12715     gchar *ansi_map_add_string;
12716
12717 #define TCAP_PARAM_SET_TAG 0xf2
12718     if (check_ansi_map_tag(asn1, TCAP_PARAM_SET_TAG))
12719     {
12720         str = "Parameter Set Identifier";
12721     }
12722 #define TCAP_PARAM_SEQ_TAG 0x30
12723     else if (check_ansi_map_tag(asn1, TCAP_PARAM_SEQ_TAG))
12724     {
12725         str = "Parameter Sequence Identifier";
12726     }
12727     else
12728     {
12729         /* XXX */
12730         return;
12731     }
12732
12733     saved_offset = asn1->offset;
12734     asn1_id_decode1(asn1, &tag);
12735
12736     item =
12737         proto_tree_add_text(tree, asn1->tvb,
12738             saved_offset, -1, "Parameters");
12739
12740     subtree = proto_item_add_subtree(item, ett_params);
12741
12742     proto_tree_add_uint_format(subtree, hf_ansi_map_tag, asn1->tvb,
12743         saved_offset, asn1->offset - saved_offset, tag, str);
12744
12745     dissect_ansi_map_len(asn1, subtree, &def_len, &len);
12746
12747     if ((gint) (asn1->offset - saved_offset + len) < 0)
12748         THROW (ReportedBoundsError);
12749
12750     proto_item_set_len(item, (asn1->offset - saved_offset) + len);
12751
12752     ansi_map_add_string = ep_alloc(1024);
12753     ansi_map_add_string[0] = '\0';
12754
12755     param_list(asn1, subtree, len, ansi_map_add_string, 1024);
12756
12757     if (ansi_map_add_string[0] != '\0')
12758     {
12759         proto_item_append_text(item, ansi_map_add_string);
12760     }
12761 }
12762
12763 static void
12764 dissect_ansi_map_reject(ASN1_SCK *asn1, proto_tree *tree)
12765 {
12766     guint len;
12767     proto_tree *subtree;
12768
12769 #define COMPONENT_ID_TAG 0xcf
12770     if (check_ansi_map_tag(asn1, COMPONENT_ID_TAG))
12771     {
12772         subtree = dissect_ansi_map_component(asn1, tree, &len);
12773
12774         switch (len)
12775         {
12776         case 1:
12777             dissect_ansi_map_octet(asn1, subtree, "Correlation ID:");
12778             break;
12779         }
12780     }
12781
12782     dissect_ansi_problem(asn1, tree);
12783
12784     dissect_ansi_params(asn1, tree);
12785 }
12786
12787 static void
12788 dissect_ansi_map_re(ASN1_SCK *asn1, proto_tree *tree)
12789 {
12790     guint len;
12791     proto_tree *subtree;
12792
12793 #define COMPONENT_ID_TAG 0xcf
12794     if (check_ansi_map_tag(asn1, COMPONENT_ID_TAG))
12795     {
12796         subtree = dissect_ansi_map_component(asn1, tree, &len);
12797
12798         switch (len)
12799         {
12800         case 1:
12801             dissect_ansi_map_octet(asn1, subtree, "Correlation ID:");
12802             break;
12803         }
12804     }
12805
12806     dissect_ansi_error(asn1, tree);
12807
12808     dissect_ansi_params(asn1, tree);
12809 }
12810
12811 static void
12812 dissect_ansi_map_rr(ASN1_SCK *asn1, proto_tree *tree)
12813 {
12814     guint len;
12815     proto_tree *subtree;
12816
12817 #define COMPONENT_ID_TAG 0xcf
12818     if (check_ansi_map_tag(asn1, COMPONENT_ID_TAG))
12819     {
12820         subtree = dissect_ansi_map_component(asn1, tree, &len);
12821
12822         switch (len)
12823         {
12824         case 1:
12825             dissect_ansi_map_octet(asn1, subtree, "Correlation ID:");
12826             break;
12827         }
12828     }
12829
12830     dissect_ansi_params(asn1, tree);
12831 }
12832
12833 static void
12834 dissect_ansi_map_invoke(ASN1_SCK *asn1, packet_info *pinfo, proto_tree *tree, gint *opr_code_p)
12835 {
12836     guint len;
12837     proto_tree *subtree;
12838
12839 #define COMPONENT_ID_TAG 0xcf
12840     if (check_ansi_map_tag(asn1, COMPONENT_ID_TAG))
12841     {
12842         subtree = dissect_ansi_map_component(asn1, tree, &len);
12843
12844         switch (len)
12845         {
12846         case 1:
12847             dissect_ansi_map_octet(asn1, subtree, "Invoke ID:");
12848             break;
12849
12850         case 2:
12851             dissect_ansi_map_octet(asn1, subtree, "Invoke ID:");
12852             dissect_ansi_map_octet(asn1, subtree, "Correlation ID:");
12853             break;
12854         }
12855     }
12856
12857     ansi_map_is_invoke = TRUE;
12858
12859     dissect_ansi_opr_code(asn1, pinfo, tree, opr_code_p);
12860
12861     dissect_ansi_params(asn1, tree);
12862 }
12863
12864 static void
12865 dissect_ansi_map_message(ASN1_SCK *asn1, packet_info *pinfo, proto_tree *ansi_map_tree)
12866 {
12867     static ansi_map_tap_rec_t tap_rec;
12868     guint       saved_offset;
12869     guint       tag;
12870     guint       len;
12871     const gchar *str = NULL;
12872     proto_item *item, *tag_item;
12873     proto_tree *subtree, *tag_subtree;
12874     gboolean def_len;
12875     static int  i = 0;
12876     gint opr_code;
12877
12878
12879     saved_offset = asn1->offset;
12880     asn1_id_decode1(asn1, &tag);
12881
12882     str = match_strval(tag, ansi_cmp_type_strings);
12883
12884     if (NULL == str) return;
12885
12886     if (check_col(pinfo->cinfo, COL_INFO))
12887     {
12888         if (0 == i)
12889         {
12890             col_append_fstr(pinfo->cinfo, COL_INFO,  "%s ", str);
12891         }
12892         else
12893         {
12894             col_append_fstr(pinfo->cinfo, COL_INFO,  "& %s ", str);
12895         }
12896     }
12897
12898     item =
12899         proto_tree_add_text(ansi_map_tree, asn1->tvb,
12900             saved_offset, -1, "Components");
12901     subtree = proto_item_add_subtree(item, ett_components);
12902
12903     tag_item =
12904         proto_tree_add_uint_format(subtree, hf_ansi_map_tag, asn1->tvb,
12905             saved_offset, asn1->offset - saved_offset, tag, str);
12906
12907     dissect_ansi_map_len(asn1, subtree, &def_len, &len);
12908
12909     tag_subtree = proto_item_add_subtree(tag_item, ett_components);
12910
12911     opr_code = -1;
12912
12913     switch (tag)
12914     {
12915     case ANSI_TC_INVOKE_L:
12916         dissect_ansi_map_invoke(asn1, pinfo, tag_subtree, &opr_code);
12917         break;
12918
12919     case ANSI_TC_RRL:
12920         dissect_ansi_map_rr(asn1, tag_subtree);
12921         break;
12922
12923     case ANSI_TC_RE:
12924         dissect_ansi_map_re(asn1, tag_subtree);
12925         break;
12926
12927     case ANSI_TC_REJECT:
12928         dissect_ansi_map_reject(asn1, tag_subtree);
12929         break;
12930
12931     case ANSI_TC_INVOKE_N:
12932         dissect_ansi_map_invoke(asn1, pinfo, tag_subtree, &opr_code);
12933         break;
12934
12935     case ANSI_TC_RRN:
12936         dissect_ansi_map_rr(asn1, tag_subtree);
12937         break;
12938
12939     default:
12940         /* XXX */
12941         break;
12942     }
12943
12944     if (bd_tvb != NULL)
12945     {
12946         if (ansi_map_sms_tele_id != -1)
12947         {
12948             dissector_try_port(is637_tele_id_dissector_table, ansi_map_sms_tele_id, bd_tvb, g_pinfo, g_tree);
12949             ansi_map_sms_tele_id = -1;
12950         }
12951         else if (is683_ota)
12952         {
12953             dissector_try_port(is683_dissector_table, ansi_map_is_invoke ? 0 : 1, bd_tvb, g_pinfo, g_tree);
12954         }
12955         else if (is801_pld)
12956         {
12957             dissector_try_port(is801_dissector_table, ansi_map_is_invoke ? 0 : 1, bd_tvb, g_pinfo, g_tree);
12958         }
12959     }
12960
12961     proto_item_set_len(item, asn1->offset - saved_offset);
12962
12963     if (opr_code != -1)
12964     {
12965         tap_rec.message_type = opr_code;
12966         tap_rec.size = asn1->offset - saved_offset;
12967
12968         tap_queue_packet(ansi_map_tap, pinfo, &tap_rec);
12969     }
12970 }
12971
12972 static void
12973 dissect_ansi_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
12974 {
12975     proto_item *ansi_map_item;
12976     proto_tree *ansi_map_tree = NULL;
12977     ASN1_SCK   asn1;
12978     int        offset = 0;
12979
12980     g_pinfo = pinfo;
12981
12982     /*
12983      * Make entry in the Protocol column on summary display
12984      */
12985     if (check_col(pinfo->cinfo, COL_PROTOCOL))
12986     {
12987         col_set_str(pinfo->cinfo, COL_PROTOCOL, "ANSI MAP");
12988     }
12989
12990     /* In the interest of speed, if "tree" is NULL, don't do any work not
12991      * necessary to generate protocol tree items.
12992      */
12993     if (tree)
12994     {
12995         g_tree = tree;
12996
12997         /*
12998          * create the ansi_map protocol tree
12999          */
13000         ansi_map_item =
13001             proto_tree_add_item(tree, proto_ansi_map, tvb, 0, -1, FALSE);
13002
13003         ansi_map_tree =
13004             proto_item_add_subtree(ansi_map_item, ett_ansi_map);
13005
13006         asn1_open(&asn1, tvb, offset);
13007
13008         ansi_map_is_invoke = FALSE;
13009         is683_ota = FALSE;
13010         is801_pld = FALSE;
13011         bd_tvb = NULL;
13012         dissect_ansi_map_message(&asn1, pinfo, ansi_map_tree);
13013
13014         asn1_close(&asn1, &offset);
13015     }
13016 }
13017
13018
13019 /* Register the protocol with Ethereal */
13020 void
13021 proto_register_ansi_map(void)
13022 {
13023     guint               i;
13024     gint                last_offset;
13025
13026     /* Setup list of header fields */
13027     static hf_register_info hf[] =
13028     {
13029         { &hf_ansi_map_tag,
13030             { "Tag",            "ansi_map.tag",
13031             FT_UINT8, BASE_HEX, NULL, 0,
13032             "", HFILL }
13033         },
13034         { &hf_ansi_map_length,
13035             { "Length",         "ansi_map.len",
13036             FT_UINT8, BASE_DEC, NULL, 0,
13037             "", HFILL }
13038         },
13039         { &hf_ansi_map_id,
13040             { "Value",          "ansi_map.id",
13041             FT_UINT8, BASE_DEC, NULL, 0,
13042             "", HFILL }
13043         },
13044         { &hf_ansi_map_opr_code,
13045             { "Operation Code", "ansi_map.oprcode",
13046             FT_INT32, BASE_DEC, VALS(ansi_map_opr_code_strings), 0,
13047             "", HFILL }
13048         },
13049         { &hf_ansi_map_param_id,
13050             { "Param ID",       "ansi_map.param_id",
13051             FT_UINT32, BASE_HEX, NULL, 0,
13052             "", HFILL }
13053         },
13054         { &hf_ansi_map_billing_id,
13055             { "Billing ID",     "ansi_map.billing_id",
13056             FT_INT32, BASE_DEC, NULL, 0,
13057             "", HFILL }
13058         },
13059         { &hf_ansi_map_ios401_elem_id,
13060             { "IOS 4.0.1 Element ID",   "ansi_map.ios401_elem_id",
13061             FT_NONE, 0, NULL, 0,
13062             "", HFILL }
13063         },
13064         { &hf_ansi_map_min,
13065             { "MIN",            "ansi_map.min",
13066             FT_STRING, BASE_DEC, 0, 0,
13067             "", HFILL }
13068         },
13069         { &hf_ansi_map_number,
13070             { "Number",         "ansi_map.number",
13071             FT_STRING, BASE_DEC, 0, 0,
13072             "", HFILL }
13073         },
13074     };
13075
13076     /* Setup protocol subtree array */
13077 #define NUM_INDIVIDUAL_PARAMS   15
13078     gint *ett[NUM_INDIVIDUAL_PARAMS+NUM_PARAM_1+NUM_PARAM_2+NUM_PARAM_3+NUM_IOS401_ELEM];
13079
13080     memset((void *) ett, -1, sizeof(ett));
13081
13082     ett[0] = &ett_ansi_map;
13083     ett[1] = &ett_opr_code;
13084     ett[2] = &ett_component;
13085     ett[3] = &ett_components;
13086     ett[4] = &ett_param;
13087     ett[5] = &ett_params;
13088     ett[6] = &ett_error;
13089     ett[7] = &ett_problem;
13090     ett[8] = &ett_natnum;
13091     ett[9] = &ett_call_mode;
13092     ett[10] = &ett_chan_data;
13093     ett[11] = &ett_code_chan;
13094     ett[12] = &ett_clr_dig_mask;
13095     ett[13] = &ett_ent_dig_mask;
13096     ett[14] = &ett_all_dig_mask;
13097
13098     last_offset = NUM_INDIVIDUAL_PARAMS;
13099
13100     for (i=0; i < NUM_PARAM_1; i++, last_offset++)
13101     {
13102         ett[last_offset] = &ett_ansi_param_1[i];
13103     }
13104
13105     for (i=0; i < NUM_PARAM_2; i++, last_offset++)
13106     {
13107         ett[last_offset] = &ett_ansi_param_2[i];
13108     }
13109
13110     for (i=0; i < NUM_PARAM_3; i++, last_offset++)
13111     {
13112         ett[last_offset] = &ett_ansi_param_3[i];
13113     }
13114
13115     for (i=0; i < NUM_IOS401_ELEM; i++, last_offset++)
13116     {
13117         ett[last_offset] = &ett_ansi_map_ios401_elem[i];
13118     }
13119
13120     /* Register the protocol name and description */
13121     proto_ansi_map =
13122         proto_register_protocol("ANSI Mobile Application Part",
13123             "ANSI MAP", "ansi_map");
13124
13125     is637_tele_id_dissector_table =
13126         register_dissector_table("ansi_map.tele_id", "IS-637 Teleservice ID",
13127             FT_UINT8, BASE_DEC);
13128
13129     is683_dissector_table =
13130         register_dissector_table("ansi_map.ota", "IS-683-A (OTA)",
13131             FT_UINT8, BASE_DEC);
13132
13133     is801_dissector_table =
13134         register_dissector_table("ansi_map.pld", "IS-801 (PLD)",
13135             FT_UINT8, BASE_DEC);
13136
13137     /* Required function calls to register the header fields and subtrees used */
13138     proto_register_field_array(proto_ansi_map, hf, array_length(hf));
13139     proto_register_subtree_array(ett, array_length(ett));
13140
13141     ansi_map_tap = register_tap("ansi_map");
13142 }
13143
13144
13145 void
13146 proto_reg_handoff_ansi_map(void)
13147 {
13148     dissector_handle_t ansi_map_handle;
13149
13150     ansi_map_handle = create_dissector_handle(dissect_ansi_map, proto_ansi_map);
13151
13152     add_ansi_tcap_subdissector(5, ansi_map_handle);
13153     add_ansi_tcap_subdissector(6, ansi_map_handle);
13154     add_ansi_tcap_subdissector(7, ansi_map_handle);
13155     add_ansi_tcap_subdissector(8, ansi_map_handle);
13156     add_ansi_tcap_subdissector(9 , ansi_map_handle);
13157     add_ansi_tcap_subdissector(10 , ansi_map_handle);
13158     add_ansi_tcap_subdissector(11 , ansi_map_handle);
13159     add_ansi_tcap_subdissector(12 , ansi_map_handle);
13160     add_ansi_tcap_subdissector(13 , ansi_map_handle);
13161     add_ansi_tcap_subdissector(14 , ansi_map_handle);
13162
13163     data_handle = find_dissector("data");
13164 }