From Clinton Work: dissect Cisco PID 0x010b as STP (it's actually their
[obnox/wireshark/wip.git] / 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: packet-ansi_map.c,v 1.14 2004/03/27 11:32:28 guy Exp $
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 "asn1.h"
114 #include "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     { 0x9F59,   "Inter System Termination" },
219     { 0x9F5A,   "Availability Type" },
220     { 0x9F5B,   "Local Termination" },
221     { 0x9F5C,   "Message Waiting Notification Count" },
222     { 0x9F5D,   "Mobile Directory Number" },
223     { 0x9F5E,   "MSCID Number" },
224     { 0x9F5F,   "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 Number 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     { 0x9F78,   "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     { 0x9F811D, "Target Measurement Information" },
288     { 0x9F811E, "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     { 0x9F8172, "International Mobile Subscriber Identity" },
302     { 0x9F8173, "Calling Party Name" },
303     { 0x9F8174, "Display Text" },
304     { 0x9F8175, "Redirecting Party Name" },
305     { 0x9F8176, "Service ID" },
306     { 0x9F8177, "All Or None" },
307     { 0x9F8178, "Change" },
308     { 0xBF8179, "Data Access Element" },
309     { 0xBF817A, "Data Access Element List" },
310     { 0xBF817E, "Data Update Result" },
311     { 0xBF817F, "Data Update Result List" },
312     { 0x9F812D, "CDMA Pilot PN" },
313     { 0x9F812E, "CDMA Service Configuration Record" },
314     { 0x9F812F, "CDMA Service Option" },
315     { 0x9F8131, "CDMA Station Class Mark 2" },
316     { 0x9F8132, "TDMA Service Code" },
317     { 0x9F8133, "TDMA Terminal Capability" },
318     { 0x9F8134, "TDMA Voice Coder" },
319     { 0x9F8135, "A-Key Protocol Version" },
320     { 0x9F8136, "Authentication Response Reauthentication" },
321     { 0x9F8137, "Base Station Partial Key" },
322     { 0x9F8138, "Mobile Station MIN" },
323     { 0x9F8139, "Mobile Station Partial Key" },
324     { 0x9F813A, "Modulus Value" },
325     { 0x9F813B, "Newly Assigned MIN" },
326     { 0x9F813D, "OTASP Result Code" },
327     { 0x9F813E, "Primitive Value" },
328     { 0x9F813F, "Random Variable Reauthentication" },
329     { 0x9F8140, "Reauthentication Report" },
330     { 0x9F8141, "Service Indicator" },
331     { 0x9F8142, "Signaling Message Encryption Report" },
332     { 0x9F8143, "Temporary Reference Number" },
333     { 0x9F8144, "Voice Privacy Report" },
334     { 0x9F8147, "Control Channel Mode" },
335     { 0x9F8152, "CDMA Connection Reference" },
336     { 0x9F8153, "CDMA Connection Reference Information" },
337     { 0x9F8154, "CDMA Connection Reference List" },
338     { 0x9F8156, "Change Service Attributes" },
339     { 0x9F8157, "Data Key" },
340     { 0x9F8158, "Data Privacy Parameters" },
341     { 0x9F8159, "ISLP Information" }, /* IS-737 *SPEC CONFLICT* */
342     { 0x9F815A, "Reason List" },
343     { 0x9F815C, "TDMA Bandwidth" },
344     { 0x9F815D, "TDMA Data Features Indicator" },
345     { 0x9F815E, "TDMA Data Mode" },
346     { 0x9F815F, "TDMA Voice Mode" },
347     { 0x9F8160, "Analog Redirect Info" },
348     { 0xBF812B, "CDMA Band Class Information" },
349     { 0xBF812C, "CDMA Band Class List" },
350     { 0xBF8130, "CDMA Service Option List" },
351     { 0xBF8153, "CDMA Connection Reference Information" },
352     { 0xBF8154, "CDMA Connection Reference List" },
353     { 0xBF8161, "Analog Redirect Record" },
354     { 0xBF8202, "Execute Script" },
355     { 0xBF8206, "Modification Request" },
356     { 0xBF8207, "Modification Request List" },
357     { 0xBF8208, "Modification Result List" },
358     { 0xBF820E, "Service Data Access Element" },
359     { 0xBF820F, "Service Data Access Element List" },
360     { 0xBF8210, "Service Data Result" },
361     { 0xBF8211, "Service Data Result List" },
362     { 0xBF8214, "Trigger Address List" },
363     { 0xBF8216, "Trigger List" },
364     { 0xBF8218, "WIN Capability" },
365     { 0xBF822F, "Call Recovery ID" },
366     { 0xBF8230, "Call Recovery ID List" },
367     { 0xBF8250, "Position Information" },
368     { 0xBF825A, "CDMA PSMM List" },
369     { 0x9F8162, "CDMA Channel Number" },
370     { 0xBF8163, "CDMA Channel Number List" },
371     { 0x9F8164, "CDMA Power Combined Indicator" },
372     { 0x9F8165, "CDMA Redirect Record" },
373     { 0x9F8166, "CDMA Search Parameters" },
374     { 0x9F8168, "CDMA Network Identification" },
375     { 0x9F8169, "Network TMSI" },
376     { 0x9F816A, "Network TMSI Expiration Time" },
377     { 0x9F816B, "New Network TMSI" },
378     { 0x9F816C, "Required Parameters Mask" },
379     { 0x9F816D, "Service Redirection Cause" },
380     { 0x9F816E, "Service Redirection Info" },
381     { 0x9F816F, "Roaming Indication" },
382     { 0x9F8170, "MSID" },
383     { 0x9F817B, "Data ID" },
384     { 0x9F817C, "Database Key" },
385     { 0x9F817D, "Data Result" },
386     { 0x9F8200, "Data Value" },
387     { 0x9F8203, "Failure Cause" },
388     { 0x9F8204, "Failure Type" },
389     { 0x9F8205, "Global Title" },
390     { 0x9F8209, "Private Specialized Resource" },
391     { 0x9F820A, "Resume PIC" },
392     { 0x9F820B, "Script Argument" },
393     { 0x9F820C, "Script Name" },
394     { 0x9F820D, "Script Result" },
395     { 0x9F8212, "Specialized Resource" },
396     { 0x9F8213, "Time Date Offset" },
397     { 0x9F8215, "Trigger Capability" },
398     { 0x9F8217, "Trigger Type" },
399     { 0x9F8219, "WIN Operations Capability" },
400     { 0x9F821B, "WIN Trigger List" },
401     { 0x9F821C, "MSC Address" },
402     { 0x9F821D, "Suspicious Access" },
403     { 0x9F821E, "Mobile Station IMSI" },
404     { 0x9F821F, "Newly Assigned IMSI" },
405     { 0x9F822A, "Command Code" },
406     { 0x9F822B, "Display Text 2" },
407     { 0x9F822C, "Page Count" },
408     { 0x9F822D, "Page Response Time" },
409     { 0x9F822E, "SMS Transaction ID" },
410     { 0x9F8231, "DMH Service ID" },
411     { 0x9F8232, "Feature Indicator" },
412     { 0x9F8233, "Control Network ID" },
413     { 0x9F8234, "Release Cause" },
414     { 0x9F8235, "Time Of Day" },
415     { 0x9F8236, "Call Status" },
416     { 0x9F8237, "DMH Charge Information" },
417     { 0x9F8238, "DMH Billing Indicator" },
418     { 0x9F8239, "MS Status" },
419     { 0x9F823B, "Position Information Code" },
420     { 0x9F8246, "Inter Message Time" },
421     { 0x9F8247, "MSID Usage" },
422     { 0x9F8248, "New MIN Extension" },
423     { 0x9F8249, "DTX Indication" },
424     { 0x9F824A, "CDMA Mobile Capabilities" },
425     { 0x9F824B, "Generalized Time" },
426     { 0x9F824C, "Generic Digits" },
427     { 0x9F824D, "Geographic Position" },
428     { 0x9F824E, "Mobile Call Status" },
429     { 0x9F824F, "Mobile Position Capability" },
430     { 0x9F8251, "Position Request Type" },
431     { 0x9F8252, "Position Result" },
432     { 0x9F8253, "Position Source" },
433     { 0x9F8254, "ACG Encountered" },
434     { 0x9F8255, "CDMA State/Control Type *" },  /* PN-3590 (ANSI-41-E)/ACG *SPEC CONFLICT* */
435     { 0x9F8256, "Gap Duration" },
436     { 0x9F8257, "SCF Overload Gap Interval" },
437     { 0x9F8258, "Service Management System Gap Interval" },
438     { 0x9F8259, "CDMA PSMM Count" },
439     { 0x9F825B, "CDMA Serving One Way Delay 2" },
440     { 0x9F825C, "QoS Priority" },
441     { 0x9F825D, "PDSN Address" },
442     { 0x9F825E, "PDSN Protocol Type" },
443     { 0x9F825F, "CDMA MS Measured Channel Identity" },
444     { 0x9F8261, "Range" },
445     { 0x9F8263, "Calling Party Category" },
446     { 0x9F8264, "cdma2000 Handoff Invoke IOS Data" },
447     { 0x9F8265, "cdma2000 Handoff Response IOS Data" },
448     { 0x9F8266, "LCS Client ID" },
449     { 0x9F8267, "TDMA MAHO Cell ID" },
450     { 0x9F8268, "TDMA MAHO Channel" },
451     { 0x9F8269, "CDMA Service Option Connection Identifier" },
452     { 0x9F826A, "TDMA Time Alignment" },
453     { 0x9F826C, "TDMA MAHO Request" },
454     { 0, NULL },
455 };
456
457 /* ANSI TCAP component type */
458 #define ANSI_TC_INVOKE_L 0xe9
459 #define ANSI_TC_RRL 0xea
460 #define ANSI_TC_RE 0xeb
461 #define ANSI_TC_REJECT 0xec
462 #define ANSI_TC_INVOKE_N 0xed
463 #define ANSI_TC_RRN 0xee
464
465 static const value_string ansi_cmp_type_strings[] = {
466     { ANSI_TC_INVOKE_L,         "Invoke(Last)" },
467     { ANSI_TC_RRL,              "RetRes(Last)" },
468     { ANSI_TC_RE,               "RetErr" },
469     { ANSI_TC_REJECT,           "Reject" },
470     { ANSI_TC_INVOKE_N,         "Invoke(Not Last)" },
471     { ANSI_TC_RRN,              "RetRes(Not Last)" },
472     { 0, NULL },
473 };
474
475 const value_string ansi_map_opr_code_strings[] = {
476     { 1,        "Handoff Measurement Request" },
477     { 2,        "Facilities Directive" },
478     { 3,        "Mobile On Channel" },
479     { 4,        "Handoff Back" },
480     { 5,        "Facilities Release" },
481     { 6,        "Qualification Request" },
482     { 7,        "Qualification Directive" },
483     { 8,        "Blocking" },
484     { 9,        "Unblocking" },
485     { 10,       "Reset Circuit" },
486     { 11,       "Trunk Test" },
487     { 12,       "Trunk Test Disconnect" },
488     { 13,       "Registration Notification" },
489     { 14,       "Registration Cancellation" },
490     { 15,       "Location Request" },
491     { 16,       "Routing Request" },
492     { 17,       "Feature Request" },
493     { 18,       "Reserved 18 (Service Profile Request, IS-41-C)" },
494     { 19,       "Reserved 19 (Service Profile Directive, IS-41-C)" },
495     { 20,       "Unreliable Roamer Data Directive" },
496     { 21,       "Reserved 21 (Call Data Request, IS-41-C)" },
497     { 22,       "MS Inactive" },
498     { 23,       "Transfer To Number Request" },
499     { 24,       "Redirection Request" },
500     { 25,       "Handoff To Third" },
501     { 26,       "Flash Request" },
502     { 27,       "Authentication Directive" },
503     { 28,       "Authentication Request" },
504     { 29,       "Base Station Challenge" },
505     { 30,       "Authentication Failure Report" },
506     { 31,       "Count Request" },
507     { 32,       "Inter System Page" },
508     { 33,       "Unsolicited Response" },
509     { 34,       "Bulk Deregistration" },
510     { 35,       "Handoff Measurement Request 2" },
511     { 36,       "Facilities Directive 2" },
512     { 37,       "Handoff Back 2" },
513     { 38,       "Handoff To Third 2" },
514     { 39,       "Authentication Directive Forward" },
515     { 40,       "Authentication Status Report" },
516     { 41,       "Reserved 41" },
517     { 42,       "Information Directive" },
518     { 43,       "Information Forward" },
519     { 44,       "Inter System Answer" },
520     { 45,       "Inter System Page 2" },
521     { 46,       "Inter System Setup" },
522     { 47,       "Origination Request" },
523     { 48,       "Random Variable Request" },
524     { 49,       "Redirection Directive" },
525     { 50,       "Remote User Interaction Directive" },
526     { 51,       "SMS Delivery Backward" },
527     { 52,       "SMS Delivery Forward" },
528     { 53,       "SMS Delivery Point to Point" },
529     { 54,       "SMS Notification" },
530     { 55,       "SMS Request" },
531     { 56,       "OTASP Request" },
532     { 57,       "Information Backward" },
533     { 58,       "Change Facilities" },
534     { 59,       "Change Service" },
535     { 60,       "Parameter Request" },
536     { 61,       "TMSI Directive" },
537     { 62,       "Reserved 62" },
538     { 63,       "Service Request" },
539     { 64,       "Analyzed Information Request" },
540     { 65,       "Connection Failure Report" },
541     { 66,       "Connect Resource" },
542     { 67,       "Disconnect Resource" },
543     { 68,       "Facility Selected and Available" },
544     { 69,       "Instruction Request" },
545     { 70,       "Modify" },
546     { 71,       "Reset Timer" },
547     { 72,       "Search" },
548     { 73,       "Seize Resource" },
549     { 74,       "SRF Directive" },
550     { 75,       "T Busy" },
551     { 76,       "T NoAnswer" },
552     { 77,       "Release" },
553     { 78,       "SMS Delivery Point to Point Ack" },
554     { 79,       "Message Directive" },
555     { 80,       "Bulk Disconnection" },
556     { 81,       "Call Control Directive" },
557     { 82,       "O Answer" },
558     { 83,       "O Disconnect" },
559     { 84,       "Call Recovery Report" },
560     { 85,       "T Answer" },
561     { 86,       "T Disconnect" },
562     { 87,       "Unreliable Call Data" },
563     { 88,       "O CalledPartyBusy" },
564     { 89,       "O NoAnswer" },
565     { 90,       "Position Request" },
566     { 91,       "Position Request Forward" },
567     { 92,       "Call Termination Report" },
568     { 93,       "Geo Position Directive" },
569     { 94,       "Geo Position Request" },
570     { 95,       "Inter System Position Request" },
571     { 96,       "Inter System Position Request Forward" },
572     { 97,       "ACG Directive" },
573     { 98,       "Roamer Database Verification Request" },
574     { 99,       "Add Service" },
575     { 100,      "Drop Service" },
576     { 0, NULL },
577 };
578
579 static const value_string ansi_tele_strings[] = {
580     { 1,        "Reserved for maintenance" },
581     { 4096,     "AMPS Extended Protocol Enhanced Services" },
582     { 4097,     "CDMA Cellular Paging Teleservice" },
583     { 4098,     "CDMA Cellular Messaging Teleservice" },
584     { 4099,     "CDMA Voice Mail Notification" },
585     { 32513,    "TDMA Cellular Messaging Teleservice" },
586     { 32520,    "TDMA System Assisted Mobile Positioning through Satellite (SAMPS)" },
587     { 32584,    "TDMA Segmented System Assisted Mobile Positioning Service" },
588     { 0, NULL },
589 };
590
591 #define NUM_BAND_CLASS_STR      (sizeof(band_class_str)/sizeof(gchar *))
592 static gchar *band_class_str[] = {
593     "800 MHz Cellular System",
594     "1.850 to 1.990 GHz Broadband PCS",
595     "872 to 960 MHz TACS Band",
596     "832 to 925 MHz JTACS Band",
597     "1.750 to 1.870 GHz Korean PCS",
598     "450 MHz NMT",
599     "2 GHz IMT-2000 Band",
600     "North American 700 MHz Cellular Band",
601     "1.710 to 1.880 GHz PCS",
602     "880 to 960 MHz Band",
603     "Secondary 800 MHz Band",
604     "400 MHz European PAMR Band",
605     "800 MHz European PAMR Band"
606 };
607
608 #define NUM_QOS_PRI_STR         (sizeof(qos_pri_str)/sizeof(gchar *))
609 static gchar *qos_pri_str[] = {
610     "Priority Level 0.  This is the lowest level",
611     "Priority Level 1",
612     "Priority Level 2",
613     "Priority Level 3",
614     "Priority Level 4",
615     "Priority Level 5",
616     "Priority Level 6",
617     "Priority Level 7",
618     "Priority Level 8",
619     "Priority Level 9",
620     "Priority Level 10",
621     "Priority Level 11",
622     "Priority Level 12",
623     "Priority Level 13",
624     "Reserved, treat as Priority Level 14",
625     "Reserved, treat as Priority Level 15"
626 };
627
628 /*
629  * would prefer to have had the define set to the exact number of
630  * elements in the array but that is not without it's own problems
631  * (sizeof(ansi_a_ios401_elem_1_strings)/sizeof(value_string))
632  */
633 #define NUM_IOS401_ELEM ANSI_A_MAX_NUM_IOS401_ELEM_1_STRINGS
634 static gint ett_ansi_map_ios401_elem[NUM_IOS401_ELEM];
635
636
637 /* Initialize the protocol and registered fields */
638 static int proto_ansi_map = -1;
639
640 static int ansi_map_tap = -1;
641
642 static int hf_ansi_map_tag = -1;
643 static int hf_ansi_map_length = -1;
644 static int hf_ansi_map_id = -1;
645 static int hf_ansi_map_opr_code = -1;
646 static int hf_ansi_map_param_id = -1;
647 static int hf_ansi_map_ios401_elem_id = -1;
648
649
650 /* Initialize the subtree pointers */
651 static gint ett_ansi_map = -1;
652 static gint ett_opr_code = -1;
653 static gint ett_component = -1;
654 static gint ett_components = -1;
655 static gint ett_params = -1;
656 static gint ett_param = -1;
657 static gint ett_error = -1;
658 static gint ett_problem = -1;
659 static gint ett_natnum = -1;
660 static gint ett_call_mode = -1;
661 static gint ett_chan_data = -1;
662 static gint ett_code_chan = -1;
663 static gint ett_clr_dig_mask = -1;
664 static gint ett_ent_dig_mask = -1;
665 static gint ett_all_dig_mask = -1;
666
667
668 static char bigbuf[1024];
669 static gchar ansi_map_add_string[1024];
670 static dissector_handle_t data_handle;
671 static dissector_table_t is637_tele_id_dissector_table; /* IS-637 Teleservice ID */
672 static dissector_table_t is683_dissector_table; /* IS-683-A (OTA) */
673 static dissector_table_t is801_dissector_table; /* IS-801 (PLD) */
674 static packet_info *g_pinfo;
675 static proto_tree *g_tree;
676 static gint32 ansi_map_sms_tele_id = -1;
677 static gboolean is683_ota;
678 static gboolean is801_pld;
679 static gboolean ansi_map_is_invoke;
680
681
682 typedef struct dgt_set_t
683 {
684     unsigned char out[15];
685 }
686 dgt_set_t;
687
688 static dgt_set_t Dgt_tbcd = {
689     {
690   /*  0   1   2   3   4   5   6   7   8   9   a   b   c   d   e */
691      '0','1','2','3','4','5','6','7','8','9','?','B','C','*','#'
692     }
693 };
694
695 static dgt_set_t Dgt_msid = {
696     {
697   /*  0   1   2   3   4   5   6   7   8   9   a   b   c   d   e */
698      '0','1','2','3','4','5','6','7','8','9','?','?','?','?','?'
699     }
700 };
701
702 /* FUNCTIONS */
703
704 /*
705  * Unpack BCD input pattern into output ASCII pattern
706  *
707  * Input Pattern is supplied using the same format as the digits
708  *
709  * Returns: length of unpacked pattern
710  */
711 static int
712 my_dgt_tbcd_unpack(
713     char        *out,           /* ASCII pattern out */
714     guchar      *in,            /* packed pattern in */
715     int         num_octs,       /* Number of octets to unpack */
716     dgt_set_t   *dgt            /* Digit definitions */
717     )
718 {
719     int cnt = 0;
720     unsigned char i;
721
722     while (num_octs)
723     {
724         /*
725          * unpack first value in byte
726          */
727         i = *in++;
728         *out++ = dgt->out[i & 0x0f];
729         cnt++;
730
731         /*
732          * unpack second value in byte
733          */
734         i >>= 4;
735
736         if (i == 0x0f)  /* odd number bytes - hit filler */
737             break;
738
739         *out++ = dgt->out[i];
740         cnt++;
741         num_octs--;
742     }
743
744     *out = '\0';
745
746     return(cnt);
747 }
748
749 static gchar *
750 my_match_strval(guint32 val, const value_string *vs, gint *idx)
751 {
752     gint i = 0;
753
754     while (vs[i].strptr)
755     {
756         if (vs[i].value == val)
757         {
758             *idx = i;
759             return(vs[i].strptr);
760         }
761
762         i++;
763     }
764
765     *idx = -1;
766     return(NULL);
767 }
768
769
770 /* PARAM FUNCTIONS */
771
772 #define EXTRANEOUS_DATA_CHECK(edc_len, edc_max_len) \
773     if ((edc_len) > (edc_max_len)) \
774     { \
775         proto_tree_add_text(tree, asn1->tvb, \
776             asn1->offset, (edc_len) - (edc_max_len), "Extraneous Data"); \
777         asn1->offset += ((edc_len) - (edc_max_len)); \
778     }
779
780 #define SHORT_DATA_CHECK(sdc_len, sdc_min_len) \
781     if ((sdc_len) < (sdc_min_len)) \
782     { \
783         proto_tree_add_text(tree, asn1->tvb, \
784             asn1->offset, (sdc_len), "Short Data (?)"); \
785         asn1->offset += (sdc_len); \
786         return; \
787     }
788
789 #define EXACT_DATA_CHECK(edc_len, edc_eq_len) \
790     if ((edc_len) != (edc_eq_len)) \
791     { \
792         proto_tree_add_text(tree, asn1->tvb, \
793             asn1->offset, (edc_len), "Unexpected Data Length"); \
794         asn1->offset += (edc_len); \
795         return; \
796     }
797
798 static void
799 param_mscid(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
800 {
801     gint32 market_id, switch_num;
802     guint saved_offset;
803
804     EXACT_DATA_CHECK(len, 3);
805
806     add_string = add_string;
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)
820 {
821     gint32 value;
822     guint saved_offset;
823     gchar *str = NULL;
824
825     add_string = add_string;
826     saved_offset = asn1->offset;
827
828     asn1_int32_value_decode(asn1, 1, &value);
829
830     switch (value)
831     {
832     case 0: str = "Not used"; break;
833     case 1: str = "Page"; break;
834     case 2: str = "Listen only"; break;
835     default:
836         if ((value >= 3) && (value <= 223)) { str = "Reserved, treat as Page"; }
837         else { str = "Reserved for protocol extension, treat as Page"; }
838         break;
839     }
840
841     proto_tree_add_text(tree, asn1->tvb,
842         saved_offset, asn1->offset - saved_offset,
843         str);
844
845     EXTRANEOUS_DATA_CHECK(len, 1);
846 }
847
848 static void
849 param_srvc_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
850 {
851     gint32 value;
852     guint saved_offset;
853     gchar *str = NULL;
854
855     EXACT_DATA_CHECK(len, 1);
856
857     add_string = add_string;
858     saved_offset = asn1->offset;
859
860     asn1_int32_value_decode(asn1, 1, &value);
861
862     switch (value)
863     {
864     case 0: str = "Undefined Service"; break;
865     case 1: str = "CDMA OTASP Service"; is683_ota = TRUE; break;
866     case 2: str = "TDMA OTASP Service"; break;
867     case 3: str = "CDMA OTAPA Service"; is683_ota = TRUE; break;
868     case 4: str = "CDMA Position Determination Service";  is801_pld = TRUE; break;
869     case 5: str = "AMPS Position Determination Service"; break;
870     default:
871         if ((value >= 6) && (value <= 223)) { str = "Reserved, treat as Undefined Service"; }
872         else { str = "Reserved for protocol extension, treat as Undefined Service"; }
873         break;
874     }
875
876     proto_tree_add_text(tree, asn1->tvb,
877         saved_offset, asn1->offset - saved_offset,
878         "%s (%u)",
879         str,
880         value);
881 }
882
883 static void
884 param_sme_report(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
885 {
886     gint32 value;
887     guint saved_offset;
888     gchar *str = NULL;
889
890     EXACT_DATA_CHECK(len, 1);
891
892     add_string = add_string;
893     saved_offset = asn1->offset;
894
895     asn1_int32_value_decode(asn1, 1, &value);
896
897     switch (value)
898     {
899     case 0: str = "Not used"; break;
900     case 1: str = "Signaling Message Encryption enabling not attempted"; break;
901     case 2: str = "Signaling Message Encryption enabling no response"; break;
902     case 3: str = "Signaling Message Encryption is enabled"; break;
903     case 4: str = "Signaling Message Encryption enabling failed"; break;
904     default:
905         if ((value >= 5) && (value <= 223)) { str = "Reserved, treat as Signaling Message Encryption enabling not attempted"; }
906         else { str = "Reserved for protocol extension, treat as Signaling Message Encryption enabling not attempted"; }
907         break;
908     }
909
910     proto_tree_add_text(tree, asn1->tvb,
911         saved_offset, asn1->offset - saved_offset,
912         "%s (%u)",
913         str,
914         value);
915 }
916
917 static void
918 param_alert_code(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
919 {
920     gint32 value;
921     guint saved_offset;
922     gchar *str = NULL;
923
924     SHORT_DATA_CHECK(len, 2);
925
926     add_string = add_string;
927     saved_offset = asn1->offset;
928
929     asn1_int32_value_decode(asn1, 1, &value);
930
931     switch ((value & 0xc0) >> 6)
932     {
933     case 0: str = "Medium"; break;
934     case 1: str = "High"; break;
935     case 2: str = "Low"; break;
936     case 3: str = "Reserved"; break;
937     }
938
939     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
940     proto_tree_add_text(tree, asn1->tvb,
941         saved_offset, asn1->offset - saved_offset,
942         "%s :  Pitch, %s",
943         bigbuf,
944         str);
945
946     switch (value & 0x3f)
947     {
948     case 0: str = "NoTone"; break;
949     case 1: str = "Long"; break;
950     case 2: str = "ShortShort"; break;
951     case 3: str = "ShortShortLong"; break;
952     case 4: str = "ShortShort2"; break;
953     case 5: str = "ShortLongShort"; break;
954     case 6: str = "ShortShortShortShort"; break;
955     case 7: str = "PBXLong"; break;
956     case 8: str = "PBXShortShort"; break;
957     case 9: str = "PBXShortShortLong"; break;
958     case 10: str = "PBXShortLongShort"; break;
959     case 11: str = "PBXShortShortShortShort"; break;
960     case 12: str = "PipPipPipPip"; break;
961     default:
962         str = "Reserved, treat as NoTone";
963         break;
964     }
965
966     other_decode_bitfield_value(bigbuf, value, 0x3f, 8);
967     proto_tree_add_text(tree, asn1->tvb,
968         saved_offset, asn1->offset - saved_offset,
969         "%s :  Cadence, %s",
970         bigbuf,
971         str);
972
973     add_string = add_string;
974     saved_offset = asn1->offset;
975
976     asn1_int32_value_decode(asn1, 1, &value);
977
978     other_decode_bitfield_value(bigbuf, value, 0xf8, 8);
979     proto_tree_add_text(tree, asn1->tvb,
980         saved_offset, asn1->offset - saved_offset,
981         "%s :  Reserved",
982         bigbuf);
983
984     switch (value & 0x07)
985     {
986     case 0: str = "Alert without waiting to report"; break;
987     case 1: str = "Apply a reminder alert once"; break;
988     default:
989         str = "Reserved, treat as Alert without waiting to report";
990         break;
991     }
992
993     other_decode_bitfield_value(bigbuf, value, 0x07, 8);
994     proto_tree_add_text(tree, asn1->tvb,
995         saved_offset, asn1->offset - saved_offset,
996         "%s :  Alert Action, %s",
997         bigbuf,
998         str);
999
1000     EXTRANEOUS_DATA_CHECK(len, 2);
1001 }
1002
1003 static void
1004 param_term_acc_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
1005 {
1006     gint32 value;
1007     guint saved_offset;
1008     gchar *str = NULL;
1009
1010     add_string = add_string;
1011     saved_offset = asn1->offset;
1012
1013     asn1_int32_value_decode(asn1, 1, &value);
1014
1015     switch (value)
1016     {
1017     case 0: str = "Not used"; break;
1018     case 252: str = "Mobile-to-Mobile Directory Number access"; break;
1019     case 253: str = "Land-to-Mobile Directory Number access"; break;
1020     case 254: str = "Land-to-Mobile Directory Number access"; break;
1021     case 255: str = "Roamer port access"; break;
1022     default:
1023         if ((value >= 1) && (value <= 127)) { str = "Reserved for controlling system assignment"; }
1024         else if ((value >= 128) && (value <= 160)) { str = "Reserved for protocol extension, treat as Land-to-Mobile Directory Number access"; }
1025         else { str = "Reserved"; }
1026         break;
1027     }
1028
1029     proto_tree_add_text(tree, asn1->tvb,
1030         saved_offset, asn1->offset - saved_offset,
1031         str);
1032
1033     EXTRANEOUS_DATA_CHECK(len, 1);
1034 }
1035
1036 static void
1037 param_term_treat(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
1038 {
1039     gint32 value;
1040     guint saved_offset;
1041     gchar *str = NULL;
1042
1043     add_string = add_string;
1044     saved_offset = asn1->offset;
1045
1046     asn1_int32_value_decode(asn1, 1, &value);
1047
1048     switch (value)
1049     {
1050     case 0: str = "Not used"; break;
1051     case 1: str = "MS Termination"; break;
1052     case 2: str = "Voice Mail Storage"; break;
1053     case 3: str = "Voice Mail Retrieval"; break;
1054     case 4: str = "Dialogue Termination"; break;
1055     default:
1056         if ((value >= 5) && (value <= 223)) { str = "Reserved, treat as Unrecognized parameter value"; }
1057         else { str = "Reserved for protocol extension, treat as Unrecognized parameter value"; }
1058         break;
1059     }
1060
1061     proto_tree_add_text(tree, asn1->tvb,
1062         saved_offset, asn1->offset - saved_offset,
1063         str);
1064
1065     EXTRANEOUS_DATA_CHECK(len, 1);
1066 }
1067
1068 static void
1069 param_term_trig(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
1070 {
1071     gint32 value;
1072     guint saved_offset;
1073     gchar *str = NULL;
1074
1075     SHORT_DATA_CHECK(len, 2);
1076
1077     add_string = add_string;
1078     saved_offset = asn1->offset;
1079
1080     asn1_int32_value_decode(asn1, 1, &value);
1081
1082     switch ((value & 0xc0) >> 6)
1083     {
1084     case 0: str = "No Answer Call"; break;
1085     case 1: str = "No Answer Trigger"; break;
1086     case 2: str = "No Answer Leg"; break;
1087     case 3: str = "Reserved"; break;
1088     }
1089
1090     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
1091     proto_tree_add_text(tree, asn1->tvb,
1092         saved_offset, asn1->offset - saved_offset,
1093         "%s :  No Answer (NA), %s",
1094         bigbuf,
1095         str);
1096
1097     switch ((value & 0x30) >> 4)
1098     {
1099     case 0: str = "No Page Response Call"; break;
1100     case 1: str = "No Page Response Trigger"; break;
1101     case 2: str = "No Page Response Leg"; break;
1102     case 3: str = "Reserved"; break;
1103     }
1104
1105     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
1106     proto_tree_add_text(tree, asn1->tvb,
1107         saved_offset, asn1->offset - saved_offset,
1108         "%s :  No Page Response (NPR), %s",
1109         bigbuf,
1110         str);
1111
1112     switch ((value & 0x0c) >> 2)
1113     {
1114     case 0: str = "Failed Call"; break;
1115     case 1: str = "Routing Failure Trigger"; break;
1116     case 2: str = "Failed Leg"; break;
1117     case 3: str = "Reserved"; break;
1118     }
1119
1120     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
1121     proto_tree_add_text(tree, asn1->tvb,
1122         saved_offset, asn1->offset - saved_offset,
1123         "%s :  Routing Failure (RF), %s",
1124         bigbuf,
1125         str);
1126
1127     switch (value & 0x03)
1128     {
1129     case 0: str = "Busy Call"; break;
1130     case 1: str = "Busy Trigger"; break;
1131     case 2: str = "Busy Leg"; break;
1132     case 3: str = "Reserved"; break;
1133     }
1134
1135     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
1136     proto_tree_add_text(tree, asn1->tvb,
1137         saved_offset, asn1->offset - saved_offset,
1138         "%s :  Busy, %s",
1139         bigbuf,
1140         str);
1141
1142     add_string = add_string;
1143     saved_offset = asn1->offset;
1144
1145     asn1_int32_value_decode(asn1, 1, &value);
1146
1147     other_decode_bitfield_value(bigbuf, value, 0xfe, 8);
1148     proto_tree_add_text(tree, asn1->tvb,
1149         saved_offset, asn1->offset - saved_offset,
1150         "%s :  Reserved",
1151         bigbuf);
1152
1153     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
1154     proto_tree_add_text(tree, asn1->tvb,
1155         saved_offset, asn1->offset - saved_offset,
1156         "%s :  None Reachable (NR), %s",
1157         bigbuf,
1158         (value & 0x01) ? "Group Not Reachable" : "Member Not Reachable");
1159
1160     EXTRANEOUS_DATA_CHECK(len, 2);
1161 }
1162
1163 static void
1164 param_aav(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
1165 {
1166     gint32 value;
1167     guint saved_offset;
1168
1169     add_string = add_string;
1170     saved_offset = asn1->offset;
1171
1172     asn1_int32_value_decode(asn1, 1, &value);
1173
1174     proto_tree_add_text(tree, asn1->tvb,
1175         saved_offset, asn1->offset - saved_offset,
1176         "Value as used in the CAVE algorithm (%u)",
1177         value);
1178
1179     EXTRANEOUS_DATA_CHECK(len, 1);
1180 }
1181
1182 static void
1183 param_ann_code(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
1184 {
1185     gint32 value;
1186     guint saved_offset;
1187     gchar *str = NULL;
1188
1189     SHORT_DATA_CHECK(len, 3);
1190
1191     add_string = add_string;
1192     saved_offset = asn1->offset;
1193
1194     asn1_int32_value_decode(asn1, 1, &value);
1195
1196     switch (value)
1197     {
1198     case 0: str = "Dialtone"; break;
1199     case 1: str = "Ringback or Audible Alerting"; break;
1200     case 2: str = "Intercept or Mobile Reorder"; break;
1201     case 3: str = "Congestion or Reorder"; break;
1202     case 4: str = "Busy"; break;
1203     case 5: str = "Confirmation"; break;
1204     case 6: str = "Answer"; break;
1205     case 7: str = "Call Waiting"; break;
1206     case 8: str = "Offhook"; break;
1207     case 17: str = "Recall Dial"; break;
1208     case 18: str = "Barge In"; break;
1209     case 20: str = "PPC Insufficient"; break;
1210     case 21: str = "PPC Warning 1"; break;
1211     case 22: str = "PPC Warning 2"; break;
1212     case 23: str = "PPC Warning 3"; break;
1213     case 24: str = "PPC Disconnect"; break;
1214     case 25: str = "PPC Redirect"; break;
1215     case 63: str = "Tones Off"; break;
1216     case 192: str = "Pip"; break;
1217     case 193: str = "Abbreviated Intercept"; break;
1218     case 194: str = "Abbreviated Congestion"; break;
1219     case 195: str = "Warning"; break;
1220     case 196: str = "Denial Tone Burst"; break;
1221     case 197: str = "Dial Tone Burst"; break;
1222     case 250: str = "Incoming Additional Call"; break;
1223     case 251: str = "Priority Additional Call"; break;
1224     default:
1225         str = "Reserved, treat as Tones Off";
1226         break;
1227     }
1228
1229     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
1230     proto_tree_add_text(tree, asn1->tvb,
1231         saved_offset, asn1->offset - saved_offset,
1232         "%s :  Tone %u, %s",
1233         bigbuf,
1234         value,
1235         str);
1236
1237     saved_offset = asn1->offset;
1238
1239     asn1_int32_value_decode(asn1, 1, &value);
1240
1241     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
1242     proto_tree_add_text(tree, asn1->tvb,
1243         saved_offset, asn1->offset - saved_offset,
1244         "%s :  Reserved",
1245         bigbuf);
1246
1247     switch (value & 0x0f)
1248     {
1249     case 0: str = "Concurrent"; break;
1250     case 1: str = "Sequential"; break;
1251     default:
1252         if ((value >= 2) && (value <= 7)) { str = "Reserved, treat as Concurrent"; }
1253         else { str = "Reserved, treat as Sequential"; }
1254         break;
1255     }
1256
1257     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
1258     proto_tree_add_text(tree, asn1->tvb,
1259         saved_offset, asn1->offset - saved_offset,
1260         "%s :  Class %s",
1261         bigbuf,
1262         str);
1263
1264     saved_offset = asn1->offset;
1265
1266     asn1_int32_value_decode(asn1, 1, &value);
1267
1268     switch (value)
1269     {
1270     case 0: str = "None"; break;
1271     case 1: str = "Unauthorized User"; break;
1272     case 2: str = "Invalid ESN"; break;
1273     case 3: str = "Unauthorized Mobile"; break;
1274     case 4: str = "Suspended Origination"; break;
1275     case 5: str = "Origination Denied"; break;
1276     case 6: str = "Service Area Denial"; break;
1277     case 16: str = "Partial Dial"; break;
1278     case 17: str = "Require 1 Plus"; break;
1279     case 18: str = "Require 1 Plus NPA"; break;
1280     case 19: str = "Require 0 Plus"; break;
1281     case 20: str = "Require 0 Plus NPA"; break;
1282     case 21: str = "Deny 1 Plus"; break;
1283     case 22: str = "Unsupported 10 plus"; break;
1284     case 23: str = "Deny 10 plus"; break;
1285     case 24: str = "Unsupported 10 XXX"; break;
1286     case 25: str = "Deny 10 XXX"; break;
1287     case 26: str = "Deny 10 XXX Locally"; break;
1288     case 27: str = "Require 10 Plus"; break;
1289     case 28: str = "Require NPA"; break;
1290     case 29: str = "Deny Toll Origination"; break;
1291     case 30: str = "Deny International Origination"; break;
1292     case 31: str = "Deny 0 Minus"; break;
1293     case 48: str = "Deny Number"; break;
1294     case 49: str = "Alternate Operator Services"; break;
1295     case 64: str = "No Circuit or All Circuits Busy or FacilityProblem"; break;
1296     case 65: str = "Overload"; break;
1297     case 66: str = "Internal Office Failure"; break;
1298     case 67: str = "No Wink Received"; break;
1299     case 68: str = "Interoffice Link Failure"; break;
1300     case 69: str = "Vacant"; break;
1301     case 70: str = "Invalid Prefix or Invalid Access Code"; break;
1302     case 71: str = "Other Dialing Irregularity"; break;
1303     case 80: str = "Vacant Number or Disconnected Number"; break;
1304     case 81: str = "Deny Termination"; break;
1305     case 82: str = "Suspended Termination"; break;
1306     case 83: str = "Changed Number"; break;
1307     case 84: str = "Inaccessible Subscriber"; break;
1308     case 85: str = "Deny Incoming Toll"; break;
1309     case 86: str = "Roamer Access Screening"; break;
1310     case 87: str = "Refuse Call"; break;
1311     case 88: str = "Redirect Call"; break;
1312     case 89: str = "No Page Response"; break;
1313     case 90: str = "No Answer"; break;
1314     case 96: str = "Roamer Intercept"; break;
1315     case 97: str = "General Information"; break;
1316     case 112: str = "Unrecognized Feature Code"; break;
1317     case 113: str = "Unauthorized Feature Code"; break;
1318     case 114: str = "Restricted Feature Code"; break;
1319     case 115: str = "Invalid Modifier Digits"; break;
1320     case 116: str = "Successful Feature Registration"; break;
1321     case 117: str = "Successful Feature Deregistration"; break;
1322     case 118: str = "Successful Feature Activation"; break;
1323     case 119: str = "Successful Feature Deactivation"; break;
1324     case 120: str = "Invalid Forward To Number"; break;
1325     case 121: str = "Courtesy Call Warning"; break;
1326     case 128: str = "Enter PIN Send Prompt"; break;
1327     case 129: str = "Enter PIN Prompt"; break;
1328     case 130: str = "Reenter PIN Send Prompt"; break;
1329     case 131: str = "Reenter PIN Prompt"; break;
1330     case 132: str = "Enter Old PIN Send Prompt"; break;
1331     case 133: str = "Enter Old PIN Prompt"; break;
1332     case 134: str = "Enter New PIN Send Prompt"; break;
1333     case 135: str = "Enter New PIN Prompt"; break;
1334     case 136: str = "Reenter New PIN Send Prompt"; break;
1335     case 137: str = "Reenter New PIN Prompt"; break;
1336     case 138: str = "Enter Password Prompt"; break;
1337     case 139: str = "Enter Directory Number Prompt"; break;
1338     case 140: str = "Reenter Directory Number Prompt"; break;
1339     case 141: str = "Enter Feature Code Prompt"; break;
1340     case 142: str = "Enter Credit Card Number Prompt"; break;
1341     case 143: str = "Enter Destination Number Prompt"; break;
1342     case 152: str = "PPC Insufficient Account Balance"; break;
1343     case 153: str = "PPC Five Minute Warning"; break;
1344     case 154: str = "PPC Three Minute Warning"; break;
1345     case 155: str = "PPC Two Minute Warning"; break;
1346     case 156: str = "PPC One Minute Warning"; break;
1347     case 157: str = "PPC Disconnect"; break;
1348     case 158: str = "PPC Redirect"; break;
1349     default:
1350         str = "Reserved, treat as None";
1351         break;
1352     }
1353
1354     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
1355     proto_tree_add_text(tree, asn1->tvb,
1356         saved_offset, asn1->offset - saved_offset,
1357         "%s :  Standard Announcement, %s",
1358         bigbuf,
1359         str);
1360
1361     if (len == 3) return;
1362
1363     saved_offset = asn1->offset;
1364
1365     asn1_int32_value_decode(asn1, 1, &value);
1366
1367     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
1368     proto_tree_add_text(tree, asn1->tvb,
1369         saved_offset, asn1->offset - saved_offset,
1370         "%s :  Custom Announcement %u",
1371         bigbuf,
1372         value);
1373
1374     EXTRANEOUS_DATA_CHECK(len, 4);
1375 }
1376
1377 static void
1378 param_alert_res(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
1379 {
1380     gint32 value;
1381     guint saved_offset;
1382     gchar *str = NULL;
1383
1384     add_string = add_string;
1385     saved_offset = asn1->offset;
1386
1387     asn1_int32_value_decode(asn1, 1, &value);
1388
1389     switch (value)
1390     {
1391     case 0: str = "Not specified"; break;
1392     case 1: str = "Success"; break;
1393     case 2: str = "Failure"; break;
1394     case 3: str = "Denied"; break;
1395     case 4: str = "Not attempted"; break;
1396     case 5: str = "No page response"; break;
1397     case 6: str = "Busy"; break;
1398     default:
1399         str = "Reserved, treat as Not specified";
1400         break;
1401     }
1402
1403     proto_tree_add_text(tree, asn1->tvb,
1404         saved_offset, asn1->offset - saved_offset,
1405         str);
1406
1407     EXTRANEOUS_DATA_CHECK(len, 1);
1408 }
1409
1410 static void
1411 param_conf_call_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
1412 {
1413     gint32 value;
1414     guint saved_offset;
1415     gchar *str = NULL;
1416
1417     add_string = add_string;
1418     saved_offset = asn1->offset;
1419
1420     asn1_int32_value_decode(asn1, 1, &value);
1421
1422     switch (value)
1423     {
1424     case 0: str = ", Not specified"; break;
1425     case 255: str = ", Unlimited number of conferees"; break;
1426     default:
1427         str = "";
1428         break;
1429     }
1430
1431     proto_tree_add_text(tree, asn1->tvb,
1432         saved_offset, asn1->offset - saved_offset,
1433         "Maximum Number of Conferees, (%u)%s",
1434         value,
1435         str);
1436
1437     EXTRANEOUS_DATA_CHECK(len, 1);
1438 }
1439
1440 static void
1441 param_count_upd_report(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
1442 {
1443     gint32 value;
1444     guint saved_offset;
1445     gchar *str = NULL;
1446
1447     add_string = add_string;
1448     saved_offset = asn1->offset;
1449
1450     asn1_int32_value_decode(asn1, 1, &value);
1451
1452     switch (value)
1453     {
1454     case 0: str = "Not used"; break;
1455     case 1: str = "COUNT Update not attempted"; break;
1456     case 2: str = "COUNT Update no response"; break;
1457     case 3: str = "COUNT Update successful"; break;
1458     default:
1459         if ((value >= 4) && (value <= 223)) { str = "Reserved, treat as COUNT Update not attempted"; }
1460         else { str = "Reserved for protocol extension, treat as COUNT Update not attempted"; }
1461         break;
1462     }
1463
1464     proto_tree_add_text(tree, asn1->tvb,
1465         saved_offset, asn1->offset - saved_offset,
1466         str);
1467
1468     EXTRANEOUS_DATA_CHECK(len, 1);
1469 }
1470
1471 static void
1472 param_ssd_upd_report(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
1473 {
1474     gint32 value;
1475     guint saved_offset;
1476     gchar *str = NULL;
1477
1478     add_string = add_string;
1479     saved_offset = asn1->offset;
1480
1481     asn1_int32_value_decode(asn1, 1, &value);
1482
1483     switch (value)
1484     {
1485     case 0: str = "Not used"; break;
1486     case 1: str = "SSD Update not attempted"; break;
1487     case 2: str = "SSD Update no response"; break;
1488     case 3: str = "SSD Update successful"; break;
1489     case 4: str = "SSD Update failed"; break;
1490     default:
1491         if ((value >= 5) && (value <= 223)) { str = "Reserved, treat as SSD Update not attempted"; }
1492         else { str = "Reserved for protocol extension, treat as SSD Update not attempted"; }
1493         break;
1494     }
1495
1496     proto_tree_add_text(tree, asn1->tvb,
1497         saved_offset, asn1->offset - saved_offset,
1498         str);
1499
1500     EXTRANEOUS_DATA_CHECK(len, 1);
1501 }
1502
1503 static void
1504 param_cond_den_reason(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
1505 {
1506     gint32 value;
1507     guint saved_offset;
1508     gchar *str = NULL;
1509
1510     EXACT_DATA_CHECK(len, 1);
1511
1512     add_string = add_string;
1513     saved_offset = asn1->offset;
1514
1515     asn1_int32_value_decode(asn1, 1, &value);
1516
1517     switch (value)
1518     {
1519     case 0: str = "Not used"; break;
1520     case 1: str = "Waitable (i.e., Call Waiting is possible)"; break;
1521     default:
1522         if ((value >= 2) && (value <= 223)) { str = "Reserved, treat as Waitable"; }
1523         else { str = "Reserved for protocol extension, treat as Waitable"; }
1524         break;
1525     }
1526
1527     proto_tree_add_text(tree, asn1->tvb,
1528         saved_offset, asn1->offset - saved_offset,
1529         str);
1530 }
1531
1532 static void
1533 param_den_auth_per(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
1534 {
1535     gint32 value;
1536     guint saved_offset;
1537     gchar *str = NULL;
1538
1539     SHORT_DATA_CHECK(len, 2);
1540
1541     add_string = add_string;
1542     saved_offset = asn1->offset;
1543
1544     asn1_int32_value_decode(asn1, 1, &value);
1545
1546     switch (value)
1547     {
1548     case 0: str = "Not used"; break;
1549     case 1: str = "Per Call. Re-authorization should be attempted on the next call attempt"; break;
1550     case 2: str = "Hours"; break;
1551     case 3: str = "Days"; break;
1552     case 4: str = "Weeks"; break;
1553     case 5: str = "Per Agreement"; break;
1554     case 6: str = "Reserved"; break;
1555     case 7: str = "Number of calls. Re-authorization should be attempted after this number of (rejected) call attempts"; break;
1556     case 8: str = "Minutes"; break;
1557     default:
1558         if ((value >= 9) && (value <= 223)) { str = "Reserved, treat as Per Call"; }
1559         else { str = "Reserved for protocol extension, treat as Per Call"; }
1560         break;
1561     }
1562
1563     proto_tree_add_text(tree, asn1->tvb,
1564         saved_offset, asn1->offset - saved_offset,
1565         "Period, %s",
1566         str);
1567
1568     saved_offset = asn1->offset;
1569
1570     asn1_int32_value_decode(asn1, 1, &value);
1571
1572     proto_tree_add_text(tree, asn1->tvb,
1573         saved_offset, asn1->offset - saved_offset,
1574         "Value %u",
1575         value);
1576
1577     EXTRANEOUS_DATA_CHECK(len, 2);
1578 }
1579
1580 static void
1581 param_ho_state(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
1582 {
1583     gint32 value;
1584     guint saved_offset;
1585
1586     add_string = add_string;
1587     saved_offset = asn1->offset;
1588
1589     asn1_int32_value_decode(asn1, 1, &value);
1590
1591     other_decode_bitfield_value(bigbuf, value, 0xfe, 8);
1592     proto_tree_add_text(tree, asn1->tvb,
1593         saved_offset, asn1->offset - saved_offset,
1594         "%s :  Reserved",
1595         bigbuf);
1596
1597     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
1598     proto_tree_add_text(tree, asn1->tvb,
1599         saved_offset, asn1->offset - saved_offset,
1600         "%s :  Party Involved (PI), %s",
1601         bigbuf,
1602         (value & 0x01) ? "Terminator is handing off" : "Originator is handing off");
1603
1604     EXTRANEOUS_DATA_CHECK(len, 1);
1605 }
1606
1607 static void
1608 param_geo_auth(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
1609 {
1610     gint32 value;
1611     guint saved_offset;
1612     gchar *str = NULL;
1613
1614     add_string = add_string;
1615     saved_offset = asn1->offset;
1616
1617     asn1_int32_value_decode(asn1, 1, &value);
1618
1619     switch (value)
1620     {
1621     case 0: str = "Not used"; break;
1622     case 1: str = "Authorized for all Market IDs served by the VLR"; break;
1623     case 2: str = "Authorized for this Market ID only"; break;
1624     case 3: str = "Authorized for this Market ID and Switch Number only"; break;
1625     case 4: str = "Authorized for this Location Area ID within a Market ID only"; break;
1626     default:
1627         if ((value >= 5) && (value <= 95)) { str = "Reserved, treat as Authorized for all Market IDs served by the VLR"; }
1628         else if ((value >= 96) && (value <= 127)) { str = "Reserved for protocol extension, treat as Authorized for all Market IDs served by the VLR"; }
1629         else if ((value >= 128) && (value <= 223)) { str = "Reserved, treat as Authorized for this Location Area ID within a Market ID only"; }
1630         else { str = "Reserved for protocol extension, treat as Authorized for this Location Area ID within a Market ID only"; }
1631         break;
1632     }
1633
1634     proto_tree_add_text(tree, asn1->tvb,
1635         saved_offset, asn1->offset - saved_offset,
1636         str);
1637
1638     EXTRANEOUS_DATA_CHECK(len, 1);
1639 }
1640
1641 static void
1642 param_mw_noti_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
1643 {
1644     gint32 value;
1645     guint saved_offset;
1646     gchar *str = NULL;
1647
1648     add_string = add_string;
1649     saved_offset = asn1->offset;
1650
1651     asn1_int32_value_decode(asn1, 1, &value);
1652
1653     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
1654     proto_tree_add_text(tree, asn1->tvb,
1655         saved_offset, asn1->offset - saved_offset,
1656         "%s :  Reserved",
1657         bigbuf);
1658
1659     switch ((value & 0x0c) >> 2)
1660     {
1661     case 0: str = "No MWI. Notification is not authorized or notification is not required"; break;
1662     case 1: str = "Reserved"; break;
1663     case 2: str = "MWI On. Notification is required. Messages waiting"; break;
1664     case 3: str = "MWI Off. Notification is required. No messages waiting"; break;
1665     }
1666
1667     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
1668     proto_tree_add_text(tree, asn1->tvb,
1669         saved_offset, asn1->offset - saved_offset,
1670         "%s :  Message Waiting Indication (MWI), %s",
1671         bigbuf,
1672         str);
1673
1674     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
1675     proto_tree_add_text(tree, asn1->tvb,
1676         saved_offset, asn1->offset - saved_offset,
1677         "%s :  Alert Pip Tone (APT), %s",
1678         bigbuf,
1679         (value & 0x02) ? "notification is required" : "notification is not authorized or notification is not required");
1680
1681     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
1682     proto_tree_add_text(tree, asn1->tvb,
1683         saved_offset, asn1->offset - saved_offset,
1684         "%s :  Pip Tone (PT), %s",
1685         bigbuf,
1686         (value & 0x01) ? "notification is required" : "notification is not authorized or notification is not required");
1687
1688     EXTRANEOUS_DATA_CHECK(len, 1);
1689 }
1690
1691 static void
1692 param_paca_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
1693 {
1694     gint32 value;
1695     guint saved_offset;
1696     gchar *str = NULL;
1697
1698     add_string = add_string;
1699     saved_offset = asn1->offset;
1700
1701     asn1_int32_value_decode(asn1, 1, &value);
1702
1703     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
1704     proto_tree_add_text(tree, asn1->tvb,
1705         saved_offset, asn1->offset - saved_offset,
1706         "%s :  Reserved",
1707         bigbuf);
1708
1709     switch ((value & 0x1e) >> 1)
1710     {
1711     case 0: str = "Not used"; break;
1712     case 1: str = "Priority Level 1"; break;
1713     case 2: str = "Priority Level 2"; break;
1714     case 3: str = "Priority Level 3"; break;
1715     case 4: str = "Priority Level 4"; break;
1716     case 5: str = "Priority Level 5"; break;
1717     case 6: str = "Priority Level 6"; break;
1718     case 7: str = "Priority Level 7"; break;
1719     case 8: str = "Priority Level 8"; break;
1720     case 9: str = "Priority Level 9"; break;
1721     case 10: str = "Priority Level 10"; break;
1722     case 11: str = "Priority Level 11"; break;
1723     case 12: str = "Priority Level 12"; break;
1724     case 13: str = "Priority Level 13"; break;
1725     case 14: str = "Priority Level 14"; break;
1726     case 15: str = "Priority Level 15"; break;
1727     }
1728
1729     other_decode_bitfield_value(bigbuf, value, 0x1e, 8);
1730     proto_tree_add_text(tree, asn1->tvb,
1731         saved_offset, asn1->offset - saved_offset,
1732         "%s :  PACA Level, %s",
1733         bigbuf,
1734         str);
1735
1736     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
1737     proto_tree_add_text(tree, asn1->tvb,
1738         saved_offset, asn1->offset - saved_offset,
1739         "%s :  PACA is %spermanently activated",
1740         bigbuf,
1741         (value & 0x01) ? "" : "not ");
1742
1743     EXTRANEOUS_DATA_CHECK(len, 1);
1744 }
1745
1746 static void
1747 param_digit_collect_ctrl(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
1748 {
1749     gint32 value;
1750     guint saved_offset;
1751     proto_item *item;
1752     proto_tree *subtree;
1753
1754     add_string = add_string;
1755     saved_offset = asn1->offset;
1756
1757     asn1_int32_value_decode(asn1, 1, &value);
1758
1759     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
1760     proto_tree_add_text(tree, asn1->tvb,
1761         saved_offset, asn1->offset - saved_offset,
1762         "%s :  Break (BRK), %s",
1763         bigbuf,
1764         (value & 0x80) ? "Break In (default)" : "No Break");
1765
1766     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
1767     proto_tree_add_text(tree, asn1->tvb,
1768         saved_offset, asn1->offset - saved_offset,
1769         "%s :  Type Ahead (TA), %s",
1770         bigbuf,
1771         (value & 0x40) ? "Buffer (default)" : "No Type Ahead");
1772
1773     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
1774     proto_tree_add_text(tree, asn1->tvb,
1775         saved_offset, asn1->offset - saved_offset,
1776         "%s :  Reserved",
1777         bigbuf);
1778
1779     other_decode_bitfield_value(bigbuf, value, 0x1f, 8);
1780     proto_tree_add_text(tree, asn1->tvb,
1781         saved_offset, asn1->offset - saved_offset,
1782         "%s :  Maximum Collect (%u)",
1783         bigbuf,
1784         (value & 0x1f));
1785
1786     if (len == 1) return;
1787
1788     saved_offset = asn1->offset;
1789
1790     asn1_int32_value_decode(asn1, 1, &value);
1791
1792     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
1793     proto_tree_add_text(tree, asn1->tvb,
1794         saved_offset, asn1->offset - saved_offset,
1795         "%s :  Reserved",
1796         bigbuf);
1797
1798     other_decode_bitfield_value(bigbuf, value, 0x1f, 8);
1799     proto_tree_add_text(tree, asn1->tvb,
1800         saved_offset, asn1->offset - saved_offset,
1801         "%s :  Minimum Collect (%u)",
1802         bigbuf,
1803         (value & 0x1f));
1804
1805     if (len == 2) return;
1806
1807     saved_offset = asn1->offset;
1808
1809     asn1_int32_value_decode(asn1, 1, &value);
1810
1811     proto_tree_add_text(tree, asn1->tvb,
1812         saved_offset, asn1->offset - saved_offset,
1813         "Maximum Interaction Time (%u) seconds",
1814         value);
1815
1816     if (len == 3) return;
1817
1818     saved_offset = asn1->offset;
1819
1820     asn1_int32_value_decode(asn1, 1, &value);
1821
1822     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
1823     proto_tree_add_text(tree, asn1->tvb,
1824         saved_offset, asn1->offset - saved_offset,
1825         "%s :  Reserved",
1826         bigbuf);
1827
1828     other_decode_bitfield_value(bigbuf, value, 0x1f, 8);
1829     proto_tree_add_text(tree, asn1->tvb,
1830         saved_offset, asn1->offset - saved_offset,
1831         "%s :  Initial Interdigit Time (%u) seconds",
1832         bigbuf,
1833         (value & 0x1f));
1834
1835     if (len == 4) return;
1836
1837     saved_offset = asn1->offset;
1838
1839     asn1_int32_value_decode(asn1, 1, &value);
1840
1841     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
1842     proto_tree_add_text(tree, asn1->tvb,
1843         saved_offset, asn1->offset - saved_offset,
1844         "%s :  Reserved",
1845         bigbuf);
1846
1847     other_decode_bitfield_value(bigbuf, value, 0x1f, 8);
1848     proto_tree_add_text(tree, asn1->tvb,
1849         saved_offset, asn1->offset - saved_offset,
1850         "%s :  Normal Interdigit Time (%u) seconds",
1851         bigbuf,
1852         (value & 0x1f));
1853
1854     if (len == 5) return;
1855
1856     saved_offset = asn1->offset;
1857
1858     item =
1859         proto_tree_add_text(tree, asn1->tvb,
1860             saved_offset, (len > 6) ? 2 : 1,
1861             "Clear Digits Digit Mask");
1862
1863     subtree = proto_item_add_subtree(item, ett_clr_dig_mask);
1864
1865     asn1_int32_value_decode(asn1, 1, &value);
1866
1867     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
1868     proto_tree_add_text(subtree, asn1->tvb,
1869         saved_offset, asn1->offset - saved_offset,
1870         "%s :  7 Digit",
1871         bigbuf);
1872
1873     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
1874     proto_tree_add_text(subtree, asn1->tvb,
1875         saved_offset, asn1->offset - saved_offset,
1876         "%s :  6 Digit",
1877         bigbuf);
1878
1879     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
1880     proto_tree_add_text(subtree, asn1->tvb,
1881         saved_offset, asn1->offset - saved_offset,
1882         "%s :  5 Digit",
1883         bigbuf);
1884
1885     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
1886     proto_tree_add_text(subtree, asn1->tvb,
1887         saved_offset, asn1->offset - saved_offset,
1888         "%s :  4 Digit",
1889         bigbuf);
1890
1891     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
1892     proto_tree_add_text(subtree, asn1->tvb,
1893         saved_offset, asn1->offset - saved_offset,
1894         "%s :  3 Digit",
1895         bigbuf);
1896
1897     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
1898     proto_tree_add_text(subtree, asn1->tvb,
1899         saved_offset, asn1->offset - saved_offset,
1900         "%s :  2 Digit",
1901         bigbuf);
1902
1903     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
1904     proto_tree_add_text(subtree, asn1->tvb,
1905         saved_offset, asn1->offset - saved_offset,
1906         "%s :  1 Digit",
1907         bigbuf);
1908
1909     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
1910     proto_tree_add_text(subtree, asn1->tvb,
1911         saved_offset, asn1->offset - saved_offset,
1912         "%s :  0 Digit",
1913         bigbuf);
1914
1915     if (len == 6) return;
1916
1917     saved_offset = asn1->offset;
1918
1919     asn1_int32_value_decode(asn1, 1, &value);
1920
1921     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
1922     proto_tree_add_text(subtree, asn1->tvb,
1923         saved_offset, asn1->offset - saved_offset,
1924         "%s :  Reserved",
1925         bigbuf);
1926
1927     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
1928     proto_tree_add_text(subtree, asn1->tvb,
1929         saved_offset, asn1->offset - saved_offset,
1930         "%s :  # Digit",
1931         bigbuf);
1932
1933     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
1934     proto_tree_add_text(subtree, asn1->tvb,
1935         saved_offset, asn1->offset - saved_offset,
1936         "%s :  * Digit",
1937         bigbuf);
1938
1939     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
1940     proto_tree_add_text(subtree, asn1->tvb,
1941         saved_offset, asn1->offset - saved_offset,
1942         "%s :  Reserved",
1943         bigbuf);
1944
1945     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
1946     proto_tree_add_text(subtree, asn1->tvb,
1947         saved_offset, asn1->offset - saved_offset,
1948         "%s :  9 Digit",
1949         bigbuf);
1950
1951     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
1952     proto_tree_add_text(subtree, asn1->tvb,
1953         saved_offset, asn1->offset - saved_offset,
1954         "%s :  8 Digit",
1955         bigbuf);
1956
1957     if (len == 7) return;
1958
1959     saved_offset = asn1->offset;
1960
1961     item =
1962         proto_tree_add_text(tree, asn1->tvb,
1963             saved_offset, (len > 8) ? 2 : 1,
1964             "Enter Digits Digit Mask");
1965
1966     subtree = proto_item_add_subtree(item, ett_ent_dig_mask);
1967
1968     asn1_int32_value_decode(asn1, 1, &value);
1969
1970     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
1971     proto_tree_add_text(subtree, asn1->tvb,
1972         saved_offset, asn1->offset - saved_offset,
1973         "%s :  7 Digit",
1974         bigbuf);
1975
1976     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
1977     proto_tree_add_text(subtree, asn1->tvb,
1978         saved_offset, asn1->offset - saved_offset,
1979         "%s :  6 Digit",
1980         bigbuf);
1981
1982     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
1983     proto_tree_add_text(subtree, asn1->tvb,
1984         saved_offset, asn1->offset - saved_offset,
1985         "%s :  5 Digit",
1986         bigbuf);
1987
1988     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
1989     proto_tree_add_text(subtree, asn1->tvb,
1990         saved_offset, asn1->offset - saved_offset,
1991         "%s :  4 Digit",
1992         bigbuf);
1993
1994     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
1995     proto_tree_add_text(subtree, asn1->tvb,
1996         saved_offset, asn1->offset - saved_offset,
1997         "%s :  3 Digit",
1998         bigbuf);
1999
2000     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
2001     proto_tree_add_text(subtree, asn1->tvb,
2002         saved_offset, asn1->offset - saved_offset,
2003         "%s :  2 Digit",
2004         bigbuf);
2005
2006     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
2007     proto_tree_add_text(subtree, asn1->tvb,
2008         saved_offset, asn1->offset - saved_offset,
2009         "%s :  1 Digit",
2010         bigbuf);
2011
2012     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
2013     proto_tree_add_text(subtree, asn1->tvb,
2014         saved_offset, asn1->offset - saved_offset,
2015         "%s :  0 Digit",
2016         bigbuf);
2017
2018     if (len == 8) return;
2019
2020     saved_offset = asn1->offset;
2021
2022     asn1_int32_value_decode(asn1, 1, &value);
2023
2024     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
2025     proto_tree_add_text(subtree, asn1->tvb,
2026         saved_offset, asn1->offset - saved_offset,
2027         "%s :  Reserved",
2028         bigbuf);
2029
2030     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
2031     proto_tree_add_text(subtree, asn1->tvb,
2032         saved_offset, asn1->offset - saved_offset,
2033         "%s :  # Digit",
2034         bigbuf);
2035
2036     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
2037     proto_tree_add_text(subtree, asn1->tvb,
2038         saved_offset, asn1->offset - saved_offset,
2039         "%s :  * Digit",
2040         bigbuf);
2041
2042     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
2043     proto_tree_add_text(subtree, asn1->tvb,
2044         saved_offset, asn1->offset - saved_offset,
2045         "%s :  Reserved",
2046         bigbuf);
2047
2048     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
2049     proto_tree_add_text(subtree, asn1->tvb,
2050         saved_offset, asn1->offset - saved_offset,
2051         "%s :  9 Digit",
2052         bigbuf);
2053
2054     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
2055     proto_tree_add_text(subtree, asn1->tvb,
2056         saved_offset, asn1->offset - saved_offset,
2057         "%s :  8 Digit",
2058         bigbuf);
2059
2060     if (len == 9) return;
2061
2062     saved_offset = asn1->offset;
2063
2064     item =
2065         proto_tree_add_text(tree, asn1->tvb,
2066             saved_offset, (len > 10) ? 2 : 1,
2067             "Allowed Digits Digit Mask");
2068
2069     subtree = proto_item_add_subtree(item, ett_all_dig_mask);
2070
2071     asn1_int32_value_decode(asn1, 1, &value);
2072
2073     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
2074     proto_tree_add_text(subtree, asn1->tvb,
2075         saved_offset, asn1->offset - saved_offset,
2076         "%s :  7 Digit",
2077         bigbuf);
2078
2079     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
2080     proto_tree_add_text(subtree, asn1->tvb,
2081         saved_offset, asn1->offset - saved_offset,
2082         "%s :  6 Digit",
2083         bigbuf);
2084
2085     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
2086     proto_tree_add_text(subtree, asn1->tvb,
2087         saved_offset, asn1->offset - saved_offset,
2088         "%s :  5 Digit",
2089         bigbuf);
2090
2091     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
2092     proto_tree_add_text(subtree, asn1->tvb,
2093         saved_offset, asn1->offset - saved_offset,
2094         "%s :  4 Digit",
2095         bigbuf);
2096
2097     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
2098     proto_tree_add_text(subtree, asn1->tvb,
2099         saved_offset, asn1->offset - saved_offset,
2100         "%s :  3 Digit",
2101         bigbuf);
2102
2103     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
2104     proto_tree_add_text(subtree, asn1->tvb,
2105         saved_offset, asn1->offset - saved_offset,
2106         "%s :  2 Digit",
2107         bigbuf);
2108
2109     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
2110     proto_tree_add_text(subtree, asn1->tvb,
2111         saved_offset, asn1->offset - saved_offset,
2112         "%s :  1 Digit",
2113         bigbuf);
2114
2115     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
2116     proto_tree_add_text(subtree, asn1->tvb,
2117         saved_offset, asn1->offset - saved_offset,
2118         "%s :  0 Digit",
2119         bigbuf);
2120
2121     if (len == 10) return;
2122
2123     saved_offset = asn1->offset;
2124
2125     asn1_int32_value_decode(asn1, 1, &value);
2126
2127     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
2128     proto_tree_add_text(subtree, asn1->tvb,
2129         saved_offset, asn1->offset - saved_offset,
2130         "%s :  Reserved",
2131         bigbuf);
2132
2133     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
2134     proto_tree_add_text(subtree, asn1->tvb,
2135         saved_offset, asn1->offset - saved_offset,
2136         "%s :  # Digit",
2137         bigbuf);
2138
2139     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
2140     proto_tree_add_text(subtree, asn1->tvb,
2141         saved_offset, asn1->offset - saved_offset,
2142         "%s :  * Digit",
2143         bigbuf);
2144
2145     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
2146     proto_tree_add_text(subtree, asn1->tvb,
2147         saved_offset, asn1->offset - saved_offset,
2148         "%s :  Reserved",
2149         bigbuf);
2150
2151     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
2152     proto_tree_add_text(subtree, asn1->tvb,
2153         saved_offset, asn1->offset - saved_offset,
2154         "%s :  9 Digit",
2155         bigbuf);
2156
2157     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
2158     proto_tree_add_text(subtree, asn1->tvb,
2159         saved_offset, asn1->offset - saved_offset,
2160         "%s :  8 Digit",
2161         bigbuf);
2162
2163     if (len == 11) return;
2164
2165     saved_offset = asn1->offset;
2166
2167     asn1_int32_value_decode(asn1, 1, &value);
2168
2169     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
2170     proto_tree_add_text(tree, asn1->tvb,
2171         saved_offset, asn1->offset - saved_offset,
2172         "%s :  Reserved",
2173         bigbuf);
2174
2175     other_decode_bitfield_value(bigbuf, value, 0x1f, 8);
2176     proto_tree_add_text(tree, asn1->tvb,
2177         saved_offset, asn1->offset - saved_offset,
2178         "%s :  Special Interdigit Time (%u)",
2179         bigbuf,
2180         value & 0x1f);
2181
2182     if (len == 12) return;
2183
2184     saved_offset = asn1->offset;
2185
2186     asn1_int32_value_decode(asn1, 1, &value);
2187
2188     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
2189     proto_tree_add_text(tree, asn1->tvb,
2190         saved_offset, asn1->offset - saved_offset,
2191         "%s :  SIT 8",
2192         bigbuf);
2193
2194     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
2195     proto_tree_add_text(tree, asn1->tvb,
2196         saved_offset, asn1->offset - saved_offset,
2197         "%s :  SIT 7",
2198         bigbuf);
2199
2200     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
2201     proto_tree_add_text(tree, asn1->tvb,
2202         saved_offset, asn1->offset - saved_offset,
2203         "%s :  SIT 6",
2204         bigbuf);
2205
2206     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
2207     proto_tree_add_text(tree, asn1->tvb,
2208         saved_offset, asn1->offset - saved_offset,
2209         "%s :  SIT 5",
2210         bigbuf);
2211
2212     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
2213     proto_tree_add_text(tree, asn1->tvb,
2214         saved_offset, asn1->offset - saved_offset,
2215         "%s :  SIT 4",
2216         bigbuf);
2217
2218     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
2219     proto_tree_add_text(tree, asn1->tvb,
2220         saved_offset, asn1->offset - saved_offset,
2221         "%s :  SIT 3",
2222         bigbuf);
2223
2224     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
2225     proto_tree_add_text(tree, asn1->tvb,
2226         saved_offset, asn1->offset - saved_offset,
2227         "%s :  SIT 2",
2228         bigbuf);
2229
2230     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
2231     proto_tree_add_text(tree, asn1->tvb,
2232         saved_offset, asn1->offset - saved_offset,
2233         "%s :  SIT 1",
2234         bigbuf);
2235
2236     if (len == 13) return;
2237
2238     saved_offset = asn1->offset;
2239
2240     asn1_int32_value_decode(asn1, 1, &value);
2241
2242     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
2243     proto_tree_add_text(tree, asn1->tvb,
2244         saved_offset, asn1->offset - saved_offset,
2245         "%s :  SIT 16",
2246         bigbuf);
2247
2248     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
2249     proto_tree_add_text(tree, asn1->tvb,
2250         saved_offset, asn1->offset - saved_offset,
2251         "%s :  SIT 15",
2252         bigbuf);
2253
2254     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
2255     proto_tree_add_text(tree, asn1->tvb,
2256         saved_offset, asn1->offset - saved_offset,
2257         "%s :  SIT 14",
2258         bigbuf);
2259
2260     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
2261     proto_tree_add_text(tree, asn1->tvb,
2262         saved_offset, asn1->offset - saved_offset,
2263         "%s :  SIT 13",
2264         bigbuf);
2265
2266     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
2267     proto_tree_add_text(tree, asn1->tvb,
2268         saved_offset, asn1->offset - saved_offset,
2269         "%s :  SIT 12",
2270         bigbuf);
2271
2272     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
2273     proto_tree_add_text(tree, asn1->tvb,
2274         saved_offset, asn1->offset - saved_offset,
2275         "%s :  SIT 11",
2276         bigbuf);
2277
2278     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
2279     proto_tree_add_text(tree, asn1->tvb,
2280         saved_offset, asn1->offset - saved_offset,
2281         "%s :  SIT 10",
2282         bigbuf);
2283
2284     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
2285     proto_tree_add_text(tree, asn1->tvb,
2286         saved_offset, asn1->offset - saved_offset,
2287         "%s :  SIT 9",
2288         bigbuf);
2289
2290     if (len == 14) return;
2291
2292     saved_offset = asn1->offset;
2293
2294     asn1_int32_value_decode(asn1, 1, &value);
2295
2296     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
2297     proto_tree_add_text(tree, asn1->tvb,
2298         saved_offset, asn1->offset - saved_offset,
2299         "%s :  SIT 24",
2300         bigbuf);
2301
2302     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
2303     proto_tree_add_text(tree, asn1->tvb,
2304         saved_offset, asn1->offset - saved_offset,
2305         "%s :  SIT 23",
2306         bigbuf);
2307
2308     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
2309     proto_tree_add_text(tree, asn1->tvb,
2310         saved_offset, asn1->offset - saved_offset,
2311         "%s :  SIT 22",
2312         bigbuf);
2313
2314     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
2315     proto_tree_add_text(tree, asn1->tvb,
2316         saved_offset, asn1->offset - saved_offset,
2317         "%s :  SIT 21",
2318         bigbuf);
2319
2320     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
2321     proto_tree_add_text(tree, asn1->tvb,
2322         saved_offset, asn1->offset - saved_offset,
2323         "%s :  SIT 20",
2324         bigbuf);
2325
2326     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
2327     proto_tree_add_text(tree, asn1->tvb,
2328         saved_offset, asn1->offset - saved_offset,
2329         "%s :  SIT 19",
2330         bigbuf);
2331
2332     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
2333     proto_tree_add_text(tree, asn1->tvb,
2334         saved_offset, asn1->offset - saved_offset,
2335         "%s :  SIT 18",
2336         bigbuf);
2337
2338     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
2339     proto_tree_add_text(tree, asn1->tvb,
2340         saved_offset, asn1->offset - saved_offset,
2341         "%s :  SIT 17",
2342         bigbuf);
2343
2344     if (len == 15) return;
2345
2346     saved_offset = asn1->offset;
2347
2348     asn1_int32_value_decode(asn1, 1, &value);
2349
2350     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
2351     proto_tree_add_text(tree, asn1->tvb,
2352         saved_offset, asn1->offset - saved_offset,
2353         "%s :  Reserved",
2354         bigbuf);
2355
2356     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
2357     proto_tree_add_text(tree, asn1->tvb,
2358         saved_offset, asn1->offset - saved_offset,
2359         "%s :  SIT 31",
2360         bigbuf);
2361
2362     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
2363     proto_tree_add_text(tree, asn1->tvb,
2364         saved_offset, asn1->offset - saved_offset,
2365         "%s :  SIT 30",
2366         bigbuf);
2367
2368     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
2369     proto_tree_add_text(tree, asn1->tvb,
2370         saved_offset, asn1->offset - saved_offset,
2371         "%s :  SIT 29",
2372         bigbuf);
2373
2374     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
2375     proto_tree_add_text(tree, asn1->tvb,
2376         saved_offset, asn1->offset - saved_offset,
2377         "%s :  SIT 28",
2378         bigbuf);
2379
2380     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
2381     proto_tree_add_text(tree, asn1->tvb,
2382         saved_offset, asn1->offset - saved_offset,
2383         "%s :  SIT 27",
2384         bigbuf);
2385
2386     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
2387     proto_tree_add_text(tree, asn1->tvb,
2388         saved_offset, asn1->offset - saved_offset,
2389         "%s :  SIT 26",
2390         bigbuf);
2391
2392     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
2393     proto_tree_add_text(tree, asn1->tvb,
2394         saved_offset, asn1->offset - saved_offset,
2395         "%s :  SIT 25",
2396         bigbuf);
2397
2398     EXTRANEOUS_DATA_CHECK(len, 16);
2399 }
2400
2401 static void
2402 param_no_ans_time(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
2403 {
2404     gint32 value;
2405     guint saved_offset;
2406
2407     add_string = add_string;
2408     saved_offset = asn1->offset;
2409
2410     asn1_int32_value_decode(asn1, 1, &value);
2411
2412     proto_tree_add_text(tree, asn1->tvb,
2413         saved_offset, asn1->offset - saved_offset,
2414         "(%u) The number of seconds to wait after alerting an MS or after seizing an outgoing trunk before applying no answer trigger treatment.",
2415         value);
2416
2417     EXTRANEOUS_DATA_CHECK(len, 1);
2418 }
2419
2420 static void
2421 param_mw_noti_count(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
2422 {
2423     gint32 value;
2424     guint saved_offset, orig_offset;
2425     gchar *str = NULL;
2426
2427     SHORT_DATA_CHECK(len, 2);
2428
2429     add_string = add_string;
2430     orig_offset = asn1->offset;
2431     saved_offset = asn1->offset;
2432
2433     do
2434     {
2435         asn1_int32_value_decode(asn1, 1, &value);
2436
2437         switch (value)
2438         {
2439         case 0: str = "Voice Messages"; break;
2440         case 1: str = "Short Message Services (SMS) messages"; break;
2441         case 2: str = "Group 3 (G3) Fax messages"; break;
2442         case 255: str = "Not specified"; break;
2443         default:
2444             str = "Reserved, treat as Not specified";
2445             break;
2446         }
2447
2448         proto_tree_add_text(tree, asn1->tvb,
2449             saved_offset, asn1->offset - saved_offset,
2450             "Type of messages, %s",
2451             str);
2452
2453         saved_offset = asn1->offset;
2454
2455         asn1_int32_value_decode(asn1, 1, &value);
2456
2457         switch (value)
2458         {
2459         case 0: str = "No messages are waiting"; break;
2460         case 254: str = "254 or more messages are waiting"; break;
2461         case 255: str = "An unknown number of messages are waiting (greater than zero)"; break;
2462         default:
2463             sprintf(bigbuf, "%u messages are waiting", value);
2464             str = bigbuf;
2465             break;
2466         }
2467
2468         proto_tree_add_text(tree, asn1->tvb,
2469             saved_offset, asn1->offset - saved_offset,
2470             str);
2471
2472         saved_offset = asn1->offset;
2473     }
2474     while ((len - (saved_offset - orig_offset)) >= 2);
2475
2476     EXTRANEOUS_DATA_CHECK((len - (saved_offset - orig_offset)), 0);
2477 }
2478
2479 static void
2480 param_otfi(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
2481 {
2482     gint32 value;
2483     guint saved_offset;
2484     gchar *str = NULL;
2485
2486     add_string = add_string;
2487     saved_offset = asn1->offset;
2488
2489     asn1_int32_value_decode(asn1, 1, &value);
2490
2491     switch ((value & 0xc0) >> 6)
2492     {
2493     case 0: str = "Ignore"; break;
2494     case 1: str = "Presentation Allowed"; break;
2495     case 2: str = "Presentation Restricted"; break;
2496     case 3: str = "Reserved"; break;
2497     }
2498
2499     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
2500     proto_tree_add_text(tree, asn1->tvb,
2501         saved_offset, asn1->offset - saved_offset,
2502         "%s :  Calling Number ID Restriction, %s",
2503         bigbuf,
2504         str);
2505
2506     switch ((value & 0x30) >> 4)
2507     {
2508     case 0: str = "Ignore"; break;
2509     case 1: str = "Pip Tone Inactive"; break;
2510     case 2: str = "Pip Tone Active"; break;
2511     case 3: str = "Reserved"; break;
2512     }
2513
2514     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
2515     proto_tree_add_text(tree, asn1->tvb,
2516         saved_offset, asn1->offset - saved_offset,
2517         "%s :  Message Waiting Notification, %s",
2518         bigbuf,
2519         str);
2520
2521     switch ((value & 0x0c) >> 2)
2522     {
2523     case 0: str = "Ignore"; break;
2524     case 1: str = "No CW"; break;
2525     case 2: str = "Normal CW"; break;
2526     case 3: str = "Priority CW"; break;
2527     }
2528
2529     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
2530     proto_tree_add_text(tree, asn1->tvb,
2531         saved_offset, asn1->offset - saved_offset,
2532         "%s :  Call Waiting for Incoming Call (CWIC), %s",
2533         bigbuf,
2534         str);
2535
2536     switch (value & 0x03)
2537     {
2538     case 0: str = "Ignore"; break;
2539     case 1: str = "No CW"; break;
2540     case 2: str = "Normal CW"; break;
2541     case 3: str = "Priority CW"; break;
2542     }
2543
2544     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
2545     proto_tree_add_text(tree, asn1->tvb,
2546         saved_offset, asn1->offset - saved_offset,
2547         "%s :  Call Waiting for Future Incoming Call (CWFI), %s",
2548         bigbuf,
2549         str);
2550
2551     if (len == 1) return;
2552
2553     saved_offset = asn1->offset;
2554
2555     asn1_int32_value_decode(asn1, 1, &value);
2556
2557     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
2558     proto_tree_add_text(tree, asn1->tvb,
2559         saved_offset, asn1->offset - saved_offset,
2560         "%s :  Reserved",
2561         bigbuf);
2562
2563     switch ((value & 0x30) >> 4)
2564     {
2565     case 0: str = "Ignore"; break;
2566     case 1: str = "Presentation Allowed"; break;
2567     case 2: str = "Presentation Restricted"; break;
2568     case 3: str = "Blocking Toggle"; break;
2569     }
2570
2571     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
2572     proto_tree_add_text(tree, asn1->tvb,
2573         saved_offset, asn1->offset - saved_offset,
2574         "%s :  Calling Name Restriction (CNAR), %s",
2575         bigbuf,
2576         str);
2577
2578     switch ((value & 0x0c) >> 2)
2579     {
2580     case 0: str = "Ignore"; break;
2581     case 1: str = "Flash Inactive"; break;
2582     case 2: str = "Flash Active"; break;
2583     case 3: str = "Reserved"; break;
2584     }
2585
2586     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
2587     proto_tree_add_text(tree, asn1->tvb,
2588         saved_offset, asn1->offset - saved_offset,
2589         "%s :  Flash Privileges (Flash), %s",
2590         bigbuf,
2591         str);
2592
2593     switch (value & 0x03)
2594     {
2595     case 0: str = "Ignore"; break;
2596     case 1: str = "PACA Demand Inactive"; break;
2597     case 2: str = "PACA Demand Actived"; break;
2598     case 3: str = "Reserved"; break;
2599     }
2600
2601     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
2602     proto_tree_add_text(tree, asn1->tvb,
2603         saved_offset, asn1->offset - saved_offset,
2604         "%s :  Priority Access and Channel Assignment (PACA), %s",
2605         bigbuf,
2606         str);
2607
2608     EXTRANEOUS_DATA_CHECK(len, 2);
2609 }
2610
2611 /*
2612  * For:
2613  *      Authentication Response
2614  *      Authentication Response Base Station
2615  *      Authentication Response Unique Challenge
2616  */
2617 static void
2618 param_auth_resp_all(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
2619 {
2620     gint32 value;
2621     guint saved_offset;
2622
2623     EXACT_DATA_CHECK(len, 3);
2624
2625     add_string = add_string;
2626     saved_offset = asn1->offset;
2627
2628     asn1_int32_value_decode(asn1, 1, &value);
2629
2630     other_decode_bitfield_value(bigbuf, value, 0xfc, 8);
2631     proto_tree_add_text(tree, asn1->tvb,
2632         saved_offset, asn1->offset - saved_offset,
2633         "%s :  Reserved",
2634         bigbuf);
2635
2636     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
2637     proto_tree_add_text(tree, asn1->tvb,
2638         saved_offset, asn1->offset - saved_offset,
2639         "%s :  Response (MSB)",
2640         bigbuf);
2641
2642     saved_offset = asn1->offset;
2643
2644     asn1_int32_value_decode(asn1, 1, &value);
2645
2646     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
2647     proto_tree_add_text(tree, asn1->tvb,
2648         saved_offset, asn1->offset - saved_offset,
2649         "%s :  Response",
2650         bigbuf);
2651
2652     saved_offset = asn1->offset;
2653
2654     asn1_int32_value_decode(asn1, 1, &value);
2655
2656     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
2657     proto_tree_add_text(tree, asn1->tvb,
2658         saved_offset, asn1->offset - saved_offset,
2659         "%s :  Response (LSB)",
2660         bigbuf);
2661 }
2662
2663 static void
2664 param_sys_acc_data(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
2665 {
2666     gint32 value;
2667     guint saved_offset;
2668
2669     EXACT_DATA_CHECK(len, 5);
2670
2671     param_mscid(asn1, tree, 3, add_string);
2672
2673     saved_offset = asn1->offset;
2674     asn1_int32_value_decode(asn1, 2, &value);
2675
2676     proto_tree_add_text(tree, asn1->tvb,
2677         saved_offset, asn1->offset - saved_offset,
2678         "Serving Cell ID %u",
2679         value);
2680 }
2681
2682 static void
2683 param_bill_id(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
2684 {
2685     gint32 id, segcount;
2686     guint saved_offset;
2687     gchar *str = NULL;
2688
2689     EXACT_DATA_CHECK(len, 7);
2690
2691     param_mscid(asn1, tree, 3, add_string);
2692
2693     saved_offset = asn1->offset;
2694     asn1_int32_value_decode(asn1, 3, &id);
2695
2696     proto_tree_add_text(tree, asn1->tvb,
2697         saved_offset, asn1->offset - saved_offset,
2698         "ID Number %u",
2699         id);
2700
2701     saved_offset = asn1->offset;
2702     asn1_int32_value_decode(asn1, 1, &segcount);
2703
2704     if (segcount == 255) { str = "Unspecified"; }
2705     else if ((segcount >= 0) && (segcount <= 127)) { str = "Number of call segments"; }
2706     else if ((segcount >= 128) && (segcount < 255)) { str = "Not used in TIA/EIA-41"; }
2707
2708     proto_tree_add_text(tree, asn1->tvb,
2709         saved_offset, asn1->offset - saved_offset,
2710         "Segment Counter %u:  %s",
2711         segcount, str);
2712 }
2713
2714 static void
2715 param_cdma_so(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
2716 {
2717     gint32 so;
2718     guint saved_offset;
2719     gchar *str = NULL;
2720
2721     SHORT_DATA_CHECK(len, 2);
2722
2723     add_string = add_string;
2724     saved_offset = asn1->offset;
2725     asn1_int32_value_decode(asn1, 2, &so);
2726
2727     switch (so)
2728     {
2729     case 1: str = "Basic Variable Rate Voice Service (8 kbps)"; break;
2730     case 2: str = "Mobile Station Loopback (8 kbps)"; break;
2731     case 3: str = "Enhanced Variable Rate Voice Service (8 kbps)"; break;
2732     case 4: str = "Asynchronous Data Service (9.6 kbps)"; break;
2733     case 5: str = "Group 3 Facsimile (9.6 kbps)"; break;
2734     case 6: str = "Short Message Services (Rate Set 1)"; break;
2735     case 7: str = "Packet Data Service: Internet or ISO Protocol Stack (9.6 kbps)"; break;
2736     case 8: str = "Packet Data Service: CDPD Protocol Stack (9.6 kbps)"; break;
2737     case 9: str = "Mobile Station Loopback (13 kbps)"; break;
2738     case 10: str = "STU-III Transparent Service"; break;
2739     case 11: str = "STU-III Non-Transparent Service"; break;
2740     case 12: str = "Asynchronous Data Service (14.4 or 9.6 kbps)"; break;
2741     case 13: str = "Group 3 Facsimile (14.4 or 9.6 kbps)"; break;
2742     case 14: str = "Short Message Services (Rate Set 2)"; break;
2743     case 15: str = "Packet Data Service: Internet or ISO Protocol Stack (14.4 kbps)"; break;
2744     case 16: str = "Packet Data Service: CDPD Protocol Stack (14.4 kbps)"; break;
2745     case 17: str = "High Rate Voice Service (13 kbps)"; break;
2746     case 32768: str = "QCELP (13 kbps)"; break;
2747     case 18: str = "Over-the-Air Parameter Administration (Rate Set 1)"; break;
2748     case 19: str = "Over-the-Air Parameter Administration (Rate Set 2)"; break;
2749     case 20: str = "Group 3 Analog Facsimile (Rate Set 1)"; break;
2750     case 21: str = "Group 3 Analog Facsimile (Rate Set 2)"; break;
2751     case 22: str = "High Speed Packet Data Service: Internet or ISO Protocol Stack (RS1 forward, RS1 reverse)"; break;
2752     case 23: str = "High Speed Packet Data Service: Internet or ISO Protocol Stack (RS1 forward, RS2 reverse)"; break;
2753     case 24: str = "High Speed Packet Data Service: Internet or ISO Protocol Stack (RS2 forward, RS1 reverse)"; break;
2754     case 25: str = "High Speed Packet Data Service: Internet or ISO Protocol Stack (RS2 forward, RS2 reverse)"; break;
2755     case 26: str = "High Speed Packet Data Service: CDPD Protocol Stack (RS1 forward, RS1 reverse)"; break;
2756     case 27: str = "High Speed Packet Data Service: CDPD Protocol Stack (RS1 forward, RS2 reverse)"; break;
2757     case 28: str = "High Speed Packet Data Service: CDPD Protocol Stack (RS2 forward, RS1 reverse)"; break;
2758     case 29: str = "High Speed Packet Data Service: CDPD Protocol Stack (RS2 forward, RS2 reverse)"; break;
2759     case 30: str = "Supplemental Channel Loopback Test for Rate Set 1"; break;
2760     case 31: str = "Supplemental Channel Loopback Test for Rate Set 2"; break;
2761     case 32: str = "Test Data Service Option (TDSO)"; break;
2762     case 33: str = "cdma2000 High Speed Packet Data Service, Internet or ISO Protocol Stack"; break;
2763     case 34: str = "cdma2000 High Speed Packet Data Service, CDPD Protocol Stack"; break;
2764     case 35: str = "Location Services, Rate Set 1 (9.6 kbps)"; break;
2765     case 36: str = "Location Services, Rate Set 2 (14.4 kbps)"; break;
2766     case 37: str = "ISDN Interworking Service (64 kbps)"; break;
2767     case 38: str = "GSM Voice"; break;
2768     case 39: str = "GSM Circuit Data"; break;
2769     case 40: str = "GSM Packet Data"; break;
2770     case 41: str = "GSM Short Message Service"; break;
2771     case 42: str = "None Reserved for MC-MAP standard service options"; break;
2772     case 54: str = "Markov Service Option (MSO)"; break;
2773     case 55: str = "Loopback Service Option (LSO)"; break;
2774     case 56: str = "Selectable Mode Vocoder"; break;
2775     case 57: str = "32 kbps Circuit Video Conferencing"; break;
2776     case 58: str = "64 kbps Circuit Video Conferencing"; break;
2777     case 59: str = "HRPD Accounting Records Identifier"; break;
2778     case 60: str = "Link Layer Assisted Robust Header Compression (LLA ROHC) - Header Removal"; break;
2779     case 61: str = "Link Layer Assisted Robust Header Compression (LLA ROHC) - Header Compression"; break;
2780     case 62: str = "- 4099 None Reserved for standard service options"; break;
2781     case 4100: str = "Asynchronous Data Service, Revision 1 (9.6 or 14.4 kbps)"; break;
2782     case 4101: str = "Group 3 Facsimile, Revision 1 (9.6 or 14.4 kbps)"; break;
2783     case 4102: str = "Reserved for standard service option"; break;
2784     case 4103: str = "Packet Data Service: Internet or ISO Protocol Stack, Revision 1 (9.6 or 14.4 kbps)"; break;
2785     case 4104: str = "Packet Data Service: CDPD Protocol Stack, Revision 1 (9.6 or 14.4 kbps)"; break;
2786     default:
2787         if ((so >= 4105) && (so <= 32767)) { str = "Reserved for standard service options"; }
2788         else if ((so >= 32769) && (so <= 32771)) { str = "Proprietary QUALCOMM Incorporated"; }
2789         else if ((so >= 32772) && (so <= 32775)) { str = "Proprietary OKI Telecom"; }
2790         else if ((so >= 32776) && (so <= 32779)) { str = "Proprietary Lucent Technologies"; }
2791         else if ((so >= 32780) && (so <=32783)) { str = "Nokia"; }
2792         else if ((so >= 32784) && (so <=32787)) { str = "NORTEL NETWORKS"; }
2793         else if ((so >= 32788) && (so <=32791)) { str = "Sony Electronics Inc."; }
2794         else if ((so >= 32792) && (so <=32795)) { str = "Motorola"; }
2795         else if ((so >= 32796) && (so <=32799)) { str = "QUALCOMM Incorporated"; }
2796         else if ((so >= 32800) && (so <=32803)) { str = "QUALCOMM Incorporated"; }
2797         else if ((so >= 32804) && (so <=32807)) { str = "QUALCOMM Incorporated"; }
2798         else if ((so >= 32808) && (so <=32811)) { str = "QUALCOMM Incorporated"; }
2799         else if ((so >= 32812) && (so <=32815)) { str = "Lucent Technologies"; }
2800         else if ((so >= 32816) && (so <=32819)) { str = "Denso International"; }
2801         else if ((so >= 32820) && (so <=32823)) { str = "Motorola"; }
2802         else if ((so >= 32824) && (so <=32827)) { str = "Denso International"; }
2803         else if ((so >= 32828) && (so <=32831)) { str = "Denso International"; }
2804         else if ((so >= 32832) && (so <=32835)) { str = "Denso International"; }
2805         else if ((so >= 32836) && (so <=32839)) { str = "NEC America"; }
2806         else if ((so >= 32840) && (so <=32843)) { str = "Samsung Electronics"; }
2807         else if ((so >= 32844) && (so <=32847)) { str = "Texas Instruments Incorporated"; }
2808         else if ((so >= 32848) && (so <=32851)) { str = "Toshiba Corporation"; }
2809         else if ((so >= 32852) && (so <=32855)) { str = "LG Electronics Inc."; }
2810         else if ((so >= 32856) && (so <=32859)) { str = "VIA Telecom Inc."; }
2811         else { str = "Reserved"; }
2812         break;
2813     }
2814
2815     proto_tree_add_text(tree, asn1->tvb,
2816         saved_offset, asn1->offset - saved_offset,
2817         "%s %u/0x%04x",
2818         str, so, so);
2819
2820     sprintf(add_string, " - (SO=0x%04x)", so);
2821
2822     EXTRANEOUS_DATA_CHECK(len, 2);
2823 }
2824
2825 static void
2826 param_tdma_sc(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
2827 {
2828     gint32 value;
2829     guint saved_offset;
2830     gchar *str = NULL;
2831
2832     add_string = add_string;
2833     saved_offset = asn1->offset;
2834
2835     asn1_int32_value_decode(asn1, 1, &value);
2836
2837     switch (value)
2838     {
2839     case 0: str = "Analog Speech Only"; break;
2840     case 1: str = "Digital Speech Only"; break;
2841     case 2: str = "Analog or Digital Speech, Analog Preferred"; break;
2842     case 3: str = "Analog or Digital Speech, Digital Preferred"; break;
2843     case 4: str = "Asynchronous Data"; break;
2844     case 5: str = "G3 Fax"; break;
2845     case 6: str = "Not Used (Service Rejected)"; break;
2846     case 7: str = "STU III (Secure Telephone Unit)"; break;
2847     default:
2848         str = "Reserved, treat as Analog Speech Only";
2849         break;
2850     }
2851
2852     proto_tree_add_text(tree, asn1->tvb,
2853         saved_offset, asn1->offset - saved_offset,
2854         "%s %u",
2855         str, value);
2856
2857     EXTRANEOUS_DATA_CHECK(len, 1);
2858 }
2859
2860 static void
2861 param_dmh_red_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
2862 {
2863     gint32 redind;
2864     guint saved_offset;
2865     gchar *str = NULL;
2866
2867     EXACT_DATA_CHECK(len, 1);
2868
2869     add_string = add_string;
2870     saved_offset = asn1->offset;
2871
2872     asn1_int32_value_decode(asn1, 1, &redind);
2873
2874     switch (redind)
2875     {
2876     case 0: str = "Not used"; break;
2877     case 1: str = "Call Forwarding Unconditional (CFU)"; break;
2878     case 2: str = "Call Forwarding Busy (CFB)"; break;
2879     case 3: str = "Call Forwarding No Answer (CFNA)"; break;
2880     case 4: str = "Call Forwarding Other (CFO)"; break;
2881     case 5: str = "CD Unspecified"; break;
2882     case 6: str = "CD PSTN"; break;
2883     case 7: str = "CD Private"; break;
2884     case 8: str = "PSTN Tandem"; break;
2885     case 9: str = "Private Tandem"; break;
2886     case 10: str = "Busy"; break;
2887     case 11: str = "Inactive"; break;
2888     case 12: str = "Unassigned"; break;
2889     case 13: str = "Termination Denied"; break;
2890     case 14: str = "CD Failure"; break;
2891     case 15: str = "Explicit Call Transfer (ECT)"; break;
2892     case 16: str = "Mobile Access Hunting (MAH)"; break;
2893     case 17: str = "Flexible Alerting (FA)"; break;
2894     case 18: str = "Abandoned Call Leg"; break;
2895     case 19: str = "Password Call Acceptance (PCA) Call Refused"; break;
2896     case 20: str = "Selective Call Acceptance (SCA) Call Refused"; break;
2897     case 21: str = "Dialogue"; break;
2898     case 22: str = "Call Forwarding Default (CFD)"; break;
2899     case 23: str = "CD Local"; break;
2900     case 24: str = "Voice Mail Retrieval"; break;
2901     default:
2902         if ((redind >= 25) && (redind <= 127))
2903         {
2904             str = "Reserved/Unknown";
2905         }
2906         else
2907         {
2908             str = "Reserved for bilateral agreements";
2909         }
2910         break;
2911     }
2912
2913     proto_tree_add_text(tree, asn1->tvb,
2914         saved_offset, asn1->offset - saved_offset,
2915         "%s (%u)",
2916         str, redind);
2917 }
2918
2919 static void
2920 param_cic(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
2921 {
2922     gint32 tg, mem;
2923     guint saved_offset;
2924
2925     EXACT_DATA_CHECK(len, 2);
2926
2927     add_string = add_string;
2928     saved_offset = asn1->offset;
2929
2930     asn1_int32_value_decode(asn1, 1, &tg);
2931     asn1_int32_value_decode(asn1, 1, &mem);
2932
2933     proto_tree_add_text(tree, asn1->tvb,
2934         saved_offset, len,
2935         "Trunk Group %u  Member %u",
2936         tg, mem);
2937
2938     sprintf(add_string, "- (%u/%u)", tg, mem);
2939 }
2940
2941 static void
2942 param_qic(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
2943 {
2944     gint32 qic;
2945     guint saved_offset;
2946     gchar *str = NULL;
2947
2948     EXACT_DATA_CHECK(len, 1);
2949
2950     add_string = add_string;
2951     saved_offset = asn1->offset;
2952
2953     asn1_int32_value_decode(asn1, 1, &qic);
2954
2955     switch (qic)
2956     {
2957     case 0: str = "Not used"; break;
2958     case 1: str = "No information"; break;
2959     case 2: str = "Validation only"; break;
2960     case 3: str = "Validation and profile"; break;
2961     case 4: str = "Profile only"; break;
2962     default:
2963         if ((qic >= 5) && (qic <= 223))
2964         {
2965             str = "Reserved, treat as Validation and profile";
2966         }
2967         else
2968         {
2969             str = "Reserved for extension, treat as Validation and profile";
2970         }
2971         break;
2972     }
2973
2974     proto_tree_add_text(tree, asn1->tvb,
2975         saved_offset, asn1->offset - saved_offset,
2976         str);
2977 }
2978
2979 static void
2980 param_feat_result(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
2981 {
2982     gint32 value;
2983     guint saved_offset;
2984     gchar *str = NULL;
2985
2986     EXACT_DATA_CHECK(len, 1);
2987
2988     add_string = add_string;
2989     saved_offset = asn1->offset;
2990
2991     asn1_int32_value_decode(asn1, 1, &value);
2992
2993     switch (value)
2994     {
2995     case 0: str = "Not used"; break;
2996     case 1: str = "Unsuccessful"; break;
2997     case 2: str = "Successful"; break;
2998     default:
2999         if ((value >= 3) && (value <= 95)) { str = "Reserved, treat as Unsuccessful"; }
3000         else if ((value >= 96) && (value <= 127)) { str = "Reserved, treat as Unsuccessful"; }
3001         else if ((value >= 128) && (value <= 223)) { str = "Reserved, treat as Successful"; }
3002         else { str = "Reserved for protocol extension, treat as Successful"; }
3003         break;
3004     }
3005
3006     proto_tree_add_text(tree, asn1->tvb,
3007         saved_offset, asn1->offset - saved_offset,
3008         str);
3009 }
3010
3011 gchar *calling_feat_ind_str[] = {
3012     "Not used",
3013     "Not authorized",
3014     "Authorized but de-activated",
3015     "Authorized and activated"
3016 };
3017
3018 static void
3019 param_calling_feat_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
3020 {
3021     gint32 value;
3022     guint saved_offset;
3023
3024     SHORT_DATA_CHECK(len, 2);
3025
3026     add_string = add_string;
3027     saved_offset = asn1->offset;
3028
3029     asn1_int32_value_decode(asn1, 1, &value);
3030
3031     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3032     proto_tree_add_text(tree, asn1->tvb,
3033         saved_offset, asn1->offset - saved_offset,
3034         "%s :  Call Waiting Feature Activity (CW-FA), %s",
3035         bigbuf,
3036         calling_feat_ind_str[(value & 0xc0) >> 6]);
3037
3038     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
3039     proto_tree_add_text(tree, asn1->tvb,
3040         saved_offset, asn1->offset - saved_offset,
3041         "%s :  Call Forwarding No Answer Feature Activity (CFNA-FA), %s",
3042         bigbuf,
3043         calling_feat_ind_str[(value & 0x30) >> 4]);
3044
3045     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
3046     proto_tree_add_text(tree, asn1->tvb,
3047         saved_offset, asn1->offset - saved_offset,
3048         "%s :  Call Forwarding Busy Feature Activity (CFB-FA), %s",
3049         bigbuf,
3050         calling_feat_ind_str[(value & 0x0c) >> 2]);
3051
3052     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3053     proto_tree_add_text(tree, asn1->tvb,
3054         saved_offset, asn1->offset - saved_offset,
3055         "%s :  Call Forwarding Unconditional Feature Activity (CFU-FA), %s",
3056         bigbuf,
3057         calling_feat_ind_str[value & 0x03]);
3058
3059     saved_offset = asn1->offset;
3060
3061     asn1_int32_value_decode(asn1, 1, &value);
3062
3063     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3064     proto_tree_add_text(tree, asn1->tvb,
3065         saved_offset, asn1->offset - saved_offset,
3066         "%s :  Call Transfer Feature Activity (CT-FA), %s",
3067         bigbuf,
3068         calling_feat_ind_str[(value & 0xc0) >> 6]);
3069
3070     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
3071     proto_tree_add_text(tree, asn1->tvb,
3072         saved_offset, asn1->offset - saved_offset,
3073         "%s :  Voice Privacy Feature Activity (VP-FA), %s",
3074         bigbuf,
3075         calling_feat_ind_str[(value & 0x30) >> 4]);
3076
3077     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
3078     proto_tree_add_text(tree, asn1->tvb,
3079         saved_offset, asn1->offset - saved_offset,
3080         "%s :  Call Delivery Feature Activity (CD-FA), %s",
3081         bigbuf,
3082         calling_feat_ind_str[(value & 0x0c) >> 2]);
3083
3084     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3085     proto_tree_add_text(tree, asn1->tvb,
3086         saved_offset, asn1->offset - saved_offset,
3087         "%s :  Three-Way Calling Feature Activity (3WC-FA), %s",
3088         bigbuf,
3089         calling_feat_ind_str[value & 0x03]);
3090
3091     if (len == 2) return;
3092
3093     saved_offset = asn1->offset;
3094
3095     asn1_int32_value_decode(asn1, 1, &value);
3096
3097     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3098     proto_tree_add_text(tree, asn1->tvb,
3099         saved_offset, asn1->offset - saved_offset,
3100         "%s :  Calling Number ID Restriction Override Feature Activity (CNIROver-FA), %s",
3101         bigbuf,
3102         calling_feat_ind_str[(value & 0xc0) >> 6]);
3103
3104     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
3105     proto_tree_add_text(tree, asn1->tvb,
3106         saved_offset, asn1->offset - saved_offset,
3107         "%s :  Calling Number ID Restriction Feature Activity (CNIR-FA), %s",
3108         bigbuf,
3109         calling_feat_ind_str[(value & 0x30) >> 4]);
3110
3111     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
3112     proto_tree_add_text(tree, asn1->tvb,
3113         saved_offset, asn1->offset - saved_offset,
3114         "%s :  Two number Calling Number ID Presentation Feature Activity (CNIP2-FA), %s",
3115         bigbuf,
3116         calling_feat_ind_str[(value & 0x0c) >> 2]);
3117
3118     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3119     proto_tree_add_text(tree, asn1->tvb,
3120         saved_offset, asn1->offset - saved_offset,
3121         "%s :  One number Calling Number ID Presentation Feature Activity (CNIP1-FA), %s",
3122         bigbuf,
3123         calling_feat_ind_str[value & 0x03]);
3124
3125     if (len == 3) return;
3126
3127     saved_offset = asn1->offset;
3128
3129     asn1_int32_value_decode(asn1, 1, &value);
3130
3131     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3132     proto_tree_add_text(tree, asn1->tvb,
3133         saved_offset, asn1->offset - saved_offset,
3134         "%s :  USCF divert to voice mail Feature Activity (USCFvm-FA), %s",
3135         bigbuf,
3136         calling_feat_ind_str[(value & 0xc0) >> 6]);
3137
3138     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
3139     proto_tree_add_text(tree, asn1->tvb,
3140         saved_offset, asn1->offset - saved_offset,
3141         "%s :  Answer Hold Feature Activity (AH-FA), %s",
3142         bigbuf,
3143         calling_feat_ind_str[(value & 0x30) >> 4]);
3144
3145     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
3146     proto_tree_add_text(tree, asn1->tvb,
3147         saved_offset, asn1->offset - saved_offset,
3148         "%s :  Data Privacy Feature Activity (DP-FA), %s",
3149         bigbuf,
3150         calling_feat_ind_str[(value & 0x0c) >> 2]);
3151
3152     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3153     proto_tree_add_text(tree, asn1->tvb,
3154         saved_offset, asn1->offset - saved_offset,
3155         "%s :  Priority Call Waiting Feature Activity (PCW-FA), %s",
3156         bigbuf,
3157         calling_feat_ind_str[value & 0x03]);
3158
3159     if (len == 4) return;
3160
3161     saved_offset = asn1->offset;
3162
3163     asn1_int32_value_decode(asn1, 1, &value);
3164
3165     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3166     proto_tree_add_text(tree, asn1->tvb,
3167         saved_offset, asn1->offset - saved_offset,
3168         "%s :  CDMA-Concurrent Service Feature Activity (CCS-FA), %s",
3169         bigbuf,
3170         calling_feat_ind_str[(value & 0xc0) >> 6]);
3171
3172     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
3173     proto_tree_add_text(tree, asn1->tvb,
3174         saved_offset, asn1->offset - saved_offset,
3175         "%s :  CDMA-Packet Data Service Feature Activity (CPDS-FA), %s",
3176         bigbuf,
3177         calling_feat_ind_str[(value & 0x30) >> 4]);
3178
3179     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
3180     proto_tree_add_text(tree, asn1->tvb,
3181         saved_offset, asn1->offset - saved_offset,
3182         "%s :  USCF divert to network registered DN Feature Activity (USCFnr-FA), %s",
3183         bigbuf,
3184         calling_feat_ind_str[(value & 0x0c) >> 2]);
3185
3186     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3187     proto_tree_add_text(tree, asn1->tvb,
3188         saved_offset, asn1->offset - saved_offset,
3189         "%s :  USCF divert to mobile station provided DN Feature Activity (USCFms-FA), %s",
3190         bigbuf,
3191         calling_feat_ind_str[value & 0x03]);
3192
3193     if (len == 5) return;
3194
3195     saved_offset = asn1->offset;
3196
3197     asn1_int32_value_decode(asn1, 1, &value);
3198
3199     other_decode_bitfield_value(bigbuf, value, 0xfc, 8);
3200     proto_tree_add_text(tree, asn1->tvb,
3201         saved_offset, asn1->offset - saved_offset,
3202         "%s :  Reserved",
3203         bigbuf);
3204
3205     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3206     proto_tree_add_text(tree, asn1->tvb,
3207         saved_offset, asn1->offset - saved_offset,
3208         "%s :  TDMA Enhanced Privacy and Encryption Feature Activity (TDMA EPE-FA), %s",
3209         bigbuf,
3210         calling_feat_ind_str[value & 0x03]);
3211
3212     EXTRANEOUS_DATA_CHECK(len, 6);
3213 }
3214
3215 static void
3216 param_usage_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
3217 {
3218     gint32 value;
3219     guint saved_offset;
3220     gchar *str = NULL;
3221
3222     EXACT_DATA_CHECK(len, 1);
3223
3224     add_string = add_string;
3225     saved_offset = asn1->offset;
3226
3227     asn1_int32_value_decode(asn1, 1, &value);
3228
3229     switch (value)
3230     {
3231     case 0: str = "Unspecified"; break;
3232     case 1: str = "Sent-paid call"; break;
3233     case 2: str = "3rd number bill"; break;
3234     default:
3235         str = "Reserved, treat as Unspecified";
3236         break;
3237     }
3238
3239     proto_tree_add_text(tree, asn1->tvb,
3240         saved_offset, asn1->offset - saved_offset,
3241         "%s (%u)",
3242         str,
3243         value);
3244 }
3245
3246 gchar *tdma_data_feat_ind_str[] = {
3247     "Not used",
3248     "Not authorized",
3249     "Authorized but de-activated",
3250     "Authorized and activated"
3251 };
3252
3253 static void
3254 param_tdma_data_feat_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
3255 {
3256     gint32 value;
3257     guint saved_offset;
3258
3259     SHORT_DATA_CHECK(len, 2);
3260
3261     add_string = add_string;
3262     saved_offset = asn1->offset;
3263
3264     asn1_int32_value_decode(asn1, 1, &value);
3265
3266     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3267     proto_tree_add_text(tree, asn1->tvb,
3268         saved_offset, asn1->offset - saved_offset,
3269         "%s :  Reserved",
3270         bigbuf);
3271
3272     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
3273     proto_tree_add_text(tree, asn1->tvb,
3274         saved_offset, asn1->offset - saved_offset,
3275         "%s :  STU-III Feature Activity (STUIII-FA), %s",
3276         bigbuf,
3277         tdma_data_feat_ind_str[(value & 0x30) >> 4]);
3278
3279     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
3280     proto_tree_add_text(tree, asn1->tvb,
3281         saved_offset, asn1->offset - saved_offset,
3282         "%s :  G3 Fax Feature Activity (G3FAX-FA), %s",
3283         bigbuf,
3284         tdma_data_feat_ind_str[(value & 0x0c) >> 2]);
3285
3286     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3287     proto_tree_add_text(tree, asn1->tvb,
3288         saved_offset, asn1->offset - saved_offset,
3289         "%s :  ADS Feature Activity (ADS-FA), %s",
3290         bigbuf,
3291         tdma_data_feat_ind_str[value & 0x03]);
3292
3293     saved_offset = asn1->offset;
3294
3295     asn1_int32_value_decode(asn1, 1, &value);
3296
3297     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3298     proto_tree_add_text(tree, asn1->tvb,
3299         saved_offset, asn1->offset - saved_offset,
3300         "%s :  Triple Rate data Feature Activity (3RATE-FA), %s",
3301         bigbuf,
3302         tdma_data_feat_ind_str[(value & 0xc0) >> 6]);
3303
3304     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
3305     proto_tree_add_text(tree, asn1->tvb,
3306         saved_offset, asn1->offset - saved_offset,
3307         "%s :  Double Rate data Feature Activity (2RATE-FA), %s",
3308         bigbuf,
3309         tdma_data_feat_ind_str[(value & 0x30) >> 4]);
3310
3311     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
3312     proto_tree_add_text(tree, asn1->tvb,
3313         saved_offset, asn1->offset - saved_offset,
3314         "%s :  Full Rate data Feature Activity (FRATE-FA), %s",
3315         bigbuf,
3316         tdma_data_feat_ind_str[(value & 0x0c) >> 2]);
3317
3318     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3319     proto_tree_add_text(tree, asn1->tvb,
3320         saved_offset, asn1->offset - saved_offset,
3321         "%s :  Half Rate data Feature Activity (HRATE-FA), %s",
3322         bigbuf,
3323         tdma_data_feat_ind_str[value & 0x03]);
3324
3325     EXTRANEOUS_DATA_CHECK(len, 2);
3326 }
3327
3328 static void
3329 param_faulty(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
3330 {
3331     gint32 value;
3332     guint saved_offset;
3333     gchar *str = NULL;
3334     gint idx;
3335
3336     add_string = add_string;
3337     saved_offset = asn1->offset;
3338     asn1_int32_value_decode(asn1, 1, &value);
3339
3340     str = my_match_strval((guint32) value, ansi_param_1_strings, &idx);
3341
3342     if (NULL == str)
3343     {
3344         if (len < 2)
3345         {
3346             proto_tree_add_text(tree, asn1->tvb,
3347                 saved_offset, len,
3348                 "Unrecognized parameter ID");
3349             return;
3350         }
3351
3352         asn1->offset = saved_offset;
3353         asn1_uint32_value_decode(asn1, 2, &value);
3354
3355         str = my_match_strval((guint32) value, ansi_param_2_strings, &idx);
3356
3357         if (NULL == str)
3358         {
3359             if (len < 3)
3360             {
3361                 proto_tree_add_text(tree, asn1->tvb,
3362                     saved_offset, len,
3363                     "Unrecognized parameter ID");
3364                 return;
3365             }
3366
3367             asn1->offset = saved_offset;
3368             asn1_int32_value_decode(asn1, 3, &value);
3369
3370             str = my_match_strval((guint32) value, ansi_param_3_strings, &idx);
3371
3372             if (NULL == str)
3373             {
3374                 if (((value >= 0x9FFF00) && (value <= 0x9FFF7F)) ||
3375                     ((value >= 0xBFFF00) && (value <= 0xBFFF7F)))
3376                 {
3377                     str = "Reserved for protocol extension";
3378                 }
3379                 else if (((value >= 0x9FFE76) && (value <= 0x9FFE7F)) ||
3380                     ((value >= 0xBFFE76) && (value <= 0xBFFE7F)))
3381                 {
3382                     str = "Reserved for National Network Use";
3383                 }
3384                 else
3385                 {
3386                     str = "Unrecognized parameter ID";
3387                 }
3388             }
3389         }
3390     }
3391
3392     proto_tree_add_text(tree, asn1->tvb,
3393         saved_offset, asn1->offset - saved_offset,
3394         str);
3395
3396     EXTRANEOUS_DATA_CHECK(len, asn1->offset - saved_offset);
3397 }
3398
3399 static void
3400 param_sys_type_code(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
3401 {
3402     gint32 sys_type_code;
3403     guint saved_offset;
3404     gchar *str = NULL;
3405
3406     EXACT_DATA_CHECK(len, 1);
3407
3408     add_string = add_string;
3409     saved_offset = asn1->offset;
3410
3411     asn1_int32_value_decode(asn1, 1, &sys_type_code);
3412
3413     switch (sys_type_code)
3414     {
3415     case 0: str = "Not used"; break;
3416     case 1: str = "EDS"; break;
3417     case 2: str = "Astronet"; break;
3418     case 3: str = "Lucent Technologies"; break;
3419     case 4: str = "Ericsson"; break;
3420     case 5: str = "GTE"; break;
3421     case 6: str = "Motorola"; break;
3422     case 7: str = "NEC"; break;
3423     case 8: str = "NORTEL"; break;
3424     case 9: str = "NovAtel"; break;
3425     case 10: str = "Plexsys"; break;
3426     case 11: str = "Digital Equipment Corp"; break;
3427     case 12: str = "INET"; break;
3428     case 13: str = "Bellcore"; break;
3429     case 14: str = "Alcatel SEL"; break;
3430     case 15: str = "Compaq (Tandem)"; break;
3431     case 16: str = "QUALCOMM"; break;
3432     case 17: str = "Aldiscon"; break;
3433     case 18: str = "Celcore"; break;
3434     case 19: str = "TELOS"; break;
3435     case 20: str = "ADI Limited (Stanilite)"; break;
3436     case 21: str = "Coral Systems"; break;
3437     case 22: str = "Synacom Technology"; break;
3438     case 23: str = "DSC"; break;
3439     case 24: str = "MCI"; break;
3440     case 25: str = "NewNet"; break;
3441     case 26: str = "Sema Group Telecoms"; break;
3442     case 27: str = "LG Information and Communications"; break;
3443     case 28: str = "CBIS"; break;
3444     case 29: str = "Siemens"; break;
3445     case 30: str = "Samsung Electronics"; break;
3446     case 31: str = "ReadyCom Inc."; break;
3447     case 32: str = "AG Communication Systems"; break;
3448     case 33: str = "Hughes Network Systems"; break;
3449     case 34: str = "Phoenix Wireless Group"; break;
3450     default:
3451         str = "Reserved/Unknown";
3452         break;
3453     }
3454
3455     proto_tree_add_text(tree, asn1->tvb,
3456         saved_offset, asn1->offset - saved_offset,
3457         "Vendor ID (%u) %s",
3458         sys_type_code, str);
3459 }
3460
3461 static void
3462 param_ext_sys_type_code(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
3463 {
3464     gint32 type;
3465     guint saved_offset;
3466     gchar *str = NULL;
3467
3468     EXACT_DATA_CHECK(len, 2);
3469
3470     add_string = add_string;
3471     saved_offset = asn1->offset;
3472
3473     asn1_int32_value_decode(asn1, 1, &type);
3474
3475     switch (type)
3476     {
3477     case 0: str = "Not specified"; break;
3478     case 1: str = "Serving MSC"; break;
3479     case 2: str = "Home MSC"; break;
3480     case 3: str = "Gateway MSC"; break;
3481     case 4: str = "HLR"; break;
3482     case 5: str = "VLR"; break;
3483     case 6: str = "EIR (reserved)"; break;
3484     case 7: str = "AC"; break;
3485     case 8: str = "Border MSC"; break;
3486     case 9: str = "Originating MSC"; break;
3487     default:
3488         if ((type >= 10) && (type <= 223)) { str = "Reserved, treat as Not specified"; }
3489         else { str = "Reserved for protocol extension, treat as Not specified"; }
3490         break;
3491     }
3492
3493     proto_tree_add_text(tree, asn1->tvb,
3494         saved_offset, asn1->offset - saved_offset,
3495         "Type (%u) %s",
3496         type,
3497         str);
3498
3499     param_sys_type_code(asn1, tree, len-1, add_string);
3500 }
3501
3502 static void
3503 param_cdma_sea_win(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
3504 {
3505     gint32 value;
3506     guint saved_offset;
3507
3508     EXACT_DATA_CHECK(len, 1);
3509
3510     add_string = add_string;
3511     saved_offset = asn1->offset;
3512
3513     asn1_int32_value_decode(asn1, 1, &value);
3514
3515     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
3516     proto_tree_add_text(tree, asn1->tvb,
3517         saved_offset, asn1->offset - saved_offset,
3518         "%s :  Reserved",
3519         bigbuf);
3520
3521     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
3522     proto_tree_add_text(tree, asn1->tvb,
3523         saved_offset, asn1->offset - saved_offset,
3524         "%s :  Value %u",
3525         bigbuf,
3526         value & 0x0f);
3527 }
3528
3529 static void
3530 param_cdma_sea_param(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
3531 {
3532     gint32 value;
3533     guint saved_offset;
3534
3535     SHORT_DATA_CHECK(len, 4);
3536
3537     add_string = add_string;
3538     saved_offset = asn1->offset;
3539
3540     asn1_int32_value_decode(asn1, 1, &value);
3541
3542     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
3543     proto_tree_add_text(tree, asn1->tvb,
3544         saved_offset, asn1->offset - saved_offset,
3545         "%s :  Reserved",
3546         bigbuf);
3547
3548     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
3549     proto_tree_add_text(tree, asn1->tvb,
3550         saved_offset, asn1->offset - saved_offset,
3551         "%s :  CDMA Search Window, %u",
3552         bigbuf,
3553         value & 0x0f);
3554
3555     saved_offset = asn1->offset;
3556
3557     asn1_int32_value_decode(asn1, 1, &value);
3558
3559     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3560     proto_tree_add_text(tree, asn1->tvb,
3561         saved_offset, asn1->offset - saved_offset,
3562         "%s :  Reserved",
3563         bigbuf);
3564
3565     other_decode_bitfield_value(bigbuf, value, 0x3f, 8);
3566     proto_tree_add_text(tree, asn1->tvb,
3567         saved_offset, asn1->offset - saved_offset,
3568         "%s :  T_ADD, %u",
3569         bigbuf,
3570         value & 0x3f);
3571
3572     saved_offset = asn1->offset;
3573
3574     asn1_int32_value_decode(asn1, 1, &value);
3575
3576     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3577     proto_tree_add_text(tree, asn1->tvb,
3578         saved_offset, asn1->offset - saved_offset,
3579         "%s :  Reserved",
3580         bigbuf);
3581
3582     other_decode_bitfield_value(bigbuf, value, 0x3f, 8);
3583     proto_tree_add_text(tree, asn1->tvb,
3584         saved_offset, asn1->offset - saved_offset,
3585         "%s :  T_DROP, %u",
3586         bigbuf,
3587         value & 0x3f);
3588
3589     saved_offset = asn1->offset;
3590
3591     asn1_int32_value_decode(asn1, 1, &value);
3592
3593     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
3594     proto_tree_add_text(tree, asn1->tvb,
3595         saved_offset, asn1->offset - saved_offset,
3596         "%s :  T_TDROP, %u",
3597         bigbuf,
3598         value & 0xf0);
3599
3600     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
3601     proto_tree_add_text(tree, asn1->tvb,
3602         saved_offset, asn1->offset - saved_offset,
3603         "%s :  T_COMP, %u",
3604         bigbuf,
3605         value & 0x0f);
3606
3607     EXTRANEOUS_DATA_CHECK(len, 4);
3608 }
3609
3610 static void
3611 param_cdma_code_chan(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
3612 {
3613     gint32 value;
3614     guint saved_offset;
3615
3616     add_string = add_string;
3617     saved_offset = asn1->offset;
3618
3619     asn1_int32_value_decode(asn1, 1, &value);
3620
3621     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3622     proto_tree_add_text(tree, asn1->tvb,
3623         saved_offset, asn1->offset - saved_offset,
3624         "%s :  Reserved",
3625         bigbuf);
3626
3627     other_decode_bitfield_value(bigbuf, value, 0x3f, 8);
3628     proto_tree_add_text(tree, asn1->tvb,
3629         saved_offset, asn1->offset - saved_offset,
3630         "%s :  CDMA Code Channel %u",
3631         bigbuf,
3632         value & 0x3f);
3633
3634     EXTRANEOUS_DATA_CHECK(len, 1);
3635 }
3636
3637 static void
3638 param_chan_data(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
3639 {
3640     gint32 value;
3641     guint saved_offset;
3642     gchar *str = NULL;
3643
3644     SHORT_DATA_CHECK(len, 3);
3645
3646     add_string = add_string;
3647     saved_offset = asn1->offset;
3648
3649     asn1_int32_value_decode(asn1, 1, &value);
3650
3651     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3652     proto_tree_add_text(tree, asn1->tvb,
3653         saved_offset, asn1->offset - saved_offset,
3654         "%s :  SAT Color Code %u",
3655         bigbuf,
3656         (value & 0xc0 >> 6));
3657
3658     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
3659     proto_tree_add_text(tree, asn1->tvb,
3660         saved_offset, asn1->offset - saved_offset,
3661         "%s :  %s",
3662         (value & 0x20) ? "Reserved" : "Analog Band Class",
3663         bigbuf);
3664
3665     switch ((value & 0x18) >> 3)
3666     {
3667     case 0: str = "DTX disabled (not active/acceptable)"; break;
3668     case 1: str = "Reserved, treat as DTX disabled"; break;
3669     case 2: str = "DTX-low mode (i.e., 8 dB below DTX active/acceptable)"; break;
3670     case 3: str = "DTX mode active or acceptable"; break;
3671     }
3672
3673     other_decode_bitfield_value(bigbuf, value, 0x18, 8);
3674     proto_tree_add_text(tree, asn1->tvb,
3675         saved_offset, asn1->offset - saved_offset,
3676         "%s :  %s",
3677         bigbuf,
3678         str);
3679
3680     other_decode_bitfield_value(bigbuf, value, 0x07, 8);
3681     proto_tree_add_text(tree, asn1->tvb,
3682         saved_offset, asn1->offset - saved_offset,
3683         "%s :  Voice Mobile Attenuation Code (VMAC) %u",
3684         bigbuf,
3685         value & 0x07);
3686
3687     saved_offset = asn1->offset;
3688
3689     asn1_int32_value_decode(asn1, 2, &value);
3690
3691     proto_tree_add_text(tree, asn1->tvb,
3692         saved_offset, asn1->offset - saved_offset,
3693         "Channel Number %u",
3694         value);
3695
3696     EXTRANEOUS_DATA_CHECK(len, 3);
3697 }
3698
3699 static void
3700 param_cdma_plcm(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
3701 {
3702     gint32 value;
3703     guint saved_offset;
3704
3705     EXACT_DATA_CHECK(len, 6);
3706
3707     add_string = add_string;
3708     saved_offset = asn1->offset;
3709
3710     asn1_int32_value_decode(asn1, 1, &value);
3711
3712     other_decode_bitfield_value(bigbuf, value, 0xfc, 8);
3713     proto_tree_add_text(tree, asn1->tvb,
3714         saved_offset, asn1->offset - saved_offset,
3715         "%s :  Reserved",
3716         bigbuf);
3717
3718     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3719     proto_tree_add_text(tree, asn1->tvb,
3720         saved_offset, asn1->offset - saved_offset,
3721         "%s :  CDMA Private Long Code Mask (PLCM) (MSB)",
3722         bigbuf);
3723
3724     saved_offset = asn1->offset;
3725
3726     proto_tree_add_text(tree, asn1->tvb,
3727         saved_offset, len - 1,
3728         "CDMA Private Long Code Mask (PLCM)");
3729
3730     asn1->offset += (len - 1);
3731 }
3732
3733 static void
3734 param_ctrl_chan_data(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
3735 {
3736     gint32 value;
3737     guint saved_offset;
3738
3739     EXACT_DATA_CHECK(len, 4);
3740
3741     add_string = add_string;
3742     saved_offset = asn1->offset;
3743
3744     asn1_int32_value_decode(asn1, 1, &value);
3745
3746     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3747     proto_tree_add_text(tree, asn1->tvb,
3748         saved_offset, asn1->offset - saved_offset,
3749         "%s :  Digital Color Code (DCC)",
3750         bigbuf);
3751
3752     other_decode_bitfield_value(bigbuf, value, 0x38, 8);
3753     proto_tree_add_text(tree, asn1->tvb,
3754         saved_offset, asn1->offset - saved_offset,
3755         "%s :  Reserved",
3756         bigbuf);
3757
3758     other_decode_bitfield_value(bigbuf, value, 0x07, 8);
3759     proto_tree_add_text(tree, asn1->tvb,
3760         saved_offset, asn1->offset - saved_offset,
3761         "%s :  Control Mobile Attenuation Code (CMAC)",
3762         bigbuf);
3763
3764     saved_offset = asn1->offset;
3765
3766     asn1_int32_value_decode(asn1, 2, &value);
3767
3768     proto_tree_add_text(tree, asn1->tvb,
3769         saved_offset, asn1->offset - saved_offset,
3770         "Channel Number (CHNO), %u",
3771         value);
3772
3773     saved_offset = asn1->offset;
3774
3775     asn1_int32_value_decode(asn1, 1, &value);
3776
3777     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
3778     proto_tree_add_text(tree, asn1->tvb,
3779         saved_offset, asn1->offset - saved_offset,
3780         "%s :  Reserved",
3781         bigbuf);
3782
3783     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
3784     proto_tree_add_text(tree, asn1->tvb,
3785         saved_offset, asn1->offset - saved_offset,
3786         "%s :  Supplementary Digital Color Codes (SDCC1)",
3787         bigbuf);
3788
3789     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3790     proto_tree_add_text(tree, asn1->tvb,
3791         saved_offset, asn1->offset - saved_offset,
3792         "%s :  Supplementary Digital Color Codes (SDCC2)",
3793         bigbuf);
3794 }
3795
3796 static void
3797 param_cdma_chan_data(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
3798 {
3799     gint32 value, temp_int;
3800     guint saved_offset;
3801     gchar *str = NULL;
3802
3803     SHORT_DATA_CHECK(len, 8);
3804
3805     add_string = add_string;
3806     saved_offset = asn1->offset;
3807
3808     asn1_int32_value_decode(asn1, 2, &value);
3809
3810     other_decode_bitfield_value(bigbuf, value >> 8, 0x80, 8);
3811     proto_tree_add_text(tree, asn1->tvb,
3812         saved_offset, 1,
3813         "%s :  Reserved",
3814         bigbuf);
3815
3816     other_decode_bitfield_value(bigbuf, value >> 8, 0x78, 8);
3817     proto_tree_add_text(tree, asn1->tvb,
3818         saved_offset, 1,
3819         "%s :  Frame Offset (%u), %.2f ms",
3820         bigbuf,
3821         (value & 0x7800) >> 11,
3822         ((value & 0x7800) >> 11) * 1.25);
3823
3824     other_decode_bitfield_value(bigbuf, value >> 8, 0x07, 8);
3825     proto_tree_add_text(tree, asn1->tvb,
3826         saved_offset, 1,
3827         "%s :  CDMA Channel Number (MSB), %u",
3828         bigbuf,
3829         value & 0x07ff);
3830
3831     other_decode_bitfield_value(bigbuf, value & 0x00ff, 0xff, 8);
3832     proto_tree_add_text(tree, asn1->tvb,
3833         saved_offset+1, 1,
3834         "%s :  CDMA Channel Number (LSB)",
3835         bigbuf);
3836
3837     saved_offset = asn1->offset;
3838
3839     asn1_int32_value_decode(asn1, 1, &value);
3840
3841     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
3842     proto_tree_add_text(tree, asn1->tvb,
3843         saved_offset, asn1->offset - saved_offset,
3844         "%s :  Reserved",
3845         bigbuf);
3846
3847     temp_int = (value & 0x7c) >> 2;
3848     if ((temp_int < 0) || (temp_int >= (gint) NUM_BAND_CLASS_STR))
3849     {
3850         str = "Reserved";
3851     }
3852     else
3853     {
3854         str = band_class_str[temp_int];
3855     }
3856
3857     other_decode_bitfield_value(bigbuf, value, 0x7c, 8);
3858     proto_tree_add_text(tree, asn1->tvb,
3859         saved_offset, asn1->offset - saved_offset,
3860         "%s :  Band Class, %s",
3861         bigbuf,
3862         str);
3863
3864     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3865     proto_tree_add_text(tree, asn1->tvb,
3866         saved_offset, asn1->offset - saved_offset,
3867         "%s :  Long Code Mask (MSB)",
3868         bigbuf);
3869
3870     asn1_int32_value_decode(asn1, 1, &value);
3871
3872     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
3873     proto_tree_add_text(tree, asn1->tvb,
3874         saved_offset + 1, 1,
3875         "%s :  Long Code Mask",
3876         bigbuf);
3877
3878     asn1_int32_value_decode(asn1, 1, &value);
3879
3880     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
3881     proto_tree_add_text(tree, asn1->tvb,
3882         saved_offset + 2, 1,
3883         "%s :  Long Code Mask",
3884         bigbuf);
3885
3886     asn1_int32_value_decode(asn1, 1, &value);
3887
3888     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
3889     proto_tree_add_text(tree, asn1->tvb,
3890         saved_offset + 3, 1,
3891         "%s :  Long Code Mask",
3892         bigbuf);
3893
3894     asn1_int32_value_decode(asn1, 1, &value);
3895
3896     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
3897     proto_tree_add_text(tree, asn1->tvb,
3898         saved_offset + 4, 1,
3899         "%s :  Long Code Mask",
3900         bigbuf);
3901
3902     asn1_int32_value_decode(asn1, 1, &value);
3903
3904     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
3905     proto_tree_add_text(tree, asn1->tvb,
3906         saved_offset + 5, 1,
3907         "%s :  Long Code Mask (LSB)",
3908         bigbuf);
3909
3910     if (len == 8) return;
3911
3912     saved_offset = asn1->offset;
3913
3914     asn1_int32_value_decode(asn1, 1, &value);
3915
3916     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
3917     proto_tree_add_text(tree, asn1->tvb,
3918         saved_offset, asn1->offset - saved_offset,
3919         "%s :  NP Extension",
3920         bigbuf);
3921
3922     other_decode_bitfield_value(bigbuf, value, 0x78, 8);
3923     proto_tree_add_text(tree, asn1->tvb,
3924         saved_offset, asn1->offset - saved_offset,
3925         "%s :  Nominal Power, %u",
3926         bigbuf,
3927         (value & 0x78) >> 3);
3928
3929     other_decode_bitfield_value(bigbuf, value, 0x07, 8);
3930     proto_tree_add_text(tree, asn1->tvb,
3931         saved_offset, asn1->offset - saved_offset,
3932         "%s :  Number Preamble, %u",
3933         bigbuf,
3934         value & 0x07);
3935
3936     if (len == 9) return;
3937
3938     saved_offset = asn1->offset;
3939
3940     asn1_int32_value_decode(asn1, 1, &value);
3941
3942     proto_tree_add_text(tree, asn1->tvb,
3943         saved_offset, asn1->offset - saved_offset,
3944         "Base Station Protocol Revision, %u",
3945         value);
3946
3947     EXTRANEOUS_DATA_CHECK(len, 10);
3948 }
3949
3950 static void
3951 param_namps_chan_data(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
3952 {
3953     gint32 value;
3954     guint saved_offset;
3955     gchar *str = NULL;
3956
3957     add_string = add_string;
3958     saved_offset = asn1->offset;
3959
3960     asn1_int32_value_decode(asn1, 1, &value);
3961
3962     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
3963     proto_tree_add_text(tree, asn1->tvb,
3964         saved_offset, asn1->offset - saved_offset,
3965         "%s :  Reserved",
3966         bigbuf);
3967
3968     switch ((value & 0x1c) >> 2)
3969     {
3970     case 0: str = "Channel Data parameter SCC field applies"; break;
3971     case 1: str = "Digital SAT Color Code 1 (ignore SCC field)"; break;
3972     case 2: str = "Digital SAT Color Code 2 (ignore SCC field)"; break;
3973     case 3: str = "Digital SAT Color Code 3 (ignore SCC field)"; break;
3974     case 4: str = "Digital SAT Color Code 4 (ignore SCC field)"; break;
3975     case 5: str = "Digital SAT Color Code 5 (ignore SCC field)"; break;
3976     case 6: str = "Digital SAT Color Code 6 (ignore SCC field)"; break;
3977     case 7: str = "Digital SAT Color Code 7 (ignore SCC field)"; break;
3978     }
3979
3980     other_decode_bitfield_value(bigbuf, value, 0x1c, 8);
3981     proto_tree_add_text(tree, asn1->tvb,
3982         saved_offset, asn1->offset - saved_offset,
3983         "%s :  Color Code Indicator (CCIndicator), %s",
3984         bigbuf,
3985         str);
3986
3987     switch (value & 0x03)
3988     {
3989     case 0: str = "Wide. 30 kHz AMPS voice channel"; break;
3990     case 1: str = "Upper. 10 kHz NAMPS voice channel"; break;
3991     case 2: str = "Middle. 10 kHz NAMPS voice channel"; break;
3992     case 3: str = "Lower. 10 kHz NAMPS voice channel"; break;
3993     }
3994
3995     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3996     proto_tree_add_text(tree, asn1->tvb,
3997         saved_offset, asn1->offset - saved_offset,
3998         "%s :  Narrow Analog Voice Channel Assignment (NAVCA), %s",
3999         bigbuf,
4000         str);
4001
4002     EXTRANEOUS_DATA_CHECK(len, 1);
4003 }
4004
4005 static void
4006 param_cdma_ms_meas_chan_id(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4007 {
4008     gint32 value, temp_int;
4009     guint saved_offset;
4010     gchar *str = NULL;
4011
4012     SHORT_DATA_CHECK(len, 2);
4013
4014     add_string = add_string;
4015     saved_offset = asn1->offset;
4016
4017     asn1_int32_value_decode(asn1, 2, &value);
4018
4019     temp_int = (value & 0xf800) >> 11;
4020     if ((temp_int < 0) || (temp_int >= (gint) NUM_BAND_CLASS_STR))
4021     {
4022         str = "Reserved";
4023     }
4024     else
4025     {
4026         str = band_class_str[temp_int];
4027     }
4028
4029     other_decode_bitfield_value(bigbuf, value >> 8, 0xf8, 8);
4030     proto_tree_add_text(tree, asn1->tvb,
4031         saved_offset, 1,
4032         "%s :  Band Class, %s",
4033         bigbuf,
4034         str);
4035
4036     other_decode_bitfield_value(bigbuf, value >> 8, 0x07, 8);
4037     proto_tree_add_text(tree, asn1->tvb,
4038         saved_offset, 1,
4039         "%s :  CDMA Channel Number (MSB), %u",
4040         bigbuf,
4041         value & 0x07ff);
4042
4043     other_decode_bitfield_value(bigbuf, value & 0x00ff, 0xff, 8);
4044     proto_tree_add_text(tree, asn1->tvb,
4045         saved_offset+1, 1,
4046         "%s :  CDMA Channel Number (LSB)",
4047         bigbuf);
4048
4049     EXTRANEOUS_DATA_CHECK(len, 2);
4050 }
4051
4052 static void
4053 param_tdma_chan_data(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4054 {
4055     gint32 value;
4056     guint saved_offset;
4057     gchar *str = NULL;
4058
4059     SHORT_DATA_CHECK(len, 5);
4060
4061     add_string = add_string;
4062     saved_offset = asn1->offset;
4063
4064     asn1_int32_value_decode(asn1, 1, &value);
4065
4066     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
4067     proto_tree_add_text(tree, asn1->tvb,
4068         saved_offset, asn1->offset - saved_offset,
4069         "%s :  Reserved",
4070         bigbuf);
4071
4072     switch (value & 0x1f)
4073     {
4074     case 0: str = "Analog (not used if ChannelData is present)"; break;
4075     case 1: str = "Assigned to timeslot 1, full rate"; break;
4076     case 2: str = "Assigned to timeslot 2, full rate"; break;
4077     case 3: str = "Assigned to timeslot 3, full rate"; break;
4078     case 4: str = "Assigned to timeslots 1, 4 and 2, 5 Double rate"; break;
4079     case 5: str = "Assigned to timeslots 1, 4 and 3, 6 Double rate"; break;
4080     case 6: str = "Assigned to timeslots 2, 5 and 3, 6 Double rate"; break;
4081     case 9: str = "Assigned to timeslot 1, half rate"; break;
4082     case 10: str = "Assigned to timeslot 2, half rate"; break;
4083     case 11: str = "Assigned to timeslot 3, half rate"; break;
4084     case 12: str = "Assigned to timeslot 4, half rate"; break;
4085     case 13: str = "Assigned to timeslot 5, half rate"; break;
4086     case 14: str = "Assigned to timeslot 6, half rate"; break;
4087     case 15: str = "Assigned to timeslot 1, 2, 3, 4, 5, 6 Triple rate"; break;
4088     default:
4089         str = "Reserved, treat as Analog";
4090         break;
4091     }
4092
4093     other_decode_bitfield_value(bigbuf, value, 0x1f, 8);
4094     proto_tree_add_text(tree, asn1->tvb,
4095         saved_offset, asn1->offset - saved_offset,
4096         "%s :  Time Slot and Rate indicator (TSR), %s",
4097         bigbuf,
4098         str);
4099
4100     saved_offset = asn1->offset;
4101
4102     asn1_int32_value_decode(asn1, 1, &value);
4103
4104     proto_tree_add_text(tree, asn1->tvb,
4105         saved_offset, asn1->offset - saved_offset,
4106         "Digital Verification Color Code (DVCC) %u",
4107         value);
4108
4109     saved_offset = asn1->offset;
4110
4111     asn1_int32_value_decode(asn1, 1, &value);
4112
4113     switch ((value & 0xf0) >> 4)
4114     {
4115     case 0: str = "800 MHz"; break;
4116     case 1: str = "1800 MHz"; break;
4117     default:
4118         str = "Reserved, treat as 800 MHz";
4119         break;
4120     }
4121
4122     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
4123     proto_tree_add_text(tree, asn1->tvb,
4124         saved_offset, asn1->offset - saved_offset,
4125         "%s :  Hyper Band, %s",
4126         bigbuf,
4127         str);
4128
4129     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
4130     proto_tree_add_text(tree, asn1->tvb,
4131         saved_offset, asn1->offset - saved_offset,
4132         "%s :  Digital Mobile Attenuation Code (DMAC) %u",
4133         bigbuf,
4134         value & 0x0f);
4135
4136     saved_offset = asn1->offset;
4137
4138     asn1_int32_value_decode(asn1, 2, &value);
4139
4140     other_decode_bitfield_value(bigbuf, value >> 8, 0xff, 8);
4141     proto_tree_add_text(tree, asn1->tvb,
4142         saved_offset, 1,
4143         "%s :  Channel Number (MSB), %u",
4144         bigbuf,
4145         value);
4146
4147     other_decode_bitfield_value(bigbuf, value & 0x00ff, 0xff, 8);
4148     proto_tree_add_text(tree, asn1->tvb,
4149         saved_offset + 1, 1,
4150         "%s :  Channel Number (LSB)",
4151         bigbuf);
4152
4153     EXTRANEOUS_DATA_CHECK(len, 5);
4154 }
4155
4156 static void
4157 param_tdma_call_mode(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4158 {
4159     gint32 value;
4160     guint saved_offset;
4161
4162     add_string = add_string;
4163     saved_offset = asn1->offset;
4164
4165     asn1_int32_value_decode(asn1, 1, &value);
4166
4167     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
4168     proto_tree_add_text(tree, asn1->tvb,
4169         saved_offset, asn1->offset - saved_offset,
4170         "%s :  Reserved",
4171         bigbuf);
4172
4173     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
4174     proto_tree_add_text(tree, asn1->tvb,
4175         saved_offset, asn1->offset - saved_offset,
4176         "%s :  %sxtended modulation and framing",
4177         bigbuf,
4178         (value & 0x20) ? "E" : "No e");
4179
4180     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
4181     proto_tree_add_text(tree, asn1->tvb,
4182         saved_offset, asn1->offset - saved_offset,
4183         "%s :  Other voice coding %sacceptable",
4184         bigbuf,
4185         (value & 0x10) ? "" : "not ");
4186
4187     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
4188     proto_tree_add_text(tree, asn1->tvb,
4189         saved_offset, asn1->offset - saved_offset,
4190         "%s :  Other DQPSK channel %sacceptable",
4191         bigbuf,
4192         (value & 0x08) ? "" : "not ");
4193
4194     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
4195     proto_tree_add_text(tree, asn1->tvb,
4196         saved_offset, asn1->offset - saved_offset,
4197         "%s :  Half rate digital traffic channel %sacceptable",
4198         bigbuf,
4199         (value & 0x04) ? "" : "not ");
4200
4201     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
4202     proto_tree_add_text(tree, asn1->tvb,
4203         saved_offset, asn1->offset - saved_offset,
4204         "%s :  Full rate digital traffic channel %sacceptable",
4205         bigbuf,
4206         (value & 0x02) ? "" : "not ");
4207
4208     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
4209     proto_tree_add_text(tree, asn1->tvb,
4210         saved_offset, asn1->offset - saved_offset,
4211         "%s :  AMPS channel %sacceptable",
4212         bigbuf,
4213         (value & 0x01) ? "" : "not ");
4214
4215     EXTRANEOUS_DATA_CHECK(len, 1);
4216 }
4217
4218 static void
4219 param_cdma_call_mode(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4220 {
4221     gint32 value;
4222     guint saved_offset;
4223
4224     add_string = add_string;
4225     saved_offset = asn1->offset;
4226
4227     asn1_int32_value_decode(asn1, 1, &value);
4228
4229     if (len == 1)
4230     {
4231         /* assuming older spec. no IS-880 */
4232
4233         other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
4234         proto_tree_add_text(tree, asn1->tvb,
4235             saved_offset, asn1->offset - saved_offset,
4236             "%s :  Reserved",
4237             bigbuf);
4238     }
4239     else
4240     {
4241         other_decode_bitfield_value(bigbuf, value, 0x80, 8);
4242         proto_tree_add_text(tree, asn1->tvb,
4243             saved_offset, asn1->offset - saved_offset,
4244             "%s :  450 MHz channel (Band Class 5) %sacceptable",
4245             bigbuf,
4246             (value & 0x80) ? "" : "not ");
4247
4248         other_decode_bitfield_value(bigbuf, value, 0x40, 8);
4249         proto_tree_add_text(tree, asn1->tvb,
4250             saved_offset, asn1->offset - saved_offset,
4251             "%s :  Korean PCS channel (Band Class 4) %sacceptable",
4252             bigbuf,
4253             (value & 0x40) ? "" : "not ");
4254
4255         other_decode_bitfield_value(bigbuf, value, 0x20, 8);
4256         proto_tree_add_text(tree, asn1->tvb,
4257             saved_offset, asn1->offset - saved_offset,
4258             "%s :  JTACS channel (Band Class 3) %sacceptable",
4259             bigbuf,
4260             (value & 0x20) ? "" : "not ");
4261
4262         other_decode_bitfield_value(bigbuf, value, 0x10, 8);
4263         proto_tree_add_text(tree, asn1->tvb,
4264             saved_offset, asn1->offset - saved_offset,
4265             "%s :  TACS channel (Band Class 2) %sacceptable",
4266             bigbuf,
4267             (value & 0x10) ? "" : "not ");
4268     }
4269
4270     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
4271     proto_tree_add_text(tree, asn1->tvb,
4272         saved_offset, asn1->offset - saved_offset,
4273         "%s :  CDMA 1900 MHz channel (Band Class 1) %sacceptable",
4274         bigbuf,
4275         (value & 0x08) ? "" : "not ");
4276
4277     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
4278     proto_tree_add_text(tree, asn1->tvb,
4279         saved_offset, asn1->offset - saved_offset,
4280         "%s :  NAMPS 800 MHz channel %sacceptable",
4281         bigbuf,
4282         (value & 0x04) ? "" : "not ");
4283
4284     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
4285     proto_tree_add_text(tree, asn1->tvb,
4286         saved_offset, asn1->offset - saved_offset,
4287         "%s :  AMPS 800 MHz channel %sacceptable",
4288         bigbuf,
4289         (value & 0x02) ? "" : "not ");
4290
4291     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
4292     proto_tree_add_text(tree, asn1->tvb,
4293         saved_offset, asn1->offset - saved_offset,
4294         "%s :  CDMA 800 MHz channel (Band Class 0) %sacceptable",
4295         bigbuf,
4296         (value & 0x01) ? "" : "not ");
4297
4298     if (len == 1) return;
4299
4300     saved_offset = asn1->offset;
4301
4302     asn1_int32_value_decode(asn1, 1, &value);
4303
4304     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
4305     proto_tree_add_text(tree, asn1->tvb,
4306         saved_offset, asn1->offset - saved_offset,
4307         "%s :  Reserved",
4308         bigbuf);
4309
4310     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
4311     proto_tree_add_text(tree, asn1->tvb,
4312         saved_offset, asn1->offset - saved_offset,
4313         "%s :  Secondary 800 MHz channel (Band Class 10) %sacceptable",
4314         bigbuf,
4315         (value & 0x10) ? "" : "not ");
4316
4317     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
4318     proto_tree_add_text(tree, asn1->tvb,
4319         saved_offset, asn1->offset - saved_offset,
4320         "%s :  900 MHz channel (Band Class 9) %sacceptable",
4321         bigbuf,
4322         (value & 0x08) ? "" : "not ");
4323
4324     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
4325     proto_tree_add_text(tree, asn1->tvb,
4326         saved_offset, asn1->offset - saved_offset,
4327         "%s :  1800 MHz channel (Band Class 8) %sacceptable",
4328         bigbuf,
4329         (value & 0x04) ? "" : "not ");
4330
4331     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
4332     proto_tree_add_text(tree, asn1->tvb,
4333         saved_offset, asn1->offset - saved_offset,
4334         "%s :  700 MHz channel (Band Class 7) %sacceptable",
4335         bigbuf,
4336         (value & 0x02) ? "" : "not ");
4337
4338     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
4339     proto_tree_add_text(tree, asn1->tvb,
4340         saved_offset, asn1->offset - saved_offset,
4341         "%s :  2 GHz channel (Band Class 6) %sacceptable",
4342         bigbuf,
4343         (value & 0x01) ? "" : "not ");
4344
4345     EXTRANEOUS_DATA_CHECK(len, 2);
4346 }
4347
4348 static void
4349 param_namps_call_mode(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4350 {
4351     gint32 value;
4352     guint saved_offset;
4353
4354     add_string = add_string;
4355     saved_offset = asn1->offset;
4356
4357     asn1_int32_value_decode(asn1, 1, &value);
4358
4359     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
4360     proto_tree_add_text(tree, asn1->tvb,
4361         saved_offset, asn1->offset - saved_offset,
4362         "%s :  Reserved",
4363         bigbuf);
4364
4365     proto_tree_add_text(tree, asn1->tvb,
4366         saved_offset, asn1->offset - saved_offset,
4367         ".... %u... :  AMPS 1800 MHz channel %sacceptable",
4368         (value & 0x08) >> 3, (value & 0x08) ? "" : "not ");
4369
4370     proto_tree_add_text(tree, asn1->tvb,
4371         saved_offset, asn1->offset - saved_offset,
4372         ".... .%u.. :  NAMPS 1800 MHz channel %sacceptable",
4373         (value & 0x04) >> 2, (value & 0x04) ? "" : "not ");
4374
4375     proto_tree_add_text(tree, asn1->tvb,
4376         saved_offset, asn1->offset - saved_offset,
4377         ".... ..%u. :  AMPS 800 MHz channel %sacceptable",
4378         (value & 0x02) >> 1, (value & 0x02) ? "" : "not ");
4379
4380     proto_tree_add_text(tree, asn1->tvb,
4381         saved_offset, asn1->offset - saved_offset,
4382         ".... ...%u :  NAMPS 800 MHz channel %sacceptable",
4383         value & 0x01, (value & 0x01) ? "" : "not ");
4384
4385     EXTRANEOUS_DATA_CHECK(len, 1);
4386 }
4387
4388 static void
4389 param_mob_rev(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4390 {
4391     gint32 value;
4392     guint saved_offset;
4393
4394     add_string = add_string;
4395     saved_offset = asn1->offset;
4396
4397     asn1_int32_value_decode(asn1, 1, &value);
4398
4399     proto_tree_add_text(tree, asn1->tvb,
4400         saved_offset, asn1->offset - saved_offset,
4401         "Revision %u",
4402         value);
4403
4404     EXTRANEOUS_DATA_CHECK(len, 1);
4405 }
4406
4407 static void
4408 param_cdma_band_class(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4409 {
4410     gint32 value, temp_int;
4411     guint saved_offset;
4412     gchar *str = NULL;
4413
4414     add_string = add_string;
4415     saved_offset = asn1->offset;
4416
4417     asn1_int32_value_decode(asn1, 1, &value);
4418
4419     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
4420     proto_tree_add_text(tree, asn1->tvb,
4421         saved_offset, asn1->offset - saved_offset,
4422         "%s :  Reserved",
4423         bigbuf);
4424
4425     temp_int = value & 0x1f;
4426     if ((temp_int < 0) || (temp_int >= (gint) NUM_BAND_CLASS_STR))
4427     {
4428         str = "Reserved";
4429     }
4430     else
4431     {
4432         str = band_class_str[temp_int];
4433     }
4434
4435     other_decode_bitfield_value(bigbuf, value, 0x1f, 8);
4436     proto_tree_add_text(tree, asn1->tvb,
4437         saved_offset, asn1->offset - saved_offset,
4438         "%s :  Band Class %s",
4439         bigbuf,
4440         str);
4441
4442     EXTRANEOUS_DATA_CHECK(len, 1);
4443 }
4444
4445 static void
4446 param_calling_party_name(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4447 {
4448     gint32 value;
4449     guint saved_offset;
4450     gchar *str = NULL;
4451
4452     SHORT_DATA_CHECK(len, 1);
4453
4454     add_string = add_string;
4455     saved_offset = asn1->offset;
4456
4457     asn1_int32_value_decode(asn1, 1, &value);
4458
4459     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
4460     proto_tree_add_text(tree, asn1->tvb,
4461         saved_offset, asn1->offset - saved_offset,
4462         "%s :  Spec. has hardcoded as 0 0 1",
4463         bigbuf);
4464
4465     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
4466     proto_tree_add_text(tree, asn1->tvb,
4467         saved_offset, asn1->offset - saved_offset,
4468         "%s :  Availability, %s",
4469         bigbuf,
4470         (value & 0x10) ?  "Name not available" : "Name available/unknown");
4471
4472     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
4473     proto_tree_add_text(tree, asn1->tvb,
4474         saved_offset, asn1->offset - saved_offset,
4475         "%s :  Reserved",
4476         bigbuf);
4477
4478     switch (value & 0x03)
4479     {
4480     case 0: str = "Presentation allowed"; break;
4481     case 1: str = "Presentation restricted"; break;
4482     case 2: str = "Blocking toggle"; break;
4483     case 3: str = "No indication"; break;
4484     }
4485
4486     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
4487     proto_tree_add_text(tree, asn1->tvb,
4488         saved_offset, asn1->offset - saved_offset,
4489         "%s :  Presentation Status, %s",
4490         bigbuf,
4491         str);
4492
4493     if (len == 1) return;
4494
4495     saved_offset = asn1->offset;
4496
4497     proto_tree_add_text(tree, asn1->tvb,
4498         asn1->offset, len - 1,
4499         "IA5 Digits");
4500
4501     asn1->offset += (len - 1);
4502 }
4503
4504 static void
4505 param_red_party_name(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4506 {
4507     gint32 value;
4508     guint saved_offset;
4509     gchar *str = NULL;
4510
4511     SHORT_DATA_CHECK(len, 1);
4512
4513     add_string = add_string;
4514     saved_offset = asn1->offset;
4515
4516     asn1_int32_value_decode(asn1, 1, &value);
4517
4518     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
4519     proto_tree_add_text(tree, asn1->tvb,
4520         saved_offset, asn1->offset - saved_offset,
4521         "%s :  Spec. has hardcoded as 0 1 1",
4522         bigbuf);
4523
4524     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
4525     proto_tree_add_text(tree, asn1->tvb,
4526         saved_offset, asn1->offset - saved_offset,
4527         "%s :  Availability, %s",
4528         bigbuf,
4529         (value & 0x10) ?  "Name not available" : "Name available/unknown");
4530
4531     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
4532     proto_tree_add_text(tree, asn1->tvb,
4533         saved_offset, asn1->offset - saved_offset,
4534         "%s :  Reserved",
4535         bigbuf);
4536
4537     switch (value & 0x03)
4538     {
4539     case 0: str = "Presentation allowed"; break;
4540     case 1: str = "Presentation restricted"; break;
4541     case 2: str = "Blocking toggle"; break;
4542     case 3: str = "No indication"; break;
4543     }
4544
4545     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
4546     proto_tree_add_text(tree, asn1->tvb,
4547         saved_offset, asn1->offset - saved_offset,
4548         "%s :  Presentation Status, %s",
4549         bigbuf,
4550         str);
4551
4552     if (len == 1) return;
4553
4554     saved_offset = asn1->offset;
4555
4556     proto_tree_add_text(tree, asn1->tvb,
4557         asn1->offset, len - 1,
4558         "IA5 Digits");
4559
4560     asn1->offset += (len - 1);
4561 }
4562
4563 static void
4564 param_srvc_id(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4565 {
4566
4567     add_string = add_string;
4568
4569     proto_tree_add_text(tree, asn1->tvb,
4570         asn1->offset, len,
4571         "Service Identifier (Spec. does not define clearly)");
4572
4573     asn1->offset += len;
4574 }
4575
4576 static void
4577 param_all_or_none(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4578 {
4579     gint32 value;
4580     guint saved_offset;
4581     gchar *str = NULL;
4582
4583     EXACT_DATA_CHECK(len, 1);
4584
4585     add_string = add_string;
4586     saved_offset = asn1->offset;
4587
4588     asn1_int32_value_decode(asn1, 1, &value);
4589
4590     switch (value)
4591     {
4592     case 0: str = "Not used"; break;
4593     case 1: str = "All changes must succeed or none should be applied"; break;
4594     case 2: str = "Treat each change independently"; break;
4595     default:
4596         if ((value >= 3) && (value <= 223)) { str = "Reserved, treat as All changes must succeed or none should be applied"; }
4597         else { str = "Reserved for protocol extension, treat as All changes must succeed or none should be applied"; }
4598         break;
4599     }
4600
4601     proto_tree_add_text(tree, asn1->tvb,
4602         saved_offset, asn1->offset - saved_offset,
4603         str);
4604 }
4605
4606 static void
4607 param_change(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4608 {
4609     gint32 value;
4610     guint saved_offset;
4611     gchar *str = NULL;
4612
4613     EXACT_DATA_CHECK(len, 1);
4614
4615     add_string = add_string;
4616     saved_offset = asn1->offset;
4617
4618     asn1_int32_value_decode(asn1, 1, &value);
4619
4620     switch (value)
4621     {
4622     case 0: str = "Not used"; break;
4623     case 1: str = "Set Data Item to Default Value"; break;
4624     case 2: str = "Add Data Item"; break;
4625     case 3: str = "Delete Data Item"; break;
4626     case 4: str = "Replace Data Item with associated DataValue"; break;
4627     default:
4628         if ((value >= 5) && (value <= 223)) { str = "Reserved, treat as Set Data Item to Default Value"; }
4629         else { str = "Reserved for protocol extension, treat as Set Data Item to Default Value"; }
4630         break;
4631     }
4632
4633     proto_tree_add_text(tree, asn1->tvb,
4634         saved_offset, asn1->offset - saved_offset,
4635         str);
4636 }
4637
4638 static void
4639 param_data_result(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4640 {
4641     gint32 value;
4642     guint saved_offset;
4643     gchar *str = NULL;
4644
4645     EXACT_DATA_CHECK(len, 1);
4646
4647     add_string = add_string;
4648     saved_offset = asn1->offset;
4649
4650     asn1_int32_value_decode(asn1, 1, &value);
4651
4652     switch (value)
4653     {
4654     case 0: str = "Not used"; break;
4655     case 1: str = "Successful"; break;
4656     case 2: str = "Unsuccessful, unspecified"; break;
4657     case 3: str = "Unsuccessful, no default value available"; break;
4658     default:
4659         if ((value >= 4) && (value <= 95)) { str = "Reserved, treat as Unsuccessful"; }
4660         else if ((value >= 96) && (value <= 127)) { str = "Reserved for protocol extension, treat as Unsuccessful"; }
4661         else if ((value >= 128) && (value <= 223)) { str = "Reserved, treat as Successful"; }
4662         else { str = "Reserved for protocol extension, treat as Successful"; }
4663         break;
4664     }
4665
4666     proto_tree_add_text(tree, asn1->tvb,
4667         saved_offset, asn1->offset - saved_offset,
4668         str);
4669 }
4670
4671 static void
4672 param_fail_cause(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4673 {
4674     guint saved_offset;
4675
4676     SHORT_DATA_CHECK(len, 2);
4677
4678     add_string = add_string;
4679     saved_offset = asn1->offset;
4680
4681     proto_tree_add_text(tree, asn1->tvb,
4682         saved_offset, len,
4683         "ISUP Cause Indicator");
4684
4685     asn1->offset += len;
4686 }
4687
4688 static void
4689 param_fail_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4690 {
4691     gint32 value;
4692     guint saved_offset;
4693     gchar *str = NULL;
4694
4695     EXACT_DATA_CHECK(len, 1);
4696
4697     add_string = add_string;
4698     saved_offset = asn1->offset;
4699
4700     asn1_int32_value_decode(asn1, 1, &value);
4701
4702     switch (value)
4703     {
4704     case 0: str = "Not used"; break;
4705     case 1: str = "Call abandoned"; break;
4706     case 2: str = "Resource disconnect"; break;
4707     case 3: str = "Failure at MSC"; break;
4708     case 4: str = "SSFT expiration"; break;
4709     default:
4710         if ((value >= 5) && (value <= 223)) { str = "Reserved, ignore"; }
4711         else { str = "Reserved for protocol extension, ignore"; }
4712         break;
4713     }
4714
4715     proto_tree_add_text(tree, asn1->tvb,
4716         saved_offset, asn1->offset - saved_offset,
4717         str);
4718 }
4719
4720 static void
4721 param_resume_pic(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4722 {
4723     gint32 value;
4724     guint saved_offset;
4725     gchar *str = NULL;
4726
4727     EXACT_DATA_CHECK(len, 1);
4728
4729     add_string = add_string;
4730     saved_offset = asn1->offset;
4731
4732     asn1_int32_value_decode(asn1, 1, &value);
4733
4734     switch (value)
4735     {
4736     case 0: str = "Not used"; break;
4737     case 1: str = "Continue Call Processing"; break;
4738     case 2: str = "Collect Information PIC"; break;
4739     case 3: str = "Analyze Information PIC"; break;
4740     case 4: str = "Select Route PIC"; break;
4741     case 5: str = "Authorize Origination_Attempt PIC"; break;
4742     case 6: str = "Authorize Call Setup PIC"; break;
4743     case 7: str = "Send Call PIC"; break;
4744     case 8: str = "O Alerting PIC"; break;
4745     case 9: str = "O Active PIC"; break;
4746     case 10: str = "O Suspended PIC"; break;
4747     case 11: str = "O Null PIC"; break;
4748     case 32: str = "Select Facility PIC"; break;
4749     case 33: str = "Present Call PIC"; break;
4750     case 34: str = "Authorize Termination Attempt PIC"; break;
4751     case 35: str = "T Alerting PIC"; break;
4752     case 36: str = "T Active PIC"; break;
4753     case 37: str = "T Suspended PIC"; break;
4754     case 38: str = "T Null PIC"; break;
4755     default:
4756         if ((value >= 12) && (value <= 31)) { str = "Reserved, treat as Not used"; }
4757         else if ((value >= 39) && (value <= 223)) { str = "Reserved, ignore"; }
4758         else { str = "Reserved for protocol extension, ignore"; }
4759         break;
4760     }
4761
4762     proto_tree_add_text(tree, asn1->tvb,
4763         saved_offset, asn1->offset - saved_offset,
4764         "Point in Call, %s (%u)",
4765         str,
4766         value);
4767 }
4768
4769 static void
4770 param_special_rsc(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4771 {
4772     gint32 value, i;
4773     guint saved_offset;
4774     gchar *str = NULL;
4775
4776     add_string = add_string;
4777     saved_offset = asn1->offset;
4778
4779     i = 0;
4780
4781     do
4782     {
4783         asn1_int32_value_decode(asn1, 1, &value);
4784
4785         switch (value)
4786         {
4787         case 0: str = "Not used"; break;
4788         case 1: str = "DTMF tone detector"; break;
4789         case 2: str = "Automatic Speech Recognition - Speaker Independent - Digits"; break;
4790         case 3: str = "Automatic Speech Recognition - Speaker Independent - Speech User Interface Version 1"; break;
4791         default:
4792             if ((value >= 4) && (value <= 223)) { str = "Reserved, treat as Not used"; }
4793             else { str = "Reserved for protocol extension, treat as Not used"; }
4794             break;
4795         }
4796
4797         proto_tree_add_text(tree, asn1->tvb,
4798             saved_offset, asn1->offset - saved_offset,
4799             "[%u] Resource Type, %s",
4800             i++,
4801             str);
4802
4803         saved_offset = asn1->offset;
4804     }
4805     while ((len - i) > 0);
4806 }
4807
4808 static void
4809 param_time_date_offset(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4810 {
4811     gint32 value;
4812     guint saved_offset;
4813
4814     EXACT_DATA_CHECK(len, 2);
4815
4816     add_string = add_string;
4817     saved_offset = asn1->offset;
4818
4819     asn1_int32_value_decode(asn1, 2, &value);
4820
4821     proto_tree_add_text(tree, asn1->tvb,
4822         saved_offset, asn1->offset - saved_offset,
4823         "In minutes (%u)",
4824         value);
4825 }
4826
4827 static void
4828 param_network_tmsi(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4829 {
4830     gint32 value, addr_type, first_dig;
4831     guint saved_offset;
4832     gchar *str = NULL;
4833     guchar *poctets;
4834
4835     SHORT_DATA_CHECK(len, 4);
4836
4837     add_string = add_string;
4838     saved_offset = asn1->offset;
4839
4840     asn1_int32_value_decode(asn1, 4, &value);
4841
4842     proto_tree_add_text(tree, asn1->tvb,
4843         saved_offset, asn1->offset - saved_offset,
4844         "TMSI Code, %u",
4845         value);
4846
4847     if (len == 4) return;
4848
4849     saved_offset = asn1->offset;
4850
4851     asn1_int32_value_decode(asn1, 1, &value);
4852
4853     first_dig = Dgt_tbcd.out[(value & 0xf0) >> 4];
4854
4855     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
4856     proto_tree_add_text(tree, asn1->tvb,
4857         saved_offset, asn1->offset - saved_offset,
4858         "%s :  First digit of TMSI Zone, %c",
4859         bigbuf,
4860         first_dig);
4861
4862     addr_type = value & 0x0f;
4863     switch (addr_type)
4864     {
4865     case 0: str = "Not used"; break;
4866     case 1: str = "E.212 based routing"; break;
4867     case 2: str = "20-bit TDMA TMSI"; break;
4868     case 3: str = "24-bit TDMA TMSI"; break;
4869     default:
4870         str = "Reserved for protocol extension, treat as Not used";
4871         break;
4872     }
4873
4874     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
4875     proto_tree_add_text(tree, asn1->tvb,
4876         saved_offset, asn1->offset - saved_offset,
4877         "%s :  Type of addressing, %s",
4878         bigbuf,
4879         str);
4880
4881     if (len == 5) return;
4882
4883     saved_offset = asn1->offset;
4884
4885     asn1_string_value_decode(asn1, (len-5), &poctets);
4886
4887     bigbuf[0] = first_dig;
4888
4889     my_dgt_tbcd_unpack(bigbuf+1, poctets, (len-5), &Dgt_tbcd);
4890     g_free(poctets);
4891
4892     proto_tree_add_text(tree, asn1->tvb,
4893         saved_offset - 1, (len-5)+1,
4894         "TMSI Zone, %s",
4895         bigbuf);
4896 }
4897
4898 static void
4899 param_reqd_param_mask(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4900 {
4901     gint32 value;
4902     guint saved_offset;
4903
4904     add_string = add_string;
4905     saved_offset = asn1->offset;
4906
4907     asn1_int32_value_decode(asn1, 1, &value);
4908
4909     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
4910     proto_tree_add_text(tree, asn1->tvb,
4911         saved_offset, asn1->offset - saved_offset,
4912         "%s :  Reserved",
4913         bigbuf);
4914
4915     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
4916     proto_tree_add_text(tree, asn1->tvb,
4917         saved_offset, asn1->offset - saved_offset,
4918         "%s :  Location Area ID (LOCID) %srequired",
4919         bigbuf,
4920         (value & 0x10) ? "" : "not ");
4921
4922     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
4923     proto_tree_add_text(tree, asn1->tvb,
4924         saved_offset, asn1->offset - saved_offset,
4925         "%s :  TMSI %srequired",
4926         bigbuf,
4927         (value & 0x08) ? "" : "not ");
4928
4929     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
4930     proto_tree_add_text(tree, asn1->tvb,
4931         saved_offset, asn1->offset - saved_offset,
4932         "%s :  ESN %srequired",
4933         bigbuf,
4934         (value & 0x04) ? "" : "not ");
4935
4936     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
4937     proto_tree_add_text(tree, asn1->tvb,
4938         saved_offset, asn1->offset - saved_offset,
4939         "%s :  MIN %srequired",
4940         bigbuf,
4941         (value & 0x02) ? "" : "not ");
4942
4943     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
4944     proto_tree_add_text(tree, asn1->tvb,
4945         saved_offset, asn1->offset - saved_offset,
4946         "%s :  IMSI %srequired",
4947         bigbuf,
4948         (value & 0x01) ? "" : "not ");
4949
4950     EXTRANEOUS_DATA_CHECK(len, 1);
4951 }
4952
4953 static void
4954 param_srvc_red_cause(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4955 {
4956     gint32 value;
4957     guint saved_offset;
4958     gchar *str = NULL;
4959
4960     add_string = add_string;
4961     saved_offset = asn1->offset;
4962
4963     asn1_int32_value_decode(asn1, 1, &value);
4964
4965     switch (value)
4966     {
4967     case 0: str = "Not used"; break;
4968     case 1: str = "Normal Registration"; break;
4969     case 2: str = "System Not Found"; break;
4970     case 3: str = "Protocol Mismatch"; break;
4971     case 4: str = "Registration Rejection"; break;
4972     case 5: str = "Wrong SID"; break;
4973     case 6: str = "Wrong NID"; break;
4974     default:
4975         if ((value >= 7) && (value <= 223)) { str = "Reserved, treat as Normal Registration"; }
4976         else { str = "Reserved for protocol extension. If unknown, treat as Normal Registration"; }
4977         break;
4978     }
4979
4980     proto_tree_add_text(tree, asn1->tvb,
4981         saved_offset, asn1->offset - saved_offset,
4982         str);
4983
4984     EXTRANEOUS_DATA_CHECK(len, 1);
4985 }
4986
4987 static void
4988 param_srvc_red_info(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4989 {
4990     gint32 value;
4991     guint saved_offset;
4992
4993     add_string = add_string;
4994     saved_offset = asn1->offset;
4995
4996     asn1_int32_value_decode(asn1, 1, &value);
4997
4998     other_decode_bitfield_value(bigbuf, value, 0xfc, 8);
4999     proto_tree_add_text(tree, asn1->tvb,
5000         saved_offset, asn1->offset - saved_offset,
5001         "%s :  Reserved",
5002         bigbuf);
5003
5004     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
5005     proto_tree_add_text(tree, asn1->tvb,
5006         saved_offset, asn1->offset - saved_offset,
5007         "%s :  NDSS Status (NDS), %ssuppressed",
5008         bigbuf,
5009         (value & 0x02) ? "" : "not ");
5010
5011     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
5012     proto_tree_add_text(tree, asn1->tvb,
5013         saved_offset, asn1->offset - saved_offset,
5014         "%s :  Return If Fail (RIF), If MS fails to access the redirected system, MS shall %sreturn to the serving system",
5015         bigbuf,
5016         (value & 0x01) ? "" : "not ");
5017
5018     EXTRANEOUS_DATA_CHECK(len, 1);
5019 }
5020
5021 static void
5022 param_roaming_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5023 {
5024     gint32 value;
5025     guint saved_offset;
5026     gchar *str = NULL;
5027
5028     add_string = add_string;
5029     saved_offset = asn1->offset;
5030
5031     asn1_int32_value_decode(asn1, 1, &value);
5032
5033     switch (value)
5034     {
5035     case 0: str = "Roaming Indicator On"; break;
5036     case 1: str = "Roaming Indicator Off"; break;
5037     case 2: str = "Roaming Indicator Flashing"; break;
5038     case 3: str = "Out of Neighborhood"; break;
5039     case 4: str = "Out of Building"; break;
5040     case 5: str = "Roaming - Preferred System"; break;
5041     case 6: str = "Roaming - Available System"; break;
5042     case 7: str = "Roaming - Alliance Partner"; break;
5043     case 8: str = "Roaming - Premium Partner"; break;
5044     case 9: str = "Roaming - Full Service Functionality"; break;
5045     case 10: str = "Roaming - Partial Service Functionality"; break;
5046     case 11: str = "Roaming Banner On"; break;
5047     case 12: str = "Roaming Banner Off"; break;
5048     default:
5049         if ((value >= 13) && (value <= 63)) { str = "Reserved for Standard Enhanced Roaming Indicator Numbers"; }
5050         else if ((value >= 64) && (value <= 127)) { str = "Reserved for Non-Standard Enhanced Roaming Indicator Numbers"; }
5051         else { str = "Reserved"; }
5052         break;
5053     }
5054
5055     proto_tree_add_text(tree, asn1->tvb,
5056         saved_offset, asn1->offset - saved_offset,
5057         str);
5058
5059     EXTRANEOUS_DATA_CHECK(len, 1);
5060 }
5061
5062 static void
5063 param_cdma_pci(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5064 {
5065     gint32 value;
5066     guint saved_offset;
5067
5068     EXACT_DATA_CHECK(len, 1);
5069
5070     add_string = add_string;
5071     saved_offset = asn1->offset;
5072
5073     asn1_int32_value_decode(asn1, 1, &value);
5074
5075     other_decode_bitfield_value(bigbuf, value, 0xfe, 8);
5076     proto_tree_add_text(tree, asn1->tvb,
5077         saved_offset, asn1->offset - saved_offset,
5078         "%s :  Reserved",
5079         bigbuf);
5080
5081     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
5082     proto_tree_add_text(tree, asn1->tvb,
5083         saved_offset, asn1->offset - saved_offset,
5084         "%s :  CDMA PWR_COMB_IND",
5085         bigbuf);
5086 }
5087
5088 static void
5089 param_cdma_chan_num(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5090 {
5091     gint32 value;
5092     guint saved_offset;
5093
5094     SHORT_DATA_CHECK(len, 2);
5095
5096     add_string = add_string;
5097     saved_offset = asn1->offset;
5098
5099     asn1_int32_value_decode(asn1, 2, &value);
5100
5101     other_decode_bitfield_value(bigbuf, value >> 8, 0xf8, 8);
5102     proto_tree_add_text(tree, asn1->tvb,
5103         saved_offset, 1,
5104         "%s :  Reserved",
5105         bigbuf);
5106
5107     other_decode_bitfield_value(bigbuf, value >> 8, 0x07, 8);
5108     proto_tree_add_text(tree, asn1->tvb,
5109         saved_offset, 1,
5110         "%s :  CDMA Channel Number (MSB) %u",
5111         bigbuf,
5112         value & 0x07ff);
5113
5114     other_decode_bitfield_value(bigbuf, value & 0x00ff, 0xff, 8);
5115     proto_tree_add_text(tree, asn1->tvb,
5116         saved_offset+1, 1,
5117         "%s :  CDMA Channel Number (LSB)",
5118         bigbuf);
5119
5120     EXTRANEOUS_DATA_CHECK(len, 2);
5121 }
5122
5123 static void
5124 param_cdma_sci(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5125 {
5126     gint32 value;
5127     guint saved_offset;
5128
5129     EXACT_DATA_CHECK(len, 1);
5130
5131     add_string = add_string;
5132     saved_offset = asn1->offset;
5133
5134     asn1_int32_value_decode(asn1, 1, &value);
5135
5136     other_decode_bitfield_value(bigbuf, value, 0xf8, 8);
5137     proto_tree_add_text(tree, asn1->tvb,
5138         saved_offset, asn1->offset - saved_offset,
5139         "%s :  Reserved",
5140         bigbuf);
5141
5142     other_decode_bitfield_value(bigbuf, value, 0x07, 8);
5143     proto_tree_add_text(tree, asn1->tvb,
5144         saved_offset, asn1->offset - saved_offset,
5145         "%s :  Slot Cycle Index, %u",
5146         bigbuf,
5147         (value & 0x07));
5148 }
5149
5150 static void
5151 param_vp_report(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5152 {
5153     gint32 value;
5154     guint saved_offset;
5155     gchar *str = NULL;
5156
5157     EXACT_DATA_CHECK(len, 1);
5158
5159     add_string = add_string;
5160     saved_offset = asn1->offset;
5161
5162     asn1_int32_value_decode(asn1, 1, &value);
5163
5164     switch (value)
5165     {
5166     case 0: str = "Not used"; break;
5167     case 1: str = "Voice Privacy not attempted"; break;
5168     case 2: str = "Voice Privacy no response"; break;
5169     case 3: str = "Voiec Privacy successful is active"; break;
5170     case 4: str = "Voice Privacy failed"; break;
5171     default:
5172         if ((value >= 5) && (value <= 223)) { str = "Reserved, treat as Voice Privacy not attempted"; }
5173         else { str = "Reserved for protocol extension, treat as Voice Privacy not attempted"; }
5174         break;
5175     }
5176
5177     proto_tree_add_text(tree, asn1->tvb,
5178         saved_offset, asn1->offset - saved_offset,
5179         "%s (%u)",
5180         str,
5181         value);
5182 }
5183
5184 static void
5185 param_cdma_scm(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5186 {
5187     gint32 value;
5188     guint saved_offset;
5189     gchar *str = NULL;
5190
5191     add_string = add_string;
5192     saved_offset = asn1->offset;
5193
5194     asn1_int32_value_decode(asn1, 1, &value);
5195
5196     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
5197     proto_tree_add_text(tree, asn1->tvb,
5198         saved_offset, asn1->offset - saved_offset,
5199         "%s :  Reserved",
5200         bigbuf);
5201
5202     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
5203     proto_tree_add_text(tree, asn1->tvb,
5204         saved_offset, asn1->offset - saved_offset,
5205         "%s :  Dual-mode Indicator, %s",
5206         bigbuf,
5207         (value & 0x40) ? "Dual mode CDMA" : "CDMA only");
5208
5209     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
5210     proto_tree_add_text(tree, asn1->tvb,
5211         saved_offset, asn1->offset - saved_offset,
5212         "%s :  Slotted mode Indicator, %s",
5213         bigbuf,
5214         (value & 0x20) ? "slotted capable" : "slotted incapable");
5215
5216     other_decode_bitfield_value(bigbuf, value, 0x18, 8);
5217     proto_tree_add_text(tree, asn1->tvb,
5218         saved_offset, asn1->offset - saved_offset,
5219         "%s :  Reserved",
5220         bigbuf);
5221
5222     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
5223     proto_tree_add_text(tree, asn1->tvb,
5224         saved_offset, asn1->offset - saved_offset,
5225         "%s :  Analog Transmission, %s",
5226         bigbuf,
5227         (value & 0x04) ? "discontinuous" : "continuous");
5228
5229     switch (value & 0x03)
5230     {
5231     case 0: str = "Power Class I"; break;
5232     case 1: str = "Power Class II"; break;
5233     case 2: str = "Power Class III"; break;
5234     case 3: str = "Reserved"; break;
5235     }
5236
5237     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
5238     proto_tree_add_text(tree, asn1->tvb,
5239         saved_offset, asn1->offset - saved_offset,
5240         "%s :  %s",
5241         bigbuf,
5242         str);
5243
5244     EXTRANEOUS_DATA_CHECK(len, 1);
5245 }
5246
5247 static void
5248 param_ota_result_code(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5249 {
5250     gint32 value;
5251     guint saved_offset;
5252     gchar *str = NULL;
5253
5254     add_string = add_string;
5255     saved_offset = asn1->offset;
5256
5257     asn1_int32_value_decode(asn1, 1, &value);
5258
5259     switch (value)
5260     {
5261     case 0: str = "Accepted - Successful"; break;
5262     case 1: str = "Rejected - Unknown cause"; break;
5263     case 2: str = "Computation Failure - E.g., unable to compute A-key"; break;
5264     case 3: str = "CSC Rejected - CSC challenge failure"; break;
5265     case 4: str = "Unrecognized OTASPCallEntry"; break;
5266     case 5: str = "Unsupported AKeyProtocolVersion(s)"; break;
5267     case 6: str = "Unable to Commit"; break;
5268     default:
5269         if ((value >= 7) && (value <= 223)) { str = "Reserved, treat as Rejected - Unknown cause"; }
5270         else { str = "Reserved for protocol extension, treat as Rejected - Unknown cause"; }
5271         break;
5272     }
5273
5274     proto_tree_add_text(tree, asn1->tvb,
5275         saved_offset, asn1->offset - saved_offset,
5276         "%s (%u)",
5277         str,
5278         value);
5279
5280     EXTRANEOUS_DATA_CHECK(len, 1);
5281 }
5282
5283 static void
5284 param_cdma_scm2(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5285 {
5286     gint32 value;
5287     guint saved_offset;
5288
5289     add_string = add_string;
5290     saved_offset = asn1->offset;
5291
5292     asn1_int32_value_decode(asn1, 1, &value);
5293
5294     proto_tree_add_text(tree, asn1->tvb,
5295         saved_offset, asn1->offset - saved_offset,
5296         "Value %u",
5297         value);
5298
5299     EXTRANEOUS_DATA_CHECK(len, 1);
5300 }
5301
5302 static void
5303 param_tdma_term_cap(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5304 {
5305     gint32 value;
5306     guint saved_offset;
5307     gchar *str = NULL;
5308
5309     SHORT_DATA_CHECK(len, 4);
5310
5311     add_string = add_string;
5312     saved_offset = asn1->offset;
5313
5314     asn1_int32_value_decode(asn1, 1, &value);
5315
5316     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
5317     proto_tree_add_text(tree, asn1->tvb,
5318         saved_offset, asn1->offset - saved_offset,
5319         "%s :  Reserved",
5320         bigbuf);
5321
5322     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
5323     proto_tree_add_text(tree, asn1->tvb,
5324         saved_offset, asn1->offset - saved_offset,
5325         "%s :  1800 MHz F channel %sacceptable",
5326         bigbuf,
5327         (value & 0x40) ? "" : "not ");
5328
5329     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
5330     proto_tree_add_text(tree, asn1->tvb,
5331         saved_offset, asn1->offset - saved_offset,
5332         "%s :  1800 MHz E channel %sacceptable",
5333         bigbuf,
5334         (value & 0x20) ? "" : "not ");
5335
5336     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
5337     proto_tree_add_text(tree, asn1->tvb,
5338         saved_offset, asn1->offset - saved_offset,
5339         "%s :  1800 MHz D channel %sacceptable",
5340         bigbuf,
5341         (value & 0x10) ? "" : "not ");
5342
5343     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
5344     proto_tree_add_text(tree, asn1->tvb,
5345         saved_offset, asn1->offset - saved_offset,
5346         "%s :  1800 MHz C channel %sacceptable",
5347         bigbuf,
5348         (value & 0x08) ? "" : "not ");
5349
5350     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
5351     proto_tree_add_text(tree, asn1->tvb,
5352         saved_offset, asn1->offset - saved_offset,
5353         "%s :  1800 MHz B channel %sacceptable",
5354         bigbuf,
5355         (value & 0x04) ? "" : "not ");
5356
5357     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
5358     proto_tree_add_text(tree, asn1->tvb,
5359         saved_offset, asn1->offset - saved_offset,
5360         "%s :  %s acceptable",
5361         bigbuf,
5362         (value & 0x02) ? "1800 MHz A channel" : "1800 MHz A&B Digital channel not");
5363
5364     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
5365     proto_tree_add_text(tree, asn1->tvb,
5366         saved_offset, asn1->offset - saved_offset,
5367         "%s :  800 MHz A&B channel %sacceptable",
5368         bigbuf,
5369         (value & 0x01) ? "" : "not ");
5370
5371     saved_offset = asn1->offset;
5372
5373     asn1_int32_value_decode(asn1, 1, &value);
5374
5375     other_decode_bitfield_value(bigbuf, value, 0xfc, 8);
5376     proto_tree_add_text(tree, asn1->tvb,
5377         saved_offset, asn1->offset - saved_offset,
5378         "%s :  Reserved",
5379         bigbuf);
5380
5381     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
5382     proto_tree_add_text(tree, asn1->tvb,
5383         saved_offset, asn1->offset - saved_offset,
5384         "%s :  IS-641 Voice Coder %sacceptable",
5385         bigbuf,
5386         (value & 0x02) ? "" : "not ");
5387
5388     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
5389     proto_tree_add_text(tree, asn1->tvb,
5390         saved_offset, asn1->offset - saved_offset,
5391         "%s :  VSELP Voice Coder %sacceptable",
5392         bigbuf,
5393         (value & 0x01) ? "" : "not ");
5394
5395     saved_offset = asn1->offset;
5396
5397     asn1_int32_value_decode(asn1, 1, &value);
5398
5399     switch (value)
5400     {
5401     case 0: str = "EIA-553 or IS-54-A"; break;
5402     case 1: str = "TIA/EIA-627 (IS-54-B)"; break;
5403     case 2: str = "IS-136"; break;
5404     case 3: str = "Reserved (ANSI J-STD-011)"; break;
5405     case 4: str = "PV 0 as published in TIA/EIA-136-0 and IS-136-A"; break;
5406     case 5: str = "PV 1 as published in TIA/EIA-136-A"; break;
5407     case 6: str = "PV 2 as published in TIA/EIA-136-A"; break;
5408     case 7: str = "PV 3 as published in TIA/EIA-136-A"; break;
5409     default:
5410         str = "Reserved, treat as EIA-553 or IS-54-A";
5411         break;
5412     }
5413
5414     proto_tree_add_text(tree, asn1->tvb,
5415         saved_offset, 1,
5416         "Protocol Version, %s",
5417         str);
5418
5419     saved_offset = asn1->offset;
5420
5421     asn1_int32_value_decode(asn1, 1, &value);
5422
5423     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
5424     proto_tree_add_text(tree, asn1->tvb,
5425         saved_offset, asn1->offset - saved_offset,
5426         "%s :  Triple Rate (3RATE) %ssupported",
5427         bigbuf,
5428         (value & 0x80) ? "" : "not ");
5429
5430     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
5431     proto_tree_add_text(tree, asn1->tvb,
5432         saved_offset, asn1->offset - saved_offset,
5433         "%s :  Double Rate (2RATE) %ssupported",
5434         bigbuf,
5435         (value & 0x40) ? "" : "not ");
5436
5437     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
5438     proto_tree_add_text(tree, asn1->tvb,
5439         saved_offset, asn1->offset - saved_offset,
5440         "%s :  Full Rate (FRATE) %ssupported",
5441         bigbuf,
5442         (value & 0x20) ? "" : "not ");
5443
5444     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
5445     proto_tree_add_text(tree, asn1->tvb,
5446         saved_offset, asn1->offset - saved_offset,
5447         "%s :  Half Rate (HRATE) %ssupported",
5448         bigbuf,
5449         (value & 0x10) ? "" : "not ");
5450
5451     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
5452     proto_tree_add_text(tree, asn1->tvb,
5453         saved_offset, asn1->offset - saved_offset,
5454         "%s :  Analog Voice (AVOX) %ssupported",
5455         bigbuf,
5456         (value & 0x08) ? "" : "not ");
5457
5458     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
5459     proto_tree_add_text(tree, asn1->tvb,
5460         saved_offset, asn1->offset - saved_offset,
5461         "%s :  Secure Telephone Unit III (STU3) %ssupported",
5462         bigbuf,
5463         (value & 0x04) ? "" : "not ");
5464
5465     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
5466     proto_tree_add_text(tree, asn1->tvb,
5467         saved_offset, asn1->offset - saved_offset,
5468         "%s :  Group 3 Fax (G3FAX) %ssupported",
5469         bigbuf,
5470         (value & 0x02) ? "" : "not ");
5471
5472     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
5473     proto_tree_add_text(tree, asn1->tvb,
5474         saved_offset, asn1->offset - saved_offset,
5475         "%s :  Asynchronous Data (ADS) %ssupported",
5476         bigbuf,
5477         (value & 0x01) ? "" : "not ");
5478
5479     EXTRANEOUS_DATA_CHECK(len, 4);
5480 }
5481
5482 static void
5483 param_tdma_voice_coder(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5484 {
5485     gint32 value, vc;
5486     guint orig_offset, saved_offset;
5487     gchar *str = NULL;
5488
5489     SHORT_DATA_CHECK(len, 2);
5490
5491     add_string = add_string;
5492     orig_offset = asn1->offset;
5493     saved_offset = asn1->offset;
5494
5495     do
5496     {
5497         asn1_int32_value_decode(asn1, 1, &value);
5498
5499         other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
5500         proto_tree_add_text(tree, asn1->tvb,
5501             saved_offset, asn1->offset - saved_offset,
5502             "%s :  Reserved",
5503             bigbuf);
5504
5505         vc = (value & 0x0f);
5506         switch (vc)
5507         {
5508         case 0: str = "Not used"; break;
5509         case 1: str = "VSELP Voice Coder acceptable"; break;
5510         case 2: str = "IS-641 Voice Coder acceptable"; break;
5511         case 6: str = "Reserved for SOC/BSMC Specific signaling. If unknown, use any acceptable value"; break;
5512         default:
5513             if ((vc >= 3) && (vc <= 5)) { str = "Reserved. Ignore on reception, use any acceptable value"; }
5514             else if ((vc >= 7) && (vc <= 12)) { str = "Reserved. Ignore on reception, use any acceptable value"; }
5515             else if ((vc >= 13) && (vc <= 15)) { str = "Reserved for protocol extension. If unknown, use any acceptable value"; }
5516             break;
5517         }
5518
5519         other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
5520         proto_tree_add_text(tree, asn1->tvb,
5521             saved_offset, asn1->offset - saved_offset,
5522             "%s :  Voice Coder, %s",
5523             bigbuf,
5524             str);
5525
5526         saved_offset = asn1->offset;
5527     }
5528     while ((len - (saved_offset - orig_offset)) > 0);
5529 }
5530
5531 static void
5532 param_cdma_pilot_pn(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5533 {
5534     gint32 value;
5535     guint saved_offset;
5536
5537     SHORT_DATA_CHECK(len, 2);
5538
5539     add_string = add_string;
5540     saved_offset = asn1->offset;
5541
5542     asn1_int32_value_decode(asn1, 2, &value);
5543
5544     other_decode_bitfield_value(bigbuf, value >> 8, 0xfe, 8);
5545     proto_tree_add_text(tree, asn1->tvb,
5546         saved_offset, 1,
5547         "%s :  Reserved",
5548         bigbuf);
5549
5550     other_decode_bitfield_value(bigbuf, value >> 8, 0x01, 8);
5551     proto_tree_add_text(tree, asn1->tvb,
5552         saved_offset, 1,
5553         "%s :  Pilot PN (MSB), %u",
5554         bigbuf, value & 0x01ff);
5555
5556     other_decode_bitfield_value(bigbuf, value & 0x00ff, 0xff, 8);
5557     proto_tree_add_text(tree, asn1->tvb,
5558         saved_offset + 1, 1,
5559         "%s :  Pilot PN (LSB)",
5560         bigbuf);
5561
5562     EXTRANEOUS_DATA_CHECK(len, 2);
5563 }
5564
5565 static void
5566 param_cdma_pilot_strength(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5567 {
5568     gint32 value;
5569     guint saved_offset;
5570
5571     EXACT_DATA_CHECK(len, 1);
5572
5573     add_string = add_string;
5574     saved_offset = asn1->offset;
5575
5576     asn1_int32_value_decode(asn1, 1, &value);
5577
5578     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
5579     proto_tree_add_text(tree, asn1->tvb,
5580         saved_offset, asn1->offset - saved_offset,
5581         "%s :  Reserved",
5582         bigbuf);
5583
5584     other_decode_bitfield_value(bigbuf, value, 0x3f, 8);
5585     proto_tree_add_text(tree, asn1->tvb,
5586         saved_offset, asn1->offset - saved_offset,
5587         "%s :  Value %u",
5588         bigbuf,
5589         value & 0x3f);
5590 }
5591
5592 static void
5593 param_trunk_stat(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5594 {
5595     gint32 value;
5596     guint saved_offset;
5597     gchar *str = NULL;
5598
5599     EXACT_DATA_CHECK(len, 1);
5600
5601     add_string = add_string;
5602     saved_offset = asn1->offset;
5603
5604     asn1_int32_value_decode(asn1, 1, &value);
5605
5606     switch (value)
5607     {
5608     case 0: str = "Idle"; break;
5609     case 1: str = "Blocked"; break;
5610     default:
5611         if ((value >= 2) && (value <= 223)) { str = "Reserved, treat as ERROR or Blocked"; }
5612         else { str = "Reserved for protocol extension, treat as ERROR or Blocked"; }
5613         break;
5614     }
5615
5616     proto_tree_add_text(tree, asn1->tvb,
5617         saved_offset, asn1->offset - saved_offset,
5618         "Trunk Status, %s",
5619         str);
5620 }
5621
5622 static void
5623 param_pref_lang_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5624 {
5625     gint32 value;
5626     guint saved_offset;
5627     gchar *str = NULL;
5628
5629     add_string = add_string;
5630     saved_offset = asn1->offset;
5631
5632     asn1_int32_value_decode(asn1, 1, &value);
5633
5634     switch (value)
5635     {
5636     case 0: str = "Unspecified"; break;
5637     case 1: str = "English"; break;
5638     case 2: str = "French"; break;
5639     case 3: str = "Spanish"; break;
5640     case 4: str = "German"; break;
5641     case 5: str = "Portuguese"; break;
5642     default:
5643         str = "Reserved, treat as Unspecified";
5644         break;
5645     }
5646
5647     proto_tree_add_text(tree, asn1->tvb,
5648         saved_offset, asn1->offset - saved_offset,
5649         "Preferred Language, %s",
5650         str);
5651
5652     EXTRANEOUS_DATA_CHECK(len, 1);
5653 }
5654
5655 static void
5656 param_rand_valtime(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5657 {
5658     gint32 value;
5659     guint saved_offset;
5660     gchar *str = NULL;
5661
5662     add_string = add_string;
5663     saved_offset = asn1->offset;
5664
5665     asn1_int32_value_decode(asn1, 1, &value);
5666
5667     if (value == 0)
5668     {
5669         str = "RAND shall not be stored";
5670     }
5671     else
5672     {
5673         sprintf(bigbuf, "RAND may be used for %u minutes", value);
5674         str = bigbuf;
5675     }
5676
5677     proto_tree_add_text(tree, asn1->tvb,
5678         saved_offset, asn1->offset - saved_offset,
5679         str);
5680
5681     EXTRANEOUS_DATA_CHECK(len, 1);
5682 }
5683
5684 static void
5685 param_tdma_burst_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5686 {
5687     gint32 value;
5688     guint saved_offset;
5689     gchar *str = NULL;
5690
5691     EXACT_DATA_CHECK(len, 1);
5692
5693     add_string = add_string;
5694     saved_offset = asn1->offset;
5695
5696     asn1_int32_value_decode(asn1, 1, &value);
5697
5698     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
5699     proto_tree_add_text(tree, asn1->tvb,
5700         saved_offset, asn1->offset - saved_offset,
5701         "%s :  Reserved",
5702         bigbuf);
5703
5704     other_decode_bitfield_value(bigbuf, value, 0x7c, 8);
5705     proto_tree_add_text(tree, asn1->tvb,
5706         saved_offset, asn1->offset - saved_offset,
5707         "%s :  Time Alignment Offset (TA), %u",
5708         bigbuf,
5709         (value & 0x7c) >> 2);
5710
5711     switch (value & 0x03)
5712     {
5713     case 0: str = "Transmit normal burst after cell-to-cell handoff"; break;
5714     case 1: str = "Transmit normal burst after handoff within cell"; break;
5715     case 2: str = "Transmit shortened burst after cell-to-cell handoff"; break;
5716     case 3: str = "Reserved, treat with RETURN ERROR"; break;
5717     }
5718
5719     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
5720     proto_tree_add_text(tree, asn1->tvb,
5721         saved_offset, asn1->offset - saved_offset,
5722         "%s :  Burst Code, %s",
5723         bigbuf,
5724         str);
5725 }
5726
5727 static void
5728 param_orig_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5729 {
5730     gint32 value;
5731     guint saved_offset;
5732     gchar *str = NULL;
5733
5734     EXACT_DATA_CHECK(len, 1);
5735
5736     add_string = add_string;
5737     saved_offset = asn1->offset;
5738
5739     asn1_int32_value_decode(asn1, 1, &value);
5740
5741     switch (value)
5742     {
5743     case 0: str = "Not used"; break;
5744     case 1: str = "Prior agreement"; break;
5745     case 2: str = "Origination denied"; break;
5746     case 3: str = "Local calls only"; break;
5747     case 4: str = "Selected leading digits of directory number or of international E.164 number, see Digits(Destination)"; break;
5748     case 5: str = "Selected leading digits of directory number or of international E.164 number and local calls only, see Digits(Destination)"; break;
5749     case 6: str = "National long distance"; break;
5750     case 7: str = "International calls"; break;
5751     case 8: str = "Single directory number or international E.164 number, see Digits(Destination)"; break;
5752     default:
5753         if ((value >= 9) && (value <= 223)) { str = "Reserved, treat as Local calls only"; }
5754         else { str = "Reserved for protocol extension, treat as Local calls only"; }
5755         break;
5756     }
5757
5758     proto_tree_add_text(tree, asn1->tvb,
5759         saved_offset, asn1->offset - saved_offset,
5760         "Allowed Call Types, %s",
5761         str);
5762 }
5763
5764 static void
5765 param_ms_loc(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5766 {
5767     gint32 value;
5768     guint saved_offset;
5769
5770     SHORT_DATA_CHECK(len, 7);
5771
5772     add_string = add_string;
5773     saved_offset = asn1->offset;
5774
5775     asn1_int32_value_decode(asn1, 3, &value);
5776
5777     proto_tree_add_text(tree, asn1->tvb,
5778         saved_offset, asn1->offset - saved_offset,
5779         "Latitude in tenths of a second, %u",
5780         value);
5781
5782     saved_offset = asn1->offset;
5783
5784     asn1_int32_value_decode(asn1, 3, &value);
5785
5786     proto_tree_add_text(tree, asn1->tvb,
5787         saved_offset, asn1->offset - saved_offset,
5788         "Longitude in tenths of a second, %u",
5789         value);
5790
5791     saved_offset = asn1->offset;
5792
5793     asn1_int32_value_decode(asn1, MIN(len - 6, 2), &value);
5794
5795     proto_tree_add_text(tree, asn1->tvb,
5796         saved_offset, asn1->offset - saved_offset,
5797         "Resolution in units of 1 foot, %u",
5798         value);
5799
5800     EXTRANEOUS_DATA_CHECK(len, 8);
5801 }
5802
5803 static void
5804 param_unique_chal_rep(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5805 {
5806     gint32 value;
5807     guint saved_offset;
5808     gchar *str = NULL;
5809
5810     add_string = add_string;
5811     saved_offset = asn1->offset;
5812
5813     asn1_int32_value_decode(asn1, 1, &value);
5814
5815     switch (value)
5816     {
5817     case 0: str = "Not used"; break;
5818     case 1: str = "Unique Challenge not attempted"; break;
5819     case 2: str = "Unique Challenge no response"; break;
5820     case 3: str = "Unique Challenge successful"; break;
5821     case 4: str = "Unique Challenge failed"; break;
5822     default:
5823         if ((value >= 5) && (value <= 223)) { str = "Reserved, treat as Unique Challenge not attempted"; }
5824         else { str = "Reserved for protocol extension, treat as Unique Challenge not attempted"; }
5825         break;
5826     }
5827
5828     proto_tree_add_text(tree, asn1->tvb,
5829         saved_offset, asn1->offset - saved_offset,
5830         str);
5831
5832     EXTRANEOUS_DATA_CHECK(len, 1);
5833 }
5834
5835 static void
5836 param_rand_unique(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5837 {
5838     guint saved_offset;
5839
5840     EXACT_DATA_CHECK(len, 3);
5841
5842     add_string = add_string;
5843     saved_offset = asn1->offset;
5844
5845     proto_tree_add_text(tree, asn1->tvb,
5846         saved_offset, len,
5847         "24-bit random number used as input to the CAVE algorithm for authenticating a specific MS");
5848
5849     asn1->offset += len;
5850 }
5851
5852 static void
5853 param_vpmask(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5854 {
5855     gint32 value;
5856     guint saved_offset;
5857
5858     EXACT_DATA_CHECK(len, 66);
5859
5860     add_string = add_string;
5861     saved_offset = asn1->offset;
5862
5863     asn1_int32_value_decode(asn1, 1, &value);
5864
5865     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
5866     proto_tree_add_text(tree, asn1->tvb,
5867         saved_offset, asn1->offset - saved_offset,
5868         "%s :  Reserved",
5869         bigbuf);
5870
5871     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
5872     proto_tree_add_text(tree, asn1->tvb,
5873         saved_offset, asn1->offset - saved_offset,
5874         "%s :  Voice Privacy Mask-A (VPMASK-A) (MSB)",
5875         bigbuf);
5876
5877     saved_offset = asn1->offset;
5878
5879     proto_tree_add_text(tree, asn1->tvb,
5880         saved_offset, 32,
5881         "Voice Privacy Mask-A (VPMASK-A)");
5882
5883     asn1->offset += 32;
5884
5885     saved_offset = asn1->offset;
5886
5887     asn1_int32_value_decode(asn1, 1, &value);
5888
5889     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
5890     proto_tree_add_text(tree, asn1->tvb,
5891         saved_offset, asn1->offset - saved_offset,
5892         "%s :  Reserved",
5893         bigbuf);
5894
5895     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
5896     proto_tree_add_text(tree, asn1->tvb,
5897         saved_offset, asn1->offset - saved_offset,
5898         "%s :  Voice Privacy Mask-B (VPMASK-B) (MSB)",
5899         bigbuf);
5900
5901     saved_offset = asn1->offset;
5902
5903     proto_tree_add_text(tree, asn1->tvb,
5904         saved_offset, 32,
5905         "Voice Privacy Mask-B (VPMASK-B)");
5906
5907     asn1->offset += 32;
5908 }
5909
5910 static void
5911 param_ssd(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5912 {
5913     guint saved_offset;
5914
5915     EXACT_DATA_CHECK(len, 16);
5916
5917     add_string = add_string;
5918     saved_offset = asn1->offset;
5919
5920     proto_tree_add_text(tree, asn1->tvb,
5921         saved_offset, 8,
5922         "Shared Secret Data-A (SSD-A)");
5923
5924     proto_tree_add_text(tree, asn1->tvb,
5925         saved_offset+8, 8,
5926         "Shared Secret Data-B (SSD-B)");
5927
5928     asn1->offset += len;
5929 }
5930
5931 static void
5932 param_upd_count(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5933 {
5934     gint32 value;
5935     guint saved_offset;
5936     gchar *str = NULL;
5937
5938     EXACT_DATA_CHECK(len, 1);
5939
5940     add_string = add_string;
5941     saved_offset = asn1->offset;
5942
5943     asn1_int32_value_decode(asn1, 1, &value);
5944
5945     switch (value)
5946     {
5947     case 0: str = "Not used"; break;
5948     case 1: str = "Update COUNT"; break;
5949     default:
5950         if ((value >= 2) && (value <= 223)) { str = "Reserved, treat as Update COUNT"; }
5951         else { str = "Reserved for protocol extension, treat as Update COUNT"; }
5952         break;
5953     }
5954
5955     proto_tree_add_text(tree, asn1->tvb,
5956         saved_offset, asn1->offset - saved_offset,
5957         "%s",
5958         str);
5959 }
5960
5961 static void
5962 param_sme_key(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5963 {
5964     guint saved_offset;
5965
5966     EXACT_DATA_CHECK(len, 8);
5967
5968     add_string = add_string;
5969     saved_offset = asn1->offset;
5970
5971     proto_tree_add_text(tree, asn1->tvb,
5972         saved_offset, len,
5973         "Signaling Message Encryption Key (SMEKEY)");
5974
5975     asn1->offset += len;
5976 }
5977
5978 static void
5979 param_rand_ssd(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5980 {
5981     guint saved_offset;
5982
5983     EXACT_DATA_CHECK(len, 7);
5984
5985     add_string = add_string;
5986     saved_offset = asn1->offset;
5987
5988     proto_tree_add_text(tree, asn1->tvb,
5989         saved_offset, len,
5990         "56-bit random number used as input to the CAVE algorithm for generating Shared Secret Data");
5991
5992     asn1->offset += len;
5993 }
5994
5995 static void
5996 param_setup_result(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5997 {
5998     gint32 value;
5999     guint saved_offset;
6000     gchar *str = NULL;
6001
6002     add_string = add_string;
6003     saved_offset = asn1->offset;
6004
6005     asn1_int32_value_decode(asn1, 1, &value);
6006
6007     switch (value)
6008     {
6009     case 0: str = "Not used"; break;
6010     case 1: str = "Unsuccessful"; break;
6011     case 2: str = "Successful"; break;
6012     default:
6013         str = "Reserved, treat as Unsuccessful";
6014         break;
6015     }
6016
6017     proto_tree_add_text(tree, asn1->tvb,
6018         saved_offset, asn1->offset - saved_offset,
6019         str);
6020
6021     EXTRANEOUS_DATA_CHECK(len, 1);
6022 }
6023
6024 static void
6025 param_randc(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6026 {
6027     guint saved_offset;
6028
6029     add_string = add_string;
6030     saved_offset = asn1->offset;
6031
6032     proto_tree_add_text(tree, asn1->tvb,
6033         saved_offset, 1,
6034         "The 8 most significant bits of the 32-bit Random Variable used to compute the Authentication Response");
6035
6036     asn1->offset += 1;
6037
6038     EXTRANEOUS_DATA_CHECK(len, 1);
6039 }
6040
6041 static void
6042 param_ext_mscid(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6043 {
6044     gint32 type;
6045     guint saved_offset;
6046     gchar *str = NULL;
6047
6048     EXACT_DATA_CHECK(len, 4);
6049
6050     saved_offset = asn1->offset;
6051
6052     asn1_int32_value_decode(asn1, 1, &type);
6053
6054     switch (type)
6055     {
6056     case 0: str = "Not specified"; break;
6057     case 1: str = "Serving MSC"; break;
6058     case 2: str = "Home MSC"; break;
6059     case 3: str = "Gateway MSC"; break;
6060     case 4: str = "HLR"; break;
6061     case 5: str = "VLR"; break;
6062     case 6: str = "EIR (reserved)"; break;
6063     case 7: str = "AC"; break;
6064     case 8: str = "Border MSC"; break;
6065     case 9: str = "Originating MSC"; break;
6066     default:
6067         if ((type >= 10) && (type <= 223)) { str = "Reserved, treat as Not specified"; }
6068         else { str = "Reserved for protocol extension, treat as Not specified"; }
6069         break;
6070     }
6071
6072     proto_tree_add_text(tree, asn1->tvb,
6073         saved_offset, asn1->offset - saved_offset,
6074         "Type (%u), %s",
6075         type,
6076         str);
6077
6078     param_mscid(asn1, tree, len-1, add_string);
6079 }
6080
6081 static void
6082 param_sub_addr(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6083 {
6084     gint32 value;
6085     guint saved_offset;
6086     gchar *str = NULL;
6087
6088     add_string = add_string;
6089     saved_offset = asn1->offset;
6090     asn1_int32_value_decode(asn1, 1, &value);
6091
6092     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
6093     proto_tree_add_text(tree, asn1->tvb,
6094         saved_offset, asn1->offset - saved_offset,
6095         "%s :  Should be 1",
6096         bigbuf);
6097
6098     switch ((value & 0x70) >> 4)
6099     {
6100     case 0x00: str = "NSAP (CCITT Rec. X.213 or ISO 8348 AD2)"; break;
6101     case 0x02: str = "User specified"; break;
6102     default:
6103         str = "Reserved";
6104         break;
6105     }
6106
6107     other_decode_bitfield_value(bigbuf, value, 0x70, 8);
6108     proto_tree_add_text(tree, asn1->tvb,
6109         saved_offset, asn1->offset - saved_offset,
6110         "%s :  Type of Subaddress %s",
6111         bigbuf, str);
6112
6113     switch ((value & 0x08) >> 3)
6114     {
6115     case 0x00: str = "Even number of subaddress signals follow"; break;
6116     case 0x01: str = "Odd number of subaddress signals follow"; break;
6117     }
6118
6119     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
6120     proto_tree_add_text(tree, asn1->tvb,
6121         saved_offset, asn1->offset - saved_offset,
6122         "%s :  %s",
6123         bigbuf, str);
6124
6125     proto_tree_add_text(tree, asn1->tvb,
6126         asn1->offset, len - 1,
6127         "Subaddress");
6128
6129     asn1->offset += len - 1;
6130 }
6131
6132 static void
6133 param_digits(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6134 {
6135     gint32 value, b1, b2, b3, b4, enc, plan;
6136     guint saved_offset;
6137     gchar *str = NULL;
6138     proto_item *item;
6139     proto_tree *subtree;
6140     guchar *poctets;
6141
6142     SHORT_DATA_CHECK(len, 4);
6143
6144     add_string = add_string;
6145     saved_offset = asn1->offset;
6146     asn1_int32_value_decode(asn1, 1, &value);
6147
6148     switch (value)
6149     {
6150     case 0: str = "Not used"; break;
6151     case 1: str = "Dialed Numer or Called Party Number"; break;
6152     case 2: str = "Calling Party Number"; break;
6153     case 3: str = "Caller Interaction (Not used)"; break;
6154     case 4: str = "Routing Number"; break;
6155     case 5: str = "Billing Number"; break;
6156     case 6: str = "Destination Number"; break;
6157     case 7: str = "LATA (Not used)"; break;
6158     case 8: str = "Carrier"; break;
6159     case 13: str = "ESRD"; break;
6160     default:
6161         str = "Reserved";
6162         break;
6163     }
6164
6165     proto_tree_add_text(tree, asn1->tvb,
6166         saved_offset, asn1->offset - saved_offset,
6167         "Type of Digits %u: %s",
6168         value, str);
6169
6170     saved_offset = asn1->offset;
6171     asn1_int32_value_decode(asn1, 1, &value);
6172
6173     item =
6174         proto_tree_add_text(tree, asn1->tvb,
6175             saved_offset, asn1->offset - saved_offset,
6176             "Nature of Number");
6177
6178     subtree = proto_item_add_subtree(item, ett_natnum);
6179
6180     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
6181     proto_tree_add_text(subtree, asn1->tvb,
6182         saved_offset, asn1->offset - saved_offset,
6183         "%s :  Reserved",
6184         bigbuf);
6185
6186     switch ((value & 0x30) >> 4)
6187     {
6188     case 0x00: str = "User provided, not screened"; break;
6189     case 0x01: str = "User provided, screening passed"; break;
6190     case 0x02: str = "User provided, screening failed"; break;
6191     case 0x03: str = "Network provided"; break;
6192     }
6193
6194     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
6195     proto_tree_add_text(subtree, asn1->tvb,
6196         saved_offset, asn1->offset - saved_offset,
6197         "%s :  %s",
6198         bigbuf, str);
6199
6200     proto_tree_add_text(subtree, asn1->tvb,
6201         saved_offset, asn1->offset - saved_offset,
6202         ".... %u... :  Reserved",
6203         (value & 0x08) >> 3);
6204
6205     proto_tree_add_text(subtree, asn1->tvb,
6206         saved_offset, asn1->offset - saved_offset,
6207         ".... .%u.. :  Number is %savailable",
6208         (value & 0x04) >> 2, (value & 0x04) ? "not " : "");
6209
6210     proto_tree_add_text(subtree, asn1->tvb,
6211         saved_offset, asn1->offset - saved_offset,
6212         ".... ..%u. :  Presentation %s",
6213         (value & 0x02) >> 1, (value & 0x02) ? "Restricted" : "Allowed");
6214
6215     proto_tree_add_text(subtree, asn1->tvb,
6216         saved_offset, asn1->offset - saved_offset,
6217         ".... ...%u :  %s",
6218         value & 0x01, (value & 0x01) ? "International" : "National");
6219
6220     saved_offset = asn1->offset;
6221     asn1_int32_value_decode(asn1, 1, &value);
6222
6223     plan = (value & 0xf0) >> 4;
6224     switch (plan)
6225     {
6226     case 0x00: str = "Unknown or not applicable"; break;
6227     case 0x01: str = "ISDN Numbering (Not used)"; break;
6228     case 0x02: str = "Telephony Numbering (ITU-T Rec. E.164, E.163)"; break;
6229     case 0x03: str = "Data Numbering (ITU-T Rec. X.121)(Not used)"; break;
6230     case 0x04: str = "Telex Numbering (ITU-T Rec. F.69)(Not used)"; break;
6231     case 0x05: str = "Maritime Mobile Numbering (Not used)"; break;
6232     case 0x06: str = "Land Mobile Numbering (ITU-T Rec. E.212)"; break;
6233     case 0x07: str = "Private Numbering Plan (service provider defined)"; break;
6234     case 0x0d: str = "ANSI SS7 Point Code (PC) and Subsystem Number (SSN)"; break;
6235     case 0x0e: str = "Internet Protocol (IP) Address"; break;
6236     case 0x0f: str = "Reserved for extension"; break;
6237     default:
6238         str = "Reserved";
6239         break;
6240     }
6241
6242     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
6243     proto_tree_add_text(tree, asn1->tvb,
6244         saved_offset, asn1->offset - saved_offset,
6245         "%s :  Numbering Plan: %s",
6246         bigbuf, str);
6247
6248     enc = value & 0x0f;
6249     switch (enc)
6250     {
6251     case 0x00: str = "Not used"; break;
6252     case 0x01: str = "BCD"; break;
6253     case 0x02: str = "IA5"; break;
6254     case 0x03: str = "Octet String"; break;
6255     default:
6256         str = "Reserved";
6257         break;
6258     }
6259
6260     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
6261     proto_tree_add_text(tree, asn1->tvb,
6262         saved_offset, asn1->offset - saved_offset,
6263         "%s :  Encoding: %s",
6264         bigbuf, str);
6265
6266     saved_offset = asn1->offset;
6267
6268     if (plan == 0x0d)
6269     {
6270         asn1_int32_value_decode(asn1, 1, &b1);
6271         asn1_int32_value_decode(asn1, 1, &b2);
6272         asn1_int32_value_decode(asn1, 1, &b3);
6273         asn1_int32_value_decode(asn1, 1, &b4);
6274
6275         proto_tree_add_text(tree, asn1->tvb,
6276             saved_offset, asn1->offset - saved_offset,
6277             "Point Code %u-%u-%u  SSN %u",
6278             b3, b2, b1, b4);
6279     }
6280     else if (plan == 0x0e)
6281     {
6282         asn1_int32_value_decode(asn1, 1, &b1);
6283         asn1_int32_value_decode(asn1, 1, &b2);
6284         asn1_int32_value_decode(asn1, 1, &b3);
6285         asn1_int32_value_decode(asn1, 1, &b4);
6286
6287         proto_tree_add_text(tree, asn1->tvb,
6288             saved_offset, asn1->offset - saved_offset,
6289             "IP Address %u.%u.%u.%u",
6290             b1, b2, b3, b4);
6291     }
6292     else
6293     {
6294         asn1_int32_value_decode(asn1, 1, &value);
6295
6296         proto_tree_add_text(tree, asn1->tvb,
6297             saved_offset, asn1->offset - saved_offset,
6298             "Number of Digits: %u",
6299             value);
6300
6301         if (enc == 0x02)
6302         {
6303             proto_tree_add_text(tree, asn1->tvb,
6304                 asn1->offset, value,
6305                 "IA5 Digits");
6306
6307             asn1->offset += value;
6308         }
6309         else if (enc == 0x01)
6310         {
6311             saved_offset = asn1->offset;
6312             asn1_string_value_decode(asn1, (value+1)/2, &poctets);
6313
6314             my_dgt_tbcd_unpack(bigbuf, poctets, (value+1)/2, &Dgt_tbcd);
6315             g_free(poctets);
6316
6317             proto_tree_add_text(tree, asn1->tvb,
6318                 saved_offset, (value+1)/2,
6319                 "BCD Digits: %s",
6320                 bigbuf);
6321         }
6322     }
6323 }
6324
6325 static void
6326 param_esn(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6327 {
6328     gint32 value;
6329     guint saved_offset;
6330
6331     EXACT_DATA_CHECK(len, 4);
6332
6333     add_string = add_string;
6334     saved_offset = asn1->offset;
6335
6336     asn1_int32_value_decode(asn1, 4, &value);
6337
6338     proto_tree_add_text(tree, asn1->tvb,
6339         saved_offset, asn1->offset - saved_offset,
6340         "ESN 0x%04x",
6341         value);
6342
6343     sprintf(add_string, " - 0x%04x", value);
6344 }
6345
6346 static void
6347 param_sms_noti(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6348 {
6349     gint32 value;
6350     guint saved_offset;
6351     gchar *str = NULL;
6352
6353     add_string = add_string;
6354     saved_offset = asn1->offset;
6355
6356     asn1_int32_value_decode(asn1, 1, &value);
6357
6358     switch (value)
6359     {
6360     case 0: str = "Not used"; break;
6361     case 1: str = "Notify when available"; break;
6362     case 2: str = "Do not notify when available"; break;
6363     default:
6364         if ((value >= 3) && (value <= 127)) { str = "Reserved, treat as Notify when available"; }
6365         else if ((value >= 128) && (value <= 223)) { str = "Reserved, treat as Do not notify when available"; }
6366         else { str = "Reserved for protocol extension"; }
6367         break;
6368     }
6369
6370     proto_tree_add_text(tree, asn1->tvb,
6371         saved_offset, asn1->offset - saved_offset,
6372         "%s (%u)",
6373         str,
6374         value);
6375
6376     EXTRANEOUS_DATA_CHECK(len, 1);
6377 }
6378
6379 static void
6380 param_sms_orig_restric(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6381 {
6382     gint32 value;
6383     guint saved_offset;
6384     gchar *str = NULL;
6385
6386     add_string = add_string;
6387     saved_offset = asn1->offset;
6388
6389     asn1_int32_value_decode(asn1, 1, &value);
6390
6391     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
6392     proto_tree_add_text(tree, asn1->tvb,
6393         saved_offset, asn1->offset - saved_offset,
6394         "%s :  Reserved",
6395         bigbuf);
6396
6397     switch (value & 0x08)
6398     {
6399     case 0x00: str = "No effect"; break;
6400     default:
6401         str = "Force indirect";
6402         break;
6403     }
6404
6405     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
6406     proto_tree_add_text(tree, asn1->tvb,
6407         saved_offset, asn1->offset - saved_offset,
6408         "%s :  Force Message Center, %s",
6409         bigbuf, str);
6410
6411     switch (value & 0x04)
6412     {
6413     case 0x00: str = "Block direct"; break;
6414     default:
6415         str = "Allow direct";
6416         break;
6417     }
6418
6419     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
6420     proto_tree_add_text(tree, asn1->tvb,
6421         saved_offset, asn1->offset - saved_offset,
6422         "%s :  DIRECT, %s",
6423         bigbuf, str);
6424
6425     switch (value & 0x03)
6426     {
6427     case 0x00: str = "Block all"; break;
6428     case 0x02: str = "Allow specific"; break;
6429     case 0x03: str = "Allow all"; break;
6430     default:
6431         str = "Reserved";
6432         break;
6433     }
6434
6435     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
6436     proto_tree_add_text(tree, asn1->tvb,
6437         saved_offset, asn1->offset - saved_offset,
6438         "%s :  DEFAULT, %s",
6439         bigbuf, str);
6440
6441     EXTRANEOUS_DATA_CHECK(len, 1);
6442 }
6443
6444 static void
6445 param_seizure(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6446 {
6447     gint32 value;
6448     guint saved_offset;
6449     gchar *str = NULL;
6450
6451     add_string = add_string;
6452     saved_offset = asn1->offset;
6453
6454     asn1_int32_value_decode(asn1, 1, &value);
6455
6456     switch (value)
6457     {
6458     case 0: str = "Unspecified"; break;
6459     case 1: str = "Loopback"; break;
6460     default:
6461         if ((value >= 2) && (value <= 223)) { str = "Reserved"; }
6462         else { str = "Reserved for protocol extension"; }
6463         break;
6464     }
6465
6466     proto_tree_add_text(tree, asn1->tvb,
6467         saved_offset, asn1->offset - saved_offset,
6468         str);
6469
6470     EXTRANEOUS_DATA_CHECK(len, 1);
6471 }
6472
6473 static void
6474 param_sms_tele(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6475 {
6476     gint32 value;
6477     guint saved_offset;
6478     gchar *str = NULL;
6479
6480     ansi_map_sms_tele_id = -1;
6481
6482     SHORT_DATA_CHECK(len, 2);
6483
6484     add_string = add_string;
6485     saved_offset = asn1->offset;
6486
6487     asn1_int32_value_decode(asn1, 2, &value);
6488
6489     str = match_strval(value, ansi_tele_strings);
6490     if (str == NULL)
6491     {
6492         switch (value)
6493         {
6494         case 0: str = "Not used"; break;
6495         default:
6496             if ((value >= 2) && (value <= 4095)) { str = "Reserved for assignment by TIA/EIA-41"; }
6497             else if ((value >= 4100) && (value <= 32512)) { str = "Reserved for assignment by TIA/EIA-41"; }
6498             else if ((value >= 32514) && (value <= 32639)) { str = "Reserved for assignment by this Standard for TDMA MS-based SMEs."; }
6499             else if ((value >= 32640) && (value <= 32767)) { str = "Reserved for carrier specific teleservices for TDMA MS-based SMEs."; }
6500             else if ((value >= 32768) && (value <= 49151)) { str = "Reserved for node specific teleservices."; }
6501             else if ((value >= 49152) && (value <= 65535)) { str = "Reserved for carrier specific teleservices."; }
6502             else { str = "Unknown teleservice ID"; }
6503             break;
6504         }
6505     }
6506
6507     ansi_map_sms_tele_id = value;
6508
6509     proto_tree_add_text(tree, asn1->tvb,
6510         saved_offset, asn1->offset - saved_offset,
6511         "%s (%u)",
6512         str,
6513         value);
6514
6515     EXTRANEOUS_DATA_CHECK(len, 2);
6516 }
6517
6518 static void
6519 param_sms_term_restric(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6520 {
6521     gint32 value;
6522     guint saved_offset;
6523     gchar *str = NULL;
6524
6525     add_string = add_string;
6526     saved_offset = asn1->offset;
6527
6528     asn1_int32_value_decode(asn1, 1, &value);
6529
6530     other_decode_bitfield_value(bigbuf, value, 0xf8, 8);
6531     proto_tree_add_text(tree, asn1->tvb,
6532         saved_offset, asn1->offset - saved_offset,
6533         "%s :  Reserved",
6534         bigbuf);
6535
6536     switch (value & 0x04)
6537     {
6538     case 0x00: str = "Block messages charged to destination"; break;
6539     default:
6540         str = "Allow messages charged to destination";
6541         break;
6542     }
6543
6544     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
6545     proto_tree_add_text(tree, asn1->tvb,
6546         saved_offset, asn1->offset - saved_offset,
6547         "%s :  Reverse Charges, %s",
6548         bigbuf, str);
6549
6550     switch (value & 0x03)
6551     {
6552     case 0x00: str = "Block all"; break;
6553     case 0x02: str = "Allow specific"; break;
6554     case 0x03: str = "Allow all"; break;
6555     default:
6556         str = "Reserved";
6557         break;
6558     }
6559
6560     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
6561     proto_tree_add_text(tree, asn1->tvb,
6562         saved_offset, asn1->offset - saved_offset,
6563         "%s :  DEFAULT, %s",
6564         bigbuf, str);
6565
6566     EXTRANEOUS_DATA_CHECK(len, 1);
6567 }
6568
6569 static void
6570 param_sms_msg_count(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6571 {
6572     gint32 value;
6573     guint saved_offset;
6574     gchar *str = NULL;
6575
6576     add_string = add_string;
6577     saved_offset = asn1->offset;
6578
6579     asn1_int32_value_decode(asn1, 1, &value);
6580
6581     switch (value)
6582     {
6583     case 0: str = "No more pending SMS messages"; break;
6584     default:
6585         sprintf(bigbuf, "%u pending SMS messages", value);
6586         str = bigbuf;
6587         break;
6588     }
6589
6590     proto_tree_add_text(tree, asn1->tvb,
6591         saved_offset, asn1->offset - saved_offset,
6592         str);
6593
6594     EXTRANEOUS_DATA_CHECK(len, 1);
6595 }
6596
6597 static void
6598 param_qos_pri(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6599 {
6600     gint32 value, temp_int;
6601     guint saved_offset;
6602     gchar *str = NULL;
6603
6604     add_string = add_string;
6605     saved_offset = asn1->offset;
6606
6607     asn1_int32_value_decode(asn1, 1, &value);
6608
6609     temp_int = (value & 0xf0) >> 4;
6610     if ((temp_int < 0) || (temp_int >= (gint) NUM_QOS_PRI_STR))
6611     {
6612         str = "Reserved";
6613     }
6614     else
6615     {
6616         str = qos_pri_str[temp_int];
6617     }
6618
6619     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
6620     proto_tree_add_text(tree, asn1->tvb,
6621         saved_offset, asn1->offset - saved_offset,
6622         "%s :  Assured Priority, %s",
6623         bigbuf,
6624         str);
6625
6626     temp_int = value & 0x0f;
6627     if ((temp_int < 0) || (temp_int >= (gint) NUM_QOS_PRI_STR))
6628     {
6629         str = "Reserved";
6630     }
6631     else
6632     {
6633         str = qos_pri_str[temp_int];
6634     }
6635
6636     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
6637     proto_tree_add_text(tree, asn1->tvb,
6638         saved_offset, asn1->offset - saved_offset,
6639         "%s :  Non-Assured Priority, %s",
6640         bigbuf,
6641         str);
6642
6643     EXTRANEOUS_DATA_CHECK(len, 1);
6644 }
6645
6646 static void
6647 param_calling_party_cat(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6648 {
6649     gint32 value;
6650     guint saved_offset;
6651
6652     EXACT_DATA_CHECK(len, 1);
6653
6654     add_string = add_string;
6655     saved_offset = asn1->offset;
6656
6657     asn1_int32_value_decode(asn1, 1, &value);
6658
6659     proto_tree_add_text(tree, asn1->tvb,
6660         saved_offset, asn1->offset - saved_offset,
6661         "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");
6662 }
6663
6664 /*
6665  * Dissect IOS data parameters expected to be in TLV format
6666  */
6667 static void
6668 dissect_cdma2000_ios_data(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6669 {
6670     gint32      value;
6671     guint       num_elems;
6672     guchar      elem_len;
6673     guint32     orig_offset, saved_offset;
6674     proto_tree  *subtree;
6675     proto_item  *item;
6676     gchar       *str;
6677     gint        idx;
6678
6679     num_elems = 0;
6680     orig_offset = saved_offset = asn1->offset;
6681
6682     while ((saved_offset - orig_offset + 2) <= len)
6683     {
6684         num_elems++;
6685
6686         asn1_int32_value_decode(asn1, 1, &value);
6687         str = my_match_strval((guint32) value, ansi_a_ios401_elem_1_strings, &idx);
6688
6689         asn1_octet_decode(asn1, &elem_len);
6690
6691         item =
6692             proto_tree_add_text(tree,
6693                 asn1->tvb, saved_offset, elem_len + 2,
6694                 "IOS - %s",
6695                 str);
6696
6697         subtree = proto_item_add_subtree(item, ett_ansi_map_ios401_elem[idx]);
6698
6699         proto_tree_add_none_format(subtree, hf_ansi_map_ios401_elem_id, asn1->tvb,
6700             saved_offset, 1, "Element ID");
6701
6702         proto_tree_add_uint(subtree, hf_ansi_map_length, asn1->tvb,
6703             saved_offset + 1, 1, elem_len);
6704
6705         if (elem_len > 0)
6706         {
6707             proto_tree_add_text(subtree,
6708                 asn1->tvb, saved_offset + 2, elem_len,
6709                 "Element Value");
6710
6711             asn1->offset += elem_len;
6712         }
6713
6714         saved_offset += elem_len + 2;
6715     }
6716
6717     sprintf(add_string, " - (%u)", num_elems);
6718
6719     EXTRANEOUS_DATA_CHECK((len - (saved_offset - orig_offset)), 0);
6720 }
6721
6722 static void
6723 param_cdma2000_ho_ivk_ios(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6724 {
6725
6726     dissect_cdma2000_ios_data(asn1, tree, len, add_string);
6727 }
6728
6729 static void
6730 param_cdma2000_ho_rsp_ios(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6731 {
6732
6733     dissect_cdma2000_ios_data(asn1, tree, len, add_string);
6734 }
6735
6736 static void
6737 param_msid_usage(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6738 {
6739     gint32 value;
6740     guint saved_offset;
6741     gchar *str = NULL;
6742
6743     add_string = add_string;
6744     saved_offset = asn1->offset;
6745
6746     asn1_int32_value_decode(asn1, 1, &value);
6747
6748     other_decode_bitfield_value(bigbuf, value, 0xfc, 8);
6749     proto_tree_add_text(tree, asn1->tvb,
6750         saved_offset, asn1->offset - saved_offset,
6751         "%s :  Reserved",
6752         bigbuf);
6753
6754     switch (value & 0x03)
6755     {
6756     case 0: str = "Not used"; break;
6757     case 1: str = "MIN last used"; break;
6758     case 2: str = "IMSI last used"; break;
6759     case 3: str = "Reserved"; break;
6760     }
6761
6762     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
6763     proto_tree_add_text(tree, asn1->tvb,
6764         saved_offset, asn1->offset - saved_offset,
6765         "%s :  %s",
6766         bigbuf,
6767         str);
6768
6769     EXTRANEOUS_DATA_CHECK(len, 1);
6770 }
6771
6772 static void
6773 param_new_min_ext(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6774 {
6775     gint32 value;
6776     guint saved_offset;
6777     gchar *str = NULL;
6778
6779     EXACT_DATA_CHECK(len, 3);
6780
6781     add_string = add_string;
6782     saved_offset = asn1->offset;
6783
6784     asn1_int32_value_decode(asn1, 1, &value);
6785
6786     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
6787     proto_tree_add_text(tree, asn1->tvb,
6788         saved_offset, asn1->offset - saved_offset,
6789         "%s :  MCC_M (MSB), see CDMA",
6790         bigbuf);
6791
6792     other_decode_bitfield_value(bigbuf, value, 0x0e, 8);
6793     proto_tree_add_text(tree, asn1->tvb,
6794         saved_offset, asn1->offset - saved_offset,
6795         "%s :  IMSI_M_ADDR_NUM, see CDMA",
6796         bigbuf);
6797
6798     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
6799     proto_tree_add_text(tree, asn1->tvb,
6800         saved_offset, asn1->offset - saved_offset,
6801         "%s :  IMSI_M_CLASS, see CDMA",
6802         bigbuf);
6803
6804     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
6805     proto_tree_add_text(tree, asn1->tvb,
6806         saved_offset, asn1->offset - saved_offset,
6807         "%s :  %s",
6808         bigbuf,
6809         str);
6810
6811     bigbuf[0] = Dgt_tbcd.out[(value & 0xf0) >> 4];
6812
6813     saved_offset = asn1->offset;
6814
6815     asn1_int32_value_decode(asn1, 1, &value);
6816
6817     bigbuf[1] = Dgt_tbcd.out[value & 0x0f];
6818     bigbuf[2] = Dgt_tbcd.out[(value & 0xf0) >> 4];
6819     bigbuf[3] = '\0';
6820
6821     proto_tree_add_text(tree, asn1->tvb,
6822         saved_offset, asn1->offset - saved_offset,
6823         "MCC_M, %s, see CDMA",
6824         bigbuf);
6825
6826     saved_offset = asn1->offset;
6827
6828     asn1_int32_value_decode(asn1, 1, &value);
6829
6830     bigbuf[0] = Dgt_tbcd.out[value & 0x0f];
6831     bigbuf[1] = Dgt_tbcd.out[(value & 0xf0) >> 4];
6832     bigbuf[2] = '\0';
6833
6834     proto_tree_add_text(tree, asn1->tvb,
6835         saved_offset, asn1->offset - saved_offset,
6836         "IMSI_11_12, %s, see CDMA",
6837         bigbuf);
6838 }
6839
6840 static void
6841 param_dtx_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6842 {
6843     gint32 value;
6844     guint saved_offset;
6845     gchar *str = NULL;
6846
6847     add_string = add_string;
6848     saved_offset = asn1->offset;
6849
6850     asn1_int32_value_decode(asn1, 1, &value);
6851
6852     other_decode_bitfield_value(bigbuf, value, 0xfe, 8);
6853     proto_tree_add_text(tree, asn1->tvb,
6854         saved_offset, asn1->offset - saved_offset,
6855         "%s :  Reserved",
6856         bigbuf);
6857
6858     switch (value & 0x01)
6859     {
6860     case 0: str = "Discontinuous Transmission mode is not active"; break;
6861     case 1: str = "Discontinuous Transmission mode is active"; break;
6862     }
6863
6864     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
6865     proto_tree_add_text(tree, asn1->tvb,
6866         saved_offset, asn1->offset - saved_offset,
6867         "%s :  %s",
6868         bigbuf,
6869         str);
6870
6871     EXTRANEOUS_DATA_CHECK(len, 1);
6872 }
6873
6874 static void
6875 param_cdma_mob_cap(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6876 {
6877     gint32 value;
6878     guint saved_offset;
6879     gchar *str = NULL;
6880
6881     add_string = add_string;
6882     saved_offset = asn1->offset;
6883
6884     asn1_int32_value_decode(asn1, 1, &value);
6885
6886     other_decode_bitfield_value(bigbuf, value, 0xfe, 8);
6887     proto_tree_add_text(tree, asn1->tvb,
6888         saved_offset, asn1->offset - saved_offset,
6889         "%s :  Reserved",
6890         bigbuf);
6891
6892     switch (value & 0x01)
6893     {
6894     case 0: str = "No MS-initiated position determination"; break;
6895     case 1: str = "MS-initiated position determination"; break;
6896     }
6897
6898     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
6899     proto_tree_add_text(tree, asn1->tvb,
6900         saved_offset, asn1->offset - saved_offset,
6901         "%s :  %s",
6902         bigbuf,
6903         str);
6904
6905     EXTRANEOUS_DATA_CHECK(len, 1);
6906 }
6907
6908 static void
6909 param_gen_time(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6910 {
6911     gint32 value;
6912     gint32 h, m, s, ts;
6913     guint saved_offset;
6914
6915     SHORT_DATA_CHECK(len, 6);
6916
6917     add_string = add_string;
6918     saved_offset = asn1->offset;
6919
6920     asn1_int32_value_decode(asn1, 1, &value);
6921
6922     proto_tree_add_text(tree, asn1->tvb,
6923         saved_offset, asn1->offset - saved_offset,
6924         "Year-2000, %u",
6925         value);
6926
6927     saved_offset = asn1->offset;
6928
6929     asn1_int32_value_decode(asn1, 1, &value);
6930
6931     proto_tree_add_text(tree, asn1->tvb,
6932         saved_offset, asn1->offset - saved_offset,
6933         "Month, %u",
6934         value);
6935
6936     saved_offset = asn1->offset;
6937
6938     asn1_int32_value_decode(asn1, 1, &value);
6939
6940     proto_tree_add_text(tree, asn1->tvb,
6941         saved_offset, asn1->offset - saved_offset,
6942         "Day of month, %u",
6943         value);
6944
6945     saved_offset = asn1->offset;
6946
6947     asn1_int32_value_decode(asn1, 3, &value);
6948
6949     h = value / (3600 * 10);
6950     m = (value - (h * (3600 * 10))) / (60 * 10);
6951     s = (value - (h * (3600 * 10)) - (m * (60 * 10))) / 10;
6952     ts = (value - (h * (3600 * 10)) - (m * (60 * 10)) - (s * 10));
6953
6954     proto_tree_add_text(tree, asn1->tvb,
6955         saved_offset, asn1->offset - saved_offset,
6956         "Time of day (UTC) (in tenths of seconds - 1), %u (%u:%u:%u.%u)",
6957         value,
6958         h,
6959         m,
6960         s,
6961         ts);
6962
6963     EXTRANEOUS_DATA_CHECK(len, 6);
6964 }
6965
6966 static void
6967 param_geo_pos(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6968 {
6969     guint saved_offset;
6970
6971     add_string = add_string;
6972     saved_offset = asn1->offset;
6973
6974     proto_tree_add_text(tree, asn1->tvb,
6975         saved_offset, len,
6976         "Calling Geodetic Location (CGL), see T1.628 CallingGeodeticLocation TCAP parameter for encoding");
6977 }
6978
6979 static void
6980 param_mob_call_status(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6981 {
6982     gint32 value, auth;
6983     guint saved_offset;
6984     gchar *str = NULL;
6985
6986     add_string = add_string;
6987     saved_offset = asn1->offset;
6988
6989     asn1_int32_value_decode(asn1, 1, &value);
6990
6991     auth = (value & 0xf0) >> 4;
6992     switch (auth)
6993     {
6994     case 0: str = "Authorization not performed"; break;
6995     case 1: str = "Authorization successful"; break;
6996     case 2: str = "Invalid Electronic Serial Number (ESN)"; break;
6997     case 3: str = "Unassigned Directory Number (DN)"; break;
6998     case 4: str = "Duplicate Unit"; break;
6999     case 5: str = "Delinquent Account"; break;
7000     case 6: str = "Stolen Unit"; break;
7001     case 7: str = "Not authorized for MSC"; break;
7002     case 8: str = "Unspecified"; break;
7003     default:
7004         str = "Reserved, treat as Authorization not performed";
7005         break;
7006     }
7007
7008     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
7009     proto_tree_add_text(tree, asn1->tvb,
7010         saved_offset, asn1->offset - saved_offset,
7011         "%s :  Authorization, %s",
7012         bigbuf,
7013         str);
7014
7015     auth = value & 0x0f;
7016     switch (auth)
7017     {
7018     case 0: str = "Authentication not performed. Authentication has not yet occurred or the MS is not capable of authentication"; break;
7019     case 1: str = "Authentication successful. Authentication has successfully occurred on the MS"; break;
7020     case 2: str = "Authentication failure. An authentication failure has occurred on the MS"; break;
7021     default:
7022         str = "Reserved, treat as Authentication not performed";
7023         break;
7024     }
7025
7026     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
7027     proto_tree_add_text(tree, asn1->tvb,
7028         saved_offset, asn1->offset - saved_offset,
7029         "%s :  Authentication, %s",
7030         bigbuf,
7031         str);
7032
7033     EXTRANEOUS_DATA_CHECK(len, 1);
7034 }
7035
7036 static void
7037 param_pos_req_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7038 {
7039     gint32 value;
7040     guint saved_offset;
7041     gchar *str = NULL;
7042
7043     add_string = add_string;
7044     saved_offset = asn1->offset;
7045
7046     asn1_int32_value_decode(asn1, 1, &value);
7047
7048     switch (value)
7049     {
7050     case 0: str = "Not used"; break;
7051     case 1: str = "Initial position. Return updated position only if initial position is unavailable."; break;
7052     case 2: str = "Return the updated position"; break;
7053     case 3: str = "Return the updated or last known position"; break;
7054     case 4: str = "Reserved for LSP interface. Treat as Not used"; break;
7055     default:
7056         if ((value >= 5) && (value <= 95)) { str = "Reserved, treat as Initial position"; }
7057         else { str = "Reserved for protocol extension, treat as Initial position"; }
7058         break;
7059     }
7060
7061     proto_tree_add_text(tree, asn1->tvb,
7062         saved_offset, asn1->offset - saved_offset,
7063         "Position Request Type, %s",
7064         str);
7065
7066     EXTRANEOUS_DATA_CHECK(len, 1);
7067 }
7068
7069 static void
7070 param_pos_result(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7071 {
7072     gint32 value;
7073     guint saved_offset;
7074     gchar *str = NULL;
7075
7076     add_string = add_string;
7077     saved_offset = asn1->offset;
7078
7079     asn1_int32_value_decode(asn1, 1, &value);
7080
7081     switch (value)
7082     {
7083     case 0: str = "Not used"; break;
7084     case 1: str = "Initial position returned"; break;
7085     case 2: str = "Updated position returned"; break;
7086     case 3: str = "Last known position returned"; break;
7087     case 4: str = "Requested position is not available"; break;
7088     case 5: str = "Caller disconnected. No call in progress for caller identified"; break;
7089     case 6: str = "Caller has handed-off. Position is unavailable due to a hand-off (e.g. handoff to a position incapable system)"; break;
7090     case 7: str = "Identified MS is inactive or has roamed to another system"; break;
7091     case 8: str = "Unresponsive"; break;
7092     case 9: str = "Identified MS is responsive, but refused position request"; break;
7093     case 10: str = "System Failure"; break;
7094     case 11: str = "MSID is not known"; break;
7095     case 12: str = "Callback number is not known"; break;
7096     case 13: str = "Improper request (e.g. invalid channel information, invalid ESN)"; break;
7097     case 14: str = "Mobile channel information returned"; break;
7098     case 15: str = "Signal not detected"; break;
7099     case 16: str = "PDE Timeout"; break;
7100     case 17: str = "Position pending"; break;
7101     case 18: str = "TDMA MAHO Information Returned"; break;
7102     case 19: str = "TDMA MAHO Information is not available"; break;
7103     default:
7104         if ((value >= 20) && (value <= 223)) { str = "Reserved, treat as Not used"; }
7105         else { str = "Reserved for protocol extension, treat as Not used"; }
7106         break;
7107     }
7108
7109     proto_tree_add_text(tree, asn1->tvb,
7110         saved_offset, asn1->offset - saved_offset,
7111         "Position Result, %s",
7112         str);
7113
7114     EXTRANEOUS_DATA_CHECK(len, 1);
7115 }
7116
7117 static void
7118 param_pos_source(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7119 {
7120     gint32 value;
7121     guint saved_offset;
7122     gchar *str = NULL;
7123
7124     add_string = add_string;
7125     saved_offset = asn1->offset;
7126
7127     asn1_int32_value_decode(asn1, 1, &value);
7128
7129     switch (value)
7130     {
7131     case 0: str = "Not used"; break;
7132     case 1: str = "Network Unspecified"; break;
7133     case 2: str = "Network AOA (Angle of Arrival)"; break;
7134     case 3: str = "Network TOA (Time of Arrival)"; break;
7135     case 4: str = "Network TDOA (Time Difference of Arrival)"; break;
7136     case 5: str = "Network RF Fingerprinting"; break;
7137     case 6: str = "Network Cell/Sector"; break;
7138     case 7: str = "Network Cell/Sector with Timing"; break;
7139     case 16: str = "Handset Unspecified"; break;
7140     case 17: str = "Handset GPS"; break;
7141     case 18: str = "Handset AGPS (Assisted GPS)"; break;
7142     case 19: str = "Handset EOTD (Enhanced Observed Time Difference)"; break;
7143     case 20: str = "Handset AFLT (Advanced Forward Link Trilateration)"; break;
7144     case 21: str = "Handset EFLT (Enhanced Forward Link Trilateration)"; break;
7145     default:
7146         if ((value >= 8) && (value <= 15)) { str = "Reserved, treat as Network Unspecified"; }
7147         else if ((value >= 22) && (value <= 31)) { str = "Reserved, treat as Handset Unspecified"; }
7148         else { str = "Reserved for protocol extension, treat as Not used"; }
7149         break;
7150     }
7151
7152     proto_tree_add_text(tree, asn1->tvb,
7153         saved_offset, asn1->offset - saved_offset,
7154         "Position Source, %s",
7155         str);
7156
7157     EXTRANEOUS_DATA_CHECK(len, 1);
7158 }
7159
7160 static void
7161 param_acg_encounter(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7162 {
7163     gint32 value;
7164     guint saved_offset;
7165     gchar *str = NULL;
7166
7167     EXACT_DATA_CHECK(len, 1);
7168
7169     add_string = add_string;
7170     saved_offset = asn1->offset;
7171
7172     asn1_int32_value_decode(asn1, 1, &value);
7173
7174     switch ((value & 0xc0) >> 6)
7175     {
7176     case 0: str = "Not used"; break;
7177     case 1: str = "Service Management System Initiated control encountered"; break;
7178     case 2: str = "SCF Overload control encountered"; break;
7179     case 3: str = "Reserved, treat as Not used"; break;
7180     }
7181
7182     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
7183     proto_tree_add_text(tree, asn1->tvb,
7184         saved_offset, asn1->offset - saved_offset,
7185         "%s :  Control Type, %s",
7186         bigbuf,
7187         str);
7188
7189     switch (value & 0x3f)
7190     {
7191     case 0: str = "PC_SSN"; break;
7192     case 1: str = "1-digit control"; break;
7193     case 2: str = "2-digit control"; break;
7194     case 3: str = "3-digit control"; break;
7195     case 4: str = "4-digit control"; break;
7196     case 5: str = "5-digit control"; break;
7197     case 6: str = "6-digit control"; break;
7198     case 7: str = "7-digit control"; break;
7199     case 8: str = "8-digit control"; break;
7200     case 9: str = "9-digit control"; break;
7201     case 10: str = "10-digit control"; break;
7202     case 11: str = "11-digit control"; break;
7203     case 12: str = "12-digit control"; break;
7204     case 13: str = "13-digit control"; break;
7205     case 14: str = "14-digit control"; break;
7206     case 15: str = "15-digit control"; break;
7207     default:
7208         str = "Reserved, treat as 15-digit control";
7209         break;
7210     }
7211
7212     other_decode_bitfield_value(bigbuf, value, 0x3f, 8);
7213     proto_tree_add_text(tree, asn1->tvb,
7214         saved_offset, asn1->offset - saved_offset,
7215         "%s :  %s",
7216         bigbuf,
7217         str);
7218 }
7219
7220 static void
7221 param_ctrl_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7222 {
7223     gint32 value;
7224     guint saved_offset;
7225     gchar *str = NULL;
7226
7227     EXACT_DATA_CHECK(len, 1);
7228
7229     add_string = add_string;
7230     saved_offset = asn1->offset;
7231
7232     asn1_int32_value_decode(asn1, 1, &value);
7233
7234     switch ((value & 0xc0) >> 6)
7235     {
7236     case 0: str = "Not used"; break;
7237     case 1: str = "Service Management System Initiated control"; break;
7238     case 2: str = "SCF Overload control"; break;
7239     case 3: str = "Reserved, treat as Not used"; break;
7240     }
7241
7242     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
7243     proto_tree_add_text(tree, asn1->tvb,
7244         saved_offset, asn1->offset - saved_offset,
7245         "%s :  Control Type, %s",
7246         bigbuf,
7247         str);
7248
7249     switch (value & 0x3f)
7250     {
7251     case 0: str = "PC_SSN"; break;
7252     case 1: str = "1-digit control"; break;
7253     case 2: str = "2-digit control"; break;
7254     case 3: str = "3-digit control"; break;
7255     case 4: str = "4-digit control"; break;
7256     case 5: str = "5-digit control"; break;
7257     case 6: str = "6-digit control"; break;
7258     case 7: str = "7-digit control"; break;
7259     case 8: str = "8-digit control"; break;
7260     case 9: str = "9-digit control"; break;
7261     case 10: str = "10-digit control"; break;
7262     case 11: str = "11-digit control"; break;
7263     case 12: str = "12-digit control"; break;
7264     case 13: str = "13-digit control"; break;
7265     case 14: str = "14-digit control"; break;
7266     case 15: str = "15-digit control"; break;
7267     default:
7268         str = "Reserved, treat as 15-digit control";
7269         break;
7270     }
7271
7272     other_decode_bitfield_value(bigbuf, value, 0x3f, 8);
7273     proto_tree_add_text(tree, asn1->tvb,
7274         saved_offset, asn1->offset - saved_offset,
7275         "%s :  %s",
7276         bigbuf,
7277         str);
7278 }
7279
7280 static void
7281 param_gap_duration(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7282 {
7283     gint32 value;
7284     guint saved_offset;
7285     gchar *str = NULL;
7286
7287     EXACT_DATA_CHECK(len, 1);
7288
7289     add_string = add_string;
7290     saved_offset = asn1->offset;
7291
7292     asn1_int32_value_decode(asn1, 1, &value);
7293
7294     switch (value)
7295     {
7296     case 0: str = "Not used"; break;
7297     case 1: str = "1 second"; break;
7298     case 2: str = "2 seconds"; break;
7299     case 3: str = "4 seconds"; break;
7300     case 4: str = "8 seconds"; break;
7301     case 5: str = "16 seconds"; break;
7302     case 6: str = "32 seconds"; break;
7303     case 7: str = "64 seconds"; break;
7304     case 8: str = "128 seconds"; break;
7305     case 9: str = "256 seconds"; break;
7306     case 10: str = "512 seconds"; break;
7307     case 11: str = "1024 seconds"; break;
7308     case 12: str = "2048 seconds"; break;
7309     case 13: str = "Infinity"; break;
7310     default:
7311         str = "Reserved, treat as Not used";
7312         break;
7313     }
7314
7315     proto_tree_add_text(tree, asn1->tvb,
7316         saved_offset, asn1->offset - saved_offset,
7317         str);
7318 }
7319
7320 static void
7321 param_scf_overload_gap_int(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7322 {
7323     gint32 value;
7324     guint saved_offset;
7325     gchar *str = NULL;
7326
7327     EXACT_DATA_CHECK(len, 1);
7328
7329     add_string = add_string;
7330     saved_offset = asn1->offset;
7331
7332     asn1_int32_value_decode(asn1, 1, &value);
7333
7334     switch (value)
7335     {
7336     case 0: str = "0 seconds"; break;
7337     case 1: str = "3 seconds"; break;
7338     case 2: str = "4 seconds"; break;
7339     case 3: str = "6 seconds"; break;
7340     case 4: str = "8 seconds"; break;
7341     case 5: str = "11 seconds"; break;
7342     case 6: str = "16 seconds"; break;
7343     case 7: str = "22 seconds"; break;
7344     case 8: str = "30 seconds"; break;
7345     case 9: str = "42 seconds"; break;
7346     case 10: str = "58 seconds"; break;
7347     case 11: str = "81 seconds"; break;
7348     case 12: str = "112 seconds"; break;
7349     case 13: str = "156 seconds"; break;
7350     case 14: str = "217 seconds"; break;
7351     case 15: str = "300 seconds"; break;
7352     case 16: str = "Remove gap control"; break;
7353     case 17: str = "0.10 seconds"; break;
7354     case 18: str = "0.25 seconds"; break;
7355     case 19: str = "0.5 seconds"; break;
7356     case 20: str = "1 second"; break;
7357     case 21: str = "2 seconds"; break;
7358     default:
7359         str = "Reserved, treat as 0 seconds";
7360         break;
7361     }
7362
7363     proto_tree_add_text(tree, asn1->tvb,
7364         saved_offset, asn1->offset - saved_offset,
7365         str);
7366 }
7367
7368 static void
7369 param_tdma_time_align(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7370 {
7371     gint32 value;
7372     guint saved_offset;
7373
7374     add_string = add_string;
7375     saved_offset = asn1->offset;
7376
7377     asn1_int32_value_decode(asn1, 1, &value);
7378
7379     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
7380     proto_tree_add_text(tree, asn1->tvb,
7381         saved_offset, asn1->offset - saved_offset,
7382         "%s :  Reserved",
7383         bigbuf);
7384
7385
7386     other_decode_bitfield_value(bigbuf, value, 0x1f, 8);
7387     proto_tree_add_text(tree, asn1->tvb,
7388         saved_offset, asn1->offset - saved_offset,
7389         "%s :  Time Alignment Offset (TA), %u",
7390         bigbuf,
7391         value & 0x1f);
7392
7393     EXTRANEOUS_DATA_CHECK(len, 1);
7394 }
7395
7396 static void
7397 dump_rssi(ASN1_SCK *asn1, proto_tree *tree, gchar *leader)
7398 {
7399     gint32 value;
7400     guint saved_offset;
7401     gchar *str = NULL;
7402
7403     saved_offset = asn1->offset;
7404
7405     asn1_int32_value_decode(asn1, 1, &value);
7406
7407     switch ((value & 0xc0) >> 6)
7408     {
7409     case 0: str = "800 MHz"; break;
7410     case 1: str = "1900 MHz"; break;
7411     default:
7412         str = "Reserved";
7413         break;
7414     }
7415
7416     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
7417     proto_tree_add_text(tree, asn1->tvb,
7418         saved_offset, asn1->offset - saved_offset,
7419         "%s :  %sHyper, %s",
7420         bigbuf,
7421         leader,
7422         str);
7423
7424     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
7425     proto_tree_add_text(tree, asn1->tvb,
7426         saved_offset, asn1->offset - saved_offset,
7427         "%s :  Reserved",
7428         bigbuf);
7429
7430     other_decode_bitfield_value(bigbuf, value, 0x1f, 8);
7431     proto_tree_add_text(tree, asn1->tvb,
7432         saved_offset, asn1->offset - saved_offset,
7433         "%s :  %sRSSI, %u",
7434         bigbuf,
7435         leader,
7436         value & 0x1f);
7437 }
7438
7439 static void
7440 param_tdma_maho_cell_id(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7441 {
7442     gint32 value, num_rssi, num_msc;
7443     guint saved_offset, orig_offset;
7444     gint32 i, j;
7445
7446     SHORT_DATA_CHECK(len, 3);
7447
7448     orig_offset = asn1->offset;
7449
7450     dump_rssi(asn1, tree, "Serving Cell ");
7451
7452     saved_offset = asn1->offset;
7453
7454     asn1_int32_value_decode(asn1, 1, &num_rssi);
7455
7456     proto_tree_add_text(tree, asn1->tvb,
7457         saved_offset, asn1->offset - saved_offset,
7458         "Number of RSSI %u",
7459         num_rssi);
7460
7461     for (i = 0; i < num_rssi; i++)
7462     {
7463         if ((len - (asn1->offset - orig_offset)) < 3)
7464         {
7465             proto_tree_add_text(tree, asn1->tvb,
7466                 asn1->offset, len - (asn1->offset - orig_offset),
7467                 "Short Data (?)");
7468
7469             asn1->offset += len - (asn1->offset - orig_offset);
7470             return;
7471         }
7472
7473         dump_rssi(asn1, tree, "");
7474
7475         saved_offset = asn1->offset;
7476
7477         asn1_int32_value_decode(asn1, 2, &value);
7478
7479         proto_tree_add_text(tree, asn1->tvb,
7480             saved_offset, asn1->offset - saved_offset,
7481             "Measured Cell ID %u",
7482             value);
7483     }
7484
7485     saved_offset = asn1->offset;
7486
7487     asn1_int32_value_decode(asn1, 1, &num_msc);
7488
7489     proto_tree_add_text(tree, asn1->tvb,
7490         saved_offset, asn1->offset - saved_offset,
7491         "Number of MSC %u",
7492         num_msc);
7493
7494     for (i = 0; i < num_msc; i++)
7495     {
7496         if ((len - (asn1->offset - orig_offset)) < 4)
7497         {
7498             proto_tree_add_text(tree, asn1->tvb,
7499                 asn1->offset, len - (asn1->offset - orig_offset),
7500                 "Short Data (?)");
7501
7502             asn1->offset += len - (asn1->offset - orig_offset);
7503             return;
7504         }
7505
7506         param_mscid(asn1, tree, 3, add_string);
7507
7508         saved_offset = asn1->offset;
7509
7510         asn1_int32_value_decode(asn1, 1, &num_rssi);
7511
7512         proto_tree_add_text(tree, asn1->tvb,
7513             saved_offset, asn1->offset - saved_offset,
7514             "Number of RSSI %u",
7515             num_rssi);
7516
7517         for (j = 0; j < num_rssi; j++)
7518         {
7519             if ((len - (asn1->offset - orig_offset)) < 3)
7520             {
7521                 proto_tree_add_text(tree, asn1->tvb,
7522                     asn1->offset, len - (asn1->offset - orig_offset),
7523                     "Short Data (?)");
7524
7525                 asn1->offset += len - (asn1->offset - orig_offset);
7526                 return;
7527             }
7528
7529             dump_rssi(asn1, tree, "");
7530
7531             saved_offset = asn1->offset;
7532
7533             asn1_int32_value_decode(asn1, 2, &value);
7534
7535             proto_tree_add_text(tree, asn1->tvb,
7536                 saved_offset, asn1->offset - saved_offset,
7537                 "Measured Cell ID %u",
7538                 value);
7539         }
7540     }
7541
7542     EXTRANEOUS_DATA_CHECK((len - (asn1->offset - orig_offset)), 0);
7543 }
7544
7545 static void
7546 param_tdma_maho_chan(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7547 {
7548     gint32 value, num_rssi, num_msc;
7549     guint saved_offset, orig_offset;
7550     gint32 i, j;
7551
7552     SHORT_DATA_CHECK(len, 3);
7553
7554     orig_offset = asn1->offset;
7555
7556     dump_rssi(asn1, tree, "Serving Cell ");
7557
7558     saved_offset = asn1->offset;
7559
7560     asn1_int32_value_decode(asn1, 1, &num_rssi);
7561
7562     proto_tree_add_text(tree, asn1->tvb,
7563         saved_offset, asn1->offset - saved_offset,
7564         "Number of RSSI %u",
7565         num_rssi);
7566
7567     for (i = 0; i < num_rssi; i++)
7568     {
7569         if ((len - (asn1->offset - orig_offset)) < 3)
7570         {
7571             proto_tree_add_text(tree, asn1->tvb,
7572                 asn1->offset, len - (asn1->offset - orig_offset),
7573                 "Short Data (?)");
7574
7575             asn1->offset += len - (asn1->offset - orig_offset);
7576             return;
7577         }
7578
7579         dump_rssi(asn1, tree, "");
7580
7581         saved_offset = asn1->offset;
7582
7583         asn1_int32_value_decode(asn1, 2, &value);
7584
7585         other_decode_bitfield_value(bigbuf, value >> 8, 0xff, 8);
7586         proto_tree_add_text(tree, asn1->tvb,
7587             saved_offset, 1,
7588             "%s :  Measured Channel (MSB), %u",
7589             bigbuf,
7590             (value & 0xffe0) >> 5);
7591
7592         other_decode_bitfield_value(bigbuf, value & 0xff, 0xe0, 8);
7593         proto_tree_add_text(tree, asn1->tvb,
7594             saved_offset+1, 1,
7595             "%s :  Measured Channel (LSB)",
7596             bigbuf);
7597     }
7598
7599     saved_offset = asn1->offset;
7600
7601     asn1_int32_value_decode(asn1, 1, &num_msc);
7602
7603     proto_tree_add_text(tree, asn1->tvb,
7604         saved_offset, asn1->offset - saved_offset,
7605         "Number of MSC %u",
7606         num_msc);
7607
7608     for (i = 0; i < num_msc; i++)
7609     {
7610         if ((len - (asn1->offset - orig_offset)) < 4)
7611         {
7612             proto_tree_add_text(tree, asn1->tvb,
7613                 asn1->offset, len - (asn1->offset - orig_offset),
7614                 "Short Data (?)");
7615
7616             asn1->offset += len - (asn1->offset - orig_offset);
7617             return;
7618         }
7619
7620         param_mscid(asn1, tree, 3, add_string);
7621
7622         saved_offset = asn1->offset;
7623
7624         asn1_int32_value_decode(asn1, 1, &num_rssi);
7625
7626         proto_tree_add_text(tree, asn1->tvb,
7627             saved_offset, asn1->offset - saved_offset,
7628             "Number of RSSI %u",
7629             num_rssi);
7630
7631         for (j = 0; j < num_rssi; j++)
7632         {
7633             if ((len - (asn1->offset - orig_offset)) < 3)
7634             {
7635                 proto_tree_add_text(tree, asn1->tvb,
7636                     asn1->offset, len - (asn1->offset - orig_offset),
7637                     "Short Data (?)");
7638
7639                 asn1->offset += len - (asn1->offset - orig_offset);
7640                 return;
7641             }
7642
7643             dump_rssi(asn1, tree, "");
7644
7645             saved_offset = asn1->offset;
7646
7647             asn1_int32_value_decode(asn1, 2, &value);
7648
7649             other_decode_bitfield_value(bigbuf, value >> 8, 0xff, 8);
7650             proto_tree_add_text(tree, asn1->tvb,
7651                 saved_offset, 1,
7652                 "%s :  Measured Channel (MSB), %u",
7653                 bigbuf,
7654                 (value & 0xffe0) >> 5);
7655
7656             other_decode_bitfield_value(bigbuf, value & 0xff, 0xe0, 8);
7657             proto_tree_add_text(tree, asn1->tvb,
7658                 saved_offset+1, 1,
7659                 "%s :  Measured Channel (LSB)",
7660                 bigbuf);
7661         }
7662     }
7663
7664     EXTRANEOUS_DATA_CHECK((len - (asn1->offset - orig_offset)), 0);
7665 }
7666
7667 static void
7668 param_tdma_maho_req(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7669 {
7670     gint32 value;
7671     guint saved_offset;
7672     gchar *str = NULL;
7673
7674     EXACT_DATA_CHECK(len, 1);
7675
7676     add_string = add_string;
7677     saved_offset = asn1->offset;
7678
7679     asn1_int32_value_decode(asn1, 1, &value);
7680
7681     switch (value)
7682     {
7683     case 0: str = "No MAHO information requested"; break;
7684     case 1: str = "MAHO information requested"; break;
7685     default:
7686         str = "Reserved, treat as No MAHO information requested";
7687         break;
7688     }
7689
7690     proto_tree_add_text(tree, asn1->tvb,
7691         saved_offset, asn1->offset - saved_offset,
7692         str);
7693 }
7694
7695 static void
7696 param_sm_gap_int(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7697 {
7698     gint32 value;
7699     guint saved_offset;
7700     gchar *str = NULL;
7701
7702     EXACT_DATA_CHECK(len, 1);
7703
7704     add_string = add_string;
7705     saved_offset = asn1->offset;
7706
7707     asn1_int32_value_decode(asn1, 1, &value);
7708
7709     switch (value)
7710     {
7711     case 0: str = "Remove gap control"; break;
7712     case 1: str = "0 seconds"; break;
7713     case 2: str = "0.10 seconds"; break;
7714     case 3: str = "0.25 seconds"; break;
7715     case 4: str = "0.50 seconds"; break;
7716     case 5: str = "1 second"; break;
7717     case 6: str = "2 seconds"; break;
7718     case 7: str = "5 seconds"; break;
7719     case 8: str = "10 seconds"; break;
7720     case 9: str = "15 seconds"; break;
7721     case 10: str = "30 seconds"; break;
7722     case 11: str = "60 seconds"; break;
7723     case 12: str = "120 seconds"; break;
7724     case 13: str = "300 seconds"; break;
7725     case 14: str = "600 seconds"; break;
7726     case 15: str = "Stop all queries"; break;
7727     default:
7728         str = "Reserved, treat as Remove gap control";
7729         break;
7730     }
7731
7732     proto_tree_add_text(tree, asn1->tvb,
7733         saved_offset, asn1->offset - saved_offset,
7734         str);
7735 }
7736
7737 static void
7738 param_mob_cap(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7739 {
7740     gint32 value;
7741     guint saved_offset, i;
7742     gchar *str = NULL;
7743
7744     add_string = add_string;
7745
7746     for (i=0; i < len; i++)
7747     {
7748         saved_offset = asn1->offset;
7749
7750         asn1_int32_value_decode(asn1, 1, &value);
7751
7752         switch (value)
7753         {
7754         case 0: str = "Undefined Mobile Position Capabilities"; break;
7755         case 1: str = "CDMA None"; break;
7756         case 2: str = "CDMA Pilot Phase + GPS - MS shall be capable of supporting A-FLT and GPS for position determination"; break;
7757         case 3: str = "CDMA Pilot Phase Only - MS shall be capable of supporting A-FLT only for position determination"; break;
7758         case 4: str = "CDMA GPS Only - MS shall be capable of supporting GPS only for position determination"; break;
7759         case 51: str = "TDMA None. See TIA/EIA-136-740"; break;
7760         case 52: str = "TDMA MS-Based with Network Assistance SAMPS Supported. See TIA/EIA-136-740"; break;
7761         case 53: str = "TDMA MS-Assisted SAMPS Supported. See TIA/EIA-136-740"; break;
7762         case 54: str = "TDMA SAMPS Time Measurement Capability Supported. See TIA/EIA-136-740"; break;
7763         case 55: str = "TDMA MS-Based Stand-alone SAMPS Supported. See TIA/EIA-136-740"; break;
7764         case 101: str = "AMPS None"; break;
7765         case 102: str = "AMPS MS-based - MS shall be capable of autonomously determining the position without assistance from the network"; break;
7766         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;
7767         default:
7768             if ((value >= 5) && (value <= 50)) { str = "Reserved for CDMA, treat as CDMA None"; }
7769             else if ((value >= 56) && (value <= 100)) { str = "Reserved for TDMA, treat as TDMA None"; }
7770             else if ((value >= 104) && (value <= 150)) { str = "Reserved for AMPS, treat as AMPS None"; }
7771             else if ((value >= 151) && (value <= 223)) { str = "Reserved, treat as Undefined"; }
7772             else { str = "Reserved for protocol extension, treat as Undefined"; }
7773             break;
7774         }
7775
7776         proto_tree_add_text(tree, asn1->tvb,
7777             saved_offset, asn1->offset - saved_offset,
7778             "Mobile Position Capability, %s",
7779             str);
7780     }
7781 }
7782
7783 static void
7784 param_cdma_psmm_count(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7785 {
7786     gint32 value;
7787     guint saved_offset;
7788
7789     EXACT_DATA_CHECK(len, 1);
7790
7791     add_string = add_string;
7792     saved_offset = asn1->offset;
7793
7794     asn1_int32_value_decode(asn1, 1, &value);
7795
7796     proto_tree_add_text(tree, asn1->tvb,
7797         saved_offset, asn1->offset - saved_offset,
7798         "Number of CDMA Pilot Strength Measurements to return, %u",
7799         value);
7800 }
7801
7802 static void
7803 param_cdma_sowd2(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7804 {
7805     gint32 value;
7806     guint saved_offset;
7807     gchar *str = NULL;
7808
7809     SHORT_DATA_CHECK(len, 5);
7810
7811     add_string = add_string;
7812     saved_offset = asn1->offset;
7813
7814     asn1_int32_value_decode(asn1, 2, &value);
7815
7816     proto_tree_add_text(tree, asn1->tvb,
7817         saved_offset, asn1->offset - saved_offset,
7818         "CDMA Serving One Way Delay, %u",
7819         value);
7820
7821     saved_offset = asn1->offset;
7822
7823     asn1_int32_value_decode(asn1, 1, &value);
7824
7825     other_decode_bitfield_value(bigbuf, value, 0xfc, 8);
7826     proto_tree_add_text(tree, asn1->tvb,
7827         saved_offset, asn1->offset - saved_offset,
7828         "%s :  Reserved",
7829         bigbuf);
7830
7831     switch (value & 0x03)
7832     {
7833     case 0: str = "100 nsec"; break;
7834     case 1: str = "50 nsec"; break;
7835     case 2: str = "1/16 CDMA PN Chip"; break;
7836     case 3: str = "Reserved"; break;
7837     }
7838
7839     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
7840     proto_tree_add_text(tree, asn1->tvb,
7841         saved_offset, asn1->offset - saved_offset,
7842         "%s :  Resolution, %s",
7843         bigbuf,
7844         str);
7845
7846     saved_offset = asn1->offset;
7847
7848     asn1_int32_value_decode(asn1, 2, &value);
7849
7850     proto_tree_add_text(tree, asn1->tvb,
7851         saved_offset, asn1->offset - saved_offset,
7852         "Serving One Way Delay TimeStamp, %u",
7853         value);
7854
7855     EXTRANEOUS_DATA_CHECK(len, 5);
7856 }
7857
7858 static void
7859 param_sms_charge_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7860 {
7861     gint32 value;
7862     guint saved_offset;
7863     gchar *str = NULL;
7864
7865     add_string = add_string;
7866     saved_offset = asn1->offset;
7867
7868     asn1_int32_value_decode(asn1, 1, &value);
7869
7870     switch (value)
7871     {
7872     case 0: str = "Not used"; break;
7873     case 1: str = "No charge"; break;
7874     case 2: str = "Charge original originator"; break;
7875     case 3: str = "Charge original destination"; break;
7876     default:
7877         str = "Reserved";
7878         break;
7879     }
7880
7881     proto_tree_add_text(tree, asn1->tvb,
7882         saved_offset, asn1->offset - saved_offset,
7883         "Charge %u, %s",
7884         value,
7885         str);
7886
7887     EXTRANEOUS_DATA_CHECK(len, 1);
7888 }
7889
7890 static void
7891 param_auth_per(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7892 {
7893     gint32 value;
7894     guint saved_offset;
7895     gchar *str = NULL;
7896
7897     EXACT_DATA_CHECK(len, 2);
7898
7899     add_string = add_string;
7900     saved_offset = asn1->offset;
7901
7902     asn1_int32_value_decode(asn1, 1, &value);
7903
7904     switch (value)
7905     {
7906     case 0: str = "Not used"; break;
7907     case 1: str = "Per call"; break;
7908     case 2: str = "Hours"; break;
7909     case 3: str = "Days"; break;
7910     case 4: str = "Weeks"; break;
7911     case 5: str = "Per agreement"; break;
7912     case 6: str = "Indefinite"; break;
7913     case 7: str = "Number of calls"; break;
7914     default:
7915         if ((value >= 8) && (value <= 223)) { str = "Reserved, treat as Per call"; }
7916         else { str = "Reserved for protocol extension, treat as Per call"; }
7917         break;
7918     }
7919
7920     proto_tree_add_text(tree, asn1->tvb,
7921         saved_offset, asn1->offset - saved_offset,
7922         "Period (%u) %s",
7923         value,
7924         str);
7925
7926     saved_offset = asn1->offset;
7927
7928     asn1_int32_value_decode(asn1, 1, &value);
7929
7930     proto_tree_add_text(tree, asn1->tvb,
7931         saved_offset, asn1->offset - saved_offset,
7932         "Value %u",
7933         value);
7934 }
7935
7936 static void
7937 param_ctrl_chan_mode(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7938 {
7939     gint32 value;
7940     guint saved_offset;
7941     gchar *str = NULL;
7942
7943     add_string = add_string;
7944     saved_offset = asn1->offset;
7945
7946     asn1_int32_value_decode(asn1, 1, &value);
7947
7948     switch (value)
7949     {
7950     case 0: str = "Unknown"; break;
7951     case 1: str = "MS is in Analog CC Mode"; break;
7952     case 2: str = "MS is in Digital CC Mode"; break;
7953     case 3: str = "MS is in NAMPS CC Mode"; break;
7954     default:
7955         if ((value >= 4) && (value <= 223)) { str = "Reserved, treat as Unknown"; }
7956         else { str = "Reserved for protocol extension, treat as Unknown"; }
7957         break;
7958     }
7959
7960     proto_tree_add_text(tree, asn1->tvb,
7961         saved_offset, asn1->offset - saved_offset,
7962         str);
7963
7964     EXTRANEOUS_DATA_CHECK(len, 1);
7965 }
7966
7967 static void
7968 param_tdma_data_mode(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7969 {
7970     gint32 value;
7971     guint saved_offset;
7972     gchar *str = NULL;
7973
7974     SHORT_DATA_CHECK(len, 2);
7975
7976     add_string = add_string;
7977     saved_offset = asn1->offset;
7978
7979     asn1_int32_value_decode(asn1, 1, &value);
7980
7981     switch ((value & 0xe0) >> 5)
7982     {
7983     case 0: str = "As per IS-135"; break;
7984     case 1: str = "As per FSVS - 211 (STU-III)"; break;
7985     default:
7986         str = "Reserved";
7987         break;
7988     }
7989
7990     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
7991     proto_tree_add_text(tree, asn1->tvb,
7992         saved_offset, asn1->offset - saved_offset,
7993         "%s :  Data Part, %s",
7994         bigbuf,
7995         str);
7996
7997     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
7998     proto_tree_add_text(tree, asn1->tvb,
7999         saved_offset, asn1->offset - saved_offset,
8000         "%s :  AD, %s",
8001         bigbuf,
8002         (value & 0x10) ? "unacknowledged data only" : "unacked data or both");
8003
8004     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
8005     proto_tree_add_text(tree, asn1->tvb,
8006         saved_offset, asn1->offset - saved_offset,
8007         "%s :  %s",
8008         bigbuf,
8009         (value & 0x08) ? "SAP 0 and 1" : "SAP 0 only");
8010
8011     switch (value & 0x07)
8012     {
8013     case 0: str = "No Data Privacy"; break;
8014     case 1: str = "Data Privacy Algorithm A"; break;
8015     default:
8016         str = "Reserved, treat as No Data Privacy";
8017         break;
8018     }
8019
8020     other_decode_bitfield_value(bigbuf, value, 0x07, 8);
8021     proto_tree_add_text(tree, asn1->tvb,
8022         saved_offset, asn1->offset - saved_offset,
8023         "%s :  Data Privacy Mode, %s",
8024         bigbuf,
8025         str);
8026
8027     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
8028     proto_tree_add_text(tree, asn1->tvb,
8029         saved_offset, asn1->offset - saved_offset,
8030         "%s :  Reserved",
8031         bigbuf);
8032
8033     switch ((value & 0x0c) >> 2)
8034     {
8035     case 0: str = "RLP1"; break;
8036     case 1: str = "RLP2"; break;
8037     default:
8038         str = "Reserved";
8039         break;
8040     }
8041
8042     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
8043     proto_tree_add_text(tree, asn1->tvb,
8044         saved_offset, asn1->offset - saved_offset,
8045         "%s :  %s",
8046         bigbuf,
8047         str);
8048
8049     switch (value & 0x03)
8050     {
8051     case 0: str = "16-bit Cyclic Redundancy Check"; break;
8052     case 1: str = "24-bit Cyclic Redundancy Check"; break;
8053     case 2: str = "No Cyclic Redundancy Check"; break;
8054     default:
8055         str = "Reserved";
8056         break;
8057     }
8058
8059     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
8060     proto_tree_add_text(tree, asn1->tvb,
8061         saved_offset, asn1->offset - saved_offset,
8062         "%s :  %s",
8063         bigbuf,
8064         str);
8065
8066     EXTRANEOUS_DATA_CHECK(len, 2);
8067 }
8068
8069 static void
8070 param_tdma_voice_mode(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8071 {
8072     gint32 value;
8073     guint saved_offset;
8074     gchar *str = NULL;
8075
8076     add_string = add_string;
8077     saved_offset = asn1->offset;
8078
8079     asn1_int32_value_decode(asn1, 1, &value);
8080
8081     switch ((value & 0xf0) >> 4)
8082     {
8083     case 0: str = "No Voice Privacy"; break;
8084     case 1: str = "Voice Privacy Algorithm A"; break;
8085     case 2: str = "Reserved, treat as No Voice Privacy"; break;
8086     case 3: str = "Reserved, treat as No Voice Privacy"; break;
8087     case 4: str = "Reserved for SOC/BMSC Specific signaling"; break;
8088     default:
8089         str = "Reserved, treat as No Voice Privacy";
8090         break;
8091     }
8092
8093     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
8094     proto_tree_add_text(tree, asn1->tvb,
8095         saved_offset, asn1->offset - saved_offset,
8096         "%s :  Voice Privacy Mode, %s",
8097         bigbuf,
8098         str);
8099
8100     switch (value & 0x0f)
8101     {
8102     case 0: str = "No Voice Coder"; break;
8103     case 1: str = "VSELP Voice Coder"; break;
8104     case 2: str = "IS-641 Voice Coder"; break;
8105     case 6: str = "Reserved for SOC/BMSC Specific signaling"; break;
8106     default:
8107         str = "Reserved, treat as No Voice Coder";
8108         break;
8109     }
8110
8111     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
8112     proto_tree_add_text(tree, asn1->tvb,
8113         saved_offset, asn1->offset - saved_offset,
8114         "%s :  Voice Coder, %s",
8115         bigbuf,
8116         str);
8117
8118     EXTRANEOUS_DATA_CHECK(len, 1);
8119 }
8120
8121 static void
8122 param_tdma_bandwidth(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8123 {
8124     gint32 value;
8125     guint saved_offset;
8126     gchar *str = NULL;
8127
8128     add_string = add_string;
8129     saved_offset = asn1->offset;
8130
8131     asn1_int32_value_decode(asn1, 1, &value);
8132
8133     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
8134     proto_tree_add_text(tree, asn1->tvb,
8135         saved_offset, asn1->offset - saved_offset,
8136         "%s :  Reserved",
8137         bigbuf);
8138
8139     switch (value & 0x0f)
8140     {
8141     case 0: str = "Half-Rate Digital Traffic Channel Only"; break;
8142     case 1: str = "Full-Rate Digital Traffic Channel Only"; break;
8143     case 2: str = "Half-Rate or Full-rate Digital Traffic Channel - Full-Rate Preferred"; break;
8144     case 3: str = "Half-rate or Full-rate Digital Traffic Channel - Half-rate Preferred"; break;
8145     case 4: str = "Double Full-Rate Digital Traffic Channel Only"; break;
8146     case 5: str = "Triple Full-Rate Digital Traffic Channel Only"; break;
8147     default:
8148         str = "Reserved, treat as Full-Rate Digital Traffic Channel Only";
8149         break;
8150     }
8151
8152     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
8153     proto_tree_add_text(tree, asn1->tvb,
8154         saved_offset, asn1->offset - saved_offset,
8155         "%s :  Bandwidth, %s",
8156         bigbuf,
8157         str);
8158
8159     EXTRANEOUS_DATA_CHECK(len, 1);
8160 }
8161
8162 static void
8163 param_change_srvc_attr(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8164 {
8165     gint32 value;
8166     guint saved_offset;
8167     gchar *str = NULL;
8168
8169     add_string = add_string;
8170     saved_offset = asn1->offset;
8171
8172     asn1_int32_value_decode(asn1, 1, &value);
8173
8174     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
8175     proto_tree_add_text(tree, asn1->tvb,
8176         saved_offset, asn1->offset - saved_offset,
8177         "%s :  Reserved",
8178         bigbuf);
8179
8180     switch ((value & 0x0c) >> 2)
8181     {
8182     case 0: str = "Service Negotiation Used"; break;
8183     case 1: str = "Service Negotiation Not Used"; break;
8184     case 2: str = "Service Negotiation Required"; break;
8185     case 3: str = "Service Negotiation Not Required"; break;
8186     }
8187
8188     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
8189     proto_tree_add_text(tree, asn1->tvb,
8190         saved_offset, asn1->offset - saved_offset,
8191         "%s :  Service Negotiate Flag (SRVNEG), %s",
8192         bigbuf,
8193         str);
8194
8195     switch (value & 0x03)
8196     {
8197     case 0 : str = "Change Facilities Operation Requested"; break;
8198     case 1 : str = "Change Facilities Operation Not Requested"; break;
8199     case 2 : str = "Change Facilities Operation Used"; break;
8200     case 3 : str = "Change Facilities Operation Not Used"; break;
8201     }
8202
8203     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
8204     proto_tree_add_text(tree, asn1->tvb,
8205         saved_offset, asn1->offset - saved_offset,
8206         "%s :  Change Facilities Flag (CHGFAC), %s",
8207         bigbuf,
8208         str);
8209
8210     EXTRANEOUS_DATA_CHECK(len, 1);
8211 }
8212
8213 static void
8214 param_dp_params(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8215 {
8216     gint32 value;
8217     guint saved_offset;
8218     gchar *str = NULL;
8219
8220     SHORT_DATA_CHECK(len, 4);
8221
8222     add_string = add_string;
8223     saved_offset = asn1->offset;
8224
8225     asn1_int32_value_decode(asn1, 1, &value);
8226
8227     other_decode_bitfield_value(bigbuf, value, 0xfc, 8);
8228     proto_tree_add_text(tree, asn1->tvb,
8229         saved_offset, asn1->offset - saved_offset,
8230         "%s :  Reserved",
8231         bigbuf);
8232
8233     switch (value & 0x03)
8234     {
8235     case 0: str = "Privacy inactive or not supported"; break;
8236     case 1: str = "Privacy Requested or Acknowledged"; break;
8237     default:
8238         str = "Reserved, treat as Privacy inactive or not supported";
8239         break;
8240     }
8241
8242     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
8243     proto_tree_add_text(tree, asn1->tvb,
8244         saved_offset, asn1->offset - saved_offset,
8245         "%s :  Privacy Mode, %s",
8246         bigbuf,
8247         str);
8248
8249     saved_offset = asn1->offset;
8250
8251     asn1_int32_value_decode(asn1, 1, &value);
8252
8253     switch (value)
8254     {
8255     case 0: str = "Not used"; break;
8256     case 1: str = "Data Privacy Version 1"; break;
8257     default:
8258         if ((value >= 2) && (value <= 223)) { str = "Reserved, treat as Not used"; }
8259         else { str = "Reserved for protocol extension, treat as Not used"; }
8260         break;
8261     }
8262
8263     proto_tree_add_text(tree, asn1->tvb,
8264         saved_offset, asn1->offset - saved_offset,
8265         "Data Privacy Version, %s",
8266         str);
8267
8268     saved_offset = asn1->offset;
8269
8270     proto_tree_add_text(tree, asn1->tvb,
8271         saved_offset, len - 2,
8272         "Data Privacy data");
8273
8274     asn1->offset += (len - 2);
8275 }
8276
8277 static void
8278 param_trn(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8279 {
8280     guint saved_offset;
8281     guchar *poctets;
8282
8283     add_string = add_string;
8284     saved_offset = asn1->offset;
8285
8286     asn1_string_value_decode(asn1, len, &poctets);
8287
8288     my_dgt_tbcd_unpack(bigbuf, poctets, len, &Dgt_msid);
8289     g_free(poctets);
8290
8291     proto_tree_add_text(tree, asn1->tvb,
8292         saved_offset, len, "TRN %s", bigbuf);
8293 }
8294
8295 static void
8296 param_islp_info(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8297 {
8298     gint32 value;
8299     guint saved_offset;
8300     gchar *str = NULL;
8301
8302     add_string = add_string;
8303     saved_offset = asn1->offset;
8304
8305     asn1_int32_value_decode(asn1, 1, &value);
8306
8307     switch (value)
8308     {
8309     case 0: str = "No ISLP supported"; break;
8310     case 1: str = "ISLP supported (see ISLP)"; break;
8311     default:
8312         if ((value >= 2) && (value <= 112)) { str = "Reserved, treat as No ISLP supported"; }
8313         else if ((value >= 113) && (value <= 223)) { str = "Reserved, treat as ISLP supported"; }
8314         else if ((value >= 224) && (value <= 240)) { str = "Reserved for protocol extension, treat as No ISLP supported"; }
8315         else { str = "Reserved for protocol extension, treat as ISLP supported"; }
8316         break;
8317     }
8318
8319     proto_tree_add_text(tree, asn1->tvb,
8320         saved_offset, asn1->offset - saved_offset,
8321         str);
8322
8323     EXTRANEOUS_DATA_CHECK(len, 1);
8324 }
8325
8326 static void
8327 param_ana_red_info(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8328 {
8329     gint32 value;
8330     guint saved_offset;
8331     gchar *str = NULL;
8332
8333     add_string = add_string;
8334     saved_offset = asn1->offset;
8335
8336     asn1_int32_value_decode(asn1, 1, &value);
8337
8338     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
8339     proto_tree_add_text(tree, asn1->tvb,
8340         saved_offset, asn1->offset - saved_offset,
8341         "%s :  Reserved",
8342         bigbuf);
8343
8344     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
8345     proto_tree_add_text(tree, asn1->tvb,
8346         saved_offset, asn1->offset - saved_offset,
8347         "%s :  Ignore CDMA, %s",
8348         bigbuf,
8349         (value & 0x20) ?  "Ignore the CDMA Capability Message on the analog system to which it is being redirected" :
8350             "Don't ignore the CDMA Capability Message on the analog system to which it is being redirected");
8351
8352     switch (value & 0x1f)
8353     {
8354     case 0: str = "Attempt to obtain service on either System A or B in accordance with the custom system selection process"; break;
8355     case 1: str = "Attempt to obtain service on System A only"; break;
8356     case 2: str = "Error in IS-735, text was unspecified but not reserved"; break;
8357     case 3: str = "Attempt to obtain service on System A first.  If unsuccessful, attempt to obtain service on System B"; break;
8358     case 4: str = "Attempt to obtain service on System B first.  If unsuccessful, attempt to obtain service on System A"; break;
8359     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;
8360
8361     default:
8362         str = "Reserved for protocol extension";
8363         break;
8364     }
8365
8366     other_decode_bitfield_value(bigbuf, value, 0x1f, 8);
8367     proto_tree_add_text(tree, asn1->tvb,
8368         saved_offset, asn1->offset - saved_offset,
8369         "%s :  Sys Ordering, %s",
8370         bigbuf,
8371         str);
8372
8373     EXTRANEOUS_DATA_CHECK(len, 1);
8374 }
8375
8376 static void
8377 param_reason_list(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8378 {
8379     gint32 value;
8380     gint i;
8381     guint saved_offset;
8382     gchar *str = NULL;
8383
8384     add_string = add_string;
8385     saved_offset = asn1->offset;
8386
8387     i = 0;
8388
8389     do
8390     {
8391         asn1_int32_value_decode(asn1, 1, &value);
8392
8393         switch (value)
8394         {
8395         case 0: str = "Unknown"; break;
8396         case 1: str = "Unable to configure ISLP"; break;
8397         case 2: str = "ISLP failure"; break;
8398         case 3: str = "Service allowed but facilities not available"; break;
8399         case 4: str = "Service not allowed"; break;
8400         case 5: str = "No Response to TMSI assignment"; break;
8401         case 6: str = "Required parameters unavailable. (e.g., as indicated by the RequiredParametersMask parameter)"; break;
8402         default:
8403             if ((value >= 7) && (value <= 110)) { str = "Reserved for common CDMA and TDMA network error causes. If unknown, treat as Unknown"; }
8404             else if ((value >= 111) && (value <= 127)) { str = "Reserved for common CDMA and TDMA network error causes for protocol extension. If unknown, treat as Unknown"; }
8405             else if ((value >= 128) && (value <= 174)) { str = "CDMA Specific error causes. If unknown, treat as Unknown"; }
8406             else if ((value >= 175) && (value <= 191)) { str = "CDMA Specific error causes for protocol extension. If unknown treat as Unknown"; }
8407             else if ((value >= 192) && (value <= 237)) { str = "TDMA Specific error causes as defined by the TDMACause parameter. If unknown treat as Unknown"; }
8408             else { str = "TDMA Specific error causes for protocol extension. If unknown, treat as Unknown"; }
8409             break;
8410         }
8411
8412         proto_tree_add_text(tree, asn1->tvb,
8413             saved_offset, asn1->offset - saved_offset,
8414             "[%u] %s",
8415             i++,
8416             str);
8417
8418         saved_offset = asn1->offset;
8419     }
8420     while ((len - i) > 0);
8421 }
8422
8423 static void
8424 param_imsi(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8425 {
8426     guint saved_offset;
8427     guchar *poctets;
8428
8429     add_string = add_string;
8430     saved_offset = asn1->offset;
8431     asn1_string_value_decode(asn1, len, &poctets);
8432
8433     my_dgt_tbcd_unpack(bigbuf, poctets, len, &Dgt_msid);
8434     g_free(poctets);
8435
8436     proto_tree_add_text(tree, asn1->tvb,
8437         saved_offset, len,
8438         "IMSI %s",
8439         bigbuf);
8440
8441     sprintf(add_string, " - %s", bigbuf);
8442 }
8443
8444 static void
8445 param_min(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8446 {
8447     guint saved_offset;
8448     guchar *poctets;
8449
8450     EXACT_DATA_CHECK(len, 5);
8451
8452     add_string = add_string;
8453     saved_offset = asn1->offset;
8454     asn1_string_value_decode(asn1, len, &poctets);
8455
8456     my_dgt_tbcd_unpack(bigbuf, poctets, len, &Dgt_msid);
8457     g_free(poctets);
8458
8459     proto_tree_add_text(tree, asn1->tvb,
8460         saved_offset, len,
8461         "MIN %s",
8462         bigbuf);
8463
8464     sprintf(add_string, " - %s", bigbuf);
8465 }
8466
8467 static void
8468 param_auth_cap(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8469 {
8470     gint32 value;
8471     guint saved_offset;
8472     gchar *str = NULL;
8473
8474     EXACT_DATA_CHECK(len, 1);
8475
8476     add_string = add_string;
8477     saved_offset = asn1->offset;
8478
8479     asn1_int32_value_decode(asn1, 1, &value);
8480
8481     switch (value)
8482     {
8483     case 0: str = "Not used"; break;
8484     case 1: str = "No authentication required"; break;
8485     case 2: str = "Authentication required"; break;
8486     case 128: str = "Authentication required and UIM capable"; break;
8487     default:
8488         if ((value >= 3) && (value <= 95)) { str = "Reserved, treat as No authentication required"; }
8489         else if ((value >= 96) && (value <= 127)) { str = "Reserved for protocol extension, treat as No authentication required"; }
8490         else if ((value >= 129) && (value <= 223)) { str = "Reserved, treat as Authentication required"; }
8491         else { str = "Reserved for protocol extension, treat as Authentication required"; }
8492         break;
8493     }
8494
8495     proto_tree_add_text(tree, asn1->tvb,
8496         saved_offset, asn1->offset - saved_offset,
8497         str);
8498 }
8499
8500 static void
8501 param_sus_acc(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8502 {
8503     gint32 value;
8504     guint saved_offset;
8505     gchar *str = NULL;
8506
8507     EXACT_DATA_CHECK(len, 1);
8508
8509     add_string = add_string;
8510     saved_offset = asn1->offset;
8511
8512     asn1_int32_value_decode(asn1, 1, &value);
8513
8514     switch (value)
8515     {
8516     case 0: str = "Not used"; break;
8517     case 1: str = "Anomalous digits"; break;
8518     case 2: str = "Unspecified"; break;
8519     default:
8520         if ((value >= 3) && (value <= 113)) { str = "Reserved, treat as Anomalous digits"; }
8521         else if ((value >= 114) && (value <= 223)) { str = "Reserved, treat as Unspecified"; }
8522         else { str = "Reserved for protocol extension, treat as Unspecified"; }
8523         break;
8524     }
8525
8526     proto_tree_add_text(tree, asn1->tvb,
8527         saved_offset, asn1->offset - saved_offset,
8528         "Reason, %s",
8529         str);
8530 }
8531
8532 static void
8533 param_dis_text(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8534 {
8535     gint32 value;
8536     guint saved_offset;
8537
8538     SHORT_DATA_CHECK(len, 3);
8539
8540     add_string = add_string;
8541     saved_offset = asn1->offset;
8542
8543     asn1_int32_value_decode(asn1, 1, &value);
8544
8545     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
8546     proto_tree_add_text(tree, asn1->tvb,
8547         saved_offset, asn1->offset - saved_offset,
8548         "%s :  Spec. has hardcoded 1",
8549         bigbuf);
8550
8551     other_decode_bitfield_value(bigbuf, value, 0x7f, 8);
8552     proto_tree_add_text(tree, asn1->tvb,
8553         saved_offset, asn1->offset - saved_offset,
8554         "%s :  Display type, see ANSI T1.610 for encoding",
8555         bigbuf);
8556
8557     saved_offset = asn1->offset;
8558
8559     proto_tree_add_text(tree, asn1->tvb,
8560         saved_offset, len - 1,
8561         "Display data");
8562
8563     asn1->offset += len - 1;
8564 }
8565
8566 static void
8567 param_dis_text2(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8568 {
8569     gint32 value;
8570     guint orig_offset, saved_offset;
8571     gchar *str = NULL;
8572
8573     SHORT_DATA_CHECK(len, 4);
8574
8575     add_string = add_string;
8576
8577     orig_offset = asn1->offset;
8578     saved_offset = asn1->offset;
8579
8580     do
8581     {
8582         asn1_int32_value_decode(asn1, 1, &value);
8583
8584         switch (value)
8585         {
8586         case 0: str = "Not used"; break;
8587         case 1: str = "ASCII"; break;
8588         case 2: str = "ITU T.50. The International Reference Alphabet as defined in ITU-R Rec. T.50"; break;
8589         case 3: str = "User Specific"; break;
8590         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;
8591         case 5: str = "ISO 10646. The Universal Multiple-Octet Coded Character Set (USC) as defined in ISO/IEC Standard 10646"; break;
8592         case 6: str = "ISO 8859-8. The 8-bit single-byte coded character set Hebrew as defined in ISO/IEC Standard 8859-8"; break;
8593         case 7: str = "IS-91 Extended Protocol Message. The length is determined by the Message Type; see TIA/EIA/IS-90"; break;
8594         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;
8595         case 9: str = "KC C 5601. Variable 1-2 byte Korean encoding method"; break;
8596         default:
8597             if ((value >= 10) && (value <= 223)) { str = "Reserved, treat as ASCII"; }
8598             else { str = "Reserved, treat as ASCII"; }
8599             break;
8600         }
8601
8602         proto_tree_add_text(tree, asn1->tvb,
8603             saved_offset, asn1->offset - saved_offset,
8604             "Display Character Set, %s",
8605             str);
8606
8607         saved_offset = asn1->offset;
8608
8609         asn1_int32_value_decode(asn1, 1, &value);
8610
8611         proto_tree_add_text(tree, asn1->tvb,
8612             saved_offset, asn1->offset - saved_offset,
8613             "Display Type, %u, see ANSI T1.610",
8614             value);
8615
8616         saved_offset = asn1->offset;
8617
8618         asn1_int32_value_decode(asn1, 1, &value);
8619
8620         proto_tree_add_text(tree, asn1->tvb,
8621             saved_offset, asn1->offset - saved_offset,
8622             "Display Tag, %u",
8623             value);
8624
8625         saved_offset = asn1->offset;
8626
8627         asn1_int32_value_decode(asn1, 1, &value);
8628
8629         proto_tree_add_text(tree, asn1->tvb,
8630             saved_offset, asn1->offset - saved_offset,
8631             "Display Length, %u",
8632             value);
8633
8634         saved_offset = asn1->offset;
8635
8636         if (value > 0)
8637         {
8638             if ((guint32) value > (len - (saved_offset - orig_offset)))
8639             {
8640                 proto_tree_add_text(tree, asn1->tvb,
8641                     saved_offset, len - (saved_offset - orig_offset),
8642                     "Short Data (?)");
8643
8644                 asn1->offset += len - (saved_offset - orig_offset);
8645                 return;
8646             }
8647
8648             proto_tree_add_text(tree, asn1->tvb,
8649                 saved_offset, value,
8650                 "Display data");
8651
8652             asn1->offset += value;
8653
8654             saved_offset = asn1->offset;
8655         }
8656     }
8657     while ((len - (saved_offset - orig_offset)) >= 4);
8658
8659     EXTRANEOUS_DATA_CHECK((len - (saved_offset - orig_offset)), 0);
8660 }
8661
8662 static void
8663 param_dmh_srvc_id(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8664 {
8665     gint32 value;
8666     guint orig_offset, saved_offset;
8667
8668     SHORT_DATA_CHECK(len, 5);
8669
8670     add_string = add_string;
8671
8672     orig_offset = asn1->offset;
8673     saved_offset = asn1->offset;
8674
8675     do
8676     {
8677         asn1_int32_value_decode(asn1, 2, &value);
8678
8679         proto_tree_add_text(tree, asn1->tvb,
8680             saved_offset, asn1->offset - saved_offset,
8681             "Market ID %u",
8682             value);
8683
8684         saved_offset = asn1->offset;
8685
8686         asn1_int32_value_decode(asn1, 1, &value);
8687
8688         proto_tree_add_text(tree, asn1->tvb,
8689             saved_offset, asn1->offset - saved_offset,
8690             "Market Segment ID %u",
8691             value);
8692
8693         saved_offset = asn1->offset;
8694
8695         asn1_int32_value_decode(asn1, 2, &value);
8696
8697         proto_tree_add_text(tree, asn1->tvb,
8698             saved_offset, asn1->offset - saved_offset,
8699             "DMH Service ID Value %u",
8700             value);
8701
8702         saved_offset = asn1->offset;
8703     }
8704     while ((len - (saved_offset - orig_offset)) >= 5);
8705
8706     EXTRANEOUS_DATA_CHECK((len - (saved_offset - orig_offset)), 0);
8707 }
8708
8709 static void
8710 param_feat_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8711 {
8712     gint32 value;
8713     guint orig_offset, saved_offset;
8714
8715     SHORT_DATA_CHECK(len, 5);
8716
8717     add_string = add_string;
8718
8719     orig_offset = asn1->offset;
8720     saved_offset = asn1->offset;
8721
8722     do
8723     {
8724         asn1_int32_value_decode(asn1, 2, &value);
8725
8726         proto_tree_add_text(tree, asn1->tvb,
8727             saved_offset, asn1->offset - saved_offset,
8728             "Market ID %u",
8729             value);
8730
8731         saved_offset = asn1->offset;
8732
8733         asn1_int32_value_decode(asn1, 1, &value);
8734
8735         proto_tree_add_text(tree, asn1->tvb,
8736             saved_offset, asn1->offset - saved_offset,
8737             "Market Segment ID %u",
8738             value);
8739
8740         saved_offset = asn1->offset;
8741
8742         asn1_int32_value_decode(asn1, 2, &value);
8743
8744         proto_tree_add_text(tree, asn1->tvb,
8745             saved_offset, asn1->offset - saved_offset,
8746             "DMH Service ID Value %u",
8747             value);
8748
8749         saved_offset = asn1->offset;
8750     }
8751     while ((len - (saved_offset - orig_offset)) >= 5);
8752
8753     EXTRANEOUS_DATA_CHECK((len - (saved_offset - orig_offset)), 0);
8754 }
8755
8756 static void
8757 param_a_key_ver(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8758 {
8759     gint32 value;
8760     gint i;
8761     guint saved_offset;
8762     gchar *str = NULL;
8763
8764     add_string = add_string;
8765     saved_offset = asn1->offset;
8766
8767     i = 0;
8768
8769     do
8770     {
8771         asn1_int32_value_decode(asn1, 1, &value);
8772
8773         switch (value)
8774         {
8775         case 0: str = "Not used"; break;
8776         case 1: str = "A-key Generation not supported"; break;
8777         case 2: str = "Diffie Hellman with 768-bit modulus, 160-bit primitive, and 160-bit exponents"; break;
8778         case 3: str = "Diffie Hellman with 512-bit modulus, 160-bit primitive, and 160-bit exponents"; break;
8779         case 4: str = "Diffie Hellman with 768-bit modulus, 32-bit primitive, and 160-bit exponents"; break;
8780         default:
8781             if ((value >= 5) && (value <= 223)) { str = "Reserved, treat as A-key Generation not supported"; }
8782             else { str = "Reserved for protocol extension, treat as A-key Generation not supported"; }
8783             break;
8784         }
8785
8786         proto_tree_add_text(tree, asn1->tvb,
8787             saved_offset, asn1->offset - saved_offset,
8788             "[%u] %s",
8789             i++,
8790             str);
8791
8792         saved_offset = asn1->offset;
8793     }
8794     while ((len - i) > 0);
8795 }
8796
8797 static void
8798 param_inter_msg_time(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8799 {
8800     gint32 value;
8801     guint saved_offset;
8802
8803     EXACT_DATA_CHECK(len, 1);
8804
8805     add_string = add_string;
8806     saved_offset = asn1->offset;
8807
8808     asn1_int32_value_decode(asn1, 1, &value);
8809
8810     proto_tree_add_text(tree, asn1->tvb,
8811         saved_offset, asn1->offset - saved_offset,
8812         "Timer Value, %u, %u seconds",
8813         value,
8814         value * 10);
8815
8816         /* XXX * 10 or / 10 ? */
8817 }
8818
8819 static void
8820 param_rel_cause(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8821 {
8822     gint32 value;
8823     guint saved_offset;
8824     gchar *str = NULL;
8825
8826     EXACT_DATA_CHECK(len, 1);
8827
8828     add_string = add_string;
8829     saved_offset = asn1->offset;
8830
8831     asn1_int32_value_decode(asn1, 1, &value);
8832
8833     switch (value)
8834     {
8835     case 0: str = "Unspecified"; break;
8836     case 1: str = "Calling Party"; break;
8837     case 2: str = "Called Party"; break;
8838     case 3: str = "Commanded Disconnect"; break;
8839     default:
8840         if ((value >= 4) && (value <= 23)) { str = "Reserved, treat as Calling Party"; }
8841         else if ((value >= 24) && (value <= 31)) { str = "Reserved for protocol extension. If unknown, treat as Calling Party"; }
8842         else if ((value >= 32) && (value <= 55)) { str = "Reserved, treat as Called Party"; }
8843         else if ((value >= 56) && (value <= 63)) { str = "Reserved for protocol extension. If unknown, treat as Called Party"; }
8844         else if ((value >= 64) && (value <= 87)) { str = "Reserved, treat as Commanded Disconnect"; }
8845         else if ((value >= 88) && (value <= 95)) { str = "Reserved for protocol extension. If unknown, treat as Commanded Disconnect"; }
8846         else if ((value >= 96) && (value <= 223)) { str = "Reserved, treat as Unspecified"; }
8847         else { str = "Reserved for protocol extension. If unknown, treat as Unspecified"; }
8848         break;
8849     }
8850
8851     proto_tree_add_text(tree, asn1->tvb,
8852         saved_offset, asn1->offset - saved_offset,
8853         str);
8854 }
8855
8856 static void
8857 param_time_day(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8858 {
8859     gint32 value;
8860     gint32 h, m, s, ts;
8861     guint saved_offset;
8862
8863     EXACT_DATA_CHECK(len, 3);
8864
8865     add_string = add_string;
8866     saved_offset = asn1->offset;
8867
8868     asn1_int32_value_decode(asn1, 3, &value);
8869
8870     h = value / (3600 * 10);
8871     m = (value - (h * (3600 * 10))) / (60 * 10);
8872     s = (value - (h * (3600 * 10)) - (m * (60 * 10))) / 10;
8873     ts = (value - (h * (3600 * 10)) - (m * (60 * 10)) - (s * 10));
8874
8875     proto_tree_add_text(tree, asn1->tvb,
8876         saved_offset, asn1->offset - saved_offset,
8877         "(UTC) (in tenths of seconds - 1), %u (%u:%u:%u.%u)",
8878         value,
8879         h,
8880         m,
8881         s,
8882         ts);
8883 }
8884
8885 static void
8886 param_call_status(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8887 {
8888     gint32 value;
8889     guint saved_offset;
8890     gchar *str = NULL;
8891
8892     add_string = add_string;
8893
8894     if (len > 4)
8895     {
8896         proto_tree_add_text(tree, asn1->tvb,
8897             asn1->offset, len, "Long Data (?)");
8898         asn1->offset += len;
8899         return;
8900     }
8901
8902     saved_offset = asn1->offset;
8903
8904     asn1->offset = saved_offset;
8905
8906     asn1_int32_value_decode(asn1, len, &value);
8907
8908     switch (value)
8909     {
8910     case 0: str = "Not used"; break;
8911     case 1: str = "Call Setup in Progress"; break;
8912     case 2: str = "Locally Allowed Call - No Action"; break;
8913     default:
8914         if (value < 0) { str = "Reserved for bilateral agreements. If unknown, treat as Not used"; }
8915         else { str = "Reserved, treat as Not used"; }
8916         break;
8917     }
8918
8919     proto_tree_add_text(tree, asn1->tvb,
8920         saved_offset, len,
8921         str);
8922 }
8923
8924 static void
8925 param_ms_status(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8926 {
8927     gint32 value;
8928     guint saved_offset;
8929     gchar *str = NULL;
8930     gboolean has_chan;
8931     gboolean extended;
8932
8933     add_string = add_string;
8934     saved_offset = asn1->offset;
8935
8936     asn1_int32_value_decode(asn1, 1, &value);
8937
8938     extended = (value & 0x80) >> 7;
8939
8940     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
8941     proto_tree_add_text(tree, asn1->tvb,
8942         saved_offset, asn1->offset - saved_offset,
8943         "%s :  Extension (EXT), %s",
8944         bigbuf,
8945         extended ? "No Extension, last octet of sequence" : "Extension indicator, the octet continues through the next octet");
8946
8947     other_decode_bitfield_value(bigbuf, value, 0x60, 8);
8948     proto_tree_add_text(tree, asn1->tvb,
8949         saved_offset, asn1->offset - saved_offset,
8950         "%s :  Reserved",
8951         bigbuf);
8952
8953     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
8954     proto_tree_add_text(tree, asn1->tvb,
8955         saved_offset, asn1->offset - saved_offset,
8956         "%s :  Location Information (LOC), %s",
8957         bigbuf,
8958         (value & 0x10) ? "MS location information available" : "No MS location information available");
8959
8960     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
8961     proto_tree_add_text(tree, asn1->tvb,
8962         saved_offset, asn1->offset - saved_offset,
8963         "%s :  Contact, %s",
8964         bigbuf,
8965         (value & 0x08) ? "Radio Contact Established" : "No Radio Contact");
8966
8967     has_chan = (value & 0x04) >> 2;
8968
8969     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
8970     proto_tree_add_text(tree, asn1->tvb,
8971         saved_offset, asn1->offset - saved_offset,
8972         "%s :  Channel, %s",
8973         bigbuf,
8974         has_chan ? "Traffic Channel Assigned" : "No Traffic Channel");
8975
8976     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
8977     proto_tree_add_text(tree, asn1->tvb,
8978         saved_offset, asn1->offset - saved_offset,
8979         "%s :  Handoff, %s",
8980         bigbuf,
8981         (value & 0x02) ? "Intersystem Handoff" : "No Intersystem Handoff");
8982
8983     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
8984     proto_tree_add_text(tree, asn1->tvb,
8985         saved_offset, asn1->offset - saved_offset,
8986         "%s :  Inactive, %s",
8987         bigbuf,
8988         (value & 0x01) ? "MS Inactive" : "MS Active");
8989
8990     if (len == 1) return;
8991
8992     saved_offset = asn1->offset;
8993
8994     asn1_int32_value_decode(asn1, 1, &value);
8995
8996     if (extended)
8997     {
8998         proto_tree_add_text(tree, asn1->tvb,
8999             saved_offset, asn1->offset - saved_offset,
9000             "Octet 1a ? spec. does not provide details");
9001
9002         saved_offset = asn1->offset;
9003
9004         EXTRANEOUS_DATA_CHECK(len, 2);
9005
9006         return;
9007     }
9008
9009     if (has_chan)
9010     {
9011         switch (value)
9012         {
9013         case 0: str = "Not used "; break;
9014         case 1: str = "Analog. The MS is currently assigned to an analog traffic channel"; break;
9015         case 2: str = "NAMPS. The MS is currently assigned to an NAMPS traffic channel"; break;
9016         case 3: str = "TDMA. The MS is currently assigned to a TDMA traffic channel"; break;
9017         case 4: str = "CDMA. The MS is currently assigned to a CDMA traffic channel"; break;
9018         default:
9019             if ((value >= 5) && (value <= 223)) { str = "Reserved, treat as Not used"; }
9020             else { str = "Reserved for protocol extension, treat as Not used"; }
9021             break;
9022         }
9023
9024         proto_tree_add_text(tree, asn1->tvb,
9025             saved_offset, asn1->offset - saved_offset,
9026             "Radio Channel Type, %s",
9027             str);
9028
9029         saved_offset = asn1->offset;
9030
9031         EXTRANEOUS_DATA_CHECK(len, 2);
9032
9033         return;
9034     }
9035
9036     asn1->offset -= 1;
9037
9038     EXTRANEOUS_DATA_CHECK(len, 1);
9039 }
9040
9041 static void
9042 param_pos_info_code(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9043 {
9044     gint32 value;
9045     guint saved_offset;
9046
9047     add_string = add_string;
9048     saved_offset = asn1->offset;
9049
9050     asn1_int32_value_decode(asn1, 1, &value);
9051
9052     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
9053     proto_tree_add_text(tree, asn1->tvb,
9054         saved_offset, asn1->offset - saved_offset,
9055         "%s :  Reserved",
9056         bigbuf);
9057
9058     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
9059     proto_tree_add_text(tree, asn1->tvb,
9060         saved_offset, asn1->offset - saved_offset,
9061         "%s :  MS Identity (MSID), %s",
9062         bigbuf,
9063         (value & 0x10) ? "MS Identity Requested" : "No MS Identity Requested");
9064
9065     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
9066     proto_tree_add_text(tree, asn1->tvb,
9067         saved_offset, asn1->offset - saved_offset,
9068         "%s :  Routing Address (ROUTE), %s",
9069         bigbuf,
9070         (value & 0x08) ? "Routing Address Requested" : "No Routing Address Requested");
9071
9072     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
9073     proto_tree_add_text(tree, asn1->tvb,
9074         saved_offset, asn1->offset - saved_offset,
9075         "%s :  Serving Cell ID (CELLID), %s",
9076         bigbuf,
9077         (value & 0x04) ? "Serving Cell ID Requested" : "No Serving Cell ID Requested");
9078
9079     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
9080     proto_tree_add_text(tree, asn1->tvb,
9081         saved_offset, asn1->offset - saved_offset,
9082         "%s :  Location Area ID (LOCID), %s",
9083         bigbuf,
9084         (value & 0x02) ?  "Location Area ID Requested" : "No Location Area ID Requested");
9085
9086     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
9087     proto_tree_add_text(tree, asn1->tvb,
9088         saved_offset, asn1->offset - saved_offset,
9089         "%s :  Current, %s",
9090         bigbuf,
9091         (value & 0x01) ? "Provide the current MS location" : "Provide the last known MS location information, if known");
9092
9093     EXTRANEOUS_DATA_CHECK(len, 1);
9094 }
9095
9096 static void
9097 param_rel_reason(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9098 {
9099     gint32 value;
9100     guint saved_offset;
9101     gchar *str = NULL;
9102
9103     EXACT_DATA_CHECK(len, 1);
9104
9105     add_string = add_string;
9106     saved_offset = asn1->offset;
9107
9108     asn1_int32_value_decode(asn1, 1, &value);
9109
9110     switch (value)
9111     {
9112     case 0: str = "Unspecified"; break;
9113     case 1: str = "Call Over Clear Forward"; break;
9114     case 2: str = "Call Over Clear Backward"; break;
9115     case 3: str = "Handoff Successful"; break;
9116     case 4: str = "Handoff Abort - call over"; break;
9117     case 5: str = "Handoff Abort - not received"; break;
9118     case 6: str = "Abnormal mobile termination"; break;
9119     case 7: str = "Abnormal switch termination"; break;
9120     case 8: str = "Special feature release"; break;
9121     case 9: str = "Session Over Clear Forward"; break;
9122     case 10: str = "Session Over Clear Backward"; break;
9123     case 11: str = "Clear All Services Forward"; break;
9124     case 12: str = "Clear All Services Backward"; break;
9125     case 13: str = "Anchor MSC was removed from the packet data session"; break;
9126     default:
9127         if ((value >= 14) && (value <= 223)) { str = "Reserved, treat as Unspecified"; }
9128         else { str = "Reserved for protocol extension, treat as Unspecified"; }
9129         break;
9130     }
9131
9132     proto_tree_add_text(tree, asn1->tvb,
9133         saved_offset, asn1->offset - saved_offset,
9134         "Reason, %s",
9135         str);
9136 }
9137
9138 static void
9139 param_ho_reason(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9140 {
9141     gint32 value;
9142     guint saved_offset;
9143     gchar *str = NULL;
9144
9145     EXACT_DATA_CHECK(len, 1);
9146
9147     add_string = add_string;
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 = "Weak signal"; break;
9157     case 3: str = "Off-loading"; break;
9158     case 4: str = "Anticipatory"; break;
9159     default:
9160         if ((value >= 5) && (value <= 223)) { str = "Reserved, treat as Unspecified"; }
9161         else { str = "Reserved for protocol extension, treat as Unspecified"; }
9162         break;
9163     }
9164
9165     proto_tree_add_text(tree, asn1->tvb,
9166         saved_offset, asn1->offset - saved_offset,
9167         str);
9168 }
9169
9170 static void
9171 param_red_reason(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9172 {
9173     gint32 value;
9174     guint saved_offset;
9175     gchar *str = NULL;
9176
9177     EXACT_DATA_CHECK(len, 1);
9178
9179     add_string = add_string;
9180     saved_offset = asn1->offset;
9181
9182     asn1_int32_value_decode(asn1, 1, &value);
9183
9184     switch (value)
9185     {
9186     case 0: str = "Not used"; break;
9187     case 1: str = "Busy"; break;
9188     case 2: str = "No answer"; break;
9189     case 3: str = "Unconditional"; break;
9190     case 4: str = "No page response"; break;
9191     case 5: str = "Unavailable"; break;
9192     case 6: str = "Unroutable"; break;
9193     case 7: str = "Call accepted"; break;
9194     case 8: str = "Call refused"; break;
9195     case 9: str = "USCFvm, divert to voice mail"; break;
9196     case 10: str = "USCFms, divert to an MS provided DN"; break;
9197     case 11: str = "USCFnr, divert to a network registered DN"; break;
9198     default:
9199         if ((value >= 12) && (value <= 223)) { str = "Reserved, treat as No answer"; }
9200         else { str = "Reserved for protocol extension, treat as No answer"; }
9201         break;
9202     }
9203
9204     proto_tree_add_text(tree, asn1->tvb,
9205         saved_offset, asn1->offset - saved_offset,
9206         str);
9207 }
9208
9209 static void
9210 param_confid_mode(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9211 {
9212     gint32 value;
9213     guint saved_offset;
9214
9215     EXACT_DATA_CHECK(len, 1);
9216
9217     add_string = add_string;
9218     saved_offset = asn1->offset;
9219
9220     asn1_int32_value_decode(asn1, 1, &value);
9221
9222     other_decode_bitfield_value(bigbuf, value, 0xf8, 8);
9223     proto_tree_add_text(tree, asn1->tvb,
9224         saved_offset, asn1->offset - saved_offset,
9225         "%s :  Reserved",
9226         bigbuf);
9227
9228     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
9229     proto_tree_add_text(tree, asn1->tvb,
9230         saved_offset, asn1->offset - saved_offset,
9231         "%s :  Data Privacy (DP), %s",
9232         bigbuf,
9233         (value & 0x04) ? "ON" : "OFF");
9234
9235     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
9236     proto_tree_add_text(tree, asn1->tvb,
9237         saved_offset, asn1->offset - saved_offset,
9238         "%s :  Signaling Message Encryption (SE), %s",
9239         bigbuf,
9240         (value & 0x02) ? "ON" : "OFF");
9241
9242     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
9243     proto_tree_add_text(tree, asn1->tvb,
9244         saved_offset, asn1->offset - saved_offset,
9245         "%s :  Voice Privacy (VP), %s",
9246         bigbuf,
9247         (value & 0x01) ? "ON" : "OFF");
9248 }
9249
9250 static void
9251 param_sys_acc_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9252 {
9253     gint32 value;
9254     guint saved_offset;
9255     gchar *str = NULL;
9256
9257     EXACT_DATA_CHECK(len, 1);
9258
9259     add_string = add_string;
9260     saved_offset = asn1->offset;
9261
9262     asn1_int32_value_decode(asn1, 1, &value);
9263
9264     switch (value)
9265     {
9266     case 0: str = "Not used"; break;
9267     case 1: str = "Unspecified"; break;
9268     case 2: str = "Flash request"; break;
9269     case 3: str = "Autonomous registration"; break;
9270     case 4: str = "Call origination"; break;
9271     case 5: str = "Page response"; break;
9272     case 6: str = "No access"; break;
9273     case 7: str = "Power down registration"; break;
9274     case 8: str = "SMS page response"; break;
9275     case 9: str = "OTASP"; break;
9276     default:
9277         if ((value >= 10) && (value <= 223)) { str = "Reserved, treat as Unspecified"; }
9278         else { str = "Reserved for protocol extension, treat as Unspecified"; }
9279         break;
9280     }
9281
9282     proto_tree_add_text(tree, asn1->tvb,
9283         saved_offset, asn1->offset - saved_offset,
9284         str);
9285 }
9286
9287 static void
9288 param_scm(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9289 {
9290     gint32 value, temp_int;
9291     guint saved_offset;
9292     gchar *str = NULL;
9293
9294     EXACT_DATA_CHECK(len, 1);
9295
9296     add_string = add_string;
9297     saved_offset = asn1->offset;
9298
9299     asn1_int32_value_decode(asn1, 1, &value);
9300
9301     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
9302     proto_tree_add_text(tree, asn1->tvb,
9303         saved_offset, asn1->offset - saved_offset,
9304         "%s :  Reserved",
9305         bigbuf);
9306
9307     temp_int = ((value & 0x10) >> 2) | (value & 0x03);
9308     switch (temp_int)
9309     {
9310     case 0: str = "Class I"; break;
9311     case 1: str = "Class II"; break;
9312     case 2: str = "Class III"; break;
9313     case 3: str = "Class IV"; break;
9314     case 4: str = "Class V"; break;
9315     case 5: str = "Class VI"; break;
9316     case 6: str = "Class VII"; break;
9317     case 7: str = "Class VIII"; break;
9318     }
9319
9320     other_decode_bitfield_value(bigbuf, value, 0x13, 8);
9321     proto_tree_add_text(tree, asn1->tvb,
9322         saved_offset, asn1->offset - saved_offset,
9323         "%s :  Power %s",
9324         bigbuf,
9325         str);
9326
9327     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
9328     proto_tree_add_text(tree, asn1->tvb,
9329         saved_offset, asn1->offset - saved_offset,
9330         "%s :  Bandwidth %s",
9331         bigbuf,
9332         (value & 0x08) ? "25 MHz" : "20 MHz");
9333
9334     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
9335     proto_tree_add_text(tree, asn1->tvb,
9336         saved_offset, asn1->offset - saved_offset,
9337         "%s :  Transmission, %s",
9338         bigbuf,
9339         (value & 0x04) ? "Discontinuous" : "Continuous");
9340 }
9341
9342 static void
9343 param_deny_acc(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9344 {
9345     gint32 value;
9346     guint saved_offset;
9347     gchar *str = NULL;
9348
9349     EXACT_DATA_CHECK(len, 1);
9350
9351     add_string = add_string;
9352     saved_offset = asn1->offset;
9353
9354     asn1_int32_value_decode(asn1, 1, &value);
9355
9356     switch (value)
9357     {
9358     case 0: str = "Not used"; break;
9359     case 1: str = "Unspecified"; break;
9360     case 2: str = "SSD Update failure"; break;
9361     case 3: str = "COUNT Update failure"; break;
9362     case 4: str = "Unique Challenge failure"; break;
9363     case 5: str = "AUTHR mismatch"; break;
9364     case 6: str = "COUNT mismatch"; break;
9365     case 7: str = "Process collision"; break;
9366     case 8: str = "Missing authentication parameters"; break;
9367     case 9: str = "TerminalType mismatch"; break;
9368     case 10: str = "MIN, IMSI or ESN authorization failure"; break;
9369     default:
9370         if ((value >= 11) && (value <= 223)) { str = "Reserved, treat as Unspecified"; }
9371         else { str = "Reserved for protocol extension, treat as Unspecified"; }
9372         break;
9373     }
9374
9375     proto_tree_add_text(tree, asn1->tvb,
9376         saved_offset, asn1->offset - saved_offset,
9377         str);
9378 }
9379
9380 static void
9381 param_cdma_sig_qual(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9382 {
9383     gint32 value;
9384     guint saved_offset;
9385
9386     EXACT_DATA_CHECK(len, 1);
9387
9388     add_string = add_string;
9389     saved_offset = asn1->offset;
9390
9391     asn1_int32_value_decode(asn1, 1, &value);
9392
9393     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
9394     proto_tree_add_text(tree, asn1->tvb,
9395         saved_offset, asn1->offset - saved_offset,
9396         "%s :  Reserved",
9397         bigbuf);
9398
9399     other_decode_bitfield_value(bigbuf, value, 0x3f, 8);
9400     proto_tree_add_text(tree, asn1->tvb,
9401         saved_offset, asn1->offset - saved_offset,
9402         "%s :  Value %u",
9403         bigbuf,
9404         value & 0x3f);
9405 }
9406
9407 static void
9408 param_rec_sig_qual(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9409 {
9410     gint32 value;
9411     guint saved_offset;
9412     gchar *str = NULL;
9413
9414     EXACT_DATA_CHECK(len, 1);
9415
9416     add_string = add_string;
9417     saved_offset = asn1->offset;
9418
9419     asn1_int32_value_decode(asn1, 1, &value);
9420
9421     switch (value)
9422     {
9423     case 0: str = "Not a usable signal"; break;
9424     case 255: str = "Interference"; break;
9425     default:
9426         if ((value >= 1) && (value <= 8)) { str = "Reserved, treat as Not a usable signal"; }
9427         else if ((value >= 9) && (value <= 245)) { str = "Usable signal range"; }
9428         else if ((value >= 246) && (value <= 254)) { str = "Reserved, treat as Interference"; }
9429         break;
9430     }
9431
9432     proto_tree_add_text(tree, asn1->tvb,
9433         saved_offset, asn1->offset - saved_offset,
9434         str);
9435 }
9436
9437 static void
9438 param_sig_qual(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9439 {
9440     gint32 value;
9441     guint saved_offset;
9442     gchar *str = NULL;
9443
9444     EXACT_DATA_CHECK(len, 1);
9445
9446     add_string = add_string;
9447     saved_offset = asn1->offset;
9448
9449     asn1_int32_value_decode(asn1, 1, &value);
9450
9451     switch (value)
9452     {
9453     case 0: str = "Not a usable signal"; break;
9454     case 255: str = "Interference"; break;
9455     default:
9456         if ((value >= 1) && (value <= 8)) { str = "Reserved, treat as Not a usable signal"; }
9457         else if ((value >= 9) && (value <= 245)) { str = "Usable signal range"; }
9458         else if ((value >= 246) && (value <= 254)) { str = "Reserved, treat as Interference"; }
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_ssd_no_share(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9469 {
9470     gint32 value;
9471     guint saved_offset;
9472     gchar *str = NULL;
9473
9474     EXACT_DATA_CHECK(len, 1);
9475
9476     add_string = add_string;
9477     saved_offset = asn1->offset;
9478
9479     asn1_int32_value_decode(asn1, 1, &value);
9480
9481     switch (value)
9482     {
9483     case 0: str = "Not used"; break;
9484     case 1: str = "Discard SSD"; break;
9485     default:
9486         str = "Reserved, treat as Discard SSD";
9487         break;
9488     }
9489
9490     proto_tree_add_text(tree, asn1->tvb,
9491         saved_offset, asn1->offset - saved_offset,
9492         str);
9493 }
9494
9495 static void
9496 param_report_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9497 {
9498     gint32 value;
9499     guint saved_offset;
9500     gchar *str = NULL;
9501
9502     EXACT_DATA_CHECK(len, 1);
9503
9504     add_string = add_string;
9505     saved_offset = asn1->offset;
9506
9507     asn1_int32_value_decode(asn1, 1, &value);
9508
9509     switch (value)
9510     {
9511     case 0: str = "Not used"; break;
9512     case 1: str = "Unspecified security violation"; break;
9513     case 2: str = "MSID/ESN mismatch"; break;
9514     case 3: str = "RANDC mismatch"; break;
9515     case 4: str = "Reserved (see TSB51)"; break;
9516     case 5: str = "SSD Update failed"; break;
9517     case 6: str = "Reserved (see TSB51)"; break;
9518     case 7: str = "COUNT mismatch"; break;
9519     case 8: str = "Reserved (see TSB51)"; break;
9520     case 9: str = "Unique Challenge failed"; break;
9521     case 10: str = "Unsolicited Base Station Challenge"; break;
9522     case 11: str = "SSD Update no response"; break;
9523     case 12: str = "COUNT Update no response"; break;
9524     case 13: str = "Unique Challenge no response"; break;
9525     case 14: str = "AUTHR mismatch"; break;
9526     case 15: str = "TERMTYP mismatch"; break;
9527     case 16: str = "Missing authentication parameters"; break;
9528     default:
9529         if ((value >= 17) && (value <= 223)) { str = "Reserved, treat as Unspecified security violation"; }
9530         else { str = "Reserved for protocol extension, treat as Unspecified security violation"; }
9531         break;
9532     }
9533
9534     proto_tree_add_text(tree, asn1->tvb,
9535         saved_offset, asn1->offset - saved_offset,
9536         str);
9537 }
9538
9539 static void
9540 param_term_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9541 {
9542     gint32 value;
9543     guint saved_offset;
9544     gchar *str = NULL;
9545
9546     EXACT_DATA_CHECK(len, 1);
9547
9548     add_string = add_string;
9549     saved_offset = asn1->offset;
9550
9551     asn1_int32_value_decode(asn1, 1, &value);
9552
9553     switch (value)
9554     {
9555     case 0: str = "Not used"; break;
9556     case 1: str = "Not distinguished, EIA/TIA-553, IS-54-A, IS-88, IS-91, IS-94"; break;
9557     case 2: str = "IS-54-B"; break;
9558     case 3: str = "IS-136"; break;
9559     case 4: str = "J-STD-011 (rescinded 11/23/99)"; break;
9560     case 5: str = "IS-136-A or TIA/EIA-136 Revision-0"; break;
9561     case 6: str = "TIA/EIA-136-A"; break;
9562     case 7: str = "TIA/EIA-136-B"; break;
9563     case 32: str = "IS-95"; break;
9564     case 33: str = "IS-95-A"; break;
9565     case 34: str = "J-STD-008"; break;
9566     case 35: str = "IS-95-B"; break;
9567     case 36: str = "IS-2000"; break;
9568     case 64: str = "IS-88"; break;
9569     case 65: str = "IS-94"; break;
9570     case 66: str = "IS-91"; break;
9571     case 67: str = "J-STD-014"; break;
9572     case 68: str = "TIA/EIA-553-A"; break;
9573     case 69: str = "IS-91-A"; break;
9574     default:
9575         if ((value >= 8) && (value <= 31)) { str = "Reserved, treat as IS-54-B"; }
9576         else if ((value >= 37) && (value <= 63)) { str = "Reserved, treat as IS-95-A"; }
9577         else if ((value >= 70) && (value <= 223)) { str = "Reserved, treat as Not distinguished"; }
9578         else { str = "Reserved for protocol extension, treat as Not distinguished"; }
9579         break;
9580     }
9581
9582     proto_tree_add_text(tree, asn1->tvb,
9583         saved_offset, asn1->offset - saved_offset,
9584         str);
9585 }
9586
9587 static void
9588 param_term_res(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9589 {
9590     gint32 value;
9591     guint saved_offset;
9592     gchar *str = NULL;
9593
9594     EXACT_DATA_CHECK(len, 1);
9595
9596     add_string = add_string;
9597     saved_offset = asn1->offset;
9598
9599     asn1_int32_value_decode(asn1, 1, &value);
9600
9601     switch (value)
9602     {
9603     case 0: str = "Not used"; break;
9604     case 1: str = "Termination denied"; break;
9605     case 2: str = "Unrestricted"; break;
9606     case 3: str = "Treatment for this value is not specified"; break;
9607     default:
9608         if ((value >= 4) && (value <= 223)) { str = "Reserved, treat as Unrestricted"; }
9609         else { str = "Reserved for protocol extension, treat as Unrestricted"; }
9610         break;
9611     }
9612
9613     proto_tree_add_text(tree, asn1->tvb,
9614         saved_offset, asn1->offset - saved_offset,
9615         str);
9616 }
9617
9618 static void
9619 param_dereg(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9620 {
9621     gint32 value;
9622     guint saved_offset;
9623     gchar *str = NULL;
9624
9625     EXACT_DATA_CHECK(len, 1);
9626
9627     add_string = add_string;
9628     saved_offset = asn1->offset;
9629
9630     asn1_int32_value_decode(asn1, 1, &value);
9631
9632     switch (value)
9633     {
9634     case 0: str = "Not used"; break;
9635     case 1: str = "Deregister for an unspecified reason"; break;
9636     case 2: str = "Deregister for an adminstrative reason"; break;
9637     case 3: str = "Deregister due to MS power down"; break;
9638     default:
9639         if ((value >= 4) && (value <= 223)) { str = "Reserved, treat as Deregister for an unspecified reason"; }
9640         else { str = "Reserved for protocol extension, treat as Deregister for an unspecified reason"; }
9641         break;
9642     }
9643
9644     proto_tree_add_text(tree, asn1->tvb,
9645         saved_offset, asn1->offset - saved_offset,
9646         str);
9647 }
9648
9649 static void
9650 param_group_info(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9651 {
9652     gint32 value;
9653     guint saved_offset;
9654
9655     SHORT_DATA_CHECK(len, 4);
9656
9657     add_string = add_string;
9658     saved_offset = asn1->offset;
9659
9660     asn1_int32_value_decode(asn1, 4, &value);
9661
9662     proto_tree_add_text(tree, asn1->tvb,
9663         saved_offset, asn1->offset - saved_offset,
9664         "Value %u",
9665         value);
9666
9667     EXTRANEOUS_DATA_CHECK(len, 4);
9668 }
9669
9670 static void
9671 param_auth_den(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9672 {
9673     gint32 value;
9674     guint saved_offset;
9675     gchar *str = NULL;
9676
9677     EXACT_DATA_CHECK(len, 1);
9678
9679     add_string = add_string;
9680     saved_offset = asn1->offset;
9681
9682     asn1_int32_value_decode(asn1, 1, &value);
9683
9684     switch (value)
9685     {
9686     case 0: str = "Not used"; break;
9687     case 1: str = "Delinquent account"; break;
9688     case 2: str = "Invalid serial number"; break;
9689     case 3: str = "Stolen unit"; break;
9690     case 4: str = "Duplicate unit"; break;
9691     case 5: str = "Unassigned directory number"; break;
9692     case 6: str = "Unspecified"; break;
9693     case 7: str = "Multiple access"; break;
9694     case 8: str = "Not Authorized for the MSC"; break;
9695     case 9: str = "Missing authentication parameters"; break;
9696     case 10: str = "Terminal Type mismatch"; break;
9697     default:
9698         if ((value >= 11) && (value <= 223)) { str = "Reserved, treat as Unspecified"; }
9699         else { str = "Reserved for protocol extension, treat as Unspecified"; }
9700         break;
9701     }
9702
9703     proto_tree_add_text(tree, asn1->tvb,
9704         saved_offset, asn1->offset - saved_offset,
9705         "Reason, %s (%u)",
9706         str,
9707         value);
9708 }
9709
9710 static gchar *
9711 find_trig_type(gint32 value)
9712 {
9713     gchar *str = NULL;
9714
9715     switch (value)
9716     {
9717     case 0: str = "Unspecified"; break;
9718     case 1: str = "All Calls"; break;
9719     case 2: str = "Double Introducing Star"; break;
9720     case 3: str = "Single Introducing Star"; break;
9721     case 4: str = "Reserved [for Home System Feature Code"; break;
9722     case 5: str = "Double Introducing Pound"; break;
9723     case 6: str = "Single Introducing Pound"; break;
9724     case 7: str = "Revertive Call"; break;
9725     case 8: str = "0 Digit"; break;
9726     case 9: str = "1 Digit"; break;
9727     case 10: str = "2 Digit"; break;
9728     case 11: str = "3 Digit"; break;
9729     case 12: str = "4 Digit"; break;
9730     case 13: str = "5 Digit"; break;
9731     case 14: str = "6 Digit"; break;
9732     case 15: str = "7 Digit"; break;
9733     case 16: str = "8 Digit"; break;
9734     case 17: str = "9 Digit"; break;
9735     case 18: str = "10 Digit"; break;
9736     case 19: str = "11 Digit"; break;
9737     case 20: str = "12 Digit"; break;
9738     case 21: str = "13 Digit"; break;
9739     case 22: str = "14 Digit"; break;
9740     case 23: str = "15 Digit"; break;
9741     case 24: str = "Local Call"; break;
9742     case 25: str = "Intra-LATA Toll Call"; break;
9743     case 26: str = "Inter-LATA Toll Call"; break;
9744     case 27: str = "World Zone Call"; break;
9745     case 28: str = "International Call"; break;
9746     case 29: str = "Unrecognized Number"; break;
9747     case 30: str = "Prior Agreement"; break;
9748     case 31: str = "Specific Called Party Digit String"; break;
9749     case 32: str = "Mobile Termination"; break;
9750     case 33: str = "Advanced Termination"; break;
9751     case 34: str = "Location"; break;
9752     case 35: str = "Locally Allowed Specific Digit String"; break;
9753     case 36: str = "Origination Attempt Authorized"; break;
9754     case 37: str = "Calling Routing Address Available"; break;
9755     case 38: str = "Initial Termination"; break;
9756     case 39: str = "Called Routing Address Available"; break;
9757     case 40: str = "O Answer"; break;
9758     case 41: str = "O Disconnect"; break;
9759     case 42: str = "O Called Party Busy"; break;
9760     case 43: str = "O No Answer"; break;
9761     case 64: str = "Terminating Resource Available"; break;
9762     case 65: str = "T Busy"; break;
9763     case 66: str = "T No Answer"; break;
9764     case 67: str = "T No Page Response"; break;
9765     case 68: str = "T Unroutable"; break;
9766     case 69: str = "T Answer"; break;
9767     case 70: str = "T Disconnect"; break;
9768     case 220: str = "Reserved for TDP-R DP Type value"; break;
9769     case 221: str = "Reserved for TDP-N DP Type value"; break;
9770     case 222: str = "Reserved for EDP-R DP Type value"; break;
9771     case 223: str = "Reserved for EDP-N DP Type value"; break;
9772     default:
9773         if ((value >= 44) && (value <= 63)) { str = "Reserved, treat as Unspecified"; }
9774         else if ((value >= 71) && (value <= 219)) { str = "Reserved, treat as Unspecified"; }
9775         else { str = "Reserved for protocol extension, treat as Unspecified"; }
9776         break;
9777     }
9778
9779     return(str);
9780 }
9781
9782 static void
9783 param_trig_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9784 {
9785     gint32 value;
9786     guint saved_offset;
9787
9788     EXACT_DATA_CHECK(len, 1);
9789
9790     add_string = add_string;
9791     saved_offset = asn1->offset;
9792
9793     asn1_int32_value_decode(asn1, 1, &value);
9794
9795     proto_tree_add_text(tree, asn1->tvb,
9796         saved_offset, asn1->offset - saved_offset,
9797         "Trigger (%u) %s",
9798         value,
9799         find_trig_type(value));
9800 }
9801
9802 static void
9803 param_win_op_cap(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9804 {
9805     gint32 value;
9806     guint saved_offset;
9807     gchar *str = NULL;
9808
9809     add_string = add_string;
9810     saved_offset = asn1->offset;
9811
9812     asn1_int32_value_decode(asn1, 1, &value);
9813
9814     other_decode_bitfield_value(bigbuf, value, 0xf8, 8);
9815     proto_tree_add_text(tree, asn1->tvb,
9816         saved_offset, asn1->offset - saved_offset,
9817         "%s :  Reserved",
9818         bigbuf);
9819
9820     switch ((value & 0x04) >> 2)
9821     {
9822     case 0x00: str = "Sender does not support PositionRequest OP"; break;
9823     default:
9824         str = "Sender supports PositionRequest OP";
9825         break;
9826     }
9827
9828     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
9829     proto_tree_add_text(tree, asn1->tvb,
9830         saved_offset, asn1->offset - saved_offset,
9831         "%s :  %s",
9832         bigbuf, str);
9833
9834     switch ((value & 0x02) >> 1)
9835     {
9836     case 0x00: str = "Sender does not support CallControlDirective OP"; break;
9837     default:
9838         str = "Sender supports CallControlDirective OP";
9839         break;
9840     }
9841
9842     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
9843     proto_tree_add_text(tree, asn1->tvb,
9844         saved_offset, asn1->offset - saved_offset,
9845         "%s :  %s",
9846         bigbuf, str);
9847
9848     switch (value & 0x01)
9849     {
9850     case 0x00: str = "Sender does not support ConnectResource, DisconnectResource, ConnectionFailureReport and ResetTimer (SSFT timer) OPs"; break;
9851     default:
9852         str = "Sender supports ConnectResource, DisconnectResource, ConnectionFailureReport and ResetTimer (SSFT timer) OPs";
9853         break;
9854     }
9855
9856     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
9857     proto_tree_add_text(tree, asn1->tvb,
9858         saved_offset, asn1->offset - saved_offset,
9859         "%s :  %s",
9860         bigbuf, str);
9861
9862     EXTRANEOUS_DATA_CHECK(len, 1);
9863 }
9864
9865 static void
9866 param_win_trig_list(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9867 {
9868     gint32 value, i, j;
9869     guint saved_offset;
9870
9871     add_string = add_string;
9872     saved_offset = asn1->offset;
9873
9874     j = 0;
9875     i = 0;
9876
9877     do
9878     {
9879         asn1_int32_value_decode(asn1, 1, &value);
9880
9881         switch (value)
9882         {
9883         case 0xdc:
9884             proto_tree_add_text(tree, asn1->tvb,
9885                 saved_offset, asn1->offset - saved_offset,
9886                 "TDP-R's armed");
9887
9888             j = 0;
9889             break;
9890
9891         case 0xdd:
9892             proto_tree_add_text(tree, asn1->tvb,
9893                 saved_offset, asn1->offset - saved_offset,
9894                 "TDP-N's armed");
9895
9896             j = 0;
9897             break;
9898
9899         case 0xde:
9900             proto_tree_add_text(tree, asn1->tvb,
9901                 saved_offset, asn1->offset - saved_offset,
9902                 "EDP-R's armed");
9903
9904             j = 0;
9905             break;
9906
9907         case 0xdf:
9908             proto_tree_add_text(tree, asn1->tvb,
9909                 saved_offset, asn1->offset - saved_offset,
9910                 "EDP-N's armed");
9911
9912             j = 0;
9913             break;
9914
9915         default:
9916             proto_tree_add_text(tree, asn1->tvb,
9917                 saved_offset, asn1->offset - saved_offset,
9918                 "[%u] (%u) %s",
9919                 j,
9920                 value,
9921                 find_trig_type(value));
9922             j++;
9923             break;
9924         }
9925
9926         saved_offset = asn1->offset;
9927         i++;
9928     }
9929     while ((len - i) > 0);
9930 }
9931
9932 static void
9933 param_trans_cap(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9934 {
9935     gint32 value;
9936     guint saved_offset;
9937     gchar *str = NULL;
9938     char *p;
9939
9940     add_string = add_string;
9941     saved_offset = asn1->offset;
9942
9943     asn1_int32_value_decode(asn1, 1, &value);
9944
9945     switch ((value & 0x80) >> 7)
9946     {
9947     case 0x00: str = "System is not capable of supporting CNAP/CNAR (NAMI)"; break;
9948     default:
9949         str = "System is capable of supporting CNAP/CNAR (NAMI)";
9950         break;
9951     }
9952
9953     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
9954     proto_tree_add_text(tree, asn1->tvb,
9955         saved_offset, asn1->offset - saved_offset,
9956         "%s :  %s",
9957         bigbuf, str);
9958
9959     switch ((value & 0x40) >> 6)
9960     {
9961     case 0x00: str = "System is not capable of supporting NDSS"; break;
9962     default:
9963         str = "System is capable of supporting NDSS";
9964         break;
9965     }
9966
9967     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
9968     proto_tree_add_text(tree, asn1->tvb,
9969         saved_offset, asn1->offset - saved_offset,
9970         "%s :  %s",
9971         bigbuf, str);
9972
9973     switch ((value & 0x20) >> 5)
9974     {
9975     case 0x00: str = "System is not capable of supporting User Zones (UZCI)"; break;
9976     default:
9977         str = "System is capable of supporting User Zones (UZCI)";
9978         break;
9979     }
9980
9981     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
9982     proto_tree_add_text(tree, asn1->tvb,
9983         saved_offset, asn1->offset - saved_offset,
9984         "%s :  %s",
9985         bigbuf, str);
9986
9987     switch ((value & 0x10) >> 4)
9988     {
9989     case 0x00: str = "System is not capable of supporting local SPINI"; break;
9990     default:
9991         str = "System is capable of supporting local SPINI";
9992         break;
9993     }
9994
9995     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
9996     proto_tree_add_text(tree, asn1->tvb,
9997         saved_offset, asn1->offset - saved_offset,
9998         "%s :  %s",
9999         bigbuf, str);
10000
10001     switch ((value & 0x08) >> 3)
10002     {
10003     case 0x00: str = "System is not capable of interacting with the user (RUI)"; break;
10004     default:
10005         str = "System is capable of interacting with the user (RUI)";
10006         break;
10007     }
10008
10009     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
10010     proto_tree_add_text(tree, asn1->tvb,
10011         saved_offset, asn1->offset - saved_offset,
10012         "%s :  %s",
10013         bigbuf, str);
10014
10015     switch ((value & 0x04) >> 2)
10016     {
10017     case 0x00: str = "System is not capable of honoring the Announcement List parameter (ANN)"; break;
10018     default:
10019         str = "System is capable of honoring the Announcement List parameter (ANN)";
10020         break;
10021     }
10022
10023     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
10024     proto_tree_add_text(tree, asn1->tvb,
10025         saved_offset, asn1->offset - saved_offset,
10026         "%s :  %s",
10027         bigbuf, str);
10028
10029     switch ((value & 0x02) >> 1)
10030     {
10031     case 0x00: str = "System is not capable of detecting a busy condition (BUSY)"; break;
10032     default:
10033         str = "System is capable of detecting a busy condition (BUSY)";
10034         break;
10035     }
10036
10037     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
10038     proto_tree_add_text(tree, asn1->tvb,
10039         saved_offset, asn1->offset - saved_offset,
10040         "%s :  %s",
10041         bigbuf, str);
10042
10043     switch (value & 0x01)
10044     {
10045     case 0x00: str = "System is not capable of supporting the IS-41-C profile parameter (PROFILE)"; break;
10046     default:
10047         str = "System is capable of supporting the IS-41-C profile parameter (PROFILE)";
10048         break;
10049     }
10050
10051     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
10052     proto_tree_add_text(tree, asn1->tvb,
10053         saved_offset, asn1->offset - saved_offset,
10054         "%s :  %s",
10055         bigbuf, str);
10056
10057     if (len == 1) return;
10058
10059     saved_offset = asn1->offset;
10060
10061     asn1_int32_value_decode(asn1, 1, &value);
10062
10063     switch ((value & 0x80) >> 7)
10064     {
10065     case 0x00: str = "System is not capable of supporting the CDMA Over the Air Parameter Administration"; break;
10066     default:
10067         str = "System is capable of supporting the CDMA Over the Air Parameter Administration";
10068         break;
10069     }
10070
10071     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
10072     proto_tree_add_text(tree, asn1->tvb,
10073         saved_offset, asn1->offset - saved_offset,
10074         "%s :  %s",
10075         bigbuf, str);
10076
10077     switch ((value & 0x40) >> 6)
10078     {
10079     case 0x00: str = "System is not capable of supporting lower layer segmentation & reassembly (S&R)"; break;
10080     default:
10081         str = "System is capable of supporting lower layer segmentation & reassembly (S&R)";
10082         break;
10083     }
10084
10085     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
10086     proto_tree_add_text(tree, asn1->tvb,
10087         saved_offset, asn1->offset - saved_offset,
10088         "%s :  %s",
10089         bigbuf, str);
10090
10091     switch ((value & 0x20) >> 5)
10092     {
10093     case 0x00: str = "System is not capable of supporting the Trigger Address List parameter (WADDR)"; break;
10094     default:
10095         str = "System is capable of supporting the Trigger Address List parameter (WADDR)";
10096         break;
10097     }
10098
10099     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
10100     proto_tree_add_text(tree, asn1->tvb,
10101         saved_offset, asn1->offset - saved_offset,
10102         "%s :  %s",
10103         bigbuf, str);
10104
10105     switch ((value & 0x10) >> 4)
10106     {
10107     case 0x00: str = "System is not capable of supporting the Termination List parameter (TL)"; break;
10108     default:
10109         str = "System is capable of supporting the Termination List parameter (TL)";
10110         break;
10111     }
10112
10113     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
10114     proto_tree_add_text(tree, asn1->tvb,
10115         saved_offset, asn1->offset - saved_offset,
10116         "%s :  %s",
10117         bigbuf, str);
10118
10119     p = other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
10120     switch (value & 0x0f)
10121     {
10122     case 0x00: strcat(p, " :  System cannot accept a termination at this time"); break;
10123     default:
10124         sprintf(p, " :  System supports %u call leg(s)", value & 0x0f);
10125         break;
10126     }
10127
10128     proto_tree_add_text(tree, asn1->tvb,
10129         saved_offset, asn1->offset - saved_offset,
10130         "%s",
10131         bigbuf);
10132
10133     if (len == 2) return;
10134
10135     saved_offset = asn1->offset;
10136
10137     asn1_int32_value_decode(asn1, 1, &value);
10138
10139     other_decode_bitfield_value(bigbuf, value, 0xf8, 8);
10140     proto_tree_add_text(tree, asn1->tvb,
10141         saved_offset, asn1->offset - saved_offset,
10142         "%s :  Reserved",
10143         bigbuf);
10144
10145     switch ((value & 0x04) >> 2)
10146     {
10147     case 0x00: str = "The system is not capable of supporting external MAHO requests"; break;
10148     default:
10149         str = "The system is capable of supporting external MAHO requests (e.g. for positioning)";
10150         break;
10151     }
10152
10153     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
10154     proto_tree_add_text(tree, asn1->tvb,
10155         saved_offset, asn1->offset - saved_offset,
10156         "%s :  %s",
10157         bigbuf, str);
10158
10159     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
10160     proto_tree_add_text(tree, asn1->tvb,
10161         saved_offset, asn1->offset - saved_offset,
10162         "%s :  Reserved",
10163         bigbuf);
10164
10165     EXTRANEOUS_DATA_CHECK(len, 3);
10166 }
10167
10168 static void
10169 param_spini_trig(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
10170 {
10171     gint32 value;
10172     guint saved_offset;
10173     gchar *str = NULL;
10174
10175     SHORT_DATA_CHECK(len, 4);
10176
10177     add_string = add_string;
10178     saved_offset = asn1->offset;
10179
10180     asn1_int32_value_decode(asn1, 1, &value);
10181
10182     switch ((value & 0x80) >> 7)
10183     {
10184     case 0x00: str = "Trigger is not active"; break;
10185     default:
10186         str = "Execute local SPINI procedures for any Revertive Call attempt"; break;
10187         break;
10188     }
10189
10190     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
10191     proto_tree_add_text(tree, asn1->tvb,
10192         saved_offset, asn1->offset - saved_offset,
10193         "%s :  Revertive Call (RvtC), %s",
10194         bigbuf, str);
10195
10196     switch ((value & 0x40) >> 6)
10197     {
10198     case 0x00: str = "Trigger is not active"; break;
10199     default:
10200         str = "Execute local SPINI procedures for any call attempt to an unrecognized number"; break;
10201         break;
10202     }
10203
10204     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
10205     proto_tree_add_text(tree, asn1->tvb,
10206         saved_offset, asn1->offset - saved_offset,
10207         "%s :  Unrecognized Number (Unrec), %s",
10208         bigbuf, str);
10209
10210     switch ((value & 0x20) >> 5)
10211     {
10212     case 0x00: str = "Trigger is not active"; break;
10213     default:
10214         str = "Execute local SPINI procedures for any call attempt outside of the current World Zone (as defined in ITU-T Rec. E.164)";
10215         break;
10216     }
10217
10218     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
10219     proto_tree_add_text(tree, asn1->tvb,
10220         saved_offset, asn1->offset - saved_offset,
10221         "%s :  World Zone (WZ), %s",
10222         bigbuf, str);
10223
10224     switch ((value & 0x10) >> 4)
10225     {
10226     case 0x00: str = "Trigger is not active"; break;
10227     default:
10228         str = "Execute local SPINI procedures for any international call attempt";
10229         break;
10230     }
10231
10232     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
10233     proto_tree_add_text(tree, asn1->tvb,
10234         saved_offset, asn1->offset - saved_offset,
10235         "%s :  International (Intl), %s",
10236         bigbuf, str);
10237
10238     switch ((value & 0x08) >> 3)
10239     {
10240     case 0x00: str = "Trigger is not active"; break;
10241     default:
10242         str = "Execute local SPINI procedures for any toll calls outside the local carrier's serving area";
10243         break;
10244     }
10245
10246     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
10247     proto_tree_add_text(tree, asn1->tvb,
10248         saved_offset, asn1->offset - saved_offset,
10249         "%s :  Non-Local (Inter-LATA) Toll (NLTOLL/OLATA), %s",
10250         bigbuf, str);
10251
10252     switch ((value & 0x04) >> 2)
10253     {
10254     case 0x00: str = "Trigger is not active"; break;
10255     default:
10256         str = "Execute local SPINI procedures for any local toll call attempt.  Refers to intra-LATA toll within the NANP";
10257         break;
10258     }
10259
10260     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
10261     proto_tree_add_text(tree, asn1->tvb,
10262         saved_offset, asn1->offset - saved_offset,
10263         "%s :  Local (Intra-LATA) Toll (LTOLL/ILATA), %s",
10264         bigbuf, str);
10265
10266     switch ((value & 0x02) >> 1)
10267     {
10268     case 0x00: str = "Trigger is not active"; break;
10269     default:
10270         str = "Execute local SPINI procedures for any local call attempt";
10271         break;
10272     }
10273
10274     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
10275     proto_tree_add_text(tree, asn1->tvb,
10276         saved_offset, asn1->offset - saved_offset,
10277         "%s :  Local, %s",
10278         bigbuf, str);
10279
10280     switch (value & 0x01)
10281     {
10282     case 0x00: str = "Trigger is not active"; break;
10283     default:
10284         str = "Execute local SPINI procedures for any call attempt. This overrides all other values.";
10285         break;
10286     }
10287
10288     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
10289     proto_tree_add_text(tree, asn1->tvb,
10290         saved_offset, asn1->offset - saved_offset,
10291         "%s :  All Origination (All), %s",
10292         bigbuf, str);
10293
10294     saved_offset = asn1->offset;
10295
10296     asn1_int32_value_decode(asn1, 1, &value);
10297
10298     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
10299     proto_tree_add_text(tree, asn1->tvb,
10300         saved_offset, asn1->offset - saved_offset,
10301         "%s :  Reserved",
10302         bigbuf);
10303
10304     switch ((value & 0x10) >> 4)
10305     {
10306     case 0x00: str = "Trigger is not active"; break;
10307     default:
10308         str = "Execute local SPINI procedures for any number matching a criteria of a prior agreement";
10309         break;
10310     }
10311
10312     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
10313     proto_tree_add_text(tree, asn1->tvb,
10314         saved_offset, asn1->offset - saved_offset,
10315         "%s :  Prior Agreement (PA), %s",
10316         bigbuf, str);
10317
10318     switch ((value & 0x08) >> 3)
10319     {
10320     case 0x00: str = "Trigger is not active"; break;
10321     default:
10322         str = "Execute local SPINI procedures for any number beginning with two Pound ## digits";
10323         break;
10324     }
10325
10326     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
10327     proto_tree_add_text(tree, asn1->tvb,
10328         saved_offset, asn1->offset - saved_offset,
10329         "%s :  Double Pound (DP), %s",
10330         bigbuf, str);
10331
10332     switch ((value & 0x04) >> 2)
10333     {
10334     case 0x00: str = "Trigger is not active"; break;
10335     default:
10336         str = "Execute local SPINI procedures for any number beginning with a Pound # digit";
10337         break;
10338     }
10339
10340     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
10341     proto_tree_add_text(tree, asn1->tvb,
10342         saved_offset, asn1->offset - saved_offset,
10343         "%s :  Pound, %s",
10344         bigbuf, str);
10345
10346     switch ((value & 0x02) >> 1)
10347     {
10348     case 0x00: str = "Trigger is not active"; break;
10349     default:
10350         str = "Execute local SPINI procedures for any number beginning with two Star ** digits";
10351         break;
10352     }
10353
10354     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
10355     proto_tree_add_text(tree, asn1->tvb,
10356         saved_offset, asn1->offset - saved_offset,
10357         "%s :  Double Star (DS), %s",
10358         bigbuf, str);
10359
10360     switch (value & 0x01)
10361     {
10362     case 0x00: str = "Trigger is not active"; break;
10363     default:
10364         str = "Execute local SPINI procedures for any number beginning with a Star * digit";
10365         break;
10366     }
10367
10368     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
10369     proto_tree_add_text(tree, asn1->tvb,
10370         saved_offset, asn1->offset - saved_offset,
10371         "%s :  Star, %s",
10372         bigbuf, str);
10373
10374     saved_offset = asn1->offset;
10375
10376     asn1_int32_value_decode(asn1, 1, &value);
10377
10378     switch ((value & 0x80) >> 7)
10379     {
10380     case 0x00: str = "Trigger is not active"; break;
10381     default:
10382         str = "Execute local SPINI procedures for any call attempt with 7 digits";
10383         break;
10384     }
10385
10386     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
10387     proto_tree_add_text(tree, asn1->tvb,
10388         saved_offset, asn1->offset - saved_offset,
10389         "%s :  7 digits, %s",
10390         bigbuf, str);
10391
10392     switch ((value & 0x40) >> 6)
10393     {
10394     case 0x00: str = "Trigger is not active"; break;
10395     default:
10396         str = "Execute local SPINI procedures for any call attempt with 6 digits";
10397         break;
10398     }
10399
10400     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
10401     proto_tree_add_text(tree, asn1->tvb,
10402         saved_offset, asn1->offset - saved_offset,
10403         "%s :  6 digits, %s",
10404         bigbuf, str);
10405
10406     switch ((value & 0x20) >> 5)
10407     {
10408     case 0x00: str = "Trigger is not active"; break;
10409     default:
10410         str = "Execute local SPINI procedures for any call attempt with 5 digits";
10411         break;
10412     }
10413
10414     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
10415     proto_tree_add_text(tree, asn1->tvb,
10416         saved_offset, asn1->offset - saved_offset,
10417         "%s :  5 digits, %s",
10418         bigbuf, str);
10419
10420     switch ((value & 0x10) >> 4)
10421     {
10422     case 0x00: str = "Trigger is not active"; break;
10423     default:
10424         str = "Execute local SPINI procedures for any call attempt with 4 digits";
10425         break;
10426     }
10427
10428     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
10429     proto_tree_add_text(tree, asn1->tvb,
10430         saved_offset, asn1->offset - saved_offset,
10431         "%s :  4 digits, %s",
10432         bigbuf, str);
10433
10434     switch ((value & 0x08) >> 3)
10435     {
10436     case 0x00: str = "Trigger is not active"; break;
10437     default:
10438         str = "Execute local SPINI procedures for any call attempt with 3 digits";
10439         break;
10440     }
10441
10442     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
10443     proto_tree_add_text(tree, asn1->tvb,
10444         saved_offset, asn1->offset - saved_offset,
10445         "%s :  3 digits, %s",
10446         bigbuf, str);
10447
10448     switch ((value & 0x04) >> 2)
10449     {
10450     case 0x00: str = "Trigger is not active"; break;
10451     default:
10452         str = "Execute local SPINI procedures for any call attempt with 2 digits";
10453         break;
10454     }
10455
10456     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
10457     proto_tree_add_text(tree, asn1->tvb,
10458         saved_offset, asn1->offset - saved_offset,
10459         "%s :  2 digits, %s",
10460         bigbuf, str);
10461
10462     switch ((value & 0x02) >> 1)
10463     {
10464     case 0x00: str = "Trigger is not active"; break;
10465     default:
10466         str = "Execute local SPINI procedures for any call attempt with 1 digits";
10467         break;
10468     }
10469
10470     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
10471     proto_tree_add_text(tree, asn1->tvb,
10472         saved_offset, asn1->offset - saved_offset,
10473         "%s :  1 digits, %s",
10474         bigbuf, str);
10475
10476     switch (value & 0x01)
10477     {
10478     case 0x00: str = "Trigger is not active"; break;
10479     default:
10480         str = "Execute local SPINI procedures for any call attempt with no digits";
10481         break;
10482     }
10483
10484     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
10485     proto_tree_add_text(tree, asn1->tvb,
10486         saved_offset, asn1->offset - saved_offset,
10487         "%s :  No digits, %s",
10488         bigbuf, str);
10489
10490     saved_offset = asn1->offset;
10491
10492     asn1_int32_value_decode(asn1, 1, &value);
10493
10494     switch ((value & 0x80) >> 7)
10495     {
10496     case 0x00: str = "Trigger is not active"; break;
10497     default:
10498         str = "Execute local SPINI procedures for any call attempt with 15 or more digits";
10499         break;
10500     }
10501
10502     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
10503     proto_tree_add_text(tree, asn1->tvb,
10504         saved_offset, asn1->offset - saved_offset,
10505         "%s :  15 digits, %s",
10506         bigbuf, str);
10507
10508     switch ((value & 0x40) >> 6)
10509     {
10510     case 0x00: str = "Trigger is not active"; break;
10511     default:
10512         str = "Execute local SPINI procedures for any call attempt with 14 digits";
10513         break;
10514     }
10515
10516     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
10517     proto_tree_add_text(tree, asn1->tvb,
10518         saved_offset, asn1->offset - saved_offset,
10519         "%s :  14 digits, %s",
10520         bigbuf, str);
10521
10522     switch ((value & 0x20) >> 5)
10523     {
10524     case 0x00: str = "Trigger is not active"; break;
10525     default:
10526         str = "Execute local SPINI procedures for any call attempt with 13 digits";
10527         break;
10528     }
10529
10530     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
10531     proto_tree_add_text(tree, asn1->tvb,
10532         saved_offset, asn1->offset - saved_offset,
10533         "%s :  13 digits, %s",
10534         bigbuf, str);
10535
10536     switch ((value & 0x10) >> 4)
10537     {
10538     case 0x00: str = "Trigger is not active"; break;
10539     default:
10540         str = "Execute local SPINI procedures for any call attempt with 12 digits";
10541         break;
10542     }
10543
10544     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
10545     proto_tree_add_text(tree, asn1->tvb,
10546         saved_offset, asn1->offset - saved_offset,
10547         "%s :  12 digits, %s",
10548         bigbuf, str);
10549
10550     switch ((value & 0x08) >> 3)
10551     {
10552     case 0x00: str = "Trigger is not active"; break;
10553     default:
10554         str = "Execute local SPINI procedures for any call attempt with 11 digits";
10555         break;
10556     }
10557
10558     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
10559     proto_tree_add_text(tree, asn1->tvb,
10560         saved_offset, asn1->offset - saved_offset,
10561         "%s :  11 digits, %s",
10562         bigbuf, str);
10563
10564     switch ((value & 0x04) >> 2)
10565     {
10566     case 0x00: str = "Trigger is not active"; break;
10567     default:
10568         str = "Execute local SPINI procedures for any call attempt with 10 digits";
10569         break;
10570     }
10571
10572     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
10573     proto_tree_add_text(tree, asn1->tvb,
10574         saved_offset, asn1->offset - saved_offset,
10575         "%s :  10 digits, %s",
10576         bigbuf, str);
10577
10578     switch ((value & 0x02) >> 1)
10579     {
10580     case 0x00: str = "Trigger is not active"; break;
10581     default:
10582         str = "Execute local SPINI procedures for any call attempt with 9 digits";
10583         break;
10584     }
10585
10586     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
10587     proto_tree_add_text(tree, asn1->tvb,
10588         saved_offset, asn1->offset - saved_offset,
10589         "%s :  9 digits, %s",
10590         bigbuf, str);
10591
10592     switch (value & 0x01)
10593     {
10594     case 0x00: str = "Trigger is not active"; break;
10595     default:
10596         str = "Execute local SPINI procedures for any call attempt with 8 digits";
10597         break;
10598     }
10599
10600     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
10601     proto_tree_add_text(tree, asn1->tvb,
10602         saved_offset, asn1->offset - saved_offset,
10603         "%s :  8 digits, %s",
10604         bigbuf, str);
10605
10606     EXTRANEOUS_DATA_CHECK(len, 4);
10607 }
10608
10609 static void
10610 param_orig_trig(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
10611 {
10612     gint32 value;
10613     guint saved_offset;
10614     gchar *str = NULL;
10615
10616     SHORT_DATA_CHECK(len, 4);
10617
10618     add_string = add_string;
10619     saved_offset = asn1->offset;
10620
10621     asn1_int32_value_decode(asn1, 1, &value);
10622
10623     switch ((value & 0x80) >> 7)
10624     {
10625     case 0x00: str = "Trigger is not active"; break;
10626     default:
10627         str = "Launch an Origination Request for any Revertive Call attempt"; break;
10628         break;
10629     }
10630
10631     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
10632     proto_tree_add_text(tree, asn1->tvb,
10633         saved_offset, asn1->offset - saved_offset,
10634         "%s :  Revertive Call (RvtC), %s",
10635         bigbuf, str);
10636
10637     switch ((value & 0x40) >> 6)
10638     {
10639     case 0x00: str = "Trigger is not active"; break;
10640     default:
10641         str = "Launch an Origination Request for any call attempt to an unrecognized number"; break;
10642         break;
10643     }
10644
10645     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
10646     proto_tree_add_text(tree, asn1->tvb,
10647         saved_offset, asn1->offset - saved_offset,
10648         "%s :  Unrecognized Number (Unrec), %s",
10649         bigbuf, str);
10650
10651     switch ((value & 0x20) >> 5)
10652     {
10653     case 0x00: str = "Trigger is not active"; break;
10654     default:
10655         str = "Launch an Origination Request for any call attempt outside of the current World Zone (as defined in ITU-T Rec. E.164)";
10656         break;
10657     }
10658
10659     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
10660     proto_tree_add_text(tree, asn1->tvb,
10661         saved_offset, asn1->offset - saved_offset,
10662         "%s :  World Zone (WZ), %s",
10663         bigbuf, str);
10664
10665     switch ((value & 0x10) >> 4)
10666     {
10667     case 0x00: str = "Trigger is not active"; break;
10668     default:
10669         str = "Launch an Origination Request for any international call attempt";
10670         break;
10671     }
10672
10673     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
10674     proto_tree_add_text(tree, asn1->tvb,
10675         saved_offset, asn1->offset - saved_offset,
10676         "%s :  International (Intl), %s",
10677         bigbuf, str);
10678
10679     switch ((value & 0x08) >> 3)
10680     {
10681     case 0x00: str = "Trigger is not active"; break;
10682     default:
10683         str = "Launch an Origination Request for any toll calls outside the local carrier's serving area";
10684         break;
10685     }
10686
10687     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
10688     proto_tree_add_text(tree, asn1->tvb,
10689         saved_offset, asn1->offset - saved_offset,
10690         "%s :  Non-Local (Inter-LATA) Toll (NLTOLL/OLATA), %s",
10691         bigbuf, str);
10692
10693     switch ((value & 0x04) >> 2)
10694     {
10695     case 0x00: str = "Trigger is not active"; break;
10696     default:
10697         str = "Launch an Origination Request for any local toll call attempt.  Refers to intra-LATA toll within the NANP";
10698         break;
10699     }
10700
10701     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
10702     proto_tree_add_text(tree, asn1->tvb,
10703         saved_offset, asn1->offset - saved_offset,
10704         "%s :  Local (Intra-LATA) Toll (LTOLL/ILATA), %s",
10705         bigbuf, str);
10706
10707     switch ((value & 0x02) >> 1)
10708     {
10709     case 0x00: str = "Trigger is not active"; break;
10710     default:
10711         str = "Launch an Origination Request for any local call attempt";
10712         break;
10713     }
10714
10715     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
10716     proto_tree_add_text(tree, asn1->tvb,
10717         saved_offset, asn1->offset - saved_offset,
10718         "%s :  Local, %s",
10719         bigbuf, str);
10720
10721     switch (value & 0x01)
10722     {
10723     case 0x00: str = "Trigger is not active"; break;
10724     default:
10725         str = "Launch an Origination Request for any call attempt. This overrides all other values.";
10726         break;
10727     }
10728
10729     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
10730     proto_tree_add_text(tree, asn1->tvb,
10731         saved_offset, asn1->offset - saved_offset,
10732         "%s :  All Origination (All), %s",
10733         bigbuf, str);
10734
10735     saved_offset = asn1->offset;
10736
10737     asn1_int32_value_decode(asn1, 1, &value);
10738
10739     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
10740     proto_tree_add_text(tree, asn1->tvb,
10741         saved_offset, asn1->offset - saved_offset,
10742         "%s :  Reserved",
10743         bigbuf);
10744
10745     switch ((value & 0x10) >> 4)
10746     {
10747     case 0x00: str = "Trigger is not active"; break;
10748     default:
10749         str = "Launch an Origination Request for any number matching a criteria of a prior agreement";
10750         break;
10751     }
10752
10753     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
10754     proto_tree_add_text(tree, asn1->tvb,
10755         saved_offset, asn1->offset - saved_offset,
10756         "%s :  Prior Agreement (PA), %s",
10757         bigbuf, str);
10758
10759     switch ((value & 0x08) >> 3)
10760     {
10761     case 0x00: str = "Trigger is not active"; break;
10762     default:
10763         str = "Launch an Origination Request for any number beginning with two Pound ## digits";
10764         break;
10765     }
10766
10767     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
10768     proto_tree_add_text(tree, asn1->tvb,
10769         saved_offset, asn1->offset - saved_offset,
10770         "%s :  Double Pound (DP), %s",
10771         bigbuf, str);
10772
10773     switch ((value & 0x04) >> 2)
10774     {
10775     case 0x00: str = "Trigger is not active"; break;
10776     default:
10777         str = "Launch an Origination Request for any number beginning with a Pound # digit";
10778         break;
10779     }
10780
10781     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
10782     proto_tree_add_text(tree, asn1->tvb,
10783         saved_offset, asn1->offset - saved_offset,
10784         "%s :  Pound, %s",
10785         bigbuf, str);
10786
10787     switch ((value & 0x02) >> 1)
10788     {
10789     case 0x00: str = "Trigger is not active"; break;
10790     default:
10791         str = "Launch an Origination Request for any number beginning with two Star ** digits";
10792         break;
10793     }
10794
10795     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
10796     proto_tree_add_text(tree, asn1->tvb,
10797         saved_offset, asn1->offset - saved_offset,
10798         "%s :  Double Star (DS), %s",
10799         bigbuf, str);
10800
10801     switch (value & 0x01)
10802     {
10803     case 0x00: str = "Trigger is not active"; break;
10804     default:
10805         str = "Launch an Origination Request for any number beginning with a Star * digit";
10806         break;
10807     }
10808
10809     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
10810     proto_tree_add_text(tree, asn1->tvb,
10811         saved_offset, asn1->offset - saved_offset,
10812         "%s :  Star, %s",
10813         bigbuf, str);
10814
10815     saved_offset = asn1->offset;
10816
10817     asn1_int32_value_decode(asn1, 1, &value);
10818
10819     switch ((value & 0x80) >> 7)
10820     {
10821     case 0x00: str = "Trigger is not active"; break;
10822     default:
10823         str = "Launch an Origination Request for any call attempt with 7 digits";
10824         break;
10825     }
10826
10827     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
10828     proto_tree_add_text(tree, asn1->tvb,
10829         saved_offset, asn1->offset - saved_offset,
10830         "%s :  7 digits, %s",
10831         bigbuf, str);
10832
10833     switch ((value & 0x40) >> 6)
10834     {
10835     case 0x00: str = "Trigger is not active"; break;
10836     default:
10837         str = "Launch an Origination Request for any call attempt with 6 digits";
10838         break;
10839     }
10840
10841     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
10842     proto_tree_add_text(tree, asn1->tvb,
10843         saved_offset, asn1->offset - saved_offset,
10844         "%s :  6 digits, %s",
10845         bigbuf, str);
10846
10847     switch ((value & 0x20) >> 5)
10848     {
10849     case 0x00: str = "Trigger is not active"; break;
10850     default:
10851         str = "Launch an Origination Request for any call attempt with 5 digits";
10852         break;
10853     }
10854
10855     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
10856     proto_tree_add_text(tree, asn1->tvb,
10857         saved_offset, asn1->offset - saved_offset,
10858         "%s :  5 digits, %s",
10859         bigbuf, str);
10860
10861     switch ((value & 0x10) >> 4)
10862     {
10863     case 0x00: str = "Trigger is not active"; break;
10864     default:
10865         str = "Launch an Origination Request for any call attempt with 4 digits";
10866         break;
10867     }
10868
10869     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
10870     proto_tree_add_text(tree, asn1->tvb,
10871         saved_offset, asn1->offset - saved_offset,
10872         "%s :  4 digits, %s",
10873         bigbuf, str);
10874
10875     switch ((value & 0x08) >> 3)
10876     {
10877     case 0x00: str = "Trigger is not active"; break;
10878     default:
10879         str = "Launch an Origination Request for any call attempt with 3 digits";
10880         break;
10881     }
10882
10883     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
10884     proto_tree_add_text(tree, asn1->tvb,
10885         saved_offset, asn1->offset - saved_offset,
10886         "%s :  3 digits, %s",
10887         bigbuf, str);
10888
10889     switch ((value & 0x04) >> 2)
10890     {
10891     case 0x00: str = "Trigger is not active"; break;
10892     default:
10893         str = "Launch an Origination Request for any call attempt with 2 digits";
10894         break;
10895     }
10896
10897     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
10898     proto_tree_add_text(tree, asn1->tvb,
10899         saved_offset, asn1->offset - saved_offset,
10900         "%s :  2 digits, %s",
10901         bigbuf, str);
10902
10903     switch ((value & 0x02) >> 1)
10904     {
10905     case 0x00: str = "Trigger is not active"; break;
10906     default:
10907         str = "Launch an Origination Request for any call attempt with 1 digits";
10908         break;
10909     }
10910
10911     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
10912     proto_tree_add_text(tree, asn1->tvb,
10913         saved_offset, asn1->offset - saved_offset,
10914         "%s :  1 digits, %s",
10915         bigbuf, str);
10916
10917     switch (value & 0x01)
10918     {
10919     case 0x00: str = "Trigger is not active"; break;
10920     default:
10921         str = "Launch an Origination Request for any call attempt with no digits";
10922         break;
10923     }
10924
10925     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
10926     proto_tree_add_text(tree, asn1->tvb,
10927         saved_offset, asn1->offset - saved_offset,
10928         "%s :  No digits, %s",
10929         bigbuf, str);
10930
10931     saved_offset = asn1->offset;
10932
10933     asn1_int32_value_decode(asn1, 1, &value);
10934
10935     switch ((value & 0x80) >> 7)
10936     {
10937     case 0x00: str = "Trigger is not active"; break;
10938     default:
10939         str = "Launch an Origination Request for any call attempt with 15 or more digits";
10940         break;
10941     }
10942
10943     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
10944     proto_tree_add_text(tree, asn1->tvb,
10945         saved_offset, asn1->offset - saved_offset,
10946         "%s :  15 digits, %s",
10947         bigbuf, str);
10948
10949     switch ((value & 0x40) >> 6)
10950     {
10951     case 0x00: str = "Trigger is not active"; break;
10952     default:
10953         str = "Launch an Origination Request for any call attempt with 14 digits";
10954         break;
10955     }
10956
10957     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
10958     proto_tree_add_text(tree, asn1->tvb,
10959         saved_offset, asn1->offset - saved_offset,
10960         "%s :  14 digits, %s",
10961         bigbuf, str);
10962
10963     switch ((value & 0x20) >> 5)
10964     {
10965     case 0x00: str = "Trigger is not active"; break;
10966     default:
10967         str = "Launch an Origination Request for any call attempt with 13 digits";
10968         break;
10969     }
10970
10971     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
10972     proto_tree_add_text(tree, asn1->tvb,
10973         saved_offset, asn1->offset - saved_offset,
10974         "%s :  13 digits, %s",
10975         bigbuf, str);
10976
10977     switch ((value & 0x10) >> 4)
10978     {
10979     case 0x00: str = "Trigger is not active"; break;
10980     default:
10981         str = "Launch an Origination Request for any call attempt with 12 digits";
10982         break;
10983     }
10984
10985     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
10986     proto_tree_add_text(tree, asn1->tvb,
10987         saved_offset, asn1->offset - saved_offset,
10988         "%s :  12 digits, %s",
10989         bigbuf, str);
10990
10991     switch ((value & 0x08) >> 3)
10992     {
10993     case 0x00: str = "Trigger is not active"; break;
10994     default:
10995         str = "Launch an Origination Request for any call attempt with 11 digits";
10996         break;
10997     }
10998
10999     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
11000     proto_tree_add_text(tree, asn1->tvb,
11001         saved_offset, asn1->offset - saved_offset,
11002         "%s :  11 digits, %s",
11003         bigbuf, str);
11004
11005     switch ((value & 0x04) >> 2)
11006     {
11007     case 0x00: str = "Trigger is not active"; break;
11008     default:
11009         str = "Launch an Origination Request for any call attempt with 10 digits";
11010         break;
11011     }
11012
11013     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
11014     proto_tree_add_text(tree, asn1->tvb,
11015         saved_offset, asn1->offset - saved_offset,
11016         "%s :  10 digits, %s",
11017         bigbuf, str);
11018
11019     switch ((value & 0x02) >> 1)
11020     {
11021     case 0x00: str = "Trigger is not active"; break;
11022     default:
11023         str = "Launch an Origination Request for any call attempt with 9 digits";
11024         break;
11025     }
11026
11027     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
11028     proto_tree_add_text(tree, asn1->tvb,
11029         saved_offset, asn1->offset - saved_offset,
11030         "%s :  9 digits, %s",
11031         bigbuf, str);
11032
11033     switch (value & 0x01)
11034     {
11035     case 0x00: str = "Trigger is not active"; break;
11036     default:
11037         str = "Launch an Origination Request for any call attempt with 8 digits";
11038         break;
11039     }
11040
11041     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
11042     proto_tree_add_text(tree, asn1->tvb,
11043         saved_offset, asn1->offset - saved_offset,
11044         "%s :  8 digits, %s",
11045         bigbuf, str);
11046
11047     EXTRANEOUS_DATA_CHECK(len, 4);
11048 }
11049
11050 static void
11051 param_trig_cap(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
11052 {
11053     gint32 value;
11054     guint saved_offset;
11055     gchar *str = NULL;
11056
11057     add_string = add_string;
11058     saved_offset = asn1->offset;
11059
11060     asn1_int32_value_decode(asn1, 1, &value);
11061
11062     switch ((value & 0x80) >> 7)
11063     {
11064     case 0x00: str = "O No Answer (ONA) cannot be armed"; break;
11065     default:
11066         str = "O No Answer (ONA) can be armed";
11067         break;
11068     }
11069
11070     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
11071     proto_tree_add_text(tree, asn1->tvb,
11072         saved_offset, asn1->offset - saved_offset,
11073         "%s :  %s",
11074         bigbuf, str);
11075
11076     switch ((value & 0x40) >> 6)
11077     {
11078     case 0x00: str = "O Disconnect (ODISC) cannot be armed"; break;
11079     default:
11080         str = "O Disconnect (ODISC) can be armed";
11081         break;
11082     }
11083
11084     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
11085     proto_tree_add_text(tree, asn1->tvb,
11086         saved_offset, asn1->offset - saved_offset,
11087         "%s :  %s",
11088         bigbuf, str);
11089
11090     switch ((value & 0x20) >> 5)
11091     {
11092     case 0x00: str = "O Answer (OANS) cannot be armed"; break;
11093     default:
11094         str = "O Answer (OANS) can be armed";
11095         break;
11096     }
11097
11098     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
11099     proto_tree_add_text(tree, asn1->tvb,
11100         saved_offset, asn1->offset - saved_offset,
11101         "%s :  %s",
11102         bigbuf, str);
11103
11104     switch ((value & 0x10) >> 4)
11105     {
11106     case 0x00: str = "Origination Attempt Authorized (OAA) cannot be armed"; break;
11107     default:
11108         str = "Origination Attempt Authorized (OAA) can be armed";
11109         break;
11110     }
11111
11112     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
11113     proto_tree_add_text(tree, asn1->tvb,
11114         saved_offset, asn1->offset - saved_offset,
11115         "%s :  %s",
11116         bigbuf, str);
11117
11118     switch ((value & 0x08) >> 3)
11119     {
11120     case 0x00: str = "Revertive Call trigger (RvtC) cannot be armed"; break;
11121     default:
11122         str = "Revertive Call trigger (RvtC) can be armed";
11123         break;
11124     }
11125
11126     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
11127     proto_tree_add_text(tree, asn1->tvb,
11128         saved_offset, asn1->offset - saved_offset,
11129         "%s :  %s",
11130         bigbuf, str);
11131
11132     switch ((value & 0x04) >> 2)
11133     {
11134     case 0x00: str = "All Calls trigger (All) cannot be armed"; break;
11135     default:
11136         str = "All Calls trigger (All) can be armed";
11137         break;
11138     }
11139
11140     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
11141     proto_tree_add_text(tree, asn1->tvb,
11142         saved_offset, asn1->offset - saved_offset,
11143         "%s :  %s",
11144         bigbuf, str);
11145
11146     switch ((value & 0x02) >> 1)
11147     {
11148     case 0x00: str = "K-digit triggers (K-digit) cannot be armed"; break;
11149     default:
11150         str = "K-digit triggers (K-digit) can be armed";
11151         break;
11152     }
11153
11154     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
11155     proto_tree_add_text(tree, asn1->tvb,
11156         saved_offset, asn1->offset - saved_offset,
11157         "%s :  %s",
11158         bigbuf, str);
11159
11160     switch (value & 0x01)
11161     {
11162     case 0x00: str = "Introducing Star/Pound triggers (INIT) cannot be armed"; break;
11163     default:
11164         str = "Introducing Star/Pound triggers (INIT) can be armed";
11165         break;
11166     }
11167
11168     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
11169     proto_tree_add_text(tree, asn1->tvb,
11170         saved_offset, asn1->offset - saved_offset,
11171         "%s :  %s",
11172         bigbuf, str);
11173
11174     if (len == 1) return;
11175
11176     saved_offset = asn1->offset;
11177
11178     asn1_int32_value_decode(asn1, 1, &value);
11179
11180     switch ((value & 0x80) >> 7)
11181     {
11182     case 0x00: str = "O Called Party Busy (OBSY) cannot be armed"; break;
11183     default:
11184         str = "O Called Party Busy (OBSY) can be armed";
11185         break;
11186     }
11187
11188     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
11189     proto_tree_add_text(tree, asn1->tvb,
11190         saved_offset, asn1->offset - saved_offset,
11191         "%s :  %s",
11192         bigbuf, str);
11193
11194     switch ((value & 0x40) >> 6)
11195     {
11196     case 0x00: str = "Called Routing Address Available (CdRAA) cannot be armed"; break;
11197     default:
11198         str = "Called Routing Address Available (CdRAA) can be armed";
11199         break;
11200     }
11201
11202     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
11203     proto_tree_add_text(tree, asn1->tvb,
11204         saved_offset, asn1->offset - saved_offset,
11205         "%s :  %s",
11206         bigbuf, str);
11207
11208     switch ((value & 0x20) >> 5)
11209     {
11210     case 0x00: str = "Initial Termination (IT) cannot be armed"; break;
11211     default:
11212         str = "Initial Termination (IT) can be armed";
11213         break;
11214     }
11215
11216     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
11217     proto_tree_add_text(tree, asn1->tvb,
11218         saved_offset, asn1->offset - saved_offset,
11219         "%s :  %s",
11220         bigbuf, str);
11221
11222     switch ((value & 0x10) >> 4)
11223     {
11224     case 0x00: str = "Calling Routing Address Available (CgRAA) cannot be armed"; break;
11225     default:
11226         str = "Calling Routing Address Available (CgRAA) can be armed";
11227         break;
11228     }
11229
11230     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
11231     proto_tree_add_text(tree, asn1->tvb,
11232         saved_offset, asn1->offset - saved_offset,
11233         "%s :  %s",
11234         bigbuf, str);
11235
11236     switch ((value & 0x08) >> 3)
11237     {
11238     case 0x00: str = "Advanced Termination trigger (AT) cannot be armed"; break;
11239     default:
11240         str = "Advanced Termination trigger (AT) can be armed";
11241         break;
11242     }
11243
11244     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
11245     proto_tree_add_text(tree, asn1->tvb,
11246         saved_offset, asn1->offset - saved_offset,
11247         "%s :  %s",
11248         bigbuf, str);
11249
11250     switch ((value & 0x04) >> 2)
11251     {
11252     case 0x00: str = "Prior Agreement trigger (PA) cannot be armed"; break;
11253     default:
11254         str = "Prior Agreement trigger (PA) can be armed";
11255         break;
11256     }
11257
11258     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
11259     proto_tree_add_text(tree, asn1->tvb,
11260         saved_offset, asn1->offset - saved_offset,
11261         "%s :  %s",
11262         bigbuf, str);
11263
11264     switch ((value & 0x02) >> 1)
11265     {
11266     case 0x00: str = "Unrecognized Number trigger (Unrec) cannot be armed"; break;
11267     default:
11268         str = "Unrecognized Number trigger (Unrec) can be armed";
11269         break;
11270     }
11271
11272     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
11273     proto_tree_add_text(tree, asn1->tvb,
11274         saved_offset, asn1->offset - saved_offset,
11275         "%s :  %s",
11276         bigbuf, str);
11277
11278     switch (value & 0x01)
11279     {
11280     case 0x00: str = "Call Type triggers (CT) cannot be armed"; break;
11281     default:
11282         str = "Call Type triggers (CT) can be armed";
11283         break;
11284     }
11285
11286     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
11287     proto_tree_add_text(tree, asn1->tvb,
11288         saved_offset, asn1->offset - saved_offset,
11289         "%s :  %s",
11290         bigbuf, str);
11291
11292     if (len == 2) return;
11293
11294     saved_offset = asn1->offset;
11295
11296     asn1_int32_value_decode(asn1, 1, &value);
11297
11298     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
11299     proto_tree_add_text(tree, asn1->tvb,
11300         saved_offset, asn1->offset - saved_offset,
11301         "%s :  Reserved",
11302         bigbuf);
11303
11304     switch ((value & 0x10) >> 4)
11305     {
11306     case 0x00: str = "T Disconnect (TDISC) cannot be armed"; break;
11307     default:
11308         str = "T Disconnect (TDISC) can be armed";
11309         break;
11310     }
11311
11312     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
11313     proto_tree_add_text(tree, asn1->tvb,
11314         saved_offset, asn1->offset - saved_offset,
11315         "%s :  %s",
11316         bigbuf, str);
11317
11318     switch ((value & 0x08) >> 3)
11319     {
11320     case 0x00: str = "T Answer (TANS) cannot be armed"; break;
11321     default:
11322         str = "T Answer (TANS) can be armed";
11323         break;
11324     }
11325
11326     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
11327     proto_tree_add_text(tree, asn1->tvb,
11328         saved_offset, asn1->offset - saved_offset,
11329         "%s :  %s",
11330         bigbuf, str);
11331
11332     switch ((value & 0x04) >> 2)
11333     {
11334     case 0x00: str = "T No Answer trigger (TNA) cannot be armed"; break;
11335     default:
11336         str = "T No Answer trigger (TNA) can be armed";
11337         break;
11338     }
11339
11340     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
11341     proto_tree_add_text(tree, asn1->tvb,
11342         saved_offset, asn1->offset - saved_offset,
11343         "%s :  %s",
11344         bigbuf, str);
11345
11346     switch ((value & 0x02) >> 1)
11347     {
11348     case 0x00: str = "T Busy trigger (TBusy) cannot be armed"; break;
11349     default:
11350         str = "T Busy trigger (TBusy) can be armed";
11351         break;
11352     }
11353
11354     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
11355     proto_tree_add_text(tree, asn1->tvb,
11356         saved_offset, asn1->offset - saved_offset,
11357         "%s :  %s",
11358         bigbuf, str);
11359
11360     switch (value & 0x01)
11361     {
11362     case 0x00: str = "Terminating Resource Available triggers (TRA) cannot be armed"; break;
11363     default:
11364         str = "Terminating Resource Available triggers (TRA) can be armed";
11365         break;
11366     }
11367
11368     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
11369     proto_tree_add_text(tree, asn1->tvb,
11370         saved_offset, asn1->offset - saved_offset,
11371         "%s :  %s",
11372         bigbuf, str);
11373
11374     EXTRANEOUS_DATA_CHECK(len, 3);
11375 }
11376
11377 static void
11378 param_sys_cap(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
11379 {
11380     gint32 value;
11381     guint saved_offset;
11382     gchar *str = NULL;
11383
11384     EXACT_DATA_CHECK(len, 1);
11385
11386     add_string = add_string;
11387     saved_offset = asn1->offset;
11388
11389     asn1_int32_value_decode(asn1, 1, &value);
11390
11391     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
11392     proto_tree_add_text(tree, asn1->tvb,
11393         saved_offset, asn1->offset - saved_offset,
11394         "%s :  Reserved",
11395         bigbuf);
11396
11397     switch ((value & 0x20) >> 5)
11398     {
11399     case 0x00: str = "DP is not supported by the system"; break;
11400     default:
11401         str = "DP is supported by the system";
11402         break;
11403     }
11404
11405     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
11406     proto_tree_add_text(tree, asn1->tvb,
11407         saved_offset, asn1->offset - saved_offset,
11408         "%s :  %s",
11409         bigbuf, str);
11410
11411     switch ((value & 0x10) >> 4)
11412     {
11413     case 0x00: str = "SSD is not shared with the system for the indicated MS"; break;
11414     default:
11415         str = "SSD is shared with the system for the indicated MS";
11416         break;
11417     }
11418
11419     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
11420     proto_tree_add_text(tree, asn1->tvb,
11421         saved_offset, asn1->offset - saved_offset,
11422         "%s :  %s",
11423         bigbuf, str);
11424
11425     switch ((value & 0x08) >> 3)
11426     {
11427     case 0x00: str = "System cannot execute CAVE algorithm"; break;
11428     default:
11429         str = "System can execute CAVE algorithm";
11430         break;
11431     }
11432
11433     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
11434     proto_tree_add_text(tree, asn1->tvb,
11435         saved_offset, asn1->offset - saved_offset,
11436         "%s :  %s",
11437         bigbuf, str);
11438
11439     switch ((value & 0x04) >> 2)
11440     {
11441     case 0x00: str = "Voice Privacy is not supported"; break;
11442     default:
11443         str = "Voice Privacy is supported";
11444         break;
11445     }
11446
11447     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
11448     proto_tree_add_text(tree, asn1->tvb,
11449         saved_offset, asn1->offset - saved_offset,
11450         "%s :  %s",
11451         bigbuf, str);
11452
11453     switch ((value & 0x02) >> 1)
11454     {
11455     case 0x00: str = "SME is not supported"; break;
11456     default:
11457         str = "SME is supported";
11458         break;
11459     }
11460
11461     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
11462     proto_tree_add_text(tree, asn1->tvb,
11463         saved_offset, asn1->offset - saved_offset,
11464         "%s :  %s",
11465         bigbuf, str);
11466
11467     switch (value & 0x01)
11468     {
11469     case 0x00: str = "Authentication parameters were not requested"; break;
11470     default:
11471         str = "Authentication parameters were requested";
11472         break;
11473     }
11474
11475     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
11476     proto_tree_add_text(tree, asn1->tvb,
11477         saved_offset, asn1->offset - saved_offset,
11478         "%s :  %s",
11479         bigbuf, str);
11480 }
11481
11482 static void
11483 param_act_code(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
11484 {
11485     gint32 value;
11486     guint saved_offset;
11487     gchar *str = NULL;
11488
11489     add_string = add_string;
11490     saved_offset = asn1->offset;
11491
11492     asn1_int32_value_decode(asn1, 1, &value);
11493
11494     switch (value)
11495     {
11496     case 0: str = "Not used"; break;
11497     case 1: str = "Continue processing"; break;
11498     case 2: str = "Disconnect call"; break;
11499     case 3: str = "Disconnect call leg"; break;
11500     case 4: str = "Conference calling drop last party"; break;
11501     case 5: str = "Bridge call leg(s) to conference call"; break;
11502     case 6: str = "Drop call leg on busy or routing failure"; break;
11503     case 7: str = "Disconnect all call legs"; break;
11504     case 8: str = "Attach MSC to OTAF"; break;
11505     case 9: str = "Initiate Registration Notification"; break;
11506     case 10: str = "Generate Public Encryption values"; break;
11507     case 11: str = "Generate A-Key"; break;
11508     case 12: str = "Perform SSD Update procedure"; break;
11509     case 13: str = "Perform Re-authentication procedure"; break;
11510     case 14: str = "Release TRN"; break;
11511     case 15: str = "Commit A-key"; break;
11512     case 16: str = "Release Resources"; break;
11513     case 17: str = "Record NEWMSID"; break;
11514     case 18: str = "Allocate Resources"; break;
11515     case 19: str = "Generate Authentication Signature"; break;
11516     case 20: str = "Release leg and redirect subscriber"; break;
11517     case 21: str = "Do Not Wait For MS User Level Response"; break;
11518     default:
11519         if ((value >= 22) && (value <= 95)) { str = "Reserved, treat as Continue processing"; }
11520         if ((value >= 96) && (value <= 127)) { str = "Reserved for protocol extension, treat as Continue processing"; }
11521         if ((value >= 128) && (value <= 223)) { str = "Reserved, treat as Disconnect call"; }
11522         else { str = "Reserved for protocol extension, treat as Disconnect call"; }
11523         break;
11524     }
11525
11526     proto_tree_add_text(tree, asn1->tvb,
11527         saved_offset, asn1->offset - saved_offset,
11528         "Action Code, %s (%u)",
11529         str,
11530         value);
11531
11532     EXTRANEOUS_DATA_CHECK(len, 1);
11533 }
11534
11535 static void
11536 param_border_acc(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
11537 {
11538     gint32 value;
11539     guint saved_offset;
11540     gchar *str = NULL;
11541
11542     EXACT_DATA_CHECK(len, 1);
11543
11544     add_string = add_string;
11545     saved_offset = asn1->offset;
11546
11547     asn1_int32_value_decode(asn1, 1, &value);
11548
11549     switch (value)
11550     {
11551     case 0: str = "Not used"; break;
11552     case 1: str = "Border Cell Access"; break;
11553     default:
11554         if ((value >= 2) && (value <= 223)) { str = "Reserved, treat as Border Cell Access"; }
11555         else { str = "Reserved for protocol extension, treat as Border Cell Access"; }
11556         break;
11557     }
11558
11559     proto_tree_add_text(tree, asn1->tvb,
11560         saved_offset, asn1->offset - saved_offset,
11561         "Indication, %s (%u)",
11562         str,
11563         value);
11564 }
11565
11566 static void
11567 param_avail_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
11568 {
11569     gint32 value;
11570     guint saved_offset;
11571     gchar *str = NULL;
11572
11573     add_string = add_string;
11574     saved_offset = asn1->offset;
11575
11576     asn1_int32_value_decode(asn1, 1, &value);
11577
11578     switch (value)
11579     {
11580     case 0: str = "Not used"; break;
11581     case 1: str = "Unspecified MS inactivity type"; break;
11582     default:
11583         if ((value >= 2) && (value <= 223)) { str = "Reserved, treat as Unspecified"; }
11584         else { str = "Reserved for protocol extension, treat as Unspecified"; }
11585         break;
11586     }
11587
11588     proto_tree_add_text(tree, asn1->tvb,
11589         saved_offset, asn1->offset - saved_offset,
11590         str);
11591
11592     EXTRANEOUS_DATA_CHECK(len, 1);
11593 }
11594
11595 static void
11596 param_can_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
11597 {
11598     gint32 value;
11599     guint saved_offset;
11600     gchar *str = NULL;
11601
11602     add_string = add_string;
11603     saved_offset = asn1->offset;
11604
11605     asn1_int32_value_decode(asn1, 1, &value);
11606
11607     switch (value)
11608     {
11609     case 0: str = "Not used"; break;
11610     case 1: str = "Serving System Option.  The serving system may discontinue a call or service in progress at its option."; break;
11611     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;
11612     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;
11613     default:
11614         if ((value >= 4) && (value <= 223)) { str = "Reserved, treat as Serving System Option"; }
11615         else { str = "Reserved for protocol extension, treat as Serving System Option"; }
11616         break;
11617     }
11618
11619     proto_tree_add_text(tree, asn1->tvb,
11620         saved_offset, asn1->offset - saved_offset,
11621         str);
11622
11623     EXTRANEOUS_DATA_CHECK(len, 1);
11624 }
11625
11626 static void
11627 param_can_den(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
11628 {
11629     gint32 value;
11630     guint saved_offset;
11631     gchar *str = NULL;
11632
11633     EXACT_DATA_CHECK(len, 1);
11634
11635     add_string = add_string;
11636     saved_offset = asn1->offset;
11637
11638     asn1_int32_value_decode(asn1, 1, &value);
11639
11640     switch (value)
11641     {
11642     case 0: str = "Not used"; break;
11643     case 1: str = "Multiple Access"; break;
11644     case 2: str = "Busy"; break;
11645     default:
11646         if ((value >= 3) && (value <= 223)) { str = "Reserved, treat as Multiple Access"; }
11647         else { str = "Reserved for protocol extension, treat as Multiple Access"; }
11648         break;
11649     }
11650
11651     proto_tree_add_text(tree, asn1->tvb,
11652         saved_offset, asn1->offset - saved_offset,
11653         "Indication, %s (%u)",
11654         str,
11655         value);
11656 }
11657
11658 static void
11659 param_acc_den(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
11660 {
11661     gint32 value;
11662     guint saved_offset;
11663     gchar *str = NULL;
11664
11665     EXACT_DATA_CHECK(len, 1);
11666
11667     add_string = add_string;
11668     saved_offset = asn1->offset;
11669
11670     asn1_int32_value_decode(asn1, 1, &value);
11671
11672     switch (value)
11673     {
11674     case 0: str = "Not used"; break;
11675     case 1: str = "Unassigned directory number"; break;
11676     case 2: str = "Inactive"; break;
11677     case 3: str = "Busy"; break;
11678     case 4: str = "Termination denied"; break;
11679     case 5: str = "No Page response"; break;
11680     case 6: str = "Unavailable"; break;
11681     case 7: str = "Service Rejected by MS"; break;
11682     case 8: str = "Service Rejected by the System"; break;
11683     case 9: str = "Service Type Mismatch"; break;
11684     case 10: str = "Service Denied"; break;
11685     case 11: str = "Call Rejected"; break;
11686     default:
11687         if ((value >= 12) && (value <= 223)) { str = "Reserved, treat as Termination denied"; }
11688         else { str = "Reserved for protocol extension, treat as Termination denied"; }
11689         break;
11690     }
11691
11692     proto_tree_add_text(tree, asn1->tvb,
11693         saved_offset, asn1->offset - saved_offset,
11694         "Access Denied Reason, %s (%u)",
11695         str,
11696         value);
11697 }
11698
11699 static void
11700 param_sms_acc_den_reason(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
11701 {
11702     gint32 value;
11703     guint saved_offset;
11704     gchar *str = NULL;
11705
11706     add_string = add_string;
11707     saved_offset = asn1->offset;
11708
11709     asn1_int32_value_decode(asn1, 1, &value);
11710
11711     switch (value)
11712     {
11713     case 0: str = "Not used"; break;
11714     case 1: str = "Denied"; break;
11715     case 2: str = "Postponed"; break;
11716     case 3: str = "Unavailable"; break;
11717     case 4: str = "Invalid"; break;
11718     default:
11719         if ((value >= 5) && (value <= 63)) { str = "Reserved, treat as Denied"; }
11720         else if ((value >= 64) && (value <= 127)) { str = "Reserved, treat as Postponed"; }
11721         else if ((value >= 128) && (value <= 223)) { str = "Reserved, treat as Unavailable"; }
11722         else { str = "Reserved for protocol extension, treat as Unavailable"; }
11723         break;
11724     }
11725
11726     proto_tree_add_text(tree, asn1->tvb,
11727         saved_offset, asn1->offset - saved_offset,
11728         "Access Denied Reason, %s (%u)",
11729         str,
11730         value);
11731
11732     EXTRANEOUS_DATA_CHECK(len, 1);
11733 }
11734
11735 static void
11736 param_sms_bd(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
11737 {
11738     tvbuff_t *next_tvb;
11739
11740     add_string = add_string;
11741
11742     next_tvb = tvb_new_subset(asn1->tvb, asn1->offset, len, len);
11743
11744     if (ansi_map_sms_tele_id != -1)
11745     {
11746         dissector_try_port(is637_tele_id_dissector_table, ansi_map_sms_tele_id, next_tvb, g_pinfo, g_tree);
11747         ansi_map_sms_tele_id = -1;
11748     }
11749     else if (is683_ota)
11750     {
11751         dissector_try_port(is683_dissector_table, ansi_map_is_invoke ? 0 : 1, next_tvb, g_pinfo, g_tree);
11752     }
11753     else if (is801_pld)
11754     {
11755         dissector_try_port(is801_dissector_table, ansi_map_is_invoke ? 0 : 1, next_tvb, g_pinfo, g_tree);
11756     }
11757
11758     proto_tree_add_text(tree, asn1->tvb,
11759         asn1->offset, len,
11760         "Parameter Data");
11761
11762     asn1->offset += len;
11763 }
11764
11765 static void
11766 param_sms_cause(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
11767 {
11768     gint32 value;
11769     guint saved_offset;
11770     gchar *str = NULL;
11771
11772     add_string = add_string;
11773     saved_offset = asn1->offset;
11774
11775     asn1_int32_value_decode(asn1, 1, &value);
11776
11777     switch (value)
11778     {
11779     case 0: str = "Address vacant"; break;
11780     case 1: str = "Address translation failure"; break;
11781     case 2: str = "Network resource shortage"; break;
11782     case 3: str = "Network failure"; break;
11783     case 4: str = "Invalid Teleservice ID"; break;
11784     case 5: str = "Other network problem"; break;
11785     case 6: str = "Unsupported network interface"; break;
11786     case 32: str = "No page response"; break;
11787     case 33: str = "Destination busy"; break;
11788     case 34: str = "No acknowledgement"; break;
11789     case 35: str = "Destination resource shortage"; break;
11790     case 36: str = "SMS delivery postponed"; break;
11791     case 37: str = "Destination out of service"; break;
11792     case 38: str = "Destination no longer at this address"; break;
11793     case 39: str = "Other terminal problem"; break;
11794     case 64: str = "Radio interface resource shortage"; break;
11795     case 65: str = "Radio interface incompatibility"; break;
11796     case 66: str = "Other radio interface problem"; break;
11797     case 67: str = "Unsupported Base Station Capability"; break;
11798     case 96: str = "Encoding problem"; break;
11799     case 97: str = "Service origination denied"; break;
11800     case 98: str = "Service termination denied"; break;
11801     case 99: str = "Supplementary service not supported"; break;
11802     case 100: str = "Service not supported"; break;
11803     case 101: str = "Reserved"; break;
11804     case 102: str = "Missing expected parameter"; break;
11805     case 103: str = "Missing mandatory parameter"; break;
11806     case 104: str = "Unrecognized parameter value"; break;
11807     case 105: str = "Unexpected parameter value"; break;
11808     case 106: str = "User Data size error"; break;
11809     case 107: str = "Other general problems"; break;
11810     case 108: str = "Session not active"; break;
11811     default:
11812         if ((value >= 7) && (value <= 31)) { str = "Reserved, treat as Other network problem"; }
11813         else if ((value >= 40) && (value <= 47)) { str = "Reserved, treat as Other terminal problem"; }
11814         else if ((value >= 48) && (value <= 63)) { str = "Reserved, treat as SMS delivery postponed"; }
11815         else if ((value >= 68) && (value <= 95)) { str = "Reserved, treat as Other radio interface problem"; }
11816         else if ((value >= 109) && (value <= 223)) { str = "Reserved, treat as Other general problems"; }
11817         else { str = "Reserved for protocol extension, treat as Other general problems"; }
11818         break;
11819     }
11820
11821     proto_tree_add_text(tree, asn1->tvb,
11822         saved_offset, asn1->offset - saved_offset,
11823         "%s (%u)",
11824         str,
11825         value);
11826
11827     EXTRANEOUS_DATA_CHECK(len, 1);
11828 }
11829
11830 static void
11831 param_cdma_soci(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
11832 {
11833     gint32 value;
11834     guint saved_offset;
11835
11836     add_string = add_string;
11837     saved_offset = asn1->offset;
11838
11839     asn1_int32_value_decode(asn1, 1, &value);
11840
11841     proto_tree_add_text(tree, asn1->tvb,
11842         saved_offset, asn1->offset - saved_offset,
11843         "Value %u",
11844         value);
11845
11846     EXTRANEOUS_DATA_CHECK(len, 1);
11847 }
11848
11849 static void
11850 param_int(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
11851 {
11852     gint32 value;
11853     guint saved_offset;
11854
11855     add_string = add_string;
11856
11857     if (len > 4)
11858     {
11859         proto_tree_add_text(tree, asn1->tvb,
11860             asn1->offset, len, "Long Data (?)");
11861         asn1->offset += len;
11862         return;
11863     }
11864
11865     saved_offset = asn1->offset;
11866
11867     asn1_int32_value_decode(asn1, len, &value);
11868
11869     proto_tree_add_text(tree, asn1->tvb,
11870         saved_offset, asn1->offset - saved_offset,
11871         "Value %u",
11872         value);
11873 }
11874
11875 static void
11876 param_pc_ssn(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
11877 {
11878     gint32 value, b1, b2, b3, b4;
11879     guint saved_offset;
11880     gchar *str = NULL;
11881
11882     EXACT_DATA_CHECK(len, 5);
11883
11884     add_string = add_string;
11885     saved_offset = asn1->offset;
11886
11887     asn1_int32_value_decode(asn1, 1, &value);
11888
11889     switch (value)
11890     {
11891     case 0: str = "Not specified"; break;
11892     case 1: str = "Serving MSC"; break;
11893     case 2: str = "Home MSC"; break;
11894     case 3: str = "Gateway MSC"; break;
11895     case 4: str = "HLR"; break;
11896     case 5: str = "VLR"; break;
11897     case 6: str = "EIR (reserved)"; break;
11898     case 7: str = "AC"; break;
11899     case 8: str = "Border MSC"; break;
11900     case 9: str = "Originating MSC"; break;
11901     default:
11902         if ((value >= 10) && (value <= 223)) { str = "Reserved, treat as Not specified"; }
11903         else { str = "Reserved for protocol extension, treat as Not specified"; }
11904         break;
11905     }
11906
11907     proto_tree_add_text(tree, asn1->tvb,
11908         saved_offset, asn1->offset - saved_offset,
11909         "Type (%u) %s",
11910         value,
11911         str);
11912
11913     asn1_int32_value_decode(asn1, 1, &b1);
11914     asn1_int32_value_decode(asn1, 1, &b2);
11915     asn1_int32_value_decode(asn1, 1, &b3);
11916     asn1_int32_value_decode(asn1, 1, &b4);
11917
11918     proto_tree_add_text(tree, asn1->tvb,
11919         saved_offset, asn1->offset - saved_offset,
11920         "Point Code %u-%u-%u  SSN %u",
11921         b3, b2, b1, b4);
11922 }
11923
11924 static void
11925 param_lai(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
11926 {
11927     gint32 value;
11928     guint saved_offset;
11929
11930     EXACT_DATA_CHECK(len, 2);
11931
11932     add_string = add_string;
11933     saved_offset = asn1->offset;
11934
11935     asn1_int32_value_decode(asn1, 2, &value);
11936
11937     proto_tree_add_text(tree, asn1->tvb,
11938         saved_offset, asn1->offset - saved_offset,
11939         "LAI %u (0x%04x)",
11940         value,
11941         value);
11942 }
11943
11944 static void
11945 param_list(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
11946 {
11947     guint saved_offset;
11948     guint num_parms;
11949
11950     add_string = add_string;
11951     num_parms = 0;
11952     saved_offset = asn1->offset;
11953
11954     while (len > (asn1->offset - saved_offset))
11955     {
11956         num_parms++;
11957
11958         if (!dissect_ansi_param(asn1, tree))
11959         {
11960             proto_tree_add_text(tree,
11961                 asn1->tvb, asn1->offset, len - (asn1->offset - saved_offset),
11962                 "Unknown Parameter Data");
11963
11964             asn1->offset = saved_offset + len;
11965             break;
11966         }
11967     }
11968
11969     sprintf(add_string, " - (%u)", num_parms);
11970 }
11971
11972
11973 #define NUM_PARAM_1 (sizeof(ansi_param_1_strings)/sizeof(value_string))
11974 static gint ett_ansi_param_1[NUM_PARAM_1];
11975 static void (*param_1_fcn[])(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string) = {
11976     param_bill_id,      /* Billing ID */
11977     param_int,  /* Serving Cell ID */
11978     param_int,  /* Target Cell ID */
11979     param_digits,       /* Digits */
11980     param_chan_data,    /* Channel Data */
11981     param_cic,  /* Inter MSC Circuit ID */
11982     param_int,  /* Inter Switch Count */
11983     param_min,  /* Mobile Identification Number */
11984     param_esn,  /* Electronic Serial Number */
11985     param_rel_reason,   /* Release Reason */
11986     param_sig_qual,     /* Signal Quality */
11987     param_scm,  /* Station Class Mark */
11988     param_auth_den,     /* Authorization Denied */
11989     param_auth_per,     /* Authorization Period */
11990     param_seizure,      /* Seizure Type */
11991     param_trunk_stat,   /* Trunk Status */
11992     param_qic,  /* Qualification Information Code */
11993     param_feat_result,  /* Feature Result */
11994     param_red_reason,   /* Redirection Reason */
11995     param_acc_den,      /* Access Denied Reason */
11996     param_mscid,        /* MSCID */
11997     param_sys_type_code,        /* System My Type Code */
11998     param_orig_ind,     /* Origination Indicator */
11999     param_term_res,     /* Termination Restriction Code */
12000     param_calling_feat_ind,     /* Calling Features Indicator */
12001     param_faulty,       /* Faulty Parameter */
12002     param_usage_ind,    /* Usage Indicator */
12003     param_tdma_chan_data,       /* TDMA Channel Data */
12004     param_tdma_call_mode,       /* TDMA Call Mode */
12005     param_ho_reason,    /* Handoff Reason */
12006     NULL,       /* NONE */
12007 };
12008
12009
12010 #define NUM_PARAM_2 (sizeof(ansi_param_2_strings)/sizeof(value_string))
12011 static gint ett_ansi_param_2[NUM_PARAM_2];
12012 static void (*param_2_fcn[])(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string) = {
12013     param_tdma_burst_ind,       /* TDMA Burst Indicator */
12014     param_pc_ssn,       /* PC_SSN */
12015     param_lai,  /* Location Area ID */
12016     param_sys_acc_type, /* System Access Type */
12017     param_auth_resp_all,        /* Authentication Response */
12018     param_auth_resp_all,        /* Authentication Response Base Station */
12019     param_auth_resp_all,        /* Authentication Response Unique Challenge */
12020     param_int,  /* Call History Count */
12021     param_confid_mode,  /* Confidentiality Modes */
12022     param_int,  /* Random Variable */
12023     param_int,  /* Random Variable Base station */
12024     param_rand_ssd,     /* Random Variable SSD */
12025     param_rand_unique,  /* Random Variable Unique Challenge */
12026     param_report_type,  /* Report Type */
12027     param_sme_key,      /* Signaling Message Encryption Key */
12028     param_ssd,  /* Shared Secret Data */
12029     param_term_type,    /* Terminal Type */
12030     param_vpmask,       /* Voice Privacy Mask */
12031     param_sys_cap,      /* System Capabilities */
12032     param_deny_acc,     /* Deny Access */
12033     param_upd_count,    /* Update Count */
12034     param_ssd_no_share, /* SSD Not Shared */
12035     param_ext_mscid,    /* Extended MSCID */
12036     param_ext_sys_type_code,    /* Extended System My Type Code */
12037     param_ctrl_chan_data,       /* Control Channel Data */
12038     param_sys_acc_data, /* System Access Data */
12039     param_can_den,      /* Cancellation Denied */
12040     param_border_acc,   /* Border Cell Access */
12041     param_cdma_scm,     /* CDMA Station Class Mark */
12042     param_int,  /* CDMA Serving One Way Delay */
12043     param_int,  /* CDMA Target One Way Delay */
12044     param_cdma_call_mode,       /* CDMA Call Mode */
12045     param_cdma_chan_data,       /* CDMA Channel Data */
12046     param_cdma_sig_qual,        /* CDMA Signal Quality */
12047     param_cdma_pilot_strength,  /* CDMA Pilot Strength */
12048     param_mob_rev,      /* CDMA Mobile Protocol Revision */
12049     param_cdma_plcm,    /* CDMA Private Long Code Mask */
12050     param_cdma_code_chan,       /* CDMA Code Channel */
12051     param_cdma_sea_win, /* CDMA Search Window */
12052     param_ms_loc,       /* MS Location */
12053     param_page_ind,     /* Page Indicator */
12054     param_rec_sig_qual, /* Received Signal Quality */
12055     param_dereg,        /* Deregistration Type */
12056     param_namps_chan_data,      /* NAMPS Channel Data */
12057     param_alert_code,   /* Alert Code */
12058     param_ann_code,     /* Announcement Code */
12059     param_aav,  /* Authentication Algorithm Version */
12060     param_auth_cap,     /* Authentication Capability */
12061     param_int,  /* Call History Count Expected */
12062     param_digits,       /* Calling Party Number Digits 1 */
12063     param_digits,       /* Calling Party Number Digits 2 */
12064     param_digits,       /* Calling Party Number String 1 */
12065     param_digits,       /* Calling Party Number String 2 */
12066     param_sub_addr,     /* Calling Party Subaddress */
12067     param_can_type,     /* Cancellation Type */
12068     param_digits,       /* Carrier Digits */
12069     param_digits,       /* Destination Digits */
12070     param_dmh_red_ind,  /* DMH Redirection Indicator */
12071     param_list, /* Inter System Termination */
12072     param_avail_type,   /* Availability Type */
12073     param_list, /* Local Termination */
12074     param_mw_noti_count,        /* Message Waiting Notification Count */
12075     param_digits,       /* Mobile Directory Number */
12076     param_digits,       /* MSCID Number */
12077     param_list, /* PSTN Termination */
12078     param_no_ans_time,  /* No Answer Time */
12079     param_otfi, /* One Time Feature Indicator */
12080     param_orig_trig,    /* Origination Triggers */
12081     param_randc,        /* RANDC */
12082     param_digits,       /* Redirecting Number Digits */
12083     param_digits,       /* Redirecting Number String */
12084     param_sub_addr,     /* Redirecting Number Subaddress */
12085     param_digits,       /* Sender Identification Number */
12086     param_digits,       /* SMS Address */
12087     param_sms_bd,       /* SMS Bearer Data */
12088     param_sms_charge_ind,       /* SMS Charge Indicator */
12089     param_digits,       /* SMS Destination Address */
12090     param_sms_msg_count,        /* SMS Message Count */
12091     param_sms_noti,     /* SMS Notification Indicator */
12092     param_digits,       /* SMS Original Destination Address */
12093     param_sub_addr,     /* SMS Original Destination Subaddress */
12094     param_digits,       /* SMS Original Originating Address */
12095     param_sub_addr,     /* SMS Original Originating Subaddress */
12096     param_digits,       /* SMS Originating Address */
12097     param_sms_orig_restric,     /* SMS Originating Restrictions */
12098     param_sms_tele,     /* SMS Teleservice Identifier */
12099     param_sms_term_restric,     /* SMS Termination Restrictions */
12100     NULL/* no data */,  /* SMS Message Waiting Indicator */
12101     param_term_acc_type,        /* Termination Access Type */
12102     param_list, /* Termination List */
12103     param_term_treat,   /* Termination Treatment */
12104     param_term_trig,    /* Termination Triggers */
12105     param_trans_cap,    /* Transaction Capability */
12106     param_unique_chal_rep,      /* Unique Challenge Report */
12107     NULL,       /* NONE */
12108 };
12109
12110
12111 #define NUM_PARAM_3 (sizeof(ansi_param_3_strings)/sizeof(value_string))
12112 static gint ett_ansi_param_3[NUM_PARAM_3];
12113 static void (*param_3_fcn[])(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string) = {
12114     param_act_code,     /* Action Code */
12115     param_alert_res,    /* Alert Result */
12116     param_list, /* Announcement List */
12117     param_list, /* CDMA Code Channel Information */
12118     param_list, /* CDMA Code Channel List */
12119     param_list, /* CDMA Target Measurement Information */
12120     param_list, /* CDMA Target Measurement List */
12121     param_list, /* CDMA Target MAHO Information */
12122     param_list, /* CDMA Target MAHO List */
12123     param_conf_call_ind,        /* Conference Calling Indicator */
12124     param_count_upd_report,     /* Count Update Report */
12125     param_digit_collect_ctrl,   /* Digit Collection Control */
12126     param_digits,       /* DMH Account Code Digits */
12127     param_digits,       /* DMH Alternate Billing Digits */
12128     param_digits,       /* DMH Billing Digits */
12129     param_geo_auth,     /* Geographic Authorization */
12130     param_int,  /* Leg Information */
12131     param_mw_noti_type, /* Message Waiting Notification Type */
12132     param_paca_ind,     /* PACA Indicator */
12133     param_pref_lang_ind,        /* Preferred Language Indicator */
12134     param_rand_valtime, /* Random Valid Time */
12135     param_digits,       /* Restriction Digits */
12136     param_digits,       /* Routing Digits */
12137     param_setup_result, /* Setup Result */
12138     param_sms_acc_den_reason,   /* SMS Access Denied Reason */
12139     param_sms_cause,    /* SMS Cause Code */
12140     param_digits,       /* SPINI PIN */
12141     param_spini_trig,   /* SPINI Triggers */
12142     param_ssd_upd_report,       /* SSD Update Report */
12143     param_list, /* Target Measurement Information */
12144     param_list, /* Target Measurement List */
12145     param_digits,       /* Voice Mailbox PIN */
12146     param_digits,       /* Voice Mailbox Number */
12147     NULL/* no special handling */,      /* Authentication Data */
12148     param_cond_den_reason,      /* Conditionally Denied Reason */
12149     param_group_info,   /* Group Information */
12150     param_ho_state,     /* Handoff State */
12151     param_namps_call_mode,      /* NAMPS Call Mode */
12152     param_cdma_sci,     /* CDMA Slot Cycle Index */
12153     param_den_auth_per, /* Denied Authorization Period */
12154     param_digits,       /* Pilot Number */
12155     param_bill_id,      /* Pilot Billing ID */
12156     param_cdma_band_class,      /* CDMA Band Class */
12157     param_imsi, /* International Mobile Subscriber Identity */
12158     param_calling_party_name,   /* Calling Party Name */
12159     param_dis_text,     /* Display Text */
12160     param_red_party_name,       /* Redirecting Party Name */
12161     param_srvc_id,      /* Service ID */
12162     param_all_or_none,  /* All Or None */
12163     param_change,       /* Change */
12164     param_list, /* Data Access Element */
12165     param_list, /* Data Access Element List */
12166     param_list, /* Data Update Result */
12167     param_list, /* Data Update Result List */
12168     param_cdma_pilot_pn,        /* CDMA Pilot PN */
12169     NULL/* no special handling */,      /* CDMA Service Configuration Record */
12170     param_cdma_so,      /* CDMA Service Option */
12171     param_cdma_scm2,    /* CDMA Station Class Mark 2 */
12172     param_tdma_sc,      /* TDMA Service Code */
12173     param_tdma_term_cap,        /* TDMA Terminal Capability */
12174     param_tdma_voice_coder,     /* TDMA Voice Coder */
12175     param_a_key_ver,    /* A-Key Protocol Version */
12176     NULL/* XXX what spec ? */,  /* Authentication Response Reauthentication */
12177     NULL/* no special handling */,      /* Base Station Partial Key */
12178     param_min,  /* Mobile Station MIN */
12179     NULL/* no special handling */,      /* Mobile Station Partial Key */
12180     NULL/* no special handling */,      /* Modulus Value */
12181     param_min,  /* Newly Assigned MIN */
12182     param_ota_result_code,      /* OTASP Result Code */
12183     NULL/* no special handling */,      /* Primitive Value */
12184     NULL/* XXX what spec ? */,  /* Random Variable Reauthentication */
12185     NULL/* XXX what spec ? */,  /* Reauthentication Report */
12186     param_srvc_ind,     /* Service Indicator */
12187     param_sme_report,   /* Signaling Message Encryption Report */
12188     param_trn,  /* Temporary Reference Number */
12189     param_vp_report,    /* Voice Privacy Report */
12190     param_ctrl_chan_mode,       /* Control Channel Mode */
12191     NULL/* no special handling */,      /* CDMA Connection Reference */
12192     param_list, /* CDMA Connection Reference Information */
12193     param_list, /* CDMA Connection Reference List */
12194     param_change_srvc_attr,     /* Change Service Attributes */
12195     NULL/* no special handling */,      /* Data Key */
12196     param_dp_params,    /* Data Privacy Parameters */
12197     param_islp_info,    /* ISLP Information */
12198     param_reason_list,  /* Reason List */
12199     param_tdma_bandwidth,       /* TDMA Bandwidth */
12200     param_tdma_data_feat_ind,   /* TDMA Data Features Indicator */
12201     param_tdma_data_mode,       /* TDMA Data Mode */
12202     param_tdma_voice_mode,      /* TDMA Voice Mode */
12203     param_ana_red_info, /* Analog Redirect Info */
12204     param_list, /* CDMA Band Class Information */
12205     param_list, /* CDMA Band Class List */
12206     param_list, /* CDMA Service Option List */
12207     param_list, /* CDMA Connection Reference Information */
12208     param_list, /* CDMA Connection Reference List */
12209     param_list, /* Analog Redirect Record */
12210     param_list, /* Execute Script */
12211     param_list, /* Modification Request */
12212     param_list, /* Modification Request List */
12213     param_list, /* Modification Result List */
12214     param_list, /* Service Data Access Element */
12215     param_list, /* Service Data Access Element List */
12216     param_list, /* Service Data Result */
12217     param_list, /* Service Data Result List */
12218     param_list, /* Trigger Address List */
12219     param_list, /* Trigger List */
12220     param_list, /* WIN Capability */
12221     param_list, /* Call Recovery ID */
12222     param_list, /* Call Recovery ID List */
12223     param_list, /* Position Information */
12224     param_list, /* CDMA PSMM List */
12225     param_cdma_chan_num,        /* CDMA Channel Number */
12226     param_list, /* CDMA Channel Number List */
12227     param_cdma_pci,     /* CDMA Power Combined Indicator */
12228     param_list, /* CDMA Redirect Record */
12229     param_cdma_sea_param,       /* CDMA Search Parameters */
12230     param_int,  /* CDMA Network Identification */
12231     param_network_tmsi, /* Network TMSI */
12232     param_int,  /* Network TMSI Expiration Time */
12233     param_network_tmsi, /* New Network TMSI */
12234     param_reqd_param_mask,      /* Required Parameters Mask */
12235     param_srvc_red_cause,       /* Service Redirection Cause */
12236     param_srvc_red_info,        /* Service Redirection Info */
12237     param_roaming_ind,  /* Roaming Indication */
12238     NULL/* XXX what spec ? */,  /* MSID */
12239     NULL/* no special handling */,      /* Data ID */
12240     NULL/* no special handling */,      /* Database Key */
12241     param_data_result,  /* Data Result */
12242     NULL/* no special handling */,      /* Data Value */
12243     param_fail_cause,   /* Failure Cause */
12244     param_fail_type,    /* Failure Type */
12245     NULL/* no special handling */,      /* Global Title */
12246     NULL/* no special handling */,      /* Private Specialized Resource */
12247     param_resume_pic,   /* Resume PIC */
12248     NULL/* no special handling */,      /* Script Argument */
12249     NULL/* no special handling */,      /* Script Name */
12250     NULL/* no special handling */,      /* Script Result */
12251     param_special_rsc,  /* Specialized Resource */
12252     param_time_date_offset,     /* Time Date Offset */
12253     param_trig_cap,     /* Trigger Capability */
12254     param_trig_type,    /* Trigger Type */
12255     param_win_op_cap,   /* WIN Operations Capability */
12256     param_win_trig_list,        /* WIN Trigger List */
12257     param_digits,       /* MSC Address */
12258     param_sus_acc,      /* Suspicious Access */
12259     param_imsi, /* Mobile Station IMSI */
12260     param_imsi, /* Newly Assigned IMSI */
12261     NULL/* XXX what spec ? */,  /* Command Code */
12262     param_dis_text2,    /* Display Text 2 */
12263     NULL/* XXX what spec ? */,  /* Page Count */
12264     NULL/* XXX what spec ? */,  /* Page Response Time */
12265     NULL/* XXX what spec ? */,  /* SMS Transaction ID */
12266     param_dmh_srvc_id,  /* DMH Service ID */
12267     param_feat_ind,     /* Feature Indicator */
12268     param_mscid,        /* Control Network ID */
12269     param_rel_cause,    /* Release Cause */
12270     param_time_day,     /* Time Of Day */
12271     param_call_status,  /* Call Status */
12272     NULL/* no special handling */,      /* DMH Charge Information */
12273     NULL/* no special handling */,      /* DMH Billing Indicator */
12274     param_ms_status,    /* MS Status */
12275     param_pos_info_code,        /* Position Information Code */
12276     param_inter_msg_time,       /* Inter Message Time */
12277     param_msid_usage,   /* MSID Usage */
12278     param_new_min_ext,  /* New MIN Extension */
12279     param_dtx_ind,      /* DTX Indication */
12280     param_cdma_mob_cap, /* CDMA Mobile Capabilities */
12281     param_gen_time,     /* Generalized Time */
12282     param_digits,       /* Generic Digits */
12283     param_geo_pos,      /* Geographic Position */
12284     param_mob_call_status,      /* Mobile Call Status */
12285     param_mob_cap,      /* Mobile Position Capability */
12286     param_pos_req_type, /* Position Request Type */
12287     param_pos_result,   /* Position Result */
12288     param_pos_source,   /* Position Source */
12289     param_acg_encounter,        /* ACG Encountered */
12290     param_ctrl_type,    /* CDMA State/Control Type */
12291     param_gap_duration, /* Gap Duration */
12292     param_scf_overload_gap_int, /* SCF Overload Gap Interval */
12293     param_sm_gap_int,   /* Service Management System Gap Interval */
12294     param_cdma_psmm_count,      /* CDMA PSMM Count */
12295     param_cdma_sowd2,   /* CDMA Serving One Way Delay 2 */
12296     param_qos_pri,      /* QoS Priority */
12297     NULL/* no special handling */,      /* PDSN Address */
12298     NULL/* no special handling */,      /* PDSN Protocol Type */
12299     param_cdma_ms_meas_chan_id, /* CDMA MS Measured Channel Identity */
12300     NULL/* no special handling */,      /* Range */
12301     param_calling_party_cat,    /* Calling Party Category */
12302     param_cdma2000_ho_ivk_ios,  /* cdma2000 Handoff Invoke IOS Data */
12303     param_cdma2000_ho_rsp_ios,  /* cdma2000 Handoff Response IOS Data */
12304     param_digits,       /* LCS Client ID */
12305     param_tdma_maho_cell_id,    /* TDMA MAHO Cell ID */
12306     param_tdma_maho_chan,       /* TDMA MAHO Channel */
12307     param_cdma_soci,    /* CDMA Service Option Connection Identifier */
12308     param_tdma_time_align,      /* TDMA Time Alignment */
12309     param_tdma_maho_req,        /* TDMA MAHO Request */
12310     NULL,       /* NONE */
12311 };
12312
12313 /* GENERIC MAP DISSECTOR FUNCTIONS */
12314
12315 static void
12316 dissect_ansi_map_len(ASN1_SCK *asn1, proto_tree *tree, gboolean *def_len, guint *len)
12317 {
12318     guint       saved_offset;
12319     int         ret;
12320
12321
12322     saved_offset = asn1->offset;
12323     *def_len = FALSE;
12324     *len = 0;
12325
12326     ret = asn1_length_decode(asn1, def_len, len);
12327
12328     if (*def_len)
12329     {
12330         proto_tree_add_uint(tree, hf_ansi_map_length, asn1->tvb,
12331             saved_offset, asn1->offset - saved_offset,
12332             *len);
12333     }
12334     else
12335     {
12336         proto_tree_add_text(tree, asn1->tvb,
12337             saved_offset, asn1->offset - saved_offset,
12338             "Length: Indefinite");
12339     }
12340
12341 }
12342
12343 static gboolean
12344 check_ansi_map_tag(ASN1_SCK *asn1, guint tag)
12345 {
12346     guint saved_offset, real_tag;
12347
12348
12349     saved_offset = asn1->offset;
12350
12351     asn1_id_decode1(asn1, &real_tag);
12352
12353     asn1->offset = saved_offset;
12354
12355     return(tag == real_tag);
12356 }
12357
12358 static void
12359 dissect_ansi_map_octet(ASN1_SCK *asn1, proto_tree *tree, guchar * str)
12360 {
12361     guint saved_offset;
12362     guchar my_oct;
12363
12364
12365     saved_offset = asn1->offset;
12366
12367     asn1_octet_decode(asn1, &my_oct);
12368
12369     proto_tree_add_uint_format(tree, hf_ansi_map_id, asn1->tvb,
12370         saved_offset, asn1->offset - saved_offset, my_oct,
12371         "%s %u",
12372         str, my_oct);
12373 }
12374
12375 static proto_tree *
12376 dissect_ansi_map_component(ASN1_SCK *asn1, proto_tree *tree, guint *len_p)
12377 {
12378     guint saved_offset;
12379     guint tag;
12380     proto_item *item;
12381     proto_tree *subtree;
12382     gboolean def_len;
12383
12384
12385     saved_offset = asn1->offset;
12386     asn1_id_decode1(asn1, &tag);
12387
12388     item =
12389         proto_tree_add_text(tree, asn1->tvb,
12390             saved_offset, -1, "Component ID");
12391
12392     subtree = proto_item_add_subtree(item, ett_component);
12393
12394     proto_tree_add_uint_format(subtree, hf_ansi_map_tag, asn1->tvb,
12395         saved_offset, asn1->offset - saved_offset, tag,
12396         "Component ID Identifier");
12397
12398     dissect_ansi_map_len(asn1, subtree, &def_len, len_p);
12399
12400     proto_item_set_len(item, (asn1->offset - saved_offset) + *len_p);
12401
12402     return(subtree);
12403 }
12404
12405 static void
12406 dissect_ansi_opr_code(ASN1_SCK *asn1, packet_info *pinfo, proto_tree *tree)
12407 {
12408     static ansi_map_tap_rec_t tap_rec;
12409     guint saved_offset = 0;
12410     guint len;
12411     guint tag;
12412     gint32 val;
12413     gchar *str = NULL;
12414     guchar my_oct;
12415     proto_item *item;
12416     proto_tree *subtree;
12417     gboolean def_len;
12418
12419
12420 #define TCAP_NAT_OPR_CODE_TAG 0xd0
12421     if (check_ansi_map_tag(asn1, TCAP_NAT_OPR_CODE_TAG))
12422     {
12423         str = "National TCAP Operation Code Identifier";
12424     }
12425 #define TCAP_PRIV_OPR_CODE_TAG 0xd1
12426     else if (check_ansi_map_tag(asn1, TCAP_PRIV_OPR_CODE_TAG))
12427     {
12428         str = "Private TCAP Operation Code Identifier";
12429     }
12430     else
12431     {
12432         /* XXX */
12433         return;
12434     }
12435
12436     saved_offset = asn1->offset;
12437     asn1_id_decode1(asn1, &tag);
12438
12439     item =
12440         proto_tree_add_text(tree, asn1->tvb,
12441             saved_offset, -1, "Operation Code");
12442
12443     subtree = proto_item_add_subtree(item, ett_opr_code);
12444
12445     proto_tree_add_uint_format(subtree, hf_ansi_map_tag, asn1->tvb,
12446         saved_offset, asn1->offset - saved_offset, tag, str);
12447
12448     dissect_ansi_map_len(asn1, subtree, &def_len, &len);
12449     proto_item_set_len(item, (asn1->offset - saved_offset) + len);
12450
12451     if (len > 0)
12452     {
12453         saved_offset = asn1->offset;
12454         asn1_octet_decode(asn1, &my_oct);
12455
12456 #define ANSI_MAP_OPR_FAMILY 0x09
12457         if (my_oct != ANSI_MAP_OPR_FAMILY)
12458         {
12459             asn1->offset = saved_offset;
12460             return;
12461         }
12462
12463         proto_tree_add_text(subtree, asn1->tvb,
12464             saved_offset, 1, "Operation Code Family");
12465
12466         saved_offset = asn1->offset;
12467         asn1_int32_value_decode(asn1, len-1, &val);
12468         proto_tree_add_int(subtree, hf_ansi_map_opr_code, asn1->tvb,
12469             saved_offset, asn1->offset - saved_offset, val);
12470
12471         str = match_strval(val, ansi_map_opr_code_strings);
12472
12473         if (NULL == str) return;
12474
12475         tap_rec.message_type = val;
12476
12477         tap_queue_packet(ansi_map_tap, pinfo, &tap_rec);
12478
12479         if (check_col(pinfo->cinfo, COL_INFO))
12480         {
12481             col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", str);
12482         }
12483     }
12484 }
12485
12486 static void
12487 dissect_ansi_problem(ASN1_SCK *asn1, proto_tree *tree)
12488 {
12489     guint saved_offset = 0;
12490     guint len;
12491     guint tag;
12492     proto_tree *subtree;
12493     proto_item *item = NULL;
12494     gchar *str = NULL;
12495     gchar *type_str = NULL;
12496     gint32 type, spec;
12497     gboolean def_len;
12498
12499
12500 #define TCAP_PROB_CODE_TAG 0xd5
12501     if (check_ansi_map_tag(asn1, TCAP_PROB_CODE_TAG))
12502     {
12503         str = "Problem Code Identifier";
12504     }
12505     else
12506     {
12507         /* XXX */
12508         return;
12509     }
12510
12511     saved_offset = asn1->offset;
12512     asn1_id_decode1(asn1, &tag);
12513
12514     item =
12515         proto_tree_add_text(tree, asn1->tvb,
12516             saved_offset, -1, "Problem Code");
12517
12518     subtree = proto_item_add_subtree(item, ett_problem);
12519
12520     proto_tree_add_uint_format(subtree, hf_ansi_map_tag, asn1->tvb,
12521         saved_offset, asn1->offset - saved_offset, tag, str);
12522
12523     dissect_ansi_map_len(asn1, subtree, &def_len, &len);
12524     proto_item_set_len(item, (asn1->offset - saved_offset) + len);
12525
12526     if (len != 2)
12527     {
12528         proto_tree_add_text(subtree, asn1->tvb,
12529             asn1->offset, len, "Unknown encoding of Problem Code");
12530
12531         asn1->offset += len;
12532         return;
12533     }
12534
12535     saved_offset = asn1->offset;
12536     asn1_int32_value_decode(asn1, 1, &type);
12537     asn1_int32_value_decode(asn1, 1, &spec);
12538
12539     switch (type)
12540     {
12541     case 0: type_str = "Not used"; break;
12542
12543     case 1:
12544         type_str = "General";
12545         switch (spec)
12546         {
12547         case 1: str = "Unrecognized Component Type"; break;
12548         case 2: str = "Incorrect Component Portion"; break;
12549         case 3: str = "Badly Structured Component Portion"; break;
12550         default:
12551             str = "Undefined";
12552             break;
12553         }
12554         break;
12555
12556     case 2:
12557         type_str = "Invoke";
12558         switch (spec)
12559         {
12560         case 1: str = "Duplicate Invoke ID"; break;
12561         case 2: str = "Unrecognized Operation Code"; break;
12562         case 3: str = "Incorrect Parameter"; break;
12563         case 4: str = "Unrecognized Correlation ID"; break;
12564         default:
12565             str = "Undefined";
12566             break;
12567         }
12568         break;
12569
12570     case 3:
12571         type_str = "Return Result";
12572         switch (spec)
12573         {
12574         case 1: str = "Unrecognized Correlation ID"; break;
12575         case 2: str = "Unexpected Return Result"; break;
12576         case 3: str = "Incorrect Parameter"; break;
12577         default:
12578             str = "Undefined";
12579             break;
12580         }
12581         break;
12582
12583     case 4:
12584         type_str = "Return Error";
12585         switch (spec)
12586         {
12587         case 1: str = "Unrecognized Correlation ID"; break;
12588         case 2: str = "Unexpected Return Error"; break;
12589         case 3: str = "Unrecognized Error"; break;
12590         case 4: str = "Unexpected Error"; break;
12591         case 5: str = "Incorrect Parameter"; break;
12592         default:
12593             str = "Undefined";
12594             break;
12595         }
12596         break;
12597
12598     case 5:
12599         type_str = "Transaction Portion";
12600         switch (spec)
12601         {
12602         case 1: str = "Unrecognized Package Type"; break;
12603         case 2: str = "Incorrect Transaction Portion"; break;
12604         case 3: str = "Badly Structured Transaction Portion"; break;
12605         case 4: str = "Unrecognized Transaction ID"; break;
12606         case 5: str = "Permission to Release"; break;
12607         case 6: str = "Resource Unavailable"; break;
12608         default:
12609             str = "Undefined";
12610             break;
12611         }
12612         break;
12613
12614     default:
12615         type_str = "Undefined";
12616         break;
12617     }
12618
12619     if (spec == 255) { str = "Reserved"; }
12620     else if (spec == 0) { str = "Not used"; }
12621
12622     proto_tree_add_text(subtree, asn1->tvb,
12623         saved_offset, 1, "Problem Type %s", type_str);
12624
12625     proto_tree_add_text(subtree, asn1->tvb,
12626         saved_offset + 1, 1, "Problem Specifier %s", str);
12627 }
12628
12629 static void
12630 dissect_ansi_error(ASN1_SCK *asn1, proto_tree *tree)
12631 {
12632     guint saved_offset = 0;
12633     guint len;
12634     guint tag;
12635     gint32 value;
12636     proto_tree *subtree;
12637     proto_item *item = NULL;
12638     gchar *str = NULL;
12639     gboolean def_len;
12640
12641
12642 #define TCAP_NAT_ERR_CODE_TAG 0xd3
12643     if (check_ansi_map_tag(asn1, TCAP_NAT_ERR_CODE_TAG))
12644     {
12645         str = "National TCAP Error Code Identifier";
12646     }
12647 #define TCAP_PRIV_ERR_CODE_TAG 0xd4
12648     else if (check_ansi_map_tag(asn1, TCAP_PRIV_ERR_CODE_TAG))
12649     {
12650         str = "Private TCAP Error Code Identifier";
12651     }
12652     else
12653     {
12654         /* XXX */
12655         return;
12656     }
12657
12658     saved_offset = asn1->offset;
12659     asn1_id_decode1(asn1, &tag);
12660
12661     item =
12662         proto_tree_add_text(tree, asn1->tvb,
12663             saved_offset, -1, "TCAP Error Code");
12664
12665     subtree = proto_item_add_subtree(item, ett_error);
12666
12667     proto_tree_add_uint_format(subtree, hf_ansi_map_tag, asn1->tvb,
12668         saved_offset, asn1->offset - saved_offset, tag, str);
12669
12670     dissect_ansi_map_len(asn1, subtree, &def_len, &len);
12671     proto_item_set_len(item, (asn1->offset - saved_offset) + len);
12672
12673     if ((tag == TCAP_PRIV_ERR_CODE_TAG) &&
12674         (len == 1))
12675     {
12676         saved_offset = asn1->offset;
12677         asn1_int32_value_decode(asn1, 1, &value);
12678
12679         switch (value)
12680         {
12681         case 0x81: str = "Unrecognized MIN"; break;
12682         case 0x82: str = "Unrecognized ESN"; break;
12683         case 0x83: str = "MIN/HLR Mismatch"; break;
12684         case 0x84: str = "Operation Sequence Problem"; break;
12685         case 0x85: str = "Resource Shortage"; break;
12686         case 0x86: str = "Operation Not Supported"; break;
12687         case 0x87: str = "Trunk Unavailable"; break;
12688         case 0x88: str = "Parameter Error"; break;
12689         case 0x89: str = "System Failure"; break;
12690         case 0x8a: str = "Unrecognized Parameter Value"; break;
12691         case 0x8b: str = "Feature Inactive"; break;
12692         case 0x8c: str = "Missing Parameter"; break;
12693         default:
12694             if ((value >= 0xe0) && (value <= 0xff)) { str = "Reserved for protocol extension"; }
12695             else { str = "Reserved"; }
12696             break;
12697         }
12698
12699         proto_tree_add_text(subtree, asn1->tvb,
12700             saved_offset, 1, str);
12701     }
12702     else
12703     {
12704         proto_tree_add_text(subtree, asn1->tvb,
12705             asn1->offset, len, "Error Code");
12706
12707         asn1->offset += len;
12708     }
12709 }
12710
12711
12712 static gboolean
12713 dissect_ansi_param(ASN1_SCK *asn1, proto_tree *tree)
12714 {
12715     void (*param_fcn)(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string) = NULL;
12716     guint saved_offset = 0;
12717     guint len;
12718     proto_tree *subtree;
12719     proto_item *item;
12720     guint val;
12721     gchar *str = NULL;
12722     gint ett_param_idx, idx;
12723     gboolean def_len;
12724
12725
12726     saved_offset = asn1->offset;
12727
12728     asn1_uint32_value_decode(asn1, 1, &val);
12729     str = my_match_strval((guint32) val, ansi_param_1_strings, &idx);
12730
12731     if (NULL == str)
12732     {
12733         asn1->offset = saved_offset;
12734         asn1_uint32_value_decode(asn1, 2, &val);
12735
12736         str = my_match_strval((guint32) val, ansi_param_2_strings, &idx);
12737
12738         if (NULL == str)
12739         {
12740             asn1->offset = saved_offset;
12741             asn1_int32_value_decode(asn1, 3, &val);
12742
12743             str = my_match_strval((guint32) val, ansi_param_3_strings, &idx);
12744
12745             if (NULL == str)
12746             {
12747                 if (((val >= 0x9FFF00) && (val <= 0x9FFF7F)) ||
12748                     ((val >= 0xBFFF00) && (val <= 0xBFFF7F)))
12749                 {
12750                     str = "Reserved for protocol extension";
12751                 }
12752                 else if (((val >= 0x9FFE76) && (val <= 0x9FFE7F)) ||
12753                     ((val >= 0xBFFE76) && (val <= 0xBFFE7F)))
12754                 {
12755                     str = "Reserved for National Network Use";
12756                 }
12757                 else
12758                 {
12759                     str = "Unknown Parameter Data";
12760                     param_fcn = NULL;
12761                 }
12762
12763                 ett_param_idx = ett_param;
12764             }
12765             else
12766             {
12767                 ett_param_idx = ett_ansi_param_3[idx];
12768                 param_fcn = param_3_fcn[idx];
12769             }
12770         }
12771         else
12772         {
12773             ett_param_idx = ett_ansi_param_2[idx];
12774             param_fcn = param_2_fcn[idx];
12775         }
12776     }
12777     else
12778     {
12779         ett_param_idx = ett_ansi_param_1[idx];
12780         param_fcn = param_1_fcn[idx];
12781     }
12782
12783     item =
12784         proto_tree_add_text(tree, asn1->tvb,
12785             saved_offset, -1, str);
12786
12787     subtree = proto_item_add_subtree(item, ett_param_idx);
12788
12789     proto_tree_add_uint_format(subtree, hf_ansi_map_param_id, asn1->tvb,
12790         saved_offset, asn1->offset - saved_offset, val, "Parameter ID");
12791
12792     dissect_ansi_map_len(asn1, subtree, &def_len, &len);
12793
12794     proto_item_set_len(item, asn1->offset - saved_offset + len);
12795
12796     if (len > 0)
12797     {
12798         if (param_fcn == NULL)
12799         {
12800             proto_tree_add_text(subtree, asn1->tvb,
12801                 asn1->offset, len, "Parameter Data");
12802             asn1->offset += len;
12803         }
12804         else
12805         {
12806             ansi_map_add_string[0] = '\0';
12807
12808             (*param_fcn)(asn1, subtree, len, ansi_map_add_string);
12809
12810             if (ansi_map_add_string[0] != '\0')
12811             {
12812                 proto_item_append_text(item, ansi_map_add_string);
12813                 ansi_map_add_string[0] = '\0';
12814             }
12815         }
12816     }
12817
12818     return(TRUE);
12819 }
12820
12821
12822 static void
12823 dissect_ansi_params(ASN1_SCK *asn1, proto_tree *tree)
12824 {
12825     guint saved_offset = 0;
12826     guint len;
12827     guint tag;
12828     proto_tree *subtree;
12829     proto_item *item = NULL;
12830     gchar *str = NULL;
12831     gboolean def_len;
12832
12833 #define TCAP_PARAM_SET_TAG 0xf2
12834     if (check_ansi_map_tag(asn1, TCAP_PARAM_SET_TAG))
12835     {
12836         str = "Parameter Set Identifier";
12837     }
12838 #define TCAP_PARAM_SEQ_TAG 0x30
12839     else if (check_ansi_map_tag(asn1, TCAP_PARAM_SEQ_TAG))
12840     {
12841         str = "Parameter Sequence Identifier";
12842     }
12843     else
12844     {
12845         /* XXX */
12846         return;
12847     }
12848
12849     saved_offset = asn1->offset;
12850     asn1_id_decode1(asn1, &tag);
12851
12852     item =
12853         proto_tree_add_text(tree, asn1->tvb,
12854             saved_offset, -1, "Parameters");
12855
12856     subtree = proto_item_add_subtree(item, ett_params);
12857
12858     proto_tree_add_uint_format(subtree, hf_ansi_map_tag, asn1->tvb,
12859         saved_offset, asn1->offset - saved_offset, tag, str);
12860
12861     dissect_ansi_map_len(asn1, subtree, &def_len, &len);
12862     proto_item_set_len(item, (asn1->offset - saved_offset) + len);
12863
12864     ansi_map_add_string[0] = '\0';
12865
12866     param_list(asn1, subtree, len, ansi_map_add_string);
12867
12868     if (ansi_map_add_string[0] != '\0')
12869     {
12870         proto_item_append_text(item, ansi_map_add_string);
12871         ansi_map_add_string[0] = '\0';
12872     }
12873 }
12874
12875 static void
12876 dissect_ansi_map_reject(ASN1_SCK *asn1, proto_tree *tree)
12877 {
12878     guint len;
12879     proto_tree *subtree;
12880
12881 #define COMPONENT_ID_TAG 0xcf
12882     if (check_ansi_map_tag(asn1, COMPONENT_ID_TAG))
12883     {
12884         subtree = dissect_ansi_map_component(asn1, tree, &len);
12885
12886         switch (len)
12887         {
12888         case 1:
12889             dissect_ansi_map_octet(asn1, subtree, "Correlation ID:");
12890             break;
12891         }
12892     }
12893
12894     dissect_ansi_problem(asn1, tree);
12895
12896     dissect_ansi_params(asn1, tree);
12897 }
12898
12899 static void
12900 dissect_ansi_map_re(ASN1_SCK *asn1, proto_tree *tree)
12901 {
12902     guint len;
12903     proto_tree *subtree;
12904
12905 #define COMPONENT_ID_TAG 0xcf
12906     if (check_ansi_map_tag(asn1, COMPONENT_ID_TAG))
12907     {
12908         subtree = dissect_ansi_map_component(asn1, tree, &len);
12909
12910         switch (len)
12911         {
12912         case 1:
12913             dissect_ansi_map_octet(asn1, subtree, "Correlation ID:");
12914             break;
12915         }
12916     }
12917
12918     dissect_ansi_error(asn1, tree);
12919
12920     dissect_ansi_params(asn1, tree);
12921 }
12922
12923 static void
12924 dissect_ansi_map_rr(ASN1_SCK *asn1, proto_tree *tree)
12925 {
12926     guint len;
12927     proto_tree *subtree;
12928
12929 #define COMPONENT_ID_TAG 0xcf
12930     if (check_ansi_map_tag(asn1, COMPONENT_ID_TAG))
12931     {
12932         subtree = dissect_ansi_map_component(asn1, tree, &len);
12933
12934         switch (len)
12935         {
12936         case 1:
12937             dissect_ansi_map_octet(asn1, subtree, "Correlation ID:");
12938             break;
12939         }
12940     }
12941
12942     dissect_ansi_params(asn1, tree);
12943 }
12944
12945 static void
12946 dissect_ansi_map_invoke(ASN1_SCK *asn1, packet_info *pinfo, proto_tree *tree)
12947 {
12948     guint len;
12949     proto_tree *subtree;
12950
12951 #define COMPONENT_ID_TAG 0xcf
12952     if (check_ansi_map_tag(asn1, COMPONENT_ID_TAG))
12953     {
12954         subtree = dissect_ansi_map_component(asn1, tree, &len);
12955
12956         switch (len)
12957         {
12958         case 1:
12959             dissect_ansi_map_octet(asn1, subtree, "Invoke ID:");
12960             break;
12961
12962         case 2:
12963             dissect_ansi_map_octet(asn1, subtree, "Invoke ID:");
12964             dissect_ansi_map_octet(asn1, subtree, "Correlation ID:");
12965             break;
12966         }
12967     }
12968
12969     ansi_map_is_invoke = TRUE;
12970
12971     dissect_ansi_opr_code(asn1, pinfo, tree);
12972
12973     dissect_ansi_params(asn1, tree);
12974 }
12975
12976 static void
12977 dissect_ansi_map_message(ASN1_SCK *asn1, packet_info *pinfo, proto_tree *ansi_map_tree)
12978 {
12979     guint       saved_offset;
12980     guint       tag;
12981     guint       len;
12982     gchar       *str = NULL;
12983     proto_item *item, *tag_item;
12984     proto_tree *subtree, *tag_subtree;
12985     gboolean def_len;
12986     static int  i = 0;
12987
12988
12989     saved_offset = asn1->offset;
12990     asn1_id_decode1(asn1, &tag);
12991
12992     str = match_strval(tag, ansi_cmp_type_strings);
12993
12994     if (NULL == str) return;
12995
12996     if (check_col(pinfo->cinfo, COL_INFO))
12997     {
12998         if (0 == i)
12999         {
13000             col_append_fstr(pinfo->cinfo, COL_INFO,  "%s ", str);
13001         }
13002         else
13003         {
13004             col_append_fstr(pinfo->cinfo, COL_INFO,  "& %s ", str);
13005         }
13006     }
13007
13008     item =
13009         proto_tree_add_text(ansi_map_tree, asn1->tvb,
13010             saved_offset, -1, "Components");
13011     subtree = proto_item_add_subtree(item, ett_components);
13012
13013     tag_item =
13014         proto_tree_add_uint_format(subtree, hf_ansi_map_tag, asn1->tvb,
13015             saved_offset, asn1->offset - saved_offset, tag, str);
13016
13017     dissect_ansi_map_len(asn1, subtree, &def_len, &len);
13018
13019     tag_subtree = proto_item_add_subtree(tag_item, ett_components);
13020
13021     switch (tag)
13022     {
13023     case ANSI_TC_INVOKE_L:
13024         dissect_ansi_map_invoke(asn1, pinfo, tag_subtree);
13025         break;
13026
13027     case ANSI_TC_RRL:
13028         dissect_ansi_map_rr(asn1, tag_subtree);
13029         break;
13030
13031     case ANSI_TC_RE:
13032         dissect_ansi_map_re(asn1, tag_subtree);
13033         break;
13034
13035     case ANSI_TC_REJECT:
13036         dissect_ansi_map_reject(asn1, tag_subtree);
13037         break;
13038
13039     case ANSI_TC_INVOKE_N:
13040         dissect_ansi_map_invoke(asn1, pinfo, tag_subtree);
13041         break;
13042
13043     case ANSI_TC_RRN:
13044         dissect_ansi_map_rr(asn1, tag_subtree);
13045         break;
13046
13047     default:
13048         break;
13049     }
13050
13051     proto_item_set_len(item, asn1->offset - saved_offset);
13052 }
13053
13054 static void
13055 dissect_ansi_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
13056 {
13057     proto_item *ansi_map_item;
13058     proto_tree *ansi_map_tree = NULL;
13059     ASN1_SCK   asn1;
13060     int        offset = 0;
13061
13062     g_pinfo = pinfo;
13063
13064     /*
13065      * Make entry in the Protocol column on summary display
13066      */
13067     if (check_col(pinfo->cinfo, COL_PROTOCOL))
13068     {
13069         col_set_str(pinfo->cinfo, COL_PROTOCOL, "ANSI MAP");
13070     }
13071
13072     /* In the interest of speed, if "tree" is NULL, don't do any work not
13073      * necessary to generate protocol tree items.
13074      */
13075     if (tree)
13076     {
13077         g_tree = tree;
13078
13079         /*
13080          * create the ansi_map protocol tree
13081          */
13082         ansi_map_item =
13083             proto_tree_add_item(tree, proto_ansi_map, tvb, 0, -1, FALSE);
13084
13085         ansi_map_tree =
13086             proto_item_add_subtree(ansi_map_item, ett_ansi_map);
13087
13088         asn1_open(&asn1, tvb, offset);
13089
13090         ansi_map_is_invoke = FALSE;
13091         is683_ota = FALSE;
13092         is801_pld = FALSE;
13093         dissect_ansi_map_message(&asn1, pinfo, ansi_map_tree);
13094
13095         asn1_close(&asn1, &offset);
13096     }
13097 }
13098
13099
13100 /* Register the protocol with Ethereal */
13101 void
13102 proto_register_ansi_map(void)
13103 {
13104     guint               i;
13105     gint                last_offset;
13106
13107     /* Setup list of header fields */
13108     static hf_register_info hf[] =
13109     {
13110         { &hf_ansi_map_tag,
13111             { "Tag",            "ansi_map.tag",
13112             FT_UINT8, BASE_HEX, NULL, 0,
13113             "", HFILL }
13114         },
13115         { &hf_ansi_map_length,
13116             { "Length",         "ansi_map.len",
13117             FT_UINT8, BASE_DEC, NULL, 0,
13118             "", HFILL }
13119         },
13120         { &hf_ansi_map_id,
13121             { "Value",          "ansi_map.id",
13122             FT_UINT8, BASE_DEC, NULL, 0,
13123             "", HFILL }
13124         },
13125         { &hf_ansi_map_opr_code,
13126             { "Operation Code", "ansi_map.oprcode",
13127             FT_INT32, BASE_DEC, VALS(ansi_map_opr_code_strings), 0,
13128             "", HFILL }
13129         },
13130         { &hf_ansi_map_param_id,
13131             { "Param ID",       "ansi_map.param_id",
13132             FT_UINT32, BASE_HEX, NULL, 0,
13133             "", HFILL }
13134         },
13135         { &hf_ansi_map_ios401_elem_id,
13136             { "IOS 4.0.1 Element ID",   "ansi_map.ios401_elem_id",
13137             FT_NONE, 0, NULL, 0,
13138             "", HFILL }
13139         },
13140     };
13141
13142     /* Setup protocol subtree array */
13143 #define NUM_INDIVIDUAL_PARAMS   15
13144     gint *ett[NUM_INDIVIDUAL_PARAMS+NUM_PARAM_1+NUM_PARAM_2+NUM_PARAM_3+NUM_IOS401_ELEM];
13145
13146     memset((void *) ett, -1, sizeof(ett));
13147
13148     ett[0] = &ett_ansi_map;
13149     ett[1] = &ett_opr_code;
13150     ett[2] = &ett_component;
13151     ett[3] = &ett_components;
13152     ett[4] = &ett_param;
13153     ett[5] = &ett_params;
13154     ett[6] = &ett_error;
13155     ett[7] = &ett_problem;
13156     ett[8] = &ett_natnum;
13157     ett[9] = &ett_call_mode;
13158     ett[10] = &ett_chan_data;
13159     ett[11] = &ett_code_chan;
13160     ett[12] = &ett_clr_dig_mask;
13161     ett[13] = &ett_ent_dig_mask;
13162     ett[14] = &ett_all_dig_mask;
13163
13164     last_offset = NUM_INDIVIDUAL_PARAMS;
13165
13166     for (i=0; i < NUM_PARAM_1; i++, last_offset++)
13167     {
13168         ett[last_offset] = &ett_ansi_param_1[i];
13169     }
13170
13171     for (i=0; i < NUM_PARAM_2; i++, last_offset++)
13172     {
13173         ett[last_offset] = &ett_ansi_param_2[i];
13174     }
13175
13176     for (i=0; i < NUM_PARAM_3; i++, last_offset++)
13177     {
13178         ett[last_offset] = &ett_ansi_param_3[i];
13179     }
13180
13181     for (i=0; i < NUM_IOS401_ELEM; i++, last_offset++)
13182     {
13183         ett[last_offset] = &ett_ansi_map_ios401_elem[i];
13184     }
13185
13186     /* Register the protocol name and description */
13187     proto_ansi_map =
13188         proto_register_protocol("ANSI Mobile Application Part",
13189             "ANSI MAP", "ansi_map");
13190
13191     is637_tele_id_dissector_table =
13192         register_dissector_table("ansi_map.tele_id", "IS-637 Teleservice ID",
13193             FT_UINT8, BASE_DEC);
13194
13195     is683_dissector_table =
13196         register_dissector_table("ansi_map.ota", "IS-683-A (OTA)",
13197             FT_UINT8, BASE_DEC);
13198
13199     is801_dissector_table =
13200         register_dissector_table("ansi_map.pld", "IS-801 (PLD)",
13201             FT_UINT8, BASE_DEC);
13202
13203     /* Required function calls to register the header fields and subtrees used */
13204     proto_register_field_array(proto_ansi_map, hf, array_length(hf));
13205     proto_register_subtree_array(ett, array_length(ett));
13206
13207     ansi_map_tap = register_tap("ansi_map");
13208 }
13209
13210
13211 void
13212 proto_reg_handoff_ansi_map(void)
13213 {
13214     dissector_handle_t ansi_map_handle;
13215
13216     ansi_map_handle = create_dissector_handle(dissect_ansi_map, proto_ansi_map);
13217
13218     dissector_add("tcap.ansi_ssn", 5, ansi_map_handle);
13219     dissector_add("tcap.ansi_ssn", 6, ansi_map_handle);
13220     dissector_add("tcap.ansi_ssn", 7, ansi_map_handle);
13221     dissector_add("tcap.ansi_ssn", 8, ansi_map_handle);
13222     dissector_add("tcap.ansi_ssn", 9 , ansi_map_handle);
13223     dissector_add("tcap.ansi_ssn", 10 , ansi_map_handle);
13224     dissector_add("tcap.ansi_ssn", 11 , ansi_map_handle);
13225     dissector_add("tcap.ansi_ssn", 12 , ansi_map_handle);
13226
13227     data_handle = find_dissector("data");
13228 }