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