Don't capitalize "Filter" in "Display Filter" in the "Find" dialog box,
[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.15 2004/04/21 05:53:55 guy Exp $
83  *
84  * Ethereal - Network traffic analyzer
85  * By Gerald Combs <gerald@ethereal.com>
86  * Copyright 1998 Gerald Combs
87  *
88  * This program is free software; you can redistribute it and/or
89  * modify it under the terms of the GNU General Public License
90  * as published by the Free Software Foundation; either version 2
91  * of the License, or (at your option) any later version.
92  *
93  * This program is distributed in the hope that it will be useful,
94  * but WITHOUT ANY WARRANTY; without even the implied warranty of
95  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
96  * GNU General Public License for more details.
97  *
98  * You should have received a copy of the GNU General Public License
99  * along with this program; if not, write to the Free Software
100  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
101  */
102
103 #ifdef HAVE_CONFIG_H
104 # include "config.h"
105 #endif
106
107 #include <stdio.h>
108 #include <stdlib.h>
109
110 #include <string.h>
111
112 #include "epan/packet.h"
113 #include "asn1.h"
114 #include "tap.h"
115
116 #include "packet-ansi_a.h"
117 #include "packet-ansi_map.h"
118
119
120 /* PROTOTYPES/FORWARDS */
121
122 static gboolean dissect_ansi_param(ASN1_SCK *asn1, proto_tree *tree);
123
124 /* ANSI PARAM STRINGS */
125 static const value_string ansi_param_1_strings[] = {
126     { 0x81,     "Billing ID" },
127     { 0x82,     "Serving Cell ID" },
128     { 0x83,     "Target Cell ID" },
129     { 0x84,     "Digits" },
130     { 0x85,     "Channel Data" },
131     { 0x86,     "Inter MSC Circuit ID" },
132     { 0x87,     "Inter Switch Count" },
133     { 0x88,     "Mobile Identification Number" },
134     { 0x89,     "Electronic Serial Number" },
135     { 0x8A,     "Release Reason" },
136     { 0x8B,     "Signal Quality" },
137     { 0x8C,     "Station Class Mark" },
138     { 0x8D,     "Authorization Denied" },
139     { 0x8E,     "Authorization Period" },
140     { 0x8F,     "Seizure Type" },
141     { 0x90,     "Trunk Status" },
142     { 0x91,     "Qualification Information Code" },
143     { 0x92,     "Feature Result" },
144     { 0x93,     "Redirection Reason" },
145     { 0x94,     "Access Denied Reason" },
146     { 0x95,     "MSCID" },
147     { 0x96,     "System My Type Code" },
148     { 0x97,     "Origination Indicator" },
149     { 0x98,     "Termination Restriction Code" },
150     { 0x99,     "Calling Features Indicator" },
151     { 0x9A,     "Faulty Parameter" },
152     { 0x9B,     "Usage Indicator" },
153     { 0x9C,     "TDMA Channel Data" },
154     { 0x9D,     "TDMA Call Mode" },
155     { 0x9E,     "Handoff Reason" },
156     { 0, NULL },
157 };
158
159 static const value_string ansi_param_2_strings[] = {
160     { 0x9F1F,   "TDMA Burst Indicator" },
161     { 0x9F20,   "PC_SSN" },
162     { 0x9F21,   "Location Area ID" },
163     { 0x9F22,   "System Access Type" },
164     { 0x9F23,   "Authentication Response" },
165     { 0x9F24,   "Authentication Response Base Station" },
166     { 0x9F25,   "Authentication Response Unique Challenge" },
167     { 0x9F26,   "Call History Count" },
168     { 0x9F27,   "Confidentiality Modes" },
169     { 0x9F28,   "Random Variable" },
170     { 0x9F29,   "Random Variable Base Station" },
171     { 0x9F2A,   "Random Variable SSD" },
172     { 0x9F2B,   "Random Variable Unique Challenge" },
173     { 0x9F2C,   "Report Type" },
174     { 0x9F2D,   "Signaling Message Encryption Key" },
175     { 0x9F2E,   "Shared Secret Data" },
176     { 0x9F2F,   "Terminal Type" },
177     { 0x9F30,   "Voice Privacy Mask" },
178     { 0x9F31,   "System Capabilities" },
179     { 0x9F32,   "Deny Access" },
180     { 0x9F33,   "Update Count" },
181     { 0x9F34,   "SSD Not Shared" },
182     { 0x9F35,   "Extended MSCID" },
183     { 0x9F36,   "Extended System My Type Code" },
184     { 0x9F37,   "Control Channel Data" },
185     { 0x9F38,   "System Access Data" },
186     { 0x9F39,   "Cancellation Denied" },
187     { 0x9F3A,   "Border Cell Access" },
188     { 0x9F3B,   "CDMA Station Class Mark" },
189     { 0x9F3C,   "CDMA Serving One Way Delay" },
190     { 0x9F3D,   "CDMA Target One Way Delay" },
191     { 0x9F3E,   "CDMA Call Mode" },
192     { 0x9F3F,   "CDMA Channel Data" },
193     { 0x9F40,   "CDMA Signal Quality" },
194     { 0x9F41,   "CDMA Pilot Strength" },
195     { 0x9F42,   "CDMA Mobile Protocol Revision" },
196     { 0x9F43,   "CDMA Private Long Code Mask" },
197     { 0x9F44,   "CDMA Code Channel" },
198     { 0x9F45,   "CDMA Search Window" },
199     { 0x9F46,   "MS Location" },
200     { 0x9F47,   "Page Indicator" },
201     { 0x9F48,   "Received Signal Quality" },
202     { 0x9F49,   "Deregistration Type" },
203     { 0x9F4A,   "NAMPS Channel Data" },
204     { 0x9F4B,   "Alert Code" },
205     { 0x9F4C,   "Announcement Code" },
206     { 0x9F4D,   "Authentication Algorithm Version" },
207     { 0x9F4E,   "Authentication Capability" },
208     { 0x9F4F,   "Call History Count Expected" },
209     { 0x9F50,   "Calling Party Number Digits 1" },
210     { 0x9F51,   "Calling Party Number Digits 2" },
211     { 0x9F52,   "Calling Party Number String 1" },
212     { 0x9F53,   "Calling Party Number String 2" },
213     { 0x9F54,   "Calling Party Subaddress" },
214     { 0x9F55,   "Cancellation Type" },
215     { 0x9F56,   "Carrier Digits" },
216     { 0x9F57,   "Destination Digits" },
217     { 0x9F58,   "DMH Redirection Indicator" },
218     { 0x9F59,   "Inter System Termination" },
219     { 0x9F5A,   "Availability Type" },
220     { 0x9F5B,   "Local Termination" },
221     { 0x9F5C,   "Message Waiting Notification Count" },
222     { 0x9F5D,   "Mobile Directory Number" },
223     { 0x9F5E,   "MSCID Number" },
224     { 0x9F5F,   "PSTN Termination" },
225     { 0x9F60,   "No Answer Time" },
226     { 0x9F61,   "One Time Feature Indicator" },
227     { 0x9F62,   "Origination Triggers" },
228     { 0x9F63,   "RANDC" },
229     { 0x9F64,   "Redirecting Number Digits" },
230     { 0x9F65,   "Redirecting Number String" },
231     { 0x9F66,   "Redirecting Number Subaddress" },
232     { 0x9F67,   "Sender Identification Number" },
233     { 0x9F68,   "SMS Address" },
234     { 0x9F69,   "SMS Bearer Data" },
235     { 0x9F6A,   "SMS Charge Indicator" },
236     { 0x9F6B,   "SMS Destination Address" },
237     { 0x9F6C,   "SMS Message Count" },
238     { 0x9F6D,   "SMS Notification Indicator" },
239     { 0x9F6E,   "SMS Original Destination Address" },
240     { 0x9F6F,   "SMS Original Destination Subaddress" },
241     { 0x9F70,   "SMS Original Originating Address" },
242     { 0x9F71,   "SMS Original Originating Subaddress" },
243     { 0x9F72,   "SMS Originating Address" },
244     { 0x9F73,   "SMS Originating Restrictions" },
245     { 0x9F74,   "SMS Teleservice Identifier" },
246     { 0x9F75,   "SMS Termination Restrictions" },
247     { 0x9F76,   "SMS Message Waiting Indicator" },
248     { 0x9F77,   "Termination Access Type" },
249     { 0x9F78,   "Termination List" },
250     { 0x9F79,   "Termination Treatment" },
251     { 0x9F7A,   "Termination Triggers" },
252     { 0x9F7B,   "Transaction Capability" },
253     { 0x9F7C,   "Unique Challenge Report" },
254     { 0, NULL },
255 };
256
257 static const value_string ansi_param_3_strings[] = {
258     { 0x9F8100, "Action Code" },
259     { 0x9F8101, "Alert Result" },
260     { 0xBF8102, "Announcement List" },
261     { 0xBF8103, "CDMA Code Channel Information" },
262     { 0xBF8104, "CDMA Code Channel List" },
263     { 0xBF8105, "CDMA Target Measurement Information" },
264     { 0xBF8106, "CDMA Target Measurement List" },
265     { 0xBF8107, "CDMA Target MAHO Information" },
266     { 0xBF8108, "CDMA Target MAHO List" },
267     { 0x9F8109, "Conference Calling Indicator" },
268     { 0x9F810A, "Count Update Report" },
269     { 0x9F810B, "Digit Collection Control" },
270     { 0x9F810C, "DMH Account Code Digits" },
271     { 0x9F810D, "DMH Alternate Billing Digits" },
272     { 0x9F810E, "DMH Billing Digits" },
273     { 0x9F810F, "Geographic Authorization" },
274     { 0x9F8110, "Leg Information" },
275     { 0x9F8111, "Message Waiting Notification Type" },
276     { 0x9F8112, "PACA Indicator" },
277     { 0x9F8113, "Preferred Language Indicator" },
278     { 0x9F8114, "Random Valid Time" },
279     { 0x9F8115, "Restriction Digits" },
280     { 0x9F8116, "Routing Digits" },
281     { 0x9F8117, "Setup Result" },
282     { 0x9F8118, "SMS Access Denied Reason" },
283     { 0x9F8119, "SMS Cause Code" },
284     { 0x9F811A, "SPINI PIN" },
285     { 0x9F811B, "SPINI Triggers" },
286     { 0x9F811C, "SSD Update Report" },
287     { 0x9F811D, "Target Measurement Information" },
288     { 0x9F811E, "Target Measurement List" },
289     { 0x9F811F, "Voice Mailbox PIN" },
290     { 0x9F8120, "Voice Mailbox Number" },
291     { 0x9F8121, "Authentication Data" },
292     { 0x9F8122, "Conditionally Denied Reason" },
293     { 0x9F8123, "Group Information" },
294     { 0x9F8124, "Handoff State" },
295     { 0x9F8125, "NAMPS Call Mode" },
296     { 0x9F8126, "CDMA Slot Cycle Index" },
297     { 0x9F8127, "Denied Authorization Period" },
298     { 0x9F8128, "Pilot Number" },
299     { 0x9F8129, "Pilot Billing ID" },
300     { 0x9F812A, "CDMA Band Class" },
301     { 0x9F8172, "International Mobile Subscriber Identity" },
302     { 0x9F8173, "Calling Party Name" },
303     { 0x9F8174, "Display Text" },
304     { 0x9F8175, "Redirecting Party Name" },
305     { 0x9F8176, "Service ID" },
306     { 0x9F8177, "All Or None" },
307     { 0x9F8178, "Change" },
308     { 0xBF8179, "Data Access Element" },
309     { 0xBF817A, "Data Access Element List" },
310     { 0xBF817E, "Data Update Result" },
311     { 0xBF817F, "Data Update Result List" },
312     { 0x9F812D, "CDMA Pilot PN" },
313     { 0x9F812E, "CDMA Service Configuration Record" },
314     { 0x9F812F, "CDMA Service Option" },
315     { 0x9F8131, "CDMA Station Class Mark 2" },
316     { 0x9F8132, "TDMA Service Code" },
317     { 0x9F8133, "TDMA Terminal Capability" },
318     { 0x9F8134, "TDMA Voice Coder" },
319     { 0x9F8135, "A-Key Protocol Version" },
320     { 0x9F8136, "Authentication Response Reauthentication" },
321     { 0x9F8137, "Base Station Partial Key" },
322     { 0x9F8138, "Mobile Station MIN" },
323     { 0x9F8139, "Mobile Station Partial Key" },
324     { 0x9F813A, "Modulus Value" },
325     { 0x9F813B, "Newly Assigned MIN" },
326     { 0x9F813D, "OTASP Result Code" },
327     { 0x9F813E, "Primitive Value" },
328     { 0x9F813F, "Random Variable Reauthentication" },
329     { 0x9F8140, "Reauthentication Report" },
330     { 0x9F8141, "Service Indicator" },
331     { 0x9F8142, "Signaling Message Encryption Report" },
332     { 0x9F8143, "Temporary Reference Number" },
333     { 0x9F8144, "Voice Privacy Report" },
334     { 0x9F8147, "Control Channel Mode" },
335     { 0x9F8152, "CDMA Connection Reference" },
336     { 0x9F8153, "CDMA Connection Reference Information" },
337     { 0x9F8154, "CDMA Connection Reference List" },
338     { 0x9F8156, "Change Service Attributes" },
339     { 0x9F8157, "Data Key" },
340     { 0x9F8158, "Data Privacy Parameters" },
341     { 0x9F8159, "ISLP Information" }, /* IS-737 *SPEC CONFLICT* */
342     { 0x9F815A, "Reason List" },
343     { 0x9F815C, "TDMA Bandwidth" },
344     { 0x9F815D, "TDMA Data Features Indicator" },
345     { 0x9F815E, "TDMA Data Mode" },
346     { 0x9F815F, "TDMA Voice Mode" },
347     { 0x9F8160, "Analog Redirect Info" },
348     { 0xBF812B, "CDMA Band Class Information" },
349     { 0xBF812C, "CDMA Band Class List" },
350     { 0xBF8130, "CDMA Service Option List" },
351     { 0xBF8153, "CDMA Connection Reference Information" },
352     { 0xBF8154, "CDMA Connection Reference List" },
353     { 0xBF8161, "Analog Redirect Record" },
354     { 0xBF8202, "Execute Script" },
355     { 0xBF8206, "Modification Request" },
356     { 0xBF8207, "Modification Request List" },
357     { 0xBF8208, "Modification Result List" },
358     { 0xBF820E, "Service Data Access Element" },
359     { 0xBF820F, "Service Data Access Element List" },
360     { 0xBF8210, "Service Data Result" },
361     { 0xBF8211, "Service Data Result List" },
362     { 0xBF8214, "Trigger Address List" },
363     { 0xBF8216, "Trigger List" },
364     { 0xBF8218, "WIN Capability" },
365     { 0xBF822F, "Call Recovery ID" },
366     { 0xBF8230, "Call Recovery ID List" },
367     { 0xBF8250, "Position Information" },
368     { 0xBF825A, "CDMA PSMM List" },
369     { 0x9F8162, "CDMA Channel Number" },
370     { 0xBF8163, "CDMA Channel Number List" },
371     { 0x9F8164, "CDMA Power Combined Indicator" },
372     { 0x9F8165, "CDMA Redirect Record" },
373     { 0x9F8166, "CDMA Search Parameters" },
374     { 0x9F8168, "CDMA Network Identification" },
375     { 0x9F8169, "Network TMSI" },
376     { 0x9F816A, "Network TMSI Expiration Time" },
377     { 0x9F816B, "New Network TMSI" },
378     { 0x9F816C, "Required Parameters Mask" },
379     { 0x9F816D, "Service Redirection Cause" },
380     { 0x9F816E, "Service Redirection Info" },
381     { 0x9F816F, "Roaming Indication" },
382     { 0x9F8170, "MSID" },
383     { 0x9F817B, "Data ID" },
384     { 0x9F817C, "Database Key" },
385     { 0x9F817D, "Data Result" },
386     { 0x9F8200, "Data Value" },
387     { 0x9F8203, "Failure Cause" },
388     { 0x9F8204, "Failure Type" },
389     { 0x9F8205, "Global Title" },
390     { 0x9F8209, "Private Specialized Resource" },
391     { 0x9F820A, "Resume PIC" },
392     { 0x9F820B, "Script Argument" },
393     { 0x9F820C, "Script Name" },
394     { 0x9F820D, "Script Result" },
395     { 0x9F8212, "Specialized Resource" },
396     { 0x9F8213, "Time Date Offset" },
397     { 0x9F8215, "Trigger Capability" },
398     { 0x9F8217, "Trigger Type" },
399     { 0x9F8219, "WIN Operations Capability" },
400     { 0x9F821B, "WIN Trigger List" },
401     { 0x9F821C, "MSC Address" },
402     { 0x9F821D, "Suspicious Access" },
403     { 0x9F821E, "Mobile Station IMSI" },
404     { 0x9F821F, "Newly Assigned IMSI" },
405     { 0x9F822A, "Command Code" },
406     { 0x9F822B, "Display Text 2" },
407     { 0x9F822C, "Page Count" },
408     { 0x9F822D, "Page Response Time" },
409     { 0x9F822E, "SMS Transaction ID" },
410     { 0x9F8231, "DMH Service ID" },
411     { 0x9F8232, "Feature Indicator" },
412     { 0x9F8233, "Control Network ID" },
413     { 0x9F8234, "Release Cause" },
414     { 0x9F8235, "Time Of Day" },
415     { 0x9F8236, "Call Status" },
416     { 0x9F8237, "DMH Charge Information" },
417     { 0x9F8238, "DMH Billing Indicator" },
418     { 0x9F8239, "MS Status" },
419     { 0x9F823B, "Position Information Code" },
420     { 0x9F8246, "Inter Message Time" },
421     { 0x9F8247, "MSID Usage" },
422     { 0x9F8248, "New MIN Extension" },
423     { 0x9F8249, "DTX Indication" },
424     { 0x9F824A, "CDMA Mobile Capabilities" },
425     { 0x9F824B, "Generalized Time" },
426     { 0x9F824C, "Generic Digits" },
427     { 0x9F824D, "Geographic Position" },
428     { 0x9F824E, "Mobile Call Status" },
429     { 0x9F824F, "Mobile Position Capability" },
430     { 0x9F8251, "Position Request Type" },
431     { 0x9F8252, "Position Result" },
432     { 0x9F8253, "Position Source" },
433     { 0x9F8254, "ACG Encountered" },
434     { 0x9F8255, "CDMA State/Control Type *" },  /* PN-3590 (ANSI-41-E)/ACG *SPEC CONFLICT* */
435     { 0x9F8256, "Gap Duration" },
436     { 0x9F8257, "SCF Overload Gap Interval" },
437     { 0x9F8258, "Service Management System Gap Interval" },
438     { 0x9F8259, "CDMA PSMM Count" },
439     { 0x9F825B, "CDMA Serving One Way Delay 2" },
440     { 0x9F825C, "QoS Priority" },
441     { 0x9F825D, "PDSN Address" },
442     { 0x9F825E, "PDSN Protocol Type" },
443     { 0x9F825F, "CDMA MS Measured Channel Identity" },
444     { 0x9F8261, "Range" },
445     { 0x9F8263, "Calling Party Category" },
446     { 0x9F8264, "cdma2000 Handoff Invoke IOS Data" },
447     { 0x9F8265, "cdma2000 Handoff Response IOS Data" },
448     { 0x9F8266, "LCS Client ID" },
449     { 0x9F8267, "TDMA MAHO Cell ID" },
450     { 0x9F8268, "TDMA MAHO Channel" },
451     { 0x9F8269, "CDMA Service Option Connection Identifier" },
452     { 0x9F826A, "TDMA Time Alignment" },
453     { 0x9F826C, "TDMA MAHO Request" },
454     { 0, NULL },
455 };
456
457 /* ANSI TCAP component type */
458 #define ANSI_TC_INVOKE_L 0xe9
459 #define ANSI_TC_RRL 0xea
460 #define ANSI_TC_RE 0xeb
461 #define ANSI_TC_REJECT 0xec
462 #define ANSI_TC_INVOKE_N 0xed
463 #define ANSI_TC_RRN 0xee
464
465 static const value_string ansi_cmp_type_strings[] = {
466     { ANSI_TC_INVOKE_L,         "Invoke(Last)" },
467     { ANSI_TC_RRL,              "RetRes(Last)" },
468     { ANSI_TC_RE,               "RetErr" },
469     { ANSI_TC_REJECT,           "Reject" },
470     { ANSI_TC_INVOKE_N,         "Invoke(Not Last)" },
471     { ANSI_TC_RRN,              "RetRes(Not Last)" },
472     { 0, NULL },
473 };
474
475 const value_string ansi_map_opr_code_strings[] = {
476     { 1,        "Handoff Measurement Request" },
477     { 2,        "Facilities Directive" },
478     { 3,        "Mobile On Channel" },
479     { 4,        "Handoff Back" },
480     { 5,        "Facilities Release" },
481     { 6,        "Qualification Request" },
482     { 7,        "Qualification Directive" },
483     { 8,        "Blocking" },
484     { 9,        "Unblocking" },
485     { 10,       "Reset Circuit" },
486     { 11,       "Trunk Test" },
487     { 12,       "Trunk Test Disconnect" },
488     { 13,       "Registration Notification" },
489     { 14,       "Registration Cancellation" },
490     { 15,       "Location Request" },
491     { 16,       "Routing Request" },
492     { 17,       "Feature Request" },
493     { 18,       "Reserved 18 (Service Profile Request, IS-41-C)" },
494     { 19,       "Reserved 19 (Service Profile Directive, IS-41-C)" },
495     { 20,       "Unreliable Roamer Data Directive" },
496     { 21,       "Reserved 21 (Call Data Request, IS-41-C)" },
497     { 22,       "MS Inactive" },
498     { 23,       "Transfer To Number Request" },
499     { 24,       "Redirection Request" },
500     { 25,       "Handoff To Third" },
501     { 26,       "Flash Request" },
502     { 27,       "Authentication Directive" },
503     { 28,       "Authentication Request" },
504     { 29,       "Base Station Challenge" },
505     { 30,       "Authentication Failure Report" },
506     { 31,       "Count Request" },
507     { 32,       "Inter System Page" },
508     { 33,       "Unsolicited Response" },
509     { 34,       "Bulk Deregistration" },
510     { 35,       "Handoff Measurement Request 2" },
511     { 36,       "Facilities Directive 2" },
512     { 37,       "Handoff Back 2" },
513     { 38,       "Handoff To Third 2" },
514     { 39,       "Authentication Directive Forward" },
515     { 40,       "Authentication Status Report" },
516     { 41,       "Reserved 41" },
517     { 42,       "Information Directive" },
518     { 43,       "Information Forward" },
519     { 44,       "Inter System Answer" },
520     { 45,       "Inter System Page 2" },
521     { 46,       "Inter System Setup" },
522     { 47,       "Origination Request" },
523     { 48,       "Random Variable Request" },
524     { 49,       "Redirection Directive" },
525     { 50,       "Remote User Interaction Directive" },
526     { 51,       "SMS Delivery Backward" },
527     { 52,       "SMS Delivery Forward" },
528     { 53,       "SMS Delivery Point to Point" },
529     { 54,       "SMS Notification" },
530     { 55,       "SMS Request" },
531     { 56,       "OTASP Request" },
532     { 57,       "Information Backward" },
533     { 58,       "Change Facilities" },
534     { 59,       "Change Service" },
535     { 60,       "Parameter Request" },
536     { 61,       "TMSI Directive" },
537     { 62,       "Reserved 62" },
538     { 63,       "Service Request" },
539     { 64,       "Analyzed Information Request" },
540     { 65,       "Connection Failure Report" },
541     { 66,       "Connect Resource" },
542     { 67,       "Disconnect Resource" },
543     { 68,       "Facility Selected and Available" },
544     { 69,       "Instruction Request" },
545     { 70,       "Modify" },
546     { 71,       "Reset Timer" },
547     { 72,       "Search" },
548     { 73,       "Seize Resource" },
549     { 74,       "SRF Directive" },
550     { 75,       "T Busy" },
551     { 76,       "T NoAnswer" },
552     { 77,       "Release" },
553     { 78,       "SMS Delivery Point to Point Ack" },
554     { 79,       "Message Directive" },
555     { 80,       "Bulk Disconnection" },
556     { 81,       "Call Control Directive" },
557     { 82,       "O Answer" },
558     { 83,       "O Disconnect" },
559     { 84,       "Call Recovery Report" },
560     { 85,       "T Answer" },
561     { 86,       "T Disconnect" },
562     { 87,       "Unreliable Call Data" },
563     { 88,       "O CalledPartyBusy" },
564     { 89,       "O NoAnswer" },
565     { 90,       "Position Request" },
566     { 91,       "Position Request Forward" },
567     { 92,       "Call Termination Report" },
568     { 93,       "Geo Position Directive" },
569     { 94,       "Geo Position Request" },
570     { 95,       "Inter System Position Request" },
571     { 96,       "Inter System Position Request Forward" },
572     { 97,       "ACG Directive" },
573     { 98,       "Roamer Database Verification Request" },
574     { 99,       "Add Service" },
575     { 100,      "Drop Service" },
576     { 0, NULL },
577 };
578
579 static const value_string ansi_tele_strings[] = {
580     { 1,        "Reserved for maintenance" },
581     { 4096,     "AMPS Extended Protocol Enhanced Services" },
582     { 4097,     "CDMA Cellular Paging Teleservice" },
583     { 4098,     "CDMA Cellular Messaging Teleservice" },
584     { 4099,     "CDMA Voice Mail Notification" },
585     { 32513,    "TDMA Cellular Messaging Teleservice" },
586     { 32520,    "TDMA System Assisted Mobile Positioning through Satellite (SAMPS)" },
587     { 32584,    "TDMA Segmented System Assisted Mobile Positioning Service" },
588     { 0, NULL },
589 };
590
591 #define NUM_BAND_CLASS_STR      (sizeof(band_class_str)/sizeof(gchar *))
592 static gchar *band_class_str[] = {
593     "800 MHz Cellular System",
594     "1.850 to 1.990 GHz Broadband PCS",
595     "872 to 960 MHz TACS Band",
596     "832 to 925 MHz JTACS Band",
597     "1.750 to 1.870 GHz Korean PCS",
598     "450 MHz NMT",
599     "2 GHz IMT-2000 Band",
600     "North American 700 MHz Cellular Band",
601     "1.710 to 1.880 GHz PCS",
602     "880 to 960 MHz Band",
603     "Secondary 800 MHz Band",
604     "400 MHz European PAMR Band",
605     "800 MHz European PAMR Band"
606 };
607
608 #define NUM_QOS_PRI_STR         (sizeof(qos_pri_str)/sizeof(gchar *))
609 static gchar *qos_pri_str[] = {
610     "Priority Level 0.  This is the lowest level",
611     "Priority Level 1",
612     "Priority Level 2",
613     "Priority Level 3",
614     "Priority Level 4",
615     "Priority Level 5",
616     "Priority Level 6",
617     "Priority Level 7",
618     "Priority Level 8",
619     "Priority Level 9",
620     "Priority Level 10",
621     "Priority Level 11",
622     "Priority Level 12",
623     "Priority Level 13",
624     "Reserved, treat as Priority Level 14",
625     "Reserved, treat as Priority Level 15"
626 };
627
628 /*
629  * would prefer to have had the define set to the exact number of
630  * elements in the array but that is not without it's own problems
631  * (sizeof(ansi_a_ios401_elem_1_strings)/sizeof(value_string))
632  */
633 #define NUM_IOS401_ELEM ANSI_A_MAX_NUM_IOS401_ELEM_1_STRINGS
634 static gint ett_ansi_map_ios401_elem[NUM_IOS401_ELEM];
635
636
637 /* Initialize the protocol and registered fields */
638 static int proto_ansi_map = -1;
639
640 static int ansi_map_tap = -1;
641
642 static int hf_ansi_map_tag = -1;
643 static int hf_ansi_map_length = -1;
644 static int hf_ansi_map_id = -1;
645 static int hf_ansi_map_opr_code = -1;
646 static int hf_ansi_map_param_id = -1;
647 static int hf_ansi_map_ios401_elem_id = -1;
648
649
650 /* Initialize the subtree pointers */
651 static gint ett_ansi_map = -1;
652 static gint ett_opr_code = -1;
653 static gint ett_component = -1;
654 static gint ett_components = -1;
655 static gint ett_params = -1;
656 static gint ett_param = -1;
657 static gint ett_error = -1;
658 static gint ett_problem = -1;
659 static gint ett_natnum = -1;
660 static gint ett_call_mode = -1;
661 static gint ett_chan_data = -1;
662 static gint ett_code_chan = -1;
663 static gint ett_clr_dig_mask = -1;
664 static gint ett_ent_dig_mask = -1;
665 static gint ett_all_dig_mask = -1;
666
667
668 static char bigbuf[1024];
669 static gchar ansi_map_add_string[1024];
670 static dissector_handle_t data_handle;
671 static dissector_table_t is637_tele_id_dissector_table; /* IS-637 Teleservice ID */
672 static dissector_table_t is683_dissector_table; /* IS-683-A (OTA) */
673 static dissector_table_t is801_dissector_table; /* IS-801 (PLD) */
674 static packet_info *g_pinfo;
675 static proto_tree *g_tree;
676 static gint32 ansi_map_sms_tele_id = -1;
677 static gboolean is683_ota;
678 static gboolean is801_pld;
679 static gboolean ansi_map_is_invoke;
680
681
682 typedef struct dgt_set_t
683 {
684     unsigned char out[15];
685 }
686 dgt_set_t;
687
688 static dgt_set_t Dgt_tbcd = {
689     {
690   /*  0   1   2   3   4   5   6   7   8   9   a   b   c   d   e */
691      '0','1','2','3','4','5','6','7','8','9','?','B','C','*','#'
692     }
693 };
694
695 static dgt_set_t Dgt_msid = {
696     {
697   /*  0   1   2   3   4   5   6   7   8   9   a   b   c   d   e */
698      '0','1','2','3','4','5','6','7','8','9','?','?','?','?','?'
699     }
700 };
701
702 /* FUNCTIONS */
703
704 /*
705  * Unpack BCD input pattern into output ASCII pattern
706  *
707  * Input Pattern is supplied using the same format as the digits
708  *
709  * Returns: length of unpacked pattern
710  */
711 static int
712 my_dgt_tbcd_unpack(
713     char        *out,           /* ASCII pattern out */
714     guchar      *in,            /* packed pattern in */
715     int         num_octs,       /* Number of octets to unpack */
716     dgt_set_t   *dgt            /* Digit definitions */
717     )
718 {
719     int cnt = 0;
720     unsigned char i;
721
722     while (num_octs)
723     {
724         /*
725          * unpack first value in byte
726          */
727         i = *in++;
728         *out++ = dgt->out[i & 0x0f];
729         cnt++;
730
731         /*
732          * unpack second value in byte
733          */
734         i >>= 4;
735
736         if (i == 0x0f)  /* odd number bytes - hit filler */
737             break;
738
739         *out++ = dgt->out[i];
740         cnt++;
741         num_octs--;
742     }
743
744     *out = '\0';
745
746     return(cnt);
747 }
748
749 static gchar *
750 my_match_strval(guint32 val, const value_string *vs, gint *idx)
751 {
752     gint i = 0;
753
754     while (vs[i].strptr)
755     {
756         if (vs[i].value == val)
757         {
758             *idx = i;
759             return(vs[i].strptr);
760         }
761
762         i++;
763     }
764
765     *idx = -1;
766     return(NULL);
767 }
768
769
770 /* PARAM FUNCTIONS */
771
772 #define EXTRANEOUS_DATA_CHECK(edc_len, edc_max_len) \
773     if ((edc_len) > (edc_max_len)) \
774     { \
775         proto_tree_add_text(tree, asn1->tvb, \
776             asn1->offset, (edc_len) - (edc_max_len), "Extraneous Data"); \
777         asn1->offset += ((edc_len) - (edc_max_len)); \
778     }
779
780 #define SHORT_DATA_CHECK(sdc_len, sdc_min_len) \
781     if ((sdc_len) < (sdc_min_len)) \
782     { \
783         proto_tree_add_text(tree, asn1->tvb, \
784             asn1->offset, (sdc_len), "Short Data (?)"); \
785         asn1->offset += (sdc_len); \
786         return; \
787     }
788
789 #define EXACT_DATA_CHECK(edc_len, edc_eq_len) \
790     if ((edc_len) != (edc_eq_len)) \
791     { \
792         proto_tree_add_text(tree, asn1->tvb, \
793             asn1->offset, (edc_len), "Unexpected Data Length"); \
794         asn1->offset += (edc_len); \
795         return; \
796     }
797
798 static void
799 param_mscid(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
800 {
801     gint32 market_id, switch_num;
802     guint saved_offset;
803
804     EXACT_DATA_CHECK(len, 3);
805
806     add_string = add_string;
807     saved_offset = asn1->offset;
808
809     asn1_int32_value_decode(asn1, 2, &market_id);
810     asn1_int32_value_decode(asn1, 1, &switch_num);
811
812     proto_tree_add_text(tree, asn1->tvb,
813         saved_offset, asn1->offset - saved_offset,
814         "Market ID %u  Switch Number %u",
815         market_id, switch_num);
816 }
817
818 static void
819 param_page_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
820 {
821     gint32 value;
822     guint saved_offset;
823     gchar *str = NULL;
824
825     add_string = add_string;
826     saved_offset = asn1->offset;
827
828     asn1_int32_value_decode(asn1, 1, &value);
829
830     switch (value)
831     {
832     case 0: str = "Not used"; break;
833     case 1: str = "Page"; break;
834     case 2: str = "Listen only"; break;
835     default:
836         if ((value >= 3) && (value <= 223)) { str = "Reserved, treat as Page"; }
837         else { str = "Reserved for protocol extension, treat as Page"; }
838         break;
839     }
840
841     proto_tree_add_text(tree, asn1->tvb,
842         saved_offset, asn1->offset - saved_offset,
843         str);
844
845     EXTRANEOUS_DATA_CHECK(len, 1);
846 }
847
848 static void
849 param_srvc_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
850 {
851     gint32 value;
852     guint saved_offset;
853     gchar *str = NULL;
854
855     EXACT_DATA_CHECK(len, 1);
856
857     add_string = add_string;
858     saved_offset = asn1->offset;
859
860     asn1_int32_value_decode(asn1, 1, &value);
861
862     switch (value)
863     {
864     case 0: str = "Undefined Service"; break;
865     case 1: str = "CDMA OTASP Service"; is683_ota = TRUE; break;
866     case 2: str = "TDMA OTASP Service"; break;
867     case 3: str = "CDMA OTAPA Service"; is683_ota = TRUE; break;
868     case 4: str = "CDMA Position Determination Service";  is801_pld = TRUE; break;
869     case 5: str = "AMPS Position Determination Service"; break;
870     default:
871         if ((value >= 6) && (value <= 223)) { str = "Reserved, treat as Undefined Service"; }
872         else { str = "Reserved for protocol extension, treat as Undefined Service"; }
873         break;
874     }
875
876     proto_tree_add_text(tree, asn1->tvb,
877         saved_offset, asn1->offset - saved_offset,
878         "%s (%u)",
879         str,
880         value);
881 }
882
883 static void
884 param_sme_report(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
885 {
886     gint32 value;
887     guint saved_offset;
888     gchar *str = NULL;
889
890     EXACT_DATA_CHECK(len, 1);
891
892     add_string = add_string;
893     saved_offset = asn1->offset;
894
895     asn1_int32_value_decode(asn1, 1, &value);
896
897     switch (value)
898     {
899     case 0: str = "Not used"; break;
900     case 1: str = "Signaling Message Encryption enabling not attempted"; break;
901     case 2: str = "Signaling Message Encryption enabling no response"; break;
902     case 3: str = "Signaling Message Encryption is enabled"; break;
903     case 4: str = "Signaling Message Encryption enabling failed"; break;
904     default:
905         if ((value >= 5) && (value <= 223)) { str = "Reserved, treat as Signaling Message Encryption enabling not attempted"; }
906         else { str = "Reserved for protocol extension, treat as Signaling Message Encryption enabling not attempted"; }
907         break;
908     }
909
910     proto_tree_add_text(tree, asn1->tvb,
911         saved_offset, asn1->offset - saved_offset,
912         "%s (%u)",
913         str,
914         value);
915 }
916
917 static void
918 param_alert_code(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
919 {
920     gint32 value;
921     guint saved_offset;
922     gchar *str = NULL;
923
924     SHORT_DATA_CHECK(len, 2);
925
926     add_string = add_string;
927     saved_offset = asn1->offset;
928
929     asn1_int32_value_decode(asn1, 1, &value);
930
931     switch ((value & 0xc0) >> 6)
932     {
933     case 0: str = "Medium"; break;
934     case 1: str = "High"; break;
935     case 2: str = "Low"; break;
936     case 3: str = "Reserved"; break;
937     }
938
939     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
940     proto_tree_add_text(tree, asn1->tvb,
941         saved_offset, asn1->offset - saved_offset,
942         "%s :  Pitch, %s",
943         bigbuf,
944         str);
945
946     switch (value & 0x3f)
947     {
948     case 0: str = "NoTone"; break;
949     case 1: str = "Long"; break;
950     case 2: str = "ShortShort"; break;
951     case 3: str = "ShortShortLong"; break;
952     case 4: str = "ShortShort2"; break;
953     case 5: str = "ShortLongShort"; break;
954     case 6: str = "ShortShortShortShort"; break;
955     case 7: str = "PBXLong"; break;
956     case 8: str = "PBXShortShort"; break;
957     case 9: str = "PBXShortShortLong"; break;
958     case 10: str = "PBXShortLongShort"; break;
959     case 11: str = "PBXShortShortShortShort"; break;
960     case 12: str = "PipPipPipPip"; break;
961     default:
962         str = "Reserved, treat as NoTone";
963         break;
964     }
965
966     other_decode_bitfield_value(bigbuf, value, 0x3f, 8);
967     proto_tree_add_text(tree, asn1->tvb,
968         saved_offset, asn1->offset - saved_offset,
969         "%s :  Cadence, %s",
970         bigbuf,
971         str);
972
973     add_string = add_string;
974     saved_offset = asn1->offset;
975
976     asn1_int32_value_decode(asn1, 1, &value);
977
978     other_decode_bitfield_value(bigbuf, value, 0xf8, 8);
979     proto_tree_add_text(tree, asn1->tvb,
980         saved_offset, asn1->offset - saved_offset,
981         "%s :  Reserved",
982         bigbuf);
983
984     switch (value & 0x07)
985     {
986     case 0: str = "Alert without waiting to report"; break;
987     case 1: str = "Apply a reminder alert once"; break;
988     default:
989         str = "Reserved, treat as Alert without waiting to report";
990         break;
991     }
992
993     other_decode_bitfield_value(bigbuf, value, 0x07, 8);
994     proto_tree_add_text(tree, asn1->tvb,
995         saved_offset, asn1->offset - saved_offset,
996         "%s :  Alert Action, %s",
997         bigbuf,
998         str);
999
1000     EXTRANEOUS_DATA_CHECK(len, 2);
1001 }
1002
1003 static void
1004 param_term_acc_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
1005 {
1006     gint32 value;
1007     guint saved_offset;
1008     gchar *str = NULL;
1009
1010     add_string = add_string;
1011     saved_offset = asn1->offset;
1012
1013     asn1_int32_value_decode(asn1, 1, &value);
1014
1015     switch (value)
1016     {
1017     case 0: str = "Not used"; break;
1018     case 252: str = "Mobile-to-Mobile Directory Number access"; break;
1019     case 253: str = "Land-to-Mobile Directory Number access"; break;
1020     case 254: str = "Land-to-Mobile Directory Number access"; break;
1021     case 255: str = "Roamer port access"; break;
1022     default:
1023         if ((value >= 1) && (value <= 127)) { str = "Reserved for controlling system assignment"; }
1024         else if ((value >= 128) && (value <= 160)) { str = "Reserved for protocol extension, treat as Land-to-Mobile Directory Number access"; }
1025         else { str = "Reserved"; }
1026         break;
1027     }
1028
1029     proto_tree_add_text(tree, asn1->tvb,
1030         saved_offset, asn1->offset - saved_offset,
1031         str);
1032
1033     EXTRANEOUS_DATA_CHECK(len, 1);
1034 }
1035
1036 static void
1037 param_term_treat(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
1038 {
1039     gint32 value;
1040     guint saved_offset;
1041     gchar *str = NULL;
1042
1043     add_string = add_string;
1044     saved_offset = asn1->offset;
1045
1046     asn1_int32_value_decode(asn1, 1, &value);
1047
1048     switch (value)
1049     {
1050     case 0: str = "Not used"; break;
1051     case 1: str = "MS Termination"; break;
1052     case 2: str = "Voice Mail Storage"; break;
1053     case 3: str = "Voice Mail Retrieval"; break;
1054     case 4: str = "Dialogue Termination"; break;
1055     default:
1056         if ((value >= 5) && (value <= 223)) { str = "Reserved, treat as Unrecognized parameter value"; }
1057         else { str = "Reserved for protocol extension, treat as Unrecognized parameter value"; }
1058         break;
1059     }
1060
1061     proto_tree_add_text(tree, asn1->tvb,
1062         saved_offset, asn1->offset - saved_offset,
1063         str);
1064
1065     EXTRANEOUS_DATA_CHECK(len, 1);
1066 }
1067
1068 static void
1069 param_term_trig(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
1070 {
1071     gint32 value;
1072     guint saved_offset;
1073     gchar *str = NULL;
1074
1075     SHORT_DATA_CHECK(len, 2);
1076
1077     add_string = add_string;
1078     saved_offset = asn1->offset;
1079
1080     asn1_int32_value_decode(asn1, 1, &value);
1081
1082     switch ((value & 0xc0) >> 6)
1083     {
1084     case 0: str = "No Answer Call"; break;
1085     case 1: str = "No Answer Trigger"; break;
1086     case 2: str = "No Answer Leg"; break;
1087     case 3: str = "Reserved"; break;
1088     }
1089
1090     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
1091     proto_tree_add_text(tree, asn1->tvb,
1092         saved_offset, asn1->offset - saved_offset,
1093         "%s :  No Answer (NA), %s",
1094         bigbuf,
1095         str);
1096
1097     switch ((value & 0x30) >> 4)
1098     {
1099     case 0: str = "No Page Response Call"; break;
1100     case 1: str = "No Page Response Trigger"; break;
1101     case 2: str = "No Page Response Leg"; break;
1102     case 3: str = "Reserved"; break;
1103     }
1104
1105     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
1106     proto_tree_add_text(tree, asn1->tvb,
1107         saved_offset, asn1->offset - saved_offset,
1108         "%s :  No Page Response (NPR), %s",
1109         bigbuf,
1110         str);
1111
1112     switch ((value & 0x0c) >> 2)
1113     {
1114     case 0: str = "Failed Call"; break;
1115     case 1: str = "Routing Failure Trigger"; break;
1116     case 2: str = "Failed Leg"; break;
1117     case 3: str = "Reserved"; break;
1118     }
1119
1120     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
1121     proto_tree_add_text(tree, asn1->tvb,
1122         saved_offset, asn1->offset - saved_offset,
1123         "%s :  Routing Failure (RF), %s",
1124         bigbuf,
1125         str);
1126
1127     switch (value & 0x03)
1128     {
1129     case 0: str = "Busy Call"; break;
1130     case 1: str = "Busy Trigger"; break;
1131     case 2: str = "Busy Leg"; break;
1132     case 3: str = "Reserved"; break;
1133     }
1134
1135     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
1136     proto_tree_add_text(tree, asn1->tvb,
1137         saved_offset, asn1->offset - saved_offset,
1138         "%s :  Busy, %s",
1139         bigbuf,
1140         str);
1141
1142     add_string = add_string;
1143     saved_offset = asn1->offset;
1144
1145     asn1_int32_value_decode(asn1, 1, &value);
1146
1147     other_decode_bitfield_value(bigbuf, value, 0xfe, 8);
1148     proto_tree_add_text(tree, asn1->tvb,
1149         saved_offset, asn1->offset - saved_offset,
1150         "%s :  Reserved",
1151         bigbuf);
1152
1153     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
1154     proto_tree_add_text(tree, asn1->tvb,
1155         saved_offset, asn1->offset - saved_offset,
1156         "%s :  None Reachable (NR), %s",
1157         bigbuf,
1158         (value & 0x01) ? "Group Not Reachable" : "Member Not Reachable");
1159
1160     EXTRANEOUS_DATA_CHECK(len, 2);
1161 }
1162
1163 static void
1164 param_aav(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
1165 {
1166     gint32 value;
1167     guint saved_offset;
1168
1169     add_string = add_string;
1170     saved_offset = asn1->offset;
1171
1172     asn1_int32_value_decode(asn1, 1, &value);
1173
1174     proto_tree_add_text(tree, asn1->tvb,
1175         saved_offset, asn1->offset - saved_offset,
1176         "Value as used in the CAVE algorithm (%u)",
1177         value);
1178
1179     EXTRANEOUS_DATA_CHECK(len, 1);
1180 }
1181
1182 static void
1183 param_ann_code(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
1184 {
1185     gint32 value;
1186     guint saved_offset;
1187     gchar *str = NULL;
1188
1189     SHORT_DATA_CHECK(len, 3);
1190
1191     add_string = add_string;
1192     saved_offset = asn1->offset;
1193
1194     asn1_int32_value_decode(asn1, 1, &value);
1195
1196     switch (value)
1197     {
1198     case 0: str = "Dialtone"; break;
1199     case 1: str = "Ringback or Audible Alerting"; break;
1200     case 2: str = "Intercept or Mobile Reorder"; break;
1201     case 3: str = "Congestion or Reorder"; break;
1202     case 4: str = "Busy"; break;
1203     case 5: str = "Confirmation"; break;
1204     case 6: str = "Answer"; break;
1205     case 7: str = "Call Waiting"; break;
1206     case 8: str = "Offhook"; break;
1207     case 17: str = "Recall Dial"; break;
1208     case 18: str = "Barge In"; break;
1209     case 20: str = "PPC Insufficient"; break;
1210     case 21: str = "PPC Warning 1"; break;
1211     case 22: str = "PPC Warning 2"; break;
1212     case 23: str = "PPC Warning 3"; break;
1213     case 24: str = "PPC Disconnect"; break;
1214     case 25: str = "PPC Redirect"; break;
1215     case 63: str = "Tones Off"; break;
1216     case 192: str = "Pip"; break;
1217     case 193: str = "Abbreviated Intercept"; break;
1218     case 194: str = "Abbreviated Congestion"; break;
1219     case 195: str = "Warning"; break;
1220     case 196: str = "Denial Tone Burst"; break;
1221     case 197: str = "Dial Tone Burst"; break;
1222     case 250: str = "Incoming Additional Call"; break;
1223     case 251: str = "Priority Additional Call"; break;
1224     default:
1225         str = "Reserved, treat as Tones Off";
1226         break;
1227     }
1228
1229     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
1230     proto_tree_add_text(tree, asn1->tvb,
1231         saved_offset, asn1->offset - saved_offset,
1232         "%s :  Tone %u, %s",
1233         bigbuf,
1234         value,
1235         str);
1236
1237     saved_offset = asn1->offset;
1238
1239     asn1_int32_value_decode(asn1, 1, &value);
1240
1241     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
1242     proto_tree_add_text(tree, asn1->tvb,
1243         saved_offset, asn1->offset - saved_offset,
1244         "%s :  Reserved",
1245         bigbuf);
1246
1247     switch (value & 0x0f)
1248     {
1249     case 0: str = "Concurrent"; break;
1250     case 1: str = "Sequential"; break;
1251     default:
1252         if ((value >= 2) && (value <= 7)) { str = "Reserved, treat as Concurrent"; }
1253         else { str = "Reserved, treat as Sequential"; }
1254         break;
1255     }
1256
1257     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
1258     proto_tree_add_text(tree, asn1->tvb,
1259         saved_offset, asn1->offset - saved_offset,
1260         "%s :  Class %s",
1261         bigbuf,
1262         str);
1263
1264     saved_offset = asn1->offset;
1265
1266     asn1_int32_value_decode(asn1, 1, &value);
1267
1268     switch (value)
1269     {
1270     case 0: str = "None"; break;
1271     case 1: str = "Unauthorized User"; break;
1272     case 2: str = "Invalid ESN"; break;
1273     case 3: str = "Unauthorized Mobile"; break;
1274     case 4: str = "Suspended Origination"; break;
1275     case 5: str = "Origination Denied"; break;
1276     case 6: str = "Service Area Denial"; break;
1277     case 16: str = "Partial Dial"; break;
1278     case 17: str = "Require 1 Plus"; break;
1279     case 18: str = "Require 1 Plus NPA"; break;
1280     case 19: str = "Require 0 Plus"; break;
1281     case 20: str = "Require 0 Plus NPA"; break;
1282     case 21: str = "Deny 1 Plus"; break;
1283     case 22: str = "Unsupported 10 plus"; break;
1284     case 23: str = "Deny 10 plus"; break;
1285     case 24: str = "Unsupported 10 XXX"; break;
1286     case 25: str = "Deny 10 XXX"; break;
1287     case 26: str = "Deny 10 XXX Locally"; break;
1288     case 27: str = "Require 10 Plus"; break;
1289     case 28: str = "Require NPA"; break;
1290     case 29: str = "Deny Toll Origination"; break;
1291     case 30: str = "Deny International Origination"; break;
1292     case 31: str = "Deny 0 Minus"; break;
1293     case 48: str = "Deny Number"; break;
1294     case 49: str = "Alternate Operator Services"; break;
1295     case 64: str = "No Circuit or All Circuits Busy or FacilityProblem"; break;
1296     case 65: str = "Overload"; break;
1297     case 66: str = "Internal Office Failure"; break;
1298     case 67: str = "No Wink Received"; break;
1299     case 68: str = "Interoffice Link Failure"; break;
1300     case 69: str = "Vacant"; break;
1301     case 70: str = "Invalid Prefix or Invalid Access Code"; break;
1302     case 71: str = "Other Dialing Irregularity"; break;
1303     case 80: str = "Vacant Number or Disconnected Number"; break;
1304     case 81: str = "Deny Termination"; break;
1305     case 82: str = "Suspended Termination"; break;
1306     case 83: str = "Changed Number"; break;
1307     case 84: str = "Inaccessible Subscriber"; break;
1308     case 85: str = "Deny Incoming Toll"; break;
1309     case 86: str = "Roamer Access Screening"; break;
1310     case 87: str = "Refuse Call"; break;
1311     case 88: str = "Redirect Call"; break;
1312     case 89: str = "No Page Response"; break;
1313     case 90: str = "No Answer"; break;
1314     case 96: str = "Roamer Intercept"; break;
1315     case 97: str = "General Information"; break;
1316     case 112: str = "Unrecognized Feature Code"; break;
1317     case 113: str = "Unauthorized Feature Code"; break;
1318     case 114: str = "Restricted Feature Code"; break;
1319     case 115: str = "Invalid Modifier Digits"; break;
1320     case 116: str = "Successful Feature Registration"; break;
1321     case 117: str = "Successful Feature Deregistration"; break;
1322     case 118: str = "Successful Feature Activation"; break;
1323     case 119: str = "Successful Feature Deactivation"; break;
1324     case 120: str = "Invalid Forward To Number"; break;
1325     case 121: str = "Courtesy Call Warning"; break;
1326     case 128: str = "Enter PIN Send Prompt"; break;
1327     case 129: str = "Enter PIN Prompt"; break;
1328     case 130: str = "Reenter PIN Send Prompt"; break;
1329     case 131: str = "Reenter PIN Prompt"; break;
1330     case 132: str = "Enter Old PIN Send Prompt"; break;
1331     case 133: str = "Enter Old PIN Prompt"; break;
1332     case 134: str = "Enter New PIN Send Prompt"; break;
1333     case 135: str = "Enter New PIN Prompt"; break;
1334     case 136: str = "Reenter New PIN Send Prompt"; break;
1335     case 137: str = "Reenter New PIN Prompt"; break;
1336     case 138: str = "Enter Password Prompt"; break;
1337     case 139: str = "Enter Directory Number Prompt"; break;
1338     case 140: str = "Reenter Directory Number Prompt"; break;
1339     case 141: str = "Enter Feature Code Prompt"; break;
1340     case 142: str = "Enter Credit Card Number Prompt"; break;
1341     case 143: str = "Enter Destination Number Prompt"; break;
1342     case 152: str = "PPC Insufficient Account Balance"; break;
1343     case 153: str = "PPC Five Minute Warning"; break;
1344     case 154: str = "PPC Three Minute Warning"; break;
1345     case 155: str = "PPC Two Minute Warning"; break;
1346     case 156: str = "PPC One Minute Warning"; break;
1347     case 157: str = "PPC Disconnect"; break;
1348     case 158: str = "PPC Redirect"; break;
1349     default:
1350         str = "Reserved, treat as None";
1351         break;
1352     }
1353
1354     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
1355     proto_tree_add_text(tree, asn1->tvb,
1356         saved_offset, asn1->offset - saved_offset,
1357         "%s :  Standard Announcement, %s",
1358         bigbuf,
1359         str);
1360
1361     if (len == 3) return;
1362
1363     saved_offset = asn1->offset;
1364
1365     asn1_int32_value_decode(asn1, 1, &value);
1366
1367     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
1368     proto_tree_add_text(tree, asn1->tvb,
1369         saved_offset, asn1->offset - saved_offset,
1370         "%s :  Custom Announcement %u",
1371         bigbuf,
1372         value);
1373
1374     EXTRANEOUS_DATA_CHECK(len, 4);
1375 }
1376
1377 static void
1378 param_alert_res(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
1379 {
1380     gint32 value;
1381     guint saved_offset;
1382     gchar *str = NULL;
1383
1384     add_string = add_string;
1385     saved_offset = asn1->offset;
1386
1387     asn1_int32_value_decode(asn1, 1, &value);
1388
1389     switch (value)
1390     {
1391     case 0: str = "Not specified"; break;
1392     case 1: str = "Success"; break;
1393     case 2: str = "Failure"; break;
1394     case 3: str = "Denied"; break;
1395     case 4: str = "Not attempted"; break;
1396     case 5: str = "No page response"; break;
1397     case 6: str = "Busy"; break;
1398     default:
1399         str = "Reserved, treat as Not specified";
1400         break;
1401     }
1402
1403     proto_tree_add_text(tree, asn1->tvb,
1404         saved_offset, asn1->offset - saved_offset,
1405         str);
1406
1407     EXTRANEOUS_DATA_CHECK(len, 1);
1408 }
1409
1410 static void
1411 param_conf_call_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
1412 {
1413     gint32 value;
1414     guint saved_offset;
1415     gchar *str = NULL;
1416
1417     add_string = add_string;
1418     saved_offset = asn1->offset;
1419
1420     asn1_int32_value_decode(asn1, 1, &value);
1421
1422     switch (value)
1423     {
1424     case 0: str = ", Not specified"; break;
1425     case 255: str = ", Unlimited number of conferees"; break;
1426     default:
1427         str = "";
1428         break;
1429     }
1430
1431     proto_tree_add_text(tree, asn1->tvb,
1432         saved_offset, asn1->offset - saved_offset,
1433         "Maximum Number of Conferees, (%u)%s",
1434         value,
1435         str);
1436
1437     EXTRANEOUS_DATA_CHECK(len, 1);
1438 }
1439
1440 static void
1441 param_count_upd_report(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
1442 {
1443     gint32 value;
1444     guint saved_offset;
1445     gchar *str = NULL;
1446
1447     add_string = add_string;
1448     saved_offset = asn1->offset;
1449
1450     asn1_int32_value_decode(asn1, 1, &value);
1451
1452     switch (value)
1453     {
1454     case 0: str = "Not used"; break;
1455     case 1: str = "COUNT Update not attempted"; break;
1456     case 2: str = "COUNT Update no response"; break;
1457     case 3: str = "COUNT Update successful"; break;
1458     default:
1459         if ((value >= 4) && (value <= 223)) { str = "Reserved, treat as COUNT Update not attempted"; }
1460         else { str = "Reserved for protocol extension, treat as COUNT Update not attempted"; }
1461         break;
1462     }
1463
1464     proto_tree_add_text(tree, asn1->tvb,
1465         saved_offset, asn1->offset - saved_offset,
1466         str);
1467
1468     EXTRANEOUS_DATA_CHECK(len, 1);
1469 }
1470
1471 static void
1472 param_ssd_upd_report(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
1473 {
1474     gint32 value;
1475     guint saved_offset;
1476     gchar *str = NULL;
1477
1478     add_string = add_string;
1479     saved_offset = asn1->offset;
1480
1481     asn1_int32_value_decode(asn1, 1, &value);
1482
1483     switch (value)
1484     {
1485     case 0: str = "Not used"; break;
1486     case 1: str = "SSD Update not attempted"; break;
1487     case 2: str = "SSD Update no response"; break;
1488     case 3: str = "SSD Update successful"; break;
1489     case 4: str = "SSD Update failed"; break;
1490     default:
1491         if ((value >= 5) && (value <= 223)) { str = "Reserved, treat as SSD Update not attempted"; }
1492         else { str = "Reserved for protocol extension, treat as SSD Update not attempted"; }
1493         break;
1494     }
1495
1496     proto_tree_add_text(tree, asn1->tvb,
1497         saved_offset, asn1->offset - saved_offset,
1498         str);
1499
1500     EXTRANEOUS_DATA_CHECK(len, 1);
1501 }
1502
1503 static void
1504 param_cond_den_reason(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
1505 {
1506     gint32 value;
1507     guint saved_offset;
1508     gchar *str = NULL;
1509
1510     EXACT_DATA_CHECK(len, 1);
1511
1512     add_string = add_string;
1513     saved_offset = asn1->offset;
1514
1515     asn1_int32_value_decode(asn1, 1, &value);
1516
1517     switch (value)
1518     {
1519     case 0: str = "Not used"; break;
1520     case 1: str = "Waitable (i.e., Call Waiting is possible)"; break;
1521     default:
1522         if ((value >= 2) && (value <= 223)) { str = "Reserved, treat as Waitable"; }
1523         else { str = "Reserved for protocol extension, treat as Waitable"; }
1524         break;
1525     }
1526
1527     proto_tree_add_text(tree, asn1->tvb,
1528         saved_offset, asn1->offset - saved_offset,
1529         str);
1530 }
1531
1532 static void
1533 param_den_auth_per(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
1534 {
1535     gint32 value;
1536     guint saved_offset;
1537     gchar *str = NULL;
1538
1539     SHORT_DATA_CHECK(len, 2);
1540
1541     add_string = add_string;
1542     saved_offset = asn1->offset;
1543
1544     asn1_int32_value_decode(asn1, 1, &value);
1545
1546     switch (value)
1547     {
1548     case 0: str = "Not used"; break;
1549     case 1: str = "Per Call. Re-authorization should be attempted on the next call attempt"; break;
1550     case 2: str = "Hours"; break;
1551     case 3: str = "Days"; break;
1552     case 4: str = "Weeks"; break;
1553     case 5: str = "Per Agreement"; break;
1554     case 6: str = "Reserved"; break;
1555     case 7: str = "Number of calls. Re-authorization should be attempted after this number of (rejected) call attempts"; break;
1556     case 8: str = "Minutes"; break;
1557     default:
1558         if ((value >= 9) && (value <= 223)) { str = "Reserved, treat as Per Call"; }
1559         else { str = "Reserved for protocol extension, treat as Per Call"; }
1560         break;
1561     }
1562
1563     proto_tree_add_text(tree, asn1->tvb,
1564         saved_offset, asn1->offset - saved_offset,
1565         "Period, %s",
1566         str);
1567
1568     saved_offset = asn1->offset;
1569
1570     asn1_int32_value_decode(asn1, 1, &value);
1571
1572     proto_tree_add_text(tree, asn1->tvb,
1573         saved_offset, asn1->offset - saved_offset,
1574         "Value %u",
1575         value);
1576
1577     EXTRANEOUS_DATA_CHECK(len, 2);
1578 }
1579
1580 static void
1581 param_ho_state(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
1582 {
1583     gint32 value;
1584     guint saved_offset;
1585
1586     add_string = add_string;
1587     saved_offset = asn1->offset;
1588
1589     asn1_int32_value_decode(asn1, 1, &value);
1590
1591     other_decode_bitfield_value(bigbuf, value, 0xfe, 8);
1592     proto_tree_add_text(tree, asn1->tvb,
1593         saved_offset, asn1->offset - saved_offset,
1594         "%s :  Reserved",
1595         bigbuf);
1596
1597     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
1598     proto_tree_add_text(tree, asn1->tvb,
1599         saved_offset, asn1->offset - saved_offset,
1600         "%s :  Party Involved (PI), %s",
1601         bigbuf,
1602         (value & 0x01) ? "Terminator is handing off" : "Originator is handing off");
1603
1604     EXTRANEOUS_DATA_CHECK(len, 1);
1605 }
1606
1607 static void
1608 param_geo_auth(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
1609 {
1610     gint32 value;
1611     guint saved_offset;
1612     gchar *str = NULL;
1613
1614     add_string = add_string;
1615     saved_offset = asn1->offset;
1616
1617     asn1_int32_value_decode(asn1, 1, &value);
1618
1619     switch (value)
1620     {
1621     case 0: str = "Not used"; break;
1622     case 1: str = "Authorized for all Market IDs served by the VLR"; break;
1623     case 2: str = "Authorized for this Market ID only"; break;
1624     case 3: str = "Authorized for this Market ID and Switch Number only"; break;
1625     case 4: str = "Authorized for this Location Area ID within a Market ID only"; break;
1626     default:
1627         if ((value >= 5) && (value <= 95)) { str = "Reserved, treat as Authorized for all Market IDs served by the VLR"; }
1628         else if ((value >= 96) && (value <= 127)) { str = "Reserved for protocol extension, treat as Authorized for all Market IDs served by the VLR"; }
1629         else if ((value >= 128) && (value <= 223)) { str = "Reserved, treat as Authorized for this Location Area ID within a Market ID only"; }
1630         else { str = "Reserved for protocol extension, treat as Authorized for this Location Area ID within a Market ID only"; }
1631         break;
1632     }
1633
1634     proto_tree_add_text(tree, asn1->tvb,
1635         saved_offset, asn1->offset - saved_offset,
1636         str);
1637
1638     EXTRANEOUS_DATA_CHECK(len, 1);
1639 }
1640
1641 static void
1642 param_mw_noti_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
1643 {
1644     gint32 value;
1645     guint saved_offset;
1646     gchar *str = NULL;
1647
1648     add_string = add_string;
1649     saved_offset = asn1->offset;
1650
1651     asn1_int32_value_decode(asn1, 1, &value);
1652
1653     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
1654     proto_tree_add_text(tree, asn1->tvb,
1655         saved_offset, asn1->offset - saved_offset,
1656         "%s :  Reserved",
1657         bigbuf);
1658
1659     switch ((value & 0x0c) >> 2)
1660     {
1661     case 0: str = "No MWI. Notification is not authorized or notification is not required"; break;
1662     case 1: str = "Reserved"; break;
1663     case 2: str = "MWI On. Notification is required. Messages waiting"; break;
1664     case 3: str = "MWI Off. Notification is required. No messages waiting"; break;
1665     }
1666
1667     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
1668     proto_tree_add_text(tree, asn1->tvb,
1669         saved_offset, asn1->offset - saved_offset,
1670         "%s :  Message Waiting Indication (MWI), %s",
1671         bigbuf,
1672         str);
1673
1674     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
1675     proto_tree_add_text(tree, asn1->tvb,
1676         saved_offset, asn1->offset - saved_offset,
1677         "%s :  Alert Pip Tone (APT), %s",
1678         bigbuf,
1679         (value & 0x02) ? "notification is required" : "notification is not authorized or notification is not required");
1680
1681     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
1682     proto_tree_add_text(tree, asn1->tvb,
1683         saved_offset, asn1->offset - saved_offset,
1684         "%s :  Pip Tone (PT), %s",
1685         bigbuf,
1686         (value & 0x01) ? "notification is required" : "notification is not authorized or notification is not required");
1687
1688     EXTRANEOUS_DATA_CHECK(len, 1);
1689 }
1690
1691 static void
1692 param_paca_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
1693 {
1694     gint32 value;
1695     guint saved_offset;
1696     gchar *str = NULL;
1697
1698     add_string = add_string;
1699     saved_offset = asn1->offset;
1700
1701     asn1_int32_value_decode(asn1, 1, &value);
1702
1703     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
1704     proto_tree_add_text(tree, asn1->tvb,
1705         saved_offset, asn1->offset - saved_offset,
1706         "%s :  Reserved",
1707         bigbuf);
1708
1709     switch ((value & 0x1e) >> 1)
1710     {
1711     case 0: str = "Not used"; break;
1712     case 1: str = "Priority Level 1"; break;
1713     case 2: str = "Priority Level 2"; break;
1714     case 3: str = "Priority Level 3"; break;
1715     case 4: str = "Priority Level 4"; break;
1716     case 5: str = "Priority Level 5"; break;
1717     case 6: str = "Priority Level 6"; break;
1718     case 7: str = "Priority Level 7"; break;
1719     case 8: str = "Priority Level 8"; break;
1720     case 9: str = "Priority Level 9"; break;
1721     case 10: str = "Priority Level 10"; break;
1722     case 11: str = "Priority Level 11"; break;
1723     case 12: str = "Priority Level 12"; break;
1724     case 13: str = "Priority Level 13"; break;
1725     case 14: str = "Priority Level 14"; break;
1726     case 15: str = "Priority Level 15"; break;
1727     }
1728
1729     other_decode_bitfield_value(bigbuf, value, 0x1e, 8);
1730     proto_tree_add_text(tree, asn1->tvb,
1731         saved_offset, asn1->offset - saved_offset,
1732         "%s :  PACA Level, %s",
1733         bigbuf,
1734         str);
1735
1736     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
1737     proto_tree_add_text(tree, asn1->tvb,
1738         saved_offset, asn1->offset - saved_offset,
1739         "%s :  PACA is %spermanently activated",
1740         bigbuf,
1741         (value & 0x01) ? "" : "not ");
1742
1743     EXTRANEOUS_DATA_CHECK(len, 1);
1744 }
1745
1746 static void
1747 param_digit_collect_ctrl(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
1748 {
1749     gint32 value;
1750     guint saved_offset;
1751     proto_item *item;
1752     proto_tree *subtree;
1753
1754     add_string = add_string;
1755     saved_offset = asn1->offset;
1756
1757     asn1_int32_value_decode(asn1, 1, &value);
1758
1759     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
1760     proto_tree_add_text(tree, asn1->tvb,
1761         saved_offset, asn1->offset - saved_offset,
1762         "%s :  Break (BRK), %s",
1763         bigbuf,
1764         (value & 0x80) ? "Break In (default)" : "No Break");
1765
1766     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
1767     proto_tree_add_text(tree, asn1->tvb,
1768         saved_offset, asn1->offset - saved_offset,
1769         "%s :  Type Ahead (TA), %s",
1770         bigbuf,
1771         (value & 0x40) ? "Buffer (default)" : "No Type Ahead");
1772
1773     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
1774     proto_tree_add_text(tree, asn1->tvb,
1775         saved_offset, asn1->offset - saved_offset,
1776         "%s :  Reserved",
1777         bigbuf);
1778
1779     other_decode_bitfield_value(bigbuf, value, 0x1f, 8);
1780     proto_tree_add_text(tree, asn1->tvb,
1781         saved_offset, asn1->offset - saved_offset,
1782         "%s :  Maximum Collect (%u)",
1783         bigbuf,
1784         (value & 0x1f));
1785
1786     if (len == 1) return;
1787
1788     saved_offset = asn1->offset;
1789
1790     asn1_int32_value_decode(asn1, 1, &value);
1791
1792     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
1793     proto_tree_add_text(tree, asn1->tvb,
1794         saved_offset, asn1->offset - saved_offset,
1795         "%s :  Reserved",
1796         bigbuf);
1797
1798     other_decode_bitfield_value(bigbuf, value, 0x1f, 8);
1799     proto_tree_add_text(tree, asn1->tvb,
1800         saved_offset, asn1->offset - saved_offset,
1801         "%s :  Minimum Collect (%u)",
1802         bigbuf,
1803         (value & 0x1f));
1804
1805     if (len == 2) return;
1806
1807     saved_offset = asn1->offset;
1808
1809     asn1_int32_value_decode(asn1, 1, &value);
1810
1811     proto_tree_add_text(tree, asn1->tvb,
1812         saved_offset, asn1->offset - saved_offset,
1813         "Maximum Interaction Time (%u) seconds",
1814         value);
1815
1816     if (len == 3) return;
1817
1818     saved_offset = asn1->offset;
1819
1820     asn1_int32_value_decode(asn1, 1, &value);
1821
1822     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
1823     proto_tree_add_text(tree, asn1->tvb,
1824         saved_offset, asn1->offset - saved_offset,
1825         "%s :  Reserved",
1826         bigbuf);
1827
1828     other_decode_bitfield_value(bigbuf, value, 0x1f, 8);
1829     proto_tree_add_text(tree, asn1->tvb,
1830         saved_offset, asn1->offset - saved_offset,
1831         "%s :  Initial Interdigit Time (%u) seconds",
1832         bigbuf,
1833         (value & 0x1f));
1834
1835     if (len == 4) return;
1836
1837     saved_offset = asn1->offset;
1838
1839     asn1_int32_value_decode(asn1, 1, &value);
1840
1841     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
1842     proto_tree_add_text(tree, asn1->tvb,
1843         saved_offset, asn1->offset - saved_offset,
1844         "%s :  Reserved",
1845         bigbuf);
1846
1847     other_decode_bitfield_value(bigbuf, value, 0x1f, 8);
1848     proto_tree_add_text(tree, asn1->tvb,
1849         saved_offset, asn1->offset - saved_offset,
1850         "%s :  Normal Interdigit Time (%u) seconds",
1851         bigbuf,
1852         (value & 0x1f));
1853
1854     if (len == 5) return;
1855
1856     saved_offset = asn1->offset;
1857
1858     item =
1859         proto_tree_add_text(tree, asn1->tvb,
1860             saved_offset, (len > 6) ? 2 : 1,
1861             "Clear Digits Digit Mask");
1862
1863     subtree = proto_item_add_subtree(item, ett_clr_dig_mask);
1864
1865     asn1_int32_value_decode(asn1, 1, &value);
1866
1867     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
1868     proto_tree_add_text(subtree, asn1->tvb,
1869         saved_offset, asn1->offset - saved_offset,
1870         "%s :  7 Digit",
1871         bigbuf);
1872
1873     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
1874     proto_tree_add_text(subtree, asn1->tvb,
1875         saved_offset, asn1->offset - saved_offset,
1876         "%s :  6 Digit",
1877         bigbuf);
1878
1879     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
1880     proto_tree_add_text(subtree, asn1->tvb,
1881         saved_offset, asn1->offset - saved_offset,
1882         "%s :  5 Digit",
1883         bigbuf);
1884
1885     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
1886     proto_tree_add_text(subtree, asn1->tvb,
1887         saved_offset, asn1->offset - saved_offset,
1888         "%s :  4 Digit",
1889         bigbuf);
1890
1891     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
1892     proto_tree_add_text(subtree, asn1->tvb,
1893         saved_offset, asn1->offset - saved_offset,
1894         "%s :  3 Digit",
1895         bigbuf);
1896
1897     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
1898     proto_tree_add_text(subtree, asn1->tvb,
1899         saved_offset, asn1->offset - saved_offset,
1900         "%s :  2 Digit",
1901         bigbuf);
1902
1903     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
1904     proto_tree_add_text(subtree, asn1->tvb,
1905         saved_offset, asn1->offset - saved_offset,
1906         "%s :  1 Digit",
1907         bigbuf);
1908
1909     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
1910     proto_tree_add_text(subtree, asn1->tvb,
1911         saved_offset, asn1->offset - saved_offset,
1912         "%s :  0 Digit",
1913         bigbuf);
1914
1915     if (len == 6) return;
1916
1917     saved_offset = asn1->offset;
1918
1919     asn1_int32_value_decode(asn1, 1, &value);
1920
1921     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
1922     proto_tree_add_text(subtree, asn1->tvb,
1923         saved_offset, asn1->offset - saved_offset,
1924         "%s :  Reserved",
1925         bigbuf);
1926
1927     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
1928     proto_tree_add_text(subtree, asn1->tvb,
1929         saved_offset, asn1->offset - saved_offset,
1930         "%s :  # Digit",
1931         bigbuf);
1932
1933     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
1934     proto_tree_add_text(subtree, asn1->tvb,
1935         saved_offset, asn1->offset - saved_offset,
1936         "%s :  * Digit",
1937         bigbuf);
1938
1939     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
1940     proto_tree_add_text(subtree, asn1->tvb,
1941         saved_offset, asn1->offset - saved_offset,
1942         "%s :  Reserved",
1943         bigbuf);
1944
1945     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
1946     proto_tree_add_text(subtree, asn1->tvb,
1947         saved_offset, asn1->offset - saved_offset,
1948         "%s :  9 Digit",
1949         bigbuf);
1950
1951     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
1952     proto_tree_add_text(subtree, asn1->tvb,
1953         saved_offset, asn1->offset - saved_offset,
1954         "%s :  8 Digit",
1955         bigbuf);
1956
1957     if (len == 7) return;
1958
1959     saved_offset = asn1->offset;
1960
1961     item =
1962         proto_tree_add_text(tree, asn1->tvb,
1963             saved_offset, (len > 8) ? 2 : 1,
1964             "Enter Digits Digit Mask");
1965
1966     subtree = proto_item_add_subtree(item, ett_ent_dig_mask);
1967
1968     asn1_int32_value_decode(asn1, 1, &value);
1969
1970     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
1971     proto_tree_add_text(subtree, asn1->tvb,
1972         saved_offset, asn1->offset - saved_offset,
1973         "%s :  7 Digit",
1974         bigbuf);
1975
1976     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
1977     proto_tree_add_text(subtree, asn1->tvb,
1978         saved_offset, asn1->offset - saved_offset,
1979         "%s :  6 Digit",
1980         bigbuf);
1981
1982     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
1983     proto_tree_add_text(subtree, asn1->tvb,
1984         saved_offset, asn1->offset - saved_offset,
1985         "%s :  5 Digit",
1986         bigbuf);
1987
1988     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
1989     proto_tree_add_text(subtree, asn1->tvb,
1990         saved_offset, asn1->offset - saved_offset,
1991         "%s :  4 Digit",
1992         bigbuf);
1993
1994     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
1995     proto_tree_add_text(subtree, asn1->tvb,
1996         saved_offset, asn1->offset - saved_offset,
1997         "%s :  3 Digit",
1998         bigbuf);
1999
2000     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
2001     proto_tree_add_text(subtree, asn1->tvb,
2002         saved_offset, asn1->offset - saved_offset,
2003         "%s :  2 Digit",
2004         bigbuf);
2005
2006     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
2007     proto_tree_add_text(subtree, asn1->tvb,
2008         saved_offset, asn1->offset - saved_offset,
2009         "%s :  1 Digit",
2010         bigbuf);
2011
2012     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
2013     proto_tree_add_text(subtree, asn1->tvb,
2014         saved_offset, asn1->offset - saved_offset,
2015         "%s :  0 Digit",
2016         bigbuf);
2017
2018     if (len == 8) return;
2019
2020     saved_offset = asn1->offset;
2021
2022     asn1_int32_value_decode(asn1, 1, &value);
2023
2024     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
2025     proto_tree_add_text(subtree, asn1->tvb,
2026         saved_offset, asn1->offset - saved_offset,
2027         "%s :  Reserved",
2028         bigbuf);
2029
2030     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
2031     proto_tree_add_text(subtree, asn1->tvb,
2032         saved_offset, asn1->offset - saved_offset,
2033         "%s :  # Digit",
2034         bigbuf);
2035
2036     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
2037     proto_tree_add_text(subtree, asn1->tvb,
2038         saved_offset, asn1->offset - saved_offset,
2039         "%s :  * Digit",
2040         bigbuf);
2041
2042     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
2043     proto_tree_add_text(subtree, asn1->tvb,
2044         saved_offset, asn1->offset - saved_offset,
2045         "%s :  Reserved",
2046         bigbuf);
2047
2048     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
2049     proto_tree_add_text(subtree, asn1->tvb,
2050         saved_offset, asn1->offset - saved_offset,
2051         "%s :  9 Digit",
2052         bigbuf);
2053
2054     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
2055     proto_tree_add_text(subtree, asn1->tvb,
2056         saved_offset, asn1->offset - saved_offset,
2057         "%s :  8 Digit",
2058         bigbuf);
2059
2060     if (len == 9) return;
2061
2062     saved_offset = asn1->offset;
2063
2064     item =
2065         proto_tree_add_text(tree, asn1->tvb,
2066             saved_offset, (len > 10) ? 2 : 1,
2067             "Allowed Digits Digit Mask");
2068
2069     subtree = proto_item_add_subtree(item, ett_all_dig_mask);
2070
2071     asn1_int32_value_decode(asn1, 1, &value);
2072
2073     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
2074     proto_tree_add_text(subtree, asn1->tvb,
2075         saved_offset, asn1->offset - saved_offset,
2076         "%s :  7 Digit",
2077         bigbuf);
2078
2079     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
2080     proto_tree_add_text(subtree, asn1->tvb,
2081         saved_offset, asn1->offset - saved_offset,
2082         "%s :  6 Digit",
2083         bigbuf);
2084
2085     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
2086     proto_tree_add_text(subtree, asn1->tvb,
2087         saved_offset, asn1->offset - saved_offset,
2088         "%s :  5 Digit",
2089         bigbuf);
2090
2091     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
2092     proto_tree_add_text(subtree, asn1->tvb,
2093         saved_offset, asn1->offset - saved_offset,
2094         "%s :  4 Digit",
2095         bigbuf);
2096
2097     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
2098     proto_tree_add_text(subtree, asn1->tvb,
2099         saved_offset, asn1->offset - saved_offset,
2100         "%s :  3 Digit",
2101         bigbuf);
2102
2103     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
2104     proto_tree_add_text(subtree, asn1->tvb,
2105         saved_offset, asn1->offset - saved_offset,
2106         "%s :  2 Digit",
2107         bigbuf);
2108
2109     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
2110     proto_tree_add_text(subtree, asn1->tvb,
2111         saved_offset, asn1->offset - saved_offset,
2112         "%s :  1 Digit",
2113         bigbuf);
2114
2115     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
2116     proto_tree_add_text(subtree, asn1->tvb,
2117         saved_offset, asn1->offset - saved_offset,
2118         "%s :  0 Digit",
2119         bigbuf);
2120
2121     if (len == 10) return;
2122
2123     saved_offset = asn1->offset;
2124
2125     asn1_int32_value_decode(asn1, 1, &value);
2126
2127     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
2128     proto_tree_add_text(subtree, asn1->tvb,
2129         saved_offset, asn1->offset - saved_offset,
2130         "%s :  Reserved",
2131         bigbuf);
2132
2133     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
2134     proto_tree_add_text(subtree, asn1->tvb,
2135         saved_offset, asn1->offset - saved_offset,
2136         "%s :  # Digit",
2137         bigbuf);
2138
2139     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
2140     proto_tree_add_text(subtree, asn1->tvb,
2141         saved_offset, asn1->offset - saved_offset,
2142         "%s :  * Digit",
2143         bigbuf);
2144
2145     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
2146     proto_tree_add_text(subtree, asn1->tvb,
2147         saved_offset, asn1->offset - saved_offset,
2148         "%s :  Reserved",
2149         bigbuf);
2150
2151     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
2152     proto_tree_add_text(subtree, asn1->tvb,
2153         saved_offset, asn1->offset - saved_offset,
2154         "%s :  9 Digit",
2155         bigbuf);
2156
2157     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
2158     proto_tree_add_text(subtree, asn1->tvb,
2159         saved_offset, asn1->offset - saved_offset,
2160         "%s :  8 Digit",
2161         bigbuf);
2162
2163     if (len == 11) return;
2164
2165     saved_offset = asn1->offset;
2166
2167     asn1_int32_value_decode(asn1, 1, &value);
2168
2169     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
2170     proto_tree_add_text(tree, asn1->tvb,
2171         saved_offset, asn1->offset - saved_offset,
2172         "%s :  Reserved",
2173         bigbuf);
2174
2175     other_decode_bitfield_value(bigbuf, value, 0x1f, 8);
2176     proto_tree_add_text(tree, asn1->tvb,
2177         saved_offset, asn1->offset - saved_offset,
2178         "%s :  Special Interdigit Time (%u)",
2179         bigbuf,
2180         value & 0x1f);
2181
2182     if (len == 12) return;
2183
2184     saved_offset = asn1->offset;
2185
2186     asn1_int32_value_decode(asn1, 1, &value);
2187
2188     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
2189     proto_tree_add_text(tree, asn1->tvb,
2190         saved_offset, asn1->offset - saved_offset,
2191         "%s :  SIT 8",
2192         bigbuf);
2193
2194     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
2195     proto_tree_add_text(tree, asn1->tvb,
2196         saved_offset, asn1->offset - saved_offset,
2197         "%s :  SIT 7",
2198         bigbuf);
2199
2200     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
2201     proto_tree_add_text(tree, asn1->tvb,
2202         saved_offset, asn1->offset - saved_offset,
2203         "%s :  SIT 6",
2204         bigbuf);
2205
2206     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
2207     proto_tree_add_text(tree, asn1->tvb,
2208         saved_offset, asn1->offset - saved_offset,
2209         "%s :  SIT 5",
2210         bigbuf);
2211
2212     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
2213     proto_tree_add_text(tree, asn1->tvb,
2214         saved_offset, asn1->offset - saved_offset,
2215         "%s :  SIT 4",
2216         bigbuf);
2217
2218     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
2219     proto_tree_add_text(tree, asn1->tvb,
2220         saved_offset, asn1->offset - saved_offset,
2221         "%s :  SIT 3",
2222         bigbuf);
2223
2224     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
2225     proto_tree_add_text(tree, asn1->tvb,
2226         saved_offset, asn1->offset - saved_offset,
2227         "%s :  SIT 2",
2228         bigbuf);
2229
2230     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
2231     proto_tree_add_text(tree, asn1->tvb,
2232         saved_offset, asn1->offset - saved_offset,
2233         "%s :  SIT 1",
2234         bigbuf);
2235
2236     if (len == 13) return;
2237
2238     saved_offset = asn1->offset;
2239
2240     asn1_int32_value_decode(asn1, 1, &value);
2241
2242     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
2243     proto_tree_add_text(tree, asn1->tvb,
2244         saved_offset, asn1->offset - saved_offset,
2245         "%s :  SIT 16",
2246         bigbuf);
2247
2248     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
2249     proto_tree_add_text(tree, asn1->tvb,
2250         saved_offset, asn1->offset - saved_offset,
2251         "%s :  SIT 15",
2252         bigbuf);
2253
2254     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
2255     proto_tree_add_text(tree, asn1->tvb,
2256         saved_offset, asn1->offset - saved_offset,
2257         "%s :  SIT 14",
2258         bigbuf);
2259
2260     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
2261     proto_tree_add_text(tree, asn1->tvb,
2262         saved_offset, asn1->offset - saved_offset,
2263         "%s :  SIT 13",
2264         bigbuf);
2265
2266     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
2267     proto_tree_add_text(tree, asn1->tvb,
2268         saved_offset, asn1->offset - saved_offset,
2269         "%s :  SIT 12",
2270         bigbuf);
2271
2272     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
2273     proto_tree_add_text(tree, asn1->tvb,
2274         saved_offset, asn1->offset - saved_offset,
2275         "%s :  SIT 11",
2276         bigbuf);
2277
2278     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
2279     proto_tree_add_text(tree, asn1->tvb,
2280         saved_offset, asn1->offset - saved_offset,
2281         "%s :  SIT 10",
2282         bigbuf);
2283
2284     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
2285     proto_tree_add_text(tree, asn1->tvb,
2286         saved_offset, asn1->offset - saved_offset,
2287         "%s :  SIT 9",
2288         bigbuf);
2289
2290     if (len == 14) return;
2291
2292     saved_offset = asn1->offset;
2293
2294     asn1_int32_value_decode(asn1, 1, &value);
2295
2296     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
2297     proto_tree_add_text(tree, asn1->tvb,
2298         saved_offset, asn1->offset - saved_offset,
2299         "%s :  SIT 24",
2300         bigbuf);
2301
2302     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
2303     proto_tree_add_text(tree, asn1->tvb,
2304         saved_offset, asn1->offset - saved_offset,
2305         "%s :  SIT 23",
2306         bigbuf);
2307
2308     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
2309     proto_tree_add_text(tree, asn1->tvb,
2310         saved_offset, asn1->offset - saved_offset,
2311         "%s :  SIT 22",
2312         bigbuf);
2313
2314     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
2315     proto_tree_add_text(tree, asn1->tvb,
2316         saved_offset, asn1->offset - saved_offset,
2317         "%s :  SIT 21",
2318         bigbuf);
2319
2320     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
2321     proto_tree_add_text(tree, asn1->tvb,
2322         saved_offset, asn1->offset - saved_offset,
2323         "%s :  SIT 20",
2324         bigbuf);
2325
2326     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
2327     proto_tree_add_text(tree, asn1->tvb,
2328         saved_offset, asn1->offset - saved_offset,
2329         "%s :  SIT 19",
2330         bigbuf);
2331
2332     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
2333     proto_tree_add_text(tree, asn1->tvb,
2334         saved_offset, asn1->offset - saved_offset,
2335         "%s :  SIT 18",
2336         bigbuf);
2337
2338     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
2339     proto_tree_add_text(tree, asn1->tvb,
2340         saved_offset, asn1->offset - saved_offset,
2341         "%s :  SIT 17",
2342         bigbuf);
2343
2344     if (len == 15) return;
2345
2346     saved_offset = asn1->offset;
2347
2348     asn1_int32_value_decode(asn1, 1, &value);
2349
2350     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
2351     proto_tree_add_text(tree, asn1->tvb,
2352         saved_offset, asn1->offset - saved_offset,
2353         "%s :  Reserved",
2354         bigbuf);
2355
2356     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
2357     proto_tree_add_text(tree, asn1->tvb,
2358         saved_offset, asn1->offset - saved_offset,
2359         "%s :  SIT 31",
2360         bigbuf);
2361
2362     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
2363     proto_tree_add_text(tree, asn1->tvb,
2364         saved_offset, asn1->offset - saved_offset,
2365         "%s :  SIT 30",
2366         bigbuf);
2367
2368     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
2369     proto_tree_add_text(tree, asn1->tvb,
2370         saved_offset, asn1->offset - saved_offset,
2371         "%s :  SIT 29",
2372         bigbuf);
2373
2374     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
2375     proto_tree_add_text(tree, asn1->tvb,
2376         saved_offset, asn1->offset - saved_offset,
2377         "%s :  SIT 28",
2378         bigbuf);
2379
2380     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
2381     proto_tree_add_text(tree, asn1->tvb,
2382         saved_offset, asn1->offset - saved_offset,
2383         "%s :  SIT 27",
2384         bigbuf);
2385
2386     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
2387     proto_tree_add_text(tree, asn1->tvb,
2388         saved_offset, asn1->offset - saved_offset,
2389         "%s :  SIT 26",
2390         bigbuf);
2391
2392     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
2393     proto_tree_add_text(tree, asn1->tvb,
2394         saved_offset, asn1->offset - saved_offset,
2395         "%s :  SIT 25",
2396         bigbuf);
2397
2398     EXTRANEOUS_DATA_CHECK(len, 16);
2399 }
2400
2401 static void
2402 param_no_ans_time(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
2403 {
2404     gint32 value;
2405     guint saved_offset;
2406
2407     add_string = add_string;
2408     saved_offset = asn1->offset;
2409
2410     asn1_int32_value_decode(asn1, 1, &value);
2411
2412     proto_tree_add_text(tree, asn1->tvb,
2413         saved_offset, asn1->offset - saved_offset,
2414         "(%u) The number of seconds to wait after alerting an MS or after seizing an outgoing trunk before applying no answer trigger treatment.",
2415         value);
2416
2417     EXTRANEOUS_DATA_CHECK(len, 1);
2418 }
2419
2420 static void
2421 param_mw_noti_count(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
2422 {
2423     gint32 value;
2424     guint saved_offset, orig_offset;
2425     gchar *str = NULL;
2426
2427     SHORT_DATA_CHECK(len, 2);
2428
2429     add_string = add_string;
2430     orig_offset = asn1->offset;
2431     saved_offset = asn1->offset;
2432
2433     do
2434     {
2435         asn1_int32_value_decode(asn1, 1, &value);
2436
2437         switch (value)
2438         {
2439         case 0: str = "Voice Messages"; break;
2440         case 1: str = "Short Message Services (SMS) messages"; break;
2441         case 2: str = "Group 3 (G3) Fax messages"; break;
2442         case 255: str = "Not specified"; break;
2443         default:
2444             str = "Reserved, treat as Not specified";
2445             break;
2446         }
2447
2448         proto_tree_add_text(tree, asn1->tvb,
2449             saved_offset, asn1->offset - saved_offset,
2450             "Type of messages, %s",
2451             str);
2452
2453         saved_offset = asn1->offset;
2454
2455         asn1_int32_value_decode(asn1, 1, &value);
2456
2457         switch (value)
2458         {
2459         case 0: str = "No messages are waiting"; break;
2460         case 254: str = "254 or more messages are waiting"; break;
2461         case 255: str = "An unknown number of messages are waiting (greater than zero)"; break;
2462         default:
2463             sprintf(bigbuf, "%u messages are waiting", value);
2464             str = bigbuf;
2465             break;
2466         }
2467
2468         proto_tree_add_text(tree, asn1->tvb,
2469             saved_offset, asn1->offset - saved_offset,
2470             str);
2471
2472         saved_offset = asn1->offset;
2473     }
2474     while ((len - (saved_offset - orig_offset)) >= 2);
2475
2476     EXTRANEOUS_DATA_CHECK((len - (saved_offset - orig_offset)), 0);
2477 }
2478
2479 static void
2480 param_otfi(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
2481 {
2482     gint32 value;
2483     guint saved_offset;
2484     gchar *str = NULL;
2485
2486     add_string = add_string;
2487     saved_offset = asn1->offset;
2488
2489     asn1_int32_value_decode(asn1, 1, &value);
2490
2491     switch ((value & 0xc0) >> 6)
2492     {
2493     case 0: str = "Ignore"; break;
2494     case 1: str = "Presentation Allowed"; break;
2495     case 2: str = "Presentation Restricted"; break;
2496     case 3: str = "Reserved"; break;
2497     }
2498
2499     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
2500     proto_tree_add_text(tree, asn1->tvb,
2501         saved_offset, asn1->offset - saved_offset,
2502         "%s :  Calling Number ID Restriction, %s",
2503         bigbuf,
2504         str);
2505
2506     switch ((value & 0x30) >> 4)
2507     {
2508     case 0: str = "Ignore"; break;
2509     case 1: str = "Pip Tone Inactive"; break;
2510     case 2: str = "Pip Tone Active"; break;
2511     case 3: str = "Reserved"; break;
2512     }
2513
2514     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
2515     proto_tree_add_text(tree, asn1->tvb,
2516         saved_offset, asn1->offset - saved_offset,
2517         "%s :  Message Waiting Notification, %s",
2518         bigbuf,
2519         str);
2520
2521     switch ((value & 0x0c) >> 2)
2522     {
2523     case 0: str = "Ignore"; break;
2524     case 1: str = "No CW"; break;
2525     case 2: str = "Normal CW"; break;
2526     case 3: str = "Priority CW"; break;
2527     }
2528
2529     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
2530     proto_tree_add_text(tree, asn1->tvb,
2531         saved_offset, asn1->offset - saved_offset,
2532         "%s :  Call Waiting for Incoming Call (CWIC), %s",
2533         bigbuf,
2534         str);
2535
2536     switch (value & 0x03)
2537     {
2538     case 0: str = "Ignore"; break;
2539     case 1: str = "No CW"; break;
2540     case 2: str = "Normal CW"; break;
2541     case 3: str = "Priority CW"; break;
2542     }
2543
2544     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
2545     proto_tree_add_text(tree, asn1->tvb,
2546         saved_offset, asn1->offset - saved_offset,
2547         "%s :  Call Waiting for Future Incoming Call (CWFI), %s",
2548         bigbuf,
2549         str);
2550
2551     if (len == 1) return;
2552
2553     saved_offset = asn1->offset;
2554
2555     asn1_int32_value_decode(asn1, 1, &value);
2556
2557     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
2558     proto_tree_add_text(tree, asn1->tvb,
2559         saved_offset, asn1->offset - saved_offset,
2560         "%s :  Reserved",
2561         bigbuf);
2562
2563     switch ((value & 0x30) >> 4)
2564     {
2565     case 0: str = "Ignore"; break;
2566     case 1: str = "Presentation Allowed"; break;
2567     case 2: str = "Presentation Restricted"; break;
2568     case 3: str = "Blocking Toggle"; break;
2569     }
2570
2571     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
2572     proto_tree_add_text(tree, asn1->tvb,
2573         saved_offset, asn1->offset - saved_offset,
2574         "%s :  Calling Name Restriction (CNAR), %s",
2575         bigbuf,
2576         str);
2577
2578     switch ((value & 0x0c) >> 2)
2579     {
2580     case 0: str = "Ignore"; break;
2581     case 1: str = "Flash Inactive"; break;
2582     case 2: str = "Flash Active"; break;
2583     case 3: str = "Reserved"; break;
2584     }
2585
2586     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
2587     proto_tree_add_text(tree, asn1->tvb,
2588         saved_offset, asn1->offset - saved_offset,
2589         "%s :  Flash Privileges (Flash), %s",
2590         bigbuf,
2591         str);
2592
2593     switch (value & 0x03)
2594     {
2595     case 0: str = "Ignore"; break;
2596     case 1: str = "PACA Demand Inactive"; break;
2597     case 2: str = "PACA Demand Actived"; break;
2598     case 3: str = "Reserved"; break;
2599     }
2600
2601     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
2602     proto_tree_add_text(tree, asn1->tvb,
2603         saved_offset, asn1->offset - saved_offset,
2604         "%s :  Priority Access and Channel Assignment (PACA), %s",
2605         bigbuf,
2606         str);
2607
2608     EXTRANEOUS_DATA_CHECK(len, 2);
2609 }
2610
2611 /*
2612  * For:
2613  *      Authentication Response
2614  *      Authentication Response Base Station
2615  *      Authentication Response Unique Challenge
2616  */
2617 static void
2618 param_auth_resp_all(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
2619 {
2620     gint32 value;
2621     guint saved_offset;
2622
2623     EXACT_DATA_CHECK(len, 3);
2624
2625     add_string = add_string;
2626     saved_offset = asn1->offset;
2627
2628     asn1_int32_value_decode(asn1, 1, &value);
2629
2630     other_decode_bitfield_value(bigbuf, value, 0xfc, 8);
2631     proto_tree_add_text(tree, asn1->tvb,
2632         saved_offset, asn1->offset - saved_offset,
2633         "%s :  Reserved",
2634         bigbuf);
2635
2636     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
2637     proto_tree_add_text(tree, asn1->tvb,
2638         saved_offset, asn1->offset - saved_offset,
2639         "%s :  Response (MSB)",
2640         bigbuf);
2641
2642     saved_offset = asn1->offset;
2643
2644     asn1_int32_value_decode(asn1, 1, &value);
2645
2646     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
2647     proto_tree_add_text(tree, asn1->tvb,
2648         saved_offset, asn1->offset - saved_offset,
2649         "%s :  Response",
2650         bigbuf);
2651
2652     saved_offset = asn1->offset;
2653
2654     asn1_int32_value_decode(asn1, 1, &value);
2655
2656     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
2657     proto_tree_add_text(tree, asn1->tvb,
2658         saved_offset, asn1->offset - saved_offset,
2659         "%s :  Response (LSB)",
2660         bigbuf);
2661 }
2662
2663 static void
2664 param_sys_acc_data(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
2665 {
2666     gint32 value;
2667     guint saved_offset;
2668
2669     EXACT_DATA_CHECK(len, 5);
2670
2671     param_mscid(asn1, tree, 3, add_string);
2672
2673     saved_offset = asn1->offset;
2674     asn1_int32_value_decode(asn1, 2, &value);
2675
2676     proto_tree_add_text(tree, asn1->tvb,
2677         saved_offset, asn1->offset - saved_offset,
2678         "Serving Cell ID %u",
2679         value);
2680 }
2681
2682 static void
2683 param_bill_id(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
2684 {
2685     gint32 id, segcount;
2686     guint saved_offset;
2687     gchar *str = NULL;
2688
2689     EXACT_DATA_CHECK(len, 7);
2690
2691     param_mscid(asn1, tree, 3, add_string);
2692
2693     saved_offset = asn1->offset;
2694     asn1_int32_value_decode(asn1, 3, &id);
2695
2696     proto_tree_add_text(tree, asn1->tvb,
2697         saved_offset, asn1->offset - saved_offset,
2698         "ID Number %u",
2699         id);
2700
2701     saved_offset = asn1->offset;
2702     asn1_int32_value_decode(asn1, 1, &segcount);
2703
2704     if (segcount == 255) { str = "Unspecified"; }
2705     else if ((segcount >= 0) && (segcount <= 127)) { str = "Number of call segments"; }
2706     else if ((segcount >= 128) && (segcount < 255)) { str = "Not used in TIA/EIA-41"; }
2707
2708     proto_tree_add_text(tree, asn1->tvb,
2709         saved_offset, asn1->offset - saved_offset,
2710         "Segment Counter %u:  %s",
2711         segcount, str);
2712 }
2713
2714 static void
2715 param_cdma_so(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
2716 {
2717     gint32 so;
2718     guint saved_offset;
2719     gchar *str = NULL;
2720
2721     SHORT_DATA_CHECK(len, 2);
2722
2723     add_string = add_string;
2724     saved_offset = asn1->offset;
2725     asn1_int32_value_decode(asn1, 2, &so);
2726
2727     switch (so)
2728     {
2729     case 1: str = "Basic Variable Rate Voice Service (8 kbps)"; break;
2730     case 2: str = "Mobile Station Loopback (8 kbps)"; break;
2731     case 3: str = "Enhanced Variable Rate Voice Service (8 kbps)"; break;
2732     case 4: str = "Asynchronous Data Service (9.6 kbps)"; break;
2733     case 5: str = "Group 3 Facsimile (9.6 kbps)"; break;
2734     case 6: str = "Short Message Services (Rate Set 1)"; break;
2735     case 7: str = "Packet Data Service: Internet or ISO Protocol Stack (9.6 kbps)"; break;
2736     case 8: str = "Packet Data Service: CDPD Protocol Stack (9.6 kbps)"; break;
2737     case 9: str = "Mobile Station Loopback (13 kbps)"; break;
2738     case 10: str = "STU-III Transparent Service"; break;
2739     case 11: str = "STU-III Non-Transparent Service"; break;
2740     case 12: str = "Asynchronous Data Service (14.4 or 9.6 kbps)"; break;
2741     case 13: str = "Group 3 Facsimile (14.4 or 9.6 kbps)"; break;
2742     case 14: str = "Short Message Services (Rate Set 2)"; break;
2743     case 15: str = "Packet Data Service: Internet or ISO Protocol Stack (14.4 kbps)"; break;
2744     case 16: str = "Packet Data Service: CDPD Protocol Stack (14.4 kbps)"; break;
2745     case 17: str = "High Rate Voice Service (13 kbps)"; break;
2746     case 32768: str = "QCELP (13 kbps)"; break;
2747     case 18: str = "Over-the-Air Parameter Administration (Rate Set 1)"; break;
2748     case 19: str = "Over-the-Air Parameter Administration (Rate Set 2)"; break;
2749     case 20: str = "Group 3 Analog Facsimile (Rate Set 1)"; break;
2750     case 21: str = "Group 3 Analog Facsimile (Rate Set 2)"; break;
2751     case 22: str = "High Speed Packet Data Service: Internet or ISO Protocol Stack (RS1 forward, RS1 reverse)"; break;
2752     case 23: str = "High Speed Packet Data Service: Internet or ISO Protocol Stack (RS1 forward, RS2 reverse)"; break;
2753     case 24: str = "High Speed Packet Data Service: Internet or ISO Protocol Stack (RS2 forward, RS1 reverse)"; break;
2754     case 25: str = "High Speed Packet Data Service: Internet or ISO Protocol Stack (RS2 forward, RS2 reverse)"; break;
2755     case 26: str = "High Speed Packet Data Service: CDPD Protocol Stack (RS1 forward, RS1 reverse)"; break;
2756     case 27: str = "High Speed Packet Data Service: CDPD Protocol Stack (RS1 forward, RS2 reverse)"; break;
2757     case 28: str = "High Speed Packet Data Service: CDPD Protocol Stack (RS2 forward, RS1 reverse)"; break;
2758     case 29: str = "High Speed Packet Data Service: CDPD Protocol Stack (RS2 forward, RS2 reverse)"; break;
2759     case 30: str = "Supplemental Channel Loopback Test for Rate Set 1"; break;
2760     case 31: str = "Supplemental Channel Loopback Test for Rate Set 2"; break;
2761     case 32: str = "Test Data Service Option (TDSO)"; break;
2762     case 33: str = "cdma2000 High Speed Packet Data Service, Internet or ISO Protocol Stack"; break;
2763     case 34: str = "cdma2000 High Speed Packet Data Service, CDPD Protocol Stack"; break;
2764     case 35: str = "Location Services, Rate Set 1 (9.6 kbps)"; break;
2765     case 36: str = "Location Services, Rate Set 2 (14.4 kbps)"; break;
2766     case 37: str = "ISDN Interworking Service (64 kbps)"; break;
2767     case 38: str = "GSM Voice"; break;
2768     case 39: str = "GSM Circuit Data"; break;
2769     case 40: str = "GSM Packet Data"; break;
2770     case 41: str = "GSM Short Message Service"; break;
2771     case 42: str = "None Reserved for MC-MAP standard service options"; break;
2772     case 54: str = "Markov Service Option (MSO)"; break;
2773     case 55: str = "Loopback Service Option (LSO)"; break;
2774     case 56: str = "Selectable Mode Vocoder"; break;
2775     case 57: str = "32 kbps Circuit Video Conferencing"; break;
2776     case 58: str = "64 kbps Circuit Video Conferencing"; break;
2777     case 59: str = "HRPD Accounting Records Identifier"; break;
2778     case 60: str = "Link Layer Assisted Robust Header Compression (LLA ROHC) - Header Removal"; break;
2779     case 61: str = "Link Layer Assisted Robust Header Compression (LLA ROHC) - Header Compression"; break;
2780     case 62: str = "- 4099 None Reserved for standard service options"; break;
2781     case 4100: str = "Asynchronous Data Service, Revision 1 (9.6 or 14.4 kbps)"; break;
2782     case 4101: str = "Group 3 Facsimile, Revision 1 (9.6 or 14.4 kbps)"; break;
2783     case 4102: str = "Reserved for standard service option"; break;
2784     case 4103: str = "Packet Data Service: Internet or ISO Protocol Stack, Revision 1 (9.6 or 14.4 kbps)"; break;
2785     case 4104: str = "Packet Data Service: CDPD Protocol Stack, Revision 1 (9.6 or 14.4 kbps)"; break;
2786     default:
2787         if ((so >= 4105) && (so <= 32767)) { str = "Reserved for standard service options"; }
2788         else if ((so >= 32769) && (so <= 32771)) { str = "Proprietary QUALCOMM Incorporated"; }
2789         else if ((so >= 32772) && (so <= 32775)) { str = "Proprietary OKI Telecom"; }
2790         else if ((so >= 32776) && (so <= 32779)) { str = "Proprietary Lucent Technologies"; }
2791         else if ((so >= 32780) && (so <=32783)) { str = "Nokia"; }
2792         else if ((so >= 32784) && (so <=32787)) { str = "NORTEL NETWORKS"; }
2793         else if ((so >= 32788) && (so <=32791)) { str = "Sony Electronics Inc."; }
2794         else if ((so >= 32792) && (so <=32795)) { str = "Motorola"; }
2795         else if ((so >= 32796) && (so <=32799)) { str = "QUALCOMM Incorporated"; }
2796         else if ((so >= 32800) && (so <=32803)) { str = "QUALCOMM Incorporated"; }
2797         else if ((so >= 32804) && (so <=32807)) { str = "QUALCOMM Incorporated"; }
2798         else if ((so >= 32808) && (so <=32811)) { str = "QUALCOMM Incorporated"; }
2799         else if ((so >= 32812) && (so <=32815)) { str = "Lucent Technologies"; }
2800         else if ((so >= 32816) && (so <=32819)) { str = "Denso International"; }
2801         else if ((so >= 32820) && (so <=32823)) { str = "Motorola"; }
2802         else if ((so >= 32824) && (so <=32827)) { str = "Denso International"; }
2803         else if ((so >= 32828) && (so <=32831)) { str = "Denso International"; }
2804         else if ((so >= 32832) && (so <=32835)) { str = "Denso International"; }
2805         else if ((so >= 32836) && (so <=32839)) { str = "NEC America"; }
2806         else if ((so >= 32840) && (so <=32843)) { str = "Samsung Electronics"; }
2807         else if ((so >= 32844) && (so <=32847)) { str = "Texas Instruments Incorporated"; }
2808         else if ((so >= 32848) && (so <=32851)) { str = "Toshiba Corporation"; }
2809         else if ((so >= 32852) && (so <=32855)) { str = "LG Electronics Inc."; }
2810         else if ((so >= 32856) && (so <=32859)) { str = "VIA Telecom Inc."; }
2811         else { str = "Reserved"; }
2812         break;
2813     }
2814
2815     proto_tree_add_text(tree, asn1->tvb,
2816         saved_offset, asn1->offset - saved_offset,
2817         "%s %u/0x%04x",
2818         str, so, so);
2819
2820     sprintf(add_string, " - (SO=0x%04x)", so);
2821
2822     EXTRANEOUS_DATA_CHECK(len, 2);
2823 }
2824
2825 static void
2826 param_tdma_sc(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
2827 {
2828     gint32 value;
2829     guint saved_offset;
2830     gchar *str = NULL;
2831
2832     add_string = add_string;
2833     saved_offset = asn1->offset;
2834
2835     asn1_int32_value_decode(asn1, 1, &value);
2836
2837     switch (value)
2838     {
2839     case 0: str = "Analog Speech Only"; break;
2840     case 1: str = "Digital Speech Only"; break;
2841     case 2: str = "Analog or Digital Speech, Analog Preferred"; break;
2842     case 3: str = "Analog or Digital Speech, Digital Preferred"; break;
2843     case 4: str = "Asynchronous Data"; break;
2844     case 5: str = "G3 Fax"; break;
2845     case 6: str = "Not Used (Service Rejected)"; break;
2846     case 7: str = "STU III (Secure Telephone Unit)"; break;
2847     default:
2848         str = "Reserved, treat as Analog Speech Only";
2849         break;
2850     }
2851
2852     proto_tree_add_text(tree, asn1->tvb,
2853         saved_offset, asn1->offset - saved_offset,
2854         "%s %u",
2855         str, value);
2856
2857     EXTRANEOUS_DATA_CHECK(len, 1);
2858 }
2859
2860 static void
2861 param_dmh_red_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
2862 {
2863     gint32 redind;
2864     guint saved_offset;
2865     gchar *str = NULL;
2866
2867     EXACT_DATA_CHECK(len, 1);
2868
2869     add_string = add_string;
2870     saved_offset = asn1->offset;
2871
2872     asn1_int32_value_decode(asn1, 1, &redind);
2873
2874     switch (redind)
2875     {
2876     case 0: str = "Not used"; break;
2877     case 1: str = "Call Forwarding Unconditional (CFU)"; break;
2878     case 2: str = "Call Forwarding Busy (CFB)"; break;
2879     case 3: str = "Call Forwarding No Answer (CFNA)"; break;
2880     case 4: str = "Call Forwarding Other (CFO)"; break;
2881     case 5: str = "CD Unspecified"; break;
2882     case 6: str = "CD PSTN"; break;
2883     case 7: str = "CD Private"; break;
2884     case 8: str = "PSTN Tandem"; break;
2885     case 9: str = "Private Tandem"; break;
2886     case 10: str = "Busy"; break;
2887     case 11: str = "Inactive"; break;
2888     case 12: str = "Unassigned"; break;
2889     case 13: str = "Termination Denied"; break;
2890     case 14: str = "CD Failure"; break;
2891     case 15: str = "Explicit Call Transfer (ECT)"; break;
2892     case 16: str = "Mobile Access Hunting (MAH)"; break;
2893     case 17: str = "Flexible Alerting (FA)"; break;
2894     case 18: str = "Abandoned Call Leg"; break;
2895     case 19: str = "Password Call Acceptance (PCA) Call Refused"; break;
2896     case 20: str = "Selective Call Acceptance (SCA) Call Refused"; break;
2897     case 21: str = "Dialogue"; break;
2898     case 22: str = "Call Forwarding Default (CFD)"; break;
2899     case 23: str = "CD Local"; break;
2900     case 24: str = "Voice Mail Retrieval"; break;
2901     default:
2902         if ((redind >= 25) && (redind <= 127))
2903         {
2904             str = "Reserved/Unknown";
2905         }
2906         else
2907         {
2908             str = "Reserved for bilateral agreements";
2909         }
2910         break;
2911     }
2912
2913     proto_tree_add_text(tree, asn1->tvb,
2914         saved_offset, asn1->offset - saved_offset,
2915         "%s (%u)",
2916         str, redind);
2917 }
2918
2919 static void
2920 param_cic(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
2921 {
2922     gint32 tg, mem;
2923     guint saved_offset;
2924
2925     EXACT_DATA_CHECK(len, 2);
2926
2927     add_string = add_string;
2928     saved_offset = asn1->offset;
2929
2930     asn1_int32_value_decode(asn1, 1, &tg);
2931     asn1_int32_value_decode(asn1, 1, &mem);
2932
2933     proto_tree_add_text(tree, asn1->tvb,
2934         saved_offset, len,
2935         "Trunk Group %u  Member %u",
2936         tg, mem);
2937
2938     sprintf(add_string, "- (%u/%u)", tg, mem);
2939 }
2940
2941 static void
2942 param_qic(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
2943 {
2944     gint32 qic;
2945     guint saved_offset;
2946     gchar *str = NULL;
2947
2948     EXACT_DATA_CHECK(len, 1);
2949
2950     add_string = add_string;
2951     saved_offset = asn1->offset;
2952
2953     asn1_int32_value_decode(asn1, 1, &qic);
2954
2955     switch (qic)
2956     {
2957     case 0: str = "Not used"; break;
2958     case 1: str = "No information"; break;
2959     case 2: str = "Validation only"; break;
2960     case 3: str = "Validation and profile"; break;
2961     case 4: str = "Profile only"; break;
2962     default:
2963         if ((qic >= 5) && (qic <= 223))
2964         {
2965             str = "Reserved, treat as Validation and profile";
2966         }
2967         else
2968         {
2969             str = "Reserved for extension, treat as Validation and profile";
2970         }
2971         break;
2972     }
2973
2974     proto_tree_add_text(tree, asn1->tvb,
2975         saved_offset, asn1->offset - saved_offset,
2976         str);
2977 }
2978
2979 static void
2980 param_feat_result(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
2981 {
2982     gint32 value;
2983     guint saved_offset;
2984     gchar *str = NULL;
2985
2986     EXACT_DATA_CHECK(len, 1);
2987
2988     add_string = add_string;
2989     saved_offset = asn1->offset;
2990
2991     asn1_int32_value_decode(asn1, 1, &value);
2992
2993     switch (value)
2994     {
2995     case 0: str = "Not used"; break;
2996     case 1: str = "Unsuccessful"; break;
2997     case 2: str = "Successful"; break;
2998     default:
2999         if ((value >= 3) && (value <= 95)) { str = "Reserved, treat as Unsuccessful"; }
3000         else if ((value >= 96) && (value <= 127)) { str = "Reserved, treat as Unsuccessful"; }
3001         else if ((value >= 128) && (value <= 223)) { str = "Reserved, treat as Successful"; }
3002         else { str = "Reserved for protocol extension, treat as Successful"; }
3003         break;
3004     }
3005
3006     proto_tree_add_text(tree, asn1->tvb,
3007         saved_offset, asn1->offset - saved_offset,
3008         str);
3009 }
3010
3011 gchar *calling_feat_ind_str[] = {
3012     "Not used",
3013     "Not authorized",
3014     "Authorized but de-activated",
3015     "Authorized and activated"
3016 };
3017
3018 static void
3019 param_calling_feat_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
3020 {
3021     gint32 value;
3022     guint saved_offset;
3023
3024     SHORT_DATA_CHECK(len, 2);
3025
3026     add_string = add_string;
3027     saved_offset = asn1->offset;
3028
3029     asn1_int32_value_decode(asn1, 1, &value);
3030
3031     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3032     proto_tree_add_text(tree, asn1->tvb,
3033         saved_offset, asn1->offset - saved_offset,
3034         "%s :  Call Waiting Feature Activity (CW-FA), %s",
3035         bigbuf,
3036         calling_feat_ind_str[(value & 0xc0) >> 6]);
3037
3038     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
3039     proto_tree_add_text(tree, asn1->tvb,
3040         saved_offset, asn1->offset - saved_offset,
3041         "%s :  Call Forwarding No Answer Feature Activity (CFNA-FA), %s",
3042         bigbuf,
3043         calling_feat_ind_str[(value & 0x30) >> 4]);
3044
3045     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
3046     proto_tree_add_text(tree, asn1->tvb,
3047         saved_offset, asn1->offset - saved_offset,
3048         "%s :  Call Forwarding Busy Feature Activity (CFB-FA), %s",
3049         bigbuf,
3050         calling_feat_ind_str[(value & 0x0c) >> 2]);
3051
3052     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3053     proto_tree_add_text(tree, asn1->tvb,
3054         saved_offset, asn1->offset - saved_offset,
3055         "%s :  Call Forwarding Unconditional Feature Activity (CFU-FA), %s",
3056         bigbuf,
3057         calling_feat_ind_str[value & 0x03]);
3058
3059     saved_offset = asn1->offset;
3060
3061     asn1_int32_value_decode(asn1, 1, &value);
3062
3063     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3064     proto_tree_add_text(tree, asn1->tvb,
3065         saved_offset, asn1->offset - saved_offset,
3066         "%s :  Call Transfer Feature Activity (CT-FA), %s",
3067         bigbuf,
3068         calling_feat_ind_str[(value & 0xc0) >> 6]);
3069
3070     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
3071     proto_tree_add_text(tree, asn1->tvb,
3072         saved_offset, asn1->offset - saved_offset,
3073         "%s :  Voice Privacy Feature Activity (VP-FA), %s",
3074         bigbuf,
3075         calling_feat_ind_str[(value & 0x30) >> 4]);
3076
3077     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
3078     proto_tree_add_text(tree, asn1->tvb,
3079         saved_offset, asn1->offset - saved_offset,
3080         "%s :  Call Delivery Feature Activity (CD-FA), %s",
3081         bigbuf,
3082         calling_feat_ind_str[(value & 0x0c) >> 2]);
3083
3084     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3085     proto_tree_add_text(tree, asn1->tvb,
3086         saved_offset, asn1->offset - saved_offset,
3087         "%s :  Three-Way Calling Feature Activity (3WC-FA), %s",
3088         bigbuf,
3089         calling_feat_ind_str[value & 0x03]);
3090
3091     if (len == 2) return;
3092
3093     saved_offset = asn1->offset;
3094
3095     asn1_int32_value_decode(asn1, 1, &value);
3096
3097     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3098     proto_tree_add_text(tree, asn1->tvb,
3099         saved_offset, asn1->offset - saved_offset,
3100         "%s :  Calling Number ID Restriction Override Feature Activity (CNIROver-FA), %s",
3101         bigbuf,
3102         calling_feat_ind_str[(value & 0xc0) >> 6]);
3103
3104     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
3105     proto_tree_add_text(tree, asn1->tvb,
3106         saved_offset, asn1->offset - saved_offset,
3107         "%s :  Calling Number ID Restriction Feature Activity (CNIR-FA), %s",
3108         bigbuf,
3109         calling_feat_ind_str[(value & 0x30) >> 4]);
3110
3111     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
3112     proto_tree_add_text(tree, asn1->tvb,
3113         saved_offset, asn1->offset - saved_offset,
3114         "%s :  Two number Calling Number ID Presentation Feature Activity (CNIP2-FA), %s",
3115         bigbuf,
3116         calling_feat_ind_str[(value & 0x0c) >> 2]);
3117
3118     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3119     proto_tree_add_text(tree, asn1->tvb,
3120         saved_offset, asn1->offset - saved_offset,
3121         "%s :  One number Calling Number ID Presentation Feature Activity (CNIP1-FA), %s",
3122         bigbuf,
3123         calling_feat_ind_str[value & 0x03]);
3124
3125     if (len == 3) return;
3126
3127     saved_offset = asn1->offset;
3128
3129     asn1_int32_value_decode(asn1, 1, &value);
3130
3131     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3132     proto_tree_add_text(tree, asn1->tvb,
3133         saved_offset, asn1->offset - saved_offset,
3134         "%s :  USCF divert to voice mail Feature Activity (USCFvm-FA), %s",
3135         bigbuf,
3136         calling_feat_ind_str[(value & 0xc0) >> 6]);
3137
3138     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
3139     proto_tree_add_text(tree, asn1->tvb,
3140         saved_offset, asn1->offset - saved_offset,
3141         "%s :  Answer Hold Feature Activity (AH-FA), %s",
3142         bigbuf,
3143         calling_feat_ind_str[(value & 0x30) >> 4]);
3144
3145     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
3146     proto_tree_add_text(tree, asn1->tvb,
3147         saved_offset, asn1->offset - saved_offset,
3148         "%s :  Data Privacy Feature Activity (DP-FA), %s",
3149         bigbuf,
3150         calling_feat_ind_str[(value & 0x0c) >> 2]);
3151
3152     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3153     proto_tree_add_text(tree, asn1->tvb,
3154         saved_offset, asn1->offset - saved_offset,
3155         "%s :  Priority Call Waiting Feature Activity (PCW-FA), %s",
3156         bigbuf,
3157         calling_feat_ind_str[value & 0x03]);
3158
3159     if (len == 4) return;
3160
3161     saved_offset = asn1->offset;
3162
3163     asn1_int32_value_decode(asn1, 1, &value);
3164
3165     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3166     proto_tree_add_text(tree, asn1->tvb,
3167         saved_offset, asn1->offset - saved_offset,
3168         "%s :  CDMA-Concurrent Service Feature Activity (CCS-FA), %s",
3169         bigbuf,
3170         calling_feat_ind_str[(value & 0xc0) >> 6]);
3171
3172     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
3173     proto_tree_add_text(tree, asn1->tvb,
3174         saved_offset, asn1->offset - saved_offset,
3175         "%s :  CDMA-Packet Data Service Feature Activity (CPDS-FA), %s",
3176         bigbuf,
3177         calling_feat_ind_str[(value & 0x30) >> 4]);
3178
3179     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
3180     proto_tree_add_text(tree, asn1->tvb,
3181         saved_offset, asn1->offset - saved_offset,
3182         "%s :  USCF divert to network registered DN Feature Activity (USCFnr-FA), %s",
3183         bigbuf,
3184         calling_feat_ind_str[(value & 0x0c) >> 2]);
3185
3186     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3187     proto_tree_add_text(tree, asn1->tvb,
3188         saved_offset, asn1->offset - saved_offset,
3189         "%s :  USCF divert to mobile station provided DN Feature Activity (USCFms-FA), %s",
3190         bigbuf,
3191         calling_feat_ind_str[value & 0x03]);
3192
3193     if (len == 5) return;
3194
3195     saved_offset = asn1->offset;
3196
3197     asn1_int32_value_decode(asn1, 1, &value);
3198
3199     other_decode_bitfield_value(bigbuf, value, 0xfc, 8);
3200     proto_tree_add_text(tree, asn1->tvb,
3201         saved_offset, asn1->offset - saved_offset,
3202         "%s :  Reserved",
3203         bigbuf);
3204
3205     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3206     proto_tree_add_text(tree, asn1->tvb,
3207         saved_offset, asn1->offset - saved_offset,
3208         "%s :  TDMA Enhanced Privacy and Encryption Feature Activity (TDMA EPE-FA), %s",
3209         bigbuf,
3210         calling_feat_ind_str[value & 0x03]);
3211
3212     EXTRANEOUS_DATA_CHECK(len, 6);
3213 }
3214
3215 static void
3216 param_usage_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
3217 {
3218     gint32 value;
3219     guint saved_offset;
3220     gchar *str = NULL;
3221
3222     EXACT_DATA_CHECK(len, 1);
3223
3224     add_string = add_string;
3225     saved_offset = asn1->offset;
3226
3227     asn1_int32_value_decode(asn1, 1, &value);
3228
3229     switch (value)
3230     {
3231     case 0: str = "Unspecified"; break;
3232     case 1: str = "Sent-paid call"; break;
3233     case 2: str = "3rd number bill"; break;
3234     default:
3235         str = "Reserved, treat as Unspecified";
3236         break;
3237     }
3238
3239     proto_tree_add_text(tree, asn1->tvb,
3240         saved_offset, asn1->offset - saved_offset,
3241         "%s (%u)",
3242         str,
3243         value);
3244 }
3245
3246 gchar *tdma_data_feat_ind_str[] = {
3247     "Not used",
3248     "Not authorized",
3249     "Authorized but de-activated",
3250     "Authorized and activated"
3251 };
3252
3253 static void
3254 param_tdma_data_feat_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
3255 {
3256     gint32 value;
3257     guint saved_offset;
3258
3259     SHORT_DATA_CHECK(len, 2);
3260
3261     add_string = add_string;
3262     saved_offset = asn1->offset;
3263
3264     asn1_int32_value_decode(asn1, 1, &value);
3265
3266     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3267     proto_tree_add_text(tree, asn1->tvb,
3268         saved_offset, asn1->offset - saved_offset,
3269         "%s :  Reserved",
3270         bigbuf);
3271
3272     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
3273     proto_tree_add_text(tree, asn1->tvb,
3274         saved_offset, asn1->offset - saved_offset,
3275         "%s :  STU-III Feature Activity (STUIII-FA), %s",
3276         bigbuf,
3277         tdma_data_feat_ind_str[(value & 0x30) >> 4]);
3278
3279     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
3280     proto_tree_add_text(tree, asn1->tvb,
3281         saved_offset, asn1->offset - saved_offset,
3282         "%s :  G3 Fax Feature Activity (G3FAX-FA), %s",
3283         bigbuf,
3284         tdma_data_feat_ind_str[(value & 0x0c) >> 2]);
3285
3286     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3287     proto_tree_add_text(tree, asn1->tvb,
3288         saved_offset, asn1->offset - saved_offset,
3289         "%s :  ADS Feature Activity (ADS-FA), %s",
3290         bigbuf,
3291         tdma_data_feat_ind_str[value & 0x03]);
3292
3293     saved_offset = asn1->offset;
3294
3295     asn1_int32_value_decode(asn1, 1, &value);
3296
3297     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3298     proto_tree_add_text(tree, asn1->tvb,
3299         saved_offset, asn1->offset - saved_offset,
3300         "%s :  Triple Rate data Feature Activity (3RATE-FA), %s",
3301         bigbuf,
3302         tdma_data_feat_ind_str[(value & 0xc0) >> 6]);
3303
3304     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
3305     proto_tree_add_text(tree, asn1->tvb,
3306         saved_offset, asn1->offset - saved_offset,
3307         "%s :  Double Rate data Feature Activity (2RATE-FA), %s",
3308         bigbuf,
3309         tdma_data_feat_ind_str[(value & 0x30) >> 4]);
3310
3311     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
3312     proto_tree_add_text(tree, asn1->tvb,
3313         saved_offset, asn1->offset - saved_offset,
3314         "%s :  Full Rate data Feature Activity (FRATE-FA), %s",
3315         bigbuf,
3316         tdma_data_feat_ind_str[(value & 0x0c) >> 2]);
3317
3318     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3319     proto_tree_add_text(tree, asn1->tvb,
3320         saved_offset, asn1->offset - saved_offset,
3321         "%s :  Half Rate data Feature Activity (HRATE-FA), %s",
3322         bigbuf,
3323         tdma_data_feat_ind_str[value & 0x03]);
3324
3325     EXTRANEOUS_DATA_CHECK(len, 2);
3326 }
3327
3328 static void
3329 param_faulty(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
3330 {
3331     gint32 value;
3332     guint saved_offset;
3333     gchar *str = NULL;
3334     gint idx;
3335
3336     add_string = add_string;
3337     saved_offset = asn1->offset;
3338     asn1_int32_value_decode(asn1, 1, &value);
3339
3340     str = my_match_strval((guint32) value, ansi_param_1_strings, &idx);
3341
3342     if (NULL == str)
3343     {
3344         if (len < 2)
3345         {
3346             proto_tree_add_text(tree, asn1->tvb,
3347                 saved_offset, len,
3348                 "Unrecognized parameter ID");
3349             return;
3350         }
3351
3352         asn1->offset = saved_offset;
3353         asn1_uint32_value_decode(asn1, 2, &value);
3354
3355         str = my_match_strval((guint32) value, ansi_param_2_strings, &idx);
3356
3357         if (NULL == str)
3358         {
3359             if (len < 3)
3360             {
3361                 proto_tree_add_text(tree, asn1->tvb,
3362                     saved_offset, len,
3363                     "Unrecognized parameter ID");
3364                 return;
3365             }
3366
3367             asn1->offset = saved_offset;
3368             asn1_int32_value_decode(asn1, 3, &value);
3369
3370             str = my_match_strval((guint32) value, ansi_param_3_strings, &idx);
3371
3372             if (NULL == str)
3373             {
3374                 if (((value >= 0x9FFF00) && (value <= 0x9FFF7F)) ||
3375                     ((value >= 0xBFFF00) && (value <= 0xBFFF7F)))
3376                 {
3377                     str = "Reserved for protocol extension";
3378                 }
3379                 else if (((value >= 0x9FFE76) && (value <= 0x9FFE7F)) ||
3380                     ((value >= 0xBFFE76) && (value <= 0xBFFE7F)))
3381                 {
3382                     str = "Reserved for National Network Use";
3383                 }
3384                 else
3385                 {
3386                     str = "Unrecognized parameter ID";
3387                 }
3388             }
3389         }
3390     }
3391
3392     proto_tree_add_text(tree, asn1->tvb,
3393         saved_offset, asn1->offset - saved_offset,
3394         str);
3395
3396     EXTRANEOUS_DATA_CHECK(len, asn1->offset - saved_offset);
3397 }
3398
3399 static void
3400 param_sys_type_code(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
3401 {
3402     gint32 sys_type_code;
3403     guint saved_offset;
3404     gchar *str = NULL;
3405
3406     EXACT_DATA_CHECK(len, 1);
3407
3408     add_string = add_string;
3409     saved_offset = asn1->offset;
3410
3411     asn1_int32_value_decode(asn1, 1, &sys_type_code);
3412
3413     switch (sys_type_code)
3414     {
3415     case 0: str = "Not used"; break;
3416     case 1: str = "EDS"; break;
3417     case 2: str = "Astronet"; break;
3418     case 3: str = "Lucent Technologies"; break;
3419     case 4: str = "Ericsson"; break;
3420     case 5: str = "GTE"; break;
3421     case 6: str = "Motorola"; break;
3422     case 7: str = "NEC"; break;
3423     case 8: str = "NORTEL"; break;
3424     case 9: str = "NovAtel"; break;
3425     case 10: str = "Plexsys"; break;
3426     case 11: str = "Digital Equipment Corp"; break;
3427     case 12: str = "INET"; break;
3428     case 13: str = "Bellcore"; break;
3429     case 14: str = "Alcatel SEL"; break;
3430     case 15: str = "Compaq (Tandem)"; break;
3431     case 16: str = "QUALCOMM"; break;
3432     case 17: str = "Aldiscon"; break;
3433     case 18: str = "Celcore"; break;
3434     case 19: str = "TELOS"; break;
3435     case 20: str = "ADI Limited (Stanilite)"; break;
3436     case 21: str = "Coral Systems"; break;
3437     case 22: str = "Synacom Technology"; break;
3438     case 23: str = "DSC"; break;
3439     case 24: str = "MCI"; break;
3440     case 25: str = "NewNet"; break;
3441     case 26: str = "Sema Group Telecoms"; break;
3442     case 27: str = "LG Information and Communications"; break;
3443     case 28: str = "CBIS"; break;
3444     case 29: str = "Siemens"; break;
3445     case 30: str = "Samsung Electronics"; break;
3446     case 31: str = "ReadyCom Inc."; break;
3447     case 32: str = "AG Communication Systems"; break;
3448     case 33: str = "Hughes Network Systems"; break;
3449     case 34: str = "Phoenix Wireless Group"; break;
3450     default:
3451         str = "Reserved/Unknown";
3452         break;
3453     }
3454
3455     proto_tree_add_text(tree, asn1->tvb,
3456         saved_offset, asn1->offset - saved_offset,
3457         "Vendor ID (%u) %s",
3458         sys_type_code, str);
3459 }
3460
3461 static void
3462 param_ext_sys_type_code(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
3463 {
3464     gint32 type;
3465     guint saved_offset;
3466     gchar *str = NULL;
3467
3468     EXACT_DATA_CHECK(len, 2);
3469
3470     add_string = add_string;
3471     saved_offset = asn1->offset;
3472
3473     asn1_int32_value_decode(asn1, 1, &type);
3474
3475     switch (type)
3476     {
3477     case 0: str = "Not specified"; break;
3478     case 1: str = "Serving MSC"; break;
3479     case 2: str = "Home MSC"; break;
3480     case 3: str = "Gateway MSC"; break;
3481     case 4: str = "HLR"; break;
3482     case 5: str = "VLR"; break;
3483     case 6: str = "EIR (reserved)"; break;
3484     case 7: str = "AC"; break;
3485     case 8: str = "Border MSC"; break;
3486     case 9: str = "Originating MSC"; break;
3487     default:
3488         if ((type >= 10) && (type <= 223)) { str = "Reserved, treat as Not specified"; }
3489         else { str = "Reserved for protocol extension, treat as Not specified"; }
3490         break;
3491     }
3492
3493     proto_tree_add_text(tree, asn1->tvb,
3494         saved_offset, asn1->offset - saved_offset,
3495         "Type (%u) %s",
3496         type,
3497         str);
3498
3499     param_sys_type_code(asn1, tree, len-1, add_string);
3500 }
3501
3502 static void
3503 param_cdma_sea_win(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
3504 {
3505     gint32 value;
3506     guint saved_offset;
3507
3508     EXACT_DATA_CHECK(len, 1);
3509
3510     add_string = add_string;
3511     saved_offset = asn1->offset;
3512
3513     asn1_int32_value_decode(asn1, 1, &value);
3514
3515     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
3516     proto_tree_add_text(tree, asn1->tvb,
3517         saved_offset, asn1->offset - saved_offset,
3518         "%s :  Reserved",
3519         bigbuf);
3520
3521     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
3522     proto_tree_add_text(tree, asn1->tvb,
3523         saved_offset, asn1->offset - saved_offset,
3524         "%s :  Value %u",
3525         bigbuf,
3526         value & 0x0f);
3527 }
3528
3529 static void
3530 param_cdma_sea_param(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
3531 {
3532     gint32 value;
3533     guint saved_offset;
3534
3535     SHORT_DATA_CHECK(len, 4);
3536
3537     add_string = add_string;
3538     saved_offset = asn1->offset;
3539
3540     asn1_int32_value_decode(asn1, 1, &value);
3541
3542     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
3543     proto_tree_add_text(tree, asn1->tvb,
3544         saved_offset, asn1->offset - saved_offset,
3545         "%s :  Reserved",
3546         bigbuf);
3547
3548     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
3549     proto_tree_add_text(tree, asn1->tvb,
3550         saved_offset, asn1->offset - saved_offset,
3551         "%s :  CDMA Search Window, %u",
3552         bigbuf,
3553         value & 0x0f);
3554
3555     saved_offset = asn1->offset;
3556
3557     asn1_int32_value_decode(asn1, 1, &value);
3558
3559     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3560     proto_tree_add_text(tree, asn1->tvb,
3561         saved_offset, asn1->offset - saved_offset,
3562         "%s :  Reserved",
3563         bigbuf);
3564
3565     other_decode_bitfield_value(bigbuf, value, 0x3f, 8);
3566     proto_tree_add_text(tree, asn1->tvb,
3567         saved_offset, asn1->offset - saved_offset,
3568         "%s :  T_ADD, %u",
3569         bigbuf,
3570         value & 0x3f);
3571
3572     saved_offset = asn1->offset;
3573
3574     asn1_int32_value_decode(asn1, 1, &value);
3575
3576     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3577     proto_tree_add_text(tree, asn1->tvb,
3578         saved_offset, asn1->offset - saved_offset,
3579         "%s :  Reserved",
3580         bigbuf);
3581
3582     other_decode_bitfield_value(bigbuf, value, 0x3f, 8);
3583     proto_tree_add_text(tree, asn1->tvb,
3584         saved_offset, asn1->offset - saved_offset,
3585         "%s :  T_DROP, %u",
3586         bigbuf,
3587         value & 0x3f);
3588
3589     saved_offset = asn1->offset;
3590
3591     asn1_int32_value_decode(asn1, 1, &value);
3592
3593     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
3594     proto_tree_add_text(tree, asn1->tvb,
3595         saved_offset, asn1->offset - saved_offset,
3596         "%s :  T_TDROP, %u",
3597         bigbuf,
3598         value & 0xf0);
3599
3600     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
3601     proto_tree_add_text(tree, asn1->tvb,
3602         saved_offset, asn1->offset - saved_offset,
3603         "%s :  T_COMP, %u",
3604         bigbuf,
3605         value & 0x0f);
3606
3607     EXTRANEOUS_DATA_CHECK(len, 4);
3608 }
3609
3610 static void
3611 param_cdma_code_chan(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
3612 {
3613     gint32 value;
3614     guint saved_offset;
3615
3616     add_string = add_string;
3617     saved_offset = asn1->offset;
3618
3619     asn1_int32_value_decode(asn1, 1, &value);
3620
3621     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3622     proto_tree_add_text(tree, asn1->tvb,
3623         saved_offset, asn1->offset - saved_offset,
3624         "%s :  Reserved",
3625         bigbuf);
3626
3627     other_decode_bitfield_value(bigbuf, value, 0x3f, 8);
3628     proto_tree_add_text(tree, asn1->tvb,
3629         saved_offset, asn1->offset - saved_offset,
3630         "%s :  CDMA Code Channel %u",
3631         bigbuf,
3632         value & 0x3f);
3633
3634     EXTRANEOUS_DATA_CHECK(len, 1);
3635 }
3636
3637 static void
3638 param_chan_data(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
3639 {
3640     gint32 value;
3641     guint saved_offset;
3642     gchar *str = NULL;
3643
3644     SHORT_DATA_CHECK(len, 3);
3645
3646     add_string = add_string;
3647     saved_offset = asn1->offset;
3648
3649     asn1_int32_value_decode(asn1, 1, &value);
3650
3651     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3652     proto_tree_add_text(tree, asn1->tvb,
3653         saved_offset, asn1->offset - saved_offset,
3654         "%s :  SAT Color Code %u",
3655         bigbuf,
3656         (value & 0xc0 >> 6));
3657
3658     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
3659     proto_tree_add_text(tree, asn1->tvb,
3660         saved_offset, asn1->offset - saved_offset,
3661         "%s :  %s",
3662         (value & 0x20) ? "Reserved" : "Analog Band Class",
3663         bigbuf);
3664
3665     switch ((value & 0x18) >> 3)
3666     {
3667     case 0: str = "DTX disabled (not active/acceptable)"; break;
3668     case 1: str = "Reserved, treat as DTX disabled"; break;
3669     case 2: str = "DTX-low mode (i.e., 8 dB below DTX active/acceptable)"; break;
3670     case 3: str = "DTX mode active or acceptable"; break;
3671     }
3672
3673     other_decode_bitfield_value(bigbuf, value, 0x18, 8);
3674     proto_tree_add_text(tree, asn1->tvb,
3675         saved_offset, asn1->offset - saved_offset,
3676         "%s :  %s",
3677         bigbuf,
3678         str);
3679
3680     other_decode_bitfield_value(bigbuf, value, 0x07, 8);
3681     proto_tree_add_text(tree, asn1->tvb,
3682         saved_offset, asn1->offset - saved_offset,
3683         "%s :  Voice Mobile Attenuation Code (VMAC) %u",
3684         bigbuf,
3685         value & 0x07);
3686
3687     saved_offset = asn1->offset;
3688
3689     asn1_int32_value_decode(asn1, 2, &value);
3690
3691     proto_tree_add_text(tree, asn1->tvb,
3692         saved_offset, asn1->offset - saved_offset,
3693         "Channel Number %u",
3694         value);
3695
3696     EXTRANEOUS_DATA_CHECK(len, 3);
3697 }
3698
3699 static void
3700 param_cdma_plcm(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
3701 {
3702     gint32 value;
3703     guint saved_offset;
3704
3705     EXACT_DATA_CHECK(len, 6);
3706
3707     add_string = add_string;
3708     saved_offset = asn1->offset;
3709
3710     asn1_int32_value_decode(asn1, 1, &value);
3711
3712     other_decode_bitfield_value(bigbuf, value, 0xfc, 8);
3713     proto_tree_add_text(tree, asn1->tvb,
3714         saved_offset, asn1->offset - saved_offset,
3715         "%s :  Reserved",
3716         bigbuf);
3717
3718     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3719     proto_tree_add_text(tree, asn1->tvb,
3720         saved_offset, asn1->offset - saved_offset,
3721         "%s :  CDMA Private Long Code Mask (PLCM) (MSB)",
3722         bigbuf);
3723
3724     saved_offset = asn1->offset;
3725
3726     proto_tree_add_text(tree, asn1->tvb,
3727         saved_offset, len - 1,
3728         "CDMA Private Long Code Mask (PLCM)");
3729
3730     asn1->offset += (len - 1);
3731 }
3732
3733 static void
3734 param_ctrl_chan_data(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
3735 {
3736     gint32 value;
3737     guint saved_offset;
3738
3739     EXACT_DATA_CHECK(len, 4);
3740
3741     add_string = add_string;
3742     saved_offset = asn1->offset;
3743
3744     asn1_int32_value_decode(asn1, 1, &value);
3745
3746     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
3747     proto_tree_add_text(tree, asn1->tvb,
3748         saved_offset, asn1->offset - saved_offset,
3749         "%s :  Digital Color Code (DCC)",
3750         bigbuf);
3751
3752     other_decode_bitfield_value(bigbuf, value, 0x38, 8);
3753     proto_tree_add_text(tree, asn1->tvb,
3754         saved_offset, asn1->offset - saved_offset,
3755         "%s :  Reserved",
3756         bigbuf);
3757
3758     other_decode_bitfield_value(bigbuf, value, 0x07, 8);
3759     proto_tree_add_text(tree, asn1->tvb,
3760         saved_offset, asn1->offset - saved_offset,
3761         "%s :  Control Mobile Attenuation Code (CMAC)",
3762         bigbuf);
3763
3764     saved_offset = asn1->offset;
3765
3766     asn1_int32_value_decode(asn1, 2, &value);
3767
3768     proto_tree_add_text(tree, asn1->tvb,
3769         saved_offset, asn1->offset - saved_offset,
3770         "Channel Number (CHNO), %u",
3771         value);
3772
3773     saved_offset = asn1->offset;
3774
3775     asn1_int32_value_decode(asn1, 1, &value);
3776
3777     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
3778     proto_tree_add_text(tree, asn1->tvb,
3779         saved_offset, asn1->offset - saved_offset,
3780         "%s :  Reserved",
3781         bigbuf);
3782
3783     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
3784     proto_tree_add_text(tree, asn1->tvb,
3785         saved_offset, asn1->offset - saved_offset,
3786         "%s :  Supplementary Digital Color Codes (SDCC1)",
3787         bigbuf);
3788
3789     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3790     proto_tree_add_text(tree, asn1->tvb,
3791         saved_offset, asn1->offset - saved_offset,
3792         "%s :  Supplementary Digital Color Codes (SDCC2)",
3793         bigbuf);
3794 }
3795
3796 static void
3797 param_cdma_chan_data(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
3798 {
3799     gint32 value, temp_int;
3800     guint saved_offset;
3801     gchar *str = NULL;
3802
3803     SHORT_DATA_CHECK(len, 8);
3804
3805     add_string = add_string;
3806     saved_offset = asn1->offset;
3807
3808     asn1_int32_value_decode(asn1, 2, &value);
3809
3810     other_decode_bitfield_value(bigbuf, value >> 8, 0x80, 8);
3811     proto_tree_add_text(tree, asn1->tvb,
3812         saved_offset, 1,
3813         "%s :  Reserved",
3814         bigbuf);
3815
3816     other_decode_bitfield_value(bigbuf, value >> 8, 0x78, 8);
3817     proto_tree_add_text(tree, asn1->tvb,
3818         saved_offset, 1,
3819         "%s :  Frame Offset (%u), %.2f ms",
3820         bigbuf,
3821         (value & 0x7800) >> 11,
3822         ((value & 0x7800) >> 11) * 1.25);
3823
3824     other_decode_bitfield_value(bigbuf, value >> 8, 0x07, 8);
3825     proto_tree_add_text(tree, asn1->tvb,
3826         saved_offset, 1,
3827         "%s :  CDMA Channel Number (MSB), %u",
3828         bigbuf,
3829         value & 0x07ff);
3830
3831     other_decode_bitfield_value(bigbuf, value & 0x00ff, 0xff, 8);
3832     proto_tree_add_text(tree, asn1->tvb,
3833         saved_offset+1, 1,
3834         "%s :  CDMA Channel Number (LSB)",
3835         bigbuf);
3836
3837     saved_offset = asn1->offset;
3838
3839     asn1_int32_value_decode(asn1, 1, &value);
3840
3841     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
3842     proto_tree_add_text(tree, asn1->tvb,
3843         saved_offset, asn1->offset - saved_offset,
3844         "%s :  Reserved",
3845         bigbuf);
3846
3847     temp_int = (value & 0x7c) >> 2;
3848     if ((temp_int < 0) || (temp_int >= (gint) NUM_BAND_CLASS_STR))
3849     {
3850         str = "Reserved";
3851     }
3852     else
3853     {
3854         str = band_class_str[temp_int];
3855     }
3856
3857     other_decode_bitfield_value(bigbuf, value, 0x7c, 8);
3858     proto_tree_add_text(tree, asn1->tvb,
3859         saved_offset, asn1->offset - saved_offset,
3860         "%s :  Band Class, %s",
3861         bigbuf,
3862         str);
3863
3864     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3865     proto_tree_add_text(tree, asn1->tvb,
3866         saved_offset, asn1->offset - saved_offset,
3867         "%s :  Long Code Mask (MSB)",
3868         bigbuf);
3869
3870     asn1_int32_value_decode(asn1, 1, &value);
3871
3872     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
3873     proto_tree_add_text(tree, asn1->tvb,
3874         saved_offset + 1, 1,
3875         "%s :  Long Code Mask",
3876         bigbuf);
3877
3878     asn1_int32_value_decode(asn1, 1, &value);
3879
3880     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
3881     proto_tree_add_text(tree, asn1->tvb,
3882         saved_offset + 2, 1,
3883         "%s :  Long Code Mask",
3884         bigbuf);
3885
3886     asn1_int32_value_decode(asn1, 1, &value);
3887
3888     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
3889     proto_tree_add_text(tree, asn1->tvb,
3890         saved_offset + 3, 1,
3891         "%s :  Long Code Mask",
3892         bigbuf);
3893
3894     asn1_int32_value_decode(asn1, 1, &value);
3895
3896     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
3897     proto_tree_add_text(tree, asn1->tvb,
3898         saved_offset + 4, 1,
3899         "%s :  Long Code Mask",
3900         bigbuf);
3901
3902     asn1_int32_value_decode(asn1, 1, &value);
3903
3904     other_decode_bitfield_value(bigbuf, value, 0xff, 8);
3905     proto_tree_add_text(tree, asn1->tvb,
3906         saved_offset + 5, 1,
3907         "%s :  Long Code Mask (LSB)",
3908         bigbuf);
3909
3910     if (len == 8) return;
3911
3912     saved_offset = asn1->offset;
3913
3914     asn1_int32_value_decode(asn1, 1, &value);
3915
3916     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
3917     proto_tree_add_text(tree, asn1->tvb,
3918         saved_offset, asn1->offset - saved_offset,
3919         "%s :  NP Extension",
3920         bigbuf);
3921
3922     other_decode_bitfield_value(bigbuf, value, 0x78, 8);
3923     proto_tree_add_text(tree, asn1->tvb,
3924         saved_offset, asn1->offset - saved_offset,
3925         "%s :  Nominal Power, %u",
3926         bigbuf,
3927         (value & 0x78) >> 3);
3928
3929     other_decode_bitfield_value(bigbuf, value, 0x07, 8);
3930     proto_tree_add_text(tree, asn1->tvb,
3931         saved_offset, asn1->offset - saved_offset,
3932         "%s :  Number Preamble, %u",
3933         bigbuf,
3934         value & 0x07);
3935
3936     if (len == 9) return;
3937
3938     saved_offset = asn1->offset;
3939
3940     asn1_int32_value_decode(asn1, 1, &value);
3941
3942     proto_tree_add_text(tree, asn1->tvb,
3943         saved_offset, asn1->offset - saved_offset,
3944         "Base Station Protocol Revision, %u",
3945         value);
3946
3947     EXTRANEOUS_DATA_CHECK(len, 10);
3948 }
3949
3950 static void
3951 param_namps_chan_data(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
3952 {
3953     gint32 value;
3954     guint saved_offset;
3955     gchar *str = NULL;
3956
3957     add_string = add_string;
3958     saved_offset = asn1->offset;
3959
3960     asn1_int32_value_decode(asn1, 1, &value);
3961
3962     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
3963     proto_tree_add_text(tree, asn1->tvb,
3964         saved_offset, asn1->offset - saved_offset,
3965         "%s :  Reserved",
3966         bigbuf);
3967
3968     switch ((value & 0x1c) >> 2)
3969     {
3970     case 0: str = "Channel Data parameter SCC field applies"; break;
3971     case 1: str = "Digital SAT Color Code 1 (ignore SCC field)"; break;
3972     case 2: str = "Digital SAT Color Code 2 (ignore SCC field)"; break;
3973     case 3: str = "Digital SAT Color Code 3 (ignore SCC field)"; break;
3974     case 4: str = "Digital SAT Color Code 4 (ignore SCC field)"; break;
3975     case 5: str = "Digital SAT Color Code 5 (ignore SCC field)"; break;
3976     case 6: str = "Digital SAT Color Code 6 (ignore SCC field)"; break;
3977     case 7: str = "Digital SAT Color Code 7 (ignore SCC field)"; break;
3978     }
3979
3980     other_decode_bitfield_value(bigbuf, value, 0x1c, 8);
3981     proto_tree_add_text(tree, asn1->tvb,
3982         saved_offset, asn1->offset - saved_offset,
3983         "%s :  Color Code Indicator (CCIndicator), %s",
3984         bigbuf,
3985         str);
3986
3987     switch (value & 0x03)
3988     {
3989     case 0: str = "Wide. 30 kHz AMPS voice channel"; break;
3990     case 1: str = "Upper. 10 kHz NAMPS voice channel"; break;
3991     case 2: str = "Middle. 10 kHz NAMPS voice channel"; break;
3992     case 3: str = "Lower. 10 kHz NAMPS voice channel"; break;
3993     }
3994
3995     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
3996     proto_tree_add_text(tree, asn1->tvb,
3997         saved_offset, asn1->offset - saved_offset,
3998         "%s :  Narrow Analog Voice Channel Assignment (NAVCA), %s",
3999         bigbuf,
4000         str);
4001
4002     EXTRANEOUS_DATA_CHECK(len, 1);
4003 }
4004
4005 static void
4006 param_cdma_ms_meas_chan_id(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4007 {
4008     gint32 value, temp_int;
4009     guint saved_offset;
4010     gchar *str = NULL;
4011
4012     SHORT_DATA_CHECK(len, 2);
4013
4014     add_string = add_string;
4015     saved_offset = asn1->offset;
4016
4017     asn1_int32_value_decode(asn1, 2, &value);
4018
4019     temp_int = (value & 0xf800) >> 11;
4020     if ((temp_int < 0) || (temp_int >= (gint) NUM_BAND_CLASS_STR))
4021     {
4022         str = "Reserved";
4023     }
4024     else
4025     {
4026         str = band_class_str[temp_int];
4027     }
4028
4029     other_decode_bitfield_value(bigbuf, value >> 8, 0xf8, 8);
4030     proto_tree_add_text(tree, asn1->tvb,
4031         saved_offset, 1,
4032         "%s :  Band Class, %s",
4033         bigbuf,
4034         str);
4035
4036     other_decode_bitfield_value(bigbuf, value >> 8, 0x07, 8);
4037     proto_tree_add_text(tree, asn1->tvb,
4038         saved_offset, 1,
4039         "%s :  CDMA Channel Number (MSB), %u",
4040         bigbuf,
4041         value & 0x07ff);
4042
4043     other_decode_bitfield_value(bigbuf, value & 0x00ff, 0xff, 8);
4044     proto_tree_add_text(tree, asn1->tvb,
4045         saved_offset+1, 1,
4046         "%s :  CDMA Channel Number (LSB)",
4047         bigbuf);
4048
4049     EXTRANEOUS_DATA_CHECK(len, 2);
4050 }
4051
4052 static void
4053 param_tdma_chan_data(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4054 {
4055     gint32 value;
4056     guint saved_offset;
4057     gchar *str = NULL;
4058
4059     SHORT_DATA_CHECK(len, 5);
4060
4061     add_string = add_string;
4062     saved_offset = asn1->offset;
4063
4064     asn1_int32_value_decode(asn1, 1, &value);
4065
4066     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
4067     proto_tree_add_text(tree, asn1->tvb,
4068         saved_offset, asn1->offset - saved_offset,
4069         "%s :  Reserved",
4070         bigbuf);
4071
4072     switch (value & 0x1f)
4073     {
4074     case 0: str = "Analog (not used if ChannelData is present)"; break;
4075     case 1: str = "Assigned to timeslot 1, full rate"; break;
4076     case 2: str = "Assigned to timeslot 2, full rate"; break;
4077     case 3: str = "Assigned to timeslot 3, full rate"; break;
4078     case 4: str = "Assigned to timeslots 1, 4 and 2, 5 Double rate"; break;
4079     case 5: str = "Assigned to timeslots 1, 4 and 3, 6 Double rate"; break;
4080     case 6: str = "Assigned to timeslots 2, 5 and 3, 6 Double rate"; break;
4081     case 9: str = "Assigned to timeslot 1, half rate"; break;
4082     case 10: str = "Assigned to timeslot 2, half rate"; break;
4083     case 11: str = "Assigned to timeslot 3, half rate"; break;
4084     case 12: str = "Assigned to timeslot 4, half rate"; break;
4085     case 13: str = "Assigned to timeslot 5, half rate"; break;
4086     case 14: str = "Assigned to timeslot 6, half rate"; break;
4087     case 15: str = "Assigned to timeslot 1, 2, 3, 4, 5, 6 Triple rate"; break;
4088     default:
4089         str = "Reserved, treat as Analog";
4090         break;
4091     }
4092
4093     other_decode_bitfield_value(bigbuf, value, 0x1f, 8);
4094     proto_tree_add_text(tree, asn1->tvb,
4095         saved_offset, asn1->offset - saved_offset,
4096         "%s :  Time Slot and Rate indicator (TSR), %s",
4097         bigbuf,
4098         str);
4099
4100     saved_offset = asn1->offset;
4101
4102     asn1_int32_value_decode(asn1, 1, &value);
4103
4104     proto_tree_add_text(tree, asn1->tvb,
4105         saved_offset, asn1->offset - saved_offset,
4106         "Digital Verification Color Code (DVCC) %u",
4107         value);
4108
4109     saved_offset = asn1->offset;
4110
4111     asn1_int32_value_decode(asn1, 1, &value);
4112
4113     switch ((value & 0xf0) >> 4)
4114     {
4115     case 0: str = "800 MHz"; break;
4116     case 1: str = "1800 MHz"; break;
4117     default:
4118         str = "Reserved, treat as 800 MHz";
4119         break;
4120     }
4121
4122     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
4123     proto_tree_add_text(tree, asn1->tvb,
4124         saved_offset, asn1->offset - saved_offset,
4125         "%s :  Hyper Band, %s",
4126         bigbuf,
4127         str);
4128
4129     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
4130     proto_tree_add_text(tree, asn1->tvb,
4131         saved_offset, asn1->offset - saved_offset,
4132         "%s :  Digital Mobile Attenuation Code (DMAC) %u",
4133         bigbuf,
4134         value & 0x0f);
4135
4136     saved_offset = asn1->offset;
4137
4138     asn1_int32_value_decode(asn1, 2, &value);
4139
4140     other_decode_bitfield_value(bigbuf, value >> 8, 0xff, 8);
4141     proto_tree_add_text(tree, asn1->tvb,
4142         saved_offset, 1,
4143         "%s :  Channel Number (MSB), %u",
4144         bigbuf,
4145         value);
4146
4147     other_decode_bitfield_value(bigbuf, value & 0x00ff, 0xff, 8);
4148     proto_tree_add_text(tree, asn1->tvb,
4149         saved_offset + 1, 1,
4150         "%s :  Channel Number (LSB)",
4151         bigbuf);
4152
4153     EXTRANEOUS_DATA_CHECK(len, 5);
4154 }
4155
4156 static void
4157 param_tdma_call_mode(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4158 {
4159     gint32 value;
4160     guint saved_offset;
4161
4162     add_string = add_string;
4163     saved_offset = asn1->offset;
4164
4165     asn1_int32_value_decode(asn1, 1, &value);
4166
4167     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
4168     proto_tree_add_text(tree, asn1->tvb,
4169         saved_offset, asn1->offset - saved_offset,
4170         "%s :  Reserved",
4171         bigbuf);
4172
4173     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
4174     proto_tree_add_text(tree, asn1->tvb,
4175         saved_offset, asn1->offset - saved_offset,
4176         "%s :  %sxtended modulation and framing",
4177         bigbuf,
4178         (value & 0x20) ? "E" : "No e");
4179
4180     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
4181     proto_tree_add_text(tree, asn1->tvb,
4182         saved_offset, asn1->offset - saved_offset,
4183         "%s :  Other voice coding %sacceptable",
4184         bigbuf,
4185         (value & 0x10) ? "" : "not ");
4186
4187     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
4188     proto_tree_add_text(tree, asn1->tvb,
4189         saved_offset, asn1->offset - saved_offset,
4190         "%s :  Other DQPSK channel %sacceptable",
4191         bigbuf,
4192         (value & 0x08) ? "" : "not ");
4193
4194     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
4195     proto_tree_add_text(tree, asn1->tvb,
4196         saved_offset, asn1->offset - saved_offset,
4197         "%s :  Half rate digital traffic channel %sacceptable",
4198         bigbuf,
4199         (value & 0x04) ? "" : "not ");
4200
4201     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
4202     proto_tree_add_text(tree, asn1->tvb,
4203         saved_offset, asn1->offset - saved_offset,
4204         "%s :  Full rate digital traffic channel %sacceptable",
4205         bigbuf,
4206         (value & 0x02) ? "" : "not ");
4207
4208     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
4209     proto_tree_add_text(tree, asn1->tvb,
4210         saved_offset, asn1->offset - saved_offset,
4211         "%s :  AMPS channel %sacceptable",
4212         bigbuf,
4213         (value & 0x01) ? "" : "not ");
4214
4215     EXTRANEOUS_DATA_CHECK(len, 1);
4216 }
4217
4218 static void
4219 param_cdma_call_mode(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4220 {
4221     gint32 value;
4222     guint saved_offset;
4223
4224     add_string = add_string;
4225     saved_offset = asn1->offset;
4226
4227     asn1_int32_value_decode(asn1, 1, &value);
4228
4229     if (len == 1)
4230     {
4231         /* assuming older spec. no IS-880 */
4232
4233         other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
4234         proto_tree_add_text(tree, asn1->tvb,
4235             saved_offset, asn1->offset - saved_offset,
4236             "%s :  Reserved",
4237             bigbuf);
4238     }
4239     else
4240     {
4241         other_decode_bitfield_value(bigbuf, value, 0x80, 8);
4242         proto_tree_add_text(tree, asn1->tvb,
4243             saved_offset, asn1->offset - saved_offset,
4244             "%s :  450 MHz channel (Band Class 5) %sacceptable",
4245             bigbuf,
4246             (value & 0x80) ? "" : "not ");
4247
4248         other_decode_bitfield_value(bigbuf, value, 0x40, 8);
4249         proto_tree_add_text(tree, asn1->tvb,
4250             saved_offset, asn1->offset - saved_offset,
4251             "%s :  Korean PCS channel (Band Class 4) %sacceptable",
4252             bigbuf,
4253             (value & 0x40) ? "" : "not ");
4254
4255         other_decode_bitfield_value(bigbuf, value, 0x20, 8);
4256         proto_tree_add_text(tree, asn1->tvb,
4257             saved_offset, asn1->offset - saved_offset,
4258             "%s :  JTACS channel (Band Class 3) %sacceptable",
4259             bigbuf,
4260             (value & 0x20) ? "" : "not ");
4261
4262         other_decode_bitfield_value(bigbuf, value, 0x10, 8);
4263         proto_tree_add_text(tree, asn1->tvb,
4264             saved_offset, asn1->offset - saved_offset,
4265             "%s :  TACS channel (Band Class 2) %sacceptable",
4266             bigbuf,
4267             (value & 0x10) ? "" : "not ");
4268     }
4269
4270     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
4271     proto_tree_add_text(tree, asn1->tvb,
4272         saved_offset, asn1->offset - saved_offset,
4273         "%s :  CDMA 1900 MHz channel (Band Class 1) %sacceptable",
4274         bigbuf,
4275         (value & 0x08) ? "" : "not ");
4276
4277     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
4278     proto_tree_add_text(tree, asn1->tvb,
4279         saved_offset, asn1->offset - saved_offset,
4280         "%s :  NAMPS 800 MHz channel %sacceptable",
4281         bigbuf,
4282         (value & 0x04) ? "" : "not ");
4283
4284     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
4285     proto_tree_add_text(tree, asn1->tvb,
4286         saved_offset, asn1->offset - saved_offset,
4287         "%s :  AMPS 800 MHz channel %sacceptable",
4288         bigbuf,
4289         (value & 0x02) ? "" : "not ");
4290
4291     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
4292     proto_tree_add_text(tree, asn1->tvb,
4293         saved_offset, asn1->offset - saved_offset,
4294         "%s :  CDMA 800 MHz channel (Band Class 0) %sacceptable",
4295         bigbuf,
4296         (value & 0x01) ? "" : "not ");
4297
4298     if (len == 1) return;
4299
4300     saved_offset = asn1->offset;
4301
4302     asn1_int32_value_decode(asn1, 1, &value);
4303
4304     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
4305     proto_tree_add_text(tree, asn1->tvb,
4306         saved_offset, asn1->offset - saved_offset,
4307         "%s :  Reserved",
4308         bigbuf);
4309
4310     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
4311     proto_tree_add_text(tree, asn1->tvb,
4312         saved_offset, asn1->offset - saved_offset,
4313         "%s :  Secondary 800 MHz channel (Band Class 10) %sacceptable",
4314         bigbuf,
4315         (value & 0x10) ? "" : "not ");
4316
4317     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
4318     proto_tree_add_text(tree, asn1->tvb,
4319         saved_offset, asn1->offset - saved_offset,
4320         "%s :  900 MHz channel (Band Class 9) %sacceptable",
4321         bigbuf,
4322         (value & 0x08) ? "" : "not ");
4323
4324     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
4325     proto_tree_add_text(tree, asn1->tvb,
4326         saved_offset, asn1->offset - saved_offset,
4327         "%s :  1800 MHz channel (Band Class 8) %sacceptable",
4328         bigbuf,
4329         (value & 0x04) ? "" : "not ");
4330
4331     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
4332     proto_tree_add_text(tree, asn1->tvb,
4333         saved_offset, asn1->offset - saved_offset,
4334         "%s :  700 MHz channel (Band Class 7) %sacceptable",
4335         bigbuf,
4336         (value & 0x02) ? "" : "not ");
4337
4338     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
4339     proto_tree_add_text(tree, asn1->tvb,
4340         saved_offset, asn1->offset - saved_offset,
4341         "%s :  2 GHz channel (Band Class 6) %sacceptable",
4342         bigbuf,
4343         (value & 0x01) ? "" : "not ");
4344
4345     EXTRANEOUS_DATA_CHECK(len, 2);
4346 }
4347
4348 static void
4349 param_namps_call_mode(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4350 {
4351     gint32 value;
4352     guint saved_offset;
4353
4354     add_string = add_string;
4355     saved_offset = asn1->offset;
4356
4357     asn1_int32_value_decode(asn1, 1, &value);
4358
4359     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
4360     proto_tree_add_text(tree, asn1->tvb,
4361         saved_offset, asn1->offset - saved_offset,
4362         "%s :  Reserved",
4363         bigbuf);
4364
4365     proto_tree_add_text(tree, asn1->tvb,
4366         saved_offset, asn1->offset - saved_offset,
4367         ".... %u... :  AMPS 1800 MHz channel %sacceptable",
4368         (value & 0x08) >> 3, (value & 0x08) ? "" : "not ");
4369
4370     proto_tree_add_text(tree, asn1->tvb,
4371         saved_offset, asn1->offset - saved_offset,
4372         ".... .%u.. :  NAMPS 1800 MHz channel %sacceptable",
4373         (value & 0x04) >> 2, (value & 0x04) ? "" : "not ");
4374
4375     proto_tree_add_text(tree, asn1->tvb,
4376         saved_offset, asn1->offset - saved_offset,
4377         ".... ..%u. :  AMPS 800 MHz channel %sacceptable",
4378         (value & 0x02) >> 1, (value & 0x02) ? "" : "not ");
4379
4380     proto_tree_add_text(tree, asn1->tvb,
4381         saved_offset, asn1->offset - saved_offset,
4382         ".... ...%u :  NAMPS 800 MHz channel %sacceptable",
4383         value & 0x01, (value & 0x01) ? "" : "not ");
4384
4385     EXTRANEOUS_DATA_CHECK(len, 1);
4386 }
4387
4388 static void
4389 param_mob_rev(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4390 {
4391     gint32 value;
4392     guint saved_offset;
4393
4394     add_string = add_string;
4395     saved_offset = asn1->offset;
4396
4397     asn1_int32_value_decode(asn1, 1, &value);
4398
4399     proto_tree_add_text(tree, asn1->tvb,
4400         saved_offset, asn1->offset - saved_offset,
4401         "Revision %u",
4402         value);
4403
4404     EXTRANEOUS_DATA_CHECK(len, 1);
4405 }
4406
4407 static void
4408 param_cdma_band_class(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4409 {
4410     gint32 value, temp_int;
4411     guint saved_offset;
4412     gchar *str = NULL;
4413
4414     add_string = add_string;
4415     saved_offset = asn1->offset;
4416
4417     asn1_int32_value_decode(asn1, 1, &value);
4418
4419     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
4420     proto_tree_add_text(tree, asn1->tvb,
4421         saved_offset, asn1->offset - saved_offset,
4422         "%s :  Reserved",
4423         bigbuf);
4424
4425     temp_int = value & 0x1f;
4426     if ((temp_int < 0) || (temp_int >= (gint) NUM_BAND_CLASS_STR))
4427     {
4428         str = "Reserved";
4429     }
4430     else
4431     {
4432         str = band_class_str[temp_int];
4433     }
4434
4435     other_decode_bitfield_value(bigbuf, value, 0x1f, 8);
4436     proto_tree_add_text(tree, asn1->tvb,
4437         saved_offset, asn1->offset - saved_offset,
4438         "%s :  Band Class %s",
4439         bigbuf,
4440         str);
4441
4442     EXTRANEOUS_DATA_CHECK(len, 1);
4443 }
4444
4445 static void
4446 param_calling_party_name(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4447 {
4448     gint32 value;
4449     guint saved_offset;
4450     gchar *str = NULL;
4451
4452     SHORT_DATA_CHECK(len, 1);
4453
4454     add_string = add_string;
4455     saved_offset = asn1->offset;
4456
4457     asn1_int32_value_decode(asn1, 1, &value);
4458
4459     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
4460     proto_tree_add_text(tree, asn1->tvb,
4461         saved_offset, asn1->offset - saved_offset,
4462         "%s :  Spec. has hardcoded as 0 0 1",
4463         bigbuf);
4464
4465     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
4466     proto_tree_add_text(tree, asn1->tvb,
4467         saved_offset, asn1->offset - saved_offset,
4468         "%s :  Availability, %s",
4469         bigbuf,
4470         (value & 0x10) ?  "Name not available" : "Name available/unknown");
4471
4472     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
4473     proto_tree_add_text(tree, asn1->tvb,
4474         saved_offset, asn1->offset - saved_offset,
4475         "%s :  Reserved",
4476         bigbuf);
4477
4478     switch (value & 0x03)
4479     {
4480     case 0: str = "Presentation allowed"; break;
4481     case 1: str = "Presentation restricted"; break;
4482     case 2: str = "Blocking toggle"; break;
4483     case 3: str = "No indication"; break;
4484     }
4485
4486     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
4487     proto_tree_add_text(tree, asn1->tvb,
4488         saved_offset, asn1->offset - saved_offset,
4489         "%s :  Presentation Status, %s",
4490         bigbuf,
4491         str);
4492
4493     if (len == 1) return;
4494
4495     saved_offset = asn1->offset;
4496
4497     proto_tree_add_text(tree, asn1->tvb,
4498         asn1->offset, len - 1,
4499         "IA5 Digits");
4500
4501     asn1->offset += (len - 1);
4502 }
4503
4504 static void
4505 param_red_party_name(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4506 {
4507     gint32 value;
4508     guint saved_offset;
4509     gchar *str = NULL;
4510
4511     SHORT_DATA_CHECK(len, 1);
4512
4513     add_string = add_string;
4514     saved_offset = asn1->offset;
4515
4516     asn1_int32_value_decode(asn1, 1, &value);
4517
4518     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
4519     proto_tree_add_text(tree, asn1->tvb,
4520         saved_offset, asn1->offset - saved_offset,
4521         "%s :  Spec. has hardcoded as 0 1 1",
4522         bigbuf);
4523
4524     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
4525     proto_tree_add_text(tree, asn1->tvb,
4526         saved_offset, asn1->offset - saved_offset,
4527         "%s :  Availability, %s",
4528         bigbuf,
4529         (value & 0x10) ?  "Name not available" : "Name available/unknown");
4530
4531     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
4532     proto_tree_add_text(tree, asn1->tvb,
4533         saved_offset, asn1->offset - saved_offset,
4534         "%s :  Reserved",
4535         bigbuf);
4536
4537     switch (value & 0x03)
4538     {
4539     case 0: str = "Presentation allowed"; break;
4540     case 1: str = "Presentation restricted"; break;
4541     case 2: str = "Blocking toggle"; break;
4542     case 3: str = "No indication"; break;
4543     }
4544
4545     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
4546     proto_tree_add_text(tree, asn1->tvb,
4547         saved_offset, asn1->offset - saved_offset,
4548         "%s :  Presentation Status, %s",
4549         bigbuf,
4550         str);
4551
4552     if (len == 1) return;
4553
4554     saved_offset = asn1->offset;
4555
4556     proto_tree_add_text(tree, asn1->tvb,
4557         asn1->offset, len - 1,
4558         "IA5 Digits");
4559
4560     asn1->offset += (len - 1);
4561 }
4562
4563 static void
4564 param_srvc_id(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4565 {
4566
4567     add_string = add_string;
4568
4569     proto_tree_add_text(tree, asn1->tvb,
4570         asn1->offset, len,
4571         "Service Identifier (Spec. does not define clearly)");
4572
4573     asn1->offset += len;
4574 }
4575
4576 static void
4577 param_all_or_none(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4578 {
4579     gint32 value;
4580     guint saved_offset;
4581     gchar *str = NULL;
4582
4583     EXACT_DATA_CHECK(len, 1);
4584
4585     add_string = add_string;
4586     saved_offset = asn1->offset;
4587
4588     asn1_int32_value_decode(asn1, 1, &value);
4589
4590     switch (value)
4591     {
4592     case 0: str = "Not used"; break;
4593     case 1: str = "All changes must succeed or none should be applied"; break;
4594     case 2: str = "Treat each change independently"; break;
4595     default:
4596         if ((value >= 3) && (value <= 223)) { str = "Reserved, treat as All changes must succeed or none should be applied"; }
4597         else { str = "Reserved for protocol extension, treat as All changes must succeed or none should be applied"; }
4598         break;
4599     }
4600
4601     proto_tree_add_text(tree, asn1->tvb,
4602         saved_offset, asn1->offset - saved_offset,
4603         str);
4604 }
4605
4606 static void
4607 param_change(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4608 {
4609     gint32 value;
4610     guint saved_offset;
4611     gchar *str = NULL;
4612
4613     EXACT_DATA_CHECK(len, 1);
4614
4615     add_string = add_string;
4616     saved_offset = asn1->offset;
4617
4618     asn1_int32_value_decode(asn1, 1, &value);
4619
4620     switch (value)
4621     {
4622     case 0: str = "Not used"; break;
4623     case 1: str = "Set Data Item to Default Value"; break;
4624     case 2: str = "Add Data Item"; break;
4625     case 3: str = "Delete Data Item"; break;
4626     case 4: str = "Replace Data Item with associated DataValue"; break;
4627     default:
4628         if ((value >= 5) && (value <= 223)) { str = "Reserved, treat as Set Data Item to Default Value"; }
4629         else { str = "Reserved for protocol extension, treat as Set Data Item to Default Value"; }
4630         break;
4631     }
4632
4633     proto_tree_add_text(tree, asn1->tvb,
4634         saved_offset, asn1->offset - saved_offset,
4635         str);
4636 }
4637
4638 static void
4639 param_data_result(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4640 {
4641     gint32 value;
4642     guint saved_offset;
4643     gchar *str = NULL;
4644
4645     EXACT_DATA_CHECK(len, 1);
4646
4647     add_string = add_string;
4648     saved_offset = asn1->offset;
4649
4650     asn1_int32_value_decode(asn1, 1, &value);
4651
4652     switch (value)
4653     {
4654     case 0: str = "Not used"; break;
4655     case 1: str = "Successful"; break;
4656     case 2: str = "Unsuccessful, unspecified"; break;
4657     case 3: str = "Unsuccessful, no default value available"; break;
4658     default:
4659         if ((value >= 4) && (value <= 95)) { str = "Reserved, treat as Unsuccessful"; }
4660         else if ((value >= 96) && (value <= 127)) { str = "Reserved for protocol extension, treat as Unsuccessful"; }
4661         else if ((value >= 128) && (value <= 223)) { str = "Reserved, treat as Successful"; }
4662         else { str = "Reserved for protocol extension, treat as Successful"; }
4663         break;
4664     }
4665
4666     proto_tree_add_text(tree, asn1->tvb,
4667         saved_offset, asn1->offset - saved_offset,
4668         str);
4669 }
4670
4671 static void
4672 param_fail_cause(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4673 {
4674     guint saved_offset;
4675
4676     SHORT_DATA_CHECK(len, 2);
4677
4678     add_string = add_string;
4679     saved_offset = asn1->offset;
4680
4681     proto_tree_add_text(tree, asn1->tvb,
4682         saved_offset, len,
4683         "ISUP Cause Indicator");
4684
4685     asn1->offset += len;
4686 }
4687
4688 static void
4689 param_fail_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4690 {
4691     gint32 value;
4692     guint saved_offset;
4693     gchar *str = NULL;
4694
4695     EXACT_DATA_CHECK(len, 1);
4696
4697     add_string = add_string;
4698     saved_offset = asn1->offset;
4699
4700     asn1_int32_value_decode(asn1, 1, &value);
4701
4702     switch (value)
4703     {
4704     case 0: str = "Not used"; break;
4705     case 1: str = "Call abandoned"; break;
4706     case 2: str = "Resource disconnect"; break;
4707     case 3: str = "Failure at MSC"; break;
4708     case 4: str = "SSFT expiration"; break;
4709     default:
4710         if ((value >= 5) && (value <= 223)) { str = "Reserved, ignore"; }
4711         else { str = "Reserved for protocol extension, ignore"; }
4712         break;
4713     }
4714
4715     proto_tree_add_text(tree, asn1->tvb,
4716         saved_offset, asn1->offset - saved_offset,
4717         str);
4718 }
4719
4720 static void
4721 param_resume_pic(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4722 {
4723     gint32 value;
4724     guint saved_offset;
4725     gchar *str = NULL;
4726
4727     EXACT_DATA_CHECK(len, 1);
4728
4729     add_string = add_string;
4730     saved_offset = asn1->offset;
4731
4732     asn1_int32_value_decode(asn1, 1, &value);
4733
4734     switch (value)
4735     {
4736     case 0: str = "Not used"; break;
4737     case 1: str = "Continue Call Processing"; break;
4738     case 2: str = "Collect Information PIC"; break;
4739     case 3: str = "Analyze Information PIC"; break;
4740     case 4: str = "Select Route PIC"; break;
4741     case 5: str = "Authorize Origination_Attempt PIC"; break;
4742     case 6: str = "Authorize Call Setup PIC"; break;
4743     case 7: str = "Send Call PIC"; break;
4744     case 8: str = "O Alerting PIC"; break;
4745     case 9: str = "O Active PIC"; break;
4746     case 10: str = "O Suspended PIC"; break;
4747     case 11: str = "O Null PIC"; break;
4748     case 32: str = "Select Facility PIC"; break;
4749     case 33: str = "Present Call PIC"; break;
4750     case 34: str = "Authorize Termination Attempt PIC"; break;
4751     case 35: str = "T Alerting PIC"; break;
4752     case 36: str = "T Active PIC"; break;
4753     case 37: str = "T Suspended PIC"; break;
4754     case 38: str = "T Null PIC"; break;
4755     default:
4756         if ((value >= 12) && (value <= 31)) { str = "Reserved, treat as Not used"; }
4757         else if ((value >= 39) && (value <= 223)) { str = "Reserved, ignore"; }
4758         else { str = "Reserved for protocol extension, ignore"; }
4759         break;
4760     }
4761
4762     proto_tree_add_text(tree, asn1->tvb,
4763         saved_offset, asn1->offset - saved_offset,
4764         "Point in Call, %s (%u)",
4765         str,
4766         value);
4767 }
4768
4769 static void
4770 param_special_rsc(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4771 {
4772     gint32 value, i;
4773     guint saved_offset;
4774     gchar *str = NULL;
4775
4776     add_string = add_string;
4777     saved_offset = asn1->offset;
4778
4779     i = 0;
4780
4781     do
4782     {
4783         asn1_int32_value_decode(asn1, 1, &value);
4784
4785         switch (value)
4786         {
4787         case 0: str = "Not used"; break;
4788         case 1: str = "DTMF tone detector"; break;
4789         case 2: str = "Automatic Speech Recognition - Speaker Independent - Digits"; break;
4790         case 3: str = "Automatic Speech Recognition - Speaker Independent - Speech User Interface Version 1"; break;
4791         default:
4792             if ((value >= 4) && (value <= 223)) { str = "Reserved, treat as Not used"; }
4793             else { str = "Reserved for protocol extension, treat as Not used"; }
4794             break;
4795         }
4796
4797         proto_tree_add_text(tree, asn1->tvb,
4798             saved_offset, asn1->offset - saved_offset,
4799             "[%u] Resource Type, %s",
4800             i++,
4801             str);
4802
4803         saved_offset = asn1->offset;
4804     }
4805     while ((len - i) > 0);
4806 }
4807
4808 static void
4809 param_time_date_offset(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4810 {
4811     gint32 value;
4812     guint saved_offset;
4813
4814     EXACT_DATA_CHECK(len, 2);
4815
4816     add_string = add_string;
4817     saved_offset = asn1->offset;
4818
4819     asn1_int32_value_decode(asn1, 2, &value);
4820
4821     proto_tree_add_text(tree, asn1->tvb,
4822         saved_offset, asn1->offset - saved_offset,
4823         "In minutes (%u)",
4824         value);
4825 }
4826
4827 static void
4828 param_network_tmsi(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4829 {
4830     gint32 value, addr_type, first_dig;
4831     guint saved_offset;
4832     gchar *str = NULL;
4833     guchar *poctets;
4834
4835     SHORT_DATA_CHECK(len, 4);
4836
4837     add_string = add_string;
4838     saved_offset = asn1->offset;
4839
4840     asn1_int32_value_decode(asn1, 4, &value);
4841
4842     proto_tree_add_text(tree, asn1->tvb,
4843         saved_offset, asn1->offset - saved_offset,
4844         "TMSI Code, %u",
4845         value);
4846
4847     if (len == 4) return;
4848
4849     saved_offset = asn1->offset;
4850
4851     asn1_int32_value_decode(asn1, 1, &value);
4852
4853     first_dig = Dgt_tbcd.out[(value & 0xf0) >> 4];
4854
4855     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
4856     proto_tree_add_text(tree, asn1->tvb,
4857         saved_offset, asn1->offset - saved_offset,
4858         "%s :  First digit of TMSI Zone, %c",
4859         bigbuf,
4860         first_dig);
4861
4862     addr_type = value & 0x0f;
4863     switch (addr_type)
4864     {
4865     case 0: str = "Not used"; break;
4866     case 1: str = "E.212 based routing"; break;
4867     case 2: str = "20-bit TDMA TMSI"; break;
4868     case 3: str = "24-bit TDMA TMSI"; break;
4869     default:
4870         str = "Reserved for protocol extension, treat as Not used";
4871         break;
4872     }
4873
4874     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
4875     proto_tree_add_text(tree, asn1->tvb,
4876         saved_offset, asn1->offset - saved_offset,
4877         "%s :  Type of addressing, %s",
4878         bigbuf,
4879         str);
4880
4881     if (len == 5) return;
4882
4883     saved_offset = asn1->offset;
4884
4885     asn1_string_value_decode(asn1, (len-5), &poctets);
4886
4887     bigbuf[0] = first_dig;
4888
4889     my_dgt_tbcd_unpack(bigbuf+1, poctets, (len-5), &Dgt_tbcd);
4890     g_free(poctets);
4891
4892     proto_tree_add_text(tree, asn1->tvb,
4893         saved_offset - 1, (len-5)+1,
4894         "TMSI Zone, %s",
4895         bigbuf);
4896 }
4897
4898 static void
4899 param_reqd_param_mask(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4900 {
4901     gint32 value;
4902     guint saved_offset;
4903
4904     add_string = add_string;
4905     saved_offset = asn1->offset;
4906
4907     asn1_int32_value_decode(asn1, 1, &value);
4908
4909     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
4910     proto_tree_add_text(tree, asn1->tvb,
4911         saved_offset, asn1->offset - saved_offset,
4912         "%s :  Reserved",
4913         bigbuf);
4914
4915     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
4916     proto_tree_add_text(tree, asn1->tvb,
4917         saved_offset, asn1->offset - saved_offset,
4918         "%s :  Location Area ID (LOCID) %srequired",
4919         bigbuf,
4920         (value & 0x10) ? "" : "not ");
4921
4922     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
4923     proto_tree_add_text(tree, asn1->tvb,
4924         saved_offset, asn1->offset - saved_offset,
4925         "%s :  TMSI %srequired",
4926         bigbuf,
4927         (value & 0x08) ? "" : "not ");
4928
4929     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
4930     proto_tree_add_text(tree, asn1->tvb,
4931         saved_offset, asn1->offset - saved_offset,
4932         "%s :  ESN %srequired",
4933         bigbuf,
4934         (value & 0x04) ? "" : "not ");
4935
4936     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
4937     proto_tree_add_text(tree, asn1->tvb,
4938         saved_offset, asn1->offset - saved_offset,
4939         "%s :  MIN %srequired",
4940         bigbuf,
4941         (value & 0x02) ? "" : "not ");
4942
4943     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
4944     proto_tree_add_text(tree, asn1->tvb,
4945         saved_offset, asn1->offset - saved_offset,
4946         "%s :  IMSI %srequired",
4947         bigbuf,
4948         (value & 0x01) ? "" : "not ");
4949
4950     EXTRANEOUS_DATA_CHECK(len, 1);
4951 }
4952
4953 static void
4954 param_srvc_red_cause(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4955 {
4956     gint32 value;
4957     guint saved_offset;
4958     gchar *str = NULL;
4959
4960     add_string = add_string;
4961     saved_offset = asn1->offset;
4962
4963     asn1_int32_value_decode(asn1, 1, &value);
4964
4965     switch (value)
4966     {
4967     case 0: str = "Not used"; break;
4968     case 1: str = "Normal Registration"; break;
4969     case 2: str = "System Not Found"; break;
4970     case 3: str = "Protocol Mismatch"; break;
4971     case 4: str = "Registration Rejection"; break;
4972     case 5: str = "Wrong SID"; break;
4973     case 6: str = "Wrong NID"; break;
4974     default:
4975         if ((value >= 7) && (value <= 223)) { str = "Reserved, treat as Normal Registration"; }
4976         else { str = "Reserved for protocol extension. If unknown, treat as Normal Registration"; }
4977         break;
4978     }
4979
4980     proto_tree_add_text(tree, asn1->tvb,
4981         saved_offset, asn1->offset - saved_offset,
4982         str);
4983
4984     EXTRANEOUS_DATA_CHECK(len, 1);
4985 }
4986
4987 static void
4988 param_srvc_red_info(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
4989 {
4990     gint32 value;
4991     guint saved_offset;
4992
4993     add_string = add_string;
4994     saved_offset = asn1->offset;
4995
4996     asn1_int32_value_decode(asn1, 1, &value);
4997
4998     other_decode_bitfield_value(bigbuf, value, 0xfc, 8);
4999     proto_tree_add_text(tree, asn1->tvb,
5000         saved_offset, asn1->offset - saved_offset,
5001         "%s :  Reserved",
5002         bigbuf);
5003
5004     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
5005     proto_tree_add_text(tree, asn1->tvb,
5006         saved_offset, asn1->offset - saved_offset,
5007         "%s :  NDSS Status (NDS), %ssuppressed",
5008         bigbuf,
5009         (value & 0x02) ? "" : "not ");
5010
5011     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
5012     proto_tree_add_text(tree, asn1->tvb,
5013         saved_offset, asn1->offset - saved_offset,
5014         "%s :  Return If Fail (RIF), If MS fails to access the redirected system, MS shall %sreturn to the serving system",
5015         bigbuf,
5016         (value & 0x01) ? "" : "not ");
5017
5018     EXTRANEOUS_DATA_CHECK(len, 1);
5019 }
5020
5021 static void
5022 param_roaming_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5023 {
5024     gint32 value;
5025     guint saved_offset;
5026     gchar *str = NULL;
5027
5028     add_string = add_string;
5029     saved_offset = asn1->offset;
5030
5031     asn1_int32_value_decode(asn1, 1, &value);
5032
5033     switch (value)
5034     {
5035     case 0: str = "Roaming Indicator On"; break;
5036     case 1: str = "Roaming Indicator Off"; break;
5037     case 2: str = "Roaming Indicator Flashing"; break;
5038     case 3: str = "Out of Neighborhood"; break;
5039     case 4: str = "Out of Building"; break;
5040     case 5: str = "Roaming - Preferred System"; break;
5041     case 6: str = "Roaming - Available System"; break;
5042     case 7: str = "Roaming - Alliance Partner"; break;
5043     case 8: str = "Roaming - Premium Partner"; break;
5044     case 9: str = "Roaming - Full Service Functionality"; break;
5045     case 10: str = "Roaming - Partial Service Functionality"; break;
5046     case 11: str = "Roaming Banner On"; break;
5047     case 12: str = "Roaming Banner Off"; break;
5048     default:
5049         if ((value >= 13) && (value <= 63)) { str = "Reserved for Standard Enhanced Roaming Indicator Numbers"; }
5050         else if ((value >= 64) && (value <= 127)) { str = "Reserved for Non-Standard Enhanced Roaming Indicator Numbers"; }
5051         else { str = "Reserved"; }
5052         break;
5053     }
5054
5055     proto_tree_add_text(tree, asn1->tvb,
5056         saved_offset, asn1->offset - saved_offset,
5057         str);
5058
5059     EXTRANEOUS_DATA_CHECK(len, 1);
5060 }
5061
5062 static void
5063 param_cdma_pci(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5064 {
5065     gint32 value;
5066     guint saved_offset;
5067
5068     EXACT_DATA_CHECK(len, 1);
5069
5070     add_string = add_string;
5071     saved_offset = asn1->offset;
5072
5073     asn1_int32_value_decode(asn1, 1, &value);
5074
5075     other_decode_bitfield_value(bigbuf, value, 0xfe, 8);
5076     proto_tree_add_text(tree, asn1->tvb,
5077         saved_offset, asn1->offset - saved_offset,
5078         "%s :  Reserved",
5079         bigbuf);
5080
5081     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
5082     proto_tree_add_text(tree, asn1->tvb,
5083         saved_offset, asn1->offset - saved_offset,
5084         "%s :  CDMA PWR_COMB_IND",
5085         bigbuf);
5086 }
5087
5088 static void
5089 param_cdma_chan_num(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5090 {
5091     gint32 value;
5092     guint saved_offset;
5093
5094     SHORT_DATA_CHECK(len, 2);
5095
5096     add_string = add_string;
5097     saved_offset = asn1->offset;
5098
5099     asn1_int32_value_decode(asn1, 2, &value);
5100
5101     other_decode_bitfield_value(bigbuf, value >> 8, 0xf8, 8);
5102     proto_tree_add_text(tree, asn1->tvb,
5103         saved_offset, 1,
5104         "%s :  Reserved",
5105         bigbuf);
5106
5107     other_decode_bitfield_value(bigbuf, value >> 8, 0x07, 8);
5108     proto_tree_add_text(tree, asn1->tvb,
5109         saved_offset, 1,
5110         "%s :  CDMA Channel Number (MSB) %u",
5111         bigbuf,
5112         value & 0x07ff);
5113
5114     other_decode_bitfield_value(bigbuf, value & 0x00ff, 0xff, 8);
5115     proto_tree_add_text(tree, asn1->tvb,
5116         saved_offset+1, 1,
5117         "%s :  CDMA Channel Number (LSB)",
5118         bigbuf);
5119
5120     EXTRANEOUS_DATA_CHECK(len, 2);
5121 }
5122
5123 static void
5124 param_cdma_sci(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5125 {
5126     gint32 value;
5127     guint saved_offset;
5128
5129     EXACT_DATA_CHECK(len, 1);
5130
5131     add_string = add_string;
5132     saved_offset = asn1->offset;
5133
5134     asn1_int32_value_decode(asn1, 1, &value);
5135
5136     other_decode_bitfield_value(bigbuf, value, 0xf8, 8);
5137     proto_tree_add_text(tree, asn1->tvb,
5138         saved_offset, asn1->offset - saved_offset,
5139         "%s :  Reserved",
5140         bigbuf);
5141
5142     other_decode_bitfield_value(bigbuf, value, 0x07, 8);
5143     proto_tree_add_text(tree, asn1->tvb,
5144         saved_offset, asn1->offset - saved_offset,
5145         "%s :  Slot Cycle Index, %u",
5146         bigbuf,
5147         (value & 0x07));
5148 }
5149
5150 static void
5151 param_vp_report(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5152 {
5153     gint32 value;
5154     guint saved_offset;
5155     gchar *str = NULL;
5156
5157     EXACT_DATA_CHECK(len, 1);
5158
5159     add_string = add_string;
5160     saved_offset = asn1->offset;
5161
5162     asn1_int32_value_decode(asn1, 1, &value);
5163
5164     switch (value)
5165     {
5166     case 0: str = "Not used"; break;
5167     case 1: str = "Voice Privacy not attempted"; break;
5168     case 2: str = "Voice Privacy no response"; break;
5169     case 3: str = "Voiec Privacy successful is active"; break;
5170     case 4: str = "Voice Privacy failed"; break;
5171     default:
5172         if ((value >= 5) && (value <= 223)) { str = "Reserved, treat as Voice Privacy not attempted"; }
5173         else { str = "Reserved for protocol extension, treat as Voice Privacy not attempted"; }
5174         break;
5175     }
5176
5177     proto_tree_add_text(tree, asn1->tvb,
5178         saved_offset, asn1->offset - saved_offset,
5179         "%s (%u)",
5180         str,
5181         value);
5182 }
5183
5184 static void
5185 param_cdma_scm(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5186 {
5187     gint32 value;
5188     guint saved_offset;
5189     gchar *str = NULL;
5190
5191     add_string = add_string;
5192     saved_offset = asn1->offset;
5193
5194     asn1_int32_value_decode(asn1, 1, &value);
5195
5196     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
5197     proto_tree_add_text(tree, asn1->tvb,
5198         saved_offset, asn1->offset - saved_offset,
5199         "%s :  Reserved",
5200         bigbuf);
5201
5202     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
5203     proto_tree_add_text(tree, asn1->tvb,
5204         saved_offset, asn1->offset - saved_offset,
5205         "%s :  Dual-mode Indicator, %s",
5206         bigbuf,
5207         (value & 0x40) ? "Dual mode CDMA" : "CDMA only");
5208
5209     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
5210     proto_tree_add_text(tree, asn1->tvb,
5211         saved_offset, asn1->offset - saved_offset,
5212         "%s :  Slotted mode Indicator, %s",
5213         bigbuf,
5214         (value & 0x20) ? "slotted capable" : "slotted incapable");
5215
5216     other_decode_bitfield_value(bigbuf, value, 0x18, 8);
5217     proto_tree_add_text(tree, asn1->tvb,
5218         saved_offset, asn1->offset - saved_offset,
5219         "%s :  Reserved",
5220         bigbuf);
5221
5222     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
5223     proto_tree_add_text(tree, asn1->tvb,
5224         saved_offset, asn1->offset - saved_offset,
5225         "%s :  Analog Transmission, %s",
5226         bigbuf,
5227         (value & 0x04) ? "discontinuous" : "continuous");
5228
5229     switch (value & 0x03)
5230     {
5231     case 0: str = "Power Class I"; break;
5232     case 1: str = "Power Class II"; break;
5233     case 2: str = "Power Class III"; break;
5234     case 3: str = "Reserved"; break;
5235     }
5236
5237     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
5238     proto_tree_add_text(tree, asn1->tvb,
5239         saved_offset, asn1->offset - saved_offset,
5240         "%s :  %s",
5241         bigbuf,
5242         str);
5243
5244     EXTRANEOUS_DATA_CHECK(len, 1);
5245 }
5246
5247 static void
5248 param_ota_result_code(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5249 {
5250     gint32 value;
5251     guint saved_offset;
5252     gchar *str = NULL;
5253
5254     add_string = add_string;
5255     saved_offset = asn1->offset;
5256
5257     asn1_int32_value_decode(asn1, 1, &value);
5258
5259     switch (value)
5260     {
5261     case 0: str = "Accepted - Successful"; break;
5262     case 1: str = "Rejected - Unknown cause"; break;
5263     case 2: str = "Computation Failure - E.g., unable to compute A-key"; break;
5264     case 3: str = "CSC Rejected - CSC challenge failure"; break;
5265     case 4: str = "Unrecognized OTASPCallEntry"; break;
5266     case 5: str = "Unsupported AKeyProtocolVersion(s)"; break;
5267     case 6: str = "Unable to Commit"; break;
5268     default:
5269         if ((value >= 7) && (value <= 223)) { str = "Reserved, treat as Rejected - Unknown cause"; }
5270         else { str = "Reserved for protocol extension, treat as Rejected - Unknown cause"; }
5271         break;
5272     }
5273
5274     proto_tree_add_text(tree, asn1->tvb,
5275         saved_offset, asn1->offset - saved_offset,
5276         "%s (%u)",
5277         str,
5278         value);
5279
5280     EXTRANEOUS_DATA_CHECK(len, 1);
5281 }
5282
5283 static void
5284 param_cdma_scm2(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5285 {
5286     gint32 value;
5287     guint saved_offset;
5288
5289     add_string = add_string;
5290     saved_offset = asn1->offset;
5291
5292     asn1_int32_value_decode(asn1, 1, &value);
5293
5294     proto_tree_add_text(tree, asn1->tvb,
5295         saved_offset, asn1->offset - saved_offset,
5296         "Value %u",
5297         value);
5298
5299     EXTRANEOUS_DATA_CHECK(len, 1);
5300 }
5301
5302 static void
5303 param_tdma_term_cap(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5304 {
5305     gint32 value;
5306     guint saved_offset;
5307     gchar *str = NULL;
5308
5309     SHORT_DATA_CHECK(len, 4);
5310
5311     add_string = add_string;
5312     saved_offset = asn1->offset;
5313
5314     asn1_int32_value_decode(asn1, 1, &value);
5315
5316     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
5317     proto_tree_add_text(tree, asn1->tvb,
5318         saved_offset, asn1->offset - saved_offset,
5319         "%s :  Reserved",
5320         bigbuf);
5321
5322     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
5323     proto_tree_add_text(tree, asn1->tvb,
5324         saved_offset, asn1->offset - saved_offset,
5325         "%s :  1800 MHz F channel %sacceptable",
5326         bigbuf,
5327         (value & 0x40) ? "" : "not ");
5328
5329     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
5330     proto_tree_add_text(tree, asn1->tvb,
5331         saved_offset, asn1->offset - saved_offset,
5332         "%s :  1800 MHz E channel %sacceptable",
5333         bigbuf,
5334         (value & 0x20) ? "" : "not ");
5335
5336     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
5337     proto_tree_add_text(tree, asn1->tvb,
5338         saved_offset, asn1->offset - saved_offset,
5339         "%s :  1800 MHz D channel %sacceptable",
5340         bigbuf,
5341         (value & 0x10) ? "" : "not ");
5342
5343     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
5344     proto_tree_add_text(tree, asn1->tvb,
5345         saved_offset, asn1->offset - saved_offset,
5346         "%s :  1800 MHz C channel %sacceptable",
5347         bigbuf,
5348         (value & 0x08) ? "" : "not ");
5349
5350     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
5351     proto_tree_add_text(tree, asn1->tvb,
5352         saved_offset, asn1->offset - saved_offset,
5353         "%s :  1800 MHz B channel %sacceptable",
5354         bigbuf,
5355         (value & 0x04) ? "" : "not ");
5356
5357     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
5358     proto_tree_add_text(tree, asn1->tvb,
5359         saved_offset, asn1->offset - saved_offset,
5360         "%s :  %s acceptable",
5361         bigbuf,
5362         (value & 0x02) ? "1800 MHz A channel" : "1800 MHz A&B Digital channel not");
5363
5364     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
5365     proto_tree_add_text(tree, asn1->tvb,
5366         saved_offset, asn1->offset - saved_offset,
5367         "%s :  800 MHz A&B channel %sacceptable",
5368         bigbuf,
5369         (value & 0x01) ? "" : "not ");
5370
5371     saved_offset = asn1->offset;
5372
5373     asn1_int32_value_decode(asn1, 1, &value);
5374
5375     other_decode_bitfield_value(bigbuf, value, 0xfc, 8);
5376     proto_tree_add_text(tree, asn1->tvb,
5377         saved_offset, asn1->offset - saved_offset,
5378         "%s :  Reserved",
5379         bigbuf);
5380
5381     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
5382     proto_tree_add_text(tree, asn1->tvb,
5383         saved_offset, asn1->offset - saved_offset,
5384         "%s :  IS-641 Voice Coder %sacceptable",
5385         bigbuf,
5386         (value & 0x02) ? "" : "not ");
5387
5388     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
5389     proto_tree_add_text(tree, asn1->tvb,
5390         saved_offset, asn1->offset - saved_offset,
5391         "%s :  VSELP Voice Coder %sacceptable",
5392         bigbuf,
5393         (value & 0x01) ? "" : "not ");
5394
5395     saved_offset = asn1->offset;
5396
5397     asn1_int32_value_decode(asn1, 1, &value);
5398
5399     switch (value)
5400     {
5401     case 0: str = "EIA-553 or IS-54-A"; break;
5402     case 1: str = "TIA/EIA-627 (IS-54-B)"; break;
5403     case 2: str = "IS-136"; break;
5404     case 3: str = "Reserved (ANSI J-STD-011)"; break;
5405     case 4: str = "PV 0 as published in TIA/EIA-136-0 and IS-136-A"; break;
5406     case 5: str = "PV 1 as published in TIA/EIA-136-A"; break;
5407     case 6: str = "PV 2 as published in TIA/EIA-136-A"; break;
5408     case 7: str = "PV 3 as published in TIA/EIA-136-A"; break;
5409     default:
5410         str = "Reserved, treat as EIA-553 or IS-54-A";
5411         break;
5412     }
5413
5414     proto_tree_add_text(tree, asn1->tvb,
5415         saved_offset, 1,
5416         "Protocol Version, %s",
5417         str);
5418
5419     saved_offset = asn1->offset;
5420
5421     asn1_int32_value_decode(asn1, 1, &value);
5422
5423     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
5424     proto_tree_add_text(tree, asn1->tvb,
5425         saved_offset, asn1->offset - saved_offset,
5426         "%s :  Triple Rate (3RATE) %ssupported",
5427         bigbuf,
5428         (value & 0x80) ? "" : "not ");
5429
5430     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
5431     proto_tree_add_text(tree, asn1->tvb,
5432         saved_offset, asn1->offset - saved_offset,
5433         "%s :  Double Rate (2RATE) %ssupported",
5434         bigbuf,
5435         (value & 0x40) ? "" : "not ");
5436
5437     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
5438     proto_tree_add_text(tree, asn1->tvb,
5439         saved_offset, asn1->offset - saved_offset,
5440         "%s :  Full Rate (FRATE) %ssupported",
5441         bigbuf,
5442         (value & 0x20) ? "" : "not ");
5443
5444     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
5445     proto_tree_add_text(tree, asn1->tvb,
5446         saved_offset, asn1->offset - saved_offset,
5447         "%s :  Half Rate (HRATE) %ssupported",
5448         bigbuf,
5449         (value & 0x10) ? "" : "not ");
5450
5451     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
5452     proto_tree_add_text(tree, asn1->tvb,
5453         saved_offset, asn1->offset - saved_offset,
5454         "%s :  Analog Voice (AVOX) %ssupported",
5455         bigbuf,
5456         (value & 0x08) ? "" : "not ");
5457
5458     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
5459     proto_tree_add_text(tree, asn1->tvb,
5460         saved_offset, asn1->offset - saved_offset,
5461         "%s :  Secure Telephone Unit III (STU3) %ssupported",
5462         bigbuf,
5463         (value & 0x04) ? "" : "not ");
5464
5465     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
5466     proto_tree_add_text(tree, asn1->tvb,
5467         saved_offset, asn1->offset - saved_offset,
5468         "%s :  Group 3 Fax (G3FAX) %ssupported",
5469         bigbuf,
5470         (value & 0x02) ? "" : "not ");
5471
5472     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
5473     proto_tree_add_text(tree, asn1->tvb,
5474         saved_offset, asn1->offset - saved_offset,
5475         "%s :  Asynchronous Data (ADS) %ssupported",
5476         bigbuf,
5477         (value & 0x01) ? "" : "not ");
5478
5479     EXTRANEOUS_DATA_CHECK(len, 4);
5480 }
5481
5482 static void
5483 param_tdma_voice_coder(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5484 {
5485     gint32 value, vc;
5486     guint orig_offset, saved_offset;
5487     gchar *str = NULL;
5488
5489     SHORT_DATA_CHECK(len, 2);
5490
5491     add_string = add_string;
5492     orig_offset = asn1->offset;
5493     saved_offset = asn1->offset;
5494
5495     do
5496     {
5497         asn1_int32_value_decode(asn1, 1, &value);
5498
5499         other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
5500         proto_tree_add_text(tree, asn1->tvb,
5501             saved_offset, asn1->offset - saved_offset,
5502             "%s :  Reserved",
5503             bigbuf);
5504
5505         vc = (value & 0x0f);
5506         switch (vc)
5507         {
5508         case 0: str = "Not used"; break;
5509         case 1: str = "VSELP Voice Coder acceptable"; break;
5510         case 2: str = "IS-641 Voice Coder acceptable"; break;
5511         case 6: str = "Reserved for SOC/BSMC Specific signaling. If unknown, use any acceptable value"; break;
5512         default:
5513             if ((vc >= 3) && (vc <= 5)) { str = "Reserved. Ignore on reception, use any acceptable value"; }
5514             else if ((vc >= 7) && (vc <= 12)) { str = "Reserved. Ignore on reception, use any acceptable value"; }
5515             else if ((vc >= 13) && (vc <= 15)) { str = "Reserved for protocol extension. If unknown, use any acceptable value"; }
5516             break;
5517         }
5518
5519         other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
5520         proto_tree_add_text(tree, asn1->tvb,
5521             saved_offset, asn1->offset - saved_offset,
5522             "%s :  Voice Coder, %s",
5523             bigbuf,
5524             str);
5525
5526         saved_offset = asn1->offset;
5527     }
5528     while ((len - (saved_offset - orig_offset)) > 0);
5529 }
5530
5531 static void
5532 param_cdma_pilot_pn(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5533 {
5534     gint32 value;
5535     guint saved_offset;
5536
5537     SHORT_DATA_CHECK(len, 2);
5538
5539     add_string = add_string;
5540     saved_offset = asn1->offset;
5541
5542     asn1_int32_value_decode(asn1, 2, &value);
5543
5544     other_decode_bitfield_value(bigbuf, value >> 8, 0xfe, 8);
5545     proto_tree_add_text(tree, asn1->tvb,
5546         saved_offset, 1,
5547         "%s :  Reserved",
5548         bigbuf);
5549
5550     other_decode_bitfield_value(bigbuf, value >> 8, 0x01, 8);
5551     proto_tree_add_text(tree, asn1->tvb,
5552         saved_offset, 1,
5553         "%s :  Pilot PN (MSB), %u",
5554         bigbuf, value & 0x01ff);
5555
5556     other_decode_bitfield_value(bigbuf, value & 0x00ff, 0xff, 8);
5557     proto_tree_add_text(tree, asn1->tvb,
5558         saved_offset + 1, 1,
5559         "%s :  Pilot PN (LSB)",
5560         bigbuf);
5561
5562     EXTRANEOUS_DATA_CHECK(len, 2);
5563 }
5564
5565 static void
5566 param_cdma_pilot_strength(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5567 {
5568     gint32 value;
5569     guint saved_offset;
5570
5571     EXACT_DATA_CHECK(len, 1);
5572
5573     add_string = add_string;
5574     saved_offset = asn1->offset;
5575
5576     asn1_int32_value_decode(asn1, 1, &value);
5577
5578     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
5579     proto_tree_add_text(tree, asn1->tvb,
5580         saved_offset, asn1->offset - saved_offset,
5581         "%s :  Reserved",
5582         bigbuf);
5583
5584     other_decode_bitfield_value(bigbuf, value, 0x3f, 8);
5585     proto_tree_add_text(tree, asn1->tvb,
5586         saved_offset, asn1->offset - saved_offset,
5587         "%s :  Value %u",
5588         bigbuf,
5589         value & 0x3f);
5590 }
5591
5592 static void
5593 param_trunk_stat(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5594 {
5595     gint32 value;
5596     guint saved_offset;
5597     gchar *str = NULL;
5598
5599     EXACT_DATA_CHECK(len, 1);
5600
5601     add_string = add_string;
5602     saved_offset = asn1->offset;
5603
5604     asn1_int32_value_decode(asn1, 1, &value);
5605
5606     switch (value)
5607     {
5608     case 0: str = "Idle"; break;
5609     case 1: str = "Blocked"; break;
5610     default:
5611         if ((value >= 2) && (value <= 223)) { str = "Reserved, treat as ERROR or Blocked"; }
5612         else { str = "Reserved for protocol extension, treat as ERROR or Blocked"; }
5613         break;
5614     }
5615
5616     proto_tree_add_text(tree, asn1->tvb,
5617         saved_offset, asn1->offset - saved_offset,
5618         "Trunk Status, %s",
5619         str);
5620 }
5621
5622 static void
5623 param_pref_lang_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5624 {
5625     gint32 value;
5626     guint saved_offset;
5627     gchar *str = NULL;
5628
5629     add_string = add_string;
5630     saved_offset = asn1->offset;
5631
5632     asn1_int32_value_decode(asn1, 1, &value);
5633
5634     switch (value)
5635     {
5636     case 0: str = "Unspecified"; break;
5637     case 1: str = "English"; break;
5638     case 2: str = "French"; break;
5639     case 3: str = "Spanish"; break;
5640     case 4: str = "German"; break;
5641     case 5: str = "Portuguese"; break;
5642     default:
5643         str = "Reserved, treat as Unspecified";
5644         break;
5645     }
5646
5647     proto_tree_add_text(tree, asn1->tvb,
5648         saved_offset, asn1->offset - saved_offset,
5649         "Preferred Language, %s",
5650         str);
5651
5652     EXTRANEOUS_DATA_CHECK(len, 1);
5653 }
5654
5655 static void
5656 param_rand_valtime(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5657 {
5658     gint32 value;
5659     guint saved_offset;
5660     gchar *str = NULL;
5661
5662     add_string = add_string;
5663     saved_offset = asn1->offset;
5664
5665     asn1_int32_value_decode(asn1, 1, &value);
5666
5667     if (value == 0)
5668     {
5669         str = "RAND shall not be stored";
5670     }
5671     else
5672     {
5673         sprintf(bigbuf, "RAND may be used for %u minutes", value);
5674         str = bigbuf;
5675     }
5676
5677     proto_tree_add_text(tree, asn1->tvb,
5678         saved_offset, asn1->offset - saved_offset,
5679         str);
5680
5681     EXTRANEOUS_DATA_CHECK(len, 1);
5682 }
5683
5684 static void
5685 param_tdma_burst_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5686 {
5687     gint32 value;
5688     guint saved_offset;
5689     gchar *str = NULL;
5690
5691     EXACT_DATA_CHECK(len, 1);
5692
5693     add_string = add_string;
5694     saved_offset = asn1->offset;
5695
5696     asn1_int32_value_decode(asn1, 1, &value);
5697
5698     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
5699     proto_tree_add_text(tree, asn1->tvb,
5700         saved_offset, asn1->offset - saved_offset,
5701         "%s :  Reserved",
5702         bigbuf);
5703
5704     other_decode_bitfield_value(bigbuf, value, 0x7c, 8);
5705     proto_tree_add_text(tree, asn1->tvb,
5706         saved_offset, asn1->offset - saved_offset,
5707         "%s :  Time Alignment Offset (TA), %u",
5708         bigbuf,
5709         (value & 0x7c) >> 2);
5710
5711     switch (value & 0x03)
5712     {
5713     case 0: str = "Transmit normal burst after cell-to-cell handoff"; break;
5714     case 1: str = "Transmit normal burst after handoff within cell"; break;
5715     case 2: str = "Transmit shortened burst after cell-to-cell handoff"; break;
5716     case 3: str = "Reserved, treat with RETURN ERROR"; break;
5717     }
5718
5719     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
5720     proto_tree_add_text(tree, asn1->tvb,
5721         saved_offset, asn1->offset - saved_offset,
5722         "%s :  Burst Code, %s",
5723         bigbuf,
5724         str);
5725 }
5726
5727 static void
5728 param_orig_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5729 {
5730     gint32 value;
5731     guint saved_offset;
5732     gchar *str = NULL;
5733
5734     EXACT_DATA_CHECK(len, 1);
5735
5736     add_string = add_string;
5737     saved_offset = asn1->offset;
5738
5739     asn1_int32_value_decode(asn1, 1, &value);
5740
5741     switch (value)
5742     {
5743     case 0: str = "Not used"; break;
5744     case 1: str = "Prior agreement"; break;
5745     case 2: str = "Origination denied"; break;
5746     case 3: str = "Local calls only"; break;
5747     case 4: str = "Selected leading digits of directory number or of international E.164 number, see Digits(Destination)"; break;
5748     case 5: str = "Selected leading digits of directory number or of international E.164 number and local calls only, see Digits(Destination)"; break;
5749     case 6: str = "National long distance"; break;
5750     case 7: str = "International calls"; break;
5751     case 8: str = "Single directory number or international E.164 number, see Digits(Destination)"; break;
5752     default:
5753         if ((value >= 9) && (value <= 223)) { str = "Reserved, treat as Local calls only"; }
5754         else { str = "Reserved for protocol extension, treat as Local calls only"; }
5755         break;
5756     }
5757
5758     proto_tree_add_text(tree, asn1->tvb,
5759         saved_offset, asn1->offset - saved_offset,
5760         "Allowed Call Types, %s",
5761         str);
5762 }
5763
5764 static void
5765 param_ms_loc(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5766 {
5767     gint32 value;
5768     guint saved_offset;
5769
5770     SHORT_DATA_CHECK(len, 7);
5771
5772     add_string = add_string;
5773     saved_offset = asn1->offset;
5774
5775     asn1_int32_value_decode(asn1, 3, &value);
5776
5777     proto_tree_add_text(tree, asn1->tvb,
5778         saved_offset, asn1->offset - saved_offset,
5779         "Latitude in tenths of a second, %u",
5780         value);
5781
5782     saved_offset = asn1->offset;
5783
5784     asn1_int32_value_decode(asn1, 3, &value);
5785
5786     proto_tree_add_text(tree, asn1->tvb,
5787         saved_offset, asn1->offset - saved_offset,
5788         "Longitude in tenths of a second, %u",
5789         value);
5790
5791     saved_offset = asn1->offset;
5792
5793     asn1_int32_value_decode(asn1, MIN(len - 6, 2), &value);
5794
5795     proto_tree_add_text(tree, asn1->tvb,
5796         saved_offset, asn1->offset - saved_offset,
5797         "Resolution in units of 1 foot, %u",
5798         value);
5799
5800     EXTRANEOUS_DATA_CHECK(len, 8);
5801 }
5802
5803 static void
5804 param_unique_chal_rep(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5805 {
5806     gint32 value;
5807     guint saved_offset;
5808     gchar *str = NULL;
5809
5810     add_string = add_string;
5811     saved_offset = asn1->offset;
5812
5813     asn1_int32_value_decode(asn1, 1, &value);
5814
5815     switch (value)
5816     {
5817     case 0: str = "Not used"; break;
5818     case 1: str = "Unique Challenge not attempted"; break;
5819     case 2: str = "Unique Challenge no response"; break;
5820     case 3: str = "Unique Challenge successful"; break;
5821     case 4: str = "Unique Challenge failed"; break;
5822     default:
5823         if ((value >= 5) && (value <= 223)) { str = "Reserved, treat as Unique Challenge not attempted"; }
5824         else { str = "Reserved for protocol extension, treat as Unique Challenge not attempted"; }
5825         break;
5826     }
5827
5828     proto_tree_add_text(tree, asn1->tvb,
5829         saved_offset, asn1->offset - saved_offset,
5830         str);
5831
5832     EXTRANEOUS_DATA_CHECK(len, 1);
5833 }
5834
5835 static void
5836 param_rand_unique(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5837 {
5838     guint saved_offset;
5839
5840     EXACT_DATA_CHECK(len, 3);
5841
5842     add_string = add_string;
5843     saved_offset = asn1->offset;
5844
5845     proto_tree_add_text(tree, asn1->tvb,
5846         saved_offset, len,
5847         "24-bit random number used as input to the CAVE algorithm for authenticating a specific MS");
5848
5849     asn1->offset += len;
5850 }
5851
5852 static void
5853 param_vpmask(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5854 {
5855     gint32 value;
5856     guint saved_offset;
5857
5858     EXACT_DATA_CHECK(len, 66);
5859
5860     add_string = add_string;
5861     saved_offset = asn1->offset;
5862
5863     asn1_int32_value_decode(asn1, 1, &value);
5864
5865     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
5866     proto_tree_add_text(tree, asn1->tvb,
5867         saved_offset, asn1->offset - saved_offset,
5868         "%s :  Reserved",
5869         bigbuf);
5870
5871     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
5872     proto_tree_add_text(tree, asn1->tvb,
5873         saved_offset, asn1->offset - saved_offset,
5874         "%s :  Voice Privacy Mask-A (VPMASK-A) (MSB)",
5875         bigbuf);
5876
5877     saved_offset = asn1->offset;
5878
5879     proto_tree_add_text(tree, asn1->tvb,
5880         saved_offset, 32,
5881         "Voice Privacy Mask-A (VPMASK-A)");
5882
5883     asn1->offset += 32;
5884
5885     saved_offset = asn1->offset;
5886
5887     asn1_int32_value_decode(asn1, 1, &value);
5888
5889     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
5890     proto_tree_add_text(tree, asn1->tvb,
5891         saved_offset, asn1->offset - saved_offset,
5892         "%s :  Reserved",
5893         bigbuf);
5894
5895     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
5896     proto_tree_add_text(tree, asn1->tvb,
5897         saved_offset, asn1->offset - saved_offset,
5898         "%s :  Voice Privacy Mask-B (VPMASK-B) (MSB)",
5899         bigbuf);
5900
5901     saved_offset = asn1->offset;
5902
5903     proto_tree_add_text(tree, asn1->tvb,
5904         saved_offset, 32,
5905         "Voice Privacy Mask-B (VPMASK-B)");
5906
5907     asn1->offset += 32;
5908 }
5909
5910 static void
5911 param_ssd(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5912 {
5913     guint saved_offset;
5914
5915     EXACT_DATA_CHECK(len, 16);
5916
5917     add_string = add_string;
5918     saved_offset = asn1->offset;
5919
5920     proto_tree_add_text(tree, asn1->tvb,
5921         saved_offset, 8,
5922         "Shared Secret Data-A (SSD-A)");
5923
5924     proto_tree_add_text(tree, asn1->tvb,
5925         saved_offset+8, 8,
5926         "Shared Secret Data-B (SSD-B)");
5927
5928     asn1->offset += len;
5929 }
5930
5931 static void
5932 param_upd_count(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5933 {
5934     gint32 value;
5935     guint saved_offset;
5936     gchar *str = NULL;
5937
5938     EXACT_DATA_CHECK(len, 1);
5939
5940     add_string = add_string;
5941     saved_offset = asn1->offset;
5942
5943     asn1_int32_value_decode(asn1, 1, &value);
5944
5945     switch (value)
5946     {
5947     case 0: str = "Not used"; break;
5948     case 1: str = "Update COUNT"; break;
5949     default:
5950         if ((value >= 2) && (value <= 223)) { str = "Reserved, treat as Update COUNT"; }
5951         else { str = "Reserved for protocol extension, treat as Update COUNT"; }
5952         break;
5953     }
5954
5955     proto_tree_add_text(tree, asn1->tvb,
5956         saved_offset, asn1->offset - saved_offset,
5957         "%s",
5958         str);
5959 }
5960
5961 static void
5962 param_sme_key(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5963 {
5964     guint saved_offset;
5965
5966     EXACT_DATA_CHECK(len, 8);
5967
5968     add_string = add_string;
5969     saved_offset = asn1->offset;
5970
5971     proto_tree_add_text(tree, asn1->tvb,
5972         saved_offset, len,
5973         "Signaling Message Encryption Key (SMEKEY)");
5974
5975     asn1->offset += len;
5976 }
5977
5978 static void
5979 param_rand_ssd(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5980 {
5981     guint saved_offset;
5982
5983     EXACT_DATA_CHECK(len, 7);
5984
5985     add_string = add_string;
5986     saved_offset = asn1->offset;
5987
5988     proto_tree_add_text(tree, asn1->tvb,
5989         saved_offset, len,
5990         "56-bit random number used as input to the CAVE algorithm for generating Shared Secret Data");
5991
5992     asn1->offset += len;
5993 }
5994
5995 static void
5996 param_setup_result(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
5997 {
5998     gint32 value;
5999     guint saved_offset;
6000     gchar *str = NULL;
6001
6002     add_string = add_string;
6003     saved_offset = asn1->offset;
6004
6005     asn1_int32_value_decode(asn1, 1, &value);
6006
6007     switch (value)
6008     {
6009     case 0: str = "Not used"; break;
6010     case 1: str = "Unsuccessful"; break;
6011     case 2: str = "Successful"; break;
6012     default:
6013         str = "Reserved, treat as Unsuccessful";
6014         break;
6015     }
6016
6017     proto_tree_add_text(tree, asn1->tvb,
6018         saved_offset, asn1->offset - saved_offset,
6019         str);
6020
6021     EXTRANEOUS_DATA_CHECK(len, 1);
6022 }
6023
6024 static void
6025 param_randc(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6026 {
6027     guint saved_offset;
6028
6029     add_string = add_string;
6030     saved_offset = asn1->offset;
6031
6032     proto_tree_add_text(tree, asn1->tvb,
6033         saved_offset, 1,
6034         "The 8 most significant bits of the 32-bit Random Variable used to compute the Authentication Response");
6035
6036     asn1->offset += 1;
6037
6038     EXTRANEOUS_DATA_CHECK(len, 1);
6039 }
6040
6041 static void
6042 param_ext_mscid(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6043 {
6044     gint32 type;
6045     guint saved_offset;
6046     gchar *str = NULL;
6047
6048     EXACT_DATA_CHECK(len, 4);
6049
6050     saved_offset = asn1->offset;
6051
6052     asn1_int32_value_decode(asn1, 1, &type);
6053
6054     switch (type)
6055     {
6056     case 0: str = "Not specified"; break;
6057     case 1: str = "Serving MSC"; break;
6058     case 2: str = "Home MSC"; break;
6059     case 3: str = "Gateway MSC"; break;
6060     case 4: str = "HLR"; break;
6061     case 5: str = "VLR"; break;
6062     case 6: str = "EIR (reserved)"; break;
6063     case 7: str = "AC"; break;
6064     case 8: str = "Border MSC"; break;
6065     case 9: str = "Originating MSC"; break;
6066     default:
6067         if ((type >= 10) && (type <= 223)) { str = "Reserved, treat as Not specified"; }
6068         else { str = "Reserved for protocol extension, treat as Not specified"; }
6069         break;
6070     }
6071
6072     proto_tree_add_text(tree, asn1->tvb,
6073         saved_offset, asn1->offset - saved_offset,
6074         "Type (%u), %s",
6075         type,
6076         str);
6077
6078     param_mscid(asn1, tree, len-1, add_string);
6079 }
6080
6081 static void
6082 param_sub_addr(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6083 {
6084     gint32 value;
6085     guint saved_offset;
6086     gchar *str = NULL;
6087
6088     add_string = add_string;
6089     saved_offset = asn1->offset;
6090     asn1_int32_value_decode(asn1, 1, &value);
6091
6092     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
6093     proto_tree_add_text(tree, asn1->tvb,
6094         saved_offset, asn1->offset - saved_offset,
6095         "%s :  Should be 1",
6096         bigbuf);
6097
6098     switch ((value & 0x70) >> 4)
6099     {
6100     case 0x00: str = "NSAP (CCITT Rec. X.213 or ISO 8348 AD2)"; break;
6101     case 0x02: str = "User specified"; break;
6102     default:
6103         str = "Reserved";
6104         break;
6105     }
6106
6107     other_decode_bitfield_value(bigbuf, value, 0x70, 8);
6108     proto_tree_add_text(tree, asn1->tvb,
6109         saved_offset, asn1->offset - saved_offset,
6110         "%s :  Type of Subaddress %s",
6111         bigbuf, str);
6112
6113     switch ((value & 0x08) >> 3)
6114     {
6115     case 0x00: str = "Even number of subaddress signals follow"; break;
6116     case 0x01: str = "Odd number of subaddress signals follow"; break;
6117     }
6118
6119     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
6120     proto_tree_add_text(tree, asn1->tvb,
6121         saved_offset, asn1->offset - saved_offset,
6122         "%s :  %s",
6123         bigbuf, str);
6124
6125     proto_tree_add_text(tree, asn1->tvb,
6126         asn1->offset, len - 1,
6127         "Subaddress");
6128
6129     asn1->offset += len - 1;
6130 }
6131
6132 static void
6133 param_digits(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6134 {
6135     gint32 value, b1, b2, b3, b4, enc, plan;
6136     guint saved_offset;
6137     gchar *str = NULL;
6138     proto_item *item;
6139     proto_tree *subtree;
6140     guchar *poctets;
6141
6142     SHORT_DATA_CHECK(len, 4);
6143
6144     add_string = add_string;
6145     saved_offset = asn1->offset;
6146     asn1_int32_value_decode(asn1, 1, &value);
6147
6148     switch (value)
6149     {
6150     case 0: str = "Not used"; break;
6151     case 1: str = "Dialed Numer or Called Party Number"; break;
6152     case 2: str = "Calling Party Number"; break;
6153     case 3: str = "Caller Interaction (Not used)"; break;
6154     case 4: str = "Routing Number"; break;
6155     case 5: str = "Billing Number"; break;
6156     case 6: str = "Destination Number"; break;
6157     case 7: str = "LATA (Not used)"; break;
6158     case 8: str = "Carrier"; break;
6159     case 13: str = "ESRD"; break;
6160     default:
6161         str = "Reserved";
6162         break;
6163     }
6164
6165     proto_tree_add_text(tree, asn1->tvb,
6166         saved_offset, asn1->offset - saved_offset,
6167         "Type of Digits %u: %s",
6168         value, str);
6169
6170     saved_offset = asn1->offset;
6171     asn1_int32_value_decode(asn1, 1, &value);
6172
6173     item =
6174         proto_tree_add_text(tree, asn1->tvb,
6175             saved_offset, asn1->offset - saved_offset,
6176             "Nature of Number");
6177
6178     subtree = proto_item_add_subtree(item, ett_natnum);
6179
6180     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
6181     proto_tree_add_text(subtree, asn1->tvb,
6182         saved_offset, asn1->offset - saved_offset,
6183         "%s :  Reserved",
6184         bigbuf);
6185
6186     switch ((value & 0x30) >> 4)
6187     {
6188     case 0x00: str = "User provided, not screened"; break;
6189     case 0x01: str = "User provided, screening passed"; break;
6190     case 0x02: str = "User provided, screening failed"; break;
6191     case 0x03: str = "Network provided"; break;
6192     }
6193
6194     other_decode_bitfield_value(bigbuf, value, 0x30, 8);
6195     proto_tree_add_text(subtree, asn1->tvb,
6196         saved_offset, asn1->offset - saved_offset,
6197         "%s :  %s",
6198         bigbuf, str);
6199
6200     proto_tree_add_text(subtree, asn1->tvb,
6201         saved_offset, asn1->offset - saved_offset,
6202         ".... %u... :  Reserved",
6203         (value & 0x08) >> 3);
6204
6205     proto_tree_add_text(subtree, asn1->tvb,
6206         saved_offset, asn1->offset - saved_offset,
6207         ".... .%u.. :  Number is %savailable",
6208         (value & 0x04) >> 2, (value & 0x04) ? "not " : "");
6209
6210     proto_tree_add_text(subtree, asn1->tvb,
6211         saved_offset, asn1->offset - saved_offset,
6212         ".... ..%u. :  Presentation %s",
6213         (value & 0x02) >> 1, (value & 0x02) ? "Restricted" : "Allowed");
6214
6215     proto_tree_add_text(subtree, asn1->tvb,
6216         saved_offset, asn1->offset - saved_offset,
6217         ".... ...%u :  %s",
6218         value & 0x01, (value & 0x01) ? "International" : "National");
6219
6220     saved_offset = asn1->offset;
6221     asn1_int32_value_decode(asn1, 1, &value);
6222
6223     plan = (value & 0xf0) >> 4;
6224     switch (plan)
6225     {
6226     case 0x00: str = "Unknown or not applicable"; break;
6227     case 0x01: str = "ISDN Numbering (Not used)"; break;
6228     case 0x02: str = "Telephony Numbering (ITU-T Rec. E.164, E.163)"; break;
6229     case 0x03: str = "Data Numbering (ITU-T Rec. X.121)(Not used)"; break;
6230     case 0x04: str = "Telex Numbering (ITU-T Rec. F.69)(Not used)"; break;
6231     case 0x05: str = "Maritime Mobile Numbering (Not used)"; break;
6232     case 0x06: str = "Land Mobile Numbering (ITU-T Rec. E.212)"; break;
6233     case 0x07: str = "Private Numbering Plan (service provider defined)"; break;
6234     case 0x0d: str = "ANSI SS7 Point Code (PC) and Subsystem Number (SSN)"; break;
6235     case 0x0e: str = "Internet Protocol (IP) Address"; break;
6236     case 0x0f: str = "Reserved for extension"; break;
6237     default:
6238         str = "Reserved";
6239         break;
6240     }
6241
6242     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
6243     proto_tree_add_text(tree, asn1->tvb,
6244         saved_offset, asn1->offset - saved_offset,
6245         "%s :  Numbering Plan: %s",
6246         bigbuf, str);
6247
6248     enc = value & 0x0f;
6249     switch (enc)
6250     {
6251     case 0x00: str = "Not used"; break;
6252     case 0x01: str = "BCD"; break;
6253     case 0x02: str = "IA5"; break;
6254     case 0x03: str = "Octet String"; break;
6255     default:
6256         str = "Reserved";
6257         break;
6258     }
6259
6260     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
6261     proto_tree_add_text(tree, asn1->tvb,
6262         saved_offset, asn1->offset - saved_offset,
6263         "%s :  Encoding: %s",
6264         bigbuf, str);
6265
6266     saved_offset = asn1->offset;
6267
6268     if (plan == 0x0d)
6269     {
6270         asn1_int32_value_decode(asn1, 1, &b1);
6271         asn1_int32_value_decode(asn1, 1, &b2);
6272         asn1_int32_value_decode(asn1, 1, &b3);
6273         asn1_int32_value_decode(asn1, 1, &b4);
6274
6275         proto_tree_add_text(tree, asn1->tvb,
6276             saved_offset, asn1->offset - saved_offset,
6277             "Point Code %u-%u-%u  SSN %u",
6278             b3, b2, b1, b4);
6279     }
6280     else if (plan == 0x0e)
6281     {
6282         asn1_int32_value_decode(asn1, 1, &b1);
6283         asn1_int32_value_decode(asn1, 1, &b2);
6284         asn1_int32_value_decode(asn1, 1, &b3);
6285         asn1_int32_value_decode(asn1, 1, &b4);
6286
6287         proto_tree_add_text(tree, asn1->tvb,
6288             saved_offset, asn1->offset - saved_offset,
6289             "IP Address %u.%u.%u.%u",
6290             b1, b2, b3, b4);
6291     }
6292     else
6293     {
6294         asn1_int32_value_decode(asn1, 1, &value);
6295
6296         proto_tree_add_text(tree, asn1->tvb,
6297             saved_offset, asn1->offset - saved_offset,
6298             "Number of Digits: %u",
6299             value);
6300
6301         if (enc == 0x02)
6302         {
6303             proto_tree_add_text(tree, asn1->tvb,
6304                 asn1->offset, value,
6305                 "IA5 Digits: %s",
6306                 tvb_format_text(asn1->tvb, asn1->offset, value));
6307
6308             asn1->offset += value;
6309         }
6310         else if (enc == 0x01)
6311         {
6312             saved_offset = asn1->offset;
6313             asn1_string_value_decode(asn1, (value+1)/2, &poctets);
6314
6315             my_dgt_tbcd_unpack(bigbuf, poctets, (value+1)/2, &Dgt_tbcd);
6316             g_free(poctets);
6317
6318             proto_tree_add_text(tree, asn1->tvb,
6319                 saved_offset, (value+1)/2,
6320                 "BCD Digits: %s",
6321                 bigbuf);
6322         }
6323     }
6324 }
6325
6326 static void
6327 param_esn(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6328 {
6329     gint32 value;
6330     guint saved_offset;
6331
6332     EXACT_DATA_CHECK(len, 4);
6333
6334     add_string = add_string;
6335     saved_offset = asn1->offset;
6336
6337     asn1_int32_value_decode(asn1, 4, &value);
6338
6339     proto_tree_add_text(tree, asn1->tvb,
6340         saved_offset, asn1->offset - saved_offset,
6341         "ESN 0x%04x",
6342         value);
6343
6344     sprintf(add_string, " - 0x%04x", value);
6345 }
6346
6347 static void
6348 param_sms_noti(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6349 {
6350     gint32 value;
6351     guint saved_offset;
6352     gchar *str = NULL;
6353
6354     add_string = add_string;
6355     saved_offset = asn1->offset;
6356
6357     asn1_int32_value_decode(asn1, 1, &value);
6358
6359     switch (value)
6360     {
6361     case 0: str = "Not used"; break;
6362     case 1: str = "Notify when available"; break;
6363     case 2: str = "Do not notify when available"; break;
6364     default:
6365         if ((value >= 3) && (value <= 127)) { str = "Reserved, treat as Notify when available"; }
6366         else if ((value >= 128) && (value <= 223)) { str = "Reserved, treat as Do not notify when available"; }
6367         else { str = "Reserved for protocol extension"; }
6368         break;
6369     }
6370
6371     proto_tree_add_text(tree, asn1->tvb,
6372         saved_offset, asn1->offset - saved_offset,
6373         "%s (%u)",
6374         str,
6375         value);
6376
6377     EXTRANEOUS_DATA_CHECK(len, 1);
6378 }
6379
6380 static void
6381 param_sms_orig_restric(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6382 {
6383     gint32 value;
6384     guint saved_offset;
6385     gchar *str = NULL;
6386
6387     add_string = add_string;
6388     saved_offset = asn1->offset;
6389
6390     asn1_int32_value_decode(asn1, 1, &value);
6391
6392     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
6393     proto_tree_add_text(tree, asn1->tvb,
6394         saved_offset, asn1->offset - saved_offset,
6395         "%s :  Reserved",
6396         bigbuf);
6397
6398     switch (value & 0x08)
6399     {
6400     case 0x00: str = "No effect"; break;
6401     default:
6402         str = "Force indirect";
6403         break;
6404     }
6405
6406     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
6407     proto_tree_add_text(tree, asn1->tvb,
6408         saved_offset, asn1->offset - saved_offset,
6409         "%s :  Force Message Center, %s",
6410         bigbuf, str);
6411
6412     switch (value & 0x04)
6413     {
6414     case 0x00: str = "Block direct"; break;
6415     default:
6416         str = "Allow direct";
6417         break;
6418     }
6419
6420     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
6421     proto_tree_add_text(tree, asn1->tvb,
6422         saved_offset, asn1->offset - saved_offset,
6423         "%s :  DIRECT, %s",
6424         bigbuf, str);
6425
6426     switch (value & 0x03)
6427     {
6428     case 0x00: str = "Block all"; break;
6429     case 0x02: str = "Allow specific"; break;
6430     case 0x03: str = "Allow all"; break;
6431     default:
6432         str = "Reserved";
6433         break;
6434     }
6435
6436     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
6437     proto_tree_add_text(tree, asn1->tvb,
6438         saved_offset, asn1->offset - saved_offset,
6439         "%s :  DEFAULT, %s",
6440         bigbuf, str);
6441
6442     EXTRANEOUS_DATA_CHECK(len, 1);
6443 }
6444
6445 static void
6446 param_seizure(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6447 {
6448     gint32 value;
6449     guint saved_offset;
6450     gchar *str = NULL;
6451
6452     add_string = add_string;
6453     saved_offset = asn1->offset;
6454
6455     asn1_int32_value_decode(asn1, 1, &value);
6456
6457     switch (value)
6458     {
6459     case 0: str = "Unspecified"; break;
6460     case 1: str = "Loopback"; break;
6461     default:
6462         if ((value >= 2) && (value <= 223)) { str = "Reserved"; }
6463         else { str = "Reserved for protocol extension"; }
6464         break;
6465     }
6466
6467     proto_tree_add_text(tree, asn1->tvb,
6468         saved_offset, asn1->offset - saved_offset,
6469         str);
6470
6471     EXTRANEOUS_DATA_CHECK(len, 1);
6472 }
6473
6474 static void
6475 param_sms_tele(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6476 {
6477     gint32 value;
6478     guint saved_offset;
6479     gchar *str = NULL;
6480
6481     ansi_map_sms_tele_id = -1;
6482
6483     SHORT_DATA_CHECK(len, 2);
6484
6485     add_string = add_string;
6486     saved_offset = asn1->offset;
6487
6488     asn1_int32_value_decode(asn1, 2, &value);
6489
6490     str = match_strval(value, ansi_tele_strings);
6491     if (str == NULL)
6492     {
6493         switch (value)
6494         {
6495         case 0: str = "Not used"; break;
6496         default:
6497             if ((value >= 2) && (value <= 4095)) { str = "Reserved for assignment by TIA/EIA-41"; }
6498             else if ((value >= 4100) && (value <= 32512)) { str = "Reserved for assignment by TIA/EIA-41"; }
6499             else if ((value >= 32514) && (value <= 32639)) { str = "Reserved for assignment by this Standard for TDMA MS-based SMEs."; }
6500             else if ((value >= 32640) && (value <= 32767)) { str = "Reserved for carrier specific teleservices for TDMA MS-based SMEs."; }
6501             else if ((value >= 32768) && (value <= 49151)) { str = "Reserved for node specific teleservices."; }
6502             else if ((value >= 49152) && (value <= 65535)) { str = "Reserved for carrier specific teleservices."; }
6503             else { str = "Unknown teleservice ID"; }
6504             break;
6505         }
6506     }
6507
6508     ansi_map_sms_tele_id = value;
6509
6510     proto_tree_add_text(tree, asn1->tvb,
6511         saved_offset, asn1->offset - saved_offset,
6512         "%s (%u)",
6513         str,
6514         value);
6515
6516     EXTRANEOUS_DATA_CHECK(len, 2);
6517 }
6518
6519 static void
6520 param_sms_term_restric(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6521 {
6522     gint32 value;
6523     guint saved_offset;
6524     gchar *str = NULL;
6525
6526     add_string = add_string;
6527     saved_offset = asn1->offset;
6528
6529     asn1_int32_value_decode(asn1, 1, &value);
6530
6531     other_decode_bitfield_value(bigbuf, value, 0xf8, 8);
6532     proto_tree_add_text(tree, asn1->tvb,
6533         saved_offset, asn1->offset - saved_offset,
6534         "%s :  Reserved",
6535         bigbuf);
6536
6537     switch (value & 0x04)
6538     {
6539     case 0x00: str = "Block messages charged to destination"; break;
6540     default:
6541         str = "Allow messages charged to destination";
6542         break;
6543     }
6544
6545     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
6546     proto_tree_add_text(tree, asn1->tvb,
6547         saved_offset, asn1->offset - saved_offset,
6548         "%s :  Reverse Charges, %s",
6549         bigbuf, str);
6550
6551     switch (value & 0x03)
6552     {
6553     case 0x00: str = "Block all"; break;
6554     case 0x02: str = "Allow specific"; break;
6555     case 0x03: str = "Allow all"; break;
6556     default:
6557         str = "Reserved";
6558         break;
6559     }
6560
6561     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
6562     proto_tree_add_text(tree, asn1->tvb,
6563         saved_offset, asn1->offset - saved_offset,
6564         "%s :  DEFAULT, %s",
6565         bigbuf, str);
6566
6567     EXTRANEOUS_DATA_CHECK(len, 1);
6568 }
6569
6570 static void
6571 param_sms_msg_count(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6572 {
6573     gint32 value;
6574     guint saved_offset;
6575     gchar *str = NULL;
6576
6577     add_string = add_string;
6578     saved_offset = asn1->offset;
6579
6580     asn1_int32_value_decode(asn1, 1, &value);
6581
6582     switch (value)
6583     {
6584     case 0: str = "No more pending SMS messages"; break;
6585     default:
6586         sprintf(bigbuf, "%u pending SMS messages", value);
6587         str = bigbuf;
6588         break;
6589     }
6590
6591     proto_tree_add_text(tree, asn1->tvb,
6592         saved_offset, asn1->offset - saved_offset,
6593         str);
6594
6595     EXTRANEOUS_DATA_CHECK(len, 1);
6596 }
6597
6598 static void
6599 param_qos_pri(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6600 {
6601     gint32 value, temp_int;
6602     guint saved_offset;
6603     gchar *str = NULL;
6604
6605     add_string = add_string;
6606     saved_offset = asn1->offset;
6607
6608     asn1_int32_value_decode(asn1, 1, &value);
6609
6610     temp_int = (value & 0xf0) >> 4;
6611     if ((temp_int < 0) || (temp_int >= (gint) NUM_QOS_PRI_STR))
6612     {
6613         str = "Reserved";
6614     }
6615     else
6616     {
6617         str = qos_pri_str[temp_int];
6618     }
6619
6620     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
6621     proto_tree_add_text(tree, asn1->tvb,
6622         saved_offset, asn1->offset - saved_offset,
6623         "%s :  Assured Priority, %s",
6624         bigbuf,
6625         str);
6626
6627     temp_int = value & 0x0f;
6628     if ((temp_int < 0) || (temp_int >= (gint) NUM_QOS_PRI_STR))
6629     {
6630         str = "Reserved";
6631     }
6632     else
6633     {
6634         str = qos_pri_str[temp_int];
6635     }
6636
6637     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
6638     proto_tree_add_text(tree, asn1->tvb,
6639         saved_offset, asn1->offset - saved_offset,
6640         "%s :  Non-Assured Priority, %s",
6641         bigbuf,
6642         str);
6643
6644     EXTRANEOUS_DATA_CHECK(len, 1);
6645 }
6646
6647 static void
6648 param_calling_party_cat(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6649 {
6650     gint32 value;
6651     guint saved_offset;
6652
6653     EXACT_DATA_CHECK(len, 1);
6654
6655     add_string = add_string;
6656     saved_offset = asn1->offset;
6657
6658     asn1_int32_value_decode(asn1, 1, &value);
6659
6660     proto_tree_add_text(tree, asn1->tvb,
6661         saved_offset, asn1->offset - saved_offset,
6662         "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");
6663 }
6664
6665 /*
6666  * Dissect IOS data parameters expected to be in TLV format
6667  */
6668 static void
6669 dissect_cdma2000_ios_data(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6670 {
6671     gint32      value;
6672     guint       num_elems;
6673     guchar      elem_len;
6674     guint32     orig_offset, saved_offset;
6675     proto_tree  *subtree;
6676     proto_item  *item;
6677     gchar       *str;
6678     gint        idx;
6679
6680     num_elems = 0;
6681     orig_offset = saved_offset = asn1->offset;
6682
6683     while ((saved_offset - orig_offset + 2) <= len)
6684     {
6685         num_elems++;
6686
6687         asn1_int32_value_decode(asn1, 1, &value);
6688         str = my_match_strval((guint32) value, ansi_a_ios401_elem_1_strings, &idx);
6689
6690         asn1_octet_decode(asn1, &elem_len);
6691
6692         item =
6693             proto_tree_add_text(tree,
6694                 asn1->tvb, saved_offset, elem_len + 2,
6695                 "IOS - %s",
6696                 str);
6697
6698         subtree = proto_item_add_subtree(item, ett_ansi_map_ios401_elem[idx]);
6699
6700         proto_tree_add_none_format(subtree, hf_ansi_map_ios401_elem_id, asn1->tvb,
6701             saved_offset, 1, "Element ID");
6702
6703         proto_tree_add_uint(subtree, hf_ansi_map_length, asn1->tvb,
6704             saved_offset + 1, 1, elem_len);
6705
6706         if (elem_len > 0)
6707         {
6708             proto_tree_add_text(subtree,
6709                 asn1->tvb, saved_offset + 2, elem_len,
6710                 "Element Value");
6711
6712             asn1->offset += elem_len;
6713         }
6714
6715         saved_offset += elem_len + 2;
6716     }
6717
6718     sprintf(add_string, " - (%u)", num_elems);
6719
6720     EXTRANEOUS_DATA_CHECK((len - (saved_offset - orig_offset)), 0);
6721 }
6722
6723 static void
6724 param_cdma2000_ho_ivk_ios(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6725 {
6726
6727     dissect_cdma2000_ios_data(asn1, tree, len, add_string);
6728 }
6729
6730 static void
6731 param_cdma2000_ho_rsp_ios(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6732 {
6733
6734     dissect_cdma2000_ios_data(asn1, tree, len, add_string);
6735 }
6736
6737 static void
6738 param_msid_usage(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6739 {
6740     gint32 value;
6741     guint saved_offset;
6742     gchar *str = NULL;
6743
6744     add_string = add_string;
6745     saved_offset = asn1->offset;
6746
6747     asn1_int32_value_decode(asn1, 1, &value);
6748
6749     other_decode_bitfield_value(bigbuf, value, 0xfc, 8);
6750     proto_tree_add_text(tree, asn1->tvb,
6751         saved_offset, asn1->offset - saved_offset,
6752         "%s :  Reserved",
6753         bigbuf);
6754
6755     switch (value & 0x03)
6756     {
6757     case 0: str = "Not used"; break;
6758     case 1: str = "MIN last used"; break;
6759     case 2: str = "IMSI last used"; break;
6760     case 3: str = "Reserved"; break;
6761     }
6762
6763     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
6764     proto_tree_add_text(tree, asn1->tvb,
6765         saved_offset, asn1->offset - saved_offset,
6766         "%s :  %s",
6767         bigbuf,
6768         str);
6769
6770     EXTRANEOUS_DATA_CHECK(len, 1);
6771 }
6772
6773 static void
6774 param_new_min_ext(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6775 {
6776     gint32 value;
6777     guint saved_offset;
6778     gchar *str = NULL;
6779
6780     EXACT_DATA_CHECK(len, 3);
6781
6782     add_string = add_string;
6783     saved_offset = asn1->offset;
6784
6785     asn1_int32_value_decode(asn1, 1, &value);
6786
6787     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
6788     proto_tree_add_text(tree, asn1->tvb,
6789         saved_offset, asn1->offset - saved_offset,
6790         "%s :  MCC_M (MSB), see CDMA",
6791         bigbuf);
6792
6793     other_decode_bitfield_value(bigbuf, value, 0x0e, 8);
6794     proto_tree_add_text(tree, asn1->tvb,
6795         saved_offset, asn1->offset - saved_offset,
6796         "%s :  IMSI_M_ADDR_NUM, see CDMA",
6797         bigbuf);
6798
6799     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
6800     proto_tree_add_text(tree, asn1->tvb,
6801         saved_offset, asn1->offset - saved_offset,
6802         "%s :  IMSI_M_CLASS, see CDMA",
6803         bigbuf);
6804
6805     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
6806     proto_tree_add_text(tree, asn1->tvb,
6807         saved_offset, asn1->offset - saved_offset,
6808         "%s :  %s",
6809         bigbuf,
6810         str);
6811
6812     bigbuf[0] = Dgt_tbcd.out[(value & 0xf0) >> 4];
6813
6814     saved_offset = asn1->offset;
6815
6816     asn1_int32_value_decode(asn1, 1, &value);
6817
6818     bigbuf[1] = Dgt_tbcd.out[value & 0x0f];
6819     bigbuf[2] = Dgt_tbcd.out[(value & 0xf0) >> 4];
6820     bigbuf[3] = '\0';
6821
6822     proto_tree_add_text(tree, asn1->tvb,
6823         saved_offset, asn1->offset - saved_offset,
6824         "MCC_M, %s, see CDMA",
6825         bigbuf);
6826
6827     saved_offset = asn1->offset;
6828
6829     asn1_int32_value_decode(asn1, 1, &value);
6830
6831     bigbuf[0] = Dgt_tbcd.out[value & 0x0f];
6832     bigbuf[1] = Dgt_tbcd.out[(value & 0xf0) >> 4];
6833     bigbuf[2] = '\0';
6834
6835     proto_tree_add_text(tree, asn1->tvb,
6836         saved_offset, asn1->offset - saved_offset,
6837         "IMSI_11_12, %s, see CDMA",
6838         bigbuf);
6839 }
6840
6841 static void
6842 param_dtx_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6843 {
6844     gint32 value;
6845     guint saved_offset;
6846     gchar *str = NULL;
6847
6848     add_string = add_string;
6849     saved_offset = asn1->offset;
6850
6851     asn1_int32_value_decode(asn1, 1, &value);
6852
6853     other_decode_bitfield_value(bigbuf, value, 0xfe, 8);
6854     proto_tree_add_text(tree, asn1->tvb,
6855         saved_offset, asn1->offset - saved_offset,
6856         "%s :  Reserved",
6857         bigbuf);
6858
6859     switch (value & 0x01)
6860     {
6861     case 0: str = "Discontinuous Transmission mode is not active"; break;
6862     case 1: str = "Discontinuous Transmission mode is active"; break;
6863     }
6864
6865     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
6866     proto_tree_add_text(tree, asn1->tvb,
6867         saved_offset, asn1->offset - saved_offset,
6868         "%s :  %s",
6869         bigbuf,
6870         str);
6871
6872     EXTRANEOUS_DATA_CHECK(len, 1);
6873 }
6874
6875 static void
6876 param_cdma_mob_cap(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6877 {
6878     gint32 value;
6879     guint saved_offset;
6880     gchar *str = NULL;
6881
6882     add_string = add_string;
6883     saved_offset = asn1->offset;
6884
6885     asn1_int32_value_decode(asn1, 1, &value);
6886
6887     other_decode_bitfield_value(bigbuf, value, 0xfe, 8);
6888     proto_tree_add_text(tree, asn1->tvb,
6889         saved_offset, asn1->offset - saved_offset,
6890         "%s :  Reserved",
6891         bigbuf);
6892
6893     switch (value & 0x01)
6894     {
6895     case 0: str = "No MS-initiated position determination"; break;
6896     case 1: str = "MS-initiated position determination"; break;
6897     }
6898
6899     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
6900     proto_tree_add_text(tree, asn1->tvb,
6901         saved_offset, asn1->offset - saved_offset,
6902         "%s :  %s",
6903         bigbuf,
6904         str);
6905
6906     EXTRANEOUS_DATA_CHECK(len, 1);
6907 }
6908
6909 static void
6910 param_gen_time(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6911 {
6912     gint32 value;
6913     gint32 h, m, s, ts;
6914     guint saved_offset;
6915
6916     SHORT_DATA_CHECK(len, 6);
6917
6918     add_string = add_string;
6919     saved_offset = asn1->offset;
6920
6921     asn1_int32_value_decode(asn1, 1, &value);
6922
6923     proto_tree_add_text(tree, asn1->tvb,
6924         saved_offset, asn1->offset - saved_offset,
6925         "Year-2000, %u",
6926         value);
6927
6928     saved_offset = asn1->offset;
6929
6930     asn1_int32_value_decode(asn1, 1, &value);
6931
6932     proto_tree_add_text(tree, asn1->tvb,
6933         saved_offset, asn1->offset - saved_offset,
6934         "Month, %u",
6935         value);
6936
6937     saved_offset = asn1->offset;
6938
6939     asn1_int32_value_decode(asn1, 1, &value);
6940
6941     proto_tree_add_text(tree, asn1->tvb,
6942         saved_offset, asn1->offset - saved_offset,
6943         "Day of month, %u",
6944         value);
6945
6946     saved_offset = asn1->offset;
6947
6948     asn1_int32_value_decode(asn1, 3, &value);
6949
6950     h = value / (3600 * 10);
6951     m = (value - (h * (3600 * 10))) / (60 * 10);
6952     s = (value - (h * (3600 * 10)) - (m * (60 * 10))) / 10;
6953     ts = (value - (h * (3600 * 10)) - (m * (60 * 10)) - (s * 10));
6954
6955     proto_tree_add_text(tree, asn1->tvb,
6956         saved_offset, asn1->offset - saved_offset,
6957         "Time of day (UTC) (in tenths of seconds - 1), %u (%u:%u:%u.%u)",
6958         value,
6959         h,
6960         m,
6961         s,
6962         ts);
6963
6964     EXTRANEOUS_DATA_CHECK(len, 6);
6965 }
6966
6967 static void
6968 param_geo_pos(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6969 {
6970     guint saved_offset;
6971
6972     add_string = add_string;
6973     saved_offset = asn1->offset;
6974
6975     proto_tree_add_text(tree, asn1->tvb,
6976         saved_offset, len,
6977         "Calling Geodetic Location (CGL), see T1.628 CallingGeodeticLocation TCAP parameter for encoding");
6978 }
6979
6980 static void
6981 param_mob_call_status(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
6982 {
6983     gint32 value, auth;
6984     guint saved_offset;
6985     gchar *str = NULL;
6986
6987     add_string = add_string;
6988     saved_offset = asn1->offset;
6989
6990     asn1_int32_value_decode(asn1, 1, &value);
6991
6992     auth = (value & 0xf0) >> 4;
6993     switch (auth)
6994     {
6995     case 0: str = "Authorization not performed"; break;
6996     case 1: str = "Authorization successful"; break;
6997     case 2: str = "Invalid Electronic Serial Number (ESN)"; break;
6998     case 3: str = "Unassigned Directory Number (DN)"; break;
6999     case 4: str = "Duplicate Unit"; break;
7000     case 5: str = "Delinquent Account"; break;
7001     case 6: str = "Stolen Unit"; break;
7002     case 7: str = "Not authorized for MSC"; break;
7003     case 8: str = "Unspecified"; break;
7004     default:
7005         str = "Reserved, treat as Authorization not performed";
7006         break;
7007     }
7008
7009     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
7010     proto_tree_add_text(tree, asn1->tvb,
7011         saved_offset, asn1->offset - saved_offset,
7012         "%s :  Authorization, %s",
7013         bigbuf,
7014         str);
7015
7016     auth = value & 0x0f;
7017     switch (auth)
7018     {
7019     case 0: str = "Authentication not performed. Authentication has not yet occurred or the MS is not capable of authentication"; break;
7020     case 1: str = "Authentication successful. Authentication has successfully occurred on the MS"; break;
7021     case 2: str = "Authentication failure. An authentication failure has occurred on the MS"; break;
7022     default:
7023         str = "Reserved, treat as Authentication not performed";
7024         break;
7025     }
7026
7027     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
7028     proto_tree_add_text(tree, asn1->tvb,
7029         saved_offset, asn1->offset - saved_offset,
7030         "%s :  Authentication, %s",
7031         bigbuf,
7032         str);
7033
7034     EXTRANEOUS_DATA_CHECK(len, 1);
7035 }
7036
7037 static void
7038 param_pos_req_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7039 {
7040     gint32 value;
7041     guint saved_offset;
7042     gchar *str = NULL;
7043
7044     add_string = add_string;
7045     saved_offset = asn1->offset;
7046
7047     asn1_int32_value_decode(asn1, 1, &value);
7048
7049     switch (value)
7050     {
7051     case 0: str = "Not used"; break;
7052     case 1: str = "Initial position. Return updated position only if initial position is unavailable."; break;
7053     case 2: str = "Return the updated position"; break;
7054     case 3: str = "Return the updated or last known position"; break;
7055     case 4: str = "Reserved for LSP interface. Treat as Not used"; break;
7056     default:
7057         if ((value >= 5) && (value <= 95)) { str = "Reserved, treat as Initial position"; }
7058         else { str = "Reserved for protocol extension, treat as Initial position"; }
7059         break;
7060     }
7061
7062     proto_tree_add_text(tree, asn1->tvb,
7063         saved_offset, asn1->offset - saved_offset,
7064         "Position Request Type, %s",
7065         str);
7066
7067     EXTRANEOUS_DATA_CHECK(len, 1);
7068 }
7069
7070 static void
7071 param_pos_result(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7072 {
7073     gint32 value;
7074     guint saved_offset;
7075     gchar *str = NULL;
7076
7077     add_string = add_string;
7078     saved_offset = asn1->offset;
7079
7080     asn1_int32_value_decode(asn1, 1, &value);
7081
7082     switch (value)
7083     {
7084     case 0: str = "Not used"; break;
7085     case 1: str = "Initial position returned"; break;
7086     case 2: str = "Updated position returned"; break;
7087     case 3: str = "Last known position returned"; break;
7088     case 4: str = "Requested position is not available"; break;
7089     case 5: str = "Caller disconnected. No call in progress for caller identified"; break;
7090     case 6: str = "Caller has handed-off. Position is unavailable due to a hand-off (e.g. handoff to a position incapable system)"; break;
7091     case 7: str = "Identified MS is inactive or has roamed to another system"; break;
7092     case 8: str = "Unresponsive"; break;
7093     case 9: str = "Identified MS is responsive, but refused position request"; break;
7094     case 10: str = "System Failure"; break;
7095     case 11: str = "MSID is not known"; break;
7096     case 12: str = "Callback number is not known"; break;
7097     case 13: str = "Improper request (e.g. invalid channel information, invalid ESN)"; break;
7098     case 14: str = "Mobile channel information returned"; break;
7099     case 15: str = "Signal not detected"; break;
7100     case 16: str = "PDE Timeout"; break;
7101     case 17: str = "Position pending"; break;
7102     case 18: str = "TDMA MAHO Information Returned"; break;
7103     case 19: str = "TDMA MAHO Information is not available"; break;
7104     default:
7105         if ((value >= 20) && (value <= 223)) { str = "Reserved, treat as Not used"; }
7106         else { str = "Reserved for protocol extension, treat as Not used"; }
7107         break;
7108     }
7109
7110     proto_tree_add_text(tree, asn1->tvb,
7111         saved_offset, asn1->offset - saved_offset,
7112         "Position Result, %s",
7113         str);
7114
7115     EXTRANEOUS_DATA_CHECK(len, 1);
7116 }
7117
7118 static void
7119 param_pos_source(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7120 {
7121     gint32 value;
7122     guint saved_offset;
7123     gchar *str = NULL;
7124
7125     add_string = add_string;
7126     saved_offset = asn1->offset;
7127
7128     asn1_int32_value_decode(asn1, 1, &value);
7129
7130     switch (value)
7131     {
7132     case 0: str = "Not used"; break;
7133     case 1: str = "Network Unspecified"; break;
7134     case 2: str = "Network AOA (Angle of Arrival)"; break;
7135     case 3: str = "Network TOA (Time of Arrival)"; break;
7136     case 4: str = "Network TDOA (Time Difference of Arrival)"; break;
7137     case 5: str = "Network RF Fingerprinting"; break;
7138     case 6: str = "Network Cell/Sector"; break;
7139     case 7: str = "Network Cell/Sector with Timing"; break;
7140     case 16: str = "Handset Unspecified"; break;
7141     case 17: str = "Handset GPS"; break;
7142     case 18: str = "Handset AGPS (Assisted GPS)"; break;
7143     case 19: str = "Handset EOTD (Enhanced Observed Time Difference)"; break;
7144     case 20: str = "Handset AFLT (Advanced Forward Link Trilateration)"; break;
7145     case 21: str = "Handset EFLT (Enhanced Forward Link Trilateration)"; break;
7146     default:
7147         if ((value >= 8) && (value <= 15)) { str = "Reserved, treat as Network Unspecified"; }
7148         else if ((value >= 22) && (value <= 31)) { str = "Reserved, treat as Handset Unspecified"; }
7149         else { str = "Reserved for protocol extension, treat as Not used"; }
7150         break;
7151     }
7152
7153     proto_tree_add_text(tree, asn1->tvb,
7154         saved_offset, asn1->offset - saved_offset,
7155         "Position Source, %s",
7156         str);
7157
7158     EXTRANEOUS_DATA_CHECK(len, 1);
7159 }
7160
7161 static void
7162 param_acg_encounter(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7163 {
7164     gint32 value;
7165     guint saved_offset;
7166     gchar *str = NULL;
7167
7168     EXACT_DATA_CHECK(len, 1);
7169
7170     add_string = add_string;
7171     saved_offset = asn1->offset;
7172
7173     asn1_int32_value_decode(asn1, 1, &value);
7174
7175     switch ((value & 0xc0) >> 6)
7176     {
7177     case 0: str = "Not used"; break;
7178     case 1: str = "Service Management System Initiated control encountered"; break;
7179     case 2: str = "SCF Overload control encountered"; break;
7180     case 3: str = "Reserved, treat as Not used"; break;
7181     }
7182
7183     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
7184     proto_tree_add_text(tree, asn1->tvb,
7185         saved_offset, asn1->offset - saved_offset,
7186         "%s :  Control Type, %s",
7187         bigbuf,
7188         str);
7189
7190     switch (value & 0x3f)
7191     {
7192     case 0: str = "PC_SSN"; break;
7193     case 1: str = "1-digit control"; break;
7194     case 2: str = "2-digit control"; break;
7195     case 3: str = "3-digit control"; break;
7196     case 4: str = "4-digit control"; break;
7197     case 5: str = "5-digit control"; break;
7198     case 6: str = "6-digit control"; break;
7199     case 7: str = "7-digit control"; break;
7200     case 8: str = "8-digit control"; break;
7201     case 9: str = "9-digit control"; break;
7202     case 10: str = "10-digit control"; break;
7203     case 11: str = "11-digit control"; break;
7204     case 12: str = "12-digit control"; break;
7205     case 13: str = "13-digit control"; break;
7206     case 14: str = "14-digit control"; break;
7207     case 15: str = "15-digit control"; break;
7208     default:
7209         str = "Reserved, treat as 15-digit control";
7210         break;
7211     }
7212
7213     other_decode_bitfield_value(bigbuf, value, 0x3f, 8);
7214     proto_tree_add_text(tree, asn1->tvb,
7215         saved_offset, asn1->offset - saved_offset,
7216         "%s :  %s",
7217         bigbuf,
7218         str);
7219 }
7220
7221 static void
7222 param_ctrl_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7223 {
7224     gint32 value;
7225     guint saved_offset;
7226     gchar *str = NULL;
7227
7228     EXACT_DATA_CHECK(len, 1);
7229
7230     add_string = add_string;
7231     saved_offset = asn1->offset;
7232
7233     asn1_int32_value_decode(asn1, 1, &value);
7234
7235     switch ((value & 0xc0) >> 6)
7236     {
7237     case 0: str = "Not used"; break;
7238     case 1: str = "Service Management System Initiated control"; break;
7239     case 2: str = "SCF Overload control"; break;
7240     case 3: str = "Reserved, treat as Not used"; break;
7241     }
7242
7243     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
7244     proto_tree_add_text(tree, asn1->tvb,
7245         saved_offset, asn1->offset - saved_offset,
7246         "%s :  Control Type, %s",
7247         bigbuf,
7248         str);
7249
7250     switch (value & 0x3f)
7251     {
7252     case 0: str = "PC_SSN"; break;
7253     case 1: str = "1-digit control"; break;
7254     case 2: str = "2-digit control"; break;
7255     case 3: str = "3-digit control"; break;
7256     case 4: str = "4-digit control"; break;
7257     case 5: str = "5-digit control"; break;
7258     case 6: str = "6-digit control"; break;
7259     case 7: str = "7-digit control"; break;
7260     case 8: str = "8-digit control"; break;
7261     case 9: str = "9-digit control"; break;
7262     case 10: str = "10-digit control"; break;
7263     case 11: str = "11-digit control"; break;
7264     case 12: str = "12-digit control"; break;
7265     case 13: str = "13-digit control"; break;
7266     case 14: str = "14-digit control"; break;
7267     case 15: str = "15-digit control"; break;
7268     default:
7269         str = "Reserved, treat as 15-digit control";
7270         break;
7271     }
7272
7273     other_decode_bitfield_value(bigbuf, value, 0x3f, 8);
7274     proto_tree_add_text(tree, asn1->tvb,
7275         saved_offset, asn1->offset - saved_offset,
7276         "%s :  %s",
7277         bigbuf,
7278         str);
7279 }
7280
7281 static void
7282 param_gap_duration(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7283 {
7284     gint32 value;
7285     guint saved_offset;
7286     gchar *str = NULL;
7287
7288     EXACT_DATA_CHECK(len, 1);
7289
7290     add_string = add_string;
7291     saved_offset = asn1->offset;
7292
7293     asn1_int32_value_decode(asn1, 1, &value);
7294
7295     switch (value)
7296     {
7297     case 0: str = "Not used"; break;
7298     case 1: str = "1 second"; break;
7299     case 2: str = "2 seconds"; break;
7300     case 3: str = "4 seconds"; break;
7301     case 4: str = "8 seconds"; break;
7302     case 5: str = "16 seconds"; break;
7303     case 6: str = "32 seconds"; break;
7304     case 7: str = "64 seconds"; break;
7305     case 8: str = "128 seconds"; break;
7306     case 9: str = "256 seconds"; break;
7307     case 10: str = "512 seconds"; break;
7308     case 11: str = "1024 seconds"; break;
7309     case 12: str = "2048 seconds"; break;
7310     case 13: str = "Infinity"; break;
7311     default:
7312         str = "Reserved, treat as Not used";
7313         break;
7314     }
7315
7316     proto_tree_add_text(tree, asn1->tvb,
7317         saved_offset, asn1->offset - saved_offset,
7318         str);
7319 }
7320
7321 static void
7322 param_scf_overload_gap_int(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7323 {
7324     gint32 value;
7325     guint saved_offset;
7326     gchar *str = NULL;
7327
7328     EXACT_DATA_CHECK(len, 1);
7329
7330     add_string = add_string;
7331     saved_offset = asn1->offset;
7332
7333     asn1_int32_value_decode(asn1, 1, &value);
7334
7335     switch (value)
7336     {
7337     case 0: str = "0 seconds"; break;
7338     case 1: str = "3 seconds"; break;
7339     case 2: str = "4 seconds"; break;
7340     case 3: str = "6 seconds"; break;
7341     case 4: str = "8 seconds"; break;
7342     case 5: str = "11 seconds"; break;
7343     case 6: str = "16 seconds"; break;
7344     case 7: str = "22 seconds"; break;
7345     case 8: str = "30 seconds"; break;
7346     case 9: str = "42 seconds"; break;
7347     case 10: str = "58 seconds"; break;
7348     case 11: str = "81 seconds"; break;
7349     case 12: str = "112 seconds"; break;
7350     case 13: str = "156 seconds"; break;
7351     case 14: str = "217 seconds"; break;
7352     case 15: str = "300 seconds"; break;
7353     case 16: str = "Remove gap control"; break;
7354     case 17: str = "0.10 seconds"; break;
7355     case 18: str = "0.25 seconds"; break;
7356     case 19: str = "0.5 seconds"; break;
7357     case 20: str = "1 second"; break;
7358     case 21: str = "2 seconds"; break;
7359     default:
7360         str = "Reserved, treat as 0 seconds";
7361         break;
7362     }
7363
7364     proto_tree_add_text(tree, asn1->tvb,
7365         saved_offset, asn1->offset - saved_offset,
7366         str);
7367 }
7368
7369 static void
7370 param_tdma_time_align(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7371 {
7372     gint32 value;
7373     guint saved_offset;
7374
7375     add_string = add_string;
7376     saved_offset = asn1->offset;
7377
7378     asn1_int32_value_decode(asn1, 1, &value);
7379
7380     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
7381     proto_tree_add_text(tree, asn1->tvb,
7382         saved_offset, asn1->offset - saved_offset,
7383         "%s :  Reserved",
7384         bigbuf);
7385
7386
7387     other_decode_bitfield_value(bigbuf, value, 0x1f, 8);
7388     proto_tree_add_text(tree, asn1->tvb,
7389         saved_offset, asn1->offset - saved_offset,
7390         "%s :  Time Alignment Offset (TA), %u",
7391         bigbuf,
7392         value & 0x1f);
7393
7394     EXTRANEOUS_DATA_CHECK(len, 1);
7395 }
7396
7397 static void
7398 dump_rssi(ASN1_SCK *asn1, proto_tree *tree, gchar *leader)
7399 {
7400     gint32 value;
7401     guint saved_offset;
7402     gchar *str = NULL;
7403
7404     saved_offset = asn1->offset;
7405
7406     asn1_int32_value_decode(asn1, 1, &value);
7407
7408     switch ((value & 0xc0) >> 6)
7409     {
7410     case 0: str = "800 MHz"; break;
7411     case 1: str = "1900 MHz"; break;
7412     default:
7413         str = "Reserved";
7414         break;
7415     }
7416
7417     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
7418     proto_tree_add_text(tree, asn1->tvb,
7419         saved_offset, asn1->offset - saved_offset,
7420         "%s :  %sHyper, %s",
7421         bigbuf,
7422         leader,
7423         str);
7424
7425     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
7426     proto_tree_add_text(tree, asn1->tvb,
7427         saved_offset, asn1->offset - saved_offset,
7428         "%s :  Reserved",
7429         bigbuf);
7430
7431     other_decode_bitfield_value(bigbuf, value, 0x1f, 8);
7432     proto_tree_add_text(tree, asn1->tvb,
7433         saved_offset, asn1->offset - saved_offset,
7434         "%s :  %sRSSI, %u",
7435         bigbuf,
7436         leader,
7437         value & 0x1f);
7438 }
7439
7440 static void
7441 param_tdma_maho_cell_id(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7442 {
7443     gint32 value, num_rssi, num_msc;
7444     guint saved_offset, orig_offset;
7445     gint32 i, j;
7446
7447     SHORT_DATA_CHECK(len, 3);
7448
7449     orig_offset = asn1->offset;
7450
7451     dump_rssi(asn1, tree, "Serving Cell ");
7452
7453     saved_offset = asn1->offset;
7454
7455     asn1_int32_value_decode(asn1, 1, &num_rssi);
7456
7457     proto_tree_add_text(tree, asn1->tvb,
7458         saved_offset, asn1->offset - saved_offset,
7459         "Number of RSSI %u",
7460         num_rssi);
7461
7462     for (i = 0; i < num_rssi; i++)
7463     {
7464         if ((len - (asn1->offset - orig_offset)) < 3)
7465         {
7466             proto_tree_add_text(tree, asn1->tvb,
7467                 asn1->offset, len - (asn1->offset - orig_offset),
7468                 "Short Data (?)");
7469
7470             asn1->offset += len - (asn1->offset - orig_offset);
7471             return;
7472         }
7473
7474         dump_rssi(asn1, tree, "");
7475
7476         saved_offset = asn1->offset;
7477
7478         asn1_int32_value_decode(asn1, 2, &value);
7479
7480         proto_tree_add_text(tree, asn1->tvb,
7481             saved_offset, asn1->offset - saved_offset,
7482             "Measured Cell ID %u",
7483             value);
7484     }
7485
7486     saved_offset = asn1->offset;
7487
7488     asn1_int32_value_decode(asn1, 1, &num_msc);
7489
7490     proto_tree_add_text(tree, asn1->tvb,
7491         saved_offset, asn1->offset - saved_offset,
7492         "Number of MSC %u",
7493         num_msc);
7494
7495     for (i = 0; i < num_msc; i++)
7496     {
7497         if ((len - (asn1->offset - orig_offset)) < 4)
7498         {
7499             proto_tree_add_text(tree, asn1->tvb,
7500                 asn1->offset, len - (asn1->offset - orig_offset),
7501                 "Short Data (?)");
7502
7503             asn1->offset += len - (asn1->offset - orig_offset);
7504             return;
7505         }
7506
7507         param_mscid(asn1, tree, 3, add_string);
7508
7509         saved_offset = asn1->offset;
7510
7511         asn1_int32_value_decode(asn1, 1, &num_rssi);
7512
7513         proto_tree_add_text(tree, asn1->tvb,
7514             saved_offset, asn1->offset - saved_offset,
7515             "Number of RSSI %u",
7516             num_rssi);
7517
7518         for (j = 0; j < num_rssi; j++)
7519         {
7520             if ((len - (asn1->offset - orig_offset)) < 3)
7521             {
7522                 proto_tree_add_text(tree, asn1->tvb,
7523                     asn1->offset, len - (asn1->offset - orig_offset),
7524                     "Short Data (?)");
7525
7526                 asn1->offset += len - (asn1->offset - orig_offset);
7527                 return;
7528             }
7529
7530             dump_rssi(asn1, tree, "");
7531
7532             saved_offset = asn1->offset;
7533
7534             asn1_int32_value_decode(asn1, 2, &value);
7535
7536             proto_tree_add_text(tree, asn1->tvb,
7537                 saved_offset, asn1->offset - saved_offset,
7538                 "Measured Cell ID %u",
7539                 value);
7540         }
7541     }
7542
7543     EXTRANEOUS_DATA_CHECK((len - (asn1->offset - orig_offset)), 0);
7544 }
7545
7546 static void
7547 param_tdma_maho_chan(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7548 {
7549     gint32 value, num_rssi, num_msc;
7550     guint saved_offset, orig_offset;
7551     gint32 i, j;
7552
7553     SHORT_DATA_CHECK(len, 3);
7554
7555     orig_offset = asn1->offset;
7556
7557     dump_rssi(asn1, tree, "Serving Cell ");
7558
7559     saved_offset = asn1->offset;
7560
7561     asn1_int32_value_decode(asn1, 1, &num_rssi);
7562
7563     proto_tree_add_text(tree, asn1->tvb,
7564         saved_offset, asn1->offset - saved_offset,
7565         "Number of RSSI %u",
7566         num_rssi);
7567
7568     for (i = 0; i < num_rssi; i++)
7569     {
7570         if ((len - (asn1->offset - orig_offset)) < 3)
7571         {
7572             proto_tree_add_text(tree, asn1->tvb,
7573                 asn1->offset, len - (asn1->offset - orig_offset),
7574                 "Short Data (?)");
7575
7576             asn1->offset += len - (asn1->offset - orig_offset);
7577             return;
7578         }
7579
7580         dump_rssi(asn1, tree, "");
7581
7582         saved_offset = asn1->offset;
7583
7584         asn1_int32_value_decode(asn1, 2, &value);
7585
7586         other_decode_bitfield_value(bigbuf, value >> 8, 0xff, 8);
7587         proto_tree_add_text(tree, asn1->tvb,
7588             saved_offset, 1,
7589             "%s :  Measured Channel (MSB), %u",
7590             bigbuf,
7591             (value & 0xffe0) >> 5);
7592
7593         other_decode_bitfield_value(bigbuf, value & 0xff, 0xe0, 8);
7594         proto_tree_add_text(tree, asn1->tvb,
7595             saved_offset+1, 1,
7596             "%s :  Measured Channel (LSB)",
7597             bigbuf);
7598     }
7599
7600     saved_offset = asn1->offset;
7601
7602     asn1_int32_value_decode(asn1, 1, &num_msc);
7603
7604     proto_tree_add_text(tree, asn1->tvb,
7605         saved_offset, asn1->offset - saved_offset,
7606         "Number of MSC %u",
7607         num_msc);
7608
7609     for (i = 0; i < num_msc; i++)
7610     {
7611         if ((len - (asn1->offset - orig_offset)) < 4)
7612         {
7613             proto_tree_add_text(tree, asn1->tvb,
7614                 asn1->offset, len - (asn1->offset - orig_offset),
7615                 "Short Data (?)");
7616
7617             asn1->offset += len - (asn1->offset - orig_offset);
7618             return;
7619         }
7620
7621         param_mscid(asn1, tree, 3, add_string);
7622
7623         saved_offset = asn1->offset;
7624
7625         asn1_int32_value_decode(asn1, 1, &num_rssi);
7626
7627         proto_tree_add_text(tree, asn1->tvb,
7628             saved_offset, asn1->offset - saved_offset,
7629             "Number of RSSI %u",
7630             num_rssi);
7631
7632         for (j = 0; j < num_rssi; j++)
7633         {
7634             if ((len - (asn1->offset - orig_offset)) < 3)
7635             {
7636                 proto_tree_add_text(tree, asn1->tvb,
7637                     asn1->offset, len - (asn1->offset - orig_offset),
7638                     "Short Data (?)");
7639
7640                 asn1->offset += len - (asn1->offset - orig_offset);
7641                 return;
7642             }
7643
7644             dump_rssi(asn1, tree, "");
7645
7646             saved_offset = asn1->offset;
7647
7648             asn1_int32_value_decode(asn1, 2, &value);
7649
7650             other_decode_bitfield_value(bigbuf, value >> 8, 0xff, 8);
7651             proto_tree_add_text(tree, asn1->tvb,
7652                 saved_offset, 1,
7653                 "%s :  Measured Channel (MSB), %u",
7654                 bigbuf,
7655                 (value & 0xffe0) >> 5);
7656
7657             other_decode_bitfield_value(bigbuf, value & 0xff, 0xe0, 8);
7658             proto_tree_add_text(tree, asn1->tvb,
7659                 saved_offset+1, 1,
7660                 "%s :  Measured Channel (LSB)",
7661                 bigbuf);
7662         }
7663     }
7664
7665     EXTRANEOUS_DATA_CHECK((len - (asn1->offset - orig_offset)), 0);
7666 }
7667
7668 static void
7669 param_tdma_maho_req(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7670 {
7671     gint32 value;
7672     guint saved_offset;
7673     gchar *str = NULL;
7674
7675     EXACT_DATA_CHECK(len, 1);
7676
7677     add_string = add_string;
7678     saved_offset = asn1->offset;
7679
7680     asn1_int32_value_decode(asn1, 1, &value);
7681
7682     switch (value)
7683     {
7684     case 0: str = "No MAHO information requested"; break;
7685     case 1: str = "MAHO information requested"; break;
7686     default:
7687         str = "Reserved, treat as No MAHO information requested";
7688         break;
7689     }
7690
7691     proto_tree_add_text(tree, asn1->tvb,
7692         saved_offset, asn1->offset - saved_offset,
7693         str);
7694 }
7695
7696 static void
7697 param_sm_gap_int(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7698 {
7699     gint32 value;
7700     guint saved_offset;
7701     gchar *str = NULL;
7702
7703     EXACT_DATA_CHECK(len, 1);
7704
7705     add_string = add_string;
7706     saved_offset = asn1->offset;
7707
7708     asn1_int32_value_decode(asn1, 1, &value);
7709
7710     switch (value)
7711     {
7712     case 0: str = "Remove gap control"; break;
7713     case 1: str = "0 seconds"; break;
7714     case 2: str = "0.10 seconds"; break;
7715     case 3: str = "0.25 seconds"; break;
7716     case 4: str = "0.50 seconds"; break;
7717     case 5: str = "1 second"; break;
7718     case 6: str = "2 seconds"; break;
7719     case 7: str = "5 seconds"; break;
7720     case 8: str = "10 seconds"; break;
7721     case 9: str = "15 seconds"; break;
7722     case 10: str = "30 seconds"; break;
7723     case 11: str = "60 seconds"; break;
7724     case 12: str = "120 seconds"; break;
7725     case 13: str = "300 seconds"; break;
7726     case 14: str = "600 seconds"; break;
7727     case 15: str = "Stop all queries"; break;
7728     default:
7729         str = "Reserved, treat as Remove gap control";
7730         break;
7731     }
7732
7733     proto_tree_add_text(tree, asn1->tvb,
7734         saved_offset, asn1->offset - saved_offset,
7735         str);
7736 }
7737
7738 static void
7739 param_mob_cap(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7740 {
7741     gint32 value;
7742     guint saved_offset, i;
7743     gchar *str = NULL;
7744
7745     add_string = add_string;
7746
7747     for (i=0; i < len; i++)
7748     {
7749         saved_offset = asn1->offset;
7750
7751         asn1_int32_value_decode(asn1, 1, &value);
7752
7753         switch (value)
7754         {
7755         case 0: str = "Undefined Mobile Position Capabilities"; break;
7756         case 1: str = "CDMA None"; break;
7757         case 2: str = "CDMA Pilot Phase + GPS - MS shall be capable of supporting A-FLT and GPS for position determination"; break;
7758         case 3: str = "CDMA Pilot Phase Only - MS shall be capable of supporting A-FLT only for position determination"; break;
7759         case 4: str = "CDMA GPS Only - MS shall be capable of supporting GPS only for position determination"; break;
7760         case 51: str = "TDMA None. See TIA/EIA-136-740"; break;
7761         case 52: str = "TDMA MS-Based with Network Assistance SAMPS Supported. See TIA/EIA-136-740"; break;
7762         case 53: str = "TDMA MS-Assisted SAMPS Supported. See TIA/EIA-136-740"; break;
7763         case 54: str = "TDMA SAMPS Time Measurement Capability Supported. See TIA/EIA-136-740"; break;
7764         case 55: str = "TDMA MS-Based Stand-alone SAMPS Supported. See TIA/EIA-136-740"; break;
7765         case 101: str = "AMPS None"; break;
7766         case 102: str = "AMPS MS-based - MS shall be capable of autonomously determining the position without assistance from the network"; break;
7767         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;
7768         default:
7769             if ((value >= 5) && (value <= 50)) { str = "Reserved for CDMA, treat as CDMA None"; }
7770             else if ((value >= 56) && (value <= 100)) { str = "Reserved for TDMA, treat as TDMA None"; }
7771             else if ((value >= 104) && (value <= 150)) { str = "Reserved for AMPS, treat as AMPS None"; }
7772             else if ((value >= 151) && (value <= 223)) { str = "Reserved, treat as Undefined"; }
7773             else { str = "Reserved for protocol extension, treat as Undefined"; }
7774             break;
7775         }
7776
7777         proto_tree_add_text(tree, asn1->tvb,
7778             saved_offset, asn1->offset - saved_offset,
7779             "Mobile Position Capability, %s",
7780             str);
7781     }
7782 }
7783
7784 static void
7785 param_cdma_psmm_count(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7786 {
7787     gint32 value;
7788     guint saved_offset;
7789
7790     EXACT_DATA_CHECK(len, 1);
7791
7792     add_string = add_string;
7793     saved_offset = asn1->offset;
7794
7795     asn1_int32_value_decode(asn1, 1, &value);
7796
7797     proto_tree_add_text(tree, asn1->tvb,
7798         saved_offset, asn1->offset - saved_offset,
7799         "Number of CDMA Pilot Strength Measurements to return, %u",
7800         value);
7801 }
7802
7803 static void
7804 param_cdma_sowd2(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7805 {
7806     gint32 value;
7807     guint saved_offset;
7808     gchar *str = NULL;
7809
7810     SHORT_DATA_CHECK(len, 5);
7811
7812     add_string = add_string;
7813     saved_offset = asn1->offset;
7814
7815     asn1_int32_value_decode(asn1, 2, &value);
7816
7817     proto_tree_add_text(tree, asn1->tvb,
7818         saved_offset, asn1->offset - saved_offset,
7819         "CDMA Serving One Way Delay, %u",
7820         value);
7821
7822     saved_offset = asn1->offset;
7823
7824     asn1_int32_value_decode(asn1, 1, &value);
7825
7826     other_decode_bitfield_value(bigbuf, value, 0xfc, 8);
7827     proto_tree_add_text(tree, asn1->tvb,
7828         saved_offset, asn1->offset - saved_offset,
7829         "%s :  Reserved",
7830         bigbuf);
7831
7832     switch (value & 0x03)
7833     {
7834     case 0: str = "100 nsec"; break;
7835     case 1: str = "50 nsec"; break;
7836     case 2: str = "1/16 CDMA PN Chip"; break;
7837     case 3: str = "Reserved"; break;
7838     }
7839
7840     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
7841     proto_tree_add_text(tree, asn1->tvb,
7842         saved_offset, asn1->offset - saved_offset,
7843         "%s :  Resolution, %s",
7844         bigbuf,
7845         str);
7846
7847     saved_offset = asn1->offset;
7848
7849     asn1_int32_value_decode(asn1, 2, &value);
7850
7851     proto_tree_add_text(tree, asn1->tvb,
7852         saved_offset, asn1->offset - saved_offset,
7853         "Serving One Way Delay TimeStamp, %u",
7854         value);
7855
7856     EXTRANEOUS_DATA_CHECK(len, 5);
7857 }
7858
7859 static void
7860 param_sms_charge_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7861 {
7862     gint32 value;
7863     guint saved_offset;
7864     gchar *str = NULL;
7865
7866     add_string = add_string;
7867     saved_offset = asn1->offset;
7868
7869     asn1_int32_value_decode(asn1, 1, &value);
7870
7871     switch (value)
7872     {
7873     case 0: str = "Not used"; break;
7874     case 1: str = "No charge"; break;
7875     case 2: str = "Charge original originator"; break;
7876     case 3: str = "Charge original destination"; break;
7877     default:
7878         str = "Reserved";
7879         break;
7880     }
7881
7882     proto_tree_add_text(tree, asn1->tvb,
7883         saved_offset, asn1->offset - saved_offset,
7884         "Charge %u, %s",
7885         value,
7886         str);
7887
7888     EXTRANEOUS_DATA_CHECK(len, 1);
7889 }
7890
7891 static void
7892 param_auth_per(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7893 {
7894     gint32 value;
7895     guint saved_offset;
7896     gchar *str = NULL;
7897
7898     EXACT_DATA_CHECK(len, 2);
7899
7900     add_string = add_string;
7901     saved_offset = asn1->offset;
7902
7903     asn1_int32_value_decode(asn1, 1, &value);
7904
7905     switch (value)
7906     {
7907     case 0: str = "Not used"; break;
7908     case 1: str = "Per call"; break;
7909     case 2: str = "Hours"; break;
7910     case 3: str = "Days"; break;
7911     case 4: str = "Weeks"; break;
7912     case 5: str = "Per agreement"; break;
7913     case 6: str = "Indefinite"; break;
7914     case 7: str = "Number of calls"; break;
7915     default:
7916         if ((value >= 8) && (value <= 223)) { str = "Reserved, treat as Per call"; }
7917         else { str = "Reserved for protocol extension, treat as Per call"; }
7918         break;
7919     }
7920
7921     proto_tree_add_text(tree, asn1->tvb,
7922         saved_offset, asn1->offset - saved_offset,
7923         "Period (%u) %s",
7924         value,
7925         str);
7926
7927     saved_offset = asn1->offset;
7928
7929     asn1_int32_value_decode(asn1, 1, &value);
7930
7931     proto_tree_add_text(tree, asn1->tvb,
7932         saved_offset, asn1->offset - saved_offset,
7933         "Value %u",
7934         value);
7935 }
7936
7937 static void
7938 param_ctrl_chan_mode(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7939 {
7940     gint32 value;
7941     guint saved_offset;
7942     gchar *str = NULL;
7943
7944     add_string = add_string;
7945     saved_offset = asn1->offset;
7946
7947     asn1_int32_value_decode(asn1, 1, &value);
7948
7949     switch (value)
7950     {
7951     case 0: str = "Unknown"; break;
7952     case 1: str = "MS is in Analog CC Mode"; break;
7953     case 2: str = "MS is in Digital CC Mode"; break;
7954     case 3: str = "MS is in NAMPS CC Mode"; break;
7955     default:
7956         if ((value >= 4) && (value <= 223)) { str = "Reserved, treat as Unknown"; }
7957         else { str = "Reserved for protocol extension, treat as Unknown"; }
7958         break;
7959     }
7960
7961     proto_tree_add_text(tree, asn1->tvb,
7962         saved_offset, asn1->offset - saved_offset,
7963         str);
7964
7965     EXTRANEOUS_DATA_CHECK(len, 1);
7966 }
7967
7968 static void
7969 param_tdma_data_mode(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
7970 {
7971     gint32 value;
7972     guint saved_offset;
7973     gchar *str = NULL;
7974
7975     SHORT_DATA_CHECK(len, 2);
7976
7977     add_string = add_string;
7978     saved_offset = asn1->offset;
7979
7980     asn1_int32_value_decode(asn1, 1, &value);
7981
7982     switch ((value & 0xe0) >> 5)
7983     {
7984     case 0: str = "As per IS-135"; break;
7985     case 1: str = "As per FSVS - 211 (STU-III)"; break;
7986     default:
7987         str = "Reserved";
7988         break;
7989     }
7990
7991     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
7992     proto_tree_add_text(tree, asn1->tvb,
7993         saved_offset, asn1->offset - saved_offset,
7994         "%s :  Data Part, %s",
7995         bigbuf,
7996         str);
7997
7998     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
7999     proto_tree_add_text(tree, asn1->tvb,
8000         saved_offset, asn1->offset - saved_offset,
8001         "%s :  AD, %s",
8002         bigbuf,
8003         (value & 0x10) ? "unacknowledged data only" : "unacked data or both");
8004
8005     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
8006     proto_tree_add_text(tree, asn1->tvb,
8007         saved_offset, asn1->offset - saved_offset,
8008         "%s :  %s",
8009         bigbuf,
8010         (value & 0x08) ? "SAP 0 and 1" : "SAP 0 only");
8011
8012     switch (value & 0x07)
8013     {
8014     case 0: str = "No Data Privacy"; break;
8015     case 1: str = "Data Privacy Algorithm A"; break;
8016     default:
8017         str = "Reserved, treat as No Data Privacy";
8018         break;
8019     }
8020
8021     other_decode_bitfield_value(bigbuf, value, 0x07, 8);
8022     proto_tree_add_text(tree, asn1->tvb,
8023         saved_offset, asn1->offset - saved_offset,
8024         "%s :  Data Privacy Mode, %s",
8025         bigbuf,
8026         str);
8027
8028     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
8029     proto_tree_add_text(tree, asn1->tvb,
8030         saved_offset, asn1->offset - saved_offset,
8031         "%s :  Reserved",
8032         bigbuf);
8033
8034     switch ((value & 0x0c) >> 2)
8035     {
8036     case 0: str = "RLP1"; break;
8037     case 1: str = "RLP2"; break;
8038     default:
8039         str = "Reserved";
8040         break;
8041     }
8042
8043     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
8044     proto_tree_add_text(tree, asn1->tvb,
8045         saved_offset, asn1->offset - saved_offset,
8046         "%s :  %s",
8047         bigbuf,
8048         str);
8049
8050     switch (value & 0x03)
8051     {
8052     case 0: str = "16-bit Cyclic Redundancy Check"; break;
8053     case 1: str = "24-bit Cyclic Redundancy Check"; break;
8054     case 2: str = "No Cyclic Redundancy Check"; break;
8055     default:
8056         str = "Reserved";
8057         break;
8058     }
8059
8060     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
8061     proto_tree_add_text(tree, asn1->tvb,
8062         saved_offset, asn1->offset - saved_offset,
8063         "%s :  %s",
8064         bigbuf,
8065         str);
8066
8067     EXTRANEOUS_DATA_CHECK(len, 2);
8068 }
8069
8070 static void
8071 param_tdma_voice_mode(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8072 {
8073     gint32 value;
8074     guint saved_offset;
8075     gchar *str = NULL;
8076
8077     add_string = add_string;
8078     saved_offset = asn1->offset;
8079
8080     asn1_int32_value_decode(asn1, 1, &value);
8081
8082     switch ((value & 0xf0) >> 4)
8083     {
8084     case 0: str = "No Voice Privacy"; break;
8085     case 1: str = "Voice Privacy Algorithm A"; break;
8086     case 2: str = "Reserved, treat as No Voice Privacy"; break;
8087     case 3: str = "Reserved, treat as No Voice Privacy"; break;
8088     case 4: str = "Reserved for SOC/BMSC Specific signaling"; break;
8089     default:
8090         str = "Reserved, treat as No Voice Privacy";
8091         break;
8092     }
8093
8094     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
8095     proto_tree_add_text(tree, asn1->tvb,
8096         saved_offset, asn1->offset - saved_offset,
8097         "%s :  Voice Privacy Mode, %s",
8098         bigbuf,
8099         str);
8100
8101     switch (value & 0x0f)
8102     {
8103     case 0: str = "No Voice Coder"; break;
8104     case 1: str = "VSELP Voice Coder"; break;
8105     case 2: str = "IS-641 Voice Coder"; break;
8106     case 6: str = "Reserved for SOC/BMSC Specific signaling"; break;
8107     default:
8108         str = "Reserved, treat as No Voice Coder";
8109         break;
8110     }
8111
8112     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
8113     proto_tree_add_text(tree, asn1->tvb,
8114         saved_offset, asn1->offset - saved_offset,
8115         "%s :  Voice Coder, %s",
8116         bigbuf,
8117         str);
8118
8119     EXTRANEOUS_DATA_CHECK(len, 1);
8120 }
8121
8122 static void
8123 param_tdma_bandwidth(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8124 {
8125     gint32 value;
8126     guint saved_offset;
8127     gchar *str = NULL;
8128
8129     add_string = add_string;
8130     saved_offset = asn1->offset;
8131
8132     asn1_int32_value_decode(asn1, 1, &value);
8133
8134     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
8135     proto_tree_add_text(tree, asn1->tvb,
8136         saved_offset, asn1->offset - saved_offset,
8137         "%s :  Reserved",
8138         bigbuf);
8139
8140     switch (value & 0x0f)
8141     {
8142     case 0: str = "Half-Rate Digital Traffic Channel Only"; break;
8143     case 1: str = "Full-Rate Digital Traffic Channel Only"; break;
8144     case 2: str = "Half-Rate or Full-rate Digital Traffic Channel - Full-Rate Preferred"; break;
8145     case 3: str = "Half-rate or Full-rate Digital Traffic Channel - Half-rate Preferred"; break;
8146     case 4: str = "Double Full-Rate Digital Traffic Channel Only"; break;
8147     case 5: str = "Triple Full-Rate Digital Traffic Channel Only"; break;
8148     default:
8149         str = "Reserved, treat as Full-Rate Digital Traffic Channel Only";
8150         break;
8151     }
8152
8153     other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
8154     proto_tree_add_text(tree, asn1->tvb,
8155         saved_offset, asn1->offset - saved_offset,
8156         "%s :  Bandwidth, %s",
8157         bigbuf,
8158         str);
8159
8160     EXTRANEOUS_DATA_CHECK(len, 1);
8161 }
8162
8163 static void
8164 param_change_srvc_attr(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8165 {
8166     gint32 value;
8167     guint saved_offset;
8168     gchar *str = NULL;
8169
8170     add_string = add_string;
8171     saved_offset = asn1->offset;
8172
8173     asn1_int32_value_decode(asn1, 1, &value);
8174
8175     other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
8176     proto_tree_add_text(tree, asn1->tvb,
8177         saved_offset, asn1->offset - saved_offset,
8178         "%s :  Reserved",
8179         bigbuf);
8180
8181     switch ((value & 0x0c) >> 2)
8182     {
8183     case 0: str = "Service Negotiation Used"; break;
8184     case 1: str = "Service Negotiation Not Used"; break;
8185     case 2: str = "Service Negotiation Required"; break;
8186     case 3: str = "Service Negotiation Not Required"; break;
8187     }
8188
8189     other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
8190     proto_tree_add_text(tree, asn1->tvb,
8191         saved_offset, asn1->offset - saved_offset,
8192         "%s :  Service Negotiate Flag (SRVNEG), %s",
8193         bigbuf,
8194         str);
8195
8196     switch (value & 0x03)
8197     {
8198     case 0 : str = "Change Facilities Operation Requested"; break;
8199     case 1 : str = "Change Facilities Operation Not Requested"; break;
8200     case 2 : str = "Change Facilities Operation Used"; break;
8201     case 3 : str = "Change Facilities Operation Not Used"; break;
8202     }
8203
8204     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
8205     proto_tree_add_text(tree, asn1->tvb,
8206         saved_offset, asn1->offset - saved_offset,
8207         "%s :  Change Facilities Flag (CHGFAC), %s",
8208         bigbuf,
8209         str);
8210
8211     EXTRANEOUS_DATA_CHECK(len, 1);
8212 }
8213
8214 static void
8215 param_dp_params(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8216 {
8217     gint32 value;
8218     guint saved_offset;
8219     gchar *str = NULL;
8220
8221     SHORT_DATA_CHECK(len, 4);
8222
8223     add_string = add_string;
8224     saved_offset = asn1->offset;
8225
8226     asn1_int32_value_decode(asn1, 1, &value);
8227
8228     other_decode_bitfield_value(bigbuf, value, 0xfc, 8);
8229     proto_tree_add_text(tree, asn1->tvb,
8230         saved_offset, asn1->offset - saved_offset,
8231         "%s :  Reserved",
8232         bigbuf);
8233
8234     switch (value & 0x03)
8235     {
8236     case 0: str = "Privacy inactive or not supported"; break;
8237     case 1: str = "Privacy Requested or Acknowledged"; break;
8238     default:
8239         str = "Reserved, treat as Privacy inactive or not supported";
8240         break;
8241     }
8242
8243     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
8244     proto_tree_add_text(tree, asn1->tvb,
8245         saved_offset, asn1->offset - saved_offset,
8246         "%s :  Privacy Mode, %s",
8247         bigbuf,
8248         str);
8249
8250     saved_offset = asn1->offset;
8251
8252     asn1_int32_value_decode(asn1, 1, &value);
8253
8254     switch (value)
8255     {
8256     case 0: str = "Not used"; break;
8257     case 1: str = "Data Privacy Version 1"; break;
8258     default:
8259         if ((value >= 2) && (value <= 223)) { str = "Reserved, treat as Not used"; }
8260         else { str = "Reserved for protocol extension, treat as Not used"; }
8261         break;
8262     }
8263
8264     proto_tree_add_text(tree, asn1->tvb,
8265         saved_offset, asn1->offset - saved_offset,
8266         "Data Privacy Version, %s",
8267         str);
8268
8269     saved_offset = asn1->offset;
8270
8271     proto_tree_add_text(tree, asn1->tvb,
8272         saved_offset, len - 2,
8273         "Data Privacy data");
8274
8275     asn1->offset += (len - 2);
8276 }
8277
8278 static void
8279 param_trn(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8280 {
8281     guint saved_offset;
8282     guchar *poctets;
8283
8284     add_string = add_string;
8285     saved_offset = asn1->offset;
8286
8287     asn1_string_value_decode(asn1, len, &poctets);
8288
8289     my_dgt_tbcd_unpack(bigbuf, poctets, len, &Dgt_msid);
8290     g_free(poctets);
8291
8292     proto_tree_add_text(tree, asn1->tvb,
8293         saved_offset, len, "TRN %s", bigbuf);
8294 }
8295
8296 static void
8297 param_islp_info(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8298 {
8299     gint32 value;
8300     guint saved_offset;
8301     gchar *str = NULL;
8302
8303     add_string = add_string;
8304     saved_offset = asn1->offset;
8305
8306     asn1_int32_value_decode(asn1, 1, &value);
8307
8308     switch (value)
8309     {
8310     case 0: str = "No ISLP supported"; break;
8311     case 1: str = "ISLP supported (see ISLP)"; break;
8312     default:
8313         if ((value >= 2) && (value <= 112)) { str = "Reserved, treat as No ISLP supported"; }
8314         else if ((value >= 113) && (value <= 223)) { str = "Reserved, treat as ISLP supported"; }
8315         else if ((value >= 224) && (value <= 240)) { str = "Reserved for protocol extension, treat as No ISLP supported"; }
8316         else { str = "Reserved for protocol extension, treat as ISLP supported"; }
8317         break;
8318     }
8319
8320     proto_tree_add_text(tree, asn1->tvb,
8321         saved_offset, asn1->offset - saved_offset,
8322         str);
8323
8324     EXTRANEOUS_DATA_CHECK(len, 1);
8325 }
8326
8327 static void
8328 param_ana_red_info(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8329 {
8330     gint32 value;
8331     guint saved_offset;
8332     gchar *str = NULL;
8333
8334     add_string = add_string;
8335     saved_offset = asn1->offset;
8336
8337     asn1_int32_value_decode(asn1, 1, &value);
8338
8339     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
8340     proto_tree_add_text(tree, asn1->tvb,
8341         saved_offset, asn1->offset - saved_offset,
8342         "%s :  Reserved",
8343         bigbuf);
8344
8345     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
8346     proto_tree_add_text(tree, asn1->tvb,
8347         saved_offset, asn1->offset - saved_offset,
8348         "%s :  Ignore CDMA, %s",
8349         bigbuf,
8350         (value & 0x20) ?  "Ignore the CDMA Capability Message on the analog system to which it is being redirected" :
8351             "Don't ignore the CDMA Capability Message on the analog system to which it is being redirected");
8352
8353     switch (value & 0x1f)
8354     {
8355     case 0: str = "Attempt to obtain service on either System A or B in accordance with the custom system selection process"; break;
8356     case 1: str = "Attempt to obtain service on System A only"; break;
8357     case 2: str = "Error in IS-735, text was unspecified but not reserved"; break;
8358     case 3: str = "Attempt to obtain service on System A first.  If unsuccessful, attempt to obtain service on System B"; break;
8359     case 4: str = "Attempt to obtain service on System B first.  If unsuccessful, attempt to obtain service on System A"; break;
8360     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;
8361
8362     default:
8363         str = "Reserved for protocol extension";
8364         break;
8365     }
8366
8367     other_decode_bitfield_value(bigbuf, value, 0x1f, 8);
8368     proto_tree_add_text(tree, asn1->tvb,
8369         saved_offset, asn1->offset - saved_offset,
8370         "%s :  Sys Ordering, %s",
8371         bigbuf,
8372         str);
8373
8374     EXTRANEOUS_DATA_CHECK(len, 1);
8375 }
8376
8377 static void
8378 param_reason_list(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8379 {
8380     gint32 value;
8381     gint i;
8382     guint saved_offset;
8383     gchar *str = NULL;
8384
8385     add_string = add_string;
8386     saved_offset = asn1->offset;
8387
8388     i = 0;
8389
8390     do
8391     {
8392         asn1_int32_value_decode(asn1, 1, &value);
8393
8394         switch (value)
8395         {
8396         case 0: str = "Unknown"; break;
8397         case 1: str = "Unable to configure ISLP"; break;
8398         case 2: str = "ISLP failure"; break;
8399         case 3: str = "Service allowed but facilities not available"; break;
8400         case 4: str = "Service not allowed"; break;
8401         case 5: str = "No Response to TMSI assignment"; break;
8402         case 6: str = "Required parameters unavailable. (e.g., as indicated by the RequiredParametersMask parameter)"; break;
8403         default:
8404             if ((value >= 7) && (value <= 110)) { str = "Reserved for common CDMA and TDMA network error causes. If unknown, treat as Unknown"; }
8405             else if ((value >= 111) && (value <= 127)) { str = "Reserved for common CDMA and TDMA network error causes for protocol extension. If unknown, treat as Unknown"; }
8406             else if ((value >= 128) && (value <= 174)) { str = "CDMA Specific error causes. If unknown, treat as Unknown"; }
8407             else if ((value >= 175) && (value <= 191)) { str = "CDMA Specific error causes for protocol extension. If unknown treat as Unknown"; }
8408             else if ((value >= 192) && (value <= 237)) { str = "TDMA Specific error causes as defined by the TDMACause parameter. If unknown treat as Unknown"; }
8409             else { str = "TDMA Specific error causes for protocol extension. If unknown, treat as Unknown"; }
8410             break;
8411         }
8412
8413         proto_tree_add_text(tree, asn1->tvb,
8414             saved_offset, asn1->offset - saved_offset,
8415             "[%u] %s",
8416             i++,
8417             str);
8418
8419         saved_offset = asn1->offset;
8420     }
8421     while ((len - i) > 0);
8422 }
8423
8424 static void
8425 param_imsi(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8426 {
8427     guint saved_offset;
8428     guchar *poctets;
8429
8430     add_string = add_string;
8431     saved_offset = asn1->offset;
8432     asn1_string_value_decode(asn1, len, &poctets);
8433
8434     my_dgt_tbcd_unpack(bigbuf, poctets, len, &Dgt_msid);
8435     g_free(poctets);
8436
8437     proto_tree_add_text(tree, asn1->tvb,
8438         saved_offset, len,
8439         "IMSI %s",
8440         bigbuf);
8441
8442     sprintf(add_string, " - %s", bigbuf);
8443 }
8444
8445 static void
8446 param_min(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8447 {
8448     guint saved_offset;
8449     guchar *poctets;
8450
8451     EXACT_DATA_CHECK(len, 5);
8452
8453     add_string = add_string;
8454     saved_offset = asn1->offset;
8455     asn1_string_value_decode(asn1, len, &poctets);
8456
8457     my_dgt_tbcd_unpack(bigbuf, poctets, len, &Dgt_msid);
8458     g_free(poctets);
8459
8460     proto_tree_add_text(tree, asn1->tvb,
8461         saved_offset, len,
8462         "MIN %s",
8463         bigbuf);
8464
8465     sprintf(add_string, " - %s", bigbuf);
8466 }
8467
8468 static void
8469 param_auth_cap(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8470 {
8471     gint32 value;
8472     guint saved_offset;
8473     gchar *str = NULL;
8474
8475     EXACT_DATA_CHECK(len, 1);
8476
8477     add_string = add_string;
8478     saved_offset = asn1->offset;
8479
8480     asn1_int32_value_decode(asn1, 1, &value);
8481
8482     switch (value)
8483     {
8484     case 0: str = "Not used"; break;
8485     case 1: str = "No authentication required"; break;
8486     case 2: str = "Authentication required"; break;
8487     case 128: str = "Authentication required and UIM capable"; break;
8488     default:
8489         if ((value >= 3) && (value <= 95)) { str = "Reserved, treat as No authentication required"; }
8490         else if ((value >= 96) && (value <= 127)) { str = "Reserved for protocol extension, treat as No authentication required"; }
8491         else if ((value >= 129) && (value <= 223)) { str = "Reserved, treat as Authentication required"; }
8492         else { str = "Reserved for protocol extension, treat as Authentication required"; }
8493         break;
8494     }
8495
8496     proto_tree_add_text(tree, asn1->tvb,
8497         saved_offset, asn1->offset - saved_offset,
8498         str);
8499 }
8500
8501 static void
8502 param_sus_acc(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8503 {
8504     gint32 value;
8505     guint saved_offset;
8506     gchar *str = NULL;
8507
8508     EXACT_DATA_CHECK(len, 1);
8509
8510     add_string = add_string;
8511     saved_offset = asn1->offset;
8512
8513     asn1_int32_value_decode(asn1, 1, &value);
8514
8515     switch (value)
8516     {
8517     case 0: str = "Not used"; break;
8518     case 1: str = "Anomalous digits"; break;
8519     case 2: str = "Unspecified"; break;
8520     default:
8521         if ((value >= 3) && (value <= 113)) { str = "Reserved, treat as Anomalous digits"; }
8522         else if ((value >= 114) && (value <= 223)) { str = "Reserved, treat as Unspecified"; }
8523         else { str = "Reserved for protocol extension, treat as Unspecified"; }
8524         break;
8525     }
8526
8527     proto_tree_add_text(tree, asn1->tvb,
8528         saved_offset, asn1->offset - saved_offset,
8529         "Reason, %s",
8530         str);
8531 }
8532
8533 static void
8534 param_dis_text(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8535 {
8536     gint32 value;
8537     guint saved_offset;
8538
8539     SHORT_DATA_CHECK(len, 3);
8540
8541     add_string = add_string;
8542     saved_offset = asn1->offset;
8543
8544     asn1_int32_value_decode(asn1, 1, &value);
8545
8546     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
8547     proto_tree_add_text(tree, asn1->tvb,
8548         saved_offset, asn1->offset - saved_offset,
8549         "%s :  Spec. has hardcoded 1",
8550         bigbuf);
8551
8552     other_decode_bitfield_value(bigbuf, value, 0x7f, 8);
8553     proto_tree_add_text(tree, asn1->tvb,
8554         saved_offset, asn1->offset - saved_offset,
8555         "%s :  Display type, see ANSI T1.610 for encoding",
8556         bigbuf);
8557
8558     saved_offset = asn1->offset;
8559
8560     proto_tree_add_text(tree, asn1->tvb,
8561         saved_offset, len - 1,
8562         "Display data");
8563
8564     asn1->offset += len - 1;
8565 }
8566
8567 static void
8568 param_dis_text2(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8569 {
8570     gint32 value;
8571     guint orig_offset, saved_offset;
8572     gchar *str = NULL;
8573
8574     SHORT_DATA_CHECK(len, 4);
8575
8576     add_string = add_string;
8577
8578     orig_offset = asn1->offset;
8579     saved_offset = asn1->offset;
8580
8581     do
8582     {
8583         asn1_int32_value_decode(asn1, 1, &value);
8584
8585         switch (value)
8586         {
8587         case 0: str = "Not used"; break;
8588         case 1: str = "ASCII"; break;
8589         case 2: str = "ITU T.50. The International Reference Alphabet as defined in ITU-R Rec. T.50"; break;
8590         case 3: str = "User Specific"; break;
8591         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;
8592         case 5: str = "ISO 10646. The Universal Multiple-Octet Coded Character Set (USC) as defined in ISO/IEC Standard 10646"; break;
8593         case 6: str = "ISO 8859-8. The 8-bit single-byte coded character set Hebrew as defined in ISO/IEC Standard 8859-8"; break;
8594         case 7: str = "IS-91 Extended Protocol Message. The length is determined by the Message Type; see TIA/EIA/IS-90"; break;
8595         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;
8596         case 9: str = "KC C 5601. Variable 1-2 byte Korean encoding method"; break;
8597         default:
8598             if ((value >= 10) && (value <= 223)) { str = "Reserved, treat as ASCII"; }
8599             else { str = "Reserved, treat as ASCII"; }
8600             break;
8601         }
8602
8603         proto_tree_add_text(tree, asn1->tvb,
8604             saved_offset, asn1->offset - saved_offset,
8605             "Display Character Set, %s",
8606             str);
8607
8608         saved_offset = asn1->offset;
8609
8610         asn1_int32_value_decode(asn1, 1, &value);
8611
8612         proto_tree_add_text(tree, asn1->tvb,
8613             saved_offset, asn1->offset - saved_offset,
8614             "Display Type, %u, see ANSI T1.610",
8615             value);
8616
8617         saved_offset = asn1->offset;
8618
8619         asn1_int32_value_decode(asn1, 1, &value);
8620
8621         proto_tree_add_text(tree, asn1->tvb,
8622             saved_offset, asn1->offset - saved_offset,
8623             "Display Tag, %u",
8624             value);
8625
8626         saved_offset = asn1->offset;
8627
8628         asn1_int32_value_decode(asn1, 1, &value);
8629
8630         proto_tree_add_text(tree, asn1->tvb,
8631             saved_offset, asn1->offset - saved_offset,
8632             "Display Length, %u",
8633             value);
8634
8635         saved_offset = asn1->offset;
8636
8637         if (value > 0)
8638         {
8639             if ((guint32) value > (len - (saved_offset - orig_offset)))
8640             {
8641                 proto_tree_add_text(tree, asn1->tvb,
8642                     saved_offset, len - (saved_offset - orig_offset),
8643                     "Short Data (?)");
8644
8645                 asn1->offset += len - (saved_offset - orig_offset);
8646                 return;
8647             }
8648
8649             proto_tree_add_text(tree, asn1->tvb,
8650                 saved_offset, value,
8651                 "Display data");
8652
8653             asn1->offset += value;
8654
8655             saved_offset = asn1->offset;
8656         }
8657     }
8658     while ((len - (saved_offset - orig_offset)) >= 4);
8659
8660     EXTRANEOUS_DATA_CHECK((len - (saved_offset - orig_offset)), 0);
8661 }
8662
8663 static void
8664 param_dmh_srvc_id(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8665 {
8666     gint32 value;
8667     guint orig_offset, saved_offset;
8668
8669     SHORT_DATA_CHECK(len, 5);
8670
8671     add_string = add_string;
8672
8673     orig_offset = asn1->offset;
8674     saved_offset = asn1->offset;
8675
8676     do
8677     {
8678         asn1_int32_value_decode(asn1, 2, &value);
8679
8680         proto_tree_add_text(tree, asn1->tvb,
8681             saved_offset, asn1->offset - saved_offset,
8682             "Market ID %u",
8683             value);
8684
8685         saved_offset = asn1->offset;
8686
8687         asn1_int32_value_decode(asn1, 1, &value);
8688
8689         proto_tree_add_text(tree, asn1->tvb,
8690             saved_offset, asn1->offset - saved_offset,
8691             "Market Segment ID %u",
8692             value);
8693
8694         saved_offset = asn1->offset;
8695
8696         asn1_int32_value_decode(asn1, 2, &value);
8697
8698         proto_tree_add_text(tree, asn1->tvb,
8699             saved_offset, asn1->offset - saved_offset,
8700             "DMH Service ID Value %u",
8701             value);
8702
8703         saved_offset = asn1->offset;
8704     }
8705     while ((len - (saved_offset - orig_offset)) >= 5);
8706
8707     EXTRANEOUS_DATA_CHECK((len - (saved_offset - orig_offset)), 0);
8708 }
8709
8710 static void
8711 param_feat_ind(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8712 {
8713     gint32 value;
8714     guint orig_offset, saved_offset;
8715
8716     SHORT_DATA_CHECK(len, 5);
8717
8718     add_string = add_string;
8719
8720     orig_offset = asn1->offset;
8721     saved_offset = asn1->offset;
8722
8723     do
8724     {
8725         asn1_int32_value_decode(asn1, 2, &value);
8726
8727         proto_tree_add_text(tree, asn1->tvb,
8728             saved_offset, asn1->offset - saved_offset,
8729             "Market ID %u",
8730             value);
8731
8732         saved_offset = asn1->offset;
8733
8734         asn1_int32_value_decode(asn1, 1, &value);
8735
8736         proto_tree_add_text(tree, asn1->tvb,
8737             saved_offset, asn1->offset - saved_offset,
8738             "Market Segment ID %u",
8739             value);
8740
8741         saved_offset = asn1->offset;
8742
8743         asn1_int32_value_decode(asn1, 2, &value);
8744
8745         proto_tree_add_text(tree, asn1->tvb,
8746             saved_offset, asn1->offset - saved_offset,
8747             "DMH Service ID Value %u",
8748             value);
8749
8750         saved_offset = asn1->offset;
8751     }
8752     while ((len - (saved_offset - orig_offset)) >= 5);
8753
8754     EXTRANEOUS_DATA_CHECK((len - (saved_offset - orig_offset)), 0);
8755 }
8756
8757 static void
8758 param_a_key_ver(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8759 {
8760     gint32 value;
8761     gint i;
8762     guint saved_offset;
8763     gchar *str = NULL;
8764
8765     add_string = add_string;
8766     saved_offset = asn1->offset;
8767
8768     i = 0;
8769
8770     do
8771     {
8772         asn1_int32_value_decode(asn1, 1, &value);
8773
8774         switch (value)
8775         {
8776         case 0: str = "Not used"; break;
8777         case 1: str = "A-key Generation not supported"; break;
8778         case 2: str = "Diffie Hellman with 768-bit modulus, 160-bit primitive, and 160-bit exponents"; break;
8779         case 3: str = "Diffie Hellman with 512-bit modulus, 160-bit primitive, and 160-bit exponents"; break;
8780         case 4: str = "Diffie Hellman with 768-bit modulus, 32-bit primitive, and 160-bit exponents"; break;
8781         default:
8782             if ((value >= 5) && (value <= 223)) { str = "Reserved, treat as A-key Generation not supported"; }
8783             else { str = "Reserved for protocol extension, treat as A-key Generation not supported"; }
8784             break;
8785         }
8786
8787         proto_tree_add_text(tree, asn1->tvb,
8788             saved_offset, asn1->offset - saved_offset,
8789             "[%u] %s",
8790             i++,
8791             str);
8792
8793         saved_offset = asn1->offset;
8794     }
8795     while ((len - i) > 0);
8796 }
8797
8798 static void
8799 param_inter_msg_time(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8800 {
8801     gint32 value;
8802     guint saved_offset;
8803
8804     EXACT_DATA_CHECK(len, 1);
8805
8806     add_string = add_string;
8807     saved_offset = asn1->offset;
8808
8809     asn1_int32_value_decode(asn1, 1, &value);
8810
8811     proto_tree_add_text(tree, asn1->tvb,
8812         saved_offset, asn1->offset - saved_offset,
8813         "Timer Value, %u, %u seconds",
8814         value,
8815         value * 10);
8816
8817         /* XXX * 10 or / 10 ? */
8818 }
8819
8820 static void
8821 param_rel_cause(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8822 {
8823     gint32 value;
8824     guint saved_offset;
8825     gchar *str = NULL;
8826
8827     EXACT_DATA_CHECK(len, 1);
8828
8829     add_string = add_string;
8830     saved_offset = asn1->offset;
8831
8832     asn1_int32_value_decode(asn1, 1, &value);
8833
8834     switch (value)
8835     {
8836     case 0: str = "Unspecified"; break;
8837     case 1: str = "Calling Party"; break;
8838     case 2: str = "Called Party"; break;
8839     case 3: str = "Commanded Disconnect"; break;
8840     default:
8841         if ((value >= 4) && (value <= 23)) { str = "Reserved, treat as Calling Party"; }
8842         else if ((value >= 24) && (value <= 31)) { str = "Reserved for protocol extension. If unknown, treat as Calling Party"; }
8843         else if ((value >= 32) && (value <= 55)) { str = "Reserved, treat as Called Party"; }
8844         else if ((value >= 56) && (value <= 63)) { str = "Reserved for protocol extension. If unknown, treat as Called Party"; }
8845         else if ((value >= 64) && (value <= 87)) { str = "Reserved, treat as Commanded Disconnect"; }
8846         else if ((value >= 88) && (value <= 95)) { str = "Reserved for protocol extension. If unknown, treat as Commanded Disconnect"; }
8847         else if ((value >= 96) && (value <= 223)) { str = "Reserved, treat as Unspecified"; }
8848         else { str = "Reserved for protocol extension. If unknown, treat as Unspecified"; }
8849         break;
8850     }
8851
8852     proto_tree_add_text(tree, asn1->tvb,
8853         saved_offset, asn1->offset - saved_offset,
8854         str);
8855 }
8856
8857 static void
8858 param_time_day(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8859 {
8860     gint32 value;
8861     gint32 h, m, s, ts;
8862     guint saved_offset;
8863
8864     EXACT_DATA_CHECK(len, 3);
8865
8866     add_string = add_string;
8867     saved_offset = asn1->offset;
8868
8869     asn1_int32_value_decode(asn1, 3, &value);
8870
8871     h = value / (3600 * 10);
8872     m = (value - (h * (3600 * 10))) / (60 * 10);
8873     s = (value - (h * (3600 * 10)) - (m * (60 * 10))) / 10;
8874     ts = (value - (h * (3600 * 10)) - (m * (60 * 10)) - (s * 10));
8875
8876     proto_tree_add_text(tree, asn1->tvb,
8877         saved_offset, asn1->offset - saved_offset,
8878         "(UTC) (in tenths of seconds - 1), %u (%u:%u:%u.%u)",
8879         value,
8880         h,
8881         m,
8882         s,
8883         ts);
8884 }
8885
8886 static void
8887 param_call_status(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8888 {
8889     gint32 value;
8890     guint saved_offset;
8891     gchar *str = NULL;
8892
8893     add_string = add_string;
8894
8895     if (len > 4)
8896     {
8897         proto_tree_add_text(tree, asn1->tvb,
8898             asn1->offset, len, "Long Data (?)");
8899         asn1->offset += len;
8900         return;
8901     }
8902
8903     saved_offset = asn1->offset;
8904
8905     asn1->offset = saved_offset;
8906
8907     asn1_int32_value_decode(asn1, len, &value);
8908
8909     switch (value)
8910     {
8911     case 0: str = "Not used"; break;
8912     case 1: str = "Call Setup in Progress"; break;
8913     case 2: str = "Locally Allowed Call - No Action"; break;
8914     default:
8915         if (value < 0) { str = "Reserved for bilateral agreements. If unknown, treat as Not used"; }
8916         else { str = "Reserved, treat as Not used"; }
8917         break;
8918     }
8919
8920     proto_tree_add_text(tree, asn1->tvb,
8921         saved_offset, len,
8922         str);
8923 }
8924
8925 static void
8926 param_ms_status(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
8927 {
8928     gint32 value;
8929     guint saved_offset;
8930     gchar *str = NULL;
8931     gboolean has_chan;
8932     gboolean extended;
8933
8934     add_string = add_string;
8935     saved_offset = asn1->offset;
8936
8937     asn1_int32_value_decode(asn1, 1, &value);
8938
8939     extended = (value & 0x80) >> 7;
8940
8941     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
8942     proto_tree_add_text(tree, asn1->tvb,
8943         saved_offset, asn1->offset - saved_offset,
8944         "%s :  Extension (EXT), %s",
8945         bigbuf,
8946         extended ? "No Extension, last octet of sequence" : "Extension indicator, the octet continues through the next octet");
8947
8948     other_decode_bitfield_value(bigbuf, value, 0x60, 8);
8949     proto_tree_add_text(tree, asn1->tvb,
8950         saved_offset, asn1->offset - saved_offset,
8951         "%s :  Reserved",
8952         bigbuf);
8953
8954     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
8955     proto_tree_add_text(tree, asn1->tvb,
8956         saved_offset, asn1->offset - saved_offset,
8957         "%s :  Location Information (LOC), %s",
8958         bigbuf,
8959         (value & 0x10) ? "MS location information available" : "No MS location information available");
8960
8961     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
8962     proto_tree_add_text(tree, asn1->tvb,
8963         saved_offset, asn1->offset - saved_offset,
8964         "%s :  Contact, %s",
8965         bigbuf,
8966         (value & 0x08) ? "Radio Contact Established" : "No Radio Contact");
8967
8968     has_chan = (value & 0x04) >> 2;
8969
8970     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
8971     proto_tree_add_text(tree, asn1->tvb,
8972         saved_offset, asn1->offset - saved_offset,
8973         "%s :  Channel, %s",
8974         bigbuf,
8975         has_chan ? "Traffic Channel Assigned" : "No Traffic Channel");
8976
8977     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
8978     proto_tree_add_text(tree, asn1->tvb,
8979         saved_offset, asn1->offset - saved_offset,
8980         "%s :  Handoff, %s",
8981         bigbuf,
8982         (value & 0x02) ? "Intersystem Handoff" : "No Intersystem Handoff");
8983
8984     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
8985     proto_tree_add_text(tree, asn1->tvb,
8986         saved_offset, asn1->offset - saved_offset,
8987         "%s :  Inactive, %s",
8988         bigbuf,
8989         (value & 0x01) ? "MS Inactive" : "MS Active");
8990
8991     if (len == 1) return;
8992
8993     saved_offset = asn1->offset;
8994
8995     asn1_int32_value_decode(asn1, 1, &value);
8996
8997     if (extended)
8998     {
8999         proto_tree_add_text(tree, asn1->tvb,
9000             saved_offset, asn1->offset - saved_offset,
9001             "Octet 1a ? spec. does not provide details");
9002
9003         saved_offset = asn1->offset;
9004
9005         EXTRANEOUS_DATA_CHECK(len, 2);
9006
9007         return;
9008     }
9009
9010     if (has_chan)
9011     {
9012         switch (value)
9013         {
9014         case 0: str = "Not used "; break;
9015         case 1: str = "Analog. The MS is currently assigned to an analog traffic channel"; break;
9016         case 2: str = "NAMPS. The MS is currently assigned to an NAMPS traffic channel"; break;
9017         case 3: str = "TDMA. The MS is currently assigned to a TDMA traffic channel"; break;
9018         case 4: str = "CDMA. The MS is currently assigned to a CDMA traffic channel"; break;
9019         default:
9020             if ((value >= 5) && (value <= 223)) { str = "Reserved, treat as Not used"; }
9021             else { str = "Reserved for protocol extension, treat as Not used"; }
9022             break;
9023         }
9024
9025         proto_tree_add_text(tree, asn1->tvb,
9026             saved_offset, asn1->offset - saved_offset,
9027             "Radio Channel Type, %s",
9028             str);
9029
9030         saved_offset = asn1->offset;
9031
9032         EXTRANEOUS_DATA_CHECK(len, 2);
9033
9034         return;
9035     }
9036
9037     asn1->offset -= 1;
9038
9039     EXTRANEOUS_DATA_CHECK(len, 1);
9040 }
9041
9042 static void
9043 param_pos_info_code(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9044 {
9045     gint32 value;
9046     guint saved_offset;
9047
9048     add_string = add_string;
9049     saved_offset = asn1->offset;
9050
9051     asn1_int32_value_decode(asn1, 1, &value);
9052
9053     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
9054     proto_tree_add_text(tree, asn1->tvb,
9055         saved_offset, asn1->offset - saved_offset,
9056         "%s :  Reserved",
9057         bigbuf);
9058
9059     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
9060     proto_tree_add_text(tree, asn1->tvb,
9061         saved_offset, asn1->offset - saved_offset,
9062         "%s :  MS Identity (MSID), %s",
9063         bigbuf,
9064         (value & 0x10) ? "MS Identity Requested" : "No MS Identity Requested");
9065
9066     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
9067     proto_tree_add_text(tree, asn1->tvb,
9068         saved_offset, asn1->offset - saved_offset,
9069         "%s :  Routing Address (ROUTE), %s",
9070         bigbuf,
9071         (value & 0x08) ? "Routing Address Requested" : "No Routing Address Requested");
9072
9073     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
9074     proto_tree_add_text(tree, asn1->tvb,
9075         saved_offset, asn1->offset - saved_offset,
9076         "%s :  Serving Cell ID (CELLID), %s",
9077         bigbuf,
9078         (value & 0x04) ? "Serving Cell ID Requested" : "No Serving Cell ID Requested");
9079
9080     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
9081     proto_tree_add_text(tree, asn1->tvb,
9082         saved_offset, asn1->offset - saved_offset,
9083         "%s :  Location Area ID (LOCID), %s",
9084         bigbuf,
9085         (value & 0x02) ?  "Location Area ID Requested" : "No Location Area ID Requested");
9086
9087     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
9088     proto_tree_add_text(tree, asn1->tvb,
9089         saved_offset, asn1->offset - saved_offset,
9090         "%s :  Current, %s",
9091         bigbuf,
9092         (value & 0x01) ? "Provide the current MS location" : "Provide the last known MS location information, if known");
9093
9094     EXTRANEOUS_DATA_CHECK(len, 1);
9095 }
9096
9097 static void
9098 param_rel_reason(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9099 {
9100     gint32 value;
9101     guint saved_offset;
9102     gchar *str = NULL;
9103
9104     EXACT_DATA_CHECK(len, 1);
9105
9106     add_string = add_string;
9107     saved_offset = asn1->offset;
9108
9109     asn1_int32_value_decode(asn1, 1, &value);
9110
9111     switch (value)
9112     {
9113     case 0: str = "Unspecified"; break;
9114     case 1: str = "Call Over Clear Forward"; break;
9115     case 2: str = "Call Over Clear Backward"; break;
9116     case 3: str = "Handoff Successful"; break;
9117     case 4: str = "Handoff Abort - call over"; break;
9118     case 5: str = "Handoff Abort - not received"; break;
9119     case 6: str = "Abnormal mobile termination"; break;
9120     case 7: str = "Abnormal switch termination"; break;
9121     case 8: str = "Special feature release"; break;
9122     case 9: str = "Session Over Clear Forward"; break;
9123     case 10: str = "Session Over Clear Backward"; break;
9124     case 11: str = "Clear All Services Forward"; break;
9125     case 12: str = "Clear All Services Backward"; break;
9126     case 13: str = "Anchor MSC was removed from the packet data session"; break;
9127     default:
9128         if ((value >= 14) && (value <= 223)) { str = "Reserved, treat as Unspecified"; }
9129         else { str = "Reserved for protocol extension, treat as Unspecified"; }
9130         break;
9131     }
9132
9133     proto_tree_add_text(tree, asn1->tvb,
9134         saved_offset, asn1->offset - saved_offset,
9135         "Reason, %s",
9136         str);
9137 }
9138
9139 static void
9140 param_ho_reason(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9141 {
9142     gint32 value;
9143     guint saved_offset;
9144     gchar *str = NULL;
9145
9146     EXACT_DATA_CHECK(len, 1);
9147
9148     add_string = add_string;
9149     saved_offset = asn1->offset;
9150
9151     asn1_int32_value_decode(asn1, 1, &value);
9152
9153     switch (value)
9154     {
9155     case 0: str = "Not used"; break;
9156     case 1: str = "Unspecified"; break;
9157     case 2: str = "Weak signal"; break;
9158     case 3: str = "Off-loading"; break;
9159     case 4: str = "Anticipatory"; break;
9160     default:
9161         if ((value >= 5) && (value <= 223)) { str = "Reserved, treat as Unspecified"; }
9162         else { str = "Reserved for protocol extension, treat as Unspecified"; }
9163         break;
9164     }
9165
9166     proto_tree_add_text(tree, asn1->tvb,
9167         saved_offset, asn1->offset - saved_offset,
9168         str);
9169 }
9170
9171 static void
9172 param_red_reason(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9173 {
9174     gint32 value;
9175     guint saved_offset;
9176     gchar *str = NULL;
9177
9178     EXACT_DATA_CHECK(len, 1);
9179
9180     add_string = add_string;
9181     saved_offset = asn1->offset;
9182
9183     asn1_int32_value_decode(asn1, 1, &value);
9184
9185     switch (value)
9186     {
9187     case 0: str = "Not used"; break;
9188     case 1: str = "Busy"; break;
9189     case 2: str = "No answer"; break;
9190     case 3: str = "Unconditional"; break;
9191     case 4: str = "No page response"; break;
9192     case 5: str = "Unavailable"; break;
9193     case 6: str = "Unroutable"; break;
9194     case 7: str = "Call accepted"; break;
9195     case 8: str = "Call refused"; break;
9196     case 9: str = "USCFvm, divert to voice mail"; break;
9197     case 10: str = "USCFms, divert to an MS provided DN"; break;
9198     case 11: str = "USCFnr, divert to a network registered DN"; break;
9199     default:
9200         if ((value >= 12) && (value <= 223)) { str = "Reserved, treat as No answer"; }
9201         else { str = "Reserved for protocol extension, treat as No answer"; }
9202         break;
9203     }
9204
9205     proto_tree_add_text(tree, asn1->tvb,
9206         saved_offset, asn1->offset - saved_offset,
9207         str);
9208 }
9209
9210 static void
9211 param_confid_mode(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9212 {
9213     gint32 value;
9214     guint saved_offset;
9215
9216     EXACT_DATA_CHECK(len, 1);
9217
9218     add_string = add_string;
9219     saved_offset = asn1->offset;
9220
9221     asn1_int32_value_decode(asn1, 1, &value);
9222
9223     other_decode_bitfield_value(bigbuf, value, 0xf8, 8);
9224     proto_tree_add_text(tree, asn1->tvb,
9225         saved_offset, asn1->offset - saved_offset,
9226         "%s :  Reserved",
9227         bigbuf);
9228
9229     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
9230     proto_tree_add_text(tree, asn1->tvb,
9231         saved_offset, asn1->offset - saved_offset,
9232         "%s :  Data Privacy (DP), %s",
9233         bigbuf,
9234         (value & 0x04) ? "ON" : "OFF");
9235
9236     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
9237     proto_tree_add_text(tree, asn1->tvb,
9238         saved_offset, asn1->offset - saved_offset,
9239         "%s :  Signaling Message Encryption (SE), %s",
9240         bigbuf,
9241         (value & 0x02) ? "ON" : "OFF");
9242
9243     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
9244     proto_tree_add_text(tree, asn1->tvb,
9245         saved_offset, asn1->offset - saved_offset,
9246         "%s :  Voice Privacy (VP), %s",
9247         bigbuf,
9248         (value & 0x01) ? "ON" : "OFF");
9249 }
9250
9251 static void
9252 param_sys_acc_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9253 {
9254     gint32 value;
9255     guint saved_offset;
9256     gchar *str = NULL;
9257
9258     EXACT_DATA_CHECK(len, 1);
9259
9260     add_string = add_string;
9261     saved_offset = asn1->offset;
9262
9263     asn1_int32_value_decode(asn1, 1, &value);
9264
9265     switch (value)
9266     {
9267     case 0: str = "Not used"; break;
9268     case 1: str = "Unspecified"; break;
9269     case 2: str = "Flash request"; break;
9270     case 3: str = "Autonomous registration"; break;
9271     case 4: str = "Call origination"; break;
9272     case 5: str = "Page response"; break;
9273     case 6: str = "No access"; break;
9274     case 7: str = "Power down registration"; break;
9275     case 8: str = "SMS page response"; break;
9276     case 9: str = "OTASP"; break;
9277     default:
9278         if ((value >= 10) && (value <= 223)) { str = "Reserved, treat as Unspecified"; }
9279         else { str = "Reserved for protocol extension, treat as Unspecified"; }
9280         break;
9281     }
9282
9283     proto_tree_add_text(tree, asn1->tvb,
9284         saved_offset, asn1->offset - saved_offset,
9285         str);
9286 }
9287
9288 static void
9289 param_scm(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9290 {
9291     gint32 value, temp_int;
9292     guint saved_offset;
9293     gchar *str = NULL;
9294
9295     EXACT_DATA_CHECK(len, 1);
9296
9297     add_string = add_string;
9298     saved_offset = asn1->offset;
9299
9300     asn1_int32_value_decode(asn1, 1, &value);
9301
9302     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
9303     proto_tree_add_text(tree, asn1->tvb,
9304         saved_offset, asn1->offset - saved_offset,
9305         "%s :  Reserved",
9306         bigbuf);
9307
9308     temp_int = ((value & 0x10) >> 2) | (value & 0x03);
9309     switch (temp_int)
9310     {
9311     case 0: str = "Class I"; break;
9312     case 1: str = "Class II"; break;
9313     case 2: str = "Class III"; break;
9314     case 3: str = "Class IV"; break;
9315     case 4: str = "Class V"; break;
9316     case 5: str = "Class VI"; break;
9317     case 6: str = "Class VII"; break;
9318     case 7: str = "Class VIII"; break;
9319     }
9320
9321     other_decode_bitfield_value(bigbuf, value, 0x13, 8);
9322     proto_tree_add_text(tree, asn1->tvb,
9323         saved_offset, asn1->offset - saved_offset,
9324         "%s :  Power %s",
9325         bigbuf,
9326         str);
9327
9328     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
9329     proto_tree_add_text(tree, asn1->tvb,
9330         saved_offset, asn1->offset - saved_offset,
9331         "%s :  Bandwidth %s",
9332         bigbuf,
9333         (value & 0x08) ? "25 MHz" : "20 MHz");
9334
9335     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
9336     proto_tree_add_text(tree, asn1->tvb,
9337         saved_offset, asn1->offset - saved_offset,
9338         "%s :  Transmission, %s",
9339         bigbuf,
9340         (value & 0x04) ? "Discontinuous" : "Continuous");
9341 }
9342
9343 static void
9344 param_deny_acc(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9345 {
9346     gint32 value;
9347     guint saved_offset;
9348     gchar *str = NULL;
9349
9350     EXACT_DATA_CHECK(len, 1);
9351
9352     add_string = add_string;
9353     saved_offset = asn1->offset;
9354
9355     asn1_int32_value_decode(asn1, 1, &value);
9356
9357     switch (value)
9358     {
9359     case 0: str = "Not used"; break;
9360     case 1: str = "Unspecified"; break;
9361     case 2: str = "SSD Update failure"; break;
9362     case 3: str = "COUNT Update failure"; break;
9363     case 4: str = "Unique Challenge failure"; break;
9364     case 5: str = "AUTHR mismatch"; break;
9365     case 6: str = "COUNT mismatch"; break;
9366     case 7: str = "Process collision"; break;
9367     case 8: str = "Missing authentication parameters"; break;
9368     case 9: str = "TerminalType mismatch"; break;
9369     case 10: str = "MIN, IMSI or ESN authorization failure"; break;
9370     default:
9371         if ((value >= 11) && (value <= 223)) { str = "Reserved, treat as Unspecified"; }
9372         else { str = "Reserved for protocol extension, treat as Unspecified"; }
9373         break;
9374     }
9375
9376     proto_tree_add_text(tree, asn1->tvb,
9377         saved_offset, asn1->offset - saved_offset,
9378         str);
9379 }
9380
9381 static void
9382 param_cdma_sig_qual(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9383 {
9384     gint32 value;
9385     guint saved_offset;
9386
9387     EXACT_DATA_CHECK(len, 1);
9388
9389     add_string = add_string;
9390     saved_offset = asn1->offset;
9391
9392     asn1_int32_value_decode(asn1, 1, &value);
9393
9394     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
9395     proto_tree_add_text(tree, asn1->tvb,
9396         saved_offset, asn1->offset - saved_offset,
9397         "%s :  Reserved",
9398         bigbuf);
9399
9400     other_decode_bitfield_value(bigbuf, value, 0x3f, 8);
9401     proto_tree_add_text(tree, asn1->tvb,
9402         saved_offset, asn1->offset - saved_offset,
9403         "%s :  Value %u",
9404         bigbuf,
9405         value & 0x3f);
9406 }
9407
9408 static void
9409 param_rec_sig_qual(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9410 {
9411     gint32 value;
9412     guint saved_offset;
9413     gchar *str = NULL;
9414
9415     EXACT_DATA_CHECK(len, 1);
9416
9417     add_string = add_string;
9418     saved_offset = asn1->offset;
9419
9420     asn1_int32_value_decode(asn1, 1, &value);
9421
9422     switch (value)
9423     {
9424     case 0: str = "Not a usable signal"; break;
9425     case 255: str = "Interference"; break;
9426     default:
9427         if ((value >= 1) && (value <= 8)) { str = "Reserved, treat as Not a usable signal"; }
9428         else if ((value >= 9) && (value <= 245)) { str = "Usable signal range"; }
9429         else if ((value >= 246) && (value <= 254)) { str = "Reserved, treat as Interference"; }
9430         break;
9431     }
9432
9433     proto_tree_add_text(tree, asn1->tvb,
9434         saved_offset, asn1->offset - saved_offset,
9435         str);
9436 }
9437
9438 static void
9439 param_sig_qual(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9440 {
9441     gint32 value;
9442     guint saved_offset;
9443     gchar *str = NULL;
9444
9445     EXACT_DATA_CHECK(len, 1);
9446
9447     add_string = add_string;
9448     saved_offset = asn1->offset;
9449
9450     asn1_int32_value_decode(asn1, 1, &value);
9451
9452     switch (value)
9453     {
9454     case 0: str = "Not a usable signal"; break;
9455     case 255: str = "Interference"; break;
9456     default:
9457         if ((value >= 1) && (value <= 8)) { str = "Reserved, treat as Not a usable signal"; }
9458         else if ((value >= 9) && (value <= 245)) { str = "Usable signal range"; }
9459         else if ((value >= 246) && (value <= 254)) { str = "Reserved, treat as Interference"; }
9460         break;
9461     }
9462
9463     proto_tree_add_text(tree, asn1->tvb,
9464         saved_offset, asn1->offset - saved_offset,
9465         str);
9466 }
9467
9468 static void
9469 param_ssd_no_share(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9470 {
9471     gint32 value;
9472     guint saved_offset;
9473     gchar *str = NULL;
9474
9475     EXACT_DATA_CHECK(len, 1);
9476
9477     add_string = add_string;
9478     saved_offset = asn1->offset;
9479
9480     asn1_int32_value_decode(asn1, 1, &value);
9481
9482     switch (value)
9483     {
9484     case 0: str = "Not used"; break;
9485     case 1: str = "Discard SSD"; break;
9486     default:
9487         str = "Reserved, treat as Discard SSD";
9488         break;
9489     }
9490
9491     proto_tree_add_text(tree, asn1->tvb,
9492         saved_offset, asn1->offset - saved_offset,
9493         str);
9494 }
9495
9496 static void
9497 param_report_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9498 {
9499     gint32 value;
9500     guint saved_offset;
9501     gchar *str = NULL;
9502
9503     EXACT_DATA_CHECK(len, 1);
9504
9505     add_string = add_string;
9506     saved_offset = asn1->offset;
9507
9508     asn1_int32_value_decode(asn1, 1, &value);
9509
9510     switch (value)
9511     {
9512     case 0: str = "Not used"; break;
9513     case 1: str = "Unspecified security violation"; break;
9514     case 2: str = "MSID/ESN mismatch"; break;
9515     case 3: str = "RANDC mismatch"; break;
9516     case 4: str = "Reserved (see TSB51)"; break;
9517     case 5: str = "SSD Update failed"; break;
9518     case 6: str = "Reserved (see TSB51)"; break;
9519     case 7: str = "COUNT mismatch"; break;
9520     case 8: str = "Reserved (see TSB51)"; break;
9521     case 9: str = "Unique Challenge failed"; break;
9522     case 10: str = "Unsolicited Base Station Challenge"; break;
9523     case 11: str = "SSD Update no response"; break;
9524     case 12: str = "COUNT Update no response"; break;
9525     case 13: str = "Unique Challenge no response"; break;
9526     case 14: str = "AUTHR mismatch"; break;
9527     case 15: str = "TERMTYP mismatch"; break;
9528     case 16: str = "Missing authentication parameters"; break;
9529     default:
9530         if ((value >= 17) && (value <= 223)) { str = "Reserved, treat as Unspecified security violation"; }
9531         else { str = "Reserved for protocol extension, treat as Unspecified security violation"; }
9532         break;
9533     }
9534
9535     proto_tree_add_text(tree, asn1->tvb,
9536         saved_offset, asn1->offset - saved_offset,
9537         str);
9538 }
9539
9540 static void
9541 param_term_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9542 {
9543     gint32 value;
9544     guint saved_offset;
9545     gchar *str = NULL;
9546
9547     EXACT_DATA_CHECK(len, 1);
9548
9549     add_string = add_string;
9550     saved_offset = asn1->offset;
9551
9552     asn1_int32_value_decode(asn1, 1, &value);
9553
9554     switch (value)
9555     {
9556     case 0: str = "Not used"; break;
9557     case 1: str = "Not distinguished, EIA/TIA-553, IS-54-A, IS-88, IS-91, IS-94"; break;
9558     case 2: str = "IS-54-B"; break;
9559     case 3: str = "IS-136"; break;
9560     case 4: str = "J-STD-011 (rescinded 11/23/99)"; break;
9561     case 5: str = "IS-136-A or TIA/EIA-136 Revision-0"; break;
9562     case 6: str = "TIA/EIA-136-A"; break;
9563     case 7: str = "TIA/EIA-136-B"; break;
9564     case 32: str = "IS-95"; break;
9565     case 33: str = "IS-95-A"; break;
9566     case 34: str = "J-STD-008"; break;
9567     case 35: str = "IS-95-B"; break;
9568     case 36: str = "IS-2000"; break;
9569     case 64: str = "IS-88"; break;
9570     case 65: str = "IS-94"; break;
9571     case 66: str = "IS-91"; break;
9572     case 67: str = "J-STD-014"; break;
9573     case 68: str = "TIA/EIA-553-A"; break;
9574     case 69: str = "IS-91-A"; break;
9575     default:
9576         if ((value >= 8) && (value <= 31)) { str = "Reserved, treat as IS-54-B"; }
9577         else if ((value >= 37) && (value <= 63)) { str = "Reserved, treat as IS-95-A"; }
9578         else if ((value >= 70) && (value <= 223)) { str = "Reserved, treat as Not distinguished"; }
9579         else { str = "Reserved for protocol extension, treat as Not distinguished"; }
9580         break;
9581     }
9582
9583     proto_tree_add_text(tree, asn1->tvb,
9584         saved_offset, asn1->offset - saved_offset,
9585         str);
9586 }
9587
9588 static void
9589 param_term_res(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9590 {
9591     gint32 value;
9592     guint saved_offset;
9593     gchar *str = NULL;
9594
9595     EXACT_DATA_CHECK(len, 1);
9596
9597     add_string = add_string;
9598     saved_offset = asn1->offset;
9599
9600     asn1_int32_value_decode(asn1, 1, &value);
9601
9602     switch (value)
9603     {
9604     case 0: str = "Not used"; break;
9605     case 1: str = "Termination denied"; break;
9606     case 2: str = "Unrestricted"; break;
9607     case 3: str = "Treatment for this value is not specified"; break;
9608     default:
9609         if ((value >= 4) && (value <= 223)) { str = "Reserved, treat as Unrestricted"; }
9610         else { str = "Reserved for protocol extension, treat as Unrestricted"; }
9611         break;
9612     }
9613
9614     proto_tree_add_text(tree, asn1->tvb,
9615         saved_offset, asn1->offset - saved_offset,
9616         str);
9617 }
9618
9619 static void
9620 param_dereg(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9621 {
9622     gint32 value;
9623     guint saved_offset;
9624     gchar *str = NULL;
9625
9626     EXACT_DATA_CHECK(len, 1);
9627
9628     add_string = add_string;
9629     saved_offset = asn1->offset;
9630
9631     asn1_int32_value_decode(asn1, 1, &value);
9632
9633     switch (value)
9634     {
9635     case 0: str = "Not used"; break;
9636     case 1: str = "Deregister for an unspecified reason"; break;
9637     case 2: str = "Deregister for an adminstrative reason"; break;
9638     case 3: str = "Deregister due to MS power down"; break;
9639     default:
9640         if ((value >= 4) && (value <= 223)) { str = "Reserved, treat as Deregister for an unspecified reason"; }
9641         else { str = "Reserved for protocol extension, treat as Deregister for an unspecified reason"; }
9642         break;
9643     }
9644
9645     proto_tree_add_text(tree, asn1->tvb,
9646         saved_offset, asn1->offset - saved_offset,
9647         str);
9648 }
9649
9650 static void
9651 param_group_info(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9652 {
9653     gint32 value;
9654     guint saved_offset;
9655
9656     SHORT_DATA_CHECK(len, 4);
9657
9658     add_string = add_string;
9659     saved_offset = asn1->offset;
9660
9661     asn1_int32_value_decode(asn1, 4, &value);
9662
9663     proto_tree_add_text(tree, asn1->tvb,
9664         saved_offset, asn1->offset - saved_offset,
9665         "Value %u",
9666         value);
9667
9668     EXTRANEOUS_DATA_CHECK(len, 4);
9669 }
9670
9671 static void
9672 param_auth_den(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9673 {
9674     gint32 value;
9675     guint saved_offset;
9676     gchar *str = NULL;
9677
9678     EXACT_DATA_CHECK(len, 1);
9679
9680     add_string = add_string;
9681     saved_offset = asn1->offset;
9682
9683     asn1_int32_value_decode(asn1, 1, &value);
9684
9685     switch (value)
9686     {
9687     case 0: str = "Not used"; break;
9688     case 1: str = "Delinquent account"; break;
9689     case 2: str = "Invalid serial number"; break;
9690     case 3: str = "Stolen unit"; break;
9691     case 4: str = "Duplicate unit"; break;
9692     case 5: str = "Unassigned directory number"; break;
9693     case 6: str = "Unspecified"; break;
9694     case 7: str = "Multiple access"; break;
9695     case 8: str = "Not Authorized for the MSC"; break;
9696     case 9: str = "Missing authentication parameters"; break;
9697     case 10: str = "Terminal Type mismatch"; break;
9698     default:
9699         if ((value >= 11) && (value <= 223)) { str = "Reserved, treat as Unspecified"; }
9700         else { str = "Reserved for protocol extension, treat as Unspecified"; }
9701         break;
9702     }
9703
9704     proto_tree_add_text(tree, asn1->tvb,
9705         saved_offset, asn1->offset - saved_offset,
9706         "Reason, %s (%u)",
9707         str,
9708         value);
9709 }
9710
9711 static gchar *
9712 find_trig_type(gint32 value)
9713 {
9714     gchar *str = NULL;
9715
9716     switch (value)
9717     {
9718     case 0: str = "Unspecified"; break;
9719     case 1: str = "All Calls"; break;
9720     case 2: str = "Double Introducing Star"; break;
9721     case 3: str = "Single Introducing Star"; break;
9722     case 4: str = "Reserved [for Home System Feature Code"; break;
9723     case 5: str = "Double Introducing Pound"; break;
9724     case 6: str = "Single Introducing Pound"; break;
9725     case 7: str = "Revertive Call"; break;
9726     case 8: str = "0 Digit"; break;
9727     case 9: str = "1 Digit"; break;
9728     case 10: str = "2 Digit"; break;
9729     case 11: str = "3 Digit"; break;
9730     case 12: str = "4 Digit"; break;
9731     case 13: str = "5 Digit"; break;
9732     case 14: str = "6 Digit"; break;
9733     case 15: str = "7 Digit"; break;
9734     case 16: str = "8 Digit"; break;
9735     case 17: str = "9 Digit"; break;
9736     case 18: str = "10 Digit"; break;
9737     case 19: str = "11 Digit"; break;
9738     case 20: str = "12 Digit"; break;
9739     case 21: str = "13 Digit"; break;
9740     case 22: str = "14 Digit"; break;
9741     case 23: str = "15 Digit"; break;
9742     case 24: str = "Local Call"; break;
9743     case 25: str = "Intra-LATA Toll Call"; break;
9744     case 26: str = "Inter-LATA Toll Call"; break;
9745     case 27: str = "World Zone Call"; break;
9746     case 28: str = "International Call"; break;
9747     case 29: str = "Unrecognized Number"; break;
9748     case 30: str = "Prior Agreement"; break;
9749     case 31: str = "Specific Called Party Digit String"; break;
9750     case 32: str = "Mobile Termination"; break;
9751     case 33: str = "Advanced Termination"; break;
9752     case 34: str = "Location"; break;
9753     case 35: str = "Locally Allowed Specific Digit String"; break;
9754     case 36: str = "Origination Attempt Authorized"; break;
9755     case 37: str = "Calling Routing Address Available"; break;
9756     case 38: str = "Initial Termination"; break;
9757     case 39: str = "Called Routing Address Available"; break;
9758     case 40: str = "O Answer"; break;
9759     case 41: str = "O Disconnect"; break;
9760     case 42: str = "O Called Party Busy"; break;
9761     case 43: str = "O No Answer"; break;
9762     case 64: str = "Terminating Resource Available"; break;
9763     case 65: str = "T Busy"; break;
9764     case 66: str = "T No Answer"; break;
9765     case 67: str = "T No Page Response"; break;
9766     case 68: str = "T Unroutable"; break;
9767     case 69: str = "T Answer"; break;
9768     case 70: str = "T Disconnect"; break;
9769     case 220: str = "Reserved for TDP-R DP Type value"; break;
9770     case 221: str = "Reserved for TDP-N DP Type value"; break;
9771     case 222: str = "Reserved for EDP-R DP Type value"; break;
9772     case 223: str = "Reserved for EDP-N DP Type value"; break;
9773     default:
9774         if ((value >= 44) && (value <= 63)) { str = "Reserved, treat as Unspecified"; }
9775         else if ((value >= 71) && (value <= 219)) { str = "Reserved, treat as Unspecified"; }
9776         else { str = "Reserved for protocol extension, treat as Unspecified"; }
9777         break;
9778     }
9779
9780     return(str);
9781 }
9782
9783 static void
9784 param_trig_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9785 {
9786     gint32 value;
9787     guint saved_offset;
9788
9789     EXACT_DATA_CHECK(len, 1);
9790
9791     add_string = add_string;
9792     saved_offset = asn1->offset;
9793
9794     asn1_int32_value_decode(asn1, 1, &value);
9795
9796     proto_tree_add_text(tree, asn1->tvb,
9797         saved_offset, asn1->offset - saved_offset,
9798         "Trigger (%u) %s",
9799         value,
9800         find_trig_type(value));
9801 }
9802
9803 static void
9804 param_win_op_cap(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9805 {
9806     gint32 value;
9807     guint saved_offset;
9808     gchar *str = NULL;
9809
9810     add_string = add_string;
9811     saved_offset = asn1->offset;
9812
9813     asn1_int32_value_decode(asn1, 1, &value);
9814
9815     other_decode_bitfield_value(bigbuf, value, 0xf8, 8);
9816     proto_tree_add_text(tree, asn1->tvb,
9817         saved_offset, asn1->offset - saved_offset,
9818         "%s :  Reserved",
9819         bigbuf);
9820
9821     switch ((value & 0x04) >> 2)
9822     {
9823     case 0x00: str = "Sender does not support PositionRequest OP"; break;
9824     default:
9825         str = "Sender supports PositionRequest OP";
9826         break;
9827     }
9828
9829     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
9830     proto_tree_add_text(tree, asn1->tvb,
9831         saved_offset, asn1->offset - saved_offset,
9832         "%s :  %s",
9833         bigbuf, str);
9834
9835     switch ((value & 0x02) >> 1)
9836     {
9837     case 0x00: str = "Sender does not support CallControlDirective OP"; break;
9838     default:
9839         str = "Sender supports CallControlDirective OP";
9840         break;
9841     }
9842
9843     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
9844     proto_tree_add_text(tree, asn1->tvb,
9845         saved_offset, asn1->offset - saved_offset,
9846         "%s :  %s",
9847         bigbuf, str);
9848
9849     switch (value & 0x01)
9850     {
9851     case 0x00: str = "Sender does not support ConnectResource, DisconnectResource, ConnectionFailureReport and ResetTimer (SSFT timer) OPs"; break;
9852     default:
9853         str = "Sender supports ConnectResource, DisconnectResource, ConnectionFailureReport and ResetTimer (SSFT timer) OPs";
9854         break;
9855     }
9856
9857     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
9858     proto_tree_add_text(tree, asn1->tvb,
9859         saved_offset, asn1->offset - saved_offset,
9860         "%s :  %s",
9861         bigbuf, str);
9862
9863     EXTRANEOUS_DATA_CHECK(len, 1);
9864 }
9865
9866 static void
9867 param_win_trig_list(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9868 {
9869     gint32 value, i, j;
9870     guint saved_offset;
9871
9872     add_string = add_string;
9873     saved_offset = asn1->offset;
9874
9875     j = 0;
9876     i = 0;
9877
9878     do
9879     {
9880         asn1_int32_value_decode(asn1, 1, &value);
9881
9882         switch (value)
9883         {
9884         case 0xdc:
9885             proto_tree_add_text(tree, asn1->tvb,
9886                 saved_offset, asn1->offset - saved_offset,
9887                 "TDP-R's armed");
9888
9889             j = 0;
9890             break;
9891
9892         case 0xdd:
9893             proto_tree_add_text(tree, asn1->tvb,
9894                 saved_offset, asn1->offset - saved_offset,
9895                 "TDP-N's armed");
9896
9897             j = 0;
9898             break;
9899
9900         case 0xde:
9901             proto_tree_add_text(tree, asn1->tvb,
9902                 saved_offset, asn1->offset - saved_offset,
9903                 "EDP-R's armed");
9904
9905             j = 0;
9906             break;
9907
9908         case 0xdf:
9909             proto_tree_add_text(tree, asn1->tvb,
9910                 saved_offset, asn1->offset - saved_offset,
9911                 "EDP-N's armed");
9912
9913             j = 0;
9914             break;
9915
9916         default:
9917             proto_tree_add_text(tree, asn1->tvb,
9918                 saved_offset, asn1->offset - saved_offset,
9919                 "[%u] (%u) %s",
9920                 j,
9921                 value,
9922                 find_trig_type(value));
9923             j++;
9924             break;
9925         }
9926
9927         saved_offset = asn1->offset;
9928         i++;
9929     }
9930     while ((len - i) > 0);
9931 }
9932
9933 static void
9934 param_trans_cap(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
9935 {
9936     gint32 value;
9937     guint saved_offset;
9938     gchar *str = NULL;
9939     char *p;
9940
9941     add_string = add_string;
9942     saved_offset = asn1->offset;
9943
9944     asn1_int32_value_decode(asn1, 1, &value);
9945
9946     switch ((value & 0x80) >> 7)
9947     {
9948     case 0x00: str = "System is not capable of supporting CNAP/CNAR (NAMI)"; break;
9949     default:
9950         str = "System is capable of supporting CNAP/CNAR (NAMI)";
9951         break;
9952     }
9953
9954     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
9955     proto_tree_add_text(tree, asn1->tvb,
9956         saved_offset, asn1->offset - saved_offset,
9957         "%s :  %s",
9958         bigbuf, str);
9959
9960     switch ((value & 0x40) >> 6)
9961     {
9962     case 0x00: str = "System is not capable of supporting NDSS"; break;
9963     default:
9964         str = "System is capable of supporting NDSS";
9965         break;
9966     }
9967
9968     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
9969     proto_tree_add_text(tree, asn1->tvb,
9970         saved_offset, asn1->offset - saved_offset,
9971         "%s :  %s",
9972         bigbuf, str);
9973
9974     switch ((value & 0x20) >> 5)
9975     {
9976     case 0x00: str = "System is not capable of supporting User Zones (UZCI)"; break;
9977     default:
9978         str = "System is capable of supporting User Zones (UZCI)";
9979         break;
9980     }
9981
9982     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
9983     proto_tree_add_text(tree, asn1->tvb,
9984         saved_offset, asn1->offset - saved_offset,
9985         "%s :  %s",
9986         bigbuf, str);
9987
9988     switch ((value & 0x10) >> 4)
9989     {
9990     case 0x00: str = "System is not capable of supporting local SPINI"; break;
9991     default:
9992         str = "System is capable of supporting local SPINI";
9993         break;
9994     }
9995
9996     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
9997     proto_tree_add_text(tree, asn1->tvb,
9998         saved_offset, asn1->offset - saved_offset,
9999         "%s :  %s",
10000         bigbuf, str);
10001
10002     switch ((value & 0x08) >> 3)
10003     {
10004     case 0x00: str = "System is not capable of interacting with the user (RUI)"; break;
10005     default:
10006         str = "System is capable of interacting with the user (RUI)";
10007         break;
10008     }
10009
10010     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
10011     proto_tree_add_text(tree, asn1->tvb,
10012         saved_offset, asn1->offset - saved_offset,
10013         "%s :  %s",
10014         bigbuf, str);
10015
10016     switch ((value & 0x04) >> 2)
10017     {
10018     case 0x00: str = "System is not capable of honoring the Announcement List parameter (ANN)"; break;
10019     default:
10020         str = "System is capable of honoring the Announcement List parameter (ANN)";
10021         break;
10022     }
10023
10024     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
10025     proto_tree_add_text(tree, asn1->tvb,
10026         saved_offset, asn1->offset - saved_offset,
10027         "%s :  %s",
10028         bigbuf, str);
10029
10030     switch ((value & 0x02) >> 1)
10031     {
10032     case 0x00: str = "System is not capable of detecting a busy condition (BUSY)"; break;
10033     default:
10034         str = "System is capable of detecting a busy condition (BUSY)";
10035         break;
10036     }
10037
10038     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
10039     proto_tree_add_text(tree, asn1->tvb,
10040         saved_offset, asn1->offset - saved_offset,
10041         "%s :  %s",
10042         bigbuf, str);
10043
10044     switch (value & 0x01)
10045     {
10046     case 0x00: str = "System is not capable of supporting the IS-41-C profile parameter (PROFILE)"; break;
10047     default:
10048         str = "System is capable of supporting the IS-41-C profile parameter (PROFILE)";
10049         break;
10050     }
10051
10052     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
10053     proto_tree_add_text(tree, asn1->tvb,
10054         saved_offset, asn1->offset - saved_offset,
10055         "%s :  %s",
10056         bigbuf, str);
10057
10058     if (len == 1) return;
10059
10060     saved_offset = asn1->offset;
10061
10062     asn1_int32_value_decode(asn1, 1, &value);
10063
10064     switch ((value & 0x80) >> 7)
10065     {
10066     case 0x00: str = "System is not capable of supporting the CDMA Over the Air Parameter Administration"; break;
10067     default:
10068         str = "System is capable of supporting the CDMA Over the Air Parameter Administration";
10069         break;
10070     }
10071
10072     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
10073     proto_tree_add_text(tree, asn1->tvb,
10074         saved_offset, asn1->offset - saved_offset,
10075         "%s :  %s",
10076         bigbuf, str);
10077
10078     switch ((value & 0x40) >> 6)
10079     {
10080     case 0x00: str = "System is not capable of supporting lower layer segmentation & reassembly (S&R)"; break;
10081     default:
10082         str = "System is capable of supporting lower layer segmentation & reassembly (S&R)";
10083         break;
10084     }
10085
10086     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
10087     proto_tree_add_text(tree, asn1->tvb,
10088         saved_offset, asn1->offset - saved_offset,
10089         "%s :  %s",
10090         bigbuf, str);
10091
10092     switch ((value & 0x20) >> 5)
10093     {
10094     case 0x00: str = "System is not capable of supporting the Trigger Address List parameter (WADDR)"; break;
10095     default:
10096         str = "System is capable of supporting the Trigger Address List parameter (WADDR)";
10097         break;
10098     }
10099
10100     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
10101     proto_tree_add_text(tree, asn1->tvb,
10102         saved_offset, asn1->offset - saved_offset,
10103         "%s :  %s",
10104         bigbuf, str);
10105
10106     switch ((value & 0x10) >> 4)
10107     {
10108     case 0x00: str = "System is not capable of supporting the Termination List parameter (TL)"; break;
10109     default:
10110         str = "System is capable of supporting the Termination List parameter (TL)";
10111         break;
10112     }
10113
10114     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
10115     proto_tree_add_text(tree, asn1->tvb,
10116         saved_offset, asn1->offset - saved_offset,
10117         "%s :  %s",
10118         bigbuf, str);
10119
10120     p = other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
10121     switch (value & 0x0f)
10122     {
10123     case 0x00: strcat(p, " :  System cannot accept a termination at this time"); break;
10124     default:
10125         sprintf(p, " :  System supports %u call leg(s)", value & 0x0f);
10126         break;
10127     }
10128
10129     proto_tree_add_text(tree, asn1->tvb,
10130         saved_offset, asn1->offset - saved_offset,
10131         "%s",
10132         bigbuf);
10133
10134     if (len == 2) return;
10135
10136     saved_offset = asn1->offset;
10137
10138     asn1_int32_value_decode(asn1, 1, &value);
10139
10140     other_decode_bitfield_value(bigbuf, value, 0xf8, 8);
10141     proto_tree_add_text(tree, asn1->tvb,
10142         saved_offset, asn1->offset - saved_offset,
10143         "%s :  Reserved",
10144         bigbuf);
10145
10146     switch ((value & 0x04) >> 2)
10147     {
10148     case 0x00: str = "The system is not capable of supporting external MAHO requests"; break;
10149     default:
10150         str = "The system is capable of supporting external MAHO requests (e.g. for positioning)";
10151         break;
10152     }
10153
10154     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
10155     proto_tree_add_text(tree, asn1->tvb,
10156         saved_offset, asn1->offset - saved_offset,
10157         "%s :  %s",
10158         bigbuf, str);
10159
10160     other_decode_bitfield_value(bigbuf, value, 0x03, 8);
10161     proto_tree_add_text(tree, asn1->tvb,
10162         saved_offset, asn1->offset - saved_offset,
10163         "%s :  Reserved",
10164         bigbuf);
10165
10166     EXTRANEOUS_DATA_CHECK(len, 3);
10167 }
10168
10169 static void
10170 param_spini_trig(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
10171 {
10172     gint32 value;
10173     guint saved_offset;
10174     gchar *str = NULL;
10175
10176     SHORT_DATA_CHECK(len, 4);
10177
10178     add_string = add_string;
10179     saved_offset = asn1->offset;
10180
10181     asn1_int32_value_decode(asn1, 1, &value);
10182
10183     switch ((value & 0x80) >> 7)
10184     {
10185     case 0x00: str = "Trigger is not active"; break;
10186     default:
10187         str = "Execute local SPINI procedures for any Revertive Call attempt"; break;
10188         break;
10189     }
10190
10191     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
10192     proto_tree_add_text(tree, asn1->tvb,
10193         saved_offset, asn1->offset - saved_offset,
10194         "%s :  Revertive Call (RvtC), %s",
10195         bigbuf, str);
10196
10197     switch ((value & 0x40) >> 6)
10198     {
10199     case 0x00: str = "Trigger is not active"; break;
10200     default:
10201         str = "Execute local SPINI procedures for any call attempt to an unrecognized number"; break;
10202         break;
10203     }
10204
10205     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
10206     proto_tree_add_text(tree, asn1->tvb,
10207         saved_offset, asn1->offset - saved_offset,
10208         "%s :  Unrecognized Number (Unrec), %s",
10209         bigbuf, str);
10210
10211     switch ((value & 0x20) >> 5)
10212     {
10213     case 0x00: str = "Trigger is not active"; break;
10214     default:
10215         str = "Execute local SPINI procedures for any call attempt outside of the current World Zone (as defined in ITU-T Rec. E.164)";
10216         break;
10217     }
10218
10219     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
10220     proto_tree_add_text(tree, asn1->tvb,
10221         saved_offset, asn1->offset - saved_offset,
10222         "%s :  World Zone (WZ), %s",
10223         bigbuf, str);
10224
10225     switch ((value & 0x10) >> 4)
10226     {
10227     case 0x00: str = "Trigger is not active"; break;
10228     default:
10229         str = "Execute local SPINI procedures for any international call attempt";
10230         break;
10231     }
10232
10233     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
10234     proto_tree_add_text(tree, asn1->tvb,
10235         saved_offset, asn1->offset - saved_offset,
10236         "%s :  International (Intl), %s",
10237         bigbuf, str);
10238
10239     switch ((value & 0x08) >> 3)
10240     {
10241     case 0x00: str = "Trigger is not active"; break;
10242     default:
10243         str = "Execute local SPINI procedures for any toll calls outside the local carrier's serving area";
10244         break;
10245     }
10246
10247     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
10248     proto_tree_add_text(tree, asn1->tvb,
10249         saved_offset, asn1->offset - saved_offset,
10250         "%s :  Non-Local (Inter-LATA) Toll (NLTOLL/OLATA), %s",
10251         bigbuf, str);
10252
10253     switch ((value & 0x04) >> 2)
10254     {
10255     case 0x00: str = "Trigger is not active"; break;
10256     default:
10257         str = "Execute local SPINI procedures for any local toll call attempt.  Refers to intra-LATA toll within the NANP";
10258         break;
10259     }
10260
10261     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
10262     proto_tree_add_text(tree, asn1->tvb,
10263         saved_offset, asn1->offset - saved_offset,
10264         "%s :  Local (Intra-LATA) Toll (LTOLL/ILATA), %s",
10265         bigbuf, str);
10266
10267     switch ((value & 0x02) >> 1)
10268     {
10269     case 0x00: str = "Trigger is not active"; break;
10270     default:
10271         str = "Execute local SPINI procedures for any local call attempt";
10272         break;
10273     }
10274
10275     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
10276     proto_tree_add_text(tree, asn1->tvb,
10277         saved_offset, asn1->offset - saved_offset,
10278         "%s :  Local, %s",
10279         bigbuf, str);
10280
10281     switch (value & 0x01)
10282     {
10283     case 0x00: str = "Trigger is not active"; break;
10284     default:
10285         str = "Execute local SPINI procedures for any call attempt. This overrides all other values.";
10286         break;
10287     }
10288
10289     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
10290     proto_tree_add_text(tree, asn1->tvb,
10291         saved_offset, asn1->offset - saved_offset,
10292         "%s :  All Origination (All), %s",
10293         bigbuf, str);
10294
10295     saved_offset = asn1->offset;
10296
10297     asn1_int32_value_decode(asn1, 1, &value);
10298
10299     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
10300     proto_tree_add_text(tree, asn1->tvb,
10301         saved_offset, asn1->offset - saved_offset,
10302         "%s :  Reserved",
10303         bigbuf);
10304
10305     switch ((value & 0x10) >> 4)
10306     {
10307     case 0x00: str = "Trigger is not active"; break;
10308     default:
10309         str = "Execute local SPINI procedures for any number matching a criteria of a prior agreement";
10310         break;
10311     }
10312
10313     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
10314     proto_tree_add_text(tree, asn1->tvb,
10315         saved_offset, asn1->offset - saved_offset,
10316         "%s :  Prior Agreement (PA), %s",
10317         bigbuf, str);
10318
10319     switch ((value & 0x08) >> 3)
10320     {
10321     case 0x00: str = "Trigger is not active"; break;
10322     default:
10323         str = "Execute local SPINI procedures for any number beginning with two Pound ## digits";
10324         break;
10325     }
10326
10327     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
10328     proto_tree_add_text(tree, asn1->tvb,
10329         saved_offset, asn1->offset - saved_offset,
10330         "%s :  Double Pound (DP), %s",
10331         bigbuf, str);
10332
10333     switch ((value & 0x04) >> 2)
10334     {
10335     case 0x00: str = "Trigger is not active"; break;
10336     default:
10337         str = "Execute local SPINI procedures for any number beginning with a Pound # digit";
10338         break;
10339     }
10340
10341     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
10342     proto_tree_add_text(tree, asn1->tvb,
10343         saved_offset, asn1->offset - saved_offset,
10344         "%s :  Pound, %s",
10345         bigbuf, str);
10346
10347     switch ((value & 0x02) >> 1)
10348     {
10349     case 0x00: str = "Trigger is not active"; break;
10350     default:
10351         str = "Execute local SPINI procedures for any number beginning with two Star ** digits";
10352         break;
10353     }
10354
10355     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
10356     proto_tree_add_text(tree, asn1->tvb,
10357         saved_offset, asn1->offset - saved_offset,
10358         "%s :  Double Star (DS), %s",
10359         bigbuf, str);
10360
10361     switch (value & 0x01)
10362     {
10363     case 0x00: str = "Trigger is not active"; break;
10364     default:
10365         str = "Execute local SPINI procedures for any number beginning with a Star * digit";
10366         break;
10367     }
10368
10369     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
10370     proto_tree_add_text(tree, asn1->tvb,
10371         saved_offset, asn1->offset - saved_offset,
10372         "%s :  Star, %s",
10373         bigbuf, str);
10374
10375     saved_offset = asn1->offset;
10376
10377     asn1_int32_value_decode(asn1, 1, &value);
10378
10379     switch ((value & 0x80) >> 7)
10380     {
10381     case 0x00: str = "Trigger is not active"; break;
10382     default:
10383         str = "Execute local SPINI procedures for any call attempt with 7 digits";
10384         break;
10385     }
10386
10387     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
10388     proto_tree_add_text(tree, asn1->tvb,
10389         saved_offset, asn1->offset - saved_offset,
10390         "%s :  7 digits, %s",
10391         bigbuf, str);
10392
10393     switch ((value & 0x40) >> 6)
10394     {
10395     case 0x00: str = "Trigger is not active"; break;
10396     default:
10397         str = "Execute local SPINI procedures for any call attempt with 6 digits";
10398         break;
10399     }
10400
10401     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
10402     proto_tree_add_text(tree, asn1->tvb,
10403         saved_offset, asn1->offset - saved_offset,
10404         "%s :  6 digits, %s",
10405         bigbuf, str);
10406
10407     switch ((value & 0x20) >> 5)
10408     {
10409     case 0x00: str = "Trigger is not active"; break;
10410     default:
10411         str = "Execute local SPINI procedures for any call attempt with 5 digits";
10412         break;
10413     }
10414
10415     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
10416     proto_tree_add_text(tree, asn1->tvb,
10417         saved_offset, asn1->offset - saved_offset,
10418         "%s :  5 digits, %s",
10419         bigbuf, str);
10420
10421     switch ((value & 0x10) >> 4)
10422     {
10423     case 0x00: str = "Trigger is not active"; break;
10424     default:
10425         str = "Execute local SPINI procedures for any call attempt with 4 digits";
10426         break;
10427     }
10428
10429     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
10430     proto_tree_add_text(tree, asn1->tvb,
10431         saved_offset, asn1->offset - saved_offset,
10432         "%s :  4 digits, %s",
10433         bigbuf, str);
10434
10435     switch ((value & 0x08) >> 3)
10436     {
10437     case 0x00: str = "Trigger is not active"; break;
10438     default:
10439         str = "Execute local SPINI procedures for any call attempt with 3 digits";
10440         break;
10441     }
10442
10443     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
10444     proto_tree_add_text(tree, asn1->tvb,
10445         saved_offset, asn1->offset - saved_offset,
10446         "%s :  3 digits, %s",
10447         bigbuf, str);
10448
10449     switch ((value & 0x04) >> 2)
10450     {
10451     case 0x00: str = "Trigger is not active"; break;
10452     default:
10453         str = "Execute local SPINI procedures for any call attempt with 2 digits";
10454         break;
10455     }
10456
10457     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
10458     proto_tree_add_text(tree, asn1->tvb,
10459         saved_offset, asn1->offset - saved_offset,
10460         "%s :  2 digits, %s",
10461         bigbuf, str);
10462
10463     switch ((value & 0x02) >> 1)
10464     {
10465     case 0x00: str = "Trigger is not active"; break;
10466     default:
10467         str = "Execute local SPINI procedures for any call attempt with 1 digits";
10468         break;
10469     }
10470
10471     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
10472     proto_tree_add_text(tree, asn1->tvb,
10473         saved_offset, asn1->offset - saved_offset,
10474         "%s :  1 digits, %s",
10475         bigbuf, str);
10476
10477     switch (value & 0x01)
10478     {
10479     case 0x00: str = "Trigger is not active"; break;
10480     default:
10481         str = "Execute local SPINI procedures for any call attempt with no digits";
10482         break;
10483     }
10484
10485     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
10486     proto_tree_add_text(tree, asn1->tvb,
10487         saved_offset, asn1->offset - saved_offset,
10488         "%s :  No digits, %s",
10489         bigbuf, str);
10490
10491     saved_offset = asn1->offset;
10492
10493     asn1_int32_value_decode(asn1, 1, &value);
10494
10495     switch ((value & 0x80) >> 7)
10496     {
10497     case 0x00: str = "Trigger is not active"; break;
10498     default:
10499         str = "Execute local SPINI procedures for any call attempt with 15 or more digits";
10500         break;
10501     }
10502
10503     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
10504     proto_tree_add_text(tree, asn1->tvb,
10505         saved_offset, asn1->offset - saved_offset,
10506         "%s :  15 digits, %s",
10507         bigbuf, str);
10508
10509     switch ((value & 0x40) >> 6)
10510     {
10511     case 0x00: str = "Trigger is not active"; break;
10512     default:
10513         str = "Execute local SPINI procedures for any call attempt with 14 digits";
10514         break;
10515     }
10516
10517     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
10518     proto_tree_add_text(tree, asn1->tvb,
10519         saved_offset, asn1->offset - saved_offset,
10520         "%s :  14 digits, %s",
10521         bigbuf, str);
10522
10523     switch ((value & 0x20) >> 5)
10524     {
10525     case 0x00: str = "Trigger is not active"; break;
10526     default:
10527         str = "Execute local SPINI procedures for any call attempt with 13 digits";
10528         break;
10529     }
10530
10531     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
10532     proto_tree_add_text(tree, asn1->tvb,
10533         saved_offset, asn1->offset - saved_offset,
10534         "%s :  13 digits, %s",
10535         bigbuf, str);
10536
10537     switch ((value & 0x10) >> 4)
10538     {
10539     case 0x00: str = "Trigger is not active"; break;
10540     default:
10541         str = "Execute local SPINI procedures for any call attempt with 12 digits";
10542         break;
10543     }
10544
10545     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
10546     proto_tree_add_text(tree, asn1->tvb,
10547         saved_offset, asn1->offset - saved_offset,
10548         "%s :  12 digits, %s",
10549         bigbuf, str);
10550
10551     switch ((value & 0x08) >> 3)
10552     {
10553     case 0x00: str = "Trigger is not active"; break;
10554     default:
10555         str = "Execute local SPINI procedures for any call attempt with 11 digits";
10556         break;
10557     }
10558
10559     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
10560     proto_tree_add_text(tree, asn1->tvb,
10561         saved_offset, asn1->offset - saved_offset,
10562         "%s :  11 digits, %s",
10563         bigbuf, str);
10564
10565     switch ((value & 0x04) >> 2)
10566     {
10567     case 0x00: str = "Trigger is not active"; break;
10568     default:
10569         str = "Execute local SPINI procedures for any call attempt with 10 digits";
10570         break;
10571     }
10572
10573     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
10574     proto_tree_add_text(tree, asn1->tvb,
10575         saved_offset, asn1->offset - saved_offset,
10576         "%s :  10 digits, %s",
10577         bigbuf, str);
10578
10579     switch ((value & 0x02) >> 1)
10580     {
10581     case 0x00: str = "Trigger is not active"; break;
10582     default:
10583         str = "Execute local SPINI procedures for any call attempt with 9 digits";
10584         break;
10585     }
10586
10587     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
10588     proto_tree_add_text(tree, asn1->tvb,
10589         saved_offset, asn1->offset - saved_offset,
10590         "%s :  9 digits, %s",
10591         bigbuf, str);
10592
10593     switch (value & 0x01)
10594     {
10595     case 0x00: str = "Trigger is not active"; break;
10596     default:
10597         str = "Execute local SPINI procedures for any call attempt with 8 digits";
10598         break;
10599     }
10600
10601     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
10602     proto_tree_add_text(tree, asn1->tvb,
10603         saved_offset, asn1->offset - saved_offset,
10604         "%s :  8 digits, %s",
10605         bigbuf, str);
10606
10607     EXTRANEOUS_DATA_CHECK(len, 4);
10608 }
10609
10610 static void
10611 param_orig_trig(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
10612 {
10613     gint32 value;
10614     guint saved_offset;
10615     gchar *str = NULL;
10616
10617     SHORT_DATA_CHECK(len, 4);
10618
10619     add_string = add_string;
10620     saved_offset = asn1->offset;
10621
10622     asn1_int32_value_decode(asn1, 1, &value);
10623
10624     switch ((value & 0x80) >> 7)
10625     {
10626     case 0x00: str = "Trigger is not active"; break;
10627     default:
10628         str = "Launch an Origination Request for any Revertive Call attempt"; break;
10629         break;
10630     }
10631
10632     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
10633     proto_tree_add_text(tree, asn1->tvb,
10634         saved_offset, asn1->offset - saved_offset,
10635         "%s :  Revertive Call (RvtC), %s",
10636         bigbuf, str);
10637
10638     switch ((value & 0x40) >> 6)
10639     {
10640     case 0x00: str = "Trigger is not active"; break;
10641     default:
10642         str = "Launch an Origination Request for any call attempt to an unrecognized number"; break;
10643         break;
10644     }
10645
10646     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
10647     proto_tree_add_text(tree, asn1->tvb,
10648         saved_offset, asn1->offset - saved_offset,
10649         "%s :  Unrecognized Number (Unrec), %s",
10650         bigbuf, str);
10651
10652     switch ((value & 0x20) >> 5)
10653     {
10654     case 0x00: str = "Trigger is not active"; break;
10655     default:
10656         str = "Launch an Origination Request for any call attempt outside of the current World Zone (as defined in ITU-T Rec. E.164)";
10657         break;
10658     }
10659
10660     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
10661     proto_tree_add_text(tree, asn1->tvb,
10662         saved_offset, asn1->offset - saved_offset,
10663         "%s :  World Zone (WZ), %s",
10664         bigbuf, str);
10665
10666     switch ((value & 0x10) >> 4)
10667     {
10668     case 0x00: str = "Trigger is not active"; break;
10669     default:
10670         str = "Launch an Origination Request for any international call attempt";
10671         break;
10672     }
10673
10674     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
10675     proto_tree_add_text(tree, asn1->tvb,
10676         saved_offset, asn1->offset - saved_offset,
10677         "%s :  International (Intl), %s",
10678         bigbuf, str);
10679
10680     switch ((value & 0x08) >> 3)
10681     {
10682     case 0x00: str = "Trigger is not active"; break;
10683     default:
10684         str = "Launch an Origination Request for any toll calls outside the local carrier's serving area";
10685         break;
10686     }
10687
10688     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
10689     proto_tree_add_text(tree, asn1->tvb,
10690         saved_offset, asn1->offset - saved_offset,
10691         "%s :  Non-Local (Inter-LATA) Toll (NLTOLL/OLATA), %s",
10692         bigbuf, str);
10693
10694     switch ((value & 0x04) >> 2)
10695     {
10696     case 0x00: str = "Trigger is not active"; break;
10697     default:
10698         str = "Launch an Origination Request for any local toll call attempt.  Refers to intra-LATA toll within the NANP";
10699         break;
10700     }
10701
10702     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
10703     proto_tree_add_text(tree, asn1->tvb,
10704         saved_offset, asn1->offset - saved_offset,
10705         "%s :  Local (Intra-LATA) Toll (LTOLL/ILATA), %s",
10706         bigbuf, str);
10707
10708     switch ((value & 0x02) >> 1)
10709     {
10710     case 0x00: str = "Trigger is not active"; break;
10711     default:
10712         str = "Launch an Origination Request for any local call attempt";
10713         break;
10714     }
10715
10716     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
10717     proto_tree_add_text(tree, asn1->tvb,
10718         saved_offset, asn1->offset - saved_offset,
10719         "%s :  Local, %s",
10720         bigbuf, str);
10721
10722     switch (value & 0x01)
10723     {
10724     case 0x00: str = "Trigger is not active"; break;
10725     default:
10726         str = "Launch an Origination Request for any call attempt. This overrides all other values.";
10727         break;
10728     }
10729
10730     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
10731     proto_tree_add_text(tree, asn1->tvb,
10732         saved_offset, asn1->offset - saved_offset,
10733         "%s :  All Origination (All), %s",
10734         bigbuf, str);
10735
10736     saved_offset = asn1->offset;
10737
10738     asn1_int32_value_decode(asn1, 1, &value);
10739
10740     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
10741     proto_tree_add_text(tree, asn1->tvb,
10742         saved_offset, asn1->offset - saved_offset,
10743         "%s :  Reserved",
10744         bigbuf);
10745
10746     switch ((value & 0x10) >> 4)
10747     {
10748     case 0x00: str = "Trigger is not active"; break;
10749     default:
10750         str = "Launch an Origination Request for any number matching a criteria of a prior agreement";
10751         break;
10752     }
10753
10754     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
10755     proto_tree_add_text(tree, asn1->tvb,
10756         saved_offset, asn1->offset - saved_offset,
10757         "%s :  Prior Agreement (PA), %s",
10758         bigbuf, str);
10759
10760     switch ((value & 0x08) >> 3)
10761     {
10762     case 0x00: str = "Trigger is not active"; break;
10763     default:
10764         str = "Launch an Origination Request for any number beginning with two Pound ## digits";
10765         break;
10766     }
10767
10768     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
10769     proto_tree_add_text(tree, asn1->tvb,
10770         saved_offset, asn1->offset - saved_offset,
10771         "%s :  Double Pound (DP), %s",
10772         bigbuf, str);
10773
10774     switch ((value & 0x04) >> 2)
10775     {
10776     case 0x00: str = "Trigger is not active"; break;
10777     default:
10778         str = "Launch an Origination Request for any number beginning with a Pound # digit";
10779         break;
10780     }
10781
10782     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
10783     proto_tree_add_text(tree, asn1->tvb,
10784         saved_offset, asn1->offset - saved_offset,
10785         "%s :  Pound, %s",
10786         bigbuf, str);
10787
10788     switch ((value & 0x02) >> 1)
10789     {
10790     case 0x00: str = "Trigger is not active"; break;
10791     default:
10792         str = "Launch an Origination Request for any number beginning with two Star ** digits";
10793         break;
10794     }
10795
10796     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
10797     proto_tree_add_text(tree, asn1->tvb,
10798         saved_offset, asn1->offset - saved_offset,
10799         "%s :  Double Star (DS), %s",
10800         bigbuf, str);
10801
10802     switch (value & 0x01)
10803     {
10804     case 0x00: str = "Trigger is not active"; break;
10805     default:
10806         str = "Launch an Origination Request for any number beginning with a Star * digit";
10807         break;
10808     }
10809
10810     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
10811     proto_tree_add_text(tree, asn1->tvb,
10812         saved_offset, asn1->offset - saved_offset,
10813         "%s :  Star, %s",
10814         bigbuf, str);
10815
10816     saved_offset = asn1->offset;
10817
10818     asn1_int32_value_decode(asn1, 1, &value);
10819
10820     switch ((value & 0x80) >> 7)
10821     {
10822     case 0x00: str = "Trigger is not active"; break;
10823     default:
10824         str = "Launch an Origination Request for any call attempt with 7 digits";
10825         break;
10826     }
10827
10828     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
10829     proto_tree_add_text(tree, asn1->tvb,
10830         saved_offset, asn1->offset - saved_offset,
10831         "%s :  7 digits, %s",
10832         bigbuf, str);
10833
10834     switch ((value & 0x40) >> 6)
10835     {
10836     case 0x00: str = "Trigger is not active"; break;
10837     default:
10838         str = "Launch an Origination Request for any call attempt with 6 digits";
10839         break;
10840     }
10841
10842     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
10843     proto_tree_add_text(tree, asn1->tvb,
10844         saved_offset, asn1->offset - saved_offset,
10845         "%s :  6 digits, %s",
10846         bigbuf, str);
10847
10848     switch ((value & 0x20) >> 5)
10849     {
10850     case 0x00: str = "Trigger is not active"; break;
10851     default:
10852         str = "Launch an Origination Request for any call attempt with 5 digits";
10853         break;
10854     }
10855
10856     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
10857     proto_tree_add_text(tree, asn1->tvb,
10858         saved_offset, asn1->offset - saved_offset,
10859         "%s :  5 digits, %s",
10860         bigbuf, str);
10861
10862     switch ((value & 0x10) >> 4)
10863     {
10864     case 0x00: str = "Trigger is not active"; break;
10865     default:
10866         str = "Launch an Origination Request for any call attempt with 4 digits";
10867         break;
10868     }
10869
10870     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
10871     proto_tree_add_text(tree, asn1->tvb,
10872         saved_offset, asn1->offset - saved_offset,
10873         "%s :  4 digits, %s",
10874         bigbuf, str);
10875
10876     switch ((value & 0x08) >> 3)
10877     {
10878     case 0x00: str = "Trigger is not active"; break;
10879     default:
10880         str = "Launch an Origination Request for any call attempt with 3 digits";
10881         break;
10882     }
10883
10884     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
10885     proto_tree_add_text(tree, asn1->tvb,
10886         saved_offset, asn1->offset - saved_offset,
10887         "%s :  3 digits, %s",
10888         bigbuf, str);
10889
10890     switch ((value & 0x04) >> 2)
10891     {
10892     case 0x00: str = "Trigger is not active"; break;
10893     default:
10894         str = "Launch an Origination Request for any call attempt with 2 digits";
10895         break;
10896     }
10897
10898     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
10899     proto_tree_add_text(tree, asn1->tvb,
10900         saved_offset, asn1->offset - saved_offset,
10901         "%s :  2 digits, %s",
10902         bigbuf, str);
10903
10904     switch ((value & 0x02) >> 1)
10905     {
10906     case 0x00: str = "Trigger is not active"; break;
10907     default:
10908         str = "Launch an Origination Request for any call attempt with 1 digits";
10909         break;
10910     }
10911
10912     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
10913     proto_tree_add_text(tree, asn1->tvb,
10914         saved_offset, asn1->offset - saved_offset,
10915         "%s :  1 digits, %s",
10916         bigbuf, str);
10917
10918     switch (value & 0x01)
10919     {
10920     case 0x00: str = "Trigger is not active"; break;
10921     default:
10922         str = "Launch an Origination Request for any call attempt with no digits";
10923         break;
10924     }
10925
10926     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
10927     proto_tree_add_text(tree, asn1->tvb,
10928         saved_offset, asn1->offset - saved_offset,
10929         "%s :  No digits, %s",
10930         bigbuf, str);
10931
10932     saved_offset = asn1->offset;
10933
10934     asn1_int32_value_decode(asn1, 1, &value);
10935
10936     switch ((value & 0x80) >> 7)
10937     {
10938     case 0x00: str = "Trigger is not active"; break;
10939     default:
10940         str = "Launch an Origination Request for any call attempt with 15 or more digits";
10941         break;
10942     }
10943
10944     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
10945     proto_tree_add_text(tree, asn1->tvb,
10946         saved_offset, asn1->offset - saved_offset,
10947         "%s :  15 digits, %s",
10948         bigbuf, str);
10949
10950     switch ((value & 0x40) >> 6)
10951     {
10952     case 0x00: str = "Trigger is not active"; break;
10953     default:
10954         str = "Launch an Origination Request for any call attempt with 14 digits";
10955         break;
10956     }
10957
10958     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
10959     proto_tree_add_text(tree, asn1->tvb,
10960         saved_offset, asn1->offset - saved_offset,
10961         "%s :  14 digits, %s",
10962         bigbuf, str);
10963
10964     switch ((value & 0x20) >> 5)
10965     {
10966     case 0x00: str = "Trigger is not active"; break;
10967     default:
10968         str = "Launch an Origination Request for any call attempt with 13 digits";
10969         break;
10970     }
10971
10972     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
10973     proto_tree_add_text(tree, asn1->tvb,
10974         saved_offset, asn1->offset - saved_offset,
10975         "%s :  13 digits, %s",
10976         bigbuf, str);
10977
10978     switch ((value & 0x10) >> 4)
10979     {
10980     case 0x00: str = "Trigger is not active"; break;
10981     default:
10982         str = "Launch an Origination Request for any call attempt with 12 digits";
10983         break;
10984     }
10985
10986     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
10987     proto_tree_add_text(tree, asn1->tvb,
10988         saved_offset, asn1->offset - saved_offset,
10989         "%s :  12 digits, %s",
10990         bigbuf, str);
10991
10992     switch ((value & 0x08) >> 3)
10993     {
10994     case 0x00: str = "Trigger is not active"; break;
10995     default:
10996         str = "Launch an Origination Request for any call attempt with 11 digits";
10997         break;
10998     }
10999
11000     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
11001     proto_tree_add_text(tree, asn1->tvb,
11002         saved_offset, asn1->offset - saved_offset,
11003         "%s :  11 digits, %s",
11004         bigbuf, str);
11005
11006     switch ((value & 0x04) >> 2)
11007     {
11008     case 0x00: str = "Trigger is not active"; break;
11009     default:
11010         str = "Launch an Origination Request for any call attempt with 10 digits";
11011         break;
11012     }
11013
11014     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
11015     proto_tree_add_text(tree, asn1->tvb,
11016         saved_offset, asn1->offset - saved_offset,
11017         "%s :  10 digits, %s",
11018         bigbuf, str);
11019
11020     switch ((value & 0x02) >> 1)
11021     {
11022     case 0x00: str = "Trigger is not active"; break;
11023     default:
11024         str = "Launch an Origination Request for any call attempt with 9 digits";
11025         break;
11026     }
11027
11028     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
11029     proto_tree_add_text(tree, asn1->tvb,
11030         saved_offset, asn1->offset - saved_offset,
11031         "%s :  9 digits, %s",
11032         bigbuf, str);
11033
11034     switch (value & 0x01)
11035     {
11036     case 0x00: str = "Trigger is not active"; break;
11037     default:
11038         str = "Launch an Origination Request for any call attempt with 8 digits";
11039         break;
11040     }
11041
11042     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
11043     proto_tree_add_text(tree, asn1->tvb,
11044         saved_offset, asn1->offset - saved_offset,
11045         "%s :  8 digits, %s",
11046         bigbuf, str);
11047
11048     EXTRANEOUS_DATA_CHECK(len, 4);
11049 }
11050
11051 static void
11052 param_trig_cap(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
11053 {
11054     gint32 value;
11055     guint saved_offset;
11056     gchar *str = NULL;
11057
11058     add_string = add_string;
11059     saved_offset = asn1->offset;
11060
11061     asn1_int32_value_decode(asn1, 1, &value);
11062
11063     switch ((value & 0x80) >> 7)
11064     {
11065     case 0x00: str = "O No Answer (ONA) cannot be armed"; break;
11066     default:
11067         str = "O No Answer (ONA) can be armed";
11068         break;
11069     }
11070
11071     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
11072     proto_tree_add_text(tree, asn1->tvb,
11073         saved_offset, asn1->offset - saved_offset,
11074         "%s :  %s",
11075         bigbuf, str);
11076
11077     switch ((value & 0x40) >> 6)
11078     {
11079     case 0x00: str = "O Disconnect (ODISC) cannot be armed"; break;
11080     default:
11081         str = "O Disconnect (ODISC) can be armed";
11082         break;
11083     }
11084
11085     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
11086     proto_tree_add_text(tree, asn1->tvb,
11087         saved_offset, asn1->offset - saved_offset,
11088         "%s :  %s",
11089         bigbuf, str);
11090
11091     switch ((value & 0x20) >> 5)
11092     {
11093     case 0x00: str = "O Answer (OANS) cannot be armed"; break;
11094     default:
11095         str = "O Answer (OANS) can be armed";
11096         break;
11097     }
11098
11099     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
11100     proto_tree_add_text(tree, asn1->tvb,
11101         saved_offset, asn1->offset - saved_offset,
11102         "%s :  %s",
11103         bigbuf, str);
11104
11105     switch ((value & 0x10) >> 4)
11106     {
11107     case 0x00: str = "Origination Attempt Authorized (OAA) cannot be armed"; break;
11108     default:
11109         str = "Origination Attempt Authorized (OAA) can be armed";
11110         break;
11111     }
11112
11113     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
11114     proto_tree_add_text(tree, asn1->tvb,
11115         saved_offset, asn1->offset - saved_offset,
11116         "%s :  %s",
11117         bigbuf, str);
11118
11119     switch ((value & 0x08) >> 3)
11120     {
11121     case 0x00: str = "Revertive Call trigger (RvtC) cannot be armed"; break;
11122     default:
11123         str = "Revertive Call trigger (RvtC) can be armed";
11124         break;
11125     }
11126
11127     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
11128     proto_tree_add_text(tree, asn1->tvb,
11129         saved_offset, asn1->offset - saved_offset,
11130         "%s :  %s",
11131         bigbuf, str);
11132
11133     switch ((value & 0x04) >> 2)
11134     {
11135     case 0x00: str = "All Calls trigger (All) cannot be armed"; break;
11136     default:
11137         str = "All Calls trigger (All) can be armed";
11138         break;
11139     }
11140
11141     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
11142     proto_tree_add_text(tree, asn1->tvb,
11143         saved_offset, asn1->offset - saved_offset,
11144         "%s :  %s",
11145         bigbuf, str);
11146
11147     switch ((value & 0x02) >> 1)
11148     {
11149     case 0x00: str = "K-digit triggers (K-digit) cannot be armed"; break;
11150     default:
11151         str = "K-digit triggers (K-digit) can be armed";
11152         break;
11153     }
11154
11155     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
11156     proto_tree_add_text(tree, asn1->tvb,
11157         saved_offset, asn1->offset - saved_offset,
11158         "%s :  %s",
11159         bigbuf, str);
11160
11161     switch (value & 0x01)
11162     {
11163     case 0x00: str = "Introducing Star/Pound triggers (INIT) cannot be armed"; break;
11164     default:
11165         str = "Introducing Star/Pound triggers (INIT) can be armed";
11166         break;
11167     }
11168
11169     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
11170     proto_tree_add_text(tree, asn1->tvb,
11171         saved_offset, asn1->offset - saved_offset,
11172         "%s :  %s",
11173         bigbuf, str);
11174
11175     if (len == 1) return;
11176
11177     saved_offset = asn1->offset;
11178
11179     asn1_int32_value_decode(asn1, 1, &value);
11180
11181     switch ((value & 0x80) >> 7)
11182     {
11183     case 0x00: str = "O Called Party Busy (OBSY) cannot be armed"; break;
11184     default:
11185         str = "O Called Party Busy (OBSY) can be armed";
11186         break;
11187     }
11188
11189     other_decode_bitfield_value(bigbuf, value, 0x80, 8);
11190     proto_tree_add_text(tree, asn1->tvb,
11191         saved_offset, asn1->offset - saved_offset,
11192         "%s :  %s",
11193         bigbuf, str);
11194
11195     switch ((value & 0x40) >> 6)
11196     {
11197     case 0x00: str = "Called Routing Address Available (CdRAA) cannot be armed"; break;
11198     default:
11199         str = "Called Routing Address Available (CdRAA) can be armed";
11200         break;
11201     }
11202
11203     other_decode_bitfield_value(bigbuf, value, 0x40, 8);
11204     proto_tree_add_text(tree, asn1->tvb,
11205         saved_offset, asn1->offset - saved_offset,
11206         "%s :  %s",
11207         bigbuf, str);
11208
11209     switch ((value & 0x20) >> 5)
11210     {
11211     case 0x00: str = "Initial Termination (IT) cannot be armed"; break;
11212     default:
11213         str = "Initial Termination (IT) can be armed";
11214         break;
11215     }
11216
11217     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
11218     proto_tree_add_text(tree, asn1->tvb,
11219         saved_offset, asn1->offset - saved_offset,
11220         "%s :  %s",
11221         bigbuf, str);
11222
11223     switch ((value & 0x10) >> 4)
11224     {
11225     case 0x00: str = "Calling Routing Address Available (CgRAA) cannot be armed"; break;
11226     default:
11227         str = "Calling Routing Address Available (CgRAA) can be armed";
11228         break;
11229     }
11230
11231     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
11232     proto_tree_add_text(tree, asn1->tvb,
11233         saved_offset, asn1->offset - saved_offset,
11234         "%s :  %s",
11235         bigbuf, str);
11236
11237     switch ((value & 0x08) >> 3)
11238     {
11239     case 0x00: str = "Advanced Termination trigger (AT) cannot be armed"; break;
11240     default:
11241         str = "Advanced Termination trigger (AT) can be armed";
11242         break;
11243     }
11244
11245     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
11246     proto_tree_add_text(tree, asn1->tvb,
11247         saved_offset, asn1->offset - saved_offset,
11248         "%s :  %s",
11249         bigbuf, str);
11250
11251     switch ((value & 0x04) >> 2)
11252     {
11253     case 0x00: str = "Prior Agreement trigger (PA) cannot be armed"; break;
11254     default:
11255         str = "Prior Agreement trigger (PA) can be armed";
11256         break;
11257     }
11258
11259     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
11260     proto_tree_add_text(tree, asn1->tvb,
11261         saved_offset, asn1->offset - saved_offset,
11262         "%s :  %s",
11263         bigbuf, str);
11264
11265     switch ((value & 0x02) >> 1)
11266     {
11267     case 0x00: str = "Unrecognized Number trigger (Unrec) cannot be armed"; break;
11268     default:
11269         str = "Unrecognized Number trigger (Unrec) can be armed";
11270         break;
11271     }
11272
11273     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
11274     proto_tree_add_text(tree, asn1->tvb,
11275         saved_offset, asn1->offset - saved_offset,
11276         "%s :  %s",
11277         bigbuf, str);
11278
11279     switch (value & 0x01)
11280     {
11281     case 0x00: str = "Call Type triggers (CT) cannot be armed"; break;
11282     default:
11283         str = "Call Type triggers (CT) can be armed";
11284         break;
11285     }
11286
11287     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
11288     proto_tree_add_text(tree, asn1->tvb,
11289         saved_offset, asn1->offset - saved_offset,
11290         "%s :  %s",
11291         bigbuf, str);
11292
11293     if (len == 2) return;
11294
11295     saved_offset = asn1->offset;
11296
11297     asn1_int32_value_decode(asn1, 1, &value);
11298
11299     other_decode_bitfield_value(bigbuf, value, 0xe0, 8);
11300     proto_tree_add_text(tree, asn1->tvb,
11301         saved_offset, asn1->offset - saved_offset,
11302         "%s :  Reserved",
11303         bigbuf);
11304
11305     switch ((value & 0x10) >> 4)
11306     {
11307     case 0x00: str = "T Disconnect (TDISC) cannot be armed"; break;
11308     default:
11309         str = "T Disconnect (TDISC) can be armed";
11310         break;
11311     }
11312
11313     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
11314     proto_tree_add_text(tree, asn1->tvb,
11315         saved_offset, asn1->offset - saved_offset,
11316         "%s :  %s",
11317         bigbuf, str);
11318
11319     switch ((value & 0x08) >> 3)
11320     {
11321     case 0x00: str = "T Answer (TANS) cannot be armed"; break;
11322     default:
11323         str = "T Answer (TANS) can be armed";
11324         break;
11325     }
11326
11327     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
11328     proto_tree_add_text(tree, asn1->tvb,
11329         saved_offset, asn1->offset - saved_offset,
11330         "%s :  %s",
11331         bigbuf, str);
11332
11333     switch ((value & 0x04) >> 2)
11334     {
11335     case 0x00: str = "T No Answer trigger (TNA) cannot be armed"; break;
11336     default:
11337         str = "T No Answer trigger (TNA) can be armed";
11338         break;
11339     }
11340
11341     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
11342     proto_tree_add_text(tree, asn1->tvb,
11343         saved_offset, asn1->offset - saved_offset,
11344         "%s :  %s",
11345         bigbuf, str);
11346
11347     switch ((value & 0x02) >> 1)
11348     {
11349     case 0x00: str = "T Busy trigger (TBusy) cannot be armed"; break;
11350     default:
11351         str = "T Busy trigger (TBusy) can be armed";
11352         break;
11353     }
11354
11355     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
11356     proto_tree_add_text(tree, asn1->tvb,
11357         saved_offset, asn1->offset - saved_offset,
11358         "%s :  %s",
11359         bigbuf, str);
11360
11361     switch (value & 0x01)
11362     {
11363     case 0x00: str = "Terminating Resource Available triggers (TRA) cannot be armed"; break;
11364     default:
11365         str = "Terminating Resource Available triggers (TRA) can be armed";
11366         break;
11367     }
11368
11369     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
11370     proto_tree_add_text(tree, asn1->tvb,
11371         saved_offset, asn1->offset - saved_offset,
11372         "%s :  %s",
11373         bigbuf, str);
11374
11375     EXTRANEOUS_DATA_CHECK(len, 3);
11376 }
11377
11378 static void
11379 param_sys_cap(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
11380 {
11381     gint32 value;
11382     guint saved_offset;
11383     gchar *str = NULL;
11384
11385     EXACT_DATA_CHECK(len, 1);
11386
11387     add_string = add_string;
11388     saved_offset = asn1->offset;
11389
11390     asn1_int32_value_decode(asn1, 1, &value);
11391
11392     other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
11393     proto_tree_add_text(tree, asn1->tvb,
11394         saved_offset, asn1->offset - saved_offset,
11395         "%s :  Reserved",
11396         bigbuf);
11397
11398     switch ((value & 0x20) >> 5)
11399     {
11400     case 0x00: str = "DP is not supported by the system"; break;
11401     default:
11402         str = "DP is supported by the system";
11403         break;
11404     }
11405
11406     other_decode_bitfield_value(bigbuf, value, 0x20, 8);
11407     proto_tree_add_text(tree, asn1->tvb,
11408         saved_offset, asn1->offset - saved_offset,
11409         "%s :  %s",
11410         bigbuf, str);
11411
11412     switch ((value & 0x10) >> 4)
11413     {
11414     case 0x00: str = "SSD is not shared with the system for the indicated MS"; break;
11415     default:
11416         str = "SSD is shared with the system for the indicated MS";
11417         break;
11418     }
11419
11420     other_decode_bitfield_value(bigbuf, value, 0x10, 8);
11421     proto_tree_add_text(tree, asn1->tvb,
11422         saved_offset, asn1->offset - saved_offset,
11423         "%s :  %s",
11424         bigbuf, str);
11425
11426     switch ((value & 0x08) >> 3)
11427     {
11428     case 0x00: str = "System cannot execute CAVE algorithm"; break;
11429     default:
11430         str = "System can execute CAVE algorithm";
11431         break;
11432     }
11433
11434     other_decode_bitfield_value(bigbuf, value, 0x08, 8);
11435     proto_tree_add_text(tree, asn1->tvb,
11436         saved_offset, asn1->offset - saved_offset,
11437         "%s :  %s",
11438         bigbuf, str);
11439
11440     switch ((value & 0x04) >> 2)
11441     {
11442     case 0x00: str = "Voice Privacy is not supported"; break;
11443     default:
11444         str = "Voice Privacy is supported";
11445         break;
11446     }
11447
11448     other_decode_bitfield_value(bigbuf, value, 0x04, 8);
11449     proto_tree_add_text(tree, asn1->tvb,
11450         saved_offset, asn1->offset - saved_offset,
11451         "%s :  %s",
11452         bigbuf, str);
11453
11454     switch ((value & 0x02) >> 1)
11455     {
11456     case 0x00: str = "SME is not supported"; break;
11457     default:
11458         str = "SME is supported";
11459         break;
11460     }
11461
11462     other_decode_bitfield_value(bigbuf, value, 0x02, 8);
11463     proto_tree_add_text(tree, asn1->tvb,
11464         saved_offset, asn1->offset - saved_offset,
11465         "%s :  %s",
11466         bigbuf, str);
11467
11468     switch (value & 0x01)
11469     {
11470     case 0x00: str = "Authentication parameters were not requested"; break;
11471     default:
11472         str = "Authentication parameters were requested";
11473         break;
11474     }
11475
11476     other_decode_bitfield_value(bigbuf, value, 0x01, 8);
11477     proto_tree_add_text(tree, asn1->tvb,
11478         saved_offset, asn1->offset - saved_offset,
11479         "%s :  %s",
11480         bigbuf, str);
11481 }
11482
11483 static void
11484 param_act_code(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
11485 {
11486     gint32 value;
11487     guint saved_offset;
11488     gchar *str = NULL;
11489
11490     add_string = add_string;
11491     saved_offset = asn1->offset;
11492
11493     asn1_int32_value_decode(asn1, 1, &value);
11494
11495     switch (value)
11496     {
11497     case 0: str = "Not used"; break;
11498     case 1: str = "Continue processing"; break;
11499     case 2: str = "Disconnect call"; break;
11500     case 3: str = "Disconnect call leg"; break;
11501     case 4: str = "Conference calling drop last party"; break;
11502     case 5: str = "Bridge call leg(s) to conference call"; break;
11503     case 6: str = "Drop call leg on busy or routing failure"; break;
11504     case 7: str = "Disconnect all call legs"; break;
11505     case 8: str = "Attach MSC to OTAF"; break;
11506     case 9: str = "Initiate Registration Notification"; break;
11507     case 10: str = "Generate Public Encryption values"; break;
11508     case 11: str = "Generate A-Key"; break;
11509     case 12: str = "Perform SSD Update procedure"; break;
11510     case 13: str = "Perform Re-authentication procedure"; break;
11511     case 14: str = "Release TRN"; break;
11512     case 15: str = "Commit A-key"; break;
11513     case 16: str = "Release Resources"; break;
11514     case 17: str = "Record NEWMSID"; break;
11515     case 18: str = "Allocate Resources"; break;
11516     case 19: str = "Generate Authentication Signature"; break;
11517     case 20: str = "Release leg and redirect subscriber"; break;
11518     case 21: str = "Do Not Wait For MS User Level Response"; break;
11519     default:
11520         if ((value >= 22) && (value <= 95)) { str = "Reserved, treat as Continue processing"; }
11521         if ((value >= 96) && (value <= 127)) { str = "Reserved for protocol extension, treat as Continue processing"; }
11522         if ((value >= 128) && (value <= 223)) { str = "Reserved, treat as Disconnect call"; }
11523         else { str = "Reserved for protocol extension, treat as Disconnect call"; }
11524         break;
11525     }
11526
11527     proto_tree_add_text(tree, asn1->tvb,
11528         saved_offset, asn1->offset - saved_offset,
11529         "Action Code, %s (%u)",
11530         str,
11531         value);
11532
11533     EXTRANEOUS_DATA_CHECK(len, 1);
11534 }
11535
11536 static void
11537 param_border_acc(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
11538 {
11539     gint32 value;
11540     guint saved_offset;
11541     gchar *str = NULL;
11542
11543     EXACT_DATA_CHECK(len, 1);
11544
11545     add_string = add_string;
11546     saved_offset = asn1->offset;
11547
11548     asn1_int32_value_decode(asn1, 1, &value);
11549
11550     switch (value)
11551     {
11552     case 0: str = "Not used"; break;
11553     case 1: str = "Border Cell Access"; break;
11554     default:
11555         if ((value >= 2) && (value <= 223)) { str = "Reserved, treat as Border Cell Access"; }
11556         else { str = "Reserved for protocol extension, treat as Border Cell Access"; }
11557         break;
11558     }
11559
11560     proto_tree_add_text(tree, asn1->tvb,
11561         saved_offset, asn1->offset - saved_offset,
11562         "Indication, %s (%u)",
11563         str,
11564         value);
11565 }
11566
11567 static void
11568 param_avail_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
11569 {
11570     gint32 value;
11571     guint saved_offset;
11572     gchar *str = NULL;
11573
11574     add_string = add_string;
11575     saved_offset = asn1->offset;
11576
11577     asn1_int32_value_decode(asn1, 1, &value);
11578
11579     switch (value)
11580     {
11581     case 0: str = "Not used"; break;
11582     case 1: str = "Unspecified MS inactivity type"; break;
11583     default:
11584         if ((value >= 2) && (value <= 223)) { str = "Reserved, treat as Unspecified"; }
11585         else { str = "Reserved for protocol extension, treat as Unspecified"; }
11586         break;
11587     }
11588
11589     proto_tree_add_text(tree, asn1->tvb,
11590         saved_offset, asn1->offset - saved_offset,
11591         str);
11592
11593     EXTRANEOUS_DATA_CHECK(len, 1);
11594 }
11595
11596 static void
11597 param_can_type(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
11598 {
11599     gint32 value;
11600     guint saved_offset;
11601     gchar *str = NULL;
11602
11603     add_string = add_string;
11604     saved_offset = asn1->offset;
11605
11606     asn1_int32_value_decode(asn1, 1, &value);
11607
11608     switch (value)
11609     {
11610     case 0: str = "Not used"; break;
11611     case 1: str = "Serving System Option.  The serving system may discontinue a call or service in progress at its option."; break;
11612     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;
11613     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;
11614     default:
11615         if ((value >= 4) && (value <= 223)) { str = "Reserved, treat as Serving System Option"; }
11616         else { str = "Reserved for protocol extension, treat as Serving System Option"; }
11617         break;
11618     }
11619
11620     proto_tree_add_text(tree, asn1->tvb,
11621         saved_offset, asn1->offset - saved_offset,
11622         str);
11623
11624     EXTRANEOUS_DATA_CHECK(len, 1);
11625 }
11626
11627 static void
11628 param_can_den(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
11629 {
11630     gint32 value;
11631     guint saved_offset;
11632     gchar *str = NULL;
11633
11634     EXACT_DATA_CHECK(len, 1);
11635
11636     add_string = add_string;
11637     saved_offset = asn1->offset;
11638
11639     asn1_int32_value_decode(asn1, 1, &value);
11640
11641     switch (value)
11642     {
11643     case 0: str = "Not used"; break;
11644     case 1: str = "Multiple Access"; break;
11645     case 2: str = "Busy"; break;
11646     default:
11647         if ((value >= 3) && (value <= 223)) { str = "Reserved, treat as Multiple Access"; }
11648         else { str = "Reserved for protocol extension, treat as Multiple Access"; }
11649         break;
11650     }
11651
11652     proto_tree_add_text(tree, asn1->tvb,
11653         saved_offset, asn1->offset - saved_offset,
11654         "Indication, %s (%u)",
11655         str,
11656         value);
11657 }
11658
11659 static void
11660 param_acc_den(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
11661 {
11662     gint32 value;
11663     guint saved_offset;
11664     gchar *str = NULL;
11665
11666     EXACT_DATA_CHECK(len, 1);
11667
11668     add_string = add_string;
11669     saved_offset = asn1->offset;
11670
11671     asn1_int32_value_decode(asn1, 1, &value);
11672
11673     switch (value)
11674     {
11675     case 0: str = "Not used"; break;
11676     case 1: str = "Unassigned directory number"; break;
11677     case 2: str = "Inactive"; break;
11678     case 3: str = "Busy"; break;
11679     case 4: str = "Termination denied"; break;
11680     case 5: str = "No Page response"; break;
11681     case 6: str = "Unavailable"; break;
11682     case 7: str = "Service Rejected by MS"; break;
11683     case 8: str = "Service Rejected by the System"; break;
11684     case 9: str = "Service Type Mismatch"; break;
11685     case 10: str = "Service Denied"; break;
11686     case 11: str = "Call Rejected"; break;
11687     default:
11688         if ((value >= 12) && (value <= 223)) { str = "Reserved, treat as Termination denied"; }
11689         else { str = "Reserved for protocol extension, treat as Termination denied"; }
11690         break;
11691     }
11692
11693     proto_tree_add_text(tree, asn1->tvb,
11694         saved_offset, asn1->offset - saved_offset,
11695         "Access Denied Reason, %s (%u)",
11696         str,
11697         value);
11698 }
11699
11700 static void
11701 param_sms_acc_den_reason(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
11702 {
11703     gint32 value;
11704     guint saved_offset;
11705     gchar *str = NULL;
11706
11707     add_string = add_string;
11708     saved_offset = asn1->offset;
11709
11710     asn1_int32_value_decode(asn1, 1, &value);
11711
11712     switch (value)
11713     {
11714     case 0: str = "Not used"; break;
11715     case 1: str = "Denied"; break;
11716     case 2: str = "Postponed"; break;
11717     case 3: str = "Unavailable"; break;
11718     case 4: str = "Invalid"; break;
11719     default:
11720         if ((value >= 5) && (value <= 63)) { str = "Reserved, treat as Denied"; }
11721         else if ((value >= 64) && (value <= 127)) { str = "Reserved, treat as Postponed"; }
11722         else if ((value >= 128) && (value <= 223)) { str = "Reserved, treat as Unavailable"; }
11723         else { str = "Reserved for protocol extension, treat as Unavailable"; }
11724         break;
11725     }
11726
11727     proto_tree_add_text(tree, asn1->tvb,
11728         saved_offset, asn1->offset - saved_offset,
11729         "Access Denied Reason, %s (%u)",
11730         str,
11731         value);
11732
11733     EXTRANEOUS_DATA_CHECK(len, 1);
11734 }
11735
11736 static void
11737 param_sms_bd(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
11738 {
11739     tvbuff_t *next_tvb;
11740
11741     add_string = add_string;
11742
11743     next_tvb = tvb_new_subset(asn1->tvb, asn1->offset, len, len);
11744
11745     if (ansi_map_sms_tele_id != -1)
11746     {
11747         dissector_try_port(is637_tele_id_dissector_table, ansi_map_sms_tele_id, next_tvb, g_pinfo, g_tree);
11748         ansi_map_sms_tele_id = -1;
11749     }
11750     else if (is683_ota)
11751     {
11752         dissector_try_port(is683_dissector_table, ansi_map_is_invoke ? 0 : 1, next_tvb, g_pinfo, g_tree);
11753     }
11754     else if (is801_pld)
11755     {
11756         dissector_try_port(is801_dissector_table, ansi_map_is_invoke ? 0 : 1, next_tvb, g_pinfo, g_tree);
11757     }
11758
11759     proto_tree_add_text(tree, asn1->tvb,
11760         asn1->offset, len,
11761         "Parameter Data");
11762
11763     asn1->offset += len;
11764 }
11765
11766 static void
11767 param_sms_cause(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
11768 {
11769     gint32 value;
11770     guint saved_offset;
11771     gchar *str = NULL;
11772
11773     add_string = add_string;
11774     saved_offset = asn1->offset;
11775
11776     asn1_int32_value_decode(asn1, 1, &value);
11777
11778     switch (value)
11779     {
11780     case 0: str = "Address vacant"; break;
11781     case 1: str = "Address translation failure"; break;
11782     case 2: str = "Network resource shortage"; break;
11783     case 3: str = "Network failure"; break;
11784     case 4: str = "Invalid Teleservice ID"; break;
11785     case 5: str = "Other network problem"; break;
11786     case 6: str = "Unsupported network interface"; break;
11787     case 32: str = "No page response"; break;
11788     case 33: str = "Destination busy"; break;
11789     case 34: str = "No acknowledgement"; break;
11790     case 35: str = "Destination resource shortage"; break;
11791     case 36: str = "SMS delivery postponed"; break;
11792     case 37: str = "Destination out of service"; break;
11793     case 38: str = "Destination no longer at this address"; break;
11794     case 39: str = "Other terminal problem"; break;
11795     case 64: str = "Radio interface resource shortage"; break;
11796     case 65: str = "Radio interface incompatibility"; break;
11797     case 66: str = "Other radio interface problem"; break;
11798     case 67: str = "Unsupported Base Station Capability"; break;
11799     case 96: str = "Encoding problem"; break;
11800     case 97: str = "Service origination denied"; break;
11801     case 98: str = "Service termination denied"; break;
11802     case 99: str = "Supplementary service not supported"; break;
11803     case 100: str = "Service not supported"; break;
11804     case 101: str = "Reserved"; break;
11805     case 102: str = "Missing expected parameter"; break;
11806     case 103: str = "Missing mandatory parameter"; break;
11807     case 104: str = "Unrecognized parameter value"; break;
11808     case 105: str = "Unexpected parameter value"; break;
11809     case 106: str = "User Data size error"; break;
11810     case 107: str = "Other general problems"; break;
11811     case 108: str = "Session not active"; break;
11812     default:
11813         if ((value >= 7) && (value <= 31)) { str = "Reserved, treat as Other network problem"; }
11814         else if ((value >= 40) && (value <= 47)) { str = "Reserved, treat as Other terminal problem"; }
11815         else if ((value >= 48) && (value <= 63)) { str = "Reserved, treat as SMS delivery postponed"; }
11816         else if ((value >= 68) && (value <= 95)) { str = "Reserved, treat as Other radio interface problem"; }
11817         else if ((value >= 109) && (value <= 223)) { str = "Reserved, treat as Other general problems"; }
11818         else { str = "Reserved for protocol extension, treat as Other general problems"; }
11819         break;
11820     }
11821
11822     proto_tree_add_text(tree, asn1->tvb,
11823         saved_offset, asn1->offset - saved_offset,
11824         "%s (%u)",
11825         str,
11826         value);
11827
11828     EXTRANEOUS_DATA_CHECK(len, 1);
11829 }
11830
11831 static void
11832 param_cdma_soci(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
11833 {
11834     gint32 value;
11835     guint saved_offset;
11836
11837     add_string = add_string;
11838     saved_offset = asn1->offset;
11839
11840     asn1_int32_value_decode(asn1, 1, &value);
11841
11842     proto_tree_add_text(tree, asn1->tvb,
11843         saved_offset, asn1->offset - saved_offset,
11844         "Value %u",
11845         value);
11846
11847     EXTRANEOUS_DATA_CHECK(len, 1);
11848 }
11849
11850 static void
11851 param_int(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
11852 {
11853     gint32 value;
11854     guint saved_offset;
11855
11856     add_string = add_string;
11857
11858     if (len > 4)
11859     {
11860         proto_tree_add_text(tree, asn1->tvb,
11861             asn1->offset, len, "Long Data (?)");
11862         asn1->offset += len;
11863         return;
11864     }
11865
11866     saved_offset = asn1->offset;
11867
11868     asn1_int32_value_decode(asn1, len, &value);
11869
11870     proto_tree_add_text(tree, asn1->tvb,
11871         saved_offset, asn1->offset - saved_offset,
11872         "Value %u",
11873         value);
11874 }
11875
11876 static void
11877 param_pc_ssn(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
11878 {
11879     gint32 value, b1, b2, b3, b4;
11880     guint saved_offset;
11881     gchar *str = NULL;
11882
11883     EXACT_DATA_CHECK(len, 5);
11884
11885     add_string = add_string;
11886     saved_offset = asn1->offset;
11887
11888     asn1_int32_value_decode(asn1, 1, &value);
11889
11890     switch (value)
11891     {
11892     case 0: str = "Not specified"; break;
11893     case 1: str = "Serving MSC"; break;
11894     case 2: str = "Home MSC"; break;
11895     case 3: str = "Gateway MSC"; break;
11896     case 4: str = "HLR"; break;
11897     case 5: str = "VLR"; break;
11898     case 6: str = "EIR (reserved)"; break;
11899     case 7: str = "AC"; break;
11900     case 8: str = "Border MSC"; break;
11901     case 9: str = "Originating MSC"; break;
11902     default:
11903         if ((value >= 10) && (value <= 223)) { str = "Reserved, treat as Not specified"; }
11904         else { str = "Reserved for protocol extension, treat as Not specified"; }
11905         break;
11906     }
11907
11908     proto_tree_add_text(tree, asn1->tvb,
11909         saved_offset, asn1->offset - saved_offset,
11910         "Type (%u) %s",
11911         value,
11912         str);
11913
11914     asn1_int32_value_decode(asn1, 1, &b1);
11915     asn1_int32_value_decode(asn1, 1, &b2);
11916     asn1_int32_value_decode(asn1, 1, &b3);
11917     asn1_int32_value_decode(asn1, 1, &b4);
11918
11919     proto_tree_add_text(tree, asn1->tvb,
11920         saved_offset, asn1->offset - saved_offset,
11921         "Point Code %u-%u-%u  SSN %u",
11922         b3, b2, b1, b4);
11923 }
11924
11925 static void
11926 param_lai(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
11927 {
11928     gint32 value;
11929     guint saved_offset;
11930
11931     EXACT_DATA_CHECK(len, 2);
11932
11933     add_string = add_string;
11934     saved_offset = asn1->offset;
11935
11936     asn1_int32_value_decode(asn1, 2, &value);
11937
11938     proto_tree_add_text(tree, asn1->tvb,
11939         saved_offset, asn1->offset - saved_offset,
11940         "LAI %u (0x%04x)",
11941         value,
11942         value);
11943 }
11944
11945 static void
11946 param_list(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
11947 {
11948     guint saved_offset;
11949     guint num_parms;
11950
11951     add_string = add_string;
11952     num_parms = 0;
11953     saved_offset = asn1->offset;
11954
11955     while (len > (asn1->offset - saved_offset))
11956     {
11957         num_parms++;
11958
11959         if (!dissect_ansi_param(asn1, tree))
11960         {
11961             proto_tree_add_text(tree,
11962                 asn1->tvb, asn1->offset, len - (asn1->offset - saved_offset),
11963                 "Unknown Parameter Data");
11964
11965             asn1->offset = saved_offset + len;
11966             break;
11967         }
11968     }
11969
11970     sprintf(add_string, " - (%u)", num_parms);
11971 }
11972
11973
11974 #define NUM_PARAM_1 (sizeof(ansi_param_1_strings)/sizeof(value_string))
11975 static gint ett_ansi_param_1[NUM_PARAM_1];
11976 static void (*param_1_fcn[])(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string) = {
11977     param_bill_id,      /* Billing ID */
11978     param_int,  /* Serving Cell ID */
11979     param_int,  /* Target Cell ID */
11980     param_digits,       /* Digits */
11981     param_chan_data,    /* Channel Data */
11982     param_cic,  /* Inter MSC Circuit ID */
11983     param_int,  /* Inter Switch Count */
11984     param_min,  /* Mobile Identification Number */
11985     param_esn,  /* Electronic Serial Number */
11986     param_rel_reason,   /* Release Reason */
11987     param_sig_qual,     /* Signal Quality */
11988     param_scm,  /* Station Class Mark */
11989     param_auth_den,     /* Authorization Denied */
11990     param_auth_per,     /* Authorization Period */
11991     param_seizure,      /* Seizure Type */
11992     param_trunk_stat,   /* Trunk Status */
11993     param_qic,  /* Qualification Information Code */
11994     param_feat_result,  /* Feature Result */
11995     param_red_reason,   /* Redirection Reason */
11996     param_acc_den,      /* Access Denied Reason */
11997     param_mscid,        /* MSCID */
11998     param_sys_type_code,        /* System My Type Code */
11999     param_orig_ind,     /* Origination Indicator */
12000     param_term_res,     /* Termination Restriction Code */
12001     param_calling_feat_ind,     /* Calling Features Indicator */
12002     param_faulty,       /* Faulty Parameter */
12003     param_usage_ind,    /* Usage Indicator */
12004     param_tdma_chan_data,       /* TDMA Channel Data */
12005     param_tdma_call_mode,       /* TDMA Call Mode */
12006     param_ho_reason,    /* Handoff Reason */
12007     NULL,       /* NONE */
12008 };
12009
12010
12011 #define NUM_PARAM_2 (sizeof(ansi_param_2_strings)/sizeof(value_string))
12012 static gint ett_ansi_param_2[NUM_PARAM_2];
12013 static void (*param_2_fcn[])(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string) = {
12014     param_tdma_burst_ind,       /* TDMA Burst Indicator */
12015     param_pc_ssn,       /* PC_SSN */
12016     param_lai,  /* Location Area ID */
12017     param_sys_acc_type, /* System Access Type */
12018     param_auth_resp_all,        /* Authentication Response */
12019     param_auth_resp_all,        /* Authentication Response Base Station */
12020     param_auth_resp_all,        /* Authentication Response Unique Challenge */
12021     param_int,  /* Call History Count */
12022     param_confid_mode,  /* Confidentiality Modes */
12023     param_int,  /* Random Variable */
12024     param_int,  /* Random Variable Base station */
12025     param_rand_ssd,     /* Random Variable SSD */
12026     param_rand_unique,  /* Random Variable Unique Challenge */
12027     param_report_type,  /* Report Type */
12028     param_sme_key,      /* Signaling Message Encryption Key */
12029     param_ssd,  /* Shared Secret Data */
12030     param_term_type,    /* Terminal Type */
12031     param_vpmask,       /* Voice Privacy Mask */
12032     param_sys_cap,      /* System Capabilities */
12033     param_deny_acc,     /* Deny Access */
12034     param_upd_count,    /* Update Count */
12035     param_ssd_no_share, /* SSD Not Shared */
12036     param_ext_mscid,    /* Extended MSCID */
12037     param_ext_sys_type_code,    /* Extended System My Type Code */
12038     param_ctrl_chan_data,       /* Control Channel Data */
12039     param_sys_acc_data, /* System Access Data */
12040     param_can_den,      /* Cancellation Denied */
12041     param_border_acc,   /* Border Cell Access */
12042     param_cdma_scm,     /* CDMA Station Class Mark */
12043     param_int,  /* CDMA Serving One Way Delay */
12044     param_int,  /* CDMA Target One Way Delay */
12045     param_cdma_call_mode,       /* CDMA Call Mode */
12046     param_cdma_chan_data,       /* CDMA Channel Data */
12047     param_cdma_sig_qual,        /* CDMA Signal Quality */
12048     param_cdma_pilot_strength,  /* CDMA Pilot Strength */
12049     param_mob_rev,      /* CDMA Mobile Protocol Revision */
12050     param_cdma_plcm,    /* CDMA Private Long Code Mask */
12051     param_cdma_code_chan,       /* CDMA Code Channel */
12052     param_cdma_sea_win, /* CDMA Search Window */
12053     param_ms_loc,       /* MS Location */
12054     param_page_ind,     /* Page Indicator */
12055     param_rec_sig_qual, /* Received Signal Quality */
12056     param_dereg,        /* Deregistration Type */
12057     param_namps_chan_data,      /* NAMPS Channel Data */
12058     param_alert_code,   /* Alert Code */
12059     param_ann_code,     /* Announcement Code */
12060     param_aav,  /* Authentication Algorithm Version */
12061     param_auth_cap,     /* Authentication Capability */
12062     param_int,  /* Call History Count Expected */
12063     param_digits,       /* Calling Party Number Digits 1 */
12064     param_digits,       /* Calling Party Number Digits 2 */
12065     param_digits,       /* Calling Party Number String 1 */
12066     param_digits,       /* Calling Party Number String 2 */
12067     param_sub_addr,     /* Calling Party Subaddress */
12068     param_can_type,     /* Cancellation Type */
12069     param_digits,       /* Carrier Digits */
12070     param_digits,       /* Destination Digits */
12071     param_dmh_red_ind,  /* DMH Redirection Indicator */
12072     param_list, /* Inter System Termination */
12073     param_avail_type,   /* Availability Type */
12074     param_list, /* Local Termination */
12075     param_mw_noti_count,        /* Message Waiting Notification Count */
12076     param_digits,       /* Mobile Directory Number */
12077     param_digits,       /* MSCID Number */
12078     param_list, /* PSTN Termination */
12079     param_no_ans_time,  /* No Answer Time */
12080     param_otfi, /* One Time Feature Indicator */
12081     param_orig_trig,    /* Origination Triggers */
12082     param_randc,        /* RANDC */
12083     param_digits,       /* Redirecting Number Digits */
12084     param_digits,       /* Redirecting Number String */
12085     param_sub_addr,     /* Redirecting Number Subaddress */
12086     param_digits,       /* Sender Identification Number */
12087     param_digits,       /* SMS Address */
12088     param_sms_bd,       /* SMS Bearer Data */
12089     param_sms_charge_ind,       /* SMS Charge Indicator */
12090     param_digits,       /* SMS Destination Address */
12091     param_sms_msg_count,        /* SMS Message Count */
12092     param_sms_noti,     /* SMS Notification Indicator */
12093     param_digits,       /* SMS Original Destination Address */
12094     param_sub_addr,     /* SMS Original Destination Subaddress */
12095     param_digits,       /* SMS Original Originating Address */
12096     param_sub_addr,     /* SMS Original Originating Subaddress */
12097     param_digits,       /* SMS Originating Address */
12098     param_sms_orig_restric,     /* SMS Originating Restrictions */
12099     param_sms_tele,     /* SMS Teleservice Identifier */
12100     param_sms_term_restric,     /* SMS Termination Restrictions */
12101     NULL/* no data */,  /* SMS Message Waiting Indicator */
12102     param_term_acc_type,        /* Termination Access Type */
12103     param_list, /* Termination List */
12104     param_term_treat,   /* Termination Treatment */
12105     param_term_trig,    /* Termination Triggers */
12106     param_trans_cap,    /* Transaction Capability */
12107     param_unique_chal_rep,      /* Unique Challenge Report */
12108     NULL,       /* NONE */
12109 };
12110
12111
12112 #define NUM_PARAM_3 (sizeof(ansi_param_3_strings)/sizeof(value_string))
12113 static gint ett_ansi_param_3[NUM_PARAM_3];
12114 static void (*param_3_fcn[])(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string) = {
12115     param_act_code,     /* Action Code */
12116     param_alert_res,    /* Alert Result */
12117     param_list, /* Announcement List */
12118     param_list, /* CDMA Code Channel Information */
12119     param_list, /* CDMA Code Channel List */
12120     param_list, /* CDMA Target Measurement Information */
12121     param_list, /* CDMA Target Measurement List */
12122     param_list, /* CDMA Target MAHO Information */
12123     param_list, /* CDMA Target MAHO List */
12124     param_conf_call_ind,        /* Conference Calling Indicator */
12125     param_count_upd_report,     /* Count Update Report */
12126     param_digit_collect_ctrl,   /* Digit Collection Control */
12127     param_digits,       /* DMH Account Code Digits */
12128     param_digits,       /* DMH Alternate Billing Digits */
12129     param_digits,       /* DMH Billing Digits */
12130     param_geo_auth,     /* Geographic Authorization */
12131     param_int,  /* Leg Information */
12132     param_mw_noti_type, /* Message Waiting Notification Type */
12133     param_paca_ind,     /* PACA Indicator */
12134     param_pref_lang_ind,        /* Preferred Language Indicator */
12135     param_rand_valtime, /* Random Valid Time */
12136     param_digits,       /* Restriction Digits */
12137     param_digits,       /* Routing Digits */
12138     param_setup_result, /* Setup Result */
12139     param_sms_acc_den_reason,   /* SMS Access Denied Reason */
12140     param_sms_cause,    /* SMS Cause Code */
12141     param_digits,       /* SPINI PIN */
12142     param_spini_trig,   /* SPINI Triggers */
12143     param_ssd_upd_report,       /* SSD Update Report */
12144     param_list, /* Target Measurement Information */
12145     param_list, /* Target Measurement List */
12146     param_digits,       /* Voice Mailbox PIN */
12147     param_digits,       /* Voice Mailbox Number */
12148     NULL/* no special handling */,      /* Authentication Data */
12149     param_cond_den_reason,      /* Conditionally Denied Reason */
12150     param_group_info,   /* Group Information */
12151     param_ho_state,     /* Handoff State */
12152     param_namps_call_mode,      /* NAMPS Call Mode */
12153     param_cdma_sci,     /* CDMA Slot Cycle Index */
12154     param_den_auth_per, /* Denied Authorization Period */
12155     param_digits,       /* Pilot Number */
12156     param_bill_id,      /* Pilot Billing ID */
12157     param_cdma_band_class,      /* CDMA Band Class */
12158     param_imsi, /* International Mobile Subscriber Identity */
12159     param_calling_party_name,   /* Calling Party Name */
12160     param_dis_text,     /* Display Text */
12161     param_red_party_name,       /* Redirecting Party Name */
12162     param_srvc_id,      /* Service ID */
12163     param_all_or_none,  /* All Or None */
12164     param_change,       /* Change */
12165     param_list, /* Data Access Element */
12166     param_list, /* Data Access Element List */
12167     param_list, /* Data Update Result */
12168     param_list, /* Data Update Result List */
12169     param_cdma_pilot_pn,        /* CDMA Pilot PN */
12170     NULL/* no special handling */,      /* CDMA Service Configuration Record */
12171     param_cdma_so,      /* CDMA Service Option */
12172     param_cdma_scm2,    /* CDMA Station Class Mark 2 */
12173     param_tdma_sc,      /* TDMA Service Code */
12174     param_tdma_term_cap,        /* TDMA Terminal Capability */
12175     param_tdma_voice_coder,     /* TDMA Voice Coder */
12176     param_a_key_ver,    /* A-Key Protocol Version */
12177     NULL/* XXX what spec ? */,  /* Authentication Response Reauthentication */
12178     NULL/* no special handling */,      /* Base Station Partial Key */
12179     param_min,  /* Mobile Station MIN */
12180     NULL/* no special handling */,      /* Mobile Station Partial Key */
12181     NULL/* no special handling */,      /* Modulus Value */
12182     param_min,  /* Newly Assigned MIN */
12183     param_ota_result_code,      /* OTASP Result Code */
12184     NULL/* no special handling */,      /* Primitive Value */
12185     NULL/* XXX what spec ? */,  /* Random Variable Reauthentication */
12186     NULL/* XXX what spec ? */,  /* Reauthentication Report */
12187     param_srvc_ind,     /* Service Indicator */
12188     param_sme_report,   /* Signaling Message Encryption Report */
12189     param_trn,  /* Temporary Reference Number */
12190     param_vp_report,    /* Voice Privacy Report */
12191     param_ctrl_chan_mode,       /* Control Channel Mode */
12192     NULL/* no special handling */,      /* CDMA Connection Reference */
12193     param_list, /* CDMA Connection Reference Information */
12194     param_list, /* CDMA Connection Reference List */
12195     param_change_srvc_attr,     /* Change Service Attributes */
12196     NULL/* no special handling */,      /* Data Key */
12197     param_dp_params,    /* Data Privacy Parameters */
12198     param_islp_info,    /* ISLP Information */
12199     param_reason_list,  /* Reason List */
12200     param_tdma_bandwidth,       /* TDMA Bandwidth */
12201     param_tdma_data_feat_ind,   /* TDMA Data Features Indicator */
12202     param_tdma_data_mode,       /* TDMA Data Mode */
12203     param_tdma_voice_mode,      /* TDMA Voice Mode */
12204     param_ana_red_info, /* Analog Redirect Info */
12205     param_list, /* CDMA Band Class Information */
12206     param_list, /* CDMA Band Class List */
12207     param_list, /* CDMA Service Option List */
12208     param_list, /* CDMA Connection Reference Information */
12209     param_list, /* CDMA Connection Reference List */
12210     param_list, /* Analog Redirect Record */
12211     param_list, /* Execute Script */
12212     param_list, /* Modification Request */
12213     param_list, /* Modification Request List */
12214     param_list, /* Modification Result List */
12215     param_list, /* Service Data Access Element */
12216     param_list, /* Service Data Access Element List */
12217     param_list, /* Service Data Result */
12218     param_list, /* Service Data Result List */
12219     param_list, /* Trigger Address List */
12220     param_list, /* Trigger List */
12221     param_list, /* WIN Capability */
12222     param_list, /* Call Recovery ID */
12223     param_list, /* Call Recovery ID List */
12224     param_list, /* Position Information */
12225     param_list, /* CDMA PSMM List */
12226     param_cdma_chan_num,        /* CDMA Channel Number */
12227     param_list, /* CDMA Channel Number List */
12228     param_cdma_pci,     /* CDMA Power Combined Indicator */
12229     param_list, /* CDMA Redirect Record */
12230     param_cdma_sea_param,       /* CDMA Search Parameters */
12231     param_int,  /* CDMA Network Identification */
12232     param_network_tmsi, /* Network TMSI */
12233     param_int,  /* Network TMSI Expiration Time */
12234     param_network_tmsi, /* New Network TMSI */
12235     param_reqd_param_mask,      /* Required Parameters Mask */
12236     param_srvc_red_cause,       /* Service Redirection Cause */
12237     param_srvc_red_info,        /* Service Redirection Info */
12238     param_roaming_ind,  /* Roaming Indication */
12239     NULL/* XXX what spec ? */,  /* MSID */
12240     NULL/* no special handling */,      /* Data ID */
12241     NULL/* no special handling */,      /* Database Key */
12242     param_data_result,  /* Data Result */
12243     NULL/* no special handling */,      /* Data Value */
12244     param_fail_cause,   /* Failure Cause */
12245     param_fail_type,    /* Failure Type */
12246     NULL/* no special handling */,      /* Global Title */
12247     NULL/* no special handling */,      /* Private Specialized Resource */
12248     param_resume_pic,   /* Resume PIC */
12249     NULL/* no special handling */,      /* Script Argument */
12250     NULL/* no special handling */,      /* Script Name */
12251     NULL/* no special handling */,      /* Script Result */
12252     param_special_rsc,  /* Specialized Resource */
12253     param_time_date_offset,     /* Time Date Offset */
12254     param_trig_cap,     /* Trigger Capability */
12255     param_trig_type,    /* Trigger Type */
12256     param_win_op_cap,   /* WIN Operations Capability */
12257     param_win_trig_list,        /* WIN Trigger List */
12258     param_digits,       /* MSC Address */
12259     param_sus_acc,      /* Suspicious Access */
12260     param_imsi, /* Mobile Station IMSI */
12261     param_imsi, /* Newly Assigned IMSI */
12262     NULL/* XXX what spec ? */,  /* Command Code */
12263     param_dis_text2,    /* Display Text 2 */
12264     NULL/* XXX what spec ? */,  /* Page Count */
12265     NULL/* XXX what spec ? */,  /* Page Response Time */
12266     NULL/* XXX what spec ? */,  /* SMS Transaction ID */
12267     param_dmh_srvc_id,  /* DMH Service ID */
12268     param_feat_ind,     /* Feature Indicator */
12269     param_mscid,        /* Control Network ID */
12270     param_rel_cause,    /* Release Cause */
12271     param_time_day,     /* Time Of Day */
12272     param_call_status,  /* Call Status */
12273     NULL/* no special handling */,      /* DMH Charge Information */
12274     NULL/* no special handling */,      /* DMH Billing Indicator */
12275     param_ms_status,    /* MS Status */
12276     param_pos_info_code,        /* Position Information Code */
12277     param_inter_msg_time,       /* Inter Message Time */
12278     param_msid_usage,   /* MSID Usage */
12279     param_new_min_ext,  /* New MIN Extension */
12280     param_dtx_ind,      /* DTX Indication */
12281     param_cdma_mob_cap, /* CDMA Mobile Capabilities */
12282     param_gen_time,     /* Generalized Time */
12283     param_digits,       /* Generic Digits */
12284     param_geo_pos,      /* Geographic Position */
12285     param_mob_call_status,      /* Mobile Call Status */
12286     param_mob_cap,      /* Mobile Position Capability */
12287     param_pos_req_type, /* Position Request Type */
12288     param_pos_result,   /* Position Result */
12289     param_pos_source,   /* Position Source */
12290     param_acg_encounter,        /* ACG Encountered */
12291     param_ctrl_type,    /* CDMA State/Control Type */
12292     param_gap_duration, /* Gap Duration */
12293     param_scf_overload_gap_int, /* SCF Overload Gap Interval */
12294     param_sm_gap_int,   /* Service Management System Gap Interval */
12295     param_cdma_psmm_count,      /* CDMA PSMM Count */
12296     param_cdma_sowd2,   /* CDMA Serving One Way Delay 2 */
12297     param_qos_pri,      /* QoS Priority */
12298     NULL/* no special handling */,      /* PDSN Address */
12299     NULL/* no special handling */,      /* PDSN Protocol Type */
12300     param_cdma_ms_meas_chan_id, /* CDMA MS Measured Channel Identity */
12301     NULL/* no special handling */,      /* Range */
12302     param_calling_party_cat,    /* Calling Party Category */
12303     param_cdma2000_ho_ivk_ios,  /* cdma2000 Handoff Invoke IOS Data */
12304     param_cdma2000_ho_rsp_ios,  /* cdma2000 Handoff Response IOS Data */
12305     param_digits,       /* LCS Client ID */
12306     param_tdma_maho_cell_id,    /* TDMA MAHO Cell ID */
12307     param_tdma_maho_chan,       /* TDMA MAHO Channel */
12308     param_cdma_soci,    /* CDMA Service Option Connection Identifier */
12309     param_tdma_time_align,      /* TDMA Time Alignment */
12310     param_tdma_maho_req,        /* TDMA MAHO Request */
12311     NULL,       /* NONE */
12312 };
12313
12314 /* GENERIC MAP DISSECTOR FUNCTIONS */
12315
12316 static void
12317 dissect_ansi_map_len(ASN1_SCK *asn1, proto_tree *tree, gboolean *def_len, guint *len)
12318 {
12319     guint       saved_offset;
12320     int         ret;
12321
12322
12323     saved_offset = asn1->offset;
12324     *def_len = FALSE;
12325     *len = 0;
12326
12327     ret = asn1_length_decode(asn1, def_len, len);
12328
12329     if (*def_len)
12330     {
12331         proto_tree_add_uint(tree, hf_ansi_map_length, asn1->tvb,
12332             saved_offset, asn1->offset - saved_offset,
12333             *len);
12334     }
12335     else
12336     {
12337         proto_tree_add_text(tree, asn1->tvb,
12338             saved_offset, asn1->offset - saved_offset,
12339             "Length: Indefinite");
12340     }
12341
12342 }
12343
12344 static gboolean
12345 check_ansi_map_tag(ASN1_SCK *asn1, guint tag)
12346 {
12347     guint saved_offset, real_tag;
12348
12349
12350     saved_offset = asn1->offset;
12351
12352     asn1_id_decode1(asn1, &real_tag);
12353
12354     asn1->offset = saved_offset;
12355
12356     return(tag == real_tag);
12357 }
12358
12359 static void
12360 dissect_ansi_map_octet(ASN1_SCK *asn1, proto_tree *tree, guchar * str)
12361 {
12362     guint saved_offset;
12363     guchar my_oct;
12364
12365
12366     saved_offset = asn1->offset;
12367
12368     asn1_octet_decode(asn1, &my_oct);
12369
12370     proto_tree_add_uint_format(tree, hf_ansi_map_id, asn1->tvb,
12371         saved_offset, asn1->offset - saved_offset, my_oct,
12372         "%s %u",
12373         str, my_oct);
12374 }
12375
12376 static proto_tree *
12377 dissect_ansi_map_component(ASN1_SCK *asn1, proto_tree *tree, guint *len_p)
12378 {
12379     guint saved_offset;
12380     guint tag;
12381     proto_item *item;
12382     proto_tree *subtree;
12383     gboolean def_len;
12384
12385
12386     saved_offset = asn1->offset;
12387     asn1_id_decode1(asn1, &tag);
12388
12389     item =
12390         proto_tree_add_text(tree, asn1->tvb,
12391             saved_offset, -1, "Component ID");
12392
12393     subtree = proto_item_add_subtree(item, ett_component);
12394
12395     proto_tree_add_uint_format(subtree, hf_ansi_map_tag, asn1->tvb,
12396         saved_offset, asn1->offset - saved_offset, tag,
12397         "Component ID Identifier");
12398
12399     dissect_ansi_map_len(asn1, subtree, &def_len, len_p);
12400
12401     proto_item_set_len(item, (asn1->offset - saved_offset) + *len_p);
12402
12403     return(subtree);
12404 }
12405
12406 static void
12407 dissect_ansi_opr_code(ASN1_SCK *asn1, packet_info *pinfo, proto_tree *tree, gint32 *opr_code_p)
12408 {
12409     guint saved_offset = 0;
12410     guint len;
12411     guint tag;
12412     gint32 val;
12413     gchar *str = NULL;
12414     guchar my_oct;
12415     proto_item *item;
12416     proto_tree *subtree;
12417     gboolean def_len;
12418
12419
12420     *opr_code_p = -1;
12421
12422 #define TCAP_NAT_OPR_CODE_TAG 0xd0
12423     if (check_ansi_map_tag(asn1, TCAP_NAT_OPR_CODE_TAG))
12424     {
12425         str = "National TCAP Operation Code Identifier";
12426     }
12427 #define TCAP_PRIV_OPR_CODE_TAG 0xd1
12428     else if (check_ansi_map_tag(asn1, TCAP_PRIV_OPR_CODE_TAG))
12429     {
12430         str = "Private TCAP Operation Code Identifier";
12431     }
12432     else
12433     {
12434         proto_tree_add_text(tree, asn1->tvb,
12435             asn1->offset, -1, "Unexpected tag, not National or Private TCAP Operation Code");
12436         return;
12437     }
12438
12439     saved_offset = asn1->offset;
12440     asn1_id_decode1(asn1, &tag);
12441
12442     item =
12443         proto_tree_add_text(tree, asn1->tvb,
12444             saved_offset, -1, "Operation Code");
12445
12446     subtree = proto_item_add_subtree(item, ett_opr_code);
12447
12448     proto_tree_add_uint_format(subtree, hf_ansi_map_tag, asn1->tvb,
12449         saved_offset, asn1->offset - saved_offset, tag, str);
12450
12451     dissect_ansi_map_len(asn1, subtree, &def_len, &len);
12452     proto_item_set_len(item, (asn1->offset - saved_offset) + len);
12453
12454     if (len > 0)
12455     {
12456         saved_offset = asn1->offset;
12457         asn1_octet_decode(asn1, &my_oct);
12458
12459 #define ANSI_MAP_OPR_FAMILY 0x09
12460         if (my_oct != ANSI_MAP_OPR_FAMILY)
12461         {
12462             asn1->offset = saved_offset;
12463             return;
12464         }
12465
12466         proto_tree_add_text(subtree, asn1->tvb,
12467             saved_offset, 1, "Operation Code Family");
12468
12469         saved_offset = asn1->offset;
12470         asn1_int32_value_decode(asn1, len-1, &val);
12471         proto_tree_add_int(subtree, hf_ansi_map_opr_code, asn1->tvb,
12472             saved_offset, asn1->offset - saved_offset, val);
12473
12474         str = match_strval(val, ansi_map_opr_code_strings);
12475
12476         if (NULL == str) return;
12477
12478         *opr_code_p = val;
12479
12480         if (check_col(pinfo->cinfo, COL_INFO))
12481         {
12482             col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", str);
12483         }
12484     }
12485 }
12486
12487 static void
12488 dissect_ansi_problem(ASN1_SCK *asn1, proto_tree *tree)
12489 {
12490     guint saved_offset = 0;
12491     guint len;
12492     guint tag;
12493     proto_tree *subtree;
12494     proto_item *item = NULL;
12495     gchar *str = NULL;
12496     gchar *type_str = NULL;
12497     gint32 type, spec;
12498     gboolean def_len;
12499
12500
12501 #define TCAP_PROB_CODE_TAG 0xd5
12502     if (check_ansi_map_tag(asn1, TCAP_PROB_CODE_TAG))
12503     {
12504         str = "Problem Code Identifier";
12505     }
12506     else
12507     {
12508         /* XXX */
12509         return;
12510     }
12511
12512     saved_offset = asn1->offset;
12513     asn1_id_decode1(asn1, &tag);
12514
12515     item =
12516         proto_tree_add_text(tree, asn1->tvb,
12517             saved_offset, -1, "Problem Code");
12518
12519     subtree = proto_item_add_subtree(item, ett_problem);
12520
12521     proto_tree_add_uint_format(subtree, hf_ansi_map_tag, asn1->tvb,
12522         saved_offset, asn1->offset - saved_offset, tag, str);
12523
12524     dissect_ansi_map_len(asn1, subtree, &def_len, &len);
12525     proto_item_set_len(item, (asn1->offset - saved_offset) + len);
12526
12527     if (len != 2)
12528     {
12529         proto_tree_add_text(subtree, asn1->tvb,
12530             asn1->offset, len, "Unknown encoding of Problem Code");
12531
12532         asn1->offset += len;
12533         return;
12534     }
12535
12536     saved_offset = asn1->offset;
12537     asn1_int32_value_decode(asn1, 1, &type);
12538     asn1_int32_value_decode(asn1, 1, &spec);
12539
12540     switch (type)
12541     {
12542     case 0: type_str = "Not used"; break;
12543
12544     case 1:
12545         type_str = "General";
12546         switch (spec)
12547         {
12548         case 1: str = "Unrecognized Component Type"; break;
12549         case 2: str = "Incorrect Component Portion"; break;
12550         case 3: str = "Badly Structured Component Portion"; break;
12551         default:
12552             str = "Undefined";
12553             break;
12554         }
12555         break;
12556
12557     case 2:
12558         type_str = "Invoke";
12559         switch (spec)
12560         {
12561         case 1: str = "Duplicate Invoke ID"; break;
12562         case 2: str = "Unrecognized Operation Code"; break;
12563         case 3: str = "Incorrect Parameter"; break;
12564         case 4: str = "Unrecognized Correlation ID"; break;
12565         default:
12566             str = "Undefined";
12567             break;
12568         }
12569         break;
12570
12571     case 3:
12572         type_str = "Return Result";
12573         switch (spec)
12574         {
12575         case 1: str = "Unrecognized Correlation ID"; break;
12576         case 2: str = "Unexpected Return Result"; break;
12577         case 3: str = "Incorrect Parameter"; break;
12578         default:
12579             str = "Undefined";
12580             break;
12581         }
12582         break;
12583
12584     case 4:
12585         type_str = "Return Error";
12586         switch (spec)
12587         {
12588         case 1: str = "Unrecognized Correlation ID"; break;
12589         case 2: str = "Unexpected Return Error"; break;
12590         case 3: str = "Unrecognized Error"; break;
12591         case 4: str = "Unexpected Error"; break;
12592         case 5: str = "Incorrect Parameter"; break;
12593         default:
12594             str = "Undefined";
12595             break;
12596         }
12597         break;
12598
12599     case 5:
12600         type_str = "Transaction Portion";
12601         switch (spec)
12602         {
12603         case 1: str = "Unrecognized Package Type"; break;
12604         case 2: str = "Incorrect Transaction Portion"; break;
12605         case 3: str = "Badly Structured Transaction Portion"; break;
12606         case 4: str = "Unrecognized Transaction ID"; break;
12607         case 5: str = "Permission to Release"; break;
12608         case 6: str = "Resource Unavailable"; break;
12609         default:
12610             str = "Undefined";
12611             break;
12612         }
12613         break;
12614
12615     default:
12616         type_str = "Undefined";
12617         break;
12618     }
12619
12620     if (spec == 255) { str = "Reserved"; }
12621     else if (spec == 0) { str = "Not used"; }
12622
12623     proto_tree_add_text(subtree, asn1->tvb,
12624         saved_offset, 1, "Problem Type %s", type_str);
12625
12626     proto_tree_add_text(subtree, asn1->tvb,
12627         saved_offset + 1, 1, "Problem Specifier %s", str);
12628 }
12629
12630 static void
12631 dissect_ansi_error(ASN1_SCK *asn1, proto_tree *tree)
12632 {
12633     guint saved_offset = 0;
12634     guint len;
12635     guint tag;
12636     gint32 value;
12637     proto_tree *subtree;
12638     proto_item *item = NULL;
12639     gchar *str = NULL;
12640     gboolean def_len;
12641
12642
12643 #define TCAP_NAT_ERR_CODE_TAG 0xd3
12644     if (check_ansi_map_tag(asn1, TCAP_NAT_ERR_CODE_TAG))
12645     {
12646         str = "National TCAP Error Code Identifier";
12647     }
12648 #define TCAP_PRIV_ERR_CODE_TAG 0xd4
12649     else if (check_ansi_map_tag(asn1, TCAP_PRIV_ERR_CODE_TAG))
12650     {
12651         str = "Private TCAP Error Code Identifier";
12652     }
12653     else
12654     {
12655         /* XXX */
12656         return;
12657     }
12658
12659     saved_offset = asn1->offset;
12660     asn1_id_decode1(asn1, &tag);
12661
12662     item =
12663         proto_tree_add_text(tree, asn1->tvb,
12664             saved_offset, -1, "TCAP Error Code");
12665
12666     subtree = proto_item_add_subtree(item, ett_error);
12667
12668     proto_tree_add_uint_format(subtree, hf_ansi_map_tag, asn1->tvb,
12669         saved_offset, asn1->offset - saved_offset, tag, str);
12670
12671     dissect_ansi_map_len(asn1, subtree, &def_len, &len);
12672     proto_item_set_len(item, (asn1->offset - saved_offset) + len);
12673
12674     if ((tag == TCAP_PRIV_ERR_CODE_TAG) &&
12675         (len == 1))
12676     {
12677         saved_offset = asn1->offset;
12678         asn1_int32_value_decode(asn1, 1, &value);
12679
12680         switch (value)
12681         {
12682         case 0x81: str = "Unrecognized MIN"; break;
12683         case 0x82: str = "Unrecognized ESN"; break;
12684         case 0x83: str = "MIN/HLR Mismatch"; break;
12685         case 0x84: str = "Operation Sequence Problem"; break;
12686         case 0x85: str = "Resource Shortage"; break;
12687         case 0x86: str = "Operation Not Supported"; break;
12688         case 0x87: str = "Trunk Unavailable"; break;
12689         case 0x88: str = "Parameter Error"; break;
12690         case 0x89: str = "System Failure"; break;
12691         case 0x8a: str = "Unrecognized Parameter Value"; break;
12692         case 0x8b: str = "Feature Inactive"; break;
12693         case 0x8c: str = "Missing Parameter"; break;
12694         default:
12695             if ((value >= 0xe0) && (value <= 0xff)) { str = "Reserved for protocol extension"; }
12696             else { str = "Reserved"; }
12697             break;
12698         }
12699
12700         proto_tree_add_text(subtree, asn1->tvb,
12701             saved_offset, 1, str);
12702     }
12703     else
12704     {
12705         proto_tree_add_text(subtree, asn1->tvb,
12706             asn1->offset, len, "Error Code");
12707
12708         asn1->offset += len;
12709     }
12710 }
12711
12712
12713 static gboolean
12714 dissect_ansi_param(ASN1_SCK *asn1, proto_tree *tree)
12715 {
12716     void (*param_fcn)(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string) = NULL;
12717     guint saved_offset = 0;
12718     guint len;
12719     proto_tree *subtree;
12720     proto_item *item;
12721     guint val;
12722     gchar *str = NULL;
12723     gint ett_param_idx, idx;
12724     gboolean def_len;
12725
12726
12727     saved_offset = asn1->offset;
12728
12729     asn1_uint32_value_decode(asn1, 1, &val);
12730     str = my_match_strval((guint32) val, ansi_param_1_strings, &idx);
12731
12732     if (NULL == str)
12733     {
12734         asn1->offset = saved_offset;
12735         asn1_uint32_value_decode(asn1, 2, &val);
12736
12737         str = my_match_strval((guint32) val, ansi_param_2_strings, &idx);
12738
12739         if (NULL == str)
12740         {
12741             asn1->offset = saved_offset;
12742             asn1_int32_value_decode(asn1, 3, &val);
12743
12744             str = my_match_strval((guint32) val, ansi_param_3_strings, &idx);
12745
12746             if (NULL == str)
12747             {
12748                 if (((val >= 0x9FFF00) && (val <= 0x9FFF7F)) ||
12749                     ((val >= 0xBFFF00) && (val <= 0xBFFF7F)))
12750                 {
12751                     str = "Reserved for protocol extension";
12752                 }
12753                 else if (((val >= 0x9FFE76) && (val <= 0x9FFE7F)) ||
12754                     ((val >= 0xBFFE76) && (val <= 0xBFFE7F)))
12755                 {
12756                     str = "Reserved for National Network Use";
12757                 }
12758                 else
12759                 {
12760                     str = "Unknown Parameter Data";
12761                     param_fcn = NULL;
12762                 }
12763
12764                 ett_param_idx = ett_param;
12765             }
12766             else
12767             {
12768                 ett_param_idx = ett_ansi_param_3[idx];
12769                 param_fcn = param_3_fcn[idx];
12770             }
12771         }
12772         else
12773         {
12774             ett_param_idx = ett_ansi_param_2[idx];
12775             param_fcn = param_2_fcn[idx];
12776         }
12777     }
12778     else
12779     {
12780         ett_param_idx = ett_ansi_param_1[idx];
12781         param_fcn = param_1_fcn[idx];
12782     }
12783
12784     item =
12785         proto_tree_add_text(tree, asn1->tvb,
12786             saved_offset, -1, str);
12787
12788     subtree = proto_item_add_subtree(item, ett_param_idx);
12789
12790     proto_tree_add_uint_format(subtree, hf_ansi_map_param_id, asn1->tvb,
12791         saved_offset, asn1->offset - saved_offset, val, "Parameter ID");
12792
12793     dissect_ansi_map_len(asn1, subtree, &def_len, &len);
12794
12795     proto_item_set_len(item, asn1->offset - saved_offset + len);
12796
12797     if (len > 0)
12798     {
12799         if (param_fcn == NULL)
12800         {
12801             proto_tree_add_text(subtree, asn1->tvb,
12802                 asn1->offset, len, "Parameter Data");
12803             asn1->offset += len;
12804         }
12805         else
12806         {
12807             ansi_map_add_string[0] = '\0';
12808
12809             (*param_fcn)(asn1, subtree, len, ansi_map_add_string);
12810
12811             if (ansi_map_add_string[0] != '\0')
12812             {
12813                 proto_item_append_text(item, ansi_map_add_string);
12814                 ansi_map_add_string[0] = '\0';
12815             }
12816         }
12817     }
12818
12819     return(TRUE);
12820 }
12821
12822
12823 static void
12824 dissect_ansi_params(ASN1_SCK *asn1, proto_tree *tree)
12825 {
12826     guint saved_offset = 0;
12827     guint len;
12828     guint tag;
12829     proto_tree *subtree;
12830     proto_item *item = NULL;
12831     gchar *str = NULL;
12832     gboolean def_len;
12833
12834 #define TCAP_PARAM_SET_TAG 0xf2
12835     if (check_ansi_map_tag(asn1, TCAP_PARAM_SET_TAG))
12836     {
12837         str = "Parameter Set Identifier";
12838     }
12839 #define TCAP_PARAM_SEQ_TAG 0x30
12840     else if (check_ansi_map_tag(asn1, TCAP_PARAM_SEQ_TAG))
12841     {
12842         str = "Parameter Sequence Identifier";
12843     }
12844     else
12845     {
12846         /* XXX */
12847         return;
12848     }
12849
12850     saved_offset = asn1->offset;
12851     asn1_id_decode1(asn1, &tag);
12852
12853     item =
12854         proto_tree_add_text(tree, asn1->tvb,
12855             saved_offset, -1, "Parameters");
12856
12857     subtree = proto_item_add_subtree(item, ett_params);
12858
12859     proto_tree_add_uint_format(subtree, hf_ansi_map_tag, asn1->tvb,
12860         saved_offset, asn1->offset - saved_offset, tag, str);
12861
12862     dissect_ansi_map_len(asn1, subtree, &def_len, &len);
12863     proto_item_set_len(item, (asn1->offset - saved_offset) + len);
12864
12865     ansi_map_add_string[0] = '\0';
12866
12867     param_list(asn1, subtree, len, ansi_map_add_string);
12868
12869     if (ansi_map_add_string[0] != '\0')
12870     {
12871         proto_item_append_text(item, ansi_map_add_string);
12872         ansi_map_add_string[0] = '\0';
12873     }
12874 }
12875
12876 static void
12877 dissect_ansi_map_reject(ASN1_SCK *asn1, proto_tree *tree)
12878 {
12879     guint len;
12880     proto_tree *subtree;
12881
12882 #define COMPONENT_ID_TAG 0xcf
12883     if (check_ansi_map_tag(asn1, COMPONENT_ID_TAG))
12884     {
12885         subtree = dissect_ansi_map_component(asn1, tree, &len);
12886
12887         switch (len)
12888         {
12889         case 1:
12890             dissect_ansi_map_octet(asn1, subtree, "Correlation ID:");
12891             break;
12892         }
12893     }
12894
12895     dissect_ansi_problem(asn1, tree);
12896
12897     dissect_ansi_params(asn1, tree);
12898 }
12899
12900 static void
12901 dissect_ansi_map_re(ASN1_SCK *asn1, proto_tree *tree)
12902 {
12903     guint len;
12904     proto_tree *subtree;
12905
12906 #define COMPONENT_ID_TAG 0xcf
12907     if (check_ansi_map_tag(asn1, COMPONENT_ID_TAG))
12908     {
12909         subtree = dissect_ansi_map_component(asn1, tree, &len);
12910
12911         switch (len)
12912         {
12913         case 1:
12914             dissect_ansi_map_octet(asn1, subtree, "Correlation ID:");
12915             break;
12916         }
12917     }
12918
12919     dissect_ansi_error(asn1, tree);
12920
12921     dissect_ansi_params(asn1, tree);
12922 }
12923
12924 static void
12925 dissect_ansi_map_rr(ASN1_SCK *asn1, proto_tree *tree)
12926 {
12927     guint len;
12928     proto_tree *subtree;
12929
12930 #define COMPONENT_ID_TAG 0xcf
12931     if (check_ansi_map_tag(asn1, COMPONENT_ID_TAG))
12932     {
12933         subtree = dissect_ansi_map_component(asn1, tree, &len);
12934
12935         switch (len)
12936         {
12937         case 1:
12938             dissect_ansi_map_octet(asn1, subtree, "Correlation ID:");
12939             break;
12940         }
12941     }
12942
12943     dissect_ansi_params(asn1, tree);
12944 }
12945
12946 static void
12947 dissect_ansi_map_invoke(ASN1_SCK *asn1, packet_info *pinfo, proto_tree *tree, gint *opr_code_p)
12948 {
12949     guint len;
12950     proto_tree *subtree;
12951
12952 #define COMPONENT_ID_TAG 0xcf
12953     if (check_ansi_map_tag(asn1, COMPONENT_ID_TAG))
12954     {
12955         subtree = dissect_ansi_map_component(asn1, tree, &len);
12956
12957         switch (len)
12958         {
12959         case 1:
12960             dissect_ansi_map_octet(asn1, subtree, "Invoke ID:");
12961             break;
12962
12963         case 2:
12964             dissect_ansi_map_octet(asn1, subtree, "Invoke ID:");
12965             dissect_ansi_map_octet(asn1, subtree, "Correlation ID:");
12966             break;
12967         }
12968     }
12969
12970     ansi_map_is_invoke = TRUE;
12971
12972     dissect_ansi_opr_code(asn1, pinfo, tree, opr_code_p);
12973
12974     dissect_ansi_params(asn1, tree);
12975 }
12976
12977 static void
12978 dissect_ansi_map_message(ASN1_SCK *asn1, packet_info *pinfo, proto_tree *ansi_map_tree)
12979 {
12980     static ansi_map_tap_rec_t tap_rec;
12981     guint       saved_offset;
12982     guint       tag;
12983     guint       len;
12984     gchar       *str = NULL;
12985     proto_item *item, *tag_item;
12986     proto_tree *subtree, *tag_subtree;
12987     gboolean def_len;
12988     static int  i = 0;
12989     gint opr_code;
12990
12991
12992     saved_offset = asn1->offset;
12993     asn1_id_decode1(asn1, &tag);
12994
12995     str = match_strval(tag, ansi_cmp_type_strings);
12996
12997     if (NULL == str) return;
12998
12999     if (check_col(pinfo->cinfo, COL_INFO))
13000     {
13001         if (0 == i)
13002         {
13003             col_append_fstr(pinfo->cinfo, COL_INFO,  "%s ", str);
13004         }
13005         else
13006         {
13007             col_append_fstr(pinfo->cinfo, COL_INFO,  "& %s ", str);
13008         }
13009     }
13010
13011     item =
13012         proto_tree_add_text(ansi_map_tree, asn1->tvb,
13013             saved_offset, -1, "Components");
13014     subtree = proto_item_add_subtree(item, ett_components);
13015
13016     tag_item =
13017         proto_tree_add_uint_format(subtree, hf_ansi_map_tag, asn1->tvb,
13018             saved_offset, asn1->offset - saved_offset, tag, str);
13019
13020     dissect_ansi_map_len(asn1, subtree, &def_len, &len);
13021
13022     tag_subtree = proto_item_add_subtree(tag_item, ett_components);
13023
13024     opr_code = -1;
13025
13026     switch (tag)
13027     {
13028     case ANSI_TC_INVOKE_L:
13029         dissect_ansi_map_invoke(asn1, pinfo, tag_subtree, &opr_code);
13030         break;
13031
13032     case ANSI_TC_RRL:
13033         dissect_ansi_map_rr(asn1, tag_subtree);
13034         break;
13035
13036     case ANSI_TC_RE:
13037         dissect_ansi_map_re(asn1, tag_subtree);
13038         break;
13039
13040     case ANSI_TC_REJECT:
13041         dissect_ansi_map_reject(asn1, tag_subtree);
13042         break;
13043
13044     case ANSI_TC_INVOKE_N:
13045         dissect_ansi_map_invoke(asn1, pinfo, tag_subtree, &opr_code);
13046         break;
13047
13048     case ANSI_TC_RRN:
13049         dissect_ansi_map_rr(asn1, tag_subtree);
13050         break;
13051
13052     default:
13053         /* XXX */
13054         break;
13055     }
13056
13057     proto_item_set_len(item, asn1->offset - saved_offset);
13058
13059     if (opr_code != -1)
13060     {
13061         tap_rec.message_type = opr_code;
13062         tap_rec.size = asn1->offset - saved_offset;
13063
13064         tap_queue_packet(ansi_map_tap, pinfo, &tap_rec);
13065     }
13066 }
13067
13068 static void
13069 dissect_ansi_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
13070 {
13071     proto_item *ansi_map_item;
13072     proto_tree *ansi_map_tree = NULL;
13073     ASN1_SCK   asn1;
13074     int        offset = 0;
13075
13076     g_pinfo = pinfo;
13077
13078     /*
13079      * Make entry in the Protocol column on summary display
13080      */
13081     if (check_col(pinfo->cinfo, COL_PROTOCOL))
13082     {
13083         col_set_str(pinfo->cinfo, COL_PROTOCOL, "ANSI MAP");
13084     }
13085
13086     /* In the interest of speed, if "tree" is NULL, don't do any work not
13087      * necessary to generate protocol tree items.
13088      */
13089     if (tree)
13090     {
13091         g_tree = tree;
13092
13093         /*
13094          * create the ansi_map protocol tree
13095          */
13096         ansi_map_item =
13097             proto_tree_add_item(tree, proto_ansi_map, tvb, 0, -1, FALSE);
13098
13099         ansi_map_tree =
13100             proto_item_add_subtree(ansi_map_item, ett_ansi_map);
13101
13102         asn1_open(&asn1, tvb, offset);
13103
13104         ansi_map_is_invoke = FALSE;
13105         is683_ota = FALSE;
13106         is801_pld = FALSE;
13107         dissect_ansi_map_message(&asn1, pinfo, ansi_map_tree);
13108
13109         asn1_close(&asn1, &offset);
13110     }
13111 }
13112
13113
13114 /* Register the protocol with Ethereal */
13115 void
13116 proto_register_ansi_map(void)
13117 {
13118     guint               i;
13119     gint                last_offset;
13120
13121     /* Setup list of header fields */
13122     static hf_register_info hf[] =
13123     {
13124         { &hf_ansi_map_tag,
13125             { "Tag",            "ansi_map.tag",
13126             FT_UINT8, BASE_HEX, NULL, 0,
13127             "", HFILL }
13128         },
13129         { &hf_ansi_map_length,
13130             { "Length",         "ansi_map.len",
13131             FT_UINT8, BASE_DEC, NULL, 0,
13132             "", HFILL }
13133         },
13134         { &hf_ansi_map_id,
13135             { "Value",          "ansi_map.id",
13136             FT_UINT8, BASE_DEC, NULL, 0,
13137             "", HFILL }
13138         },
13139         { &hf_ansi_map_opr_code,
13140             { "Operation Code", "ansi_map.oprcode",
13141             FT_INT32, BASE_DEC, VALS(ansi_map_opr_code_strings), 0,
13142             "", HFILL }
13143         },
13144         { &hf_ansi_map_param_id,
13145             { "Param ID",       "ansi_map.param_id",
13146             FT_UINT32, BASE_HEX, NULL, 0,
13147             "", HFILL }
13148         },
13149         { &hf_ansi_map_ios401_elem_id,
13150             { "IOS 4.0.1 Element ID",   "ansi_map.ios401_elem_id",
13151             FT_NONE, 0, NULL, 0,
13152             "", HFILL }
13153         },
13154     };
13155
13156     /* Setup protocol subtree array */
13157 #define NUM_INDIVIDUAL_PARAMS   15
13158     gint *ett[NUM_INDIVIDUAL_PARAMS+NUM_PARAM_1+NUM_PARAM_2+NUM_PARAM_3+NUM_IOS401_ELEM];
13159
13160     memset((void *) ett, -1, sizeof(ett));
13161
13162     ett[0] = &ett_ansi_map;
13163     ett[1] = &ett_opr_code;
13164     ett[2] = &ett_component;
13165     ett[3] = &ett_components;
13166     ett[4] = &ett_param;
13167     ett[5] = &ett_params;
13168     ett[6] = &ett_error;
13169     ett[7] = &ett_problem;
13170     ett[8] = &ett_natnum;
13171     ett[9] = &ett_call_mode;
13172     ett[10] = &ett_chan_data;
13173     ett[11] = &ett_code_chan;
13174     ett[12] = &ett_clr_dig_mask;
13175     ett[13] = &ett_ent_dig_mask;
13176     ett[14] = &ett_all_dig_mask;
13177
13178     last_offset = NUM_INDIVIDUAL_PARAMS;
13179
13180     for (i=0; i < NUM_PARAM_1; i++, last_offset++)
13181     {
13182         ett[last_offset] = &ett_ansi_param_1[i];
13183     }
13184
13185     for (i=0; i < NUM_PARAM_2; i++, last_offset++)
13186     {
13187         ett[last_offset] = &ett_ansi_param_2[i];
13188     }
13189
13190     for (i=0; i < NUM_PARAM_3; i++, last_offset++)
13191     {
13192         ett[last_offset] = &ett_ansi_param_3[i];
13193     }
13194
13195     for (i=0; i < NUM_IOS401_ELEM; i++, last_offset++)
13196     {
13197         ett[last_offset] = &ett_ansi_map_ios401_elem[i];
13198     }
13199
13200     /* Register the protocol name and description */
13201     proto_ansi_map =
13202         proto_register_protocol("ANSI Mobile Application Part",
13203             "ANSI MAP", "ansi_map");
13204
13205     is637_tele_id_dissector_table =
13206         register_dissector_table("ansi_map.tele_id", "IS-637 Teleservice ID",
13207             FT_UINT8, BASE_DEC);
13208
13209     is683_dissector_table =
13210         register_dissector_table("ansi_map.ota", "IS-683-A (OTA)",
13211             FT_UINT8, BASE_DEC);
13212
13213     is801_dissector_table =
13214         register_dissector_table("ansi_map.pld", "IS-801 (PLD)",
13215             FT_UINT8, BASE_DEC);
13216
13217     /* Required function calls to register the header fields and subtrees used */
13218     proto_register_field_array(proto_ansi_map, hf, array_length(hf));
13219     proto_register_subtree_array(ett, array_length(ett));
13220
13221     ansi_map_tap = register_tap("ansi_map");
13222 }
13223
13224
13225 void
13226 proto_reg_handoff_ansi_map(void)
13227 {
13228     dissector_handle_t ansi_map_handle;
13229
13230     ansi_map_handle = create_dissector_handle(dissect_ansi_map, proto_ansi_map);
13231
13232     dissector_add("tcap.ansi_ssn", 5, ansi_map_handle);
13233     dissector_add("tcap.ansi_ssn", 6, ansi_map_handle);
13234     dissector_add("tcap.ansi_ssn", 7, ansi_map_handle);
13235     dissector_add("tcap.ansi_ssn", 8, ansi_map_handle);
13236     dissector_add("tcap.ansi_ssn", 9 , ansi_map_handle);
13237     dissector_add("tcap.ansi_ssn", 10 , ansi_map_handle);
13238     dissector_add("tcap.ansi_ssn", 11 , ansi_map_handle);
13239     dissector_add("tcap.ansi_ssn", 12 , ansi_map_handle);
13240
13241     data_handle = find_dissector("data");
13242 }