From Michael Lum:
[obnox/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
116 #include "packet-ansi_a.h"
117 #include "packet-ansi_map.h"
118
119
120 /* PROTOTYPES/FORWARDS */
121
122 static gboolean dissect_ansi_param(ASN1_SCK *asn1, proto_tree *tree);
123
124 /* ANSI PARAM STRINGS */
125 static const value_string ansi_param_1_strings[] = {
126     { 0x81,     "Billing ID" },
127     { 0x82,     "Serving Cell ID" },
128     { 0x83,     "Target Cell ID" },
129     { 0x84,     "Digits" },
130     { 0x85,     "Channel Data" },
131     { 0x86,     "Inter MSC Circuit ID" },
132     { 0x87,     "Inter Switch Count" },
133     { 0x88,     "Mobile Identification Number" },
134     { 0x89,     "Electronic Serial Number" },
135     { 0x8A,     "Release Reason" },
136     { 0x8B,     "Signal Quality" },
137     { 0x8C,     "Station Class Mark" },
138     { 0x8D,     "Authorization Denied" },
139     { 0x8E,     "Authorization Period" },
140     { 0x8F,     "Seizure Type" },
141     { 0x90,     "Trunk Status" },
142     { 0x91,     "Qualification Information Code" },
143     { 0x92,     "Feature Result" },
144     { 0x93,     "Redirection Reason" },
145     { 0x94,     "Access Denied Reason" },
146     { 0x95,     "MSCID" },
147     { 0x96,     "System My Type Code" },
148     { 0x97,     "Origination Indicator" },
149     { 0x98,     "Termination Restriction Code" },
150     { 0x99,     "Calling Features Indicator" },
151     { 0x9A,     "Faulty Parameter" },
152     { 0x9B,     "Usage Indicator" },
153     { 0x9C,     "TDMA Channel Data" },
154     { 0x9D,     "TDMA Call Mode" },
155     { 0x9E,     "Handoff Reason" },
156     { 0, NULL },
157 };
158
159 static const value_string ansi_param_2_strings[] = {
160     { 0x9F1F,   "TDMA Burst Indicator" },
161     { 0x9F20,   "PC_SSN" },
162     { 0x9F21,   "Location Area ID" },
163     { 0x9F22,   "System Access Type" },
164     { 0x9F23,   "Authentication Response" },
165     { 0x9F24,   "Authentication Response Base Station" },
166     { 0x9F25,   "Authentication Response Unique Challenge" },
167     { 0x9F26,   "Call History Count" },
168     { 0x9F27,   "Confidentiality Modes" },
169     { 0x9F28,   "Random Variable" },
170     { 0x9F29,   "Random Variable Base Station" },
171     { 0x9F2A,   "Random Variable SSD" },
172     { 0x9F2B,   "Random Variable Unique Challenge" },
173     { 0x9F2C,   "Report Type" },
174     { 0x9F2D,   "Signaling Message Encryption Key" },
175     { 0x9F2E,   "Shared Secret Data" },
176     { 0x9F2F,   "Terminal Type" },
177     { 0x9F30,   "Voice Privacy Mask" },
178     { 0x9F31,   "System Capabilities" },
179     { 0x9F32,   "Deny Access" },
180     { 0x9F33,   "Update Count" },
181     { 0x9F34,   "SSD Not Shared" },
182     { 0x9F35,   "Extended MSCID" },
183     { 0x9F36,   "Extended System My Type Code" },
184     { 0x9F37,   "Control Channel Data" },
185     { 0x9F38,   "System Access Data" },
186     { 0x9F39,   "Cancellation Denied" },
187     { 0x9F3A,   "Border Cell Access" },
188     { 0x9F3B,   "CDMA Station Class Mark" },
189     { 0x9F3C,   "CDMA Serving One Way Delay" },
190     { 0x9F3D,   "CDMA Target One Way Delay" },
191     { 0x9F3E,   "CDMA Call Mode" },
192     { 0x9F3F,   "CDMA Channel Data" },
193     { 0x9F40,   "CDMA Signal Quality" },
194     { 0x9F41,   "CDMA Pilot Strength" },
195     { 0x9F42,   "CDMA Mobile Protocol Revision" },
196     { 0x9F43,   "CDMA Private Long Code Mask" },
197     { 0x9F44,   "CDMA Code Channel" },
198     { 0x9F45,   "CDMA Search Window" },
199     { 0x9F46,   "MS Location" },
200     { 0x9F47,   "Page Indicator" },
201     { 0x9F48,   "Received Signal Quality" },
202     { 0x9F49,   "Deregistration Type" },
203     { 0x9F4A,   "NAMPS Channel Data" },
204     { 0x9F4B,   "Alert Code" },
205     { 0x9F4C,   "Announcement Code" },
206     { 0x9F4D,   "Authentication Algorithm Version" },
207     { 0x9F4E,   "Authentication Capability" },
208     { 0x9F4F,   "Call History Count Expected" },
209     { 0x9F50,   "Calling Party Number Digits 1" },
210     { 0x9F51,   "Calling Party Number Digits 2" },
211     { 0x9F52,   "Calling Party Number String 1" },
212     { 0x9F53,   "Calling Party Number String 2" },
213     { 0x9F54,   "Calling Party Subaddress" },
214     { 0x9F55,   "Cancellation Type" },
215     { 0x9F56,   "Carrier Digits" },
216     { 0x9F57,   "Destination Digits" },
217     { 0x9F58,   "DMH Redirection Indicator" },
218     { 0xBF59,   "Inter System Termination" },
219     { 0x9F5A,   "Availability Type" },
220     { 0xBF5B,   "Local Termination" },
221     { 0x9F5C,   "Message Waiting Notification Count" },
222     { 0x9F5D,   "Mobile Directory Number" },
223     { 0x9F5E,   "MSCID Number" },
224     { 0xBF5F,   "PSTN Termination" },
225     { 0x9F60,   "No Answer Time" },
226     { 0x9F61,   "One Time Feature Indicator" },
227     { 0x9F62,   "Origination Triggers" },
228     { 0x9F63,   "RANDC" },
229     { 0x9F64,   "Redirecting Number Digits" },
230     { 0x9F65,   "Redirecting Number String" },
231     { 0x9F66,   "Redirecting Subaddress" },
232     { 0x9F67,   "Sender Identification Number" },
233     { 0x9F68,   "SMS Address" },
234     { 0x9F69,   "SMS Bearer Data" },
235     { 0x9F6A,   "SMS Charge Indicator" },
236     { 0x9F6B,   "SMS Destination Address" },
237     { 0x9F6C,   "SMS Message Count" },
238     { 0x9F6D,   "SMS Notification Indicator" },
239     { 0x9F6E,   "SMS Original Destination Address" },
240     { 0x9F6F,   "SMS Original Destination Subaddress" },
241     { 0x9F70,   "SMS Original Originating Address" },
242     { 0x9F71,   "SMS Original Originating Subaddress" },
243     { 0x9F72,   "SMS Originating Address" },
244     { 0x9F73,   "SMS Originating Restrictions" },
245     { 0x9F74,   "SMS Teleservice Identifier" },
246     { 0x9F75,   "SMS Termination Restrictions" },
247     { 0x9F76,   "SMS Message Waiting Indicator" },
248     { 0x9F77,   "Termination Access Type" },
249     { 0xBF78,   "Termination List" },
250     { 0x9F79,   "Termination Treatment" },
251     { 0x9F7A,   "Termination Triggers" },
252     { 0x9F7B,   "Transaction Capability" },
253     { 0x9F7C,   "Unique Challenge Report" },
254     { 0, NULL },
255 };
256
257 static const value_string ansi_param_3_strings[] = {
258     { 0x9F8100, "Action Code" },
259     { 0x9F8101, "Alert Result" },
260     { 0xBF8102, "Announcement List" },
261     { 0xBF8103, "CDMA Code Channel Information" },
262     { 0xBF8104, "CDMA Code Channel List" },
263     { 0xBF8105, "CDMA Target Measurement Information" },
264     { 0xBF8106, "CDMA Target Measurement List" },
265     { 0xBF8107, "CDMA Target MAHO Information" },
266     { 0xBF8108, "CDMA Target MAHO List" },
267     { 0x9F8109, "Conference Calling Indicator" },
268     { 0x9F810A, "Count Update Report" },
269     { 0x9F810B, "Digit Collection Control" },
270     { 0x9F810C, "DMH Account Code Digits" },
271     { 0x9F810D, "DMH Alternate Billing Digits" },
272     { 0x9F810E, "DMH Billing Digits" },
273     { 0x9F810F, "Geographic Authorization" },
274     { 0x9F8110, "Leg Information" },
275     { 0x9F8111, "Message Waiting Notification Type" },
276     { 0x9F8112, "PACA Indicator" },
277     { 0x9F8113, "Preferred Language Indicator" },
278     { 0x9F8114, "Random Valid Time" },
279     { 0x9F8115, "Restriction Digits" },
280     { 0x9F8116, "Routing Digits" },
281     { 0x9F8117, "Setup Result" },
282     { 0x9F8118, "SMS Access Denied Reason" },
283     { 0x9F8119, "SMS Cause Code" },
284     { 0x9F811A, "SPINI PIN" },
285     { 0x9F811B, "SPINI Triggers" },
286     { 0x9F811C, "SSD Update Report" },
287     { 0xBF811D, "Target Measurement Information" },
288     { 0xBF811E, "Target Measurement List" },
289     { 0x9F811F, "Voice Mailbox PIN" },
290     { 0x9F8120, "Voice Mailbox Number" },
291     { 0x9F8121, "Authentication Data" },
292     { 0x9F8122, "Conditionally Denied Reason" },
293     { 0x9F8123, "Group Information" },
294     { 0x9F8124, "Handoff State" },
295     { 0x9F8125, "NAMPS Call Mode" },
296     { 0x9F8126, "CDMA Slot Cycle Index" },
297     { 0x9F8127, "Denied Authorization Period" },
298     { 0x9F8128, "Pilot Number" },
299     { 0x9F8129, "Pilot Billing ID" },
300     { 0x9F812A, "CDMA Band Class" },
301     { 0xBF812B, "CDMA Band Class Information" },
302     { 0xBF812C, "CDMA Band Class List" },
303     { 0x9F812D, "CDMA Pilot PN" },
304     { 0x9F812E, "CDMA Service Configuration Record" },
305     { 0x9F812F, "CDMA Service Option" },
306     { 0xBF8130, "CDMA Service Option List" },
307     { 0x9F8131, "CDMA Station Class Mark 2" },
308     { 0x9F8132, "TDMA Service Code" },
309     { 0x9F8133, "TDMA Terminal Capability" },
310     { 0x9F8134, "TDMA Voice Coder" },
311     { 0x9F8135, "A-Key Protocol Version" },
312     { 0x9F8136, "Authentication Response Reauthentication" },
313     { 0x9F8137, "Base Station Partial Key" },
314     { 0x9F8138, "Mobile Station MIN" },
315     { 0x9F8139, "Mobile Station Partial Key" },
316     { 0x9F813A, "Modulus Value" },
317     { 0x9F813B, "Newly Assigned MIN" },
318     { 0x9F813D, "OTASP Result Code" },
319     { 0x9F813E, "Primitive Value" },
320     { 0x9F813F, "Random Variable Reauthentication" },
321     { 0x9F8140, "Reauthentication Report" },
322     { 0x9F8141, "Service Indicator" },
323     { 0x9F8142, "Signaling Message Encryption Report" },
324     { 0x9F8143, "Temporary Reference Number" },
325     { 0x9F8144, "Voice Privacy Report" },
326     { 0x9F8145, "Base Station Manufacturer Code" },
327     { 0x9F8146, "BSMC Status" },
328     { 0x9F8147, "Control Channel Mode" },
329     { 0x9F8148, "Non Public Data" },
330     { 0x9F8149, "Paging Frame Class" },
331     { 0x9F814A, "PSID RSID Information" },
332     { 0xBF814B, "PSID RSID List" },
333     { 0x9F814C, "Services Result" },
334     { 0x9F814D, "SOC Status" },
335     { 0x9F814E, "System Operator Code" },
336     { 0xBF814F, "Target Cell ID List" },
337     { 0x9F8150, "User Group" },
338     { 0x9F8151, "User Zone Data" },
339     { 0x9F8152, "CDMA Connection Reference" },
340     { 0xBF8153, "CDMA Connection Reference Information" },
341     { 0xBF8154, "CDMA Connection Reference List" },
342     { 0x9F8155, "CDMA State" },
343     { 0x9F8156, "Change Service Attributes" },
344     { 0x9F8157, "Data Key" },
345     { 0x9F8158, "Data Privacy Parameters" },
346     { 0x9F8159, "ISLP Information" }, /* IS-737 *SPEC CONFLICT* */
347     { 0x9F815A, "Reason List" },
348     { 0x9F815B, "Second Inter MSC Circuit ID" },
349     { 0x9F815C, "TDMA Bandwidth" },
350     { 0x9F815D, "TDMA Data Features Indicator" },
351     { 0x9F815E, "TDMA Data Mode" },
352     { 0x9F815F, "TDMA Voice Mode" },
353     { 0x9F8160, "Analog Redirect Info" },
354     { 0xBF8161, "Analog Redirect Record" },
355     { 0x9F8162, "CDMA Channel Number" },
356     { 0xBF8163, "CDMA Channel Number List" },
357     { 0xBF8164, "CDMA Power Combined Indicator" },
358     { 0x9F8165, "CDMA Redirect Record" },
359     { 0x9F8166, "CDMA Search Parameters" },
360     { 0x9F8168, "CDMA Network Identification" },
361     { 0x9F8169, "Network TMSI" },
362     { 0x9F816A, "Network TMSI Expiration Time" },
363     { 0x9F816B, "New Network TMSI" },
364     { 0x9F816C, "Required Parameters Mask" },
365     { 0x9F816D, "Service Redirection Cause" },
366     { 0x9F816E, "Service Redirection Info" },
367     { 0x9F816F, "Roaming Indication" },
368     { 0x9F8170, "Emergency Services Routing Digits" },
369     { 0x9F8171, "Special Handling" },
370     { 0x9F8172, "International Mobile Subscriber Identity" },
371     { 0x9F8173, "Calling Party Name" },
372     { 0x9F8174, "Display Text" },
373     { 0x9F8175, "Redirecting Party Name" },
374     { 0x9F8176, "Service ID" },
375     { 0x9F8177, "All Or None" },
376     { 0x9F8178, "Change" },
377     { 0xBF8179, "Data Access Element" },
378     { 0xBF817A, "Data Access Element List" },
379     { 0x9F817B, "Data ID" },
380     { 0x9F817C, "Database Key" },
381     { 0x9F817D, "Data Result" },
382     { 0xBF817E, "Data Update Result" },
383     { 0xBF817F, "Data Update Result List" },
384     { 0x9F8200, "Data Value" },
385     { 0xBF8202, "Execute Script" },
386     { 0x9F8203, "Failure Cause" },
387     { 0x9F8204, "Failure Type" },
388     { 0x9F8205, "Global Title" },
389     { 0xBF8206, "Modification Request" },
390     { 0xBF8207, "Modification Request List" },
391     { 0xBF8208, "Modification Result List" },
392     { 0x9F8209, "Private Specialized Resource" },
393     { 0x9F820B, "Script Argument" },
394     { 0x9F820C, "Script Name" },
395     { 0x9F820D, "Script Result" },
396     { 0xBF820E, "Service Data Access Element" },
397     { 0xBF820F, "Service Data Access Element List" },
398     { 0xBF8210, "Service Data Result" },
399     { 0xBF8211, "Service Data Result List" },
400     { 0x9F8212, "Specialized Resource" },
401     { 0x9F8213, "Time Date Offset" },
402     { 0xBF8214, "Trigger Address List" },
403     { 0x9F8215, "Trigger Capability" },
404     { 0xBF8216, "Trigger List" },
405     { 0x9F8217, "Trigger Type" },
406     { 0xBF8218, "WIN Capability" },
407     { 0x9F8219, "WIN Operations Capability" },
408     { 0x9F821B, "WIN Trigger List" },
409     { 0x9F821C, "MSC Address" },
410     { 0x9F821D, "Suspicious Access" },
411     { 0x9F821E, "Mobile Station IMSI" },
412     { 0x9F821F, "Newly Assigned IMSI" },
413     { 0x9F822A, "Command Code" },
414     { 0x9F822B, "Display Text 2" },
415     { 0x9F822C, "Page Count" },
416     { 0x9F822D, "Page Response Time" },
417     { 0x9F822E, "SMS Transaction ID" },
418     { 0x9F823C, "CAVE Key" },
419     { 0x9F8241, "CDMA2000 Mobile Supported Capabilities" },
420     { 0x9F8245, "Enhanced Privacy Encryption Report" },
421     { 0x9F8246, "Inter Message Time" },
422     { 0x9F8247, "MSID Usage" },
423     { 0x9F8248, "New MIN Extension" },
424     { 0x9F825C, "QoS Priority" },
425     { 0x9F825F, "CDMA MS Measured Channel Identity" },
426     { 0x9F8264, "CDMA2000 Handoff Invoke IOS Data" },
427     { 0x9F8265, "CDMA2000 Handoff Response IOS Data" },
428     { 0x9F8304, "MIN Extension" },
429
430     { 0xBF822F, "Call Recovery ID" },
431     { 0xBF8230, "Call Recovery ID List" },
432     { 0xBF8250, "Position Information" },
433     { 0xBF825A, "CDMA PSMM List" },
434     { 0x9F820A, "Resume PIC" },
435     { 0x9F8231, "DMH Service ID" },
436     { 0x9F8232, "Feature Indicator" },
437     { 0x9F8233, "Control Network ID" },
438     { 0x9F8234, "Release Cause" },
439     { 0x9F8235, "Time Of Day" },
440     { 0x9F8236, "Call Status" },
441     { 0x9F8237, "DMH Charge Information" },
442     { 0x9F8238, "DMH Billing Indicator" },
443     { 0x9F8239, "MS Status" },
444     { 0x9F823B, "Position Information Code" },
445     { 0x9F8249, "DTX Indication" },
446     { 0x9F824A, "CDMA Mobile Capabilities" },
447     { 0x9F824B, "Generalized Time" },
448     { 0x9F824C, "Generic Digits" },
449     { 0x9F824D, "Geographic Position" },
450     { 0x9F824E, "Mobile Call Status" },
451     { 0x9F824F, "Mobile Position Capability" },
452     { 0x9F8251, "Position Request Type" },
453     { 0x9F8252, "Position Result" },
454     { 0x9F8253, "Position Source" },
455     { 0x9F8254, "ACG Encountered" },
456     { 0x9F8255, "Control Type" },
457     { 0x9F8256, "Gap Duration" },
458     { 0x9F8257, "SCF Overload Gap Interval" },
459     { 0x9F8258, "Service Management System Gap Interval" },
460     { 0x9F8259, "CDMA PSMM Count" },
461     { 0x9F825B, "CDMA Serving One Way Delay 2" },
462     { 0x9F825D, "PDSN Address" },
463     { 0x9F825E, "PDSN Protocol Type" },
464     { 0x9F8261, "Range" },
465     { 0x9F8263, "Calling Party Category" },
466     { 0x9F8266, "LCS Client ID" },
467     { 0x9F8267, "TDMA MAHO Cell ID" },
468     { 0x9F8268, "TDMA MAHO Channel" },
469     { 0x9F8269, "CDMA Service Option Connection Identifier" },
470     { 0x9F826A, "TDMA Time Alignment" },
471     { 0x9F826C, "TDMA MAHO Request" },
472     { 0, NULL },
473 };
474
475 /* ANSI TCAP component type */
476 #define ANSI_TC_INVOKE_L 0xe9
477 #define ANSI_TC_RRL 0xea
478 #define ANSI_TC_RE 0xeb
479 #define ANSI_TC_REJECT 0xec
480 #define ANSI_TC_INVOKE_N 0xed
481 #define ANSI_TC_RRN 0xee
482
483 static const value_string ansi_cmp_type_strings[] = {
484     { ANSI_TC_INVOKE_L,         "Invoke(Last)" },
485     { ANSI_TC_RRL,              "RetRes(Last)" },
486     { ANSI_TC_RE,               "RetErr" },
487     { ANSI_TC_REJECT,           "Reject" },
488     { ANSI_TC_INVOKE_N,         "Invoke(Not Last)" },
489     { ANSI_TC_RRN,              "RetRes(Not Last)" },
490     { 0, NULL },
491 };
492
493 const value_string ansi_map_opr_code_strings[] = {
494     { 1,        "Handoff Measurement Request" },
495     { 2,        "Facilities Directive" },
496     { 3,        "Mobile On Channel" },
497     { 4,        "Handoff Back" },
498     { 5,        "Facilities Release" },
499     { 6,        "Qualification Request" },
500     { 7,        "Qualification Directive" },
501     { 8,        "Blocking" },
502     { 9,        "Unblocking" },
503     { 10,       "Reset Circuit" },
504     { 11,       "Trunk Test" },
505     { 12,       "Trunk Test Disconnect" },
506     { 13,       "Registration Notification" },
507     { 14,       "Registration Cancellation" },
508     { 15,       "Location Request" },
509     { 16,       "Routing Request" },
510     { 17,       "Feature Request" },
511     { 18,       "Reserved 18 (Service Profile Request, IS-41-C)" },
512     { 19,       "Reserved 19 (Service Profile Directive, IS-41-C)" },
513     { 20,       "Unreliable Roamer Data Directive" },
514     { 21,       "Reserved 21 (Call Data Request, IS-41-C)" },
515     { 22,       "MS Inactive" },
516     { 23,       "Transfer To Number Request" },
517     { 24,       "Redirection Request" },
518     { 25,       "Handoff To Third" },
519     { 26,       "Flash Request" },
520     { 27,       "Authentication Directive" },
521     { 28,       "Authentication Request" },
522     { 29,       "Base Station Challenge" },
523     { 30,       "Authentication Failure Report" },
524     { 31,       "Count Request" },
525     { 32,       "Inter System Page" },
526     { 33,       "Unsolicited Response" },
527     { 34,       "Bulk Deregistration" },
528     { 35,       "Handoff Measurement Request 2" },
529     { 36,       "Facilities Directive 2" },
530     { 37,       "Handoff Back 2" },
531     { 38,       "Handoff To Third 2" },
532     { 39,       "Authentication Directive Forward" },
533     { 40,       "Authentication Status Report" },
534     { 41,       "Reserved 41" },
535     { 42,       "Information Directive" },
536     { 43,       "Information Forward" },
537     { 44,       "Inter System Answer" },
538     { 45,       "Inter System Page 2" },
539     { 46,       "Inter System Setup" },
540     { 47,       "Origination Request" },
541     { 48,       "Random Variable Request" },
542     { 49,       "Redirection Directive" },
543     { 50,       "Remote User Interaction Directive" },
544     { 51,       "SMS Delivery Backward" },
545     { 52,       "SMS Delivery Forward" },
546     { 53,       "SMS Delivery Point to Point" },
547     { 54,       "SMS Notification" },
548     { 55,       "SMS Request" },
549     { 56,       "OTASP Request" },
550     { 57,       "Information Backward" },
551     { 58,       "Change Facilities" },
552     { 59,       "Change Service" },
553     { 60,       "Parameter Request" },
554     { 61,       "TMSI Directive" },
555     { 62,       "Reserved 62" },
556     { 63,       "Service Request" },
557     { 64,       "Analyzed Information Request" },
558     { 65,       "Connection Failure Report" },
559     { 66,       "Connect Resource" },
560     { 67,       "Disconnect Resource" },
561     { 68,       "Facility Selected and Available" },
562     { 69,       "Instruction Request" },
563     { 70,       "Modify" },
564     { 71,       "Reset Timer" },
565     { 72,       "Search" },
566     { 73,       "Seize Resource" },
567     { 74,       "SRF Directive" },
568     { 75,       "T Busy" },
569     { 76,       "T NoAnswer" },
570     { 77,       "Release" },
571     { 78,       "SMS Delivery Point to Point Ack" },
572     { 79,       "Message Directive" },
573     { 80,       "Bulk Disconnection" },
574     { 81,       "Call Control Directive" },
575     { 82,       "O Answer" },
576     { 83,       "O Disconnect" },
577     { 84,       "Call Recovery Report" },
578     { 85,       "T Answer" },
579     { 86,       "T Disconnect" },
580     { 87,       "Unreliable Call Data" },
581     { 88,       "O CalledPartyBusy" },
582     { 89,       "O NoAnswer" },
583     { 90,       "Position Request" },
584     { 91,       "Position Request Forward" },
585     { 92,       "Call Termination Report" },
586     { 93,       "Geo Position Directive" },
587     { 94,       "Geo Position Request" },
588     { 95,       "Inter System Position Request" },
589     { 96,       "Inter System Position Request Forward" },
590     { 97,       "ACG Directive" },
591     { 98,       "Roamer Database Verification Request" },
592     { 99,       "Add Service" },
593     { 100,      "Drop Service" },
594     { 0, NULL },
595 };
596
597 static const value_string ansi_tele_strings[] = {
598     { 1,        "Reserved for maintenance" },
599     { 4096,     "AMPS Extended Protocol Enhanced Services" },
600     { 4097,     "CDMA Cellular Paging Teleservice" },
601     { 4098,     "CDMA Cellular Messaging Teleservice" },
602     { 4099,     "CDMA Voice Mail Notification" },
603     { 32513,    "TDMA Cellular Messaging Teleservice" },
604     { 32520,    "TDMA System Assisted Mobile Positioning through Satellite (SAMPS)" },
605     { 32584,    "TDMA Segmented System Assisted Mobile Positioning Service" },
606     { 0, NULL },
607 };
608
609 #define NUM_BAND_CLASS_STR      (sizeof(band_class_str)/sizeof(gchar *))
610 static const gchar *band_class_str[] = {
611     "800 MHz Cellular System",
612     "1.850 to 1.990 GHz Broadband PCS",
613     "872 to 960 MHz TACS Band",
614     "832 to 925 MHz JTACS Band",
615     "1.750 to 1.870 GHz Korean PCS",
616     "450 MHz NMT",
617     "2 GHz IMT-2000 Band",
618     "North American 700 MHz Cellular Band",
619     "1.710 to 1.880 GHz PCS",
620     "880 to 960 MHz Band",
621     "Secondary 800 MHz Band",
622     "400 MHz European PAMR Band",
623     "800 MHz European PAMR Band"
624 };
625
626 #define NUM_QOS_PRI_STR         (sizeof(qos_pri_str)/sizeof(gchar *))
627 static const gchar *qos_pri_str[] = {
628     "Priority Level 0.  This is the lowest level",
629     "Priority Level 1",
630     "Priority Level 2",
631     "Priority Level 3",
632     "Priority Level 4",
633     "Priority Level 5",
634     "Priority Level 6",
635     "Priority Level 7",
636     "Priority Level 8",
637     "Priority Level 9",
638     "Priority Level 10",
639     "Priority Level 11",
640     "Priority Level 12",
641     "Priority Level 13",
642     "Reserved, treat as Priority Level 14",
643     "Reserved, treat as Priority Level 15"
644 };
645
646 /*
647  * would prefer to have had the define set to the exact number of
648  * elements in the array but that is not without it's own problems
649  * (sizeof(ansi_a_ios401_elem_1_strings)/sizeof(value_string))
650  */
651 #define NUM_IOS401_ELEM ANSI_A_MAX_NUM_IOS401_ELEM_1_STRINGS
652 static gint ett_ansi_map_ios401_elem[NUM_IOS401_ELEM];
653
654
655 /* Initialize the protocol and registered fields */
656 static int proto_ansi_map = -1;
657
658 static int ansi_map_tap = -1;
659
660 static int hf_ansi_map_tag = -1;
661 static int hf_ansi_map_length = -1;
662 static int hf_ansi_map_id = -1;
663 static int hf_ansi_map_opr_code = -1;
664 static int hf_ansi_map_param_id = -1;
665 static int hf_ansi_map_ios401_elem_id = -1;
666 static int hf_ansi_map_min = -1;
667 static int hf_ansi_map_number = -1;
668
669 static int hf_ansi_map_billing_id = -1;
670
671 /* Initialize the subtree pointers */
672 static gint ett_ansi_map = -1;
673 static gint ett_opr_code = -1;
674 static gint ett_component = -1;
675 static gint ett_components = -1;
676 static gint ett_params = -1;
677 static gint ett_param = -1;
678 static gint ett_error = -1;
679 static gint ett_problem = -1;
680 static gint ett_natnum = -1;
681 static gint ett_call_mode = -1;
682 static gint ett_chan_data = -1;
683 static gint ett_code_chan = -1;
684 static gint ett_clr_dig_mask = -1;
685 static gint ett_ent_dig_mask = -1;
686 static gint ett_all_dig_mask = -1;
687
688
689 static char bigbuf[1024];
690 static gchar ansi_map_add_string[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_)
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_)
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_)
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_)
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_)
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_)
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_)
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_)
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_)
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_)
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_)
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_)
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_)
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_)
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_)
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_)
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_)
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_)
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_)
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_)
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_)
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_)
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_)
2399 {
2400     gint32 value;
2401     guint saved_offset, orig_offset;
2402     const gchar *str = NULL;
2403
2404     SHORT_DATA_CHECK(len, 2);
2405
2406     orig_offset = asn1->offset;
2407     saved_offset = asn1->offset;
2408
2409     do
2410     {
2411         asn1_int32_value_decode(asn1, 1, &value);
2412
2413         switch (value)
2414         {
2415         case 0: str = "Voice Messages"; break;
2416         case 1: str = "Short Message Services (SMS) messages"; break;
2417         case 2: str = "Group 3 (G3) Fax messages"; break;
2418         case 255: str = "Not specified"; break;
2419         default:
2420             str = "Reserved, treat as Not specified";
2421             break;
2422         }
2423
2424         proto_tree_add_text(tree, asn1->tvb,
2425             saved_offset, asn1->offset - saved_offset,
2426             "Type of messages, %s",
2427             str);
2428
2429         saved_offset = asn1->offset;
2430
2431         asn1_int32_value_decode(asn1, 1, &value);
2432
2433         switch (value)
2434         {
2435         case 0: str = "No messages are waiting"; break;
2436         case 254: str = "254 or more messages are waiting"; break;
2437         case 255: str = "An unknown number of messages are waiting (greater than zero)"; break;
2438         default:
2439             sprintf(bigbuf, "%u messages are waiting", value);
2440             str = bigbuf;
2441             break;
2442         }
2443
2444         proto_tree_add_text(tree, asn1->tvb,
2445             saved_offset, asn1->offset - saved_offset,
2446             str);
2447
2448         saved_offset = asn1->offset;
2449     }
2450     while ((len - (saved_offset - orig_offset)) >= 2);
2451
2452     EXTRANEOUS_DATA_CHECK((len - (saved_offset - orig_offset)), 0);
2453 }
2454
2455 static void
2456 param_otfi(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
2457 {
2458     gint32 value;
2459     guint saved_offset;
2460     const gchar *str = NULL;
2461
2462     saved_offset = asn1->offset;
2463
2464     asn1_int32_value_decode(asn1, 1, &value);
2465
2466     switch ((value & 0xc0) >> 6)
2467     {
2468     case 0: str = "Ignore"; break;
2469     case 1: str = "Presentation Allowed"; break;
2470     case 2: str = "Presentation Restricted"; break;
2471     case 3: str = "Reserved"; break;
2472     }
2473
2474     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
2475     proto_tree_add_text(tree, asn1->tvb,
2476         saved_offset, asn1->offset - saved_offset,
2477         "%s :  Calling Number ID Restriction, %s",
2478         bigbuf,
2479         str);
2480
2481     switch ((value & 0x30) >> 4)
2482     {
2483     case 0: str = "Ignore"; break;
2484     case 1: str = "Pip Tone Inactive"; break;
2485     case 2: str = "Pip Tone Active"; break;
2486     case 3: str = "Reserved"; break;
2487     }
2488
2489     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
2490     proto_tree_add_text(tree, asn1->tvb,
2491         saved_offset, asn1->offset - saved_offset,
2492         "%s :  Message Waiting Notification, %s",
2493         bigbuf,
2494         str);
2495
2496     switch ((value & 0x0c) >> 2)
2497     {
2498     case 0: str = "Ignore"; break;
2499     case 1: str = "No CW"; break;
2500     case 2: str = "Normal CW"; break;
2501     case 3: str = "Priority CW"; break;
2502     }
2503
2504     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
2505     proto_tree_add_text(tree, asn1->tvb,
2506         saved_offset, asn1->offset - saved_offset,
2507         "%s :  Call Waiting for Incoming Call (CWIC), %s",
2508         bigbuf,
2509         str);
2510
2511     switch (value & 0x03)
2512     {
2513     case 0: str = "Ignore"; break;
2514     case 1: str = "No CW"; break;
2515     case 2: str = "Normal CW"; break;
2516     case 3: str = "Priority CW"; break;
2517     }
2518
2519     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
2520     proto_tree_add_text(tree, asn1->tvb,
2521         saved_offset, asn1->offset - saved_offset,
2522         "%s :  Call Waiting for Future Incoming Call (CWFI), %s",
2523         bigbuf,
2524         str);
2525
2526     if (len == 1) return;
2527
2528     saved_offset = asn1->offset;
2529
2530     asn1_int32_value_decode(asn1, 1, &value);
2531
2532     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
2533     proto_tree_add_text(tree, asn1->tvb,
2534         saved_offset, asn1->offset - saved_offset,
2535         "%s :  Reserved",
2536         bigbuf);
2537
2538     switch ((value & 0x30) >> 4)
2539     {
2540     case 0: str = "Ignore"; break;
2541     case 1: str = "Presentation Allowed"; break;
2542     case 2: str = "Presentation Restricted"; break;
2543     case 3: str = "Blocking Toggle"; break;
2544     }
2545
2546     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
2547     proto_tree_add_text(tree, asn1->tvb,
2548         saved_offset, asn1->offset - saved_offset,
2549         "%s :  Calling Name Restriction (CNAR), %s",
2550         bigbuf,
2551         str);
2552
2553     switch ((value & 0x0c) >> 2)
2554     {
2555     case 0: str = "Ignore"; break;
2556     case 1: str = "Flash Inactive"; break;
2557     case 2: str = "Flash Active"; break;
2558     case 3: str = "Reserved"; break;
2559     }
2560
2561     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
2562     proto_tree_add_text(tree, asn1->tvb,
2563         saved_offset, asn1->offset - saved_offset,
2564         "%s :  Flash Privileges (Flash), %s",
2565         bigbuf,
2566         str);
2567
2568     switch (value & 0x03)
2569     {
2570     case 0: str = "Ignore"; break;
2571     case 1: str = "PACA Demand Inactive"; break;
2572     case 2: str = "PACA Demand Actived"; break;
2573     case 3: str = "Reserved"; break;
2574     }
2575
2576     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
2577     proto_tree_add_text(tree, asn1->tvb,
2578         saved_offset, asn1->offset - saved_offset,
2579         "%s :  Priority Access and Channel Assignment (PACA), %s",
2580         bigbuf,
2581         str);
2582
2583     EXTRANEOUS_DATA_CHECK(len, 2);
2584 }
2585
2586 /*
2587  * For:
2588  *      Authentication Response
2589  *      Authentication Response Base Station
2590  *      Authentication Response Unique Challenge
2591  */
2592 static void
2593 param_auth_resp_all(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
2594 {
2595     gint32 value;
2596     guint saved_offset;
2597
2598     EXACT_DATA_CHECK(len, 3);
2599
2600     saved_offset = asn1->offset;
2601
2602     asn1_int32_value_decode(asn1, 1, &value);
2603
2604     other_decode_bitfield_value(bigbuf, value, 0xfc, 8);
2605     proto_tree_add_text(tree, asn1->tvb,
2606         saved_offset, asn1->offset - saved_offset,
2607         "%s :  Reserved",
2608         bigbuf);
2609
2610     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
2611     proto_tree_add_text(tree, asn1->tvb,
2612         saved_offset, asn1->offset - saved_offset,
2613         "%s :  Response (MSB)",
2614         bigbuf);
2615
2616     saved_offset = asn1->offset;
2617
2618     asn1_int32_value_decode(asn1, 1, &value);
2619
2620     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
2621     proto_tree_add_text(tree, asn1->tvb,
2622         saved_offset, asn1->offset - saved_offset,
2623         "%s :  Response",
2624         bigbuf);
2625
2626     saved_offset = asn1->offset;
2627
2628     asn1_int32_value_decode(asn1, 1, &value);
2629
2630     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
2631     proto_tree_add_text(tree, asn1->tvb,
2632         saved_offset, asn1->offset - saved_offset,
2633         "%s :  Response (LSB)",
2634         bigbuf);
2635 }
2636
2637 static void
2638 param_sys_acc_data(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
2639 {
2640     gint32 value;
2641     guint saved_offset;
2642
2643     EXACT_DATA_CHECK(len, 5);
2644
2645     param_mscid(asn1, tree, 3, add_string);
2646
2647     saved_offset = asn1->offset;
2648     asn1_int32_value_decode(asn1, 2, &value);
2649
2650     proto_tree_add_text(tree, asn1->tvb,
2651         saved_offset, asn1->offset - saved_offset,
2652         "Serving Cell ID %u",
2653         value);
2654 }
2655
2656 static void
2657 param_bill_id(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
2658 {
2659     gint32 id, segcount;
2660     guint saved_offset;
2661     const gchar *str = NULL;
2662
2663     EXACT_DATA_CHECK(len, 7);
2664
2665     param_mscid(asn1, tree, 3, add_string);
2666
2667     saved_offset = asn1->offset;
2668     asn1_int32_value_decode(asn1, 3, &id);
2669
2670     proto_tree_add_int_format(tree, hf_ansi_map_billing_id, asn1->tvb,
2671         saved_offset, asn1->offset - saved_offset,id,
2672         "ID Number %d",
2673         id);
2674
2675     saved_offset = asn1->offset;
2676     asn1_int32_value_decode(asn1, 1, &segcount);
2677
2678     if (segcount == 255) { str = "Unspecified"; }
2679     else if ((segcount >= 0) && (segcount <= 127)) { str = "Number of call segments"; }
2680     else if ((segcount >= 128) && (segcount < 255)) { str = "Not used in TIA/EIA-41"; }
2681
2682     proto_tree_add_text(tree, asn1->tvb,
2683         saved_offset, asn1->offset - saved_offset,
2684         "Segment Counter %u:  %s",
2685         segcount, str);
2686 }
2687
2688 static void
2689 param_cdma_so(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
2690 {
2691     gint32 so;
2692     guint saved_offset;
2693     const gchar *str = NULL;
2694
2695     SHORT_DATA_CHECK(len, 2);
2696
2697     saved_offset = asn1->offset;
2698     asn1_int32_value_decode(asn1, 2, &so);
2699
2700     switch (so)
2701     {
2702     case 1: str = "Basic Variable Rate Voice Service (8 kbps)"; break;
2703     case 2: str = "Mobile Station Loopback (8 kbps)"; break;
2704     case 3: str = "Enhanced Variable Rate Voice Service (8 kbps)"; break;
2705     case 4: str = "Asynchronous Data Service (9.6 kbps)"; break;
2706     case 5: str = "Group 3 Facsimile (9.6 kbps)"; break;
2707     case 6: str = "Short Message Services (Rate Set 1)"; break;
2708     case 7: str = "Packet Data Service: Internet or ISO Protocol Stack (9.6 kbps)"; break;
2709     case 8: str = "Packet Data Service: CDPD Protocol Stack (9.6 kbps)"; break;
2710     case 9: str = "Mobile Station Loopback (13 kbps)"; break;
2711     case 10: str = "STU-III Transparent Service"; break;
2712     case 11: str = "STU-III Non-Transparent Service"; break;
2713     case 12: str = "Asynchronous Data Service (14.4 or 9.6 kbps)"; break;
2714     case 13: str = "Group 3 Facsimile (14.4 or 9.6 kbps)"; break;
2715     case 14: str = "Short Message Services (Rate Set 2)"; break;
2716     case 15: str = "Packet Data Service: Internet or ISO Protocol Stack (14.4 kbps)"; break;
2717     case 16: str = "Packet Data Service: CDPD Protocol Stack (14.4 kbps)"; break;
2718     case 17: str = "High Rate Voice Service (13 kbps)"; break;
2719     case 32768: str = "QCELP (13 kbps)"; break;
2720     case 18: str = "Over-the-Air Parameter Administration (Rate Set 1)"; break;
2721     case 19: str = "Over-the-Air Parameter Administration (Rate Set 2)"; break;
2722     case 20: str = "Group 3 Analog Facsimile (Rate Set 1)"; break;
2723     case 21: str = "Group 3 Analog Facsimile (Rate Set 2)"; break;
2724     case 22: str = "High Speed Packet Data Service: Internet or ISO Protocol Stack (RS1 forward, RS1 reverse)"; break;
2725     case 23: str = "High Speed Packet Data Service: Internet or ISO Protocol Stack (RS1 forward, RS2 reverse)"; break;
2726     case 24: str = "High Speed Packet Data Service: Internet or ISO Protocol Stack (RS2 forward, RS1 reverse)"; break;
2727     case 25: str = "High Speed Packet Data Service: Internet or ISO Protocol Stack (RS2 forward, RS2 reverse)"; break;
2728     case 26: str = "High Speed Packet Data Service: CDPD Protocol Stack (RS1 forward, RS1 reverse)"; break;
2729     case 27: str = "High Speed Packet Data Service: CDPD Protocol Stack (RS1 forward, RS2 reverse)"; break;
2730     case 28: str = "High Speed Packet Data Service: CDPD Protocol Stack (RS2 forward, RS1 reverse)"; break;
2731     case 29: str = "High Speed Packet Data Service: CDPD Protocol Stack (RS2 forward, RS2 reverse)"; break;
2732     case 30: str = "Supplemental Channel Loopback Test for Rate Set 1"; break;
2733     case 31: str = "Supplemental Channel Loopback Test for Rate Set 2"; break;
2734     case 32: str = "Test Data Service Option (TDSO)"; break;
2735     case 33: str = "cdma2000 High Speed Packet Data Service, Internet or ISO Protocol Stack"; break;
2736     case 34: str = "cdma2000 High Speed Packet Data Service, CDPD Protocol Stack"; break;
2737     case 35: str = "Location Services, Rate Set 1 (9.6 kbps)"; break;
2738     case 36: str = "Location Services, Rate Set 2 (14.4 kbps)"; break;
2739     case 37: str = "ISDN Interworking Service (64 kbps)"; break;
2740     case 38: str = "GSM Voice"; break;
2741     case 39: str = "GSM Circuit Data"; break;
2742     case 40: str = "GSM Packet Data"; break;
2743     case 41: str = "GSM Short Message Service"; break;
2744     case 42: str = "None Reserved for MC-MAP standard service options"; break;
2745     case 54: str = "Markov Service Option (MSO)"; break;
2746     case 55: str = "Loopback Service Option (LSO)"; break;
2747     case 56: str = "Selectable Mode Vocoder"; break;
2748     case 57: str = "32 kbps Circuit Video Conferencing"; break;
2749     case 58: str = "64 kbps Circuit Video Conferencing"; break;
2750     case 59: str = "HRPD Accounting Records Identifier"; break;
2751     case 60: str = "Link Layer Assisted Robust Header Compression (LLA ROHC) - Header Removal"; break;
2752     case 61: str = "Link Layer Assisted Robust Header Compression (LLA ROHC) - Header Compression"; break;
2753     case 62: str = "- 4099 None Reserved for standard service options"; break;
2754     case 4100: str = "Asynchronous Data Service, Revision 1 (9.6 or 14.4 kbps)"; break;
2755     case 4101: str = "Group 3 Facsimile, Revision 1 (9.6 or 14.4 kbps)"; break;
2756     case 4102: str = "Reserved for standard service option"; break;
2757     case 4103: str = "Packet Data Service: Internet or ISO Protocol Stack, Revision 1 (9.6 or 14.4 kbps)"; break;
2758     case 4104: str = "Packet Data Service: CDPD Protocol Stack, Revision 1 (9.6 or 14.4 kbps)"; break;
2759     default:
2760         if ((so >= 4105) && (so <= 32767)) { str = "Reserved for standard service options"; }
2761         else if ((so >= 32769) && (so <= 32771)) { str = "Proprietary QUALCOMM Incorporated"; }
2762         else if ((so >= 32772) && (so <= 32775)) { str = "Proprietary OKI Telecom"; }
2763         else if ((so >= 32776) && (so <= 32779)) { str = "Proprietary Lucent Technologies"; }
2764         else if ((so >= 32780) && (so <=32783)) { str = "Nokia"; }
2765         else if ((so >= 32784) && (so <=32787)) { str = "NORTEL NETWORKS"; }
2766         else if ((so >= 32788) && (so <=32791)) { str = "Sony Electronics Inc."; }
2767         else if ((so >= 32792) && (so <=32795)) { str = "Motorola"; }
2768         else if ((so >= 32796) && (so <=32799)) { str = "QUALCOMM Incorporated"; }
2769         else if ((so >= 32800) && (so <=32803)) { str = "QUALCOMM Incorporated"; }
2770         else if ((so >= 32804) && (so <=32807)) { str = "QUALCOMM Incorporated"; }
2771         else if ((so >= 32808) && (so <=32811)) { str = "QUALCOMM Incorporated"; }
2772         else if ((so >= 32812) && (so <=32815)) { str = "Lucent Technologies"; }
2773         else if ((so >= 32816) && (so <=32819)) { str = "Denso International"; }
2774         else if ((so >= 32820) && (so <=32823)) { str = "Motorola"; }
2775         else if ((so >= 32824) && (so <=32827)) { str = "Denso International"; }
2776         else if ((so >= 32828) && (so <=32831)) { str = "Denso International"; }
2777         else if ((so >= 32832) && (so <=32835)) { str = "Denso International"; }
2778         else if ((so >= 32836) && (so <=32839)) { str = "NEC America"; }
2779         else if ((so >= 32840) && (so <=32843)) { str = "Samsung Electronics"; }
2780         else if ((so >= 32844) && (so <=32847)) { str = "Texas Instruments Incorporated"; }
2781         else if ((so >= 32848) && (so <=32851)) { str = "Toshiba Corporation"; }
2782         else if ((so >= 32852) && (so <=32855)) { str = "LG Electronics Inc."; }
2783         else if ((so >= 32856) && (so <=32859)) { str = "VIA Telecom Inc."; }
2784         else { str = "Reserved"; }
2785         break;
2786     }
2787
2788     proto_tree_add_text(tree, asn1->tvb,
2789         saved_offset, asn1->offset - saved_offset,
2790         "%s %u/0x%04x",
2791         str, so, so);
2792
2793     sprintf(add_string, " - (SO=0x%04x)", so);
2794
2795     EXTRANEOUS_DATA_CHECK(len, 2);
2796 }
2797
2798 static void
2799 param_tdma_sc(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
2800 {
2801     gint32 value;
2802     guint saved_offset;
2803     const gchar *str = NULL;
2804
2805     saved_offset = asn1->offset;
2806
2807     asn1_int32_value_decode(asn1, 1, &value);
2808
2809     switch (value)
2810     {
2811     case 0: str = "Analog Speech Only"; break;
2812     case 1: str = "Digital Speech Only"; break;
2813     case 2: str = "Analog or Digital Speech, Analog Preferred"; break;
2814     case 3: str = "Analog or Digital Speech, Digital Preferred"; break;
2815     case 4: str = "Asynchronous Data"; break;
2816     case 5: str = "G3 Fax"; break;
2817     case 6: str = "Not Used (Service Rejected)"; break;
2818     case 7: str = "STU III (Secure Telephone Unit)"; break;
2819     default:
2820         str = "Reserved, treat as Analog Speech Only";
2821         break;
2822     }
2823
2824     proto_tree_add_text(tree, asn1->tvb,
2825         saved_offset, asn1->offset - saved_offset,
2826         "%s %u",
2827         str, value);
2828
2829     EXTRANEOUS_DATA_CHECK(len, 1);
2830 }
2831
2832 static void
2833 param_dmh_red_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
2834 {
2835     gint32 redind;
2836     guint saved_offset;
2837     const gchar *str = NULL;
2838
2839     EXACT_DATA_CHECK(len, 1);
2840
2841     saved_offset = asn1->offset;
2842
2843     asn1_int32_value_decode(asn1, 1, &redind);
2844
2845     switch (redind)
2846     {
2847     case 0: str = "Not used"; break;
2848     case 1: str = "Call Forwarding Unconditional (CFU)"; break;
2849     case 2: str = "Call Forwarding Busy (CFB)"; break;
2850     case 3: str = "Call Forwarding No Answer (CFNA)"; break;
2851     case 4: str = "Call Forwarding Other (CFO)"; break;
2852     case 5: str = "CD Unspecified"; break;
2853     case 6: str = "CD PSTN"; break;
2854     case 7: str = "CD Private"; break;
2855     case 8: str = "PSTN Tandem"; break;
2856     case 9: str = "Private Tandem"; break;
2857     case 10: str = "Busy"; break;
2858     case 11: str = "Inactive"; break;
2859     case 12: str = "Unassigned"; break;
2860     case 13: str = "Termination Denied"; break;
2861     case 14: str = "CD Failure"; break;
2862     case 15: str = "Explicit Call Transfer (ECT)"; break;
2863     case 16: str = "Mobile Access Hunting (MAH)"; break;
2864     case 17: str = "Flexible Alerting (FA)"; break;
2865     case 18: str = "Abandoned Call Leg"; break;
2866     case 19: str = "Password Call Acceptance (PCA) Call Refused"; break;
2867     case 20: str = "Selective Call Acceptance (SCA) Call Refused"; break;
2868     case 21: str = "Dialogue"; break;
2869     case 22: str = "Call Forwarding Default (CFD)"; break;
2870     case 23: str = "CD Local"; break;
2871     case 24: str = "Voice Mail Retrieval"; break;
2872     default:
2873         if ((redind >= 25) && (redind <= 127))
2874         {
2875             str = "Reserved/Unknown";
2876         }
2877         else
2878         {
2879             str = "Reserved for bilateral agreements";
2880         }
2881         break;
2882     }
2883
2884     proto_tree_add_text(tree, asn1->tvb,
2885         saved_offset, asn1->offset - saved_offset,
2886         "%s (%u)",
2887         str, redind);
2888 }
2889
2890 static void
2891 param_cic(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
2892 {
2893     gint32 tg, mem;
2894     guint saved_offset;
2895
2896     EXACT_DATA_CHECK(len, 2);
2897
2898     saved_offset = asn1->offset;
2899
2900     asn1_int32_value_decode(asn1, 1, &tg);
2901     asn1_int32_value_decode(asn1, 1, &mem);
2902
2903     proto_tree_add_text(tree, asn1->tvb,
2904         saved_offset, len,
2905         "Trunk Group %u  Member %u",
2906         tg, mem);
2907
2908     sprintf(add_string, "- (%u/%u)", tg, mem);
2909 }
2910
2911 static void
2912 param_qic(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
2913 {
2914     gint32 qic;
2915     guint saved_offset;
2916     const gchar *str = NULL;
2917
2918     EXACT_DATA_CHECK(len, 1);
2919
2920     saved_offset = asn1->offset;
2921
2922     asn1_int32_value_decode(asn1, 1, &qic);
2923
2924     switch (qic)
2925     {
2926     case 0: str = "Not used"; break;
2927     case 1: str = "No information"; break;
2928     case 2: str = "Validation only"; break;
2929     case 3: str = "Validation and profile"; break;
2930     case 4: str = "Profile only"; break;
2931     default:
2932         if ((qic >= 5) && (qic <= 223))
2933         {
2934             str = "Reserved, treat as Validation and profile";
2935         }
2936         else
2937         {
2938             str = "Reserved for extension, treat as Validation and profile";
2939         }
2940         break;
2941     }
2942
2943     proto_tree_add_text(tree, asn1->tvb,
2944         saved_offset, asn1->offset - saved_offset,
2945         str);
2946 }
2947
2948 static void
2949 param_feat_result(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
2950 {
2951     gint32 value;
2952     guint saved_offset;
2953     const gchar *str = NULL;
2954
2955     EXACT_DATA_CHECK(len, 1);
2956
2957     saved_offset = asn1->offset;
2958
2959     asn1_int32_value_decode(asn1, 1, &value);
2960
2961     switch (value)
2962     {
2963     case 0: str = "Not used"; break;
2964     case 1: str = "Unsuccessful"; break;
2965     case 2: str = "Successful"; break;
2966     default:
2967         if ((value >= 3) && (value <= 95)) { str = "Reserved, treat as Unsuccessful"; }
2968         else if ((value >= 96) && (value <= 127)) { str = "Reserved, treat as Unsuccessful"; }
2969         else if ((value >= 128) && (value <= 223)) { str = "Reserved, treat as Successful"; }
2970         else { str = "Reserved for protocol extension, treat as Successful"; }
2971         break;
2972     }
2973
2974     proto_tree_add_text(tree, asn1->tvb,
2975         saved_offset, asn1->offset - saved_offset,
2976         str);
2977 }
2978
2979 const gchar *calling_feat_ind_str[] = {
2980     "Not used",
2981     "Not authorized",
2982     "Authorized but de-activated",
2983     "Authorized and activated"
2984 };
2985
2986 static void
2987 param_calling_feat_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
2988 {
2989     gint32 value;
2990     guint saved_offset;
2991
2992     SHORT_DATA_CHECK(len, 2);
2993
2994     saved_offset = asn1->offset;
2995
2996     asn1_int32_value_decode(asn1, 1, &value);
2997
2998     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
2999     proto_tree_add_text(tree, asn1->tvb,
3000         saved_offset, asn1->offset - saved_offset,
3001         "%s :  Call Waiting Feature Activity (CW-FA), %s",
3002         bigbuf,
3003         calling_feat_ind_str[(value & 0xc0) >> 6]);
3004
3005     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
3006     proto_tree_add_text(tree, asn1->tvb,
3007         saved_offset, asn1->offset - saved_offset,
3008         "%s :  Call Forwarding No Answer Feature Activity (CFNA-FA), %s",
3009         bigbuf,
3010         calling_feat_ind_str[(value & 0x30) >> 4]);
3011
3012     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
3013     proto_tree_add_text(tree, asn1->tvb,
3014         saved_offset, asn1->offset - saved_offset,
3015         "%s :  Call Forwarding Busy Feature Activity (CFB-FA), %s",
3016         bigbuf,
3017         calling_feat_ind_str[(value & 0x0c) >> 2]);
3018
3019     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3020     proto_tree_add_text(tree, asn1->tvb,
3021         saved_offset, asn1->offset - saved_offset,
3022         "%s :  Call Forwarding Unconditional Feature Activity (CFU-FA), %s",
3023         bigbuf,
3024         calling_feat_ind_str[value & 0x03]);
3025
3026     saved_offset = asn1->offset;
3027
3028     asn1_int32_value_decode(asn1, 1, &value);
3029
3030     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3031     proto_tree_add_text(tree, asn1->tvb,
3032         saved_offset, asn1->offset - saved_offset,
3033         "%s :  Call Transfer Feature Activity (CT-FA), %s",
3034         bigbuf,
3035         calling_feat_ind_str[(value & 0xc0) >> 6]);
3036
3037     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
3038     proto_tree_add_text(tree, asn1->tvb,
3039         saved_offset, asn1->offset - saved_offset,
3040         "%s :  Voice Privacy Feature Activity (VP-FA), %s",
3041         bigbuf,
3042         calling_feat_ind_str[(value & 0x30) >> 4]);
3043
3044     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
3045     proto_tree_add_text(tree, asn1->tvb,
3046         saved_offset, asn1->offset - saved_offset,
3047         "%s :  Call Delivery Feature Activity (CD-FA), %s",
3048         bigbuf,
3049         calling_feat_ind_str[(value & 0x0c) >> 2]);
3050
3051     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3052     proto_tree_add_text(tree, asn1->tvb,
3053         saved_offset, asn1->offset - saved_offset,
3054         "%s :  Three-Way Calling Feature Activity (3WC-FA), %s",
3055         bigbuf,
3056         calling_feat_ind_str[value & 0x03]);
3057
3058     if (len == 2) return;
3059
3060     saved_offset = asn1->offset;
3061
3062     asn1_int32_value_decode(asn1, 1, &value);
3063
3064     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3065     proto_tree_add_text(tree, asn1->tvb,
3066         saved_offset, asn1->offset - saved_offset,
3067         "%s :  Calling Number ID Restriction Override Feature Activity (CNIROver-FA), %s",
3068         bigbuf,
3069         calling_feat_ind_str[(value & 0xc0) >> 6]);
3070
3071     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
3072     proto_tree_add_text(tree, asn1->tvb,
3073         saved_offset, asn1->offset - saved_offset,
3074         "%s :  Calling Number ID Restriction Feature Activity (CNIR-FA), %s",
3075         bigbuf,
3076         calling_feat_ind_str[(value & 0x30) >> 4]);
3077
3078     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
3079     proto_tree_add_text(tree, asn1->tvb,
3080         saved_offset, asn1->offset - saved_offset,
3081         "%s :  Two number Calling Number ID Presentation Feature Activity (CNIP2-FA), %s",
3082         bigbuf,
3083         calling_feat_ind_str[(value & 0x0c) >> 2]);
3084
3085     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3086     proto_tree_add_text(tree, asn1->tvb,
3087         saved_offset, asn1->offset - saved_offset,
3088         "%s :  One number Calling Number ID Presentation Feature Activity (CNIP1-FA), %s",
3089         bigbuf,
3090         calling_feat_ind_str[value & 0x03]);
3091
3092     if (len == 3) return;
3093
3094     saved_offset = asn1->offset;
3095
3096     asn1_int32_value_decode(asn1, 1, &value);
3097
3098     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3099     proto_tree_add_text(tree, asn1->tvb,
3100         saved_offset, asn1->offset - saved_offset,
3101         "%s :  USCF divert to voice mail Feature Activity (USCFvm-FA), %s",
3102         bigbuf,
3103         calling_feat_ind_str[(value & 0xc0) >> 6]);
3104
3105     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
3106     proto_tree_add_text(tree, asn1->tvb,
3107         saved_offset, asn1->offset - saved_offset,
3108         "%s :  Answer Hold Feature Activity (AH-FA), %s",
3109         bigbuf,
3110         calling_feat_ind_str[(value & 0x30) >> 4]);
3111
3112     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
3113     proto_tree_add_text(tree, asn1->tvb,
3114         saved_offset, asn1->offset - saved_offset,
3115         "%s :  Data Privacy Feature Activity (DP-FA), %s",
3116         bigbuf,
3117         calling_feat_ind_str[(value & 0x0c) >> 2]);
3118
3119     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3120     proto_tree_add_text(tree, asn1->tvb,
3121         saved_offset, asn1->offset - saved_offset,
3122         "%s :  Priority Call Waiting Feature Activity (PCW-FA), %s",
3123         bigbuf,
3124         calling_feat_ind_str[value & 0x03]);
3125
3126     if (len == 4) return;
3127
3128     saved_offset = asn1->offset;
3129
3130     asn1_int32_value_decode(asn1, 1, &value);
3131
3132     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3133     proto_tree_add_text(tree, asn1->tvb,
3134         saved_offset, asn1->offset - saved_offset,
3135         "%s :  CDMA-Concurrent Service Feature Activity (CCS-FA), %s",
3136         bigbuf,
3137         calling_feat_ind_str[(value & 0xc0) >> 6]);
3138
3139     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
3140     proto_tree_add_text(tree, asn1->tvb,
3141         saved_offset, asn1->offset - saved_offset,
3142         "%s :  CDMA-Packet Data Service Feature Activity (CPDS-FA), %s",
3143         bigbuf,
3144         calling_feat_ind_str[(value & 0x30) >> 4]);
3145
3146     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
3147     proto_tree_add_text(tree, asn1->tvb,
3148         saved_offset, asn1->offset - saved_offset,
3149         "%s :  USCF divert to network registered DN Feature Activity (USCFnr-FA), %s",
3150         bigbuf,
3151         calling_feat_ind_str[(value & 0x0c) >> 2]);
3152
3153     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3154     proto_tree_add_text(tree, asn1->tvb,
3155         saved_offset, asn1->offset - saved_offset,
3156         "%s :  USCF divert to mobile station provided DN Feature Activity (USCFms-FA), %s",
3157         bigbuf,
3158         calling_feat_ind_str[value & 0x03]);
3159
3160     if (len == 5) return;
3161
3162     saved_offset = asn1->offset;
3163
3164     asn1_int32_value_decode(asn1, 1, &value);
3165
3166     other_decode_bitfield_value(bigbuf, value, 0xfc, 8);
3167     proto_tree_add_text(tree, asn1->tvb,
3168         saved_offset, asn1->offset - saved_offset,
3169         "%s :  Reserved",
3170         bigbuf);
3171
3172     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3173     proto_tree_add_text(tree, asn1->tvb,
3174         saved_offset, asn1->offset - saved_offset,
3175         "%s :  TDMA Enhanced Privacy and Encryption Feature Activity (TDMA EPE-FA), %s",
3176         bigbuf,
3177         calling_feat_ind_str[value & 0x03]);
3178
3179     EXTRANEOUS_DATA_CHECK(len, 6);
3180 }
3181
3182 static void
3183 param_usage_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
3184 {
3185     gint32 value;
3186     guint saved_offset;
3187     const gchar *str = NULL;
3188
3189     EXACT_DATA_CHECK(len, 1);
3190
3191     saved_offset = asn1->offset;
3192
3193     asn1_int32_value_decode(asn1, 1, &value);
3194
3195     switch (value)
3196     {
3197     case 0: str = "Unspecified"; break;
3198     case 1: str = "Sent-paid call"; break;
3199     case 2: str = "3rd number bill"; break;
3200     default:
3201         str = "Reserved, treat as Unspecified";
3202         break;
3203     }
3204
3205     proto_tree_add_text(tree, asn1->tvb,
3206         saved_offset, asn1->offset - saved_offset,
3207         "%s (%u)",
3208         str,
3209         value);
3210 }
3211
3212 const gchar *tdma_data_feat_ind_str[] = {
3213     "Not used",
3214     "Not authorized",
3215     "Authorized but de-activated",
3216     "Authorized and activated"
3217 };
3218
3219 static void
3220 param_tdma_data_feat_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
3221 {
3222     gint32 value;
3223     guint saved_offset;
3224
3225     SHORT_DATA_CHECK(len, 2);
3226
3227     saved_offset = asn1->offset;
3228
3229     asn1_int32_value_decode(asn1, 1, &value);
3230
3231     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3232     proto_tree_add_text(tree, asn1->tvb,
3233         saved_offset, asn1->offset - saved_offset,
3234         "%s :  Reserved",
3235         bigbuf);
3236
3237     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
3238     proto_tree_add_text(tree, asn1->tvb,
3239         saved_offset, asn1->offset - saved_offset,
3240         "%s :  STU-III Feature Activity (STUIII-FA), %s",
3241         bigbuf,
3242         tdma_data_feat_ind_str[(value & 0x30) >> 4]);
3243
3244     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
3245     proto_tree_add_text(tree, asn1->tvb,
3246         saved_offset, asn1->offset - saved_offset,
3247         "%s :  G3 Fax Feature Activity (G3FAX-FA), %s",
3248         bigbuf,
3249         tdma_data_feat_ind_str[(value & 0x0c) >> 2]);
3250
3251     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3252     proto_tree_add_text(tree, asn1->tvb,
3253         saved_offset, asn1->offset - saved_offset,
3254         "%s :  ADS Feature Activity (ADS-FA), %s",
3255         bigbuf,
3256         tdma_data_feat_ind_str[value & 0x03]);
3257
3258     saved_offset = asn1->offset;
3259
3260     asn1_int32_value_decode(asn1, 1, &value);
3261
3262     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3263     proto_tree_add_text(tree, asn1->tvb,
3264         saved_offset, asn1->offset - saved_offset,
3265         "%s :  Triple Rate data Feature Activity (3RATE-FA), %s",
3266         bigbuf,
3267         tdma_data_feat_ind_str[(value & 0xc0) >> 6]);
3268
3269     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
3270     proto_tree_add_text(tree, asn1->tvb,
3271         saved_offset, asn1->offset - saved_offset,
3272         "%s :  Double Rate data Feature Activity (2RATE-FA), %s",
3273         bigbuf,
3274         tdma_data_feat_ind_str[(value & 0x30) >> 4]);
3275
3276     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
3277     proto_tree_add_text(tree, asn1->tvb,
3278         saved_offset, asn1->offset - saved_offset,
3279         "%s :  Full Rate data Feature Activity (FRATE-FA), %s",
3280         bigbuf,
3281         tdma_data_feat_ind_str[(value & 0x0c) >> 2]);
3282
3283     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3284     proto_tree_add_text(tree, asn1->tvb,
3285         saved_offset, asn1->offset - saved_offset,
3286         "%s :  Half Rate data Feature Activity (HRATE-FA), %s",
3287         bigbuf,
3288         tdma_data_feat_ind_str[value & 0x03]);
3289
3290     EXTRANEOUS_DATA_CHECK(len, 2);
3291 }
3292
3293 static void
3294 param_faulty(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
3295 {
3296     gint32 value;
3297     guint saved_offset;
3298     const gchar *str = NULL;
3299     gint idx;
3300
3301     saved_offset = asn1->offset;
3302     asn1_int32_value_decode(asn1, 1, &value);
3303
3304     str = match_strval_idx((guint32) value, ansi_param_1_strings, &idx);
3305
3306     if (NULL == str)
3307     {
3308         if (len < 2)
3309         {
3310             proto_tree_add_text(tree, asn1->tvb,
3311                 saved_offset, len,
3312                 "Unrecognized parameter ID");
3313             return;
3314         }
3315
3316         asn1->offset = saved_offset;
3317         asn1_uint32_value_decode(asn1, 2, &value);
3318
3319         str = match_strval_idx((guint32) value, ansi_param_2_strings, &idx);
3320
3321         if (NULL == str)
3322         {
3323             if (len < 3)
3324             {
3325                 proto_tree_add_text(tree, asn1->tvb,
3326                     saved_offset, len,
3327                     "Unrecognized parameter ID");
3328                 return;
3329             }
3330
3331             asn1->offset = saved_offset;
3332             asn1_int32_value_decode(asn1, 3, &value);
3333
3334             str = match_strval_idx((guint32) value, ansi_param_3_strings, &idx);
3335
3336             if (NULL == str)
3337             {
3338                 if (((value >= 0x9FFF00) && (value <= 0x9FFF7F)) ||
3339                     ((value >= 0xBFFF00) && (value <= 0xBFFF7F)))
3340                 {
3341                     str = "Reserved for protocol extension";
3342                 }
3343                 else if (((value >= 0x9FFE76) && (value <= 0x9FFE7F)) ||
3344                     ((value >= 0xBFFE76) && (value <= 0xBFFE7F)))
3345                 {
3346                     str = "Reserved for National Network Use";
3347                 }
3348                 else
3349                 {
3350                     str = "Unrecognized parameter ID";
3351                 }
3352             }
3353         }
3354     }
3355
3356     proto_tree_add_text(tree, asn1->tvb,
3357         saved_offset, asn1->offset - saved_offset,
3358         str);
3359
3360     EXTRANEOUS_DATA_CHECK(len, asn1->offset - saved_offset);
3361 }
3362
3363 static void
3364 param_sys_type_code(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
3365 {
3366     gint32 sys_type_code;
3367     guint saved_offset;
3368     const gchar *str = NULL;
3369
3370     EXACT_DATA_CHECK(len, 1);
3371
3372     saved_offset = asn1->offset;
3373
3374     asn1_int32_value_decode(asn1, 1, &sys_type_code);
3375
3376     switch (sys_type_code)
3377     {
3378     case 0: str = "Not used"; break;
3379     case 1: str = "EDS"; break;
3380     case 2: str = "Astronet"; break;
3381     case 3: str = "Lucent Technologies"; break;
3382     case 4: str = "Ericsson"; break;
3383     case 5: str = "GTE"; break;
3384     case 6: str = "Motorola"; break;
3385     case 7: str = "NEC"; break;
3386     case 8: str = "NORTEL"; break;
3387     case 9: str = "NovAtel"; break;
3388     case 10: str = "Plexsys"; break;
3389     case 11: str = "Digital Equipment Corp"; break;
3390     case 12: str = "INET"; break;
3391     case 13: str = "Bellcore"; break;
3392     case 14: str = "Alcatel SEL"; break;
3393     case 15: str = "Compaq (Tandem)"; break;
3394     case 16: str = "QUALCOMM"; break;
3395     case 17: str = "Aldiscon"; break;
3396     case 18: str = "Celcore"; break;
3397     case 19: str = "TELOS"; break;
3398     case 20: str = "ADI Limited (Stanilite)"; break;
3399     case 21: str = "Coral Systems"; break;
3400     case 22: str = "Synacom Technology"; break;
3401     case 23: str = "DSC"; break;
3402     case 24: str = "MCI"; break;
3403     case 25: str = "NewNet"; break;
3404     case 26: str = "Sema Group Telecoms"; break;
3405     case 27: str = "LG Information and Communications"; break;
3406     case 28: str = "CBIS"; break;
3407     case 29: str = "Siemens"; break;
3408     case 30: str = "Samsung Electronics"; break;
3409     case 31: str = "ReadyCom Inc."; break;
3410     case 32: str = "AG Communication Systems"; break;
3411     case 33: str = "Hughes Network Systems"; break;
3412     case 34: str = "Phoenix Wireless Group"; break;
3413     default:
3414         str = "Reserved/Unknown";
3415         break;
3416     }
3417
3418     proto_tree_add_text(tree, asn1->tvb,
3419         saved_offset, asn1->offset - saved_offset,
3420         "Vendor ID (%u) %s",
3421         sys_type_code, str);
3422 }
3423
3424 static void
3425 param_ext_sys_type_code(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
3426 {
3427     gint32 type;
3428     guint saved_offset;
3429     const gchar *str = NULL;
3430
3431     EXACT_DATA_CHECK(len, 2);
3432
3433     saved_offset = asn1->offset;
3434
3435     asn1_int32_value_decode(asn1, 1, &type);
3436
3437     switch (type)
3438     {
3439     case 0: str = "Not specified"; break;
3440     case 1: str = "Serving MSC"; break;
3441     case 2: str = "Home MSC"; break;
3442     case 3: str = "Gateway MSC"; break;
3443     case 4: str = "HLR"; break;
3444     case 5: str = "VLR"; break;
3445     case 6: str = "EIR (reserved)"; break;
3446     case 7: str = "AC"; break;
3447     case 8: str = "Border MSC"; break;
3448     case 9: str = "Originating MSC"; break;
3449     default:
3450         if ((type >= 10) && (type <= 223)) { str = "Reserved, treat as Not specified"; }
3451         else { str = "Reserved for protocol extension, treat as Not specified"; }
3452         break;
3453     }
3454
3455     proto_tree_add_text(tree, asn1->tvb,
3456         saved_offset, asn1->offset - saved_offset,
3457         "Type (%u) %s",
3458         type,
3459         str);
3460
3461     param_sys_type_code(asn1, tree, len-1, add_string);
3462 }
3463
3464 static void
3465 param_cdma_sea_win(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
3466 {
3467     gint32 value;
3468     guint saved_offset;
3469
3470     EXACT_DATA_CHECK(len, 1);
3471
3472     saved_offset = asn1->offset;
3473
3474     asn1_int32_value_decode(asn1, 1, &value);
3475
3476     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
3477     proto_tree_add_text(tree, asn1->tvb,
3478         saved_offset, asn1->offset - saved_offset,
3479         "%s :  Reserved",
3480         bigbuf);
3481
3482     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
3483     proto_tree_add_text(tree, asn1->tvb,
3484         saved_offset, asn1->offset - saved_offset,
3485         "%s :  Value %u",
3486         bigbuf,
3487         value & 0x0f);
3488 }
3489
3490 static void
3491 param_cdma_sea_param(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
3492 {
3493     gint32 value;
3494     guint saved_offset;
3495
3496     SHORT_DATA_CHECK(len, 4);
3497
3498     saved_offset = asn1->offset;
3499
3500     asn1_int32_value_decode(asn1, 1, &value);
3501
3502     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
3503     proto_tree_add_text(tree, asn1->tvb,
3504         saved_offset, asn1->offset - saved_offset,
3505         "%s :  Reserved",
3506         bigbuf);
3507
3508     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
3509     proto_tree_add_text(tree, asn1->tvb,
3510         saved_offset, asn1->offset - saved_offset,
3511         "%s :  CDMA Search Window, %u",
3512         bigbuf,
3513         value & 0x0f);
3514
3515     saved_offset = asn1->offset;
3516
3517     asn1_int32_value_decode(asn1, 1, &value);
3518
3519     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3520     proto_tree_add_text(tree, asn1->tvb,
3521         saved_offset, asn1->offset - saved_offset,
3522         "%s :  Reserved",
3523         bigbuf);
3524
3525     other_decode_bitfield_value(bigbuf, value, 0x3f, 8);
3526     proto_tree_add_text(tree, asn1->tvb,
3527         saved_offset, asn1->offset - saved_offset,
3528         "%s :  T_ADD, %u",
3529         bigbuf,
3530         value & 0x3f);
3531
3532     saved_offset = asn1->offset;
3533
3534     asn1_int32_value_decode(asn1, 1, &value);
3535
3536     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3537     proto_tree_add_text(tree, asn1->tvb,
3538         saved_offset, asn1->offset - saved_offset,
3539         "%s :  Reserved",
3540         bigbuf);
3541
3542     other_decode_bitfield_value(bigbuf, value, 0x3f, 8);
3543     proto_tree_add_text(tree, asn1->tvb,
3544         saved_offset, asn1->offset - saved_offset,
3545         "%s :  T_DROP, %u",
3546         bigbuf,
3547         value & 0x3f);
3548
3549     saved_offset = asn1->offset;
3550
3551     asn1_int32_value_decode(asn1, 1, &value);
3552
3553     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
3554     proto_tree_add_text(tree, asn1->tvb,
3555         saved_offset, asn1->offset - saved_offset,
3556         "%s :  T_TDROP, %u",
3557         bigbuf,
3558         value & 0xf0);
3559
3560     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
3561     proto_tree_add_text(tree, asn1->tvb,
3562         saved_offset, asn1->offset - saved_offset,
3563         "%s :  T_COMP, %u",
3564         bigbuf,
3565         value & 0x0f);
3566
3567     EXTRANEOUS_DATA_CHECK(len, 4);
3568 }
3569
3570 static void
3571 param_cdma_code_chan(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
3572 {
3573     gint32 value;
3574     guint saved_offset;
3575
3576     saved_offset = asn1->offset;
3577
3578     asn1_int32_value_decode(asn1, 1, &value);
3579
3580     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3581     proto_tree_add_text(tree, asn1->tvb,
3582         saved_offset, asn1->offset - saved_offset,
3583         "%s :  Reserved",
3584         bigbuf);
3585
3586     other_decode_bitfield_value(bigbuf, value, 0x3f, 8);
3587     proto_tree_add_text(tree, asn1->tvb,
3588         saved_offset, asn1->offset - saved_offset,
3589         "%s :  CDMA Code Channel %u",
3590         bigbuf,
3591         value & 0x3f);
3592
3593     EXTRANEOUS_DATA_CHECK(len, 1);
3594 }
3595
3596 static void
3597 param_chan_data(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
3598 {
3599     gint32 value;
3600     guint saved_offset;
3601     const gchar *str = NULL;
3602
3603     SHORT_DATA_CHECK(len, 3);
3604
3605     saved_offset = asn1->offset;
3606
3607     asn1_int32_value_decode(asn1, 1, &value);
3608
3609     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3610     proto_tree_add_text(tree, asn1->tvb,
3611         saved_offset, asn1->offset - saved_offset,
3612         "%s :  SAT Color Code %u",
3613         bigbuf,
3614         (value & 0xc0 >> 6));
3615
3616     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
3617     proto_tree_add_text(tree, asn1->tvb,
3618         saved_offset, asn1->offset - saved_offset,
3619         "%s :  %s",
3620         (value & 0x20) ? "Reserved" : "Analog Band Class",
3621         bigbuf);
3622
3623     switch ((value & 0x18) >> 3)
3624     {
3625     case 0: str = "DTX disabled (not active/acceptable)"; break;
3626     case 1: str = "Reserved, treat as DTX disabled"; break;
3627     case 2: str = "DTX-low mode (i.e., 8 dB below DTX active/acceptable)"; break;
3628     case 3: str = "DTX mode active or acceptable"; break;
3629     }
3630
3631     other_decode_bitfield_value(bigbuf, value, 0x18, 8);
3632     proto_tree_add_text(tree, asn1->tvb,
3633         saved_offset, asn1->offset - saved_offset,
3634         "%s :  %s",
3635         bigbuf,
3636         str);
3637
3638     other_decode_bitfield_value(bigbuf, value, 0x07, 8);
3639     proto_tree_add_text(tree, asn1->tvb,
3640         saved_offset, asn1->offset - saved_offset,
3641         "%s :  Voice Mobile Attenuation Code (VMAC) %u",
3642         bigbuf,
3643         value & 0x07);
3644
3645     saved_offset = asn1->offset;
3646
3647     asn1_int32_value_decode(asn1, 2, &value);
3648
3649     proto_tree_add_text(tree, asn1->tvb,
3650         saved_offset, asn1->offset - saved_offset,
3651         "Channel Number %u",
3652         value);
3653
3654     EXTRANEOUS_DATA_CHECK(len, 3);
3655 }
3656
3657 static void
3658 param_cdma_plcm(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
3659 {
3660     gint32 value;
3661     guint saved_offset;
3662
3663     EXACT_DATA_CHECK(len, 6);
3664
3665     saved_offset = asn1->offset;
3666
3667     asn1_int32_value_decode(asn1, 1, &value);
3668
3669     other_decode_bitfield_value(bigbuf, value, 0xfc, 8);
3670     proto_tree_add_text(tree, asn1->tvb,
3671         saved_offset, asn1->offset - saved_offset,
3672         "%s :  Reserved",
3673         bigbuf);
3674
3675     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3676     proto_tree_add_text(tree, asn1->tvb,
3677         saved_offset, asn1->offset - saved_offset,
3678         "%s :  CDMA Private Long Code Mask (PLCM) (MSB)",
3679         bigbuf);
3680
3681     saved_offset = asn1->offset;
3682
3683     proto_tree_add_text(tree, asn1->tvb,
3684         saved_offset, len - 1,
3685         "CDMA Private Long Code Mask (PLCM)");
3686
3687     asn1->offset += (len - 1);
3688 }
3689
3690 static void
3691 param_ctrl_chan_data(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
3692 {
3693     gint32 value;
3694     guint saved_offset;
3695
3696     EXACT_DATA_CHECK(len, 4);
3697
3698     saved_offset = asn1->offset;
3699
3700     asn1_int32_value_decode(asn1, 1, &value);
3701
3702     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3703     proto_tree_add_text(tree, asn1->tvb,
3704         saved_offset, asn1->offset - saved_offset,
3705         "%s :  Digital Color Code (DCC)",
3706         bigbuf);
3707
3708     other_decode_bitfield_value(bigbuf, value, 0x38, 8);
3709     proto_tree_add_text(tree, asn1->tvb,
3710         saved_offset, asn1->offset - saved_offset,
3711         "%s :  Reserved",
3712         bigbuf);
3713
3714     other_decode_bitfield_value(bigbuf, value, 0x07, 8);
3715     proto_tree_add_text(tree, asn1->tvb,
3716         saved_offset, asn1->offset - saved_offset,
3717         "%s :  Control Mobile Attenuation Code (CMAC)",
3718         bigbuf);
3719
3720     saved_offset = asn1->offset;
3721
3722     asn1_int32_value_decode(asn1, 2, &value);
3723
3724     proto_tree_add_text(tree, asn1->tvb,
3725         saved_offset, asn1->offset - saved_offset,
3726         "Channel Number (CHNO), %u",
3727         value);
3728
3729     saved_offset = asn1->offset;
3730
3731     asn1_int32_value_decode(asn1, 1, &value);
3732
3733     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
3734     proto_tree_add_text(tree, asn1->tvb,
3735         saved_offset, asn1->offset - saved_offset,
3736         "%s :  Reserved",
3737         bigbuf);
3738
3739     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
3740     proto_tree_add_text(tree, asn1->tvb,
3741         saved_offset, asn1->offset - saved_offset,
3742         "%s :  Supplementary Digital Color Codes (SDCC1)",
3743         bigbuf);
3744
3745     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3746     proto_tree_add_text(tree, asn1->tvb,
3747         saved_offset, asn1->offset - saved_offset,
3748         "%s :  Supplementary Digital Color Codes (SDCC2)",
3749         bigbuf);
3750 }
3751
3752 static void
3753 param_cdma_chan_data(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
3754 {
3755     gint32 value, temp_int;
3756     guint saved_offset;
3757     const gchar *str = NULL;
3758
3759     SHORT_DATA_CHECK(len, 8);
3760
3761     saved_offset = asn1->offset;
3762
3763     asn1_int32_value_decode(asn1, 2, &value);
3764
3765     other_decode_bitfield_value(bigbuf, value >> 8, 0x80, 8);
3766     proto_tree_add_text(tree, asn1->tvb,
3767         saved_offset, 1,
3768         "%s :  Reserved",
3769         bigbuf);
3770
3771     other_decode_bitfield_value(bigbuf, value >> 8, 0x78, 8);
3772     proto_tree_add_text(tree, asn1->tvb,
3773         saved_offset, 1,
3774         "%s :  Frame Offset (%u), %.2f ms",
3775         bigbuf,
3776         (value & 0x7800) >> 11,
3777         ((value & 0x7800) >> 11) * 1.25);
3778
3779     other_decode_bitfield_value(bigbuf, value >> 8, 0x07, 8);
3780     proto_tree_add_text(tree, asn1->tvb,
3781         saved_offset, 1,
3782         "%s :  CDMA Channel Number (MSB), %u",
3783         bigbuf,
3784         value & 0x07ff);
3785
3786     other_decode_bitfield_value(bigbuf, value & 0x00ff, 0xff, 8);
3787     proto_tree_add_text(tree, asn1->tvb,
3788         saved_offset+1, 1,
3789         "%s :  CDMA Channel Number (LSB)",
3790         bigbuf);
3791
3792     saved_offset = asn1->offset;
3793
3794     asn1_int32_value_decode(asn1, 1, &value);
3795
3796     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
3797     proto_tree_add_text(tree, asn1->tvb,
3798         saved_offset, asn1->offset - saved_offset,
3799         "%s :  Reserved",
3800         bigbuf);
3801
3802     temp_int = (value & 0x7c) >> 2;
3803     if ((temp_int < 0) || (temp_int >= (gint) NUM_BAND_CLASS_STR))
3804     {
3805         str = "Reserved";
3806     }
3807     else
3808     {
3809         str = band_class_str[temp_int];
3810     }
3811
3812     other_decode_bitfield_value(bigbuf, value, 0x7c, 8);
3813     proto_tree_add_text(tree, asn1->tvb,
3814         saved_offset, asn1->offset - saved_offset,
3815         "%s :  Band Class, %s",
3816         bigbuf,
3817         str);
3818
3819     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3820     proto_tree_add_text(tree, asn1->tvb,
3821         saved_offset, asn1->offset - saved_offset,
3822         "%s :  Long Code Mask (MSB)",
3823         bigbuf);
3824
3825     asn1_int32_value_decode(asn1, 1, &value);
3826
3827     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
3828     proto_tree_add_text(tree, asn1->tvb,
3829         saved_offset + 1, 1,
3830         "%s :  Long Code Mask",
3831         bigbuf);
3832
3833     asn1_int32_value_decode(asn1, 1, &value);
3834
3835     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
3836     proto_tree_add_text(tree, asn1->tvb,
3837         saved_offset + 2, 1,
3838         "%s :  Long Code Mask",
3839         bigbuf);
3840
3841     asn1_int32_value_decode(asn1, 1, &value);
3842
3843     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
3844     proto_tree_add_text(tree, asn1->tvb,
3845         saved_offset + 3, 1,
3846         "%s :  Long Code Mask",
3847         bigbuf);
3848
3849     asn1_int32_value_decode(asn1, 1, &value);
3850
3851     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
3852     proto_tree_add_text(tree, asn1->tvb,
3853         saved_offset + 4, 1,
3854         "%s :  Long Code Mask",
3855         bigbuf);
3856
3857     asn1_int32_value_decode(asn1, 1, &value);
3858
3859     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
3860     proto_tree_add_text(tree, asn1->tvb,
3861         saved_offset + 5, 1,
3862         "%s :  Long Code Mask (LSB)",
3863         bigbuf);
3864
3865     if (len == 8) return;
3866
3867     saved_offset = asn1->offset;
3868
3869     asn1_int32_value_decode(asn1, 1, &value);
3870
3871     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
3872     proto_tree_add_text(tree, asn1->tvb,
3873         saved_offset, asn1->offset - saved_offset,
3874         "%s :  NP Extension",
3875         bigbuf);
3876
3877     other_decode_bitfield_value(bigbuf, value, 0x78, 8);
3878     proto_tree_add_text(tree, asn1->tvb,
3879         saved_offset, asn1->offset - saved_offset,
3880         "%s :  Nominal Power, %u",
3881         bigbuf,
3882         (value & 0x78) >> 3);
3883
3884     other_decode_bitfield_value(bigbuf, value, 0x07, 8);
3885     proto_tree_add_text(tree, asn1->tvb,
3886         saved_offset, asn1->offset - saved_offset,
3887         "%s :  Number Preamble, %u",
3888         bigbuf,
3889         value & 0x07);
3890
3891     if (len == 9) return;
3892
3893     saved_offset = asn1->offset;
3894
3895     asn1_int32_value_decode(asn1, 1, &value);
3896
3897     proto_tree_add_text(tree, asn1->tvb,
3898         saved_offset, asn1->offset - saved_offset,
3899         "Base Station Protocol Revision, %u",
3900         value);
3901
3902     EXTRANEOUS_DATA_CHECK(len, 10);
3903 }
3904
3905 static void
3906 param_namps_chan_data(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
3907 {
3908     gint32 value;
3909     guint saved_offset;
3910     const gchar *str = NULL;
3911
3912     saved_offset = asn1->offset;
3913
3914     asn1_int32_value_decode(asn1, 1, &value);
3915
3916     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
3917     proto_tree_add_text(tree, asn1->tvb,
3918         saved_offset, asn1->offset - saved_offset,
3919         "%s :  Reserved",
3920         bigbuf);
3921
3922     switch ((value & 0x1c) >> 2)
3923     {
3924     case 0: str = "Channel Data parameter SCC field applies"; break;
3925     case 1: str = "Digital SAT Color Code 1 (ignore SCC field)"; break;
3926     case 2: str = "Digital SAT Color Code 2 (ignore SCC field)"; break;
3927     case 3: str = "Digital SAT Color Code 3 (ignore SCC field)"; break;
3928     case 4: str = "Digital SAT Color Code 4 (ignore SCC field)"; break;
3929     case 5: str = "Digital SAT Color Code 5 (ignore SCC field)"; break;
3930     case 6: str = "Digital SAT Color Code 6 (ignore SCC field)"; break;
3931     case 7: str = "Digital SAT Color Code 7 (ignore SCC field)"; break;
3932     }
3933
3934     other_decode_bitfield_value(bigbuf, value, 0x1c, 8);
3935     proto_tree_add_text(tree, asn1->tvb,
3936         saved_offset, asn1->offset - saved_offset,
3937         "%s :  Color Code Indicator (CCIndicator), %s",
3938         bigbuf,
3939         str);
3940
3941     switch (value & 0x03)
3942     {
3943     case 0: str = "Wide. 30 kHz AMPS voice channel"; break;
3944     case 1: str = "Upper. 10 kHz NAMPS voice channel"; break;
3945     case 2: str = "Middle. 10 kHz NAMPS voice channel"; break;
3946     case 3: str = "Lower. 10 kHz NAMPS voice channel"; break;
3947     }
3948
3949     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3950     proto_tree_add_text(tree, asn1->tvb,
3951         saved_offset, asn1->offset - saved_offset,
3952         "%s :  Narrow Analog Voice Channel Assignment (NAVCA), %s",
3953         bigbuf,
3954         str);
3955
3956     EXTRANEOUS_DATA_CHECK(len, 1);
3957 }
3958
3959 static void
3960 param_cdma_ms_meas_chan_id(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
3961 {
3962     gint32 value, temp_int;
3963     guint saved_offset;
3964     const gchar *str = NULL;
3965
3966     SHORT_DATA_CHECK(len, 2);
3967
3968     saved_offset = asn1->offset;
3969
3970     asn1_int32_value_decode(asn1, 2, &value);
3971
3972     temp_int = (value & 0xf800) >> 11;
3973     if ((temp_int < 0) || (temp_int >= (gint) NUM_BAND_CLASS_STR))
3974     {
3975         str = "Reserved";
3976     }
3977     else
3978     {
3979         str = band_class_str[temp_int];
3980     }
3981
3982     other_decode_bitfield_value(bigbuf, value >> 8, 0xf8, 8);
3983     proto_tree_add_text(tree, asn1->tvb,
3984         saved_offset, 1,
3985         "%s :  Band Class, %s",
3986         bigbuf,
3987         str);
3988
3989     other_decode_bitfield_value(bigbuf, value >> 8, 0x07, 8);
3990     proto_tree_add_text(tree, asn1->tvb,
3991         saved_offset, 1,
3992         "%s :  CDMA Channel Number (MSB), %u",
3993         bigbuf,
3994         value & 0x07ff);
3995
3996     other_decode_bitfield_value(bigbuf, value & 0x00ff, 0xff, 8);
3997     proto_tree_add_text(tree, asn1->tvb,
3998         saved_offset+1, 1,
3999         "%s :  CDMA Channel Number (LSB)",
4000         bigbuf);
4001
4002     EXTRANEOUS_DATA_CHECK(len, 2);
4003 }
4004
4005 static void
4006 param_tdma_chan_data(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
4007 {
4008     gint32 value;
4009     guint saved_offset;
4010     const gchar *str = NULL;
4011
4012     SHORT_DATA_CHECK(len, 5);
4013
4014     saved_offset = asn1->offset;
4015
4016     asn1_int32_value_decode(asn1, 1, &value);
4017
4018     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
4019     proto_tree_add_text(tree, asn1->tvb,
4020         saved_offset, asn1->offset - saved_offset,
4021         "%s :  Reserved",
4022         bigbuf);
4023
4024     switch (value & 0x1f)
4025     {
4026     case 0: str = "Analog (not used if ChannelData is present)"; break;
4027     case 1: str = "Assigned to timeslot 1, full rate"; break;
4028     case 2: str = "Assigned to timeslot 2, full rate"; break;
4029     case 3: str = "Assigned to timeslot 3, full rate"; break;
4030     case 4: str = "Assigned to timeslots 1, 4 and 2, 5 Double rate"; break;
4031     case 5: str = "Assigned to timeslots 1, 4 and 3, 6 Double rate"; break;
4032     case 6: str = "Assigned to timeslots 2, 5 and 3, 6 Double rate"; break;
4033     case 9: str = "Assigned to timeslot 1, half rate"; break;
4034     case 10: str = "Assigned to timeslot 2, half rate"; break;
4035     case 11: str = "Assigned to timeslot 3, half rate"; break;
4036     case 12: str = "Assigned to timeslot 4, half rate"; break;
4037     case 13: str = "Assigned to timeslot 5, half rate"; break;
4038     case 14: str = "Assigned to timeslot 6, half rate"; break;
4039     case 15: str = "Assigned to timeslot 1, 2, 3, 4, 5, 6 Triple rate"; break;
4040     default:
4041         str = "Reserved, treat as Analog";
4042         break;
4043     }
4044
4045     other_decode_bitfield_value(bigbuf, value, 0x1f, 8);
4046     proto_tree_add_text(tree, asn1->tvb,
4047         saved_offset, asn1->offset - saved_offset,
4048         "%s :  Time Slot and Rate indicator (TSR), %s",
4049         bigbuf,
4050         str);
4051
4052     saved_offset = asn1->offset;
4053
4054     asn1_int32_value_decode(asn1, 1, &value);
4055
4056     proto_tree_add_text(tree, asn1->tvb,
4057         saved_offset, asn1->offset - saved_offset,
4058         "Digital Verification Color Code (DVCC) %u",
4059         value);
4060
4061     saved_offset = asn1->offset;
4062
4063     asn1_int32_value_decode(asn1, 1, &value);
4064
4065     switch ((value & 0xf0) >> 4)
4066     {
4067     case 0: str = "800 MHz"; break;
4068     case 1: str = "1800 MHz"; break;
4069     default:
4070         str = "Reserved, treat as 800 MHz";
4071         break;
4072     }
4073
4074     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
4075     proto_tree_add_text(tree, asn1->tvb,
4076         saved_offset, asn1->offset - saved_offset,
4077         "%s :  Hyper Band, %s",
4078         bigbuf,
4079         str);
4080
4081     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
4082     proto_tree_add_text(tree, asn1->tvb,
4083         saved_offset, asn1->offset - saved_offset,
4084         "%s :  Digital Mobile Attenuation Code (DMAC) %u",
4085         bigbuf,
4086         value & 0x0f);
4087
4088     saved_offset = asn1->offset;
4089
4090     asn1_int32_value_decode(asn1, 2, &value);
4091
4092     other_decode_bitfield_value(bigbuf, value >> 8, 0xff, 8);
4093     proto_tree_add_text(tree, asn1->tvb,
4094         saved_offset, 1,
4095         "%s :  Channel Number (MSB), %u",
4096         bigbuf,
4097         value);
4098
4099     other_decode_bitfield_value(bigbuf, value & 0x00ff, 0xff, 8);
4100     proto_tree_add_text(tree, asn1->tvb,
4101         saved_offset + 1, 1,
4102         "%s :  Channel Number (LSB)",
4103         bigbuf);
4104
4105     EXTRANEOUS_DATA_CHECK(len, 5);
4106 }
4107
4108 static void
4109 param_tdma_call_mode(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
4110 {
4111     gint32 value;
4112     guint saved_offset;
4113
4114     saved_offset = asn1->offset;
4115
4116     asn1_int32_value_decode(asn1, 1, &value);
4117
4118     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
4119     proto_tree_add_text(tree, asn1->tvb,
4120         saved_offset, asn1->offset - saved_offset,
4121         "%s :  Reserved",
4122         bigbuf);
4123
4124     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
4125     proto_tree_add_text(tree, asn1->tvb,
4126         saved_offset, asn1->offset - saved_offset,
4127         "%s :  %sxtended modulation and framing",
4128         bigbuf,
4129         (value & 0x20) ? "E" : "No e");
4130
4131     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
4132     proto_tree_add_text(tree, asn1->tvb,
4133         saved_offset, asn1->offset - saved_offset,
4134         "%s :  Other voice coding %sacceptable",
4135         bigbuf,
4136         (value & 0x10) ? "" : "not ");
4137
4138     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
4139     proto_tree_add_text(tree, asn1->tvb,
4140         saved_offset, asn1->offset - saved_offset,
4141         "%s :  Other DQPSK channel %sacceptable",
4142         bigbuf,
4143         (value & 0x08) ? "" : "not ");
4144
4145     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
4146     proto_tree_add_text(tree, asn1->tvb,
4147         saved_offset, asn1->offset - saved_offset,
4148         "%s :  Half rate digital traffic channel %sacceptable",
4149         bigbuf,
4150         (value & 0x04) ? "" : "not ");
4151
4152     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
4153     proto_tree_add_text(tree, asn1->tvb,
4154         saved_offset, asn1->offset - saved_offset,
4155         "%s :  Full rate digital traffic channel %sacceptable",
4156         bigbuf,
4157         (value & 0x02) ? "" : "not ");
4158
4159     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
4160     proto_tree_add_text(tree, asn1->tvb,
4161         saved_offset, asn1->offset - saved_offset,
4162         "%s :  AMPS channel %sacceptable",
4163         bigbuf,
4164         (value & 0x01) ? "" : "not ");
4165
4166     EXTRANEOUS_DATA_CHECK(len, 1);
4167 }
4168
4169 static void
4170 param_cdma_call_mode(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
4171 {
4172     gint32 value;
4173     guint saved_offset;
4174
4175     saved_offset = asn1->offset;
4176
4177     asn1_int32_value_decode(asn1, 1, &value);
4178
4179     if (len == 1)
4180     {
4181         /* assuming older spec. no IS-880 */
4182
4183         other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
4184         proto_tree_add_text(tree, asn1->tvb,
4185             saved_offset, asn1->offset - saved_offset,
4186             "%s :  Reserved",
4187             bigbuf);
4188     }
4189     else
4190     {
4191         other_decode_bitfield_value(bigbuf, value, 0x80, 8);
4192         proto_tree_add_text(tree, asn1->tvb,
4193             saved_offset, asn1->offset - saved_offset,
4194             "%s :  450 MHz channel (Band Class 5) %sacceptable",
4195             bigbuf,
4196             (value & 0x80) ? "" : "not ");
4197
4198         other_decode_bitfield_value(bigbuf, value, 0x40, 8);
4199         proto_tree_add_text(tree, asn1->tvb,
4200             saved_offset, asn1->offset - saved_offset,
4201             "%s :  Korean PCS channel (Band Class 4) %sacceptable",
4202             bigbuf,
4203             (value & 0x40) ? "" : "not ");
4204
4205         other_decode_bitfield_value(bigbuf, value, 0x20, 8);
4206         proto_tree_add_text(tree, asn1->tvb,
4207             saved_offset, asn1->offset - saved_offset,
4208             "%s :  JTACS channel (Band Class 3) %sacceptable",
4209             bigbuf,
4210             (value & 0x20) ? "" : "not ");
4211
4212         other_decode_bitfield_value(bigbuf, value, 0x10, 8);
4213         proto_tree_add_text(tree, asn1->tvb,
4214             saved_offset, asn1->offset - saved_offset,
4215             "%s :  TACS channel (Band Class 2) %sacceptable",
4216             bigbuf,
4217             (value & 0x10) ? "" : "not ");
4218     }
4219
4220     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
4221     proto_tree_add_text(tree, asn1->tvb,
4222         saved_offset, asn1->offset - saved_offset,
4223         "%s :  CDMA 1900 MHz channel (Band Class 1) %sacceptable",
4224         bigbuf,
4225         (value & 0x08) ? "" : "not ");
4226
4227     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
4228     proto_tree_add_text(tree, asn1->tvb,
4229         saved_offset, asn1->offset - saved_offset,
4230         "%s :  NAMPS 800 MHz channel %sacceptable",
4231         bigbuf,
4232         (value & 0x04) ? "" : "not ");
4233
4234     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
4235     proto_tree_add_text(tree, asn1->tvb,
4236         saved_offset, asn1->offset - saved_offset,
4237         "%s :  AMPS 800 MHz channel %sacceptable",
4238         bigbuf,
4239         (value & 0x02) ? "" : "not ");
4240
4241     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
4242     proto_tree_add_text(tree, asn1->tvb,
4243         saved_offset, asn1->offset - saved_offset,
4244         "%s :  CDMA 800 MHz channel (Band Class 0) %sacceptable",
4245         bigbuf,
4246         (value & 0x01) ? "" : "not ");
4247
4248     if (len == 1) return;
4249
4250     saved_offset = asn1->offset;
4251
4252     asn1_int32_value_decode(asn1, 1, &value);
4253
4254     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
4255     proto_tree_add_text(tree, asn1->tvb,
4256         saved_offset, asn1->offset - saved_offset,
4257         "%s :  Reserved",
4258         bigbuf);
4259
4260     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
4261     proto_tree_add_text(tree, asn1->tvb,
4262         saved_offset, asn1->offset - saved_offset,
4263         "%s :  Secondary 800 MHz channel (Band Class 10) %sacceptable",
4264         bigbuf,
4265         (value & 0x10) ? "" : "not ");
4266
4267     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
4268     proto_tree_add_text(tree, asn1->tvb,
4269         saved_offset, asn1->offset - saved_offset,
4270         "%s :  900 MHz channel (Band Class 9) %sacceptable",
4271         bigbuf,
4272         (value & 0x08) ? "" : "not ");
4273
4274     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
4275     proto_tree_add_text(tree, asn1->tvb,
4276         saved_offset, asn1->offset - saved_offset,
4277         "%s :  1800 MHz channel (Band Class 8) %sacceptable",
4278         bigbuf,
4279         (value & 0x04) ? "" : "not ");
4280
4281     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
4282     proto_tree_add_text(tree, asn1->tvb,
4283         saved_offset, asn1->offset - saved_offset,
4284         "%s :  700 MHz channel (Band Class 7) %sacceptable",
4285         bigbuf,
4286         (value & 0x02) ? "" : "not ");
4287
4288     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
4289     proto_tree_add_text(tree, asn1->tvb,
4290         saved_offset, asn1->offset - saved_offset,
4291         "%s :  2 GHz channel (Band Class 6) %sacceptable",
4292         bigbuf,
4293         (value & 0x01) ? "" : "not ");
4294
4295     EXTRANEOUS_DATA_CHECK(len, 2);
4296 }
4297
4298 static void
4299 param_namps_call_mode(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
4300 {
4301     gint32 value;
4302     guint saved_offset;
4303
4304     saved_offset = asn1->offset;
4305
4306     asn1_int32_value_decode(asn1, 1, &value);
4307
4308     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
4309     proto_tree_add_text(tree, asn1->tvb,
4310         saved_offset, asn1->offset - saved_offset,
4311         "%s :  Reserved",
4312         bigbuf);
4313
4314     proto_tree_add_text(tree, asn1->tvb,
4315         saved_offset, asn1->offset - saved_offset,
4316         ".... %u... :  AMPS 1800 MHz channel %sacceptable",
4317         (value & 0x08) >> 3, (value & 0x08) ? "" : "not ");
4318
4319     proto_tree_add_text(tree, asn1->tvb,
4320         saved_offset, asn1->offset - saved_offset,
4321         ".... .%u.. :  NAMPS 1800 MHz channel %sacceptable",
4322         (value & 0x04) >> 2, (value & 0x04) ? "" : "not ");
4323
4324     proto_tree_add_text(tree, asn1->tvb,
4325         saved_offset, asn1->offset - saved_offset,
4326         ".... ..%u. :  AMPS 800 MHz channel %sacceptable",
4327         (value & 0x02) >> 1, (value & 0x02) ? "" : "not ");
4328
4329     proto_tree_add_text(tree, asn1->tvb,
4330         saved_offset, asn1->offset - saved_offset,
4331         ".... ...%u :  NAMPS 800 MHz channel %sacceptable",
4332         value & 0x01, (value & 0x01) ? "" : "not ");
4333
4334     EXTRANEOUS_DATA_CHECK(len, 1);
4335 }
4336
4337 static void
4338 param_mob_rev(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
4339 {
4340     gint32 value;
4341     guint saved_offset;
4342
4343     saved_offset = asn1->offset;
4344
4345     asn1_int32_value_decode(asn1, 1, &value);
4346
4347     proto_tree_add_text(tree, asn1->tvb,
4348         saved_offset, asn1->offset - saved_offset,
4349         "Revision %u",
4350         value);
4351
4352     EXTRANEOUS_DATA_CHECK(len, 1);
4353 }
4354
4355 static void
4356 param_cdma_band_class(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
4357 {
4358     gint32 value, temp_int;
4359     guint saved_offset;
4360     const gchar *str = NULL;
4361
4362     saved_offset = asn1->offset;
4363
4364     asn1_int32_value_decode(asn1, 1, &value);
4365
4366     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
4367     proto_tree_add_text(tree, asn1->tvb,
4368         saved_offset, asn1->offset - saved_offset,
4369         "%s :  Reserved",
4370         bigbuf);
4371
4372     temp_int = value & 0x1f;
4373     if ((temp_int < 0) || (temp_int >= (gint) NUM_BAND_CLASS_STR))
4374     {
4375         str = "Reserved";
4376     }
4377     else
4378     {
4379         str = band_class_str[temp_int];
4380     }
4381
4382     other_decode_bitfield_value(bigbuf, value, 0x1f, 8);
4383     proto_tree_add_text(tree, asn1->tvb,
4384         saved_offset, asn1->offset - saved_offset,
4385         "%s :  Band Class %s",
4386         bigbuf,
4387         str);
4388
4389     EXTRANEOUS_DATA_CHECK(len, 1);
4390 }
4391
4392 static void
4393 param_calling_party_name(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
4394 {
4395     gint32 value;
4396     guint saved_offset;
4397     const gchar *str = NULL;
4398
4399     SHORT_DATA_CHECK(len, 1);
4400
4401     saved_offset = asn1->offset;
4402
4403     asn1_int32_value_decode(asn1, 1, &value);
4404
4405     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
4406     proto_tree_add_text(tree, asn1->tvb,
4407         saved_offset, asn1->offset - saved_offset,
4408         "%s :  Spec. has hardcoded as 0 0 1",
4409         bigbuf);
4410
4411     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
4412     proto_tree_add_text(tree, asn1->tvb,
4413         saved_offset, asn1->offset - saved_offset,
4414         "%s :  Availability, %s",
4415         bigbuf,
4416         (value & 0x10) ?  "Name not available" : "Name available/unknown");
4417
4418     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
4419     proto_tree_add_text(tree, asn1->tvb,
4420         saved_offset, asn1->offset - saved_offset,
4421         "%s :  Reserved",
4422         bigbuf);
4423
4424     switch (value & 0x03)
4425     {
4426     case 0: str = "Presentation allowed"; break;
4427     case 1: str = "Presentation restricted"; break;
4428     case 2: str = "Blocking toggle"; break;
4429     case 3: str = "No indication"; break;
4430     }
4431
4432     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
4433     proto_tree_add_text(tree, asn1->tvb,
4434         saved_offset, asn1->offset - saved_offset,
4435         "%s :  Presentation Status, %s",
4436         bigbuf,
4437         str);
4438
4439     if (len == 1) return;
4440
4441     saved_offset = asn1->offset;
4442
4443     proto_tree_add_text(tree, asn1->tvb,
4444         asn1->offset, len - 1,
4445         "IA5 Digits");
4446
4447     asn1->offset += (len - 1);
4448 }
4449
4450 static void
4451 param_red_party_name(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
4452 {
4453     gint32 value;
4454     guint saved_offset;
4455     const gchar *str = NULL;
4456
4457     SHORT_DATA_CHECK(len, 1);
4458
4459     saved_offset = asn1->offset;
4460
4461     asn1_int32_value_decode(asn1, 1, &value);
4462
4463     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
4464     proto_tree_add_text(tree, asn1->tvb,
4465         saved_offset, asn1->offset - saved_offset,
4466         "%s :  Spec. has hardcoded as 0 1 1",
4467         bigbuf);
4468
4469     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
4470     proto_tree_add_text(tree, asn1->tvb,
4471         saved_offset, asn1->offset - saved_offset,
4472         "%s :  Availability, %s",
4473         bigbuf,
4474         (value & 0x10) ?  "Name not available" : "Name available/unknown");
4475
4476     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
4477     proto_tree_add_text(tree, asn1->tvb,
4478         saved_offset, asn1->offset - saved_offset,
4479         "%s :  Reserved",
4480         bigbuf);
4481
4482     switch (value & 0x03)
4483     {
4484     case 0: str = "Presentation allowed"; break;
4485     case 1: str = "Presentation restricted"; break;
4486     case 2: str = "Blocking toggle"; break;
4487     case 3: str = "No indication"; break;
4488     }
4489
4490     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
4491     proto_tree_add_text(tree, asn1->tvb,
4492         saved_offset, asn1->offset - saved_offset,
4493         "%s :  Presentation Status, %s",
4494         bigbuf,
4495         str);
4496
4497     if (len == 1) return;
4498
4499     saved_offset = asn1->offset;
4500
4501     proto_tree_add_text(tree, asn1->tvb,
4502         asn1->offset, len - 1,
4503         "IA5 Digits");
4504
4505     asn1->offset += (len - 1);
4506 }
4507
4508 static void
4509 param_srvc_id(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
4510 {
4511     proto_tree_add_text(tree, asn1->tvb,
4512         asn1->offset, len,
4513         "Service Identifier (Spec. does not define clearly)");
4514
4515     asn1->offset += len;
4516 }
4517
4518 static void
4519 param_all_or_none(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
4520 {
4521     gint32 value;
4522     guint saved_offset;
4523     const gchar *str = NULL;
4524
4525     EXACT_DATA_CHECK(len, 1);
4526
4527     saved_offset = asn1->offset;
4528
4529     asn1_int32_value_decode(asn1, 1, &value);
4530
4531     switch (value)
4532     {
4533     case 0: str = "Not used"; break;
4534     case 1: str = "All changes must succeed or none should be applied"; break;
4535     case 2: str = "Treat each change independently"; break;
4536     default:
4537         if ((value >= 3) && (value <= 223)) { str = "Reserved, treat as All changes must succeed or none should be applied"; }
4538         else { str = "Reserved for protocol extension, treat as All changes must succeed or none should be applied"; }
4539         break;
4540     }
4541
4542     proto_tree_add_text(tree, asn1->tvb,
4543         saved_offset, asn1->offset - saved_offset,
4544         str);
4545 }
4546
4547 static void
4548 param_change(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
4549 {
4550     gint32 value;
4551     guint saved_offset;
4552     const gchar *str = NULL;
4553
4554     EXACT_DATA_CHECK(len, 1);
4555
4556     saved_offset = asn1->offset;
4557
4558     asn1_int32_value_decode(asn1, 1, &value);
4559
4560     switch (value)
4561     {
4562     case 0: str = "Not used"; break;
4563     case 1: str = "Set Data Item to Default Value"; break;
4564     case 2: str = "Add Data Item"; break;
4565     case 3: str = "Delete Data Item"; break;
4566     case 4: str = "Replace Data Item with associated DataValue"; break;
4567     default:
4568         if ((value >= 5) && (value <= 223)) { str = "Reserved, treat as Set Data Item to Default Value"; }
4569         else { str = "Reserved for protocol extension, treat as Set Data Item to Default Value"; }
4570         break;
4571     }
4572
4573     proto_tree_add_text(tree, asn1->tvb,
4574         saved_offset, asn1->offset - saved_offset,
4575         str);
4576 }
4577
4578 static void
4579 param_data_result(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
4580 {
4581     gint32 value;
4582     guint saved_offset;
4583     const gchar *str = NULL;
4584
4585     EXACT_DATA_CHECK(len, 1);
4586
4587     saved_offset = asn1->offset;
4588
4589     asn1_int32_value_decode(asn1, 1, &value);
4590
4591     switch (value)
4592     {
4593     case 0: str = "Not used"; break;
4594     case 1: str = "Successful"; break;
4595     case 2: str = "Unsuccessful, unspecified"; break;
4596     case 3: str = "Unsuccessful, no default value available"; break;
4597     default:
4598         if ((value >= 4) && (value <= 95)) { str = "Reserved, treat as Unsuccessful"; }
4599         else if ((value >= 96) && (value <= 127)) { str = "Reserved for protocol extension, treat as Unsuccessful"; }
4600         else if ((value >= 128) && (value <= 223)) { str = "Reserved, treat as Successful"; }
4601         else { str = "Reserved for protocol extension, treat as Successful"; }
4602         break;
4603     }
4604
4605     proto_tree_add_text(tree, asn1->tvb,
4606         saved_offset, asn1->offset - saved_offset,
4607         str);
4608 }
4609
4610 static void
4611 param_fail_cause(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
4612 {
4613     guint saved_offset;
4614
4615     SHORT_DATA_CHECK(len, 2);
4616
4617     saved_offset = asn1->offset;
4618
4619     proto_tree_add_text(tree, asn1->tvb,
4620         saved_offset, len,
4621         "ISUP Cause Indicator");
4622
4623     asn1->offset += len;
4624 }
4625
4626 static void
4627 param_fail_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
4628 {
4629     gint32 value;
4630     guint saved_offset;
4631     const gchar *str = NULL;
4632
4633     EXACT_DATA_CHECK(len, 1);
4634
4635     saved_offset = asn1->offset;
4636
4637     asn1_int32_value_decode(asn1, 1, &value);
4638
4639     switch (value)
4640     {
4641     case 0: str = "Not used"; break;
4642     case 1: str = "Call abandoned"; break;
4643     case 2: str = "Resource disconnect"; break;
4644     case 3: str = "Failure at MSC"; break;
4645     case 4: str = "SSFT expiration"; break;
4646     default:
4647         if ((value >= 5) && (value <= 223)) { str = "Reserved, ignore"; }
4648         else { str = "Reserved for protocol extension, ignore"; }
4649         break;
4650     }
4651
4652     proto_tree_add_text(tree, asn1->tvb,
4653         saved_offset, asn1->offset - saved_offset,
4654         str);
4655 }
4656
4657 static void
4658 param_resume_pic(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
4659 {
4660     gint32 value;
4661     guint saved_offset;
4662     const gchar *str = NULL;
4663
4664     EXACT_DATA_CHECK(len, 1);
4665
4666     saved_offset = asn1->offset;
4667
4668     asn1_int32_value_decode(asn1, 1, &value);
4669
4670     switch (value)
4671     {
4672     case 0: str = "Not used"; break;
4673     case 1: str = "Continue Call Processing"; break;
4674     case 2: str = "Collect Information PIC"; break;
4675     case 3: str = "Analyze Information PIC"; break;
4676     case 4: str = "Select Route PIC"; break;
4677     case 5: str = "Authorize Origination_Attempt PIC"; break;
4678     case 6: str = "Authorize Call Setup PIC"; break;
4679     case 7: str = "Send Call PIC"; break;
4680     case 8: str = "O Alerting PIC"; break;
4681     case 9: str = "O Active PIC"; break;
4682     case 10: str = "O Suspended PIC"; break;
4683     case 11: str = "O Null PIC"; break;
4684     case 32: str = "Select Facility PIC"; break;
4685     case 33: str = "Present Call PIC"; break;
4686     case 34: str = "Authorize Termination Attempt PIC"; break;
4687     case 35: str = "T Alerting PIC"; break;
4688     case 36: str = "T Active PIC"; break;
4689     case 37: str = "T Suspended PIC"; break;
4690     case 38: str = "T Null PIC"; break;
4691     default:
4692         if ((value >= 12) && (value <= 31)) { str = "Reserved, treat as Not used"; }
4693         else if ((value >= 39) && (value <= 223)) { str = "Reserved, ignore"; }
4694         else { str = "Reserved for protocol extension, ignore"; }
4695         break;
4696     }
4697
4698     proto_tree_add_text(tree, asn1->tvb,
4699         saved_offset, asn1->offset - saved_offset,
4700         "Point in Call, %s (%u)",
4701         str,
4702         value);
4703 }
4704
4705 static void
4706 param_special_rsc(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
4707 {
4708     gint32 value, i;
4709     guint saved_offset;
4710     const gchar *str = NULL;
4711
4712     saved_offset = asn1->offset;
4713
4714     i = 0;
4715
4716     do
4717     {
4718         asn1_int32_value_decode(asn1, 1, &value);
4719
4720         switch (value)
4721         {
4722         case 0: str = "Not used"; break;
4723         case 1: str = "DTMF tone detector"; break;
4724         case 2: str = "Automatic Speech Recognition - Speaker Independent - Digits"; break;
4725         case 3: str = "Automatic Speech Recognition - Speaker Independent - Speech User Interface Version 1"; break;
4726         default:
4727             if ((value >= 4) && (value <= 223)) { str = "Reserved, treat as Not used"; }
4728             else { str = "Reserved for protocol extension, treat as Not used"; }
4729             break;
4730         }
4731
4732         proto_tree_add_text(tree, asn1->tvb,
4733             saved_offset, asn1->offset - saved_offset,
4734             "[%u] Resource Type, %s",
4735             i++,
4736             str);
4737
4738         saved_offset = asn1->offset;
4739     }
4740     while ((len - i) > 0);
4741 }
4742
4743 static void
4744 param_time_date_offset(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
4745 {
4746     gint32 value;
4747     guint saved_offset;
4748
4749     EXACT_DATA_CHECK(len, 2);
4750
4751     saved_offset = asn1->offset;
4752
4753     asn1_int32_value_decode(asn1, 2, &value);
4754
4755     proto_tree_add_text(tree, asn1->tvb,
4756         saved_offset, asn1->offset - saved_offset,
4757         "In minutes (%u)",
4758         value);
4759 }
4760
4761 static void
4762 param_network_tmsi(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
4763 {
4764     gint32 value, addr_type, first_dig;
4765     guint saved_offset;
4766     const gchar *str = NULL;
4767     guchar *poctets;
4768
4769     SHORT_DATA_CHECK(len, 4);
4770
4771     saved_offset = asn1->offset;
4772
4773     asn1_int32_value_decode(asn1, 4, &value);
4774
4775     proto_tree_add_text(tree, asn1->tvb,
4776         saved_offset, asn1->offset - saved_offset,
4777         "TMSI Code, %u",
4778         value);
4779
4780     if (len == 4) return;
4781
4782     saved_offset = asn1->offset;
4783
4784     asn1_int32_value_decode(asn1, 1, &value);
4785
4786     first_dig = Dgt_tbcd.out[(value & 0xf0) >> 4];
4787
4788     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
4789     proto_tree_add_text(tree, asn1->tvb,
4790         saved_offset, asn1->offset - saved_offset,
4791         "%s :  First digit of TMSI Zone, %c",
4792         bigbuf,
4793         first_dig);
4794
4795     addr_type = value & 0x0f;
4796     switch (addr_type)
4797     {
4798     case 0: str = "Not used"; break;
4799     case 1: str = "E.212 based routing"; break;
4800     case 2: str = "20-bit TDMA TMSI"; break;
4801     case 3: str = "24-bit TDMA TMSI"; break;
4802     default:
4803         str = "Reserved for protocol extension, treat as Not used";
4804         break;
4805     }
4806
4807     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
4808     proto_tree_add_text(tree, asn1->tvb,
4809         saved_offset, asn1->offset - saved_offset,
4810         "%s :  Type of addressing, %s",
4811         bigbuf,
4812         str);
4813
4814     if (len == 5) return;
4815
4816     saved_offset = asn1->offset;
4817
4818     asn1_string_value_decode(asn1, (len-5), &poctets);
4819
4820     bigbuf[0] = first_dig;
4821
4822     my_dgt_tbcd_unpack(bigbuf+1, poctets, (len-5), &Dgt_tbcd);
4823     g_free(poctets);
4824
4825     proto_tree_add_text(tree, asn1->tvb,
4826         saved_offset - 1, (len-5)+1,
4827         "TMSI Zone, %s",
4828         bigbuf);
4829 }
4830
4831 static void
4832 param_reqd_param_mask(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
4833 {
4834     gint32 value;
4835     guint saved_offset;
4836
4837     saved_offset = asn1->offset;
4838
4839     asn1_int32_value_decode(asn1, 1, &value);
4840
4841     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
4842     proto_tree_add_text(tree, asn1->tvb,
4843         saved_offset, asn1->offset - saved_offset,
4844         "%s :  Reserved",
4845         bigbuf);
4846
4847     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
4848     proto_tree_add_text(tree, asn1->tvb,
4849         saved_offset, asn1->offset - saved_offset,
4850         "%s :  Location Area ID (LOCID) %srequired",
4851         bigbuf,
4852         (value & 0x10) ? "" : "not ");
4853
4854     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
4855     proto_tree_add_text(tree, asn1->tvb,
4856         saved_offset, asn1->offset - saved_offset,
4857         "%s :  TMSI %srequired",
4858         bigbuf,
4859         (value & 0x08) ? "" : "not ");
4860
4861     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
4862     proto_tree_add_text(tree, asn1->tvb,
4863         saved_offset, asn1->offset - saved_offset,
4864         "%s :  ESN %srequired",
4865         bigbuf,
4866         (value & 0x04) ? "" : "not ");
4867
4868     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
4869     proto_tree_add_text(tree, asn1->tvb,
4870         saved_offset, asn1->offset - saved_offset,
4871         "%s :  MIN %srequired",
4872         bigbuf,
4873         (value & 0x02) ? "" : "not ");
4874
4875     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
4876     proto_tree_add_text(tree, asn1->tvb,
4877         saved_offset, asn1->offset - saved_offset,
4878         "%s :  IMSI %srequired",
4879         bigbuf,
4880         (value & 0x01) ? "" : "not ");
4881
4882     EXTRANEOUS_DATA_CHECK(len, 1);
4883 }
4884
4885 static void
4886 param_srvc_red_cause(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
4887 {
4888     gint32 value;
4889     guint saved_offset;
4890     const gchar *str = NULL;
4891
4892     saved_offset = asn1->offset;
4893
4894     asn1_int32_value_decode(asn1, 1, &value);
4895
4896     switch (value)
4897     {
4898     case 0: str = "Not used"; break;
4899     case 1: str = "Normal Registration"; break;
4900     case 2: str = "System Not Found"; break;
4901     case 3: str = "Protocol Mismatch"; break;
4902     case 4: str = "Registration Rejection"; break;
4903     case 5: str = "Wrong SID"; break;
4904     case 6: str = "Wrong NID"; break;
4905     default:
4906         if ((value >= 7) && (value <= 223)) { str = "Reserved, treat as Normal Registration"; }
4907         else { str = "Reserved for protocol extension. If unknown, treat as Normal Registration"; }
4908         break;
4909     }
4910
4911     proto_tree_add_text(tree, asn1->tvb,
4912         saved_offset, asn1->offset - saved_offset,
4913         str);
4914
4915     EXTRANEOUS_DATA_CHECK(len, 1);
4916 }
4917
4918 static void
4919 param_srvc_red_info(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
4920 {
4921     gint32 value;
4922     guint saved_offset;
4923
4924     saved_offset = asn1->offset;
4925
4926     asn1_int32_value_decode(asn1, 1, &value);
4927
4928     other_decode_bitfield_value(bigbuf, value, 0xfc, 8);
4929     proto_tree_add_text(tree, asn1->tvb,
4930         saved_offset, asn1->offset - saved_offset,
4931         "%s :  Reserved",
4932         bigbuf);
4933
4934     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
4935     proto_tree_add_text(tree, asn1->tvb,
4936         saved_offset, asn1->offset - saved_offset,
4937         "%s :  NDSS Status (NDS), %ssuppressed",
4938         bigbuf,
4939         (value & 0x02) ? "" : "not ");
4940
4941     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
4942     proto_tree_add_text(tree, asn1->tvb,
4943         saved_offset, asn1->offset - saved_offset,
4944         "%s :  Return If Fail (RIF), If MS fails to access the redirected system, MS shall %sreturn to the serving system",
4945         bigbuf,
4946         (value & 0x01) ? "" : "not ");
4947
4948     EXTRANEOUS_DATA_CHECK(len, 1);
4949 }
4950
4951 static void
4952 param_roaming_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
4953 {
4954     gint32 value;
4955     guint saved_offset;
4956     const gchar *str = NULL;
4957
4958     saved_offset = asn1->offset;
4959
4960     asn1_int32_value_decode(asn1, 1, &value);
4961
4962     switch (value)
4963     {
4964     case 0: str = "Roaming Indicator On"; break;
4965     case 1: str = "Roaming Indicator Off"; break;
4966     case 2: str = "Roaming Indicator Flashing"; break;
4967     case 3: str = "Out of Neighborhood"; break;
4968     case 4: str = "Out of Building"; break;
4969     case 5: str = "Roaming - Preferred System"; break;
4970     case 6: str = "Roaming - Available System"; break;
4971     case 7: str = "Roaming - Alliance Partner"; break;
4972     case 8: str = "Roaming - Premium Partner"; break;
4973     case 9: str = "Roaming - Full Service Functionality"; break;
4974     case 10: str = "Roaming - Partial Service Functionality"; break;
4975     case 11: str = "Roaming Banner On"; break;
4976     case 12: str = "Roaming Banner Off"; break;
4977     default:
4978         if ((value >= 13) && (value <= 63)) { str = "Reserved for Standard Enhanced Roaming Indicator Numbers"; }
4979         else if ((value >= 64) && (value <= 127)) { str = "Reserved for Non-Standard Enhanced Roaming Indicator Numbers"; }
4980         else { str = "Reserved"; }
4981         break;
4982     }
4983
4984     proto_tree_add_text(tree, asn1->tvb,
4985         saved_offset, asn1->offset - saved_offset,
4986         str);
4987
4988     EXTRANEOUS_DATA_CHECK(len, 1);
4989 }
4990
4991 static void
4992 param_cdma_pci(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
4993 {
4994     gint32 value;
4995     guint saved_offset;
4996
4997     EXACT_DATA_CHECK(len, 1);
4998
4999     saved_offset = asn1->offset;
5000
5001     asn1_int32_value_decode(asn1, 1, &value);
5002
5003     other_decode_bitfield_value(bigbuf, value, 0xfe, 8);
5004     proto_tree_add_text(tree, asn1->tvb,
5005         saved_offset, asn1->offset - saved_offset,
5006         "%s :  Reserved",
5007         bigbuf);
5008
5009     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
5010     proto_tree_add_text(tree, asn1->tvb,
5011         saved_offset, asn1->offset - saved_offset,
5012         "%s :  CDMA PWR_COMB_IND",
5013         bigbuf);
5014 }
5015
5016 static void
5017 param_cdma_chan_num(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
5018 {
5019     gint32 value;
5020     guint saved_offset;
5021
5022     SHORT_DATA_CHECK(len, 2);
5023
5024     saved_offset = asn1->offset;
5025
5026     asn1_int32_value_decode(asn1, 2, &value);
5027
5028     other_decode_bitfield_value(bigbuf, value >> 8, 0xf8, 8);
5029     proto_tree_add_text(tree, asn1->tvb,
5030         saved_offset, 1,
5031         "%s :  Reserved",
5032         bigbuf);
5033
5034     other_decode_bitfield_value(bigbuf, value >> 8, 0x07, 8);
5035     proto_tree_add_text(tree, asn1->tvb,
5036         saved_offset, 1,
5037         "%s :  CDMA Channel Number (MSB) %u",
5038         bigbuf,
5039         value & 0x07ff);
5040
5041     other_decode_bitfield_value(bigbuf, value & 0x00ff, 0xff, 8);
5042     proto_tree_add_text(tree, asn1->tvb,
5043         saved_offset+1, 1,
5044         "%s :  CDMA Channel Number (LSB)",
5045         bigbuf);
5046
5047     EXTRANEOUS_DATA_CHECK(len, 2);
5048 }
5049
5050 static void
5051 param_cdma_sci(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
5052 {
5053     gint32 value;
5054     guint saved_offset;
5055
5056     EXACT_DATA_CHECK(len, 1);
5057
5058     saved_offset = asn1->offset;
5059
5060     asn1_int32_value_decode(asn1, 1, &value);
5061
5062     other_decode_bitfield_value(bigbuf, value, 0xf8, 8);
5063     proto_tree_add_text(tree, asn1->tvb,
5064         saved_offset, asn1->offset - saved_offset,
5065         "%s :  Reserved",
5066         bigbuf);
5067
5068     other_decode_bitfield_value(bigbuf, value, 0x07, 8);
5069     proto_tree_add_text(tree, asn1->tvb,
5070         saved_offset, asn1->offset - saved_offset,
5071         "%s :  Slot Cycle Index, %u",
5072         bigbuf,
5073         (value & 0x07));
5074 }
5075
5076 static void
5077 param_vp_report(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
5078 {
5079     gint32 value;
5080     guint saved_offset;
5081     const gchar *str = NULL;
5082
5083     EXACT_DATA_CHECK(len, 1);
5084
5085     saved_offset = asn1->offset;
5086
5087     asn1_int32_value_decode(asn1, 1, &value);
5088
5089     switch (value)
5090     {
5091     case 0: str = "Not used"; break;
5092     case 1: str = "Voice Privacy not attempted"; break;
5093     case 2: str = "Voice Privacy no response"; break;
5094     case 3: str = "Voiec Privacy successful is active"; break;
5095     case 4: str = "Voice Privacy failed"; break;
5096     default:
5097         if ((value >= 5) && (value <= 223)) { str = "Reserved, treat as Voice Privacy not attempted"; }
5098         else { str = "Reserved for protocol extension, treat as Voice Privacy not attempted"; }
5099         break;
5100     }
5101
5102     proto_tree_add_text(tree, asn1->tvb,
5103         saved_offset, asn1->offset - saved_offset,
5104         "%s (%u)",
5105         str,
5106         value);
5107 }
5108
5109 static void
5110 param_cdma_scm(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
5111 {
5112     gint32 value;
5113     guint saved_offset;
5114     const gchar *str = NULL;
5115
5116     saved_offset = asn1->offset;
5117
5118     asn1_int32_value_decode(asn1, 1, &value);
5119
5120     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
5121     proto_tree_add_text(tree, asn1->tvb,
5122         saved_offset, asn1->offset - saved_offset,
5123         "%s :  Reserved",
5124         bigbuf);
5125
5126     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
5127     proto_tree_add_text(tree, asn1->tvb,
5128         saved_offset, asn1->offset - saved_offset,
5129         "%s :  Dual-mode Indicator, %s",
5130         bigbuf,
5131         (value & 0x40) ? "Dual mode CDMA" : "CDMA only");
5132
5133     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
5134     proto_tree_add_text(tree, asn1->tvb,
5135         saved_offset, asn1->offset - saved_offset,
5136         "%s :  Slotted mode Indicator, %s",
5137         bigbuf,
5138         (value & 0x20) ? "slotted capable" : "slotted incapable");
5139
5140     other_decode_bitfield_value(bigbuf, value, 0x18, 8);
5141     proto_tree_add_text(tree, asn1->tvb,
5142         saved_offset, asn1->offset - saved_offset,
5143         "%s :  Reserved",
5144         bigbuf);
5145
5146     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
5147     proto_tree_add_text(tree, asn1->tvb,
5148         saved_offset, asn1->offset - saved_offset,
5149         "%s :  Analog Transmission, %s",
5150         bigbuf,
5151         (value & 0x04) ? "discontinuous" : "continuous");
5152
5153     switch (value & 0x03)
5154     {
5155     case 0: str = "Power Class I"; break;
5156     case 1: str = "Power Class II"; break;
5157     case 2: str = "Power Class III"; break;
5158     case 3: str = "Reserved"; break;
5159     }
5160
5161     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
5162     proto_tree_add_text(tree, asn1->tvb,
5163         saved_offset, asn1->offset - saved_offset,
5164         "%s :  %s",
5165         bigbuf,
5166         str);
5167
5168     EXTRANEOUS_DATA_CHECK(len, 1);
5169 }
5170
5171 static void
5172 param_ota_result_code(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
5173 {
5174     gint32 value;
5175     guint saved_offset;
5176     const gchar *str = NULL;
5177
5178     saved_offset = asn1->offset;
5179
5180     asn1_int32_value_decode(asn1, 1, &value);
5181
5182     switch (value)
5183     {
5184     case 0: str = "Accepted - Successful"; break;
5185     case 1: str = "Rejected - Unknown cause"; break;
5186     case 2: str = "Computation Failure - E.g., unable to compute A-key"; break;
5187     case 3: str = "CSC Rejected - CSC challenge failure"; break;
5188     case 4: str = "Unrecognized OTASPCallEntry"; break;
5189     case 5: str = "Unsupported AKeyProtocolVersion(s)"; break;
5190     case 6: str = "Unable to Commit"; break;
5191     default:
5192         if ((value >= 7) && (value <= 223)) { str = "Reserved, treat as Rejected - Unknown cause"; }
5193         else { str = "Reserved for protocol extension, treat as Rejected - Unknown cause"; }
5194         break;
5195     }
5196
5197     proto_tree_add_text(tree, asn1->tvb,
5198         saved_offset, asn1->offset - saved_offset,
5199         "%s (%u)",
5200         str,
5201         value);
5202
5203     EXTRANEOUS_DATA_CHECK(len, 1);
5204 }
5205
5206 static void
5207 param_cdma_scm2(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
5208 {
5209     gint32 value;
5210     guint saved_offset;
5211
5212     saved_offset = asn1->offset;
5213
5214     asn1_int32_value_decode(asn1, 1, &value);
5215
5216     proto_tree_add_text(tree, asn1->tvb,
5217         saved_offset, asn1->offset - saved_offset,
5218         "Value %u",
5219         value);
5220
5221     EXTRANEOUS_DATA_CHECK(len, 1);
5222 }
5223
5224 static void
5225 param_tdma_term_cap(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
5226 {
5227     gint32 value;
5228     guint saved_offset;
5229     const gchar *str = NULL;
5230
5231     SHORT_DATA_CHECK(len, 4);
5232
5233     saved_offset = asn1->offset;
5234
5235     asn1_int32_value_decode(asn1, 1, &value);
5236
5237     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
5238     proto_tree_add_text(tree, asn1->tvb,
5239         saved_offset, asn1->offset - saved_offset,
5240         "%s :  Reserved",
5241         bigbuf);
5242
5243     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
5244     proto_tree_add_text(tree, asn1->tvb,
5245         saved_offset, asn1->offset - saved_offset,
5246         "%s :  1800 MHz F channel %sacceptable",
5247         bigbuf,
5248         (value & 0x40) ? "" : "not ");
5249
5250     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
5251     proto_tree_add_text(tree, asn1->tvb,
5252         saved_offset, asn1->offset - saved_offset,
5253         "%s :  1800 MHz E channel %sacceptable",
5254         bigbuf,
5255         (value & 0x20) ? "" : "not ");
5256
5257     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
5258     proto_tree_add_text(tree, asn1->tvb,
5259         saved_offset, asn1->offset - saved_offset,
5260         "%s :  1800 MHz D channel %sacceptable",
5261         bigbuf,
5262         (value & 0x10) ? "" : "not ");
5263
5264     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
5265     proto_tree_add_text(tree, asn1->tvb,
5266         saved_offset, asn1->offset - saved_offset,
5267         "%s :  1800 MHz C channel %sacceptable",
5268         bigbuf,
5269         (value & 0x08) ? "" : "not ");
5270
5271     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
5272     proto_tree_add_text(tree, asn1->tvb,
5273         saved_offset, asn1->offset - saved_offset,
5274         "%s :  1800 MHz B channel %sacceptable",
5275         bigbuf,
5276         (value & 0x04) ? "" : "not ");
5277
5278     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
5279     proto_tree_add_text(tree, asn1->tvb,
5280         saved_offset, asn1->offset - saved_offset,
5281         "%s :  %s acceptable",
5282         bigbuf,
5283         (value & 0x02) ? "1800 MHz A channel" : "1800 MHz A&B Digital channel not");
5284
5285     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
5286     proto_tree_add_text(tree, asn1->tvb,
5287         saved_offset, asn1->offset - saved_offset,
5288         "%s :  800 MHz A&B channel %sacceptable",
5289         bigbuf,
5290         (value & 0x01) ? "" : "not ");
5291
5292     saved_offset = asn1->offset;
5293
5294     asn1_int32_value_decode(asn1, 1, &value);
5295
5296     other_decode_bitfield_value(bigbuf, value, 0xfc, 8);
5297     proto_tree_add_text(tree, asn1->tvb,
5298         saved_offset, asn1->offset - saved_offset,
5299         "%s :  Reserved",
5300         bigbuf);
5301
5302     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
5303     proto_tree_add_text(tree, asn1->tvb,
5304         saved_offset, asn1->offset - saved_offset,
5305         "%s :  IS-641 Voice Coder %sacceptable",
5306         bigbuf,
5307         (value & 0x02) ? "" : "not ");
5308
5309     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
5310     proto_tree_add_text(tree, asn1->tvb,
5311         saved_offset, asn1->offset - saved_offset,
5312         "%s :  VSELP Voice Coder %sacceptable",
5313         bigbuf,
5314         (value & 0x01) ? "" : "not ");
5315
5316     saved_offset = asn1->offset;
5317
5318     asn1_int32_value_decode(asn1, 1, &value);
5319
5320     switch (value)
5321     {
5322     case 0: str = "EIA-553 or IS-54-A"; break;
5323     case 1: str = "TIA/EIA-627 (IS-54-B)"; break;
5324     case 2: str = "IS-136"; break;
5325     case 3: str = "Reserved (ANSI J-STD-011)"; break;
5326     case 4: str = "PV 0 as published in TIA/EIA-136-0 and IS-136-A"; break;
5327     case 5: str = "PV 1 as published in TIA/EIA-136-A"; break;
5328     case 6: str = "PV 2 as published in TIA/EIA-136-A"; break;
5329     case 7: str = "PV 3 as published in TIA/EIA-136-A"; break;
5330     default:
5331         str = "Reserved, treat as EIA-553 or IS-54-A";
5332         break;
5333     }
5334
5335     proto_tree_add_text(tree, asn1->tvb,
5336         saved_offset, 1,
5337         "Protocol Version, %s",
5338         str);
5339
5340     saved_offset = asn1->offset;
5341
5342     asn1_int32_value_decode(asn1, 1, &value);
5343
5344     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
5345     proto_tree_add_text(tree, asn1->tvb,
5346         saved_offset, asn1->offset - saved_offset,
5347         "%s :  Triple Rate (3RATE) %ssupported",
5348         bigbuf,
5349         (value & 0x80) ? "" : "not ");
5350
5351     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
5352     proto_tree_add_text(tree, asn1->tvb,
5353         saved_offset, asn1->offset - saved_offset,
5354         "%s :  Double Rate (2RATE) %ssupported",
5355         bigbuf,
5356         (value & 0x40) ? "" : "not ");
5357
5358     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
5359     proto_tree_add_text(tree, asn1->tvb,
5360         saved_offset, asn1->offset - saved_offset,
5361         "%s :  Full Rate (FRATE) %ssupported",
5362         bigbuf,
5363         (value & 0x20) ? "" : "not ");
5364
5365     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
5366     proto_tree_add_text(tree, asn1->tvb,
5367         saved_offset, asn1->offset - saved_offset,
5368         "%s :  Half Rate (HRATE) %ssupported",
5369         bigbuf,
5370         (value & 0x10) ? "" : "not ");
5371
5372     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
5373     proto_tree_add_text(tree, asn1->tvb,
5374         saved_offset, asn1->offset - saved_offset,
5375         "%s :  Analog Voice (AVOX) %ssupported",
5376         bigbuf,
5377         (value & 0x08) ? "" : "not ");
5378
5379     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
5380     proto_tree_add_text(tree, asn1->tvb,
5381         saved_offset, asn1->offset - saved_offset,
5382         "%s :  Secure Telephone Unit III (STU3) %ssupported",
5383         bigbuf,
5384         (value & 0x04) ? "" : "not ");
5385
5386     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
5387     proto_tree_add_text(tree, asn1->tvb,
5388         saved_offset, asn1->offset - saved_offset,
5389         "%s :  Group 3 Fax (G3FAX) %ssupported",
5390         bigbuf,
5391         (value & 0x02) ? "" : "not ");
5392
5393     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
5394     proto_tree_add_text(tree, asn1->tvb,
5395         saved_offset, asn1->offset - saved_offset,
5396         "%s :  Asynchronous Data (ADS) %ssupported",
5397         bigbuf,
5398         (value & 0x01) ? "" : "not ");
5399
5400     EXTRANEOUS_DATA_CHECK(len, 4);
5401 }
5402
5403 static void
5404 param_tdma_voice_coder(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
5405 {
5406     gint32 value, vc;
5407     guint orig_offset, saved_offset;
5408     const gchar *str = NULL;
5409
5410     SHORT_DATA_CHECK(len, 2);
5411
5412     orig_offset = asn1->offset;
5413     saved_offset = asn1->offset;
5414
5415     do
5416     {
5417         asn1_int32_value_decode(asn1, 1, &value);
5418
5419         other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
5420         proto_tree_add_text(tree, asn1->tvb,
5421             saved_offset, asn1->offset - saved_offset,
5422             "%s :  Reserved",
5423             bigbuf);
5424
5425         vc = (value & 0x0f);
5426         switch (vc)
5427         {
5428         case 0: str = "Not used"; break;
5429         case 1: str = "VSELP Voice Coder acceptable"; break;
5430         case 2: str = "IS-641 Voice Coder acceptable"; break;
5431         case 6: str = "Reserved for SOC/BSMC Specific signaling. If unknown, use any acceptable value"; break;
5432         default:
5433             if ((vc >= 3) && (vc <= 5)) { str = "Reserved. Ignore on reception, use any acceptable value"; }
5434             else if ((vc >= 7) && (vc <= 12)) { str = "Reserved. Ignore on reception, use any acceptable value"; }
5435             else if ((vc >= 13) && (vc <= 15)) { str = "Reserved for protocol extension. If unknown, use any acceptable value"; }
5436             break;
5437         }
5438
5439         other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
5440         proto_tree_add_text(tree, asn1->tvb,
5441             saved_offset, asn1->offset - saved_offset,
5442             "%s :  Voice Coder, %s",
5443             bigbuf,
5444             str);
5445
5446         saved_offset = asn1->offset;
5447     }
5448     while ((len - (saved_offset - orig_offset)) > 0);
5449 }
5450
5451 static void
5452 param_cdma_pilot_pn(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
5453 {
5454     gint32 value;
5455     guint saved_offset;
5456
5457     SHORT_DATA_CHECK(len, 2);
5458
5459     saved_offset = asn1->offset;
5460
5461     asn1_int32_value_decode(asn1, 2, &value);
5462
5463     other_decode_bitfield_value(bigbuf, value >> 8, 0xfe, 8);
5464     proto_tree_add_text(tree, asn1->tvb,
5465         saved_offset, 1,
5466         "%s :  Reserved",
5467         bigbuf);
5468
5469     other_decode_bitfield_value(bigbuf, value >> 8, 0x01, 8);
5470     proto_tree_add_text(tree, asn1->tvb,
5471         saved_offset, 1,
5472         "%s :  Pilot PN (MSB), %u",
5473         bigbuf, value & 0x01ff);
5474
5475     other_decode_bitfield_value(bigbuf, value & 0x00ff, 0xff, 8);
5476     proto_tree_add_text(tree, asn1->tvb,
5477         saved_offset + 1, 1,
5478         "%s :  Pilot PN (LSB)",
5479         bigbuf);
5480
5481     EXTRANEOUS_DATA_CHECK(len, 2);
5482 }
5483
5484 static void
5485 param_cdma_pilot_strength(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
5486 {
5487     gint32 value;
5488     guint saved_offset;
5489
5490     EXACT_DATA_CHECK(len, 1);
5491
5492     saved_offset = asn1->offset;
5493
5494     asn1_int32_value_decode(asn1, 1, &value);
5495
5496     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
5497     proto_tree_add_text(tree, asn1->tvb,
5498         saved_offset, asn1->offset - saved_offset,
5499         "%s :  Reserved",
5500         bigbuf);
5501
5502     other_decode_bitfield_value(bigbuf, value, 0x3f, 8);
5503     proto_tree_add_text(tree, asn1->tvb,
5504         saved_offset, asn1->offset - saved_offset,
5505         "%s :  Value %u",
5506         bigbuf,
5507         value & 0x3f);
5508 }
5509
5510 static void
5511 param_trunk_stat(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
5512 {
5513     gint32 value;
5514     guint saved_offset;
5515     const gchar *str = NULL;
5516
5517     EXACT_DATA_CHECK(len, 1);
5518
5519     saved_offset = asn1->offset;
5520
5521     asn1_int32_value_decode(asn1, 1, &value);
5522
5523     switch (value)
5524     {
5525     case 0: str = "Idle"; break;
5526     case 1: str = "Blocked"; break;
5527     default:
5528         if ((value >= 2) && (value <= 223)) { str = "Reserved, treat as ERROR or Blocked"; }
5529         else { str = "Reserved for protocol extension, treat as ERROR or Blocked"; }
5530         break;
5531     }
5532
5533     proto_tree_add_text(tree, asn1->tvb,
5534         saved_offset, asn1->offset - saved_offset,
5535         "Trunk Status, %s",
5536         str);
5537 }
5538
5539 static void
5540 param_pref_lang_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
5541 {
5542     gint32 value;
5543     guint saved_offset;
5544     const gchar *str = NULL;
5545
5546     saved_offset = asn1->offset;
5547
5548     asn1_int32_value_decode(asn1, 1, &value);
5549
5550     switch (value)
5551     {
5552     case 0: str = "Unspecified"; break;
5553     case 1: str = "English"; break;
5554     case 2: str = "French"; break;
5555     case 3: str = "Spanish"; break;
5556     case 4: str = "German"; break;
5557     case 5: str = "Portuguese"; break;
5558     default:
5559         str = "Reserved, treat as Unspecified";
5560         break;
5561     }
5562
5563     proto_tree_add_text(tree, asn1->tvb,
5564         saved_offset, asn1->offset - saved_offset,
5565         "Preferred Language, %s",
5566         str);
5567
5568     EXTRANEOUS_DATA_CHECK(len, 1);
5569 }
5570
5571 static void
5572 param_rand_valtime(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
5573 {
5574     gint32 value;
5575     guint saved_offset;
5576     const gchar *str = NULL;
5577
5578     saved_offset = asn1->offset;
5579
5580     asn1_int32_value_decode(asn1, 1, &value);
5581
5582     if (value == 0)
5583     {
5584         str = "RAND shall not be stored";
5585     }
5586     else
5587     {
5588         sprintf(bigbuf, "RAND may be used for %u minutes", value);
5589         str = bigbuf;
5590     }
5591
5592     proto_tree_add_text(tree, asn1->tvb,
5593         saved_offset, asn1->offset - saved_offset,
5594         str);
5595
5596     EXTRANEOUS_DATA_CHECK(len, 1);
5597 }
5598
5599 static void
5600 param_tdma_burst_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
5601 {
5602     gint32 value;
5603     guint saved_offset;
5604     const gchar *str = NULL;
5605
5606     EXACT_DATA_CHECK(len, 1);
5607
5608     saved_offset = asn1->offset;
5609
5610     asn1_int32_value_decode(asn1, 1, &value);
5611
5612     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
5613     proto_tree_add_text(tree, asn1->tvb,
5614         saved_offset, asn1->offset - saved_offset,
5615         "%s :  Reserved",
5616         bigbuf);
5617
5618     other_decode_bitfield_value(bigbuf, value, 0x7c, 8);
5619     proto_tree_add_text(tree, asn1->tvb,
5620         saved_offset, asn1->offset - saved_offset,
5621         "%s :  Time Alignment Offset (TA), %u",
5622         bigbuf,
5623         (value & 0x7c) >> 2);
5624
5625     switch (value & 0x03)
5626     {
5627     case 0: str = "Transmit normal burst after cell-to-cell handoff"; break;
5628     case 1: str = "Transmit normal burst after handoff within cell"; break;
5629     case 2: str = "Transmit shortened burst after cell-to-cell handoff"; break;
5630     case 3: str = "Reserved, treat with RETURN ERROR"; break;
5631     }
5632
5633     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
5634     proto_tree_add_text(tree, asn1->tvb,
5635         saved_offset, asn1->offset - saved_offset,
5636         "%s :  Burst Code, %s",
5637         bigbuf,
5638         str);
5639 }
5640
5641 static void
5642 param_orig_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
5643 {
5644     gint32 value;
5645     guint saved_offset;
5646     const gchar *str = NULL;
5647
5648     EXACT_DATA_CHECK(len, 1);
5649
5650     saved_offset = asn1->offset;
5651
5652     asn1_int32_value_decode(asn1, 1, &value);
5653
5654     switch (value)
5655     {
5656     case 0: str = "Not used"; break;
5657     case 1: str = "Prior agreement"; break;
5658     case 2: str = "Origination denied"; break;
5659     case 3: str = "Local calls only"; break;
5660     case 4: str = "Selected leading digits of directory number or of international E.164 number, see Digits(Destination)"; break;
5661     case 5: str = "Selected leading digits of directory number or of international E.164 number and local calls only, see Digits(Destination)"; break;
5662     case 6: str = "National long distance"; break;
5663     case 7: str = "International calls"; break;
5664     case 8: str = "Single directory number or international E.164 number, see Digits(Destination)"; break;
5665     default:
5666         if ((value >= 9) && (value <= 223)) { str = "Reserved, treat as Local calls only"; }
5667         else { str = "Reserved for protocol extension, treat as Local calls only"; }
5668         break;
5669     }
5670
5671     proto_tree_add_text(tree, asn1->tvb,
5672         saved_offset, asn1->offset - saved_offset,
5673         "Allowed Call Types, %s",
5674         str);
5675 }
5676
5677 static void
5678 param_ms_loc(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
5679 {
5680     gint32 value;
5681     guint saved_offset;
5682
5683     SHORT_DATA_CHECK(len, 7);
5684
5685     saved_offset = asn1->offset;
5686
5687     asn1_int32_value_decode(asn1, 3, &value);
5688
5689     proto_tree_add_text(tree, asn1->tvb,
5690         saved_offset, asn1->offset - saved_offset,
5691         "Latitude in tenths of a second, %u",
5692         value);
5693
5694     saved_offset = asn1->offset;
5695
5696     asn1_int32_value_decode(asn1, 3, &value);
5697
5698     proto_tree_add_text(tree, asn1->tvb,
5699         saved_offset, asn1->offset - saved_offset,
5700         "Longitude in tenths of a second, %u",
5701         value);
5702
5703     saved_offset = asn1->offset;
5704
5705     asn1_int32_value_decode(asn1, MIN(len - 6, 2), &value);
5706
5707     proto_tree_add_text(tree, asn1->tvb,
5708         saved_offset, asn1->offset - saved_offset,
5709         "Resolution in units of 1 foot, %u",
5710         value);
5711
5712     EXTRANEOUS_DATA_CHECK(len, 8);
5713 }
5714
5715 static void
5716 param_unique_chal_rep(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
5717 {
5718     gint32 value;
5719     guint saved_offset;
5720     const gchar *str = NULL;
5721
5722     saved_offset = asn1->offset;
5723
5724     asn1_int32_value_decode(asn1, 1, &value);
5725
5726     switch (value)
5727     {
5728     case 0: str = "Not used"; break;
5729     case 1: str = "Unique Challenge not attempted"; break;
5730     case 2: str = "Unique Challenge no response"; break;
5731     case 3: str = "Unique Challenge successful"; break;
5732     case 4: str = "Unique Challenge failed"; break;
5733     default:
5734         if ((value >= 5) && (value <= 223)) { str = "Reserved, treat as Unique Challenge not attempted"; }
5735         else { str = "Reserved for protocol extension, treat as Unique Challenge not attempted"; }
5736         break;
5737     }
5738
5739     proto_tree_add_text(tree, asn1->tvb,
5740         saved_offset, asn1->offset - saved_offset,
5741         str);
5742
5743     EXTRANEOUS_DATA_CHECK(len, 1);
5744 }
5745
5746 static void
5747 param_rand_unique(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
5748 {
5749     guint saved_offset;
5750
5751     EXACT_DATA_CHECK(len, 3);
5752
5753     saved_offset = asn1->offset;
5754
5755     proto_tree_add_text(tree, asn1->tvb,
5756         saved_offset, len,
5757         "24-bit random number used as input to the CAVE algorithm for authenticating a specific MS");
5758
5759     asn1->offset += len;
5760 }
5761
5762 static void
5763 param_vpmask(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
5764 {
5765     gint32 value;
5766     guint saved_offset;
5767
5768     EXACT_DATA_CHECK(len, 66);
5769
5770     saved_offset = asn1->offset;
5771
5772     asn1_int32_value_decode(asn1, 1, &value);
5773
5774     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
5775     proto_tree_add_text(tree, asn1->tvb,
5776         saved_offset, asn1->offset - saved_offset,
5777         "%s :  Reserved",
5778         bigbuf);
5779
5780     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
5781     proto_tree_add_text(tree, asn1->tvb,
5782         saved_offset, asn1->offset - saved_offset,
5783         "%s :  Voice Privacy Mask-A (VPMASK-A) (MSB)",
5784         bigbuf);
5785
5786     saved_offset = asn1->offset;
5787
5788     proto_tree_add_text(tree, asn1->tvb,
5789         saved_offset, 32,
5790         "Voice Privacy Mask-A (VPMASK-A)");
5791
5792     asn1->offset += 32;
5793
5794     saved_offset = asn1->offset;
5795
5796     asn1_int32_value_decode(asn1, 1, &value);
5797
5798     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
5799     proto_tree_add_text(tree, asn1->tvb,
5800         saved_offset, asn1->offset - saved_offset,
5801         "%s :  Reserved",
5802         bigbuf);
5803
5804     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
5805     proto_tree_add_text(tree, asn1->tvb,
5806         saved_offset, asn1->offset - saved_offset,
5807         "%s :  Voice Privacy Mask-B (VPMASK-B) (MSB)",
5808         bigbuf);
5809
5810     saved_offset = asn1->offset;
5811
5812     proto_tree_add_text(tree, asn1->tvb,
5813         saved_offset, 32,
5814         "Voice Privacy Mask-B (VPMASK-B)");
5815
5816     asn1->offset += 32;
5817 }
5818
5819 static void
5820 param_ssd(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
5821 {
5822     guint saved_offset;
5823
5824     EXACT_DATA_CHECK(len, 16);
5825
5826     saved_offset = asn1->offset;
5827
5828     proto_tree_add_text(tree, asn1->tvb,
5829         saved_offset, 8,
5830         "Shared Secret Data-A (SSD-A)");
5831
5832     proto_tree_add_text(tree, asn1->tvb,
5833         saved_offset+8, 8,
5834         "Shared Secret Data-B (SSD-B)");
5835
5836     asn1->offset += len;
5837 }
5838
5839 static void
5840 param_upd_count(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
5841 {
5842     gint32 value;
5843     guint saved_offset;
5844     const gchar *str = NULL;
5845
5846     EXACT_DATA_CHECK(len, 1);
5847
5848     saved_offset = asn1->offset;
5849
5850     asn1_int32_value_decode(asn1, 1, &value);
5851
5852     switch (value)
5853     {
5854     case 0: str = "Not used"; break;
5855     case 1: str = "Update COUNT"; break;
5856     default:
5857         if ((value >= 2) && (value <= 223)) { str = "Reserved, treat as Update COUNT"; }
5858         else { str = "Reserved for protocol extension, treat as Update COUNT"; }
5859         break;
5860     }
5861
5862     proto_tree_add_text(tree, asn1->tvb,
5863         saved_offset, asn1->offset - saved_offset,
5864         "%s",
5865         str);
5866 }
5867
5868 static void
5869 param_sme_key(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
5870 {
5871     guint saved_offset;
5872
5873     EXACT_DATA_CHECK(len, 8);
5874
5875     saved_offset = asn1->offset;
5876
5877     proto_tree_add_text(tree, asn1->tvb,
5878         saved_offset, len,
5879         "Signaling Message Encryption Key (SMEKEY)");
5880
5881     asn1->offset += len;
5882 }
5883
5884 static void
5885 param_rand_ssd(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
5886 {
5887     guint saved_offset;
5888
5889     EXACT_DATA_CHECK(len, 7);
5890
5891     saved_offset = asn1->offset;
5892
5893     proto_tree_add_text(tree, asn1->tvb,
5894         saved_offset, len,
5895         "56-bit random number used as input to the CAVE algorithm for generating Shared Secret Data");
5896
5897     asn1->offset += len;
5898 }
5899
5900 static void
5901 param_setup_result(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
5902 {
5903     gint32 value;
5904     guint saved_offset;
5905     const gchar *str = NULL;
5906
5907     saved_offset = asn1->offset;
5908
5909     asn1_int32_value_decode(asn1, 1, &value);
5910
5911     switch (value)
5912     {
5913     case 0: str = "Not used"; break;
5914     case 1: str = "Unsuccessful"; break;
5915     case 2: str = "Successful"; break;
5916     default:
5917         str = "Reserved, treat as Unsuccessful";
5918         break;
5919     }
5920
5921     proto_tree_add_text(tree, asn1->tvb,
5922         saved_offset, asn1->offset - saved_offset,
5923         str);
5924
5925     EXTRANEOUS_DATA_CHECK(len, 1);
5926 }
5927
5928 static void
5929 param_randc(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
5930 {
5931     guint saved_offset;
5932
5933     saved_offset = asn1->offset;
5934
5935     proto_tree_add_text(tree, asn1->tvb,
5936         saved_offset, 1,
5937         "The 8 most significant bits of the 32-bit Random Variable used to compute the Authentication Response");
5938
5939     asn1->offset += 1;
5940
5941     EXTRANEOUS_DATA_CHECK(len, 1);
5942 }
5943
5944 static void
5945 param_ext_mscid(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5946 {
5947     gint32 type;
5948     guint saved_offset;
5949     const gchar *str = NULL;
5950
5951     EXACT_DATA_CHECK(len, 4);
5952
5953     saved_offset = asn1->offset;
5954
5955     asn1_int32_value_decode(asn1, 1, &type);
5956
5957     switch (type)
5958     {
5959     case 0: str = "Not specified"; break;
5960     case 1: str = "Serving MSC"; break;
5961     case 2: str = "Home MSC"; break;
5962     case 3: str = "Gateway MSC"; break;
5963     case 4: str = "HLR"; break;
5964     case 5: str = "VLR"; break;
5965     case 6: str = "EIR (reserved)"; break;
5966     case 7: str = "AC"; break;
5967     case 8: str = "Border MSC"; break;
5968     case 9: str = "Originating MSC"; break;
5969     default:
5970         if ((type >= 10) && (type <= 223)) { str = "Reserved, treat as Not specified"; }
5971         else { str = "Reserved for protocol extension, treat as Not specified"; }
5972         break;
5973     }
5974
5975     proto_tree_add_text(tree, asn1->tvb,
5976         saved_offset, asn1->offset - saved_offset,
5977         "Type (%u), %s",
5978         type,
5979         str);
5980
5981     param_mscid(asn1, tree, len-1, add_string);
5982 }
5983
5984 static void
5985 param_sub_addr(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
5986 {
5987     gint32 value;
5988     guint saved_offset;
5989     const gchar *str = NULL;
5990
5991     saved_offset = asn1->offset;
5992     asn1_int32_value_decode(asn1, 1, &value);
5993
5994     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
5995     proto_tree_add_text(tree, asn1->tvb,
5996         saved_offset, asn1->offset - saved_offset,
5997         "%s :  Should be 1",
5998         bigbuf);
5999
6000     switch ((value & 0x70) >> 4)
6001     {
6002     case 0x00: str = "NSAP (CCITT Rec. X.213 or ISO 8348 AD2)"; break;
6003     case 0x02: str = "User specified"; break;
6004     default:
6005         str = "Reserved";
6006         break;
6007     }
6008
6009     other_decode_bitfield_value(bigbuf, value, 0x70, 8);
6010     proto_tree_add_text(tree, asn1->tvb,
6011         saved_offset, asn1->offset - saved_offset,
6012         "%s :  Type of Subaddress %s",
6013         bigbuf, str);
6014
6015     switch ((value & 0x08) >> 3)
6016     {
6017     case 0x00: str = "Even number of subaddress signals follow"; break;
6018     case 0x01: str = "Odd number of subaddress signals follow"; break;
6019     }
6020
6021     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
6022     proto_tree_add_text(tree, asn1->tvb,
6023         saved_offset, asn1->offset - saved_offset,
6024         "%s :  %s",
6025         bigbuf, str);
6026
6027     proto_tree_add_text(tree, asn1->tvb,
6028         asn1->offset, len - 1,
6029         "Subaddress");
6030
6031     asn1->offset += len - 1;
6032 }
6033
6034 static void
6035 param_digits_basic(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string, gboolean searchable _U_)
6036 {
6037     gint32 value, b1, b2, b3, b4, enc, plan;
6038     guint saved_offset;
6039     const gchar *str = NULL;
6040     proto_item *item;
6041     proto_tree *subtree;
6042     guchar *poctets;
6043
6044     SHORT_DATA_CHECK(len, 4);
6045
6046     saved_offset = asn1->offset;
6047     asn1_int32_value_decode(asn1, 1, &value);
6048
6049     switch (value)
6050     {
6051     case 0: str = "Not used"; break;
6052     case 1: str = "Dialed Numer or Called Party Number"; break;
6053     case 2: str = "Calling Party Number"; break;
6054     case 3: str = "Caller Interaction (Not used)"; break;
6055     case 4: str = "Routing Number"; break;
6056     case 5: str = "Billing Number"; break;
6057     case 6: str = "Destination Number"; break;
6058     case 7: str = "LATA (Not used)"; break;
6059     case 8: str = "Carrier"; break;
6060     case 13: str = "ESRD"; break;
6061     default:
6062         str = "Reserved";
6063         break;
6064     }
6065
6066     proto_tree_add_text(tree, asn1->tvb,
6067         saved_offset, asn1->offset - saved_offset,
6068         "Type of Digits %u: %s",
6069         value, str);
6070
6071     saved_offset = asn1->offset;
6072     asn1_int32_value_decode(asn1, 1, &value);
6073
6074     item =
6075         proto_tree_add_text(tree, asn1->tvb,
6076             saved_offset, asn1->offset - saved_offset,
6077             "Nature of Number");
6078
6079     subtree = proto_item_add_subtree(item, ett_natnum);
6080
6081     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
6082     proto_tree_add_text(subtree, asn1->tvb,
6083         saved_offset, asn1->offset - saved_offset,
6084         "%s :  Reserved",
6085         bigbuf);
6086
6087     switch ((value & 0x30) >> 4)
6088     {
6089     case 0x00: str = "User provided, not screened"; break;
6090     case 0x01: str = "User provided, screening passed"; break;
6091     case 0x02: str = "User provided, screening failed"; break;
6092     case 0x03: str = "Network provided"; break;
6093     }
6094
6095     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
6096     proto_tree_add_text(subtree, asn1->tvb,
6097         saved_offset, asn1->offset - saved_offset,
6098         "%s :  %s",
6099         bigbuf, str);
6100
6101     proto_tree_add_text(subtree, asn1->tvb,
6102         saved_offset, asn1->offset - saved_offset,
6103         ".... %u... :  Reserved",
6104         (value & 0x08) >> 3);
6105
6106     proto_tree_add_text(subtree, asn1->tvb,
6107         saved_offset, asn1->offset - saved_offset,
6108         ".... .%u.. :  Number is %savailable",
6109         (value & 0x04) >> 2, (value & 0x04) ? "not " : "");
6110
6111     proto_tree_add_text(subtree, asn1->tvb,
6112         saved_offset, asn1->offset - saved_offset,
6113         ".... ..%u. :  Presentation %s",
6114         (value & 0x02) >> 1, (value & 0x02) ? "Restricted" : "Allowed");
6115
6116     proto_tree_add_text(subtree, asn1->tvb,
6117         saved_offset, asn1->offset - saved_offset,
6118         ".... ...%u :  %s",
6119         value & 0x01, (value & 0x01) ? "International" : "National");
6120
6121     saved_offset = asn1->offset;
6122     asn1_int32_value_decode(asn1, 1, &value);
6123
6124     plan = (value & 0xf0) >> 4;
6125     switch (plan)
6126     {
6127     case 0x00: str = "Unknown or not applicable"; break;
6128     case 0x01: str = "ISDN Numbering (Not used)"; break;
6129     case 0x02: str = "Telephony Numbering (ITU-T Rec. E.164, E.163)"; break;
6130     case 0x03: str = "Data Numbering (ITU-T Rec. X.121)(Not used)"; break;
6131     case 0x04: str = "Telex Numbering (ITU-T Rec. F.69)(Not used)"; break;
6132     case 0x05: str = "Maritime Mobile Numbering (Not used)"; break;
6133     case 0x06: str = "Land Mobile Numbering (ITU-T Rec. E.212)"; break;
6134     case 0x07: str = "Private Numbering Plan (service provider defined)"; break;
6135     case 0x0d: str = "ANSI SS7 Point Code (PC) and Subsystem Number (SSN)"; break;
6136     case 0x0e: str = "Internet Protocol (IP) Address"; break;
6137     case 0x0f: str = "Reserved for extension"; break;
6138     default:
6139         str = "Reserved";
6140         break;
6141     }
6142
6143     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
6144     proto_tree_add_text(tree, asn1->tvb,
6145         saved_offset, asn1->offset - saved_offset,
6146         "%s :  Numbering Plan: %s",
6147         bigbuf, str);
6148
6149     enc = value & 0x0f;
6150     switch (enc)
6151     {
6152     case 0x00: str = "Not used"; break;
6153     case 0x01: str = "BCD"; break;
6154     case 0x02: str = "IA5"; break;
6155     case 0x03: str = "Octet String"; break;
6156     default:
6157         str = "Reserved";
6158         break;
6159     }
6160
6161     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
6162     proto_tree_add_text(tree, asn1->tvb,
6163         saved_offset, asn1->offset - saved_offset,
6164         "%s :  Encoding: %s",
6165         bigbuf, str);
6166
6167     saved_offset = asn1->offset;
6168
6169     if (plan == 0x0d)
6170     {
6171         asn1_int32_value_decode(asn1, 1, &b1);
6172         asn1_int32_value_decode(asn1, 1, &b2);
6173         asn1_int32_value_decode(asn1, 1, &b3);
6174         asn1_int32_value_decode(asn1, 1, &b4);
6175
6176         proto_tree_add_text(tree, asn1->tvb,
6177             saved_offset, asn1->offset - saved_offset,
6178             "Point Code %u-%u-%u  SSN %u",
6179             b3, b2, b1, b4);
6180     }
6181     else if (plan == 0x0e)
6182     {
6183         asn1_int32_value_decode(asn1, 1, &b1);
6184         asn1_int32_value_decode(asn1, 1, &b2);
6185         asn1_int32_value_decode(asn1, 1, &b3);
6186         asn1_int32_value_decode(asn1, 1, &b4);
6187
6188         proto_tree_add_text(tree, asn1->tvb,
6189             saved_offset, asn1->offset - saved_offset,
6190             "IP Address %u.%u.%u.%u",
6191             b1, b2, b3, b4);
6192     }
6193     else
6194     {
6195         asn1_int32_value_decode(asn1, 1, &value);
6196
6197         proto_tree_add_text(tree, asn1->tvb,
6198             saved_offset, asn1->offset - saved_offset,
6199             "Number of Digits: %u",
6200             value);
6201
6202         if (enc == 0x02)
6203         {
6204             proto_tree_add_text(tree, asn1->tvb,
6205                 asn1->offset, value,
6206                 "IA5 Digits: %s",
6207                 tvb_format_text(asn1->tvb, asn1->offset, value));
6208
6209             asn1->offset += value;
6210         }
6211         else if (enc == 0x01)
6212         {
6213             saved_offset = asn1->offset;
6214             asn1_string_value_decode(asn1, (value+1)/2, &poctets);
6215
6216             my_dgt_tbcd_unpack(bigbuf, poctets, (value+1)/2, &Dgt_tbcd);
6217             g_free(poctets);
6218
6219             if (searchable)
6220             {
6221                         proto_tree_add_string_format(tree, hf_ansi_map_number, asn1->tvb,
6222                                 saved_offset, (value+1)/2,
6223                                 bigbuf,
6224                                 "BCD Digits: %s",
6225                                 bigbuf);
6226             }
6227             else
6228             {
6229                         proto_tree_add_text(tree, asn1->tvb,
6230                                 saved_offset, (value+1)/2,
6231                                 "BCD Digits: %s",
6232                                 bigbuf);
6233                 }
6234         }
6235         }
6236 }
6237
6238 static void
6239 param_digits(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
6240 {
6241     param_digits_basic(asn1, tree, len, add_string, FALSE);
6242 }
6243
6244 static void
6245 param_mdn(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6246 {
6247     param_digits_basic(asn1, tree, len, add_string, TRUE);
6248 }
6249
6250 static void
6251 param_esn(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
6252 {
6253     gint32 value;
6254     guint saved_offset;
6255
6256     EXACT_DATA_CHECK(len, 4);
6257
6258     saved_offset = asn1->offset;
6259
6260     asn1_int32_value_decode(asn1, 4, &value);
6261
6262     proto_tree_add_text(tree, asn1->tvb,
6263         saved_offset, asn1->offset - saved_offset,
6264         "ESN 0x%04x",
6265         value);
6266
6267     sprintf(add_string, " - 0x%04x", value);
6268 }
6269
6270 static void
6271 param_sms_noti(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
6272 {
6273     gint32 value;
6274     guint saved_offset;
6275     const gchar *str = NULL;
6276
6277     saved_offset = asn1->offset;
6278
6279     asn1_int32_value_decode(asn1, 1, &value);
6280
6281     switch (value)
6282     {
6283     case 0: str = "Not used"; break;
6284     case 1: str = "Notify when available"; break;
6285     case 2: str = "Do not notify when available"; break;
6286     default:
6287         if ((value >= 3) && (value <= 127)) { str = "Reserved, treat as Notify when available"; }
6288         else if ((value >= 128) && (value <= 223)) { str = "Reserved, treat as Do not notify when available"; }
6289         else { str = "Reserved for protocol extension"; }
6290         break;
6291     }
6292
6293     proto_tree_add_text(tree, asn1->tvb,
6294         saved_offset, asn1->offset - saved_offset,
6295         "%s (%u)",
6296         str,
6297         value);
6298
6299     EXTRANEOUS_DATA_CHECK(len, 1);
6300 }
6301
6302 static void
6303 param_sms_orig_restric(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
6304 {
6305     gint32 value;
6306     guint saved_offset;
6307     const gchar *str = NULL;
6308
6309     saved_offset = asn1->offset;
6310
6311     asn1_int32_value_decode(asn1, 1, &value);
6312
6313     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
6314     proto_tree_add_text(tree, asn1->tvb,
6315         saved_offset, asn1->offset - saved_offset,
6316         "%s :  Reserved",
6317         bigbuf);
6318
6319     switch (value & 0x08)
6320     {
6321     case 0x00: str = "No effect"; break;
6322     default:
6323         str = "Force indirect";
6324         break;
6325     }
6326
6327     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
6328     proto_tree_add_text(tree, asn1->tvb,
6329         saved_offset, asn1->offset - saved_offset,
6330         "%s :  Force Message Center, %s",
6331         bigbuf, str);
6332
6333     switch (value & 0x04)
6334     {
6335     case 0x00: str = "Block direct"; break;
6336     default:
6337         str = "Allow direct";
6338         break;
6339     }
6340
6341     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
6342     proto_tree_add_text(tree, asn1->tvb,
6343         saved_offset, asn1->offset - saved_offset,
6344         "%s :  DIRECT, %s",
6345         bigbuf, str);
6346
6347     switch (value & 0x03)
6348     {
6349     case 0x00: str = "Block all"; break;
6350     case 0x02: str = "Allow specific"; break;
6351     case 0x03: str = "Allow all"; break;
6352     default:
6353         str = "Reserved";
6354         break;
6355     }
6356
6357     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
6358     proto_tree_add_text(tree, asn1->tvb,
6359         saved_offset, asn1->offset - saved_offset,
6360         "%s :  DEFAULT, %s",
6361         bigbuf, str);
6362
6363     EXTRANEOUS_DATA_CHECK(len, 1);
6364 }
6365
6366 static void
6367 param_seizure(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
6368 {
6369     gint32 value;
6370     guint saved_offset;
6371     const gchar *str = NULL;
6372
6373     saved_offset = asn1->offset;
6374
6375     asn1_int32_value_decode(asn1, 1, &value);
6376
6377     switch (value)
6378     {
6379     case 0: str = "Unspecified"; break;
6380     case 1: str = "Loopback"; break;
6381     default:
6382         if ((value >= 2) && (value <= 223)) { str = "Reserved"; }
6383         else { str = "Reserved for protocol extension"; }
6384         break;
6385     }
6386
6387     proto_tree_add_text(tree, asn1->tvb,
6388         saved_offset, asn1->offset - saved_offset,
6389         str);
6390
6391     EXTRANEOUS_DATA_CHECK(len, 1);
6392 }
6393
6394 static void
6395 param_sms_tele(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
6396 {
6397     gint32 value;
6398     guint saved_offset;
6399     const gchar *str = NULL;
6400
6401     ansi_map_sms_tele_id = -1;
6402
6403     SHORT_DATA_CHECK(len, 2);
6404
6405     saved_offset = asn1->offset;
6406
6407     asn1_int32_value_decode(asn1, 2, &value);
6408
6409     str = match_strval(value, ansi_tele_strings);
6410     if (str == NULL)
6411     {
6412         switch (value)
6413         {
6414         case 0: str = "Not used"; break;
6415         default:
6416             if ((value >= 2) && (value <= 4095)) { str = "Reserved for assignment by TIA/EIA-41"; }
6417             else if ((value >= 4100) && (value <= 32512)) { str = "Reserved for assignment by TIA/EIA-41"; }
6418             else if ((value >= 32514) && (value <= 32639)) { str = "Reserved for assignment by this Standard for TDMA MS-based SMEs."; }
6419             else if ((value >= 32640) && (value <= 32767)) { str = "Reserved for carrier specific teleservices for TDMA MS-based SMEs."; }
6420             else if ((value >= 32768) && (value <= 49151)) { str = "Reserved for node specific teleservices."; }
6421             else if ((value >= 49152) && (value <= 65535)) { str = "Reserved for carrier specific teleservices."; }
6422             else { str = "Unknown teleservice ID"; }
6423             break;
6424         }
6425     }
6426
6427     ansi_map_sms_tele_id = value;
6428
6429     proto_tree_add_text(tree, asn1->tvb,
6430         saved_offset, asn1->offset - saved_offset,
6431         "%s (%u)",
6432         str,
6433         value);
6434
6435     EXTRANEOUS_DATA_CHECK(len, 2);
6436 }
6437
6438 static void
6439 param_sms_term_restric(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
6440 {
6441     gint32 value;
6442     guint saved_offset;
6443     const gchar *str = NULL;
6444
6445     saved_offset = asn1->offset;
6446
6447     asn1_int32_value_decode(asn1, 1, &value);
6448
6449     other_decode_bitfield_value(bigbuf, value, 0xf8, 8);
6450     proto_tree_add_text(tree, asn1->tvb,
6451         saved_offset, asn1->offset - saved_offset,
6452         "%s :  Reserved",
6453         bigbuf);
6454
6455     switch (value & 0x04)
6456     {
6457     case 0x00: str = "Block messages charged to destination"; break;
6458     default:
6459         str = "Allow messages charged to destination";
6460         break;
6461     }
6462
6463     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
6464     proto_tree_add_text(tree, asn1->tvb,
6465         saved_offset, asn1->offset - saved_offset,
6466         "%s :  Reverse Charges, %s",
6467         bigbuf, str);
6468
6469     switch (value & 0x03)
6470     {
6471     case 0x00: str = "Block all"; break;
6472     case 0x02: str = "Allow specific"; break;
6473     case 0x03: str = "Allow all"; break;
6474     default:
6475         str = "Reserved";
6476         break;
6477     }
6478
6479     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
6480     proto_tree_add_text(tree, asn1->tvb,
6481         saved_offset, asn1->offset - saved_offset,
6482         "%s :  DEFAULT, %s",
6483         bigbuf, str);
6484
6485     EXTRANEOUS_DATA_CHECK(len, 1);
6486 }
6487
6488 static void
6489 param_sms_msg_count(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
6490 {
6491     gint32 value;
6492     guint saved_offset;
6493     const gchar *str = NULL;
6494
6495     saved_offset = asn1->offset;
6496
6497     asn1_int32_value_decode(asn1, 1, &value);
6498
6499     switch (value)
6500     {
6501     case 0: str = "No more pending SMS messages"; break;
6502     default:
6503         sprintf(bigbuf, "%u pending SMS messages", value);
6504         str = bigbuf;
6505         break;
6506     }
6507
6508     proto_tree_add_text(tree, asn1->tvb,
6509         saved_offset, asn1->offset - saved_offset,
6510         str);
6511
6512     EXTRANEOUS_DATA_CHECK(len, 1);
6513 }
6514
6515 static void
6516 param_qos_pri(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
6517 {
6518     gint32 value, temp_int;
6519     guint saved_offset;
6520     const gchar *str = NULL;
6521
6522     saved_offset = asn1->offset;
6523
6524     asn1_int32_value_decode(asn1, 1, &value);
6525
6526     temp_int = (value & 0xf0) >> 4;
6527     if ((temp_int < 0) || (temp_int >= (gint) NUM_QOS_PRI_STR))
6528     {
6529         str = "Reserved";
6530     }
6531     else
6532     {
6533         str = qos_pri_str[temp_int];
6534     }
6535
6536     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
6537     proto_tree_add_text(tree, asn1->tvb,
6538         saved_offset, asn1->offset - saved_offset,
6539         "%s :  Assured Priority, %s",
6540         bigbuf,
6541         str);
6542
6543     temp_int = value & 0x0f;
6544     if ((temp_int < 0) || (temp_int >= (gint) NUM_QOS_PRI_STR))
6545     {
6546         str = "Reserved";
6547     }
6548     else
6549     {
6550         str = qos_pri_str[temp_int];
6551     }
6552
6553     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
6554     proto_tree_add_text(tree, asn1->tvb,
6555         saved_offset, asn1->offset - saved_offset,
6556         "%s :  Non-Assured Priority, %s",
6557         bigbuf,
6558         str);
6559
6560     EXTRANEOUS_DATA_CHECK(len, 1);
6561 }
6562
6563 static void
6564 param_calling_party_cat(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
6565 {
6566     gint32 value;
6567     guint saved_offset;
6568
6569     EXACT_DATA_CHECK(len, 1);
6570
6571     saved_offset = asn1->offset;
6572
6573     asn1_int32_value_decode(asn1, 1, &value);
6574
6575     proto_tree_add_text(tree, asn1->tvb,
6576         saved_offset, asn1->offset - saved_offset,
6577         "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");
6578 }
6579
6580 /*
6581  * Dissect IOS data parameters expected to be in TLV format
6582  */
6583 static void
6584 dissect_cdma2000_ios_data(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
6585 {
6586     gint32      value;
6587     guint       num_elems;
6588     guchar      elem_len;
6589     guint32     orig_offset, saved_offset;
6590     proto_tree  *subtree;
6591     proto_item  *item;
6592     const gchar *str;
6593     gint        idx;
6594
6595     num_elems = 0;
6596     orig_offset = saved_offset = asn1->offset;
6597
6598     while ((saved_offset - orig_offset + 2) <= len)
6599     {
6600         num_elems++;
6601
6602         asn1_int32_value_decode(asn1, 1, &value);
6603         str = match_strval_idx((guint32) value, ansi_a_ios401_elem_1_strings, &idx);
6604
6605         asn1_octet_decode(asn1, &elem_len);
6606
6607         item =
6608             proto_tree_add_text(tree,
6609                 asn1->tvb, saved_offset, elem_len + 2,
6610                 "IOS - %s",
6611                 str);
6612
6613         subtree = proto_item_add_subtree(item, ett_ansi_map_ios401_elem[idx]);
6614
6615         proto_tree_add_none_format(subtree, hf_ansi_map_ios401_elem_id, asn1->tvb,
6616             saved_offset, 1, "Element ID");
6617
6618         proto_tree_add_uint(subtree, hf_ansi_map_length, asn1->tvb,
6619             saved_offset + 1, 1, elem_len);
6620
6621         if (elem_len > 0)
6622         {
6623             proto_tree_add_text(subtree,
6624                 asn1->tvb, saved_offset + 2, elem_len,
6625                 "Element Value");
6626
6627             asn1->offset += elem_len;
6628         }
6629
6630         saved_offset += elem_len + 2;
6631     }
6632
6633     sprintf(add_string, " - (%u)", num_elems);
6634
6635     EXTRANEOUS_DATA_CHECK((len - (saved_offset - orig_offset)), 0);
6636 }
6637
6638 static void
6639 param_cdma2000_ho_ivk_ios(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6640 {
6641
6642     dissect_cdma2000_ios_data(asn1, tree, len, add_string);
6643 }
6644
6645 static void
6646 param_cdma2000_ho_rsp_ios(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6647 {
6648
6649     dissect_cdma2000_ios_data(asn1, tree, len, add_string);
6650 }
6651
6652 static void
6653 param_msid_usage(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
6654 {
6655     gint32 value;
6656     guint saved_offset;
6657     const gchar *str = NULL;
6658
6659     saved_offset = asn1->offset;
6660
6661     asn1_int32_value_decode(asn1, 1, &value);
6662
6663     other_decode_bitfield_value(bigbuf, value, 0xfc, 8);
6664     proto_tree_add_text(tree, asn1->tvb,
6665         saved_offset, asn1->offset - saved_offset,
6666         "%s :  Reserved",
6667         bigbuf);
6668
6669     switch (value & 0x03)
6670     {
6671     case 0: str = "Not used"; break;
6672     case 1: str = "MIN last used"; break;
6673     case 2: str = "IMSI last used"; break;
6674     case 3: str = "Reserved"; break;
6675     }
6676
6677     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
6678     proto_tree_add_text(tree, asn1->tvb,
6679         saved_offset, asn1->offset - saved_offset,
6680         "%s :  %s",
6681         bigbuf,
6682         str);
6683
6684     EXTRANEOUS_DATA_CHECK(len, 1);
6685 }
6686
6687 static void
6688 param_new_min_ext(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
6689 {
6690     gint32 value;
6691     guint saved_offset;
6692     const gchar *str = NULL;
6693
6694     EXACT_DATA_CHECK(len, 3);
6695
6696     saved_offset = asn1->offset;
6697
6698     asn1_int32_value_decode(asn1, 1, &value);
6699
6700     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
6701     proto_tree_add_text(tree, asn1->tvb,
6702         saved_offset, asn1->offset - saved_offset,
6703         "%s :  MCC_M (MSB), see CDMA",
6704         bigbuf);
6705
6706     other_decode_bitfield_value(bigbuf, value, 0x0e, 8);
6707     proto_tree_add_text(tree, asn1->tvb,
6708         saved_offset, asn1->offset - saved_offset,
6709         "%s :  IMSI_M_ADDR_NUM, see CDMA",
6710         bigbuf);
6711
6712     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
6713     proto_tree_add_text(tree, asn1->tvb,
6714         saved_offset, asn1->offset - saved_offset,
6715         "%s :  IMSI_M_CLASS, see CDMA",
6716         bigbuf);
6717
6718     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
6719     proto_tree_add_text(tree, asn1->tvb,
6720         saved_offset, asn1->offset - saved_offset,
6721         "%s :  %s",
6722         bigbuf,
6723         str);
6724
6725     bigbuf[0] = Dgt_tbcd.out[(value & 0xf0) >> 4];
6726
6727     saved_offset = asn1->offset;
6728
6729     asn1_int32_value_decode(asn1, 1, &value);
6730
6731     bigbuf[1] = Dgt_tbcd.out[value & 0x0f];
6732     bigbuf[2] = Dgt_tbcd.out[(value & 0xf0) >> 4];
6733     bigbuf[3] = '\0';
6734
6735     proto_tree_add_text(tree, asn1->tvb,
6736         saved_offset, asn1->offset - saved_offset,
6737         "MCC_M, %s, see CDMA",
6738         bigbuf);
6739
6740     saved_offset = asn1->offset;
6741
6742     asn1_int32_value_decode(asn1, 1, &value);
6743
6744     bigbuf[0] = Dgt_tbcd.out[value & 0x0f];
6745     bigbuf[1] = Dgt_tbcd.out[(value & 0xf0) >> 4];
6746     bigbuf[2] = '\0';
6747
6748     proto_tree_add_text(tree, asn1->tvb,
6749         saved_offset, asn1->offset - saved_offset,
6750         "IMSI_11_12, %s, see CDMA",
6751         bigbuf);
6752 }
6753
6754 static void
6755 param_dtx_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
6756 {
6757     gint32 value;
6758     guint saved_offset;
6759     const gchar *str = NULL;
6760
6761     saved_offset = asn1->offset;
6762
6763     asn1_int32_value_decode(asn1, 1, &value);
6764
6765     other_decode_bitfield_value(bigbuf, value, 0xfe, 8);
6766     proto_tree_add_text(tree, asn1->tvb,
6767         saved_offset, asn1->offset - saved_offset,
6768         "%s :  Reserved",
6769         bigbuf);
6770
6771     switch (value & 0x01)
6772     {
6773     case 0: str = "Discontinuous Transmission mode is not active"; break;
6774     case 1: str = "Discontinuous Transmission mode is active"; break;
6775     }
6776
6777     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
6778     proto_tree_add_text(tree, asn1->tvb,
6779         saved_offset, asn1->offset - saved_offset,
6780         "%s :  %s",
6781         bigbuf,
6782         str);
6783
6784     EXTRANEOUS_DATA_CHECK(len, 1);
6785 }
6786
6787 static void
6788 param_cdma_mob_cap(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
6789 {
6790     gint32 value;
6791     guint saved_offset;
6792     const gchar *str = NULL;
6793
6794     saved_offset = asn1->offset;
6795
6796     asn1_int32_value_decode(asn1, 1, &value);
6797
6798     other_decode_bitfield_value(bigbuf, value, 0xfe, 8);
6799     proto_tree_add_text(tree, asn1->tvb,
6800         saved_offset, asn1->offset - saved_offset,
6801         "%s :  Reserved",
6802         bigbuf);
6803
6804     switch (value & 0x01)
6805     {
6806     case 0: str = "No MS-initiated position determination"; break;
6807     case 1: str = "MS-initiated position determination"; break;
6808     }
6809
6810     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
6811     proto_tree_add_text(tree, asn1->tvb,
6812         saved_offset, asn1->offset - saved_offset,
6813         "%s :  %s",
6814         bigbuf,
6815         str);
6816
6817     EXTRANEOUS_DATA_CHECK(len, 1);
6818 }
6819
6820 static void
6821 param_gen_time(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
6822 {
6823     gint32 value;
6824     gint32 h, m, s, ts;
6825     guint saved_offset;
6826
6827     SHORT_DATA_CHECK(len, 6);
6828
6829     saved_offset = asn1->offset;
6830
6831     asn1_int32_value_decode(asn1, 1, &value);
6832
6833     proto_tree_add_text(tree, asn1->tvb,
6834         saved_offset, asn1->offset - saved_offset,
6835         "Year-2000, %u",
6836         value);
6837
6838     saved_offset = asn1->offset;
6839
6840     asn1_int32_value_decode(asn1, 1, &value);
6841
6842     proto_tree_add_text(tree, asn1->tvb,
6843         saved_offset, asn1->offset - saved_offset,
6844         "Month, %u",
6845         value);
6846
6847     saved_offset = asn1->offset;
6848
6849     asn1_int32_value_decode(asn1, 1, &value);
6850
6851     proto_tree_add_text(tree, asn1->tvb,
6852         saved_offset, asn1->offset - saved_offset,
6853         "Day of month, %u",
6854         value);
6855
6856     saved_offset = asn1->offset;
6857
6858     asn1_int32_value_decode(asn1, 3, &value);
6859
6860     h = value / (3600 * 10);
6861     m = (value - (h * (3600 * 10))) / (60 * 10);
6862     s = (value - (h * (3600 * 10)) - (m * (60 * 10))) / 10;
6863     ts = (value - (h * (3600 * 10)) - (m * (60 * 10)) - (s * 10));
6864
6865     proto_tree_add_text(tree, asn1->tvb,
6866         saved_offset, asn1->offset - saved_offset,
6867         "Time of day (UTC) (in tenths of seconds - 1), %u (%u:%u:%u.%u)",
6868         value,
6869         h,
6870         m,
6871         s,
6872         ts);
6873
6874     EXTRANEOUS_DATA_CHECK(len, 6);
6875 }
6876
6877 static void
6878 param_geo_pos(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
6879 {
6880     guint saved_offset;
6881
6882     saved_offset = asn1->offset;
6883
6884     proto_tree_add_text(tree, asn1->tvb,
6885         saved_offset, len,
6886         "Calling Geodetic Location (CGL), see T1.628 CallingGeodeticLocation TCAP parameter for encoding");
6887 }
6888
6889 static void
6890 param_mob_call_status(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
6891 {
6892     gint32 value, auth;
6893     guint saved_offset;
6894     const gchar *str = NULL;
6895
6896     saved_offset = asn1->offset;
6897
6898     asn1_int32_value_decode(asn1, 1, &value);
6899
6900     auth = (value & 0xf0) >> 4;
6901     switch (auth)
6902     {
6903     case 0: str = "Authorization not performed"; break;
6904     case 1: str = "Authorization successful"; break;
6905     case 2: str = "Invalid Electronic Serial Number (ESN)"; break;
6906     case 3: str = "Unassigned Directory Number (DN)"; break;
6907     case 4: str = "Duplicate Unit"; break;
6908     case 5: str = "Delinquent Account"; break;
6909     case 6: str = "Stolen Unit"; break;
6910     case 7: str = "Not authorized for MSC"; break;
6911     case 8: str = "Unspecified"; break;
6912     default:
6913         str = "Reserved, treat as Authorization not performed";
6914         break;
6915     }
6916
6917     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
6918     proto_tree_add_text(tree, asn1->tvb,
6919         saved_offset, asn1->offset - saved_offset,
6920         "%s :  Authorization, %s",
6921         bigbuf,
6922         str);
6923
6924     auth = value & 0x0f;
6925     switch (auth)
6926     {
6927     case 0: str = "Authentication not performed. Authentication has not yet occurred or the MS is not capable of authentication"; break;
6928     case 1: str = "Authentication successful. Authentication has successfully occurred on the MS"; break;
6929     case 2: str = "Authentication failure. An authentication failure has occurred on the MS"; break;
6930     default:
6931         str = "Reserved, treat as Authentication not performed";
6932         break;
6933     }
6934
6935     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
6936     proto_tree_add_text(tree, asn1->tvb,
6937         saved_offset, asn1->offset - saved_offset,
6938         "%s :  Authentication, %s",
6939         bigbuf,
6940         str);
6941
6942     EXTRANEOUS_DATA_CHECK(len, 1);
6943 }
6944
6945 static void
6946 param_pos_req_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
6947 {
6948     gint32 value;
6949     guint saved_offset;
6950     const gchar *str = NULL;
6951
6952     saved_offset = asn1->offset;
6953
6954     asn1_int32_value_decode(asn1, 1, &value);
6955
6956     switch (value)
6957     {
6958     case 0: str = "Not used"; break;
6959     case 1: str = "Initial position. Return updated position only if initial position is unavailable."; break;
6960     case 2: str = "Return the updated position"; break;
6961     case 3: str = "Return the updated or last known position"; break;
6962     case 4: str = "Reserved for LSP interface. Treat as Not used"; break;
6963     default:
6964         if ((value >= 5) && (value <= 95)) { str = "Reserved, treat as Initial position"; }
6965         else { str = "Reserved for protocol extension, treat as Initial position"; }
6966         break;
6967     }
6968
6969     proto_tree_add_text(tree, asn1->tvb,
6970         saved_offset, asn1->offset - saved_offset,
6971         "Position Request Type, %s",
6972         str);
6973
6974     EXTRANEOUS_DATA_CHECK(len, 1);
6975 }
6976
6977 static void
6978 param_pos_result(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
6979 {
6980     gint32 value;
6981     guint saved_offset;
6982     const gchar *str = NULL;
6983
6984     saved_offset = asn1->offset;
6985
6986     asn1_int32_value_decode(asn1, 1, &value);
6987
6988     switch (value)
6989     {
6990     case 0: str = "Not used"; break;
6991     case 1: str = "Initial position returned"; break;
6992     case 2: str = "Updated position returned"; break;
6993     case 3: str = "Last known position returned"; break;
6994     case 4: str = "Requested position is not available"; break;
6995     case 5: str = "Caller disconnected. No call in progress for caller identified"; break;
6996     case 6: str = "Caller has handed-off. Position is unavailable due to a hand-off (e.g. handoff to a position incapable system)"; break;
6997     case 7: str = "Identified MS is inactive or has roamed to another system"; break;
6998     case 8: str = "Unresponsive"; break;
6999     case 9: str = "Identified MS is responsive, but refused position request"; break;
7000     case 10: str = "System Failure"; break;
7001     case 11: str = "MSID is not known"; break;
7002     case 12: str = "Callback number is not known"; break;
7003     case 13: str = "Improper request (e.g. invalid channel information, invalid ESN)"; break;
7004     case 14: str = "Mobile channel information returned"; break;
7005     case 15: str = "Signal not detected"; break;
7006     case 16: str = "PDE Timeout"; break;
7007     case 17: str = "Position pending"; break;
7008     case 18: str = "TDMA MAHO Information Returned"; break;
7009     case 19: str = "TDMA MAHO Information is not available"; break;
7010     default:
7011         if ((value >= 20) && (value <= 223)) { str = "Reserved, treat as Not used"; }
7012         else { str = "Reserved for protocol extension, treat as Not used"; }
7013         break;
7014     }
7015
7016     proto_tree_add_text(tree, asn1->tvb,
7017         saved_offset, asn1->offset - saved_offset,
7018         "Position Result, %s",
7019         str);
7020
7021     EXTRANEOUS_DATA_CHECK(len, 1);
7022 }
7023
7024 static void
7025 param_pos_source(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
7026 {
7027     gint32 value;
7028     guint saved_offset;
7029     const gchar *str = NULL;
7030
7031     saved_offset = asn1->offset;
7032
7033     asn1_int32_value_decode(asn1, 1, &value);
7034
7035     switch (value)
7036     {
7037     case 0: str = "Not used"; break;
7038     case 1: str = "Network Unspecified"; break;
7039     case 2: str = "Network AOA (Angle of Arrival)"; break;
7040     case 3: str = "Network TOA (Time of Arrival)"; break;
7041     case 4: str = "Network TDOA (Time Difference of Arrival)"; break;
7042     case 5: str = "Network RF Fingerprinting"; break;
7043     case 6: str = "Network Cell/Sector"; break;
7044     case 7: str = "Network Cell/Sector with Timing"; break;
7045     case 16: str = "Handset Unspecified"; break;
7046     case 17: str = "Handset GPS"; break;
7047     case 18: str = "Handset AGPS (Assisted GPS)"; break;
7048     case 19: str = "Handset EOTD (Enhanced Observed Time Difference)"; break;
7049     case 20: str = "Handset AFLT (Advanced Forward Link Trilateration)"; break;
7050     case 21: str = "Handset EFLT (Enhanced Forward Link Trilateration)"; break;
7051     default:
7052         if ((value >= 8) && (value <= 15)) { str = "Reserved, treat as Network Unspecified"; }
7053         else if ((value >= 22) && (value <= 31)) { str = "Reserved, treat as Handset Unspecified"; }
7054         else { str = "Reserved for protocol extension, treat as Not used"; }
7055         break;
7056     }
7057
7058     proto_tree_add_text(tree, asn1->tvb,
7059         saved_offset, asn1->offset - saved_offset,
7060         "Position Source, %s",
7061         str);
7062
7063     EXTRANEOUS_DATA_CHECK(len, 1);
7064 }
7065
7066 static void
7067 param_acg_encounter(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
7068 {
7069     gint32 value;
7070     guint saved_offset;
7071     const gchar *str = NULL;
7072
7073     EXACT_DATA_CHECK(len, 1);
7074
7075     saved_offset = asn1->offset;
7076
7077     asn1_int32_value_decode(asn1, 1, &value);
7078
7079     switch ((value & 0xc0) >> 6)
7080     {
7081     case 0: str = "Not used"; break;
7082     case 1: str = "Service Management System Initiated control encountered"; break;
7083     case 2: str = "SCF Overload control encountered"; break;
7084     case 3: str = "Reserved, treat as Not used"; break;
7085     }
7086
7087     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
7088     proto_tree_add_text(tree, asn1->tvb,
7089         saved_offset, asn1->offset - saved_offset,
7090         "%s :  Control Type, %s",
7091         bigbuf,
7092         str);
7093
7094     switch (value & 0x3f)
7095     {
7096     case 0: str = "PC_SSN"; break;
7097     case 1: str = "1-digit control"; break;
7098     case 2: str = "2-digit control"; break;
7099     case 3: str = "3-digit control"; break;
7100     case 4: str = "4-digit control"; break;
7101     case 5: str = "5-digit control"; break;
7102     case 6: str = "6-digit control"; break;
7103     case 7: str = "7-digit control"; break;
7104     case 8: str = "8-digit control"; break;
7105     case 9: str = "9-digit control"; break;
7106     case 10: str = "10-digit control"; break;
7107     case 11: str = "11-digit control"; break;
7108     case 12: str = "12-digit control"; break;
7109     case 13: str = "13-digit control"; break;
7110     case 14: str = "14-digit control"; break;
7111     case 15: str = "15-digit control"; break;
7112     default:
7113         str = "Reserved, treat as 15-digit control";
7114         break;
7115     }
7116
7117     other_decode_bitfield_value(bigbuf, value, 0x3f, 8);
7118     proto_tree_add_text(tree, asn1->tvb,
7119         saved_offset, asn1->offset - saved_offset,
7120         "%s :  %s",
7121         bigbuf,
7122         str);
7123 }
7124
7125 static void
7126 param_ctrl_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
7127 {
7128     gint32 value;
7129     guint saved_offset;
7130     const gchar *str = NULL;
7131
7132     EXACT_DATA_CHECK(len, 1);
7133
7134     saved_offset = asn1->offset;
7135
7136     asn1_int32_value_decode(asn1, 1, &value);
7137
7138     switch ((value & 0xc0) >> 6)
7139     {
7140     case 0: str = "Not used"; break;
7141     case 1: str = "Service Management System Initiated control"; break;
7142     case 2: str = "SCF Overload control"; break;
7143     case 3: str = "Reserved, treat as Not used"; break;
7144     }
7145
7146     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
7147     proto_tree_add_text(tree, asn1->tvb,
7148         saved_offset, asn1->offset - saved_offset,
7149         "%s :  Control Type, %s",
7150         bigbuf,
7151         str);
7152
7153     switch (value & 0x3f)
7154     {
7155     case 0: str = "PC_SSN"; break;
7156     case 1: str = "1-digit control"; break;
7157     case 2: str = "2-digit control"; break;
7158     case 3: str = "3-digit control"; break;
7159     case 4: str = "4-digit control"; break;
7160     case 5: str = "5-digit control"; break;
7161     case 6: str = "6-digit control"; break;
7162     case 7: str = "7-digit control"; break;
7163     case 8: str = "8-digit control"; break;
7164     case 9: str = "9-digit control"; break;
7165     case 10: str = "10-digit control"; break;
7166     case 11: str = "11-digit control"; break;
7167     case 12: str = "12-digit control"; break;
7168     case 13: str = "13-digit control"; break;
7169     case 14: str = "14-digit control"; break;
7170     case 15: str = "15-digit control"; break;
7171     default:
7172         str = "Reserved, treat as 15-digit control";
7173         break;
7174     }
7175
7176     other_decode_bitfield_value(bigbuf, value, 0x3f, 8);
7177     proto_tree_add_text(tree, asn1->tvb,
7178         saved_offset, asn1->offset - saved_offset,
7179         "%s :  %s",
7180         bigbuf,
7181         str);
7182 }
7183
7184 static void
7185 param_gap_duration(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
7186 {
7187     gint32 value;
7188     guint saved_offset;
7189     const gchar *str = NULL;
7190
7191     EXACT_DATA_CHECK(len, 1);
7192
7193     saved_offset = asn1->offset;
7194
7195     asn1_int32_value_decode(asn1, 1, &value);
7196
7197     switch (value)
7198     {
7199     case 0: str = "Not used"; break;
7200     case 1: str = "1 second"; break;
7201     case 2: str = "2 seconds"; break;
7202     case 3: str = "4 seconds"; break;
7203     case 4: str = "8 seconds"; break;
7204     case 5: str = "16 seconds"; break;
7205     case 6: str = "32 seconds"; break;
7206     case 7: str = "64 seconds"; break;
7207     case 8: str = "128 seconds"; break;
7208     case 9: str = "256 seconds"; break;
7209     case 10: str = "512 seconds"; break;
7210     case 11: str = "1024 seconds"; break;
7211     case 12: str = "2048 seconds"; break;
7212     case 13: str = "Infinity"; break;
7213     default:
7214         str = "Reserved, treat as Not used";
7215         break;
7216     }
7217
7218     proto_tree_add_text(tree, asn1->tvb,
7219         saved_offset, asn1->offset - saved_offset,
7220         str);
7221 }
7222
7223 static void
7224 param_scf_overload_gap_int(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
7225 {
7226     gint32 value;
7227     guint saved_offset;
7228     const gchar *str = NULL;
7229
7230     EXACT_DATA_CHECK(len, 1);
7231
7232     saved_offset = asn1->offset;
7233
7234     asn1_int32_value_decode(asn1, 1, &value);
7235
7236     switch (value)
7237     {
7238     case 0: str = "0 seconds"; break;
7239     case 1: str = "3 seconds"; break;
7240     case 2: str = "4 seconds"; break;
7241     case 3: str = "6 seconds"; break;
7242     case 4: str = "8 seconds"; break;
7243     case 5: str = "11 seconds"; break;
7244     case 6: str = "16 seconds"; break;
7245     case 7: str = "22 seconds"; break;
7246     case 8: str = "30 seconds"; break;
7247     case 9: str = "42 seconds"; break;
7248     case 10: str = "58 seconds"; break;
7249     case 11: str = "81 seconds"; break;
7250     case 12: str = "112 seconds"; break;
7251     case 13: str = "156 seconds"; break;
7252     case 14: str = "217 seconds"; break;
7253     case 15: str = "300 seconds"; break;
7254     case 16: str = "Remove gap control"; break;
7255     case 17: str = "0.10 seconds"; break;
7256     case 18: str = "0.25 seconds"; break;
7257     case 19: str = "0.5 seconds"; break;
7258     case 20: str = "1 second"; break;
7259     case 21: str = "2 seconds"; break;
7260     default:
7261         str = "Reserved, treat as 0 seconds";
7262         break;
7263     }
7264
7265     proto_tree_add_text(tree, asn1->tvb,
7266         saved_offset, asn1->offset - saved_offset,
7267         str);
7268 }
7269
7270 static void
7271 param_tdma_time_align(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
7272 {
7273     gint32 value;
7274     guint saved_offset;
7275
7276     saved_offset = asn1->offset;
7277
7278     asn1_int32_value_decode(asn1, 1, &value);
7279
7280     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
7281     proto_tree_add_text(tree, asn1->tvb,
7282         saved_offset, asn1->offset - saved_offset,
7283         "%s :  Reserved",
7284         bigbuf);
7285
7286
7287     other_decode_bitfield_value(bigbuf, value, 0x1f, 8);
7288     proto_tree_add_text(tree, asn1->tvb,
7289         saved_offset, asn1->offset - saved_offset,
7290         "%s :  Time Alignment Offset (TA), %u",
7291         bigbuf,
7292         value & 0x1f);
7293
7294     EXTRANEOUS_DATA_CHECK(len, 1);
7295 }
7296
7297 static void
7298 dump_rssi(ASN1_SCK *asn1, proto_tree *tree, const gchar *leader)
7299 {
7300     gint32 value;
7301     guint saved_offset;
7302     const gchar *str = NULL;
7303
7304     saved_offset = asn1->offset;
7305
7306     asn1_int32_value_decode(asn1, 1, &value);
7307
7308     switch ((value & 0xc0) >> 6)
7309     {
7310     case 0: str = "800 MHz"; break;
7311     case 1: str = "1900 MHz"; break;
7312     default:
7313         str = "Reserved";
7314         break;
7315     }
7316
7317     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
7318     proto_tree_add_text(tree, asn1->tvb,
7319         saved_offset, asn1->offset - saved_offset,
7320         "%s :  %sHyper, %s",
7321         bigbuf,
7322         leader,
7323         str);
7324
7325     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
7326     proto_tree_add_text(tree, asn1->tvb,
7327         saved_offset, asn1->offset - saved_offset,
7328         "%s :  Reserved",
7329         bigbuf);
7330
7331     other_decode_bitfield_value(bigbuf, value, 0x1f, 8);
7332     proto_tree_add_text(tree, asn1->tvb,
7333         saved_offset, asn1->offset - saved_offset,
7334         "%s :  %sRSSI, %u",
7335         bigbuf,
7336         leader,
7337         value & 0x1f);
7338 }
7339
7340 static void
7341 param_tdma_maho_cell_id(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7342 {
7343     gint32 value, num_rssi, num_msc;
7344     guint saved_offset, orig_offset;
7345     gint32 i, j;
7346
7347     SHORT_DATA_CHECK(len, 3);
7348
7349     orig_offset = asn1->offset;
7350
7351     dump_rssi(asn1, tree, "Serving Cell ");
7352
7353     saved_offset = asn1->offset;
7354
7355     asn1_int32_value_decode(asn1, 1, &num_rssi);
7356
7357     proto_tree_add_text(tree, asn1->tvb,
7358         saved_offset, asn1->offset - saved_offset,
7359         "Number of RSSI %u",
7360         num_rssi);
7361
7362     for (i = 0; i < num_rssi; i++)
7363     {
7364         if ((len - (asn1->offset - orig_offset)) < 3)
7365         {
7366             proto_tree_add_text(tree, asn1->tvb,
7367                 asn1->offset, len - (asn1->offset - orig_offset),
7368                 "Short Data (?)");
7369
7370             asn1->offset += len - (asn1->offset - orig_offset);
7371             return;
7372         }
7373
7374         dump_rssi(asn1, tree, "");
7375
7376         saved_offset = asn1->offset;
7377
7378         asn1_int32_value_decode(asn1, 2, &value);
7379
7380         proto_tree_add_text(tree, asn1->tvb,
7381             saved_offset, asn1->offset - saved_offset,
7382             "Measured Cell ID %u",
7383             value);
7384     }
7385
7386     saved_offset = asn1->offset;
7387
7388     asn1_int32_value_decode(asn1, 1, &num_msc);
7389
7390     proto_tree_add_text(tree, asn1->tvb,
7391         saved_offset, asn1->offset - saved_offset,
7392         "Number of MSC %u",
7393         num_msc);
7394
7395     for (i = 0; i < num_msc; i++)
7396     {
7397         if ((len - (asn1->offset - orig_offset)) < 4)
7398         {
7399             proto_tree_add_text(tree, asn1->tvb,
7400                 asn1->offset, len - (asn1->offset - orig_offset),
7401                 "Short Data (?)");
7402
7403             asn1->offset += len - (asn1->offset - orig_offset);
7404             return;
7405         }
7406
7407         param_mscid(asn1, tree, 3, add_string);
7408
7409         saved_offset = asn1->offset;
7410
7411         asn1_int32_value_decode(asn1, 1, &num_rssi);
7412
7413         proto_tree_add_text(tree, asn1->tvb,
7414             saved_offset, asn1->offset - saved_offset,
7415             "Number of RSSI %u",
7416             num_rssi);
7417
7418         for (j = 0; j < num_rssi; j++)
7419         {
7420             if ((len - (asn1->offset - orig_offset)) < 3)
7421             {
7422                 proto_tree_add_text(tree, asn1->tvb,
7423                     asn1->offset, len - (asn1->offset - orig_offset),
7424                     "Short Data (?)");
7425
7426                 asn1->offset += len - (asn1->offset - orig_offset);
7427                 return;
7428             }
7429
7430             dump_rssi(asn1, tree, "");
7431
7432             saved_offset = asn1->offset;
7433
7434             asn1_int32_value_decode(asn1, 2, &value);
7435
7436             proto_tree_add_text(tree, asn1->tvb,
7437                 saved_offset, asn1->offset - saved_offset,
7438                 "Measured Cell ID %u",
7439                 value);
7440         }
7441     }
7442
7443     EXTRANEOUS_DATA_CHECK((len - (asn1->offset - orig_offset)), 0);
7444 }
7445
7446 static void
7447 param_tdma_maho_chan(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7448 {
7449     gint32 value, num_rssi, num_msc;
7450     guint saved_offset, orig_offset;
7451     gint32 i, j;
7452
7453     SHORT_DATA_CHECK(len, 3);
7454
7455     orig_offset = asn1->offset;
7456
7457     dump_rssi(asn1, tree, "Serving Cell ");
7458
7459     saved_offset = asn1->offset;
7460
7461     asn1_int32_value_decode(asn1, 1, &num_rssi);
7462
7463     proto_tree_add_text(tree, asn1->tvb,
7464         saved_offset, asn1->offset - saved_offset,
7465         "Number of RSSI %u",
7466         num_rssi);
7467
7468     for (i = 0; i < num_rssi; i++)
7469     {
7470         if ((len - (asn1->offset - orig_offset)) < 3)
7471         {
7472             proto_tree_add_text(tree, asn1->tvb,
7473                 asn1->offset, len - (asn1->offset - orig_offset),
7474                 "Short Data (?)");
7475
7476             asn1->offset += len - (asn1->offset - orig_offset);
7477             return;
7478         }
7479
7480         dump_rssi(asn1, tree, "");
7481
7482         saved_offset = asn1->offset;
7483
7484         asn1_int32_value_decode(asn1, 2, &value);
7485
7486         other_decode_bitfield_value(bigbuf, value >> 8, 0xff, 8);
7487         proto_tree_add_text(tree, asn1->tvb,
7488             saved_offset, 1,
7489             "%s :  Measured Channel (MSB), %u",
7490             bigbuf,
7491             (value & 0xffe0) >> 5);
7492
7493         other_decode_bitfield_value(bigbuf, value & 0xff, 0xe0, 8);
7494         proto_tree_add_text(tree, asn1->tvb,
7495             saved_offset+1, 1,
7496             "%s :  Measured Channel (LSB)",
7497             bigbuf);
7498     }
7499
7500     saved_offset = asn1->offset;
7501
7502     asn1_int32_value_decode(asn1, 1, &num_msc);
7503
7504     proto_tree_add_text(tree, asn1->tvb,
7505         saved_offset, asn1->offset - saved_offset,
7506         "Number of MSC %u",
7507         num_msc);
7508
7509     for (i = 0; i < num_msc; i++)
7510     {
7511         if ((len - (asn1->offset - orig_offset)) < 4)
7512         {
7513             proto_tree_add_text(tree, asn1->tvb,
7514                 asn1->offset, len - (asn1->offset - orig_offset),
7515                 "Short Data (?)");
7516
7517             asn1->offset += len - (asn1->offset - orig_offset);
7518             return;
7519         }
7520
7521         param_mscid(asn1, tree, 3, add_string);
7522
7523         saved_offset = asn1->offset;
7524
7525         asn1_int32_value_decode(asn1, 1, &num_rssi);
7526
7527         proto_tree_add_text(tree, asn1->tvb,
7528             saved_offset, asn1->offset - saved_offset,
7529             "Number of RSSI %u",
7530             num_rssi);
7531
7532         for (j = 0; j < num_rssi; j++)
7533         {
7534             if ((len - (asn1->offset - orig_offset)) < 3)
7535             {
7536                 proto_tree_add_text(tree, asn1->tvb,
7537                     asn1->offset, len - (asn1->offset - orig_offset),
7538                     "Short Data (?)");
7539
7540                 asn1->offset += len - (asn1->offset - orig_offset);
7541                 return;
7542             }
7543
7544             dump_rssi(asn1, tree, "");
7545
7546             saved_offset = asn1->offset;
7547
7548             asn1_int32_value_decode(asn1, 2, &value);
7549
7550             other_decode_bitfield_value(bigbuf, value >> 8, 0xff, 8);
7551             proto_tree_add_text(tree, asn1->tvb,
7552                 saved_offset, 1,
7553                 "%s :  Measured Channel (MSB), %u",
7554                 bigbuf,
7555                 (value & 0xffe0) >> 5);
7556
7557             other_decode_bitfield_value(bigbuf, value & 0xff, 0xe0, 8);
7558             proto_tree_add_text(tree, asn1->tvb,
7559                 saved_offset+1, 1,
7560                 "%s :  Measured Channel (LSB)",
7561                 bigbuf);
7562         }
7563     }
7564
7565     EXTRANEOUS_DATA_CHECK((len - (asn1->offset - orig_offset)), 0);
7566 }
7567
7568 static void
7569 param_tdma_maho_req(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
7570 {
7571     gint32 value;
7572     guint saved_offset;
7573     const gchar *str = NULL;
7574
7575     EXACT_DATA_CHECK(len, 1);
7576
7577     saved_offset = asn1->offset;
7578
7579     asn1_int32_value_decode(asn1, 1, &value);
7580
7581     switch (value)
7582     {
7583     case 0: str = "No MAHO information requested"; break;
7584     case 1: str = "MAHO information requested"; break;
7585     default:
7586         str = "Reserved, treat as No MAHO information requested";
7587         break;
7588     }
7589
7590     proto_tree_add_text(tree, asn1->tvb,
7591         saved_offset, asn1->offset - saved_offset,
7592         str);
7593 }
7594
7595 static void
7596 param_sm_gap_int(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
7597 {
7598     gint32 value;
7599     guint saved_offset;
7600     const gchar *str = NULL;
7601
7602     EXACT_DATA_CHECK(len, 1);
7603
7604     saved_offset = asn1->offset;
7605
7606     asn1_int32_value_decode(asn1, 1, &value);
7607
7608     switch (value)
7609     {
7610     case 0: str = "Remove gap control"; break;
7611     case 1: str = "0 seconds"; break;
7612     case 2: str = "0.10 seconds"; break;
7613     case 3: str = "0.25 seconds"; break;
7614     case 4: str = "0.50 seconds"; break;
7615     case 5: str = "1 second"; break;
7616     case 6: str = "2 seconds"; break;
7617     case 7: str = "5 seconds"; break;
7618     case 8: str = "10 seconds"; break;
7619     case 9: str = "15 seconds"; break;
7620     case 10: str = "30 seconds"; break;
7621     case 11: str = "60 seconds"; break;
7622     case 12: str = "120 seconds"; break;
7623     case 13: str = "300 seconds"; break;
7624     case 14: str = "600 seconds"; break;
7625     case 15: str = "Stop all queries"; break;
7626     default:
7627         str = "Reserved, treat as Remove gap control";
7628         break;
7629     }
7630
7631     proto_tree_add_text(tree, asn1->tvb,
7632         saved_offset, asn1->offset - saved_offset,
7633         str);
7634 }
7635
7636 static void
7637 param_mob_cap(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
7638 {
7639     gint32 value;
7640     guint saved_offset, i;
7641     const gchar *str = NULL;
7642
7643     for (i=0; i < len; i++)
7644     {
7645         saved_offset = asn1->offset;
7646
7647         asn1_int32_value_decode(asn1, 1, &value);
7648
7649         switch (value)
7650         {
7651         case 0: str = "Undefined Mobile Position Capabilities"; break;
7652         case 1: str = "CDMA None"; break;
7653         case 2: str = "CDMA Pilot Phase + GPS - MS shall be capable of supporting A-FLT and GPS for position determination"; break;
7654         case 3: str = "CDMA Pilot Phase Only - MS shall be capable of supporting A-FLT only for position determination"; break;
7655         case 4: str = "CDMA GPS Only - MS shall be capable of supporting GPS only for position determination"; break;
7656         case 51: str = "TDMA None. See TIA/EIA-136-740"; break;
7657         case 52: str = "TDMA MS-Based with Network Assistance SAMPS Supported. See TIA/EIA-136-740"; break;
7658         case 53: str = "TDMA MS-Assisted SAMPS Supported. See TIA/EIA-136-740"; break;
7659         case 54: str = "TDMA SAMPS Time Measurement Capability Supported. See TIA/EIA-136-740"; break;
7660         case 55: str = "TDMA MS-Based Stand-alone SAMPS Supported. See TIA/EIA-136-740"; break;
7661         case 101: str = "AMPS None"; break;
7662         case 102: str = "AMPS MS-based - MS shall be capable of autonomously determining the position without assistance from the network"; break;
7663         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;
7664         default:
7665             if ((value >= 5) && (value <= 50)) { str = "Reserved for CDMA, treat as CDMA None"; }
7666             else if ((value >= 56) && (value <= 100)) { str = "Reserved for TDMA, treat as TDMA None"; }
7667             else if ((value >= 104) && (value <= 150)) { str = "Reserved for AMPS, treat as AMPS None"; }
7668             else if ((value >= 151) && (value <= 223)) { str = "Reserved, treat as Undefined"; }
7669             else { str = "Reserved for protocol extension, treat as Undefined"; }
7670             break;
7671         }
7672
7673         proto_tree_add_text(tree, asn1->tvb,
7674             saved_offset, asn1->offset - saved_offset,
7675             "Mobile Position Capability, %s",
7676             str);
7677     }
7678 }
7679
7680 static void
7681 param_cdma_psmm_count(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
7682 {
7683     gint32 value;
7684     guint saved_offset;
7685
7686     EXACT_DATA_CHECK(len, 1);
7687
7688     saved_offset = asn1->offset;
7689
7690     asn1_int32_value_decode(asn1, 1, &value);
7691
7692     proto_tree_add_text(tree, asn1->tvb,
7693         saved_offset, asn1->offset - saved_offset,
7694         "Number of CDMA Pilot Strength Measurements to return, %u",
7695         value);
7696 }
7697
7698 static void
7699 param_cdma_sowd2(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
7700 {
7701     gint32 value;
7702     guint saved_offset;
7703     const gchar *str = NULL;
7704
7705     SHORT_DATA_CHECK(len, 5);
7706
7707     saved_offset = asn1->offset;
7708
7709     asn1_int32_value_decode(asn1, 2, &value);
7710
7711     proto_tree_add_text(tree, asn1->tvb,
7712         saved_offset, asn1->offset - saved_offset,
7713         "CDMA Serving One Way Delay, %u",
7714         value);
7715
7716     saved_offset = asn1->offset;
7717
7718     asn1_int32_value_decode(asn1, 1, &value);
7719
7720     other_decode_bitfield_value(bigbuf, value, 0xfc, 8);
7721     proto_tree_add_text(tree, asn1->tvb,
7722         saved_offset, asn1->offset - saved_offset,
7723         "%s :  Reserved",
7724         bigbuf);
7725
7726     switch (value & 0x03)
7727     {
7728     case 0: str = "100 nsec"; break;
7729     case 1: str = "50 nsec"; break;
7730     case 2: str = "1/16 CDMA PN Chip"; break;
7731     case 3: str = "Reserved"; break;
7732     }
7733
7734     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
7735     proto_tree_add_text(tree, asn1->tvb,
7736         saved_offset, asn1->offset - saved_offset,
7737         "%s :  Resolution, %s",
7738         bigbuf,
7739         str);
7740
7741     saved_offset = asn1->offset;
7742
7743     asn1_int32_value_decode(asn1, 2, &value);
7744
7745     proto_tree_add_text(tree, asn1->tvb,
7746         saved_offset, asn1->offset - saved_offset,
7747         "Serving One Way Delay TimeStamp, %u",
7748         value);
7749
7750     EXTRANEOUS_DATA_CHECK(len, 5);
7751 }
7752
7753 static void
7754 param_sms_charge_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
7755 {
7756     gint32 value;
7757     guint saved_offset;
7758     const gchar *str = NULL;
7759
7760     saved_offset = asn1->offset;
7761
7762     asn1_int32_value_decode(asn1, 1, &value);
7763
7764     switch (value)
7765     {
7766     case 0: str = "Not used"; break;
7767     case 1: str = "No charge"; break;
7768     case 2: str = "Charge original originator"; break;
7769     case 3: str = "Charge original destination"; break;
7770     default:
7771         str = "Reserved";
7772         break;
7773     }
7774
7775     proto_tree_add_text(tree, asn1->tvb,
7776         saved_offset, asn1->offset - saved_offset,
7777         "Charge %u, %s",
7778         value,
7779         str);
7780
7781     EXTRANEOUS_DATA_CHECK(len, 1);
7782 }
7783
7784 static void
7785 param_auth_per(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
7786 {
7787     gint32 value;
7788     guint saved_offset;
7789     const gchar *str = NULL;
7790
7791     EXACT_DATA_CHECK(len, 2);
7792
7793     saved_offset = asn1->offset;
7794
7795     asn1_int32_value_decode(asn1, 1, &value);
7796
7797     switch (value)
7798     {
7799     case 0: str = "Not used"; break;
7800     case 1: str = "Per call"; break;
7801     case 2: str = "Hours"; break;
7802     case 3: str = "Days"; break;
7803     case 4: str = "Weeks"; break;
7804     case 5: str = "Per agreement"; break;
7805     case 6: str = "Indefinite"; break;
7806     case 7: str = "Number of calls"; break;
7807     default:
7808         if ((value >= 8) && (value <= 223)) { str = "Reserved, treat as Per call"; }
7809         else { str = "Reserved for protocol extension, treat as Per call"; }
7810         break;
7811     }
7812
7813     proto_tree_add_text(tree, asn1->tvb,
7814         saved_offset, asn1->offset - saved_offset,
7815         "Period (%u) %s",
7816         value,
7817         str);
7818
7819     saved_offset = asn1->offset;
7820
7821     asn1_int32_value_decode(asn1, 1, &value);
7822
7823     proto_tree_add_text(tree, asn1->tvb,
7824         saved_offset, asn1->offset - saved_offset,
7825         "Value %u",
7826         value);
7827 }
7828
7829 static void
7830 param_ctrl_chan_mode(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
7831 {
7832     gint32 value;
7833     guint saved_offset;
7834     const gchar *str = NULL;
7835
7836     saved_offset = asn1->offset;
7837
7838     asn1_int32_value_decode(asn1, 1, &value);
7839
7840     switch (value)
7841     {
7842     case 0: str = "Unknown"; break;
7843     case 1: str = "MS is in Analog CC Mode"; break;
7844     case 2: str = "MS is in Digital CC Mode"; break;
7845     case 3: str = "MS is in NAMPS CC Mode"; break;
7846     default:
7847         if ((value >= 4) && (value <= 223)) { str = "Reserved, treat as Unknown"; }
7848         else { str = "Reserved for protocol extension, treat as Unknown"; }
7849         break;
7850     }
7851
7852     proto_tree_add_text(tree, asn1->tvb,
7853         saved_offset, asn1->offset - saved_offset,
7854         str);
7855
7856     EXTRANEOUS_DATA_CHECK(len, 1);
7857 }
7858
7859 static void
7860 param_tdma_data_mode(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
7861 {
7862     gint32 value;
7863     guint saved_offset;
7864     const gchar *str = NULL;
7865
7866     SHORT_DATA_CHECK(len, 2);
7867
7868     saved_offset = asn1->offset;
7869
7870     asn1_int32_value_decode(asn1, 1, &value);
7871
7872     switch ((value & 0xe0) >> 5)
7873     {
7874     case 0: str = "As per IS-135"; break;
7875     case 1: str = "As per FSVS - 211 (STU-III)"; break;
7876     default:
7877         str = "Reserved";
7878         break;
7879     }
7880
7881     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
7882     proto_tree_add_text(tree, asn1->tvb,
7883         saved_offset, asn1->offset - saved_offset,
7884         "%s :  Data Part, %s",
7885         bigbuf,
7886         str);
7887
7888     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
7889     proto_tree_add_text(tree, asn1->tvb,
7890         saved_offset, asn1->offset - saved_offset,
7891         "%s :  AD, %s",
7892         bigbuf,
7893         (value & 0x10) ? "unacknowledged data only" : "unacked data or both");
7894
7895     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
7896     proto_tree_add_text(tree, asn1->tvb,
7897         saved_offset, asn1->offset - saved_offset,
7898         "%s :  %s",
7899         bigbuf,
7900         (value & 0x08) ? "SAP 0 and 1" : "SAP 0 only");
7901
7902     switch (value & 0x07)
7903     {
7904     case 0: str = "No Data Privacy"; break;
7905     case 1: str = "Data Privacy Algorithm A"; break;
7906     default:
7907         str = "Reserved, treat as No Data Privacy";
7908         break;
7909     }
7910
7911     other_decode_bitfield_value(bigbuf, value, 0x07, 8);
7912     proto_tree_add_text(tree, asn1->tvb,
7913         saved_offset, asn1->offset - saved_offset,
7914         "%s :  Data Privacy Mode, %s",
7915         bigbuf,
7916         str);
7917
7918     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
7919     proto_tree_add_text(tree, asn1->tvb,
7920         saved_offset, asn1->offset - saved_offset,
7921         "%s :  Reserved",
7922         bigbuf);
7923
7924     switch ((value & 0x0c) >> 2)
7925     {
7926     case 0: str = "RLP1"; break;
7927     case 1: str = "RLP2"; break;
7928     default:
7929         str = "Reserved";
7930         break;
7931     }
7932
7933     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
7934     proto_tree_add_text(tree, asn1->tvb,
7935         saved_offset, asn1->offset - saved_offset,
7936         "%s :  %s",
7937         bigbuf,
7938         str);
7939
7940     switch (value & 0x03)
7941     {
7942     case 0: str = "16-bit Cyclic Redundancy Check"; break;
7943     case 1: str = "24-bit Cyclic Redundancy Check"; break;
7944     case 2: str = "No Cyclic Redundancy Check"; break;
7945     default:
7946         str = "Reserved";
7947         break;
7948     }
7949
7950     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
7951     proto_tree_add_text(tree, asn1->tvb,
7952         saved_offset, asn1->offset - saved_offset,
7953         "%s :  %s",
7954         bigbuf,
7955         str);
7956
7957     EXTRANEOUS_DATA_CHECK(len, 2);
7958 }
7959
7960 static void
7961 param_tdma_voice_mode(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
7962 {
7963     gint32 value;
7964     guint saved_offset;
7965     const gchar *str = NULL;
7966
7967     saved_offset = asn1->offset;
7968
7969     asn1_int32_value_decode(asn1, 1, &value);
7970
7971     switch ((value & 0xf0) >> 4)
7972     {
7973     case 0: str = "No Voice Privacy"; break;
7974     case 1: str = "Voice Privacy Algorithm A"; break;
7975     case 2: str = "Reserved, treat as No Voice Privacy"; break;
7976     case 3: str = "Reserved, treat as No Voice Privacy"; break;
7977     case 4: str = "Reserved for SOC/BMSC Specific signaling"; break;
7978     default:
7979         str = "Reserved, treat as No Voice Privacy";
7980         break;
7981     }
7982
7983     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
7984     proto_tree_add_text(tree, asn1->tvb,
7985         saved_offset, asn1->offset - saved_offset,
7986         "%s :  Voice Privacy Mode, %s",
7987         bigbuf,
7988         str);
7989
7990     switch (value & 0x0f)
7991     {
7992     case 0: str = "No Voice Coder"; break;
7993     case 1: str = "VSELP Voice Coder"; break;
7994     case 2: str = "IS-641 Voice Coder"; break;
7995     case 6: str = "Reserved for SOC/BMSC Specific signaling"; break;
7996     default:
7997         str = "Reserved, treat as No Voice Coder";
7998         break;
7999     }
8000
8001     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
8002     proto_tree_add_text(tree, asn1->tvb,
8003         saved_offset, asn1->offset - saved_offset,
8004         "%s :  Voice Coder, %s",
8005         bigbuf,
8006         str);
8007
8008     EXTRANEOUS_DATA_CHECK(len, 1);
8009 }
8010
8011 static void
8012 param_tdma_bandwidth(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
8013 {
8014     gint32 value;
8015     guint saved_offset;
8016     const gchar *str = NULL;
8017
8018     saved_offset = asn1->offset;
8019
8020     asn1_int32_value_decode(asn1, 1, &value);
8021
8022     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
8023     proto_tree_add_text(tree, asn1->tvb,
8024         saved_offset, asn1->offset - saved_offset,
8025         "%s :  Reserved",
8026         bigbuf);
8027
8028     switch (value & 0x0f)
8029     {
8030     case 0: str = "Half-Rate Digital Traffic Channel Only"; break;
8031     case 1: str = "Full-Rate Digital Traffic Channel Only"; break;
8032     case 2: str = "Half-Rate or Full-rate Digital Traffic Channel - Full-Rate Preferred"; break;
8033     case 3: str = "Half-rate or Full-rate Digital Traffic Channel - Half-rate Preferred"; break;
8034     case 4: str = "Double Full-Rate Digital Traffic Channel Only"; break;
8035     case 5: str = "Triple Full-Rate Digital Traffic Channel Only"; break;
8036     default:
8037         str = "Reserved, treat as Full-Rate Digital Traffic Channel Only";
8038         break;
8039     }
8040
8041     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
8042     proto_tree_add_text(tree, asn1->tvb,
8043         saved_offset, asn1->offset - saved_offset,
8044         "%s :  Bandwidth, %s",
8045         bigbuf,
8046         str);
8047
8048     EXTRANEOUS_DATA_CHECK(len, 1);
8049 }
8050
8051 static void
8052 param_change_srvc_attr(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
8053 {
8054     gint32 value;
8055     guint saved_offset;
8056     const gchar *str = NULL;
8057
8058     saved_offset = asn1->offset;
8059
8060     asn1_int32_value_decode(asn1, 1, &value);
8061
8062     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
8063     proto_tree_add_text(tree, asn1->tvb,
8064         saved_offset, asn1->offset - saved_offset,
8065         "%s :  Reserved",
8066         bigbuf);
8067
8068     switch ((value & 0x0c) >> 2)
8069     {
8070     case 0: str = "Service Negotiation Used"; break;
8071     case 1: str = "Service Negotiation Not Used"; break;
8072     case 2: str = "Service Negotiation Required"; break;
8073     case 3: str = "Service Negotiation Not Required"; break;
8074     }
8075
8076     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
8077     proto_tree_add_text(tree, asn1->tvb,
8078         saved_offset, asn1->offset - saved_offset,
8079         "%s :  Service Negotiate Flag (SRVNEG), %s",
8080         bigbuf,
8081         str);
8082
8083     switch (value & 0x03)
8084     {
8085     case 0 : str = "Change Facilities Operation Requested"; break;
8086     case 1 : str = "Change Facilities Operation Not Requested"; break;
8087     case 2 : str = "Change Facilities Operation Used"; break;
8088     case 3 : str = "Change Facilities Operation Not Used"; break;
8089     }
8090
8091     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
8092     proto_tree_add_text(tree, asn1->tvb,
8093         saved_offset, asn1->offset - saved_offset,
8094         "%s :  Change Facilities Flag (CHGFAC), %s",
8095         bigbuf,
8096         str);
8097
8098     EXTRANEOUS_DATA_CHECK(len, 1);
8099 }
8100
8101 static void
8102 param_dp_params(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
8103 {
8104     gint32 value;
8105     guint saved_offset;
8106     const gchar *str = NULL;
8107
8108     SHORT_DATA_CHECK(len, 4);
8109
8110     saved_offset = asn1->offset;
8111
8112     asn1_int32_value_decode(asn1, 1, &value);
8113
8114     other_decode_bitfield_value(bigbuf, value, 0xfc, 8);
8115     proto_tree_add_text(tree, asn1->tvb,
8116         saved_offset, asn1->offset - saved_offset,
8117         "%s :  Reserved",
8118         bigbuf);
8119
8120     switch (value & 0x03)
8121     {
8122     case 0: str = "Privacy inactive or not supported"; break;
8123     case 1: str = "Privacy Requested or Acknowledged"; break;
8124     default:
8125         str = "Reserved, treat as Privacy inactive or not supported";
8126         break;
8127     }
8128
8129     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
8130     proto_tree_add_text(tree, asn1->tvb,
8131         saved_offset, asn1->offset - saved_offset,
8132         "%s :  Privacy Mode, %s",
8133         bigbuf,
8134         str);
8135
8136     saved_offset = asn1->offset;
8137
8138     asn1_int32_value_decode(asn1, 1, &value);
8139
8140     switch (value)
8141     {
8142     case 0: str = "Not used"; break;
8143     case 1: str = "Data Privacy Version 1"; break;
8144     default:
8145         if ((value >= 2) && (value <= 223)) { str = "Reserved, treat as Not used"; }
8146         else { str = "Reserved for protocol extension, treat as Not used"; }
8147         break;
8148     }
8149
8150     proto_tree_add_text(tree, asn1->tvb,
8151         saved_offset, asn1->offset - saved_offset,
8152         "Data Privacy Version, %s",
8153         str);
8154
8155     saved_offset = asn1->offset;
8156
8157     proto_tree_add_text(tree, asn1->tvb,
8158         saved_offset, len - 2,
8159         "Data Privacy data");
8160
8161     asn1->offset += (len - 2);
8162 }
8163
8164 static void
8165 param_trn(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
8166 {
8167     guint saved_offset;
8168     guchar *poctets;
8169
8170     saved_offset = asn1->offset;
8171
8172     asn1_string_value_decode(asn1, len, &poctets);
8173
8174     my_dgt_tbcd_unpack(bigbuf, poctets, len, &Dgt_msid);
8175     g_free(poctets);
8176
8177     proto_tree_add_text(tree, asn1->tvb,
8178         saved_offset, len, "TRN %s", bigbuf);
8179 }
8180
8181 static void
8182 param_islp_info(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
8183 {
8184     gint32 value;
8185     guint saved_offset;
8186     const gchar *str = NULL;
8187
8188     saved_offset = asn1->offset;
8189
8190     asn1_int32_value_decode(asn1, 1, &value);
8191
8192     switch (value)
8193     {
8194     case 0: str = "No ISLP supported"; break;
8195     case 1: str = "ISLP supported (see ISLP)"; break;
8196     default:
8197         if ((value >= 2) && (value <= 112)) { str = "Reserved, treat as No ISLP supported"; }
8198         else if ((value >= 113) && (value <= 223)) { str = "Reserved, treat as ISLP supported"; }
8199         else if ((value >= 224) && (value <= 240)) { str = "Reserved for protocol extension, treat as No ISLP supported"; }
8200         else { str = "Reserved for protocol extension, treat as ISLP supported"; }
8201         break;
8202     }
8203
8204     proto_tree_add_text(tree, asn1->tvb,
8205         saved_offset, asn1->offset - saved_offset,
8206         str);
8207
8208     EXTRANEOUS_DATA_CHECK(len, 1);
8209 }
8210
8211 static void
8212 param_ana_red_info(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
8213 {
8214     gint32 value;
8215     guint saved_offset;
8216     const gchar *str = NULL;
8217
8218     saved_offset = asn1->offset;
8219
8220     asn1_int32_value_decode(asn1, 1, &value);
8221
8222     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
8223     proto_tree_add_text(tree, asn1->tvb,
8224         saved_offset, asn1->offset - saved_offset,
8225         "%s :  Reserved",
8226         bigbuf);
8227
8228     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
8229     proto_tree_add_text(tree, asn1->tvb,
8230         saved_offset, asn1->offset - saved_offset,
8231         "%s :  Ignore CDMA, %s",
8232         bigbuf,
8233         (value & 0x20) ?  "Ignore the CDMA Capability Message on the analog system to which it is being redirected" :
8234             "Don't ignore the CDMA Capability Message on the analog system to which it is being redirected");
8235
8236     switch (value & 0x1f)
8237     {
8238     case 0: str = "Attempt to obtain service on either System A or B in accordance with the custom system selection process"; break;
8239     case 1: str = "Attempt to obtain service on System A only"; break;
8240     case 2: str = "Error in IS-735, text was unspecified but not reserved"; break;
8241     case 3: str = "Attempt to obtain service on System A first.  If unsuccessful, attempt to obtain service on System B"; break;
8242     case 4: str = "Attempt to obtain service on System B first.  If unsuccessful, attempt to obtain service on System A"; break;
8243     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;
8244
8245     default:
8246         str = "Reserved for protocol extension";
8247         break;
8248     }
8249
8250     other_decode_bitfield_value(bigbuf, value, 0x1f, 8);
8251     proto_tree_add_text(tree, asn1->tvb,
8252         saved_offset, asn1->offset - saved_offset,
8253         "%s :  Sys Ordering, %s",
8254         bigbuf,
8255         str);
8256
8257     EXTRANEOUS_DATA_CHECK(len, 1);
8258 }
8259
8260 static void
8261 param_reason_list(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
8262 {
8263     gint32 value;
8264     gint i;
8265     guint saved_offset;
8266     const gchar *str = NULL;
8267
8268     saved_offset = asn1->offset;
8269
8270     i = 0;
8271
8272     do
8273     {
8274         asn1_int32_value_decode(asn1, 1, &value);
8275
8276         switch (value)
8277         {
8278         case 0: str = "Unknown"; break;
8279         case 1: str = "Unable to configure ISLP"; break;
8280         case 2: str = "ISLP failure"; break;
8281         case 3: str = "Service allowed but facilities not available"; break;
8282         case 4: str = "Service not allowed"; break;
8283         case 5: str = "No Response to TMSI assignment"; break;
8284         case 6: str = "Required parameters unavailable. (e.g., as indicated by the RequiredParametersMask parameter)"; break;
8285         default:
8286             if ((value >= 7) && (value <= 110)) { str = "Reserved for common CDMA and TDMA network error causes. If unknown, treat as Unknown"; }
8287             else if ((value >= 111) && (value <= 127)) { str = "Reserved for common CDMA and TDMA network error causes for protocol extension. If unknown, treat as Unknown"; }
8288             else if ((value >= 128) && (value <= 174)) { str = "CDMA Specific error causes. If unknown, treat as Unknown"; }
8289             else if ((value >= 175) && (value <= 191)) { str = "CDMA Specific error causes for protocol extension. If unknown treat as Unknown"; }
8290             else if ((value >= 192) && (value <= 237)) { str = "TDMA Specific error causes as defined by the TDMACause parameter. If unknown treat as Unknown"; }
8291             else { str = "TDMA Specific error causes for protocol extension. If unknown, treat as Unknown"; }
8292             break;
8293         }
8294
8295         proto_tree_add_text(tree, asn1->tvb,
8296             saved_offset, asn1->offset - saved_offset,
8297             "[%u] %s",
8298             i++,
8299             str);
8300
8301         saved_offset = asn1->offset;
8302     }
8303     while ((len - i) > 0);
8304 }
8305
8306 static void
8307 param_imsi(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
8308 {
8309     guint saved_offset;
8310     guchar *poctets;
8311
8312     saved_offset = asn1->offset;
8313     asn1_string_value_decode(asn1, len, &poctets);
8314
8315     my_dgt_tbcd_unpack(bigbuf, poctets, len, &Dgt_msid);
8316     g_free(poctets);
8317
8318     proto_tree_add_text(tree, asn1->tvb,
8319         saved_offset, len,
8320         "IMSI %s",
8321         bigbuf);
8322
8323     sprintf(add_string, " - %s", bigbuf);
8324 }
8325
8326 static void
8327 param_min_basic(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string, gboolean true_min)
8328 {
8329     guint saved_offset;
8330     guchar *poctets;
8331
8332     EXACT_DATA_CHECK(len, 5);
8333
8334     saved_offset = asn1->offset;
8335     asn1_string_value_decode(asn1, len, &poctets);
8336
8337     my_dgt_tbcd_unpack(bigbuf, poctets, len, &Dgt_msid);
8338     g_free(poctets);
8339
8340     if (true_min)
8341     {
8342         proto_tree_add_string_format(tree, hf_ansi_map_min, asn1->tvb,
8343             saved_offset, len,
8344             bigbuf,
8345             "MIN %s",
8346             bigbuf);
8347     }
8348     else
8349     {
8350     proto_tree_add_text(tree, asn1->tvb,
8351                 saved_offset, len,
8352                 "MIN %s",
8353                 bigbuf);
8354         }
8355
8356     sprintf(add_string, " - %s", bigbuf);
8357 }
8358
8359 static void
8360 param_ms_min(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8361 {
8362     param_min_basic(asn1, tree, len, add_string, FALSE);
8363 }
8364
8365 static void
8366 param_new_min(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8367 {
8368     param_min_basic(asn1, tree, len, add_string, FALSE);
8369 }
8370
8371 static void
8372 param_min(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8373 {
8374     param_min_basic(asn1, tree, len, add_string, TRUE);
8375 }
8376
8377 static void
8378 param_auth_cap(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
8379 {
8380     gint32 value;
8381     guint saved_offset;
8382     const gchar *str = NULL;
8383
8384     EXACT_DATA_CHECK(len, 1);
8385
8386     saved_offset = asn1->offset;
8387
8388     asn1_int32_value_decode(asn1, 1, &value);
8389
8390     switch (value)
8391     {
8392     case 0: str = "Not used"; break;
8393     case 1: str = "No authentication required"; break;
8394     case 2: str = "Authentication required"; break;
8395     case 128: str = "Authentication required and UIM capable"; break;
8396     default:
8397         if ((value >= 3) && (value <= 95)) { str = "Reserved, treat as No authentication required"; }
8398         else if ((value >= 96) && (value <= 127)) { str = "Reserved for protocol extension, treat as No authentication required"; }
8399         else if ((value >= 129) && (value <= 223)) { str = "Reserved, treat as Authentication required"; }
8400         else { str = "Reserved for protocol extension, treat as Authentication required"; }
8401         break;
8402     }
8403
8404     proto_tree_add_text(tree, asn1->tvb,
8405         saved_offset, asn1->offset - saved_offset,
8406         str);
8407 }
8408
8409 static void
8410 param_sus_acc(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
8411 {
8412     gint32 value;
8413     guint saved_offset;
8414     const gchar *str = NULL;
8415
8416     EXACT_DATA_CHECK(len, 1);
8417
8418     saved_offset = asn1->offset;
8419
8420     asn1_int32_value_decode(asn1, 1, &value);
8421
8422     switch (value)
8423     {
8424     case 0: str = "Not used"; break;
8425     case 1: str = "Anomalous digits"; break;
8426     case 2: str = "Unspecified"; break;
8427     default:
8428         if ((value >= 3) && (value <= 113)) { str = "Reserved, treat as Anomalous digits"; }
8429         else if ((value >= 114) && (value <= 223)) { str = "Reserved, treat as Unspecified"; }
8430         else { str = "Reserved for protocol extension, treat as Unspecified"; }
8431         break;
8432     }
8433
8434     proto_tree_add_text(tree, asn1->tvb,
8435         saved_offset, asn1->offset - saved_offset,
8436         "Reason, %s",
8437         str);
8438 }
8439
8440 static void
8441 param_dis_text(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
8442 {
8443     gint32 value;
8444     guint saved_offset;
8445
8446     SHORT_DATA_CHECK(len, 3);
8447
8448     saved_offset = asn1->offset;
8449
8450     asn1_int32_value_decode(asn1, 1, &value);
8451
8452     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
8453     proto_tree_add_text(tree, asn1->tvb,
8454         saved_offset, asn1->offset - saved_offset,
8455         "%s :  Spec. has hardcoded 1",
8456         bigbuf);
8457
8458     other_decode_bitfield_value(bigbuf, value, 0x7f, 8);
8459     proto_tree_add_text(tree, asn1->tvb,
8460         saved_offset, asn1->offset - saved_offset,
8461         "%s :  Display type, see ANSI T1.610 for encoding",
8462         bigbuf);
8463
8464     saved_offset = asn1->offset;
8465
8466     proto_tree_add_text(tree, asn1->tvb,
8467         saved_offset, len - 1,
8468         "Display data");
8469
8470     asn1->offset += len - 1;
8471 }
8472
8473 static void
8474 param_dis_text2(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
8475 {
8476     gint32 value;
8477     guint orig_offset, saved_offset;
8478     const gchar *str = NULL;
8479
8480     SHORT_DATA_CHECK(len, 4);
8481
8482     orig_offset = asn1->offset;
8483     saved_offset = asn1->offset;
8484
8485     do
8486     {
8487         asn1_int32_value_decode(asn1, 1, &value);
8488
8489         switch (value)
8490         {
8491         case 0: str = "Not used"; break;
8492         case 1: str = "ASCII"; break;
8493         case 2: str = "ITU T.50. The International Reference Alphabet as defined in ITU-R Rec. T.50"; break;
8494         case 3: str = "User Specific"; break;
8495         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;
8496         case 5: str = "ISO 10646. The Universal Multiple-Octet Coded Character Set (USC) as defined in ISO/IEC Standard 10646"; break;
8497         case 6: str = "ISO 8859-8. The 8-bit single-byte coded character set Hebrew as defined in ISO/IEC Standard 8859-8"; break;
8498         case 7: str = "IS-91 Extended Protocol Message. The length is determined by the Message Type; see TIA/EIA/IS-90"; break;
8499         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;
8500         case 9: str = "KC C 5601. Variable 1-2 byte Korean encoding method"; break;
8501         default:
8502             if ((value >= 10) && (value <= 223)) { str = "Reserved, treat as ASCII"; }
8503             else { str = "Reserved, treat as ASCII"; }
8504             break;
8505         }
8506
8507         proto_tree_add_text(tree, asn1->tvb,
8508             saved_offset, asn1->offset - saved_offset,
8509             "Display Character Set, %s",
8510             str);
8511
8512         saved_offset = asn1->offset;
8513
8514         asn1_int32_value_decode(asn1, 1, &value);
8515
8516         proto_tree_add_text(tree, asn1->tvb,
8517             saved_offset, asn1->offset - saved_offset,
8518             "Display Type, %u, see ANSI T1.610",
8519             value);
8520
8521         saved_offset = asn1->offset;
8522
8523         asn1_int32_value_decode(asn1, 1, &value);
8524
8525         proto_tree_add_text(tree, asn1->tvb,
8526             saved_offset, asn1->offset - saved_offset,
8527             "Display Tag, %u",
8528             value);
8529
8530         saved_offset = asn1->offset;
8531
8532         asn1_int32_value_decode(asn1, 1, &value);
8533
8534         proto_tree_add_text(tree, asn1->tvb,
8535             saved_offset, asn1->offset - saved_offset,
8536             "Display Length, %u",
8537             value);
8538
8539         saved_offset = asn1->offset;
8540
8541         if (value > 0)
8542         {
8543             if ((guint32) value > (len - (saved_offset - orig_offset)))
8544             {
8545                 proto_tree_add_text(tree, asn1->tvb,
8546                     saved_offset, len - (saved_offset - orig_offset),
8547                     "Short Data (?)");
8548
8549                 asn1->offset += len - (saved_offset - orig_offset);
8550                 return;
8551             }
8552
8553             proto_tree_add_text(tree, asn1->tvb,
8554                 saved_offset, value,
8555                 "Display data");
8556
8557             asn1->offset += value;
8558
8559             saved_offset = asn1->offset;
8560         }
8561     }
8562     while ((len - (saved_offset - orig_offset)) >= 4);
8563
8564     EXTRANEOUS_DATA_CHECK((len - (saved_offset - orig_offset)), 0);
8565 }
8566
8567 static void
8568 param_dmh_srvc_id(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
8569 {
8570     gint32 value;
8571     guint orig_offset, saved_offset;
8572
8573     SHORT_DATA_CHECK(len, 5);
8574
8575     orig_offset = asn1->offset;
8576     saved_offset = asn1->offset;
8577
8578     do
8579     {
8580         asn1_int32_value_decode(asn1, 2, &value);
8581
8582         proto_tree_add_text(tree, asn1->tvb,
8583             saved_offset, asn1->offset - saved_offset,
8584             "Market ID %u",
8585             value);
8586
8587         saved_offset = asn1->offset;
8588
8589         asn1_int32_value_decode(asn1, 1, &value);
8590
8591         proto_tree_add_text(tree, asn1->tvb,
8592             saved_offset, asn1->offset - saved_offset,
8593             "Market Segment ID %u",
8594             value);
8595
8596         saved_offset = asn1->offset;
8597
8598         asn1_int32_value_decode(asn1, 2, &value);
8599
8600         proto_tree_add_text(tree, asn1->tvb,
8601             saved_offset, asn1->offset - saved_offset,
8602             "DMH Service ID Value %u",
8603             value);
8604
8605         saved_offset = asn1->offset;
8606     }
8607     while ((len - (saved_offset - orig_offset)) >= 5);
8608
8609     EXTRANEOUS_DATA_CHECK((len - (saved_offset - orig_offset)), 0);
8610 }
8611
8612 static void
8613 param_feat_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
8614 {
8615     gint32 value;
8616     guint orig_offset, saved_offset;
8617
8618     SHORT_DATA_CHECK(len, 5);
8619
8620     orig_offset = asn1->offset;
8621     saved_offset = asn1->offset;
8622
8623     do
8624     {
8625         asn1_int32_value_decode(asn1, 2, &value);
8626
8627         proto_tree_add_text(tree, asn1->tvb,
8628             saved_offset, asn1->offset - saved_offset,
8629             "Market ID %u",
8630             value);
8631
8632         saved_offset = asn1->offset;
8633
8634         asn1_int32_value_decode(asn1, 1, &value);
8635
8636         proto_tree_add_text(tree, asn1->tvb,
8637             saved_offset, asn1->offset - saved_offset,
8638             "Market Segment ID %u",
8639             value);
8640
8641         saved_offset = asn1->offset;
8642
8643         asn1_int32_value_decode(asn1, 2, &value);
8644
8645         proto_tree_add_text(tree, asn1->tvb,
8646             saved_offset, asn1->offset - saved_offset,
8647             "DMH Service ID Value %u",
8648             value);
8649
8650         saved_offset = asn1->offset;
8651     }
8652     while ((len - (saved_offset - orig_offset)) >= 5);
8653
8654     EXTRANEOUS_DATA_CHECK((len - (saved_offset - orig_offset)), 0);
8655 }
8656
8657 static void
8658 param_a_key_ver(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
8659 {
8660     gint32 value;
8661     gint i;
8662     guint saved_offset;
8663     const gchar *str = NULL;
8664
8665     saved_offset = asn1->offset;
8666
8667     i = 0;
8668
8669     do
8670     {
8671         asn1_int32_value_decode(asn1, 1, &value);
8672
8673         switch (value)
8674         {
8675         case 0: str = "Not used"; break;
8676         case 1: str = "A-key Generation not supported"; break;
8677         case 2: str = "Diffie Hellman with 768-bit modulus, 160-bit primitive, and 160-bit exponents"; break;
8678         case 3: str = "Diffie Hellman with 512-bit modulus, 160-bit primitive, and 160-bit exponents"; break;
8679         case 4: str = "Diffie Hellman with 768-bit modulus, 32-bit primitive, and 160-bit exponents"; break;
8680         default:
8681             if ((value >= 5) && (value <= 223)) { str = "Reserved, treat as A-key Generation not supported"; }
8682             else { str = "Reserved for protocol extension, treat as A-key Generation not supported"; }
8683             break;
8684         }
8685
8686         proto_tree_add_text(tree, asn1->tvb,
8687             saved_offset, asn1->offset - saved_offset,
8688             "[%u] %s",
8689             i++,
8690             str);
8691
8692         saved_offset = asn1->offset;
8693     }
8694     while ((len - i) > 0);
8695 }
8696
8697 static void
8698 param_inter_msg_time(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
8699 {
8700     gint32 value;
8701     guint saved_offset;
8702
8703     EXACT_DATA_CHECK(len, 1);
8704
8705     saved_offset = asn1->offset;
8706
8707     asn1_int32_value_decode(asn1, 1, &value);
8708
8709     proto_tree_add_text(tree, asn1->tvb,
8710         saved_offset, asn1->offset - saved_offset,
8711         "Timer Value, %u, %u seconds",
8712         value,
8713         value * 10);
8714
8715         /* XXX * 10 or / 10 ? */
8716 }
8717
8718 static void
8719 param_rel_cause(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
8720 {
8721     gint32 value;
8722     guint saved_offset;
8723     const gchar *str = NULL;
8724
8725     EXACT_DATA_CHECK(len, 1);
8726
8727     saved_offset = asn1->offset;
8728
8729     asn1_int32_value_decode(asn1, 1, &value);
8730
8731     switch (value)
8732     {
8733     case 0: str = "Unspecified"; break;
8734     case 1: str = "Calling Party"; break;
8735     case 2: str = "Called Party"; break;
8736     case 3: str = "Commanded Disconnect"; break;
8737     default:
8738         if ((value >= 4) && (value <= 23)) { str = "Reserved, treat as Calling Party"; }
8739         else if ((value >= 24) && (value <= 31)) { str = "Reserved for protocol extension. If unknown, treat as Calling Party"; }
8740         else if ((value >= 32) && (value <= 55)) { str = "Reserved, treat as Called Party"; }
8741         else if ((value >= 56) && (value <= 63)) { str = "Reserved for protocol extension. If unknown, treat as Called Party"; }
8742         else if ((value >= 64) && (value <= 87)) { str = "Reserved, treat as Commanded Disconnect"; }
8743         else if ((value >= 88) && (value <= 95)) { str = "Reserved for protocol extension. If unknown, treat as Commanded Disconnect"; }
8744         else if ((value >= 96) && (value <= 223)) { str = "Reserved, treat as Unspecified"; }
8745         else { str = "Reserved for protocol extension. If unknown, treat as Unspecified"; }
8746         break;
8747     }
8748
8749     proto_tree_add_text(tree, asn1->tvb,
8750         saved_offset, asn1->offset - saved_offset,
8751         str);
8752 }
8753
8754 static void
8755 param_time_day(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
8756 {
8757     gint32 value;
8758     gint32 h, m, s, ts;
8759     guint saved_offset;
8760
8761     EXACT_DATA_CHECK(len, 3);
8762
8763     saved_offset = asn1->offset;
8764
8765     asn1_int32_value_decode(asn1, 3, &value);
8766
8767     h = value / (3600 * 10);
8768     m = (value - (h * (3600 * 10))) / (60 * 10);
8769     s = (value - (h * (3600 * 10)) - (m * (60 * 10))) / 10;
8770     ts = (value - (h * (3600 * 10)) - (m * (60 * 10)) - (s * 10));
8771
8772     proto_tree_add_text(tree, asn1->tvb,
8773         saved_offset, asn1->offset - saved_offset,
8774         "(UTC) (in tenths of seconds - 1), %u (%u:%u:%u.%u)",
8775         value,
8776         h,
8777         m,
8778         s,
8779         ts);
8780 }
8781
8782 static void
8783 param_call_status(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
8784 {
8785     gint32 value;
8786     guint saved_offset;
8787     const gchar *str = NULL;
8788
8789     if (len > 4)
8790     {
8791         proto_tree_add_text(tree, asn1->tvb,
8792             asn1->offset, len, "Long Data (?)");
8793         asn1->offset += len;
8794         return;
8795     }
8796
8797     saved_offset = asn1->offset;
8798
8799     asn1->offset = saved_offset;
8800
8801     asn1_int32_value_decode(asn1, len, &value);
8802
8803     switch (value)
8804     {
8805     case 0: str = "Not used"; break;
8806     case 1: str = "Call Setup in Progress"; break;
8807     case 2: str = "Locally Allowed Call - No Action"; break;
8808     default:
8809         if (value < 0) { str = "Reserved for bilateral agreements. If unknown, treat as Not used"; }
8810         else { str = "Reserved, treat as Not used"; }
8811         break;
8812     }
8813
8814     proto_tree_add_text(tree, asn1->tvb,
8815         saved_offset, len,
8816         str);
8817 }
8818
8819 static void
8820 param_ms_status(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
8821 {
8822     gint32 value;
8823     guint saved_offset;
8824     const gchar *str = NULL;
8825     gboolean has_chan;
8826     gboolean extended;
8827
8828     saved_offset = asn1->offset;
8829
8830     asn1_int32_value_decode(asn1, 1, &value);
8831
8832     extended = (value & 0x80) >> 7;
8833
8834     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
8835     proto_tree_add_text(tree, asn1->tvb,
8836         saved_offset, asn1->offset - saved_offset,
8837         "%s :  Extension (EXT), %s",
8838         bigbuf,
8839         extended ? "No Extension, last octet of sequence" : "Extension indicator, the octet continues through the next octet");
8840
8841     other_decode_bitfield_value(bigbuf, value, 0x60, 8);
8842     proto_tree_add_text(tree, asn1->tvb,
8843         saved_offset, asn1->offset - saved_offset,
8844         "%s :  Reserved",
8845         bigbuf);
8846
8847     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
8848     proto_tree_add_text(tree, asn1->tvb,
8849         saved_offset, asn1->offset - saved_offset,
8850         "%s :  Location Information (LOC), %s",
8851         bigbuf,
8852         (value & 0x10) ? "MS location information available" : "No MS location information available");
8853
8854     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
8855     proto_tree_add_text(tree, asn1->tvb,
8856         saved_offset, asn1->offset - saved_offset,
8857         "%s :  Contact, %s",
8858         bigbuf,
8859         (value & 0x08) ? "Radio Contact Established" : "No Radio Contact");
8860
8861     has_chan = (value & 0x04) >> 2;
8862
8863     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
8864     proto_tree_add_text(tree, asn1->tvb,
8865         saved_offset, asn1->offset - saved_offset,
8866         "%s :  Channel, %s",
8867         bigbuf,
8868         has_chan ? "Traffic Channel Assigned" : "No Traffic Channel");
8869
8870     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
8871     proto_tree_add_text(tree, asn1->tvb,
8872         saved_offset, asn1->offset - saved_offset,
8873         "%s :  Handoff, %s",
8874         bigbuf,
8875         (value & 0x02) ? "Intersystem Handoff" : "No Intersystem Handoff");
8876
8877     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
8878     proto_tree_add_text(tree, asn1->tvb,
8879         saved_offset, asn1->offset - saved_offset,
8880         "%s :  Inactive, %s",
8881         bigbuf,
8882         (value & 0x01) ? "MS Inactive" : "MS Active");
8883
8884     if (len == 1) return;
8885
8886     saved_offset = asn1->offset;
8887
8888     asn1_int32_value_decode(asn1, 1, &value);
8889
8890     if (extended)
8891     {
8892         proto_tree_add_text(tree, asn1->tvb,
8893             saved_offset, asn1->offset - saved_offset,
8894             "Octet 1a ? spec. does not provide details");
8895
8896         saved_offset = asn1->offset;
8897
8898         EXTRANEOUS_DATA_CHECK(len, 2);
8899
8900         return;
8901     }
8902
8903     if (has_chan)
8904     {
8905         switch (value)
8906         {
8907         case 0: str = "Not used "; break;
8908         case 1: str = "Analog. The MS is currently assigned to an analog traffic channel"; break;
8909         case 2: str = "NAMPS. The MS is currently assigned to an NAMPS traffic channel"; break;
8910         case 3: str = "TDMA. The MS is currently assigned to a TDMA traffic channel"; break;
8911         case 4: str = "CDMA. The MS is currently assigned to a CDMA traffic channel"; break;
8912         default:
8913             if ((value >= 5) && (value <= 223)) { str = "Reserved, treat as Not used"; }
8914             else { str = "Reserved for protocol extension, treat as Not used"; }
8915             break;
8916         }
8917
8918         proto_tree_add_text(tree, asn1->tvb,
8919             saved_offset, asn1->offset - saved_offset,
8920             "Radio Channel Type, %s",
8921             str);
8922
8923         saved_offset = asn1->offset;
8924
8925         EXTRANEOUS_DATA_CHECK(len, 2);
8926
8927         return;
8928     }
8929
8930     asn1->offset -= 1;
8931
8932     EXTRANEOUS_DATA_CHECK(len, 1);
8933 }
8934
8935 static void
8936 param_pos_info_code(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
8937 {
8938     gint32 value;
8939     guint saved_offset;
8940
8941     saved_offset = asn1->offset;
8942
8943     asn1_int32_value_decode(asn1, 1, &value);
8944
8945     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
8946     proto_tree_add_text(tree, asn1->tvb,
8947         saved_offset, asn1->offset - saved_offset,
8948         "%s :  Reserved",
8949         bigbuf);
8950
8951     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
8952     proto_tree_add_text(tree, asn1->tvb,
8953         saved_offset, asn1->offset - saved_offset,
8954         "%s :  MS Identity (MSID), %s",
8955         bigbuf,
8956         (value & 0x10) ? "MS Identity Requested" : "No MS Identity Requested");
8957
8958     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
8959     proto_tree_add_text(tree, asn1->tvb,
8960         saved_offset, asn1->offset - saved_offset,
8961         "%s :  Routing Address (ROUTE), %s",
8962         bigbuf,
8963         (value & 0x08) ? "Routing Address Requested" : "No Routing Address Requested");
8964
8965     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
8966     proto_tree_add_text(tree, asn1->tvb,
8967         saved_offset, asn1->offset - saved_offset,
8968         "%s :  Serving Cell ID (CELLID), %s",
8969         bigbuf,
8970         (value & 0x04) ? "Serving Cell ID Requested" : "No Serving Cell ID Requested");
8971
8972     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
8973     proto_tree_add_text(tree, asn1->tvb,
8974         saved_offset, asn1->offset - saved_offset,
8975         "%s :  Location Area ID (LOCID), %s",
8976         bigbuf,
8977         (value & 0x02) ?  "Location Area ID Requested" : "No Location Area ID Requested");
8978
8979     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
8980     proto_tree_add_text(tree, asn1->tvb,
8981         saved_offset, asn1->offset - saved_offset,
8982         "%s :  Current, %s",
8983         bigbuf,
8984         (value & 0x01) ? "Provide the current MS location" : "Provide the last known MS location information, if known");
8985
8986     EXTRANEOUS_DATA_CHECK(len, 1);
8987 }
8988
8989 static void
8990 param_rel_reason(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
8991 {
8992     gint32 value;
8993     guint saved_offset;
8994     const gchar *str = NULL;
8995
8996     EXACT_DATA_CHECK(len, 1);
8997
8998     saved_offset = asn1->offset;
8999
9000     asn1_int32_value_decode(asn1, 1, &value);
9001
9002     switch (value)
9003     {
9004     case 0: str = "Unspecified"; break;
9005     case 1: str = "Call Over Clear Forward"; break;
9006     case 2: str = "Call Over Clear Backward"; break;
9007     case 3: str = "Handoff Successful"; break;
9008     case 4: str = "Handoff Abort - call over"; break;
9009     case 5: str = "Handoff Abort - not received"; break;
9010     case 6: str = "Abnormal mobile termination"; break;
9011     case 7: str = "Abnormal switch termination"; break;
9012     case 8: str = "Special feature release"; break;
9013     case 9: str = "Session Over Clear Forward"; break;
9014     case 10: str = "Session Over Clear Backward"; break;
9015     case 11: str = "Clear All Services Forward"; break;
9016     case 12: str = "Clear All Services Backward"; break;
9017     case 13: str = "Anchor MSC was removed from the packet data session"; break;
9018     default:
9019         if ((value >= 14) && (value <= 223)) { str = "Reserved, treat as Unspecified"; }
9020         else { str = "Reserved for protocol extension, treat as Unspecified"; }
9021         break;
9022     }
9023
9024     proto_tree_add_text(tree, asn1->tvb,
9025         saved_offset, asn1->offset - saved_offset,
9026         "Reason, %s",
9027         str);
9028 }
9029
9030 static void
9031 param_ho_reason(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
9032 {
9033     gint32 value;
9034     guint saved_offset;
9035     const gchar *str = NULL;
9036
9037     EXACT_DATA_CHECK(len, 1);
9038
9039     saved_offset = asn1->offset;
9040
9041     asn1_int32_value_decode(asn1, 1, &value);
9042
9043     switch (value)
9044     {
9045     case 0: str = "Not used"; break;
9046     case 1: str = "Unspecified"; break;
9047     case 2: str = "Weak signal"; break;
9048     case 3: str = "Off-loading"; break;
9049     case 4: str = "Anticipatory"; break;
9050     default:
9051         if ((value >= 5) && (value <= 223)) { str = "Reserved, treat as Unspecified"; }
9052         else { str = "Reserved for protocol extension, treat as Unspecified"; }
9053         break;
9054     }
9055
9056     proto_tree_add_text(tree, asn1->tvb,
9057         saved_offset, asn1->offset - saved_offset,
9058         str);
9059 }
9060
9061 static void
9062 param_red_reason(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
9063 {
9064     gint32 value;
9065     guint saved_offset;
9066     const gchar *str = NULL;
9067
9068     EXACT_DATA_CHECK(len, 1);
9069
9070     saved_offset = asn1->offset;
9071
9072     asn1_int32_value_decode(asn1, 1, &value);
9073
9074     switch (value)
9075     {
9076     case 0: str = "Not used"; break;
9077     case 1: str = "Busy"; break;
9078     case 2: str = "No answer"; break;
9079     case 3: str = "Unconditional"; break;
9080     case 4: str = "No page response"; break;
9081     case 5: str = "Unavailable"; break;
9082     case 6: str = "Unroutable"; break;
9083     case 7: str = "Call accepted"; break;
9084     case 8: str = "Call refused"; break;
9085     case 9: str = "USCFvm, divert to voice mail"; break;
9086     case 10: str = "USCFms, divert to an MS provided DN"; break;
9087     case 11: str = "USCFnr, divert to a network registered DN"; break;
9088     default:
9089         if ((value >= 12) && (value <= 223)) { str = "Reserved, treat as No answer"; }
9090         else { str = "Reserved for protocol extension, treat as No answer"; }
9091         break;
9092     }
9093
9094     proto_tree_add_text(tree, asn1->tvb,
9095         saved_offset, asn1->offset - saved_offset,
9096         str);
9097 }
9098
9099 static void
9100 param_confid_mode(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
9101 {
9102     gint32 value;
9103     guint saved_offset;
9104
9105     EXACT_DATA_CHECK(len, 1);
9106
9107     saved_offset = asn1->offset;
9108
9109     asn1_int32_value_decode(asn1, 1, &value);
9110
9111     other_decode_bitfield_value(bigbuf, value, 0xf8, 8);
9112     proto_tree_add_text(tree, asn1->tvb,
9113         saved_offset, asn1->offset - saved_offset,
9114         "%s :  Reserved",
9115         bigbuf);
9116
9117     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
9118     proto_tree_add_text(tree, asn1->tvb,
9119         saved_offset, asn1->offset - saved_offset,
9120         "%s :  Data Privacy (DP), %s",
9121         bigbuf,
9122         (value & 0x04) ? "ON" : "OFF");
9123
9124     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
9125     proto_tree_add_text(tree, asn1->tvb,
9126         saved_offset, asn1->offset - saved_offset,
9127         "%s :  Signaling Message Encryption (SE), %s",
9128         bigbuf,
9129         (value & 0x02) ? "ON" : "OFF");
9130
9131     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
9132     proto_tree_add_text(tree, asn1->tvb,
9133         saved_offset, asn1->offset - saved_offset,
9134         "%s :  Voice Privacy (VP), %s",
9135         bigbuf,
9136         (value & 0x01) ? "ON" : "OFF");
9137 }
9138
9139 static void
9140 param_sys_acc_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
9141 {
9142     gint32 value;
9143     guint saved_offset;
9144     const gchar *str = NULL;
9145
9146     EXACT_DATA_CHECK(len, 1);
9147
9148     saved_offset = asn1->offset;
9149
9150     asn1_int32_value_decode(asn1, 1, &value);
9151
9152     switch (value)
9153     {
9154     case 0: str = "Not used"; break;
9155     case 1: str = "Unspecified"; break;
9156     case 2: str = "Flash request"; break;
9157     case 3: str = "Autonomous registration"; break;
9158     case 4: str = "Call origination"; break;
9159     case 5: str = "Page response"; break;
9160     case 6: str = "No access"; break;
9161     case 7: str = "Power down registration"; break;
9162     case 8: str = "SMS page response"; break;
9163     case 9: str = "OTASP"; break;
9164     default:
9165         if ((value >= 10) && (value <= 223)) { str = "Reserved, treat as Unspecified"; }
9166         else { str = "Reserved for protocol extension, treat as Unspecified"; }
9167         break;
9168     }
9169
9170     proto_tree_add_text(tree, asn1->tvb,
9171         saved_offset, asn1->offset - saved_offset,
9172         str);
9173 }
9174
9175 static void
9176 param_scm(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
9177 {
9178     gint32 value, temp_int;
9179     guint saved_offset;
9180     const gchar *str = NULL;
9181
9182     EXACT_DATA_CHECK(len, 1);
9183
9184     saved_offset = asn1->offset;
9185
9186     asn1_int32_value_decode(asn1, 1, &value);
9187
9188     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
9189     proto_tree_add_text(tree, asn1->tvb,
9190         saved_offset, asn1->offset - saved_offset,
9191         "%s :  Reserved",
9192         bigbuf);
9193
9194     temp_int = ((value & 0x10) >> 2) | (value & 0x03);
9195     switch (temp_int)
9196     {
9197     case 0: str = "Class I"; break;
9198     case 1: str = "Class II"; break;
9199     case 2: str = "Class III"; break;
9200     case 3: str = "Class IV"; break;
9201     case 4: str = "Class V"; break;
9202     case 5: str = "Class VI"; break;
9203     case 6: str = "Class VII"; break;
9204     case 7: str = "Class VIII"; break;
9205     }
9206
9207     other_decode_bitfield_value(bigbuf, value, 0x13, 8);
9208     proto_tree_add_text(tree, asn1->tvb,
9209         saved_offset, asn1->offset - saved_offset,
9210         "%s :  Power %s",
9211         bigbuf,
9212         str);
9213
9214     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
9215     proto_tree_add_text(tree, asn1->tvb,
9216         saved_offset, asn1->offset - saved_offset,
9217         "%s :  Bandwidth %s",
9218         bigbuf,
9219         (value & 0x08) ? "25 MHz" : "20 MHz");
9220
9221     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
9222     proto_tree_add_text(tree, asn1->tvb,
9223         saved_offset, asn1->offset - saved_offset,
9224         "%s :  Transmission, %s",
9225         bigbuf,
9226         (value & 0x04) ? "Discontinuous" : "Continuous");
9227 }
9228
9229 static void
9230 param_deny_acc(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
9231 {
9232     gint32 value;
9233     guint saved_offset;
9234     const gchar *str = NULL;
9235
9236     EXACT_DATA_CHECK(len, 1);
9237
9238     saved_offset = asn1->offset;
9239
9240     asn1_int32_value_decode(asn1, 1, &value);
9241
9242     switch (value)
9243     {
9244     case 0: str = "Not used"; break;
9245     case 1: str = "Unspecified"; break;
9246     case 2: str = "SSD Update failure"; break;
9247     case 3: str = "COUNT Update failure"; break;
9248     case 4: str = "Unique Challenge failure"; break;
9249     case 5: str = "AUTHR mismatch"; break;
9250     case 6: str = "COUNT mismatch"; break;
9251     case 7: str = "Process collision"; break;
9252     case 8: str = "Missing authentication parameters"; break;
9253     case 9: str = "TerminalType mismatch"; break;
9254     case 10: str = "MIN, IMSI or ESN authorization failure"; break;
9255     default:
9256         if ((value >= 11) && (value <= 223)) { str = "Reserved, treat as Unspecified"; }
9257         else { str = "Reserved for protocol extension, treat as Unspecified"; }
9258         break;
9259     }
9260
9261     proto_tree_add_text(tree, asn1->tvb,
9262         saved_offset, asn1->offset - saved_offset,
9263         str);
9264 }
9265
9266 static void
9267 param_cdma_sig_qual(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
9268 {
9269     gint32 value;
9270     guint saved_offset;
9271
9272     EXACT_DATA_CHECK(len, 1);
9273
9274     saved_offset = asn1->offset;
9275
9276     asn1_int32_value_decode(asn1, 1, &value);
9277
9278     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
9279     proto_tree_add_text(tree, asn1->tvb,
9280         saved_offset, asn1->offset - saved_offset,
9281         "%s :  Reserved",
9282         bigbuf);
9283
9284     other_decode_bitfield_value(bigbuf, value, 0x3f, 8);
9285     proto_tree_add_text(tree, asn1->tvb,
9286         saved_offset, asn1->offset - saved_offset,
9287         "%s :  Value %u",
9288         bigbuf,
9289         value & 0x3f);
9290 }
9291
9292 static void
9293 param_rec_sig_qual(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
9294 {
9295     gint32 value;
9296     guint saved_offset;
9297     const gchar *str = NULL;
9298
9299     EXACT_DATA_CHECK(len, 1);
9300
9301     saved_offset = asn1->offset;
9302
9303     asn1_int32_value_decode(asn1, 1, &value);
9304
9305     switch (value)
9306     {
9307     case 0: str = "Not a usable signal"; break;
9308     case 255: str = "Interference"; break;
9309     default:
9310         if ((value >= 1) && (value <= 8)) { str = "Reserved, treat as Not a usable signal"; }
9311         else if ((value >= 9) && (value <= 245)) { str = "Usable signal range"; }
9312         else if ((value >= 246) && (value <= 254)) { str = "Reserved, treat as Interference"; }
9313         break;
9314     }
9315
9316     proto_tree_add_text(tree, asn1->tvb,
9317         saved_offset, asn1->offset - saved_offset,
9318         str);
9319 }
9320
9321 static void
9322 param_sig_qual(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
9323 {
9324     gint32 value;
9325     guint saved_offset;
9326     const gchar *str = NULL;
9327
9328     EXACT_DATA_CHECK(len, 1);
9329
9330     saved_offset = asn1->offset;
9331
9332     asn1_int32_value_decode(asn1, 1, &value);
9333
9334     switch (value)
9335     {
9336     case 0: str = "Not a usable signal"; break;
9337     case 255: str = "Interference"; break;
9338     default:
9339         if ((value >= 1) && (value <= 8)) { str = "Reserved, treat as Not a usable signal"; }
9340         else if ((value >= 9) && (value <= 245)) { str = "Usable signal range"; }
9341         else if ((value >= 246) && (value <= 254)) { str = "Reserved, treat as Interference"; }
9342         break;
9343     }
9344
9345     proto_tree_add_text(tree, asn1->tvb,
9346         saved_offset, asn1->offset - saved_offset,
9347         str);
9348 }
9349
9350 static void
9351 param_ssd_no_share(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
9352 {
9353     gint32 value;
9354     guint saved_offset;
9355     const gchar *str = NULL;
9356
9357     EXACT_DATA_CHECK(len, 1);
9358
9359     saved_offset = asn1->offset;
9360
9361     asn1_int32_value_decode(asn1, 1, &value);
9362
9363     switch (value)
9364     {
9365     case 0: str = "Not used"; break;
9366     case 1: str = "Discard SSD"; break;
9367     default:
9368         str = "Reserved, treat as Discard SSD";
9369         break;
9370     }
9371
9372     proto_tree_add_text(tree, asn1->tvb,
9373         saved_offset, asn1->offset - saved_offset,
9374         str);
9375 }
9376
9377 static void
9378 param_report_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
9379 {
9380     gint32 value;
9381     guint saved_offset;
9382     const gchar *str = NULL;
9383
9384     EXACT_DATA_CHECK(len, 1);
9385
9386     saved_offset = asn1->offset;
9387
9388     asn1_int32_value_decode(asn1, 1, &value);
9389
9390     switch (value)
9391     {
9392     case 0: str = "Not used"; break;
9393     case 1: str = "Unspecified security violation"; break;
9394     case 2: str = "MSID/ESN mismatch"; break;
9395     case 3: str = "RANDC mismatch"; break;
9396     case 4: str = "Reserved (see TSB51)"; break;
9397     case 5: str = "SSD Update failed"; break;
9398     case 6: str = "Reserved (see TSB51)"; break;
9399     case 7: str = "COUNT mismatch"; break;
9400     case 8: str = "Reserved (see TSB51)"; break;
9401     case 9: str = "Unique Challenge failed"; break;
9402     case 10: str = "Unsolicited Base Station Challenge"; break;
9403     case 11: str = "SSD Update no response"; break;
9404     case 12: str = "COUNT Update no response"; break;
9405     case 13: str = "Unique Challenge no response"; break;
9406     case 14: str = "AUTHR mismatch"; break;
9407     case 15: str = "TERMTYP mismatch"; break;
9408     case 16: str = "Missing authentication parameters"; break;
9409     default:
9410         if ((value >= 17) && (value <= 223)) { str = "Reserved, treat as Unspecified security violation"; }
9411         else { str = "Reserved for protocol extension, treat as Unspecified security violation"; }
9412         break;
9413     }
9414
9415     proto_tree_add_text(tree, asn1->tvb,
9416         saved_offset, asn1->offset - saved_offset,
9417         str);
9418 }
9419
9420 static void
9421 param_term_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
9422 {
9423     gint32 value;
9424     guint saved_offset;
9425     const gchar *str = NULL;
9426
9427     EXACT_DATA_CHECK(len, 1);
9428
9429     saved_offset = asn1->offset;
9430
9431     asn1_int32_value_decode(asn1, 1, &value);
9432
9433     switch (value)
9434     {
9435     case 0: str = "Not used"; break;
9436     case 1: str = "Not distinguished, EIA/TIA-553, IS-54-A, IS-88, IS-91, IS-94"; break;
9437     case 2: str = "IS-54-B"; break;
9438     case 3: str = "IS-136"; break;
9439     case 4: str = "J-STD-011 (rescinded 11/23/99)"; break;
9440     case 5: str = "IS-136-A or TIA/EIA-136 Revision-0"; break;
9441     case 6: str = "TIA/EIA-136-A"; break;
9442     case 7: str = "TIA/EIA-136-B"; break;
9443     case 32: str = "IS-95"; break;
9444     case 33: str = "IS-95-A"; break;
9445     case 34: str = "J-STD-008"; break;
9446     case 35: str = "IS-95-B"; break;
9447     case 36: str = "IS-2000"; break;
9448     case 64: str = "IS-88"; break;
9449     case 65: str = "IS-94"; break;
9450     case 66: str = "IS-91"; break;
9451     case 67: str = "J-STD-014"; break;
9452     case 68: str = "TIA/EIA-553-A"; break;
9453     case 69: str = "IS-91-A"; break;
9454     default:
9455         if ((value >= 8) && (value <= 31)) { str = "Reserved, treat as IS-54-B"; }
9456         else if ((value >= 37) && (value <= 63)) { str = "Reserved, treat as IS-95-A"; }
9457         else if ((value >= 70) && (value <= 223)) { str = "Reserved, treat as Not distinguished"; }
9458         else { str = "Reserved for protocol extension, treat as Not distinguished"; }
9459         break;
9460     }
9461
9462     proto_tree_add_text(tree, asn1->tvb,
9463         saved_offset, asn1->offset - saved_offset,
9464         str);
9465 }
9466
9467 static void
9468 param_term_res(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
9469 {
9470     gint32 value;
9471     guint saved_offset;
9472     const gchar *str = NULL;
9473
9474     EXACT_DATA_CHECK(len, 1);
9475
9476     saved_offset = asn1->offset;
9477
9478     asn1_int32_value_decode(asn1, 1, &value);
9479
9480     switch (value)
9481     {
9482     case 0: str = "Not used"; break;
9483     case 1: str = "Termination denied"; break;
9484     case 2: str = "Unrestricted"; break;
9485     case 3: str = "Treatment for this value is not specified"; break;
9486     default:
9487         if ((value >= 4) && (value <= 223)) { str = "Reserved, treat as Unrestricted"; }
9488         else { str = "Reserved for protocol extension, treat as Unrestricted"; }
9489         break;
9490     }
9491
9492     proto_tree_add_text(tree, asn1->tvb,
9493         saved_offset, asn1->offset - saved_offset,
9494         str);
9495 }
9496
9497 static void
9498 param_dereg(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
9499 {
9500     gint32 value;
9501     guint saved_offset;
9502     const gchar *str = NULL;
9503
9504     EXACT_DATA_CHECK(len, 1);
9505
9506     saved_offset = asn1->offset;
9507
9508     asn1_int32_value_decode(asn1, 1, &value);
9509
9510     switch (value)
9511     {
9512     case 0: str = "Not used"; break;
9513     case 1: str = "Deregister for an unspecified reason"; break;
9514     case 2: str = "Deregister for an adminstrative reason"; break;
9515     case 3: str = "Deregister due to MS power down"; break;
9516     default:
9517         if ((value >= 4) && (value <= 223)) { str = "Reserved, treat as Deregister for an unspecified reason"; }
9518         else { str = "Reserved for protocol extension, treat as Deregister for an unspecified reason"; }
9519         break;
9520     }
9521
9522     proto_tree_add_text(tree, asn1->tvb,
9523         saved_offset, asn1->offset - saved_offset,
9524         str);
9525 }
9526
9527 static void
9528 param_group_info(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
9529 {
9530     gint32 value;
9531     guint saved_offset;
9532
9533     SHORT_DATA_CHECK(len, 4);
9534
9535     saved_offset = asn1->offset;
9536
9537     asn1_int32_value_decode(asn1, 4, &value);
9538
9539     proto_tree_add_text(tree, asn1->tvb,
9540         saved_offset, asn1->offset - saved_offset,
9541         "Value %u",
9542         value);
9543
9544     EXTRANEOUS_DATA_CHECK(len, 4);
9545 }
9546
9547 static void
9548 param_auth_den(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
9549 {
9550     gint32 value;
9551     guint saved_offset;
9552     const gchar *str = NULL;
9553
9554     EXACT_DATA_CHECK(len, 1);
9555
9556     saved_offset = asn1->offset;
9557
9558     asn1_int32_value_decode(asn1, 1, &value);
9559
9560     switch (value)
9561     {
9562     case 0: str = "Not used"; break;
9563     case 1: str = "Delinquent account"; break;
9564     case 2: str = "Invalid serial number"; break;
9565     case 3: str = "Stolen unit"; break;
9566     case 4: str = "Duplicate unit"; break;
9567     case 5: str = "Unassigned directory number"; break;
9568     case 6: str = "Unspecified"; break;
9569     case 7: str = "Multiple access"; break;
9570     case 8: str = "Not Authorized for the MSC"; break;
9571     case 9: str = "Missing authentication parameters"; break;
9572     case 10: str = "Terminal Type mismatch"; break;
9573     default:
9574         if ((value >= 11) && (value <= 223)) { str = "Reserved, treat as Unspecified"; }
9575         else { str = "Reserved for protocol extension, treat as Unspecified"; }
9576         break;
9577     }
9578
9579     proto_tree_add_text(tree, asn1->tvb,
9580         saved_offset, asn1->offset - saved_offset,
9581         "Reason, %s (%u)",
9582         str,
9583         value);
9584 }
9585
9586 static const gchar *
9587 find_trig_type(gint32 value)
9588 {
9589     const gchar *str = NULL;
9590
9591     switch (value)
9592     {
9593     case 0: str = "Unspecified"; break;
9594     case 1: str = "All Calls"; break;
9595     case 2: str = "Double Introducing Star"; break;
9596     case 3: str = "Single Introducing Star"; break;
9597     case 4: str = "Reserved [for Home System Feature Code"; break;
9598     case 5: str = "Double Introducing Pound"; break;
9599     case 6: str = "Single Introducing Pound"; break;
9600     case 7: str = "Revertive Call"; break;
9601     case 8: str = "0 Digit"; break;
9602     case 9: str = "1 Digit"; break;
9603     case 10: str = "2 Digit"; break;
9604     case 11: str = "3 Digit"; break;
9605     case 12: str = "4 Digit"; break;
9606     case 13: str = "5 Digit"; break;
9607     case 14: str = "6 Digit"; break;
9608     case 15: str = "7 Digit"; break;
9609     case 16: str = "8 Digit"; break;
9610     case 17: str = "9 Digit"; break;
9611     case 18: str = "10 Digit"; break;
9612     case 19: str = "11 Digit"; break;
9613     case 20: str = "12 Digit"; break;
9614     case 21: str = "13 Digit"; break;
9615     case 22: str = "14 Digit"; break;
9616     case 23: str = "15 Digit"; break;
9617     case 24: str = "Local Call"; break;
9618     case 25: str = "Intra-LATA Toll Call"; break;
9619     case 26: str = "Inter-LATA Toll Call"; break;
9620     case 27: str = "World Zone Call"; break;
9621     case 28: str = "International Call"; break;
9622     case 29: str = "Unrecognized Number"; break;
9623     case 30: str = "Prior Agreement"; break;
9624     case 31: str = "Specific Called Party Digit String"; break;
9625     case 32: str = "Mobile Termination"; break;
9626     case 33: str = "Advanced Termination"; break;
9627     case 34: str = "Location"; break;
9628     case 35: str = "Locally Allowed Specific Digit String"; break;
9629     case 36: str = "Origination Attempt Authorized"; break;
9630     case 37: str = "Calling Routing Address Available"; break;
9631     case 38: str = "Initial Termination"; break;
9632     case 39: str = "Called Routing Address Available"; break;
9633     case 40: str = "O Answer"; break;
9634     case 41: str = "O Disconnect"; break;
9635     case 42: str = "O Called Party Busy"; break;
9636     case 43: str = "O No Answer"; break;
9637     case 64: str = "Terminating Resource Available"; break;
9638     case 65: str = "T Busy"; break;
9639     case 66: str = "T No Answer"; break;
9640     case 67: str = "T No Page Response"; break;
9641     case 68: str = "T Unroutable"; break;
9642     case 69: str = "T Answer"; break;
9643     case 70: str = "T Disconnect"; break;
9644     case 220: str = "Reserved for TDP-R DP Type value"; break;
9645     case 221: str = "Reserved for TDP-N DP Type value"; break;
9646     case 222: str = "Reserved for EDP-R DP Type value"; break;
9647     case 223: str = "Reserved for EDP-N DP Type value"; break;
9648     default:
9649         if ((value >= 44) && (value <= 63)) { str = "Reserved, treat as Unspecified"; }
9650         else if ((value >= 71) && (value <= 219)) { str = "Reserved, treat as Unspecified"; }
9651         else { str = "Reserved for protocol extension, treat as Unspecified"; }
9652         break;
9653     }
9654
9655     return(str);
9656 }
9657
9658 static void
9659 param_trig_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
9660 {
9661     gint32 value;
9662     guint saved_offset;
9663
9664     EXACT_DATA_CHECK(len, 1);
9665
9666     saved_offset = asn1->offset;
9667
9668     asn1_int32_value_decode(asn1, 1, &value);
9669
9670     proto_tree_add_text(tree, asn1->tvb,
9671         saved_offset, asn1->offset - saved_offset,
9672         "Trigger (%u) %s",
9673         value,
9674         find_trig_type(value));
9675 }
9676
9677 static void
9678 param_win_op_cap(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
9679 {
9680     gint32 value;
9681     guint saved_offset;
9682     const gchar *str = NULL;
9683
9684     saved_offset = asn1->offset;
9685
9686     asn1_int32_value_decode(asn1, 1, &value);
9687
9688     other_decode_bitfield_value(bigbuf, value, 0xf8, 8);
9689     proto_tree_add_text(tree, asn1->tvb,
9690         saved_offset, asn1->offset - saved_offset,
9691         "%s :  Reserved",
9692         bigbuf);
9693
9694     switch ((value & 0x04) >> 2)
9695     {
9696     case 0x00: str = "Sender does not support PositionRequest OP"; break;
9697     default:
9698         str = "Sender supports PositionRequest OP";
9699         break;
9700     }
9701
9702     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
9703     proto_tree_add_text(tree, asn1->tvb,
9704         saved_offset, asn1->offset - saved_offset,
9705         "%s :  %s",
9706         bigbuf, str);
9707
9708     switch ((value & 0x02) >> 1)
9709     {
9710     case 0x00: str = "Sender does not support CallControlDirective OP"; break;
9711     default:
9712         str = "Sender supports CallControlDirective OP";
9713         break;
9714     }
9715
9716     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
9717     proto_tree_add_text(tree, asn1->tvb,
9718         saved_offset, asn1->offset - saved_offset,
9719         "%s :  %s",
9720         bigbuf, str);
9721
9722     switch (value & 0x01)
9723     {
9724     case 0x00: str = "Sender does not support ConnectResource, DisconnectResource, ConnectionFailureReport and ResetTimer (SSFT timer) OPs"; break;
9725     default:
9726         str = "Sender supports ConnectResource, DisconnectResource, ConnectionFailureReport and ResetTimer (SSFT timer) OPs";
9727         break;
9728     }
9729
9730     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
9731     proto_tree_add_text(tree, asn1->tvb,
9732         saved_offset, asn1->offset - saved_offset,
9733         "%s :  %s",
9734         bigbuf, str);
9735
9736     EXTRANEOUS_DATA_CHECK(len, 1);
9737 }
9738
9739 static void
9740 param_win_trig_list(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
9741 {
9742     gint32 value, i, j;
9743     guint saved_offset;
9744
9745     saved_offset = asn1->offset;
9746
9747     j = 0;
9748     i = 0;
9749
9750     do
9751     {
9752         asn1_int32_value_decode(asn1, 1, &value);
9753
9754         switch (value)
9755         {
9756         case 0xdc:
9757             proto_tree_add_text(tree, asn1->tvb,
9758                 saved_offset, asn1->offset - saved_offset,
9759                 "TDP-R's armed");
9760
9761             j = 0;
9762             break;
9763
9764         case 0xdd:
9765             proto_tree_add_text(tree, asn1->tvb,
9766                 saved_offset, asn1->offset - saved_offset,
9767                 "TDP-N's armed");
9768
9769             j = 0;
9770             break;
9771
9772         case 0xde:
9773             proto_tree_add_text(tree, asn1->tvb,
9774                 saved_offset, asn1->offset - saved_offset,
9775                 "EDP-R's armed");
9776
9777             j = 0;
9778             break;
9779
9780         case 0xdf:
9781             proto_tree_add_text(tree, asn1->tvb,
9782                 saved_offset, asn1->offset - saved_offset,
9783                 "EDP-N's armed");
9784
9785             j = 0;
9786             break;
9787
9788         default:
9789             proto_tree_add_text(tree, asn1->tvb,
9790                 saved_offset, asn1->offset - saved_offset,
9791                 "[%u] (%u) %s",
9792                 j,
9793                 value,
9794                 find_trig_type(value));
9795             j++;
9796             break;
9797         }
9798
9799         saved_offset = asn1->offset;
9800         i++;
9801     }
9802     while ((len - i) > 0);
9803 }
9804
9805 static void
9806 param_trans_cap(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
9807 {
9808     gint32 value;
9809     guint saved_offset;
9810     const gchar *str = NULL;
9811     char *p;
9812
9813     saved_offset = asn1->offset;
9814
9815     asn1_int32_value_decode(asn1, 1, &value);
9816
9817     switch ((value & 0x80) >> 7)
9818     {
9819     case 0x00: str = "System is not capable of supporting CNAP/CNAR (NAMI)"; break;
9820     default:
9821         str = "System is capable of supporting CNAP/CNAR (NAMI)";
9822         break;
9823     }
9824
9825     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
9826     proto_tree_add_text(tree, asn1->tvb,
9827         saved_offset, asn1->offset - saved_offset,
9828         "%s :  %s",
9829         bigbuf, str);
9830
9831     switch ((value & 0x40) >> 6)
9832     {
9833     case 0x00: str = "System is not capable of supporting NDSS"; break;
9834     default:
9835         str = "System is capable of supporting NDSS";
9836         break;
9837     }
9838
9839     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
9840     proto_tree_add_text(tree, asn1->tvb,
9841         saved_offset, asn1->offset - saved_offset,
9842         "%s :  %s",
9843         bigbuf, str);
9844
9845     switch ((value & 0x20) >> 5)
9846     {
9847     case 0x00: str = "System is not capable of supporting User Zones (UZCI)"; break;
9848     default:
9849         str = "System is capable of supporting User Zones (UZCI)";
9850         break;
9851     }
9852
9853     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
9854     proto_tree_add_text(tree, asn1->tvb,
9855         saved_offset, asn1->offset - saved_offset,
9856         "%s :  %s",
9857         bigbuf, str);
9858
9859     switch ((value & 0x10) >> 4)
9860     {
9861     case 0x00: str = "System is not capable of supporting local SPINI"; break;
9862     default:
9863         str = "System is capable of supporting local SPINI";
9864         break;
9865     }
9866
9867     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
9868     proto_tree_add_text(tree, asn1->tvb,
9869         saved_offset, asn1->offset - saved_offset,
9870         "%s :  %s",
9871         bigbuf, str);
9872
9873     switch ((value & 0x08) >> 3)
9874     {
9875     case 0x00: str = "System is not capable of interacting with the user (RUI)"; break;
9876     default:
9877         str = "System is capable of interacting with the user (RUI)";
9878         break;
9879     }
9880
9881     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
9882     proto_tree_add_text(tree, asn1->tvb,
9883         saved_offset, asn1->offset - saved_offset,
9884         "%s :  %s",
9885         bigbuf, str);
9886
9887     switch ((value & 0x04) >> 2)
9888     {
9889     case 0x00: str = "System is not capable of honoring the Announcement List parameter (ANN)"; break;
9890     default:
9891         str = "System is capable of honoring the Announcement List parameter (ANN)";
9892         break;
9893     }
9894
9895     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
9896     proto_tree_add_text(tree, asn1->tvb,
9897         saved_offset, asn1->offset - saved_offset,
9898         "%s :  %s",
9899         bigbuf, str);
9900
9901     switch ((value & 0x02) >> 1)
9902     {
9903     case 0x00: str = "System is not capable of detecting a busy condition (BUSY)"; break;
9904     default:
9905         str = "System is capable of detecting a busy condition (BUSY)";
9906         break;
9907     }
9908
9909     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
9910     proto_tree_add_text(tree, asn1->tvb,
9911         saved_offset, asn1->offset - saved_offset,
9912         "%s :  %s",
9913         bigbuf, str);
9914
9915     switch (value & 0x01)
9916     {
9917     case 0x00: str = "System is not capable of supporting the IS-41-C profile parameter (PROFILE)"; break;
9918     default:
9919         str = "System is capable of supporting the IS-41-C profile parameter (PROFILE)";
9920         break;
9921     }
9922
9923     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
9924     proto_tree_add_text(tree, asn1->tvb,
9925         saved_offset, asn1->offset - saved_offset,
9926         "%s :  %s",
9927         bigbuf, str);
9928
9929     if (len == 1) return;
9930
9931     saved_offset = asn1->offset;
9932
9933     asn1_int32_value_decode(asn1, 1, &value);
9934
9935     switch ((value & 0x80) >> 7)
9936     {
9937     case 0x00: str = "System is not capable of supporting the CDMA Over the Air Parameter Administration"; break;
9938     default:
9939         str = "System is capable of supporting the CDMA Over the Air Parameter Administration";
9940         break;
9941     }
9942
9943     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
9944     proto_tree_add_text(tree, asn1->tvb,
9945         saved_offset, asn1->offset - saved_offset,
9946         "%s :  %s",
9947         bigbuf, str);
9948
9949     switch ((value & 0x40) >> 6)
9950     {
9951     case 0x00: str = "System is not capable of supporting lower layer segmentation & reassembly (S&R)"; break;
9952     default:
9953         str = "System is capable of supporting lower layer segmentation & reassembly (S&R)";
9954         break;
9955     }
9956
9957     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
9958     proto_tree_add_text(tree, asn1->tvb,
9959         saved_offset, asn1->offset - saved_offset,
9960         "%s :  %s",
9961         bigbuf, str);
9962
9963     switch ((value & 0x20) >> 5)
9964     {
9965     case 0x00: str = "System is not capable of supporting the Trigger Address List parameter (WADDR)"; break;
9966     default:
9967         str = "System is capable of supporting the Trigger Address List parameter (WADDR)";
9968         break;
9969     }
9970
9971     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
9972     proto_tree_add_text(tree, asn1->tvb,
9973         saved_offset, asn1->offset - saved_offset,
9974         "%s :  %s",
9975         bigbuf, str);
9976
9977     switch ((value & 0x10) >> 4)
9978     {
9979     case 0x00: str = "System is not capable of supporting the Termination List parameter (TL)"; break;
9980     default:
9981         str = "System is capable of supporting the Termination List parameter (TL)";
9982         break;
9983     }
9984
9985     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
9986     proto_tree_add_text(tree, asn1->tvb,
9987         saved_offset, asn1->offset - saved_offset,
9988         "%s :  %s",
9989         bigbuf, str);
9990
9991     p = other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
9992     switch (value & 0x0f)
9993     {
9994     case 0x00: strcat(p, " :  System cannot accept a termination at this time"); break;
9995     default:
9996         sprintf(p, " :  System supports %u call leg(s)", value & 0x0f);
9997         break;
9998     }
9999
10000     proto_tree_add_text(tree, asn1->tvb,
10001         saved_offset, asn1->offset - saved_offset,
10002         "%s",
10003         bigbuf);
10004
10005     if (len == 2) return;
10006
10007     saved_offset = asn1->offset;
10008
10009     asn1_int32_value_decode(asn1, 1, &value);
10010
10011     other_decode_bitfield_value(bigbuf, value, 0xf8, 8);
10012     proto_tree_add_text(tree, asn1->tvb,
10013         saved_offset, asn1->offset - saved_offset,
10014         "%s :  Reserved",
10015         bigbuf);
10016
10017     switch ((value & 0x04) >> 2)
10018     {
10019     case 0x00: str = "The system is not capable of supporting external MAHO requests"; break;
10020     default:
10021         str = "The system is capable of supporting external MAHO requests (e.g. for positioning)";
10022         break;
10023     }
10024
10025     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
10026     proto_tree_add_text(tree, asn1->tvb,
10027         saved_offset, asn1->offset - saved_offset,
10028         "%s :  %s",
10029         bigbuf, str);
10030
10031     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
10032     proto_tree_add_text(tree, asn1->tvb,
10033         saved_offset, asn1->offset - saved_offset,
10034         "%s :  Reserved",
10035         bigbuf);
10036
10037     EXTRANEOUS_DATA_CHECK(len, 3);
10038 }
10039
10040 static void
10041 param_spini_trig(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
10042 {
10043     gint32 value;
10044     guint saved_offset;
10045     const gchar *str = NULL;
10046
10047     SHORT_DATA_CHECK(len, 4);
10048
10049     saved_offset = asn1->offset;
10050
10051     asn1_int32_value_decode(asn1, 1, &value);
10052
10053     switch ((value & 0x80) >> 7)
10054     {
10055     case 0x00: str = "Trigger is not active"; break;
10056     default:
10057         str = "Execute local SPINI procedures for any Revertive Call attempt"; break;
10058         break;
10059     }
10060
10061     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
10062     proto_tree_add_text(tree, asn1->tvb,
10063         saved_offset, asn1->offset - saved_offset,
10064         "%s :  Revertive Call (RvtC), %s",
10065         bigbuf, str);
10066
10067     switch ((value & 0x40) >> 6)
10068     {
10069     case 0x00: str = "Trigger is not active"; break;
10070     default:
10071         str = "Execute local SPINI procedures for any call attempt to an unrecognized number"; break;
10072         break;
10073     }
10074
10075     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
10076     proto_tree_add_text(tree, asn1->tvb,
10077         saved_offset, asn1->offset - saved_offset,
10078         "%s :  Unrecognized Number (Unrec), %s",
10079         bigbuf, str);
10080
10081     switch ((value & 0x20) >> 5)
10082     {
10083     case 0x00: str = "Trigger is not active"; break;
10084     default:
10085         str = "Execute local SPINI procedures for any call attempt outside of the current World Zone (as defined in ITU-T Rec. E.164)";
10086         break;
10087     }
10088
10089     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
10090     proto_tree_add_text(tree, asn1->tvb,
10091         saved_offset, asn1->offset - saved_offset,
10092         "%s :  World Zone (WZ), %s",
10093         bigbuf, str);
10094
10095     switch ((value & 0x10) >> 4)
10096     {
10097     case 0x00: str = "Trigger is not active"; break;
10098     default:
10099         str = "Execute local SPINI procedures for any international call attempt";
10100         break;
10101     }
10102
10103     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
10104     proto_tree_add_text(tree, asn1->tvb,
10105         saved_offset, asn1->offset - saved_offset,
10106         "%s :  International (Intl), %s",
10107         bigbuf, str);
10108
10109     switch ((value & 0x08) >> 3)
10110     {
10111     case 0x00: str = "Trigger is not active"; break;
10112     default:
10113         str = "Execute local SPINI procedures for any toll calls outside the local carrier's serving area";
10114         break;
10115     }
10116
10117     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
10118     proto_tree_add_text(tree, asn1->tvb,
10119         saved_offset, asn1->offset - saved_offset,
10120         "%s :  Non-Local (Inter-LATA) Toll (NLTOLL/OLATA), %s",
10121         bigbuf, str);
10122
10123     switch ((value & 0x04) >> 2)
10124     {
10125     case 0x00: str = "Trigger is not active"; break;
10126     default:
10127         str = "Execute local SPINI procedures for any local toll call attempt.  Refers to intra-LATA toll within the NANP";
10128         break;
10129     }
10130
10131     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
10132     proto_tree_add_text(tree, asn1->tvb,
10133         saved_offset, asn1->offset - saved_offset,
10134         "%s :  Local (Intra-LATA) Toll (LTOLL/ILATA), %s",
10135         bigbuf, str);
10136
10137     switch ((value & 0x02) >> 1)
10138     {
10139     case 0x00: str = "Trigger is not active"; break;
10140     default:
10141         str = "Execute local SPINI procedures for any local call attempt";
10142         break;
10143     }
10144
10145     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
10146     proto_tree_add_text(tree, asn1->tvb,
10147         saved_offset, asn1->offset - saved_offset,
10148         "%s :  Local, %s",
10149         bigbuf, str);
10150
10151     switch (value & 0x01)
10152     {
10153     case 0x00: str = "Trigger is not active"; break;
10154     default:
10155         str = "Execute local SPINI procedures for any call attempt. This overrides all other values.";
10156         break;
10157     }
10158
10159     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
10160     proto_tree_add_text(tree, asn1->tvb,
10161         saved_offset, asn1->offset - saved_offset,
10162         "%s :  All Origination (All), %s",
10163         bigbuf, str);
10164
10165     saved_offset = asn1->offset;
10166
10167     asn1_int32_value_decode(asn1, 1, &value);
10168
10169     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
10170     proto_tree_add_text(tree, asn1->tvb,
10171         saved_offset, asn1->offset - saved_offset,
10172         "%s :  Reserved",
10173         bigbuf);
10174
10175     switch ((value & 0x10) >> 4)
10176     {
10177     case 0x00: str = "Trigger is not active"; break;
10178     default:
10179         str = "Execute local SPINI procedures for any number matching a criteria of a prior agreement";
10180         break;
10181     }
10182
10183     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
10184     proto_tree_add_text(tree, asn1->tvb,
10185         saved_offset, asn1->offset - saved_offset,
10186         "%s :  Prior Agreement (PA), %s",
10187         bigbuf, str);
10188
10189     switch ((value & 0x08) >> 3)
10190     {
10191     case 0x00: str = "Trigger is not active"; break;
10192     default:
10193         str = "Execute local SPINI procedures for any number beginning with two Pound ## digits";
10194         break;
10195     }
10196
10197     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
10198     proto_tree_add_text(tree, asn1->tvb,
10199         saved_offset, asn1->offset - saved_offset,
10200         "%s :  Double Pound (DP), %s",
10201         bigbuf, str);
10202
10203     switch ((value & 0x04) >> 2)
10204     {
10205     case 0x00: str = "Trigger is not active"; break;
10206     default:
10207         str = "Execute local SPINI procedures for any number beginning with a Pound # digit";
10208         break;
10209     }
10210
10211     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
10212     proto_tree_add_text(tree, asn1->tvb,
10213         saved_offset, asn1->offset - saved_offset,
10214         "%s :  Pound, %s",
10215         bigbuf, str);
10216
10217     switch ((value & 0x02) >> 1)
10218     {
10219     case 0x00: str = "Trigger is not active"; break;
10220     default:
10221         str = "Execute local SPINI procedures for any number beginning with two Star ** digits";
10222         break;
10223     }
10224
10225     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
10226     proto_tree_add_text(tree, asn1->tvb,
10227         saved_offset, asn1->offset - saved_offset,
10228         "%s :  Double Star (DS), %s",
10229         bigbuf, str);
10230
10231     switch (value & 0x01)
10232     {
10233     case 0x00: str = "Trigger is not active"; break;
10234     default:
10235         str = "Execute local SPINI procedures for any number beginning with a Star * digit";
10236         break;
10237     }
10238
10239     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
10240     proto_tree_add_text(tree, asn1->tvb,
10241         saved_offset, asn1->offset - saved_offset,
10242         "%s :  Star, %s",
10243         bigbuf, str);
10244
10245     saved_offset = asn1->offset;
10246
10247     asn1_int32_value_decode(asn1, 1, &value);
10248
10249     switch ((value & 0x80) >> 7)
10250     {
10251     case 0x00: str = "Trigger is not active"; break;
10252     default:
10253         str = "Execute local SPINI procedures for any call attempt with 7 digits";
10254         break;
10255     }
10256
10257     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
10258     proto_tree_add_text(tree, asn1->tvb,
10259         saved_offset, asn1->offset - saved_offset,
10260         "%s :  7 digits, %s",
10261         bigbuf, str);
10262
10263     switch ((value & 0x40) >> 6)
10264     {
10265     case 0x00: str = "Trigger is not active"; break;
10266     default:
10267         str = "Execute local SPINI procedures for any call attempt with 6 digits";
10268         break;
10269     }
10270
10271     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
10272     proto_tree_add_text(tree, asn1->tvb,
10273         saved_offset, asn1->offset - saved_offset,
10274         "%s :  6 digits, %s",
10275         bigbuf, str);
10276
10277     switch ((value & 0x20) >> 5)
10278     {
10279     case 0x00: str = "Trigger is not active"; break;
10280     default:
10281         str = "Execute local SPINI procedures for any call attempt with 5 digits";
10282         break;
10283     }
10284
10285     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
10286     proto_tree_add_text(tree, asn1->tvb,
10287         saved_offset, asn1->offset - saved_offset,
10288         "%s :  5 digits, %s",
10289         bigbuf, str);
10290
10291     switch ((value & 0x10) >> 4)
10292     {
10293     case 0x00: str = "Trigger is not active"; break;
10294     default:
10295         str = "Execute local SPINI procedures for any call attempt with 4 digits";
10296         break;
10297     }
10298
10299     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
10300     proto_tree_add_text(tree, asn1->tvb,
10301         saved_offset, asn1->offset - saved_offset,
10302         "%s :  4 digits, %s",
10303         bigbuf, str);
10304
10305     switch ((value & 0x08) >> 3)
10306     {
10307     case 0x00: str = "Trigger is not active"; break;
10308     default:
10309         str = "Execute local SPINI procedures for any call attempt with 3 digits";
10310         break;
10311     }
10312
10313     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
10314     proto_tree_add_text(tree, asn1->tvb,
10315         saved_offset, asn1->offset - saved_offset,
10316         "%s :  3 digits, %s",
10317         bigbuf, str);
10318
10319     switch ((value & 0x04) >> 2)
10320     {
10321     case 0x00: str = "Trigger is not active"; break;
10322     default:
10323         str = "Execute local SPINI procedures for any call attempt with 2 digits";
10324         break;
10325     }
10326
10327     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
10328     proto_tree_add_text(tree, asn1->tvb,
10329         saved_offset, asn1->offset - saved_offset,
10330         "%s :  2 digits, %s",
10331         bigbuf, str);
10332
10333     switch ((value & 0x02) >> 1)
10334     {
10335     case 0x00: str = "Trigger is not active"; break;
10336     default:
10337         str = "Execute local SPINI procedures for any call attempt with 1 digits";
10338         break;
10339     }
10340
10341     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
10342     proto_tree_add_text(tree, asn1->tvb,
10343         saved_offset, asn1->offset - saved_offset,
10344         "%s :  1 digits, %s",
10345         bigbuf, str);
10346
10347     switch (value & 0x01)
10348     {
10349     case 0x00: str = "Trigger is not active"; break;
10350     default:
10351         str = "Execute local SPINI procedures for any call attempt with no digits";
10352         break;
10353     }
10354
10355     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
10356     proto_tree_add_text(tree, asn1->tvb,
10357         saved_offset, asn1->offset - saved_offset,
10358         "%s :  No digits, %s",
10359         bigbuf, str);
10360
10361     saved_offset = asn1->offset;
10362
10363     asn1_int32_value_decode(asn1, 1, &value);
10364
10365     switch ((value & 0x80) >> 7)
10366     {
10367     case 0x00: str = "Trigger is not active"; break;
10368     default:
10369         str = "Execute local SPINI procedures for any call attempt with 15 or more digits";
10370         break;
10371     }
10372
10373     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
10374     proto_tree_add_text(tree, asn1->tvb,
10375         saved_offset, asn1->offset - saved_offset,
10376         "%s :  15 digits, %s",
10377         bigbuf, str);
10378
10379     switch ((value & 0x40) >> 6)
10380     {
10381     case 0x00: str = "Trigger is not active"; break;
10382     default:
10383         str = "Execute local SPINI procedures for any call attempt with 14 digits";
10384         break;
10385     }
10386
10387     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
10388     proto_tree_add_text(tree, asn1->tvb,
10389         saved_offset, asn1->offset - saved_offset,
10390         "%s :  14 digits, %s",
10391         bigbuf, str);
10392
10393     switch ((value & 0x20) >> 5)
10394     {
10395     case 0x00: str = "Trigger is not active"; break;
10396     default:
10397         str = "Execute local SPINI procedures for any call attempt with 13 digits";
10398         break;
10399     }
10400
10401     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
10402     proto_tree_add_text(tree, asn1->tvb,
10403         saved_offset, asn1->offset - saved_offset,
10404         "%s :  13 digits, %s",
10405         bigbuf, str);
10406
10407     switch ((value & 0x10) >> 4)
10408     {
10409     case 0x00: str = "Trigger is not active"; break;
10410     default:
10411         str = "Execute local SPINI procedures for any call attempt with 12 digits";
10412         break;
10413     }
10414
10415     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
10416     proto_tree_add_text(tree, asn1->tvb,
10417         saved_offset, asn1->offset - saved_offset,
10418         "%s :  12 digits, %s",
10419         bigbuf, str);
10420
10421     switch ((value & 0x08) >> 3)
10422     {
10423     case 0x00: str = "Trigger is not active"; break;
10424     default:
10425         str = "Execute local SPINI procedures for any call attempt with 11 digits";
10426         break;
10427     }
10428
10429     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
10430     proto_tree_add_text(tree, asn1->tvb,
10431         saved_offset, asn1->offset - saved_offset,
10432         "%s :  11 digits, %s",
10433         bigbuf, str);
10434
10435     switch ((value & 0x04) >> 2)
10436     {
10437     case 0x00: str = "Trigger is not active"; break;
10438     default:
10439         str = "Execute local SPINI procedures for any call attempt with 10 digits";
10440         break;
10441     }
10442
10443     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
10444     proto_tree_add_text(tree, asn1->tvb,
10445         saved_offset, asn1->offset - saved_offset,
10446         "%s :  10 digits, %s",
10447         bigbuf, str);
10448
10449     switch ((value & 0x02) >> 1)
10450     {
10451     case 0x00: str = "Trigger is not active"; break;
10452     default:
10453         str = "Execute local SPINI procedures for any call attempt with 9 digits";
10454         break;
10455     }
10456
10457     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
10458     proto_tree_add_text(tree, asn1->tvb,
10459         saved_offset, asn1->offset - saved_offset,
10460         "%s :  9 digits, %s",
10461         bigbuf, str);
10462
10463     switch (value & 0x01)
10464     {
10465     case 0x00: str = "Trigger is not active"; break;
10466     default:
10467         str = "Execute local SPINI procedures for any call attempt with 8 digits";
10468         break;
10469     }
10470
10471     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
10472     proto_tree_add_text(tree, asn1->tvb,
10473         saved_offset, asn1->offset - saved_offset,
10474         "%s :  8 digits, %s",
10475         bigbuf, str);
10476
10477     EXTRANEOUS_DATA_CHECK(len, 4);
10478 }
10479
10480 static void
10481 param_orig_trig(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
10482 {
10483     gint32 value;
10484     guint saved_offset;
10485     const gchar *str = NULL;
10486
10487     SHORT_DATA_CHECK(len, 4);
10488
10489     saved_offset = asn1->offset;
10490
10491     asn1_int32_value_decode(asn1, 1, &value);
10492
10493     switch ((value & 0x80) >> 7)
10494     {
10495     case 0x00: str = "Trigger is not active"; break;
10496     default:
10497         str = "Launch an Origination Request for any Revertive Call attempt"; break;
10498         break;
10499     }
10500
10501     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
10502     proto_tree_add_text(tree, asn1->tvb,
10503         saved_offset, asn1->offset - saved_offset,
10504         "%s :  Revertive Call (RvtC), %s",
10505         bigbuf, str);
10506
10507     switch ((value & 0x40) >> 6)
10508     {
10509     case 0x00: str = "Trigger is not active"; break;
10510     default:
10511         str = "Launch an Origination Request for any call attempt to an unrecognized number"; break;
10512         break;
10513     }
10514
10515     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
10516     proto_tree_add_text(tree, asn1->tvb,
10517         saved_offset, asn1->offset - saved_offset,
10518         "%s :  Unrecognized Number (Unrec), %s",
10519         bigbuf, str);
10520
10521     switch ((value & 0x20) >> 5)
10522     {
10523     case 0x00: str = "Trigger is not active"; break;
10524     default:
10525         str = "Launch an Origination Request for any call attempt outside of the current World Zone (as defined in ITU-T Rec. E.164)";
10526         break;
10527     }
10528
10529     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
10530     proto_tree_add_text(tree, asn1->tvb,
10531         saved_offset, asn1->offset - saved_offset,
10532         "%s :  World Zone (WZ), %s",
10533         bigbuf, str);
10534
10535     switch ((value & 0x10) >> 4)
10536     {
10537     case 0x00: str = "Trigger is not active"; break;
10538     default:
10539         str = "Launch an Origination Request for any international call attempt";
10540         break;
10541     }
10542
10543     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
10544     proto_tree_add_text(tree, asn1->tvb,
10545         saved_offset, asn1->offset - saved_offset,
10546         "%s :  International (Intl), %s",
10547         bigbuf, str);
10548
10549     switch ((value & 0x08) >> 3)
10550     {
10551     case 0x00: str = "Trigger is not active"; break;
10552     default:
10553         str = "Launch an Origination Request for any toll calls outside the local carrier's serving area";
10554         break;
10555     }
10556
10557     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
10558     proto_tree_add_text(tree, asn1->tvb,
10559         saved_offset, asn1->offset - saved_offset,
10560         "%s :  Non-Local (Inter-LATA) Toll (NLTOLL/OLATA), %s",
10561         bigbuf, str);
10562
10563     switch ((value & 0x04) >> 2)
10564     {
10565     case 0x00: str = "Trigger is not active"; break;
10566     default:
10567         str = "Launch an Origination Request for any local toll call attempt.  Refers to intra-LATA toll within the NANP";
10568         break;
10569     }
10570
10571     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
10572     proto_tree_add_text(tree, asn1->tvb,
10573         saved_offset, asn1->offset - saved_offset,
10574         "%s :  Local (Intra-LATA) Toll (LTOLL/ILATA), %s",
10575         bigbuf, str);
10576
10577     switch ((value & 0x02) >> 1)
10578     {
10579     case 0x00: str = "Trigger is not active"; break;
10580     default:
10581         str = "Launch an Origination Request for any local call attempt";
10582         break;
10583     }
10584
10585     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
10586     proto_tree_add_text(tree, asn1->tvb,
10587         saved_offset, asn1->offset - saved_offset,
10588         "%s :  Local, %s",
10589         bigbuf, str);
10590
10591     switch (value & 0x01)
10592     {
10593     case 0x00: str = "Trigger is not active"; break;
10594     default:
10595         str = "Launch an Origination Request for any call attempt. This overrides all other values.";
10596         break;
10597     }
10598
10599     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
10600     proto_tree_add_text(tree, asn1->tvb,
10601         saved_offset, asn1->offset - saved_offset,
10602         "%s :  All Origination (All), %s",
10603         bigbuf, str);
10604
10605     saved_offset = asn1->offset;
10606
10607     asn1_int32_value_decode(asn1, 1, &value);
10608
10609     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
10610     proto_tree_add_text(tree, asn1->tvb,
10611         saved_offset, asn1->offset - saved_offset,
10612         "%s :  Reserved",
10613         bigbuf);
10614
10615     switch ((value & 0x10) >> 4)
10616     {
10617     case 0x00: str = "Trigger is not active"; break;
10618     default:
10619         str = "Launch an Origination Request for any number matching a criteria of a prior agreement";
10620         break;
10621     }
10622
10623     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
10624     proto_tree_add_text(tree, asn1->tvb,
10625         saved_offset, asn1->offset - saved_offset,
10626         "%s :  Prior Agreement (PA), %s",
10627         bigbuf, str);
10628
10629     switch ((value & 0x08) >> 3)
10630     {
10631     case 0x00: str = "Trigger is not active"; break;
10632     default:
10633         str = "Launch an Origination Request for any number beginning with two Pound ## digits";
10634         break;
10635     }
10636
10637     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
10638     proto_tree_add_text(tree, asn1->tvb,
10639         saved_offset, asn1->offset - saved_offset,
10640         "%s :  Double Pound (DP), %s",
10641         bigbuf, str);
10642
10643     switch ((value & 0x04) >> 2)
10644     {
10645     case 0x00: str = "Trigger is not active"; break;
10646     default:
10647         str = "Launch an Origination Request for any number beginning with a Pound # digit";
10648         break;
10649     }
10650
10651     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
10652     proto_tree_add_text(tree, asn1->tvb,
10653         saved_offset, asn1->offset - saved_offset,
10654         "%s :  Pound, %s",
10655         bigbuf, str);
10656
10657     switch ((value & 0x02) >> 1)
10658     {
10659     case 0x00: str = "Trigger is not active"; break;
10660     default:
10661         str = "Launch an Origination Request for any number beginning with two Star ** digits";
10662         break;
10663     }
10664
10665     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
10666     proto_tree_add_text(tree, asn1->tvb,
10667         saved_offset, asn1->offset - saved_offset,
10668         "%s :  Double Star (DS), %s",
10669         bigbuf, str);
10670
10671     switch (value & 0x01)
10672     {
10673     case 0x00: str = "Trigger is not active"; break;
10674     default:
10675         str = "Launch an Origination Request for any number beginning with a Star * digit";
10676         break;
10677     }
10678
10679     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
10680     proto_tree_add_text(tree, asn1->tvb,
10681         saved_offset, asn1->offset - saved_offset,
10682         "%s :  Star, %s",
10683         bigbuf, str);
10684
10685     saved_offset = asn1->offset;
10686
10687     asn1_int32_value_decode(asn1, 1, &value);
10688
10689     switch ((value & 0x80) >> 7)
10690     {
10691     case 0x00: str = "Trigger is not active"; break;
10692     default:
10693         str = "Launch an Origination Request for any call attempt with 7 digits";
10694         break;
10695     }
10696
10697     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
10698     proto_tree_add_text(tree, asn1->tvb,
10699         saved_offset, asn1->offset - saved_offset,
10700         "%s :  7 digits, %s",
10701         bigbuf, str);
10702
10703     switch ((value & 0x40) >> 6)
10704     {
10705     case 0x00: str = "Trigger is not active"; break;
10706     default:
10707         str = "Launch an Origination Request for any call attempt with 6 digits";
10708         break;
10709     }
10710
10711     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
10712     proto_tree_add_text(tree, asn1->tvb,
10713         saved_offset, asn1->offset - saved_offset,
10714         "%s :  6 digits, %s",
10715         bigbuf, str);
10716
10717     switch ((value & 0x20) >> 5)
10718     {
10719     case 0x00: str = "Trigger is not active"; break;
10720     default:
10721         str = "Launch an Origination Request for any call attempt with 5 digits";
10722         break;
10723     }
10724
10725     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
10726     proto_tree_add_text(tree, asn1->tvb,
10727         saved_offset, asn1->offset - saved_offset,
10728         "%s :  5 digits, %s",
10729         bigbuf, str);
10730
10731     switch ((value & 0x10) >> 4)
10732     {
10733     case 0x00: str = "Trigger is not active"; break;
10734     default:
10735         str = "Launch an Origination Request for any call attempt with 4 digits";
10736         break;
10737     }
10738
10739     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
10740     proto_tree_add_text(tree, asn1->tvb,
10741         saved_offset, asn1->offset - saved_offset,
10742         "%s :  4 digits, %s",
10743         bigbuf, str);
10744
10745     switch ((value & 0x08) >> 3)
10746     {
10747     case 0x00: str = "Trigger is not active"; break;
10748     default:
10749         str = "Launch an Origination Request for any call attempt with 3 digits";
10750         break;
10751     }
10752
10753     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
10754     proto_tree_add_text(tree, asn1->tvb,
10755         saved_offset, asn1->offset - saved_offset,
10756         "%s :  3 digits, %s",
10757         bigbuf, str);
10758
10759     switch ((value & 0x04) >> 2)
10760     {
10761     case 0x00: str = "Trigger is not active"; break;
10762     default:
10763         str = "Launch an Origination Request for any call attempt with 2 digits";
10764         break;
10765     }
10766
10767     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
10768     proto_tree_add_text(tree, asn1->tvb,
10769         saved_offset, asn1->offset - saved_offset,
10770         "%s :  2 digits, %s",
10771         bigbuf, str);
10772
10773     switch ((value & 0x02) >> 1)
10774     {
10775     case 0x00: str = "Trigger is not active"; break;
10776     default:
10777         str = "Launch an Origination Request for any call attempt with 1 digits";
10778         break;
10779     }
10780
10781     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
10782     proto_tree_add_text(tree, asn1->tvb,
10783         saved_offset, asn1->offset - saved_offset,
10784         "%s :  1 digits, %s",
10785         bigbuf, str);
10786
10787     switch (value & 0x01)
10788     {
10789     case 0x00: str = "Trigger is not active"; break;
10790     default:
10791         str = "Launch an Origination Request for any call attempt with no digits";
10792         break;
10793     }
10794
10795     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
10796     proto_tree_add_text(tree, asn1->tvb,
10797         saved_offset, asn1->offset - saved_offset,
10798         "%s :  No digits, %s",
10799         bigbuf, str);
10800
10801     saved_offset = asn1->offset;
10802
10803     asn1_int32_value_decode(asn1, 1, &value);
10804
10805     switch ((value & 0x80) >> 7)
10806     {
10807     case 0x00: str = "Trigger is not active"; break;
10808     default:
10809         str = "Launch an Origination Request for any call attempt with 15 or more digits";
10810         break;
10811     }
10812
10813     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
10814     proto_tree_add_text(tree, asn1->tvb,
10815         saved_offset, asn1->offset - saved_offset,
10816         "%s :  15 digits, %s",
10817         bigbuf, str);
10818
10819     switch ((value & 0x40) >> 6)
10820     {
10821     case 0x00: str = "Trigger is not active"; break;
10822     default:
10823         str = "Launch an Origination Request for any call attempt with 14 digits";
10824         break;
10825     }
10826
10827     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
10828     proto_tree_add_text(tree, asn1->tvb,
10829         saved_offset, asn1->offset - saved_offset,
10830         "%s :  14 digits, %s",
10831         bigbuf, str);
10832
10833     switch ((value & 0x20) >> 5)
10834     {
10835     case 0x00: str = "Trigger is not active"; break;
10836     default:
10837         str = "Launch an Origination Request for any call attempt with 13 digits";
10838         break;
10839     }
10840
10841     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
10842     proto_tree_add_text(tree, asn1->tvb,
10843         saved_offset, asn1->offset - saved_offset,
10844         "%s :  13 digits, %s",
10845         bigbuf, str);
10846
10847     switch ((value & 0x10) >> 4)
10848     {
10849     case 0x00: str = "Trigger is not active"; break;
10850     default:
10851         str = "Launch an Origination Request for any call attempt with 12 digits";
10852         break;
10853     }
10854
10855     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
10856     proto_tree_add_text(tree, asn1->tvb,
10857         saved_offset, asn1->offset - saved_offset,
10858         "%s :  12 digits, %s",
10859         bigbuf, str);
10860
10861     switch ((value & 0x08) >> 3)
10862     {
10863     case 0x00: str = "Trigger is not active"; break;
10864     default:
10865         str = "Launch an Origination Request for any call attempt with 11 digits";
10866         break;
10867     }
10868
10869     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
10870     proto_tree_add_text(tree, asn1->tvb,
10871         saved_offset, asn1->offset - saved_offset,
10872         "%s :  11 digits, %s",
10873         bigbuf, str);
10874
10875     switch ((value & 0x04) >> 2)
10876     {
10877     case 0x00: str = "Trigger is not active"; break;
10878     default:
10879         str = "Launch an Origination Request for any call attempt with 10 digits";
10880         break;
10881     }
10882
10883     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
10884     proto_tree_add_text(tree, asn1->tvb,
10885         saved_offset, asn1->offset - saved_offset,
10886         "%s :  10 digits, %s",
10887         bigbuf, str);
10888
10889     switch ((value & 0x02) >> 1)
10890     {
10891     case 0x00: str = "Trigger is not active"; break;
10892     default:
10893         str = "Launch an Origination Request for any call attempt with 9 digits";
10894         break;
10895     }
10896
10897     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
10898     proto_tree_add_text(tree, asn1->tvb,
10899         saved_offset, asn1->offset - saved_offset,
10900         "%s :  9 digits, %s",
10901         bigbuf, str);
10902
10903     switch (value & 0x01)
10904     {
10905     case 0x00: str = "Trigger is not active"; break;
10906     default:
10907         str = "Launch an Origination Request for any call attempt with 8 digits";
10908         break;
10909     }
10910
10911     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
10912     proto_tree_add_text(tree, asn1->tvb,
10913         saved_offset, asn1->offset - saved_offset,
10914         "%s :  8 digits, %s",
10915         bigbuf, str);
10916
10917     EXTRANEOUS_DATA_CHECK(len, 4);
10918 }
10919
10920 static void
10921 param_trig_cap(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
10922 {
10923     gint32 value;
10924     guint saved_offset;
10925     const gchar *str = NULL;
10926
10927     saved_offset = asn1->offset;
10928
10929     asn1_int32_value_decode(asn1, 1, &value);
10930
10931     switch ((value & 0x80) >> 7)
10932     {
10933     case 0x00: str = "O No Answer (ONA) cannot be armed"; break;
10934     default:
10935         str = "O No Answer (ONA) can be armed";
10936         break;
10937     }
10938
10939     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
10940     proto_tree_add_text(tree, asn1->tvb,
10941         saved_offset, asn1->offset - saved_offset,
10942         "%s :  %s",
10943         bigbuf, str);
10944
10945     switch ((value & 0x40) >> 6)
10946     {
10947     case 0x00: str = "O Disconnect (ODISC) cannot be armed"; break;
10948     default:
10949         str = "O Disconnect (ODISC) can be armed";
10950         break;
10951     }
10952
10953     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
10954     proto_tree_add_text(tree, asn1->tvb,
10955         saved_offset, asn1->offset - saved_offset,
10956         "%s :  %s",
10957         bigbuf, str);
10958
10959     switch ((value & 0x20) >> 5)
10960     {
10961     case 0x00: str = "O Answer (OANS) cannot be armed"; break;
10962     default:
10963         str = "O Answer (OANS) can be armed";
10964         break;
10965     }
10966
10967     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
10968     proto_tree_add_text(tree, asn1->tvb,
10969         saved_offset, asn1->offset - saved_offset,
10970         "%s :  %s",
10971         bigbuf, str);
10972
10973     switch ((value & 0x10) >> 4)
10974     {
10975     case 0x00: str = "Origination Attempt Authorized (OAA) cannot be armed"; break;
10976     default:
10977         str = "Origination Attempt Authorized (OAA) can be armed";
10978         break;
10979     }
10980
10981     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
10982     proto_tree_add_text(tree, asn1->tvb,
10983         saved_offset, asn1->offset - saved_offset,
10984         "%s :  %s",
10985         bigbuf, str);
10986
10987     switch ((value & 0x08) >> 3)
10988     {
10989     case 0x00: str = "Revertive Call trigger (RvtC) cannot be armed"; break;
10990     default:
10991         str = "Revertive Call trigger (RvtC) can be armed";
10992         break;
10993     }
10994
10995     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
10996     proto_tree_add_text(tree, asn1->tvb,
10997         saved_offset, asn1->offset - saved_offset,
10998         "%s :  %s",
10999         bigbuf, str);
11000
11001     switch ((value & 0x04) >> 2)
11002     {
11003     case 0x00: str = "All Calls trigger (All) cannot be armed"; break;
11004     default:
11005         str = "All Calls trigger (All) can be armed";
11006         break;
11007     }
11008
11009     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
11010     proto_tree_add_text(tree, asn1->tvb,
11011         saved_offset, asn1->offset - saved_offset,
11012         "%s :  %s",
11013         bigbuf, str);
11014
11015     switch ((value & 0x02) >> 1)
11016     {
11017     case 0x00: str = "K-digit triggers (K-digit) cannot be armed"; break;
11018     default:
11019         str = "K-digit triggers (K-digit) can be armed";
11020         break;
11021     }
11022
11023     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
11024     proto_tree_add_text(tree, asn1->tvb,
11025         saved_offset, asn1->offset - saved_offset,
11026         "%s :  %s",
11027         bigbuf, str);
11028
11029     switch (value & 0x01)
11030     {
11031     case 0x00: str = "Introducing Star/Pound triggers (INIT) cannot be armed"; break;
11032     default:
11033         str = "Introducing Star/Pound triggers (INIT) can be armed";
11034         break;
11035     }
11036
11037     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
11038     proto_tree_add_text(tree, asn1->tvb,
11039         saved_offset, asn1->offset - saved_offset,
11040         "%s :  %s",
11041         bigbuf, str);
11042
11043     if (len == 1) return;
11044
11045     saved_offset = asn1->offset;
11046
11047     asn1_int32_value_decode(asn1, 1, &value);
11048
11049     switch ((value & 0x80) >> 7)
11050     {
11051     case 0x00: str = "O Called Party Busy (OBSY) cannot be armed"; break;
11052     default:
11053         str = "O Called Party Busy (OBSY) can be armed";
11054         break;
11055     }
11056
11057     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
11058     proto_tree_add_text(tree, asn1->tvb,
11059         saved_offset, asn1->offset - saved_offset,
11060         "%s :  %s",
11061         bigbuf, str);
11062
11063     switch ((value & 0x40) >> 6)
11064     {
11065     case 0x00: str = "Called Routing Address Available (CdRAA) cannot be armed"; break;
11066     default:
11067         str = "Called Routing Address Available (CdRAA) can be armed";
11068         break;
11069     }
11070
11071     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
11072     proto_tree_add_text(tree, asn1->tvb,
11073         saved_offset, asn1->offset - saved_offset,
11074         "%s :  %s",
11075         bigbuf, str);
11076
11077     switch ((value & 0x20) >> 5)
11078     {
11079     case 0x00: str = "Initial Termination (IT) cannot be armed"; break;
11080     default:
11081         str = "Initial Termination (IT) can be armed";
11082         break;
11083     }
11084
11085     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
11086     proto_tree_add_text(tree, asn1->tvb,
11087         saved_offset, asn1->offset - saved_offset,
11088         "%s :  %s",
11089         bigbuf, str);
11090
11091     switch ((value & 0x10) >> 4)
11092     {
11093     case 0x00: str = "Calling Routing Address Available (CgRAA) cannot be armed"; break;
11094     default:
11095         str = "Calling Routing Address Available (CgRAA) can be armed";
11096         break;
11097     }
11098
11099     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
11100     proto_tree_add_text(tree, asn1->tvb,
11101         saved_offset, asn1->offset - saved_offset,
11102         "%s :  %s",
11103         bigbuf, str);
11104
11105     switch ((value & 0x08) >> 3)
11106     {
11107     case 0x00: str = "Advanced Termination trigger (AT) cannot be armed"; break;
11108     default:
11109         str = "Advanced Termination trigger (AT) can be armed";
11110         break;
11111     }
11112
11113     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
11114     proto_tree_add_text(tree, asn1->tvb,
11115         saved_offset, asn1->offset - saved_offset,
11116         "%s :  %s",
11117         bigbuf, str);
11118
11119     switch ((value & 0x04) >> 2)
11120     {
11121     case 0x00: str = "Prior Agreement trigger (PA) cannot be armed"; break;
11122     default:
11123         str = "Prior Agreement trigger (PA) can be armed";
11124         break;
11125     }
11126
11127     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
11128     proto_tree_add_text(tree, asn1->tvb,
11129         saved_offset, asn1->offset - saved_offset,
11130         "%s :  %s",
11131         bigbuf, str);
11132
11133     switch ((value & 0x02) >> 1)
11134     {
11135     case 0x00: str = "Unrecognized Number trigger (Unrec) cannot be armed"; break;
11136     default:
11137         str = "Unrecognized Number trigger (Unrec) can be armed";
11138         break;
11139     }
11140
11141     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
11142     proto_tree_add_text(tree, asn1->tvb,
11143         saved_offset, asn1->offset - saved_offset,
11144         "%s :  %s",
11145         bigbuf, str);
11146
11147     switch (value & 0x01)
11148     {
11149     case 0x00: str = "Call Type triggers (CT) cannot be armed"; break;
11150     default:
11151         str = "Call Type triggers (CT) can be armed";
11152         break;
11153     }
11154
11155     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
11156     proto_tree_add_text(tree, asn1->tvb,
11157         saved_offset, asn1->offset - saved_offset,
11158         "%s :  %s",
11159         bigbuf, str);
11160
11161     if (len == 2) return;
11162
11163     saved_offset = asn1->offset;
11164
11165     asn1_int32_value_decode(asn1, 1, &value);
11166
11167     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
11168     proto_tree_add_text(tree, asn1->tvb,
11169         saved_offset, asn1->offset - saved_offset,
11170         "%s :  Reserved",
11171         bigbuf);
11172
11173     switch ((value & 0x10) >> 4)
11174     {
11175     case 0x00: str = "T Disconnect (TDISC) cannot be armed"; break;
11176     default:
11177         str = "T Disconnect (TDISC) can be armed";
11178         break;
11179     }
11180
11181     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
11182     proto_tree_add_text(tree, asn1->tvb,
11183         saved_offset, asn1->offset - saved_offset,
11184         "%s :  %s",
11185         bigbuf, str);
11186
11187     switch ((value & 0x08) >> 3)
11188     {
11189     case 0x00: str = "T Answer (TANS) cannot be armed"; break;
11190     default:
11191         str = "T Answer (TANS) can be armed";
11192         break;
11193     }
11194
11195     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
11196     proto_tree_add_text(tree, asn1->tvb,
11197         saved_offset, asn1->offset - saved_offset,
11198         "%s :  %s",
11199         bigbuf, str);
11200
11201     switch ((value & 0x04) >> 2)
11202     {
11203     case 0x00: str = "T No Answer trigger (TNA) cannot be armed"; break;
11204     default:
11205         str = "T No Answer trigger (TNA) can be armed";
11206         break;
11207     }
11208
11209     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
11210     proto_tree_add_text(tree, asn1->tvb,
11211         saved_offset, asn1->offset - saved_offset,
11212         "%s :  %s",
11213         bigbuf, str);
11214
11215     switch ((value & 0x02) >> 1)
11216     {
11217     case 0x00: str = "T Busy trigger (TBusy) cannot be armed"; break;
11218     default:
11219         str = "T Busy trigger (TBusy) can be armed";
11220         break;
11221     }
11222
11223     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
11224     proto_tree_add_text(tree, asn1->tvb,
11225         saved_offset, asn1->offset - saved_offset,
11226         "%s :  %s",
11227         bigbuf, str);
11228
11229     switch (value & 0x01)
11230     {
11231     case 0x00: str = "Terminating Resource Available triggers (TRA) cannot be armed"; break;
11232     default:
11233         str = "Terminating Resource Available triggers (TRA) can be armed";
11234         break;
11235     }
11236
11237     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
11238     proto_tree_add_text(tree, asn1->tvb,
11239         saved_offset, asn1->offset - saved_offset,
11240         "%s :  %s",
11241         bigbuf, str);
11242
11243     EXTRANEOUS_DATA_CHECK(len, 3);
11244 }
11245
11246 static void
11247 param_sys_cap(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
11248 {
11249     gint32 value;
11250     guint saved_offset;
11251     const gchar *str = NULL;
11252
11253     EXACT_DATA_CHECK(len, 1);
11254
11255     saved_offset = asn1->offset;
11256
11257     asn1_int32_value_decode(asn1, 1, &value);
11258
11259     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
11260     proto_tree_add_text(tree, asn1->tvb,
11261         saved_offset, asn1->offset - saved_offset,
11262         "%s :  Reserved",
11263         bigbuf);
11264
11265     switch ((value & 0x20) >> 5)
11266     {
11267     case 0x00: str = "DP is not supported by the system"; break;
11268     default:
11269         str = "DP is supported by the system";
11270         break;
11271     }
11272
11273     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
11274     proto_tree_add_text(tree, asn1->tvb,
11275         saved_offset, asn1->offset - saved_offset,
11276         "%s :  %s",
11277         bigbuf, str);
11278
11279     switch ((value & 0x10) >> 4)
11280     {
11281     case 0x00: str = "SSD is not shared with the system for the indicated MS"; break;
11282     default:
11283         str = "SSD is shared with the system for the indicated MS";
11284         break;
11285     }
11286
11287     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
11288     proto_tree_add_text(tree, asn1->tvb,
11289         saved_offset, asn1->offset - saved_offset,
11290         "%s :  %s",
11291         bigbuf, str);
11292
11293     switch ((value & 0x08) >> 3)
11294     {
11295     case 0x00: str = "System cannot execute CAVE algorithm"; break;
11296     default:
11297         str = "System can execute CAVE algorithm";
11298         break;
11299     }
11300
11301     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
11302     proto_tree_add_text(tree, asn1->tvb,
11303         saved_offset, asn1->offset - saved_offset,
11304         "%s :  %s",
11305         bigbuf, str);
11306
11307     switch ((value & 0x04) >> 2)
11308     {
11309     case 0x00: str = "Voice Privacy is not supported"; break;
11310     default:
11311         str = "Voice Privacy is supported";
11312         break;
11313     }
11314
11315     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
11316     proto_tree_add_text(tree, asn1->tvb,
11317         saved_offset, asn1->offset - saved_offset,
11318         "%s :  %s",
11319         bigbuf, str);
11320
11321     switch ((value & 0x02) >> 1)
11322     {
11323     case 0x00: str = "SME is not supported"; break;
11324     default:
11325         str = "SME is supported";
11326         break;
11327     }
11328
11329     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
11330     proto_tree_add_text(tree, asn1->tvb,
11331         saved_offset, asn1->offset - saved_offset,
11332         "%s :  %s",
11333         bigbuf, str);
11334
11335     switch (value & 0x01)
11336     {
11337     case 0x00: str = "Authentication parameters were not requested"; break;
11338     default:
11339         str = "Authentication parameters were requested";
11340         break;
11341     }
11342
11343     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
11344     proto_tree_add_text(tree, asn1->tvb,
11345         saved_offset, asn1->offset - saved_offset,
11346         "%s :  %s",
11347         bigbuf, str);
11348 }
11349
11350 static void
11351 param_act_code(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
11352 {
11353     gint32 value;
11354     guint saved_offset;
11355     const gchar *str = NULL;
11356
11357     saved_offset = asn1->offset;
11358
11359     asn1_int32_value_decode(asn1, 1, &value);
11360
11361     switch (value)
11362     {
11363     case 0: str = "Not used"; break;
11364     case 1: str = "Continue processing"; break;
11365     case 2: str = "Disconnect call"; break;
11366     case 3: str = "Disconnect call leg"; break;
11367     case 4: str = "Conference calling drop last party"; break;
11368     case 5: str = "Bridge call leg(s) to conference call"; break;
11369     case 6: str = "Drop call leg on busy or routing failure"; break;
11370     case 7: str = "Disconnect all call legs"; break;
11371     case 8: str = "Attach MSC to OTAF"; break;
11372     case 9: str = "Initiate Registration Notification"; break;
11373     case 10: str = "Generate Public Encryption values"; break;
11374     case 11: str = "Generate A-Key"; break;
11375     case 12: str = "Perform SSD Update procedure"; break;
11376     case 13: str = "Perform Re-authentication procedure"; break;
11377     case 14: str = "Release TRN"; break;
11378     case 15: str = "Commit A-key"; break;
11379     case 16: str = "Release Resources"; break;
11380     case 17: str = "Record NEWMSID"; break;
11381     case 18: str = "Allocate Resources"; break;
11382     case 19: str = "Generate Authentication Signature"; break;
11383     case 20: str = "Release leg and redirect subscriber"; break;
11384     case 21: str = "Do Not Wait For MS User Level Response"; break;
11385     default:
11386         if ((value >= 22) && (value <= 95)) { str = "Reserved, treat as Continue processing"; }
11387         if ((value >= 96) && (value <= 127)) { str = "Reserved for protocol extension, treat as Continue processing"; }
11388         if ((value >= 128) && (value <= 223)) { str = "Reserved, treat as Disconnect call"; }
11389         else { str = "Reserved for protocol extension, treat as Disconnect call"; }
11390         break;
11391     }
11392
11393     proto_tree_add_text(tree, asn1->tvb,
11394         saved_offset, asn1->offset - saved_offset,
11395         "Action Code, %s (%u)",
11396         str,
11397         value);
11398
11399     EXTRANEOUS_DATA_CHECK(len, 1);
11400 }
11401
11402 static void
11403 param_border_acc(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
11404 {
11405     gint32 value;
11406     guint saved_offset;
11407     const gchar *str = NULL;
11408
11409     EXACT_DATA_CHECK(len, 1);
11410
11411     saved_offset = asn1->offset;
11412
11413     asn1_int32_value_decode(asn1, 1, &value);
11414
11415     switch (value)
11416     {
11417     case 0: str = "Not used"; break;
11418     case 1: str = "Border Cell Access"; break;
11419     default:
11420         if ((value >= 2) && (value <= 223)) { str = "Reserved, treat as Border Cell Access"; }
11421         else { str = "Reserved for protocol extension, treat as Border Cell Access"; }
11422         break;
11423     }
11424
11425     proto_tree_add_text(tree, asn1->tvb,
11426         saved_offset, asn1->offset - saved_offset,
11427         "Indication, %s (%u)",
11428         str,
11429         value);
11430 }
11431
11432 static void
11433 param_avail_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
11434 {
11435     gint32 value;
11436     guint saved_offset;
11437     const gchar *str = NULL;
11438
11439     saved_offset = asn1->offset;
11440
11441     asn1_int32_value_decode(asn1, 1, &value);
11442
11443     switch (value)
11444     {
11445     case 0: str = "Not used"; break;
11446     case 1: str = "Unspecified MS inactivity type"; break;
11447     default:
11448         if ((value >= 2) && (value <= 223)) { str = "Reserved, treat as Unspecified"; }
11449         else { str = "Reserved for protocol extension, treat as Unspecified"; }
11450         break;
11451     }
11452
11453     proto_tree_add_text(tree, asn1->tvb,
11454         saved_offset, asn1->offset - saved_offset,
11455         str);
11456
11457     EXTRANEOUS_DATA_CHECK(len, 1);
11458 }
11459
11460 static void
11461 param_can_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
11462 {
11463     gint32 value;
11464     guint saved_offset;
11465     const gchar *str = NULL;
11466
11467     saved_offset = asn1->offset;
11468
11469     asn1_int32_value_decode(asn1, 1, &value);
11470
11471     switch (value)
11472     {
11473     case 0: str = "Not used"; break;
11474     case 1: str = "Serving System Option.  The serving system may discontinue a call or service in progress at its option."; break;
11475     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;
11476     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;
11477     default:
11478         if ((value >= 4) && (value <= 223)) { str = "Reserved, treat as Serving System Option"; }
11479         else { str = "Reserved for protocol extension, treat as Serving System Option"; }
11480         break;
11481     }
11482
11483     proto_tree_add_text(tree, asn1->tvb,
11484         saved_offset, asn1->offset - saved_offset,
11485         str);
11486
11487     EXTRANEOUS_DATA_CHECK(len, 1);
11488 }
11489
11490 static void
11491 param_can_den(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
11492 {
11493     gint32 value;
11494     guint saved_offset;
11495     const gchar *str = NULL;
11496
11497     EXACT_DATA_CHECK(len, 1);
11498
11499     saved_offset = asn1->offset;
11500
11501     asn1_int32_value_decode(asn1, 1, &value);
11502
11503     switch (value)
11504     {
11505     case 0: str = "Not used"; break;
11506     case 1: str = "Multiple Access"; break;
11507     case 2: str = "Busy"; break;
11508     default:
11509         if ((value >= 3) && (value <= 223)) { str = "Reserved, treat as Multiple Access"; }
11510         else { str = "Reserved for protocol extension, treat as Multiple Access"; }
11511         break;
11512     }
11513
11514     proto_tree_add_text(tree, asn1->tvb,
11515         saved_offset, asn1->offset - saved_offset,
11516         "Indication, %s (%u)",
11517         str,
11518         value);
11519 }
11520
11521 static void
11522 param_acc_den(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
11523 {
11524     gint32 value;
11525     guint saved_offset;
11526     const gchar *str = NULL;
11527
11528     EXACT_DATA_CHECK(len, 1);
11529
11530     saved_offset = asn1->offset;
11531
11532     asn1_int32_value_decode(asn1, 1, &value);
11533
11534     switch (value)
11535     {
11536     case 0: str = "Not used"; break;
11537     case 1: str = "Unassigned directory number"; break;
11538     case 2: str = "Inactive"; break;
11539     case 3: str = "Busy"; break;
11540     case 4: str = "Termination denied"; break;
11541     case 5: str = "No Page response"; break;
11542     case 6: str = "Unavailable"; break;
11543     case 7: str = "Service Rejected by MS"; break;
11544     case 8: str = "Service Rejected by the System"; break;
11545     case 9: str = "Service Type Mismatch"; break;
11546     case 10: str = "Service Denied"; break;
11547     case 11: str = "Call Rejected"; break;
11548     default:
11549         if ((value >= 12) && (value <= 223)) { str = "Reserved, treat as Termination denied"; }
11550         else { str = "Reserved for protocol extension, treat as Termination denied"; }
11551         break;
11552     }
11553
11554     proto_tree_add_text(tree, asn1->tvb,
11555         saved_offset, asn1->offset - saved_offset,
11556         "Access Denied Reason, %s (%u)",
11557         str,
11558         value);
11559 }
11560
11561 static void
11562 param_sms_acc_den_reason(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
11563 {
11564     gint32 value;
11565     guint saved_offset;
11566     const gchar *str = NULL;
11567
11568     saved_offset = asn1->offset;
11569
11570     asn1_int32_value_decode(asn1, 1, &value);
11571
11572     switch (value)
11573     {
11574     case 0: str = "Not used"; break;
11575     case 1: str = "Denied"; break;
11576     case 2: str = "Postponed"; break;
11577     case 3: str = "Unavailable"; break;
11578     case 4: str = "Invalid"; break;
11579     default:
11580         if ((value >= 5) && (value <= 63)) { str = "Reserved, treat as Denied"; }
11581         else if ((value >= 64) && (value <= 127)) { str = "Reserved, treat as Postponed"; }
11582         else if ((value >= 128) && (value <= 223)) { str = "Reserved, treat as Unavailable"; }
11583         else { str = "Reserved for protocol extension, treat as Unavailable"; }
11584         break;
11585     }
11586
11587     proto_tree_add_text(tree, asn1->tvb,
11588         saved_offset, asn1->offset - saved_offset,
11589         "Access Denied Reason, %s (%u)",
11590         str,
11591         value);
11592
11593     EXTRANEOUS_DATA_CHECK(len, 1);
11594 }
11595
11596 static void
11597 param_sms_bd(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
11598 {
11599
11600     bd_tvb = tvb_new_subset(asn1->tvb, asn1->offset, len, len);
11601
11602     proto_tree_add_text(tree, asn1->tvb,
11603         asn1->offset, len,
11604         "Parameter Data");
11605
11606     asn1->offset += len;
11607 }
11608
11609 static void
11610 param_sms_cause(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
11611 {
11612     gint32 value;
11613     guint saved_offset;
11614     const gchar *str = NULL;
11615
11616     saved_offset = asn1->offset;
11617
11618     asn1_int32_value_decode(asn1, 1, &value);
11619
11620     switch (value)
11621     {
11622     case 0: str = "Address vacant"; break;
11623     case 1: str = "Address translation failure"; break;
11624     case 2: str = "Network resource shortage"; break;
11625     case 3: str = "Network failure"; break;
11626     case 4: str = "Invalid Teleservice ID"; break;
11627     case 5: str = "Other network problem"; break;
11628     case 6: str = "Unsupported network interface"; break;
11629     case 32: str = "No page response"; break;
11630     case 33: str = "Destination busy"; break;
11631     case 34: str = "No acknowledgement"; break;
11632     case 35: str = "Destination resource shortage"; break;
11633     case 36: str = "SMS delivery postponed"; break;
11634     case 37: str = "Destination out of service"; break;
11635     case 38: str = "Destination no longer at this address"; break;
11636     case 39: str = "Other terminal problem"; break;
11637     case 64: str = "Radio interface resource shortage"; break;
11638     case 65: str = "Radio interface incompatibility"; break;
11639     case 66: str = "Other radio interface problem"; break;
11640     case 67: str = "Unsupported Base Station Capability"; break;
11641     case 96: str = "Encoding problem"; break;
11642     case 97: str = "Service origination denied"; break;
11643     case 98: str = "Service termination denied"; break;
11644     case 99: str = "Supplementary service not supported"; break;
11645     case 100: str = "Service not supported"; break;
11646     case 101: str = "Reserved"; break;
11647     case 102: str = "Missing expected parameter"; break;
11648     case 103: str = "Missing mandatory parameter"; break;
11649     case 104: str = "Unrecognized parameter value"; break;
11650     case 105: str = "Unexpected parameter value"; break;
11651     case 106: str = "User Data size error"; break;
11652     case 107: str = "Other general problems"; break;
11653     case 108: str = "Session not active"; break;
11654     default:
11655         if ((value >= 7) && (value <= 31)) { str = "Reserved, treat as Other network problem"; }
11656         else if ((value >= 40) && (value <= 47)) { str = "Reserved, treat as Other terminal problem"; }
11657         else if ((value >= 48) && (value <= 63)) { str = "Reserved, treat as SMS delivery postponed"; }
11658         else if ((value >= 68) && (value <= 95)) { str = "Reserved, treat as Other radio interface problem"; }
11659         else if ((value >= 109) && (value <= 223)) { str = "Reserved, treat as Other general problems"; }
11660         else { str = "Reserved for protocol extension, treat as Other general problems"; }
11661         break;
11662     }
11663
11664     proto_tree_add_text(tree, asn1->tvb,
11665         saved_offset, asn1->offset - saved_offset,
11666         "%s (%u)",
11667         str,
11668         value);
11669
11670     EXTRANEOUS_DATA_CHECK(len, 1);
11671 }
11672
11673 static void
11674 param_cdma_soci(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
11675 {
11676     gint32 value;
11677     guint saved_offset;
11678
11679     saved_offset = asn1->offset;
11680
11681     asn1_int32_value_decode(asn1, 1, &value);
11682
11683     proto_tree_add_text(tree, asn1->tvb,
11684         saved_offset, asn1->offset - saved_offset,
11685         "Value %u",
11686         value);
11687
11688     EXTRANEOUS_DATA_CHECK(len, 1);
11689 }
11690
11691 static void
11692 param_int(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
11693 {
11694     gint32 value;
11695     guint saved_offset;
11696
11697     if (len > 4)
11698     {
11699         proto_tree_add_text(tree, asn1->tvb,
11700             asn1->offset, len, "Long Data (?)");
11701         asn1->offset += len;
11702         return;
11703     }
11704
11705     saved_offset = asn1->offset;
11706
11707     asn1_int32_value_decode(asn1, len, &value);
11708
11709     proto_tree_add_text(tree, asn1->tvb,
11710         saved_offset, asn1->offset - saved_offset,
11711         "Value %u",
11712         value);
11713 }
11714
11715 static void
11716 param_pc_ssn(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
11717 {
11718     gint32 value, b1, b2, b3, b4;
11719     guint saved_offset;
11720     const gchar *str = NULL;
11721
11722     EXACT_DATA_CHECK(len, 5);
11723
11724     saved_offset = asn1->offset;
11725
11726     asn1_int32_value_decode(asn1, 1, &value);
11727
11728     switch (value)
11729     {
11730     case 0: str = "Not specified"; break;
11731     case 1: str = "Serving MSC"; break;
11732     case 2: str = "Home MSC"; break;
11733     case 3: str = "Gateway MSC"; break;
11734     case 4: str = "HLR"; break;
11735     case 5: str = "VLR"; break;
11736     case 6: str = "EIR (reserved)"; break;
11737     case 7: str = "AC"; break;
11738     case 8: str = "Border MSC"; break;
11739     case 9: str = "Originating MSC"; break;
11740     default:
11741         if ((value >= 10) && (value <= 223)) { str = "Reserved, treat as Not specified"; }
11742         else { str = "Reserved for protocol extension, treat as Not specified"; }
11743         break;
11744     }
11745
11746     proto_tree_add_text(tree, asn1->tvb,
11747         saved_offset, asn1->offset - saved_offset,
11748         "Type (%u) %s",
11749         value,
11750         str);
11751
11752     asn1_int32_value_decode(asn1, 1, &b1);
11753     asn1_int32_value_decode(asn1, 1, &b2);
11754     asn1_int32_value_decode(asn1, 1, &b3);
11755     asn1_int32_value_decode(asn1, 1, &b4);
11756
11757     proto_tree_add_text(tree, asn1->tvb,
11758         saved_offset, asn1->offset - saved_offset,
11759         "Point Code %u-%u-%u  SSN %u",
11760         b3, b2, b1, b4);
11761 }
11762
11763 static void
11764 param_lai(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
11765 {
11766     gint32 value;
11767     guint saved_offset;
11768
11769     EXACT_DATA_CHECK(len, 2);
11770
11771     saved_offset = asn1->offset;
11772
11773     asn1_int32_value_decode(asn1, 2, &value);
11774
11775     proto_tree_add_text(tree, asn1->tvb,
11776         saved_offset, asn1->offset - saved_offset,
11777         "LAI %u (0x%04x)",
11778         value,
11779         value);
11780 }
11781
11782 static void
11783 param_list(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_)
11784 {
11785     guint saved_offset;
11786     guint num_parms;
11787
11788     num_parms = 0;
11789     saved_offset = asn1->offset;
11790
11791     while (len > (asn1->offset - saved_offset))
11792     {
11793         num_parms++;
11794
11795         if (!dissect_ansi_param(asn1, tree))
11796         {
11797             proto_tree_add_text(tree,
11798                 asn1->tvb, asn1->offset, len - (asn1->offset - saved_offset),
11799                 "Unknown Parameter Data");
11800
11801             asn1->offset = saved_offset + len;
11802             break;
11803         }
11804     }
11805
11806     sprintf(add_string, " - (%u)", num_parms);
11807 }
11808
11809
11810 #define NUM_PARAM_1 (sizeof(ansi_param_1_strings)/sizeof(value_string))
11811 static gint ett_ansi_param_1[NUM_PARAM_1];
11812 static void (*param_1_fcn[])(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_) = {
11813     param_bill_id,      /* Billing ID */
11814     param_int,  /* Serving Cell ID */
11815     param_int,  /* Target Cell ID */
11816     param_digits,       /* Digits */
11817     param_chan_data,    /* Channel Data */
11818     param_cic,  /* Inter MSC Circuit ID */
11819     param_int,  /* Inter Switch Count */
11820     param_min,  /* Mobile Identification Number */
11821     param_esn,  /* Electronic Serial Number */
11822     param_rel_reason,   /* Release Reason */
11823     param_sig_qual,     /* Signal Quality */
11824     param_scm,  /* Station Class Mark */
11825     param_auth_den,     /* Authorization Denied */
11826     param_auth_per,     /* Authorization Period */
11827     param_seizure,      /* Seizure Type */
11828     param_trunk_stat,   /* Trunk Status */
11829     param_qic,  /* Qualification Information Code */
11830     param_feat_result,  /* Feature Result */
11831     param_red_reason,   /* Redirection Reason */
11832     param_acc_den,      /* Access Denied Reason */
11833     param_mscid,        /* MSCID */
11834     param_sys_type_code,        /* System My Type Code */
11835     param_orig_ind,     /* Origination Indicator */
11836     param_term_res,     /* Termination Restriction Code */
11837     param_calling_feat_ind,     /* Calling Features Indicator */
11838     param_faulty,       /* Faulty Parameter */
11839     param_usage_ind,    /* Usage Indicator */
11840     param_tdma_chan_data,       /* TDMA Channel Data */
11841     param_tdma_call_mode,       /* TDMA Call Mode */
11842     param_ho_reason,    /* Handoff Reason */
11843     NULL,       /* NONE */
11844 };
11845
11846
11847 #define NUM_PARAM_2 (sizeof(ansi_param_2_strings)/sizeof(value_string))
11848 static gint ett_ansi_param_2[NUM_PARAM_2];
11849 static void (*param_2_fcn[])(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_) = {
11850     param_tdma_burst_ind,       /* TDMA Burst Indicator */
11851     param_pc_ssn,       /* PC_SSN */
11852     param_lai,  /* Location Area ID */
11853     param_sys_acc_type, /* System Access Type */
11854     param_auth_resp_all,        /* Authentication Response */
11855     param_auth_resp_all,        /* Authentication Response Base Station */
11856     param_auth_resp_all,        /* Authentication Response Unique Challenge */
11857     param_int,  /* Call History Count */
11858     param_confid_mode,  /* Confidentiality Modes */
11859     param_int,  /* Random Variable */
11860     param_int,  /* Random Variable Base station */
11861     param_rand_ssd,     /* Random Variable SSD */
11862     param_rand_unique,  /* Random Variable Unique Challenge */
11863     param_report_type,  /* Report Type */
11864     param_sme_key,      /* Signaling Message Encryption Key */
11865     param_ssd,  /* Shared Secret Data */
11866     param_term_type,    /* Terminal Type */
11867     param_vpmask,       /* Voice Privacy Mask */
11868     param_sys_cap,      /* System Capabilities */
11869     param_deny_acc,     /* Deny Access */
11870     param_upd_count,    /* Update Count */
11871     param_ssd_no_share, /* SSD Not Shared */
11872     param_ext_mscid,    /* Extended MSCID */
11873     param_ext_sys_type_code,    /* Extended System My Type Code */
11874     param_ctrl_chan_data,       /* Control Channel Data */
11875     param_sys_acc_data, /* System Access Data */
11876     param_can_den,      /* Cancellation Denied */
11877     param_border_acc,   /* Border Cell Access */
11878     param_cdma_scm,     /* CDMA Station Class Mark */
11879     param_int,  /* CDMA Serving One Way Delay */
11880     param_int,  /* CDMA Target One Way Delay */
11881     param_cdma_call_mode,       /* CDMA Call Mode */
11882     param_cdma_chan_data,       /* CDMA Channel Data */
11883     param_cdma_sig_qual,        /* CDMA Signal Quality */
11884     param_cdma_pilot_strength,  /* CDMA Pilot Strength */
11885     param_mob_rev,      /* CDMA Mobile Protocol Revision */
11886     param_cdma_plcm,    /* CDMA Private Long Code Mask */
11887     param_cdma_code_chan,       /* CDMA Code Channel */
11888     param_cdma_sea_win, /* CDMA Search Window */
11889     param_ms_loc,       /* MS Location */
11890     param_page_ind,     /* Page Indicator */
11891     param_rec_sig_qual, /* Received Signal Quality */
11892     param_dereg,        /* Deregistration Type */
11893     param_namps_chan_data,      /* NAMPS Channel Data */
11894     param_alert_code,   /* Alert Code */
11895     param_ann_code,     /* Announcement Code */
11896     param_aav,  /* Authentication Algorithm Version */
11897     param_auth_cap,     /* Authentication Capability */
11898     param_int,  /* Call History Count Expected */
11899     param_digits,       /* Calling Party Number Digits 1 */
11900     param_digits,       /* Calling Party Number Digits 2 */
11901     param_digits,       /* Calling Party Number String 1 */
11902     param_digits,       /* Calling Party Number String 2 */
11903     param_sub_addr,     /* Calling Party Subaddress */
11904     param_can_type,     /* Cancellation Type */
11905     param_digits,       /* Carrier Digits */
11906     param_digits,       /* Destination Digits */
11907     param_dmh_red_ind,  /* DMH Redirection Indicator */
11908     param_list, /* Inter System Termination */
11909     param_avail_type,   /* Availability Type */
11910     param_list, /* Local Termination */
11911     param_mw_noti_count,        /* Message Waiting Notification Count */
11912     param_mdn,  /* Mobile Directory Number */
11913     param_digits,       /* MSCID Number */
11914     param_list, /* PSTN Termination */
11915     param_no_ans_time,  /* No Answer Time */
11916     param_otfi, /* One Time Feature Indicator */
11917     param_orig_trig,    /* Origination Triggers */
11918     param_randc,        /* RANDC */
11919     param_digits,       /* Redirecting Number Digits */
11920     param_digits,       /* Redirecting Number String */
11921     param_sub_addr,     /* Redirecting Number Subaddress */
11922     param_digits,       /* Sender Identification Number */
11923     param_digits,       /* SMS Address */
11924     param_sms_bd,       /* SMS Bearer Data */
11925     param_sms_charge_ind,       /* SMS Charge Indicator */
11926     param_digits,       /* SMS Destination Address */
11927     param_sms_msg_count,        /* SMS Message Count */
11928     param_sms_noti,     /* SMS Notification Indicator */
11929     param_digits,       /* SMS Original Destination Address */
11930     param_sub_addr,     /* SMS Original Destination Subaddress */
11931     param_digits,       /* SMS Original Originating Address */
11932     param_sub_addr,     /* SMS Original Originating Subaddress */
11933     param_digits,       /* SMS Originating Address */
11934     param_sms_orig_restric,     /* SMS Originating Restrictions */
11935     param_sms_tele,     /* SMS Teleservice Identifier */
11936     param_sms_term_restric,     /* SMS Termination Restrictions */
11937     NULL/* no data */,  /* SMS Message Waiting Indicator */
11938     param_term_acc_type,        /* Termination Access Type */
11939     param_list, /* Termination List */
11940     param_term_treat,   /* Termination Treatment */
11941     param_term_trig,    /* Termination Triggers */
11942     param_trans_cap,    /* Transaction Capability */
11943     param_unique_chal_rep,      /* Unique Challenge Report */
11944     NULL,       /* NONE */
11945 };
11946
11947
11948 #define NUM_PARAM_3 (sizeof(ansi_param_3_strings)/sizeof(value_string))
11949 static gint ett_ansi_param_3[NUM_PARAM_3];
11950 static void (*param_3_fcn[])(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_) = {
11951     param_act_code,     /* Action Code */
11952     param_alert_res,    /* Alert Result */
11953     param_list, /* Announcement List */
11954     param_list, /* CDMA Code Channel Information */
11955     param_list, /* CDMA Code Channel List */
11956     param_list, /* CDMA Target Measurement Information */
11957     param_list, /* CDMA Target Measurement List */
11958     param_list, /* CDMA Target MAHO Information */
11959     param_list, /* CDMA Target MAHO List */
11960     param_conf_call_ind,        /* Conference Calling Indicator */
11961     param_count_upd_report,     /* Count Update Report */
11962     param_digit_collect_ctrl,   /* Digit Collection Control */
11963     param_digits,       /* DMH Account Code Digits */
11964     param_digits,       /* DMH Alternate Billing Digits */
11965     param_digits,       /* DMH Billing Digits */
11966     param_geo_auth,     /* Geographic Authorization */
11967     param_int,  /* Leg Information */
11968     param_mw_noti_type, /* Message Waiting Notification Type */
11969     param_paca_ind,     /* PACA Indicator */
11970     param_pref_lang_ind,        /* Preferred Language Indicator */
11971     param_rand_valtime, /* Random Valid Time */
11972     param_digits,       /* Restriction Digits */
11973     param_digits,       /* Routing Digits */
11974     param_setup_result, /* Setup Result */
11975     param_sms_acc_den_reason,   /* SMS Access Denied Reason */
11976     param_sms_cause,    /* SMS Cause Code */
11977     param_digits,       /* SPINI PIN */
11978     param_spini_trig,   /* SPINI Triggers */
11979     param_ssd_upd_report,       /* SSD Update Report */
11980     param_list, /* Target Measurement Information */
11981     param_list, /* Target Measurement List */
11982     param_digits,       /* Voice Mailbox PIN */
11983     param_digits,       /* Voice Mailbox Number */
11984     NULL/* no special handling */,      /* Authentication Data */
11985     param_cond_den_reason,      /* Conditionally Denied Reason */
11986     param_group_info,   /* Group Information */
11987     param_ho_state,     /* Handoff State */
11988     param_namps_call_mode,      /* NAMPS Call Mode */
11989     param_cdma_sci,     /* CDMA Slot Cycle Index */
11990     param_den_auth_per, /* Denied Authorization Period */
11991     param_digits,       /* Pilot Number */
11992     param_bill_id,      /* Pilot Billing ID */
11993     param_cdma_band_class,      /* CDMA Band Class */
11994     param_list, /* CDMA Band Class Information */
11995     param_list, /* CDMA Band Class List */
11996     param_cdma_pilot_pn,        /* CDMA Pilot PN */
11997     NULL/* no special handling */,      /* CDMA Service Configuration Record */
11998     param_cdma_so,      /* CDMA Service Option */
11999     param_list, /* CDMA Service Option List */
12000     param_cdma_scm2,    /* CDMA Station Class Mark 2 */
12001     param_tdma_sc,      /* TDMA Service Code */
12002     param_tdma_term_cap,        /* TDMA Terminal Capability */
12003     param_tdma_voice_coder,     /* TDMA Voice Coder */
12004     param_a_key_ver,    /* A-Key Protocol Version */
12005     NULL/* XXX what spec ? */,  /* Authentication Response Reauthentication */
12006     NULL/* no special handling */,      /* Base Station Partial Key */
12007     param_ms_min,       /* Mobile Station MIN */
12008     NULL/* no special handling */,      /* Mobile Station Partial Key */
12009     NULL/* no special handling */,      /* Modulus Value */
12010     param_new_min,      /* Newly Assigned MIN */
12011     param_ota_result_code,      /* OTASP Result Code */
12012     NULL/* no special handling */,      /* Primitive Value */
12013     NULL/* XXX what spec ? */,  /* Random Variable Reauthentication */
12014     NULL/* XXX what spec ? */,  /* Reauthentication Report */
12015     param_srvc_ind,     /* Service Indicator */
12016     param_sme_report,   /* Signaling Message Encryption Report */
12017     param_trn,  /* Temporary Reference Number */
12018     param_vp_report,    /* Voice Privacy Report */
12019     NULL/* XXX */,      /* Base Station Manufacturer Code */
12020     NULL/* XXX */,      /* BSMC Status */
12021     param_ctrl_chan_mode,       /* Control Channel Mode */
12022     NULL/* XXX */,      /* Non Public Data */
12023     NULL/* XXX */,      /* Paging Frame Class */
12024     NULL/* XXX */,      /* PSID RSID Information */
12025     NULL/* XXX */,      /* PSID RSID List */
12026     NULL/* XXX */,      /* Service Result */
12027     NULL/* XXX */,      /* SOC Status */
12028     NULL/* XXX */,      /* System Operator Code */
12029     NULL/* XXX */,      /* Target Cell ID List */
12030     NULL/* XXX */,      /* User Group */
12031     NULL/* XXX */,      /* User Zone Data */
12032     NULL/* no special handling */,      /* CDMA Connection Reference */
12033     param_list, /* CDMA Connection Reference Information */
12034     param_list, /* CDMA Connection Reference List */
12035     NULL/* XXX */,      /* CDMA State */
12036     param_change_srvc_attr,     /* Change Service Attributes */
12037     NULL/* no special handling */,      /* Data Key */
12038     param_dp_params,    /* Data Privacy Parameters */
12039     param_islp_info,    /* ISLP Information */
12040     param_reason_list,  /* Reason List */
12041     NULL/* XXX */,      /* Second Inter MSC Circuit ID */
12042     param_tdma_bandwidth,       /* TDMA Bandwidth */
12043     param_tdma_data_feat_ind,   /* TDMA Data Features Indicator */
12044     param_tdma_data_mode,       /* TDMA Data Mode */
12045     param_tdma_voice_mode,      /* TDMA Voice Mode */
12046     param_ana_red_info, /* Analog Redirect Info */
12047     param_list, /* Analog Redirect Record */
12048     param_cdma_chan_num,        /* CDMA Channel Number */
12049     param_list, /* CDMA Channel Number List */
12050     param_cdma_pci,     /* CDMA Power Combined Indicator */
12051     param_list, /* CDMA Redirect Record */
12052     param_cdma_sea_param,       /* CDMA Search Parameters */
12053     param_int,  /* CDMA Network Identification */
12054     param_network_tmsi, /* Network TMSI */
12055     param_int,  /* Network TMSI Expiration Time */
12056     param_network_tmsi, /* New Network TMSI */
12057     param_reqd_param_mask,      /* Required Parameters Mask */
12058     param_srvc_red_cause,       /* Service Redirection Cause */
12059     param_srvc_red_info,        /* Service Redirection Info */
12060     param_roaming_ind,  /* Roaming Indication */
12061     NULL/* XXX */,      /* Emergency Services Routing Digits */
12062     NULL/* XXX */,      /* Special Handling */
12063     param_imsi, /* International Mobile Subscriber Identity */
12064     param_calling_party_name,   /* Calling Party Name */
12065     param_dis_text,     /* Display Text */
12066     param_red_party_name,       /* Redirecting Party Name */
12067     param_srvc_id,      /* Service ID */
12068     param_all_or_none,  /* All Or None */
12069     param_change,       /* Change */
12070     param_list, /* Data Access Element */
12071     param_list, /* Data Access Element List */
12072     NULL/* no special handling */,      /* Data ID */
12073     NULL/* no special handling */,      /* Database Key */
12074     param_data_result,  /* Data Result */
12075     param_list, /* Data Update Result */
12076     param_list, /* Data Update Result List */
12077     NULL/* no special handling */,      /* Data Value */
12078     param_list, /* Execute Script */
12079     param_fail_cause,   /* Failure Cause */
12080     param_fail_type,    /* Failure Type */
12081     NULL/* no special handling */,      /* Global Title */
12082     param_list, /* Modification Request */
12083     param_list, /* Modification Request List */
12084     param_list, /* Modification Result List */
12085     NULL/* no special handling */,      /* Private Specialized Resource */
12086     NULL/* no special handling */,      /* Script Argument */
12087     NULL/* no special handling */,      /* Script Name */
12088     NULL/* no special handling */,      /* Script Result */
12089     param_list, /* Service Data Access Element */
12090     param_list, /* Service Data Access Element List */
12091     param_list, /* Service Data Result */
12092     param_list, /* Service Data Result List */
12093     param_special_rsc,  /* Specialized Resource */
12094     param_time_date_offset,     /* Time Date Offset */
12095     param_list, /* Trigger Address List */
12096     param_trig_cap,     /* Trigger Capability */
12097     param_list, /* Trigger List */
12098     param_trig_type,    /* Trigger Type */
12099     param_list, /* WIN Capability */
12100     param_win_op_cap,   /* WIN Operations Capability */
12101     param_win_trig_list,        /* WIN Trigger List */
12102     param_digits,       /* MSC Address */
12103     param_sus_acc,      /* Suspicious Access */
12104     param_imsi, /* Mobile Station IMSI */
12105     param_imsi, /* Newly Assigned IMSI */
12106     NULL/* XXX what spec ? */,  /* Command Code */
12107     param_dis_text2,    /* Display Text 2 */
12108     NULL/* XXX what spec ? */,  /* Page Count */
12109     NULL/* XXX what spec ? */,  /* Page Response Time */
12110     NULL/* XXX what spec ? */,  /* SMS Transaction ID */
12111     NULL/* XXX what spec ? */,  /* CAVE Key */
12112     NULL/* XXX what spec ? */,  /* CDMA2000 Mobile Supported Capabilities */
12113     NULL/* XXX what spec ? */,  /* Enhanced Privacy Encryption Report */
12114     param_inter_msg_time,       /* Inter Message Time */
12115     param_msid_usage,   /* MSID Usage */
12116     param_new_min_ext,  /* New MIN Extension */
12117     param_qos_pri,      /* QoS Priority */
12118     param_cdma_ms_meas_chan_id, /* CDMA MS Measured Channel Identity */
12119     param_cdma2000_ho_ivk_ios,  /* CDMA2000 Handoff Invoke IOS Data */
12120     param_cdma2000_ho_rsp_ios,  /* CDMA2000 Handoff Response IOS Data */
12121     NULL/* XXX */,      /* MIN Extension */
12122
12123     param_list, /* Call Recovery ID */
12124     param_list, /* Call Recovery ID List */
12125     param_list, /* Position Information */
12126     param_list, /* CDMA PSMM List */
12127     param_resume_pic,   /* Resume PIC */
12128     param_dmh_srvc_id,  /* DMH Service ID */
12129     param_feat_ind,     /* Feature Indicator */
12130     param_mscid,        /* Control Network ID */
12131     param_rel_cause,    /* Release Cause */
12132     param_time_day,     /* Time Of Day */
12133     param_call_status,  /* Call Status */
12134     NULL/* no special handling */,      /* DMH Charge Information */
12135     NULL/* no special handling */,      /* DMH Billing Indicator */
12136     param_ms_status,    /* MS Status */
12137     param_pos_info_code,        /* Position Information Code */
12138     param_dtx_ind,      /* DTX Indication */
12139     param_cdma_mob_cap, /* CDMA Mobile Capabilities */
12140     param_gen_time,     /* Generalized Time */
12141     param_digits,       /* Generic Digits */
12142     param_geo_pos,      /* Geographic Position */
12143     param_mob_call_status,      /* Mobile Call Status */
12144     param_mob_cap,      /* Mobile Position Capability */
12145     param_pos_req_type, /* Position Request Type */
12146     param_pos_result,   /* Position Result */
12147     param_pos_source,   /* Position Source */
12148     param_acg_encounter,        /* ACG Encountered */
12149     param_ctrl_type,    /* Control Type */
12150     param_gap_duration, /* Gap Duration */
12151     param_scf_overload_gap_int, /* SCF Overload Gap Interval */
12152     param_sm_gap_int,   /* Service Management System Gap Interval */
12153     param_cdma_psmm_count,      /* CDMA PSMM Count */
12154     param_cdma_sowd2,   /* CDMA Serving One Way Delay 2 */
12155     NULL/* no special handling */,      /* PDSN Address */
12156     NULL/* no special handling */,      /* PDSN Protocol Type */
12157     NULL/* no special handling */,      /* Range */
12158     param_calling_party_cat,    /* Calling Party Category */
12159     param_digits,       /* LCS Client ID */
12160     param_tdma_maho_cell_id,    /* TDMA MAHO Cell ID */
12161     param_tdma_maho_chan,       /* TDMA MAHO Channel */
12162     param_cdma_soci,    /* CDMA Service Option Connection Identifier */
12163     param_tdma_time_align,      /* TDMA Time Alignment */
12164     param_tdma_maho_req,        /* TDMA MAHO Request */
12165     NULL,       /* NONE */
12166 };
12167
12168 /* GENERIC MAP DISSECTOR FUNCTIONS */
12169
12170 static void
12171 dissect_ansi_map_len(ASN1_SCK *asn1, proto_tree *tree, gboolean *def_len, guint *len)
12172 {
12173     guint       saved_offset;
12174     int         ret;
12175
12176
12177     saved_offset = asn1->offset;
12178     *def_len = FALSE;
12179     *len = 0;
12180
12181     ret = asn1_length_decode(asn1, def_len, len);
12182
12183     if (*def_len)
12184     {
12185         proto_tree_add_uint(tree, hf_ansi_map_length, asn1->tvb,
12186             saved_offset, asn1->offset - saved_offset,
12187             *len);
12188     }
12189     else
12190     {
12191         proto_tree_add_text(tree, asn1->tvb,
12192             saved_offset, asn1->offset - saved_offset,
12193             "Length: Indefinite");
12194     }
12195
12196 }
12197
12198 static gboolean
12199 check_ansi_map_tag(ASN1_SCK *asn1, guint tag)
12200 {
12201     guint saved_offset, real_tag;
12202
12203
12204     saved_offset = asn1->offset;
12205
12206     asn1_id_decode1(asn1, &real_tag);
12207
12208     asn1->offset = saved_offset;
12209
12210     return(tag == real_tag);
12211 }
12212
12213 static void
12214 dissect_ansi_map_octet(ASN1_SCK *asn1, proto_tree *tree, const guchar * str)
12215 {
12216     guint saved_offset;
12217     guchar my_oct;
12218
12219
12220     saved_offset = asn1->offset;
12221
12222     asn1_octet_decode(asn1, &my_oct);
12223
12224     proto_tree_add_uint_format(tree, hf_ansi_map_id, asn1->tvb,
12225         saved_offset, asn1->offset - saved_offset, my_oct,
12226         "%s %u",
12227         str, my_oct);
12228 }
12229
12230 static proto_tree *
12231 dissect_ansi_map_component(ASN1_SCK *asn1, proto_tree *tree, guint *len_p)
12232 {
12233     guint saved_offset;
12234     guint tag;
12235     proto_item *item;
12236     proto_tree *subtree;
12237     gboolean def_len;
12238
12239
12240     saved_offset = asn1->offset;
12241     asn1_id_decode1(asn1, &tag);
12242
12243     item =
12244         proto_tree_add_text(tree, asn1->tvb,
12245             saved_offset, -1, "Component ID");
12246
12247     subtree = proto_item_add_subtree(item, ett_component);
12248
12249     proto_tree_add_uint_format(subtree, hf_ansi_map_tag, asn1->tvb,
12250         saved_offset, asn1->offset - saved_offset, tag,
12251         "Component ID Identifier");
12252
12253     dissect_ansi_map_len(asn1, subtree, &def_len, len_p);
12254
12255     proto_item_set_len(item, (asn1->offset - saved_offset) + *len_p);
12256
12257     return(subtree);
12258 }
12259
12260 static void
12261 dissect_ansi_opr_code(ASN1_SCK *asn1, packet_info *pinfo, proto_tree *tree, gint32 *opr_code_p)
12262 {
12263     guint saved_offset = 0;
12264     guint len;
12265     guint tag;
12266     gint32 val;
12267     const gchar *str = NULL;
12268     guchar my_oct;
12269     proto_item *item;
12270     proto_tree *subtree;
12271     gboolean def_len;
12272
12273
12274     *opr_code_p = -1;
12275
12276 #define TCAP_NAT_OPR_CODE_TAG 0xd0
12277     if (check_ansi_map_tag(asn1, TCAP_NAT_OPR_CODE_TAG))
12278     {
12279         str = "National TCAP Operation Code Identifier";
12280     }
12281 #define TCAP_PRIV_OPR_CODE_TAG 0xd1
12282     else if (check_ansi_map_tag(asn1, TCAP_PRIV_OPR_CODE_TAG))
12283     {
12284         str = "Private TCAP Operation Code Identifier";
12285     }
12286     else
12287     {
12288         proto_tree_add_text(tree, asn1->tvb,
12289             asn1->offset, -1, "Unexpected tag, not National or Private TCAP Operation Code");
12290         return;
12291     }
12292
12293     saved_offset = asn1->offset;
12294     asn1_id_decode1(asn1, &tag);
12295
12296     item =
12297         proto_tree_add_text(tree, asn1->tvb,
12298             saved_offset, -1, "Operation Code");
12299
12300     subtree = proto_item_add_subtree(item, ett_opr_code);
12301
12302     proto_tree_add_uint_format(subtree, hf_ansi_map_tag, asn1->tvb,
12303         saved_offset, asn1->offset - saved_offset, tag, str);
12304
12305     dissect_ansi_map_len(asn1, subtree, &def_len, &len);
12306     proto_item_set_len(item, (asn1->offset - saved_offset) + len);
12307
12308     if (len > 0)
12309     {
12310         saved_offset = asn1->offset;
12311         asn1_octet_decode(asn1, &my_oct);
12312
12313 #define ANSI_MAP_OPR_FAMILY 0x09
12314         if (my_oct != ANSI_MAP_OPR_FAMILY)
12315         {
12316             asn1->offset = saved_offset;
12317             return;
12318         }
12319
12320         proto_tree_add_text(subtree, asn1->tvb,
12321             saved_offset, 1, "Operation Code Family");
12322
12323         saved_offset = asn1->offset;
12324         asn1_int32_value_decode(asn1, len-1, &val);
12325         proto_tree_add_int(subtree, hf_ansi_map_opr_code, asn1->tvb,
12326             saved_offset, asn1->offset - saved_offset, val);
12327
12328         str = match_strval(val, ansi_map_opr_code_strings);
12329
12330         if (NULL == str) return;
12331
12332         *opr_code_p = val;
12333
12334         if (check_col(pinfo->cinfo, COL_INFO))
12335         {
12336             col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", str);
12337         }
12338     }
12339 }
12340
12341 static void
12342 dissect_ansi_problem(ASN1_SCK *asn1, proto_tree *tree)
12343 {
12344     guint saved_offset = 0;
12345     guint len;
12346     guint tag;
12347     proto_tree *subtree;
12348     proto_item *item = NULL;
12349     const gchar *str = NULL;
12350     const gchar *type_str = NULL;
12351     gint32 type, spec;
12352     gboolean def_len;
12353
12354
12355 #define TCAP_PROB_CODE_TAG 0xd5
12356     if (check_ansi_map_tag(asn1, TCAP_PROB_CODE_TAG))
12357     {
12358         str = "Problem Code Identifier";
12359     }
12360     else
12361     {
12362         /* XXX */
12363         return;
12364     }
12365
12366     saved_offset = asn1->offset;
12367     asn1_id_decode1(asn1, &tag);
12368
12369     item =
12370         proto_tree_add_text(tree, asn1->tvb,
12371             saved_offset, -1, "Problem Code");
12372
12373     subtree = proto_item_add_subtree(item, ett_problem);
12374
12375     proto_tree_add_uint_format(subtree, hf_ansi_map_tag, asn1->tvb,
12376         saved_offset, asn1->offset - saved_offset, tag, str);
12377
12378     dissect_ansi_map_len(asn1, subtree, &def_len, &len);
12379     proto_item_set_len(item, (asn1->offset - saved_offset) + len);
12380
12381     if (len != 2)
12382     {
12383         proto_tree_add_text(subtree, asn1->tvb,
12384             asn1->offset, len, "Unknown encoding of Problem Code");
12385
12386         asn1->offset += len;
12387         return;
12388     }
12389
12390     saved_offset = asn1->offset;
12391     asn1_int32_value_decode(asn1, 1, &type);
12392     asn1_int32_value_decode(asn1, 1, &spec);
12393
12394     switch (type)
12395     {
12396     case 0: type_str = "Not used"; break;
12397
12398     case 1:
12399         type_str = "General";
12400         switch (spec)
12401         {
12402         case 1: str = "Unrecognized Component Type"; break;
12403         case 2: str = "Incorrect Component Portion"; break;
12404         case 3: str = "Badly Structured Component Portion"; break;
12405         default:
12406             str = "Undefined";
12407             break;
12408         }
12409         break;
12410
12411     case 2:
12412         type_str = "Invoke";
12413         switch (spec)
12414         {
12415         case 1: str = "Duplicate Invoke ID"; break;
12416         case 2: str = "Unrecognized Operation Code"; break;
12417         case 3: str = "Incorrect Parameter"; break;
12418         case 4: str = "Unrecognized Correlation ID"; break;
12419         default:
12420             str = "Undefined";
12421             break;
12422         }
12423         break;
12424
12425     case 3:
12426         type_str = "Return Result";
12427         switch (spec)
12428         {
12429         case 1: str = "Unrecognized Correlation ID"; break;
12430         case 2: str = "Unexpected Return Result"; break;
12431         case 3: str = "Incorrect Parameter"; break;
12432         default:
12433             str = "Undefined";
12434             break;
12435         }
12436         break;
12437
12438     case 4:
12439         type_str = "Return Error";
12440         switch (spec)
12441         {
12442         case 1: str = "Unrecognized Correlation ID"; break;
12443         case 2: str = "Unexpected Return Error"; break;
12444         case 3: str = "Unrecognized Error"; break;
12445         case 4: str = "Unexpected Error"; break;
12446         case 5: str = "Incorrect Parameter"; break;
12447         default:
12448             str = "Undefined";
12449             break;
12450         }
12451         break;
12452
12453     case 5:
12454         type_str = "Transaction Portion";
12455         switch (spec)
12456         {
12457         case 1: str = "Unrecognized Package Type"; break;
12458         case 2: str = "Incorrect Transaction Portion"; break;
12459         case 3: str = "Badly Structured Transaction Portion"; break;
12460         case 4: str = "Unrecognized Transaction ID"; break;
12461         case 5: str = "Permission to Release"; break;
12462         case 6: str = "Resource Unavailable"; break;
12463         default:
12464             str = "Undefined";
12465             break;
12466         }
12467         break;
12468
12469     default:
12470         type_str = "Undefined";
12471         break;
12472     }
12473
12474     if (spec == 255) { str = "Reserved"; }
12475     else if (spec == 0) { str = "Not used"; }
12476
12477     proto_tree_add_text(subtree, asn1->tvb,
12478         saved_offset, 1, "Problem Type %s", type_str);
12479
12480     proto_tree_add_text(subtree, asn1->tvb,
12481         saved_offset + 1, 1, "Problem Specifier %s", str);
12482 }
12483
12484 static void
12485 dissect_ansi_error(ASN1_SCK *asn1, proto_tree *tree)
12486 {
12487     guint saved_offset = 0;
12488     guint len;
12489     guint tag;
12490     gint32 value;
12491     proto_tree *subtree;
12492     proto_item *item = NULL;
12493     const gchar *str = NULL;
12494     gboolean def_len;
12495
12496
12497 #define TCAP_NAT_ERR_CODE_TAG 0xd3
12498     if (check_ansi_map_tag(asn1, TCAP_NAT_ERR_CODE_TAG))
12499     {
12500         str = "National TCAP Error Code Identifier";
12501     }
12502 #define TCAP_PRIV_ERR_CODE_TAG 0xd4
12503     else if (check_ansi_map_tag(asn1, TCAP_PRIV_ERR_CODE_TAG))
12504     {
12505         str = "Private TCAP Error Code Identifier";
12506     }
12507     else
12508     {
12509         /* XXX */
12510         return;
12511     }
12512
12513     saved_offset = asn1->offset;
12514     asn1_id_decode1(asn1, &tag);
12515
12516     item =
12517         proto_tree_add_text(tree, asn1->tvb,
12518             saved_offset, -1, "TCAP Error Code");
12519
12520     subtree = proto_item_add_subtree(item, ett_error);
12521
12522     proto_tree_add_uint_format(subtree, hf_ansi_map_tag, asn1->tvb,
12523         saved_offset, asn1->offset - saved_offset, tag, str);
12524
12525     dissect_ansi_map_len(asn1, subtree, &def_len, &len);
12526     proto_item_set_len(item, (asn1->offset - saved_offset) + len);
12527
12528     if ((tag == TCAP_PRIV_ERR_CODE_TAG) &&
12529         (len == 1))
12530     {
12531         saved_offset = asn1->offset;
12532         asn1_int32_value_decode(asn1, 1, &value);
12533
12534         switch (value)
12535         {
12536         case 0x81: str = "Unrecognized MIN"; break;
12537         case 0x82: str = "Unrecognized ESN"; break;
12538         case 0x83: str = "MIN/HLR Mismatch"; break;
12539         case 0x84: str = "Operation Sequence Problem"; break;
12540         case 0x85: str = "Resource Shortage"; break;
12541         case 0x86: str = "Operation Not Supported"; break;
12542         case 0x87: str = "Trunk Unavailable"; break;
12543         case 0x88: str = "Parameter Error"; break;
12544         case 0x89: str = "System Failure"; break;
12545         case 0x8a: str = "Unrecognized Parameter Value"; break;
12546         case 0x8b: str = "Feature Inactive"; break;
12547         case 0x8c: str = "Missing Parameter"; break;
12548         default:
12549             if ((value >= 0xe0) && (value <= 0xff)) { str = "Reserved for protocol extension"; }
12550             else { str = "Reserved"; }
12551             break;
12552         }
12553
12554         proto_tree_add_text(subtree, asn1->tvb,
12555             saved_offset, 1, str);
12556     }
12557     else
12558     {
12559         proto_tree_add_text(subtree, asn1->tvb,
12560             asn1->offset, len, "Error Code");
12561
12562         asn1->offset += len;
12563     }
12564 }
12565
12566
12567 static gboolean
12568 dissect_ansi_param(ASN1_SCK *asn1, proto_tree *tree)
12569 {
12570     void (*param_fcn)(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string _U_) = NULL;
12571     guint saved_offset = 0;
12572     guint len;
12573     proto_tree *subtree;
12574     proto_item *item;
12575     guint val;
12576     const gchar *str = NULL;
12577     gint ett_param_idx, idx;
12578     gboolean def_len;
12579
12580
12581     saved_offset = asn1->offset;
12582
12583     asn1_uint32_value_decode(asn1, 1, &val);
12584     str = match_strval_idx((guint32) val, ansi_param_1_strings, &idx);
12585
12586     if (NULL == str)
12587     {
12588         asn1->offset = saved_offset;
12589         asn1_uint32_value_decode(asn1, 2, &val);
12590
12591         str = match_strval_idx((guint32) val, ansi_param_2_strings, &idx);
12592
12593         if (NULL == str)
12594         {
12595             asn1->offset = saved_offset;
12596             asn1_int32_value_decode(asn1, 3, &val);
12597
12598             str = match_strval_idx((guint32) val, ansi_param_3_strings, &idx);
12599
12600             if (NULL == str)
12601             {
12602                 if (((val >= 0x9FFF00) && (val <= 0x9FFF7F)) ||
12603                     ((val >= 0xBFFF00) && (val <= 0xBFFF7F)))
12604                 {
12605                     str = "Reserved for protocol extension";
12606                 }
12607                 else if (((val >= 0x9FFE76) && (val <= 0x9FFE7F)) ||
12608                     ((val >= 0xBFFE76) && (val <= 0xBFFE7F)))
12609                 {
12610                     str = "Reserved for National Network Use";
12611                 }
12612                 else
12613                 {
12614                     str = "Unknown Parameter Data";
12615                     param_fcn = NULL;
12616                 }
12617
12618                 ett_param_idx = ett_param;
12619             }
12620             else
12621             {
12622                 ett_param_idx = ett_ansi_param_3[idx];
12623                 param_fcn = param_3_fcn[idx];
12624             }
12625         }
12626         else
12627         {
12628             ett_param_idx = ett_ansi_param_2[idx];
12629             param_fcn = param_2_fcn[idx];
12630         }
12631     }
12632     else
12633     {
12634         ett_param_idx = ett_ansi_param_1[idx];
12635         param_fcn = param_1_fcn[idx];
12636     }
12637
12638     item =
12639         proto_tree_add_text(tree, asn1->tvb,
12640             saved_offset, -1, str);
12641
12642     subtree = proto_item_add_subtree(item, ett_param_idx);
12643
12644     proto_tree_add_uint_format(subtree, hf_ansi_map_param_id, asn1->tvb,
12645         saved_offset, asn1->offset - saved_offset, val, "Parameter ID");
12646
12647     dissect_ansi_map_len(asn1, subtree, &def_len, &len);
12648
12649     proto_item_set_len(item, asn1->offset - saved_offset + len);
12650
12651     if (len > 0)
12652     {
12653         if (param_fcn == NULL)
12654         {
12655             proto_tree_add_text(subtree, asn1->tvb,
12656                 asn1->offset, len, "Parameter Data");
12657             asn1->offset += len;
12658         }
12659         else
12660         {
12661             ansi_map_add_string[0] = '\0';
12662
12663             (*param_fcn)(asn1, subtree, len, ansi_map_add_string);
12664
12665             if (ansi_map_add_string[0] != '\0')
12666             {
12667                 proto_item_append_text(item, ansi_map_add_string);
12668                 ansi_map_add_string[0] = '\0';
12669             }
12670         }
12671     }
12672
12673     return(TRUE);
12674 }
12675
12676
12677 static void
12678 dissect_ansi_params(ASN1_SCK *asn1, proto_tree *tree)
12679 {
12680     guint saved_offset = 0;
12681     guint len;
12682     guint tag;
12683     proto_tree *subtree;
12684     proto_item *item = NULL;
12685     const gchar *str = NULL;
12686     gboolean def_len;
12687
12688 #define TCAP_PARAM_SET_TAG 0xf2
12689     if (check_ansi_map_tag(asn1, TCAP_PARAM_SET_TAG))
12690     {
12691         str = "Parameter Set Identifier";
12692     }
12693 #define TCAP_PARAM_SEQ_TAG 0x30
12694     else if (check_ansi_map_tag(asn1, TCAP_PARAM_SEQ_TAG))
12695     {
12696         str = "Parameter Sequence Identifier";
12697     }
12698     else
12699     {
12700         /* XXX */
12701         return;
12702     }
12703
12704     saved_offset = asn1->offset;
12705     asn1_id_decode1(asn1, &tag);
12706
12707     item =
12708         proto_tree_add_text(tree, asn1->tvb,
12709             saved_offset, -1, "Parameters");
12710
12711     subtree = proto_item_add_subtree(item, ett_params);
12712
12713     proto_tree_add_uint_format(subtree, hf_ansi_map_tag, asn1->tvb,
12714         saved_offset, asn1->offset - saved_offset, tag, str);
12715
12716     dissect_ansi_map_len(asn1, subtree, &def_len, &len);
12717     proto_item_set_len(item, (asn1->offset - saved_offset) + len);
12718
12719     ansi_map_add_string[0] = '\0';
12720
12721     param_list(asn1, subtree, len, ansi_map_add_string);
12722
12723     if (ansi_map_add_string[0] != '\0')
12724     {
12725         proto_item_append_text(item, ansi_map_add_string);
12726         ansi_map_add_string[0] = '\0';
12727     }
12728 }
12729
12730 static void
12731 dissect_ansi_map_reject(ASN1_SCK *asn1, proto_tree *tree)
12732 {
12733     guint len;
12734     proto_tree *subtree;
12735
12736 #define COMPONENT_ID_TAG 0xcf
12737     if (check_ansi_map_tag(asn1, COMPONENT_ID_TAG))
12738     {
12739         subtree = dissect_ansi_map_component(asn1, tree, &len);
12740
12741         switch (len)
12742         {
12743         case 1:
12744             dissect_ansi_map_octet(asn1, subtree, "Correlation ID:");
12745             break;
12746         }
12747     }
12748
12749     dissect_ansi_problem(asn1, tree);
12750
12751     dissect_ansi_params(asn1, tree);
12752 }
12753
12754 static void
12755 dissect_ansi_map_re(ASN1_SCK *asn1, proto_tree *tree)
12756 {
12757     guint len;
12758     proto_tree *subtree;
12759
12760 #define COMPONENT_ID_TAG 0xcf
12761     if (check_ansi_map_tag(asn1, COMPONENT_ID_TAG))
12762     {
12763         subtree = dissect_ansi_map_component(asn1, tree, &len);
12764
12765         switch (len)
12766         {
12767         case 1:
12768             dissect_ansi_map_octet(asn1, subtree, "Correlation ID:");
12769             break;
12770         }
12771     }
12772
12773     dissect_ansi_error(asn1, tree);
12774
12775     dissect_ansi_params(asn1, tree);
12776 }
12777
12778 static void
12779 dissect_ansi_map_rr(ASN1_SCK *asn1, proto_tree *tree)
12780 {
12781     guint len;
12782     proto_tree *subtree;
12783
12784 #define COMPONENT_ID_TAG 0xcf
12785     if (check_ansi_map_tag(asn1, COMPONENT_ID_TAG))
12786     {
12787         subtree = dissect_ansi_map_component(asn1, tree, &len);
12788
12789         switch (len)
12790         {
12791         case 1:
12792             dissect_ansi_map_octet(asn1, subtree, "Correlation ID:");
12793             break;
12794         }
12795     }
12796
12797     dissect_ansi_params(asn1, tree);
12798 }
12799
12800 static void
12801 dissect_ansi_map_invoke(ASN1_SCK *asn1, packet_info *pinfo, proto_tree *tree, gint *opr_code_p)
12802 {
12803     guint len;
12804     proto_tree *subtree;
12805
12806 #define COMPONENT_ID_TAG 0xcf
12807     if (check_ansi_map_tag(asn1, COMPONENT_ID_TAG))
12808     {
12809         subtree = dissect_ansi_map_component(asn1, tree, &len);
12810
12811         switch (len)
12812         {
12813         case 1:
12814             dissect_ansi_map_octet(asn1, subtree, "Invoke ID:");
12815             break;
12816
12817         case 2:
12818             dissect_ansi_map_octet(asn1, subtree, "Invoke ID:");
12819             dissect_ansi_map_octet(asn1, subtree, "Correlation ID:");
12820             break;
12821         }
12822     }
12823
12824     ansi_map_is_invoke = TRUE;
12825
12826     dissect_ansi_opr_code(asn1, pinfo, tree, opr_code_p);
12827
12828     dissect_ansi_params(asn1, tree);
12829 }
12830
12831 static void
12832 dissect_ansi_map_message(ASN1_SCK *asn1, packet_info *pinfo, proto_tree *ansi_map_tree)
12833 {
12834     static ansi_map_tap_rec_t tap_rec;
12835     guint       saved_offset;
12836     guint       tag;
12837     guint       len;
12838     const gchar *str = NULL;
12839     proto_item *item, *tag_item;
12840     proto_tree *subtree, *tag_subtree;
12841     gboolean def_len;
12842     static int  i = 0;
12843     gint opr_code;
12844
12845
12846     saved_offset = asn1->offset;
12847     asn1_id_decode1(asn1, &tag);
12848
12849     str = match_strval(tag, ansi_cmp_type_strings);
12850
12851     if (NULL == str) return;
12852
12853     if (check_col(pinfo->cinfo, COL_INFO))
12854     {
12855         if (0 == i)
12856         {
12857             col_append_fstr(pinfo->cinfo, COL_INFO,  "%s ", str);
12858         }
12859         else
12860         {
12861             col_append_fstr(pinfo->cinfo, COL_INFO,  "& %s ", str);
12862         }
12863     }
12864
12865     item =
12866         proto_tree_add_text(ansi_map_tree, asn1->tvb,
12867             saved_offset, -1, "Components");
12868     subtree = proto_item_add_subtree(item, ett_components);
12869
12870     tag_item =
12871         proto_tree_add_uint_format(subtree, hf_ansi_map_tag, asn1->tvb,
12872             saved_offset, asn1->offset - saved_offset, tag, str);
12873
12874     dissect_ansi_map_len(asn1, subtree, &def_len, &len);
12875
12876     tag_subtree = proto_item_add_subtree(tag_item, ett_components);
12877
12878     opr_code = -1;
12879
12880     switch (tag)
12881     {
12882     case ANSI_TC_INVOKE_L:
12883         dissect_ansi_map_invoke(asn1, pinfo, tag_subtree, &opr_code);
12884         break;
12885
12886     case ANSI_TC_RRL:
12887         dissect_ansi_map_rr(asn1, tag_subtree);
12888         break;
12889
12890     case ANSI_TC_RE:
12891         dissect_ansi_map_re(asn1, tag_subtree);
12892         break;
12893
12894     case ANSI_TC_REJECT:
12895         dissect_ansi_map_reject(asn1, tag_subtree);
12896         break;
12897
12898     case ANSI_TC_INVOKE_N:
12899         dissect_ansi_map_invoke(asn1, pinfo, tag_subtree, &opr_code);
12900         break;
12901
12902     case ANSI_TC_RRN:
12903         dissect_ansi_map_rr(asn1, tag_subtree);
12904         break;
12905
12906     default:
12907         /* XXX */
12908         break;
12909     }
12910
12911     if (bd_tvb != NULL)
12912     {
12913         if (ansi_map_sms_tele_id != -1)
12914         {
12915             dissector_try_port(is637_tele_id_dissector_table, ansi_map_sms_tele_id, bd_tvb, g_pinfo, g_tree);
12916             ansi_map_sms_tele_id = -1;
12917         }
12918         else if (is683_ota)
12919         {
12920             dissector_try_port(is683_dissector_table, ansi_map_is_invoke ? 0 : 1, bd_tvb, g_pinfo, g_tree);
12921         }
12922         else if (is801_pld)
12923         {
12924             dissector_try_port(is801_dissector_table, ansi_map_is_invoke ? 0 : 1, bd_tvb, g_pinfo, g_tree);
12925         }
12926     }
12927
12928     proto_item_set_len(item, asn1->offset - saved_offset);
12929
12930     if (opr_code != -1)
12931     {
12932         tap_rec.message_type = opr_code;
12933         tap_rec.size = asn1->offset - saved_offset;
12934
12935         tap_queue_packet(ansi_map_tap, pinfo, &tap_rec);
12936     }
12937 }
12938
12939 static void
12940 dissect_ansi_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
12941 {
12942     proto_item *ansi_map_item;
12943     proto_tree *ansi_map_tree = NULL;
12944     ASN1_SCK   asn1;
12945     int        offset = 0;
12946
12947     g_pinfo = pinfo;
12948
12949     /*
12950      * Make entry in the Protocol column on summary display
12951      */
12952     if (check_col(pinfo->cinfo, COL_PROTOCOL))
12953     {
12954         col_set_str(pinfo->cinfo, COL_PROTOCOL, "ANSI MAP");
12955     }
12956
12957     /* In the interest of speed, if "tree" is NULL, don't do any work not
12958      * necessary to generate protocol tree items.
12959      */
12960     if (tree)
12961     {
12962         g_tree = tree;
12963
12964         /*
12965          * create the ansi_map protocol tree
12966          */
12967         ansi_map_item =
12968             proto_tree_add_item(tree, proto_ansi_map, tvb, 0, -1, FALSE);
12969
12970         ansi_map_tree =
12971             proto_item_add_subtree(ansi_map_item, ett_ansi_map);
12972
12973         asn1_open(&asn1, tvb, offset);
12974
12975         ansi_map_is_invoke = FALSE;
12976         is683_ota = FALSE;
12977         is801_pld = FALSE;
12978         bd_tvb = NULL;
12979         dissect_ansi_map_message(&asn1, pinfo, ansi_map_tree);
12980
12981         asn1_close(&asn1, &offset);
12982     }
12983 }
12984
12985
12986 /* Register the protocol with Ethereal */
12987 void
12988 proto_register_ansi_map(void)
12989 {
12990     guint               i;
12991     gint                last_offset;
12992
12993     /* Setup list of header fields */
12994     static hf_register_info hf[] =
12995     {
12996         { &hf_ansi_map_tag,
12997             { "Tag",            "ansi_map.tag",
12998             FT_UINT8, BASE_HEX, NULL, 0,
12999             "", HFILL }
13000         },
13001         { &hf_ansi_map_length,
13002             { "Length",         "ansi_map.len",
13003             FT_UINT8, BASE_DEC, NULL, 0,
13004             "", HFILL }
13005         },
13006         { &hf_ansi_map_id,
13007             { "Value",          "ansi_map.id",
13008             FT_UINT8, BASE_DEC, NULL, 0,
13009             "", HFILL }
13010         },
13011         { &hf_ansi_map_opr_code,
13012             { "Operation Code", "ansi_map.oprcode",
13013             FT_INT32, BASE_DEC, VALS(ansi_map_opr_code_strings), 0,
13014             "", HFILL }
13015         },
13016         { &hf_ansi_map_param_id,
13017             { "Param ID",       "ansi_map.param_id",
13018             FT_UINT32, BASE_HEX, NULL, 0,
13019             "", HFILL }
13020         },
13021         { &hf_ansi_map_billing_id,
13022             { "Billing ID",     "ansi_map.billing_id",
13023             FT_INT32, BASE_DEC, NULL, 0,
13024             "", HFILL }
13025         },
13026         { &hf_ansi_map_ios401_elem_id,
13027             { "IOS 4.0.1 Element ID",   "ansi_map.ios401_elem_id",
13028             FT_NONE, 0, NULL, 0,
13029             "", HFILL }
13030         },
13031         { &hf_ansi_map_min,
13032             { "MIN",            "ansi_map.min",
13033             FT_STRING, BASE_DEC, 0, 0,
13034             "", HFILL }
13035         },
13036         { &hf_ansi_map_number,
13037             { "Number",         "ansi_map.number",
13038             FT_STRING, BASE_DEC, 0, 0,
13039             "", HFILL }
13040         },
13041     };
13042
13043     /* Setup protocol subtree array */
13044 #define NUM_INDIVIDUAL_PARAMS   15
13045     gint *ett[NUM_INDIVIDUAL_PARAMS+NUM_PARAM_1+NUM_PARAM_2+NUM_PARAM_3+NUM_IOS401_ELEM];
13046
13047     memset((void *) ett, -1, sizeof(ett));
13048
13049     ett[0] = &ett_ansi_map;
13050     ett[1] = &ett_opr_code;
13051     ett[2] = &ett_component;
13052     ett[3] = &ett_components;
13053     ett[4] = &ett_param;
13054     ett[5] = &ett_params;
13055     ett[6] = &ett_error;
13056     ett[7] = &ett_problem;
13057     ett[8] = &ett_natnum;
13058     ett[9] = &ett_call_mode;
13059     ett[10] = &ett_chan_data;
13060     ett[11] = &ett_code_chan;
13061     ett[12] = &ett_clr_dig_mask;
13062     ett[13] = &ett_ent_dig_mask;
13063     ett[14] = &ett_all_dig_mask;
13064
13065     last_offset = NUM_INDIVIDUAL_PARAMS;
13066
13067     for (i=0; i < NUM_PARAM_1; i++, last_offset++)
13068     {
13069         ett[last_offset] = &ett_ansi_param_1[i];
13070     }
13071
13072     for (i=0; i < NUM_PARAM_2; i++, last_offset++)
13073     {
13074         ett[last_offset] = &ett_ansi_param_2[i];
13075     }
13076
13077     for (i=0; i < NUM_PARAM_3; i++, last_offset++)
13078     {
13079         ett[last_offset] = &ett_ansi_param_3[i];
13080     }
13081
13082     for (i=0; i < NUM_IOS401_ELEM; i++, last_offset++)
13083     {
13084         ett[last_offset] = &ett_ansi_map_ios401_elem[i];
13085     }
13086
13087     /* Register the protocol name and description */
13088     proto_ansi_map =
13089         proto_register_protocol("ANSI Mobile Application Part",
13090             "ANSI MAP", "ansi_map");
13091
13092     is637_tele_id_dissector_table =
13093         register_dissector_table("ansi_map.tele_id", "IS-637 Teleservice ID",
13094             FT_UINT8, BASE_DEC);
13095
13096     is683_dissector_table =
13097         register_dissector_table("ansi_map.ota", "IS-683-A (OTA)",
13098             FT_UINT8, BASE_DEC);
13099
13100     is801_dissector_table =
13101         register_dissector_table("ansi_map.pld", "IS-801 (PLD)",
13102             FT_UINT8, BASE_DEC);
13103
13104     /* Required function calls to register the header fields and subtrees used */
13105     proto_register_field_array(proto_ansi_map, hf, array_length(hf));
13106     proto_register_subtree_array(ett, array_length(ett));
13107
13108     ansi_map_tap = register_tap("ansi_map");
13109 }
13110
13111
13112 void
13113 proto_reg_handoff_ansi_map(void)
13114 {
13115     dissector_handle_t ansi_map_handle;
13116
13117     ansi_map_handle = create_dissector_handle(dissect_ansi_map, proto_ansi_map);
13118
13119     dissector_add("tcap.ansi_ssn", 5, ansi_map_handle);
13120     dissector_add("tcap.ansi_ssn", 6, ansi_map_handle);
13121     dissector_add("tcap.ansi_ssn", 7, ansi_map_handle);
13122     dissector_add("tcap.ansi_ssn", 8, ansi_map_handle);
13123     dissector_add("tcap.ansi_ssn", 9 , ansi_map_handle);
13124     dissector_add("tcap.ansi_ssn", 10 , ansi_map_handle);
13125     dissector_add("tcap.ansi_ssn", 11 , ansi_map_handle);
13126     dissector_add("tcap.ansi_ssn", 12 , ansi_map_handle);
13127     dissector_add("tcap.ansi_ssn", 13 , ansi_map_handle);
13128     dissector_add("tcap.ansi_ssn", 14 , ansi_map_handle);
13129
13130     data_handle = find_dissector("data");
13131 }