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
13 * $Id: packet-ansi_a.c,v 1.16 2004/03/27 11:32:28 guy Exp $
15 * Ethereal - Network traffic analyzer
16 * By Gerald Combs <gerald@ethereal.com>
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"
46 #include "packet-bssap.h"
47 #include "packet-ansi_a.h"
50 /* PROTOTYPES/FORWARDS */
52 void proto_reg_handoff_ansi_a(void);
54 #define ANSI_A_MAX(x,y) (((x) < (y)) ? (y) : (x))
56 #define ANSI_A_MIN(x,y) (((x) < (y)) ? (x) : (y))
58 const value_string ansi_a_ios401_bsmap_strings[] = {
59 { 0x69, "Additional Service Notification" },
60 { 0x65, "ADDS Page" },
61 { 0x66, "ADDS Page Ack" },
62 { 0x67, "ADDS Transfer" },
63 { 0x68, "ADDS Transfer Ack" },
64 { 0x02, "Assignment Complete" },
65 { 0x03, "Assignment Failure" },
66 { 0x01, "Assignment Request" },
67 { 0x45, "Authentication Request" },
68 { 0x46, "Authentication Response" },
69 { 0x48, "Base Station Challenge" },
70 { 0x49, "Base Station Challenge Response" },
72 { 0x41, "Block Acknowledge" },
73 { 0x09, "BS Service Request" },
74 { 0x0A, "BS Service Response" },
75 { 0x20, "Clear Command" },
76 { 0x21, "Clear Complete" },
77 { 0x22, "Clear Request" },
78 { 0x57, "Complete Layer 3 Information" },
79 { 0x60, "Feature Notification" },
80 { 0x61, "Feature Notification Ack" },
81 { 0x13, "Handoff Command" },
82 { 0x15, "Handoff Commenced" },
83 { 0x14, "Handoff Complete" },
84 { 0x16, "Handoff Failure" },
85 { 0x17, "Handoff Performed" },
86 { 0x10, "Handoff Request" },
87 { 0x12, "Handoff Request Acknowledge" },
88 { 0x11, "Handoff Required" },
89 { 0x1A, "Handoff Required Reject" },
90 { 0x6C, "PACA Command" },
91 { 0x6D, "PACA Command Ack" },
92 { 0x6E, "PACA Update" },
93 { 0x6F, "PACA Update Ack" },
94 { 0x52, "Paging Request" },
95 { 0x53, "Privacy Mode Command" },
96 { 0x55, "Privacy Mode Complete" },
97 { 0x23, "Radio Measurements for Position Request" },
98 { 0x25, "Radio Measurements for Position Response" },
99 { 0x56, "Rejection" },
100 { 0x05, "Registration Request" },
102 { 0x31, "Reset Acknowledge" },
103 { 0x34, "Reset Circuit" },
104 { 0x35, "Reset Circuit Acknowledge" },
105 { 0x47, "SSD Update Request" },
106 { 0x4A, "SSD Update Response" },
107 { 0x6A, "Status Request" },
108 { 0x6B, "Status Response" },
109 { 0x39, "Transcoder Control Acknowledge" },
110 { 0x38, "Transcoder Control Request" },
112 { 0x43, "Unblock Acknowledge" },
113 { 0x0B, "User Zone Reject" },
114 { 0x04, "User Zone Update" },
118 const value_string ansi_a_ios401_dtap_strings[] = {
119 { 0x62, "Additional Service Request" },
120 { 0x53, "ADDS Deliver" },
121 { 0x54, "ADDS Deliver Ack" },
122 { 0x26, "Alert With Information" },
123 { 0x45, "Authentication Request" },
124 { 0x46, "Authentication Response" },
125 { 0x48, "Base Station Challenge" },
126 { 0x49, "Base Station Challenge Response" },
127 { 0x24, "CM Service Request" },
128 { 0x25, "CM Service Request Continuation" },
130 { 0x10, "Flash with Information" },
131 { 0x50, "Flash with Information Ack" },
132 { 0x02, "Location Updating Accept" },
133 { 0x04, "Location Updating Reject" },
134 { 0x08, "Location Updating Request" },
135 { 0x27, "Paging Response" },
136 { 0x2B, "Parameter Update Confirm" },
137 { 0x2C, "Parameter Update Request" },
138 { 0x56, "Rejection" },
139 { 0x03, "Progress" },
140 { 0x70, "Service Redirection" },
141 { 0x2E, "Service Release" },
142 { 0x2F, "Service Release Complete" },
143 { 0x47, "SSD Update Request" },
144 { 0x4A, "SSD Update Response" },
145 { 0x6A, "Status Request" },
146 { 0x6B, "Status Response" },
147 { 0x0B, "User Zone Reject" },
148 { 0x0C, "User Zone Update" },
149 { 0x0D, "User Zone Update Request" },
153 const value_string ansi_a_ios401_elem_1_strings[] = {
154 { 0x20, "Access Network Identifiers" },
155 { 0x3D, "ADDS User Part" },
156 { 0x25, "AMPS Hard Handoff Parameters" },
157 { 0x30, "Anchor PDSN Address" },
158 { 0x7C, "Anchor P-P Address" },
159 { 0x41, "Authentication Challenge Parameter" },
160 { 0x28, "Authentication Confirmation Parameter (RANDC)" },
161 { 0x59, "Authentication Data" },
162 { 0x4A, "Authentication Event" },
163 { 0x40, "Authentication Parameter COUNT" },
164 { 0x42, "Authentication Response Parameter" },
165 { 0x37, "Band Class" },
166 { 0x5B, "Called Party ASCII Number" },
167 { 0x5E, "Called Party BCD Number" },
168 { 0x4B, "Calling Party ASCII Number" },
170 { 0x08, "Cause Layer 3" },
171 { 0x0C, "CDMA Serving One Way Delay" },
172 { 0x05, "Cell Identifier" },
173 { 0x1A, "Cell Identifier List" },
174 { 0x23, "Channel Number" },
175 { 0x0B, "Channel Type" },
176 { 0x19, "Circuit Group" },
177 { 0x01, "Circuit Identity Code" },
178 { 0x24, "Circuit Identity Code Extension" },
179 { 0x12, "Classmark Information Type 2" },
180 { 0x29, "Downlink Radio Environment" },
181 { 0x2B, "Downlink Radio Environment List" },
182 { 0x0A, "Encryption Information" },
183 { 0x10, "Extended Handoff Direction Parameters" },
184 { 0x2C, "Geographic Location" },
185 { 0x5A, "Special Service Call Indicator" },
186 { 0x26, "Handoff Power Level" },
187 { 0x16, "Hard Handoff Parameters" },
188 { 0x2E, "Information Element Requested" },
189 { 0x09, "IS-2000 Channel Identity" },
190 { 0x27, "IS-2000 Channel Identity 3X" },
191 { 0x11, "IS-2000 Mobile Capabilities" },
192 { 0x0F, "IS-2000 Non-Negotiable Service Configuration Record" },
193 { 0x0E, "IS-2000 Service Configuration Record" },
194 { 0x62, "IS-95/IS-2000 Cause Value" },
195 { 0x67, "IS-2000 Redirection Record" },
196 { 0x22, "IS-95 Channel Identity" },
197 { 0x64, "IS-95 MS Measured Channel Identity" },
198 { 0x17, "Layer 3 Information" },
199 { 0x13, "Location Area Information" },
200 { 0x38, "Message Waiting Indication" },
201 { 0x0D, "Mobile Identity" },
202 { 0x15, "MS Information Records" },
203 { 0xA0, "Origination Continuation Indicator" },
204 { 0x5F, "PACA Order" },
205 { 0x60, "PACA Reorigination Indicator" },
206 { 0x4E, "PACA Timestamp" },
207 { 0x70, "Packet Session Parameters" },
208 { 0x14, "PDSN IP Address" },
209 { 0xA2, "Power Down Indicator" },
210 { 0x06, "Priority" },
211 { 0x3B, "Protocol Revision" },
212 { 0x18, "Protocol Type" },
213 { 0x2D, "PSMM Count" },
214 { 0x07, "Quality of Service Parameters" },
215 { 0x1D, "Radio Environment and Resources" },
216 { 0x1F, "Registration Type" },
217 { 0x44, "Reject Cause" },
218 { 0x1B, "Response Request" },
219 { 0x68, "Return Cause" },
220 { 0x21, "RF Channel Identity" },
221 { 0x03, "Service Option" },
222 { 0x1E, "Service Option Connection Identifier (SOCI)" },
223 { 0x2A, "Service Option List" },
224 { 0x69, "Service Redirection Info" },
225 { 0x71, "Session Reference Identifier (SR_ID)" },
228 { 0x35, "Slot Cycle Index" },
229 { 0x31, "Software Version" },
230 { 0x39, "Source RNC to Target RNC Transparent Container" },
231 { 0x14, "Source PDSN Address" },
233 { 0x3A, "Target RNC to Source RNC Transparent Container" },
234 { 0x36, "Transcoder Mode" }, /* XXX 0x1C in IOS 4.0.1 */
235 { 0x02, "User Zone ID" },
236 { 0xA1, "Voice Privacy Request" },
240 #define ANSI_MS_INFO_REC_DISPLAY 0x01
241 #define ANSI_MS_INFO_REC_CLD_PN 0x02
242 #define ANSI_MS_INFO_REC_CLG_PN 0x03
243 #define ANSI_MS_INFO_REC_CONN_N 0x04
244 #define ANSI_MS_INFO_REC_SIGNAL 0x05
245 #define ANSI_MS_INFO_REC_MW 0x06
246 #define ANSI_MS_INFO_REC_SC 0x07
247 #define ANSI_MS_INFO_REC_CLD_PSA 0x08
248 #define ANSI_MS_INFO_REC_CLG_PSA 0x09
249 #define ANSI_MS_INFO_REC_CONN_SA 0x0a
250 #define ANSI_MS_INFO_REC_RED_N 0x0b
251 #define ANSI_MS_INFO_REC_RED_SA 0x0c
252 #define ANSI_MS_INFO_REC_MP 0x0d
253 #define ANSI_MS_INFO_REC_PA 0x0e
254 #define ANSI_MS_INFO_REC_LC 0x0f
255 #define ANSI_MS_INFO_REC_EDISPLAY 0x10
256 #define ANSI_MS_INFO_REC_NNSC 0x13
257 #define ANSI_MS_INFO_REC_MC_EDISPLAY 0x14
258 #define ANSI_MS_INFO_REC_CWI 0x15
259 #define ANSI_MS_INFO_REC_ERTI 0xfe
261 static const value_string ansi_ms_info_rec_str[] = {
262 { ANSI_MS_INFO_REC_DISPLAY, "Display" },
263 { ANSI_MS_INFO_REC_CLD_PN, "Called Party Number" },
264 { ANSI_MS_INFO_REC_CLG_PN, "Calling Party Number" },
265 { ANSI_MS_INFO_REC_CONN_N, "Connected Number" },
266 { ANSI_MS_INFO_REC_SIGNAL, "Signal" },
267 { ANSI_MS_INFO_REC_MW, "Message Waiting" },
268 { ANSI_MS_INFO_REC_SC, "Service Configuration" },
269 { ANSI_MS_INFO_REC_CLD_PSA, "Called Party Subaddress" },
270 { ANSI_MS_INFO_REC_CLG_PSA, "Calling Party Subaddress" },
271 { ANSI_MS_INFO_REC_CONN_SA, "Connected Subaddress" },
272 { ANSI_MS_INFO_REC_RED_N, "Redirecting Number" },
273 { ANSI_MS_INFO_REC_RED_SA, "Redirecting Subaddress" },
274 { ANSI_MS_INFO_REC_MP, "Meter Pulses" },
275 { ANSI_MS_INFO_REC_PA, "Parametric Alerting" },
276 { ANSI_MS_INFO_REC_LC, "Line Control" },
277 { ANSI_MS_INFO_REC_EDISPLAY, "Extended Display" },
278 { ANSI_MS_INFO_REC_NNSC, "Non-Negotiable Service Configuration" },
279 { ANSI_MS_INFO_REC_MC_EDISPLAY, "Multiple Character Extended Display" },
280 { ANSI_MS_INFO_REC_CWI, "Call Waiting Indicator" },
281 { ANSI_MS_INFO_REC_ERTI, "Extended Record Type International" },
284 #define NUM_MS_INFO_REC (sizeof(ansi_ms_info_rec_str)/sizeof(value_string))
285 static gint ett_ansi_ms_info_rec[NUM_MS_INFO_REC];
287 static gchar *band_class_str[] = {
288 "800 MHz Cellular System",
289 "1.850 to 1.990 GHz Broadband PCS",
290 "872 to 960 MHz TACS Band",
291 "832 to 925 MHz JTACS Band",
292 "1.750 to 1.870 GHz Korean PCS",
294 "2 GHz IMT-2000 Band",
295 "North American 700 MHz Cellular Band",
296 "1.710 to 1.880 GHz PCS",
297 "880 to 960 MHz Band",
298 "Secondary 800 MHz Band",
299 "400 MHz European PAMR Band",
300 "800 MHz European PAMR Band"
302 #define NUM_BAND_CLASS_STR (sizeof(band_class_str)/sizeof(gchar *))
304 static gchar *cell_disc_str[] = {
305 "whole Cell Global Identification (CGI)",
307 "Cell Identity (CI)",
309 "Location Area Identification (LAI)",
310 "Location Area Code (LAC)",
312 "IS-41 whole Cell Global Identification (ICGI)",
313 "Enhanced whole Cell Global Identification (ECGI)"
315 #define NUM_CELL_DISC_STR (sizeof(cell_disc_str)/sizeof(gchar *))
317 /* Initialize the protocol and registered fields */
318 static int proto_a_bsmap = -1;
319 static int proto_a_dtap = -1;
321 static int ansi_a_tap = -1;
323 static int hf_ansi_a_none = -1;
324 static int hf_ansi_a_bsmap_msgtype = -1;
325 static int hf_ansi_a_dtap_msgtype = -1;
326 static int hf_ansi_a_length = -1;
327 static int hf_ansi_a_elem_id = -1;
328 static int hf_ansi_a_esn = -1;
329 static int hf_ansi_a_imsi = -1;
330 static int hf_ansi_a_min = -1;
331 static int hf_ansi_a_cld_party_bcd_num = -1;
332 static int hf_ansi_a_clg_party_bcd_num = -1;
333 static int hf_ansi_a_cld_party_ascii_num = -1;
334 static int hf_ansi_a_clg_party_ascii_num = -1;
335 static int hf_ansi_a_cell_ci = -1;
336 static int hf_ansi_a_cell_lac = -1;
337 static int hf_ansi_a_cell_mscid = -1;
338 static int hf_ansi_a_pdsn_ip_addr = -1;
341 /* Initialize the subtree pointers */
342 static gint ett_bsmap = -1;
343 static gint ett_dtap = -1;
344 static gint ett_elems = -1;
345 static gint ett_elem = -1;
346 static gint ett_dtap_oct_1 = -1;
347 static gint ett_cm_srvc_type = -1;
348 static gint ett_ansi_ms_info_rec_reserved = -1;
349 static gint ett_ansi_enc_info = -1;
350 static gint ett_cell_list = -1;
352 #define A_VARIANT_IS634 4
353 #define A_VARIANT_TSB80 5
354 #define A_VARIANT_IS634A 6
355 #define A_VARIANT_IOS2 7
356 #define A_VARIANT_IOS3 8
357 #define A_VARIANT_IOS401 9
360 * IOS 4, probably most common
362 static gint a_global_variant = A_VARIANT_IOS401;
365 * Variables to allow for proper deletion of dissector registration when
366 * the user changes values
368 static gint a_variant = 0;
370 static char a_bigbuf[1024];
371 static gchar a_add_string[1024];
372 static dissector_handle_t data_handle;
373 static dissector_handle_t bsmap_handle;
374 static dissector_handle_t dtap_handle;
375 static dissector_table_t is637_dissector_table; /* IS-637-A Transport Layer (SMS) */
376 static dissector_table_t is683_dissector_table; /* IS-683-A (OTA) */
377 static dissector_table_t is801_dissector_table; /* IS-801 (PLD) */
378 static packet_info *g_pinfo;
379 static proto_tree *g_tree;
382 typedef struct dgt_set_t
384 unsigned char out[15];
388 static dgt_set_t Dgt_tbcd = {
390 /* 0 1 2 3 4 5 6 7 8 9 a b c d e */
391 '0','1','2','3','4','5','6','7','8','9','?','B','C','*','#'
395 static dgt_set_t Dgt_msid = {
397 /* 0 1 2 3 4 5 6 7 8 9 a b c d e */
398 '0','1','2','3','4','5','6','7','8','9','?','?','?','?','?'
405 * Unpack BCD input pattern into output ASCII pattern
407 * Input Pattern is supplied using the same format as the digits
409 * Returns: length of unpacked pattern
413 char *out, /* ASCII pattern out */
414 guchar *in, /* packed pattern in */
415 int num_octs, /* Number of octets to unpack */
416 dgt_set_t *dgt /* Digit definitions */
425 * unpack first value in byte
428 *out++ = dgt->out[i & 0x0f];
432 * unpack second value in byte
436 if (i == 0x0f) /* odd number bytes - hit filler */
439 *out++ = dgt->out[i];
450 my_match_strval(guint32 val, const value_string *vs, gint *idx)
456 if (vs[i].value == val)
459 return(vs[i].strptr);
469 /* ELEMENT FUNCTIONS */
471 #define EXTRANEOUS_DATA_CHECK(edc_len, edc_max_len) \
472 if ((edc_len) > (edc_max_len)) \
474 proto_tree_add_text(tree, tvb, \
475 curr_offset, (edc_len) - (edc_max_len), "Extraneous Data"); \
476 curr_offset += ((edc_len) - (edc_max_len)); \
479 #define SHORT_DATA_CHECK(sdc_len, sdc_min_len) \
480 if ((sdc_len) < (sdc_min_len)) \
482 proto_tree_add_text(tree, tvb, \
483 curr_offset, (sdc_len), "Short Data (?)"); \
484 curr_offset += (sdc_len); \
485 return(curr_offset - offset); \
488 #define EXACT_DATA_CHECK(edc_len, edc_eq_len) \
489 if ((edc_len) != (edc_eq_len)) \
491 proto_tree_add_text(tree, tvb, \
492 asn1->offset, (edc_len), "Unexpected Data Length"); \
493 asn1->offset += (edc_len); \
497 #define NO_MORE_DATA_CHECK(nmdc_len) \
498 if ((nmdc_len) == (curr_offset - offset)) return(nmdc_len);
505 elem_chan_num(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
511 curr_offset = offset;
513 value = tvb_get_ntohs(tvb, curr_offset);
515 proto_tree_add_text(tree,
517 "Channel Number: %u",
522 sprintf(add_string, " - (%u)", value);
524 /* no length check possible */
526 return(curr_offset - offset);
533 elem_chan_type(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
540 curr_offset = offset;
543 oct = tvb_get_guint8(tvb, curr_offset);
547 case 0: str = "No Alert"; break;
548 case 1: str = "Speech"; break;
549 case 2: str = "Data"; data = TRUE; break;
550 case 3: str = "Signaling"; break;
556 proto_tree_add_text(tree,
558 "Speech or Data Indicator: %s",
561 sprintf(add_string, " - (%s)", str);
565 NO_MORE_DATA_CHECK(len);
567 oct = tvb_get_guint8(tvb, curr_offset);
571 case 0: str = "Reserved (invalid)"; break;
572 case 1: str = "DCCH"; break;
573 case 2: str = "Reserved for future use (invalid)"; break;
574 case 8: str = "Full rate TCH channel Bm"; break;
575 case 9: str = "Half rate TCH channel Lm"; break;
581 proto_tree_add_text(tree,
583 "Channel Rate and Type: %s",
588 NO_MORE_DATA_CHECK(len);
590 oct = tvb_get_guint8(tvb, curr_offset);
594 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
595 proto_tree_add_text(tree,
600 other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
601 proto_tree_add_text(tree,
603 "%s : %sTransparent service",
605 (oct & 0x40) ? "Non-" : "");
607 other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
608 proto_tree_add_text(tree,
617 case 0: str = "No Resources Required (invalid)"; break;
618 case 1: str = "Reserved"; break;
619 case 2: str = "Reserved"; break;
620 case 3: str = "TIA/EIA-IS-2000 8 kb/s vocoder"; break;
621 case 4: str = "8 kb/s enhanced vocoder (EVRC)"; break;
622 case 5: str = "13 kb/s vocoder"; break;
623 case 6: str = "ADPCM"; break;
629 proto_tree_add_text(tree,
631 "Speech Encoding Algorithm/data rate + Transparency Indicator: %s",
637 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
639 return(curr_offset - offset);
646 elem_rf_chan_id(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
653 curr_offset = offset;
655 proto_tree_add_text(tree, tvb, curr_offset, 1,
660 oct = tvb_get_guint8(tvb, curr_offset);
662 other_decode_bitfield_value(a_bigbuf, oct, 0xfc, 8);
663 proto_tree_add_text(tree, tvb, curr_offset, 1,
667 other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
668 proto_tree_add_text(tree, tvb, curr_offset, 1,
672 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
673 proto_tree_add_text(tree, tvb, curr_offset, 1,
674 "%s : ANSI/EIA/TIA-553",
679 oct = tvb_get_guint8(tvb, curr_offset);
681 other_decode_bitfield_value(a_bigbuf, oct, 0xfc, 8);
682 proto_tree_add_text(tree, tvb, curr_offset, 1,
686 other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
687 proto_tree_add_text(tree, tvb, curr_offset, 1,
688 "%s : Timeslot Number",
693 value = tvb_get_ntohs(tvb, curr_offset);
695 other_decode_bitfield_value(a_bigbuf, value >> 8, 0xf8, 8);
696 proto_tree_add_text(tree, tvb, curr_offset, 1,
700 other_decode_bitfield_value(a_bigbuf, value >> 8, 0x07, 8);
701 proto_tree_add_text(tree, tvb, curr_offset, 1,
702 "%s : ARFCN (MSB): %u",
706 other_decode_bitfield_value(a_bigbuf, value & 0x00ff, 0xff, 8);
707 proto_tree_add_text(tree, tvb, curr_offset + 1, 1,
711 sprintf(add_string, " - (ARFCN: %u)", value & 0x07ff);
715 /* no length check possible */
717 return(curr_offset - offset);
724 elem_sid(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
730 curr_offset = offset;
732 value = tvb_get_ntohs(tvb, curr_offset);
734 other_decode_bitfield_value(a_bigbuf, value >> 8, 0x80, 8);
735 proto_tree_add_text(tree, tvb, curr_offset, 1,
739 other_decode_bitfield_value(a_bigbuf, value >> 8, 0x7f, 8);
740 proto_tree_add_text(tree, tvb, curr_offset, 1,
741 "%s : SID (MSB), %u",
745 other_decode_bitfield_value(a_bigbuf, value & 0x00ff, 0xff, 8);
746 proto_tree_add_text(tree, tvb, curr_offset + 1, 1,
750 sprintf(add_string, " - (SID: %u)", value & 0x7fff);
754 /* no length check possible */
756 return(curr_offset - offset);
763 elem_is95_chan_id(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
769 curr_offset = offset;
771 oct = tvb_get_guint8(tvb, curr_offset);
773 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
774 proto_tree_add_text(tree, tvb, curr_offset, 1,
778 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
779 proto_tree_add_text(tree, tvb, curr_offset, 1,
780 "%s : Number of Channels to Add: %u",
784 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
785 proto_tree_add_text(tree, tvb, curr_offset, 1,
786 "%s : Frame Offset: (%u), %.2f ms",
789 (oct & 0x0f) * 1.25);
793 NO_MORE_DATA_CHECK(len);
795 SHORT_DATA_CHECK(len - (curr_offset - offset), 4);
799 oct = tvb_get_guint8(tvb, curr_offset);
801 proto_tree_add_text(tree, tvb, curr_offset, 1,
802 "Walsh Code Channel Index: %u",
807 oct = tvb_get_guint8(tvb, curr_offset);
809 other_decode_bitfield_value(a_bigbuf, oct, 0xff, 8);
810 proto_tree_add_text(tree, tvb, curr_offset, 1,
811 "%s : Pilot PN Code (LSB)",
817 oct = tvb_get_guint8(tvb, curr_offset);
818 value |= ((guint32) (oct & 0x80)) << 1;
820 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
821 proto_tree_add_text(tree, tvb, curr_offset, 1,
822 "%s : Pilot PN Code (MSB): %u",
826 other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
827 proto_tree_add_text(tree, tvb, curr_offset, 1,
828 "%s : Power Combined",
831 other_decode_bitfield_value(a_bigbuf, oct, 0x20, 8);
832 proto_tree_add_text(tree, tvb, curr_offset, 1,
833 "%s : Frequency Included",
836 other_decode_bitfield_value(a_bigbuf, oct, 0x18, 8);
837 proto_tree_add_text(tree, tvb, curr_offset, 1,
841 value = tvb_get_guint8(tvb, curr_offset + 1) | ((oct & 0x07) << 8);
843 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
844 proto_tree_add_text(tree, tvb, curr_offset, 1,
845 "%s : ARFCN (MSB): %u",
851 other_decode_bitfield_value(a_bigbuf, value & 0x00ff, 0xff, 8);
852 proto_tree_add_text(tree, tvb, curr_offset, 1,
856 if (add_string[0] == '\0')
858 sprintf(add_string, " - (ARFCN: %u)", value);
863 while ((len - (curr_offset - offset)) >= 4);
865 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
867 return(curr_offset - offset);
879 elem_enc_info(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
889 curr_offset = offset;
893 while ((len - (curr_offset - offset)) >= 2)
897 oct = tvb_get_guint8(tvb, curr_offset);
899 switch ((oct & 0x7c) >> 2)
901 case 0: str = "Not Used - Invalid value"; break;
902 case 1: str = "SME Key: Signaling Message Encryption Key"; break;
903 case 2: str = "Reserved (VPM: Voice Privacy Mask)"; break;
904 case 3: str = "Reserved"; break;
905 case 4: str = "Private Longcode"; break;
906 case 5: str = "Data Key (ORYX)"; break;
907 case 6: str = "Initial RAND"; break;
914 proto_tree_add_text(tree,
916 "Encryption Info - %u: (%u) %s",
921 subtree = proto_item_add_subtree(item, ett_ansi_enc_info);
923 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
924 proto_tree_add_text(subtree, tvb, curr_offset, 1,
928 other_decode_bitfield_value(a_bigbuf, oct, 0x7c, 8);
929 proto_tree_add_text(subtree, tvb, curr_offset, 1,
930 "%s : Encryption Parameter Identifier: (%u) %s",
935 other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
936 proto_tree_add_text(subtree, tvb, curr_offset, 1,
939 (oct & 0x02) ? "active" : "inactive");
941 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
942 proto_tree_add_text(subtree, tvb, curr_offset, 1,
943 "%s : Available: algorithm is %savailable",
945 (oct & 0x01) ? "" : "not ");
949 oct_len = tvb_get_guint8(tvb, curr_offset);
951 proto_tree_add_uint(subtree, hf_ansi_a_length, tvb,
952 curr_offset, 1, oct_len);
958 SHORT_DATA_CHECK(len - (curr_offset - offset), oct_len);
960 proto_tree_add_text(subtree, tvb, curr_offset, oct_len,
961 "Encryption Parameter value");
963 curr_offset += oct_len;
967 sprintf(add_string, " - %u record%s",
968 num_recs, plurality(num_recs, "", "s"));
970 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
972 return(curr_offset - offset);
989 elem_cm_info_type_2(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
997 curr_offset = offset;
999 oct = tvb_get_guint8(tvb, curr_offset);
1001 other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
1002 proto_tree_add_text(tree, tvb, curr_offset, 1,
1003 "%s : Mobile P_REV: %u",
1007 sprintf(add_string, " - P_REV (%u)", (oct & 0xe0) >> 5);
1009 other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
1010 proto_tree_add_text(tree, tvb, curr_offset, 1,
1014 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
1015 proto_tree_add_text(tree, tvb, curr_offset, 1,
1016 "%s : See List of Entries",
1021 case 0: str = "Class 1, vehicle and portable"; break;
1022 case 1: str = "Class 2, portable"; break;
1023 case 2: str = "Class 3, handheld"; break;
1024 case 3: str = "Class 4, handheld"; break;
1025 case 4: str = "Class 5, handheld"; break;
1026 case 5: str = "Class 6, handheld"; break;
1027 case 6: str = "Class 7, handheld"; break;
1029 str = "Class 8, handheld";
1033 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
1034 proto_tree_add_text(tree, tvb, curr_offset, 1,
1035 "%s : RF Power Capability: %s",
1041 proto_tree_add_text(tree, tvb, curr_offset, 1,
1046 oct = tvb_get_guint8(tvb, curr_offset);
1048 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
1049 proto_tree_add_text(tree, tvb, curr_offset, 1,
1050 "%s : NAR_AN_CAP: N-AMPS %ssupported",
1052 (oct & 0x80) ? "" : "not ");
1054 other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
1055 proto_tree_add_text(tree, tvb, curr_offset, 1,
1056 "%s : IS-95: %ssupported",
1058 (oct & 0x40) ? "" : "not ");
1060 other_decode_bitfield_value(a_bigbuf, oct, 0x20, 8);
1061 proto_tree_add_text(tree, tvb, curr_offset, 1,
1062 "%s : Slotted: mobile is %sin slotted mode",
1064 (oct & 0x20) ? "" : "not ");
1066 other_decode_bitfield_value(a_bigbuf, oct, 0x18, 8);
1067 proto_tree_add_text(tree, tvb, curr_offset, 1,
1071 other_decode_bitfield_value(a_bigbuf, oct, 0x04, 8);
1072 proto_tree_add_text(tree, tvb, curr_offset, 1,
1073 "%s : DTX: mobile is %scapable of DTX",
1075 (oct & 0x04) ? "" : "not ");
1077 other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
1078 proto_tree_add_text(tree, tvb, curr_offset, 1,
1079 "%s : Mobile Term: mobile is %scapable of receiving incoming calls",
1081 (oct & 0x02) ? "" : "not ");
1083 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
1084 proto_tree_add_text(tree, tvb, curr_offset, 1,
1090 NO_MORE_DATA_CHECK(len);
1092 proto_tree_add_text(tree, tvb, curr_offset, 1,
1097 NO_MORE_DATA_CHECK(len);
1099 oct = tvb_get_guint8(tvb, curr_offset);
1101 other_decode_bitfield_value(a_bigbuf, oct, 0xfc, 8);
1102 proto_tree_add_text(tree, tvb, curr_offset, 1,
1106 other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
1107 proto_tree_add_text(tree, tvb, curr_offset, 1,
1108 "%s : Mobile Term: mobile is %scapable of receiving incoming calls",
1110 (oct & 0x02) ? "" : "not ");
1112 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
1113 proto_tree_add_text(tree, tvb, curr_offset, 1,
1114 "%s : PACA Supported Indicator (PSI): mobile station %s PACA",
1116 (oct & 0x01) ? "supports" : "does not support");
1120 NO_MORE_DATA_CHECK(len);
1122 oct = tvb_get_guint8(tvb, curr_offset);
1124 proto_tree_add_text(tree, tvb, curr_offset, 1,
1130 oct = tvb_get_guint8(tvb, curr_offset);
1132 proto_tree_add_text(tree, tvb, curr_offset, 1,
1133 "Station Class Mark: %u",
1138 oct = tvb_get_guint8(tvb, curr_offset);
1140 proto_tree_add_text(tree, tvb, curr_offset, 1,
1141 "Count of Band Class Entries: %u",
1146 NO_MORE_DATA_CHECK(len);
1148 oct = tvb_get_guint8(tvb, curr_offset);
1150 proto_tree_add_text(tree, tvb, curr_offset, 1,
1151 "Band Class Entry Length: %u",
1156 NO_MORE_DATA_CHECK(len);
1158 SHORT_DATA_CHECK(len - (curr_offset - offset), 3);
1163 oct = tvb_get_guint8(tvb, curr_offset);
1165 other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
1166 proto_tree_add_text(tree,
1167 tvb, curr_offset, 1,
1171 temp_int = oct & 0x1f;
1172 if ((temp_int < 0) || (temp_int >= (gint) NUM_BAND_CLASS_STR))
1178 str = band_class_str[temp_int];
1181 other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
1182 proto_tree_add_text(tree,
1183 tvb, curr_offset, 1,
1184 "%s : Band Class: %s",
1190 oct = tvb_get_guint8(tvb, curr_offset);
1192 other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
1193 proto_tree_add_text(tree,
1194 tvb, curr_offset, 1,
1198 other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
1199 proto_tree_add_text(tree,
1200 tvb, curr_offset, 1,
1201 "%s : Band Class %u Air Interfaces Supported: %u",
1208 oct = tvb_get_guint8(tvb, curr_offset);
1210 proto_tree_add_text(tree,
1211 tvb, curr_offset, 1,
1212 "Band Class %u MS Protocol Level: %u",
1220 while ((len - (curr_offset - offset)) >= 3);
1222 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
1224 return(curr_offset - offset);
1231 elem_mid(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
1236 guint32 curr_offset;
1239 curr_offset = offset;
1241 oct = tvb_get_guint8(tvb, curr_offset);
1246 other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
1247 proto_tree_add_text(tree,
1248 tvb, curr_offset, 1,
1252 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
1253 proto_tree_add_text(tree,
1254 tvb, curr_offset, 1,
1255 "%s : Type of Identity: Broadcast",
1260 oct = tvb_get_guint8(tvb, curr_offset);
1262 switch ((oct & 0xc0) >> 6)
1264 case 0: str = "Normal"; break;
1265 case 1: str = "Interactive"; break;
1266 case 2: str = "Urgent"; break;
1272 other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
1273 proto_tree_add_text(tree,
1274 tvb, curr_offset, 1,
1275 "%s : Priority: %s",
1279 other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
1280 proto_tree_add_text(tree,
1281 tvb, curr_offset, 1,
1282 "%s : Message ID: %u",
1288 oct = tvb_get_guint8(tvb, curr_offset);
1290 proto_tree_add_text(tree,
1291 tvb, curr_offset, 1,
1295 sprintf(add_string, " - Broadcast (Zone ID: %u)", oct);
1299 value = tvb_get_ntohs(tvb, curr_offset);
1303 case 0x0000: str = "Unknown or unspecified"; break;
1304 case 0x0001: str = "Emergency Broadcasts"; break;
1305 case 0x0002: str = "Administrative"; break;
1306 case 0x0003: str = "Maintenance"; break;
1307 case 0x0004: str = "General News - Local"; break;
1308 case 0x0005: str = "General News - Regional"; break;
1309 case 0x0006: str = "General News - National"; break;
1310 case 0x0007: str = "General News - International"; break;
1311 case 0x0008: str = "Business/Financial News - Local"; break;
1312 case 0x0009: str = "Business/Financial News - Regional"; break;
1313 case 0x000A: str = "Business/Financial News - National"; break;
1314 case 0x000B: str = "Business/Financial News - International"; break;
1315 case 0x000C: str = "Sports News - Local"; break;
1316 case 0x000D: str = "Sports News - Regional"; break;
1317 case 0x000E: str = "Sports News - National"; break;
1318 case 0x000F: str = "Sports News - International"; break;
1319 case 0x0010: str = "Entertainment News - Local"; break;
1320 case 0x0011: str = "Entertainment News - Regional"; break;
1321 case 0x0012: str = "Entertainment News - National"; break;
1322 case 0x0013: str = "Entertainment News - International"; break;
1323 case 0x0014: str = "Local Weather"; break;
1324 case 0x0015: str = "Area Traffic Reports"; break;
1325 case 0x0016: str = "Local Airport Flight Schedules"; break;
1326 case 0x0017: str = "Restaurants"; break;
1327 case 0x0018: str = "Lodgings"; break;
1328 case 0x0019: str = "Retail Directory"; break;
1329 case 0x001A: str = "Advertisements"; break;
1330 case 0x001B: str = "Stock Quotes"; break;
1331 case 0x001C: str = "Employment Opportunities"; break;
1332 case 0x001D: str = "Medical/Health/Hospitals"; break;
1333 case 0x001E: str = "Technology News"; break;
1334 case 0x001F: str = "Multi-category"; break;
1336 if ((value >= 0x0020) && (value <= 0x8000)) { str = "Reserved for standard service categories"; }
1337 else { str = "Reserved for proprietary service categories"; }
1341 proto_tree_add_text(tree,
1342 tvb, curr_offset, 2,
1349 oct = tvb_get_guint8(tvb, curr_offset);
1353 case 0: str = "Unknown or unspecified"; break;
1354 case 1: str = "English"; break;
1355 case 2: str = "French"; break;
1356 case 3: str = "Spanish"; break;
1357 case 4: str = "Japanese"; break;
1358 case 5: str = "Korean"; break;
1359 case 6: str = "Chinese"; break;
1360 case 7: str = "Hebrew"; break;
1366 proto_tree_add_text(tree,
1367 tvb, curr_offset, 1,
1368 "Language: (%u) %s",
1376 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
1377 proto_tree_add_text(tree,
1378 tvb, curr_offset, 1,
1382 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
1383 proto_tree_add_text(tree,
1384 tvb, curr_offset, 1,
1385 "%s : Odd/Even Indicator: %s",
1387 (oct & 0x08) ? "ODD" : "EVEN");
1389 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
1390 proto_tree_add_text(tree,
1391 tvb, curr_offset, 1,
1392 "%s : Type of Identity: No Identity Code",
1395 strcpy(add_string, " - No Identity Code");
1401 proto_tree_add_text(tree, tvb, curr_offset, len - 1,
1402 "Format not supported");
1405 curr_offset += len - 1;
1415 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
1416 proto_tree_add_text(tree,
1417 tvb, curr_offset, 1,
1418 "%s : Identity Digit 1: %c",
1420 Dgt_msid.out[(oct & 0xf0) >> 4]);
1422 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
1423 proto_tree_add_text(tree,
1424 tvb, curr_offset, 1,
1425 "%s : Odd/Even Indicator: %s",
1427 (oct & 0x08) ? "ODD" : "EVEN");
1429 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
1430 proto_tree_add_text(tree,
1431 tvb, curr_offset, 1,
1432 "%s : Type of Identity: %s",
1434 ((oct & 0x07) == 1) ? "MIN" : "IMSI");
1436 a_bigbuf[0] = Dgt_msid.out[(oct & 0xf0) >> 4];
1439 poctets = tvb_get_string(tvb, curr_offset, len - (curr_offset - offset));
1441 my_dgt_tbcd_unpack(&a_bigbuf[1], poctets, len - (curr_offset - offset),
1445 proto_tree_add_string_format(tree,
1446 ((oct & 0x07) == 1) ? hf_ansi_a_min : hf_ansi_a_imsi,
1447 tvb, curr_offset, len - (curr_offset - offset),
1452 sprintf(add_string, " - %s (%s)",
1453 ((oct & 0x07) == 1) ? "MIN" : "IMSI",
1456 curr_offset += len - (curr_offset - offset);
1460 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
1461 proto_tree_add_text(tree,
1462 tvb, curr_offset, 1,
1466 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
1467 proto_tree_add_text(tree,
1468 tvb, curr_offset, 1,
1469 "%s : Odd/Even Indicator: %s",
1471 (oct & 0x08) ? "ODD" : "EVEN");
1473 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
1474 proto_tree_add_text(tree,
1475 tvb, curr_offset, 1,
1476 "%s : Type of Identity: Interface Directory Number",
1479 strcpy(add_string, " - Interface Directory Number");
1485 proto_tree_add_text(tree, tvb, curr_offset, len - 1,
1486 "Format not supported");
1489 curr_offset += len - 1;
1493 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
1494 proto_tree_add_text(tree,
1495 tvb, curr_offset, 1,
1499 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
1500 proto_tree_add_text(tree,
1501 tvb, curr_offset, 1,
1502 "%s : Odd/Even Indicator: %s",
1504 (oct & 0x08) ? "ODD" : "EVEN");
1506 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
1507 proto_tree_add_text(tree,
1508 tvb, curr_offset, 1,
1509 "%s : Type of Identity: TMSI",
1512 strcpy(add_string, " - TMSI");
1518 proto_tree_add_text(tree, tvb, curr_offset, len - 1,
1519 "Format not supported");
1522 curr_offset += len - 1;
1526 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
1527 proto_tree_add_text(tree,
1528 tvb, curr_offset, 1,
1532 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
1533 proto_tree_add_text(tree,
1534 tvb, curr_offset, 1,
1535 "%s : Odd/Even Indicator: %s",
1537 (oct & 0x08) ? "ODD" : "EVEN");
1539 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
1540 proto_tree_add_text(tree,
1541 tvb, curr_offset, 1,
1542 "%s : Type of Identity: ESN",
1547 value = tvb_get_ntohl(tvb, curr_offset);
1549 proto_tree_add_uint(tree, hf_ansi_a_esn,
1550 tvb, curr_offset, 4,
1553 sprintf(add_string, " - ESN (0x%04x)", value);
1559 proto_tree_add_text(tree, tvb, curr_offset, len,
1562 strcpy(add_string, " - Format Unknown");
1568 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
1570 return(curr_offset - offset);
1577 elem_sci(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
1580 guint32 curr_offset;
1583 curr_offset = offset;
1585 oct = tvb_get_guint8(tvb, curr_offset);
1587 other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
1588 proto_tree_add_text(tree,
1589 tvb, curr_offset, 1,
1593 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
1594 proto_tree_add_text(tree,
1595 tvb, curr_offset, 1,
1596 "%s : Slot Cycle Index: %u",
1600 sprintf(add_string, " - (%u)", oct & 0x07);
1604 /* no length check possible */
1606 return(curr_offset - offset);
1613 elem_prio(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
1616 guint32 curr_offset;
1618 curr_offset = offset;
1620 oct = tvb_get_guint8(tvb, curr_offset);
1622 other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
1623 proto_tree_add_text(tree,
1624 tvb, curr_offset, 1,
1628 other_decode_bitfield_value(a_bigbuf, oct, 0x3c, 8);
1629 proto_tree_add_text(tree,
1630 tvb, curr_offset, 1,
1631 "%s : Call Priority Level: %u",
1635 other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
1636 proto_tree_add_text(tree,
1637 tvb, curr_offset, 1,
1638 "%s : Queuing %sallowed",
1640 (oct & 0x02) ? "" : "not ");
1642 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
1643 proto_tree_add_text(tree,
1644 tvb, curr_offset, 1,
1645 "%s : Preemption %sallowed",
1647 (oct & 0x01) ? "" : "not ");
1649 sprintf(add_string, " - (%u)", (oct & 0x3c) >> 2);
1653 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
1655 return(curr_offset - offset);
1662 elem_cause(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
1666 guint32 curr_offset;
1669 curr_offset = offset;
1671 oct = tvb_get_guint8(tvb, curr_offset);
1673 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
1674 proto_tree_add_text(tree,
1675 tvb, curr_offset, 1,
1683 if ((oct & 0x0f) == 0x00)
1685 /* national cause */
1686 switch ((oct & 0x70) >> 4)
1688 case 0: str = "Normal Event"; break;
1689 case 1: str = "Normal Event"; break;
1690 case 2: str = "Resource Unavailable"; break;
1691 case 3: str = "Service or option not available"; break;
1692 case 4: str = "Service or option not implemented"; break;
1693 case 5: str = "Invalid message (e.g., parameter out of range)"; break;
1694 case 6: str = "Protocol error"; break;
1696 str = "Interworking";
1700 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
1701 proto_tree_add_text(tree,
1702 tvb, curr_offset, 1,
1703 "%s : Cause Class: %s",
1707 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
1708 proto_tree_add_text(tree,
1709 tvb, curr_offset, 1,
1710 "%s : National Cause",
1715 proto_tree_add_text(tree, tvb, curr_offset, 1,
1720 strcpy(add_string, " - (National Cause)");
1724 value = tvb_get_guint8(tvb, curr_offset + 1);
1726 other_decode_bitfield_value(a_bigbuf, oct, 0x7f, 8);
1727 proto_tree_add_text(tree,
1728 tvb, curr_offset, 1,
1729 "%s : Cause (MSB): %u",
1731 ((oct & 0x7f) << 8) | value);
1735 other_decode_bitfield_value(a_bigbuf, value, 0xff, 8);
1736 proto_tree_add_text(tree, tvb, curr_offset, 1,
1747 case 0x00: str = "Radio interface message failure"; break;
1748 case 0x01: str = "Radio interface failure"; break;
1749 case 0x02: str = "Uplink Quality"; break;
1750 case 0x03: str = "Uplink strength"; break;
1751 case 0x04: str = "Downlink quality"; break;
1752 case 0x05: str = "Downlink strength"; break;
1753 case 0x06: str = "Distance"; break;
1754 case 0x07: str = "OAM&P intervention"; break;
1755 case 0x08: str = "MS busy"; break;
1756 case 0x09: str = "Call processing"; break;
1757 case 0x0A: str = "Reversion to old channel"; break;
1758 case 0x0B: str = "Handoff successful"; break;
1759 case 0x0C: str = "No response from MS"; break;
1760 case 0x0D: str = "Timer expired"; break;
1761 case 0x0E: str = "Better cell (power budget)"; break;
1762 case 0x0F: str = "Interference"; break;
1763 case 0x10: str = "Packet call going dormant"; break;
1764 case 0x11: str = "Service option not available"; break;
1765 case 0x12: str = "Invalid Call"; break;
1766 case 0x13: str = "Successful operation"; break;
1767 case 0x14: str = "Normal call release"; break;
1768 case 0x1B: str = "Inter-BS Soft Handoff Drop Target"; break;
1769 case 0x1D: str = "Intra-BS Soft Handoff Drop Target"; break;
1770 case 0x20: str = "Equipment failure"; break;
1771 case 0x21: str = "No radio resource available"; break;
1772 case 0x22: str = "Requested terrestrial resource unavailable"; break;
1773 case 0x25: str = "BS not equipped"; break;
1774 case 0x26: str = "MS not equipped (or incapable)"; break;
1775 case 0x29: str = "PACA Call Queued"; break;
1776 case 0x2B: str = "Alternate signaling type reject"; break;
1777 case 0x2D: str = "PACA Queue Overflow"; break;
1778 case 0x2E: str = "PACA Cancel Request Rejected"; break;
1779 case 0x30: str = "Requested transcoding/rate adaptation unavailable"; break;
1780 case 0x31: str = "Lower priority radio resources not available"; break;
1781 case 0x32: str = "PCF resources not available"; break;
1782 case 0x33: str = "TFO Control request Failed"; break;
1783 case 0x40: str = "Ciphering algorithm not supported"; break;
1784 case 0x41: str = "Private Long Code not available or not supported."; break;
1785 case 0x42: str = "Requested MUX option or rates not available."; break;
1786 case 0x43: str = "Requested Privacy Configuration unavailable"; break;
1787 case 0x4F: str = "Terrestrial circuit already allocated.a"; break;
1788 case 0x50: str = "Terrestrial circuit already allocated"; break;
1789 case 0x5F: str = "Protocol Error between BS and MSC.a"; break;
1790 case 0x60: str = "Protocol Error between BS and MSC"; break;
1791 case 0x71: str = "ADDS message too long for delivery on the paging channel"; break;
1792 case 0x72: str = "MS-to-IWF TCP connection failure"; break;
1793 case 0x73: str = "ATH0 (Modem hang up) Command"; break;
1794 case 0x74: str = "+FSH/+FHNG (Fax session ended) Command"; break;
1795 case 0x75: str = "No carrier"; break;
1796 case 0x76: str = "PPP protocol failure"; break;
1797 case 0x77: str = "PPP session closed by the MS"; break;
1798 case 0x78: str = "Do not notify MS"; break;
1799 case 0x79: str = "PDSN resources are not available"; break;
1800 case 0x7A: str = "Data ready to send"; break;
1801 case 0x7F: str = "Handoff procedure time-out"; break;
1803 str = "Reserved for future use";
1807 other_decode_bitfield_value(a_bigbuf, oct, 0x7f, 8);
1808 proto_tree_add_text(tree,
1809 tvb, curr_offset, 1,
1810 "%s : Cause: (%u) %s",
1817 sprintf(add_string, " - (%u) %s", oct & 0x7f, str);
1820 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
1822 return(curr_offset - offset);
1827 * Formats everything after the discriminator, shared function.
1830 elem_cell_id_aux(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, guint8 disc)
1835 guint32 curr_offset;
1837 curr_offset = offset;
1842 value = tvb_get_ntohs(tvb, curr_offset);
1844 proto_tree_add_uint(tree, hf_ansi_a_cell_ci, tvb,
1845 curr_offset, 2, value);
1849 sprintf(add_string, " - CI (%u)", value);
1853 value = tvb_get_ntohs(tvb, curr_offset);
1855 proto_tree_add_uint(tree, hf_ansi_a_cell_lac, tvb,
1856 curr_offset, 2, value);
1860 sprintf(add_string, " - LAC (%u)", value);
1864 market_id = tvb_get_ntohs(tvb, curr_offset);
1865 switch_num = tvb_get_guint8(tvb, curr_offset + 2);
1867 value = tvb_get_ntoh24(tvb, curr_offset);
1869 proto_tree_add_uint_hidden(tree, hf_ansi_a_cell_mscid, tvb,
1870 curr_offset, 3, value);
1872 proto_tree_add_text(tree, tvb, curr_offset, 3,
1873 "Market ID %u Switch Number %u",
1874 market_id, switch_num);
1878 value = tvb_get_ntohs(tvb, curr_offset);
1880 proto_tree_add_uint(tree, hf_ansi_a_cell_ci, tvb,
1881 curr_offset, 2, value);
1885 sprintf(add_string, " - Market ID (%u) Switch Number (%u) CI (%u)",
1892 proto_tree_add_text(tree, tvb, curr_offset, len - 1,
1893 "Cell ID - Non IOS format");
1895 curr_offset += (len - 1);
1899 return(curr_offset - offset);
1903 elem_cell_id(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
1906 guint32 curr_offset;
1910 add_string = add_string;
1911 curr_offset = offset;
1913 oct = tvb_get_guint8(tvb, curr_offset);
1915 if (oct >= (gint) NUM_CELL_DISC_STR)
1921 str = cell_disc_str[oct];
1924 proto_tree_add_text(tree,
1925 tvb, curr_offset, 1,
1926 "Cell Identification Discriminator: (%u) %s",
1933 elem_cell_id_aux(tvb, tree, curr_offset, len - (curr_offset - offset), add_string, oct);
1935 /* no length check possible */
1937 return(curr_offset - offset);
1944 elem_cell_id_list(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
1949 guint32 curr_offset;
1950 proto_item *item = NULL;
1951 proto_tree *subtree = NULL;
1954 curr_offset = offset;
1956 oct = tvb_get_guint8(tvb, curr_offset);
1958 if (oct >= (gint) NUM_CELL_DISC_STR)
1964 str = cell_disc_str[oct];
1967 proto_tree_add_text(tree,
1968 tvb, curr_offset, 1,
1969 "Cell Identification Discriminator: (%u) %s",
1975 NO_MORE_DATA_CHECK(len);
1981 proto_tree_add_text(tree,
1982 tvb, curr_offset, -1,
1986 subtree = proto_item_add_subtree(item, ett_cell_list);
1988 add_string[0] = '\0';
1990 elem_cell_id_aux(tvb, subtree, curr_offset, len - (curr_offset - offset), add_string, oct);
1992 if (add_string[0] != '\0')
1994 proto_item_append_text(item, add_string);
1997 proto_item_set_len(item, consumed);
1999 curr_offset += consumed;
2003 while ((len - (curr_offset - offset)) > 0);
2005 sprintf(add_string, " - %u cell%s",
2006 num_cells, plurality(num_cells, "", "s"));
2008 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2010 return(curr_offset - offset);
2017 elem_cic(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
2020 guint32 curr_offset;
2023 curr_offset = offset;
2025 value = tvb_get_ntohs(tvb, curr_offset);
2027 other_decode_bitfield_value(a_bigbuf, value, 0xffe0, 16);
2028 proto_tree_add_text(tree,
2029 tvb, curr_offset, 2,
2030 "%s : PCM Multiplexer: %u",
2032 (value & 0xffe0) >> 5);
2034 other_decode_bitfield_value(a_bigbuf, value, 0x001f, 16);
2035 proto_tree_add_text(tree,
2036 tvb, curr_offset, 2,
2037 "%s : Timeslot: %u",
2043 sprintf(add_string, " - (%u) (0x%04x)", value, value);
2045 /* no length check possible */
2047 return(curr_offset - offset);
2054 elem_cic_ext(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
2058 guint32 curr_offset;
2062 curr_offset = offset;
2064 value = tvb_get_ntohs(tvb, curr_offset);
2066 other_decode_bitfield_value(a_bigbuf, value, 0xffe0, 16);
2067 proto_tree_add_text(tree,
2068 tvb, curr_offset, 2,
2069 "%s : PCM Multiplexer: %u",
2071 (value & 0xffe0) >> 5);
2073 other_decode_bitfield_value(a_bigbuf, value, 0x001f, 16);
2074 proto_tree_add_text(tree,
2075 tvb, curr_offset, 2,
2076 "%s : Timeslot: %u",
2082 sprintf(add_string, " - (%u) (0x%04x)", value, value);
2084 oct = tvb_get_guint8(tvb, curr_offset);
2086 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
2087 proto_tree_add_text(tree,
2088 tvb, curr_offset, 1,
2094 case 0x00: str = "Full-rate"; break;
2100 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
2101 proto_tree_add_text(tree,
2102 tvb, curr_offset, 1,
2103 "%s : Circuit Mode: %s",
2109 /* no length check possible */
2111 return(curr_offset - offset);
2119 #define ANSI_A_CELL_ID_LEN(_disc) ((_disc == 7) ? 5 : 2)
2125 elem_downlink_re(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
2132 guint32 curr_offset;
2133 proto_item *item = NULL;
2134 proto_tree *subtree = NULL;
2137 curr_offset = offset;
2139 oct = tvb_get_guint8(tvb, curr_offset);
2141 proto_tree_add_text(tree, tvb, curr_offset, 1,
2142 "Number of Cells: %u",
2147 NO_MORE_DATA_CHECK(len);
2149 disc = tvb_get_guint8(tvb, curr_offset);
2151 if (disc >= (gint) NUM_CELL_DISC_STR)
2157 str = cell_disc_str[disc];
2160 proto_tree_add_text(tree,
2161 tvb, curr_offset, 1,
2162 "Cell Identification Discriminator: (%u) %s",
2168 NO_MORE_DATA_CHECK(len);
2170 SHORT_DATA_CHECK(len - (curr_offset - offset), (guint32) 3 + ANSI_A_CELL_ID_LEN(disc));
2177 proto_tree_add_text(tree,
2178 tvb, curr_offset, -1,
2182 subtree = proto_item_add_subtree(item, ett_cell_list);
2184 add_string[0] = '\0';
2186 elem_cell_id_aux(tvb, subtree, curr_offset,
2187 len - (curr_offset - offset), add_string, disc);
2189 if (add_string[0] != '\0')
2191 proto_item_append_text(item, add_string);
2194 proto_item_set_len(item, consumed);
2196 curr_offset += consumed;
2198 oct = tvb_get_guint8(tvb, curr_offset);
2200 other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
2201 proto_tree_add_text(tree, tvb, curr_offset, 1,
2205 other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
2206 proto_tree_add_text(tree, tvb, curr_offset, 1,
2207 "%s : Downlink Signal Strength Raw: %u",
2213 value = tvb_get_ntohs(tvb, curr_offset);
2215 proto_tree_add_text(tree,
2216 tvb, curr_offset, 2,
2217 "CDMA Target One Way Delay: %u",
2224 while ((len - (curr_offset - offset)) >= (guint32) (3 + ANSI_A_CELL_ID_LEN(disc)));
2226 sprintf(add_string, " - %u cell%s",
2227 num_cells, plurality(num_cells, "", "s"));
2229 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2231 return(curr_offset - offset);
2258 elem_pdsn_ip_addr(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
2260 guint32 curr_offset;
2262 add_string = add_string;
2263 curr_offset = offset;
2265 proto_tree_add_item(tree, hf_ansi_a_pdsn_ip_addr, tvb, curr_offset, len, FALSE);
2268 proto_tree_add_text(tree, tvb, curr_offset, len,
2274 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2276 return(curr_offset - offset);
2283 elem_ho_pow_lev(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
2288 proto_item *item = NULL;
2289 proto_tree *subtree = NULL;
2290 guint32 curr_offset;
2292 curr_offset = offset;
2294 oct = tvb_get_guint8(tvb, curr_offset);
2296 proto_tree_add_text(tree, tvb, curr_offset, 1,
2297 "Number of Cells: %u",
2302 SHORT_DATA_CHECK(len - (curr_offset - offset), (guint32) 6);
2304 oct = tvb_get_guint8(tvb, curr_offset);
2306 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
2307 proto_tree_add_text(tree, tvb, curr_offset, 1,
2311 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
2312 proto_tree_add_text(tree, tvb, curr_offset, 1,
2317 other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
2318 proto_tree_add_text(tree, tvb, curr_offset, 1,
2319 "%s : Handoff Power Level: %u",
2326 proto_tree_add_text(tree,
2327 tvb, curr_offset, -1,
2330 subtree = proto_item_add_subtree(item, ett_cell_list);
2332 add_string[0] = '\0';
2334 elem_cell_id_aux(tvb, subtree, curr_offset,
2335 len - (curr_offset - offset), add_string, 0x7);
2337 if (add_string[0] != '\0')
2339 proto_item_append_text(item, add_string);
2342 proto_item_set_len(item, consumed);
2344 curr_offset += consumed;
2348 while ((len - (curr_offset - offset)) >= 3)
2352 oct = tvb_get_guint8(tvb, curr_offset);
2354 other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
2355 proto_tree_add_text(tree, tvb, curr_offset, 1,
2359 other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
2360 proto_tree_add_text(tree, tvb, curr_offset, 1,
2361 "%s : Handoff Power Level: %u",
2368 proto_tree_add_text(tree,
2369 tvb, curr_offset, -1,
2373 subtree = proto_item_add_subtree(item, ett_cell_list);
2375 add_string[0] = '\0';
2377 elem_cell_id_aux(tvb, subtree, curr_offset,
2378 len - (curr_offset - offset), add_string, 0x2);
2380 if (add_string[0] != '\0')
2382 proto_item_append_text(item, add_string);
2385 proto_item_set_len(item, consumed);
2387 curr_offset += consumed;
2390 sprintf(add_string, " - %u cell%s",
2391 num_cells, plurality(num_cells, "", "s"));
2393 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2395 return(curr_offset - offset);
2402 elem_uz_id(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
2405 guint32 curr_offset;
2407 curr_offset = offset;
2409 value = tvb_get_ntohs(tvb, curr_offset);
2411 proto_tree_add_text(tree, tvb, curr_offset, 2,
2417 sprintf(add_string, " - (%u)", value);
2419 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2421 return(curr_offset - offset);
2433 elem_is2000_chan_id(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
2438 guint32 curr_offset;
2441 add_string = add_string;
2442 curr_offset = offset;
2444 oct = tvb_get_guint8(tvb, curr_offset);
2446 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
2447 proto_tree_add_text(tree, tvb, curr_offset, 1,
2448 "%s : OTD: Mobile will %sbe using OTD",
2450 (oct & 0x80) ? "" : "not ");
2452 num_chan = (oct & 0x70) >> 4;
2454 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
2455 proto_tree_add_text(tree, tvb, curr_offset, 1,
2456 "%s : Channel Count: %u",
2460 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
2461 proto_tree_add_text(tree, tvb, curr_offset, 1,
2462 "%s : Frame Offset: (%u), %.2f ms",
2465 (oct & 0x0f) * 1.25);
2469 NO_MORE_DATA_CHECK(len);
2471 SHORT_DATA_CHECK(len - (curr_offset - offset), 6);
2475 oct = tvb_get_guint8(tvb, curr_offset);
2479 case 0x01: str = "Fundamental Channel (FCH) TIA/EIA/IS-2000"; break;
2480 case 0x02: str = "Dedicated Control Channel (DCCH) TIA/EIA/IS-2000"; break;
2481 case 0x03: str = "Supplemental Channel (SCH) TIA/EIA/IS-2000"; break;
2483 if ((oct >= 0x80) && (oct <= 0x9f)) { str = "Reserved for UMTS"; }
2484 else { str = "Reserved"; }
2488 proto_tree_add_text(tree, tvb, curr_offset, 1,
2489 "Physical Channel Type: %s",
2494 oct = tvb_get_guint8(tvb, curr_offset);
2496 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
2497 proto_tree_add_text(tree, tvb, curr_offset, 1,
2501 switch ((oct & 0x60) >> 5)
2503 case 0: str = "Gating rate 1"; break;
2504 case 1: str = "Gating rate 1/2"; break;
2505 case 2: str = "Gating rate 1/4"; break;
2511 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
2512 proto_tree_add_text(tree, tvb, curr_offset, 1,
2513 "%s : Pilot Gating Rate: %s",
2517 other_decode_bitfield_value(a_bigbuf, oct, 0x18, 8);
2518 proto_tree_add_text(tree, tvb, curr_offset, 1,
2522 value = tvb_get_guint8(tvb, curr_offset + 1);
2524 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
2525 proto_tree_add_text(tree, tvb, curr_offset, 1,
2526 "%s : Walsh Code Channel Index (MSB): %u",
2528 ((guint32) (oct & 0x07) << 8) | value);
2532 other_decode_bitfield_value(a_bigbuf, value, 0xff, 8);
2533 proto_tree_add_text(tree, tvb, curr_offset, 1,
2534 "%s : Walsh Code Channel Index (LSB)",
2539 oct = tvb_get_guint8(tvb, curr_offset);
2541 other_decode_bitfield_value(a_bigbuf, oct, 0xff, 8);
2542 proto_tree_add_text(tree, tvb, curr_offset, 1,
2543 "%s : Pilot PN Code (LSB)",
2549 oct = tvb_get_guint8(tvb, curr_offset);
2550 value |= ((guint32) (oct & 0x80)) << 1;
2552 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
2553 proto_tree_add_text(tree, tvb, curr_offset, 1,
2554 "%s : Pilot PN Code (MSB): %u",
2558 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
2559 proto_tree_add_text(tree, tvb, curr_offset, 1,
2563 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
2564 proto_tree_add_text(tree, tvb, curr_offset, 1,
2565 "%s : Frequency Included",
2568 value = tvb_get_guint8(tvb, curr_offset + 1) | ((oct & 0x07) << 8);
2570 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
2571 proto_tree_add_text(tree, tvb, curr_offset, 1,
2572 "%s : ARFCN (MSB): %u",
2578 other_decode_bitfield_value(a_bigbuf, value & 0x00ff, 0xff, 8);
2579 proto_tree_add_text(tree, tvb, curr_offset, 1,
2585 while ((len - (curr_offset - offset)) >= 6);
2587 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2589 return(curr_offset - offset);
2594 * NO ASSOCIATED DATA
2601 elem_is95_ms_meas_chan_id(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
2606 guint32 curr_offset;
2609 curr_offset = offset;
2611 oct = tvb_get_guint8(tvb, curr_offset);
2613 temp_int = (oct & 0xf8) >> 3;
2614 if ((temp_int < 0) || (temp_int >= (gint) NUM_BAND_CLASS_STR))
2620 str = band_class_str[temp_int];
2623 other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
2624 proto_tree_add_text(tree,
2625 tvb, curr_offset, 1,
2626 "%s : Band Class: %s",
2630 value = tvb_get_guint8(tvb, curr_offset + 1) | ((oct & 0x07) << 8);
2632 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
2633 proto_tree_add_text(tree, tvb, curr_offset, 1,
2634 "%s : ARFCN (MSB): %u",
2640 other_decode_bitfield_value(a_bigbuf, value & 0x00ff, 0xff, 8);
2641 proto_tree_add_text(tree, tvb, curr_offset, 1,
2645 sprintf(add_string, " - (ARFCN: %u)", value);
2649 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2651 return(curr_offset - offset);
2658 elem_clg_party_ascii_num(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
2661 guint32 curr_offset;
2665 curr_offset = offset;
2667 oct = tvb_get_guint8(tvb, curr_offset);
2669 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
2670 proto_tree_add_text(tree, tvb, curr_offset, 1,
2671 "%s : Extension: %s",
2673 (oct & 0x80) ? "Not extended" : "Extended");
2675 switch ((oct & 0x70) >> 4)
2677 case 0: str = "Unknown"; break;
2678 case 1: str = "International number"; break;
2679 case 2: str = "National number"; break;
2680 case 3: str = "Network-specific number"; break;
2681 case 4: str = "Dedicated PAD access, short code"; break;
2682 case 5: str = "Reserved"; break;
2683 case 6: str = "Reserved"; break;
2685 str = "Reserved for extension";
2689 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
2690 proto_tree_add_text(tree, tvb, curr_offset, 1,
2691 "%s : Type of Number: %s",
2697 case 0x00: str = "Unknown"; break;
2698 case 0x01: str = "ISDN/Telephony Numbering (ITU recommendation E.164/E.163)"; break;
2699 case 0x03: str = "Data Numbering (ITU-T Rec. X.121)"; break;
2700 case 0x04: str = "Telex Numbering (ITU-T Rec. F.69)"; break;
2701 case 0x07: str = "Reserved for extension"; break;
2702 case 0x08: str = "National Numbering"; break;
2703 case 0x09: str = "Private Numbering"; break;
2709 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
2710 proto_tree_add_text(tree, tvb, curr_offset, 1,
2711 "%s : Number Plan Identification: %s",
2721 oct = tvb_get_guint8(tvb, curr_offset);
2723 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
2724 proto_tree_add_text(tree, tvb, curr_offset, 1,
2728 switch ((oct & 0x60) >> 5)
2730 case 0: str = "Presentation allowed"; break;
2731 case 1: str = "Presentation restricted"; break;
2732 case 2: str = "Number not available due to interworking"; break;
2738 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
2739 proto_tree_add_text(tree, tvb, curr_offset, 1,
2740 "%s : Presentation Indicator: %s",
2746 case 0: str = "User-provided, not screened"; break;
2747 case 1: str = "User-provided, verified and passed"; break;
2748 case 2: str = "User-provided, verified and failed"; break;
2750 str = "Network-provided";
2754 other_decode_bitfield_value(a_bigbuf, oct, 0x1c, 8);
2755 proto_tree_add_text(tree, tvb, curr_offset, 1,
2759 other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
2760 proto_tree_add_text(tree, tvb, curr_offset, 1,
2761 "%s : Screening Indicator: %s",
2768 poctets = tvb_get_string(tvb, curr_offset, len - (curr_offset - offset));
2770 proto_tree_add_string_format(tree, hf_ansi_a_clg_party_ascii_num,
2771 tvb, curr_offset, len - (curr_offset - offset),
2775 curr_offset += len - (curr_offset - offset);
2777 sprintf(add_string, " - (%s)", poctets);
2780 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2782 return(curr_offset - offset);
2789 elem_l3_info(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
2791 guint32 curr_offset;
2794 add_string = add_string;
2795 curr_offset = offset;
2797 proto_tree_add_text(tree, tvb, curr_offset, len,
2798 "Layer 3 Information");
2801 * dissect the embedded DTAP message
2803 l3_tvb = tvb_new_subset(tvb, curr_offset, len, len);
2805 call_dissector(dtap_handle, l3_tvb, g_pinfo, g_tree);
2809 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2811 return(curr_offset - offset);
2816 * Protocol Discriminator
2826 * Location Updating Type
2832 * Simple data no decode required
2839 elem_lai(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
2843 guint32 curr_offset;
2848 add_string = add_string;
2849 curr_offset = offset;
2851 oct = tvb_get_guint8(tvb, curr_offset);
2853 mcc[0] = Dgt_tbcd.out[oct & 0x0f];
2854 mcc[1] = Dgt_tbcd.out[(oct & 0xf0) >> 4];
2856 oct = tvb_get_guint8(tvb, curr_offset+1);
2858 mcc[2] = Dgt_tbcd.out[(oct & 0x0f)];
2861 mnc[2] = Dgt_tbcd.out[(oct & 0xf0) >> 4];
2863 oct = tvb_get_guint8(tvb, curr_offset+2);
2865 mnc[0] = Dgt_tbcd.out[(oct & 0x0f)];
2866 mnc[1] = Dgt_tbcd.out[(oct & 0xf0) >> 4];
2869 proto_tree_add_text(tree,
2870 tvb, curr_offset, 3,
2871 "Mobile Country Code (MCC): %s, Mobile Network Code (MNC): %s",
2877 value = tvb_get_ntohs(tvb, curr_offset);
2879 proto_tree_add_text(tree,
2880 tvb, curr_offset, 2,
2881 "Location Area Code (LAC): 0x%04x (%u)",
2887 /* no length check possible */
2889 return(curr_offset - offset);
2896 elem_rej_cause(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
2899 guint32 curr_offset;
2903 curr_offset = offset;
2905 oct = tvb_get_guint8(tvb, curr_offset);
2909 case 0x01: str = "Reserved"; break;
2910 case 0x02: str = "MIN/IMSI unknown in HLR"; break;
2911 case 0x03: str = "Illegal MS"; break;
2912 case 0x04: str = "TMSI/IMSI/MIN unknown in VLR"; break;
2913 case 0x05: str = "Reserved"; break;
2914 case 0x0b: str = "Roaming not allowed"; break;
2915 case 0x0c: str = "Location area not allowed"; break;
2916 case 0x20: str = "Service option not supported"; break;
2917 case 0x21: str = "Requested service option not subscribed"; break;
2918 case 0x22: str = "Service option temporarily out of order"; break;
2919 case 0x26: str = "Call cannot be identified"; break;
2920 case 0x51: str = "Network failure"; break;
2921 case 0x56: str = "Congestion"; break;
2922 case 0x62: str = "Message type non-existent or not implemented"; break;
2923 case 0x63: str = "Information element non-existent or not implemented"; break;
2924 case 0x64: str = "Invalid information element contents"; break;
2925 case 0x65: str = "Message not compatible with the call state"; break;
2926 case 0x66: str = "Protocol error, unspecified"; break;
2927 case 0x6e: str = "Invalid message, unspecified"; break;
2928 case 0x6f: str = "Mandatory information element error"; break;
2934 proto_tree_add_text(tree,
2935 tvb, curr_offset, 1,
2936 "Reject Cause Value: (%u) %s",
2942 sprintf(add_string, " - (%s)", str);
2944 /* no length check possible */
2946 return(curr_offset - offset);
2953 elem_auth_chlg_param(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
2956 guint32 curr_offset;
2959 curr_offset = offset;
2961 oct = tvb_get_guint8(tvb, curr_offset);
2963 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
2964 proto_tree_add_text(tree,
2965 tvb, curr_offset, 1,
2971 case 1: str = "RAND 32 bits"; break;
2972 case 2: str = "RANDU 24 bits"; break;
2973 case 4: str = "RANDSSD 56 bits"; break;
2974 case 8: str = "RANDBS 32 bits"; break;
2980 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
2981 proto_tree_add_text(tree,
2982 tvb, curr_offset, 1,
2983 "%s : Random Number Type: (%u) %s",
2990 proto_tree_add_text(tree,
2991 tvb, curr_offset, len - (curr_offset - offset),
2992 "RAND/RANDU/RANDBS/RANDSSD Value");
2994 sprintf(add_string, " - (%s)", str);
2996 curr_offset += len - (curr_offset - offset);
2998 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3000 return(curr_offset - offset);
3007 elem_auth_resp_param(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
3010 guint32 curr_offset;
3013 curr_offset = offset;
3015 oct = tvb_get_guint8(tvb, curr_offset);
3017 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
3018 proto_tree_add_text(tree,
3019 tvb, curr_offset, 1,
3025 case 1: str = "AUTHR"; break;
3026 case 2: str = "AUTHU"; break;
3027 case 4: str = "AUTHBS"; break;
3033 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
3034 proto_tree_add_text(tree,
3035 tvb, curr_offset, 1,
3036 "%s : Auth Signature Type: (%u) %s",
3043 proto_tree_add_text(tree,
3044 tvb, curr_offset, len - (curr_offset - offset),
3047 sprintf(add_string, " - (%s)", str);
3049 curr_offset += len - (curr_offset - offset);
3051 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3053 return(curr_offset - offset);
3060 elem_auth_param_count(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
3063 guint32 curr_offset;
3066 curr_offset = offset;
3068 oct = tvb_get_guint8(tvb, curr_offset);
3070 other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
3071 proto_tree_add_text(tree,
3072 tvb, curr_offset, 1,
3076 other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
3077 proto_tree_add_text(tree,
3078 tvb, curr_offset, 1,
3085 sprintf(add_string, " - (%u)", oct & 0x3f);
3087 /* no length check possible */
3089 return(curr_offset - offset);
3096 elem_mwi(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
3099 guint32 curr_offset;
3102 curr_offset = offset;
3104 oct = tvb_get_guint8(tvb, curr_offset);
3106 proto_tree_add_text(tree,
3107 tvb, curr_offset, 1,
3108 "Number of Messages: %u",
3113 sprintf(add_string, " - (%u)", oct);
3115 /* no length check possible */
3117 return(curr_offset - offset);
3123 * UNUSED in SPEC and no IEI!
3130 elem_signal(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
3133 guint32 curr_offset;
3137 curr_offset = offset;
3139 oct = tvb_get_guint8(tvb, curr_offset);
3143 case 0x00: str = "Dial tone on"; break;
3144 case 0x01: str = "Ring back tone on"; break;
3145 case 0x02: str = "Intercept tone on"; break;
3146 case 0x03: str = "Network congestion (reorder) tone on"; break;
3147 case 0x04: str = "Busy tone on"; break;
3148 case 0x05: str = "Confirm tone on"; break;
3149 case 0x06: str = "Answer tone on"; break;
3150 case 0x07: str = "Call waiting tone on"; break;
3151 case 0x08: str = "Off-hook warning tone on"; break;
3152 case 0x3f: str = "Tones off"; break;
3153 case 0x40: str = "Normal Alerting"; break;
3154 case 0x41: str = "Inter-group Alerting"; break;
3155 case 0x42: str = "Special/Priority Alerting"; break;
3156 case 0x43: str = "Reserved (ISDN Alerting pattern 3)"; break;
3157 case 0x44: str = "Ping Ring (abbreviated alert)"; break;
3158 case 0x45: str = "Reserved (ISDN Alerting pattern 5)"; break;
3159 case 0x46: str = "Reserved (ISDN Alerting pattern 6)"; break;
3160 case 0x47: str = "Reserved (ISDN Alerting pattern 7)"; break;
3161 case 0x63: str = "Abbreviated intercept"; break;
3162 case 0x65: str = "Abbreviated reorder"; break;
3163 case 0x4f: str = "Alerting off"; break;
3169 proto_tree_add_text(tree,
3170 tvb, curr_offset, 1,
3171 "Signal Value: (%u) %s",
3175 sprintf(add_string, " - (%s)", str);
3179 oct = tvb_get_guint8(tvb, curr_offset);
3181 other_decode_bitfield_value(a_bigbuf, oct, 0xfc, 8);
3182 proto_tree_add_text(tree,
3183 tvb, curr_offset, 1,
3189 case 0: str = "Medium pitch (standard alert)"; break;
3190 case 1: str = "High pitch"; break;
3191 case 2: str = "Low pitch"; break;
3197 proto_tree_add_text(tree,
3198 tvb, curr_offset, 1,
3199 "%s : Alert Pitch: %s",
3205 /* no length check possible */
3207 return(curr_offset - offset);
3219 elem_cld_party_bcd_num(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
3223 guint32 curr_offset;
3226 curr_offset = offset;
3228 oct = tvb_get_guint8(tvb, curr_offset);
3230 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
3231 proto_tree_add_text(tree,
3232 tvb, curr_offset, 1,
3236 switch ((oct & 0x70) >> 4)
3238 case 0: str = "Unknown"; break;
3239 case 1: str = "International number"; break;
3240 case 2: str = "National number"; break;
3241 case 3: str = "Network specific number"; break;
3242 case 4: str = "Dedicated PAD access, short code"; break;
3243 case 7: str = "Reserved for extension"; break;
3249 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
3250 proto_tree_add_text(tree,
3251 tvb, curr_offset, 1,
3252 "%s : Type of Number: %s",
3258 case 0x00: str = "Unknown"; break;
3259 case 0x01: str = "ISDN/telephony number plan (ITU recommendation E.164/E.163)"; break;
3260 case 0x03: str = "Data number plan (ITU recommendation X.121)"; break;
3261 case 0x04: str = "Telex numbering plan (ITU recommendation F.69)"; break;
3262 case 0x07: str = "Reserved for extension"; break;
3263 case 0x08: str = "National numbering plan"; break;
3264 case 0x09: str = "Private numbering plan"; break;
3270 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
3271 proto_tree_add_text(tree,
3272 tvb, curr_offset, 1,
3273 "%s : Numbering Plan Identification: %s",
3279 poctets = tvb_get_string(tvb, curr_offset, len - (curr_offset - offset));
3281 my_dgt_tbcd_unpack(a_bigbuf, poctets, len - (curr_offset - offset),
3285 proto_tree_add_string_format(tree, hf_ansi_a_cld_party_bcd_num,
3286 tvb, curr_offset, len - (curr_offset - offset),
3291 sprintf(add_string, " - (%s)", a_bigbuf);
3293 curr_offset += len - (curr_offset - offset);
3295 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3297 return(curr_offset - offset);
3302 * UNUSED in SPEC and no IEI!
3304 #ifdef MAYBE_USED_FOR_OLDER_CODECS
3306 elem_clg_party_bcd_num(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
3310 guint32 curr_offset;
3313 curr_offset = offset;
3315 oct = tvb_get_guint8(tvb, curr_offset);
3317 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
3318 proto_tree_add_text(tree, tvb, curr_offset, 1,
3319 "%s : Extension: %s",
3321 (oct & 0x80) ? "Not extended" : "Extended");
3323 switch ((oct & 0x70) >> 4)
3325 case 0: str = "Unknown"; break;
3326 case 1: str = "International number"; break;
3327 case 2: str = "National number"; break;
3328 case 3: str = "Network specific number"; break;
3329 case 4: str = "Dedicated PAD access, short code"; break;
3330 case 7: str = "Reserved for extension"; break;
3336 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
3337 proto_tree_add_text(tree,
3338 tvb, curr_offset, 1,
3339 "%s : Type of Number: %s",
3345 case 0x00: str = "Unknown"; break;
3346 case 0x01: str = "ISDN/telephony number plan (ITU recommendation E.164/E.163)"; break;
3347 case 0x03: str = "Data number plan (ITU recommendation X.121)"; break;
3348 case 0x04: str = "Telex numbering plan (ITU recommendation F.69)"; break;
3349 case 0x07: str = "Reserved for extension"; break;
3350 case 0x08: str = "National numbering plan"; break;
3351 case 0x09: str = "Private numbering plan"; break;
3357 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
3358 proto_tree_add_text(tree,
3359 tvb, curr_offset, 1,
3360 "%s : Numbering Plan Identification: %s",
3370 oct = tvb_get_guint8(tvb, curr_offset);
3372 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
3373 proto_tree_add_text(tree, tvb, curr_offset, 1,
3377 switch ((oct & 0x60) >> 5)
3379 case 0: str = "Presentation allowed"; break;
3380 case 1: str = "Presentation restricted"; break;
3381 case 2: str = "Number not available due to interworking"; break;
3387 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
3388 proto_tree_add_text(tree, tvb, curr_offset, 1,
3389 "%s : Presentation Indicator: %s",
3395 case 0: str = "User-provided, not screened"; break;
3396 case 1: str = "User-provided, verified and passed"; break;
3397 case 2: str = "User-provided, verified and failed"; break;
3399 str = "Network-provided";
3403 other_decode_bitfield_value(a_bigbuf, oct, 0x1c, 8);
3404 proto_tree_add_text(tree, tvb, curr_offset, 1,
3408 other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
3409 proto_tree_add_text(tree, tvb, curr_offset, 1,
3410 "%s : Screening Indicator: %s",
3417 poctets = tvb_get_string(tvb, curr_offset, len - (curr_offset - offset));
3419 my_dgt_tbcd_unpack(a_bigbuf, poctets, len - (curr_offset - offset),
3423 proto_tree_add_string_format(tree, hf_ansi_a_clg_party_bcd_num,
3424 tvb, curr_offset, len - (curr_offset - offset),
3429 sprintf(add_string, " - (%s)", a_bigbuf);
3431 curr_offset += len - (curr_offset - offset);
3433 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3435 return(curr_offset - offset);
3443 elem_qos_params(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
3446 guint32 curr_offset;
3448 curr_offset = offset;
3450 oct = tvb_get_guint8(tvb, curr_offset);
3452 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
3453 proto_tree_add_text(tree,
3454 tvb, curr_offset, 1,
3458 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
3459 proto_tree_add_text(tree,
3460 tvb, curr_offset, 1,
3461 "%s : Packet Priority: %u",
3465 sprintf(add_string, " - (%u)", oct & 0x0f);
3469 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3471 return(curr_offset - offset);
3478 elem_cause_l3(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
3481 guint32 curr_offset;
3484 curr_offset = offset;
3486 oct = tvb_get_guint8(tvb, curr_offset);
3488 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
3489 proto_tree_add_text(tree,
3490 tvb, curr_offset, 1,
3494 switch ((oct & 0x60) >> 5)
3496 case 0: str = "Standard as described in ITU Recommendation Q.931"; break;
3497 case 1: str = "Reserved for other international standards"; break;
3498 case 2: str = "National standard"; break;
3500 str = "Reserved for other international standards";
3504 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
3505 proto_tree_add_text(tree,
3506 tvb, curr_offset, 1,
3507 "%s : Coding Standard: %s",
3511 other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
3512 proto_tree_add_text(tree,
3513 tvb, curr_offset, 1,
3519 case 0: str = "User"; break;
3520 case 1: str = "Private network serving the local user"; break;
3521 case 2: str = "Public network serving the local user"; break;
3522 case 3: str = "Transit network"; break;
3523 case 4: str = "Public network serving the remote user"; break;
3524 case 5: str = "Private network serving the remote user"; break;
3525 case 7: str = "International network"; break;
3526 case 10: str = "Network beyond interworking point"; break;
3528 str = "All other values Reserved"; break;
3532 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
3533 proto_tree_add_text(tree,
3534 tvb, curr_offset, 1,
3535 "%s : Location: %s",
3541 oct = tvb_get_guint8(tvb, curr_offset);
3543 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
3544 proto_tree_add_text(tree,
3545 tvb, curr_offset, 1,
3549 switch ((oct & 0x70) >> 4)
3551 case 0: str = "normal event"; break;
3552 case 1: str = "normal event"; break;
3553 case 2: str = "resource unavailable"; break;
3554 case 3: str = "service or option not available"; break;
3555 case 4: str = "service or option not implemented"; break;
3556 case 5: str = "invalid message (e.g., parameter out of range)"; break;
3557 case 6: str = "protocol error (e.g., unknown message)"; break;
3559 str = "interworking";
3563 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
3564 proto_tree_add_text(tree,
3565 tvb, curr_offset, 1,
3566 "%s : Class: (%u) %s",
3573 case 0x01: str = "Unassigned (unallocated) number"; break;
3574 case 0x03: str = "No route to destination"; break;
3575 case 0x06: str = "Channel unacceptable"; break;
3576 case 0x0F: str = "Procedure failed"; break;
3577 case 0x10: str = "Normal Clearing"; break;
3578 case 0x11: str = "User busy"; break;
3579 case 0x12: str = "No user responding"; break;
3580 case 0x13: str = "User alerting, no answer"; break;
3581 case 0x15: str = "Call rejected"; break;
3582 case 0x16: str = "Number changed New destination"; break;
3583 case 0x1A: str = "Non selected user clearing"; break;
3584 case 0x1B: str = "Destination out of order"; break;
3585 case 0x1C: str = "Invalid number format (incomplete number)"; break;
3586 case 0x1D: str = "Facility rejected"; break;
3587 case 0x1F: str = "Normal, unspecified"; break;
3588 case 0x22: str = "No circuit/channel available"; break;
3589 case 0x26: str = "Network out of order"; break;
3590 case 0x29: str = "Temporary failure"; break;
3591 case 0x2A: str = "Switching equipment congestion"; break;
3592 case 0x2B: str = "Access information discarded information element ids"; break;
3593 case 0x2C: str = "requested circuit/channel not available"; break;
3594 case 0x2F: str = "Resources unavailable, unspecified"; break;
3595 case 0x31: str = "Quality of service unavailable"; break;
3596 case 0x32: str = "Requested facility not subscribed"; break;
3597 case 0x33: str = "Request MUX option or rates unavailable"; break;
3598 case 0x39: str = "Bearer capability not authorized"; break;
3599 case 0x3A: str = "Bearer capability not presently available"; break;
3600 case 0x3B: str = "SSD Update Rejected"; break;
3601 case 0x3F: str = "Service or option not available, unspecified"; break;
3602 case 0x41: str = "Bearer service not implemented"; break;
3603 case 0x45: str = "Requested facility not implement"; break;
3604 case 0x46: str = "Only restricted digital information bearer capability is available"; break;
3605 case 0x4F: str = "Service or option not implemented, unspecified"; break;
3606 case 0x51: str = "Reserved"; break;
3607 case 0x58: str = "Incompatible destination incompatible parameter"; break;
3608 case 0x5B: str = "Invalid transit network selection"; break;
3609 case 0x5F: str = "Invalid message, unspecified"; break;
3610 case 0x60: str = "Mandatory information element error information element identifier(s)"; break;
3611 case 0x61: str = "Message type nonexistent or not implemented message type"; break;
3612 case 0x62: str = "Message not compatible with control state message type or message type nonexistent or not implemented"; break;
3613 case 0x64: str = "Invalid information element contents Information element Identifier(s)"; break;
3614 case 0x65: str = "Message not compatible with call state message type"; break;
3615 case 0x6F: str = "Protocol error, unspecified"; break;
3616 case 0x7F: str = "Interworking, unspecified"; break;
3622 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
3623 proto_tree_add_text(tree,
3624 tvb, curr_offset, 1,
3629 sprintf(add_string, " - (%u) %s", oct & 0x7f, str);
3633 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3635 return(curr_offset - offset);
3652 elem_xmode(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
3655 guint32 curr_offset;
3657 curr_offset = offset;
3659 oct = tvb_get_guint8(tvb, curr_offset);
3661 other_decode_bitfield_value(a_bigbuf, oct, 0xfe, 8);
3662 proto_tree_add_text(tree,
3663 tvb, curr_offset, 1,
3667 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
3668 proto_tree_add_text(tree,
3669 tvb, curr_offset, 1,
3670 "%s : TFO Mode: %s",
3672 (oct & 0x01) ? "TFO" : "tandem");
3674 sprintf(add_string, " - (%s)",
3675 (oct & 0x01) ? "TFO" : "tandem");
3679 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3681 return(curr_offset - offset);
3691 * NO ASSOCIATED DATA
3698 elem_reg_type(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
3701 guint32 curr_offset;
3705 curr_offset = offset;
3707 oct = tvb_get_guint8(tvb, curr_offset);
3711 case 0x00: str = "Timer-based"; break;
3712 case 0x01: str = "Power-up"; break;
3713 case 0x02: str = "Zone-based"; break;
3714 case 0x03: str = "Power-down"; break;
3715 case 0x04: str = "Parameter-change"; break;
3716 case 0x05: str = "Ordered"; break;
3717 case 0x06: str = "Distance-based"; break;
3723 proto_tree_add_text(tree,
3724 tvb, curr_offset, 1,
3725 "Location Registration Type: %s",
3728 sprintf(add_string, " - (%s)", str);
3732 /* no length check possible */
3734 return(curr_offset - offset);
3741 elem_tag(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
3744 guint32 curr_offset;
3747 curr_offset = offset;
3749 value = tvb_get_ntohl(tvb, curr_offset);
3751 proto_tree_add_text(tree,
3752 tvb, curr_offset, 4,
3756 sprintf(add_string, " - (%u)", value);
3760 /* no length check possible */
3762 return(curr_offset - offset);
3769 elem_hho_params(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
3773 guint32 curr_offset;
3777 curr_offset = offset;
3779 oct = tvb_get_guint8(tvb, curr_offset);
3781 other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
3782 proto_tree_add_text(tree,
3783 tvb, curr_offset, 1,
3787 temp_int = oct & 0x1f;
3788 if ((temp_int < 0) || (temp_int >= (gint) NUM_BAND_CLASS_STR))
3794 str = band_class_str[temp_int];
3797 other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
3798 proto_tree_add_text(tree,
3799 tvb, curr_offset, 1,
3800 "%s : Band Class: %s",
3806 sprintf(add_string, " - (%s)", str);
3808 oct = tvb_get_guint8(tvb, curr_offset);
3810 other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
3811 proto_tree_add_text(tree,
3812 tvb, curr_offset, 1,
3813 "%s : Number of Preamble Frames: %u",
3817 other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
3818 proto_tree_add_text(tree,
3819 tvb, curr_offset, 1,
3820 "%s : Reset L2: %s Layer 2 Acknowledgement",
3822 (oct & 0x10) ? "Reset" : "Do not reset");
3824 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
3825 proto_tree_add_text(tree,
3826 tvb, curr_offset, 1,
3827 "%s : Reset FPC: %s counters",
3829 (oct & 0x10) ? "Reset" : "Do not reset");
3831 switch ((oct & 0x06) >> 1)
3833 case 0: str = "Encryption disabled"; break;
3834 case 1: str = "Encryption enabled"; break;
3840 other_decode_bitfield_value(a_bigbuf, oct, 0x06, 8);
3841 proto_tree_add_text(tree,
3842 tvb, curr_offset, 1,
3843 "%s : Encryption Mode: %s",
3847 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
3848 proto_tree_add_text(tree,
3849 tvb, curr_offset, 1,
3850 "%s : Private LCM: %s Private Long Code Mask",
3852 (oct & 0x01) ? "Use" : "Do not use");
3856 oct = tvb_get_guint8(tvb, curr_offset);
3858 other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
3859 proto_tree_add_text(tree,
3860 tvb, curr_offset, 1,
3864 other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
3865 proto_tree_add_text(tree,
3866 tvb, curr_offset, 1,
3870 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
3871 proto_tree_add_text(tree,
3872 tvb, curr_offset, 1,
3879 oct = tvb_get_guint8(tvb, curr_offset);
3881 other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
3882 proto_tree_add_text(tree,
3883 tvb, curr_offset, 1,
3887 other_decode_bitfield_value(a_bigbuf, oct, 0x3e, 8);
3888 proto_tree_add_text(tree,
3889 tvb, curr_offset, 1,
3890 "%s : FPC Subchannel Information: %u",
3894 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
3895 proto_tree_add_text(tree,
3896 tvb, curr_offset, 1,
3897 "%s : FPC SubChannel Information Included",
3902 oct = tvb_get_guint8(tvb, curr_offset);
3904 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
3905 proto_tree_add_text(tree,
3906 tvb, curr_offset, 1,
3910 other_decode_bitfield_value(a_bigbuf, oct, 0x0e, 8);
3911 proto_tree_add_text(tree,
3912 tvb, curr_offset, 1,
3913 "%s : Power Control Step: %u",
3917 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
3918 proto_tree_add_text(tree,
3919 tvb, curr_offset, 1,
3920 "%s : Power Control Step Included",
3925 /* no length check possible */
3927 return(curr_offset - offset);
3939 elem_sw_ver(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
3941 guint8 major, minor, point;
3942 guint32 curr_offset;
3944 curr_offset = offset;
3946 major = tvb_get_guint8(tvb, curr_offset);
3948 proto_tree_add_text(tree,
3949 tvb, curr_offset, 1,
3950 "IOS Major Revision Level: %u",
3955 minor = tvb_get_guint8(tvb, curr_offset);
3957 proto_tree_add_text(tree,
3958 tvb, curr_offset, 1,
3959 "IOS Minor Revision Level: %u",
3964 point = tvb_get_guint8(tvb, curr_offset);
3966 proto_tree_add_text(tree,
3967 tvb, curr_offset, 1,
3968 "IOS Point Revision Level: %u",
3973 sprintf(add_string, " - (IOS %u.%u.%u)", major, minor, point);
3977 proto_tree_add_text(tree, tvb, curr_offset, len - 3,
3978 "Manufacturer/Carrier Software Information");
3980 curr_offset += len - 3;
3983 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3985 return(curr_offset - offset);
3991 elem_so(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
3994 guint32 curr_offset;
3998 curr_offset = offset;
4000 value = tvb_get_ntohs(tvb, curr_offset);
4002 other_decode_bitfield_value(a_bigbuf, value, 0x8000, 16);
4003 proto_tree_add_text(tree,
4004 tvb, curr_offset, 2,
4005 "%s : Proprietary Indicator",
4008 other_decode_bitfield_value(a_bigbuf, value, 0x7000, 16);
4009 proto_tree_add_text(tree,
4010 tvb, curr_offset, 2,
4011 "%s : Service Option Revision",
4014 other_decode_bitfield_value(a_bigbuf, value, 0x0fff, 16);
4015 proto_tree_add_text(tree,
4016 tvb, curr_offset, 2,
4017 "%s : Base Service Option Number",
4022 case 1: str = "Basic Variable Rate Voice Service (8 kbps)"; break;
4023 case 2: str = "Mobile Station Loopback (8 kbps)"; break;
4024 case 3: str = "Enhanced Variable Rate Voice Service (8 kbps)"; break;
4025 case 4: str = "Asynchronous Data Service (9.6 kbps)"; break;
4026 case 5: str = "Group 3 Facsimile (9.6 kbps)"; break;
4027 case 6: str = "Short Message Services (Rate Set 1)"; break;
4028 case 7: str = "Packet Data Service: Internet or ISO Protocol Stack (9.6 kbps)"; break;
4029 case 8: str = "Packet Data Service: CDPD Protocol Stack (9.6 kbps)"; break;
4030 case 9: str = "Mobile Station Loopback (13 kbps)"; break;
4031 case 10: str = "STU-III Transparent Service"; break;
4032 case 11: str = "STU-III Non-Transparent Service"; break;
4033 case 12: str = "Asynchronous Data Service (14.4 or 9.6 kbps)"; break;
4034 case 13: str = "Group 3 Facsimile (14.4 or 9.6 kbps)"; break;
4035 case 14: str = "Short Message Services (Rate Set 2)"; break;
4036 case 15: str = "Packet Data Service: Internet or ISO Protocol Stack (14.4 kbps)"; break;
4037 case 16: str = "Packet Data Service: CDPD Protocol Stack (14.4 kbps)"; break;
4038 case 17: str = "High Rate Voice Service (13 kbps)"; break;
4039 case 32768: str = "QCELP (13 kbps)"; break;
4040 case 32798: /* 0x801e */ str = "Qualcomm Loopback"; break;
4041 case 32799: /* 0x801f */ str = "Qualcomm Markov 8 kbps Loopback"; break;
4042 case 32800: /* 0x8020 */ str = "Qualcomm Packet Data"; break;
4043 case 32801: /* 0x8021 */ str = "Qualcomm Async Data"; break;
4044 case 18: str = "Over-the-Air Parameter Administration (Rate Set 1)"; break;
4045 case 19: str = "Over-the-Air Parameter Administration (Rate Set 2)"; break;
4046 case 20: str = "Group 3 Analog Facsimile (Rate Set 1)"; break;
4047 case 21: str = "Group 3 Analog Facsimile (Rate Set 2)"; break;
4048 case 22: str = "High Speed Packet Data Service: Internet or ISO Protocol Stack (RS1 forward, RS1 reverse)"; break;
4049 case 23: str = "High Speed Packet Data Service: Internet or ISO Protocol Stack (RS1 forward, RS2 reverse)"; break;
4050 case 24: str = "High Speed Packet Data Service: Internet or ISO Protocol Stack (RS2 forward, RS1 reverse)"; break;
4051 case 25: str = "High Speed Packet Data Service: Internet or ISO Protocol Stack (RS2 forward, RS2 reverse)"; break;
4052 case 26: str = "High Speed Packet Data Service: CDPD Protocol Stack (RS1 forward, RS1 reverse)"; break;
4053 case 27: str = "High Speed Packet Data Service: CDPD Protocol Stack (RS1 forward, RS2 reverse)"; break;
4054 case 28: str = "High Speed Packet Data Service: CDPD Protocol Stack (RS2 forward, RS1 reverse)"; break;
4055 case 29: str = "High Speed Packet Data Service: CDPD Protocol Stack (RS2 forward, RS2 reverse)"; break;
4056 case 30: str = "Supplemental Channel Loopback Test for Rate Set 1"; break;
4057 case 31: str = "Supplemental Channel Loopback Test for Rate Set 2"; break;
4058 case 32: str = "Test Data Service Option (TDSO)"; break;
4059 case 33: str = "cdma2000 High Speed Packet Data Service, Internet or ISO Protocol Stack"; break;
4060 case 34: str = "cdma2000 High Speed Packet Data Service, CDPD Protocol Stack"; break;
4061 case 35: str = "Location Services, Rate Set 1 (9.6 kbps)"; break;
4062 case 36: str = "Location Services, Rate Set 2 (14.4 kbps)"; break;
4063 case 37: str = "ISDN Interworking Service (64 kbps)"; break;
4064 case 38: str = "GSM Voice"; break;
4065 case 39: str = "GSM Circuit Data"; break;
4066 case 40: str = "GSM Packet Data"; break;
4067 case 41: str = "GSM Short Message Service"; break;
4068 case 42: str = "None Reserved for MC-MAP standard service options"; break;
4069 case 54: str = "Markov Service Option (MSO)"; break;
4070 case 55: str = "Loopback Service Option (LSO)"; break;
4071 case 56: str = "Selectable Mode Vocoder"; break;
4072 case 57: str = "32 kbps Circuit Video Conferencing"; break;
4073 case 58: str = "64 kbps Circuit Video Conferencing"; break;
4074 case 59: str = "HRPD Accounting Records Identifier"; break;
4075 case 60: str = "Link Layer Assisted Robust Header Compression (LLA ROHC) - Header Removal"; break;
4076 case 61: str = "Link Layer Assisted Robust Header Compression (LLA ROHC) - Header Compression"; break;
4077 case 62: str = "- 4099 None Reserved for standard service options"; break;
4078 case 4100: str = "Asynchronous Data Service, Revision 1 (9.6 or 14.4 kbps)"; break;
4079 case 4101: str = "Group 3 Facsimile, Revision 1 (9.6 or 14.4 kbps)"; break;
4080 case 4102: str = "Reserved for standard service option"; break;
4081 case 4103: str = "Packet Data Service: Internet or ISO Protocol Stack, Revision 1 (9.6 or 14.4 kbps)"; break;
4082 case 4104: str = "Packet Data Service: CDPD Protocol Stack, Revision 1 (9.6 or 14.4 kbps)"; break;
4084 if ((value >= 4105) && (value <= 32767)) { str = "Reserved for standard service options"; }
4085 else if ((value >= 32769) && (value <= 32771)) { str = "Proprietary QUALCOMM Incorporated"; }
4086 else if ((value >= 32772) && (value <= 32775)) { str = "Proprietary OKI Telecom"; }
4087 else if ((value >= 32776) && (value <= 32779)) { str = "Proprietary Lucent Technologies"; }
4088 else if ((value >= 32780) && (value <=32783)) { str = "Nokia"; }
4089 else if ((value >= 32784) && (value <=32787)) { str = "NORTEL NETWORKS"; }
4090 else if ((value >= 32788) && (value <=32791)) { str = "Sony Electronics Inc."; }
4091 else if ((value >= 32792) && (value <=32795)) { str = "Motorola"; }
4092 else if ((value >= 32796) && (value <=32799)) { str = "QUALCOMM Incorporated"; }
4093 else if ((value >= 32800) && (value <=32803)) { str = "QUALCOMM Incorporated"; }
4094 else if ((value >= 32804) && (value <=32807)) { str = "QUALCOMM Incorporated"; }
4095 else if ((value >= 32808) && (value <=32811)) { str = "QUALCOMM Incorporated"; }
4096 else if ((value >= 32812) && (value <=32815)) { str = "Lucent Technologies"; }
4097 else if ((value >= 32816) && (value <=32819)) { str = "Denso International"; }
4098 else if ((value >= 32820) && (value <=32823)) { str = "Motorola"; }
4099 else if ((value >= 32824) && (value <=32827)) { str = "Denso International"; }
4100 else if ((value >= 32828) && (value <=32831)) { str = "Denso International"; }
4101 else if ((value >= 32832) && (value <=32835)) { str = "Denso International"; }
4102 else if ((value >= 32836) && (value <=32839)) { str = "NEC America"; }
4103 else if ((value >= 32840) && (value <=32843)) { str = "Samsung Electronics"; }
4104 else if ((value >= 32844) && (value <=32847)) { str = "Texas Instruments Incorporated"; }
4105 else if ((value >= 32848) && (value <=32851)) { str = "Toshiba Corporation"; }
4106 else if ((value >= 32852) && (value <=32855)) { str = "LG Electronics Inc."; }
4107 else if ((value >= 32856) && (value <=32859)) { str = "VIA Telecom Inc."; }
4108 else { str = "Reserved"; }
4112 sprintf(add_string, " - (%u) (0x%04x)", value, value);
4114 proto_tree_add_text(tree,
4115 tvb, curr_offset, 2,
4122 /* no length check possible */
4124 return(curr_offset - offset);
4127 #define ADDS_APP_SMS 0x03
4128 #define ADDS_APP_OTA 0x04
4129 #define ADDS_APP_PLD 0x05
4135 elem_adds_user_part(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
4139 guint32 curr_offset;
4143 curr_offset = offset;
4146 oct = tvb_get_guint8(tvb, curr_offset);
4148 other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
4149 proto_tree_add_text(tree,
4150 tvb, curr_offset, 1,
4154 adds_app = oct & 0x3f;
4161 adds_tvb = tvb_new_subset(tvb, curr_offset + 1, len - 1, len - 1);
4163 dissector_try_port(is637_dissector_table,
4164 0, adds_tvb, g_pinfo, g_tree);
4170 adds_tvb = tvb_new_subset(tvb, curr_offset + 1, len - 1, len - 1);
4172 dissector_try_port(is683_dissector_table,
4173 (g_pinfo->p2p_dir == P2P_DIR_RECV), adds_tvb, g_pinfo, g_tree);
4179 adds_tvb = tvb_new_subset(tvb, curr_offset + 1, len - 1, len - 1);
4181 dissector_try_port(is801_dissector_table,
4182 (g_pinfo->p2p_dir == P2P_DIR_RECV), adds_tvb, g_pinfo, g_tree);
4190 other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
4191 proto_tree_add_text(tree,
4192 tvb, curr_offset, 1,
4193 "%s : Data Burst Type: %s",
4199 proto_tree_add_text(tree, tvb, curr_offset, len - 1,
4200 "Application Data Message");
4202 sprintf(add_string, " - (%s)", str);
4204 curr_offset += (len - 1);
4206 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
4208 return(curr_offset - offset);
4215 elem_is2000_scr(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
4218 guint32 curr_offset;
4220 add_string = add_string;
4221 curr_offset = offset;
4223 oct = tvb_get_guint8(tvb, curr_offset);
4225 other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
4226 proto_tree_add_text(tree, tvb, curr_offset, 1,
4230 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
4231 proto_tree_add_text(tree, tvb, curr_offset, 1,
4232 "%s : Bit-Exact Length Fill Bits: %u",
4238 NO_MORE_DATA_CHECK(len);
4240 proto_tree_add_text(tree, tvb, curr_offset,
4241 len - (curr_offset - offset),
4242 "IS-2000 Service Configuration Record Content");
4244 curr_offset += len - (curr_offset - offset);
4246 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
4248 return(curr_offset - offset);
4255 elem_is2000_nn_scr(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
4259 guint32 curr_offset;
4261 add_string = add_string;
4262 curr_offset = offset;
4264 oct_len = tvb_get_guint8(tvb, curr_offset);
4266 proto_tree_add_text(tree,
4267 tvb, curr_offset, 1,
4268 "Bit-Exact Length Octet Count: %u",
4273 NO_MORE_DATA_CHECK(len);
4275 oct = tvb_get_guint8(tvb, curr_offset);
4277 other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
4278 proto_tree_add_text(tree, tvb, curr_offset, 1,
4282 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
4283 proto_tree_add_text(tree, tvb, curr_offset, 1,
4284 "%s : Bit-Exact Length Fill Bits: %u",
4290 NO_MORE_DATA_CHECK(len);
4294 SHORT_DATA_CHECK(len - (curr_offset - offset), oct_len);
4296 proto_tree_add_text(tree, tvb, curr_offset, oct_len,
4297 "IS-2000 Non-Negotiable Service Configuration Record Content");
4299 curr_offset += oct_len;
4302 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
4304 return(curr_offset - offset);
4311 elem_is2000_mob_cap(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
4315 guint32 curr_offset;
4318 add_string = add_string;
4319 curr_offset = offset;
4321 oct = tvb_get_guint8(tvb, curr_offset);
4323 other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
4324 proto_tree_add_text(tree, tvb, curr_offset, 1,
4328 other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
4329 proto_tree_add_text(tree, tvb, curr_offset, 1,
4330 "%s : DCCH Supported: IS-2000 DCCH %ssupported",
4332 (oct & 0x10) ? "" : "not ");
4334 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
4335 proto_tree_add_text(tree, tvb, curr_offset, 1,
4336 "%s : FCH Supported: IS-2000 FCH %ssupported",
4338 (oct & 0x08) ? "" : "not ");
4340 other_decode_bitfield_value(a_bigbuf, oct, 0x04, 8);
4341 proto_tree_add_text(tree, tvb, curr_offset, 1,
4342 "%s : OTD Supported: Orthogonal Transmit Diversity %ssupported",
4344 (oct & 0x04) ? "" : "not ");
4346 other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
4347 proto_tree_add_text(tree, tvb, curr_offset, 1,
4348 "%s : Enhanced RC CFG Supported: Radio configuration in radio class 2 %ssupported",
4350 (oct & 0x02) ? "" : "not ");
4352 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
4353 proto_tree_add_text(tree, tvb, curr_offset, 1,
4354 "%s : QPCH Supported: Quick Paging Channel %ssupported",
4356 (oct & 0x01) ? "" : "not ");
4360 NO_MORE_DATA_CHECK(len);
4362 oct_len = tvb_get_guint8(tvb, curr_offset);
4364 proto_tree_add_text(tree,
4365 tvb, curr_offset, 1,
4366 "FCH Information: Bit-Exact Length Octet Count: %u",
4371 NO_MORE_DATA_CHECK(len);
4373 oct = tvb_get_guint8(tvb, curr_offset);
4375 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
4376 proto_tree_add_text(tree, tvb, curr_offset, 1,
4380 switch ((oct & 0x70) >> 4)
4382 case 0: str = "No mobile assisted geo-location capabilities"; break;
4383 case 1: str = "IS801 capable (Advanced Forward Link Triangulation only (AFLT))"; break;
4384 case 2: str = "IS801 capable (Advanced Forward Link Triangulation and Global Positioning Systems"; break;
4385 case 3: str = "Global Positioning Systems Only"; break;
4387 str = "All Other values reserved";
4391 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
4392 proto_tree_add_text(tree, tvb, curr_offset, 1,
4393 "%s : Geo Location Type: %s",
4397 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
4398 proto_tree_add_text(tree, tvb, curr_offset, 1,
4399 "%s : Geo Location Included",
4402 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
4403 proto_tree_add_text(tree, tvb, curr_offset, 1,
4404 "%s : FCH Information: Bit-Exact Length Fill Bits: %u",
4410 NO_MORE_DATA_CHECK(len);
4414 SHORT_DATA_CHECK(len - (curr_offset - offset), oct_len);
4416 proto_tree_add_text(tree, tvb, curr_offset, oct_len,
4417 "FCH Information Content");
4419 curr_offset += oct_len;
4421 NO_MORE_DATA_CHECK(len);
4424 oct_len = tvb_get_guint8(tvb, curr_offset);
4426 proto_tree_add_text(tree,
4427 tvb, curr_offset, 1,
4428 "DCCH Information: Bit-Exact Length Octet Count: %u",
4433 NO_MORE_DATA_CHECK(len);
4435 oct = tvb_get_guint8(tvb, curr_offset);
4437 other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
4438 proto_tree_add_text(tree, tvb, curr_offset, 1,
4442 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
4443 proto_tree_add_text(tree, tvb, curr_offset, 1,
4444 "%s : DCCH Information: Bit-Exact Length Fill Bits: %u",
4450 NO_MORE_DATA_CHECK(len);
4454 SHORT_DATA_CHECK(len - (curr_offset - offset), oct_len);
4456 proto_tree_add_text(tree, tvb, curr_offset, oct_len,
4457 "DCCH Information Content");
4459 curr_offset += oct_len;
4462 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
4464 return(curr_offset - offset);
4471 elem_ptype(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
4474 guint32 curr_offset;
4477 curr_offset = offset;
4479 value = tvb_get_ntohs(tvb, curr_offset);
4483 case 0x880b: str = "PPP"; break;
4484 case 0x8881: str = "Unstructured Byte Stream"; break;
4490 proto_tree_add_text(tree,
4491 tvb, curr_offset, 2,
4496 sprintf(add_string, " - (%s)", str);
4500 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
4502 return(curr_offset - offset);
4509 elem_ms_info_recs(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
4516 guint32 curr_offset;
4518 gint ett_elem_idx, idx, i;
4519 proto_tree *subtree;
4522 curr_offset = offset;
4526 while ((len - (curr_offset - offset)) >= 2)
4530 rec_type = tvb_get_guint8(tvb, curr_offset);
4532 str = my_match_strval((guint32) rec_type, ansi_ms_info_rec_str, &idx);
4537 ett_elem_idx = ett_ansi_ms_info_rec_reserved;
4541 ett_elem_idx = ett_ansi_ms_info_rec[idx];
4545 proto_tree_add_text(tree,
4546 tvb, curr_offset, 1,
4547 "Information Record Type - %u: (%u) %s",
4552 subtree = proto_item_add_subtree(item, ett_elem_idx);
4556 oct_len = tvb_get_guint8(tvb, curr_offset);
4558 proto_tree_add_uint(subtree, hf_ansi_a_length, tvb,
4559 curr_offset, 1, oct_len);
4565 SHORT_DATA_CHECK(len - (curr_offset - offset), oct_len);
4569 case ANSI_MS_INFO_REC_CLD_PN:
4570 oct = tvb_get_guint8(tvb, curr_offset);
4572 switch ((oct & 0xe0) >> 5)
4574 case 0: str = "Unknown"; break;
4575 case 1: str = "International number"; break;
4576 case 2: str = "National number"; break;
4577 case 3: str = "Network-specific number"; break;
4578 case 4: str = "Subscriber number"; break;
4579 case 5: str = "Reserved"; break;
4580 case 6: str = "Abbreviated number"; break;
4582 str = "Reserved for extension";
4586 other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
4587 proto_tree_add_text(subtree, tvb, curr_offset, 1,
4588 "%s : Number Type: %s",
4592 switch ((oct & 0x1e) >> 1)
4594 case 0x00: str = "Unknown"; break;
4595 case 0x01: str = "ISDN/Telephony Numbering"; break;
4596 case 0x03: str = "Data Numbering (ITU-T Rec. X.121)"; break;
4597 case 0x04: str = "Telex Numbering (ITU-T Rec. F.69)"; break;
4598 case 0x09: str = "Private Numbering"; break;
4599 case 0x0f: str = "Reserved for extension"; break;
4605 other_decode_bitfield_value(a_bigbuf, oct, 0x1e, 8);
4606 proto_tree_add_text(subtree, tvb, curr_offset, 1,
4607 "%s : Number Plan: %s",
4613 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
4614 proto_tree_add_text(subtree, tvb, curr_offset, 1,
4615 "%s : MSB of first digit",
4620 for (i=0; i < (oct_len - 1); i++)
4622 a_bigbuf[i] = (oct & 0x01) << 7;
4624 oct = tvb_get_guint8(tvb, curr_offset + i);
4626 a_bigbuf[i] |= (oct & 0xfe) >> 1;
4630 proto_tree_add_text(subtree, tvb, curr_offset, oct_len - 1,
4634 curr_offset += (oct_len - 2);
4637 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
4638 proto_tree_add_text(subtree, tvb, curr_offset, 1,
4645 case ANSI_MS_INFO_REC_CLG_PN:
4646 value = tvb_get_ntohs(tvb, curr_offset);
4648 oct = (value & 0xff00) >> 8;
4650 switch ((oct & 0xe0) >> 5)
4652 case 0: str = "Unknown"; break;
4653 case 1: str = "International number"; break;
4654 case 2: str = "National number"; break;
4655 case 3: str = "Network-specific number"; break;
4656 case 4: str = "Subscriber number"; break;
4657 case 5: str = "Reserved"; break;
4658 case 6: str = "Abbreviated number"; break;
4660 str = "Reserved for extension";
4664 other_decode_bitfield_value(a_bigbuf, value, 0xe000, 16);
4665 proto_tree_add_text(subtree, tvb, curr_offset, 2,
4666 "%s : Number Type: %s",
4670 switch ((oct & 0x1e) >> 1)
4672 case 0x00: str = "Unknown"; break;
4673 case 0x01: str = "ISDN/Telephony Numbering"; break;
4674 case 0x03: str = "Data Numbering (ITU-T Rec. X.121)"; break;
4675 case 0x04: str = "Telex Numbering (ITU-T Rec. F.69)"; break;
4676 case 0x09: str = "Private Numbering"; break;
4677 case 0x0f: str = "Reserved for extension"; break;
4683 other_decode_bitfield_value(a_bigbuf, value, 0x1e00, 16);
4684 proto_tree_add_text(subtree, tvb, curr_offset, 2,
4685 "%s : Number Plan: %s",
4689 switch ((value & 0x0180) >> 7)
4691 case 0: str = "Presentation allowed"; break;
4692 case 1: str = "Presentation restricted"; break;
4693 case 2: str = "Number not available"; break;
4699 other_decode_bitfield_value(a_bigbuf, value, 0x0180, 16);
4700 proto_tree_add_text(subtree, tvb, curr_offset, 2,
4701 "%s : Presentation Indicator (PI): %s",
4705 switch ((value & 0x0060) >> 5)
4707 case 0: str = "User-provided, not screened"; break;
4708 case 1: str = "User-provided, verified and passed"; break;
4709 case 2: str = "User-provided, verified and failed"; break;
4711 str = "Network-provided";
4715 other_decode_bitfield_value(a_bigbuf, value, 0x0060, 16);
4716 proto_tree_add_text(subtree, tvb, curr_offset, 2,
4717 "%s : Screening Indicator (SI): %s",
4723 oct = (value & 0x00ff);
4725 other_decode_bitfield_value(a_bigbuf, value, 0x001f, 16);
4726 proto_tree_add_text(subtree, tvb, curr_offset, 2,
4727 "%s : MSB of first digit",
4732 for (i=0; i < (oct_len - 2); i++)
4734 a_bigbuf[i] = (oct & 0x1f) << 3;
4736 oct = tvb_get_guint8(tvb, curr_offset + i);
4738 a_bigbuf[i] |= (oct & 0xe0) >> 5;
4742 proto_tree_add_text(subtree, tvb, curr_offset, oct_len - 2,
4746 curr_offset += (oct_len - 3);
4748 other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
4749 proto_tree_add_text(subtree, tvb, curr_offset, 1,
4757 other_decode_bitfield_value(a_bigbuf, value, 0x001f, 16);
4758 proto_tree_add_text(subtree, tvb, curr_offset, 2,
4766 case ANSI_MS_INFO_REC_MW:
4767 oct = tvb_get_guint8(tvb, curr_offset);
4769 proto_tree_add_text(subtree, tvb, curr_offset, 1,
4770 "Number of messages waiting: %u",
4777 proto_tree_add_text(subtree,
4778 tvb, curr_offset, oct_len,
4781 curr_offset += oct_len;
4787 sprintf(add_string, " - %u record%s",
4788 num_recs, plurality(num_recs, "", "s"));
4790 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
4792 return(curr_offset - offset);
4799 elem_ext_ho_dir_params(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
4803 guint32 curr_offset;
4805 add_string = add_string;
4806 curr_offset = offset;
4808 oct = tvb_get_guint8(tvb, curr_offset);
4810 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
4811 proto_tree_add_text(tree, tvb, curr_offset, 1,
4812 "%s : Search Window A Size (Srch_Win_A): %u",
4816 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
4817 proto_tree_add_text(tree, tvb, curr_offset, 1,
4818 "%s : Search Window N Size (Srch_Win_N): %u",
4824 NO_MORE_DATA_CHECK(len);
4826 oct = tvb_get_guint8(tvb, curr_offset);
4828 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
4829 proto_tree_add_text(tree, tvb, curr_offset, 1,
4830 "%s : Search Window R Size (Srch_Win_R): %u",
4834 value = tvb_get_guint8(tvb, curr_offset + 1);
4836 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
4837 proto_tree_add_text(tree, tvb, curr_offset, 1,
4838 "%s : Add Pilot Threshold (T_Add) (MSB): %u",
4840 (oct & 0x0f) << 2 | (value & 0xc0) >> 6);
4846 other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
4847 proto_tree_add_text(tree, tvb, curr_offset, 1,
4848 "%s : Add Pilot Threshold (T_Add) (LSB)",
4851 other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
4852 proto_tree_add_text(tree, tvb, curr_offset, 1,
4853 "%s : Drop Pilot Threshold (T_Drop): %u",
4859 NO_MORE_DATA_CHECK(len);
4861 oct = tvb_get_guint8(tvb, curr_offset);
4863 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
4864 proto_tree_add_text(tree, tvb, curr_offset, 1,
4865 "%s : Compare Threshold (T_Comp): %u",
4869 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
4870 proto_tree_add_text(tree, tvb, curr_offset, 1,
4871 "%s : Drop Timer Value (T_TDrop): %u",
4877 NO_MORE_DATA_CHECK(len);
4879 oct = tvb_get_guint8(tvb, curr_offset);
4881 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
4882 proto_tree_add_text(tree, tvb, curr_offset, 1,
4883 "%s : Neighbor Max Age (Nghbor_Max_AGE): %u",
4887 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
4888 proto_tree_add_text(tree, tvb, curr_offset, 1,
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 : SOFT_SLOPE: %u",
4911 NO_MORE_DATA_CHECK(len);
4913 oct = tvb_get_guint8(tvb, curr_offset);
4915 other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
4916 proto_tree_add_text(tree, tvb, curr_offset, 1,
4920 other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
4921 proto_tree_add_text(tree, tvb, curr_offset, 1,
4922 "%s : ADD_INTERCEPT: %u",
4928 NO_MORE_DATA_CHECK(len);
4930 oct = tvb_get_guint8(tvb, curr_offset);
4932 other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
4933 proto_tree_add_text(tree, tvb, curr_offset, 1,
4937 other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
4938 proto_tree_add_text(tree, tvb, curr_offset, 1,
4939 "%s : DROP_INTERCEPT: %u",
4945 NO_MORE_DATA_CHECK(len);
4947 oct = tvb_get_guint8(tvb, curr_offset);
4949 proto_tree_add_text(tree, tvb, curr_offset, 1,
4950 "Target BS P_REV: %u",
4955 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
4957 return(curr_offset - offset);
4962 * UNUSED in SPEC and no IEI!
4967 * UNUSED in SPEC and no IEI!
4977 * UNUSED in SPEC and no IEI!
4982 * UNUSED in SPEC and no IEI!
4989 elem_cdma_sowd(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
4993 guint32 curr_offset;
4996 curr_offset = offset;
4998 curr_offset += elem_cell_id(tvb, tree, offset, len, add_string);
4999 add_string[0] = '\0';
5001 value = tvb_get_ntohs(tvb, curr_offset);
5003 proto_tree_add_text(tree,
5004 tvb, curr_offset, 2,
5005 "CDMA Serving One Way Delay: %u",
5010 oct = tvb_get_guint8(tvb, curr_offset);
5012 other_decode_bitfield_value(a_bigbuf, oct, 0xfc, 8);
5013 proto_tree_add_text(tree,
5014 tvb, curr_offset, 1,
5020 case 0: str = "100 nsec"; break;
5021 case 1: str = "50 nsec"; break;
5022 case 2: str = "1/16 CDMA PN Chip"; break;
5023 case 3: str = "Reserved"; break;
5026 other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
5027 proto_tree_add_text(tree,
5028 tvb, curr_offset, 1,
5029 "%s : Resolution: %s",
5035 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
5037 return(curr_offset - offset);
5054 elem_re_res(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
5057 guint32 curr_offset;
5061 add_string = add_string;
5062 curr_offset = offset;
5064 oct = tvb_get_guint8(tvb, curr_offset);
5066 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
5067 proto_tree_add_text(tree,
5068 tvb, curr_offset, 1,
5072 other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
5073 proto_tree_add_text(tree,
5074 tvb, curr_offset, 1,
5075 "%s : Include Priority: MSC %s include priority in Assignment Request",
5077 (oct & 0x40) ? "should" : "does not need to");
5079 switch ((oct & 0x30) >> 4)
5081 case 0: str = "Not reported"; break;
5082 case 1: str = "radio environment is acceptable"; break;
5083 case 2: str = "radio environment is marginally acceptable"; break;
5085 str = "radio environment is poor";
5089 other_decode_bitfield_value(a_bigbuf, oct, 0x30, 8);
5090 proto_tree_add_text(tree,
5091 tvb, curr_offset, 1,
5096 switch ((oct & 0x0c) >> 2)
5098 case 0: str = "Not reported"; break;
5099 case 1: str = "radio environment is acceptable"; break;
5100 case 2: str = "radio environment is marginally acceptable"; break;
5102 str = "radio environment is poor";
5106 other_decode_bitfield_value(a_bigbuf, oct, 0x0c, 8);
5107 proto_tree_add_text(tree,
5108 tvb, curr_offset, 1,
5113 other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
5114 proto_tree_add_text(tree,
5115 tvb, curr_offset, 1,
5116 "%s : Alloc: resources are %sallocated",
5118 (oct & 0x02) ? "" : "not ");
5120 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
5121 proto_tree_add_text(tree,
5122 tvb, curr_offset, 1,
5123 "%s : Avail: resources are %savailable",
5125 (oct & 0x01) ? "" : "not ");
5129 /* no length check possible */
5131 return(curr_offset - offset);
5136 * UNUSED in SPEC and no IEI!
5171 * UNUSED in SPEC and no IEI!
5248 elem_cld_party_ascii_num(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
5251 guint32 curr_offset;
5255 curr_offset = offset;
5257 oct = tvb_get_guint8(tvb, curr_offset);
5259 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
5260 proto_tree_add_text(tree, tvb, curr_offset, 1,
5264 switch ((oct & 0x70) >> 4)
5266 case 0: str = "Unknown"; break;
5267 case 1: str = "International number"; break;
5268 case 2: str = "National number"; break;
5269 case 3: str = "Network specific number"; break;
5270 case 4: str = "Dedicated PAD access, short code"; break;
5271 case 7: str = "Reserved for extension"; break;
5277 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
5278 proto_tree_add_text(tree,
5279 tvb, curr_offset, 1,
5280 "%s : Type of Number: %s",
5286 case 0x00: str = "Unknown"; break;
5287 case 0x01: str = "ISDN/telephony number plan (ITU recommendation E.164/E.163)"; break;
5288 case 0x03: str = "Data number plan (ITU recommendation X.121)"; break;
5289 case 0x04: str = "Telex numbering plan (ITU recommendation F.69)"; break;
5290 case 0x07: str = "Reserved for extension"; break;
5291 case 0x08: str = "National numbering plan"; break;
5292 case 0x09: str = "Private numbering plan"; break;
5298 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
5299 proto_tree_add_text(tree,
5300 tvb, curr_offset, 1,
5301 "%s : Numbering Plan Identification: %s",
5307 poctets = tvb_get_string(tvb, curr_offset, len - (curr_offset - offset));
5309 proto_tree_add_string_format(tree, hf_ansi_a_cld_party_ascii_num,
5310 tvb, curr_offset, len - (curr_offset - offset),
5314 curr_offset += len - (curr_offset - offset);
5316 sprintf(add_string, " - (%s)", poctets);
5319 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
5321 return(curr_offset - offset);
5328 elem_band_class(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
5331 guint32 curr_offset;
5335 curr_offset = offset;
5337 oct = tvb_get_guint8(tvb, curr_offset);
5339 other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
5340 proto_tree_add_text(tree,
5341 tvb, curr_offset, 1,
5345 temp_int = oct & 0x1f;
5346 if ((temp_int < 0) || (temp_int >= (gint) NUM_BAND_CLASS_STR))
5352 str = band_class_str[temp_int];
5355 other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
5356 proto_tree_add_text(tree,
5357 tvb, curr_offset, 1,
5358 "%s : Band Class: %s",
5364 sprintf(add_string, " - (%s)", str);
5366 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
5368 return(curr_offset - offset);
5390 elem_is2000_cause(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
5392 guint32 curr_offset;
5394 add_string = add_string;
5395 curr_offset = offset;
5397 proto_tree_add_text(tree, tvb, curr_offset, len, "IS-95/IS-2000 Cause Information");
5401 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
5403 return(curr_offset - offset);
5425 elem_auth_event(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
5428 guint32 curr_offset;
5431 add_string = add_string;
5432 curr_offset = offset;
5436 oct = tvb_get_guint8(tvb, curr_offset);
5440 case 0x01: str = "Event: Authentication parameters were NOT received from mobile"; break;
5441 case 0x02: str = "Event: RANDC mis-match"; break;
5447 proto_tree_add_text(tree, tvb, curr_offset, len,
5452 proto_tree_add_text(tree, tvb, curr_offset, len, "Event");
5457 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
5459 return(curr_offset - offset);
5574 * Generic decode is good enough
5631 elem_cct_group(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
5635 guint32 curr_offset;
5637 curr_offset = offset;
5639 oct = tvb_get_guint8(tvb, curr_offset);
5641 other_decode_bitfield_value(a_bigbuf, oct, 0xfc, 8);
5642 proto_tree_add_text(tree,
5643 tvb, curr_offset, 1,
5647 other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
5648 proto_tree_add_text(tree,
5649 tvb, curr_offset, 1,
5650 "%s : All Circuits",
5653 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
5654 proto_tree_add_text(tree,
5655 tvb, curr_offset, 1,
5661 NO_MORE_DATA_CHECK(len);
5663 oct = tvb_get_guint8(tvb, curr_offset);
5665 proto_tree_add_text(tree,
5666 tvb, curr_offset, 1,
5667 "Count: %u circuit%s",
5668 oct, plurality(oct, "", "s"));
5670 sprintf(add_string, " - %u circuit%s",
5671 oct, plurality(oct, "", "s"));
5675 value = tvb_get_ntohs(tvb, curr_offset);
5677 other_decode_bitfield_value(a_bigbuf, value, 0xffe0, 16);
5678 proto_tree_add_text(tree,
5679 tvb, curr_offset, 2,
5680 "%s : PCM Multiplexer: %u",
5682 (value & 0xffe0) >> 5);
5684 other_decode_bitfield_value(a_bigbuf, value, 0x001f, 16);
5685 proto_tree_add_text(tree,
5686 tvb, curr_offset, 2,
5687 "%s : Timeslot: %u",
5693 NO_MORE_DATA_CHECK(len);
5695 proto_tree_add_text(tree,
5696 tvb, curr_offset, len - (curr_offset - offset),
5699 curr_offset += len - (curr_offset - offset);
5701 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
5703 return(curr_offset - offset);
5710 elem_paca_ts(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
5712 guint32 curr_offset;
5714 add_string = add_string;
5715 curr_offset = offset;
5717 proto_tree_add_text(tree, tvb, curr_offset, len, "PACA Queuing Time");
5721 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
5723 return(curr_offset - offset);
5730 elem_paca_order(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
5733 guint32 curr_offset;
5736 curr_offset = offset;
5738 oct = tvb_get_guint8(tvb, curr_offset);
5740 other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
5741 proto_tree_add_text(tree,
5742 tvb, curr_offset, 1,
5748 case 0: str = "Reserved"; break;
5749 case 1: str = "Update Queue Position and notify MS"; break;
5750 case 2: str = "Remove MS from the queue and release MS"; break;
5751 case 3: str = "Remove MS from the queue"; break;
5752 case 4: str = "MS Requested PACA Cancel"; break;
5753 case 5: str = "BS Requested PACA Cancel"; break;
5755 str = "All other values Reserved";
5759 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
5760 proto_tree_add_text(tree,
5761 tvb, curr_offset, 1,
5762 "%s : PACA Action Required: %s",
5768 sprintf(add_string, " - (%s)", str);
5770 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
5772 return(curr_offset - offset);
5779 elem_paca_reoi(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string)
5782 guint32 curr_offset;
5784 curr_offset = offset;
5786 oct = tvb_get_guint8(tvb, curr_offset);
5788 other_decode_bitfield_value(a_bigbuf, oct, 0xfe, 8);
5789 proto_tree_add_text(tree,
5790 tvb, curr_offset, 1,
5794 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
5795 proto_tree_add_text(tree,
5796 tvb, curr_offset, 1,
5797 "%s : PACA Reorigination Indicator (PRI)",
5802 sprintf(add_string, " - (%sReorigination)", (oct & 0x01) ? "" : "Not ");
5804 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
5806 return(curr_offset - offset);
5821 ANSI_A_E_ACC_NET_ID, /* Access Network Identifiers */
5822 ANSI_A_E_ADDS_USER_PART, /* ADDS User Part */
5823 ANSI_A_E_AMPS_HHO_PARAM, /* AMPS Hard Handoff Parameters */
5824 ANSI_A_E_ANCH_PDSN_ADDR, /* Anchor PDSN Address */
5825 ANSI_A_E_ANCH_PP_ADDR, /* Anchor P-P Address */
5826 ANSI_A_E_AUTH_CHLG_PARAM, /* Authentication Challenge Parameter */
5827 ANSI_A_E_AUTH_CNF_PARAM, /* Authentication Confirmation Parameter (RANDC) */
5828 ANSI_A_E_AUTH_DATA, /* Authentication Data */
5829 ANSI_A_E_AUTH_EVENT, /* Authentication Event */
5830 ANSI_A_E_AUTH_PARAM_COUNT, /* Authentication Parameter COUNT */
5831 ANSI_A_E_AUTH_RESP_PARAM, /* Authentication Response Parameter */
5832 ANSI_A_E_BAND_CLASS, /* Band Class */
5833 ANSI_A_E_CLD_PARTY_ASCII_NUM, /* Called Party ASCII Number */
5834 ANSI_A_E_CLD_PARTY_BCD_NUM, /* Called Party BCD Number */
5835 ANSI_A_E_CLG_PARTY_ASCII_NUM, /* Calling Party ASCII Number */
5836 ANSI_A_E_CAUSE, /* Cause */
5837 ANSI_A_E_CAUSE_L3, /* Cause Layer 3 */
5838 ANSI_A_E_CDMA_SOWD, /* CDMA Serving One Way Delay */
5839 ANSI_A_E_CELL_ID, /* Cell Identifier */
5840 ANSI_A_E_CELL_ID_LIST, /* Cell Identifier List */
5841 ANSI_A_E_CHAN_NUM, /* Channel Number */
5842 ANSI_A_E_CHAN_TYPE, /* Channel Type */
5843 ANSI_A_E_CCT_GROUP, /* Circuit Group */
5844 ANSI_A_E_CIC, /* Circuit Identity Code */
5845 ANSI_A_E_CIC_EXT, /* Circuit Identity Code Extension */
5846 ANSI_A_E_CM_INFO_TYPE_2, /* Classmark Information Type 2 */
5847 ANSI_A_E_DOWNLINK_RE, /* Downlink Radio Environment */
5848 ANSI_A_E_DOWNLINK_RE_LIST, /* Downlink Radio Environment List */
5849 ANSI_A_E_ENC_INFO, /* Encryption Information */
5850 ANSI_A_E_EXT_HO_DIR_PARAMS, /* Extended Handoff Direction Parameters */
5851 ANSI_A_E_GEO_LOC, /* Geographic Location */
5852 ANSI_A_E_SSCI, /* Special Service Call Indicator */
5853 ANSI_A_E_HO_POW_LEV, /* Handoff Power Level */
5854 ANSI_A_E_HHO_PARAMS, /* Hard Handoff Parameters */
5855 ANSI_A_E_IE_REQD, /* Information Element Requested */
5856 ANSI_A_E_IS2000_CHAN_ID, /* IS-2000 Channel Identity */
5857 ANSI_A_E_IS2000_CHAN_ID_3X, /* IS-2000 Channel Identity 3X */
5858 ANSI_A_E_IS2000_MOB_CAP, /* IS-2000 Mobile Capabilities */
5859 ANSI_A_E_IS2000_NN_SCR, /* IS-2000 Non-Negotiable Service Configuration Record */
5860 ANSI_A_E_IS2000_SCR, /* IS-2000 Service Configuration Record */
5861 ANSI_A_E_IS2000_CAUSE, /* IS-95/IS-2000 Cause Value */
5862 ANSI_A_E_IS2000_RED_RECORD, /* IS-2000 Redirection Record */
5863 ANSI_A_E_IS95_CHAN_ID, /* IS-95 Channel Identity */
5864 ANSI_A_E_IS95_MS_MEAS_CHAN_ID, /* IS-95 MS Measured Channel Identity */
5865 ANSI_A_E_L3_INFO, /* Layer 3 Information */
5866 ANSI_A_E_LAI, /* Location Area Information */
5867 ANSI_A_E_MWI, /* Message Waiting Indication */
5868 ANSI_A_E_MID, /* Mobile Identity */
5869 ANSI_A_E_MS_INFO_RECS, /* MS Information Records */
5870 ANSI_A_E_ORIG_CI, /* Origination Continuation Indicator */
5871 ANSI_A_E_PACA_ORDER, /* PACA Order */
5872 ANSI_A_E_PACA_REOI, /* PACA Reorigination Indicator */
5873 ANSI_A_E_PACA_TS, /* PACA Timestamp */
5874 ANSI_A_E_PSP, /* Packet Session Parameters */
5875 ANSI_A_E_PDSN_IP_ADDR, /* PDSN IP Address */
5876 ANSI_A_E_PDI, /* Power Down Indicator */
5877 ANSI_A_E_PRIO, /* Priority */
5878 ANSI_A_E_PREV, /* Protocol Revision */
5879 ANSI_A_E_PTYPE, /* Protocol Type */
5880 ANSI_A_E_PSMM_COUNT, /* PSMM Count */
5881 ANSI_A_E_QOS_PARAMS, /* Quality of Service Parameters */
5882 ANSI_A_E_RE_RES, /* Radio Environment and Resources */
5883 ANSI_A_E_REG_TYPE, /* Registration Type */
5884 ANSI_A_E_REJ_CAUSE, /* Reject Cause */
5885 ANSI_A_E_RESP_REQ, /* Response Request */
5886 ANSI_A_E_RET_CAUSE, /* Return Cause */
5887 ANSI_A_E_RF_CHAN_ID, /* RF Channel Identity */
5888 ANSI_A_E_SO, /* Service Option */
5889 ANSI_A_E_SOCI, /* Service Option Connection Identifier (SOCI) */
5890 ANSI_A_E_SO_LIST, /* Service Option List */
5891 ANSI_A_E_S_RED_INFO, /* Service Redirection Info */
5892 ANSI_A_E_SR_ID, /* Session Reference Identifier (SR_ID) */
5893 ANSI_A_E_SID, /* SID */
5894 ANSI_A_E_SIGNAL, /* Signal */
5895 ANSI_A_E_SCI, /* Slot Cycle Index */
5896 ANSI_A_E_SW_VER, /* Software Version */
5897 ANSI_A_E_SRNC_TRNC_TC, /* Source RNC to Target RNC Transparent Container */
5898 ANSI_A_E_S_PDSN_ADDR, /* Source PDSN Address */
5899 ANSI_A_E_TAG, /* Tag */
5900 ANSI_A_E_TRNC_SRNC_TC, /* Target RNC to Source RNC Transparent Container */
5901 ANSI_A_E_XMODE, /* Transcoder Mode */
5902 ANSI_A_E_UZ_ID, /* User Zone ID */
5903 ANSI_A_E_VP_REQ, /* Voice Privacy Request */
5904 ANSI_A_E_NONE /* NONE */
5908 #define NUM_ELEM_1 (sizeof(ansi_a_ios401_elem_1_strings)/sizeof(value_string))
5909 static gint ett_ansi_elem_1[NUM_ELEM_1];
5910 static guint8 (*elem_1_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string) = {
5911 NULL, /* Access Network Identifiers */
5912 elem_adds_user_part, /* ADDS User Part */
5913 NULL, /* AMPS Hard Handoff Parameters */
5914 NULL, /* Anchor PDSN Address */
5915 NULL, /* Anchor P-P Address */
5916 elem_auth_chlg_param, /* Authentication Challenge Parameter */
5917 NULL /* no decode required */, /* Authentication Confirmation Parameter (RANDC) */
5918 NULL /* no decode required */, /* Authentication Data */
5919 elem_auth_event, /* Authentication Event */
5920 elem_auth_param_count, /* Authentication Parameter COUNT */
5921 elem_auth_resp_param, /* Authentication Response Parameter */
5922 elem_band_class, /* Band Class */
5923 elem_cld_party_ascii_num, /* Called Party ASCII Number */
5924 elem_cld_party_bcd_num, /* Called Party BCD Number */
5925 elem_clg_party_ascii_num, /* Calling Party ASCII Number */
5926 elem_cause, /* Cause */
5927 elem_cause_l3, /* Cause Layer 3 */
5928 elem_cdma_sowd, /* CDMA Serving One Way Delay */
5929 elem_cell_id, /* Cell Identifier */
5930 elem_cell_id_list, /* Cell Identifier List */
5931 elem_chan_num, /* Channel Number */
5932 elem_chan_type, /* Channel Type */
5933 elem_cct_group, /* Circuit Group */
5934 elem_cic, /* Circuit Identity Code */
5935 elem_cic_ext, /* Circuit Identity Code Extension */
5936 elem_cm_info_type_2, /* Classmark Information Type 2 */
5937 elem_downlink_re, /* Downlink Radio Environment */
5938 NULL, /* Downlink Radio Environment List */
5939 elem_enc_info, /* Encryption Information */
5940 elem_ext_ho_dir_params, /* Extended Handoff Direction Parameters */
5941 NULL, /* Geographic Location */
5942 NULL, /* Special Service Call Indicator */
5943 elem_ho_pow_lev, /* Handoff Power Level */
5944 elem_hho_params, /* Hard Handoff Parameters */
5945 NULL, /* Information Element Requested */
5946 elem_is2000_chan_id, /* IS-2000 Channel Identity */
5947 NULL, /* IS-2000 Channel Identity 3X */
5948 elem_is2000_mob_cap, /* IS-2000 Mobile Capabilities */
5949 elem_is2000_nn_scr, /* IS-2000 Non-Negotiable Service Configuration Record */
5950 elem_is2000_scr, /* IS-2000 Service Configuration Record */
5951 elem_is2000_cause, /* IS-95/IS-2000 Cause Value */
5952 NULL, /* IS-2000 Redirection Record */
5953 elem_is95_chan_id, /* IS-95 Channel Identity */
5954 elem_is95_ms_meas_chan_id, /* IS-95 MS Measured Channel Identity */
5955 elem_l3_info, /* Layer 3 Information */
5956 elem_lai, /* Location Area Information */
5957 elem_mwi, /* Message Waiting Indication */
5958 elem_mid, /* Mobile Identity */
5959 elem_ms_info_recs, /* MS Information Records */
5960 NULL, /* Origination Continuation Indicator */
5961 elem_paca_order, /* PACA Order */
5962 elem_paca_reoi, /* PACA Reorigination Indicator */
5963 elem_paca_ts, /* PACA Timestamp */
5964 NULL, /* Packet Session Parameters */
5965 elem_pdsn_ip_addr, /* PDSN IP Address */
5966 NULL /* no associated data */, /* Power Down Indicator */
5967 elem_prio, /* Priority */
5968 NULL, /* Protocol Revision */
5969 elem_ptype, /* Protocol Type */
5970 NULL, /* PSMM Count */
5971 elem_qos_params, /* Quality of Service Parameters */
5972 elem_re_res, /* Radio Environment and Resources */
5973 elem_reg_type, /* Registration Type */
5974 elem_rej_cause, /* Reject Cause */
5975 NULL /* no associated data */, /* Response Request */
5976 NULL, /* Return Cause */
5977 elem_rf_chan_id, /* RF Channel Identity */
5978 elem_so, /* Service Option */
5979 NULL, /* Service Option Connection Identifier (SOCI) */
5980 NULL, /* Service Option List */
5981 NULL, /* Service Redirection Info */
5982 NULL, /* Session Reference Identifier (SR_ID) */
5984 elem_signal, /* Signal */
5985 elem_sci, /* Slot Cycle Index */
5986 elem_sw_ver, /* Software Version */
5987 NULL, /* Source RNC to Target RNC Transparent Container */
5988 NULL, /* Source PDSN Address */
5990 NULL, /* Target RNC to Source RNC Transparent Container */
5991 elem_xmode, /* Transcoder Mode */
5992 elem_uz_id, /* User Zone ID */
5993 NULL /* no associated data */, /* Voice Privacy Request */
5997 /* MESSAGE FUNCTIONS */
6000 * Type Length Value (TLV) element dissector
6003 elem_tlv(tvbuff_t *tvb, proto_tree *tree, elem_idx_t idx, guint32 offset, guint len, gchar *name_add)
6005 guint8 oct, parm_len;
6007 guint32 curr_offset;
6008 proto_tree *subtree;
6012 curr_offset = offset;
6015 oct = tvb_get_guint8(tvb, curr_offset);
6017 if (oct == (guint8) ansi_a_ios401_elem_1_strings[idx].value)
6019 parm_len = tvb_get_guint8(tvb, curr_offset + 1);
6022 proto_tree_add_text(tree,
6023 tvb, curr_offset, parm_len + 2,
6025 ansi_a_ios401_elem_1_strings[idx].strptr,
6026 (name_add == NULL) || (name_add[0] == '\0') ? "" : name_add);
6028 subtree = proto_item_add_subtree(item, ett_ansi_elem_1[idx]);
6030 proto_tree_add_uint(subtree, hf_ansi_a_elem_id, tvb,
6031 curr_offset, 1, oct);
6033 proto_tree_add_uint(subtree, hf_ansi_a_length, tvb,
6034 curr_offset + 1, 1, parm_len);
6038 if (elem_1_fcn[idx] == NULL)
6040 proto_tree_add_text(subtree,
6041 tvb, curr_offset + 2, parm_len,
6044 consumed = parm_len;
6048 a_add_string[0] = '\0';
6050 (*elem_1_fcn[idx])(tvb, subtree, curr_offset + 2,
6051 parm_len, a_add_string);
6053 if (a_add_string[0] != '\0')
6055 proto_item_append_text(item, a_add_string);
6056 a_add_string[0] = '\0';
6068 * Type Value (TV) element dissector
6070 * Length cannot be used in these functions, big problem if a element dissector
6071 * is not defined for these.
6074 elem_tv(tvbuff_t *tvb, proto_tree *tree, elem_idx_t idx, guint32 offset, gchar *name_add)
6078 guint32 curr_offset;
6079 proto_tree *subtree;
6082 curr_offset = offset;
6085 oct = tvb_get_guint8(tvb, curr_offset);
6087 if (oct == (guint8) ansi_a_ios401_elem_1_strings[idx].value)
6090 proto_tree_add_text(tree,
6091 tvb, curr_offset, -1,
6093 ansi_a_ios401_elem_1_strings[idx].strptr,
6094 (name_add == NULL) || (name_add[0] == '\0') ? "" : name_add);
6096 subtree = proto_item_add_subtree(item, ett_ansi_elem_1[idx]);
6098 proto_tree_add_uint(subtree, hf_ansi_a_elem_id, tvb, curr_offset, 1, oct);
6100 if (elem_1_fcn[idx] == NULL)
6102 /* BAD THING, CANNOT DETERMINE LENGTH */
6104 proto_tree_add_text(subtree,
6105 tvb, curr_offset + 1, 1,
6106 "No element dissector, rest of dissection may be incorrect");
6112 a_add_string[0] = '\0';
6113 consumed = (*elem_1_fcn[idx])(tvb, subtree, curr_offset + 1, -1, a_add_string);
6115 if (a_add_string[0] != '\0')
6117 proto_item_append_text(item, a_add_string);
6118 a_add_string[0] = '\0';
6124 proto_item_set_len(item, consumed);
6131 * Type (T) element dissector
6133 * Length cannot be used in these functions, big problem if a element dissector
6134 * is not defined for these.
6137 elem_t(tvbuff_t *tvb, proto_tree *tree, elem_idx_t idx, guint32 offset, gchar *name_add)
6140 guint32 curr_offset;
6143 curr_offset = offset;
6146 oct = tvb_get_guint8(tvb, curr_offset);
6148 if (oct == (guint8) ansi_a_ios401_elem_1_strings[idx].value)
6150 proto_tree_add_uint_format(tree, hf_ansi_a_elem_id, tvb, curr_offset, 1, oct,
6152 ansi_a_ios401_elem_1_strings[idx].strptr,
6153 (name_add == NULL) || (name_add[0] == '\0') ? "" : name_add);
6162 * Length Value (LV) element dissector
6165 elem_lv(tvbuff_t *tvb, proto_tree *tree, elem_idx_t idx, guint32 offset, guint len, gchar *name_add)
6169 guint32 curr_offset;
6170 proto_tree *subtree;
6174 curr_offset = offset;
6177 parm_len = tvb_get_guint8(tvb, curr_offset);
6180 proto_tree_add_text(tree,
6181 tvb, curr_offset, parm_len + 1,
6183 ansi_a_ios401_elem_1_strings[idx].strptr,
6184 (name_add == NULL) || (name_add[0] == '\0') ? "" : name_add);
6186 subtree = proto_item_add_subtree(item, ett_ansi_elem_1[idx]);
6188 proto_tree_add_uint(subtree, hf_ansi_a_length, tvb,
6189 curr_offset, 1, parm_len);
6193 if (elem_1_fcn[idx] == NULL)
6195 proto_tree_add_text(subtree,
6196 tvb, curr_offset + 1, parm_len,
6199 consumed = parm_len;
6203 a_add_string[0] = '\0';
6205 (*elem_1_fcn[idx])(tvb, subtree, curr_offset + 1,
6206 parm_len, a_add_string);
6208 if (a_add_string[0] != '\0')
6210 proto_item_append_text(item, a_add_string);
6211 a_add_string[0] = '\0';
6216 return(consumed + 1);
6220 * Value (V) element dissector
6222 * Length cannot be used in these functions, big problem if a element dissector
6223 * is not defined for these.
6226 elem_v(tvbuff_t *tvb, proto_tree *tree, elem_idx_t idx, guint32 offset)
6229 guint32 curr_offset;
6231 curr_offset = offset;
6234 if (elem_1_fcn[idx] == NULL)
6236 /* BAD THING, CANNOT DETERMINE LENGTH */
6238 proto_tree_add_text(tree,
6239 tvb, curr_offset, 1,
6240 "No element dissector, rest of dissection may be incorrect");
6246 a_add_string[0] = '\0';
6247 consumed = (*elem_1_fcn[idx])(tvb, tree, curr_offset, -1, a_add_string);
6248 a_add_string[0] = '\0';
6255 #define ELEM_MAND_TLV(elem_idx, elem_name_addition) \
6257 if ((consumed = elem_tlv(tvb, tree, elem_idx, curr_offset, curr_len, 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_TLV(elem_idx, elem_name_addition) \
6277 if ((consumed = elem_tlv(tvb, tree, elem_idx, curr_offset, curr_len, elem_name_addition)) > 0) \
6279 curr_offset += consumed; \
6280 curr_len -= consumed; \
6282 if (curr_len <= 0) return; \
6285 #define ELEM_MAND_TV(elem_idx, elem_name_addition) \
6287 if ((consumed = elem_tv(tvb, tree, elem_idx, curr_offset, elem_name_addition)) > 0) \
6289 curr_offset += consumed; \
6290 curr_len -= consumed; \
6294 proto_tree_add_text(tree, \
6295 tvb, curr_offset, 0, \
6296 "Missing Mandatory element (0x%02x) %s%s, rest of dissection is suspect", \
6297 ansi_a_ios401_elem_1_strings[elem_idx].value, \
6298 ansi_a_ios401_elem_1_strings[elem_idx].strptr, \
6299 (elem_name_addition == NULL) || (elem_name_addition[0] == '\0') ? "" : elem_name_addition \
6302 if (curr_len <= 0) return; \
6305 #define ELEM_OPT_TV(elem_idx, elem_name_addition) \
6307 if ((consumed = elem_tv(tvb, tree, elem_idx, curr_offset, elem_name_addition)) > 0) \
6309 curr_offset += consumed; \
6310 curr_len -= consumed; \
6312 if (curr_len <= 0) return; \
6315 #define ELEM_OPT_T(elem_idx, elem_name_addition) \
6317 if ((consumed = elem_t(tvb, tree, elem_idx, curr_offset, elem_name_addition)) > 0) \
6319 curr_offset += consumed; \
6320 curr_len -= consumed; \
6322 if (curr_len <= 0) return; \
6325 #define ELEM_MAND_LV(elem_idx, elem_name_addition) \
6327 if ((consumed = elem_lv(tvb, tree, elem_idx, curr_offset, curr_len, elem_name_addition)) > 0) \
6329 curr_offset += consumed; \
6330 curr_len -= consumed; \
6334 /* Mandatory, but nothing we can do */ \
6336 if (curr_len <= 0) return; \
6339 #define ELEM_MAND_V(elem_idx) \
6341 if ((consumed = elem_v(tvb, tree, elem_idx, curr_offset)) > 0) \
6343 curr_offset += consumed; \
6344 curr_len -= consumed; \
6348 /* Mandatory, but nothing we can do */ \
6350 if (curr_len <= 0) return; \
6358 bsmap_cl3_info(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6361 guint32 curr_offset;
6364 curr_offset = offset;
6367 ELEM_MAND_TLV(ANSI_A_E_CELL_ID, "");
6369 ELEM_MAND_TLV(ANSI_A_E_L3_INFO, "");
6371 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6378 dtap_cm_srvc_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6380 guint32 curr_offset;
6384 proto_tree *subtree;
6388 curr_offset = offset;
6392 * special dissection for CM Service Type
6394 oct = tvb_get_guint8(tvb, curr_offset);
6398 case 0x01: str = "Mobile Originating Call"; break;
6405 proto_tree_add_text(tree,
6406 tvb, curr_offset, 1,
6407 "CM Service Type: %s",
6410 subtree = proto_item_add_subtree(item, ett_cm_srvc_type);
6412 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
6413 proto_tree_add_text(subtree,
6414 tvb, curr_offset, 1,
6418 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
6419 proto_tree_add_text(subtree,
6420 tvb, curr_offset, 1,
6421 "%s : Service Type: (%u) %s",
6429 ELEM_MAND_LV(ANSI_A_E_CM_INFO_TYPE_2, "");
6431 ELEM_MAND_LV(ANSI_A_E_MID, "");
6433 ELEM_OPT_TLV(ANSI_A_E_CLD_PARTY_BCD_NUM, "");
6435 ELEM_OPT_TLV(ANSI_A_E_MID, "");
6437 ELEM_OPT_TV(ANSI_A_E_SCI, "");
6439 ELEM_OPT_TLV(ANSI_A_E_AUTH_RESP_PARAM, "");
6441 ELEM_OPT_TV(ANSI_A_E_AUTH_CNF_PARAM, "");
6443 ELEM_OPT_TV(ANSI_A_E_AUTH_PARAM_COUNT, "");
6445 ELEM_OPT_TLV(ANSI_A_E_AUTH_CHLG_PARAM, "");
6447 ELEM_OPT_TV(ANSI_A_E_SO, "");
6449 ELEM_OPT_T(ANSI_A_E_VP_REQ, "");
6451 ELEM_OPT_TV(ANSI_A_E_RE_RES, "");
6453 ELEM_OPT_TLV(ANSI_A_E_CLD_PARTY_ASCII_NUM, "");
6455 ELEM_OPT_TV(ANSI_A_E_CIC, "");
6457 ELEM_OPT_TLV(ANSI_A_E_AUTH_EVENT, "");
6459 ELEM_OPT_TLV(ANSI_A_E_AUTH_DATA, "");
6461 ELEM_OPT_TLV(ANSI_A_E_PACA_REOI, "");
6463 ELEM_OPT_TLV(ANSI_A_E_UZ_ID, "");
6465 ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
6467 ELEM_OPT_TLV(ANSI_A_E_CDMA_SOWD, "");
6469 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6476 bsmap_page_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6478 guint32 curr_offset;
6482 curr_offset = offset;
6485 ELEM_MAND_TLV(ANSI_A_E_MID, "");
6487 ELEM_OPT_TV(ANSI_A_E_TAG, "");
6489 ELEM_OPT_TLV(ANSI_A_E_CELL_ID_LIST, "");
6491 ELEM_OPT_TV(ANSI_A_E_SCI, "");
6493 ELEM_OPT_TV(ANSI_A_E_SO, "");
6495 ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
6497 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6504 dtap_page_resp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6506 guint32 curr_offset;
6510 curr_offset = offset;
6513 ELEM_MAND_LV(ANSI_A_E_CM_INFO_TYPE_2, "");
6515 ELEM_MAND_LV(ANSI_A_E_MID, "");
6517 ELEM_OPT_TV(ANSI_A_E_TAG, "");
6519 ELEM_OPT_TLV(ANSI_A_E_MID, "");
6521 ELEM_OPT_TV(ANSI_A_E_SCI, "");
6523 ELEM_OPT_TLV(ANSI_A_E_AUTH_RESP_PARAM, "");
6525 ELEM_OPT_TV(ANSI_A_E_AUTH_CNF_PARAM, "");
6527 ELEM_OPT_TV(ANSI_A_E_AUTH_PARAM_COUNT, "");
6529 ELEM_OPT_TLV(ANSI_A_E_AUTH_CHLG_PARAM, "");
6531 ELEM_OPT_TV(ANSI_A_E_SO, "");
6533 ELEM_OPT_T(ANSI_A_E_VP_REQ, "");
6535 ELEM_OPT_TV(ANSI_A_E_CIC, "");
6537 ELEM_OPT_TLV(ANSI_A_E_AUTH_EVENT, "");
6539 ELEM_OPT_TV(ANSI_A_E_RE_RES, "");
6541 ELEM_OPT_TLV(ANSI_A_E_UZ_ID, "");
6543 ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
6545 ELEM_OPT_TLV(ANSI_A_E_CDMA_SOWD, "");
6547 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6554 dtap_progress(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6556 guint32 curr_offset;
6560 curr_offset = offset;
6563 ELEM_OPT_TV(ANSI_A_E_SIGNAL, "");
6565 ELEM_OPT_TLV(ANSI_A_E_MS_INFO_RECS, "");
6567 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6574 bsmap_ass_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6577 guint32 curr_offset;
6580 curr_offset = offset;
6583 ELEM_MAND_TLV(ANSI_A_E_CHAN_TYPE, "");
6585 ELEM_OPT_TV(ANSI_A_E_CIC, "");
6587 ELEM_OPT_TLV(ANSI_A_E_ENC_INFO, "");
6589 ELEM_OPT_TV(ANSI_A_E_SO, "");
6591 ELEM_OPT_TV(ANSI_A_E_SIGNAL, "");
6593 ELEM_OPT_TLV(ANSI_A_E_CLG_PARTY_ASCII_NUM, "");
6595 ELEM_OPT_TLV(ANSI_A_E_MS_INFO_RECS, "");
6597 ELEM_OPT_TLV(ANSI_A_E_PRIO, "");
6599 ELEM_OPT_TLV(ANSI_A_E_PACA_TS, "");
6601 ELEM_OPT_TLV(ANSI_A_E_QOS_PARAMS, "");
6603 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6610 bsmap_ass_complete(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6613 guint32 curr_offset;
6616 curr_offset = offset;
6619 ELEM_MAND_TV(ANSI_A_E_CHAN_NUM, "");
6621 ELEM_OPT_TLV(ANSI_A_E_ENC_INFO, "");
6623 ELEM_OPT_TV(ANSI_A_E_SO, "");
6625 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6632 bsmap_ass_failure(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6635 guint32 curr_offset;
6638 curr_offset = offset;
6641 ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
6643 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6650 bsmap_clr_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6653 guint32 curr_offset;
6656 curr_offset = offset;
6659 ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
6661 ELEM_OPT_TLV(ANSI_A_E_CAUSE_L3, "");
6663 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6670 bsmap_clr_command(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6673 guint32 curr_offset;
6676 curr_offset = offset;
6679 ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
6681 ELEM_OPT_TLV(ANSI_A_E_CAUSE_L3, "");
6683 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6690 bsmap_clr_complete(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6693 guint32 curr_offset;
6696 curr_offset = offset;
6699 ELEM_OPT_T(ANSI_A_E_PDI, "");
6701 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6708 dtap_alert_with_info(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6710 guint32 curr_offset;
6714 curr_offset = offset;
6717 ELEM_OPT_TLV(ANSI_A_E_MS_INFO_RECS, "");
6719 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6726 bsmap_bs_srvc_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6728 guint32 curr_offset;
6732 curr_offset = offset;
6735 ELEM_MAND_TLV(ANSI_A_E_MID, "");
6737 ELEM_OPT_TLV(ANSI_A_E_MID, "");
6739 ELEM_OPT_TV(ANSI_A_E_SO, "");
6741 ELEM_OPT_TV(ANSI_A_E_TAG, "");
6743 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6750 bsmap_bs_srvc_resp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6752 guint32 curr_offset;
6756 curr_offset = offset;
6759 ELEM_MAND_TLV(ANSI_A_E_MID, "");
6761 ELEM_OPT_TLV(ANSI_A_E_MID, "");
6763 ELEM_OPT_TV(ANSI_A_E_TAG, "");
6765 ELEM_OPT_TLV(ANSI_A_E_CAUSE, "");
6767 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6774 dtap_flash_with_info(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6776 guint32 curr_offset;
6780 curr_offset = offset;
6783 ELEM_OPT_TLV(ANSI_A_E_CLD_PARTY_BCD_NUM, "");
6785 ELEM_OPT_TV(ANSI_A_E_SIGNAL, "");
6787 ELEM_OPT_TV(ANSI_A_E_MWI, "");
6789 ELEM_OPT_TLV(ANSI_A_E_CLG_PARTY_ASCII_NUM, "");
6791 ELEM_OPT_TV(ANSI_A_E_TAG, "");
6793 ELEM_OPT_TLV(ANSI_A_E_MS_INFO_RECS, "");
6795 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6802 dtap_flash_with_info_ack(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6804 guint32 curr_offset;
6808 curr_offset = offset;
6811 ELEM_OPT_TV(ANSI_A_E_TAG, "");
6813 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6820 bsmap_feat_noti(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6822 guint32 curr_offset;
6826 curr_offset = offset;
6829 ELEM_MAND_TLV(ANSI_A_E_MID, "");
6831 ELEM_OPT_TV(ANSI_A_E_TAG, "");
6833 ELEM_OPT_TLV(ANSI_A_E_CELL_ID_LIST, "");
6835 ELEM_OPT_TV(ANSI_A_E_SCI, "");
6837 ELEM_OPT_TV(ANSI_A_E_SIGNAL, "");
6839 ELEM_OPT_TV(ANSI_A_E_MWI, "");
6841 ELEM_OPT_TLV(ANSI_A_E_CLG_PARTY_ASCII_NUM, "");
6843 ELEM_OPT_TLV(ANSI_A_E_MS_INFO_RECS, "");
6845 ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
6847 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6854 bsmap_feat_noti_ack(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6856 guint32 curr_offset;
6860 curr_offset = offset;
6863 ELEM_MAND_TLV(ANSI_A_E_MID, "");
6865 ELEM_OPT_TV(ANSI_A_E_TAG, "");
6867 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6874 bsmap_paca_command(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6876 guint32 curr_offset;
6880 curr_offset = offset;
6883 ELEM_OPT_TLV(ANSI_A_E_PRIO, "");
6885 ELEM_OPT_TLV(ANSI_A_E_PACA_TS, "");
6887 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6894 bsmap_paca_command_ack(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6896 guint32 curr_offset;
6900 curr_offset = offset;
6903 ELEM_OPT_TLV(ANSI_A_E_CAUSE, "");
6905 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6912 bsmap_paca_update(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6914 guint32 curr_offset;
6918 curr_offset = offset;
6921 ELEM_OPT_TLV(ANSI_A_E_MID, "");
6923 ELEM_OPT_TLV(ANSI_A_E_MID, "");
6925 ELEM_OPT_TLV(ANSI_A_E_PACA_ORDER, "");
6927 ELEM_OPT_TLV(ANSI_A_E_PRIO, "");
6929 ELEM_OPT_TLV(ANSI_A_E_AUTH_RESP_PARAM, "");
6931 ELEM_OPT_TV(ANSI_A_E_AUTH_CNF_PARAM, "");
6933 ELEM_OPT_TV(ANSI_A_E_AUTH_PARAM_COUNT, "");
6935 ELEM_OPT_TLV(ANSI_A_E_AUTH_CHLG_PARAM, "");
6937 ELEM_OPT_TLV(ANSI_A_E_AUTH_EVENT, "");
6939 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6946 bsmap_paca_update_ack(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6948 guint32 curr_offset;
6952 curr_offset = offset;
6955 ELEM_OPT_TLV(ANSI_A_E_MID, "");
6957 ELEM_OPT_TLV(ANSI_A_E_PRIO, "");
6959 ELEM_OPT_TLV(ANSI_A_E_CAUSE, "");
6961 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6968 bsmap_auth_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6970 guint32 curr_offset;
6974 curr_offset = offset;
6977 ELEM_MAND_TLV(ANSI_A_E_AUTH_CHLG_PARAM, "");
6979 ELEM_OPT_TLV(ANSI_A_E_MID, "");
6981 ELEM_OPT_TV(ANSI_A_E_TAG, "");
6983 ELEM_OPT_TLV(ANSI_A_E_CELL_ID_LIST, "");
6985 ELEM_OPT_TV(ANSI_A_E_SCI, "");
6987 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6991 dtap_auth_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6993 guint32 curr_offset;
6997 curr_offset = offset;
7000 ELEM_MAND_LV(ANSI_A_E_AUTH_CHLG_PARAM, "");
7002 ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
7004 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7011 bsmap_auth_resp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7013 guint32 curr_offset;
7017 curr_offset = offset;
7020 ELEM_MAND_TLV(ANSI_A_E_AUTH_RESP_PARAM, "");
7022 ELEM_OPT_TLV(ANSI_A_E_MID, "");
7024 ELEM_OPT_TV(ANSI_A_E_TAG, "");
7026 ELEM_OPT_TLV(ANSI_A_E_MID, "");
7028 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7032 dtap_auth_resp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7034 guint32 curr_offset;
7038 curr_offset = offset;
7041 ELEM_MAND_LV(ANSI_A_E_AUTH_RESP_PARAM, "");
7043 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7050 bsmap_user_zone_update(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7052 guint32 curr_offset;
7056 curr_offset = offset;
7059 ELEM_OPT_TLV(ANSI_A_E_UZ_ID, "");
7061 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7068 dtap_ssd_update_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7070 guint32 curr_offset;
7074 curr_offset = offset;
7077 ELEM_MAND_LV(ANSI_A_E_AUTH_CHLG_PARAM, "");
7079 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7086 dtap_bs_challenge(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7088 guint32 curr_offset;
7092 curr_offset = offset;
7095 ELEM_MAND_LV(ANSI_A_E_AUTH_CHLG_PARAM, "");
7097 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7104 dtap_bs_challenge_resp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7106 guint32 curr_offset;
7110 curr_offset = offset;
7113 ELEM_MAND_LV(ANSI_A_E_AUTH_RESP_PARAM, "");
7115 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7122 dtap_ssd_update_resp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7124 guint32 curr_offset;
7128 curr_offset = offset;
7131 ELEM_OPT_TLV(ANSI_A_E_CAUSE_L3, "");
7133 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7140 dtap_lu_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7142 guint32 curr_offset;
7146 curr_offset = offset;
7149 ELEM_MAND_LV(ANSI_A_E_MID, "");
7151 ELEM_OPT_TV(ANSI_A_E_LAI, "");
7153 ELEM_OPT_TLV(ANSI_A_E_CM_INFO_TYPE_2, "");
7155 ELEM_OPT_TV(ANSI_A_E_REG_TYPE, "");
7157 ELEM_OPT_TLV(ANSI_A_E_MID, "");
7159 ELEM_OPT_TV(ANSI_A_E_SCI, "");
7161 ELEM_OPT_TLV(ANSI_A_E_AUTH_RESP_PARAM, "");
7163 ELEM_OPT_TV(ANSI_A_E_AUTH_CNF_PARAM, "");
7165 ELEM_OPT_TV(ANSI_A_E_AUTH_PARAM_COUNT, "");
7167 ELEM_OPT_TLV(ANSI_A_E_AUTH_CHLG_PARAM, "");
7169 ELEM_OPT_TLV(ANSI_A_E_AUTH_EVENT, "");
7171 ELEM_OPT_TLV(ANSI_A_E_UZ_ID, "");
7173 ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
7175 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7182 dtap_lu_accept(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7184 guint32 curr_offset;
7188 curr_offset = offset;
7191 ELEM_OPT_TV(ANSI_A_E_LAI, "");
7193 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7200 dtap_lu_reject(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7202 guint32 curr_offset;
7206 curr_offset = offset;
7209 ELEM_MAND_V(ANSI_A_E_REJ_CAUSE);
7211 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7218 bsmap_priv_mode_command(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7220 guint32 curr_offset;
7224 curr_offset = offset;
7227 ELEM_MAND_TLV(ANSI_A_E_ENC_INFO, "");
7229 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7236 bsmap_priv_mode_complete(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7238 guint32 curr_offset;
7242 curr_offset = offset;
7245 ELEM_OPT_TLV(ANSI_A_E_ENC_INFO, "");
7247 ELEM_OPT_T(ANSI_A_E_VP_REQ, "");
7249 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7256 bsmap_ho_reqd(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7258 guint32 curr_offset;
7262 curr_offset = offset;
7265 ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
7267 ELEM_MAND_TLV(ANSI_A_E_CELL_ID_LIST, " (Target)");
7269 ELEM_OPT_TLV(ANSI_A_E_CM_INFO_TYPE_2, "");
7271 ELEM_OPT_T(ANSI_A_E_RESP_REQ, "");
7273 ELEM_OPT_TLV(ANSI_A_E_ENC_INFO, "");
7275 ELEM_OPT_TLV(ANSI_A_E_IS95_CHAN_ID, "");
7277 ELEM_OPT_TLV(ANSI_A_E_MID, "");
7279 ELEM_OPT_TLV(ANSI_A_E_DOWNLINK_RE, "");
7281 ELEM_OPT_TV(ANSI_A_E_SO, "");
7283 ELEM_OPT_TLV(ANSI_A_E_CDMA_SOWD, "");
7285 ELEM_OPT_TLV(ANSI_A_E_IS95_MS_MEAS_CHAN_ID, "");
7287 ELEM_OPT_TLV(ANSI_A_E_IS2000_CHAN_ID, "");
7289 ELEM_OPT_TLV(ANSI_A_E_QOS_PARAMS, "");
7291 ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
7293 ELEM_OPT_TLV(ANSI_A_E_IS2000_SCR, "");
7295 ELEM_OPT_TLV(ANSI_A_E_PDSN_IP_ADDR, "");
7297 ELEM_OPT_TLV(ANSI_A_E_PTYPE, "");
7299 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7306 bsmap_ho_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7308 guint32 curr_offset;
7312 curr_offset = offset;
7315 ELEM_MAND_TLV(ANSI_A_E_CHAN_TYPE, "");
7317 ELEM_MAND_TLV(ANSI_A_E_ENC_INFO, "");
7319 ELEM_MAND_TLV(ANSI_A_E_CM_INFO_TYPE_2, "");
7321 ELEM_MAND_TLV(ANSI_A_E_CELL_ID_LIST, "(Target)");
7323 ELEM_OPT_TLV(ANSI_A_E_CIC_EXT, "");
7325 ELEM_OPT_TLV(ANSI_A_E_IS95_CHAN_ID, "");
7327 ELEM_OPT_TLV(ANSI_A_E_MID, "");
7329 ELEM_OPT_TLV(ANSI_A_E_MID, "");
7331 ELEM_OPT_TLV(ANSI_A_E_DOWNLINK_RE, "");
7333 ELEM_OPT_TV(ANSI_A_E_SO, "");
7335 ELEM_OPT_TLV(ANSI_A_E_CDMA_SOWD, "");
7337 ELEM_OPT_TLV(ANSI_A_E_IS95_MS_MEAS_CHAN_ID, "");
7339 ELEM_OPT_TLV(ANSI_A_E_IS2000_CHAN_ID, "");
7341 ELEM_OPT_TLV(ANSI_A_E_QOS_PARAMS, "");
7343 ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
7345 ELEM_OPT_TLV(ANSI_A_E_IS2000_SCR, "");
7347 ELEM_OPT_TLV(ANSI_A_E_PDSN_IP_ADDR, "");
7349 ELEM_OPT_TLV(ANSI_A_E_PTYPE, "");
7351 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7358 bsmap_ho_req_ack(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7360 guint32 curr_offset;
7364 curr_offset = offset;
7367 ELEM_OPT_TLV(ANSI_A_E_IS95_CHAN_ID, "");
7369 ELEM_OPT_TLV(ANSI_A_E_CELL_ID_LIST, "");
7371 ELEM_OPT_TLV(ANSI_A_E_EXT_HO_DIR_PARAMS, "");
7373 ELEM_OPT_TV(ANSI_A_E_HHO_PARAMS, "");
7375 ELEM_OPT_TLV(ANSI_A_E_IS2000_CHAN_ID, "");
7377 ELEM_OPT_TLV(ANSI_A_E_IS2000_SCR, "");
7379 ELEM_OPT_TLV(ANSI_A_E_IS2000_NN_SCR, "");
7381 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7388 bsmap_ho_failure(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7390 guint32 curr_offset;
7394 curr_offset = offset;
7397 ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
7399 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7406 bsmap_ho_command(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7408 guint32 curr_offset;
7412 curr_offset = offset;
7415 ELEM_OPT_TV(ANSI_A_E_RF_CHAN_ID, "");
7417 ELEM_OPT_TLV(ANSI_A_E_IS95_CHAN_ID, "");
7419 ELEM_OPT_TLV(ANSI_A_E_CELL_ID_LIST, "");
7421 ELEM_OPT_TLV(ANSI_A_E_HO_POW_LEV, "");
7423 ELEM_OPT_TV(ANSI_A_E_SID, "");
7425 ELEM_OPT_TLV(ANSI_A_E_EXT_HO_DIR_PARAMS, "");
7427 ELEM_OPT_TV(ANSI_A_E_HHO_PARAMS, "");
7429 ELEM_OPT_TLV(ANSI_A_E_IS2000_CHAN_ID, "");
7431 ELEM_OPT_TLV(ANSI_A_E_IS2000_SCR, "");
7433 ELEM_OPT_TLV(ANSI_A_E_IS2000_NN_SCR, "");
7435 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7442 bsmap_ho_reqd_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7444 guint32 curr_offset;
7448 curr_offset = offset;
7451 ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
7453 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7460 bsmap_ho_performed(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7462 guint32 curr_offset;
7466 curr_offset = offset;
7469 ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
7471 ELEM_OPT_TLV(ANSI_A_E_CELL_ID_LIST, "");
7473 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7480 bsmap_block(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7482 guint32 curr_offset;
7486 curr_offset = offset;
7489 ELEM_MAND_TV(ANSI_A_E_CIC, "");
7491 ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
7493 ELEM_OPT_TLV(ANSI_A_E_CCT_GROUP, "");
7495 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7502 bsmap_block_ack(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7504 guint32 curr_offset;
7508 curr_offset = offset;
7511 ELEM_MAND_TV(ANSI_A_E_CIC, "");
7513 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7520 bsmap_unblock(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7522 guint32 curr_offset;
7526 curr_offset = offset;
7529 ELEM_MAND_TV(ANSI_A_E_CIC, "");
7531 ELEM_OPT_TLV(ANSI_A_E_CCT_GROUP, "");
7533 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7540 bsmap_unblock_ack(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7542 guint32 curr_offset;
7546 curr_offset = offset;
7549 ELEM_MAND_TV(ANSI_A_E_CIC, "");
7551 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7558 bsmap_reset(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7560 guint32 curr_offset;
7564 curr_offset = offset;
7567 ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
7569 ELEM_OPT_TLV(ANSI_A_E_SW_VER, "");
7571 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7578 bsmap_reset_ack(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7580 guint32 curr_offset;
7584 curr_offset = offset;
7587 ELEM_OPT_TLV(ANSI_A_E_SW_VER, "");
7589 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7596 bsmap_reset_cct(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7598 guint32 curr_offset;
7602 curr_offset = offset;
7605 ELEM_MAND_TV(ANSI_A_E_CIC, "");
7607 ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
7609 ELEM_OPT_TLV(ANSI_A_E_CCT_GROUP, "");
7611 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7618 bsmap_reset_cct_ack(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7620 guint32 curr_offset;
7624 curr_offset = offset;
7627 ELEM_MAND_TV(ANSI_A_E_CIC, "");
7629 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7636 bsmap_xmode_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7638 guint32 curr_offset;
7642 curr_offset = offset;
7645 ELEM_MAND_TLV(ANSI_A_E_XMODE, "");
7647 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7654 bsmap_xmode_ack(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7656 guint32 curr_offset;
7660 curr_offset = offset;
7663 ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
7665 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7672 bsmap_adds_page(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7674 guint32 curr_offset;
7678 curr_offset = offset;
7681 ELEM_MAND_TLV(ANSI_A_E_MID, "");
7683 ELEM_MAND_TLV(ANSI_A_E_ADDS_USER_PART, "");
7685 ELEM_OPT_TV(ANSI_A_E_TAG, "");
7687 ELEM_OPT_TLV(ANSI_A_E_CELL_ID_LIST, "");
7689 ELEM_OPT_TV(ANSI_A_E_SCI, "");
7691 ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
7693 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7700 bsmap_adds_transfer(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7702 guint32 curr_offset;
7706 curr_offset = offset;
7709 ELEM_MAND_TLV(ANSI_A_E_MID, "");
7711 ELEM_MAND_TLV(ANSI_A_E_ADDS_USER_PART, "");
7713 ELEM_OPT_TLV(ANSI_A_E_MID, "");
7715 ELEM_OPT_TLV(ANSI_A_E_AUTH_RESP_PARAM, "");
7717 ELEM_OPT_TV(ANSI_A_E_AUTH_CNF_PARAM, "");
7719 ELEM_OPT_TV(ANSI_A_E_AUTH_PARAM_COUNT, "");
7721 ELEM_OPT_TLV(ANSI_A_E_AUTH_CHLG_PARAM, "");
7723 ELEM_OPT_TLV(ANSI_A_E_AUTH_EVENT, "");
7725 ELEM_OPT_TLV(ANSI_A_E_CELL_ID, "");
7727 ELEM_OPT_TLV(ANSI_A_E_CDMA_SOWD, "");
7729 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7736 dtap_adds_deliver(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7738 guint32 curr_offset;
7742 curr_offset = offset;
7745 ELEM_MAND_LV(ANSI_A_E_ADDS_USER_PART, "");
7747 ELEM_OPT_TV(ANSI_A_E_TAG, "");
7749 ELEM_OPT_TLV(ANSI_A_E_CDMA_SOWD, "");
7751 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7758 bsmap_adds_page_ack(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7760 guint32 curr_offset;
7764 curr_offset = offset;
7767 ELEM_MAND_TLV(ANSI_A_E_MID, "");
7769 ELEM_OPT_TV(ANSI_A_E_TAG, "");
7771 ELEM_OPT_TLV(ANSI_A_E_MID, "");
7773 ELEM_OPT_TLV(ANSI_A_E_CAUSE, "");
7775 ELEM_OPT_TLV(ANSI_A_E_CELL_ID, "");
7777 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7784 dtap_adds_deliver_ack(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7786 guint32 curr_offset;
7790 curr_offset = offset;
7793 ELEM_OPT_TV(ANSI_A_E_TAG, "");
7795 ELEM_OPT_TLV(ANSI_A_E_CAUSE, "");
7797 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7804 bsmap_rejection(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7806 guint32 curr_offset;
7810 curr_offset = offset;
7813 ELEM_OPT_TLV(ANSI_A_E_MID, "");
7815 ELEM_OPT_TLV(ANSI_A_E_MID, "");
7817 ELEM_OPT_TLV(ANSI_A_E_IS2000_CAUSE, "");
7819 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7823 dtap_rejection(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7825 guint32 curr_offset;
7829 curr_offset = offset;
7832 ELEM_OPT_TLV(ANSI_A_E_IS2000_CAUSE, "");
7834 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7837 #define ANSI_A_IOS401_BSMAP_NUM_MSG (sizeof(ansi_a_ios401_bsmap_strings)/sizeof(value_string))
7838 static gint ett_bsmap_msg[ANSI_A_IOS401_BSMAP_NUM_MSG];
7839 static void (*bsmap_msg_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len) = {
7840 NULL, /* Additional Service Notification */
7841 bsmap_adds_page, /* ADDS Page */
7842 bsmap_adds_page_ack, /* ADDS Page Ack */
7843 bsmap_adds_transfer, /* ADDS Transfer */
7844 NULL, /* ADDS Transfer Ack */
7845 bsmap_ass_complete, /* Assignment Complete */
7846 bsmap_ass_failure, /* Assignment Failure */
7847 bsmap_ass_req, /* Assignment Request */
7848 bsmap_auth_req, /* Authentication Request */
7849 bsmap_auth_resp, /* Authentication Response */
7850 NULL, /* Base Station Challenge */
7851 NULL, /* Base Station Challenge Response */
7852 bsmap_block, /* Block */
7853 bsmap_block_ack, /* Block Acknowledge */
7854 bsmap_bs_srvc_req, /* BS Service Request */
7855 bsmap_bs_srvc_resp, /* BS Service Response */
7856 bsmap_clr_command, /* Clear Command */
7857 bsmap_clr_complete, /* Clear Complete */
7858 bsmap_clr_req, /* Clear Request */
7859 bsmap_cl3_info, /* Complete Layer 3 Information */
7860 bsmap_feat_noti, /* Feature Notification */
7861 bsmap_feat_noti_ack, /* Feature Notification Ack */
7862 bsmap_ho_command, /* Handoff Command */
7863 NULL /* no associated data */, /* Handoff Commenced */
7864 NULL /* no associated data */, /* Handoff Complete */
7865 bsmap_ho_failure, /* Handoff Failure */
7866 bsmap_ho_performed, /* Handoff Performed */
7867 bsmap_ho_req, /* Handoff Request */
7868 bsmap_ho_req_ack, /* Handoff Request Acknowledge */
7869 bsmap_ho_reqd, /* Handoff Required */
7870 bsmap_ho_reqd_rej, /* Handoff Required Reject */
7871 bsmap_paca_command, /* PACA Command */
7872 bsmap_paca_command_ack, /* PACA Command Ack */
7873 bsmap_paca_update, /* PACA Update */
7874 bsmap_paca_update_ack, /* PACA Update Ack */
7875 bsmap_page_req, /* Paging Request */
7876 bsmap_priv_mode_command, /* Privacy Mode Command */
7877 bsmap_priv_mode_complete, /* Privacy Mode Complete */
7878 NULL, /* Radio Measurements for Position Request */
7879 NULL, /* Radio Measurements for Position Response */
7880 bsmap_rejection, /* Rejection */
7881 NULL, /* Registration Request */
7882 bsmap_reset, /* Reset */
7883 bsmap_reset_ack, /* Reset Acknowledge */
7884 bsmap_reset_cct, /* Reset Circuit */
7885 bsmap_reset_cct_ack, /* Reset Circuit Acknowledge */
7886 NULL, /* SSD Update Request */
7887 NULL, /* SSD Update Response */
7888 NULL, /* Status Request */
7889 NULL, /* Status Response */
7890 bsmap_xmode_ack, /* Transcoder Control Acknowledge */
7891 bsmap_xmode_req, /* Transcoder Control Request */
7892 bsmap_unblock, /* Unblock */
7893 bsmap_unblock_ack, /* Unblock Acknowledge */
7894 NULL, /* User Zone Reject */
7895 bsmap_user_zone_update, /* User Zone Update */
7899 #define ANSI_A_IOS401_DTAP_NUM_MSG (sizeof(ansi_a_ios401_dtap_strings)/sizeof(value_string))
7900 static gint ett_dtap_msg[ANSI_A_IOS401_DTAP_NUM_MSG];
7901 static void (*dtap_msg_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len) = {
7902 NULL, /* Additional Service Request */
7903 dtap_adds_deliver, /* ADDS Deliver */
7904 dtap_adds_deliver_ack, /* ADDS Deliver Ack */
7905 dtap_alert_with_info, /* Alert With Information */
7906 dtap_auth_req, /* Authentication Request */
7907 dtap_auth_resp, /* Authentication Response */
7908 dtap_bs_challenge, /* Base Station Challenge */
7909 dtap_bs_challenge_resp, /* Base Station Challenge Response */
7910 dtap_cm_srvc_req, /* CM Service Request */
7911 NULL, /* CM Service Request Continuation */
7912 NULL /* no associated data */, /* Connect */
7913 dtap_flash_with_info, /* Flash with Information */
7914 dtap_flash_with_info_ack, /* Flash with Information Ack */
7915 dtap_lu_accept, /* Location Updating Accept */
7916 dtap_lu_reject, /* Location Updating Reject */
7917 dtap_lu_req, /* Location Updating Request */
7918 dtap_page_resp, /* Paging Response */
7919 NULL /* no associated data */, /* Parameter Update Confirm */
7920 NULL /* no associated data */, /* Parameter Update Request */
7921 dtap_rejection, /* Rejection */
7922 dtap_progress, /* Progress */
7923 NULL, /* Service Redirection */
7924 NULL, /* Service Release */
7925 NULL, /* Service Release Complete */
7926 dtap_ssd_update_req, /* SSD Update Request */
7927 dtap_ssd_update_resp, /* SSD Update Response */
7928 NULL, /* Status Request */
7929 NULL, /* Status Response */
7930 NULL, /* User Zone Reject */
7931 NULL, /* User Zone Update */
7932 NULL, /* User Zone Update Request */
7936 /* GENERIC MAP DISSECTOR FUNCTIONS */
7939 dissect_bsmap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
7941 static ansi_a_tap_rec_t tap_rec[4];
7942 static ansi_a_tap_rec_t *tap_p;
7943 static int tap_current=0;
7945 guint32 offset, saved_offset;
7948 proto_item *bsmap_item = NULL;
7949 proto_tree *bsmap_tree = NULL;
7953 if (check_col(pinfo->cinfo, COL_INFO))
7955 col_append_str(pinfo->cinfo, COL_INFO, "(BSMAP) ");
7959 * set tap record pointer
7962 if (tap_current == 4)
7966 tap_p = &tap_rec[tap_current];
7970 saved_offset = offset;
7975 len = tvb_length(tvb);
7978 * add BSMAP message name
7980 oct = tvb_get_guint8(tvb, offset++);
7982 msg_str = my_match_strval((guint32) oct, ansi_a_ios401_bsmap_strings, &idx);
7985 * create the a protocol tree
7987 if (msg_str == NULL)
7990 proto_tree_add_protocol_format(tree, proto_a_bsmap, tvb, 0, len,
7991 "ANSI A-I/F BSMAP - Unknown BSMAP Message Type (%u)",
7994 bsmap_tree = proto_item_add_subtree(bsmap_item, ett_bsmap);
7999 proto_tree_add_protocol_format(tree, proto_a_bsmap, tvb, 0, -1,
8000 "ANSI A-I/F BSMAP - %s",
8003 bsmap_tree = proto_item_add_subtree(bsmap_item, ett_bsmap_msg[idx]);
8005 if (check_col(pinfo->cinfo, COL_INFO))
8007 col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", msg_str);
8012 * add BSMAP message name
8014 proto_tree_add_uint_format(bsmap_tree, hf_ansi_a_bsmap_msgtype,
8015 tvb, saved_offset, 1, oct, "Message Type");
8017 tap_p->pdu_type = BSSAP_PDU_TYPE_BSMAP;
8018 tap_p->message_type = oct;
8020 tap_queue_packet(ansi_a_tap, pinfo, tap_p);
8022 if (msg_str == NULL) return;
8024 if ((len - offset) <= 0) return;
8029 if (bsmap_msg_fcn[idx] == NULL)
8031 proto_tree_add_text(bsmap_tree,
8032 tvb, offset, len - offset,
8033 "Message Elements");
8037 (*bsmap_msg_fcn[idx])(tvb, bsmap_tree, offset, len - offset);
8042 dissect_dtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
8044 static ansi_a_tap_rec_t tap_rec[4];
8045 static ansi_a_tap_rec_t *tap_p;
8046 static int tap_current=0;
8048 guint32 offset, saved_offset;
8050 guint32 oct_1, oct_2;
8052 proto_item *dtap_item = NULL;
8053 proto_tree *dtap_tree = NULL;
8054 proto_item *oct_1_item = NULL;
8055 proto_tree *oct_1_tree = NULL;
8060 len = tvb_length(tvb);
8065 * too short to be DTAP
8067 call_dissector(data_handle, tvb, pinfo, tree);
8071 if (check_col(pinfo->cinfo, COL_INFO))
8073 col_append_str(pinfo->cinfo, COL_INFO, "(DTAP) ");
8077 * set tap record pointer
8080 if (tap_current == 4)
8084 tap_p = &tap_rec[tap_current];
8088 saved_offset = offset;
8094 * get protocol discriminator
8096 oct_1 = tvb_get_guint8(tvb, offset++);
8097 oct_2 = tvb_get_guint8(tvb, offset++);
8100 * add DTAP message name
8102 saved_offset = offset;
8103 oct = tvb_get_guint8(tvb, offset++);
8105 msg_str = my_match_strval((guint32) oct, ansi_a_ios401_dtap_strings, &idx);
8108 * create the a protocol tree
8110 if (msg_str == NULL)
8113 proto_tree_add_protocol_format(tree, proto_a_dtap, tvb, 0, len,
8114 "ANSI A-I/F DTAP - Unknown DTAP Message Type (%u)",
8117 dtap_tree = proto_item_add_subtree(dtap_item, ett_dtap);
8122 proto_tree_add_protocol_format(tree, proto_a_dtap, tvb, 0, -1,
8123 "ANSI A-I/F DTAP - %s",
8126 dtap_tree = proto_item_add_subtree(dtap_item, ett_dtap_msg[idx]);
8128 if (check_col(pinfo->cinfo, COL_INFO))
8130 col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", msg_str);
8137 switch (oct_1 & 0x0f)
8139 case 3: str = "Call Control, call related SS"; break;
8140 case 5: str = "Mobility Management"; break;
8141 case 6: str = "Radio Resource Management"; break;
8142 case 9: str = "Facility Management"; break;
8143 case 11: str = "Other Signaling Procedures"; break;
8144 case 15: str = "Reserved for tests"; break;
8151 proto_tree_add_text(dtap_tree,
8153 "Protocol Discriminator: %s",
8156 oct_1_tree = proto_item_add_subtree(oct_1_item, ett_dtap_oct_1);
8158 other_decode_bitfield_value(a_bigbuf, oct_1, 0xf0, 8);
8159 proto_tree_add_text(oct_1_tree,
8164 other_decode_bitfield_value(a_bigbuf, oct_1, 0x0f, 8);
8165 proto_tree_add_text(oct_1_tree,
8167 "%s : Protocol Discriminator: %u",
8176 case A_VARIANT_IS634:
8177 other_decode_bitfield_value(a_bigbuf, oct_2, 0x80, 8);
8178 proto_tree_add_text(dtap_tree,
8180 "%s : Transaction Identifier (TI) Flag: %s",
8182 ((oct_2 & 0x80) ? "allocated by receiver" : "allocated by sender"));
8184 other_decode_bitfield_value(a_bigbuf, oct_2, 0x70, 8);
8185 proto_tree_add_text(dtap_tree,
8187 "%s : Transaction Identifier (TI): %u",
8189 (oct_2 & 0x70) >> 4);
8191 other_decode_bitfield_value(a_bigbuf, oct_2, 0x0f, 8);
8192 proto_tree_add_text(dtap_tree,
8199 proto_tree_add_text(dtap_tree,
8206 * add DTAP message name
8208 proto_tree_add_uint_format(dtap_tree, hf_ansi_a_dtap_msgtype,
8209 tvb, saved_offset, 1, oct,
8212 tap_p->pdu_type = BSSAP_PDU_TYPE_DTAP;
8213 tap_p->message_type = oct;
8215 tap_queue_packet(ansi_a_tap, pinfo, tap_p);
8217 if (msg_str == NULL) return;
8219 if ((len - offset) <= 0) return;
8224 if (dtap_msg_fcn[idx] == NULL)
8226 proto_tree_add_text(dtap_tree,
8227 tvb, offset, len - offset,
8228 "Message Elements");
8232 (*dtap_msg_fcn[idx])(tvb, dtap_tree, offset, len - offset);
8237 /* Register the protocol with Ethereal */
8239 proto_register_ansi_a(void)
8241 module_t *ansi_a_module;
8245 /* Setup list of header fields */
8247 static hf_register_info hf[] =
8249 { &hf_ansi_a_bsmap_msgtype,
8250 { "BSMAP Message Type", "ansi_a.bsmap_msgtype",
8251 FT_UINT8, BASE_HEX, VALS(ansi_a_ios401_bsmap_strings), 0x0,
8254 { &hf_ansi_a_dtap_msgtype,
8255 { "DTAP Message Type", "ansi_a.dtap_msgtype",
8256 FT_UINT8, BASE_HEX, VALS(ansi_a_ios401_dtap_strings), 0x0,
8259 { &hf_ansi_a_elem_id,
8260 { "Element ID", "ansi_a.elem_id",
8261 FT_UINT8, BASE_DEC, VALS(ansi_a_ios401_elem_1_strings), 0,
8264 { &hf_ansi_a_length,
8265 { "Length", "ansi_a.len",
8266 FT_UINT8, BASE_DEC, NULL, 0,
8270 { "Sub tree", "ansi_a.none",
8275 { "ESN", "ansi_a.esn",
8276 FT_UINT32, BASE_HEX, 0, 0x0,
8280 { "IMSI", "ansi_a.imsi",
8281 FT_STRING, BASE_DEC, 0, 0,
8285 { "MIN", "ansi_a.min",
8286 FT_STRING, BASE_DEC, 0, 0,
8289 { &hf_ansi_a_cld_party_bcd_num,
8290 { "Called Party BCD Number", "ansi_a.cld_party_bcd_num",
8291 FT_STRING, BASE_DEC, 0, 0,
8294 { &hf_ansi_a_clg_party_bcd_num,
8295 { "Calling Party BCD Number", "ansi_a.clg_party_bcd_num",
8296 FT_STRING, BASE_DEC, 0, 0,
8299 { &hf_ansi_a_cld_party_ascii_num,
8300 { "Called Party ASCII Number", "ansi_a.cld_party_ascii_num",
8301 FT_STRING, BASE_DEC, 0, 0,
8304 { &hf_ansi_a_clg_party_ascii_num,
8305 { "Calling Party ASCII Number", "ansi_a.clg_party_ascii_num",
8306 FT_STRING, BASE_DEC, 0, 0,
8309 { &hf_ansi_a_cell_ci,
8310 { "Cell CI", "ansi_a.cell_ci",
8311 FT_UINT16, BASE_HEX, 0, 0x0,
8314 { &hf_ansi_a_cell_lac,
8315 { "Cell LAC", "ansi_a.cell_lac",
8316 FT_UINT16, BASE_HEX, 0, 0x0,
8319 { &hf_ansi_a_cell_mscid,
8320 { "Cell MSCID", "ansi_a.cell_mscid",
8321 FT_UINT24, BASE_HEX, 0, 0x0,
8324 { &hf_ansi_a_pdsn_ip_addr,
8325 { "PDSN IP Address", "ansi_a.pdsn_ip_addr",
8326 FT_IPv4, BASE_NONE, NULL, 0,
8327 "IP Address", HFILL}},
8330 static enum_val_t a_variant_options[] = {
8331 { "IS-634 rev. 0", A_VARIANT_IS634 },
8332 { "TSB-80", A_VARIANT_TSB80 },
8333 { "IS-634-A", A_VARIANT_IS634A },
8334 { "IOS 2.x", A_VARIANT_IOS2 },
8335 { "IOS 3.x", A_VARIANT_IOS3 },
8336 { "IOS 4.0.1", A_VARIANT_IOS401 },
8341 /* Setup protocol subtree array */
8342 #define MAX_NUM_DTAP_MSG ANSI_A_MAX(ANSI_A_IOS401_DTAP_NUM_MSG, 0)
8343 #define MAX_NUM_BSMAP_MSG ANSI_A_MAX(ANSI_A_IOS401_BSMAP_NUM_MSG, 0)
8344 #define NUM_INDIVIDUAL_ELEMS 9
8346 gint ett_len = (NUM_INDIVIDUAL_ELEMS+MAX_NUM_DTAP_MSG+MAX_NUM_BSMAP_MSG+NUM_ELEM_1+NUM_MS_INFO_REC) * sizeof(gint *);
8349 * XXX - at least one version of the HP C compiler apparently doesn't
8350 * recognize constant expressions using the "?" operator as being
8351 * constant expressions, so you can't use the expression that
8352 * initializes "ett_let" as an array size. Therefore, we dynamically
8353 * allocate the array instead.
8355 ett = g_malloc(ett_len);
8357 memset((void *) ett_dtap_msg, -1, sizeof(gint) * MAX_NUM_DTAP_MSG);
8358 memset((void *) ett_bsmap_msg, -1, sizeof(gint) * MAX_NUM_BSMAP_MSG);
8359 memset((void *) ett_ansi_elem_1, -1, sizeof(gint) * NUM_ELEM_1);
8360 memset((void *) ett_ansi_ms_info_rec, -1, sizeof(gint) * NUM_MS_INFO_REC);
8362 ett[0] = &ett_bsmap;
8364 ett[2] = &ett_elems;
8366 ett[4] = &ett_dtap_oct_1;
8367 ett[5] = &ett_cm_srvc_type;
8368 ett[6] = &ett_ansi_ms_info_rec_reserved;
8369 ett[7] = &ett_ansi_enc_info;
8370 ett[8] = &ett_cell_list;
8372 last_offset = NUM_INDIVIDUAL_ELEMS;
8374 for (i=0; i < MAX_NUM_DTAP_MSG; i++, last_offset++)
8376 ett[last_offset] = &ett_dtap_msg[i];
8379 for (i=0; i < MAX_NUM_BSMAP_MSG; i++, last_offset++)
8381 ett[last_offset] = &ett_bsmap_msg[i];
8384 for (i=0; i < NUM_ELEM_1; i++, last_offset++)
8386 ett[last_offset] = &ett_ansi_elem_1[i];
8389 for (i=0; i < NUM_MS_INFO_REC; i++, last_offset++)
8391 ett[last_offset] = &ett_ansi_ms_info_rec[i];
8394 /* Register the protocol name and description */
8397 proto_register_protocol("ANSI A-I/F BSMAP", "ANSI BSMAP", "ansi_a_bsmap");
8399 proto_register_field_array(proto_a_bsmap, hf, array_length(hf));
8402 proto_register_protocol("ANSI A-I/F DTAP", "ANSI DTAP", "ansi_a_dtap");
8404 is637_dissector_table =
8405 register_dissector_table("ansi_a.sms", "IS-637-A (SMS)",
8406 FT_UINT8, BASE_DEC);
8408 is683_dissector_table =
8409 register_dissector_table("ansi_a.ota", "IS-683-A (OTA)",
8410 FT_UINT8, BASE_DEC);
8412 is801_dissector_table =
8413 register_dissector_table("ansi_a.pld", "IS-801 (PLD)",
8414 FT_UINT8, BASE_DEC);
8416 proto_register_subtree_array(ett, ett_len / sizeof(gint *));
8418 ansi_a_tap = register_tap("ansi_a");
8421 * setup for preferences
8423 ansi_a_module = prefs_register_protocol(proto_a_bsmap, proto_reg_handoff_ansi_a);
8425 prefs_register_enum_preference(ansi_a_module,
8428 "(if other than the default of IOS 4.0.1)",
8438 proto_reg_handoff_ansi_a(void)
8440 static int ansi_a_prefs_initialized = FALSE;
8443 if (!ansi_a_prefs_initialized)
8445 bsmap_handle = create_dissector_handle(dissect_bsmap, proto_a_bsmap);
8446 dtap_handle = create_dissector_handle(dissect_dtap, proto_a_dtap);
8448 ansi_a_prefs_initialized = TRUE;
8452 dissector_delete("bsap.pdu_type", BSSAP_PDU_TYPE_BSMAP, bsmap_handle);
8453 dissector_delete("bsap.pdu_type", BSSAP_PDU_TYPE_DTAP, dtap_handle);
8456 if (a_variant != a_global_variant)
8458 a_variant = a_global_variant;
8461 dissector_add("bsap.pdu_type", BSSAP_PDU_TYPE_BSMAP, bsmap_handle);
8462 dissector_add("bsap.pdu_type", BSSAP_PDU_TYPE_DTAP, dtap_handle);
8464 data_handle = find_dissector("data");