2 * Routines for ANSI A Interface (IS-634/IOS) dissection
4 * Copyright 2003, Michael Lum <mlum [AT] telostech.com>
5 * In association with Telos Technology Inc.
9 * Inter-operability Specification (IOS) for CDMA
10 * 2000 Access Network Interfaces
11 * 3GPP2 A.S0001-1 TIA/EIA-2001
15 * Wireshark - Network traffic analyzer
16 * By Gerald Combs <gerald@wireshark.org>
17 * Copyright 1998 Gerald Combs
19 * This program is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU General Public License
21 * as published by the Free Software Foundation; either version 2
22 * of the License, or (at your option) any later version.
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * GNU General Public License for more details.
29 * You should have received a copy of the GNU General Public License
30 * along with this program; if not, write to the Free Software
31 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
42 #include <epan/packet.h>
43 #include <epan/prefs.h>
45 #include <epan/strutil.h>
46 #include <epan/emem.h>
48 #include "packet-bssap.h"
49 #include "packet-ansi_a.h"
52 /* PROTOTYPES/FORWARDS */
54 void proto_reg_handoff_ansi_a(void);
56 const value_string ansi_a_ios401_bsmap_strings[] = {
57 { 0x69, "Additional Service Notification" },
58 { 0x65, "ADDS Page" },
59 { 0x66, "ADDS Page Ack" },
60 { 0x67, "ADDS Transfer" },
61 { 0x68, "ADDS Transfer Ack" },
62 { 0x02, "Assignment Complete" },
63 { 0x03, "Assignment Failure" },
64 { 0x01, "Assignment Request" },
65 { 0x45, "Authentication Request" },
66 { 0x46, "Authentication Response" },
67 { 0x48, "Base Station Challenge" },
68 { 0x49, "Base Station Challenge Response" },
70 { 0x41, "Block Acknowledge" },
71 { 0x09, "BS Service Request" },
72 { 0x0A, "BS Service Response" },
73 { 0x20, "Clear Command" },
74 { 0x21, "Clear Complete" },
75 { 0x22, "Clear Request" },
76 { 0x57, "Complete Layer 3 Information" },
77 { 0x60, "Feature Notification" },
78 { 0x61, "Feature Notification Ack" },
79 { 0x13, "Handoff Command" },
80 { 0x15, "Handoff Commenced" },
81 { 0x14, "Handoff Complete" },
82 { 0x16, "Handoff Failure" },
83 { 0x17, "Handoff Performed" },
84 { 0x10, "Handoff Request" },
85 { 0x12, "Handoff Request Acknowledge" },
86 { 0x11, "Handoff Required" },
87 { 0x1A, "Handoff Required Reject" },
88 { 0x6C, "PACA Command" },
89 { 0x6D, "PACA Command Ack" },
90 { 0x6E, "PACA Update" },
91 { 0x6F, "PACA Update Ack" },
92 { 0x52, "Paging Request" },
93 { 0x53, "Privacy Mode Command" },
94 { 0x55, "Privacy Mode Complete" },
95 { 0x23, "Radio Measurements for Position Request" },
96 { 0x25, "Radio Measurements for Position Response" },
97 { 0x56, "Rejection" },
98 { 0x05, "Registration Request" },
100 { 0x31, "Reset Acknowledge" },
101 { 0x34, "Reset Circuit" },
102 { 0x35, "Reset Circuit Acknowledge" },
103 { 0x47, "SSD Update Request" },
104 { 0x4A, "SSD Update Response" },
105 { 0x6A, "Status Request" },
106 { 0x6B, "Status Response" },
107 { 0x39, "Transcoder Control Acknowledge" },
108 { 0x38, "Transcoder Control Request" },
110 { 0x43, "Unblock Acknowledge" },
111 { 0x0B, "User Zone Reject" },
112 { 0x04, "User Zone Update" },
116 const value_string ansi_a_ios401_dtap_strings[] = {
117 { 0x62, "Additional Service Request" },
118 { 0x53, "ADDS Deliver" },
119 { 0x54, "ADDS Deliver Ack" },
120 { 0x26, "Alert With Information" },
121 { 0x45, "Authentication Request" },
122 { 0x46, "Authentication Response" },
123 { 0x48, "Base Station Challenge" },
124 { 0x49, "Base Station Challenge Response" },
125 { 0x24, "CM Service Request" },
126 { 0x25, "CM Service Request Continuation" },
128 { 0x10, "Flash with Information" },
129 { 0x50, "Flash with Information Ack" },
130 { 0x02, "Location Updating Accept" },
131 { 0x04, "Location Updating Reject" },
132 { 0x08, "Location Updating Request" },
133 { 0x27, "Paging Response" },
134 { 0x2B, "Parameter Update Confirm" },
135 { 0x2C, "Parameter Update Request" },
136 { 0x56, "Rejection" },
137 { 0x03, "Progress" },
138 { 0x70, "Service Redirection" },
139 { 0x2E, "Service Release" },
140 { 0x2F, "Service Release Complete" },
141 { 0x47, "SSD Update Request" },
142 { 0x4A, "SSD Update Response" },
143 { 0x6A, "Status Request" },
144 { 0x6B, "Status Response" },
145 { 0x0B, "User Zone Reject" },
146 { 0x0C, "User Zone Update" },
147 { 0x0D, "User Zone Update Request" },
151 const value_string ansi_a_ios401_elem_1_strings[] = {
152 { 0x20, "Access Network Identifiers" },
153 { 0x3D, "ADDS User Part" },
154 { 0x25, "AMPS Hard Handoff Parameters" },
155 { 0x30, "Anchor PDSN Address" },
156 { 0x7C, "Anchor P-P Address" },
157 { 0x41, "Authentication Challenge Parameter" },
158 { 0x28, "Authentication Confirmation Parameter (RANDC)" },
159 { 0x59, "Authentication Data" },
160 { 0x4A, "Authentication Event" },
161 { 0x40, "Authentication Parameter COUNT" },
162 { 0x42, "Authentication Response Parameter" },
163 { 0x37, "Band Class" },
164 { 0x5B, "Called Party ASCII Number" },
165 { 0x5E, "Called Party BCD Number" },
166 { 0x4B, "Calling Party ASCII Number" },
168 { 0x08, "Cause Layer 3" },
169 { 0x0C, "CDMA Serving One Way Delay" },
170 { 0x05, "Cell Identifier" },
171 { 0x1A, "Cell Identifier List" },
172 { 0x23, "Channel Number" },
173 { 0x0B, "Channel Type" },
174 { 0x19, "Circuit Group" },
175 { 0x01, "Circuit Identity Code" },
176 { 0x24, "Circuit Identity Code Extension" },
177 { 0x12, "Classmark Information Type 2" },
178 { 0x29, "Downlink Radio Environment" },
179 { 0x2B, "Downlink Radio Environment List" },
180 { 0x0A, "Encryption Information" },
181 { 0x10, "Extended Handoff Direction Parameters" },
182 { 0x2C, "Geographic Location" },
183 { 0x5A, "Special Service Call Indicator" },
184 { 0x26, "Handoff Power Level" },
185 { 0x16, "Hard Handoff Parameters" },
186 { 0x2E, "Information Element Requested" },
187 { 0x09, "IS-2000 Channel Identity" },
188 { 0x27, "IS-2000 Channel Identity 3X" },
189 { 0x11, "IS-2000 Mobile Capabilities" },
190 { 0x0F, "IS-2000 Non-Negotiable Service Configuration Record" },
191 { 0x0E, "IS-2000 Service Configuration Record" },
192 { 0x62, "IS-95/IS-2000 Cause Value" },
193 { 0x67, "IS-2000 Redirection Record" },
194 { 0x22, "IS-95 Channel Identity" },
195 { 0x64, "IS-95 MS Measured Channel Identity" },
196 { 0x17, "Layer 3 Information" },
197 { 0x13, "Location Area Information" },
198 { 0x38, "Message Waiting Indication" },
199 { 0x0D, "Mobile Identity" },
200 { 0x15, "MS Information Records" },
201 { 0xA0, "Origination Continuation Indicator" },
202 { 0x5F, "PACA Order" },
203 { 0x60, "PACA Reorigination Indicator" },
204 { 0x4E, "PACA Timestamp" },
205 { 0x70, "Packet Session Parameters" },
206 { 0x14, "PDSN IP Address" },
207 { 0xA2, "Power Down Indicator" },
208 { 0x06, "Priority" },
209 { 0x3B, "Protocol Revision" },
210 { 0x18, "Protocol Type" },
211 { 0x2D, "PSMM Count" },
212 { 0x07, "Quality of Service Parameters" },
213 { 0x1D, "Radio Environment and Resources" },
214 { 0x1F, "Registration Type" },
215 { 0x44, "Reject Cause" },
216 { 0x1B, "Response Request" },
217 { 0x68, "Return Cause" },
218 { 0x21, "RF Channel Identity" },
219 { 0x03, "Service Option" },
220 { 0x1E, "Service Option Connection Identifier (SOCI)" },
221 { 0x2A, "Service Option List" },
222 { 0x69, "Service Redirection Info" },
223 { 0x71, "Session Reference Identifier (SR_ID)" },
226 { 0x35, "Slot Cycle Index" },
227 { 0x31, "Software Version" },
228 { 0x39, "Source RNC to Target RNC Transparent Container" },
229 { 0x14, "Source PDSN Address" },
231 { 0x3A, "Target RNC to Source RNC Transparent Container" },
232 { 0x36, "Transcoder Mode" }, /* XXX 0x1C in IOS 4.0.1 */
233 { 0x02, "User Zone ID" },
234 { 0xA1, "Voice Privacy Request" },
238 #define ANSI_MS_INFO_REC_DISPLAY 0x01
239 #define ANSI_MS_INFO_REC_CLD_PN 0x02
240 #define ANSI_MS_INFO_REC_CLG_PN 0x03
241 #define ANSI_MS_INFO_REC_CONN_N 0x04
242 #define ANSI_MS_INFO_REC_SIGNAL 0x05
243 #define ANSI_MS_INFO_REC_MW 0x06
244 #define ANSI_MS_INFO_REC_SC 0x07
245 #define ANSI_MS_INFO_REC_CLD_PSA 0x08
246 #define ANSI_MS_INFO_REC_CLG_PSA 0x09
247 #define ANSI_MS_INFO_REC_CONN_SA 0x0a
248 #define ANSI_MS_INFO_REC_RED_N 0x0b
249 #define ANSI_MS_INFO_REC_RED_SA 0x0c
250 #define ANSI_MS_INFO_REC_MP 0x0d
251 #define ANSI_MS_INFO_REC_PA 0x0e
252 #define ANSI_MS_INFO_REC_LC 0x0f
253 #define ANSI_MS_INFO_REC_EDISPLAY 0x10
254 #define ANSI_MS_INFO_REC_NNSC 0x13
255 #define ANSI_MS_INFO_REC_MC_EDISPLAY 0x14
256 #define ANSI_MS_INFO_REC_CWI 0x15
257 #define ANSI_MS_INFO_REC_ERTI 0xfe
259 static const value_string ansi_ms_info_rec_str[] = {
260 { ANSI_MS_INFO_REC_DISPLAY, "Display" },
261 { ANSI_MS_INFO_REC_CLD_PN, "Called Party Number" },
262 { ANSI_MS_INFO_REC_CLG_PN, "Calling Party Number" },
263 { ANSI_MS_INFO_REC_CONN_N, "Connected Number" },
264 { ANSI_MS_INFO_REC_SIGNAL, "Signal" },
265 { ANSI_MS_INFO_REC_MW, "Message Waiting" },
266 { ANSI_MS_INFO_REC_SC, "Service Configuration" },
267 { ANSI_MS_INFO_REC_CLD_PSA, "Called Party Subaddress" },
268 { ANSI_MS_INFO_REC_CLG_PSA, "Calling Party Subaddress" },
269 { ANSI_MS_INFO_REC_CONN_SA, "Connected Subaddress" },
270 { ANSI_MS_INFO_REC_RED_N, "Redirecting Number" },
271 { ANSI_MS_INFO_REC_RED_SA, "Redirecting Subaddress" },
272 { ANSI_MS_INFO_REC_MP, "Meter Pulses" },
273 { ANSI_MS_INFO_REC_PA, "Parametric Alerting" },
274 { ANSI_MS_INFO_REC_LC, "Line Control" },
275 { ANSI_MS_INFO_REC_EDISPLAY, "Extended Display" },
276 { ANSI_MS_INFO_REC_NNSC, "Non-Negotiable Service Configuration" },
277 { ANSI_MS_INFO_REC_MC_EDISPLAY, "Multiple Character Extended Display" },
278 { ANSI_MS_INFO_REC_CWI, "Call Waiting Indicator" },
279 { ANSI_MS_INFO_REC_ERTI, "Extended Record Type International" },
282 #define NUM_MS_INFO_REC (sizeof(ansi_ms_info_rec_str)/sizeof(value_string))
283 static gint ett_ansi_ms_info_rec[NUM_MS_INFO_REC];
285 static const gchar *band_class_str[] = {
286 "800 MHz Cellular System",
287 "1.850 to 1.990 GHz Broadband PCS",
288 "872 to 960 MHz TACS Band",
289 "832 to 925 MHz JTACS Band",
290 "1.750 to 1.870 GHz Korean PCS",
292 "2 GHz IMT-2000 Band",
293 "North American 700 MHz Cellular Band",
294 "1.710 to 1.880 GHz PCS",
295 "880 to 960 MHz Band",
296 "Secondary 800 MHz Band",
297 "400 MHz European PAMR Band",
298 "800 MHz European PAMR Band"
300 #define NUM_BAND_CLASS_STR (sizeof(band_class_str)/sizeof(gchar *))
302 static const gchar *cell_disc_str[] = {
303 "whole Cell Global Identification (CGI)",
305 "Cell Identity (CI)",
307 "Location Area Identification (LAI)",
308 "Location Area Code (LAC)",
310 "IS-41 whole Cell Global Identification (ICGI)",
311 "Enhanced whole Cell Global Identification (ECGI)"
313 #define NUM_CELL_DISC_STR (sizeof(cell_disc_str)/sizeof(gchar *))
315 /* Initialize the protocol and registered fields */
316 static int proto_a_bsmap = -1;
317 static int proto_a_dtap = -1;
319 static int ansi_a_tap = -1;
321 static int hf_ansi_a_none = -1;
322 static int hf_ansi_a_bsmap_msgtype = -1;
323 static int hf_ansi_a_dtap_msgtype = -1;
324 static int hf_ansi_a_length = -1;
325 static int hf_ansi_a_elem_id = -1;
326 static int hf_ansi_a_esn = -1;
327 static int hf_ansi_a_imsi = -1;
328 static int hf_ansi_a_min = -1;
329 static int hf_ansi_a_cld_party_bcd_num = -1;
330 static int hf_ansi_a_clg_party_bcd_num = -1;
331 static int hf_ansi_a_cld_party_ascii_num = -1;
332 static int hf_ansi_a_clg_party_ascii_num = -1;
333 static int hf_ansi_a_cell_ci = -1;
334 static int hf_ansi_a_cell_lac = -1;
335 static int hf_ansi_a_cell_mscid = -1;
336 static int hf_ansi_a_pdsn_ip_addr = -1;
339 /* Initialize the subtree pointers */
340 static gint ett_bsmap = -1;
341 static gint ett_dtap = -1;
342 static gint ett_elems = -1;
343 static gint ett_elem = -1;
344 static gint ett_dtap_oct_1 = -1;
345 static gint ett_cm_srvc_type = -1;
346 static gint ett_ansi_ms_info_rec_reserved = -1;
347 static gint ett_ansi_enc_info = -1;
348 static gint ett_cell_list = -1;
350 #define A_VARIANT_IS634 4
351 #define A_VARIANT_TSB80 5
352 #define A_VARIANT_IS634A 6
353 #define A_VARIANT_IOS2 7
354 #define A_VARIANT_IOS3 8
355 #define A_VARIANT_IOS401 9
358 * IOS 4, probably most common
360 static gint a_global_variant = A_VARIANT_IOS401;
363 * Variables to allow for proper deletion of dissector registration when
364 * the user changes values
366 static gint a_variant = 0;
368 static char a_bigbuf[1024];
369 static dissector_handle_t data_handle;
370 static dissector_handle_t bsmap_handle;
371 static dissector_handle_t dtap_handle;
372 static dissector_table_t is637_dissector_table; /* IS-637-A Transport Layer (SMS) */
373 static dissector_table_t is683_dissector_table; /* IS-683-A (OTA) */
374 static dissector_table_t is801_dissector_table; /* IS-801 (PLD) */
375 static packet_info *g_pinfo;
376 static proto_tree *g_tree;
379 typedef struct dgt_set_t
381 unsigned char out[15];
385 static dgt_set_t Dgt_tbcd = {
387 /* 0 1 2 3 4 5 6 7 8 9 a b c d e */
388 '0','1','2','3','4','5','6','7','8','9','?','B','C','*','#'
392 static dgt_set_t Dgt_msid = {
394 /* 0 1 2 3 4 5 6 7 8 9 a b c d e */
395 '0','1','2','3','4','5','6','7','8','9','?','?','?','?','?'
402 * Unpack BCD input pattern into output ASCII pattern
404 * Input Pattern is supplied using the same format as the digits
406 * Returns: length of unpacked pattern
410 char *out, /* ASCII pattern out */
411 guchar *in, /* packed pattern in */
412 int num_octs, /* Number of octets to unpack */
413 dgt_set_t *dgt /* Digit definitions */
422 * unpack first value in byte
425 *out++ = dgt->out[i & 0x0f];
429 * unpack second value in byte
433 if (i == 0x0f) /* odd number bytes - hit filler */
436 *out++ = dgt->out[i];
446 /* ELEMENT FUNCTIONS */
448 #define EXTRANEOUS_DATA_CHECK(edc_len, edc_max_len) \
449 if ((edc_len) > (edc_max_len)) \
451 proto_tree_add_text(tree, tvb, \
452 curr_offset, (edc_len) - (edc_max_len), "Extraneous Data"); \
453 curr_offset += ((edc_len) - (edc_max_len)); \
456 #define SHORT_DATA_CHECK(sdc_len, sdc_min_len) \
457 if ((sdc_len) < (sdc_min_len)) \
459 proto_tree_add_text(tree, tvb, \
460 curr_offset, (sdc_len), "Short Data (?)"); \
461 curr_offset += (sdc_len); \
462 return(curr_offset - offset); \
465 #define EXACT_DATA_CHECK(edc_len, edc_eq_len) \
466 if ((edc_len) != (edc_eq_len)) \
468 proto_tree_add_text(tree, tvb, \
469 asn1->offset, (edc_len), "Unexpected Data Length"); \
470 asn1->offset += (edc_len); \
474 #define NO_MORE_DATA_CHECK(nmdc_len) \
475 if ((nmdc_len) == (curr_offset - offset)) return(nmdc_len);
482 elem_chan_num(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
488 curr_offset = offset;
490 value = tvb_get_ntohs(tvb, curr_offset);
492 proto_tree_add_text(tree,
494 "Channel Number: %u",
499 g_snprintf(add_string, string_len, " - (%u)", value);
501 /* no length check possible */
503 return(curr_offset - offset);
510 elem_chan_type(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
514 const gchar *str = NULL;
517 curr_offset = offset;
520 oct = tvb_get_guint8(tvb, curr_offset);
524 case 0: str = "No Alert"; break;
525 case 1: str = "Speech"; break;
526 case 2: str = "Data"; data = TRUE; break;
527 case 3: str = "Signaling"; break;
533 proto_tree_add_text(tree,
535 "Speech or Data Indicator: %s",
538 g_snprintf(add_string, string_len, " - (%s)", str);
542 NO_MORE_DATA_CHECK(len);
544 oct = tvb_get_guint8(tvb, curr_offset);
548 case 0: str = "Reserved (invalid)"; break;
549 case 1: str = "DCCH"; break;
550 case 2: str = "Reserved for future use (invalid)"; break;
551 case 8: str = "Full rate TCH channel Bm"; break;
552 case 9: str = "Half rate TCH channel Lm"; break;
558 proto_tree_add_text(tree,
560 "Channel Rate and Type: %s",
565 NO_MORE_DATA_CHECK(len);
567 oct = tvb_get_guint8(tvb, curr_offset);
571 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
572 proto_tree_add_text(tree,
577 other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
578 proto_tree_add_text(tree,
580 "%s : %sTransparent service",
582 (oct & 0x40) ? "Non-" : "");
584 other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
585 proto_tree_add_text(tree,
594 case 0: str = "No Resources Required (invalid)"; break;
595 case 1: str = "Reserved"; break;
596 case 2: str = "Reserved"; break;
597 case 3: str = "TIA/EIA-IS-2000 8 kb/s vocoder"; break;
598 case 4: str = "8 kb/s enhanced vocoder (EVRC)"; break;
599 case 5: str = "13 kb/s vocoder"; break;
600 case 6: str = "ADPCM"; break;
606 proto_tree_add_text(tree,
608 "Speech Encoding Algorithm/data rate + Transparency Indicator: %s",
614 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
616 return(curr_offset - offset);
623 elem_rf_chan_id(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
630 curr_offset = offset;
632 proto_tree_add_text(tree, tvb, curr_offset, 1,
637 oct = tvb_get_guint8(tvb, curr_offset);
639 other_decode_bitfield_value(a_bigbuf, oct, 0xfc, 8);
640 proto_tree_add_text(tree, tvb, curr_offset, 1,
644 other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
645 proto_tree_add_text(tree, tvb, curr_offset, 1,
649 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
650 proto_tree_add_text(tree, tvb, curr_offset, 1,
651 "%s : ANSI/EIA/TIA-553",
656 oct = tvb_get_guint8(tvb, curr_offset);
658 other_decode_bitfield_value(a_bigbuf, oct, 0xfc, 8);
659 proto_tree_add_text(tree, tvb, curr_offset, 1,
663 other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
664 proto_tree_add_text(tree, tvb, curr_offset, 1,
665 "%s : Timeslot Number",
670 value = tvb_get_ntohs(tvb, curr_offset);
672 other_decode_bitfield_value(a_bigbuf, value >> 8, 0xf8, 8);
673 proto_tree_add_text(tree, tvb, curr_offset, 1,
677 other_decode_bitfield_value(a_bigbuf, value >> 8, 0x07, 8);
678 proto_tree_add_text(tree, tvb, curr_offset, 1,
679 "%s : ARFCN (MSB): %u",
683 other_decode_bitfield_value(a_bigbuf, value & 0x00ff, 0xff, 8);
684 proto_tree_add_text(tree, tvb, curr_offset + 1, 1,
688 g_snprintf(add_string, string_len, " - (ARFCN: %u)", value & 0x07ff);
692 /* no length check possible */
694 return(curr_offset - offset);
701 elem_sid(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
707 curr_offset = offset;
709 value = tvb_get_ntohs(tvb, curr_offset);
711 other_decode_bitfield_value(a_bigbuf, value >> 8, 0x80, 8);
712 proto_tree_add_text(tree, tvb, curr_offset, 1,
716 other_decode_bitfield_value(a_bigbuf, value >> 8, 0x7f, 8);
717 proto_tree_add_text(tree, tvb, curr_offset, 1,
718 "%s : SID (MSB), %u",
722 other_decode_bitfield_value(a_bigbuf, value & 0x00ff, 0xff, 8);
723 proto_tree_add_text(tree, tvb, curr_offset + 1, 1,
727 g_snprintf(add_string, string_len, " - (SID: %u)", value & 0x7fff);
731 /* no length check possible */
733 return(curr_offset - offset);
740 elem_is95_chan_id(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
746 curr_offset = offset;
748 oct = tvb_get_guint8(tvb, curr_offset);
750 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
751 proto_tree_add_text(tree, tvb, curr_offset, 1,
755 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
756 proto_tree_add_text(tree, tvb, curr_offset, 1,
757 "%s : Number of Channels to Add: %u",
761 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
762 proto_tree_add_text(tree, tvb, curr_offset, 1,
763 "%s : Frame Offset: (%u), %.2f ms",
766 (oct & 0x0f) * 1.25);
770 NO_MORE_DATA_CHECK(len);
772 SHORT_DATA_CHECK(len - (curr_offset - offset), 4);
776 oct = tvb_get_guint8(tvb, curr_offset);
778 proto_tree_add_text(tree, tvb, curr_offset, 1,
779 "Walsh Code Channel Index: %u",
784 oct = tvb_get_guint8(tvb, curr_offset);
786 other_decode_bitfield_value(a_bigbuf, oct, 0xff, 8);
787 proto_tree_add_text(tree, tvb, curr_offset, 1,
788 "%s : Pilot PN Code (LSB)",
794 oct = tvb_get_guint8(tvb, curr_offset);
795 value |= ((guint32) (oct & 0x80)) << 1;
797 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
798 proto_tree_add_text(tree, tvb, curr_offset, 1,
799 "%s : Pilot PN Code (MSB): %u",
803 other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
804 proto_tree_add_text(tree, tvb, curr_offset, 1,
805 "%s : Power Combined",
808 other_decode_bitfield_value(a_bigbuf, oct, 0x20, 8);
809 proto_tree_add_text(tree, tvb, curr_offset, 1,
810 "%s : Frequency Included",
813 other_decode_bitfield_value(a_bigbuf, oct, 0x18, 8);
814 proto_tree_add_text(tree, tvb, curr_offset, 1,
818 value = tvb_get_guint8(tvb, curr_offset + 1) | ((oct & 0x07) << 8);
820 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
821 proto_tree_add_text(tree, tvb, curr_offset, 1,
822 "%s : ARFCN (MSB): %u",
828 other_decode_bitfield_value(a_bigbuf, value & 0x00ff, 0xff, 8);
829 proto_tree_add_text(tree, tvb, curr_offset, 1,
833 if (add_string[0] == '\0')
835 g_snprintf(add_string, string_len, " - (ARFCN: %u)", value);
840 while ((len - (curr_offset - offset)) >= 4);
842 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
844 return(curr_offset - offset);
856 elem_enc_info(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
866 curr_offset = offset;
870 while ((len - (curr_offset - offset)) >= 2)
874 oct = tvb_get_guint8(tvb, curr_offset);
876 switch ((oct & 0x7c) >> 2)
878 case 0: str = "Not Used - Invalid value"; break;
879 case 1: str = "SME Key: Signaling Message Encryption Key"; break;
880 case 2: str = "Reserved (VPM: Voice Privacy Mask)"; break;
881 case 3: str = "Reserved"; break;
882 case 4: str = "Private Longcode"; break;
883 case 5: str = "Data Key (ORYX)"; break;
884 case 6: str = "Initial RAND"; break;
891 proto_tree_add_text(tree,
893 "Encryption Info - %u: (%u) %s",
898 subtree = proto_item_add_subtree(item, ett_ansi_enc_info);
900 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
901 proto_tree_add_text(subtree, tvb, curr_offset, 1,
905 other_decode_bitfield_value(a_bigbuf, oct, 0x7c, 8);
906 proto_tree_add_text(subtree, tvb, curr_offset, 1,
907 "%s : Encryption Parameter Identifier: (%u) %s",
912 other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
913 proto_tree_add_text(subtree, tvb, curr_offset, 1,
916 (oct & 0x02) ? "active" : "inactive");
918 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
919 proto_tree_add_text(subtree, tvb, curr_offset, 1,
920 "%s : Available: algorithm is %savailable",
922 (oct & 0x01) ? "" : "not ");
926 oct_len = tvb_get_guint8(tvb, curr_offset);
928 proto_tree_add_uint(subtree, hf_ansi_a_length, tvb,
929 curr_offset, 1, oct_len);
935 SHORT_DATA_CHECK(len - (curr_offset - offset), oct_len);
937 proto_tree_add_text(subtree, tvb, curr_offset, oct_len,
938 "Encryption Parameter value");
940 curr_offset += oct_len;
944 g_snprintf(add_string, string_len, " - %u record%s",
945 num_recs, plurality(num_recs, "", "s"));
947 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
949 return(curr_offset - offset);
966 elem_cm_info_type_2(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
974 curr_offset = offset;
976 oct = tvb_get_guint8(tvb, curr_offset);
978 other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
979 proto_tree_add_text(tree, tvb, curr_offset, 1,
980 "%s : Mobile P_REV: %u",
984 g_snprintf(add_string, string_len, " - P_REV (%u)", (oct & 0xe0) >> 5);
986 other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
987 proto_tree_add_text(tree, tvb, curr_offset, 1,
991 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
992 proto_tree_add_text(tree, tvb, curr_offset, 1,
993 "%s : See List of Entries",
998 case 0: str = "Class 1, vehicle and portable"; break;
999 case 1: str = "Class 2, portable"; break;
1000 case 2: str = "Class 3, handheld"; break;
1001 case 3: str = "Class 4, handheld"; break;
1002 case 4: str = "Class 5, handheld"; break;
1003 case 5: str = "Class 6, handheld"; break;
1004 case 6: str = "Class 7, handheld"; break;
1006 str = "Class 8, handheld";
1010 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
1011 proto_tree_add_text(tree, tvb, curr_offset, 1,
1012 "%s : RF Power Capability: %s",
1018 proto_tree_add_text(tree, tvb, curr_offset, 1,
1023 oct = tvb_get_guint8(tvb, curr_offset);
1025 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
1026 proto_tree_add_text(tree, tvb, curr_offset, 1,
1027 "%s : NAR_AN_CAP: N-AMPS %ssupported",
1029 (oct & 0x80) ? "" : "not ");
1031 other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
1032 proto_tree_add_text(tree, tvb, curr_offset, 1,
1033 "%s : IS-95: %ssupported",
1035 (oct & 0x40) ? "" : "not ");
1037 other_decode_bitfield_value(a_bigbuf, oct, 0x20, 8);
1038 proto_tree_add_text(tree, tvb, curr_offset, 1,
1039 "%s : Slotted: mobile is %sin slotted mode",
1041 (oct & 0x20) ? "" : "not ");
1043 other_decode_bitfield_value(a_bigbuf, oct, 0x18, 8);
1044 proto_tree_add_text(tree, tvb, curr_offset, 1,
1048 other_decode_bitfield_value(a_bigbuf, oct, 0x04, 8);
1049 proto_tree_add_text(tree, tvb, curr_offset, 1,
1050 "%s : DTX: mobile is %scapable of DTX",
1052 (oct & 0x04) ? "" : "not ");
1054 other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
1055 proto_tree_add_text(tree, tvb, curr_offset, 1,
1056 "%s : Mobile Term: mobile is %scapable of receiving incoming calls",
1058 (oct & 0x02) ? "" : "not ");
1060 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
1061 proto_tree_add_text(tree, tvb, curr_offset, 1,
1067 NO_MORE_DATA_CHECK(len);
1069 proto_tree_add_text(tree, tvb, curr_offset, 1,
1074 NO_MORE_DATA_CHECK(len);
1076 oct = tvb_get_guint8(tvb, curr_offset);
1078 other_decode_bitfield_value(a_bigbuf, oct, 0xfc, 8);
1079 proto_tree_add_text(tree, tvb, curr_offset, 1,
1083 other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
1084 proto_tree_add_text(tree, tvb, curr_offset, 1,
1085 "%s : Mobile Term: mobile is %scapable of receiving incoming calls",
1087 (oct & 0x02) ? "" : "not ");
1089 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
1090 proto_tree_add_text(tree, tvb, curr_offset, 1,
1091 "%s : PACA Supported Indicator (PSI): mobile station %s PACA",
1093 (oct & 0x01) ? "supports" : "does not support");
1097 NO_MORE_DATA_CHECK(len);
1099 oct = tvb_get_guint8(tvb, curr_offset);
1101 proto_tree_add_text(tree, tvb, curr_offset, 1,
1107 oct = tvb_get_guint8(tvb, curr_offset);
1109 proto_tree_add_text(tree, tvb, curr_offset, 1,
1110 "Station Class Mark: %u",
1115 oct = tvb_get_guint8(tvb, curr_offset);
1117 proto_tree_add_text(tree, tvb, curr_offset, 1,
1118 "Count of Band Class Entries: %u",
1123 NO_MORE_DATA_CHECK(len);
1125 oct = tvb_get_guint8(tvb, curr_offset);
1127 proto_tree_add_text(tree, tvb, curr_offset, 1,
1128 "Band Class Entry Length: %u",
1133 NO_MORE_DATA_CHECK(len);
1135 SHORT_DATA_CHECK(len - (curr_offset - offset), 3);
1140 oct = tvb_get_guint8(tvb, curr_offset);
1142 other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
1143 proto_tree_add_text(tree,
1144 tvb, curr_offset, 1,
1148 temp_int = oct & 0x1f;
1149 if ((temp_int < 0) || (temp_int >= (gint) NUM_BAND_CLASS_STR))
1155 str = band_class_str[temp_int];
1158 other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
1159 proto_tree_add_text(tree,
1160 tvb, curr_offset, 1,
1161 "%s : Band Class: %s",
1167 oct = tvb_get_guint8(tvb, curr_offset);
1169 other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
1170 proto_tree_add_text(tree,
1171 tvb, curr_offset, 1,
1175 other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
1176 proto_tree_add_text(tree,
1177 tvb, curr_offset, 1,
1178 "%s : Band Class %u Air Interfaces Supported: %u",
1185 oct = tvb_get_guint8(tvb, curr_offset);
1187 proto_tree_add_text(tree,
1188 tvb, curr_offset, 1,
1189 "Band Class %u MS Protocol Level: %u",
1197 while ((len - (curr_offset - offset)) >= 3);
1199 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
1201 return(curr_offset - offset);
1208 elem_mid(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
1213 guint32 curr_offset;
1216 curr_offset = offset;
1218 oct = tvb_get_guint8(tvb, curr_offset);
1223 other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
1224 proto_tree_add_text(tree,
1225 tvb, curr_offset, 1,
1229 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
1230 proto_tree_add_text(tree,
1231 tvb, curr_offset, 1,
1232 "%s : Type of Identity: Broadcast",
1237 oct = tvb_get_guint8(tvb, curr_offset);
1239 switch ((oct & 0xc0) >> 6)
1241 case 0: str = "Normal"; break;
1242 case 1: str = "Interactive"; break;
1243 case 2: str = "Urgent"; break;
1249 other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
1250 proto_tree_add_text(tree,
1251 tvb, curr_offset, 1,
1252 "%s : Priority: %s",
1256 other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
1257 proto_tree_add_text(tree,
1258 tvb, curr_offset, 1,
1259 "%s : Message ID: %u",
1265 oct = tvb_get_guint8(tvb, curr_offset);
1267 proto_tree_add_text(tree,
1268 tvb, curr_offset, 1,
1272 g_snprintf(add_string, string_len, " - Broadcast (Zone ID: %u)", oct);
1276 value = tvb_get_ntohs(tvb, curr_offset);
1280 case 0x0000: str = "Unknown or unspecified"; break;
1281 case 0x0001: str = "Emergency Broadcasts"; break;
1282 case 0x0002: str = "Administrative"; break;
1283 case 0x0003: str = "Maintenance"; break;
1284 case 0x0004: str = "General News - Local"; break;
1285 case 0x0005: str = "General News - Regional"; break;
1286 case 0x0006: str = "General News - National"; break;
1287 case 0x0007: str = "General News - International"; break;
1288 case 0x0008: str = "Business/Financial News - Local"; break;
1289 case 0x0009: str = "Business/Financial News - Regional"; break;
1290 case 0x000A: str = "Business/Financial News - National"; break;
1291 case 0x000B: str = "Business/Financial News - International"; break;
1292 case 0x000C: str = "Sports News - Local"; break;
1293 case 0x000D: str = "Sports News - Regional"; break;
1294 case 0x000E: str = "Sports News - National"; break;
1295 case 0x000F: str = "Sports News - International"; break;
1296 case 0x0010: str = "Entertainment News - Local"; break;
1297 case 0x0011: str = "Entertainment News - Regional"; break;
1298 case 0x0012: str = "Entertainment News - National"; break;
1299 case 0x0013: str = "Entertainment News - International"; break;
1300 case 0x0014: str = "Local Weather"; break;
1301 case 0x0015: str = "Area Traffic Reports"; break;
1302 case 0x0016: str = "Local Airport Flight Schedules"; break;
1303 case 0x0017: str = "Restaurants"; break;
1304 case 0x0018: str = "Lodgings"; break;
1305 case 0x0019: str = "Retail Directory"; break;
1306 case 0x001A: str = "Advertisements"; break;
1307 case 0x001B: str = "Stock Quotes"; break;
1308 case 0x001C: str = "Employment Opportunities"; break;
1309 case 0x001D: str = "Medical/Health/Hospitals"; break;
1310 case 0x001E: str = "Technology News"; break;
1311 case 0x001F: str = "Multi-category"; break;
1313 if ((value >= 0x0020) && (value <= 0x8000)) { str = "Reserved for standard service categories"; }
1314 else { str = "Reserved for proprietary service categories"; }
1318 proto_tree_add_text(tree,
1319 tvb, curr_offset, 2,
1326 oct = tvb_get_guint8(tvb, curr_offset);
1330 case 0: str = "Unknown or unspecified"; break;
1331 case 1: str = "English"; break;
1332 case 2: str = "French"; break;
1333 case 3: str = "Spanish"; break;
1334 case 4: str = "Japanese"; break;
1335 case 5: str = "Korean"; break;
1336 case 6: str = "Chinese"; break;
1337 case 7: str = "Hebrew"; break;
1343 proto_tree_add_text(tree,
1344 tvb, curr_offset, 1,
1345 "Language: (%u) %s",
1353 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
1354 proto_tree_add_text(tree,
1355 tvb, curr_offset, 1,
1359 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
1360 proto_tree_add_text(tree,
1361 tvb, curr_offset, 1,
1362 "%s : Odd/Even Indicator: %s",
1364 (oct & 0x08) ? "ODD" : "EVEN");
1366 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
1367 proto_tree_add_text(tree,
1368 tvb, curr_offset, 1,
1369 "%s : Type of Identity: No Identity Code",
1372 g_snprintf(add_string, string_len, " - No Identity Code");
1378 proto_tree_add_text(tree, tvb, curr_offset, len - 1,
1379 "Format not supported");
1382 curr_offset += len - 1;
1392 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
1393 proto_tree_add_text(tree,
1394 tvb, curr_offset, 1,
1395 "%s : Identity Digit 1: %c",
1397 Dgt_msid.out[(oct & 0xf0) >> 4]);
1399 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
1400 proto_tree_add_text(tree,
1401 tvb, curr_offset, 1,
1402 "%s : Odd/Even Indicator: %s",
1404 (oct & 0x08) ? "ODD" : "EVEN");
1406 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
1407 proto_tree_add_text(tree,
1408 tvb, curr_offset, 1,
1409 "%s : Type of Identity: %s",
1411 ((oct & 0x07) == 1) ? "MIN" : "IMSI");
1413 a_bigbuf[0] = Dgt_msid.out[(oct & 0xf0) >> 4];
1416 poctets = tvb_get_ephemeral_string(tvb, curr_offset, len - (curr_offset - offset));
1418 my_dgt_tbcd_unpack(&a_bigbuf[1], poctets, len - (curr_offset - offset),
1421 proto_tree_add_string_format(tree,
1422 ((oct & 0x07) == 1) ? hf_ansi_a_min : hf_ansi_a_imsi,
1423 tvb, curr_offset, len - (curr_offset - offset),
1428 g_snprintf(add_string, string_len, " - %s (%s)",
1429 ((oct & 0x07) == 1) ? "MIN" : "IMSI",
1432 curr_offset += len - (curr_offset - offset);
1436 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
1437 proto_tree_add_text(tree,
1438 tvb, curr_offset, 1,
1442 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
1443 proto_tree_add_text(tree,
1444 tvb, curr_offset, 1,
1445 "%s : Odd/Even Indicator: %s",
1447 (oct & 0x08) ? "ODD" : "EVEN");
1449 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
1450 proto_tree_add_text(tree,
1451 tvb, curr_offset, 1,
1452 "%s : Type of Identity: Interface Directory Number",
1455 g_snprintf(add_string, string_len, " - Interface Directory Number");
1461 proto_tree_add_text(tree, tvb, curr_offset, len - 1,
1462 "Format not supported");
1465 curr_offset += len - 1;
1469 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
1470 proto_tree_add_text(tree,
1471 tvb, curr_offset, 1,
1475 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
1476 proto_tree_add_text(tree,
1477 tvb, curr_offset, 1,
1478 "%s : Odd/Even Indicator: %s",
1480 (oct & 0x08) ? "ODD" : "EVEN");
1482 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
1483 proto_tree_add_text(tree,
1484 tvb, curr_offset, 1,
1485 "%s : Type of Identity: TMSI",
1488 g_snprintf(add_string, string_len, " - TMSI");
1494 proto_tree_add_text(tree, tvb, curr_offset, len - 1,
1495 "Format not supported");
1498 curr_offset += len - 1;
1502 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
1503 proto_tree_add_text(tree,
1504 tvb, curr_offset, 1,
1508 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
1509 proto_tree_add_text(tree,
1510 tvb, curr_offset, 1,
1511 "%s : Odd/Even Indicator: %s",
1513 (oct & 0x08) ? "ODD" : "EVEN");
1515 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
1516 proto_tree_add_text(tree,
1517 tvb, curr_offset, 1,
1518 "%s : Type of Identity: ESN",
1523 value = tvb_get_ntohl(tvb, curr_offset);
1525 proto_tree_add_uint(tree, hf_ansi_a_esn,
1526 tvb, curr_offset, 4,
1529 g_snprintf(add_string, string_len, " - ESN (0x%04x)", value);
1535 proto_tree_add_text(tree, tvb, curr_offset, len,
1538 g_snprintf(add_string, string_len, " - Format Unknown");
1544 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
1546 return(curr_offset - offset);
1553 elem_sci(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
1556 guint32 curr_offset;
1559 curr_offset = offset;
1561 oct = tvb_get_guint8(tvb, curr_offset);
1563 other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
1564 proto_tree_add_text(tree,
1565 tvb, curr_offset, 1,
1569 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
1570 proto_tree_add_text(tree,
1571 tvb, curr_offset, 1,
1572 "%s : Slot Cycle Index: %u",
1576 g_snprintf(add_string, string_len, " - (%u)", oct & 0x07);
1580 /* no length check possible */
1582 return(curr_offset - offset);
1589 elem_prio(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
1592 guint32 curr_offset;
1594 curr_offset = offset;
1596 oct = tvb_get_guint8(tvb, curr_offset);
1598 other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
1599 proto_tree_add_text(tree,
1600 tvb, curr_offset, 1,
1604 other_decode_bitfield_value(a_bigbuf, oct, 0x3c, 8);
1605 proto_tree_add_text(tree,
1606 tvb, curr_offset, 1,
1607 "%s : Call Priority Level: %u",
1611 other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
1612 proto_tree_add_text(tree,
1613 tvb, curr_offset, 1,
1614 "%s : Queuing %sallowed",
1616 (oct & 0x02) ? "" : "not ");
1618 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
1619 proto_tree_add_text(tree,
1620 tvb, curr_offset, 1,
1621 "%s : Preemption %sallowed",
1623 (oct & 0x01) ? "" : "not ");
1625 g_snprintf(add_string, string_len, " - (%u)", (oct & 0x3c) >> 2);
1629 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
1631 return(curr_offset - offset);
1638 elem_cause(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
1642 guint32 curr_offset;
1643 const gchar *str = NULL;
1645 curr_offset = offset;
1647 oct = tvb_get_guint8(tvb, curr_offset);
1649 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
1650 proto_tree_add_text(tree,
1651 tvb, curr_offset, 1,
1659 if ((oct & 0x0f) == 0x00)
1661 /* national cause */
1662 switch ((oct & 0x70) >> 4)
1664 case 0: str = "Normal Event"; break;
1665 case 1: str = "Normal Event"; break;
1666 case 2: str = "Resource Unavailable"; break;
1667 case 3: str = "Service or option not available"; break;
1668 case 4: str = "Service or option not implemented"; break;
1669 case 5: str = "Invalid message (e.g., parameter out of range)"; break;
1670 case 6: str = "Protocol error"; break;
1672 str = "Interworking";
1676 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
1677 proto_tree_add_text(tree,
1678 tvb, curr_offset, 1,
1679 "%s : Cause Class: %s",
1683 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
1684 proto_tree_add_text(tree,
1685 tvb, curr_offset, 1,
1686 "%s : National Cause",
1691 proto_tree_add_text(tree, tvb, curr_offset, 1,
1696 g_snprintf(add_string, string_len, " - (National Cause)");
1700 value = tvb_get_guint8(tvb, curr_offset + 1);
1702 other_decode_bitfield_value(a_bigbuf, oct, 0x7f, 8);
1703 proto_tree_add_text(tree,
1704 tvb, curr_offset, 1,
1705 "%s : Cause (MSB): %u",
1707 ((oct & 0x7f) << 8) | value);
1711 other_decode_bitfield_value(a_bigbuf, value, 0xff, 8);
1712 proto_tree_add_text(tree, tvb, curr_offset, 1,
1723 case 0x00: str = "Radio interface message failure"; break;
1724 case 0x01: str = "Radio interface failure"; break;
1725 case 0x02: str = "Uplink Quality"; break;
1726 case 0x03: str = "Uplink strength"; break;
1727 case 0x04: str = "Downlink quality"; break;
1728 case 0x05: str = "Downlink strength"; break;
1729 case 0x06: str = "Distance"; break;
1730 case 0x07: str = "OAM&P intervention"; break;
1731 case 0x08: str = "MS busy"; break;
1732 case 0x09: str = "Call processing"; break;
1733 case 0x0A: str = "Reversion to old channel"; break;
1734 case 0x0B: str = "Handoff successful"; break;
1735 case 0x0C: str = "No response from MS"; break;
1736 case 0x0D: str = "Timer expired"; break;
1737 case 0x0E: str = "Better cell (power budget)"; break;
1738 case 0x0F: str = "Interference"; break;
1739 case 0x10: str = "Packet call going dormant"; break;
1740 case 0x11: str = "Service option not available"; break;
1741 case 0x12: str = "Invalid Call"; break;
1742 case 0x13: str = "Successful operation"; break;
1743 case 0x14: str = "Normal call release"; break;
1744 case 0x1B: str = "Inter-BS Soft Handoff Drop Target"; break;
1745 case 0x1D: str = "Intra-BS Soft Handoff Drop Target"; break;
1746 case 0x20: str = "Equipment failure"; break;
1747 case 0x21: str = "No radio resource available"; break;
1748 case 0x22: str = "Requested terrestrial resource unavailable"; break;
1749 case 0x25: str = "BS not equipped"; break;
1750 case 0x26: str = "MS not equipped (or incapable)"; break;
1751 case 0x29: str = "PACA Call Queued"; break;
1752 case 0x2B: str = "Alternate signaling type reject"; break;
1753 case 0x2D: str = "PACA Queue Overflow"; break;
1754 case 0x2E: str = "PACA Cancel Request Rejected"; break;
1755 case 0x30: str = "Requested transcoding/rate adaptation unavailable"; break;
1756 case 0x31: str = "Lower priority radio resources not available"; break;
1757 case 0x32: str = "PCF resources not available"; break;
1758 case 0x33: str = "TFO Control request Failed"; break;
1759 case 0x40: str = "Ciphering algorithm not supported"; break;
1760 case 0x41: str = "Private Long Code not available or not supported."; break;
1761 case 0x42: str = "Requested MUX option or rates not available."; break;
1762 case 0x43: str = "Requested Privacy Configuration unavailable"; break;
1763 case 0x4F: str = "Terrestrial circuit already allocated.a"; break;
1764 case 0x50: str = "Terrestrial circuit already allocated"; break;
1765 case 0x5F: str = "Protocol Error between BS and MSC.a"; break;
1766 case 0x60: str = "Protocol Error between BS and MSC"; break;
1767 case 0x71: str = "ADDS message too long for delivery on the paging channel"; break;
1768 case 0x72: str = "MS-to-IWF TCP connection failure"; break;
1769 case 0x73: str = "ATH0 (Modem hang up) Command"; break;
1770 case 0x74: str = "+FSH/+FHNG (Fax session ended) Command"; break;
1771 case 0x75: str = "No carrier"; break;
1772 case 0x76: str = "PPP protocol failure"; break;
1773 case 0x77: str = "PPP session closed by the MS"; break;
1774 case 0x78: str = "Do not notify MS"; break;
1775 case 0x79: str = "PDSN resources are not available"; break;
1776 case 0x7A: str = "Data ready to send"; break;
1777 case 0x7F: str = "Handoff procedure time-out"; break;
1779 str = "Reserved for future use";
1783 other_decode_bitfield_value(a_bigbuf, oct, 0x7f, 8);
1784 proto_tree_add_text(tree,
1785 tvb, curr_offset, 1,
1786 "%s : Cause: (%u) %s",
1793 g_snprintf(add_string, string_len, " - (%u) %s", oct & 0x7f, str);
1796 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
1798 return(curr_offset - offset);
1803 * Formats everything after the discriminator, shared function.
1806 elem_cell_id_aux(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len, guint8 disc)
1811 guint32 curr_offset;
1813 curr_offset = offset;
1818 value = tvb_get_ntohs(tvb, curr_offset);
1820 proto_tree_add_uint(tree, hf_ansi_a_cell_ci, tvb,
1821 curr_offset, 2, value);
1825 g_snprintf(add_string, string_len, " - CI (%u)", value);
1829 value = tvb_get_ntohs(tvb, curr_offset);
1831 proto_tree_add_uint(tree, hf_ansi_a_cell_lac, tvb,
1832 curr_offset, 2, value);
1836 g_snprintf(add_string, string_len, " - LAC (%u)", value);
1840 market_id = tvb_get_ntohs(tvb, curr_offset);
1841 switch_num = tvb_get_guint8(tvb, curr_offset + 2);
1843 value = tvb_get_ntoh24(tvb, curr_offset);
1845 proto_tree_add_uint_hidden(tree, hf_ansi_a_cell_mscid, tvb,
1846 curr_offset, 3, value);
1848 proto_tree_add_text(tree, tvb, curr_offset, 3,
1849 "Market ID %u Switch Number %u",
1850 market_id, switch_num);
1854 value = tvb_get_ntohs(tvb, curr_offset);
1856 proto_tree_add_uint(tree, hf_ansi_a_cell_ci, tvb,
1857 curr_offset, 2, value);
1861 g_snprintf(add_string, string_len, " - Market ID (%u) Switch Number (%u) CI (%u)",
1868 proto_tree_add_text(tree, tvb, curr_offset, len - 1,
1869 "Cell ID - Non IOS format");
1871 curr_offset += (len - 1);
1875 return(curr_offset - offset);
1879 elem_cell_id(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
1882 guint32 curr_offset;
1883 const gchar *str = NULL;
1886 add_string = add_string;
1887 curr_offset = offset;
1889 oct = tvb_get_guint8(tvb, curr_offset);
1891 if (oct >= (gint) NUM_CELL_DISC_STR)
1897 str = cell_disc_str[oct];
1900 proto_tree_add_text(tree,
1901 tvb, curr_offset, 1,
1902 "Cell Identification Discriminator: (%u) %s",
1909 elem_cell_id_aux(tvb, tree, curr_offset, len - (curr_offset - offset), add_string, string_len, oct);
1911 /* no length check possible */
1913 return(curr_offset - offset);
1920 elem_cell_id_list(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
1925 guint32 curr_offset;
1926 proto_item *item = NULL;
1927 proto_tree *subtree = NULL;
1928 const gchar *str = NULL;
1930 curr_offset = offset;
1932 oct = tvb_get_guint8(tvb, curr_offset);
1934 if (oct >= (gint) NUM_CELL_DISC_STR)
1940 str = cell_disc_str[oct];
1943 proto_tree_add_text(tree,
1944 tvb, curr_offset, 1,
1945 "Cell Identification Discriminator: (%u) %s",
1951 NO_MORE_DATA_CHECK(len);
1957 proto_tree_add_text(tree,
1958 tvb, curr_offset, -1,
1962 subtree = proto_item_add_subtree(item, ett_cell_list);
1964 add_string[0] = '\0';
1966 elem_cell_id_aux(tvb, subtree, curr_offset, len - (curr_offset - offset), add_string, string_len, oct);
1968 if (add_string[0] != '\0')
1970 proto_item_append_text(item, "%s", add_string);
1973 proto_item_set_len(item, consumed);
1975 curr_offset += consumed;
1979 while ((len - (curr_offset - offset)) > 0);
1981 g_snprintf(add_string, string_len, " - %u cell%s",
1982 num_cells, plurality(num_cells, "", "s"));
1984 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
1986 return(curr_offset - offset);
1993 elem_cic(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
1996 guint32 curr_offset;
1999 curr_offset = offset;
2001 value = tvb_get_ntohs(tvb, curr_offset);
2003 other_decode_bitfield_value(a_bigbuf, value, 0xffe0, 16);
2004 proto_tree_add_text(tree,
2005 tvb, curr_offset, 2,
2006 "%s : PCM Multiplexer: %u",
2008 (value & 0xffe0) >> 5);
2010 other_decode_bitfield_value(a_bigbuf, value, 0x001f, 16);
2011 proto_tree_add_text(tree,
2012 tvb, curr_offset, 2,
2013 "%s : Timeslot: %u",
2019 g_snprintf(add_string, string_len, " - (%u) (0x%04x)", value, value);
2021 /* no length check possible */
2023 return(curr_offset - offset);
2030 elem_cic_ext(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
2034 guint32 curr_offset;
2038 curr_offset = offset;
2040 value = tvb_get_ntohs(tvb, curr_offset);
2042 other_decode_bitfield_value(a_bigbuf, value, 0xffe0, 16);
2043 proto_tree_add_text(tree,
2044 tvb, curr_offset, 2,
2045 "%s : PCM Multiplexer: %u",
2047 (value & 0xffe0) >> 5);
2049 other_decode_bitfield_value(a_bigbuf, value, 0x001f, 16);
2050 proto_tree_add_text(tree,
2051 tvb, curr_offset, 2,
2052 "%s : Timeslot: %u",
2058 g_snprintf(add_string, string_len, " - (%u) (0x%04x)", value, value);
2060 oct = tvb_get_guint8(tvb, curr_offset);
2062 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
2063 proto_tree_add_text(tree,
2064 tvb, curr_offset, 1,
2070 case 0x00: str = "Full-rate"; break;
2076 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
2077 proto_tree_add_text(tree,
2078 tvb, curr_offset, 1,
2079 "%s : Circuit Mode: %s",
2085 /* no length check possible */
2087 return(curr_offset - offset);
2095 #define ANSI_A_CELL_ID_LEN(_disc) ((_disc == 7) ? 5 : 2)
2101 elem_downlink_re(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
2108 guint32 curr_offset;
2109 proto_item *item = NULL;
2110 proto_tree *subtree = NULL;
2113 curr_offset = offset;
2115 oct = tvb_get_guint8(tvb, curr_offset);
2117 proto_tree_add_text(tree, tvb, curr_offset, 1,
2118 "Number of Cells: %u",
2123 NO_MORE_DATA_CHECK(len);
2125 disc = tvb_get_guint8(tvb, curr_offset);
2127 if (disc >= (gint) NUM_CELL_DISC_STR)
2133 str = cell_disc_str[disc];
2136 proto_tree_add_text(tree,
2137 tvb, curr_offset, 1,
2138 "Cell Identification Discriminator: (%u) %s",
2144 NO_MORE_DATA_CHECK(len);
2146 SHORT_DATA_CHECK(len - (curr_offset - offset), (guint32) 3 + ANSI_A_CELL_ID_LEN(disc));
2153 proto_tree_add_text(tree,
2154 tvb, curr_offset, -1,
2158 subtree = proto_item_add_subtree(item, ett_cell_list);
2160 add_string[0] = '\0';
2162 elem_cell_id_aux(tvb, subtree, curr_offset,
2163 len - (curr_offset - offset), add_string, string_len, disc);
2165 if (add_string[0] != '\0')
2167 proto_item_append_text(item, "%s", add_string);
2170 proto_item_set_len(item, consumed);
2172 curr_offset += consumed;
2174 oct = tvb_get_guint8(tvb, curr_offset);
2176 other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
2177 proto_tree_add_text(tree, tvb, curr_offset, 1,
2181 other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
2182 proto_tree_add_text(tree, tvb, curr_offset, 1,
2183 "%s : Downlink Signal Strength Raw: %u",
2189 value = tvb_get_ntohs(tvb, curr_offset);
2191 proto_tree_add_text(tree,
2192 tvb, curr_offset, 2,
2193 "CDMA Target One Way Delay: %u",
2200 while ((len - (curr_offset - offset)) >= (guint32) (3 + ANSI_A_CELL_ID_LEN(disc)));
2202 g_snprintf(add_string, string_len, " - %u cell%s",
2203 num_cells, plurality(num_cells, "", "s"));
2205 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2207 return(curr_offset - offset);
2234 elem_pdsn_ip_addr(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
2236 guint32 curr_offset;
2238 curr_offset = offset;
2240 proto_tree_add_item(tree, hf_ansi_a_pdsn_ip_addr, tvb, curr_offset, len, FALSE);
2243 proto_tree_add_text(tree, tvb, curr_offset, len,
2249 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2251 return(curr_offset - offset);
2258 elem_ho_pow_lev(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
2263 proto_item *item = NULL;
2264 proto_tree *subtree = NULL;
2265 guint32 curr_offset;
2267 curr_offset = offset;
2269 oct = tvb_get_guint8(tvb, curr_offset);
2271 proto_tree_add_text(tree, tvb, curr_offset, 1,
2272 "Number of Cells: %u",
2277 SHORT_DATA_CHECK(len - (curr_offset - offset), (guint32) 6);
2279 oct = tvb_get_guint8(tvb, curr_offset);
2281 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
2282 proto_tree_add_text(tree, tvb, curr_offset, 1,
2286 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
2287 proto_tree_add_text(tree, tvb, curr_offset, 1,
2292 other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
2293 proto_tree_add_text(tree, tvb, curr_offset, 1,
2294 "%s : Handoff Power Level: %u",
2301 proto_tree_add_text(tree,
2302 tvb, curr_offset, -1,
2305 subtree = proto_item_add_subtree(item, ett_cell_list);
2307 add_string[0] = '\0';
2309 elem_cell_id_aux(tvb, subtree, curr_offset,
2310 len - (curr_offset - offset), add_string, string_len, 0x7);
2312 if (add_string[0] != '\0')
2314 proto_item_append_text(item, "%s", add_string);
2317 proto_item_set_len(item, consumed);
2319 curr_offset += consumed;
2323 while ((len - (curr_offset - offset)) >= 3)
2327 oct = tvb_get_guint8(tvb, curr_offset);
2329 other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
2330 proto_tree_add_text(tree, tvb, curr_offset, 1,
2334 other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
2335 proto_tree_add_text(tree, tvb, curr_offset, 1,
2336 "%s : Handoff Power Level: %u",
2343 proto_tree_add_text(tree,
2344 tvb, curr_offset, -1,
2348 subtree = proto_item_add_subtree(item, ett_cell_list);
2350 add_string[0] = '\0';
2352 elem_cell_id_aux(tvb, subtree, curr_offset,
2353 len - (curr_offset - offset), add_string, string_len, 0x2);
2355 if (add_string[0] != '\0')
2357 proto_item_append_text(item, "%s", add_string);
2360 proto_item_set_len(item, consumed);
2362 curr_offset += consumed;
2365 g_snprintf(add_string, string_len, " - %u cell%s",
2366 num_cells, plurality(num_cells, "", "s"));
2368 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2370 return(curr_offset - offset);
2377 elem_uz_id(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
2380 guint32 curr_offset;
2382 curr_offset = offset;
2384 value = tvb_get_ntohs(tvb, curr_offset);
2386 proto_tree_add_text(tree, tvb, curr_offset, 2,
2392 g_snprintf(add_string, string_len, " - (%u)", value);
2394 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2396 return(curr_offset - offset);
2408 elem_is2000_chan_id(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
2413 guint32 curr_offset;
2416 curr_offset = offset;
2418 oct = tvb_get_guint8(tvb, curr_offset);
2420 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
2421 proto_tree_add_text(tree, tvb, curr_offset, 1,
2422 "%s : OTD: Mobile will %sbe using OTD",
2424 (oct & 0x80) ? "" : "not ");
2426 num_chan = (oct & 0x70) >> 4;
2428 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
2429 proto_tree_add_text(tree, tvb, curr_offset, 1,
2430 "%s : Channel Count: %u",
2434 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
2435 proto_tree_add_text(tree, tvb, curr_offset, 1,
2436 "%s : Frame Offset: (%u), %.2f ms",
2439 (oct & 0x0f) * 1.25);
2443 NO_MORE_DATA_CHECK(len);
2445 SHORT_DATA_CHECK(len - (curr_offset - offset), 6);
2449 oct = tvb_get_guint8(tvb, curr_offset);
2453 case 0x01: str = "Fundamental Channel (FCH) TIA/EIA/IS-2000"; break;
2454 case 0x02: str = "Dedicated Control Channel (DCCH) TIA/EIA/IS-2000"; break;
2455 case 0x03: str = "Supplemental Channel (SCH) TIA/EIA/IS-2000"; break;
2457 if ((oct >= 0x80) && (oct <= 0x9f)) { str = "Reserved for UMTS"; }
2458 else { str = "Reserved"; }
2462 proto_tree_add_text(tree, tvb, curr_offset, 1,
2463 "Physical Channel Type: %s",
2468 oct = tvb_get_guint8(tvb, curr_offset);
2470 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
2471 proto_tree_add_text(tree, tvb, curr_offset, 1,
2475 switch ((oct & 0x60) >> 5)
2477 case 0: str = "Gating rate 1"; break;
2478 case 1: str = "Gating rate 1/2"; break;
2479 case 2: str = "Gating rate 1/4"; break;
2485 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
2486 proto_tree_add_text(tree, tvb, curr_offset, 1,
2487 "%s : Pilot Gating Rate: %s",
2491 other_decode_bitfield_value(a_bigbuf, oct, 0x18, 8);
2492 proto_tree_add_text(tree, tvb, curr_offset, 1,
2496 value = tvb_get_guint8(tvb, curr_offset + 1);
2498 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
2499 proto_tree_add_text(tree, tvb, curr_offset, 1,
2500 "%s : Walsh Code Channel Index (MSB): %u",
2502 ((guint32) (oct & 0x07) << 8) | value);
2506 other_decode_bitfield_value(a_bigbuf, value, 0xff, 8);
2507 proto_tree_add_text(tree, tvb, curr_offset, 1,
2508 "%s : Walsh Code Channel Index (LSB)",
2513 oct = tvb_get_guint8(tvb, curr_offset);
2515 other_decode_bitfield_value(a_bigbuf, oct, 0xff, 8);
2516 proto_tree_add_text(tree, tvb, curr_offset, 1,
2517 "%s : Pilot PN Code (LSB)",
2523 oct = tvb_get_guint8(tvb, curr_offset);
2524 value |= ((guint32) (oct & 0x80)) << 1;
2526 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
2527 proto_tree_add_text(tree, tvb, curr_offset, 1,
2528 "%s : Pilot PN Code (MSB): %u",
2532 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
2533 proto_tree_add_text(tree, tvb, curr_offset, 1,
2537 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
2538 proto_tree_add_text(tree, tvb, curr_offset, 1,
2539 "%s : Frequency Included",
2542 value = tvb_get_guint8(tvb, curr_offset + 1) | ((oct & 0x07) << 8);
2544 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
2545 proto_tree_add_text(tree, tvb, curr_offset, 1,
2546 "%s : ARFCN (MSB): %u",
2552 other_decode_bitfield_value(a_bigbuf, value & 0x00ff, 0xff, 8);
2553 proto_tree_add_text(tree, tvb, curr_offset, 1,
2559 while ((len - (curr_offset - offset)) >= 6);
2561 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2563 return(curr_offset - offset);
2568 * NO ASSOCIATED DATA
2575 elem_is95_ms_meas_chan_id(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
2580 guint32 curr_offset;
2583 curr_offset = offset;
2585 oct = tvb_get_guint8(tvb, curr_offset);
2587 temp_int = (oct & 0xf8) >> 3;
2588 if ((temp_int < 0) || (temp_int >= (gint) NUM_BAND_CLASS_STR))
2594 str = band_class_str[temp_int];
2597 other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
2598 proto_tree_add_text(tree,
2599 tvb, curr_offset, 1,
2600 "%s : Band Class: %s",
2604 value = tvb_get_guint8(tvb, curr_offset + 1) | ((oct & 0x07) << 8);
2606 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
2607 proto_tree_add_text(tree, tvb, curr_offset, 1,
2608 "%s : ARFCN (MSB): %u",
2614 other_decode_bitfield_value(a_bigbuf, value & 0x00ff, 0xff, 8);
2615 proto_tree_add_text(tree, tvb, curr_offset, 1,
2619 g_snprintf(add_string, string_len, " - (ARFCN: %u)", value);
2623 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2625 return(curr_offset - offset);
2632 elem_clg_party_ascii_num(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
2635 guint32 curr_offset;
2639 curr_offset = offset;
2641 oct = tvb_get_guint8(tvb, curr_offset);
2643 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
2644 proto_tree_add_text(tree, tvb, curr_offset, 1,
2645 "%s : Extension: %s",
2647 (oct & 0x80) ? "Not extended" : "Extended");
2649 switch ((oct & 0x70) >> 4)
2651 case 0: str = "Unknown"; break;
2652 case 1: str = "International number"; break;
2653 case 2: str = "National number"; break;
2654 case 3: str = "Network-specific number"; break;
2655 case 4: str = "Dedicated PAD access, short code"; break;
2656 case 5: str = "Reserved"; break;
2657 case 6: str = "Reserved"; break;
2659 str = "Reserved for extension";
2663 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
2664 proto_tree_add_text(tree, tvb, curr_offset, 1,
2665 "%s : Type of Number: %s",
2671 case 0x00: str = "Unknown"; break;
2672 case 0x01: str = "ISDN/Telephony Numbering (ITU recommendation E.164/E.163)"; break;
2673 case 0x03: str = "Data Numbering (ITU-T Rec. X.121)"; break;
2674 case 0x04: str = "Telex Numbering (ITU-T Rec. F.69)"; break;
2675 case 0x07: str = "Reserved for extension"; break;
2676 case 0x08: str = "National Numbering"; break;
2677 case 0x09: str = "Private Numbering"; break;
2683 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
2684 proto_tree_add_text(tree, tvb, curr_offset, 1,
2685 "%s : Number Plan Identification: %s",
2695 oct = tvb_get_guint8(tvb, curr_offset);
2697 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
2698 proto_tree_add_text(tree, tvb, curr_offset, 1,
2702 switch ((oct & 0x60) >> 5)
2704 case 0: str = "Presentation allowed"; break;
2705 case 1: str = "Presentation restricted"; break;
2706 case 2: str = "Number not available due to interworking"; break;
2712 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
2713 proto_tree_add_text(tree, tvb, curr_offset, 1,
2714 "%s : Presentation Indicator: %s",
2720 case 0: str = "User-provided, not screened"; break;
2721 case 1: str = "User-provided, verified and passed"; break;
2722 case 2: str = "User-provided, verified and failed"; break;
2724 str = "Network-provided";
2728 other_decode_bitfield_value(a_bigbuf, oct, 0x1c, 8);
2729 proto_tree_add_text(tree, tvb, curr_offset, 1,
2733 other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
2734 proto_tree_add_text(tree, tvb, curr_offset, 1,
2735 "%s : Screening Indicator: %s",
2742 poctets = tvb_get_ephemeral_string(tvb, curr_offset, len - (curr_offset - offset));
2744 proto_tree_add_string_format(tree, hf_ansi_a_clg_party_ascii_num,
2745 tvb, curr_offset, len - (curr_offset - offset),
2748 format_text(poctets, len - (curr_offset - offset)));
2750 curr_offset += len - (curr_offset - offset);
2752 g_snprintf(add_string, string_len, " - (%s)", poctets);
2754 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2756 return(curr_offset - offset);
2763 elem_l3_info(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
2765 guint32 curr_offset;
2768 curr_offset = offset;
2770 proto_tree_add_text(tree, tvb, curr_offset, len,
2771 "Layer 3 Information");
2774 * dissect the embedded DTAP message
2776 l3_tvb = tvb_new_subset(tvb, curr_offset, len, len);
2778 call_dissector(dtap_handle, l3_tvb, g_pinfo, g_tree);
2782 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2784 return(curr_offset - offset);
2789 * Protocol Discriminator
2799 * Location Updating Type
2805 * Simple data no decode required
2812 elem_lai(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
2816 guint32 curr_offset;
2821 curr_offset = offset;
2823 oct = tvb_get_guint8(tvb, curr_offset);
2825 mcc[0] = Dgt_tbcd.out[oct & 0x0f];
2826 mcc[1] = Dgt_tbcd.out[(oct & 0xf0) >> 4];
2828 oct = tvb_get_guint8(tvb, curr_offset+1);
2830 mcc[2] = Dgt_tbcd.out[(oct & 0x0f)];
2833 mnc[2] = Dgt_tbcd.out[(oct & 0xf0) >> 4];
2835 oct = tvb_get_guint8(tvb, curr_offset+2);
2837 mnc[0] = Dgt_tbcd.out[(oct & 0x0f)];
2838 mnc[1] = Dgt_tbcd.out[(oct & 0xf0) >> 4];
2841 proto_tree_add_text(tree,
2842 tvb, curr_offset, 3,
2843 "Mobile Country Code (MCC): %s, Mobile Network Code (MNC): %s",
2849 value = tvb_get_ntohs(tvb, curr_offset);
2851 proto_tree_add_text(tree,
2852 tvb, curr_offset, 2,
2853 "Location Area Code (LAC): 0x%04x (%u)",
2859 /* no length check possible */
2861 return(curr_offset - offset);
2868 elem_rej_cause(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
2871 guint32 curr_offset;
2875 curr_offset = offset;
2877 oct = tvb_get_guint8(tvb, curr_offset);
2881 case 0x01: str = "Reserved"; break;
2882 case 0x02: str = "MIN/IMSI unknown in HLR"; break;
2883 case 0x03: str = "Illegal MS"; break;
2884 case 0x04: str = "TMSI/IMSI/MIN unknown in VLR"; break;
2885 case 0x05: str = "Reserved"; break;
2886 case 0x0b: str = "Roaming not allowed"; break;
2887 case 0x0c: str = "Location area not allowed"; break;
2888 case 0x20: str = "Service option not supported"; break;
2889 case 0x21: str = "Requested service option not subscribed"; break;
2890 case 0x22: str = "Service option temporarily out of order"; break;
2891 case 0x26: str = "Call cannot be identified"; break;
2892 case 0x51: str = "Network failure"; break;
2893 case 0x56: str = "Congestion"; break;
2894 case 0x62: str = "Message type non-existent or not implemented"; break;
2895 case 0x63: str = "Information element non-existent or not implemented"; break;
2896 case 0x64: str = "Invalid information element contents"; break;
2897 case 0x65: str = "Message not compatible with the call state"; break;
2898 case 0x66: str = "Protocol error, unspecified"; break;
2899 case 0x6e: str = "Invalid message, unspecified"; break;
2900 case 0x6f: str = "Mandatory information element error"; break;
2906 proto_tree_add_text(tree,
2907 tvb, curr_offset, 1,
2908 "Reject Cause Value: (%u) %s",
2914 g_snprintf(add_string, string_len, " - (%s)", str);
2916 /* no length check possible */
2918 return(curr_offset - offset);
2925 elem_auth_chlg_param(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
2928 guint32 curr_offset;
2931 curr_offset = offset;
2933 oct = tvb_get_guint8(tvb, curr_offset);
2935 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
2936 proto_tree_add_text(tree,
2937 tvb, curr_offset, 1,
2943 case 1: str = "RAND 32 bits"; break;
2944 case 2: str = "RANDU 24 bits"; break;
2945 case 4: str = "RANDSSD 56 bits"; break;
2946 case 8: str = "RANDBS 32 bits"; break;
2952 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
2953 proto_tree_add_text(tree,
2954 tvb, curr_offset, 1,
2955 "%s : Random Number Type: (%u) %s",
2962 proto_tree_add_text(tree,
2963 tvb, curr_offset, len - (curr_offset - offset),
2964 "RAND/RANDU/RANDBS/RANDSSD Value");
2966 g_snprintf(add_string, string_len, " - (%s)", str);
2968 curr_offset += len - (curr_offset - offset);
2970 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2972 return(curr_offset - offset);
2979 elem_auth_resp_param(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
2982 guint32 curr_offset;
2985 curr_offset = offset;
2987 oct = tvb_get_guint8(tvb, curr_offset);
2989 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
2990 proto_tree_add_text(tree,
2991 tvb, curr_offset, 1,
2997 case 1: str = "AUTHR"; break;
2998 case 2: str = "AUTHU"; break;
2999 case 4: str = "AUTHBS"; break;
3005 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
3006 proto_tree_add_text(tree,
3007 tvb, curr_offset, 1,
3008 "%s : Auth Signature Type: (%u) %s",
3015 proto_tree_add_text(tree,
3016 tvb, curr_offset, len - (curr_offset - offset),
3019 g_snprintf(add_string, string_len, " - (%s)", str);
3021 curr_offset += len - (curr_offset - offset);
3023 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3025 return(curr_offset - offset);
3032 elem_auth_param_count(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
3035 guint32 curr_offset;
3038 curr_offset = offset;
3040 oct = tvb_get_guint8(tvb, curr_offset);
3042 other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
3043 proto_tree_add_text(tree,
3044 tvb, curr_offset, 1,
3048 other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
3049 proto_tree_add_text(tree,
3050 tvb, curr_offset, 1,
3057 g_snprintf(add_string, string_len, " - (%u)", oct & 0x3f);
3059 /* no length check possible */
3061 return(curr_offset - offset);
3068 elem_mwi(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
3071 guint32 curr_offset;
3074 curr_offset = offset;
3076 oct = tvb_get_guint8(tvb, curr_offset);
3078 proto_tree_add_text(tree,
3079 tvb, curr_offset, 1,
3080 "Number of Messages: %u",
3085 g_snprintf(add_string, string_len, " - (%u)", oct);
3087 /* no length check possible */
3089 return(curr_offset - offset);
3095 * UNUSED in SPEC and no IEI!
3102 elem_signal(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
3105 guint32 curr_offset;
3109 curr_offset = offset;
3111 oct = tvb_get_guint8(tvb, curr_offset);
3115 case 0x00: str = "Dial tone on"; break;
3116 case 0x01: str = "Ring back tone on"; break;
3117 case 0x02: str = "Intercept tone on"; break;
3118 case 0x03: str = "Network congestion (reorder) tone on"; break;
3119 case 0x04: str = "Busy tone on"; break;
3120 case 0x05: str = "Confirm tone on"; break;
3121 case 0x06: str = "Answer tone on"; break;
3122 case 0x07: str = "Call waiting tone on"; break;
3123 case 0x08: str = "Off-hook warning tone on"; break;
3124 case 0x3f: str = "Tones off"; break;
3125 case 0x40: str = "Normal Alerting"; break;
3126 case 0x41: str = "Inter-group Alerting"; break;
3127 case 0x42: str = "Special/Priority Alerting"; break;
3128 case 0x43: str = "Reserved (ISDN Alerting pattern 3)"; break;
3129 case 0x44: str = "Ping Ring (abbreviated alert)"; break;
3130 case 0x45: str = "Reserved (ISDN Alerting pattern 5)"; break;
3131 case 0x46: str = "Reserved (ISDN Alerting pattern 6)"; break;
3132 case 0x47: str = "Reserved (ISDN Alerting pattern 7)"; break;
3133 case 0x63: str = "Abbreviated intercept"; break;
3134 case 0x65: str = "Abbreviated reorder"; break;
3135 case 0x4f: str = "Alerting off"; break;
3141 proto_tree_add_text(tree,
3142 tvb, curr_offset, 1,
3143 "Signal Value: (%u) %s",
3147 g_snprintf(add_string, string_len, " - (%s)", str);
3151 oct = tvb_get_guint8(tvb, curr_offset);
3153 other_decode_bitfield_value(a_bigbuf, oct, 0xfc, 8);
3154 proto_tree_add_text(tree,
3155 tvb, curr_offset, 1,
3161 case 0: str = "Medium pitch (standard alert)"; break;
3162 case 1: str = "High pitch"; break;
3163 case 2: str = "Low pitch"; break;
3169 proto_tree_add_text(tree,
3170 tvb, curr_offset, 1,
3171 "%s : Alert Pitch: %s",
3177 /* no length check possible */
3179 return(curr_offset - offset);
3191 elem_cld_party_bcd_num(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
3195 guint32 curr_offset;
3198 curr_offset = offset;
3200 oct = tvb_get_guint8(tvb, curr_offset);
3202 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
3203 proto_tree_add_text(tree,
3204 tvb, curr_offset, 1,
3208 switch ((oct & 0x70) >> 4)
3210 case 0: str = "Unknown"; break;
3211 case 1: str = "International number"; break;
3212 case 2: str = "National number"; break;
3213 case 3: str = "Network specific number"; break;
3214 case 4: str = "Dedicated PAD access, short code"; break;
3215 case 7: str = "Reserved for extension"; break;
3221 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
3222 proto_tree_add_text(tree,
3223 tvb, curr_offset, 1,
3224 "%s : Type of Number: %s",
3230 case 0x00: str = "Unknown"; break;
3231 case 0x01: str = "ISDN/telephony number plan (ITU recommendation E.164/E.163)"; break;
3232 case 0x03: str = "Data number plan (ITU recommendation X.121)"; break;
3233 case 0x04: str = "Telex numbering plan (ITU recommendation F.69)"; break;
3234 case 0x07: str = "Reserved for extension"; break;
3235 case 0x08: str = "National numbering plan"; break;
3236 case 0x09: str = "Private numbering plan"; break;
3242 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
3243 proto_tree_add_text(tree,
3244 tvb, curr_offset, 1,
3245 "%s : Numbering Plan Identification: %s",
3251 poctets = tvb_get_ephemeral_string(tvb, curr_offset, len - (curr_offset - offset));
3253 my_dgt_tbcd_unpack(a_bigbuf, poctets, len - (curr_offset - offset),
3256 proto_tree_add_string_format(tree, hf_ansi_a_cld_party_bcd_num,
3257 tvb, curr_offset, len - (curr_offset - offset),
3262 g_snprintf(add_string, string_len, " - (%s)", a_bigbuf);
3264 curr_offset += len - (curr_offset - offset);
3266 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3268 return(curr_offset - offset);
3273 * UNUSED in SPEC and no IEI!
3275 #ifdef MAYBE_USED_FOR_OLDER_CODECS
3277 elem_clg_party_bcd_num(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
3281 guint32 curr_offset;
3284 curr_offset = offset;
3286 oct = tvb_get_guint8(tvb, curr_offset);
3288 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
3289 proto_tree_add_text(tree, tvb, curr_offset, 1,
3290 "%s : Extension: %s",
3292 (oct & 0x80) ? "Not extended" : "Extended");
3294 switch ((oct & 0x70) >> 4)
3296 case 0: str = "Unknown"; break;
3297 case 1: str = "International number"; break;
3298 case 2: str = "National number"; break;
3299 case 3: str = "Network specific number"; break;
3300 case 4: str = "Dedicated PAD access, short code"; break;
3301 case 7: str = "Reserved for extension"; break;
3307 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
3308 proto_tree_add_text(tree,
3309 tvb, curr_offset, 1,
3310 "%s : Type of Number: %s",
3316 case 0x00: str = "Unknown"; break;
3317 case 0x01: str = "ISDN/telephony number plan (ITU recommendation E.164/E.163)"; break;
3318 case 0x03: str = "Data number plan (ITU recommendation X.121)"; break;
3319 case 0x04: str = "Telex numbering plan (ITU recommendation F.69)"; break;
3320 case 0x07: str = "Reserved for extension"; break;
3321 case 0x08: str = "National numbering plan"; break;
3322 case 0x09: str = "Private numbering plan"; break;
3328 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
3329 proto_tree_add_text(tree,
3330 tvb, curr_offset, 1,
3331 "%s : Numbering Plan Identification: %s",
3341 oct = tvb_get_guint8(tvb, curr_offset);
3343 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
3344 proto_tree_add_text(tree, tvb, curr_offset, 1,
3348 switch ((oct & 0x60) >> 5)
3350 case 0: str = "Presentation allowed"; break;
3351 case 1: str = "Presentation restricted"; break;
3352 case 2: str = "Number not available due to interworking"; break;
3358 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
3359 proto_tree_add_text(tree, tvb, curr_offset, 1,
3360 "%s : Presentation Indicator: %s",
3366 case 0: str = "User-provided, not screened"; break;
3367 case 1: str = "User-provided, verified and passed"; break;
3368 case 2: str = "User-provided, verified and failed"; break;
3370 str = "Network-provided";
3374 other_decode_bitfield_value(a_bigbuf, oct, 0x1c, 8);
3375 proto_tree_add_text(tree, tvb, curr_offset, 1,
3379 other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
3380 proto_tree_add_text(tree, tvb, curr_offset, 1,
3381 "%s : Screening Indicator: %s",
3388 poctets = tvb_get_ephemeral_string(tvb, curr_offset, len - (curr_offset - offset));
3390 my_dgt_tbcd_unpack(a_bigbuf, poctets, len - (curr_offset - offset),
3393 proto_tree_add_string_format(tree, hf_ansi_a_clg_party_bcd_num,
3394 tvb, curr_offset, len - (curr_offset - offset),
3399 g_snprintf(add_string, string_len, " - (%s)", a_bigbuf);
3401 curr_offset += len - (curr_offset - offset);
3403 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3405 return(curr_offset - offset);
3413 elem_qos_params(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
3416 guint32 curr_offset;
3418 curr_offset = offset;
3420 oct = tvb_get_guint8(tvb, curr_offset);
3422 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
3423 proto_tree_add_text(tree,
3424 tvb, curr_offset, 1,
3428 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
3429 proto_tree_add_text(tree,
3430 tvb, curr_offset, 1,
3431 "%s : Packet Priority: %u",
3435 g_snprintf(add_string, string_len, " - (%u)", oct & 0x0f);
3439 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3441 return(curr_offset - offset);
3448 elem_cause_l3(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
3451 guint32 curr_offset;
3452 const gchar *str = NULL;
3454 curr_offset = offset;
3456 oct = tvb_get_guint8(tvb, curr_offset);
3458 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
3459 proto_tree_add_text(tree,
3460 tvb, curr_offset, 1,
3464 switch ((oct & 0x60) >> 5)
3466 case 0: str = "Standard as described in ITU Recommendation Q.931"; break;
3467 case 1: str = "Reserved for other international standards"; break;
3468 case 2: str = "National standard"; break;
3470 str = "Reserved for other international standards";
3474 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
3475 proto_tree_add_text(tree,
3476 tvb, curr_offset, 1,
3477 "%s : Coding Standard: %s",
3481 other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
3482 proto_tree_add_text(tree,
3483 tvb, curr_offset, 1,
3489 case 0: str = "User"; break;
3490 case 1: str = "Private network serving the local user"; break;
3491 case 2: str = "Public network serving the local user"; break;
3492 case 3: str = "Transit network"; break;
3493 case 4: str = "Public network serving the remote user"; break;
3494 case 5: str = "Private network serving the remote user"; break;
3495 case 7: str = "International network"; break;
3496 case 10: str = "Network beyond interworking point"; break;
3498 str = "All other values Reserved"; break;
3502 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
3503 proto_tree_add_text(tree,
3504 tvb, curr_offset, 1,
3505 "%s : Location: %s",
3511 oct = tvb_get_guint8(tvb, curr_offset);
3513 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
3514 proto_tree_add_text(tree,
3515 tvb, curr_offset, 1,
3519 switch ((oct & 0x70) >> 4)
3521 case 0: str = "normal event"; break;
3522 case 1: str = "normal event"; break;
3523 case 2: str = "resource unavailable"; break;
3524 case 3: str = "service or option not available"; break;
3525 case 4: str = "service or option not implemented"; break;
3526 case 5: str = "invalid message (e.g., parameter out of range)"; break;
3527 case 6: str = "protocol error (e.g., unknown message)"; break;
3529 str = "interworking";
3533 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
3534 proto_tree_add_text(tree,
3535 tvb, curr_offset, 1,
3536 "%s : Class: (%u) %s",
3543 case 0x01: str = "Unassigned (unallocated) number"; break;
3544 case 0x03: str = "No route to destination"; break;
3545 case 0x06: str = "Channel unacceptable"; break;
3546 case 0x0F: str = "Procedure failed"; break;
3547 case 0x10: str = "Normal Clearing"; break;
3548 case 0x11: str = "User busy"; break;
3549 case 0x12: str = "No user responding"; break;
3550 case 0x13: str = "User alerting, no answer"; break;
3551 case 0x15: str = "Call rejected"; break;
3552 case 0x16: str = "Number changed New destination"; break;
3553 case 0x1A: str = "Non selected user clearing"; break;
3554 case 0x1B: str = "Destination out of order"; break;
3555 case 0x1C: str = "Invalid number format (incomplete number)"; break;
3556 case 0x1D: str = "Facility rejected"; break;
3557 case 0x1F: str = "Normal, unspecified"; break;
3558 case 0x22: str = "No circuit/channel available"; break;
3559 case 0x26: str = "Network out of order"; break;
3560 case 0x29: str = "Temporary failure"; break;
3561 case 0x2A: str = "Switching equipment congestion"; break;
3562 case 0x2B: str = "Access information discarded information element ids"; break;
3563 case 0x2C: str = "requested circuit/channel not available"; break;
3564 case 0x2F: str = "Resources unavailable, unspecified"; break;
3565 case 0x31: str = "Quality of service unavailable"; break;
3566 case 0x32: str = "Requested facility not subscribed"; break;
3567 case 0x33: str = "Request MUX option or rates unavailable"; break;
3568 case 0x39: str = "Bearer capability not authorized"; break;
3569 case 0x3A: str = "Bearer capability not presently available"; break;
3570 case 0x3B: str = "SSD Update Rejected"; break;
3571 case 0x3F: str = "Service or option not available, unspecified"; break;
3572 case 0x41: str = "Bearer service not implemented"; break;
3573 case 0x45: str = "Requested facility not implement"; break;
3574 case 0x46: str = "Only restricted digital information bearer capability is available"; break;
3575 case 0x4F: str = "Service or option not implemented, unspecified"; break;
3576 case 0x51: str = "Reserved"; break;
3577 case 0x58: str = "Incompatible destination incompatible parameter"; break;
3578 case 0x5B: str = "Invalid transit network selection"; break;
3579 case 0x5F: str = "Invalid message, unspecified"; break;
3580 case 0x60: str = "Mandatory information element error information element identifier(s)"; break;
3581 case 0x61: str = "Message type nonexistent or not implemented message type"; break;
3582 case 0x62: str = "Message not compatible with control state message type or message type nonexistent or not implemented"; break;
3583 case 0x64: str = "Invalid information element contents Information element Identifier(s)"; break;
3584 case 0x65: str = "Message not compatible with call state message type"; break;
3585 case 0x6F: str = "Protocol error, unspecified"; break;
3586 case 0x7F: str = "Interworking, unspecified"; break;
3592 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
3593 proto_tree_add_text(tree,
3594 tvb, curr_offset, 1,
3599 g_snprintf(add_string, string_len, " - (%u) %s", oct & 0x7f, str);
3603 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3605 return(curr_offset - offset);
3622 elem_xmode(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
3625 guint32 curr_offset;
3627 curr_offset = offset;
3629 oct = tvb_get_guint8(tvb, curr_offset);
3631 other_decode_bitfield_value(a_bigbuf, oct, 0xfe, 8);
3632 proto_tree_add_text(tree,
3633 tvb, curr_offset, 1,
3637 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
3638 proto_tree_add_text(tree,
3639 tvb, curr_offset, 1,
3640 "%s : TFO Mode: %s",
3642 (oct & 0x01) ? "TFO" : "tandem");
3644 g_snprintf(add_string, string_len, " - (%s)",
3645 (oct & 0x01) ? "TFO" : "tandem");
3649 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3651 return(curr_offset - offset);
3661 * NO ASSOCIATED DATA
3668 elem_reg_type(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
3671 guint32 curr_offset;
3675 curr_offset = offset;
3677 oct = tvb_get_guint8(tvb, curr_offset);
3681 case 0x00: str = "Timer-based"; break;
3682 case 0x01: str = "Power-up"; break;
3683 case 0x02: str = "Zone-based"; break;
3684 case 0x03: str = "Power-down"; break;
3685 case 0x04: str = "Parameter-change"; break;
3686 case 0x05: str = "Ordered"; break;
3687 case 0x06: str = "Distance-based"; break;
3693 proto_tree_add_text(tree,
3694 tvb, curr_offset, 1,
3695 "Location Registration Type: %s",
3698 g_snprintf(add_string, string_len, " - (%s)", str);
3702 /* no length check possible */
3704 return(curr_offset - offset);
3711 elem_tag(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
3714 guint32 curr_offset;
3717 curr_offset = offset;
3719 value = tvb_get_ntohl(tvb, curr_offset);
3721 proto_tree_add_text(tree,
3722 tvb, curr_offset, 4,
3726 g_snprintf(add_string, string_len, " - (%u)", value);
3730 /* no length check possible */
3732 return(curr_offset - offset);
3739 elem_hho_params(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
3743 guint32 curr_offset;
3747 curr_offset = offset;
3749 oct = tvb_get_guint8(tvb, curr_offset);
3751 other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
3752 proto_tree_add_text(tree,
3753 tvb, curr_offset, 1,
3757 temp_int = oct & 0x1f;
3758 if ((temp_int < 0) || (temp_int >= (gint) NUM_BAND_CLASS_STR))
3764 str = band_class_str[temp_int];
3767 other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
3768 proto_tree_add_text(tree,
3769 tvb, curr_offset, 1,
3770 "%s : Band Class: %s",
3776 g_snprintf(add_string, string_len, " - (%s)", str);
3778 oct = tvb_get_guint8(tvb, curr_offset);
3780 other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
3781 proto_tree_add_text(tree,
3782 tvb, curr_offset, 1,
3783 "%s : Number of Preamble Frames: %u",
3787 other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
3788 proto_tree_add_text(tree,
3789 tvb, curr_offset, 1,
3790 "%s : Reset L2: %s Layer 2 Acknowledgement",
3792 (oct & 0x10) ? "Reset" : "Do not reset");
3794 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
3795 proto_tree_add_text(tree,
3796 tvb, curr_offset, 1,
3797 "%s : Reset FPC: %s counters",
3799 (oct & 0x10) ? "Reset" : "Do not reset");
3801 switch ((oct & 0x06) >> 1)
3803 case 0: str = "Encryption disabled"; break;
3804 case 1: str = "Encryption enabled"; break;
3810 other_decode_bitfield_value(a_bigbuf, oct, 0x06, 8);
3811 proto_tree_add_text(tree,
3812 tvb, curr_offset, 1,
3813 "%s : Encryption Mode: %s",
3817 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
3818 proto_tree_add_text(tree,
3819 tvb, curr_offset, 1,
3820 "%s : Private LCM: %s Private Long Code Mask",
3822 (oct & 0x01) ? "Use" : "Do not use");
3826 oct = tvb_get_guint8(tvb, curr_offset);
3828 other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
3829 proto_tree_add_text(tree,
3830 tvb, curr_offset, 1,
3834 other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
3835 proto_tree_add_text(tree,
3836 tvb, curr_offset, 1,
3840 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
3841 proto_tree_add_text(tree,
3842 tvb, curr_offset, 1,
3849 oct = tvb_get_guint8(tvb, curr_offset);
3851 other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
3852 proto_tree_add_text(tree,
3853 tvb, curr_offset, 1,
3857 other_decode_bitfield_value(a_bigbuf, oct, 0x3e, 8);
3858 proto_tree_add_text(tree,
3859 tvb, curr_offset, 1,
3860 "%s : FPC Subchannel Information: %u",
3864 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
3865 proto_tree_add_text(tree,
3866 tvb, curr_offset, 1,
3867 "%s : FPC SubChannel Information Included",
3872 oct = tvb_get_guint8(tvb, curr_offset);
3874 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
3875 proto_tree_add_text(tree,
3876 tvb, curr_offset, 1,
3880 other_decode_bitfield_value(a_bigbuf, oct, 0x0e, 8);
3881 proto_tree_add_text(tree,
3882 tvb, curr_offset, 1,
3883 "%s : Power Control Step: %u",
3887 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
3888 proto_tree_add_text(tree,
3889 tvb, curr_offset, 1,
3890 "%s : Power Control Step Included",
3895 /* no length check possible */
3897 return(curr_offset - offset);
3909 elem_sw_ver(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
3911 guint8 major, minor, point;
3912 guint32 curr_offset;
3914 curr_offset = offset;
3916 major = tvb_get_guint8(tvb, curr_offset);
3918 proto_tree_add_text(tree,
3919 tvb, curr_offset, 1,
3920 "IOS Major Revision Level: %u",
3925 minor = tvb_get_guint8(tvb, curr_offset);
3927 proto_tree_add_text(tree,
3928 tvb, curr_offset, 1,
3929 "IOS Minor Revision Level: %u",
3934 point = tvb_get_guint8(tvb, curr_offset);
3936 proto_tree_add_text(tree,
3937 tvb, curr_offset, 1,
3938 "IOS Point Revision Level: %u",
3943 g_snprintf(add_string, string_len, " - (IOS %u.%u.%u)", major, minor, point);
3947 proto_tree_add_text(tree, tvb, curr_offset, len - 3,
3948 "Manufacturer/Carrier Software Information");
3950 curr_offset += len - 3;
3953 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3955 return(curr_offset - offset);
3961 elem_so(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
3964 guint32 curr_offset;
3968 curr_offset = offset;
3970 value = tvb_get_ntohs(tvb, curr_offset);
3972 other_decode_bitfield_value(a_bigbuf, value, 0x8000, 16);
3973 proto_tree_add_text(tree,
3974 tvb, curr_offset, 2,
3975 "%s : Proprietary Indicator",
3978 other_decode_bitfield_value(a_bigbuf, value, 0x7000, 16);
3979 proto_tree_add_text(tree,
3980 tvb, curr_offset, 2,
3981 "%s : Service Option Revision",
3984 other_decode_bitfield_value(a_bigbuf, value, 0x0fff, 16);
3985 proto_tree_add_text(tree,
3986 tvb, curr_offset, 2,
3987 "%s : Base Service Option Number",
3992 case 1: str = "Basic Variable Rate Voice Service (8 kbps)"; break;
3993 case 2: str = "Mobile Station Loopback (8 kbps)"; break;
3994 case 3: str = "Enhanced Variable Rate Voice Service (8 kbps)"; break;
3995 case 4: str = "Asynchronous Data Service (9.6 kbps)"; break;
3996 case 5: str = "Group 3 Facsimile (9.6 kbps)"; break;
3997 case 6: str = "Short Message Services (Rate Set 1)"; break;
3998 case 7: str = "Packet Data Service: Internet or ISO Protocol Stack (9.6 kbps)"; break;
3999 case 8: str = "Packet Data Service: CDPD Protocol Stack (9.6 kbps)"; break;
4000 case 9: str = "Mobile Station Loopback (13 kbps)"; break;
4001 case 10: str = "STU-III Transparent Service"; break;
4002 case 11: str = "STU-III Non-Transparent Service"; break;
4003 case 12: str = "Asynchronous Data Service (14.4 or 9.6 kbps)"; break;
4004 case 13: str = "Group 3 Facsimile (14.4 or 9.6 kbps)"; break;
4005 case 14: str = "Short Message Services (Rate Set 2)"; break;
4006 case 15: str = "Packet Data Service: Internet or ISO Protocol Stack (14.4 kbps)"; break;
4007 case 16: str = "Packet Data Service: CDPD Protocol Stack (14.4 kbps)"; break;
4008 case 17: str = "High Rate Voice Service (13 kbps)"; break;
4009 case 32768: str = "QCELP (13 kbps)"; break;
4010 case 32798: /* 0x801e */ str = "Qualcomm Loopback"; break;
4011 case 32799: /* 0x801f */ str = "Qualcomm Markov 8 kbps Loopback"; break;
4012 case 32800: /* 0x8020 */ str = "Qualcomm Packet Data"; break;
4013 case 32801: /* 0x8021 */ str = "Qualcomm Async Data"; break;
4014 case 18: str = "Over-the-Air Parameter Administration (Rate Set 1)"; break;
4015 case 19: str = "Over-the-Air Parameter Administration (Rate Set 2)"; break;
4016 case 20: str = "Group 3 Analog Facsimile (Rate Set 1)"; break;
4017 case 21: str = "Group 3 Analog Facsimile (Rate Set 2)"; break;
4018 case 22: str = "High Speed Packet Data Service: Internet or ISO Protocol Stack (RS1 forward, RS1 reverse)"; break;
4019 case 23: str = "High Speed Packet Data Service: Internet or ISO Protocol Stack (RS1 forward, RS2 reverse)"; break;
4020 case 24: str = "High Speed Packet Data Service: Internet or ISO Protocol Stack (RS2 forward, RS1 reverse)"; break;
4021 case 25: str = "High Speed Packet Data Service: Internet or ISO Protocol Stack (RS2 forward, RS2 reverse)"; break;
4022 case 26: str = "High Speed Packet Data Service: CDPD Protocol Stack (RS1 forward, RS1 reverse)"; break;
4023 case 27: str = "High Speed Packet Data Service: CDPD Protocol Stack (RS1 forward, RS2 reverse)"; break;
4024 case 28: str = "High Speed Packet Data Service: CDPD Protocol Stack (RS2 forward, RS1 reverse)"; break;
4025 case 29: str = "High Speed Packet Data Service: CDPD Protocol Stack (RS2 forward, RS2 reverse)"; break;
4026 case 30: str = "Supplemental Channel Loopback Test for Rate Set 1"; break;
4027 case 31: str = "Supplemental Channel Loopback Test for Rate Set 2"; break;
4028 case 32: str = "Test Data Service Option (TDSO)"; break;
4029 case 33: str = "cdma2000 High Speed Packet Data Service, Internet or ISO Protocol Stack"; break;
4030 case 34: str = "cdma2000 High Speed Packet Data Service, CDPD Protocol Stack"; break;
4031 case 35: str = "Location Services, Rate Set 1 (9.6 kbps)"; break;
4032 case 36: str = "Location Services, Rate Set 2 (14.4 kbps)"; break;
4033 case 37: str = "ISDN Interworking Service (64 kbps)"; break;
4034 case 38: str = "GSM Voice"; break;
4035 case 39: str = "GSM Circuit Data"; break;
4036 case 40: str = "GSM Packet Data"; break;
4037 case 41: str = "GSM Short Message Service"; break;
4038 case 42: str = "None Reserved for MC-MAP standard service options"; break;
4039 case 54: str = "Markov Service Option (MSO)"; break;
4040 case 55: str = "Loopback Service Option (LSO)"; break;
4041 case 56: str = "Selectable Mode Vocoder"; break;
4042 case 57: str = "32 kbps Circuit Video Conferencing"; break;
4043 case 58: str = "64 kbps Circuit Video Conferencing"; break;
4044 case 59: str = "HRPD Accounting Records Identifier"; break;
4045 case 60: str = "Link Layer Assisted Robust Header Compression (LLA ROHC) - Header Removal"; break;
4046 case 61: str = "Link Layer Assisted Robust Header Compression (LLA ROHC) - Header Compression"; break;
4047 case 62: str = "- 4099 None Reserved for standard service options"; break;
4048 case 4100: str = "Asynchronous Data Service, Revision 1 (9.6 or 14.4 kbps)"; break;
4049 case 4101: str = "Group 3 Facsimile, Revision 1 (9.6 or 14.4 kbps)"; break;
4050 case 4102: str = "Reserved for standard service option"; break;
4051 case 4103: str = "Packet Data Service: Internet or ISO Protocol Stack, Revision 1 (9.6 or 14.4 kbps)"; break;
4052 case 4104: str = "Packet Data Service: CDPD Protocol Stack, Revision 1 (9.6 or 14.4 kbps)"; break;
4054 if ((value >= 4105) && (value <= 32767)) { str = "Reserved for standard service options"; }
4055 else if ((value >= 32769) && (value <= 32771)) { str = "Proprietary QUALCOMM Incorporated"; }
4056 else if ((value >= 32772) && (value <= 32775)) { str = "Proprietary OKI Telecom"; }
4057 else if ((value >= 32776) && (value <= 32779)) { str = "Proprietary Lucent Technologies"; }
4058 else if ((value >= 32780) && (value <=32783)) { str = "Nokia"; }
4059 else if ((value >= 32784) && (value <=32787)) { str = "NORTEL NETWORKS"; }
4060 else if ((value >= 32788) && (value <=32791)) { str = "Sony Electronics Inc."; }
4061 else if ((value >= 32792) && (value <=32795)) { str = "Motorola"; }
4062 else if ((value >= 32796) && (value <=32799)) { str = "QUALCOMM Incorporated"; }
4063 else if ((value >= 32800) && (value <=32803)) { str = "QUALCOMM Incorporated"; }
4064 else if ((value >= 32804) && (value <=32807)) { str = "QUALCOMM Incorporated"; }
4065 else if ((value >= 32808) && (value <=32811)) { str = "QUALCOMM Incorporated"; }
4066 else if ((value >= 32812) && (value <=32815)) { str = "Lucent Technologies"; }
4067 else if ((value >= 32816) && (value <=32819)) { str = "Denso International"; }
4068 else if ((value >= 32820) && (value <=32823)) { str = "Motorola"; }
4069 else if ((value >= 32824) && (value <=32827)) { str = "Denso International"; }
4070 else if ((value >= 32828) && (value <=32831)) { str = "Denso International"; }
4071 else if ((value >= 32832) && (value <=32835)) { str = "Denso International"; }
4072 else if ((value >= 32836) && (value <=32839)) { str = "NEC America"; }
4073 else if ((value >= 32840) && (value <=32843)) { str = "Samsung Electronics"; }
4074 else if ((value >= 32844) && (value <=32847)) { str = "Texas Instruments Incorporated"; }
4075 else if ((value >= 32848) && (value <=32851)) { str = "Toshiba Corporation"; }
4076 else if ((value >= 32852) && (value <=32855)) { str = "LG Electronics Inc."; }
4077 else if ((value >= 32856) && (value <=32859)) { str = "VIA Telecom Inc."; }
4078 else { str = "Reserved"; }
4082 g_snprintf(add_string, string_len, " - (%u) (0x%04x)", value, value);
4084 proto_tree_add_text(tree,
4085 tvb, curr_offset, 2,
4092 /* no length check possible */
4094 return(curr_offset - offset);
4097 #define ADDS_APP_SMS 0x03
4098 #define ADDS_APP_OTA 0x04
4099 #define ADDS_APP_PLD 0x05
4105 elem_adds_user_part(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
4109 guint32 curr_offset;
4113 curr_offset = offset;
4116 oct = tvb_get_guint8(tvb, curr_offset);
4118 other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
4119 proto_tree_add_text(tree,
4120 tvb, curr_offset, 1,
4124 adds_app = oct & 0x3f;
4131 adds_tvb = tvb_new_subset(tvb, curr_offset + 1, len - 1, len - 1);
4133 dissector_try_port(is637_dissector_table,
4134 0, adds_tvb, g_pinfo, g_tree);
4140 adds_tvb = tvb_new_subset(tvb, curr_offset + 1, len - 1, len - 1);
4142 dissector_try_port(is683_dissector_table,
4143 (g_pinfo->p2p_dir == P2P_DIR_RECV), adds_tvb, g_pinfo, g_tree);
4149 adds_tvb = tvb_new_subset(tvb, curr_offset + 1, len - 1, len - 1);
4151 dissector_try_port(is801_dissector_table,
4152 (g_pinfo->p2p_dir == P2P_DIR_RECV), adds_tvb, g_pinfo, g_tree);
4160 other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
4161 proto_tree_add_text(tree,
4162 tvb, curr_offset, 1,
4163 "%s : Data Burst Type: %s",
4169 proto_tree_add_text(tree, tvb, curr_offset, len - 1,
4170 "Application Data Message");
4172 g_snprintf(add_string, string_len, " - (%s)", str);
4174 curr_offset += (len - 1);
4176 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
4178 return(curr_offset - offset);
4185 elem_is2000_scr(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
4188 guint32 curr_offset;
4190 curr_offset = offset;
4192 oct = tvb_get_guint8(tvb, curr_offset);
4194 other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
4195 proto_tree_add_text(tree, tvb, curr_offset, 1,
4199 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
4200 proto_tree_add_text(tree, tvb, curr_offset, 1,
4201 "%s : Bit-Exact Length Fill Bits: %u",
4207 NO_MORE_DATA_CHECK(len);
4209 proto_tree_add_text(tree, tvb, curr_offset,
4210 len - (curr_offset - offset),
4211 "IS-2000 Service Configuration Record Content");
4213 curr_offset += len - (curr_offset - offset);
4215 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
4217 return(curr_offset - offset);
4224 elem_is2000_nn_scr(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
4228 guint32 curr_offset;
4230 curr_offset = offset;
4232 oct_len = tvb_get_guint8(tvb, curr_offset);
4234 proto_tree_add_text(tree,
4235 tvb, curr_offset, 1,
4236 "Bit-Exact Length Octet Count: %u",
4241 NO_MORE_DATA_CHECK(len);
4243 oct = tvb_get_guint8(tvb, curr_offset);
4245 other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
4246 proto_tree_add_text(tree, tvb, curr_offset, 1,
4250 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
4251 proto_tree_add_text(tree, tvb, curr_offset, 1,
4252 "%s : Bit-Exact Length Fill Bits: %u",
4258 NO_MORE_DATA_CHECK(len);
4262 SHORT_DATA_CHECK(len - (curr_offset - offset), oct_len);
4264 proto_tree_add_text(tree, tvb, curr_offset, oct_len,
4265 "IS-2000 Non-Negotiable Service Configuration Record Content");
4267 curr_offset += oct_len;
4270 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
4272 return(curr_offset - offset);
4279 elem_is2000_mob_cap(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
4283 guint32 curr_offset;
4286 curr_offset = offset;
4288 oct = tvb_get_guint8(tvb, curr_offset);
4290 other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
4291 proto_tree_add_text(tree, tvb, curr_offset, 1,
4295 other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
4296 proto_tree_add_text(tree, tvb, curr_offset, 1,
4297 "%s : DCCH Supported: IS-2000 DCCH %ssupported",
4299 (oct & 0x10) ? "" : "not ");
4301 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
4302 proto_tree_add_text(tree, tvb, curr_offset, 1,
4303 "%s : FCH Supported: IS-2000 FCH %ssupported",
4305 (oct & 0x08) ? "" : "not ");
4307 other_decode_bitfield_value(a_bigbuf, oct, 0x04, 8);
4308 proto_tree_add_text(tree, tvb, curr_offset, 1,
4309 "%s : OTD Supported: Orthogonal Transmit Diversity %ssupported",
4311 (oct & 0x04) ? "" : "not ");
4313 other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
4314 proto_tree_add_text(tree, tvb, curr_offset, 1,
4315 "%s : Enhanced RC CFG Supported: Radio configuration in radio class 2 %ssupported",
4317 (oct & 0x02) ? "" : "not ");
4319 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
4320 proto_tree_add_text(tree, tvb, curr_offset, 1,
4321 "%s : QPCH Supported: Quick Paging Channel %ssupported",
4323 (oct & 0x01) ? "" : "not ");
4327 NO_MORE_DATA_CHECK(len);
4329 oct_len = tvb_get_guint8(tvb, curr_offset);
4331 proto_tree_add_text(tree,
4332 tvb, curr_offset, 1,
4333 "FCH Information: Bit-Exact Length Octet Count: %u",
4338 NO_MORE_DATA_CHECK(len);
4340 oct = tvb_get_guint8(tvb, curr_offset);
4342 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
4343 proto_tree_add_text(tree, tvb, curr_offset, 1,
4347 switch ((oct & 0x70) >> 4)
4349 case 0: str = "No mobile assisted geo-location capabilities"; break;
4350 case 1: str = "IS801 capable (Advanced Forward Link Triangulation only (AFLT))"; break;
4351 case 2: str = "IS801 capable (Advanced Forward Link Triangulation and Global Positioning Systems"; break;
4352 case 3: str = "Global Positioning Systems Only"; break;
4354 str = "All Other values reserved";
4358 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
4359 proto_tree_add_text(tree, tvb, curr_offset, 1,
4360 "%s : Geo Location Type: %s",
4364 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
4365 proto_tree_add_text(tree, tvb, curr_offset, 1,
4366 "%s : Geo Location Included",
4369 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
4370 proto_tree_add_text(tree, tvb, curr_offset, 1,
4371 "%s : FCH Information: Bit-Exact Length Fill Bits: %u",
4377 NO_MORE_DATA_CHECK(len);
4381 SHORT_DATA_CHECK(len - (curr_offset - offset), oct_len);
4383 proto_tree_add_text(tree, tvb, curr_offset, oct_len,
4384 "FCH Information Content");
4386 curr_offset += oct_len;
4388 NO_MORE_DATA_CHECK(len);
4391 oct_len = tvb_get_guint8(tvb, curr_offset);
4393 proto_tree_add_text(tree,
4394 tvb, curr_offset, 1,
4395 "DCCH Information: Bit-Exact Length Octet Count: %u",
4400 NO_MORE_DATA_CHECK(len);
4402 oct = tvb_get_guint8(tvb, curr_offset);
4404 other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
4405 proto_tree_add_text(tree, tvb, curr_offset, 1,
4409 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
4410 proto_tree_add_text(tree, tvb, curr_offset, 1,
4411 "%s : DCCH Information: Bit-Exact Length Fill Bits: %u",
4417 NO_MORE_DATA_CHECK(len);
4421 SHORT_DATA_CHECK(len - (curr_offset - offset), oct_len);
4423 proto_tree_add_text(tree, tvb, curr_offset, oct_len,
4424 "DCCH Information Content");
4426 curr_offset += oct_len;
4429 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
4431 return(curr_offset - offset);
4438 elem_ptype(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
4441 guint32 curr_offset;
4444 curr_offset = offset;
4446 value = tvb_get_ntohs(tvb, curr_offset);
4450 case 0x880b: str = "PPP"; break;
4451 case 0x8881: str = "Unstructured Byte Stream"; break;
4457 proto_tree_add_text(tree,
4458 tvb, curr_offset, 2,
4463 g_snprintf(add_string, string_len, " - (%s)", str);
4467 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
4469 return(curr_offset - offset);
4476 elem_ms_info_recs(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
4483 guint32 curr_offset;
4485 gint ett_elem_idx, idx, i;
4486 proto_tree *subtree;
4489 curr_offset = offset;
4493 while ((len - (curr_offset - offset)) >= 2)
4497 rec_type = tvb_get_guint8(tvb, curr_offset);
4499 str = match_strval_idx((guint32) rec_type, ansi_ms_info_rec_str, &idx);
4504 ett_elem_idx = ett_ansi_ms_info_rec_reserved;
4508 ett_elem_idx = ett_ansi_ms_info_rec[idx];
4512 proto_tree_add_text(tree,
4513 tvb, curr_offset, 1,
4514 "Information Record Type - %u: (%u) %s",
4519 subtree = proto_item_add_subtree(item, ett_elem_idx);
4523 oct_len = tvb_get_guint8(tvb, curr_offset);
4525 proto_tree_add_uint(subtree, hf_ansi_a_length, tvb,
4526 curr_offset, 1, oct_len);
4532 SHORT_DATA_CHECK(len - (curr_offset - offset), oct_len);
4536 case ANSI_MS_INFO_REC_CLD_PN:
4537 oct = tvb_get_guint8(tvb, curr_offset);
4539 switch ((oct & 0xe0) >> 5)
4541 case 0: str = "Unknown"; break;
4542 case 1: str = "International number"; break;
4543 case 2: str = "National number"; break;
4544 case 3: str = "Network-specific number"; break;
4545 case 4: str = "Subscriber number"; break;
4546 case 5: str = "Reserved"; break;
4547 case 6: str = "Abbreviated number"; break;
4549 str = "Reserved for extension";
4553 other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
4554 proto_tree_add_text(subtree, tvb, curr_offset, 1,
4555 "%s : Number Type: %s",
4559 switch ((oct & 0x1e) >> 1)
4561 case 0x00: str = "Unknown"; break;
4562 case 0x01: str = "ISDN/Telephony Numbering"; break;
4563 case 0x03: str = "Data Numbering (ITU-T Rec. X.121)"; break;
4564 case 0x04: str = "Telex Numbering (ITU-T Rec. F.69)"; break;
4565 case 0x09: str = "Private Numbering"; break;
4566 case 0x0f: str = "Reserved for extension"; break;
4572 other_decode_bitfield_value(a_bigbuf, oct, 0x1e, 8);
4573 proto_tree_add_text(subtree, tvb, curr_offset, 1,
4574 "%s : Number Plan: %s",
4580 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
4581 proto_tree_add_text(subtree, tvb, curr_offset, 1,
4582 "%s : MSB of first digit",
4587 for (i=0; i < (oct_len - 1); i++)
4589 a_bigbuf[i] = (oct & 0x01) << 7;
4591 oct = tvb_get_guint8(tvb, curr_offset + i);
4593 a_bigbuf[i] |= (oct & 0xfe) >> 1;
4597 proto_tree_add_text(subtree, tvb, curr_offset, oct_len - 1,
4601 curr_offset += (oct_len - 2);
4604 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
4605 proto_tree_add_text(subtree, tvb, curr_offset, 1,
4612 case ANSI_MS_INFO_REC_CLG_PN:
4613 value = tvb_get_ntohs(tvb, curr_offset);
4615 oct = (value & 0xff00) >> 8;
4617 switch ((oct & 0xe0) >> 5)
4619 case 0: str = "Unknown"; break;
4620 case 1: str = "International number"; break;
4621 case 2: str = "National number"; break;
4622 case 3: str = "Network-specific number"; break;
4623 case 4: str = "Subscriber number"; break;
4624 case 5: str = "Reserved"; break;
4625 case 6: str = "Abbreviated number"; break;
4627 str = "Reserved for extension";
4631 other_decode_bitfield_value(a_bigbuf, value, 0xe000, 16);
4632 proto_tree_add_text(subtree, tvb, curr_offset, 2,
4633 "%s : Number Type: %s",
4637 switch ((oct & 0x1e) >> 1)
4639 case 0x00: str = "Unknown"; break;
4640 case 0x01: str = "ISDN/Telephony Numbering"; break;
4641 case 0x03: str = "Data Numbering (ITU-T Rec. X.121)"; break;
4642 case 0x04: str = "Telex Numbering (ITU-T Rec. F.69)"; break;
4643 case 0x09: str = "Private Numbering"; break;
4644 case 0x0f: str = "Reserved for extension"; break;
4650 other_decode_bitfield_value(a_bigbuf, value, 0x1e00, 16);
4651 proto_tree_add_text(subtree, tvb, curr_offset, 2,
4652 "%s : Number Plan: %s",
4656 switch ((value & 0x0180) >> 7)
4658 case 0: str = "Presentation allowed"; break;
4659 case 1: str = "Presentation restricted"; break;
4660 case 2: str = "Number not available"; break;
4666 other_decode_bitfield_value(a_bigbuf, value, 0x0180, 16);
4667 proto_tree_add_text(subtree, tvb, curr_offset, 2,
4668 "%s : Presentation Indicator (PI): %s",
4672 switch ((value & 0x0060) >> 5)
4674 case 0: str = "User-provided, not screened"; break;
4675 case 1: str = "User-provided, verified and passed"; break;
4676 case 2: str = "User-provided, verified and failed"; break;
4678 str = "Network-provided";
4682 other_decode_bitfield_value(a_bigbuf, value, 0x0060, 16);
4683 proto_tree_add_text(subtree, tvb, curr_offset, 2,
4684 "%s : Screening Indicator (SI): %s",
4690 oct = (value & 0x00ff);
4692 other_decode_bitfield_value(a_bigbuf, value, 0x001f, 16);
4693 proto_tree_add_text(subtree, tvb, curr_offset, 2,
4694 "%s : MSB of first digit",
4699 for (i=0; i < (oct_len - 2); i++)
4701 a_bigbuf[i] = (oct & 0x1f) << 3;
4703 oct = tvb_get_guint8(tvb, curr_offset + i);
4705 a_bigbuf[i] |= (oct & 0xe0) >> 5;
4709 proto_tree_add_text(subtree, tvb, curr_offset, oct_len - 2,
4713 curr_offset += (oct_len - 3);
4715 other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
4716 proto_tree_add_text(subtree, tvb, curr_offset, 1,
4724 other_decode_bitfield_value(a_bigbuf, value, 0x001f, 16);
4725 proto_tree_add_text(subtree, tvb, curr_offset, 2,
4733 case ANSI_MS_INFO_REC_MW:
4734 oct = tvb_get_guint8(tvb, curr_offset);
4736 proto_tree_add_text(subtree, tvb, curr_offset, 1,
4737 "Number of messages waiting: %u",
4744 proto_tree_add_text(subtree,
4745 tvb, curr_offset, oct_len,
4748 curr_offset += oct_len;
4754 g_snprintf(add_string, string_len, " - %u record%s",
4755 num_recs, plurality(num_recs, "", "s"));
4757 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
4759 return(curr_offset - offset);
4766 elem_ext_ho_dir_params(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
4770 guint32 curr_offset;
4772 curr_offset = offset;
4774 oct = tvb_get_guint8(tvb, curr_offset);
4776 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
4777 proto_tree_add_text(tree, tvb, curr_offset, 1,
4778 "%s : Search Window A Size (Srch_Win_A): %u",
4782 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
4783 proto_tree_add_text(tree, tvb, curr_offset, 1,
4784 "%s : Search Window N Size (Srch_Win_N): %u",
4790 NO_MORE_DATA_CHECK(len);
4792 oct = tvb_get_guint8(tvb, curr_offset);
4794 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
4795 proto_tree_add_text(tree, tvb, curr_offset, 1,
4796 "%s : Search Window R Size (Srch_Win_R): %u",
4800 value = tvb_get_guint8(tvb, curr_offset + 1);
4802 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
4803 proto_tree_add_text(tree, tvb, curr_offset, 1,
4804 "%s : Add Pilot Threshold (T_Add) (MSB): %u",
4806 (oct & 0x0f) << 2 | (value & 0xc0) >> 6);
4812 other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
4813 proto_tree_add_text(tree, tvb, curr_offset, 1,
4814 "%s : Add Pilot Threshold (T_Add) (LSB)",
4817 other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
4818 proto_tree_add_text(tree, tvb, curr_offset, 1,
4819 "%s : Drop Pilot Threshold (T_Drop): %u",
4825 NO_MORE_DATA_CHECK(len);
4827 oct = tvb_get_guint8(tvb, curr_offset);
4829 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
4830 proto_tree_add_text(tree, tvb, curr_offset, 1,
4831 "%s : Compare Threshold (T_Comp): %u",
4835 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
4836 proto_tree_add_text(tree, tvb, curr_offset, 1,
4837 "%s : Drop Timer Value (T_TDrop): %u",
4843 NO_MORE_DATA_CHECK(len);
4845 oct = tvb_get_guint8(tvb, curr_offset);
4847 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
4848 proto_tree_add_text(tree, tvb, curr_offset, 1,
4849 "%s : Neighbor Max Age (Nghbor_Max_AGE): %u",
4853 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
4854 proto_tree_add_text(tree, tvb, curr_offset, 1,
4860 NO_MORE_DATA_CHECK(len);
4862 oct = tvb_get_guint8(tvb, curr_offset);
4864 other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
4865 proto_tree_add_text(tree, tvb, curr_offset, 1,
4869 other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
4870 proto_tree_add_text(tree, tvb, curr_offset, 1,
4871 "%s : SOFT_SLOPE: %u",
4877 NO_MORE_DATA_CHECK(len);
4879 oct = tvb_get_guint8(tvb, curr_offset);
4881 other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
4882 proto_tree_add_text(tree, tvb, curr_offset, 1,
4886 other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
4887 proto_tree_add_text(tree, tvb, curr_offset, 1,
4888 "%s : ADD_INTERCEPT: %u",
4894 NO_MORE_DATA_CHECK(len);
4896 oct = tvb_get_guint8(tvb, curr_offset);
4898 other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
4899 proto_tree_add_text(tree, tvb, curr_offset, 1,
4903 other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
4904 proto_tree_add_text(tree, tvb, curr_offset, 1,
4905 "%s : DROP_INTERCEPT: %u",
4911 NO_MORE_DATA_CHECK(len);
4913 oct = tvb_get_guint8(tvb, curr_offset);
4915 proto_tree_add_text(tree, tvb, curr_offset, 1,
4916 "Target BS P_REV: %u",
4921 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
4923 return(curr_offset - offset);
4928 * UNUSED in SPEC and no IEI!
4933 * UNUSED in SPEC and no IEI!
4943 * UNUSED in SPEC and no IEI!
4948 * UNUSED in SPEC and no IEI!
4955 elem_cdma_sowd(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
4959 guint32 curr_offset;
4960 const gchar *str = NULL;
4962 curr_offset = offset;
4964 curr_offset += elem_cell_id(tvb, tree, offset, len, add_string, string_len);
4965 add_string[0] = '\0';
4967 value = tvb_get_ntohs(tvb, curr_offset);
4969 proto_tree_add_text(tree,
4970 tvb, curr_offset, 2,
4971 "CDMA Serving One Way Delay: %u",
4976 oct = tvb_get_guint8(tvb, curr_offset);
4978 other_decode_bitfield_value(a_bigbuf, oct, 0xfc, 8);
4979 proto_tree_add_text(tree,
4980 tvb, curr_offset, 1,
4986 case 0: str = "100 nsec"; break;
4987 case 1: str = "50 nsec"; break;
4988 case 2: str = "1/16 CDMA PN Chip"; break;
4989 case 3: str = "Reserved"; break;
4992 other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
4993 proto_tree_add_text(tree,
4994 tvb, curr_offset, 1,
4995 "%s : Resolution: %s",
5001 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
5003 return(curr_offset - offset);
5020 elem_re_res(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
5023 guint32 curr_offset;
5027 curr_offset = offset;
5029 oct = tvb_get_guint8(tvb, curr_offset);
5031 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
5032 proto_tree_add_text(tree,
5033 tvb, curr_offset, 1,
5037 other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
5038 proto_tree_add_text(tree,
5039 tvb, curr_offset, 1,
5040 "%s : Include Priority: MSC %s include priority in Assignment Request",
5042 (oct & 0x40) ? "should" : "does not need to");
5044 switch ((oct & 0x30) >> 4)
5046 case 0: str = "Not reported"; break;
5047 case 1: str = "radio environment is acceptable"; break;
5048 case 2: str = "radio environment is marginally acceptable"; break;
5050 str = "radio environment is poor";
5054 other_decode_bitfield_value(a_bigbuf, oct, 0x30, 8);
5055 proto_tree_add_text(tree,
5056 tvb, curr_offset, 1,
5061 switch ((oct & 0x0c) >> 2)
5063 case 0: str = "Not reported"; break;
5064 case 1: str = "radio environment is acceptable"; break;
5065 case 2: str = "radio environment is marginally acceptable"; break;
5067 str = "radio environment is poor";
5071 other_decode_bitfield_value(a_bigbuf, oct, 0x0c, 8);
5072 proto_tree_add_text(tree,
5073 tvb, curr_offset, 1,
5078 other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
5079 proto_tree_add_text(tree,
5080 tvb, curr_offset, 1,
5081 "%s : Alloc: resources are %sallocated",
5083 (oct & 0x02) ? "" : "not ");
5085 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
5086 proto_tree_add_text(tree,
5087 tvb, curr_offset, 1,
5088 "%s : Avail: resources are %savailable",
5090 (oct & 0x01) ? "" : "not ");
5094 /* no length check possible */
5096 return(curr_offset - offset);
5101 * UNUSED in SPEC and no IEI!
5136 * UNUSED in SPEC and no IEI!
5213 elem_cld_party_ascii_num(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
5216 guint32 curr_offset;
5220 curr_offset = offset;
5222 oct = tvb_get_guint8(tvb, curr_offset);
5224 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
5225 proto_tree_add_text(tree, tvb, curr_offset, 1,
5229 switch ((oct & 0x70) >> 4)
5231 case 0: str = "Unknown"; break;
5232 case 1: str = "International number"; break;
5233 case 2: str = "National number"; break;
5234 case 3: str = "Network specific number"; break;
5235 case 4: str = "Dedicated PAD access, short code"; break;
5236 case 7: str = "Reserved for extension"; break;
5242 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
5243 proto_tree_add_text(tree,
5244 tvb, curr_offset, 1,
5245 "%s : Type of Number: %s",
5251 case 0x00: str = "Unknown"; break;
5252 case 0x01: str = "ISDN/telephony number plan (ITU recommendation E.164/E.163)"; break;
5253 case 0x03: str = "Data number plan (ITU recommendation X.121)"; break;
5254 case 0x04: str = "Telex numbering plan (ITU recommendation F.69)"; break;
5255 case 0x07: str = "Reserved for extension"; break;
5256 case 0x08: str = "National numbering plan"; break;
5257 case 0x09: str = "Private numbering plan"; break;
5263 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
5264 proto_tree_add_text(tree,
5265 tvb, curr_offset, 1,
5266 "%s : Numbering Plan Identification: %s",
5272 poctets = tvb_get_ephemeral_string(tvb, curr_offset, len - (curr_offset - offset));
5274 proto_tree_add_string_format(tree, hf_ansi_a_cld_party_ascii_num,
5275 tvb, curr_offset, len - (curr_offset - offset),
5278 format_text(poctets, len - (curr_offset - offset)));
5280 curr_offset += len - (curr_offset - offset);
5282 g_snprintf(add_string, string_len, " - (%s)", poctets);
5284 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
5286 return(curr_offset - offset);
5293 elem_band_class(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
5296 guint32 curr_offset;
5300 curr_offset = offset;
5302 oct = tvb_get_guint8(tvb, curr_offset);
5304 other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
5305 proto_tree_add_text(tree,
5306 tvb, curr_offset, 1,
5310 temp_int = oct & 0x1f;
5311 if ((temp_int < 0) || (temp_int >= (gint) NUM_BAND_CLASS_STR))
5317 str = band_class_str[temp_int];
5320 other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
5321 proto_tree_add_text(tree,
5322 tvb, curr_offset, 1,
5323 "%s : Band Class: %s",
5329 g_snprintf(add_string, string_len, " - (%s)", str);
5331 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
5333 return(curr_offset - offset);
5355 elem_is2000_cause(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
5357 guint32 curr_offset;
5359 add_string = add_string;
5360 curr_offset = offset;
5362 proto_tree_add_text(tree, tvb, curr_offset, len, "IS-95/IS-2000 Cause Information");
5366 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
5368 return(curr_offset - offset);
5390 elem_auth_event(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
5393 guint32 curr_offset;
5396 curr_offset = offset;
5400 oct = tvb_get_guint8(tvb, curr_offset);
5404 case 0x01: str = "Event: Authentication parameters were NOT received from mobile"; break;
5405 case 0x02: str = "Event: RANDC mis-match"; break;
5411 proto_tree_add_text(tree, tvb, curr_offset, len,
5416 proto_tree_add_text(tree, tvb, curr_offset, len, "Event");
5421 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
5423 return(curr_offset - offset);
5538 * Generic decode is good enough
5595 elem_cct_group(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
5599 guint32 curr_offset;
5601 curr_offset = offset;
5603 oct = tvb_get_guint8(tvb, curr_offset);
5605 other_decode_bitfield_value(a_bigbuf, oct, 0xfc, 8);
5606 proto_tree_add_text(tree,
5607 tvb, curr_offset, 1,
5611 other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
5612 proto_tree_add_text(tree,
5613 tvb, curr_offset, 1,
5614 "%s : All Circuits",
5617 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
5618 proto_tree_add_text(tree,
5619 tvb, curr_offset, 1,
5625 NO_MORE_DATA_CHECK(len);
5627 oct = tvb_get_guint8(tvb, curr_offset);
5629 proto_tree_add_text(tree,
5630 tvb, curr_offset, 1,
5631 "Count: %u circuit%s",
5632 oct, plurality(oct, "", "s"));
5634 g_snprintf(add_string, string_len, " - %u circuit%s",
5635 oct, plurality(oct, "", "s"));
5639 value = tvb_get_ntohs(tvb, curr_offset);
5641 other_decode_bitfield_value(a_bigbuf, value, 0xffe0, 16);
5642 proto_tree_add_text(tree,
5643 tvb, curr_offset, 2,
5644 "%s : PCM Multiplexer: %u",
5646 (value & 0xffe0) >> 5);
5648 other_decode_bitfield_value(a_bigbuf, value, 0x001f, 16);
5649 proto_tree_add_text(tree,
5650 tvb, curr_offset, 2,
5651 "%s : Timeslot: %u",
5657 NO_MORE_DATA_CHECK(len);
5659 proto_tree_add_text(tree,
5660 tvb, curr_offset, len - (curr_offset - offset),
5663 curr_offset += len - (curr_offset - offset);
5665 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
5667 return(curr_offset - offset);
5674 elem_paca_ts(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
5676 guint32 curr_offset;
5678 curr_offset = offset;
5680 proto_tree_add_text(tree, tvb, curr_offset, len, "PACA Queuing Time");
5684 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
5686 return(curr_offset - offset);
5693 elem_paca_order(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
5696 guint32 curr_offset;
5699 curr_offset = offset;
5701 oct = tvb_get_guint8(tvb, curr_offset);
5703 other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
5704 proto_tree_add_text(tree,
5705 tvb, curr_offset, 1,
5711 case 0: str = "Reserved"; break;
5712 case 1: str = "Update Queue Position and notify MS"; break;
5713 case 2: str = "Remove MS from the queue and release MS"; break;
5714 case 3: str = "Remove MS from the queue"; break;
5715 case 4: str = "MS Requested PACA Cancel"; break;
5716 case 5: str = "BS Requested PACA Cancel"; break;
5718 str = "All other values Reserved";
5722 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
5723 proto_tree_add_text(tree,
5724 tvb, curr_offset, 1,
5725 "%s : PACA Action Required: %s",
5731 g_snprintf(add_string, string_len, " - (%s)", str);
5733 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
5735 return(curr_offset - offset);
5742 elem_paca_reoi(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
5745 guint32 curr_offset;
5747 curr_offset = offset;
5749 oct = tvb_get_guint8(tvb, curr_offset);
5751 other_decode_bitfield_value(a_bigbuf, oct, 0xfe, 8);
5752 proto_tree_add_text(tree,
5753 tvb, curr_offset, 1,
5757 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
5758 proto_tree_add_text(tree,
5759 tvb, curr_offset, 1,
5760 "%s : PACA Reorigination Indicator (PRI)",
5765 g_snprintf(add_string, string_len, " - (%sReorigination)", (oct & 0x01) ? "" : "Not ");
5767 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
5769 return(curr_offset - offset);
5784 ANSI_A_E_ACC_NET_ID, /* Access Network Identifiers */
5785 ANSI_A_E_ADDS_USER_PART, /* ADDS User Part */
5786 ANSI_A_E_AMPS_HHO_PARAM, /* AMPS Hard Handoff Parameters */
5787 ANSI_A_E_ANCH_PDSN_ADDR, /* Anchor PDSN Address */
5788 ANSI_A_E_ANCH_PP_ADDR, /* Anchor P-P Address */
5789 ANSI_A_E_AUTH_CHLG_PARAM, /* Authentication Challenge Parameter */
5790 ANSI_A_E_AUTH_CNF_PARAM, /* Authentication Confirmation Parameter (RANDC) */
5791 ANSI_A_E_AUTH_DATA, /* Authentication Data */
5792 ANSI_A_E_AUTH_EVENT, /* Authentication Event */
5793 ANSI_A_E_AUTH_PARAM_COUNT, /* Authentication Parameter COUNT */
5794 ANSI_A_E_AUTH_RESP_PARAM, /* Authentication Response Parameter */
5795 ANSI_A_E_BAND_CLASS, /* Band Class */
5796 ANSI_A_E_CLD_PARTY_ASCII_NUM, /* Called Party ASCII Number */
5797 ANSI_A_E_CLD_PARTY_BCD_NUM, /* Called Party BCD Number */
5798 ANSI_A_E_CLG_PARTY_ASCII_NUM, /* Calling Party ASCII Number */
5799 ANSI_A_E_CAUSE, /* Cause */
5800 ANSI_A_E_CAUSE_L3, /* Cause Layer 3 */
5801 ANSI_A_E_CDMA_SOWD, /* CDMA Serving One Way Delay */
5802 ANSI_A_E_CELL_ID, /* Cell Identifier */
5803 ANSI_A_E_CELL_ID_LIST, /* Cell Identifier List */
5804 ANSI_A_E_CHAN_NUM, /* Channel Number */
5805 ANSI_A_E_CHAN_TYPE, /* Channel Type */
5806 ANSI_A_E_CCT_GROUP, /* Circuit Group */
5807 ANSI_A_E_CIC, /* Circuit Identity Code */
5808 ANSI_A_E_CIC_EXT, /* Circuit Identity Code Extension */
5809 ANSI_A_E_CM_INFO_TYPE_2, /* Classmark Information Type 2 */
5810 ANSI_A_E_DOWNLINK_RE, /* Downlink Radio Environment */
5811 ANSI_A_E_DOWNLINK_RE_LIST, /* Downlink Radio Environment List */
5812 ANSI_A_E_ENC_INFO, /* Encryption Information */
5813 ANSI_A_E_EXT_HO_DIR_PARAMS, /* Extended Handoff Direction Parameters */
5814 ANSI_A_E_GEO_LOC, /* Geographic Location */
5815 ANSI_A_E_SSCI, /* Special Service Call Indicator */
5816 ANSI_A_E_HO_POW_LEV, /* Handoff Power Level */
5817 ANSI_A_E_HHO_PARAMS, /* Hard Handoff Parameters */
5818 ANSI_A_E_IE_REQD, /* Information Element Requested */
5819 ANSI_A_E_IS2000_CHAN_ID, /* IS-2000 Channel Identity */
5820 ANSI_A_E_IS2000_CHAN_ID_3X, /* IS-2000 Channel Identity 3X */
5821 ANSI_A_E_IS2000_MOB_CAP, /* IS-2000 Mobile Capabilities */
5822 ANSI_A_E_IS2000_NN_SCR, /* IS-2000 Non-Negotiable Service Configuration Record */
5823 ANSI_A_E_IS2000_SCR, /* IS-2000 Service Configuration Record */
5824 ANSI_A_E_IS2000_CAUSE, /* IS-95/IS-2000 Cause Value */
5825 ANSI_A_E_IS2000_RED_RECORD, /* IS-2000 Redirection Record */
5826 ANSI_A_E_IS95_CHAN_ID, /* IS-95 Channel Identity */
5827 ANSI_A_E_IS95_MS_MEAS_CHAN_ID, /* IS-95 MS Measured Channel Identity */
5828 ANSI_A_E_L3_INFO, /* Layer 3 Information */
5829 ANSI_A_E_LAI, /* Location Area Information */
5830 ANSI_A_E_MWI, /* Message Waiting Indication */
5831 ANSI_A_E_MID, /* Mobile Identity */
5832 ANSI_A_E_MS_INFO_RECS, /* MS Information Records */
5833 ANSI_A_E_ORIG_CI, /* Origination Continuation Indicator */
5834 ANSI_A_E_PACA_ORDER, /* PACA Order */
5835 ANSI_A_E_PACA_REOI, /* PACA Reorigination Indicator */
5836 ANSI_A_E_PACA_TS, /* PACA Timestamp */
5837 ANSI_A_E_PSP, /* Packet Session Parameters */
5838 ANSI_A_E_PDSN_IP_ADDR, /* PDSN IP Address */
5839 ANSI_A_E_PDI, /* Power Down Indicator */
5840 ANSI_A_E_PRIO, /* Priority */
5841 ANSI_A_E_PREV, /* Protocol Revision */
5842 ANSI_A_E_PTYPE, /* Protocol Type */
5843 ANSI_A_E_PSMM_COUNT, /* PSMM Count */
5844 ANSI_A_E_QOS_PARAMS, /* Quality of Service Parameters */
5845 ANSI_A_E_RE_RES, /* Radio Environment and Resources */
5846 ANSI_A_E_REG_TYPE, /* Registration Type */
5847 ANSI_A_E_REJ_CAUSE, /* Reject Cause */
5848 ANSI_A_E_RESP_REQ, /* Response Request */
5849 ANSI_A_E_RET_CAUSE, /* Return Cause */
5850 ANSI_A_E_RF_CHAN_ID, /* RF Channel Identity */
5851 ANSI_A_E_SO, /* Service Option */
5852 ANSI_A_E_SOCI, /* Service Option Connection Identifier (SOCI) */
5853 ANSI_A_E_SO_LIST, /* Service Option List */
5854 ANSI_A_E_S_RED_INFO, /* Service Redirection Info */
5855 ANSI_A_E_SR_ID, /* Session Reference Identifier (SR_ID) */
5856 ANSI_A_E_SID, /* SID */
5857 ANSI_A_E_SIGNAL, /* Signal */
5858 ANSI_A_E_SCI, /* Slot Cycle Index */
5859 ANSI_A_E_SW_VER, /* Software Version */
5860 ANSI_A_E_SRNC_TRNC_TC, /* Source RNC to Target RNC Transparent Container */
5861 ANSI_A_E_S_PDSN_ADDR, /* Source PDSN Address */
5862 ANSI_A_E_TAG, /* Tag */
5863 ANSI_A_E_TRNC_SRNC_TC, /* Target RNC to Source RNC Transparent Container */
5864 ANSI_A_E_XMODE, /* Transcoder Mode */
5865 ANSI_A_E_UZ_ID, /* User Zone ID */
5866 ANSI_A_E_VP_REQ, /* Voice Privacy Request */
5867 ANSI_A_E_NONE /* NONE */
5871 #define NUM_ELEM_1 (sizeof(ansi_a_ios401_elem_1_strings)/sizeof(value_string))
5872 static gint ett_ansi_elem_1[NUM_ELEM_1];
5873 static guint8 (*elem_1_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len) = {
5874 NULL, /* Access Network Identifiers */
5875 elem_adds_user_part, /* ADDS User Part */
5876 NULL, /* AMPS Hard Handoff Parameters */
5877 NULL, /* Anchor PDSN Address */
5878 NULL, /* Anchor P-P Address */
5879 elem_auth_chlg_param, /* Authentication Challenge Parameter */
5880 NULL /* no decode required */, /* Authentication Confirmation Parameter (RANDC) */
5881 NULL /* no decode required */, /* Authentication Data */
5882 elem_auth_event, /* Authentication Event */
5883 elem_auth_param_count, /* Authentication Parameter COUNT */
5884 elem_auth_resp_param, /* Authentication Response Parameter */
5885 elem_band_class, /* Band Class */
5886 elem_cld_party_ascii_num, /* Called Party ASCII Number */
5887 elem_cld_party_bcd_num, /* Called Party BCD Number */
5888 elem_clg_party_ascii_num, /* Calling Party ASCII Number */
5889 elem_cause, /* Cause */
5890 elem_cause_l3, /* Cause Layer 3 */
5891 elem_cdma_sowd, /* CDMA Serving One Way Delay */
5892 elem_cell_id, /* Cell Identifier */
5893 elem_cell_id_list, /* Cell Identifier List */
5894 elem_chan_num, /* Channel Number */
5895 elem_chan_type, /* Channel Type */
5896 elem_cct_group, /* Circuit Group */
5897 elem_cic, /* Circuit Identity Code */
5898 elem_cic_ext, /* Circuit Identity Code Extension */
5899 elem_cm_info_type_2, /* Classmark Information Type 2 */
5900 elem_downlink_re, /* Downlink Radio Environment */
5901 NULL, /* Downlink Radio Environment List */
5902 elem_enc_info, /* Encryption Information */
5903 elem_ext_ho_dir_params, /* Extended Handoff Direction Parameters */
5904 NULL, /* Geographic Location */
5905 NULL, /* Special Service Call Indicator */
5906 elem_ho_pow_lev, /* Handoff Power Level */
5907 elem_hho_params, /* Hard Handoff Parameters */
5908 NULL, /* Information Element Requested */
5909 elem_is2000_chan_id, /* IS-2000 Channel Identity */
5910 NULL, /* IS-2000 Channel Identity 3X */
5911 elem_is2000_mob_cap, /* IS-2000 Mobile Capabilities */
5912 elem_is2000_nn_scr, /* IS-2000 Non-Negotiable Service Configuration Record */
5913 elem_is2000_scr, /* IS-2000 Service Configuration Record */
5914 elem_is2000_cause, /* IS-95/IS-2000 Cause Value */
5915 NULL, /* IS-2000 Redirection Record */
5916 elem_is95_chan_id, /* IS-95 Channel Identity */
5917 elem_is95_ms_meas_chan_id, /* IS-95 MS Measured Channel Identity */
5918 elem_l3_info, /* Layer 3 Information */
5919 elem_lai, /* Location Area Information */
5920 elem_mwi, /* Message Waiting Indication */
5921 elem_mid, /* Mobile Identity */
5922 elem_ms_info_recs, /* MS Information Records */
5923 NULL, /* Origination Continuation Indicator */
5924 elem_paca_order, /* PACA Order */
5925 elem_paca_reoi, /* PACA Reorigination Indicator */
5926 elem_paca_ts, /* PACA Timestamp */
5927 NULL, /* Packet Session Parameters */
5928 elem_pdsn_ip_addr, /* PDSN IP Address */
5929 NULL /* no associated data */, /* Power Down Indicator */
5930 elem_prio, /* Priority */
5931 NULL, /* Protocol Revision */
5932 elem_ptype, /* Protocol Type */
5933 NULL, /* PSMM Count */
5934 elem_qos_params, /* Quality of Service Parameters */
5935 elem_re_res, /* Radio Environment and Resources */
5936 elem_reg_type, /* Registration Type */
5937 elem_rej_cause, /* Reject Cause */
5938 NULL /* no associated data */, /* Response Request */
5939 NULL, /* Return Cause */
5940 elem_rf_chan_id, /* RF Channel Identity */
5941 elem_so, /* Service Option */
5942 NULL, /* Service Option Connection Identifier (SOCI) */
5943 NULL, /* Service Option List */
5944 NULL, /* Service Redirection Info */
5945 NULL, /* Session Reference Identifier (SR_ID) */
5947 elem_signal, /* Signal */
5948 elem_sci, /* Slot Cycle Index */
5949 elem_sw_ver, /* Software Version */
5950 NULL, /* Source RNC to Target RNC Transparent Container */
5951 NULL, /* Source PDSN Address */
5953 NULL, /* Target RNC to Source RNC Transparent Container */
5954 elem_xmode, /* Transcoder Mode */
5955 elem_uz_id, /* User Zone ID */
5956 NULL /* no associated data */, /* Voice Privacy Request */
5960 /* MESSAGE FUNCTIONS */
5963 * Type Length Value (TLV) element dissector
5966 elem_tlv(tvbuff_t *tvb, proto_tree *tree, elem_idx_t idx, guint32 offset, guint len, const gchar *name_add)
5968 guint8 oct, parm_len;
5970 guint32 curr_offset;
5971 proto_tree *subtree;
5975 curr_offset = offset;
5978 oct = tvb_get_guint8(tvb, curr_offset);
5980 if (oct == (guint8) ansi_a_ios401_elem_1_strings[idx].value)
5982 parm_len = tvb_get_guint8(tvb, curr_offset + 1);
5985 proto_tree_add_text(tree,
5986 tvb, curr_offset, parm_len + 2,
5988 ansi_a_ios401_elem_1_strings[idx].strptr,
5989 (name_add == NULL) || (name_add[0] == '\0') ? "" : name_add);
5991 subtree = proto_item_add_subtree(item, ett_ansi_elem_1[idx]);
5993 proto_tree_add_uint(subtree, hf_ansi_a_elem_id, tvb,
5994 curr_offset, 1, oct);
5996 proto_tree_add_uint(subtree, hf_ansi_a_length, tvb,
5997 curr_offset + 1, 1, parm_len);
6001 if (elem_1_fcn[idx] == NULL)
6003 proto_tree_add_text(subtree,
6004 tvb, curr_offset + 2, parm_len,
6007 consumed = parm_len;
6011 gchar *a_add_string;
6013 a_add_string=ep_alloc(1024);
6014 a_add_string[0] = '\0';
6016 (*elem_1_fcn[idx])(tvb, subtree, curr_offset + 2,
6017 parm_len, a_add_string, 1024);
6019 if (a_add_string[0] != '\0')
6021 proto_item_append_text(item, "%s", a_add_string);
6033 * Type Value (TV) element dissector
6035 * Length cannot be used in these functions, big problem if a element dissector
6036 * is not defined for these.
6039 elem_tv(tvbuff_t *tvb, proto_tree *tree, elem_idx_t idx, guint32 offset, const gchar *name_add)
6043 guint32 curr_offset;
6044 proto_tree *subtree;
6047 curr_offset = offset;
6050 oct = tvb_get_guint8(tvb, curr_offset);
6052 if (oct == (guint8) ansi_a_ios401_elem_1_strings[idx].value)
6055 proto_tree_add_text(tree,
6056 tvb, curr_offset, -1,
6058 ansi_a_ios401_elem_1_strings[idx].strptr,
6059 (name_add == NULL) || (name_add[0] == '\0') ? "" : name_add);
6061 subtree = proto_item_add_subtree(item, ett_ansi_elem_1[idx]);
6063 proto_tree_add_uint(subtree, hf_ansi_a_elem_id, tvb, curr_offset, 1, oct);
6065 if (elem_1_fcn[idx] == NULL)
6067 /* BAD THING, CANNOT DETERMINE LENGTH */
6069 proto_tree_add_text(subtree,
6070 tvb, curr_offset + 1, 1,
6071 "No element dissector, rest of dissection may be incorrect");
6077 gchar *a_add_string;
6079 a_add_string=ep_alloc(1024);
6080 a_add_string[0] = '\0';
6081 consumed = (*elem_1_fcn[idx])(tvb, subtree, curr_offset + 1, -1, a_add_string, 1024);
6083 if (a_add_string[0] != '\0')
6085 proto_item_append_text(item, "%s", a_add_string);
6091 proto_item_set_len(item, consumed);
6098 * Type (T) element dissector
6100 * Length cannot be used in these functions, big problem if a element dissector
6101 * is not defined for these.
6104 elem_t(tvbuff_t *tvb, proto_tree *tree, elem_idx_t idx, guint32 offset, const gchar *name_add)
6107 guint32 curr_offset;
6110 curr_offset = offset;
6113 oct = tvb_get_guint8(tvb, curr_offset);
6115 if (oct == (guint8) ansi_a_ios401_elem_1_strings[idx].value)
6117 proto_tree_add_uint_format(tree, hf_ansi_a_elem_id, tvb, curr_offset, 1, oct,
6119 ansi_a_ios401_elem_1_strings[idx].strptr,
6120 (name_add == NULL) || (name_add[0] == '\0') ? "" : name_add);
6129 * Length Value (LV) element dissector
6132 elem_lv(tvbuff_t *tvb, proto_tree *tree, elem_idx_t idx, guint32 offset, guint len _U_, const gchar *name_add)
6136 guint32 curr_offset;
6137 proto_tree *subtree;
6140 curr_offset = offset;
6143 parm_len = tvb_get_guint8(tvb, curr_offset);
6146 proto_tree_add_text(tree,
6147 tvb, curr_offset, parm_len + 1,
6149 ansi_a_ios401_elem_1_strings[idx].strptr,
6150 (name_add == NULL) || (name_add[0] == '\0') ? "" : name_add);
6152 subtree = proto_item_add_subtree(item, ett_ansi_elem_1[idx]);
6154 proto_tree_add_uint(subtree, hf_ansi_a_length, tvb,
6155 curr_offset, 1, parm_len);
6159 if (elem_1_fcn[idx] == NULL)
6161 proto_tree_add_text(subtree,
6162 tvb, curr_offset + 1, parm_len,
6165 consumed = parm_len;
6169 gchar *a_add_string;
6171 a_add_string=ep_alloc(1024);
6172 a_add_string[0] = '\0';
6174 (*elem_1_fcn[idx])(tvb, subtree, curr_offset + 1,
6175 parm_len, a_add_string, 1024);
6177 if (a_add_string[0] != '\0')
6179 proto_item_append_text(item, "%s", a_add_string);
6184 return(consumed + 1);
6188 * Value (V) element dissector
6190 * Length cannot be used in these functions, big problem if a element dissector
6191 * is not defined for these.
6194 elem_v(tvbuff_t *tvb, proto_tree *tree, elem_idx_t idx, guint32 offset)
6197 guint32 curr_offset;
6199 curr_offset = offset;
6202 if (elem_1_fcn[idx] == NULL)
6204 /* BAD THING, CANNOT DETERMINE LENGTH */
6206 proto_tree_add_text(tree,
6207 tvb, curr_offset, 1,
6208 "No element dissector, rest of dissection may be incorrect");
6214 gchar *a_add_string;
6216 a_add_string=ep_alloc(1024);
6217 a_add_string[0] = '\0';
6218 consumed = (*elem_1_fcn[idx])(tvb, tree, curr_offset, -1, a_add_string, 1024);
6225 #define ELEM_MAND_TLV(elem_idx, elem_name_addition) \
6227 if ((consumed = elem_tlv(tvb, tree, elem_idx, curr_offset, curr_len, elem_name_addition)) > 0) \
6229 curr_offset += consumed; \
6230 curr_len -= consumed; \
6234 proto_tree_add_text(tree, \
6235 tvb, curr_offset, 0, \
6236 "Missing Mandatory element (0x%02x) %s%s, rest of dissection is suspect", \
6237 ansi_a_ios401_elem_1_strings[elem_idx].value, \
6238 ansi_a_ios401_elem_1_strings[elem_idx].strptr, \
6239 (elem_name_addition == NULL) || (elem_name_addition[0] == '\0') ? "" : elem_name_addition \
6242 if (curr_len <= 0) return; \
6245 #define ELEM_OPT_TLV(elem_idx, elem_name_addition) \
6247 if ((consumed = elem_tlv(tvb, tree, elem_idx, curr_offset, curr_len, elem_name_addition)) > 0) \
6249 curr_offset += consumed; \
6250 curr_len -= consumed; \
6252 if (curr_len <= 0) return; \
6255 #define ELEM_MAND_TV(elem_idx, elem_name_addition) \
6257 if ((consumed = elem_tv(tvb, tree, elem_idx, curr_offset, elem_name_addition)) > 0) \
6259 curr_offset += consumed; \
6260 curr_len -= consumed; \
6264 proto_tree_add_text(tree, \
6265 tvb, curr_offset, 0, \
6266 "Missing Mandatory element (0x%02x) %s%s, rest of dissection is suspect", \
6267 ansi_a_ios401_elem_1_strings[elem_idx].value, \
6268 ansi_a_ios401_elem_1_strings[elem_idx].strptr, \
6269 (elem_name_addition == NULL) || (elem_name_addition[0] == '\0') ? "" : elem_name_addition \
6272 if (curr_len <= 0) return; \
6275 #define ELEM_OPT_TV(elem_idx, elem_name_addition) \
6277 if ((consumed = elem_tv(tvb, tree, elem_idx, curr_offset, elem_name_addition)) > 0) \
6279 curr_offset += consumed; \
6280 curr_len -= consumed; \
6282 if (curr_len <= 0) return; \
6285 #define ELEM_OPT_T(elem_idx, elem_name_addition) \
6287 if ((consumed = elem_t(tvb, tree, elem_idx, curr_offset, elem_name_addition)) > 0) \
6289 curr_offset += consumed; \
6290 curr_len -= consumed; \
6292 if (curr_len <= 0) return; \
6295 #define ELEM_MAND_LV(elem_idx, elem_name_addition) \
6297 if ((consumed = elem_lv(tvb, tree, elem_idx, curr_offset, curr_len, elem_name_addition)) > 0) \
6299 curr_offset += consumed; \
6300 curr_len -= consumed; \
6304 /* Mandatory, but nothing we can do */ \
6306 if (curr_len <= 0) return; \
6309 #define ELEM_MAND_V(elem_idx) \
6311 if ((consumed = elem_v(tvb, tree, elem_idx, curr_offset)) > 0) \
6313 curr_offset += consumed; \
6314 curr_len -= consumed; \
6318 /* Mandatory, but nothing we can do */ \
6320 if (curr_len <= 0) return; \
6328 bsmap_cl3_info(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6331 guint32 curr_offset;
6334 curr_offset = offset;
6337 ELEM_MAND_TLV(ANSI_A_E_CELL_ID, "");
6339 ELEM_MAND_TLV(ANSI_A_E_L3_INFO, "");
6341 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6348 dtap_cm_srvc_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6350 guint32 curr_offset;
6354 proto_tree *subtree;
6358 curr_offset = offset;
6362 * special dissection for CM Service Type
6364 oct = tvb_get_guint8(tvb, curr_offset);
6368 case 0x01: str = "Mobile Originating Call"; break;
6375 proto_tree_add_text(tree,
6376 tvb, curr_offset, 1,
6377 "CM Service Type: %s",
6380 subtree = proto_item_add_subtree(item, ett_cm_srvc_type);
6382 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
6383 proto_tree_add_text(subtree,
6384 tvb, curr_offset, 1,
6388 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
6389 proto_tree_add_text(subtree,
6390 tvb, curr_offset, 1,
6391 "%s : Service Type: (%u) %s",
6399 ELEM_MAND_LV(ANSI_A_E_CM_INFO_TYPE_2, "");
6401 ELEM_MAND_LV(ANSI_A_E_MID, "");
6403 ELEM_OPT_TLV(ANSI_A_E_CLD_PARTY_BCD_NUM, "");
6405 ELEM_OPT_TLV(ANSI_A_E_MID, "");
6407 ELEM_OPT_TV(ANSI_A_E_SCI, "");
6409 ELEM_OPT_TLV(ANSI_A_E_AUTH_RESP_PARAM, "");
6411 ELEM_OPT_TV(ANSI_A_E_AUTH_CNF_PARAM, "");
6413 ELEM_OPT_TV(ANSI_A_E_AUTH_PARAM_COUNT, "");
6415 ELEM_OPT_TLV(ANSI_A_E_AUTH_CHLG_PARAM, "");
6417 ELEM_OPT_TV(ANSI_A_E_SO, "");
6419 ELEM_OPT_T(ANSI_A_E_VP_REQ, "");
6421 ELEM_OPT_TV(ANSI_A_E_RE_RES, "");
6423 ELEM_OPT_TLV(ANSI_A_E_CLD_PARTY_ASCII_NUM, "");
6425 ELEM_OPT_TV(ANSI_A_E_CIC, "");
6427 ELEM_OPT_TLV(ANSI_A_E_AUTH_EVENT, "");
6429 ELEM_OPT_TLV(ANSI_A_E_AUTH_DATA, "");
6431 ELEM_OPT_TLV(ANSI_A_E_PACA_REOI, "");
6433 ELEM_OPT_TLV(ANSI_A_E_UZ_ID, "");
6435 ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
6437 ELEM_OPT_TLV(ANSI_A_E_CDMA_SOWD, "");
6439 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6446 bsmap_page_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6448 guint32 curr_offset;
6452 curr_offset = offset;
6455 ELEM_MAND_TLV(ANSI_A_E_MID, "");
6457 ELEM_OPT_TV(ANSI_A_E_TAG, "");
6459 ELEM_OPT_TLV(ANSI_A_E_CELL_ID_LIST, "");
6461 ELEM_OPT_TV(ANSI_A_E_SCI, "");
6463 ELEM_OPT_TV(ANSI_A_E_SO, "");
6465 ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
6467 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6474 dtap_page_resp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6476 guint32 curr_offset;
6480 curr_offset = offset;
6483 ELEM_MAND_LV(ANSI_A_E_CM_INFO_TYPE_2, "");
6485 ELEM_MAND_LV(ANSI_A_E_MID, "");
6487 ELEM_OPT_TV(ANSI_A_E_TAG, "");
6489 ELEM_OPT_TLV(ANSI_A_E_MID, "");
6491 ELEM_OPT_TV(ANSI_A_E_SCI, "");
6493 ELEM_OPT_TLV(ANSI_A_E_AUTH_RESP_PARAM, "");
6495 ELEM_OPT_TV(ANSI_A_E_AUTH_CNF_PARAM, "");
6497 ELEM_OPT_TV(ANSI_A_E_AUTH_PARAM_COUNT, "");
6499 ELEM_OPT_TLV(ANSI_A_E_AUTH_CHLG_PARAM, "");
6501 ELEM_OPT_TV(ANSI_A_E_SO, "");
6503 ELEM_OPT_T(ANSI_A_E_VP_REQ, "");
6505 ELEM_OPT_TV(ANSI_A_E_CIC, "");
6507 ELEM_OPT_TLV(ANSI_A_E_AUTH_EVENT, "");
6509 ELEM_OPT_TV(ANSI_A_E_RE_RES, "");
6511 ELEM_OPT_TLV(ANSI_A_E_UZ_ID, "");
6513 ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
6515 ELEM_OPT_TLV(ANSI_A_E_CDMA_SOWD, "");
6517 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6524 dtap_progress(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6526 guint32 curr_offset;
6530 curr_offset = offset;
6533 ELEM_OPT_TV(ANSI_A_E_SIGNAL, "");
6535 ELEM_OPT_TLV(ANSI_A_E_MS_INFO_RECS, "");
6537 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6544 bsmap_ass_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6547 guint32 curr_offset;
6550 curr_offset = offset;
6553 ELEM_MAND_TLV(ANSI_A_E_CHAN_TYPE, "");
6555 ELEM_OPT_TV(ANSI_A_E_CIC, "");
6557 ELEM_OPT_TLV(ANSI_A_E_ENC_INFO, "");
6559 ELEM_OPT_TV(ANSI_A_E_SO, "");
6561 ELEM_OPT_TV(ANSI_A_E_SIGNAL, "");
6563 ELEM_OPT_TLV(ANSI_A_E_CLG_PARTY_ASCII_NUM, "");
6565 ELEM_OPT_TLV(ANSI_A_E_MS_INFO_RECS, "");
6567 ELEM_OPT_TLV(ANSI_A_E_PRIO, "");
6569 ELEM_OPT_TLV(ANSI_A_E_PACA_TS, "");
6571 ELEM_OPT_TLV(ANSI_A_E_QOS_PARAMS, "");
6573 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6580 bsmap_ass_complete(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6583 guint32 curr_offset;
6586 curr_offset = offset;
6589 ELEM_MAND_TV(ANSI_A_E_CHAN_NUM, "");
6591 ELEM_OPT_TLV(ANSI_A_E_ENC_INFO, "");
6593 ELEM_OPT_TV(ANSI_A_E_SO, "");
6595 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6602 bsmap_ass_failure(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6605 guint32 curr_offset;
6608 curr_offset = offset;
6611 ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
6613 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6620 bsmap_clr_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6623 guint32 curr_offset;
6626 curr_offset = offset;
6629 ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
6631 ELEM_OPT_TLV(ANSI_A_E_CAUSE_L3, "");
6633 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6640 bsmap_clr_command(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6643 guint32 curr_offset;
6646 curr_offset = offset;
6649 ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
6651 ELEM_OPT_TLV(ANSI_A_E_CAUSE_L3, "");
6653 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6660 bsmap_clr_complete(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6663 guint32 curr_offset;
6666 curr_offset = offset;
6669 ELEM_OPT_T(ANSI_A_E_PDI, "");
6671 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6678 dtap_alert_with_info(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6680 guint32 curr_offset;
6684 curr_offset = offset;
6687 ELEM_OPT_TLV(ANSI_A_E_MS_INFO_RECS, "");
6689 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6696 bsmap_bs_srvc_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6698 guint32 curr_offset;
6702 curr_offset = offset;
6705 ELEM_MAND_TLV(ANSI_A_E_MID, "");
6707 ELEM_OPT_TLV(ANSI_A_E_MID, "");
6709 ELEM_OPT_TV(ANSI_A_E_SO, "");
6711 ELEM_OPT_TV(ANSI_A_E_TAG, "");
6713 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6720 bsmap_bs_srvc_resp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6722 guint32 curr_offset;
6726 curr_offset = offset;
6729 ELEM_MAND_TLV(ANSI_A_E_MID, "");
6731 ELEM_OPT_TLV(ANSI_A_E_MID, "");
6733 ELEM_OPT_TV(ANSI_A_E_TAG, "");
6735 ELEM_OPT_TLV(ANSI_A_E_CAUSE, "");
6737 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6744 dtap_flash_with_info(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6746 guint32 curr_offset;
6750 curr_offset = offset;
6753 ELEM_OPT_TLV(ANSI_A_E_CLD_PARTY_BCD_NUM, "");
6755 ELEM_OPT_TV(ANSI_A_E_SIGNAL, "");
6757 ELEM_OPT_TV(ANSI_A_E_MWI, "");
6759 ELEM_OPT_TLV(ANSI_A_E_CLG_PARTY_ASCII_NUM, "");
6761 ELEM_OPT_TV(ANSI_A_E_TAG, "");
6763 ELEM_OPT_TLV(ANSI_A_E_MS_INFO_RECS, "");
6765 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6772 dtap_flash_with_info_ack(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6774 guint32 curr_offset;
6778 curr_offset = offset;
6781 ELEM_OPT_TV(ANSI_A_E_TAG, "");
6783 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6790 bsmap_feat_noti(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6792 guint32 curr_offset;
6796 curr_offset = offset;
6799 ELEM_MAND_TLV(ANSI_A_E_MID, "");
6801 ELEM_OPT_TV(ANSI_A_E_TAG, "");
6803 ELEM_OPT_TLV(ANSI_A_E_CELL_ID_LIST, "");
6805 ELEM_OPT_TV(ANSI_A_E_SCI, "");
6807 ELEM_OPT_TV(ANSI_A_E_SIGNAL, "");
6809 ELEM_OPT_TV(ANSI_A_E_MWI, "");
6811 ELEM_OPT_TLV(ANSI_A_E_CLG_PARTY_ASCII_NUM, "");
6813 ELEM_OPT_TLV(ANSI_A_E_MS_INFO_RECS, "");
6815 ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
6817 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6824 bsmap_feat_noti_ack(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6826 guint32 curr_offset;
6830 curr_offset = offset;
6833 ELEM_MAND_TLV(ANSI_A_E_MID, "");
6835 ELEM_OPT_TV(ANSI_A_E_TAG, "");
6837 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6844 bsmap_paca_command(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6846 guint32 curr_offset;
6850 curr_offset = offset;
6853 ELEM_OPT_TLV(ANSI_A_E_PRIO, "");
6855 ELEM_OPT_TLV(ANSI_A_E_PACA_TS, "");
6857 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6864 bsmap_paca_command_ack(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6866 guint32 curr_offset;
6870 curr_offset = offset;
6873 ELEM_OPT_TLV(ANSI_A_E_CAUSE, "");
6875 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6882 bsmap_paca_update(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6884 guint32 curr_offset;
6888 curr_offset = offset;
6891 ELEM_OPT_TLV(ANSI_A_E_MID, "");
6893 ELEM_OPT_TLV(ANSI_A_E_MID, "");
6895 ELEM_OPT_TLV(ANSI_A_E_PACA_ORDER, "");
6897 ELEM_OPT_TLV(ANSI_A_E_PRIO, "");
6899 ELEM_OPT_TLV(ANSI_A_E_AUTH_RESP_PARAM, "");
6901 ELEM_OPT_TV(ANSI_A_E_AUTH_CNF_PARAM, "");
6903 ELEM_OPT_TV(ANSI_A_E_AUTH_PARAM_COUNT, "");
6905 ELEM_OPT_TLV(ANSI_A_E_AUTH_CHLG_PARAM, "");
6907 ELEM_OPT_TLV(ANSI_A_E_AUTH_EVENT, "");
6909 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6916 bsmap_paca_update_ack(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6918 guint32 curr_offset;
6922 curr_offset = offset;
6925 ELEM_OPT_TLV(ANSI_A_E_MID, "");
6927 ELEM_OPT_TLV(ANSI_A_E_PRIO, "");
6929 ELEM_OPT_TLV(ANSI_A_E_CAUSE, "");
6931 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6938 bsmap_auth_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6940 guint32 curr_offset;
6944 curr_offset = offset;
6947 ELEM_MAND_TLV(ANSI_A_E_AUTH_CHLG_PARAM, "");
6949 ELEM_OPT_TLV(ANSI_A_E_MID, "");
6951 ELEM_OPT_TV(ANSI_A_E_TAG, "");
6953 ELEM_OPT_TLV(ANSI_A_E_CELL_ID_LIST, "");
6955 ELEM_OPT_TV(ANSI_A_E_SCI, "");
6957 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6961 dtap_auth_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6963 guint32 curr_offset;
6967 curr_offset = offset;
6970 ELEM_MAND_LV(ANSI_A_E_AUTH_CHLG_PARAM, "");
6972 ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
6974 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6981 bsmap_auth_resp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6983 guint32 curr_offset;
6987 curr_offset = offset;
6990 ELEM_MAND_TLV(ANSI_A_E_AUTH_RESP_PARAM, "");
6992 ELEM_OPT_TLV(ANSI_A_E_MID, "");
6994 ELEM_OPT_TV(ANSI_A_E_TAG, "");
6996 ELEM_OPT_TLV(ANSI_A_E_MID, "");
6998 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7002 dtap_auth_resp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7004 guint32 curr_offset;
7008 curr_offset = offset;
7011 ELEM_MAND_LV(ANSI_A_E_AUTH_RESP_PARAM, "");
7013 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7020 bsmap_user_zone_update(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7022 guint32 curr_offset;
7026 curr_offset = offset;
7029 ELEM_OPT_TLV(ANSI_A_E_UZ_ID, "");
7031 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7038 dtap_ssd_update_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7040 guint32 curr_offset;
7044 curr_offset = offset;
7047 ELEM_MAND_LV(ANSI_A_E_AUTH_CHLG_PARAM, "");
7049 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7056 dtap_bs_challenge(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7058 guint32 curr_offset;
7062 curr_offset = offset;
7065 ELEM_MAND_LV(ANSI_A_E_AUTH_CHLG_PARAM, "");
7067 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7074 dtap_bs_challenge_resp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7076 guint32 curr_offset;
7080 curr_offset = offset;
7083 ELEM_MAND_LV(ANSI_A_E_AUTH_RESP_PARAM, "");
7085 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7092 dtap_ssd_update_resp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7094 guint32 curr_offset;
7098 curr_offset = offset;
7101 ELEM_OPT_TLV(ANSI_A_E_CAUSE_L3, "");
7103 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7110 dtap_lu_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7112 guint32 curr_offset;
7116 curr_offset = offset;
7119 ELEM_MAND_LV(ANSI_A_E_MID, "");
7121 ELEM_OPT_TV(ANSI_A_E_LAI, "");
7123 ELEM_OPT_TLV(ANSI_A_E_CM_INFO_TYPE_2, "");
7125 ELEM_OPT_TV(ANSI_A_E_REG_TYPE, "");
7127 ELEM_OPT_TLV(ANSI_A_E_MID, "");
7129 ELEM_OPT_TV(ANSI_A_E_SCI, "");
7131 ELEM_OPT_TLV(ANSI_A_E_AUTH_RESP_PARAM, "");
7133 ELEM_OPT_TV(ANSI_A_E_AUTH_CNF_PARAM, "");
7135 ELEM_OPT_TV(ANSI_A_E_AUTH_PARAM_COUNT, "");
7137 ELEM_OPT_TLV(ANSI_A_E_AUTH_CHLG_PARAM, "");
7139 ELEM_OPT_TLV(ANSI_A_E_AUTH_EVENT, "");
7141 ELEM_OPT_TLV(ANSI_A_E_UZ_ID, "");
7143 ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
7145 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7152 dtap_lu_accept(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7154 guint32 curr_offset;
7158 curr_offset = offset;
7161 ELEM_OPT_TV(ANSI_A_E_LAI, "");
7163 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7170 dtap_lu_reject(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7172 guint32 curr_offset;
7176 curr_offset = offset;
7179 ELEM_MAND_V(ANSI_A_E_REJ_CAUSE);
7181 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7188 bsmap_priv_mode_command(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7190 guint32 curr_offset;
7194 curr_offset = offset;
7197 ELEM_MAND_TLV(ANSI_A_E_ENC_INFO, "");
7199 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7206 bsmap_priv_mode_complete(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7208 guint32 curr_offset;
7212 curr_offset = offset;
7215 ELEM_OPT_TLV(ANSI_A_E_ENC_INFO, "");
7217 ELEM_OPT_T(ANSI_A_E_VP_REQ, "");
7219 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7226 bsmap_ho_reqd(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7228 guint32 curr_offset;
7232 curr_offset = offset;
7235 ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
7237 ELEM_MAND_TLV(ANSI_A_E_CELL_ID_LIST, " (Target)");
7239 ELEM_OPT_TLV(ANSI_A_E_CM_INFO_TYPE_2, "");
7241 ELEM_OPT_T(ANSI_A_E_RESP_REQ, "");
7243 ELEM_OPT_TLV(ANSI_A_E_ENC_INFO, "");
7245 ELEM_OPT_TLV(ANSI_A_E_IS95_CHAN_ID, "");
7247 ELEM_OPT_TLV(ANSI_A_E_MID, "");
7249 ELEM_OPT_TLV(ANSI_A_E_DOWNLINK_RE, "");
7251 ELEM_OPT_TV(ANSI_A_E_SO, "");
7253 ELEM_OPT_TLV(ANSI_A_E_CDMA_SOWD, "");
7255 ELEM_OPT_TLV(ANSI_A_E_IS95_MS_MEAS_CHAN_ID, "");
7257 ELEM_OPT_TLV(ANSI_A_E_IS2000_CHAN_ID, "");
7259 ELEM_OPT_TLV(ANSI_A_E_QOS_PARAMS, "");
7261 ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
7263 ELEM_OPT_TLV(ANSI_A_E_IS2000_SCR, "");
7265 ELEM_OPT_TLV(ANSI_A_E_PDSN_IP_ADDR, "");
7267 ELEM_OPT_TLV(ANSI_A_E_PTYPE, "");
7269 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7276 bsmap_ho_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7278 guint32 curr_offset;
7282 curr_offset = offset;
7285 ELEM_MAND_TLV(ANSI_A_E_CHAN_TYPE, "");
7287 ELEM_MAND_TLV(ANSI_A_E_ENC_INFO, "");
7289 ELEM_MAND_TLV(ANSI_A_E_CM_INFO_TYPE_2, "");
7291 ELEM_MAND_TLV(ANSI_A_E_CELL_ID_LIST, "(Target)");
7293 ELEM_OPT_TLV(ANSI_A_E_CIC_EXT, "");
7295 ELEM_OPT_TLV(ANSI_A_E_IS95_CHAN_ID, "");
7297 ELEM_OPT_TLV(ANSI_A_E_MID, "");
7299 ELEM_OPT_TLV(ANSI_A_E_MID, "");
7301 ELEM_OPT_TLV(ANSI_A_E_DOWNLINK_RE, "");
7303 ELEM_OPT_TV(ANSI_A_E_SO, "");
7305 ELEM_OPT_TLV(ANSI_A_E_CDMA_SOWD, "");
7307 ELEM_OPT_TLV(ANSI_A_E_IS95_MS_MEAS_CHAN_ID, "");
7309 ELEM_OPT_TLV(ANSI_A_E_IS2000_CHAN_ID, "");
7311 ELEM_OPT_TLV(ANSI_A_E_QOS_PARAMS, "");
7313 ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
7315 ELEM_OPT_TLV(ANSI_A_E_IS2000_SCR, "");
7317 ELEM_OPT_TLV(ANSI_A_E_PDSN_IP_ADDR, "");
7319 ELEM_OPT_TLV(ANSI_A_E_PTYPE, "");
7321 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7328 bsmap_ho_req_ack(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7330 guint32 curr_offset;
7334 curr_offset = offset;
7337 ELEM_OPT_TLV(ANSI_A_E_IS95_CHAN_ID, "");
7339 ELEM_OPT_TLV(ANSI_A_E_CELL_ID_LIST, "");
7341 ELEM_OPT_TLV(ANSI_A_E_EXT_HO_DIR_PARAMS, "");
7343 ELEM_OPT_TV(ANSI_A_E_HHO_PARAMS, "");
7345 ELEM_OPT_TLV(ANSI_A_E_IS2000_CHAN_ID, "");
7347 ELEM_OPT_TLV(ANSI_A_E_IS2000_SCR, "");
7349 ELEM_OPT_TLV(ANSI_A_E_IS2000_NN_SCR, "");
7351 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7358 bsmap_ho_failure(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7360 guint32 curr_offset;
7364 curr_offset = offset;
7367 ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
7369 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7376 bsmap_ho_command(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7378 guint32 curr_offset;
7382 curr_offset = offset;
7385 ELEM_OPT_TV(ANSI_A_E_RF_CHAN_ID, "");
7387 ELEM_OPT_TLV(ANSI_A_E_IS95_CHAN_ID, "");
7389 ELEM_OPT_TLV(ANSI_A_E_CELL_ID_LIST, "");
7391 ELEM_OPT_TLV(ANSI_A_E_HO_POW_LEV, "");
7393 ELEM_OPT_TV(ANSI_A_E_SID, "");
7395 ELEM_OPT_TLV(ANSI_A_E_EXT_HO_DIR_PARAMS, "");
7397 ELEM_OPT_TV(ANSI_A_E_HHO_PARAMS, "");
7399 ELEM_OPT_TLV(ANSI_A_E_IS2000_CHAN_ID, "");
7401 ELEM_OPT_TLV(ANSI_A_E_IS2000_SCR, "");
7403 ELEM_OPT_TLV(ANSI_A_E_IS2000_NN_SCR, "");
7405 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7412 bsmap_ho_reqd_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7414 guint32 curr_offset;
7418 curr_offset = offset;
7421 ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
7423 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7430 bsmap_ho_performed(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7432 guint32 curr_offset;
7436 curr_offset = offset;
7439 ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
7441 ELEM_OPT_TLV(ANSI_A_E_CELL_ID_LIST, "");
7443 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7450 bsmap_block(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7452 guint32 curr_offset;
7456 curr_offset = offset;
7459 ELEM_MAND_TV(ANSI_A_E_CIC, "");
7461 ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
7463 ELEM_OPT_TLV(ANSI_A_E_CCT_GROUP, "");
7465 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7472 bsmap_block_ack(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7474 guint32 curr_offset;
7478 curr_offset = offset;
7481 ELEM_MAND_TV(ANSI_A_E_CIC, "");
7483 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7490 bsmap_unblock(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7492 guint32 curr_offset;
7496 curr_offset = offset;
7499 ELEM_MAND_TV(ANSI_A_E_CIC, "");
7501 ELEM_OPT_TLV(ANSI_A_E_CCT_GROUP, "");
7503 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7510 bsmap_unblock_ack(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7512 guint32 curr_offset;
7516 curr_offset = offset;
7519 ELEM_MAND_TV(ANSI_A_E_CIC, "");
7521 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7528 bsmap_reset(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7530 guint32 curr_offset;
7534 curr_offset = offset;
7537 ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
7539 ELEM_OPT_TLV(ANSI_A_E_SW_VER, "");
7541 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7548 bsmap_reset_ack(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7550 guint32 curr_offset;
7554 curr_offset = offset;
7557 ELEM_OPT_TLV(ANSI_A_E_SW_VER, "");
7559 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7566 bsmap_reset_cct(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7568 guint32 curr_offset;
7572 curr_offset = offset;
7575 ELEM_MAND_TV(ANSI_A_E_CIC, "");
7577 ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
7579 ELEM_OPT_TLV(ANSI_A_E_CCT_GROUP, "");
7581 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7588 bsmap_reset_cct_ack(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7590 guint32 curr_offset;
7594 curr_offset = offset;
7597 ELEM_MAND_TV(ANSI_A_E_CIC, "");
7599 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7606 bsmap_xmode_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7608 guint32 curr_offset;
7612 curr_offset = offset;
7615 ELEM_MAND_TLV(ANSI_A_E_XMODE, "");
7617 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7624 bsmap_xmode_ack(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7626 guint32 curr_offset;
7630 curr_offset = offset;
7633 ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
7635 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7642 bsmap_adds_page(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7644 guint32 curr_offset;
7648 curr_offset = offset;
7651 ELEM_MAND_TLV(ANSI_A_E_MID, "");
7653 ELEM_MAND_TLV(ANSI_A_E_ADDS_USER_PART, "");
7655 ELEM_OPT_TV(ANSI_A_E_TAG, "");
7657 ELEM_OPT_TLV(ANSI_A_E_CELL_ID_LIST, "");
7659 ELEM_OPT_TV(ANSI_A_E_SCI, "");
7661 ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
7663 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7670 bsmap_adds_transfer(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7672 guint32 curr_offset;
7676 curr_offset = offset;
7679 ELEM_MAND_TLV(ANSI_A_E_MID, "");
7681 ELEM_MAND_TLV(ANSI_A_E_ADDS_USER_PART, "");
7683 ELEM_OPT_TLV(ANSI_A_E_MID, "");
7685 ELEM_OPT_TLV(ANSI_A_E_AUTH_RESP_PARAM, "");
7687 ELEM_OPT_TV(ANSI_A_E_AUTH_CNF_PARAM, "");
7689 ELEM_OPT_TV(ANSI_A_E_AUTH_PARAM_COUNT, "");
7691 ELEM_OPT_TLV(ANSI_A_E_AUTH_CHLG_PARAM, "");
7693 ELEM_OPT_TLV(ANSI_A_E_AUTH_EVENT, "");
7695 ELEM_OPT_TLV(ANSI_A_E_CELL_ID, "");
7697 ELEM_OPT_TLV(ANSI_A_E_CDMA_SOWD, "");
7699 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7706 dtap_adds_deliver(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7708 guint32 curr_offset;
7712 curr_offset = offset;
7715 ELEM_MAND_LV(ANSI_A_E_ADDS_USER_PART, "");
7717 ELEM_OPT_TV(ANSI_A_E_TAG, "");
7719 ELEM_OPT_TLV(ANSI_A_E_CDMA_SOWD, "");
7721 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7728 bsmap_adds_page_ack(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7730 guint32 curr_offset;
7734 curr_offset = offset;
7737 ELEM_MAND_TLV(ANSI_A_E_MID, "");
7739 ELEM_OPT_TV(ANSI_A_E_TAG, "");
7741 ELEM_OPT_TLV(ANSI_A_E_MID, "");
7743 ELEM_OPT_TLV(ANSI_A_E_CAUSE, "");
7745 ELEM_OPT_TLV(ANSI_A_E_CELL_ID, "");
7747 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7754 dtap_adds_deliver_ack(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7756 guint32 curr_offset;
7760 curr_offset = offset;
7763 ELEM_OPT_TV(ANSI_A_E_TAG, "");
7765 ELEM_OPT_TLV(ANSI_A_E_CAUSE, "");
7767 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7774 bsmap_rejection(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7776 guint32 curr_offset;
7780 curr_offset = offset;
7783 ELEM_OPT_TLV(ANSI_A_E_MID, "");
7785 ELEM_OPT_TLV(ANSI_A_E_MID, "");
7787 ELEM_OPT_TLV(ANSI_A_E_IS2000_CAUSE, "");
7789 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7793 dtap_rejection(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7795 guint32 curr_offset;
7799 curr_offset = offset;
7802 ELEM_OPT_TLV(ANSI_A_E_IS2000_CAUSE, "");
7804 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7807 #define ANSI_A_IOS401_BSMAP_NUM_MSG (sizeof(ansi_a_ios401_bsmap_strings)/sizeof(value_string))
7808 static gint ett_bsmap_msg[ANSI_A_IOS401_BSMAP_NUM_MSG];
7809 static void (*bsmap_msg_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len) = {
7810 NULL, /* Additional Service Notification */
7811 bsmap_adds_page, /* ADDS Page */
7812 bsmap_adds_page_ack, /* ADDS Page Ack */
7813 bsmap_adds_transfer, /* ADDS Transfer */
7814 NULL, /* ADDS Transfer Ack */
7815 bsmap_ass_complete, /* Assignment Complete */
7816 bsmap_ass_failure, /* Assignment Failure */
7817 bsmap_ass_req, /* Assignment Request */
7818 bsmap_auth_req, /* Authentication Request */
7819 bsmap_auth_resp, /* Authentication Response */
7820 NULL, /* Base Station Challenge */
7821 NULL, /* Base Station Challenge Response */
7822 bsmap_block, /* Block */
7823 bsmap_block_ack, /* Block Acknowledge */
7824 bsmap_bs_srvc_req, /* BS Service Request */
7825 bsmap_bs_srvc_resp, /* BS Service Response */
7826 bsmap_clr_command, /* Clear Command */
7827 bsmap_clr_complete, /* Clear Complete */
7828 bsmap_clr_req, /* Clear Request */
7829 bsmap_cl3_info, /* Complete Layer 3 Information */
7830 bsmap_feat_noti, /* Feature Notification */
7831 bsmap_feat_noti_ack, /* Feature Notification Ack */
7832 bsmap_ho_command, /* Handoff Command */
7833 NULL /* no associated data */, /* Handoff Commenced */
7834 NULL /* no associated data */, /* Handoff Complete */
7835 bsmap_ho_failure, /* Handoff Failure */
7836 bsmap_ho_performed, /* Handoff Performed */
7837 bsmap_ho_req, /* Handoff Request */
7838 bsmap_ho_req_ack, /* Handoff Request Acknowledge */
7839 bsmap_ho_reqd, /* Handoff Required */
7840 bsmap_ho_reqd_rej, /* Handoff Required Reject */
7841 bsmap_paca_command, /* PACA Command */
7842 bsmap_paca_command_ack, /* PACA Command Ack */
7843 bsmap_paca_update, /* PACA Update */
7844 bsmap_paca_update_ack, /* PACA Update Ack */
7845 bsmap_page_req, /* Paging Request */
7846 bsmap_priv_mode_command, /* Privacy Mode Command */
7847 bsmap_priv_mode_complete, /* Privacy Mode Complete */
7848 NULL, /* Radio Measurements for Position Request */
7849 NULL, /* Radio Measurements for Position Response */
7850 bsmap_rejection, /* Rejection */
7851 NULL, /* Registration Request */
7852 bsmap_reset, /* Reset */
7853 bsmap_reset_ack, /* Reset Acknowledge */
7854 bsmap_reset_cct, /* Reset Circuit */
7855 bsmap_reset_cct_ack, /* Reset Circuit Acknowledge */
7856 NULL, /* SSD Update Request */
7857 NULL, /* SSD Update Response */
7858 NULL, /* Status Request */
7859 NULL, /* Status Response */
7860 bsmap_xmode_ack, /* Transcoder Control Acknowledge */
7861 bsmap_xmode_req, /* Transcoder Control Request */
7862 bsmap_unblock, /* Unblock */
7863 bsmap_unblock_ack, /* Unblock Acknowledge */
7864 NULL, /* User Zone Reject */
7865 bsmap_user_zone_update, /* User Zone Update */
7869 #define ANSI_A_IOS401_DTAP_NUM_MSG (sizeof(ansi_a_ios401_dtap_strings)/sizeof(value_string))
7870 static gint ett_dtap_msg[ANSI_A_IOS401_DTAP_NUM_MSG];
7871 static void (*dtap_msg_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len) = {
7872 NULL, /* Additional Service Request */
7873 dtap_adds_deliver, /* ADDS Deliver */
7874 dtap_adds_deliver_ack, /* ADDS Deliver Ack */
7875 dtap_alert_with_info, /* Alert With Information */
7876 dtap_auth_req, /* Authentication Request */
7877 dtap_auth_resp, /* Authentication Response */
7878 dtap_bs_challenge, /* Base Station Challenge */
7879 dtap_bs_challenge_resp, /* Base Station Challenge Response */
7880 dtap_cm_srvc_req, /* CM Service Request */
7881 NULL, /* CM Service Request Continuation */
7882 NULL /* no associated data */, /* Connect */
7883 dtap_flash_with_info, /* Flash with Information */
7884 dtap_flash_with_info_ack, /* Flash with Information Ack */
7885 dtap_lu_accept, /* Location Updating Accept */
7886 dtap_lu_reject, /* Location Updating Reject */
7887 dtap_lu_req, /* Location Updating Request */
7888 dtap_page_resp, /* Paging Response */
7889 NULL /* no associated data */, /* Parameter Update Confirm */
7890 NULL /* no associated data */, /* Parameter Update Request */
7891 dtap_rejection, /* Rejection */
7892 dtap_progress, /* Progress */
7893 NULL, /* Service Redirection */
7894 NULL, /* Service Release */
7895 NULL, /* Service Release Complete */
7896 dtap_ssd_update_req, /* SSD Update Request */
7897 dtap_ssd_update_resp, /* SSD Update Response */
7898 NULL, /* Status Request */
7899 NULL, /* Status Response */
7900 NULL, /* User Zone Reject */
7901 NULL, /* User Zone Update */
7902 NULL, /* User Zone Update Request */
7906 /* GENERIC MAP DISSECTOR FUNCTIONS */
7909 dissect_bsmap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
7911 static ansi_a_tap_rec_t tap_rec[4];
7912 static ansi_a_tap_rec_t *tap_p;
7913 static int tap_current=0;
7915 guint32 offset, saved_offset;
7918 proto_item *bsmap_item = NULL;
7919 proto_tree *bsmap_tree = NULL;
7920 const gchar *msg_str;
7923 if (check_col(pinfo->cinfo, COL_INFO))
7925 col_append_str(pinfo->cinfo, COL_INFO, "(BSMAP) ");
7929 * set tap record pointer
7932 if (tap_current == 4)
7936 tap_p = &tap_rec[tap_current];
7940 saved_offset = offset;
7945 len = tvb_length(tvb);
7948 * add BSMAP message name
7950 oct = tvb_get_guint8(tvb, offset++);
7952 msg_str = match_strval_idx((guint32) oct, ansi_a_ios401_bsmap_strings, &idx);
7955 * create the a protocol tree
7957 if (msg_str == NULL)
7960 proto_tree_add_protocol_format(tree, proto_a_bsmap, tvb, 0, len,
7961 "ANSI A-I/F BSMAP - Unknown BSMAP Message Type (%u)",
7964 bsmap_tree = proto_item_add_subtree(bsmap_item, ett_bsmap);
7969 proto_tree_add_protocol_format(tree, proto_a_bsmap, tvb, 0, -1,
7970 "ANSI A-I/F BSMAP - %s",
7973 bsmap_tree = proto_item_add_subtree(bsmap_item, ett_bsmap_msg[idx]);
7975 if (check_col(pinfo->cinfo, COL_INFO))
7977 col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", msg_str);
7982 * add BSMAP message name
7984 proto_tree_add_uint_format(bsmap_tree, hf_ansi_a_bsmap_msgtype,
7985 tvb, saved_offset, 1, oct, "Message Type");
7987 tap_p->pdu_type = BSSAP_PDU_TYPE_BSMAP;
7988 tap_p->message_type = oct;
7990 tap_queue_packet(ansi_a_tap, pinfo, tap_p);
7992 if (msg_str == NULL) return;
7994 if ((len - offset) <= 0) return;
7999 if (bsmap_msg_fcn[idx] == NULL)
8001 proto_tree_add_text(bsmap_tree,
8002 tvb, offset, len - offset,
8003 "Message Elements");
8007 (*bsmap_msg_fcn[idx])(tvb, bsmap_tree, offset, len - offset);
8012 dissect_dtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
8014 static ansi_a_tap_rec_t tap_rec[4];
8015 static ansi_a_tap_rec_t *tap_p;
8016 static int tap_current=0;
8018 guint32 offset, saved_offset;
8020 guint32 oct_1, oct_2;
8022 proto_item *dtap_item = NULL;
8023 proto_tree *dtap_tree = NULL;
8024 proto_item *oct_1_item = NULL;
8025 proto_tree *oct_1_tree = NULL;
8026 const gchar *msg_str;
8030 len = tvb_length(tvb);
8035 * too short to be DTAP
8037 call_dissector(data_handle, tvb, pinfo, tree);
8041 if (check_col(pinfo->cinfo, COL_INFO))
8043 col_append_str(pinfo->cinfo, COL_INFO, "(DTAP) ");
8047 * set tap record pointer
8050 if (tap_current == 4)
8054 tap_p = &tap_rec[tap_current];
8058 saved_offset = offset;
8064 * get protocol discriminator
8066 oct_1 = tvb_get_guint8(tvb, offset++);
8067 oct_2 = tvb_get_guint8(tvb, offset++);
8070 * add DTAP message name
8072 saved_offset = offset;
8073 oct = tvb_get_guint8(tvb, offset++);
8075 msg_str = match_strval_idx((guint32) oct, ansi_a_ios401_dtap_strings, &idx);
8078 * create the a protocol tree
8080 if (msg_str == NULL)
8083 proto_tree_add_protocol_format(tree, proto_a_dtap, tvb, 0, len,
8084 "ANSI A-I/F DTAP - Unknown DTAP Message Type (%u)",
8087 dtap_tree = proto_item_add_subtree(dtap_item, ett_dtap);
8092 proto_tree_add_protocol_format(tree, proto_a_dtap, tvb, 0, -1,
8093 "ANSI A-I/F DTAP - %s",
8096 dtap_tree = proto_item_add_subtree(dtap_item, ett_dtap_msg[idx]);
8098 if (check_col(pinfo->cinfo, COL_INFO))
8100 col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", msg_str);
8107 switch (oct_1 & 0x0f)
8109 case 3: str = "Call Control, call related SS"; break;
8110 case 5: str = "Mobility Management"; break;
8111 case 6: str = "Radio Resource Management"; break;
8112 case 9: str = "Facility Management"; break;
8113 case 11: str = "Other Signaling Procedures"; break;
8114 case 15: str = "Reserved for tests"; break;
8121 proto_tree_add_text(dtap_tree,
8123 "Protocol Discriminator: %s",
8126 oct_1_tree = proto_item_add_subtree(oct_1_item, ett_dtap_oct_1);
8128 other_decode_bitfield_value(a_bigbuf, oct_1, 0xf0, 8);
8129 proto_tree_add_text(oct_1_tree,
8134 other_decode_bitfield_value(a_bigbuf, oct_1, 0x0f, 8);
8135 proto_tree_add_text(oct_1_tree,
8137 "%s : Protocol Discriminator: %u",
8146 case A_VARIANT_IS634:
8147 other_decode_bitfield_value(a_bigbuf, oct_2, 0x80, 8);
8148 proto_tree_add_text(dtap_tree,
8150 "%s : Transaction Identifier (TI) Flag: %s",
8152 ((oct_2 & 0x80) ? "allocated by receiver" : "allocated by sender"));
8154 other_decode_bitfield_value(a_bigbuf, oct_2, 0x70, 8);
8155 proto_tree_add_text(dtap_tree,
8157 "%s : Transaction Identifier (TI): %u",
8159 (oct_2 & 0x70) >> 4);
8161 other_decode_bitfield_value(a_bigbuf, oct_2, 0x0f, 8);
8162 proto_tree_add_text(dtap_tree,
8169 proto_tree_add_text(dtap_tree,
8176 * add DTAP message name
8178 proto_tree_add_uint_format(dtap_tree, hf_ansi_a_dtap_msgtype,
8179 tvb, saved_offset, 1, oct,
8182 tap_p->pdu_type = BSSAP_PDU_TYPE_DTAP;
8183 tap_p->message_type = oct;
8185 tap_queue_packet(ansi_a_tap, pinfo, tap_p);
8187 if (msg_str == NULL) return;
8189 if ((len - offset) <= 0) return;
8194 if (dtap_msg_fcn[idx] == NULL)
8196 proto_tree_add_text(dtap_tree,
8197 tvb, offset, len - offset,
8198 "Message Elements");
8202 (*dtap_msg_fcn[idx])(tvb, dtap_tree, offset, len - offset);
8207 /* Register the protocol with Wireshark */
8209 proto_register_ansi_a(void)
8211 module_t *ansi_a_module;
8215 /* Setup list of header fields */
8217 static hf_register_info hf[] =
8219 { &hf_ansi_a_bsmap_msgtype,
8220 { "BSMAP Message Type", "ansi_a.bsmap_msgtype",
8221 FT_UINT8, BASE_HEX, VALS(ansi_a_ios401_bsmap_strings), 0x0,
8224 { &hf_ansi_a_dtap_msgtype,
8225 { "DTAP Message Type", "ansi_a.dtap_msgtype",
8226 FT_UINT8, BASE_HEX, VALS(ansi_a_ios401_dtap_strings), 0x0,
8229 { &hf_ansi_a_elem_id,
8230 { "Element ID", "ansi_a.elem_id",
8231 FT_UINT8, BASE_DEC, VALS(ansi_a_ios401_elem_1_strings), 0,
8234 { &hf_ansi_a_length,
8235 { "Length", "ansi_a.len",
8236 FT_UINT8, BASE_DEC, NULL, 0,
8240 { "Sub tree", "ansi_a.none",
8245 { "ESN", "ansi_a.esn",
8246 FT_UINT32, BASE_HEX, 0, 0x0,
8250 { "IMSI", "ansi_a.imsi",
8251 FT_STRING, BASE_DEC, 0, 0,
8255 { "MIN", "ansi_a.min",
8256 FT_STRING, BASE_DEC, 0, 0,
8259 { &hf_ansi_a_cld_party_bcd_num,
8260 { "Called Party BCD Number", "ansi_a.cld_party_bcd_num",
8261 FT_STRING, BASE_DEC, 0, 0,
8264 { &hf_ansi_a_clg_party_bcd_num,
8265 { "Calling Party BCD Number", "ansi_a.clg_party_bcd_num",
8266 FT_STRING, BASE_DEC, 0, 0,
8269 { &hf_ansi_a_cld_party_ascii_num,
8270 { "Called Party ASCII Number", "ansi_a.cld_party_ascii_num",
8271 FT_STRING, BASE_DEC, 0, 0,
8274 { &hf_ansi_a_clg_party_ascii_num,
8275 { "Calling Party ASCII Number", "ansi_a.clg_party_ascii_num",
8276 FT_STRING, BASE_DEC, 0, 0,
8279 { &hf_ansi_a_cell_ci,
8280 { "Cell CI", "ansi_a.cell_ci",
8281 FT_UINT16, BASE_HEX, 0, 0x0,
8284 { &hf_ansi_a_cell_lac,
8285 { "Cell LAC", "ansi_a.cell_lac",
8286 FT_UINT16, BASE_HEX, 0, 0x0,
8289 { &hf_ansi_a_cell_mscid,
8290 { "Cell MSCID", "ansi_a.cell_mscid",
8291 FT_UINT24, BASE_HEX, 0, 0x0,
8294 { &hf_ansi_a_pdsn_ip_addr,
8295 { "PDSN IP Address", "ansi_a.pdsn_ip_addr",
8296 FT_IPv4, BASE_NONE, NULL, 0,
8297 "IP Address", HFILL}},
8300 static enum_val_t a_variant_options[] = {
8301 { "is-634-rev0", "IS-634 rev. 0", A_VARIANT_IS634 },
8302 { "tsb-80", "TSB-80", A_VARIANT_TSB80 },
8303 { "is-634-a", "IS-634-A", A_VARIANT_IS634A },
8304 { "ios-2.x", "IOS 2.x", A_VARIANT_IOS2 },
8305 { "ios-3.x", "IOS 3.x", A_VARIANT_IOS3 },
8306 { "ios-4.0.1", "IOS 4.0.1", A_VARIANT_IOS401 },
8311 /* Setup protocol subtree array */
8312 #define MAX_NUM_DTAP_MSG MAX(ANSI_A_IOS401_DTAP_NUM_MSG, 0)
8313 #define MAX_NUM_BSMAP_MSG MAX(ANSI_A_IOS401_BSMAP_NUM_MSG, 0)
8314 #define NUM_INDIVIDUAL_ELEMS 9
8316 gint ett_len = (NUM_INDIVIDUAL_ELEMS+MAX_NUM_DTAP_MSG+MAX_NUM_BSMAP_MSG+NUM_ELEM_1+NUM_MS_INFO_REC) * sizeof(gint *);
8319 * XXX - at least one version of the HP C compiler apparently doesn't
8320 * recognize constant expressions using the "?" operator as being
8321 * constant expressions, so you can't use the expression that
8322 * initializes "ett_let" as an array size. Therefore, we dynamically
8323 * allocate the array instead.
8325 ett = g_malloc(ett_len);
8327 memset((void *) ett_dtap_msg, -1, sizeof(gint) * MAX_NUM_DTAP_MSG);
8328 memset((void *) ett_bsmap_msg, -1, sizeof(gint) * MAX_NUM_BSMAP_MSG);
8329 memset((void *) ett_ansi_elem_1, -1, sizeof(gint) * NUM_ELEM_1);
8330 memset((void *) ett_ansi_ms_info_rec, -1, sizeof(gint) * NUM_MS_INFO_REC);
8332 ett[0] = &ett_bsmap;
8334 ett[2] = &ett_elems;
8336 ett[4] = &ett_dtap_oct_1;
8337 ett[5] = &ett_cm_srvc_type;
8338 ett[6] = &ett_ansi_ms_info_rec_reserved;
8339 ett[7] = &ett_ansi_enc_info;
8340 ett[8] = &ett_cell_list;
8342 last_offset = NUM_INDIVIDUAL_ELEMS;
8344 for (i=0; i < MAX_NUM_DTAP_MSG; i++, last_offset++)
8346 ett[last_offset] = &ett_dtap_msg[i];
8349 for (i=0; i < MAX_NUM_BSMAP_MSG; i++, last_offset++)
8351 ett[last_offset] = &ett_bsmap_msg[i];
8354 for (i=0; i < NUM_ELEM_1; i++, last_offset++)
8356 ett[last_offset] = &ett_ansi_elem_1[i];
8359 for (i=0; i < NUM_MS_INFO_REC; i++, last_offset++)
8361 ett[last_offset] = &ett_ansi_ms_info_rec[i];
8364 /* Register the protocol name and description */
8367 proto_register_protocol("ANSI A-I/F BSMAP", "ANSI BSMAP", "ansi_a_bsmap");
8369 proto_register_field_array(proto_a_bsmap, hf, array_length(hf));
8372 proto_register_protocol("ANSI A-I/F DTAP", "ANSI DTAP", "ansi_a_dtap");
8374 is637_dissector_table =
8375 register_dissector_table("ansi_a.sms", "IS-637-A (SMS)",
8376 FT_UINT8, BASE_DEC);
8378 is683_dissector_table =
8379 register_dissector_table("ansi_a.ota", "IS-683-A (OTA)",
8380 FT_UINT8, BASE_DEC);
8382 is801_dissector_table =
8383 register_dissector_table("ansi_a.pld", "IS-801 (PLD)",
8384 FT_UINT8, BASE_DEC);
8386 proto_register_subtree_array(ett, ett_len / sizeof(gint *));
8388 ansi_a_tap = register_tap("ansi_a");
8391 * setup for preferences
8393 ansi_a_module = prefs_register_protocol(proto_a_bsmap, proto_reg_handoff_ansi_a);
8395 prefs_register_enum_preference(ansi_a_module,
8398 "(if other than the default of IOS 4.0.1)",
8408 proto_reg_handoff_ansi_a(void)
8410 static int ansi_a_prefs_initialized = FALSE;
8413 if (!ansi_a_prefs_initialized)
8415 bsmap_handle = create_dissector_handle(dissect_bsmap, proto_a_bsmap);
8416 dtap_handle = create_dissector_handle(dissect_dtap, proto_a_dtap);
8418 ansi_a_prefs_initialized = TRUE;
8422 dissector_delete("bsap.pdu_type", BSSAP_PDU_TYPE_BSMAP, bsmap_handle);
8423 dissector_delete("bsap.pdu_type", BSSAP_PDU_TYPE_DTAP, dtap_handle);
8426 if (a_variant != a_global_variant)
8428 a_variant = a_global_variant;
8431 dissector_add("bsap.pdu_type", BSSAP_PDU_TYPE_BSMAP, bsmap_handle);
8432 dissector_add("bsap.pdu_type", BSSAP_PDU_TYPE_DTAP, dtap_handle);
8434 data_handle = find_dissector("data");