HACK: pinfo->private_data points to smb_info again
[wireshark-wip.git] / epan / dissectors / packet-ansi_a.c
blob379e90e0be5f666e8db4fe34c89c61c35da3874b
1 /* packet-ansi_a.c
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.
6 * Copyright 2008, Michael Lum <michael.lum [AT] utstar.com>
7 * In association with UTStarcom Inc.
8 * Copyright 2008, Michael Lum <michael.lum [AT] starsolutions.com>
9 * In association with Star Solutions
11 * Title 3GPP2 Other
13 * Inter-operability Specification (IOS) for CDMA
14 * 2000 Access Network Interfaces
15 * 3GPP2 A.S0001-1 TIA/EIA-2001
17 * $Id$
19 * Wireshark - Network traffic analyzer
20 * By Gerald Combs <gerald@wireshark.org>
21 * Copyright 1998 Gerald Combs
23 * This program is free software; you can redistribute it and/or
24 * modify it under the terms of the GNU General Public License
25 * as published by the Free Software Foundation; either version 2
26 * of the License, or (at your option) any later version.
28 * This program is distributed in the hope that it will be useful,
29 * but WITHOUT ANY WARRANTY; without even the implied warranty of
30 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 * GNU General Public License for more details.
33 * You should have received a copy of the GNU General Public License
34 * along with this program; if not, write to the Free Software
35 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
38 #include "config.h"
40 #include <string.h>
42 #include <epan/packet.h>
43 #include <epan/exceptions.h>
44 #include <epan/prefs.h>
45 #include <epan/tap.h>
46 #include <epan/strutil.h>
47 #include <epan/wmem/wmem.h>
48 #include <epan/expert.h>
49 #include <epan/base64.h>
50 #include <epan/tfs.h>
52 #include "packet-rtp.h"
53 #include "packet-bssap.h"
54 #include "packet-ansi_a.h"
58 * IOS 4, probably most common
60 static gint global_a_variant = A_VARIANT_IOS401;
63 /* PROTOTYPES/FORWARDS */
65 void proto_register_ansi_a(void);
66 void proto_reg_handoff_ansi_a(void);
68 static const gchar *
69 my_try_val_to_str_idx(guint32 val, const ext_value_string_t *vs, gint *dec_idx)
71 gint i = 0;
73 while (vs[i].strptr)
75 if (vs[i].value == val)
77 *dec_idx = vs[i].dec_index;
78 return(vs[i].strptr);
81 i++;
84 *dec_idx = -1;
85 return(NULL);
88 const ext_value_string_t ansi_a_ios401_bsmap_strings[] =
90 { 0x69, "Additional Service Notification", 0 },
91 { 0x65, "ADDS Page", 1 },
92 { 0x66, "ADDS Page Ack", 2 },
93 { 0x67, "ADDS Transfer", 3 },
94 { 0x68, "ADDS Transfer Ack", 4 },
95 { 0x02, "Assignment Complete", 5 },
96 { 0x03, "Assignment Failure", 6 },
97 { 0x01, "Assignment Request", 7 },
98 { 0x45, "Authentication Request", 8 },
99 { 0x46, "Authentication Response", 9 },
100 { 0x48, "Base Station Challenge", 10 },
101 { 0x49, "Base Station Challenge Response", 11 },
102 { 0x40, "Block", 12 },
103 { 0x41, "Block Acknowledge", 13 },
104 { 0x09, "BS Service Request", 14 },
105 { 0x0A, "BS Service Response", 15 },
106 { 0x20, "Clear Command", 16 },
107 { 0x21, "Clear Complete", 17 },
108 { 0x22, "Clear Request", 18 },
109 { 0x57, "Complete Layer 3 Information", 19 },
110 { 0x60, "Feature Notification", 20 },
111 { 0x61, "Feature Notification Ack", 21 },
112 { 0x13, "Handoff Command", 22 },
113 { 0x15, "Handoff Commenced", 23 },
114 { 0x14, "Handoff Complete", 24 },
115 { 0x16, "Handoff Failure", 25 },
116 { 0x17, "Handoff Performed", 26 },
117 { 0x10, "Handoff Request", 27 },
118 { 0x12, "Handoff Request Acknowledge", 28 },
119 { 0x11, "Handoff Required", 29 },
120 { 0x1A, "Handoff Required Reject", 30 },
121 { 0x6C, "PACA Command", 31 },
122 { 0x6D, "PACA Command Ack", 32 },
123 { 0x6E, "PACA Update", 33 },
124 { 0x6F, "PACA Update Ack", 34 },
125 { 0x52, "Paging Request", 35 },
126 { 0x53, "Privacy Mode Command", 36 },
127 { 0x55, "Privacy Mode Complete", 37 },
128 { 0x23, "Radio Measurements for Position Request", 38 },
129 { 0x25, "Radio Measurements for Position Response", 39 },
130 { 0x56, "Rejection", 40 },
131 { 0x05, "Registration Request", 41 },
132 { 0x30, "Reset", 42 },
133 { 0x31, "Reset Acknowledge", 43 },
134 { 0x34, "Reset Circuit", 44 },
135 { 0x35, "Reset Circuit Acknowledge", 45 },
136 { 0x47, "SSD Update Request", 46 },
137 { 0x4A, "SSD Update Response", 47 },
138 { 0x6A, "Status Request", 48 },
139 { 0x6B, "Status Response", 49 },
140 { 0x39, "Transcoder Control Acknowledge", 50 },
141 { 0x38, "Transcoder Control Request", 51 },
142 { 0x42, "Unblock", 52 },
143 { 0x43, "Unblock Acknowledge", 53 },
144 { 0x0B, "User Zone Reject", 54 },
145 { 0x04, "User Zone Update", 55 },
146 { 0, NULL, 0 }
149 const ext_value_string_t ansi_a_ios401_dtap_strings[] =
151 { 0x62, "Additional Service Request", 0 },
152 { 0x53, "ADDS Deliver", 1 },
153 { 0x54, "ADDS Deliver Ack", 2 },
154 { 0x26, "Alert With Information", 3 },
155 { 0x45, "Authentication Request", 4 },
156 { 0x46, "Authentication Response", 5 },
157 { 0x48, "Base Station Challenge", 6 },
158 { 0x49, "Base Station Challenge Response", 7 },
159 { 0x24, "CM Service Request", 8 },
160 { 0x25, "CM Service Request Continuation", 9 },
161 { 0x07, "Connect", 10 },
162 { 0x10, "Flash with Information", 11 },
163 { 0x50, "Flash with Information Ack", 12 },
164 { 0x02, "Location Updating Accept", 13 },
165 { 0x04, "Location Updating Reject", 14 },
166 { 0x08, "Location Updating Request", 15 },
167 { 0x27, "Paging Response", 16 },
168 { 0x2B, "Parameter Update Confirm", 17 },
169 { 0x2C, "Parameter Update Request", 18 },
170 { 0x56, "Rejection", 19 },
171 { 0x03, "Progress", 20 },
172 { 0x70, "Service Redirection", 21 },
173 { 0x2E, "Service Release", 22 },
174 { 0x2F, "Service Release Complete", 23 },
175 { 0x47, "SSD Update Request", 24 },
176 { 0x4A, "SSD Update Response", 25 },
177 { 0x6A, "Status Request", 26 },
178 { 0x6B, "Status Response", 27 },
179 { 0x0B, "User Zone Reject", 28 },
180 { 0x0C, "User Zone Update", 29 },
181 { 0x0D, "User Zone Update Request", 30 },
182 { 0, NULL, 0 }
185 const ext_value_string_t ansi_a_ios401_elem_1_strings[] =
187 { 0x20, "Access Network Identifiers", 0 },
188 { 0x3D, "ADDS User Part", 1 },
189 { 0x25, "AMPS Hard Handoff Parameters", 2 },
190 { 0x30, "Anchor PDSN Address", 3 },
191 { 0x7C, "Anchor P-P Address", 4 },
192 { 0x41, "Authentication Challenge Parameter", 5 },
193 { 0x28, "Authentication Confirmation Parameter (RANDC)", 6 },
194 { 0x59, "Authentication Data", 7 },
195 { 0x4A, "Authentication Event", 8 },
196 { 0x40, "Authentication Parameter COUNT", 9 },
197 { 0x42, "Authentication Response Parameter", 10 },
198 { 0x37, "Band Class", 11 },
199 { 0x5B, "Called Party ASCII Number", 12 },
200 { 0x5E, "Called Party BCD Number", 13 },
201 { 0x4B, "Calling Party ASCII Number", 14 },
202 { 0x04, "Cause", 15 },
203 { 0x08, "Cause Layer 3", 16 },
204 { 0x0C, "CDMA Serving One Way Delay", 17 },
205 { 0x05, "Cell Identifier", 18 },
206 { 0x1A, "Cell Identifier List", 19 },
207 { 0x23, "Channel Number", 20 },
208 { 0x0B, "Channel Type", 21 },
209 { 0x19, "Circuit Group", 22 },
210 { 0x01, "Circuit Identity Code", 23 },
211 { 0x24, "Circuit Identity Code Extension", 24 },
212 { 0x12, "Classmark Information Type 2", 25 },
213 { 0x29, "Downlink Radio Environment", 26 },
214 { 0x2B, "Downlink Radio Environment List", 27 },
215 { 0x0A, "Encryption Information", 28 },
216 { 0x10, "Extended Handoff Direction Parameters", 29 },
217 { 0x2C, "Geographic Location", 30 },
218 { 0x5A, "Special Service Call Indicator", 31 },
219 { 0x26, "Handoff Power Level", 32 },
220 { 0x16, "Hard Handoff Parameters", 33 },
221 { 0x2E, "Information Element Requested", 34 },
222 { 0x09, "IS-2000 Channel Identity", 35 },
223 { 0x27, "IS-2000 Channel Identity 3X", 36 },
224 { 0x11, "IS-2000 Mobile Capabilities", 37 },
225 { 0x0F, "IS-2000 Non-Negotiable Service Configuration Record", 38 },
226 { 0x0E, "IS-2000 Service Configuration Record", 39 },
227 { 0x62, "IS-95/IS-2000 Cause Value", 40 },
228 { 0x67, "IS-2000 Redirection Record", 41 },
229 { 0x22, "IS-95 Channel Identity", 42 },
230 { 0x64, "IS-95 MS Measured Channel Identity", 43 },
231 { 0x17, "Layer 3 Information", 44 },
232 { 0x13, "Location Area Information", 45 },
233 { 0x38, "Message Waiting Indication", 46 },
234 { 0x0D, "Mobile Identity", 47 },
235 { 0x15, "MS Information Records (Forward)", 48 },
236 { 0xA0, "Origination Continuation Indicator", 49 },
237 { 0x5F, "PACA Order", 50 },
238 { 0x60, "PACA Reorigination Indicator", 51 },
239 { 0x4E, "PACA Timestamp", 52 },
240 { 0x70, "Packet Session Parameters", 53 },
241 { 0x14, "PDSN IP Address", 54 },
242 { 0xA2, "Power Down Indicator", 55 },
243 { 0x06, "Priority", 56 },
244 { 0x3B, "Protocol Revision", 57 },
245 { 0x18, "Protocol Type", 58 },
246 { 0x2D, "PSMM Count", 59 },
247 { 0x07, "Quality of Service Parameters", 60 },
248 { 0x1D, "Radio Environment and Resources", 61 },
249 { 0x1F, "Registration Type", 62 },
250 { 0x44, "Reject Cause", 63 },
251 { 0x1B, "Response Request", 64 },
252 { 0x68, "Return Cause", 65 },
253 { 0x21, "RF Channel Identity", 66 },
254 { 0x03, "Service Option", 67 },
255 { 0x1E, "Service Option Connection Identifier (SOCI)", 68 },
256 { 0x2A, "Service Option List", 69 },
257 { 0x69, "Service Redirection Info", 70 },
258 { 0x71, "Service Reference Identifier (SR_ID)", 71 },
259 { 0x32, "SID", 72 },
260 { 0x34, "Signal", 73 },
261 { 0x35, "Slot Cycle Index", 74 },
262 { 0x31, "Software Version", 75 },
263 { 0x39, "Source RNC to Target RNC Transparent Container", 76 },
264 { 0x14, "Source PDSN Address", 77 },
265 { 0x33, "Tag", 78 },
266 { 0x3A, "Target RNC to Source RNC Transparent Container", 79 },
267 { 0x36, "Transcoder Mode", 80 }, /* XXX 0x1C in IOS 4.0.1 */
268 { 0x02, "User Zone ID", 81 },
269 { 0xA1, "Voice Privacy Request", 82 },
270 { 0x15, "MS Information Records (Reverse)", 88 },
271 { 0, NULL, 0 }
274 const ext_value_string_t ansi_a_ios501_bsmap_strings[] =
276 { 0x69, "Additional Service Notification", 0 },
277 { 0x65, "ADDS Page", 1 },
278 { 0x66, "ADDS Page Ack", 2 },
279 { 0x67, "ADDS Transfer", 3 },
280 { 0x68, "ADDS Transfer Ack", 4 },
281 { 0x02, "Assignment Complete", 5 },
282 { 0x03, "Assignment Failure", 6 },
283 { 0x01, "Assignment Request", 7 },
284 { 0x45, "Authentication Request", 8 },
285 { 0x46, "Authentication Response", 9 },
286 { 0x48, "Base Station Challenge", 10 },
287 { 0x49, "Base Station Challenge Response", 11 },
288 { 0x40, "Block", 12 },
289 { 0x41, "Block Acknowledge", 13 },
290 { 0x09, "BS Service Request", 14 },
291 { 0x0A, "BS Service Response", 15 },
292 { 0x20, "Clear Command", 16 },
293 { 0x21, "Clear Complete", 17 },
294 { 0x22, "Clear Request", 18 },
295 { 0x57, "Complete Layer 3 Information", 19 },
296 { 0x60, "Feature Notification", 20 },
297 { 0x61, "Feature Notification Ack", 21 },
298 { 0x13, "Handoff Command", 22 },
299 { 0x15, "Handoff Commenced", 23 },
300 { 0x14, "Handoff Complete", 24 },
301 { 0x16, "Handoff Failure", 25 },
302 { 0x17, "Handoff Performed", 26 },
303 { 0x10, "Handoff Request", 27 },
304 { 0x12, "Handoff Request Acknowledge", 28 },
305 { 0x11, "Handoff Required", 29 },
306 { 0x1A, "Handoff Required Reject", 30 },
307 { 0x6C, "PACA Command", 31 },
308 { 0x6D, "PACA Command Ack", 32 },
309 { 0x6E, "PACA Update", 33 },
310 { 0x6F, "PACA Update Ack", 34 },
311 { 0x52, "Paging Request", 35 },
312 { 0x53, "Privacy Mode Command", 36 },
313 { 0x55, "Privacy Mode Complete", 37 },
314 { 0x23, "Radio Measurements for Position Request", 38 },
315 { 0x25, "Radio Measurements for Position Response", 39 },
316 { 0x56, "Rejection", 40 },
317 { 0x05, "Registration Request", 41 },
318 { 0x30, "Reset", 42 },
319 { 0x31, "Reset Acknowledge", 43 },
320 { 0x34, "Reset Circuit", 44 },
321 { 0x35, "Reset Circuit Acknowledge", 45 },
322 { 0x47, "SSD Update Request", 46 },
323 { 0x4A, "SSD Update Response", 47 },
324 { 0x6A, "Status Request", 48 },
325 { 0x6B, "Status Response", 49 },
326 { 0x39, "Transcoder Control Acknowledge", 50 },
327 { 0x38, "Transcoder Control Request", 51 },
328 { 0x42, "Unblock", 52 },
329 { 0x43, "Unblock Acknowledge", 53 },
330 { 0x0B, "User Zone Reject", 54 },
331 { 0x04, "User Zone Update", 55 },
332 { 0x58, "Bearer Update Request", 56 },
333 { 0x59, "Bearer Update Response", 58 },
334 { 0x5A, "Bearer Update Required", 57 },
335 { 0x71, "Mobile Station Registered Notification", 59 },
336 { 0x07, "BS Authentication Request", 60 },
337 { 0x08, "BS Authentication Request Ack", 61 },
338 { 0, NULL, 0 }
341 const ext_value_string_t ansi_a_ios501_dtap_strings[] =
343 { 0x62, "Additional Service Request", 0 },
344 { 0x53, "ADDS Deliver", 1 },
345 { 0x54, "ADDS Deliver Ack", 2 },
346 { 0x26, "Alert With Information", 3 },
347 { 0x45, "Authentication Request", 4 },
348 { 0x46, "Authentication Response", 5 },
349 { 0x48, "Base Station Challenge", 6 },
350 { 0x49, "Base Station Challenge Response", 7 },
351 { 0x24, "CM Service Request", 8 },
352 { 0x25, "CM Service Request Continuation", 9 },
353 { 0x07, "Connect", 10 },
354 { 0x10, "Flash with Information", 11 },
355 { 0x50, "Flash with Information Ack", 12 },
356 { 0x02, "Location Updating Accept", 13 },
357 { 0x04, "Location Updating Reject", 14 },
358 { 0x08, "Location Updating Request", 15 },
359 { 0x27, "Paging Response", 16 },
360 { 0x2B, "Parameter Update Confirm", 17 },
361 { 0x2C, "Parameter Update Request", 18 },
362 { 0x56, "Rejection", 19 },
363 { 0x03, "Progress", 20 },
364 { 0x70, "Service Redirection", 21 },
365 { 0x2E, "Service Release", 22 },
366 { 0x2F, "Service Release Complete", 23 },
367 { 0x47, "SSD Update Request", 24 },
368 { 0x4A, "SSD Update Response", 25 },
369 { 0x6A, "Status Request", 26 },
370 { 0x6B, "Status Response", 27 },
371 { 0x0B, "User Zone Reject", 28 },
372 { 0x0C, "User Zone Update", 29 },
373 { 0x0D, "User Zone Update Request", 30 },
374 { 0, NULL, 0 }
378 * ORDER MUST MATCH
379 * ansi_a_ios401_elem_1_strings when the same element
380 * is being described.
382 const ext_value_string_t ansi_a_ios501_elem_1_strings[] =
384 { 0x20, "Access Network Identifiers", 0 },
385 { 0x3D, "ADDS User Part", 1 },
386 { 0x25, "AMPS Hard Handoff Parameters", 2 },
387 { 0x30, "Anchor PDSN Address", 3 },
388 { 0x7C, "Anchor P-P Address", 4 },
389 { 0x41, "Authentication Challenge Parameter", 5 },
390 { 0x28, "Authentication Confirmation Parameter (RANDC)", 6 },
391 { 0x59, "Authentication Data", 7 },
392 { 0x4A, "Authentication Event", 8 },
393 { 0x40, "Authentication Parameter COUNT", 9 },
394 { 0x42, "Authentication Response Parameter", 10 },
395 { 0x37, "Band Class", 11 },
396 { 0x5B, "Called Party ASCII Number", 12 },
397 { 0x5E, "Called Party BCD Number", 13 },
398 { 0x4B, "Calling Party ASCII Number", 14 },
399 { 0x04, "Cause", 15 },
400 { 0x08, "Cause Layer 3", 16 },
401 { 0x0C, "CDMA Serving One Way Delay", 17 },
402 { 0x05, "Cell Identifier", 18 },
403 { 0x1A, "Cell Identifier List", 19 },
404 { 0x23, "Channel Number", 20 },
405 { 0x0B, "Channel Type", 21 },
406 { 0x19, "Circuit Group", 22 },
407 { 0x01, "Circuit Identity Code", 23 },
408 { 0x24, "Circuit Identity Code Extension", 24 },
409 { 0x12, "Classmark Information Type 2", 25 },
410 { 0x29, "Downlink Radio Environment", 26 },
411 { 0x2B, "Downlink Radio Environment List", 27 },
412 { 0x0A, "Encryption Information", 28 },
413 { 0x10, "Extended Handoff Direction Parameters", 29 },
414 { 0x2C, "Geographic Location", 30 },
415 { 0x5A, "Special Service Call Indicator", 31 },
416 { 0x26, "Handoff Power Level", 32 },
417 { 0x16, "Hard Handoff Parameters", 33 },
418 { 0x2E, "Information Element Requested", 34 },
419 { 0x09, "IS-2000 Channel Identity", 35 },
420 { 0x27, "IS-2000 Channel Identity 3X", 36 },
421 { 0x11, "IS-2000 Mobile Capabilities", 37 },
422 { 0x0F, "IS-2000 Non-Negotiable Service Configuration Record", 38 },
423 { 0x0E, "IS-2000 Service Configuration Record", 39 },
424 { 0x62, "IS-95/IS-2000 Cause Value", 40 },
425 { 0x67, "IS-2000 Redirection Record", 41 },
426 { 0x22, "IS-95 Channel Identity", 42 },
427 { 0x64, "IS-95 MS Measured Channel Identity", 43 },
428 { 0x17, "Layer 3 Information", 44 },
429 { 0x13, "Location Area Information", 45 },
430 { 0x38, "Message Waiting Indication", 46 },
431 { 0x0D, "Mobile Identity", 47 },
432 { 0x15, "MS Information Records (Forward)", 48 },
433 { 0xA0, "Origination Continuation Indicator", 49 },
434 { 0x5F, "PACA Order", 50 },
435 { 0x60, "PACA Reorigination Indicator", 51 },
436 { 0x4E, "PACA Timestamp", 52 },
437 { 0x70, "Packet Session Parameters", 53 },
438 { 0x14, "PDSN IP Address", 54 },
439 { 0xA2, "Power Down Indicator", 55 },
440 { 0x06, "Priority", 56 },
441 { 0x3B, "Protocol Revision", 57 },
442 { 0x18, "Protocol Type", 58 },
443 { 0x2D, "PSMM Count", 59 },
444 { 0x07, "Quality of Service Parameters", 60 },
445 { 0x1D, "Radio Environment and Resources", 61 },
446 { 0x1F, "Registration Type", 62 },
447 { 0x44, "Reject Cause", 63 },
448 { 0x1B, "Response Request", 64 },
449 { 0x68, "Return Cause", 65 },
450 { 0x21, "RF Channel Identity", 66 },
451 { 0x03, "Service Option", 67 },
452 { 0x1E, "Service Option Connection Identifier (SOCI)", 68 },
453 { 0x2A, "Service Option List", 69 },
454 { 0x69, "Service Redirection Info", 70 },
455 { 0x71, "Service Reference Identifier (SR_ID)", 71 },
456 { 0x32, "SID", 72 },
457 { 0x34, "Signal", 73 },
458 { 0x35, "Slot Cycle Index", 74 },
459 { 0x31, "Software Version", 75 },
460 { 0x39, "Source RNC to Target RNC Transparent Container", 76 },
461 { 0x14, "Source PDSN Address", 77 },
462 { 0x33, "Tag", 78 },
463 { 0x3A, "Target RNC to Source RNC Transparent Container", 79 },
464 { 0x36, "Transcoder Mode", 80 }, /* XXX 0x1C in IOS 4.0.1 */
465 { 0x02, "User Zone ID", 81 },
466 { 0xA1, "Voice Privacy Request", 82 },
467 { 0x45, "A2p Bearer Session-Level Parameters", 83 },
468 { 0x46, "A2p Bearer Format-Specific Parameters", 84 },
469 { 0x73, "MS Designated Frequency", 85 },
470 { 0x7D, "Mobile Subscription Information", 86 },
471 { 0x72, "Public Long Code Mask Identification", 87 },
472 { 0x15, "MS Information Records (Reverse)", 88 },
473 { 0, NULL, 0 }
477 * From Table 3.7.5-1 C.S0005-D v1.0 L3
479 #define ANSI_FWD_MS_INFO_REC_DISPLAY 0x01
480 #define ANSI_FWD_MS_INFO_REC_CLD_PN 0x02
481 #define ANSI_FWD_MS_INFO_REC_CLG_PN 0x03
482 #define ANSI_FWD_MS_INFO_REC_CONN_N 0x04
483 #define ANSI_FWD_MS_INFO_REC_SIGNAL 0x05
484 #define ANSI_FWD_MS_INFO_REC_MW 0x06
485 #define ANSI_FWD_MS_INFO_REC_SC 0x07
486 #define ANSI_FWD_MS_INFO_REC_CLD_PSA 0x08
487 #define ANSI_FWD_MS_INFO_REC_CLG_PSA 0x09
488 #define ANSI_FWD_MS_INFO_REC_CONN_SA 0x0a
489 #define ANSI_FWD_MS_INFO_REC_RED_N 0x0b
490 #define ANSI_FWD_MS_INFO_REC_RED_SA 0x0c
491 #define ANSI_FWD_MS_INFO_REC_MP 0x0d
492 #define ANSI_FWD_MS_INFO_REC_PA 0x0e
493 #define ANSI_FWD_MS_INFO_REC_LC 0x0f
494 #define ANSI_FWD_MS_INFO_REC_EDISPLAY 0x10
495 #define ANSI_FWD_MS_INFO_REC_NNSC 0x13
496 #define ANSI_FWD_MS_INFO_REC_MC_EDISPLAY 0x14
497 #define ANSI_FWD_MS_INFO_REC_CWI 0x15
498 #define ANSI_FWD_MS_INFO_REC_EMC_EDISPLAY 0x16
499 #define ANSI_FWD_MS_INFO_REC_ERTI 0xfe
501 static const value_string ansi_fwd_ms_info_rec_str[] = {
502 { ANSI_FWD_MS_INFO_REC_DISPLAY, "Display" },
503 { ANSI_FWD_MS_INFO_REC_CLD_PN, "Called Party Number" },
504 { ANSI_FWD_MS_INFO_REC_CLG_PN, "Calling Party Number" },
505 { ANSI_FWD_MS_INFO_REC_CONN_N, "Connected Number" },
506 { ANSI_FWD_MS_INFO_REC_SIGNAL, "Signal" },
507 { ANSI_FWD_MS_INFO_REC_MW, "Message Waiting" },
508 { ANSI_FWD_MS_INFO_REC_SC, "Service Configuration" },
509 { ANSI_FWD_MS_INFO_REC_CLD_PSA, "Called Party Subaddress" },
510 { ANSI_FWD_MS_INFO_REC_CLG_PSA, "Calling Party Subaddress" },
511 { ANSI_FWD_MS_INFO_REC_CONN_SA, "Connected Subaddress" },
512 { ANSI_FWD_MS_INFO_REC_RED_N, "Redirecting Number" },
513 { ANSI_FWD_MS_INFO_REC_RED_SA, "Redirecting Subaddress" },
514 { ANSI_FWD_MS_INFO_REC_MP, "Meter Pulses" },
515 { ANSI_FWD_MS_INFO_REC_PA, "Parametric Alerting" },
516 { ANSI_FWD_MS_INFO_REC_LC, "Line Control" },
517 { ANSI_FWD_MS_INFO_REC_EDISPLAY, "Extended Display" },
518 { ANSI_FWD_MS_INFO_REC_NNSC, "Non-Negotiable Service Configuration" },
519 { ANSI_FWD_MS_INFO_REC_MC_EDISPLAY, "Multiple Character Extended Display" },
520 { ANSI_FWD_MS_INFO_REC_CWI, "Call Waiting Indicator" },
521 { ANSI_FWD_MS_INFO_REC_EMC_EDISPLAY, "Enhanced Multiple Character Extended Display" },
522 { ANSI_FWD_MS_INFO_REC_ERTI, "Extended Record Type International" },
523 { 0, NULL }
525 #define NUM_FWD_MS_INFO_REC (sizeof(ansi_fwd_ms_info_rec_str)/sizeof(value_string))
526 static gint ett_ansi_fwd_ms_info_rec[NUM_FWD_MS_INFO_REC];
529 * From Table 2.7.4-1 C.S0005-D v1.0 L3
531 #define ANSI_REV_MS_INFO_REC_KEYPAD_FAC 0x03
532 #define ANSI_REV_MS_INFO_REC_CLD_PN 0x04
533 #define ANSI_REV_MS_INFO_REC_CLG_PN 0x05
534 #define ANSI_REV_MS_INFO_REC_CALL_MODE 0x07
535 #define ANSI_REV_MS_INFO_REC_TERM_INFO 0x08
536 #define ANSI_REV_MS_INFO_REC_ROAM_INFO 0x09
537 #define ANSI_REV_MS_INFO_REC_SECUR_STS 0x0a
538 #define ANSI_REV_MS_INFO_REC_CONN_N 0x0b
539 #define ANSI_REV_MS_INFO_REC_IMSI 0x0c
540 #define ANSI_REV_MS_INFO_REC_ESN 0x0d
541 #define ANSI_REV_MS_INFO_REC_BAND_INFO 0x0e
542 #define ANSI_REV_MS_INFO_REC_POWER_INFO 0x0f
543 #define ANSI_REV_MS_INFO_REC_OP_MODE_INFO 0x10
544 #define ANSI_REV_MS_INFO_REC_SO_INFO 0x11
545 #define ANSI_REV_MS_INFO_REC_MO_INFO 0x12
546 #define ANSI_REV_MS_INFO_REC_SC_INFO 0x13
547 #define ANSI_REV_MS_INFO_REC_CLD_PSA 0x14
548 #define ANSI_REV_MS_INFO_REC_CLG_PSA 0x15
549 #define ANSI_REV_MS_INFO_REC_CONN_SA 0x16
550 #define ANSI_REV_MS_INFO_REC_PCI 0x17
551 #define ANSI_REV_MS_INFO_REC_IMSI_M 0x18
552 #define ANSI_REV_MS_INFO_REC_IMSI_T 0x19
553 #define ANSI_REV_MS_INFO_REC_CAP_INFO 0x1a
554 #define ANSI_REV_MS_INFO_REC_CCC_INFO 0x1b
555 #define ANSI_REV_MS_INFO_REC_EMO_INFO 0x1c
556 #define ANSI_REV_MS_INFO_REC_GEO_CAP 0x1e
557 #define ANSI_REV_MS_INFO_REC_BAND_SUB 0x1f
558 #define ANSI_REV_MS_INFO_REC_GECO 0x20
559 #define ANSI_REV_MS_INFO_REC_HOOK 0x21
560 #define ANSI_REV_MS_INFO_REC_QOS_PARAM 0x22
561 #define ANSI_REV_MS_INFO_REC_ENCRYPT_CAP 0x23
562 #define ANSI_REV_MS_INFO_REC_SMI_CAP 0x24
563 #define ANSI_REV_MS_INFO_REC_UIM_ID 0x25
564 #define ANSI_REV_MS_INFO_REC_ESN_ME 0x26
565 #define ANSI_REV_MS_INFO_REC_MEID 0x27
566 #define ANSI_REV_MS_INFO_REC_EKEYPAD_FAC 0x28
567 #define ANSI_REV_MS_INFO_REC_SYNC_ID 0x29
568 #define ANSI_REV_MS_INFO_REC_ERTI 0xfe
570 static const value_string ansi_rev_ms_info_rec_str[] = {
571 { ANSI_REV_MS_INFO_REC_KEYPAD_FAC, "Keypad Facility" },
572 { ANSI_REV_MS_INFO_REC_CLD_PN, "Called Party Number" },
573 { ANSI_REV_MS_INFO_REC_CLG_PN, "Calling Party Number" },
574 { ANSI_REV_MS_INFO_REC_CALL_MODE, "Call Mode" },
575 { ANSI_REV_MS_INFO_REC_TERM_INFO, "Terminal Information" },
576 { ANSI_REV_MS_INFO_REC_ROAM_INFO, "Roaming Information" },
577 { ANSI_REV_MS_INFO_REC_SECUR_STS, "Security Status" },
578 { ANSI_REV_MS_INFO_REC_CONN_N, "Connected Number" },
579 { ANSI_REV_MS_INFO_REC_IMSI, "IMSI" },
580 { ANSI_REV_MS_INFO_REC_ESN, "ESN" },
581 { ANSI_REV_MS_INFO_REC_BAND_INFO, "Band Class Information" },
582 { ANSI_REV_MS_INFO_REC_POWER_INFO, "Power Class Information" },
583 { ANSI_REV_MS_INFO_REC_OP_MODE_INFO, "Operating Mode Information" },
584 { ANSI_REV_MS_INFO_REC_SO_INFO, "Service Option Information" },
585 { ANSI_REV_MS_INFO_REC_MO_INFO, "Multiplex Option Information" },
586 { ANSI_REV_MS_INFO_REC_SC_INFO, "Service Configuration Information" },
587 { ANSI_REV_MS_INFO_REC_CLD_PSA, "Called Party Subaddress" },
588 { ANSI_REV_MS_INFO_REC_CLG_PSA, "Calling Party Subaddress" },
589 { ANSI_REV_MS_INFO_REC_CONN_SA, "Connected Subaddress" },
590 { ANSI_REV_MS_INFO_REC_PCI, "Power Control Information" },
591 { ANSI_REV_MS_INFO_REC_IMSI_M, "IMSI_M" },
592 { ANSI_REV_MS_INFO_REC_IMSI_T, "IMSI_T" },
593 { ANSI_REV_MS_INFO_REC_CAP_INFO, "Capability Information" },
594 { ANSI_REV_MS_INFO_REC_CCC_INFO, "Channel Configuration Capability Information" },
595 { ANSI_REV_MS_INFO_REC_EMO_INFO, "Extended Multiplex Option Information" },
596 { ANSI_REV_MS_INFO_REC_GEO_CAP, "Geo-Location Capability" },
597 { ANSI_REV_MS_INFO_REC_BAND_SUB, "Band Subclass Information" },
598 { ANSI_REV_MS_INFO_REC_GECO, "Global Emergency Call" },
599 { ANSI_REV_MS_INFO_REC_HOOK, "Hook Status" },
600 { ANSI_REV_MS_INFO_REC_QOS_PARAM, "QoS Parameters" },
601 { ANSI_REV_MS_INFO_REC_ENCRYPT_CAP, "Encryption Capability" },
602 { ANSI_REV_MS_INFO_REC_SMI_CAP, "Signaling Message Integrity Capability" },
603 { ANSI_REV_MS_INFO_REC_UIM_ID, "UIM_ID" },
604 { ANSI_REV_MS_INFO_REC_ESN_ME, "ESN_ME" },
605 { ANSI_REV_MS_INFO_REC_MEID, "MEID" },
606 { ANSI_REV_MS_INFO_REC_EKEYPAD_FAC, "Extended Keypad Facility" },
607 { ANSI_REV_MS_INFO_REC_SYNC_ID, "SYNC_ID" },
608 { ANSI_REV_MS_INFO_REC_ERTI, "Extended Record Type International" },
609 { 0, NULL }
611 #define NUM_REV_MS_INFO_REC (sizeof(ansi_rev_ms_info_rec_str)/sizeof(value_string))
612 static gint ett_ansi_rev_ms_info_rec[NUM_REV_MS_INFO_REC];
615 * C.S0057 Table 1.5-1
617 static const gchar *band_class_str[] = {
618 "800 MHz Cellular System",
619 "1.850 to 1.990 GHz Broadband PCS",
620 "872 to 960 MHz TACS Band",
621 "832 to 925 MHz JTACS Band",
622 "1.750 to 1.870 GHz Korean PCS",
623 "450 MHz NMT",
624 "2 GHz IMT-2000",
625 "Upper 700 MHz",
626 "1.710 to 1.880 GHz PCS",
627 "880 to 960 MHz",
628 "Secondary 800 MHz",
629 "400 MHz European PAMR",
630 "800 MHz European PAMR",
631 "2.5 GHz IMT-2000 Extension",
632 "US PCS 1.9 GHz",
633 "AWS",
634 "US 2.5 GHz",
635 "US 2.5 GHz Forward Link Only",
636 "700 MHz Public Safety",
637 "Lower 700 MHz"
639 #define NUM_BAND_CLASS_STR (sizeof(band_class_str)/sizeof(gchar *))
641 static const gchar *cell_disc_str[] = {
642 "whole Cell Global Identification (CGI)",
643 "LAC/CI",
644 "Cell Identity (CI)",
645 "None",
646 "Location Area Identification (LAI)",
647 "Location Area Code (LAC)",
648 "ALL",
649 "IS-41 whole Cell Global Identification (ICGI)",
650 "Enhanced whole Cell Global Identification (ECGI)"
652 #define NUM_CELL_DISC_STR (sizeof(cell_disc_str)/sizeof(gchar *))
654 /* Initialize the protocol and registered fields */
655 static int proto_a_bsmap = -1;
656 static int proto_a_dtap = -1;
658 const ext_value_string_t *ansi_a_bsmap_strings = NULL;
659 const ext_value_string_t *ansi_a_dtap_strings = NULL;
660 const ext_value_string_t *ansi_a_elem_1_strings = NULL;
662 static int ansi_a_tap = -1;
664 /* static int hf_ansi_a_none = -1; */
665 static int hf_ansi_a_bsmap_msgtype = -1;
666 static int hf_ansi_a_dtap_msgtype = -1;
667 static int hf_ansi_a_length = -1;
668 static int hf_ansi_a_elem_id = -1;
669 static int hf_ansi_a_esn = -1;
670 static int hf_ansi_a_imsi = -1;
671 static int hf_ansi_a_min = -1;
672 static int hf_ansi_a_meid = -1;
673 static int hf_ansi_a_cld_party_bcd_num = -1;
674 #ifdef MAYBE_USED_FOR_OLDER_CODECS
675 static int hf_ansi_a_clg_party_bcd_num = -1;
676 #endif
677 static int hf_ansi_a_cld_party_ascii_num = -1;
678 static int hf_ansi_a_clg_party_ascii_num = -1;
679 static int hf_ansi_a_cell_ci = -1;
680 static int hf_ansi_a_cell_lac = -1;
681 static int hf_ansi_a_cell_mscid = -1;
682 static int hf_ansi_a_pdsn_ip_addr = -1;
683 static int hf_ansi_a_s_pdsn_ip_addr = -1;
684 static int hf_ansi_a_anchor_ip_addr = -1;
685 static int hf_ansi_a_anchor_pp_ip_addr = -1;
686 static int hf_ansi_a_a2p_bearer_ipv4_addr = -1;
687 static int hf_ansi_a_a2p_bearer_ipv6_addr = -1;
688 static int hf_ansi_a_a2p_bearer_udp_port = -1;
689 static int hf_ansi_a_so = -1;
690 static int hf_ansi_a_cause_1 = -1; /* 1 octet cause */
691 static int hf_ansi_a_cause_2 = -1; /* 2 octet cause */
692 static int hf_ansi_a_meid_configured = -1;
693 static int hf_ansi_a_ms_info_rec_signal_type = -1;
694 static int hf_ansi_a_ms_info_rec_signal_alert_pitch = -1;
695 static int hf_ansi_a_ms_info_rec_signal_tone = -1;
696 static int hf_ansi_a_ms_info_rec_signal_isdn_alert = -1;
697 static int hf_ansi_a_ms_info_rec_signal_is54b_alert = -1;
698 static int hf_ansi_a_ms_info_rec_call_waiting_ind = -1;
700 /* Initialize the subtree pointers */
701 static gint ett_bsmap = -1;
702 static gint ett_dtap = -1;
703 static gint ett_elems = -1;
704 static gint ett_elem = -1;
705 static gint ett_dtap_oct_1 = -1;
706 static gint ett_cm_srvc_type = -1;
707 static gint ett_ansi_ms_info_rec_reserved = -1;
708 static gint ett_ansi_enc_info = -1;
709 static gint ett_scm = -1;
710 static gint ett_cell_list = -1;
711 static gint ett_bearer_list = -1;
712 static gint ett_re_list = -1;
713 static gint ett_so_list = -1;
714 static gint ett_adds_user_part = -1;
715 static gint ett_scr = -1;
716 static gint ett_srvc_con_rec = -1;
717 static gint ett_cm2_band_class = -1;
718 static gint ett_vp_algs = -1;
720 static expert_field ei_ansi_a_extraneous_data = EI_INIT;
722 static char a_bigbuf[1024];
723 static dissector_handle_t data_handle;
724 static dissector_handle_t dtap_handle;
725 static dissector_table_t is637_dissector_table; /* IS-637-A Transport Layer (SMS) */
726 static dissector_table_t is683_dissector_table; /* IS-683-A (OTA) */
727 static dissector_table_t is801_dissector_table; /* IS-801 (PLD) */
728 static proto_tree *g_tree;
729 static address rtp_src_addr;
730 static guint32 rtp_ipv4_addr;
731 static struct e_in6_addr rtp_ipv6_addr;
732 static guint16 rtp_port;
733 static gboolean a_meid_configured = FALSE;
736 typedef struct ansi_a_dgt_set_t
739 * would typically be 15 but to allow MEID decoding this
740 * needs to have room for full hexadecimal representation
742 unsigned char out[16];
744 ansi_a_dgt_set_t;
747 * As per A.S0001 Called Party BCD Number
749 static ansi_a_dgt_set_t Dgt_tbcd = {
751 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
752 '0','1','2','3','4','5','6','7','8','9','*','#','a','b','c', 0
756 static ansi_a_dgt_set_t Dgt_msid = {
758 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
759 '0','1','2','3','4','5','6','7','8','9','?','?','?','?','?', 0
763 static ansi_a_dgt_set_t Dgt_meid = {
765 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
766 '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'
770 /* FUNCTIONS */
773 * Unpack BCD input pattern into output ASCII pattern
775 * Input Pattern is supplied using the same format as the digits
777 * Returns: length of unpacked pattern
779 static int
780 my_dgt_tbcd_unpack(
781 char *out, /* ASCII pattern out */
782 guchar *in, /* packed pattern in */
783 int num_octs, /* Number of octets to unpack */
784 ansi_a_dgt_set_t *dgt /* Digit definitions */
787 int cnt = 0;
788 unsigned char i;
790 while (num_octs)
793 * unpack first value in byte
795 i = *in++;
796 *out++ = dgt->out[i & 0x0f];
797 cnt++;
800 * unpack second value in byte
802 i >>= 4;
804 if ((num_octs == 1) && (i == 0x0f)) /* odd number bytes - hit filler */
805 break;
807 *out++ = dgt->out[i];
808 cnt++;
809 num_octs--;
812 *out = '\0';
814 return(cnt);
817 static const gchar *
818 ansi_a_so_int_to_str(
819 gint32 so)
821 const gchar *str = NULL;
823 switch (so)
825 case 1: str = "Basic Variable Rate Voice Service (8 kbps)"; break;
826 case 2: str = "Mobile Station Loopback (8 kbps)"; break;
827 case 3: str = "(EVRC) Enhanced Variable Rate Voice Service (8 kbps)"; break;
828 case 4: str = "Asynchronous Data Service (9.6 kbps)"; break;
829 case 5: str = "Group 3 Facsimile (9.6 kbps)"; break;
830 case 6: str = "Short Message Services (Rate Set 1)"; break;
831 case 7: str = "Packet Data Service: Internet or ISO Protocol Stack (9.6 kbps)"; break;
832 case 8: str = "Packet Data Service: CDPD Protocol Stack (9.6 kbps)"; break;
833 case 9: str = "Mobile Station Loopback (13 kbps)"; break;
834 case 10: str = "STU-III Transparent Service"; break;
835 case 11: str = "STU-III Non-Transparent Service"; break;
836 case 12: str = "Asynchronous Data Service (14.4 or 9.6 kbps)"; break;
837 case 13: str = "Group 3 Facsimile (14.4 or 9.6 kbps)"; break;
838 case 14: str = "Short Message Services (Rate Set 2)"; break;
839 case 15: str = "Packet Data Service: Internet or ISO Protocol Stack (14.4 kbps)"; break;
840 case 16: str = "Packet Data Service: CDPD Protocol Stack (14.4 kbps)"; break;
841 case 17: str = "High Rate Voice Service (13 kbps)"; break;
842 case 32768: str = "QCELP (13 kbps)"; break;
843 case 32798: /* 0x801e */ str = "Qualcomm Loopback"; break;
844 case 32799: /* 0x801f */ str = "Qualcomm Markov 8 kbps Loopback"; break;
845 case 32800: /* 0x8020 */ str = "Qualcomm Packet Data"; break;
846 case 32801: /* 0x8021 */ str = "Qualcomm Async Data"; break;
847 case 18: str = "Over-the-Air Parameter Administration (Rate Set 1)"; break;
848 case 19: str = "Over-the-Air Parameter Administration (Rate Set 2)"; break;
849 case 20: str = "Group 3 Analog Facsimile (Rate Set 1)"; break;
850 case 21: str = "Group 3 Analog Facsimile (Rate Set 2)"; break;
851 case 22: str = "High Speed Packet Data Service: Internet or ISO Protocol Stack (RS1 forward, RS1 reverse)"; break;
852 case 23: str = "High Speed Packet Data Service: Internet or ISO Protocol Stack (RS1 forward, RS2 reverse)"; break;
853 case 24: str = "High Speed Packet Data Service: Internet or ISO Protocol Stack (RS2 forward, RS1 reverse)"; break;
854 case 25: str = "High Speed Packet Data Service: Internet or ISO Protocol Stack (RS2 forward, RS2 reverse)"; break;
855 case 26: str = "High Speed Packet Data Service: CDPD Protocol Stack (RS1 forward, RS1 reverse)"; break;
856 case 27: str = "High Speed Packet Data Service: CDPD Protocol Stack (RS1 forward, RS2 reverse)"; break;
857 case 28: str = "High Speed Packet Data Service: CDPD Protocol Stack (RS2 forward, RS1 reverse)"; break;
858 case 29: str = "High Speed Packet Data Service: CDPD Protocol Stack (RS2 forward, RS2 reverse)"; break;
859 case 30: str = "Supplemental Channel Loopback Test for Rate Set 1"; break;
860 case 31: str = "Supplemental Channel Loopback Test for Rate Set 2"; break;
861 case 32: str = "Test Data Service Option (TDSO)"; break;
862 case 33: str = "cdma2000 High Speed Packet Data Service, Internet or ISO Protocol Stack"; break;
863 case 34: str = "cdma2000 High Speed Packet Data Service, CDPD Protocol Stack"; break;
864 case 35: str = "Location Services (PDS), Rate Set 1 (9.6 kbps)"; break;
865 case 36: str = "Location Services (PDS), Rate Set 2 (14.4 kbps)"; break;
866 case 37: str = "ISDN Interworking Service (64 kbps)"; break;
867 case 38: str = "GSM Voice"; break;
868 case 39: str = "GSM Circuit Data"; break;
869 case 40: str = "GSM Packet Data"; break;
870 case 41: str = "GSM Short Message Service"; break;
871 case 42: str = "None Reserved for MC-MAP standard service options"; break;
872 case 54: str = "Markov Service Option (MSO)"; break;
873 case 55: str = "Loopback Service Option (LSO)"; break;
874 case 56: str = "Selectable Mode Vocoder"; break;
875 case 57: str = "32 kbps Circuit Video Conferencing"; break;
876 case 58: str = "64 kbps Circuit Video Conferencing"; break;
877 case 59: str = "HRPD Accounting Records Identifier"; break;
878 case 60: str = "Link Layer Assisted Robust Header Compression (LLA ROHC) - Header Removal"; break;
879 case 61: str = "Link Layer Assisted Robust Header Compression (LLA ROHC) - Header Compression"; break;
880 case 62: str = "- 4099 None Reserved for standard service options"; break;
881 case 68: str = "(EVRC-B NB) Enhanced Variable Rate Voice Service"; break;
882 case 70: str = "(EVRC-B WB) Enhanced Variable Rate Voice Service"; break;
883 case 73: str = "(EVRC-NW) Enhanced Variable Rate Voice Service"; break;
884 case 4100: str = "Asynchronous Data Service, Revision 1 (9.6 or 14.4 kbps)"; break;
885 case 4101: str = "Group 3 Facsimile, Revision 1 (9.6 or 14.4 kbps)"; break;
886 case 4102: str = "Reserved for standard service option"; break;
887 case 4103: str = "Packet Data Service: Internet or ISO Protocol Stack, Revision 1 (9.6 or 14.4 kbps)"; break;
888 case 4104: str = "Packet Data Service: CDPD Protocol Stack, Revision 1 (9.6 or 14.4 kbps)"; break;
889 default:
890 if ((so >= 4105) && (so <= 32767)) { str = "Reserved for standard service options"; }
891 else if ((so >= 32769) && (so <= 32771)) { str = "Proprietary QUALCOMM Incorporated"; }
892 else if ((so >= 32772) && (so <= 32775)) { str = "Proprietary OKI Telecom"; }
893 else if ((so >= 32776) && (so <= 32779)) { str = "Proprietary Lucent Technologies"; }
894 else if ((so >= 32780) && (so <=32783)) { str = "Nokia"; }
895 else if ((so >= 32784) && (so <=32787)) { str = "NORTEL NETWORKS"; }
896 else if ((so >= 32788) && (so <=32791)) { str = "Sony Electronics Inc."; }
897 else if ((so >= 32792) && (so <=32795)) { str = "Motorola"; }
898 else if ((so >= 32796) && (so <=32799)) { str = "QUALCOMM Incorporated"; }
899 else if ((so >= 32800) && (so <=32803)) { str = "QUALCOMM Incorporated"; }
900 else if ((so >= 32804) && (so <=32807)) { str = "QUALCOMM Incorporated"; }
901 else if ((so >= 32808) && (so <=32811)) { str = "QUALCOMM Incorporated"; }
902 else if ((so >= 32812) && (so <=32815)) { str = "Lucent Technologies"; }
903 else if ((so >= 32816) && (so <=32819)) { str = "Denso International"; }
904 else if ((so >= 32820) && (so <=32823)) { str = "Motorola"; }
905 else if ((so >= 32824) && (so <=32827)) { str = "Denso International"; }
906 else if ((so >= 32828) && (so <=32831)) { str = "Denso International"; }
907 else if ((so >= 32832) && (so <=32835)) { str = "Denso International"; }
908 else if ((so >= 32836) && (so <=32839)) { str = "NEC America"; }
909 else if ((so >= 32840) && (so <=32843)) { str = "Samsung Electronics"; }
910 else if ((so >= 32844) && (so <=32847)) { str = "Texas Instruments Incorporated"; }
911 else if ((so >= 32848) && (so <=32851)) { str = "Toshiba Corporation"; }
912 else if ((so >= 32852) && (so <=32855)) { str = "LG Electronics Inc."; }
913 else if ((so >= 32856) && (so <=32859)) { str = "VIA Telecom Inc."; }
914 else { str = "Reserved"; }
915 break;
918 return(str);
922 /* ELEMENT FUNCTIONS */
924 #define EXTRANEOUS_DATA_CHECK(edc_len, edc_max_len) \
925 if ((edc_len) > (edc_max_len)) \
927 proto_tree_add_text(tree, tvb, \
928 curr_offset, (edc_len) - (edc_max_len), "Extraneous Data"); \
929 curr_offset += ((edc_len) - (edc_max_len)); \
932 #define EXTRANEOUS_DATA_CHECK_EXPERT(edc_len, edc_max_len) \
933 if ((edc_len) > (edc_max_len)) \
935 proto_tree_add_expert(tree, pinfo, &ei_ansi_a_extraneous_data, \
936 tvb, curr_offset, (edc_len) - (edc_max_len)); \
937 curr_offset += ((edc_len) - (edc_max_len)); \
940 #define SHORT_DATA_CHECK(sdc_len, sdc_min_len) \
941 if ((sdc_len) < (sdc_min_len)) \
943 proto_tree_add_text(tree, tvb, \
944 curr_offset, (sdc_len), "Short Data (?)"); \
945 curr_offset += (sdc_len); \
946 return(curr_offset - offset); \
949 #define EXACT_DATA_CHECK(edc_len, edc_eq_len) \
950 if ((edc_len) != (edc_eq_len)) \
952 proto_tree_add_text(tree, tvb, \
953 asn1->offset, (edc_len), "Unexpected Data Length"); \
954 asn1->offset += (edc_len); \
955 return; \
958 #define NO_MORE_DATA_CHECK(nmdc_len) \
959 if ((nmdc_len) == (curr_offset - offset)) return(nmdc_len);
963 * IOS 6.2.2.6
965 static guint8
966 elem_chan_num(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len)
968 guint32 value;
969 guint32 curr_offset;
971 curr_offset = offset;
973 value = tvb_get_ntohs(tvb, curr_offset);
975 switch (global_a_variant)
977 case A_VARIANT_IOS401:
978 proto_tree_add_text(tree,
979 tvb, curr_offset, 2,
980 "Channel Number: %u",
981 value);
983 g_snprintf(add_string, string_len, " - (%u)", value);
984 break;
986 case A_VARIANT_IOS501:
987 other_decode_bitfield_value(a_bigbuf, value >> 8, 0xf8, 8);
988 proto_tree_add_text(tree,
989 tvb, curr_offset, 1,
990 "%s : Reserved",
991 a_bigbuf);
993 other_decode_bitfield_value(a_bigbuf, value >> 8, 0x07, 8);
994 proto_tree_add_text(tree, tvb, curr_offset, 1,
995 "%s : ARFCN (MSB): %u",
996 a_bigbuf,
997 value & 0x07ff);
999 other_decode_bitfield_value(a_bigbuf, value & 0x00ff, 0xff, 8);
1000 proto_tree_add_text(tree, tvb, curr_offset + 1, 1,
1001 "%s : ARFCN (LSB)",
1002 a_bigbuf);
1004 g_snprintf(add_string, string_len, " - (ARFCN: %u)", value & 0x07ff);
1005 break;
1008 curr_offset += 2;
1010 /* no length check possible */
1012 return(curr_offset - offset);
1016 * IOS 6.2.2.7
1018 static guint8
1019 elem_chan_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
1021 guint8 oct;
1022 guint32 curr_offset;
1023 const gchar *str = NULL;
1024 gboolean data;
1026 curr_offset = offset;
1027 data = FALSE;
1029 oct = tvb_get_guint8(tvb, curr_offset);
1031 switch (oct)
1033 case 0: str = "No Alert"; break;
1034 case 1: str = "Speech"; break;
1035 case 2: str = "Data"; data = TRUE; break;
1036 case 3: str = "Signaling"; break;
1037 default:
1038 str = "Unknown";
1039 break;
1042 proto_tree_add_text(tree,
1043 tvb, curr_offset, 1,
1044 "Speech or Data Indicator: %s",
1045 str);
1047 g_snprintf(add_string, string_len, " - (%s)", str);
1049 curr_offset++;
1051 NO_MORE_DATA_CHECK(len);
1053 oct = tvb_get_guint8(tvb, curr_offset);
1055 switch (oct)
1057 case 0: str = "Reserved (invalid)"; break;
1058 case 1: str = "DCCH"; break;
1059 case 2: str = "Reserved for future use (invalid)"; break;
1060 case 8: str = "Full rate TCH channel Bm"; break;
1061 case 9: str = "Half rate TCH channel Lm"; break;
1062 default:
1063 str = "Unknown";
1064 break;
1067 proto_tree_add_text(tree,
1068 tvb, curr_offset, 1,
1069 "Channel Rate and Type: %s",
1070 str);
1072 curr_offset++;
1074 NO_MORE_DATA_CHECK(len);
1076 oct = tvb_get_guint8(tvb, curr_offset);
1078 if (data)
1080 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
1081 proto_tree_add_text(tree,
1082 tvb, curr_offset, 1,
1083 "%s : Extension",
1084 a_bigbuf);
1086 other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
1087 proto_tree_add_text(tree,
1088 tvb, curr_offset, 1,
1089 "%s : %sTransparent service",
1090 a_bigbuf,
1091 (oct & 0x40) ? "Non-" : "");
1093 other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
1094 proto_tree_add_text(tree,
1095 tvb, curr_offset, 1,
1096 "%s : Reserved",
1097 a_bigbuf);
1099 else
1101 switch (oct)
1103 case 0: str = "No Resources Required (invalid)"; break;
1104 case 1: str = "Reserved"; break;
1105 case 2: str = "Reserved"; break;
1106 case 3: str = "TIA/EIA-IS-2000 8 kb/s vocoder"; break;
1107 case 4: str = "8 kb/s enhanced vocoder (EVRC)"; break;
1108 case 5: str = "13 kb/s vocoder"; break;
1109 case 6: str = "ADPCM"; break;
1110 default:
1111 str = "Reserved";
1112 break;
1115 proto_tree_add_text(tree,
1116 tvb, curr_offset, 1,
1117 "Speech Encoding Algorithm/data rate + Transparency Indicator: %s",
1118 str);
1121 curr_offset++;
1123 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
1125 return(curr_offset - offset);
1129 * IOS 5 4.2.83
1131 static guint8
1132 elem_return_cause(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1134 guint8 oct;
1135 const gchar *str;
1136 guint32 curr_offset;
1138 curr_offset = offset;
1140 oct = tvb_get_guint8(tvb, curr_offset);
1142 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
1143 proto_tree_add_text(tree, tvb, curr_offset, 1,
1144 "%s : Reserved",
1145 a_bigbuf);
1147 switch (oct & 0x0f)
1149 case 0: str = "Normal access"; break;
1150 case 1: str = "Service redirection failed as a result of system not found"; break;
1151 case 2: str = "Service redirection failed as a result of protocol mismatch"; break;
1152 case 3: str = "Service redirection failed as a result of registration rejection"; break;
1153 case 4: str = "Service redirection failed as a result of wrong SID"; break;
1154 case 5: str = "Service redirection failed as a result of wrong NID"; break;
1155 default:
1156 str = "Reserved";
1157 break;
1160 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
1161 proto_tree_add_text(tree, tvb, curr_offset, 1,
1162 "%s : Return Cause: %s",
1163 a_bigbuf,
1164 str);
1166 curr_offset++;
1168 /* no length check possible */
1170 return(curr_offset - offset);
1174 * IOS 6.2.2.8
1176 static guint8
1177 elem_rf_chan_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len)
1179 guint8 oct;
1180 guint32 value;
1181 guint32 curr_offset;
1183 curr_offset = offset;
1185 proto_tree_add_text(tree, tvb, curr_offset, 1,
1186 "Color Code");
1188 curr_offset++;
1190 oct = tvb_get_guint8(tvb, curr_offset);
1192 other_decode_bitfield_value(a_bigbuf, oct, 0xfc, 8);
1193 proto_tree_add_text(tree, tvb, curr_offset, 1,
1194 "%s : Reserved",
1195 a_bigbuf);
1197 other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
1198 proto_tree_add_text(tree, tvb, curr_offset, 1,
1199 "%s : N-AMPS",
1200 a_bigbuf);
1202 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
1203 proto_tree_add_text(tree, tvb, curr_offset, 1,
1204 "%s : ANSI/EIA/TIA-553",
1205 a_bigbuf);
1207 curr_offset++;
1209 oct = tvb_get_guint8(tvb, curr_offset);
1211 other_decode_bitfield_value(a_bigbuf, oct, 0xfc, 8);
1212 proto_tree_add_text(tree, tvb, curr_offset, 1,
1213 "%s : Reserved",
1214 a_bigbuf);
1216 other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
1217 proto_tree_add_text(tree, tvb, curr_offset, 1,
1218 "%s : Timeslot Number",
1219 a_bigbuf);
1221 curr_offset++;
1223 value = tvb_get_ntohs(tvb, curr_offset);
1225 other_decode_bitfield_value(a_bigbuf, value >> 8, 0xf8, 8);
1226 proto_tree_add_text(tree, tvb, curr_offset, 1,
1227 "%s : Reserved",
1228 a_bigbuf);
1230 other_decode_bitfield_value(a_bigbuf, value >> 8, 0x07, 8);
1231 proto_tree_add_text(tree, tvb, curr_offset, 1,
1232 "%s : ARFCN (MSB): %u",
1233 a_bigbuf,
1234 value & 0x07ff);
1236 other_decode_bitfield_value(a_bigbuf, value & 0x00ff, 0xff, 8);
1237 proto_tree_add_text(tree, tvb, curr_offset + 1, 1,
1238 "%s : ARFCN (LSB)",
1239 a_bigbuf);
1241 g_snprintf(add_string, string_len, " - (ARFCN: %u)", value & 0x07ff);
1243 curr_offset += 2;
1245 /* no length check possible */
1247 return(curr_offset - offset);
1251 * IOS 5 4.2.86
1253 static guint8
1254 elem_sr_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
1256 guint8 oct;
1257 guint32 curr_offset;
1259 curr_offset = offset;
1261 oct = tvb_get_guint8(tvb, curr_offset);
1263 other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
1264 proto_tree_add_text(tree,
1265 tvb, curr_offset, 1,
1266 "%s : Reserved",
1267 a_bigbuf);
1269 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
1270 proto_tree_add_text(tree,
1271 tvb, curr_offset, 1,
1272 "%s : SR_ID: %u",
1273 a_bigbuf,
1274 oct & 0x07);
1276 g_snprintf(add_string, string_len, " - (%u)", oct);
1278 curr_offset++;
1280 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
1282 return(curr_offset - offset);
1286 * IOS 6.2.2.9
1288 static guint8
1289 elem_sid(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len)
1291 guint32 value;
1292 guint32 curr_offset;
1294 curr_offset = offset;
1296 value = tvb_get_ntohs(tvb, curr_offset);
1298 other_decode_bitfield_value(a_bigbuf, value >> 8, 0x80, 8);
1299 proto_tree_add_text(tree, tvb, curr_offset, 1,
1300 "%s : Reserved",
1301 a_bigbuf);
1303 other_decode_bitfield_value(a_bigbuf, value >> 8, 0x7f, 8);
1304 proto_tree_add_text(tree, tvb, curr_offset, 1,
1305 "%s : SID (MSB), %u",
1306 a_bigbuf,
1307 value & 0x7fff);
1309 other_decode_bitfield_value(a_bigbuf, value & 0x00ff, 0xff, 8);
1310 proto_tree_add_text(tree, tvb, curr_offset + 1, 1,
1311 "%s : SID (LSB)",
1312 a_bigbuf);
1314 g_snprintf(add_string, string_len, " - (SID: %u)", value & 0x7fff);
1316 curr_offset += 2;
1318 /* no length check possible */
1320 return(curr_offset - offset);
1324 * IOS 6.2.2.10
1326 static guint8
1327 elem_is95_chan_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
1329 guint8 oct;
1330 guint32 value;
1331 guint32 curr_offset;
1333 curr_offset = offset;
1335 oct = tvb_get_guint8(tvb, curr_offset);
1337 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
1338 proto_tree_add_text(tree, tvb, curr_offset, 1,
1339 "%s : Hard Handoff",
1340 a_bigbuf);
1342 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
1343 proto_tree_add_text(tree, tvb, curr_offset, 1,
1344 "%s : Number of Channels to Add: %u",
1345 a_bigbuf,
1346 (oct & 0x70) >> 4);
1348 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
1349 proto_tree_add_text(tree, tvb, curr_offset, 1,
1350 "%s : Frame Offset: (%u), %.2f ms",
1351 a_bigbuf,
1352 oct & 0x0f,
1353 (oct & 0x0f) * 1.25);
1355 curr_offset++;
1357 NO_MORE_DATA_CHECK(len);
1359 SHORT_DATA_CHECK(len - (curr_offset - offset), 4);
1363 oct = tvb_get_guint8(tvb, curr_offset);
1365 proto_tree_add_text(tree, tvb, curr_offset, 1,
1366 "Walsh Code Channel Index: %u",
1367 oct);
1369 curr_offset++;
1371 oct = tvb_get_guint8(tvb, curr_offset);
1373 other_decode_bitfield_value(a_bigbuf, oct, 0xff, 8);
1374 proto_tree_add_text(tree, tvb, curr_offset, 1,
1375 "%s : Pilot PN Code (LSB)",
1376 a_bigbuf);
1378 curr_offset++;
1380 value = oct;
1381 oct = tvb_get_guint8(tvb, curr_offset);
1382 value |= ((guint32) (oct & 0x80)) << 1;
1384 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
1385 proto_tree_add_text(tree, tvb, curr_offset, 1,
1386 "%s : Pilot PN Code (MSB): %u",
1387 a_bigbuf,
1388 value);
1390 other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
1391 proto_tree_add_text(tree, tvb, curr_offset, 1,
1392 "%s : Power Combined",
1393 a_bigbuf);
1395 other_decode_bitfield_value(a_bigbuf, oct, 0x20, 8);
1396 proto_tree_add_text(tree, tvb, curr_offset, 1,
1397 "%s : Frequency Included",
1398 a_bigbuf);
1400 other_decode_bitfield_value(a_bigbuf, oct, 0x18, 8);
1401 proto_tree_add_text(tree, tvb, curr_offset, 1,
1402 "%s : Reserved",
1403 a_bigbuf);
1405 value = tvb_get_guint8(tvb, curr_offset + 1) | ((oct & 0x07) << 8);
1407 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
1408 proto_tree_add_text(tree, tvb, curr_offset, 1,
1409 "%s : ARFCN (MSB): %u",
1410 a_bigbuf,
1411 value);
1413 curr_offset++;
1415 other_decode_bitfield_value(a_bigbuf, value & 0x00ff, 0xff, 8);
1416 proto_tree_add_text(tree, tvb, curr_offset, 1,
1417 "%s : ARFCN (LSB)",
1418 a_bigbuf);
1420 if (add_string[0] == '\0')
1422 g_snprintf(add_string, string_len, " - (ARFCN: %u)", value);
1425 curr_offset++;
1427 while ((len - (curr_offset - offset)) >= 4);
1429 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
1431 return(curr_offset - offset);
1435 * IOS 6.2.2.11
1436 * UNUSED
1440 * IOS 6.2.2.12
1442 static guint8
1443 elem_enc_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
1445 guint8 oct;
1446 guint8 oct_len;
1447 guint32 curr_offset;
1448 const gchar *str;
1449 guint8 num_recs;
1450 proto_tree *subtree;
1451 proto_item *item;
1453 curr_offset = offset;
1455 num_recs = 0;
1457 while ((len - (curr_offset - offset)) >= 2)
1459 num_recs++;
1461 oct = tvb_get_guint8(tvb, curr_offset);
1463 switch ((oct & 0x7c) >> 2)
1465 case 0: str = "Not Used - Invalid value"; break;
1466 case 1: str = "SME Key: Signaling Message Encryption Key"; break;
1467 case 2: str = "Reserved (VPM: Voice Privacy Mask)"; break;
1468 case 3: str = "Reserved"; break;
1469 case 4: str = "Private Longcode"; break;
1470 case 5: str = "Data Key (ORYX)"; break;
1471 case 6: str = "Initial RAND"; break;
1472 default:
1473 str = "Reserved";
1474 break;
1477 item =
1478 proto_tree_add_text(tree,
1479 tvb, curr_offset, 1,
1480 "Encryption Info [%u]: (%u) %s",
1481 num_recs,
1482 (oct & 0x7c) >> 2,
1483 str);
1485 subtree = proto_item_add_subtree(item, ett_ansi_enc_info);
1487 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
1488 proto_tree_add_text(subtree, tvb, curr_offset, 1,
1489 "%s : Extension",
1490 a_bigbuf);
1492 other_decode_bitfield_value(a_bigbuf, oct, 0x7c, 8);
1493 proto_tree_add_text(subtree, tvb, curr_offset, 1,
1494 "%s : Encryption Parameter Identifier: (%u) %s",
1495 a_bigbuf,
1496 (oct & 0x7c) >> 2,
1497 str);
1499 other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
1500 proto_tree_add_text(subtree, tvb, curr_offset, 1,
1501 "%s : Status: %s",
1502 a_bigbuf,
1503 (oct & 0x02) ? "active" : "inactive");
1505 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
1506 proto_tree_add_text(subtree, tvb, curr_offset, 1,
1507 "%s : Available: algorithm is %savailable",
1508 a_bigbuf,
1509 (oct & 0x01) ? "" : "not ");
1511 curr_offset++;
1513 oct_len = tvb_get_guint8(tvb, curr_offset);
1515 proto_tree_add_uint(subtree, hf_ansi_a_length, tvb,
1516 curr_offset, 1, oct_len);
1518 curr_offset++;
1520 if (oct_len > 0)
1522 SHORT_DATA_CHECK(len - (curr_offset - offset), oct_len);
1524 proto_tree_add_text(subtree, tvb, curr_offset, oct_len,
1525 "Encryption Parameter value");
1527 curr_offset += oct_len;
1531 g_snprintf(add_string, string_len, " - %u record%s",
1532 num_recs, plurality(num_recs, "", "s"));
1534 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
1536 return(curr_offset - offset);
1540 * IOS 6.2.2.13
1541 * NO ASSOCIATED DATA
1545 * IOS 6.2.2.14
1546 * A3/A7
1550 * IOS 6.2.2.15
1552 static guint8
1553 elem_cm_info_type_2(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
1555 guint8 oct, oct2;
1556 guint8 num_bands, band_class_count;
1557 guint32 curr_offset;
1558 gint band_class;
1559 proto_tree *subtree;
1560 proto_item *item;
1561 const gchar *str;
1563 curr_offset = offset;
1565 oct = tvb_get_guint8(tvb, curr_offset);
1567 other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
1568 proto_tree_add_text(tree, tvb, curr_offset, 1,
1569 "%s : Mobile P_REV: %u",
1570 a_bigbuf,
1571 (oct & 0xe0) >> 5);
1573 g_snprintf(add_string, string_len, " - P_REV (%u)", (oct & 0xe0) >> 5);
1575 other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
1576 proto_tree_add_text(tree, tvb, curr_offset, 1,
1577 "%s : Reserved",
1578 a_bigbuf);
1580 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
1581 proto_tree_add_text(tree, tvb, curr_offset, 1,
1582 "%s : See List of Entries",
1583 a_bigbuf);
1585 switch (oct & 0x07)
1587 case 0: str = "Class 1, vehicle and portable"; break;
1588 case 1: str = "Class 2, portable"; break;
1589 case 2: str = "Class 3, handheld"; break;
1590 case 3: str = "Class 4, handheld"; break;
1591 case 4: str = "Class 5, handheld"; break;
1592 case 5: str = "Class 6, handheld"; break;
1593 case 6: str = "Class 7, handheld"; break;
1594 default:
1595 str = "Class 8, handheld";
1596 break;
1599 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
1600 proto_tree_add_text(tree, tvb, curr_offset, 1,
1601 "%s : RF Power Capability: %s",
1602 a_bigbuf,
1603 str);
1605 curr_offset++;
1607 proto_tree_add_text(tree, tvb, curr_offset, 1,
1608 "Reserved");
1610 curr_offset++;
1612 oct = tvb_get_guint8(tvb, curr_offset);
1614 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
1615 proto_tree_add_text(tree, tvb, curr_offset, 1,
1616 "%s : NAR_AN_CAP: N-AMPS %ssupported",
1617 a_bigbuf,
1618 (oct & 0x80) ? "" : "not ");
1620 other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
1621 proto_tree_add_text(tree, tvb, curr_offset, 1,
1622 "%s : IS-95: %ssupported",
1623 a_bigbuf,
1624 (oct & 0x40) ? "" : "not ");
1626 other_decode_bitfield_value(a_bigbuf, oct, 0x20, 8);
1627 proto_tree_add_text(tree, tvb, curr_offset, 1,
1628 "%s : Slotted: mobile is %sin slotted mode",
1629 a_bigbuf,
1630 (oct & 0x20) ? "" : "not ");
1632 other_decode_bitfield_value(a_bigbuf, oct, 0x18, 8);
1633 proto_tree_add_text(tree, tvb, curr_offset, 1,
1634 "%s : Reserved",
1635 a_bigbuf);
1637 other_decode_bitfield_value(a_bigbuf, oct, 0x04, 8);
1638 proto_tree_add_text(tree, tvb, curr_offset, 1,
1639 "%s : DTX: mobile is %scapable of DTX",
1640 a_bigbuf,
1641 (oct & 0x04) ? "" : "not ");
1643 other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
1644 proto_tree_add_text(tree, tvb, curr_offset, 1,
1645 "%s : Mobile Term: mobile is %scapable of receiving incoming calls",
1646 a_bigbuf,
1647 (oct & 0x02) ? "" : "not ");
1649 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
1650 proto_tree_add_text(tree, tvb, curr_offset, 1,
1651 "%s : Reserved",
1652 a_bigbuf);
1654 curr_offset++;
1656 NO_MORE_DATA_CHECK(len);
1658 proto_tree_add_text(tree, tvb, curr_offset, 1,
1659 "Reserved");
1661 curr_offset++;
1663 NO_MORE_DATA_CHECK(len);
1665 oct = tvb_get_guint8(tvb, curr_offset);
1667 other_decode_bitfield_value(a_bigbuf, oct, 0xfc, 8);
1668 proto_tree_add_text(tree, tvb, curr_offset, 1,
1669 "%s : Reserved",
1670 a_bigbuf);
1672 other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
1673 proto_tree_add_text(tree, tvb, curr_offset, 1,
1674 "%s : Mobile Term: mobile is %scapable of receiving incoming calls",
1675 a_bigbuf,
1676 (oct & 0x02) ? "" : "not ");
1678 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
1679 proto_tree_add_text(tree, tvb, curr_offset, 1,
1680 "%s : PACA Supported Indicator (PSI): mobile station %s PACA",
1681 a_bigbuf,
1682 (oct & 0x01) ? "supports" : "does not support");
1684 curr_offset++;
1686 NO_MORE_DATA_CHECK(len);
1688 oct = tvb_get_guint8(tvb, curr_offset);
1690 proto_tree_add_text(tree, tvb, curr_offset, 1,
1691 "SCM Length: %u",
1692 oct);
1694 curr_offset++;
1696 oct = tvb_get_guint8(tvb, curr_offset);
1698 item =
1699 proto_tree_add_text(tree, tvb, curr_offset, 1,
1700 "Station Class Mark: %u",
1701 oct);
1704 * following SCM decode is from:
1705 * 3GPP2 C.S0005-0 section 2.3.3
1706 * 3GPP2 C.S0072-0 section 2.1.2
1708 subtree = proto_item_add_subtree(item, ett_scm);
1710 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
1711 proto_tree_add_text(subtree, tvb, curr_offset, 1,
1712 "%s : Extended SCM Indicator: %s",
1713 a_bigbuf,
1714 (oct & 0x80) ? "Band Classes 1,4" : "Other bands");
1716 other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
1717 proto_tree_add_text(subtree, tvb, curr_offset, 1,
1718 "%s : %s",
1719 a_bigbuf,
1720 (oct & 0x40) ? "Dual Mode" : "CDMA Only");
1722 other_decode_bitfield_value(a_bigbuf, oct, 0x20, 8);
1723 proto_tree_add_text(subtree, tvb, curr_offset, 1,
1724 "%s : %s",
1725 a_bigbuf,
1726 (oct & 0x20) ? "Slotted" : "Non-Slotted");
1728 if (oct & 0x10)
1730 str = "";
1731 g_strlcat(add_string, " (MEID configured)", string_len);
1732 a_meid_configured = TRUE;
1734 else
1736 str = "not ";
1739 other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
1740 proto_tree_add_boolean_format(subtree, hf_ansi_a_meid_configured, tvb,
1741 curr_offset, 1, a_meid_configured,
1742 "%s : MEID %sconfigured",
1743 a_bigbuf,
1744 str);
1746 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
1747 proto_tree_add_text(subtree, tvb, curr_offset, 1,
1748 "%s : 25 MHz Bandwidth",
1749 a_bigbuf);
1751 other_decode_bitfield_value(a_bigbuf, oct, 0x04, 8);
1752 proto_tree_add_text(subtree, tvb, curr_offset, 1,
1753 "%s : %s Transmission",
1754 a_bigbuf,
1755 (oct & 0x04) ? "Discontinuous" : "Continuous");
1757 switch (oct & 0x03)
1759 case 0x00: str = "Class I"; break;
1760 case 0x01: str = "Class II"; break;
1761 case 0x02: str = "Class III"; break;
1762 case 0x03: str = "Reserved"; break;
1765 other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
1766 proto_tree_add_text(subtree, tvb, curr_offset, 1,
1767 "%s : Power Class for Band Class 0 Analog Operation: %s",
1768 a_bigbuf,
1769 str);
1771 curr_offset++;
1773 NO_MORE_DATA_CHECK(len);
1775 band_class_count = tvb_get_guint8(tvb, curr_offset);
1777 proto_tree_add_text(tree, tvb, curr_offset, 1,
1778 "Count of Band Class Entries: %u",
1779 band_class_count);
1781 curr_offset++;
1783 oct = tvb_get_guint8(tvb, curr_offset);
1785 proto_tree_add_text(tree, tvb, curr_offset, 1,
1786 "Band Class Entry Length: %u",
1787 oct);
1789 curr_offset++;
1791 NO_MORE_DATA_CHECK(len);
1793 if (oct > 0)
1795 SHORT_DATA_CHECK(len - (curr_offset - offset), 3);
1797 num_bands = 0;
1800 item =
1801 proto_tree_add_text(tree, tvb, curr_offset, 3,
1802 "Band Class Entry [%u]",
1803 num_bands + 1);
1805 subtree = proto_item_add_subtree(item, ett_cm2_band_class);
1807 oct = tvb_get_guint8(tvb, curr_offset);
1809 other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
1810 proto_tree_add_text(subtree,
1811 tvb, curr_offset, 1,
1812 "%s : Reserved",
1813 a_bigbuf);
1815 band_class = oct & 0x1f;
1816 if ((band_class < 0) || (band_class >= (gint) NUM_BAND_CLASS_STR))
1818 str = "Reserved";
1820 else
1822 str = band_class_str[band_class];
1825 other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
1826 proto_tree_add_text(subtree,
1827 tvb, curr_offset, 1,
1828 "%s : Band Class: %s",
1829 a_bigbuf,
1830 str);
1832 curr_offset++;
1834 oct2 = tvb_get_guint8(tvb, curr_offset);
1835 oct = tvb_get_guint8(tvb, curr_offset+1);
1837 if (oct < 4)
1839 other_decode_bitfield_value(a_bigbuf, oct2, 0x80, 8);
1840 proto_tree_add_text(subtree,
1841 tvb, curr_offset, 1,
1842 "%s : Band Class Air Interfaces OP_MODE0 (CDMA mode in Band Class 1 and Band Class 4)",
1843 a_bigbuf);
1845 other_decode_bitfield_value(a_bigbuf, oct2, 0x40, 8);
1846 proto_tree_add_text(subtree,
1847 tvb, curr_offset, 1,
1848 "%s : Band Class Air Interfaces OP_MODE1 (CDMA mode in Band Class 0 and Band Class 3)",
1849 a_bigbuf);
1851 other_decode_bitfield_value(a_bigbuf, oct2, 0x20, 8);
1852 proto_tree_add_text(subtree,
1853 tvb, curr_offset, 1,
1854 "%s : Band Class Air Interfaces OP_MODE2 (Analog mode)",
1855 a_bigbuf);
1857 other_decode_bitfield_value(a_bigbuf, oct2, 0x10, 8);
1858 proto_tree_add_text(subtree,
1859 tvb, curr_offset, 1,
1860 "%s : Band Class Air Interfaces OP_MODE3 (Wide analog mode)",
1861 a_bigbuf);
1863 other_decode_bitfield_value(a_bigbuf, oct2, 0x08, 8);
1864 proto_tree_add_text(subtree,
1865 tvb, curr_offset, 1,
1866 "%s : Band Class Air Interfaces OP_MODE4 (Narrow analog mode)",
1867 a_bigbuf);
1869 else
1871 other_decode_bitfield_value(a_bigbuf, oct2, 0x80, 8);
1872 proto_tree_add_text(subtree,
1873 tvb, curr_offset, 1,
1874 "%s : Band Class Air Interfaces OP_MODE0 (CDMA mode)",
1875 a_bigbuf);
1877 other_decode_bitfield_value(a_bigbuf, oct2, 0x40, 8);
1878 proto_tree_add_text(subtree,
1879 tvb, curr_offset, 1,
1880 "%s : Band Class Air Interfaces OP_MODE1 (CDMA mode)",
1881 a_bigbuf);
1883 other_decode_bitfield_value(a_bigbuf, oct2, 0x20, 8);
1884 proto_tree_add_text(subtree,
1885 tvb, curr_offset, 1,
1886 "%s : Band Class Air Interfaces OP_MODE2 (Analog mode)",
1887 a_bigbuf);
1889 other_decode_bitfield_value(a_bigbuf, oct2, 0x10, 8);
1890 proto_tree_add_text(subtree,
1891 tvb, curr_offset, 1,
1892 "%s : Band Class Air Interfaces OP_MODE3 (Wide analog mode)",
1893 a_bigbuf);
1895 other_decode_bitfield_value(a_bigbuf, oct2, 0x08, 8);
1896 proto_tree_add_text(subtree,
1897 tvb, curr_offset, 1,
1898 "%s : Band Class Air Interfaces OP_MODE4 (Narrow analog mode)",
1899 a_bigbuf);
1902 other_decode_bitfield_value(a_bigbuf, oct2, 0x07, 8);
1903 proto_tree_add_text(subtree,
1904 tvb, curr_offset, 1,
1905 "%s : Reserved",
1906 a_bigbuf);
1908 curr_offset++;
1910 proto_tree_add_text(subtree,
1911 tvb, curr_offset, 1,
1912 "Band Class MS Protocol Level: %u",
1913 oct);
1915 curr_offset++;
1917 proto_item_append_text(item, ": (%d)", band_class);
1919 num_bands++;
1921 while (((len - (curr_offset - offset)) >= 3) &&
1922 (num_bands < band_class_count));
1925 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
1927 return(curr_offset - offset);
1931 * IOS 6.2.2.16
1933 static guint8
1934 elem_mid(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
1936 guint8 oct;
1937 guint8 *poctets;
1938 guint32 value;
1939 guint32 curr_offset;
1940 const gchar *str;
1942 curr_offset = offset;
1944 oct = tvb_get_guint8(tvb, curr_offset);
1946 switch (oct & 0x07)
1948 case 1:
1949 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
1950 proto_tree_add_text(tree,
1951 tvb, curr_offset, 1,
1952 "%s : MEID Hex Digit 1: %X",
1953 a_bigbuf,
1954 (oct & 0xf0) >> 4);
1956 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
1957 proto_tree_add_text(tree,
1958 tvb, curr_offset, 1,
1959 "%s : Odd/Even Indicator: %s",
1960 a_bigbuf,
1961 (oct & 0x08) ? "ODD" : "EVEN");
1963 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
1964 proto_tree_add_text(tree,
1965 tvb, curr_offset, 1,
1966 "%s : Type of Identity: MEID",
1967 a_bigbuf);
1969 a_bigbuf[0] = Dgt_meid.out[(oct & 0xf0) >> 4];
1970 curr_offset++;
1972 poctets = tvb_get_string(wmem_packet_scope(), tvb, curr_offset, len - (curr_offset - offset));
1974 my_dgt_tbcd_unpack(&a_bigbuf[1], poctets, len - (curr_offset - offset),
1975 &Dgt_meid);
1977 curr_offset += len - (curr_offset - offset);
1979 proto_tree_add_string_format_value(tree,
1980 hf_ansi_a_meid,
1981 tvb, offset + 1, len - 1,
1982 a_bigbuf,
1983 "%s",
1984 a_bigbuf);
1986 g_snprintf(add_string, string_len, " - %s (%s)",
1987 "MEID",
1988 a_bigbuf);
1989 break;
1991 case 2:
1992 other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
1993 proto_tree_add_text(tree,
1994 tvb, curr_offset, 1,
1995 "%s : Reserved",
1996 a_bigbuf);
1998 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
1999 proto_tree_add_text(tree,
2000 tvb, curr_offset, 1,
2001 "%s : Type of Identity: Broadcast",
2002 a_bigbuf);
2004 curr_offset++;
2006 oct = tvb_get_guint8(tvb, curr_offset);
2008 switch ((oct & 0xc0) >> 6)
2010 case 0: str = "Normal"; break;
2011 case 1: str = "Interactive"; break;
2012 case 2: str = "Urgent"; break;
2013 default:
2014 str = "Emergency";
2015 break;
2018 other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
2019 proto_tree_add_text(tree,
2020 tvb, curr_offset, 1,
2021 "%s : Priority: %s",
2022 a_bigbuf,
2023 str);
2025 other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
2026 proto_tree_add_text(tree,
2027 tvb, curr_offset, 1,
2028 "%s : Message ID: %u",
2029 a_bigbuf,
2030 oct & 0x3f);
2032 curr_offset++;
2034 oct = tvb_get_guint8(tvb, curr_offset);
2036 proto_tree_add_text(tree,
2037 tvb, curr_offset, 1,
2038 "Zone ID: %u",
2039 oct);
2041 g_snprintf(add_string, string_len, " - Broadcast (Zone ID: %u)", oct);
2043 curr_offset++;
2045 value = tvb_get_ntohs(tvb, curr_offset);
2047 switch (value)
2049 case 0x0000: str = "Unknown or unspecified"; break;
2050 case 0x0001: str = "Emergency Broadcasts"; break;
2051 case 0x0002: str = "Administrative"; break;
2052 case 0x0003: str = "Maintenance"; break;
2053 case 0x0004: str = "General News - Local"; break;
2054 case 0x0005: str = "General News - Regional"; break;
2055 case 0x0006: str = "General News - National"; break;
2056 case 0x0007: str = "General News - International"; break;
2057 case 0x0008: str = "Business/Financial News - Local"; break;
2058 case 0x0009: str = "Business/Financial News - Regional"; break;
2059 case 0x000A: str = "Business/Financial News - National"; break;
2060 case 0x000B: str = "Business/Financial News - International"; break;
2061 case 0x000C: str = "Sports News - Local"; break;
2062 case 0x000D: str = "Sports News - Regional"; break;
2063 case 0x000E: str = "Sports News - National"; break;
2064 case 0x000F: str = "Sports News - International"; break;
2065 case 0x0010: str = "Entertainment News - Local"; break;
2066 case 0x0011: str = "Entertainment News - Regional"; break;
2067 case 0x0012: str = "Entertainment News - National"; break;
2068 case 0x0013: str = "Entertainment News - International"; break;
2069 case 0x0014: str = "Local Weather"; break;
2070 case 0x0015: str = "Area Traffic Reports"; break;
2071 case 0x0016: str = "Local Airport Flight Schedules"; break;
2072 case 0x0017: str = "Restaurants"; break;
2073 case 0x0018: str = "Lodgings"; break;
2074 case 0x0019: str = "Retail Directory"; break;
2075 case 0x001A: str = "Advertisements"; break;
2076 case 0x001B: str = "Stock Quotes"; break;
2077 case 0x001C: str = "Employment Opportunities"; break;
2078 case 0x001D: str = "Medical/Health/Hospitals"; break;
2079 case 0x001E: str = "Technology News"; break;
2080 case 0x001F: str = "Multi-category"; break;
2081 default:
2082 if ((value >= 0x0020) && (value <= 0x8000)) { str = "Reserved for standard service categories"; }
2083 else { str = "Reserved for proprietary service categories"; }
2084 break;
2087 proto_tree_add_text(tree,
2088 tvb, curr_offset, 2,
2089 "Service: (%u) %s",
2090 value,
2091 str);
2093 curr_offset += 2;
2095 oct = tvb_get_guint8(tvb, curr_offset);
2097 switch (oct)
2099 case 0: str = "Unknown or unspecified"; break;
2100 case 1: str = "English"; break;
2101 case 2: str = "French"; break;
2102 case 3: str = "Spanish"; break;
2103 case 4: str = "Japanese"; break;
2104 case 5: str = "Korean"; break;
2105 case 6: str = "Chinese"; break;
2106 case 7: str = "Hebrew"; break;
2107 default:
2108 str = "Reserved";
2109 break;
2112 proto_tree_add_text(tree,
2113 tvb, curr_offset, 1,
2114 "Language: (%u) %s",
2115 oct,
2116 str);
2118 curr_offset++;
2119 break;
2121 case 0:
2122 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
2123 proto_tree_add_text(tree,
2124 tvb, curr_offset, 1,
2125 "%s : Unused",
2126 a_bigbuf);
2128 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
2129 proto_tree_add_text(tree,
2130 tvb, curr_offset, 1,
2131 "%s : Odd/Even Indicator: %s",
2132 a_bigbuf,
2133 (oct & 0x08) ? "ODD" : "EVEN");
2135 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
2136 proto_tree_add_text(tree,
2137 tvb, curr_offset, 1,
2138 "%s : Type of Identity: No Identity Code",
2139 a_bigbuf);
2141 g_snprintf(add_string, string_len, " - No Identity Code");
2143 curr_offset++;
2145 if (len > 1)
2147 proto_tree_add_text(tree, tvb, curr_offset, len - 1,
2148 "Format not supported");
2151 curr_offset += len - 1;
2152 break;
2154 case 6:
2155 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
2156 proto_tree_add_text(tree,
2157 tvb, curr_offset, 1,
2158 "%s : Identity Digit 1: %c",
2159 a_bigbuf,
2160 Dgt_msid.out[(oct & 0xf0) >> 4]);
2162 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
2163 proto_tree_add_text(tree,
2164 tvb, curr_offset, 1,
2165 "%s : Odd/Even Indicator: %s",
2166 a_bigbuf,
2167 (oct & 0x08) ? "ODD" : "EVEN");
2169 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
2170 proto_tree_add_text(tree,
2171 tvb, curr_offset, 1,
2172 "%s : Type of Identity: %s",
2173 a_bigbuf,
2174 ((oct & 0x07) == 1) ? "MIN" : "IMSI");
2176 a_bigbuf[0] = Dgt_msid.out[(oct & 0xf0) >> 4];
2177 curr_offset++;
2179 poctets = tvb_get_string(wmem_packet_scope(), tvb, curr_offset, len - (curr_offset - offset));
2181 my_dgt_tbcd_unpack(&a_bigbuf[1], poctets, len - (curr_offset - offset),
2182 &Dgt_msid);
2184 proto_tree_add_string_format(tree,
2185 ((oct & 0x07) == 1) ? hf_ansi_a_min : hf_ansi_a_imsi,
2186 tvb, curr_offset, len - (curr_offset - offset),
2187 a_bigbuf,
2188 "BCD Digits: %s",
2189 a_bigbuf);
2191 g_snprintf(add_string, string_len, " - %s (%s)",
2192 ((oct & 0x07) == 1) ? "MIN" : "IMSI",
2193 a_bigbuf);
2195 curr_offset += len - (curr_offset - offset);
2196 break;
2198 case 3:
2199 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
2200 proto_tree_add_text(tree,
2201 tvb, curr_offset, 1,
2202 "%s : Unused",
2203 a_bigbuf);
2205 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
2206 proto_tree_add_text(tree,
2207 tvb, curr_offset, 1,
2208 "%s : Odd/Even Indicator: %s",
2209 a_bigbuf,
2210 (oct & 0x08) ? "ODD" : "EVEN");
2212 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
2213 proto_tree_add_text(tree,
2214 tvb, curr_offset, 1,
2215 "%s : Type of Identity: Interface Directory Number",
2216 a_bigbuf);
2218 g_snprintf(add_string, string_len, " - Interface Directory Number");
2220 curr_offset++;
2222 if (len > 1)
2224 proto_tree_add_text(tree, tvb, curr_offset, len - 1,
2225 "Format not supported");
2228 curr_offset += len - 1;
2229 break;
2231 case 4:
2232 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
2233 proto_tree_add_text(tree,
2234 tvb, curr_offset, 1,
2235 "%s : Unused",
2236 a_bigbuf);
2238 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
2239 proto_tree_add_text(tree,
2240 tvb, curr_offset, 1,
2241 "%s : Odd/Even Indicator: %s",
2242 a_bigbuf,
2243 (oct & 0x08) ? "ODD" : "EVEN");
2245 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
2246 proto_tree_add_text(tree,
2247 tvb, curr_offset, 1,
2248 "%s : Type of Identity: TMSI",
2249 a_bigbuf);
2251 g_snprintf(add_string, string_len, " - TMSI");
2253 curr_offset++;
2255 if (len > 1)
2257 proto_tree_add_text(tree, tvb, curr_offset, len - 1,
2258 "Format not supported");
2261 curr_offset += len - 1;
2262 break;
2264 case 5:
2265 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
2266 proto_tree_add_text(tree,
2267 tvb, curr_offset, 1,
2268 "%s : Unused",
2269 a_bigbuf);
2271 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
2272 proto_tree_add_text(tree,
2273 tvb, curr_offset, 1,
2274 "%s : Odd/Even Indicator: %s",
2275 a_bigbuf,
2276 (oct & 0x08) ? "ODD" : "EVEN");
2278 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
2279 proto_tree_add_text(tree,
2280 tvb, curr_offset, 1,
2281 "%s : Type of Identity: ESN",
2282 a_bigbuf);
2284 curr_offset++;
2286 value = tvb_get_ntohl(tvb, curr_offset);
2288 proto_tree_add_uint(tree, hf_ansi_a_esn,
2289 tvb, curr_offset, 4,
2290 value);
2292 g_snprintf(add_string, string_len, " - %sESN (0x%04x)",
2293 a_meid_configured ? "p" : "",
2294 value);
2296 curr_offset += 4;
2297 break;
2299 default:
2300 proto_tree_add_text(tree, tvb, curr_offset, len,
2301 "Format Unknown");
2303 g_snprintf(add_string, string_len, " - Format Unknown");
2305 curr_offset += len;
2306 break;
2309 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2311 return(curr_offset - offset);
2315 * IOS 6.2.2.17
2317 static guint8
2318 elem_sci(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len)
2320 guint8 oct;
2321 guint32 curr_offset;
2323 curr_offset = offset;
2325 oct = tvb_get_guint8(tvb, curr_offset);
2327 other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
2328 proto_tree_add_text(tree,
2329 tvb, curr_offset, 1,
2330 "%s : Reserved",
2331 a_bigbuf);
2333 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
2334 proto_tree_add_text(tree,
2335 tvb, curr_offset, 1,
2336 "%s : Slot Cycle Index: %u",
2337 a_bigbuf,
2338 oct & 0x07);
2340 g_snprintf(add_string, string_len, " - (%u)", oct & 0x07);
2342 curr_offset++;
2344 /* no length check possible */
2346 return(curr_offset - offset);
2350 * IOS 6.2.2.18
2352 static guint8
2353 elem_prio(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
2355 guint8 oct;
2356 guint32 curr_offset;
2358 curr_offset = offset;
2360 oct = tvb_get_guint8(tvb, curr_offset);
2362 other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
2363 proto_tree_add_text(tree,
2364 tvb, curr_offset, 1,
2365 "%s : Reserved",
2366 a_bigbuf);
2368 other_decode_bitfield_value(a_bigbuf, oct, 0x3c, 8);
2369 proto_tree_add_text(tree,
2370 tvb, curr_offset, 1,
2371 "%s : Call Priority Level: %u",
2372 a_bigbuf,
2373 (oct & 0x3c) >> 2);
2375 other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
2376 proto_tree_add_text(tree,
2377 tvb, curr_offset, 1,
2378 "%s : Queuing %sallowed",
2379 a_bigbuf,
2380 (oct & 0x02) ? "" : "not ");
2382 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
2383 proto_tree_add_text(tree,
2384 tvb, curr_offset, 1,
2385 "%s : Preemption %sallowed",
2386 a_bigbuf,
2387 (oct & 0x01) ? "" : "not ");
2389 g_snprintf(add_string, string_len, " - (%u)", (oct & 0x3c) >> 2);
2391 curr_offset++;
2393 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2395 return(curr_offset - offset);
2399 * IOS 5 4.2.79
2401 static guint8
2402 elem_p_rev(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
2404 guint8 oct;
2405 guint32 curr_offset;
2407 curr_offset = offset;
2409 oct = tvb_get_guint8(tvb, curr_offset);
2411 proto_tree_add_text(tree, tvb, curr_offset, 1,
2412 "MOB_P_REV");
2414 g_snprintf(add_string, string_len, " - (%u)", oct);
2416 curr_offset++;
2418 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2420 return(curr_offset - offset);
2424 * IOS 6.2.2.19
2426 static guint8
2427 elem_cause(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
2429 guint8 oct;
2430 guint32 value;
2431 guint32 curr_offset;
2432 const gchar *str = NULL;
2434 curr_offset = offset;
2436 oct = tvb_get_guint8(tvb, curr_offset);
2438 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
2439 proto_tree_add_text(tree,
2440 tvb, curr_offset, 1,
2441 "%s : Extension",
2442 a_bigbuf);
2444 if (oct & 0x80)
2446 /* 2 octet cause */
2448 if ((oct & 0x0f) == 0x00)
2450 /* national cause */
2451 switch ((oct & 0x70) >> 4)
2453 case 0: str = "Normal Event"; break;
2454 case 1: str = "Normal Event"; break;
2455 case 2: str = "Resource Unavailable"; break;
2456 case 3: str = "Service or option not available"; break;
2457 case 4: str = "Service or option not implemented"; break;
2458 case 5: str = "Invalid message (e.g., parameter out of range)"; break;
2459 case 6: str = "Protocol error"; break;
2460 default:
2461 str = "Interworking";
2462 break;
2465 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
2466 proto_tree_add_text(tree,
2467 tvb, curr_offset, 1,
2468 "%s : Cause Class: %s",
2469 a_bigbuf,
2470 str);
2472 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
2473 proto_tree_add_text(tree,
2474 tvb, curr_offset, 1,
2475 "%s : National Cause",
2476 a_bigbuf);
2478 curr_offset++;
2480 value = tvb_get_guint8(tvb, curr_offset);
2482 proto_tree_add_uint_format(tree, hf_ansi_a_cause_2, tvb,
2483 curr_offset, 1,
2484 ((oct & 0x7f) << 8) | value,
2485 "Cause Value");
2487 curr_offset++;
2489 g_snprintf(add_string, string_len, " - (National Cause)");
2491 else
2493 value = tvb_get_guint8(tvb, curr_offset + 1);
2495 other_decode_bitfield_value(a_bigbuf, oct, 0x7f, 8);
2497 proto_tree_add_uint_format(tree, hf_ansi_a_cause_2, tvb,
2498 curr_offset, 1,
2499 ((oct & 0x7f) << 8) | value,
2500 "%s : Cause (MSB): %u",
2501 a_bigbuf,
2502 ((oct & 0x7f) << 8) | value);
2504 curr_offset++;
2506 other_decode_bitfield_value(a_bigbuf, value, 0xff, 8);
2507 proto_tree_add_text(tree, tvb, curr_offset, 1,
2508 "%s : Cause (LSB)",
2509 a_bigbuf);
2511 curr_offset++;
2514 else
2516 switch (oct)
2518 case 0x00: str = "Radio interface message failure"; break;
2519 case 0x01: str = "Radio interface failure"; break;
2520 case 0x02: str = "Uplink Quality"; break;
2521 case 0x03: str = "Uplink strength"; break;
2522 case 0x04: str = "Downlink quality"; break;
2523 case 0x05: str = "Downlink strength"; break;
2524 case 0x06: str = "Distance"; break;
2525 case 0x07: str = "OAM&P intervention"; break;
2526 case 0x08: str = "MS busy"; break;
2527 case 0x09: str = "Call processing"; break;
2528 case 0x0A: str = "Reversion to old channel"; break;
2529 case 0x0B: str = "Handoff successful"; break;
2530 case 0x0C: str = "No response from MS"; break;
2531 case 0x0D: str = "Timer expired"; break;
2532 case 0x0E: str = "Better cell (power budget)"; break;
2533 case 0x0F: str = "Interference"; break;
2534 case 0x10: str = "Packet call going dormant"; break;
2535 case 0x11: str = "Service option not available"; break;
2537 case 0x12: str = "Invalid Call"; break;
2538 case 0x13: str = "Successful operation"; break;
2539 case 0x14: str = "Normal call release"; break;
2541 /* IOS 5 */
2542 case 0x15: str = "Short data burst authentication failure"; break;
2543 case 0x17: str = "Time critical relocation/handoff"; break;
2544 case 0x18: str = "Network optimization"; break;
2545 case 0x19: str = "Power down from dormant state"; break;
2546 case 0x1A: str = "Authentication failure"; break;
2548 case 0x1B: str = "Inter-BS Soft Handoff Drop Target"; break;
2549 case 0x1D: str = "Intra-BS Soft Handoff Drop Target"; break;
2551 /* IOS 5 */
2552 case 0x1E: str = "Autonomous Registration by the Network"; break;
2554 case 0x20: str = "Equipment failure"; break;
2555 case 0x21: str = "No radio resource available"; break;
2556 case 0x22: str = "Requested terrestrial resource unavailable"; break;
2558 /* IOS 5 */
2559 case 0x23: str = "A2p RTP Payload Type not available"; break;
2560 case 0x24: str = "A2p Bearer Format Address Type not available"; break;
2562 case 0x25: str = "BS not equipped"; break;
2563 case 0x26: str = "MS not equipped (or incapable)"; break;
2565 /* IOS 5 */
2566 case 0x27: str = "2G only sector"; break;
2567 case 0x28: str = "3G only sector"; break;
2569 case 0x29: str = "PACA Call Queued"; break;
2571 /* IOS 5 */
2572 case 0x2A: str = "Handoff Blocked"; break;
2574 case 0x2B: str = "Alternate signaling type reject"; break;
2576 /* IOS 5 */
2577 case 0x2C: str = "A2p Resource not available"; break;
2579 case 0x2D: str = "PACA Queue Overflow"; break;
2580 case 0x2E: str = "PACA Cancel Request Rejected"; break;
2581 case 0x30: str = "Requested transcoding/rate adaptation unavailable"; break;
2582 case 0x31: str = "Lower priority radio resources not available"; break;
2583 case 0x32: str = "PCF resources not available"; break; /* IOS 4 */
2584 case 0x33: str = "TFO Control request Failed"; break;
2586 /* IOS 5 */
2587 case 0x34: str = "MS rejected order"; break;
2589 case 0x40: str = "Ciphering algorithm not supported"; break;
2590 case 0x41: str = "Private Long Code not available or not supported."; break;
2591 case 0x42: str = "Requested MUX option or rates not available."; break;
2592 case 0x43: str = "Requested Privacy Configuration unavailable"; break;
2594 /* IOS 5 */
2595 case 0x45: str = "PDS-related capability not available or not supported"; break;
2597 case 0x50: str = "Terrestrial circuit already allocated"; break;
2598 case 0x60: str = "Protocol Error between BS and MSC"; break;
2599 case 0x71: str = "ADDS message too long for delivery on the paging channel"; break;
2600 case 0x72: str = "MS-to-IWF TCP connection failure"; break;
2601 case 0x73: str = "ATH0 (Modem hang up) Command"; break;
2602 case 0x74: str = "+FSH/+FHNG (Fax session ended) Command"; break;
2603 case 0x75: str = "No carrier"; break;
2604 case 0x76: str = "PPP protocol failure"; break;
2605 case 0x77: str = "PPP session closed by the MS"; break;
2606 case 0x78: str = "Do not notify MS"; break;
2607 case 0x79: str = "PCF (or PDSN) resources are not available"; break;
2608 case 0x7A: str = "Data ready to send"; break;
2610 /* IOS 5 */
2611 case 0x7B: str = "Concurrent authentication"; break;
2613 case 0x7F: str = "Handoff procedure time-out"; break;
2614 default:
2615 str = "Reserved for future use";
2616 break;
2619 other_decode_bitfield_value(a_bigbuf, oct, 0x7f, 8);
2620 proto_tree_add_uint_format(tree, hf_ansi_a_cause_1, tvb,
2621 curr_offset, 1, oct,
2622 "%s : Cause: (%u) %s",
2623 a_bigbuf,
2624 oct & 0x7f,
2625 str);
2627 curr_offset++;
2629 g_snprintf(add_string, string_len, " - (%u) %s", oct & 0x7f, str);
2632 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2634 return(curr_offset - offset);
2638 * IOS 6.2.2.20
2639 * Formats everything after the discriminator, shared function.
2641 static guint8
2642 elem_cell_id_aux(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len, guint8 disc)
2644 guint32 value;
2645 guint32 market_id;
2646 guint32 switch_num;
2647 guint32 curr_offset;
2649 curr_offset = offset;
2651 switch (disc)
2653 case 0x02:
2654 value = tvb_get_ntohs(tvb, curr_offset);
2656 proto_tree_add_uint(tree, hf_ansi_a_cell_ci, tvb,
2657 curr_offset, 2, value);
2659 curr_offset += 2;
2661 g_snprintf(add_string, string_len, " - CI (%u)", value);
2662 break;
2664 case 0x05:
2665 value = tvb_get_ntohs(tvb, curr_offset);
2667 proto_tree_add_uint(tree, hf_ansi_a_cell_lac, tvb,
2668 curr_offset, 2, value);
2670 curr_offset += 2;
2672 g_snprintf(add_string, string_len, " - LAC (%u)", value);
2673 break;
2675 case 0x07:
2676 market_id = tvb_get_ntohs(tvb, curr_offset);
2677 switch_num = tvb_get_guint8(tvb, curr_offset + 2);
2679 value = tvb_get_ntoh24(tvb, curr_offset);
2681 proto_tree_add_uint_format(tree, hf_ansi_a_cell_mscid, tvb,
2682 curr_offset, 3, value,
2683 "Market ID %u Switch Number %u",
2684 market_id, switch_num);
2686 curr_offset += 3;
2688 value = tvb_get_ntohs(tvb, curr_offset);
2690 proto_tree_add_uint(tree, hf_ansi_a_cell_ci, tvb,
2691 curr_offset, 2, value);
2693 curr_offset += 2;
2695 g_snprintf(add_string, string_len, " - Market ID (%u) Switch Number (%u) CI (%u)",
2696 market_id,
2697 switch_num,
2698 value);
2699 break;
2701 default:
2702 proto_tree_add_text(tree, tvb, curr_offset, len,
2703 "Cell ID - Non IOS format");
2705 curr_offset += len;
2706 break;
2709 return(curr_offset - offset);
2712 static guint8
2713 elem_cell_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
2715 guint8 oct;
2716 guint32 curr_offset;
2717 const gchar *str = NULL;
2719 curr_offset = offset;
2721 oct = tvb_get_guint8(tvb, curr_offset);
2723 if (oct >= (gint) NUM_CELL_DISC_STR)
2725 str = "Unknown";
2727 else
2729 str = cell_disc_str[oct];
2732 proto_tree_add_text(tree,
2733 tvb, curr_offset, 1,
2734 "Cell Identification Discriminator: (%u) %s",
2735 oct,
2736 str);
2738 curr_offset++;
2740 curr_offset +=
2741 elem_cell_id_aux(tvb, tree, curr_offset, len - (curr_offset - offset), add_string, string_len, oct);
2743 /* no length check possible */
2745 return(curr_offset - offset);
2749 * IOS 6.2.2.21
2751 static guint8
2752 elem_cell_id_list(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
2754 guint8 oct;
2755 guint16 consumed;
2756 guint8 num_cells;
2757 guint32 curr_offset;
2758 proto_item *item = NULL;
2759 proto_tree *subtree = NULL;
2760 const gchar *str = NULL;
2762 curr_offset = offset;
2764 oct = tvb_get_guint8(tvb, curr_offset);
2766 if (oct >= (gint) NUM_CELL_DISC_STR)
2768 str = "Unknown";
2770 else
2772 str = cell_disc_str[oct];
2775 proto_tree_add_text(tree,
2776 tvb, curr_offset, 1,
2777 "Cell Identification Discriminator: (%u) %s",
2778 oct,
2779 str);
2781 curr_offset++;
2783 NO_MORE_DATA_CHECK(len);
2785 num_cells = 0;
2788 item =
2789 proto_tree_add_text(tree,
2790 tvb, curr_offset, -1,
2791 "Cell [%u]",
2792 num_cells + 1);
2794 subtree = proto_item_add_subtree(item, ett_cell_list);
2796 add_string[0] = '\0';
2797 consumed =
2798 elem_cell_id_aux(tvb, subtree, curr_offset, len - (curr_offset - offset), add_string, string_len, oct);
2800 if (add_string[0] != '\0')
2802 proto_item_append_text(item, "%s", add_string);
2805 proto_item_set_len(item, consumed);
2807 curr_offset += consumed;
2809 num_cells++;
2811 while ((len - (curr_offset - offset)) > 0);
2813 g_snprintf(add_string, string_len, " - %u cell%s",
2814 num_cells, plurality(num_cells, "", "s"));
2816 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2818 return(curr_offset - offset);
2822 * IOS 6.2.2.22
2824 static guint8
2825 elem_cic(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len)
2827 guint32 value;
2828 guint32 curr_offset;
2830 curr_offset = offset;
2832 value = tvb_get_ntohs(tvb, curr_offset);
2834 other_decode_bitfield_value(a_bigbuf, value, 0xffe0, 16);
2835 proto_tree_add_text(tree,
2836 tvb, curr_offset, 2,
2837 "%s : PCM Multiplexer: %u",
2838 a_bigbuf,
2839 (value & 0xffe0) >> 5);
2841 other_decode_bitfield_value(a_bigbuf, value, 0x001f, 16);
2842 proto_tree_add_text(tree,
2843 tvb, curr_offset, 2,
2844 "%s : Timeslot: %u",
2845 a_bigbuf,
2846 value & 0x001f);
2848 curr_offset += 2;
2850 g_snprintf(add_string, string_len, " - (%u) (0x%04x)", value, value);
2852 /* no length check possible */
2854 return(curr_offset - offset);
2858 * IOS 6.2.2.23
2860 static guint8
2861 elem_cic_ext(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len)
2863 guint8 oct;
2864 guint32 value;
2865 guint32 curr_offset;
2866 const gchar *str;
2868 curr_offset = offset;
2870 value = tvb_get_ntohs(tvb, curr_offset);
2872 other_decode_bitfield_value(a_bigbuf, value, 0xffe0, 16);
2873 proto_tree_add_text(tree,
2874 tvb, curr_offset, 2,
2875 "%s : PCM Multiplexer: %u",
2876 a_bigbuf,
2877 (value & 0xffe0) >> 5);
2879 other_decode_bitfield_value(a_bigbuf, value, 0x001f, 16);
2880 proto_tree_add_text(tree,
2881 tvb, curr_offset, 2,
2882 "%s : Timeslot: %u",
2883 a_bigbuf,
2884 value & 0x001f);
2886 curr_offset += 2;
2888 g_snprintf(add_string, string_len, " - (%u) (0x%04x)", value, value);
2890 oct = tvb_get_guint8(tvb, curr_offset);
2892 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
2893 proto_tree_add_text(tree,
2894 tvb, curr_offset, 1,
2895 "%s : Reserved",
2896 a_bigbuf);
2898 switch (oct & 0x0f)
2900 case 0x00: str = "Full-rate"; break;
2901 default:
2902 str = "Reserved";
2903 break;
2906 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
2907 proto_tree_add_text(tree,
2908 tvb, curr_offset, 1,
2909 "%s : Circuit Mode: %s",
2910 a_bigbuf,
2911 str);
2913 curr_offset++;
2915 /* no length check possible */
2917 return(curr_offset - offset);
2921 * IOS 5 4.2.21
2923 static guint8
2924 elem_ssci(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
2926 guint8 oct;
2927 guint32 curr_offset;
2929 curr_offset = offset;
2931 oct = tvb_get_guint8(tvb, curr_offset);
2933 other_decode_bitfield_value(a_bigbuf, oct, 0xfc, 8);
2934 proto_tree_add_text(tree,
2935 tvb, curr_offset, 1,
2936 "%s : Reserved",
2937 a_bigbuf);
2939 other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
2940 proto_tree_add_text(tree,
2941 tvb, curr_offset, 1,
2942 "%s : Mobile Originated Position Determination",
2943 a_bigbuf);
2945 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
2946 proto_tree_add_text(tree,
2947 tvb, curr_offset, 1,
2948 "%s : Global Emergency Call Indication",
2949 a_bigbuf);
2951 curr_offset++;
2953 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2955 return(curr_offset - offset);
2959 * IOS 6.2.2.24
2960 * UNUSED
2963 #define ANSI_A_CELL_ID_LEN(_disc) ((_disc == 7) ? 5 : 2)
2966 * IOS 6.2.2.25
2967 * Formats everything no length check
2969 static guint8
2970 elem_downlink_re_aux(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
2972 guint8 oct;
2973 guint8 disc;
2974 guint16 consumed;
2975 guint8 num_cells;
2976 guint8 curr_cell;
2977 guint32 value;
2978 guint32 curr_offset;
2979 proto_item *item = NULL;
2980 proto_tree *subtree = NULL;
2981 const gchar *str;
2983 curr_offset = offset;
2985 num_cells = tvb_get_guint8(tvb, curr_offset);
2987 proto_tree_add_text(tree, tvb, curr_offset, 1,
2988 "Number of Cells: %u",
2989 num_cells);
2991 curr_offset++;
2993 NO_MORE_DATA_CHECK(len);
2995 disc = tvb_get_guint8(tvb, curr_offset);
2997 if (disc >= (gint) NUM_CELL_DISC_STR)
2999 str = "Unknown";
3001 else
3003 str = cell_disc_str[disc];
3006 proto_tree_add_text(tree,
3007 tvb, curr_offset, 1,
3008 "Cell Identification Discriminator: (%u) %s",
3009 disc,
3010 str);
3012 curr_offset++;
3014 NO_MORE_DATA_CHECK(len);
3016 SHORT_DATA_CHECK(len - (curr_offset - offset), (guint32) 3 + ANSI_A_CELL_ID_LEN(disc));
3018 curr_cell = 0;
3022 curr_cell++;
3024 item =
3025 proto_tree_add_text(tree,
3026 tvb, curr_offset, -1,
3027 "Cell [%u]",
3028 curr_cell);
3030 subtree = proto_item_add_subtree(item, ett_cell_list);
3032 add_string[0] = '\0';
3033 consumed =
3034 elem_cell_id_aux(tvb, subtree, curr_offset,
3035 len - (curr_offset - offset), add_string, string_len, disc);
3037 if (add_string[0] != '\0')
3039 proto_item_append_text(item, "%s", add_string);
3042 proto_item_set_len(item, consumed);
3044 curr_offset += consumed;
3046 oct = tvb_get_guint8(tvb, curr_offset);
3048 other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
3049 proto_tree_add_text(tree, tvb, curr_offset, 1,
3050 "%s : Reserved",
3051 a_bigbuf);
3053 other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
3054 proto_tree_add_text(tree, tvb, curr_offset, 1,
3055 "%s : Downlink Signal Strength Raw: %u",
3056 a_bigbuf,
3057 oct & 0x3f);
3059 curr_offset++;
3061 value = tvb_get_ntohs(tvb, curr_offset);
3063 proto_tree_add_text(tree,
3064 tvb, curr_offset, 2,
3065 "CDMA Target One Way Delay: %u",
3066 value);
3068 curr_offset += 2;
3070 while (curr_cell < num_cells);
3072 g_snprintf(add_string, string_len, " - %u cell%s",
3073 num_cells, plurality(num_cells, "", "s"));
3075 return(curr_offset - offset);
3079 * IOS 6.2.2.25
3081 static guint8
3082 elem_downlink_re(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
3084 guint32 curr_offset;
3086 curr_offset = offset;
3088 curr_offset +=
3089 elem_downlink_re_aux(tvb, tree, offset, len, add_string, string_len);
3091 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3093 return(curr_offset - offset);
3097 * IOS 6.2.2.140
3099 static guint8
3100 elem_downlink_re_list(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
3102 guint16 consumed;
3103 guint8 num_envs;
3104 guint8 oct_len;
3105 guint32 curr_offset;
3106 proto_item *item = NULL;
3107 proto_tree *subtree = NULL;
3109 curr_offset = offset;
3111 num_envs = 0;
3113 while ((len - (curr_offset - offset)) > 0)
3115 num_envs++;
3117 item =
3118 proto_tree_add_text(tree,
3119 tvb, curr_offset, -1,
3120 "Environment [%u]",
3121 num_envs);
3123 subtree = proto_item_add_subtree(item, ett_re_list);
3125 oct_len = tvb_get_guint8(tvb, curr_offset);
3127 proto_tree_add_text(subtree,
3128 tvb, curr_offset, 1,
3129 "Environment Length: %u",
3130 oct_len);
3132 curr_offset++;
3134 add_string[0] = '\0';
3135 consumed =
3136 elem_downlink_re_aux(tvb, subtree, curr_offset, len - (curr_offset - offset), add_string, string_len);
3138 if (add_string[0] != '\0')
3140 proto_item_append_text(item, "%s", add_string);
3144 * +1 is for environment length
3146 proto_item_set_len(item, consumed + 1);
3148 curr_offset += consumed;
3151 g_snprintf(add_string, string_len, " - %u environment%s",
3152 num_envs, plurality(num_envs, "", "s"));
3154 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3156 return(curr_offset - offset);
3160 * IOS 6.2.2.26
3161 * UNUSED
3165 * IOS 6.2.2.27
3166 * UNUSED
3170 * IOS 6.2.2.28
3171 * UNUSED
3175 * IOS 6.2.2.29
3176 * UNUSED
3180 * IOS 6.2.2.30
3182 static guint8
3183 elem_pdsn_ip_addr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
3185 guint32 curr_offset;
3187 curr_offset = offset;
3189 proto_tree_add_item(tree, hf_ansi_a_pdsn_ip_addr, tvb, curr_offset, len, ENC_BIG_ENDIAN);
3191 curr_offset += len;
3193 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3195 return(curr_offset - offset);
3199 * IOS 5 4.2.24
3201 static guint8
3202 elem_s_pdsn_ip_addr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
3204 guint32 curr_offset;
3206 curr_offset = offset;
3208 proto_tree_add_item(tree, hf_ansi_a_s_pdsn_ip_addr, tvb, curr_offset, len, ENC_BIG_ENDIAN);
3210 curr_offset += len;
3212 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3214 return(curr_offset - offset);
3218 * IOS 6.2.2.31
3220 static guint8
3221 elem_ho_pow_lev(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
3223 guint8 oct;
3224 guint16 consumed;
3225 guint8 num_cells;
3226 proto_item *item = NULL;
3227 proto_tree *subtree = NULL;
3228 guint32 curr_offset;
3230 curr_offset = offset;
3232 oct = tvb_get_guint8(tvb, curr_offset);
3234 proto_tree_add_text(tree, tvb, curr_offset, 1,
3235 "Number of Cells: %u",
3236 oct);
3238 curr_offset++;
3240 SHORT_DATA_CHECK(len - (curr_offset - offset), (guint32) 6);
3242 oct = tvb_get_guint8(tvb, curr_offset);
3244 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
3245 proto_tree_add_text(tree, tvb, curr_offset, 1,
3246 "%s : Reserved",
3247 a_bigbuf);
3249 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
3250 proto_tree_add_text(tree, tvb, curr_offset, 1,
3251 "%s : ID Type: %u",
3252 a_bigbuf,
3253 (oct & 0x60) >> 5);
3255 other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
3256 proto_tree_add_text(tree, tvb, curr_offset, 1,
3257 "%s : Handoff Power Level: %u",
3258 a_bigbuf,
3259 oct & 0x1f);
3261 curr_offset++;
3263 item =
3264 proto_tree_add_text(tree,
3265 tvb, curr_offset, -1,
3266 "Cell [1]");
3268 subtree = proto_item_add_subtree(item, ett_cell_list);
3270 add_string[0] = '\0';
3271 consumed =
3272 elem_cell_id_aux(tvb, subtree, curr_offset,
3273 len - (curr_offset - offset), add_string, string_len, 0x7);
3275 if (add_string[0] != '\0')
3277 proto_item_append_text(item, "%s", add_string);
3280 proto_item_set_len(item, consumed);
3282 curr_offset += consumed;
3284 num_cells = 1;
3286 while ((len - (curr_offset - offset)) >= 3)
3288 num_cells++;
3290 oct = tvb_get_guint8(tvb, curr_offset);
3292 other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
3293 proto_tree_add_text(tree, tvb, curr_offset, 1,
3294 "%s : Reserved",
3295 a_bigbuf);
3297 other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
3298 proto_tree_add_text(tree, tvb, curr_offset, 1,
3299 "%s : Handoff Power Level: %u",
3300 a_bigbuf,
3301 oct & 0x1f);
3303 curr_offset++;
3305 item =
3306 proto_tree_add_text(tree,
3307 tvb, curr_offset, -1,
3308 "Cell [%u]",
3309 num_cells);
3311 subtree = proto_item_add_subtree(item, ett_cell_list);
3313 add_string[0] = '\0';
3314 consumed =
3315 elem_cell_id_aux(tvb, subtree, curr_offset,
3316 len - (curr_offset - offset), add_string, string_len, 0x2);
3318 if (add_string[0] != '\0')
3320 proto_item_append_text(item, "%s", add_string);
3323 proto_item_set_len(item, consumed);
3325 curr_offset += consumed;
3328 g_snprintf(add_string, string_len, " - %u cell%s",
3329 num_cells, plurality(num_cells, "", "s"));
3331 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3333 return(curr_offset - offset);
3337 * IOS 6.2.2.32
3339 static guint8
3340 elem_uz_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
3342 guint32 value;
3343 guint32 curr_offset;
3345 curr_offset = offset;
3347 value = tvb_get_ntohs(tvb, curr_offset);
3349 proto_tree_add_text(tree, tvb, curr_offset, 2,
3350 "UZID: %u",
3351 value);
3353 curr_offset += 2;
3355 g_snprintf(add_string, string_len, " - (%u)", value);
3357 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3359 return(curr_offset - offset);
3363 * IOS 6.2.2.33
3364 * UNUSED
3368 * IOS 5 4.2.77
3370 static guint8
3371 elem_info_rec_req(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
3373 guint8 rec_type;
3374 guint8 num_recs;
3375 guint32 curr_offset;
3376 const gchar *str;
3377 gint idx;
3379 curr_offset = offset;
3381 num_recs = 0;
3383 while ((len - (curr_offset - offset)) > 0)
3385 num_recs++;
3387 rec_type = tvb_get_guint8(tvb, curr_offset);
3389 str = try_val_to_str_idx((guint32) rec_type, ansi_rev_ms_info_rec_str, &idx);
3391 if (str == NULL)
3393 str = "Reserved";
3396 proto_tree_add_text(tree,
3397 tvb, curr_offset, 1,
3398 "Information Record Type - %u: (%u) %s",
3399 num_recs,
3400 rec_type,
3401 str);
3403 curr_offset++;
3406 g_snprintf(add_string, string_len, " - %u request%s",
3407 num_recs, plurality(num_recs, "", "s"));
3409 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3411 return(curr_offset - offset);
3415 * IOS 6.2.2.34
3417 static guint8
3418 elem_is2000_chan_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
3420 guint8 oct;
3421 guint8 num_chan;
3422 guint32 value;
3423 guint32 curr_offset;
3424 const gchar *str;
3426 curr_offset = offset;
3428 oct = tvb_get_guint8(tvb, curr_offset);
3430 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
3431 proto_tree_add_text(tree, tvb, curr_offset, 1,
3432 "%s : OTD: Mobile will %sbe using OTD",
3433 a_bigbuf,
3434 (oct & 0x80) ? "" : "not ");
3436 num_chan = (oct & 0x70) >> 4;
3438 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
3439 proto_tree_add_text(tree, tvb, curr_offset, 1,
3440 "%s : Channel Count: %u",
3441 a_bigbuf,
3442 num_chan);
3444 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
3445 proto_tree_add_text(tree, tvb, curr_offset, 1,
3446 "%s : Frame Offset: (%u), %.2f ms",
3447 a_bigbuf,
3448 oct & 0x0f,
3449 (oct & 0x0f) * 1.25);
3451 curr_offset++;
3453 NO_MORE_DATA_CHECK(len);
3455 SHORT_DATA_CHECK(len - (curr_offset - offset), 6);
3459 oct = tvb_get_guint8(tvb, curr_offset);
3461 switch (oct)
3463 case 0x01: str = "Fundamental Channel (FCH) TIA/EIA/IS-2000"; break;
3464 case 0x02: str = "Dedicated Control Channel (DCCH) TIA/EIA/IS-2000"; break;
3465 case 0x03: str = "Supplemental Channel (SCH) TIA/EIA/IS-2000"; break;
3466 default:
3467 if ((oct >= 0x80) && (oct <= 0x9f)) { str = "Reserved for UMTS"; }
3468 else { str = "Reserved"; }
3469 break;
3472 proto_tree_add_text(tree, tvb, curr_offset, 1,
3473 "Physical Channel Type: %s",
3474 str);
3476 curr_offset++;
3478 oct = tvb_get_guint8(tvb, curr_offset);
3480 switch (global_a_variant)
3482 case A_VARIANT_IOS401:
3483 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
3484 proto_tree_add_text(tree, tvb, curr_offset, 1,
3485 "%s : Reserved",
3486 a_bigbuf);
3487 break;
3489 case A_VARIANT_IOS501:
3490 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
3491 proto_tree_add_text(tree, tvb, curr_offset, 1,
3492 "%s : Rev_FCH_Gating",
3493 a_bigbuf);
3494 break;
3497 switch ((oct & 0x60) >> 5)
3499 case 0: str = "Gating rate 1"; break;
3500 case 1: str = "Gating rate 1/2"; break;
3501 case 2: str = "Gating rate 1/4"; break;
3502 default:
3503 str = "Reserved";
3504 break;
3507 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
3508 proto_tree_add_text(tree, tvb, curr_offset, 1,
3509 "%s : Pilot Gating Rate: %s",
3510 a_bigbuf,
3511 str);
3513 other_decode_bitfield_value(a_bigbuf, oct, 0x18, 8);
3514 proto_tree_add_text(tree, tvb, curr_offset, 1,
3515 "%s : QOF Mask",
3516 a_bigbuf);
3518 value = tvb_get_guint8(tvb, curr_offset + 1);
3520 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
3521 proto_tree_add_text(tree, tvb, curr_offset, 1,
3522 "%s : Walsh Code Channel Index (MSB): %u",
3523 a_bigbuf,
3524 ((guint32) (oct & 0x07) << 8) | value);
3526 curr_offset++;
3528 other_decode_bitfield_value(a_bigbuf, value, 0xff, 8);
3529 proto_tree_add_text(tree, tvb, curr_offset, 1,
3530 "%s : Walsh Code Channel Index (LSB)",
3531 a_bigbuf);
3533 curr_offset++;
3535 oct = tvb_get_guint8(tvb, curr_offset);
3537 other_decode_bitfield_value(a_bigbuf, oct, 0xff, 8);
3538 proto_tree_add_text(tree, tvb, curr_offset, 1,
3539 "%s : Pilot PN Code (LSB)",
3540 a_bigbuf);
3542 curr_offset++;
3544 value = oct;
3545 oct = tvb_get_guint8(tvb, curr_offset);
3546 value |= ((guint32) (oct & 0x80)) << 1;
3548 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
3549 proto_tree_add_text(tree, tvb, curr_offset, 1,
3550 "%s : Pilot PN Code (MSB): %u",
3551 a_bigbuf,
3552 value);
3554 switch (global_a_variant)
3556 case A_VARIANT_IOS401:
3557 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
3558 proto_tree_add_text(tree, tvb, curr_offset, 1,
3559 "%s : Reserved",
3560 a_bigbuf);
3561 break;
3563 case A_VARIANT_IOS501:
3564 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
3565 proto_tree_add_text(tree, tvb, curr_offset, 1,
3566 "%s : Reserved",
3567 a_bigbuf);
3569 other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
3570 proto_tree_add_text(tree, tvb, curr_offset, 1,
3571 "%s : Power Combined",
3572 a_bigbuf);
3573 break;
3576 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
3577 proto_tree_add_text(tree, tvb, curr_offset, 1,
3578 "%s : Frequency Included",
3579 a_bigbuf);
3581 value = tvb_get_guint8(tvb, curr_offset + 1) | ((oct & 0x07) << 8);
3583 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
3584 proto_tree_add_text(tree, tvb, curr_offset, 1,
3585 "%s : ARFCN (MSB): %u",
3586 a_bigbuf,
3587 value);
3589 curr_offset++;
3591 other_decode_bitfield_value(a_bigbuf, value & 0x00ff, 0xff, 8);
3592 proto_tree_add_text(tree, tvb, curr_offset, 1,
3593 "%s : ARFCN (LSB)",
3594 a_bigbuf);
3596 curr_offset++;
3598 while ((len - (curr_offset - offset)) >= 6);
3600 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3602 return(curr_offset - offset);
3606 * IOS 6.2.2.35
3607 * NO ASSOCIATED DATA
3611 * IOS 6.2.2.36
3613 static guint8
3614 elem_is95_ms_meas_chan_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
3616 guint8 oct;
3617 guint32 value;
3618 gint temp_int;
3619 guint32 curr_offset;
3620 const gchar *str;
3622 curr_offset = offset;
3624 oct = tvb_get_guint8(tvb, curr_offset);
3626 temp_int = (oct & 0xf8) >> 3;
3627 if ((temp_int < 0) || (temp_int >= (gint) NUM_BAND_CLASS_STR))
3629 str = "Reserved";
3631 else
3633 str = band_class_str[temp_int];
3636 other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
3637 proto_tree_add_text(tree,
3638 tvb, curr_offset, 1,
3639 "%s : Band Class: %s",
3640 a_bigbuf,
3641 str);
3643 value = tvb_get_guint8(tvb, curr_offset + 1) | ((oct & 0x07) << 8);
3645 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
3646 proto_tree_add_text(tree, tvb, curr_offset, 1,
3647 "%s : ARFCN (MSB): %u",
3648 a_bigbuf,
3649 value);
3651 curr_offset++;
3653 other_decode_bitfield_value(a_bigbuf, value & 0x00ff, 0xff, 8);
3654 proto_tree_add_text(tree, tvb, curr_offset, 1,
3655 "%s : ARFCN (LSB)",
3656 a_bigbuf);
3658 g_snprintf(add_string, string_len, " - (ARFCN: %u)", value);
3660 curr_offset++;
3662 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3664 return(curr_offset - offset);
3668 * IOS 6.2.2.37
3670 static guint8
3671 elem_clg_party_ascii_num(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
3673 guint8 oct;
3674 guint32 curr_offset;
3675 guint8 *poctets;
3676 const gchar *str;
3678 curr_offset = offset;
3680 oct = tvb_get_guint8(tvb, curr_offset);
3682 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
3683 proto_tree_add_text(tree, tvb, curr_offset, 1,
3684 "%s : Extension: %s",
3685 a_bigbuf,
3686 (oct & 0x80) ? "Not extended" : "Extended");
3688 switch ((oct & 0x70) >> 4)
3690 case 0: str = "Unknown"; break;
3691 case 1: str = "International number"; break;
3692 case 2: str = "National number"; break;
3693 case 3: str = "Network-specific number"; break;
3694 case 4: str = "Dedicated PAD access, short code"; break;
3695 case 5: str = "Reserved"; break;
3696 case 6: str = "Reserved"; break;
3697 default:
3698 str = "Reserved for extension";
3699 break;
3702 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
3703 proto_tree_add_text(tree, tvb, curr_offset, 1,
3704 "%s : Type of Number: %s",
3705 a_bigbuf,
3706 str);
3708 switch (oct & 0x0f)
3710 case 0x00: str = "Unknown"; break;
3711 case 0x01: str = "ISDN/Telephony Numbering (ITU recommendation E.164/E.163)"; break;
3712 case 0x03: str = "Data Numbering (ITU-T Rec. X.121)"; break;
3713 case 0x04: str = "Telex Numbering (ITU-T Rec. F.69)"; break;
3714 case 0x07: str = "Reserved for extension"; break;
3715 case 0x08: str = "National Numbering"; break;
3716 case 0x09: str = "Private Numbering"; break;
3717 default:
3718 str = "Reserved";
3719 break;
3722 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
3723 proto_tree_add_text(tree, tvb, curr_offset, 1,
3724 "%s : Number Plan Identification: %s",
3725 a_bigbuf,
3726 str);
3728 curr_offset++;
3730 if (!(oct & 0x80))
3732 /* octet 3a */
3734 oct = tvb_get_guint8(tvb, curr_offset);
3736 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
3737 proto_tree_add_text(tree, tvb, curr_offset, 1,
3738 "%s : Extension",
3739 a_bigbuf);
3741 switch ((oct & 0x60) >> 5)
3743 case 0: str = "Presentation allowed"; break;
3744 case 1: str = "Presentation restricted"; break;
3745 case 2: str = "Number not available due to interworking"; break;
3746 default:
3747 str = "Reserved";
3748 break;
3751 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
3752 proto_tree_add_text(tree, tvb, curr_offset, 1,
3753 "%s : Presentation Indicator: %s",
3754 a_bigbuf,
3755 str);
3757 switch (oct & 0x03)
3759 case 0: str = "User-provided, not screened"; break;
3760 case 1: str = "User-provided, verified and passed"; break;
3761 case 2: str = "User-provided, verified and failed"; break;
3762 default:
3763 str = "Network-provided";
3764 break;
3767 other_decode_bitfield_value(a_bigbuf, oct, 0x1c, 8);
3768 proto_tree_add_text(tree, tvb, curr_offset, 1,
3769 "%s : Reserved",
3770 a_bigbuf);
3772 other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
3773 proto_tree_add_text(tree, tvb, curr_offset, 1,
3774 "%s : Screening Indicator: %s",
3775 a_bigbuf,
3776 str);
3778 curr_offset++;
3781 poctets = tvb_get_string(wmem_packet_scope(), tvb, curr_offset, len - (curr_offset - offset));
3783 proto_tree_add_string_format(tree, hf_ansi_a_clg_party_ascii_num,
3784 tvb, curr_offset, len - (curr_offset - offset),
3785 (gchar *) poctets,
3786 "Digits: %s",
3787 (gchar *) format_text(poctets, len - (curr_offset - offset)));
3789 curr_offset += len - (curr_offset - offset);
3791 g_snprintf(add_string, string_len, " - (%s)", poctets);
3793 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3795 return(curr_offset - offset);
3799 * IOS 6.2.2.38
3801 static guint8
3802 elem_l3_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
3804 guint32 curr_offset;
3805 tvbuff_t *l3_tvb;
3807 curr_offset = offset;
3809 proto_tree_add_text(tree, tvb, curr_offset, len,
3810 "Layer 3 Information");
3813 * dissect the embedded DTAP message
3815 l3_tvb = tvb_new_subset(tvb, curr_offset, len, len);
3817 call_dissector(dtap_handle, l3_tvb, pinfo, g_tree);
3819 curr_offset += len;
3821 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3823 return(curr_offset - offset);
3827 * IOS 6.2.2.39
3828 * Protocol Discriminator
3832 * IOS 6.2.2.40
3833 * Reserved Octet
3837 * IOS 6.2.2.41
3838 * Location Updating Type
3839 * UNUSED in SPEC!
3843 * IOS 6.2.2.42
3844 * Simple data no decode required
3848 * IOS 6.2.2.43
3850 static guint8
3851 elem_lai(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3853 guint8 oct;
3854 guint16 value;
3855 guint32 curr_offset;
3856 gchar mcc[4];
3857 gchar mnc[4];
3859 curr_offset = offset;
3861 oct = tvb_get_guint8(tvb, curr_offset);
3863 mcc[0] = Dgt_tbcd.out[oct & 0x0f];
3864 mcc[1] = Dgt_tbcd.out[(oct & 0xf0) >> 4];
3866 oct = tvb_get_guint8(tvb, curr_offset+1);
3868 mcc[2] = Dgt_tbcd.out[(oct & 0x0f)];
3869 mcc[3] = '\0';
3871 mnc[2] = Dgt_tbcd.out[(oct & 0xf0) >> 4];
3873 oct = tvb_get_guint8(tvb, curr_offset+2);
3875 mnc[0] = Dgt_tbcd.out[(oct & 0x0f)];
3876 mnc[1] = Dgt_tbcd.out[(oct & 0xf0) >> 4];
3877 mnc[3] = '\0';
3879 proto_tree_add_text(tree,
3880 tvb, curr_offset, 3,
3881 "Mobile Country Code (MCC): %s, Mobile Network Code (MNC): %s",
3882 mcc,
3883 mnc);
3885 curr_offset += 3;
3887 value = tvb_get_ntohs(tvb, curr_offset);
3889 proto_tree_add_text(tree,
3890 tvb, curr_offset, 2,
3891 "Location Area Code (LAC): 0x%04x (%u)",
3892 value,
3893 value);
3895 curr_offset += 2;
3897 /* no length check possible */
3899 return(curr_offset - offset);
3903 * IOS 6.2.2.44
3905 static guint8
3906 elem_rej_cause(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len)
3908 guint8 oct;
3909 guint32 curr_offset;
3910 const gchar *str;
3912 curr_offset = offset;
3914 oct = tvb_get_guint8(tvb, curr_offset);
3916 switch (oct)
3918 case 0x01: str = "Reserved"; break;
3919 case 0x02: str = "MIN/IMSI unknown in HLR"; break;
3920 case 0x03: str = "Illegal MS"; break;
3921 case 0x04: str = "TMSI/IMSI/MIN unknown in VLR"; break;
3922 case 0x05: str = "Reserved"; break;
3923 case 0x0b: str = "Roaming not allowed"; break;
3924 case 0x0c: str = "Location area not allowed"; break;
3925 case 0x20: str = "Service option not supported"; break;
3926 case 0x21: str = "Requested service option not subscribed"; break;
3927 case 0x22: str = "Service option temporarily out of order"; break;
3928 case 0x26: str = "Call cannot be identified"; break;
3929 case 0x51: str = "Network failure"; break;
3930 case 0x56: str = "Congestion"; break;
3931 case 0x62: str = "Message type non-existent or not implemented"; break;
3932 case 0x63: str = "Information element non-existent or not implemented"; break;
3933 case 0x64: str = "Invalid information element contents"; break;
3934 case 0x65: str = "Message not compatible with the call state"; break;
3935 case 0x66: str = "Protocol error, unspecified"; break;
3936 case 0x6e: str = "Invalid message, unspecified"; break;
3937 case 0x6f: str = "Mandatory information element error"; break;
3938 default:
3939 str = "Reserved";
3940 break;
3943 proto_tree_add_text(tree,
3944 tvb, curr_offset, 1,
3945 "Reject Cause Value: (%u) %s",
3946 oct,
3947 str);
3949 curr_offset++;
3951 g_snprintf(add_string, string_len, " - (%s)", str);
3953 /* no length check possible */
3955 return(curr_offset - offset);
3959 * IOS 5 4.2.78
3961 static guint8
3962 elem_anchor_pdsn_addr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
3964 guint32 curr_offset;
3966 curr_offset = offset;
3968 proto_tree_add_item(tree, hf_ansi_a_anchor_ip_addr, tvb, curr_offset, len, ENC_BIG_ENDIAN);
3970 curr_offset += len;
3972 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3974 return(curr_offset - offset);
3978 * IOS 5 4.2.80
3980 static guint8
3981 elem_anchor_pp_addr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
3983 guint32 curr_offset;
3985 curr_offset = offset;
3987 proto_tree_add_item(tree, hf_ansi_a_anchor_pp_ip_addr, tvb, curr_offset, len, ENC_BIG_ENDIAN);
3989 curr_offset += len;
3991 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3993 return(curr_offset - offset);
3997 * IOS 6.2.2.45
3999 static guint8
4000 elem_auth_chlg_param(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
4002 guint8 oct;
4003 guint32 curr_offset;
4004 const gchar *str;
4006 curr_offset = offset;
4008 oct = tvb_get_guint8(tvb, curr_offset);
4010 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
4011 proto_tree_add_text(tree,
4012 tvb, curr_offset, 1,
4013 "%s : Reserved",
4014 a_bigbuf);
4016 switch (oct & 0x0f)
4018 case 1: str = "RAND 32 bits"; break;
4019 case 2: str = "RANDU 24 bits"; break;
4020 case 4: str = "RANDSSD 56 bits"; break;
4021 case 8: str = "RANDBS 32 bits"; break;
4022 default:
4023 str = "Reserved";
4024 break;
4027 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
4028 proto_tree_add_text(tree,
4029 tvb, curr_offset, 1,
4030 "%s : Random Number Type: (%u) %s",
4031 a_bigbuf,
4032 oct & 0x0f,
4033 str);
4035 curr_offset++;
4037 proto_tree_add_text(tree,
4038 tvb, curr_offset, len - (curr_offset - offset),
4039 "RAND/RANDU/RANDBS/RANDSSD Value");
4041 g_snprintf(add_string, string_len, " - (%s)", str);
4043 curr_offset += len - (curr_offset - offset);
4045 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
4047 return(curr_offset - offset);
4051 * IOS 6.2.2.46
4053 static guint8
4054 elem_auth_resp_param(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
4056 guint8 oct;
4057 guint32 curr_offset;
4058 const gchar *str;
4060 curr_offset = offset;
4062 oct = tvb_get_guint8(tvb, curr_offset);
4064 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
4065 proto_tree_add_text(tree,
4066 tvb, curr_offset, 1,
4067 "%s : Reserved",
4068 a_bigbuf);
4070 switch (oct & 0x0f)
4072 case 1: str = "AUTHR"; break;
4073 case 2: str = "AUTHU"; break;
4074 case 4: str = "AUTHBS"; break;
4075 default:
4076 str = "Reserved";
4077 break;
4080 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
4081 proto_tree_add_text(tree,
4082 tvb, curr_offset, 1,
4083 "%s : Auth Signature Type: (%u) %s",
4084 a_bigbuf,
4085 oct & 0x0f,
4086 str);
4088 curr_offset++;
4090 proto_tree_add_text(tree,
4091 tvb, curr_offset, len - (curr_offset - offset),
4092 "Auth Signature");
4094 g_snprintf(add_string, string_len, " - (%s)", str);
4096 curr_offset += len - (curr_offset - offset);
4098 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
4100 return(curr_offset - offset);
4104 * IOS 6.2.2.47
4106 static guint8
4107 elem_auth_param_count(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len)
4109 guint8 oct;
4110 guint32 curr_offset;
4112 curr_offset = offset;
4114 oct = tvb_get_guint8(tvb, curr_offset);
4116 other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
4117 proto_tree_add_text(tree,
4118 tvb, curr_offset, 1,
4119 "%s : Reserved",
4120 a_bigbuf);
4122 other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
4123 proto_tree_add_text(tree,
4124 tvb, curr_offset, 1,
4125 "%s : Count: %u",
4126 a_bigbuf,
4127 oct & 0x3f);
4129 curr_offset++;
4131 g_snprintf(add_string, string_len, " - (%u)", oct & 0x3f);
4133 /* no length check possible */
4135 return(curr_offset - offset);
4139 * IOS 6.2.2.48
4141 static guint8
4142 elem_mwi(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len)
4144 guint8 oct;
4145 guint32 curr_offset;
4147 curr_offset = offset;
4149 oct = tvb_get_guint8(tvb, curr_offset);
4151 proto_tree_add_text(tree,
4152 tvb, curr_offset, 1,
4153 "Number of Messages: %u",
4154 oct);
4156 curr_offset++;
4158 g_snprintf(add_string, string_len, " - (%u)", oct);
4160 /* no length check possible */
4162 return(curr_offset - offset);
4166 * IOS 6.2.2.49
4167 * Progress
4168 * UNUSED in SPEC and no IEI!
4172 * IOS 6.2.2.50
4174 static guint8
4175 elem_signal(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len)
4177 guint8 oct;
4178 guint32 curr_offset;
4179 const gchar *str;
4181 curr_offset = offset;
4183 oct = tvb_get_guint8(tvb, curr_offset);
4185 switch (oct)
4187 case 0x00: str = "Dial tone on"; break;
4188 case 0x01: str = "Ring back tone on"; break;
4189 case 0x02: str = "Intercept tone on"; break;
4190 case 0x03: str = "Network congestion (reorder) tone on"; break;
4191 case 0x04: str = "Busy tone on"; break;
4192 case 0x05: str = "Confirm tone on"; break;
4193 case 0x06: str = "Answer tone on"; break;
4194 case 0x07: str = "Call waiting tone on"; break;
4195 case 0x08: str = "Off-hook warning tone on"; break;
4196 case 0x3f: str = "Tones off"; break;
4197 case 0x40: str = "Normal Alerting"; break;
4198 case 0x41: str = "Inter-group Alerting"; break;
4199 case 0x42: str = "Special/Priority Alerting"; break;
4200 case 0x43: str = "Reserved (ISDN Alerting pattern 3)"; break;
4201 case 0x44: str = "Ping Ring (abbreviated alert)"; break;
4202 case 0x45: str = "Reserved (ISDN Alerting pattern 5)"; break;
4203 case 0x46: str = "Reserved (ISDN Alerting pattern 6)"; break;
4204 case 0x47: str = "Reserved (ISDN Alerting pattern 7)"; break;
4205 case 0x63: str = "Abbreviated intercept"; break;
4206 case 0x65: str = "Abbreviated reorder"; break;
4207 case 0x4f: str = "Alerting off"; break;
4208 default:
4209 str = "Unknown";
4210 break;
4213 proto_tree_add_text(tree,
4214 tvb, curr_offset, 1,
4215 "Signal Value: (%u) %s",
4216 oct,
4217 str);
4219 g_snprintf(add_string, string_len, " - (%s)", str);
4221 curr_offset++;
4223 oct = tvb_get_guint8(tvb, curr_offset);
4225 other_decode_bitfield_value(a_bigbuf, oct, 0xfc, 8);
4226 proto_tree_add_text(tree,
4227 tvb, curr_offset, 1,
4228 "%s : Reserved",
4229 a_bigbuf);
4231 switch (oct & 0x03)
4233 case 0: str = "Medium pitch (standard alert)"; break;
4234 case 1: str = "High pitch"; break;
4235 case 2: str = "Low pitch"; break;
4236 default:
4237 str = "Reserved";
4238 break;
4241 other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
4242 proto_tree_add_text(tree,
4243 tvb, curr_offset, 1,
4244 "%s : Alert Pitch: %s",
4245 a_bigbuf,
4246 str);
4248 curr_offset++;
4250 /* no length check possible */
4252 return(curr_offset - offset);
4256 * IOS 6.2.2.51
4257 * CM Service Type
4261 * IOS 6.2.2.52
4263 static guint8
4264 elem_cld_party_bcd_num(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
4266 guint8 oct;
4267 guint8 *poctets;
4268 guint32 curr_offset;
4269 const gchar *str;
4271 curr_offset = offset;
4273 oct = tvb_get_guint8(tvb, curr_offset);
4275 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
4276 proto_tree_add_text(tree,
4277 tvb, curr_offset, 1,
4278 "%s : Extension",
4279 a_bigbuf);
4281 switch ((oct & 0x70) >> 4)
4283 case 0: str = "Unknown"; break;
4284 case 1: str = "International number"; break;
4285 case 2: str = "National number"; break;
4286 case 3: str = "Network specific number"; break;
4287 case 4: str = "Dedicated PAD access, short code"; break;
4288 case 7: str = "Reserved for extension"; break;
4289 default:
4290 str = "Reserved";
4291 break;
4294 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
4295 proto_tree_add_text(tree,
4296 tvb, curr_offset, 1,
4297 "%s : Type of Number: %s",
4298 a_bigbuf,
4299 str);
4301 switch (oct & 0x0f)
4303 case 0x00: str = "Unknown"; break;
4304 case 0x01: str = "ISDN/telephony number plan (ITU recommendation E.164/E.163)"; break;
4305 case 0x03: str = "Data number plan (ITU recommendation X.121)"; break;
4306 case 0x04: str = "Telex numbering plan (ITU recommendation F.69)"; break;
4307 case 0x07: str = "Reserved for extension"; break;
4308 case 0x08: str = "National numbering plan"; break;
4309 case 0x09: str = "Private numbering plan"; break;
4310 default:
4311 str = "Reserved";
4312 break;
4315 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
4316 proto_tree_add_text(tree,
4317 tvb, curr_offset, 1,
4318 "%s : Numbering Plan Identification: %s",
4319 a_bigbuf,
4320 str);
4322 curr_offset++;
4324 poctets = tvb_get_string(wmem_packet_scope(), tvb, curr_offset, len - (curr_offset - offset));
4326 my_dgt_tbcd_unpack(a_bigbuf, poctets, len - (curr_offset - offset),
4327 &Dgt_tbcd);
4329 proto_tree_add_string_format(tree, hf_ansi_a_cld_party_bcd_num,
4330 tvb, curr_offset, len - (curr_offset - offset),
4331 a_bigbuf,
4332 "BCD Digits: %s",
4333 a_bigbuf);
4335 g_snprintf(add_string, string_len, " - (%s)", a_bigbuf);
4337 curr_offset += len - (curr_offset - offset);
4339 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
4341 return(curr_offset - offset);
4345 * IOS 6.2.2.53
4346 * UNUSED in SPEC and no IEI!
4348 #ifdef MAYBE_USED_FOR_OLDER_CODECS
4349 static guint8
4350 elem_clg_party_bcd_num(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
4352 guint8 oct;
4353 guint8 *poctets;
4354 guint32 curr_offset;
4355 const gchar *str;
4357 curr_offset = offset;
4359 oct = tvb_get_guint8(tvb, curr_offset);
4361 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
4362 proto_tree_add_text(tree, tvb, curr_offset, 1,
4363 "%s : Extension: %s",
4364 a_bigbuf,
4365 (oct & 0x80) ? "Not extended" : "Extended");
4367 switch ((oct & 0x70) >> 4)
4369 case 0: str = "Unknown"; break;
4370 case 1: str = "International number"; break;
4371 case 2: str = "National number"; break;
4372 case 3: str = "Network specific number"; break;
4373 case 4: str = "Dedicated PAD access, short code"; break;
4374 case 7: str = "Reserved for extension"; break;
4375 default:
4376 str = "Reserved";
4377 break;
4380 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
4381 proto_tree_add_text(tree,
4382 tvb, curr_offset, 1,
4383 "%s : Type of Number: %s",
4384 a_bigbuf,
4385 str);
4387 switch (oct & 0x0f)
4389 case 0x00: str = "Unknown"; break;
4390 case 0x01: str = "ISDN/telephony number plan (ITU recommendation E.164/E.163)"; break;
4391 case 0x03: str = "Data number plan (ITU recommendation X.121)"; break;
4392 case 0x04: str = "Telex numbering plan (ITU recommendation F.69)"; break;
4393 case 0x07: str = "Reserved for extension"; break;
4394 case 0x08: str = "National numbering plan"; break;
4395 case 0x09: str = "Private numbering plan"; break;
4396 default:
4397 str = "Reserved";
4398 break;
4401 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
4402 proto_tree_add_text(tree,
4403 tvb, curr_offset, 1,
4404 "%s : Numbering Plan Identification: %s",
4405 a_bigbuf,
4406 str);
4408 curr_offset++;
4410 if (!(oct & 0x80))
4412 /* octet 3a */
4414 oct = tvb_get_guint8(tvb, curr_offset);
4416 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
4417 proto_tree_add_text(tree, tvb, curr_offset, 1,
4418 "%s : Extension",
4419 a_bigbuf);
4421 switch ((oct & 0x60) >> 5)
4423 case 0: str = "Presentation allowed"; break;
4424 case 1: str = "Presentation restricted"; break;
4425 case 2: str = "Number not available due to interworking"; break;
4426 default:
4427 str = "Reserved";
4428 break;
4431 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
4432 proto_tree_add_text(tree, tvb, curr_offset, 1,
4433 "%s : Presentation Indicator: %s",
4434 a_bigbuf,
4435 str);
4437 switch (oct & 0x03)
4439 case 0: str = "User-provided, not screened"; break;
4440 case 1: str = "User-provided, verified and passed"; break;
4441 case 2: str = "User-provided, verified and failed"; break;
4442 default:
4443 str = "Network-provided";
4444 break;
4447 other_decode_bitfield_value(a_bigbuf, oct, 0x1c, 8);
4448 proto_tree_add_text(tree, tvb, curr_offset, 1,
4449 "%s : Reserved",
4450 a_bigbuf);
4452 other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
4453 proto_tree_add_text(tree, tvb, curr_offset, 1,
4454 "%s : Screening Indicator: %s",
4455 a_bigbuf,
4456 str);
4458 curr_offset++;
4461 poctets = tvb_get_string(wmem_packet_scope(), tvb, curr_offset, len - (curr_offset - offset));
4463 my_dgt_tbcd_unpack(a_bigbuf, poctets, len - (curr_offset - offset),
4464 &Dgt_tbcd);
4466 proto_tree_add_string_format(tree, hf_ansi_a_clg_party_bcd_num,
4467 tvb, curr_offset, len - (curr_offset - offset),
4468 a_bigbuf,
4469 "BCD Digits: %s",
4470 a_bigbuf);
4472 g_snprintf(add_string, string_len, " - (%s)", a_bigbuf);
4474 curr_offset += len - (curr_offset - offset);
4476 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
4478 return(curr_offset - offset);
4480 #endif
4483 * IOS 6.2.2.54
4485 static guint8
4486 elem_qos_params(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
4488 guint8 oct;
4489 guint32 curr_offset;
4491 curr_offset = offset;
4493 oct = tvb_get_guint8(tvb, curr_offset);
4495 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
4496 proto_tree_add_text(tree,
4497 tvb, curr_offset, 1,
4498 "%s : Reserved",
4499 a_bigbuf);
4501 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
4502 proto_tree_add_text(tree,
4503 tvb, curr_offset, 1,
4504 "%s : Packet Priority: %u",
4505 a_bigbuf,
4506 oct & 0x0f);
4508 g_snprintf(add_string, string_len, " - (%u)", oct & 0x0f);
4510 curr_offset++;
4512 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
4514 return(curr_offset - offset);
4518 * IOS 6.2.2.55
4520 static guint8
4521 elem_cause_l3(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
4523 guint8 oct;
4524 guint32 curr_offset;
4525 const gchar *str = NULL;
4527 curr_offset = offset;
4529 oct = tvb_get_guint8(tvb, curr_offset);
4531 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
4532 proto_tree_add_text(tree,
4533 tvb, curr_offset, 1,
4534 "%s : Extension",
4535 a_bigbuf);
4537 switch ((oct & 0x60) >> 5)
4539 case 0: str = "Standard as described in ITU Recommendation Q.931"; break;
4540 case 1: str = "Reserved for other international standards"; break;
4541 case 2: str = "National standard"; break;
4542 default:
4543 str = "Reserved for other international standards";
4544 break;
4547 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
4548 proto_tree_add_text(tree,
4549 tvb, curr_offset, 1,
4550 "%s : Coding Standard: %s",
4551 a_bigbuf,
4552 str);
4554 other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
4555 proto_tree_add_text(tree,
4556 tvb, curr_offset, 1,
4557 "%s : Reserved",
4558 a_bigbuf);
4560 switch (oct & 0x0f)
4562 case 0: str = "User"; break;
4563 case 1: str = "Private network serving the local user"; break;
4564 case 2: str = "Public network serving the local user"; break;
4565 case 3: str = "Transit network"; break;
4566 case 4: str = "Public network serving the remote user"; break;
4567 case 5: str = "Private network serving the remote user"; break;
4568 case 7: str = "International network"; break;
4569 case 10: str = "Network beyond interworking point"; break;
4570 default:
4571 str = "Reserved";
4572 break;
4575 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
4576 proto_tree_add_text(tree,
4577 tvb, curr_offset, 1,
4578 "%s : Location: %s",
4579 a_bigbuf,
4580 str);
4582 curr_offset++;
4584 oct = tvb_get_guint8(tvb, curr_offset);
4586 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
4587 proto_tree_add_text(tree,
4588 tvb, curr_offset, 1,
4589 "%s : Extension",
4590 a_bigbuf);
4592 switch ((oct & 0x70) >> 4)
4594 case 0: str = "normal event"; break;
4595 case 1: str = "normal event"; break;
4596 case 2: str = "resource unavailable"; break;
4597 case 3: str = "service or option not available"; break;
4598 case 4: str = "service or option not implemented"; break;
4599 case 5: str = "invalid message (e.g., parameter out of range)"; break;
4600 case 6: str = "protocol error (e.g., unknown message)"; break;
4601 default:
4602 str = "interworking";
4603 break;
4606 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
4607 proto_tree_add_text(tree,
4608 tvb, curr_offset, 1,
4609 "%s : Class: (%u) %s",
4610 a_bigbuf,
4611 (oct & 0x70) >> 4,
4612 str);
4614 switch (oct & 0x7f)
4616 case 0x01: str = "Unassigned (unallocated) number"; break;
4617 case 0x03: str = "No route to destination"; break;
4618 case 0x06: str = "Channel unacceptable"; break;
4619 case 0x0F: str = "Procedure failed"; break;
4620 case 0x10: str = "Normal Clearing"; break;
4621 case 0x11: str = "User busy"; break;
4622 case 0x12: str = "No user responding"; break;
4623 case 0x13: str = "User alerting, no answer"; break;
4624 case 0x15: str = "Call rejected"; break;
4625 case 0x16: str = "Number changed New destination"; break;
4626 case 0x1A: str = "Non selected user clearing"; break;
4627 case 0x1B: str = "Destination out of order"; break;
4628 case 0x1C: str = "Invalid number format (incomplete number)"; break;
4629 case 0x1D: str = "Facility rejected"; break;
4630 case 0x1F: str = "Normal, unspecified"; break;
4631 case 0x22: str = "No circuit/channel available"; break;
4632 case 0x26: str = "Network out of order"; break;
4633 case 0x29: str = "Temporary failure"; break;
4634 case 0x2A: str = "Switching equipment congestion"; break;
4635 case 0x2B: str = "Access information discarded information element ids"; break;
4636 case 0x2C: str = "requested circuit/channel not available"; break;
4637 case 0x2F: str = "Resources unavailable, unspecified"; break;
4638 case 0x31: str = "Quality of service unavailable"; break;
4639 case 0x32: str = "Requested facility not subscribed"; break;
4640 case 0x33: str = "Request MUX option or rates unavailable"; break;
4641 case 0x39: str = "Bearer capability not authorized"; break;
4642 case 0x3A: str = "Bearer capability not presently available"; break;
4643 case 0x3B: str = "SSD Update Rejected"; break;
4644 case 0x3F: str = "Service or option not available, unspecified"; break;
4645 case 0x41: str = "Bearer service not implemented"; break;
4646 case 0x45: str = "Requested facility not implement"; break;
4647 case 0x46: str = "Only restricted digital information bearer capability is available"; break;
4648 case 0x4F: str = "Service or option not implemented, unspecified"; break;
4649 case 0x51: str = "Reserved"; break;
4650 case 0x58: str = "Incompatible destination incompatible parameter"; break;
4651 case 0x5B: str = "Invalid transit network selection"; break;
4652 case 0x5F: str = "Invalid message, unspecified"; break;
4653 case 0x60: str = "Mandatory information element error information element identifier(s)"; break;
4654 case 0x61: str = "Message type nonexistent or not implemented message type"; break;
4655 case 0x62: str = "Message not compatible with control state message type or message type nonexistent or not implemented"; break;
4656 case 0x64: str = "Invalid information element contents Information element Identifier(s)"; break;
4657 case 0x65: str = "Message not compatible with call state message type"; break;
4658 case 0x6F: str = "Protocol error, unspecified"; break;
4659 case 0x7F: str = "Interworking, unspecified"; break;
4660 default:
4661 str = "Reserved";
4662 break;
4665 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
4666 proto_tree_add_text(tree,
4667 tvb, curr_offset, 1,
4668 "%s : Value: (%u)",
4669 a_bigbuf,
4670 oct & 0x0f);
4672 g_snprintf(add_string, string_len, " - (%u) %s", oct & 0x7f, str);
4674 curr_offset++;
4676 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
4678 return(curr_offset - offset);
4682 * IOS 6.2.2.56
4683 * A3/A7
4687 * IOS 6.2.2.57
4688 * A3/A7
4692 * IOS 6.2.2.58
4694 static guint8
4695 elem_xmode(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
4697 guint8 oct;
4698 guint32 curr_offset;
4700 curr_offset = offset;
4702 oct = tvb_get_guint8(tvb, curr_offset);
4704 other_decode_bitfield_value(a_bigbuf, oct, 0xfe, 8);
4705 proto_tree_add_text(tree,
4706 tvb, curr_offset, 1,
4707 "%s : Reserved",
4708 a_bigbuf);
4710 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
4711 proto_tree_add_text(tree,
4712 tvb, curr_offset, 1,
4713 "%s : TFO Mode: %s",
4714 a_bigbuf,
4715 (oct & 0x01) ? "TFO" : "tandem");
4717 g_snprintf(add_string, string_len, " - (%s)",
4718 (oct & 0x01) ? "TFO" : "tandem");
4720 curr_offset++;
4722 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
4724 return(curr_offset - offset);
4728 * IOS 6.2.2.59
4729 * UNUSED
4733 * IOS 6.2.2.60
4734 * NO ASSOCIATED DATA
4738 * IOS 6.2.2.61
4740 static guint8
4741 elem_reg_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len)
4743 guint8 oct;
4744 guint32 curr_offset;
4745 const gchar *str;
4747 curr_offset = offset;
4749 oct = tvb_get_guint8(tvb, curr_offset);
4751 switch (oct)
4753 case 0x00: str = "Timer-based"; break;
4754 case 0x01: str = "Power-up"; break;
4755 case 0x02: str = "Zone-based"; break;
4756 case 0x03: str = "Power-down"; break;
4757 case 0x04: str = "Parameter-change"; break;
4758 case 0x05: str = "Ordered"; break;
4759 case 0x06: str = "Distance-based"; break;
4760 case 0x07: str = "User Zone-based"; break;
4761 case 0x09: str = "BCMC Registration"; break;
4762 default:
4763 str = "Reserved";
4764 break;
4767 proto_tree_add_text(tree,
4768 tvb, curr_offset, 1,
4769 "Location Registration Type: %s",
4770 str);
4772 g_snprintf(add_string, string_len, " - (%s)", str);
4774 curr_offset++;
4776 /* no length check possible */
4778 return(curr_offset - offset);
4782 * IOS 6.2.2.62
4784 static guint8
4785 elem_tag(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len)
4787 guint32 value;
4788 guint32 curr_offset;
4790 curr_offset = offset;
4792 value = tvb_get_ntohl(tvb, curr_offset);
4794 proto_tree_add_text(tree,
4795 tvb, curr_offset, 4,
4796 "Tag Value: %u",
4797 value);
4799 g_snprintf(add_string, string_len, " - (%u)", value);
4801 curr_offset += 4;
4803 /* no length check possible */
4805 return(curr_offset - offset);
4809 * IOS 6.2.2.63
4811 static guint8
4812 elem_hho_params(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len)
4814 guint8 oct;
4815 gint temp_int;
4816 guint32 curr_offset;
4817 const gchar *str;
4819 curr_offset = offset;
4821 oct = tvb_get_guint8(tvb, curr_offset);
4823 other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
4824 proto_tree_add_text(tree,
4825 tvb, curr_offset, 1,
4826 "%s : Reserved",
4827 a_bigbuf);
4829 temp_int = oct & 0x1f;
4830 if ((temp_int < 0) || (temp_int >= (gint) NUM_BAND_CLASS_STR))
4832 str = "Reserved";
4834 else
4836 str = band_class_str[temp_int];
4839 other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
4840 proto_tree_add_text(tree,
4841 tvb, curr_offset, 1,
4842 "%s : Band Class: %s",
4843 a_bigbuf,
4844 str);
4846 curr_offset++;
4848 g_snprintf(add_string, string_len, " - (%s)", str);
4850 oct = tvb_get_guint8(tvb, curr_offset);
4852 other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
4853 proto_tree_add_text(tree,
4854 tvb, curr_offset, 1,
4855 "%s : Number of Preamble Frames: %u",
4856 a_bigbuf,
4857 (oct & 0xe0) >> 5);
4859 other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
4860 proto_tree_add_text(tree,
4861 tvb, curr_offset, 1,
4862 "%s : Reset L2: %s Layer 2 Acknowledgement",
4863 a_bigbuf,
4864 (oct & 0x10) ? "Reset" : "Do not reset");
4866 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
4867 proto_tree_add_text(tree,
4868 tvb, curr_offset, 1,
4869 "%s : Reset FPC: %s counters",
4870 a_bigbuf,
4871 (oct & 0x10) ? "Reset" : "Do not reset");
4873 switch ((oct & 0x06) >> 1)
4875 case 0: str = "Encryption disabled"; break;
4876 case 1: str = "Encryption enabled"; break;
4877 default:
4878 str = "Unknown";
4879 break;
4882 other_decode_bitfield_value(a_bigbuf, oct, 0x06, 8);
4883 proto_tree_add_text(tree,
4884 tvb, curr_offset, 1,
4885 "%s : Encryption Mode: %s",
4886 a_bigbuf,
4887 str);
4889 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
4890 proto_tree_add_text(tree,
4891 tvb, curr_offset, 1,
4892 "%s : Private LCM: %s Private Long Code Mask",
4893 a_bigbuf,
4894 (oct & 0x01) ? "Use" : "Do not use");
4896 curr_offset++;
4898 oct = tvb_get_guint8(tvb, curr_offset);
4900 switch (global_a_variant)
4902 case A_VARIANT_IOS401:
4903 other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
4904 proto_tree_add_text(tree,
4905 tvb, curr_offset, 1,
4906 "%s : Reserved",
4907 a_bigbuf);
4908 break;
4910 case A_VARIANT_IOS501:
4911 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
4912 proto_tree_add_text(tree,
4913 tvb, curr_offset, 1,
4914 "%s : Rev_Pwr_Cntl_Delay_Incl",
4915 a_bigbuf);
4917 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
4918 proto_tree_add_text(tree, tvb, curr_offset, 1,
4919 "%s : Rev_Pwr_Cntl_Delay",
4920 a_bigbuf);
4921 break;
4924 other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
4925 proto_tree_add_text(tree,
4926 tvb, curr_offset, 1,
4927 "%s : Nom_Pwr_Ext",
4928 a_bigbuf);
4930 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
4931 proto_tree_add_text(tree,
4932 tvb, curr_offset, 1,
4933 "%s : Nom_Pwr: %u",
4934 a_bigbuf,
4935 oct & 0x0f);
4937 curr_offset++;
4939 oct = tvb_get_guint8(tvb, curr_offset);
4941 other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
4942 proto_tree_add_text(tree,
4943 tvb, curr_offset, 1,
4944 "%s : Reserved",
4945 a_bigbuf);
4947 other_decode_bitfield_value(a_bigbuf, oct, 0x3e, 8);
4948 proto_tree_add_text(tree,
4949 tvb, curr_offset, 1,
4950 "%s : FPC Subchannel Information: %u",
4951 a_bigbuf,
4952 (oct & 0x3e) >> 1);
4954 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
4955 proto_tree_add_text(tree,
4956 tvb, curr_offset, 1,
4957 "%s : FPC Subchannel Information Included",
4958 a_bigbuf);
4960 curr_offset++;
4962 oct = tvb_get_guint8(tvb, curr_offset);
4964 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
4965 proto_tree_add_text(tree,
4966 tvb, curr_offset, 1,
4967 "%s : Reserved",
4968 a_bigbuf);
4970 other_decode_bitfield_value(a_bigbuf, oct, 0x0e, 8);
4971 proto_tree_add_text(tree,
4972 tvb, curr_offset, 1,
4973 "%s : Power Control Step: %u",
4974 a_bigbuf,
4975 (oct & 0x0e) >> 1);
4977 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
4978 proto_tree_add_text(tree,
4979 tvb, curr_offset, 1,
4980 "%s : Power Control Step Included",
4981 a_bigbuf);
4983 curr_offset++;
4985 /* no length check possible */
4987 return(curr_offset - offset);
4991 * IOS 6.2.2.64
4992 * UNUSED
4996 * IOS 6.2.2.65
4998 static guint8
4999 elem_sw_ver(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
5001 guint8 major, minor, point;
5002 guint32 curr_offset;
5004 curr_offset = offset;
5006 major = tvb_get_guint8(tvb, curr_offset);
5008 proto_tree_add_text(tree,
5009 tvb, curr_offset, 1,
5010 "IOS Major Revision Level: %u",
5011 major);
5013 curr_offset++;
5015 minor = tvb_get_guint8(tvb, curr_offset);
5017 proto_tree_add_text(tree,
5018 tvb, curr_offset, 1,
5019 "IOS Minor Revision Level: %u",
5020 minor);
5022 curr_offset++;
5024 point = tvb_get_guint8(tvb, curr_offset);
5026 proto_tree_add_text(tree,
5027 tvb, curr_offset, 1,
5028 "IOS Point Revision Level: %u",
5029 point);
5031 curr_offset++;
5033 g_snprintf(add_string, string_len, " - (IOS %u.%u.%u)", major, minor, point);
5035 if (len > 3)
5037 proto_tree_add_text(tree, tvb, curr_offset, len - 3,
5038 "Manufacturer/Carrier Software Information");
5040 curr_offset += len - 3;
5043 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
5045 return(curr_offset - offset);
5049 * IOS 6.2.2.66
5051 static guint8
5052 elem_so(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len)
5054 guint16 value;
5055 guint32 curr_offset;
5057 curr_offset = offset;
5059 value = tvb_get_ntohs(tvb, curr_offset);
5061 other_decode_bitfield_value(a_bigbuf, value, 0x8000, 16);
5062 proto_tree_add_text(tree,
5063 tvb, curr_offset, 2,
5064 "%s : Proprietary Indicator",
5065 a_bigbuf);
5067 other_decode_bitfield_value(a_bigbuf, value, 0x7000, 16);
5068 proto_tree_add_text(tree,
5069 tvb, curr_offset, 2,
5070 "%s : Service Option Revision",
5071 a_bigbuf);
5073 other_decode_bitfield_value(a_bigbuf, value, 0x0fff, 16);
5074 proto_tree_add_text(tree,
5075 tvb, curr_offset, 2,
5076 "%s : Base Service Option Number",
5077 a_bigbuf);
5079 g_snprintf(add_string, string_len, " - (%u) (0x%04x)", value, value);
5081 proto_tree_add_uint_format(tree, hf_ansi_a_so, tvb,
5082 curr_offset, 2, value,
5083 "%s %s",
5084 &add_string[3],
5085 ansi_a_so_int_to_str(value));
5087 curr_offset += 2;
5089 /* no length check possible */
5091 return(curr_offset - offset);
5095 * IOS 5 4.2.73
5097 static guint8
5098 elem_soci(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
5100 guint8 oct;
5101 guint32 curr_offset;
5103 curr_offset = offset;
5105 oct = tvb_get_guint8(tvb, curr_offset);
5107 other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
5108 proto_tree_add_text(tree,
5109 tvb, curr_offset, 1,
5110 "%s : Reserved",
5111 a_bigbuf);
5113 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
5114 proto_tree_add_text(tree,
5115 tvb, curr_offset, 1,
5116 "%s : SOCI: %u",
5117 a_bigbuf,
5118 oct & 0x07);
5120 g_snprintf(add_string, string_len, " - (%u)", oct);
5122 curr_offset++;
5124 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
5126 return(curr_offset - offset);
5130 * IOS 5 4.2.74
5132 static guint8
5133 elem_so_list(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
5135 guint8 oct;
5136 guint8 num_so;
5137 guint8 inst;
5138 guint32 curr_offset;
5139 proto_item *item;
5140 proto_tree *subtree;
5142 curr_offset = offset;
5144 num_so = tvb_get_guint8(tvb, curr_offset);
5146 proto_tree_add_text(tree, tvb, curr_offset, 1,
5147 "Number of Service Option instances: %u",
5148 num_so);
5151 * this is in case we leave the function before the
5152 * loop through the instances
5154 g_snprintf(add_string, string_len, " - %u service options", num_so);
5156 curr_offset++;
5158 NO_MORE_DATA_CHECK(len);
5160 SHORT_DATA_CHECK(len - (curr_offset - offset), 3);
5162 inst = 1;
5166 item =
5167 proto_tree_add_text(tree,
5168 tvb, curr_offset, 1,
5169 "Service Option Instance [%u]",
5170 inst);
5172 subtree = proto_item_add_subtree(item, ett_so_list);
5174 oct = tvb_get_guint8(tvb, curr_offset);
5176 other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
5177 proto_tree_add_text(subtree,
5178 tvb, curr_offset, 1,
5179 "%s : Reserved",
5180 a_bigbuf);
5182 other_decode_bitfield_value(a_bigbuf, oct, 0x38, 8);
5183 proto_tree_add_text(subtree,
5184 tvb, curr_offset, 1,
5185 "%s : SR_ID: %u",
5186 a_bigbuf,
5187 (oct & 0x38) >> 3);
5189 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
5190 proto_tree_add_text(subtree,
5191 tvb, curr_offset, 1,
5192 "%s : SOCI: %u",
5193 a_bigbuf,
5194 oct & 0x07);
5196 curr_offset++;
5198 curr_offset += elem_so(tvb, pinfo, subtree, curr_offset, len, add_string, string_len);
5199 add_string[0] = '\0';
5201 inst++;
5203 while ((len - (curr_offset - offset)) >= 3);
5206 * this is because 'add_string' was used by 'elem_so()'
5208 g_snprintf(add_string, string_len, " - %u service options", num_so);
5210 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
5212 return(curr_offset - offset);
5216 * IOS 5 4.2.70
5218 static guint8
5219 elem_acc_net_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
5221 guint32 value;
5222 guint32 sid, nid, pzid;
5223 guint32 curr_offset;
5225 curr_offset = offset;
5227 value = tvb_get_ntohs(tvb, curr_offset);
5228 sid = value & 0x7fff;
5230 other_decode_bitfield_value(a_bigbuf, value >> 8, 0x80, 8);
5231 proto_tree_add_text(tree, tvb, curr_offset, 1,
5232 "%s : Reserved",
5233 a_bigbuf);
5235 other_decode_bitfield_value(a_bigbuf, value >> 8, 0x7f, 8);
5236 proto_tree_add_text(tree, tvb, curr_offset, 1,
5237 "%s : SID (MSB), %u",
5238 a_bigbuf,
5239 sid);
5241 other_decode_bitfield_value(a_bigbuf, value & 0x00ff, 0xff, 8);
5242 proto_tree_add_text(tree, tvb, curr_offset + 1, 1,
5243 "%s : SID (LSB)",
5244 a_bigbuf);
5246 curr_offset += 2;
5248 nid = tvb_get_ntohs(tvb, curr_offset);
5250 proto_tree_add_text(tree,
5251 tvb, curr_offset, 2,
5252 "NID: %u",
5253 nid);
5255 curr_offset += 2;
5257 pzid = tvb_get_ntohs(tvb, curr_offset);
5259 proto_tree_add_text(tree,
5260 tvb, curr_offset, 2,
5261 "PZID: %u",
5262 pzid);
5264 curr_offset += 2;
5266 g_snprintf(add_string, string_len, " - (SID/NID/PZID: %u/%u/%u)", sid, nid, pzid);
5268 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
5270 return(curr_offset - offset);
5274 #define ADDS_APP_UNKNOWN 0x00
5275 #define ADDS_APP_ADS 0x01
5276 #define ADDS_APP_FAX 0x02
5277 #define ADDS_APP_SMS 0x03
5278 #define ADDS_APP_OTA 0x04
5279 #define ADDS_APP_PDS 0x05 /* aka PLD */
5280 #define ADDS_APP_SDB 0x06
5281 #define ADDS_APP_HRPD 0x07
5282 #define ADDS_APP_EXT_INTL 0x3E
5283 #define ADDS_APP_EXT 0x3F
5285 static const value_string ansi_a_adds_strings[] = {
5286 { ADDS_APP_UNKNOWN, "UNKNOWN" },
5287 { ADDS_APP_ADS, "ADS" },
5288 { ADDS_APP_FAX, "FAX" },
5289 { ADDS_APP_SMS, "SMS" },
5290 { ADDS_APP_OTA, "OTA" },
5291 { ADDS_APP_PDS, "PDS" },
5292 { ADDS_APP_SDB, "SDB" },
5293 { ADDS_APP_HRPD, "HRPD" },
5294 { ADDS_APP_EXT_INTL, "EXT_INTL" },
5295 { ADDS_APP_EXT, "EXT" },
5296 { 0, NULL}
5300 * IOS 6.2.2.67
5302 static guint8
5303 elem_adds_user_part(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
5305 guint8 oct;
5306 guint32 value;
5307 guint8 adds_app;
5308 guint32 curr_offset;
5309 const gchar *str;
5310 tvbuff_t *adds_tvb;
5311 gint idx;
5312 proto_tree *subtree;
5313 proto_item *item;
5315 curr_offset = offset;
5317 oct = tvb_get_guint8(tvb, curr_offset);
5319 other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
5320 proto_tree_add_text(tree,
5321 tvb, curr_offset, 1,
5322 "%s : Reserved",
5323 a_bigbuf);
5325 adds_app = oct & 0x3f;
5327 str = try_val_to_str_idx((guint32) adds_app, ansi_a_adds_strings, &idx);
5328 if (str == NULL)
5330 str = "Reserved";
5332 g_snprintf(add_string, string_len, " - (%s)", str);
5334 other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
5335 proto_tree_add_text(tree,
5336 tvb, curr_offset, 1,
5337 "%s : Data Burst Type: %s",
5338 a_bigbuf,
5339 str);
5341 curr_offset++;
5343 item =
5344 proto_tree_add_text(tree, tvb, curr_offset, len - 1,
5345 "Application Data Message");
5347 subtree = proto_item_add_subtree(item, ett_adds_user_part);
5349 switch (adds_app)
5351 case ADDS_APP_SMS:
5352 adds_tvb = tvb_new_subset(tvb, curr_offset, len - 1, len - 1);
5354 dissector_try_uint(is637_dissector_table,
5355 0, adds_tvb, pinfo, g_tree);
5357 curr_offset += (len - 1);
5358 break;
5360 case ADDS_APP_OTA:
5361 adds_tvb = tvb_new_subset(tvb, curr_offset, len - 1, len - 1);
5363 dissector_try_uint(is683_dissector_table,
5364 (pinfo->p2p_dir == P2P_DIR_RECV), adds_tvb, pinfo, g_tree);
5366 curr_offset += (len - 1);
5367 break;
5369 case ADDS_APP_PDS:
5370 adds_tvb = tvb_new_subset(tvb, curr_offset, len - 1, len - 1);
5372 dissector_try_uint(is801_dissector_table,
5373 (pinfo->p2p_dir == P2P_DIR_RECV), adds_tvb, pinfo, g_tree);
5375 curr_offset += (len - 1);
5376 break;
5378 case ADDS_APP_SDB:
5380 * no SDB dissector, push to GRE/A11 dissector ?
5382 curr_offset += (len - 1);
5383 break;
5385 case ADDS_APP_EXT_INTL:
5387 * no generic External International dissector
5389 value = tvb_get_ntohs(tvb, curr_offset);
5391 proto_tree_add_text(subtree,
5392 tvb, curr_offset, 2,
5393 "Extended Burst Type - International: 0x%04x", value);
5395 curr_offset += 2;
5397 proto_tree_add_text(tree, tvb, curr_offset, len - (curr_offset - offset),
5398 "Data");
5400 curr_offset += len - (curr_offset - offset);
5401 break;
5403 case ADDS_APP_EXT:
5404 value = tvb_get_ntohs(tvb, curr_offset);
5406 proto_tree_add_text(subtree,
5407 tvb, curr_offset, 2,
5408 "Extended Burst Type: 0x%04x", value);
5410 curr_offset += 2;
5412 proto_tree_add_text(subtree, tvb, curr_offset, len - (curr_offset - offset),
5413 "Data");
5415 curr_offset += len - (curr_offset - offset);
5416 break;
5418 default:
5420 * no sub-dissectors
5422 curr_offset += (len - 1);
5423 break;
5426 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
5428 return(curr_offset - offset);
5432 * IOS 5 4.2.75
5434 static guint8
5435 elem_amps_hho_param(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
5437 guint8 oct;
5438 guint32 curr_offset;
5440 curr_offset = offset;
5442 oct = tvb_get_guint8(tvb, curr_offset);
5444 other_decode_bitfield_value(a_bigbuf, oct, 0xfc, 8);
5445 proto_tree_add_text(tree, tvb, curr_offset, 1,
5446 "%s : Reserved",
5447 a_bigbuf);
5449 other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
5450 proto_tree_add_text(tree, tvb, curr_offset, 1,
5451 "%s : Encryption Mode: (%u) %s",
5452 a_bigbuf,
5453 oct & 0x03,
5454 (oct & 0x03) ? "enabled" : "disabled");
5456 curr_offset++;
5458 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
5460 return(curr_offset - offset);
5464 * IOS 6.2.2.68
5466 static guint8
5467 elem_is2000_scr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
5469 guint8 oct, num_con_rec, ii;
5470 guint8 bit_mask, bit_offset;
5471 guint32 curr_offset, saved_offset;
5472 guint32 value;
5473 guint is2000_portion_len;
5474 proto_tree *scr_subtree, *subtree;
5475 proto_item *item = NULL;
5476 const gchar *str = NULL;
5478 curr_offset = offset;
5480 oct = tvb_get_guint8(tvb, curr_offset);
5482 other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
5483 proto_tree_add_text(tree, tvb, curr_offset, 1,
5484 "%s : Reserved",
5485 a_bigbuf);
5487 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
5488 proto_tree_add_text(tree, tvb, curr_offset, 1,
5489 "%s : Bit-Exact Length Fill Bits: %u",
5490 a_bigbuf,
5491 oct & 0x07);
5493 curr_offset++;
5495 is2000_portion_len = len - (curr_offset - offset);
5498 * the following decode was modified from the packet-ansi_map.c version
5501 SHORT_DATA_CHECK(is2000_portion_len, 7);
5503 saved_offset = curr_offset;
5505 item =
5506 proto_tree_add_text(tree, tvb, curr_offset,
5507 is2000_portion_len,
5508 "IS-2000 Service Configuration Record Content");
5510 scr_subtree =
5511 proto_item_add_subtree(item, ett_scr);
5513 proto_tree_add_text(scr_subtree, tvb,
5514 curr_offset, 2,
5515 "FOR_MUX_OPTION: Forward Traffic Channel multiplex option");
5517 curr_offset += 2;
5519 proto_tree_add_text(scr_subtree, tvb,
5520 curr_offset, 2,
5521 "REV_MUX_OPTION: Reverse Traffic Channel multiplex option");
5523 curr_offset += 2;
5525 proto_tree_add_text(scr_subtree, tvb,
5526 curr_offset, 1,
5527 "FOR_RATES: Transmission rates of the Forward Fundamental Channel");
5529 curr_offset += 1;
5531 proto_tree_add_text(scr_subtree, tvb,
5532 curr_offset, 1,
5533 "REV_RATES: Transmission rates of the Reverse Fundamental Channel");
5535 curr_offset += 1;
5537 num_con_rec = tvb_get_guint8(tvb, curr_offset);
5539 proto_tree_add_text(scr_subtree, tvb,
5540 curr_offset, 1,
5541 "NUM_CON_REC: Number of service option connection records, %u",
5542 num_con_rec);
5544 curr_offset += 1;
5546 for (ii=0; ii < num_con_rec; ii++)
5548 oct = tvb_get_guint8(tvb, curr_offset);
5550 item =
5551 proto_tree_add_text(scr_subtree, tvb,
5552 curr_offset, oct /* oct already includes the length octet itself */,
5553 "Service option connection record [%u]", ii+1);
5555 subtree =
5556 proto_item_add_subtree(item, ett_srvc_con_rec);
5558 curr_offset += 1;
5560 oct = tvb_get_guint8(tvb, curr_offset);
5562 proto_tree_add_text(subtree, tvb,
5563 curr_offset, 1,
5564 "CON_REF: Service option connection reference, %u",
5565 oct);
5567 curr_offset += 1;
5569 value = tvb_get_ntohs(tvb, curr_offset);
5571 proto_tree_add_text(subtree, tvb,
5572 curr_offset, 2,
5573 "SERVICE_OPTION: %s",
5574 ansi_a_so_int_to_str(value));
5576 curr_offset += 2;
5578 oct = tvb_get_guint8(tvb, curr_offset);
5580 switch ((oct & 0xf0) >> 4)
5582 case 0x00: str = "The service option connection does not use Forward Traffic Channel traffic."; break;
5583 case 0x01: str = "The service option connection uses primary traffic on the Forward Traffic Channel."; break;
5584 case 0x02: str = "The service option connection uses secondary traffic on the Forward Traffic Channel."; break;
5585 default: str = "Reserved"; break;
5588 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
5589 proto_tree_add_text(subtree, tvb,
5590 curr_offset, 1,
5591 "%s : FOR_TRAFFIC: Forward Traffic Channel traffic type, %s",
5592 a_bigbuf,
5593 str);
5595 switch (oct & 0x0f)
5597 case 0x00: str = "The service option connection does not use Reverse Traffic Channel traffic."; break;
5598 case 0x01: str = "The service option connection uses primary traffic on the Reverse Traffic Channel."; break;
5599 case 0x02: str = "The service option connection uses secondary traffic on the Reverse Traffic Channel."; break;
5600 default: str = "Reserved"; break;
5603 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
5604 proto_tree_add_text(subtree, tvb,
5605 curr_offset, 1,
5606 "%s : REV_TRAFFIC: Reverse Traffic Channel traffic type, %s",
5607 a_bigbuf,
5608 str);
5610 curr_offset += 1;
5612 oct = tvb_get_guint8(tvb, curr_offset);
5614 other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
5615 proto_tree_add_text(subtree, tvb,
5616 curr_offset, 1,
5617 "%s : UI_ENCRYPT_MODE: Encryption mode indicator for user information privacy",
5618 a_bigbuf);
5620 other_decode_bitfield_value(a_bigbuf, oct, 0x1c, 8);
5621 proto_tree_add_text(subtree, tvb,
5622 curr_offset, 1,
5623 "%s : SR_ID: Service reference identifier",
5624 a_bigbuf);
5626 other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
5627 proto_tree_add_text(subtree, tvb,
5628 curr_offset, 1,
5629 "%s : RLP_INFO_INCL: RLP information included indicator",
5630 a_bigbuf);
5632 if (oct & 0x02)
5634 value = (oct & 0x01) << 3;
5635 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
5637 curr_offset += 1;
5639 oct = tvb_get_guint8(tvb, curr_offset);
5641 value |= (oct & 0xe0) >> 5;
5643 proto_tree_add_text(subtree, tvb,
5644 curr_offset - 1, 1,
5645 "%s : RLP_BLOB_LEN (MSB), %u",
5646 a_bigbuf,
5647 value);
5649 other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
5650 proto_tree_add_text(subtree, tvb,
5651 curr_offset, 1,
5652 "%s : RLP_BLOB_LEN (LSB)",
5653 a_bigbuf);
5655 other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
5656 proto_tree_add_text(subtree, tvb,
5657 curr_offset, 1,
5658 "%s : RLP_BLOB (MSB)",
5659 a_bigbuf);
5661 curr_offset += 1;
5663 if (value > 1)
5665 proto_tree_add_text(subtree, tvb,
5666 curr_offset, value - 1,
5667 "RLP_BLOB");
5669 curr_offset += value - 1;
5672 oct = tvb_get_guint8(tvb, curr_offset);
5674 other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
5675 proto_tree_add_text(subtree, tvb,
5676 curr_offset, 1,
5677 "%s : RLP_BLOB (LSB)",
5678 a_bigbuf);
5680 other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
5681 proto_tree_add_text(subtree, tvb,
5682 curr_offset, 1,
5683 "%s : Reserved",
5684 a_bigbuf);
5686 else
5688 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
5689 proto_tree_add_text(subtree, tvb,
5690 curr_offset, 1,
5691 "%s : Reserved",
5692 a_bigbuf);
5695 curr_offset += 1;
5698 oct = tvb_get_guint8(tvb, curr_offset);
5700 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
5701 proto_tree_add_text(scr_subtree, tvb,
5702 curr_offset, 1,
5703 "%s : FCH_CC_INCL: Channel configuration for the Fundamental Channel included indicator",
5704 a_bigbuf);
5706 if (oct & 0x80)
5708 other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
5709 proto_tree_add_text(scr_subtree, tvb,
5710 curr_offset, 1,
5711 "%s : FCH_FRAME_SIZE: Fundamental Channel frame size supported indicator",
5712 a_bigbuf);
5714 other_decode_bitfield_value(a_bigbuf, oct, 0x3e, 8);
5715 proto_tree_add_text(scr_subtree, tvb,
5716 curr_offset, 1,
5717 "%s : FOR_FCH_RC: Forward Fundamental Channel Radio Configuration, %u",
5718 a_bigbuf,
5719 (oct & 0x3e) >> 1);
5721 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
5722 value = (oct & 0x01) << 4;
5724 curr_offset += 1;
5726 oct = tvb_get_guint8(tvb, curr_offset);
5728 value |= (oct & 0xf0) >> 4;
5730 proto_tree_add_text(scr_subtree, tvb,
5731 curr_offset - 1, 1,
5732 "%s : REV_FCH_RC: Reverse Fundamental Channel Radio Configuration (MSB), %u",
5733 a_bigbuf,
5734 value);
5736 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
5737 proto_tree_add_text(scr_subtree, tvb,
5738 curr_offset, 1,
5739 "%s : REV_FCH_RC: (LSB)",
5740 a_bigbuf);
5742 bit_mask = 0x08;
5743 bit_offset = 3;
5745 else
5747 bit_mask = 0x40;
5748 bit_offset = 6;
5751 other_decode_bitfield_value(a_bigbuf, oct, bit_mask, 8);
5752 proto_tree_add_text(scr_subtree, tvb,
5753 curr_offset, 1,
5754 "%s : DCCH_CC_INCL: Channel configuration for the Dedicated Control Channel included indicator",
5755 a_bigbuf);
5757 if (oct & bit_mask)
5759 /* can't be bothered to do the rest of the decode */
5761 proto_tree_add_text(scr_subtree, tvb,
5762 curr_offset, (is2000_portion_len - (curr_offset - saved_offset)),
5763 "DCCH + ? + Reserved");
5765 curr_offset += (is2000_portion_len - (curr_offset - saved_offset));
5767 else
5769 bit_mask >>= 1;
5770 bit_offset--;
5772 other_decode_bitfield_value(a_bigbuf, oct, bit_mask, 8);
5773 proto_tree_add_text(scr_subtree, tvb,
5774 curr_offset, 1,
5775 "%s : FOR_SCH_CC_INCL: Channel configuration for the Dedicated Control Channel included indicator",
5776 a_bigbuf);
5778 if (oct & bit_mask)
5780 /* can't be bothered to do the rest of the decode */
5782 proto_tree_add_text(scr_subtree, tvb,
5783 curr_offset, (is2000_portion_len - (curr_offset - saved_offset)),
5784 "FOR_SCH + ? + Reserved");
5786 curr_offset += (is2000_portion_len - (curr_offset - saved_offset));
5788 else
5790 bit_mask >>= 1;
5791 bit_offset--;
5793 other_decode_bitfield_value(a_bigbuf, oct, bit_mask, 8);
5794 proto_tree_add_text(scr_subtree, tvb,
5795 curr_offset, 1,
5796 "%s : REV_SCH_CC_INCL: Channel configuration for the Dedicated Control Channel included indicator",
5797 a_bigbuf);
5799 if (oct & bit_mask)
5801 /* can't be bothered to do the rest of the decode */
5803 proto_tree_add_text(scr_subtree, tvb,
5804 curr_offset, (is2000_portion_len - (curr_offset - saved_offset)),
5805 "REV_SCH + ? + Reserved");
5807 curr_offset += (is2000_portion_len - (curr_offset - saved_offset));
5809 else
5811 bit_mask = (0xff << (8 - bit_offset));
5812 bit_mask >>= (8 - bit_offset);
5814 other_decode_bitfield_value(a_bigbuf, oct, bit_mask, 8);
5815 proto_tree_add_text(scr_subtree, tvb,
5816 curr_offset, 1,
5817 "%s : Reserved",
5818 a_bigbuf);
5820 curr_offset += 1;
5825 EXTRANEOUS_DATA_CHECK_EXPERT(len, curr_offset - offset);
5827 return(curr_offset - offset);
5831 * IOS 6.2.2.69
5833 static guint8
5834 elem_is2000_nn_scr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
5836 guint8 oct;
5837 guint32 curr_offset;
5838 #ifndef MLUM
5839 guint is2000_portion_len;
5840 #endif
5842 curr_offset = offset;
5844 oct = tvb_get_guint8(tvb, curr_offset);
5846 other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
5847 proto_tree_add_text(tree, tvb, curr_offset, 1,
5848 "%s : Reserved",
5849 a_bigbuf);
5851 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
5852 proto_tree_add_text(tree, tvb, curr_offset, 1,
5853 "%s : Bit-Exact Length Fill Bits: %u",
5854 a_bigbuf,
5855 oct & 0x07);
5857 curr_offset++;
5859 #ifndef MLUM
5861 is2000_portion_len = len - (curr_offset - offset);
5863 NO_MORE_DATA_CHECK(len);
5865 if (is2000_portion_len > 0)
5867 SHORT_DATA_CHECK(len - (curr_offset - offset), is2000_portion_len);
5869 proto_tree_add_text(tree, tvb, curr_offset, is2000_portion_len,
5870 "IS-2000 Non-Negotiable Service Configuration Record Content");
5872 curr_offset += is2000_portion_len;
5875 #else
5878 #endif
5880 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
5882 return(curr_offset - offset);
5886 * IOS 6.2.2.70
5888 static guint8
5889 elem_is2000_mob_cap(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
5891 guint8 oct;
5892 guint8 oct_len;
5893 guint32 curr_offset;
5894 proto_tree *subtree;
5895 proto_item *item = NULL;
5896 const gchar *str;
5898 curr_offset = offset;
5900 oct = tvb_get_guint8(tvb, curr_offset);
5902 switch (global_a_variant)
5904 case A_VARIANT_IOS401:
5905 other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
5906 proto_tree_add_text(tree, tvb, curr_offset, 1,
5907 "%s : Reserved",
5908 a_bigbuf);
5909 break;
5911 case A_VARIANT_IOS501:
5912 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
5913 proto_tree_add_text(tree, tvb, curr_offset, 1,
5914 "%s : REV_PDCH Supported: IS-2000 R-PDCH %ssupported",
5915 a_bigbuf,
5916 (oct & 0x80) ? "" : "not ");
5918 other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
5919 proto_tree_add_text(tree, tvb, curr_offset, 1,
5920 "%s : FOR_PDCH Supported: IS-2000 F-PDCH %ssupported",
5921 a_bigbuf,
5922 (oct & 0x40) ? "" : "not ");
5924 other_decode_bitfield_value(a_bigbuf, oct, 0x20, 8);
5925 proto_tree_add_text(tree, tvb, curr_offset, 1,
5926 "%s : ERAM Supported: Enhanced Rate Adaptation Mode %ssupported",
5927 a_bigbuf,
5928 (oct & 0x20) ? "" : "not ");
5929 break;
5932 other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
5933 proto_tree_add_text(tree, tvb, curr_offset, 1,
5934 "%s : DCCH Supported: IS-2000 DCCH %ssupported",
5935 a_bigbuf,
5936 (oct & 0x10) ? "" : "not ");
5938 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
5939 proto_tree_add_text(tree, tvb, curr_offset, 1,
5940 "%s : FCH Supported: IS-2000 FCH %ssupported",
5941 a_bigbuf,
5942 (oct & 0x08) ? "" : "not ");
5944 other_decode_bitfield_value(a_bigbuf, oct, 0x04, 8);
5945 proto_tree_add_text(tree, tvb, curr_offset, 1,
5946 "%s : OTD Supported: Orthogonal Transmit Diversity %ssupported",
5947 a_bigbuf,
5948 (oct & 0x04) ? "" : "not ");
5950 other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
5951 proto_tree_add_text(tree, tvb, curr_offset, 1,
5952 "%s : Enhanced RC CFG Supported: Radio configuration in radio class 2 %ssupported",
5953 a_bigbuf,
5954 (oct & 0x02) ? "" : "not ");
5956 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
5957 proto_tree_add_text(tree, tvb, curr_offset, 1,
5958 "%s : QPCH Supported: Quick Paging Channel %ssupported",
5959 a_bigbuf,
5960 (oct & 0x01) ? "" : "not ");
5962 curr_offset++;
5964 NO_MORE_DATA_CHECK(len);
5966 oct_len = tvb_get_guint8(tvb, curr_offset);
5968 proto_tree_add_text(tree,
5969 tvb, curr_offset, 1,
5970 "FCH Information: Bit-Exact Length Octet Count: %u",
5971 oct_len);
5973 curr_offset++;
5975 NO_MORE_DATA_CHECK(len);
5977 oct = tvb_get_guint8(tvb, curr_offset);
5979 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
5980 proto_tree_add_text(tree, tvb, curr_offset, 1,
5981 "%s : Reserved",
5982 a_bigbuf);
5984 switch ((oct & 0x70) >> 4)
5986 case 0: str = "No mobile assisted geo-location capabilities"; break;
5987 case 1: str = "IS801 capable (Advanced Forward Link Triangulation only (AFLT))"; break;
5988 case 2: str = "IS801 capable (Advanced Forward Link Triangulation and Global Positioning Systems"; break;
5989 case 3: str = "Global Positioning Systems Only"; break;
5990 default:
5991 str = "Reserved";
5992 break;
5995 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
5996 proto_tree_add_text(tree, tvb, curr_offset, 1,
5997 "%s : Geo Location Type: %s",
5998 a_bigbuf,
5999 str);
6001 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
6002 proto_tree_add_text(tree, tvb, curr_offset, 1,
6003 "%s : Geo Location Included",
6004 a_bigbuf);
6006 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
6007 proto_tree_add_text(tree, tvb, curr_offset, 1,
6008 "%s : FCH Information: Bit-Exact Length Fill Bits: %u",
6009 a_bigbuf,
6010 oct & 0x07);
6012 curr_offset++;
6014 NO_MORE_DATA_CHECK(len);
6016 if (oct_len > 0)
6018 SHORT_DATA_CHECK(len - (curr_offset - offset), oct_len);
6020 proto_tree_add_text(tree, tvb, curr_offset, oct_len,
6021 "FCH Information Content");
6023 curr_offset += oct_len;
6025 NO_MORE_DATA_CHECK(len);
6029 * DCCH
6031 oct_len = tvb_get_guint8(tvb, curr_offset);
6033 proto_tree_add_text(tree,
6034 tvb, curr_offset, 1,
6035 "DCCH Information: Bit-Exact Length Octet Count: %u",
6036 oct_len);
6038 curr_offset++;
6040 NO_MORE_DATA_CHECK(len);
6042 oct = tvb_get_guint8(tvb, curr_offset);
6044 other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
6045 proto_tree_add_text(tree, tvb, curr_offset, 1,
6046 "%s : Reserved",
6047 a_bigbuf);
6049 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
6050 proto_tree_add_text(tree, tvb, curr_offset, 1,
6051 "%s : DCCH Information: Bit-Exact Length Fill Bits: %u",
6052 a_bigbuf,
6053 oct & 0x07);
6055 curr_offset++;
6057 NO_MORE_DATA_CHECK(len);
6059 if (oct_len > 0)
6061 SHORT_DATA_CHECK(len - (curr_offset - offset), oct_len);
6063 proto_tree_add_text(tree, tvb, curr_offset, oct_len,
6064 "DCCH Information Content");
6066 curr_offset += oct_len;
6068 NO_MORE_DATA_CHECK(len);
6072 * FOR_PDCH
6074 oct_len = tvb_get_guint8(tvb, curr_offset);
6076 proto_tree_add_text(tree,
6077 tvb, curr_offset, 1,
6078 "FOR_PDCH Information: Bit-Exact Length Octet Count: %u",
6079 oct_len);
6081 curr_offset++;
6083 NO_MORE_DATA_CHECK(len);
6085 oct = tvb_get_guint8(tvb, curr_offset);
6087 other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
6088 proto_tree_add_text(tree, tvb, curr_offset, 1,
6089 "%s : Reserved",
6090 a_bigbuf);
6092 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
6093 proto_tree_add_text(tree, tvb, curr_offset, 1,
6094 "%s : FOR_PDCH Information: Bit-Exact Length Fill Bits: %u",
6095 a_bigbuf,
6096 oct & 0x07);
6098 curr_offset++;
6100 NO_MORE_DATA_CHECK(len);
6102 if (oct_len > 0)
6104 SHORT_DATA_CHECK(len - (curr_offset - offset), oct_len);
6106 proto_tree_add_text(tree, tvb, curr_offset, oct_len,
6107 "FOR_PDCH Information Content");
6109 curr_offset += oct_len;
6111 NO_MORE_DATA_CHECK(len);
6115 * REV_PDCH
6117 oct_len = tvb_get_guint8(tvb, curr_offset);
6119 proto_tree_add_text(tree,
6120 tvb, curr_offset, 1,
6121 "REV_PDCH Information: Bit-Exact Length Octet Count: %u",
6122 oct_len);
6124 curr_offset++;
6126 NO_MORE_DATA_CHECK(len);
6128 oct = tvb_get_guint8(tvb, curr_offset);
6130 other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
6131 proto_tree_add_text(tree, tvb, curr_offset, 1,
6132 "%s : Reserved",
6133 a_bigbuf);
6135 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
6136 proto_tree_add_text(tree, tvb, curr_offset, 1,
6137 "%s : REV_PDCH Information: Bit-Exact Length Fill Bits: %u",
6138 a_bigbuf,
6139 oct & 0x07);
6141 curr_offset++;
6143 NO_MORE_DATA_CHECK(len);
6145 if (oct_len > 0)
6147 SHORT_DATA_CHECK(len - (curr_offset - offset), oct_len);
6149 proto_tree_add_text(tree, tvb, curr_offset, oct_len,
6150 "REV_PDCH Information Content");
6152 curr_offset += oct_len;
6154 NO_MORE_DATA_CHECK(len);
6157 oct = tvb_get_guint8(tvb, curr_offset);
6159 item =
6160 proto_tree_add_text(tree, tvb,
6161 curr_offset, 1,
6162 "VP Algorithms Supported%s",
6163 oct ? "" : ": No voice privacy supported");
6165 if (oct)
6167 subtree =
6168 proto_item_add_subtree(item, ett_vp_algs);
6170 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
6171 proto_tree_add_text(subtree, tvb, curr_offset, 1,
6172 "%s : %s",
6173 a_bigbuf,
6174 (oct & 0x80) ? "No extension" : "Extended");
6176 other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
6177 proto_tree_add_text(subtree, tvb, curr_offset, 1,
6178 "%s : A7: Reserved",
6179 a_bigbuf);
6181 other_decode_bitfield_value(a_bigbuf, oct, 0x20, 8);
6182 proto_tree_add_text(subtree, tvb, curr_offset, 1,
6183 "%s : A6: Reserved",
6184 a_bigbuf);
6186 other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
6187 proto_tree_add_text(subtree, tvb, curr_offset, 1,
6188 "%s : A5: Reserved",
6189 a_bigbuf);
6191 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
6192 proto_tree_add_text(subtree, tvb, curr_offset, 1,
6193 "%s : A4: Reserved",
6194 a_bigbuf);
6196 other_decode_bitfield_value(a_bigbuf, oct, 0x04, 8);
6197 proto_tree_add_text(subtree, tvb, curr_offset, 1,
6198 "%s : A3: Reserved",
6199 a_bigbuf);
6201 other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
6202 proto_tree_add_text(subtree, tvb, curr_offset, 1,
6203 "%s : A2: Advanced Encryption Standard (AES)",
6204 a_bigbuf);
6206 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
6207 proto_tree_add_text(subtree, tvb, curr_offset, 1,
6208 "%s : A1: Private long code",
6209 a_bigbuf);
6212 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
6214 return(curr_offset - offset);
6218 * IOS 6.2.2.71
6220 static guint8
6221 elem_ptype(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
6223 guint32 value;
6224 guint32 curr_offset;
6225 const gchar *str;
6227 curr_offset = offset;
6229 value = tvb_get_ntohs(tvb, curr_offset);
6231 switch (value)
6233 case 0x880b: str = "PPP"; break;
6234 case 0x8881: str = "Unstructured Byte Stream"; break;
6235 default:
6236 str = "Unknown";
6237 break;
6240 proto_tree_add_text(tree,
6241 tvb, curr_offset, 2,
6242 "(%u) %s",
6243 value,
6244 str);
6246 g_snprintf(add_string, string_len, " - (%s)", str);
6248 curr_offset += 2;
6250 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
6252 return(curr_offset - offset);
6256 * IOS 6.2.2.72
6258 static const value_string ansi_a_ms_info_rec_signal_type_vals[] = {
6259 { 0x0, "Tone signal"},
6260 { 0x1, "ISDN Alerting"},
6261 { 0x2, "IS-54B Alerting"},
6262 { 0x3, "Reserved"},
6263 { 0, NULL}
6266 static const value_string ansi_a_ms_info_rec_signal_alert_pitch_vals[] = {
6267 { 0x0, "Medium pitch (standard alert)"},
6268 { 0x1, "High pitch"},
6269 { 0x2, "Low pitch"},
6270 { 0x3, "Reserved"},
6271 { 0, NULL}
6274 static const value_string ansi_a_ms_info_rec_signal_tone_vals[] = {
6275 { 0x00, "Dial tone on"},
6276 { 0x01, "Ring back tone on"},
6277 { 0x02, "Intercept tone on"},
6278 { 0x03, "Abbreviated intercept"},
6279 { 0x04, "Network congestion (reorder) tone on"},
6280 { 0x05, "Abbreviated network congestion (reorder)"},
6281 { 0x06, "Busy tone on"},
6282 { 0x07, "Confirm tone on"},
6283 { 0x08, "Answer tone on"},
6284 { 0x09, "Call waiting tone on"},
6285 { 0x0a, "Pip tone on"},
6286 { 0x3f, "Tones off"},
6287 { 0, NULL}
6290 const value_string ansi_a_ms_info_rec_signal_isdn_alert_vals[] = {
6291 { 0x0, "Normal Alerting"},
6292 { 0x1, "Intergroup Alerting"},
6293 { 0x2, "Special/Priority Alerting"},
6294 { 0x3, "Reserved (ISDN Alerting pattern 3)"},
6295 { 0x4, "Ping ring"},
6296 { 0x5, "Reserved (ISDN Alerting pattern 5)"},
6297 { 0x6, "Reserved (ISDN Alerting pattern 6)"},
6298 { 0x7, "Reserved (ISDN Alerting pattern 7)"},
6299 { 0xf, "Alerting off"},
6300 { 0, NULL}
6303 static const value_string ansi_a_ms_info_rec_signal_is54b_alert_vals[] = {
6304 { 0x0, "No Tone"},
6305 { 0x1, "Long"},
6306 { 0x2, "Short-Short"},
6307 { 0x3, "Short-Short-Long"},
6308 { 0x4, "Short-Short-2"},
6309 { 0x5, "Short-Long-Short"},
6310 { 0x6, "Short-Short-Short-Short"},
6311 { 0x7, "PBX Long"},
6312 { 0x8, "PBX Short-Short"},
6313 { 0x9, "PBX Short-Short-Long"},
6314 { 0xa, "PBX Short-Long-Short"},
6315 { 0xb, "PBX Short-Short-Short-Short"},
6316 { 0xc, "Pip-Pip-Pip-Pip"},
6317 { 0, NULL}
6320 static guint8
6321 elem_fwd_ms_info_recs(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
6323 guint8 oct;
6324 guint8 oct_len;
6325 guint8 rec_type;
6326 guint8 num_recs;
6327 guint32 value;
6328 guint32 curr_offset;
6329 const gchar *str;
6330 gint ett_elem_idx, idx, i;
6331 proto_tree *subtree;
6332 proto_item *item;
6334 curr_offset = offset;
6336 num_recs = 0;
6338 while ((len - (curr_offset - offset)) >= 2)
6340 num_recs++;
6342 rec_type = tvb_get_guint8(tvb, curr_offset);
6344 str = try_val_to_str_idx((guint32) rec_type, ansi_fwd_ms_info_rec_str, &idx);
6346 if (str == NULL)
6348 str = "Reserved";
6349 ett_elem_idx = ett_ansi_ms_info_rec_reserved;
6351 else
6353 ett_elem_idx = ett_ansi_fwd_ms_info_rec[idx];
6356 item =
6357 proto_tree_add_text(tree,
6358 tvb, curr_offset, 1,
6359 "Information Record Type [%u]: (%u) %s",
6360 num_recs,
6361 rec_type,
6362 str);
6364 subtree = proto_item_add_subtree(item, ett_elem_idx);
6366 curr_offset++;
6368 oct_len = tvb_get_guint8(tvb, curr_offset);
6370 proto_tree_add_uint(subtree, hf_ansi_a_length, tvb,
6371 curr_offset, 1, oct_len);
6373 curr_offset++;
6375 if (oct_len > 0)
6377 SHORT_DATA_CHECK(len - (curr_offset - offset), oct_len);
6379 switch (rec_type)
6381 case ANSI_FWD_MS_INFO_REC_CLD_PN:
6382 oct = tvb_get_guint8(tvb, curr_offset);
6384 switch ((oct & 0xe0) >> 5)
6386 case 0: str = "Unknown"; break;
6387 case 1: str = "International number"; break;
6388 case 2: str = "National number"; break;
6389 case 3: str = "Network-specific number"; break;
6390 case 4: str = "Subscriber number"; break;
6391 case 5: str = "Reserved"; break;
6392 case 6: str = "Abbreviated number"; break;
6393 default:
6394 str = "Reserved for extension";
6395 break;
6398 other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
6399 proto_tree_add_text(subtree, tvb, curr_offset, 1,
6400 "%s : Number Type: %s",
6401 a_bigbuf,
6402 str);
6404 switch ((oct & 0x1e) >> 1)
6406 case 0x00: str = "Unknown"; break;
6407 case 0x01: str = "ISDN/Telephony Numbering"; break;
6408 case 0x03: str = "Data Numbering (ITU-T Rec. X.121)"; break;
6409 case 0x04: str = "Telex Numbering (ITU-T Rec. F.69)"; break;
6410 case 0x09: str = "Private Numbering"; break;
6411 case 0x0f: str = "Reserved for extension"; break;
6412 default:
6413 str = "Reserved";
6414 break;
6417 other_decode_bitfield_value(a_bigbuf, oct, 0x1e, 8);
6418 proto_tree_add_text(subtree, tvb, curr_offset, 1,
6419 "%s : Number Plan: %s",
6420 a_bigbuf,
6421 str);
6423 if (oct_len > 1)
6425 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
6426 proto_tree_add_text(subtree, tvb, curr_offset, 1,
6427 "%s : MSB of first digit",
6428 a_bigbuf);
6430 curr_offset++;
6432 for (i=0; i < (oct_len - 1); i++)
6434 a_bigbuf[i] = (oct & 0x01) << 7;
6436 oct = tvb_get_guint8(tvb, curr_offset + i);
6438 a_bigbuf[i] |= (oct & 0xfe) >> 1;
6440 a_bigbuf[i] = '\0';
6442 proto_tree_add_text(subtree, tvb, curr_offset, oct_len - 1,
6443 "Digits: %s",
6444 a_bigbuf);
6446 curr_offset += (oct_len - 2);
6449 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
6450 proto_tree_add_text(subtree, tvb, curr_offset, 1,
6451 "%s : Reserved",
6452 a_bigbuf);
6454 curr_offset++;
6455 break;
6457 case ANSI_FWD_MS_INFO_REC_CLG_PN:
6458 value = tvb_get_ntohs(tvb, curr_offset);
6460 oct = (value & 0xff00) >> 8;
6462 switch ((oct & 0xe0) >> 5)
6464 case 0: str = "Unknown"; break;
6465 case 1: str = "International number"; break;
6466 case 2: str = "National number"; break;
6467 case 3: str = "Network-specific number"; break;
6468 case 4: str = "Subscriber number"; break;
6469 case 5: str = "Reserved"; break;
6470 case 6: str = "Abbreviated number"; break;
6471 default:
6472 str = "Reserved for extension";
6473 break;
6476 other_decode_bitfield_value(a_bigbuf, value, 0xe000, 16);
6477 proto_tree_add_text(subtree, tvb, curr_offset, 2,
6478 "%s : Number Type: %s",
6479 a_bigbuf,
6480 str);
6482 switch ((oct & 0x1e) >> 1)
6484 case 0x00: str = "Unknown"; break;
6485 case 0x01: str = "ISDN/Telephony Numbering"; break;
6486 case 0x03: str = "Data Numbering (ITU-T Rec. X.121)"; break;
6487 case 0x04: str = "Telex Numbering (ITU-T Rec. F.69)"; break;
6488 case 0x09: str = "Private Numbering"; break;
6489 case 0x0f: str = "Reserved for extension"; break;
6490 default:
6491 str = "Reserved";
6492 break;
6495 other_decode_bitfield_value(a_bigbuf, value, 0x1e00, 16);
6496 proto_tree_add_text(subtree, tvb, curr_offset, 2,
6497 "%s : Number Plan: %s",
6498 a_bigbuf,
6499 str);
6501 switch ((value & 0x0180) >> 7)
6503 case 0: str = "Presentation allowed"; break;
6504 case 1: str = "Presentation restricted"; break;
6505 case 2: str = "Number not available"; break;
6506 default:
6507 str = "Reserved";
6508 break;
6511 other_decode_bitfield_value(a_bigbuf, value, 0x0180, 16);
6512 proto_tree_add_text(subtree, tvb, curr_offset, 2,
6513 "%s : Presentation Indicator (PI): %s",
6514 a_bigbuf,
6515 str);
6517 switch ((value & 0x0060) >> 5)
6519 case 0: str = "User-provided, not screened"; break;
6520 case 1: str = "User-provided, verified and passed"; break;
6521 case 2: str = "User-provided, verified and failed"; break;
6522 default:
6523 str = "Network-provided";
6524 break;
6527 other_decode_bitfield_value(a_bigbuf, value, 0x0060, 16);
6528 proto_tree_add_text(subtree, tvb, curr_offset, 2,
6529 "%s : Screening Indicator (SI): %s",
6530 a_bigbuf,
6531 str);
6533 if (oct_len > 2)
6535 oct = (value & 0x00ff);
6537 other_decode_bitfield_value(a_bigbuf, value, 0x001f, 16);
6538 proto_tree_add_text(subtree, tvb, curr_offset, 2,
6539 "%s : MSB of first digit",
6540 a_bigbuf);
6542 curr_offset += 2;
6544 for (i=0; i < (oct_len - 2); i++)
6546 a_bigbuf[i] = (oct & 0x1f) << 3;
6548 oct = tvb_get_guint8(tvb, curr_offset + i);
6550 a_bigbuf[i] |= (oct & 0xe0) >> 5;
6552 a_bigbuf[i] = '\0';
6554 proto_tree_add_text(subtree, tvb, curr_offset, oct_len - 2,
6555 "Digits: %s",
6556 a_bigbuf);
6558 curr_offset += (oct_len - 3);
6560 other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
6561 proto_tree_add_text(subtree, tvb, curr_offset, 1,
6562 "%s : Reserved",
6563 a_bigbuf);
6565 curr_offset++;
6567 else
6569 other_decode_bitfield_value(a_bigbuf, value, 0x001f, 16);
6570 proto_tree_add_text(subtree, tvb, curr_offset, 2,
6571 "%s : Reserved",
6572 a_bigbuf);
6574 curr_offset += 2;
6576 break;
6578 case ANSI_FWD_MS_INFO_REC_MW:
6579 oct = tvb_get_guint8(tvb, curr_offset);
6581 proto_tree_add_text(subtree, tvb, curr_offset, 1,
6582 "Number of messages waiting: %u",
6583 oct);
6585 curr_offset++;
6586 break;
6588 case ANSI_FWD_MS_INFO_REC_SIGNAL:
6589 oct = tvb_get_guint8(tvb, curr_offset);
6590 proto_tree_add_item(subtree, hf_ansi_a_ms_info_rec_signal_type, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
6591 proto_tree_add_item(subtree, hf_ansi_a_ms_info_rec_signal_alert_pitch, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
6592 switch (oct & 0xc0) {
6593 case 0x00:
6594 proto_tree_add_item(subtree, hf_ansi_a_ms_info_rec_signal_tone, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
6595 break;
6596 case 0x40:
6597 proto_tree_add_item(subtree, hf_ansi_a_ms_info_rec_signal_isdn_alert, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
6598 break;
6599 case 0x80:
6600 proto_tree_add_item(subtree, hf_ansi_a_ms_info_rec_signal_is54b_alert, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
6601 break;
6602 default:
6603 break;
6605 oct = tvb_get_guint8(tvb, curr_offset + 1);
6606 other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
6607 proto_tree_add_text(subtree, tvb, curr_offset, 1,
6608 "%s: Reserved",
6609 a_bigbuf);
6610 curr_offset += oct_len;
6611 break;
6613 case ANSI_FWD_MS_INFO_REC_CWI:
6614 proto_tree_add_item(subtree, hf_ansi_a_ms_info_rec_call_waiting_ind, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
6615 oct = tvb_get_guint8(tvb, curr_offset);
6616 other_decode_bitfield_value(a_bigbuf, oct, 0x7f, 8);
6617 proto_tree_add_text(subtree, tvb, curr_offset, 1,
6618 "%s: Reserved",
6619 a_bigbuf);
6620 curr_offset += oct_len;
6621 break;
6622 default:
6623 proto_tree_add_text(subtree,
6624 tvb, curr_offset, oct_len,
6625 "Record Content");
6627 curr_offset += oct_len;
6628 break;
6633 g_snprintf(add_string, string_len, " - %u record%s",
6634 num_recs, plurality(num_recs, "", "s"));
6636 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
6638 return(curr_offset - offset);
6642 * IOS 6.2.2.72
6644 static guint8
6645 elem_rev_ms_info_recs(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
6647 guint8 oct;
6648 guint8 oct_len;
6649 guint8 rec_type;
6650 guint8 num_recs;
6651 guint32 value;
6652 guint32 curr_offset, saved_offset;
6653 const gchar *str;
6654 gint ett_elem_idx, idx, i;
6655 proto_tree *subtree, *subtree2;
6656 proto_item *item;
6657 guint8 *poctets;
6659 curr_offset = offset;
6661 num_recs = 0;
6663 while ((len - (curr_offset - offset)) >= 2)
6665 num_recs++;
6667 rec_type = tvb_get_guint8(tvb, curr_offset);
6669 str = try_val_to_str_idx((guint32) rec_type, ansi_rev_ms_info_rec_str, &idx);
6671 if (str == NULL)
6673 str = "Reserved";
6674 ett_elem_idx = ett_ansi_ms_info_rec_reserved;
6676 else
6678 ett_elem_idx = ett_ansi_rev_ms_info_rec[idx];
6681 item =
6682 proto_tree_add_text(tree,
6683 tvb, curr_offset, 1,
6684 "Information Record Type [%u]: (%u) %s",
6685 num_recs,
6686 rec_type,
6687 str);
6689 subtree = proto_item_add_subtree(item, ett_elem_idx);
6691 curr_offset++;
6693 oct_len = tvb_get_guint8(tvb, curr_offset);
6695 proto_tree_add_uint(subtree, hf_ansi_a_length, tvb,
6696 curr_offset, 1, oct_len);
6698 curr_offset++;
6700 if (oct_len > 0)
6702 SHORT_DATA_CHECK(len - (curr_offset - offset), oct_len);
6704 switch (rec_type)
6706 case ANSI_REV_MS_INFO_REC_KEYPAD_FAC:
6707 poctets = tvb_get_string(wmem_packet_scope(), tvb, curr_offset, oct_len);
6709 proto_tree_add_string_format(subtree, hf_ansi_a_cld_party_ascii_num,
6710 tvb, curr_offset, oct_len,
6711 (gchar *) poctets,
6712 "Digits: %s",
6713 (gchar *) format_text(poctets, oct_len));
6715 curr_offset += oct_len;
6716 break;
6718 case ANSI_REV_MS_INFO_REC_CLD_PN:
6719 oct = tvb_get_guint8(tvb, curr_offset);
6721 switch ((oct & 0xe0) >> 5)
6723 case 0: str = "Unknown"; break;
6724 case 1: str = "International number"; break;
6725 case 2: str = "National number"; break;
6726 case 3: str = "Network-specific number"; break;
6727 case 4: str = "Subscriber number"; break;
6728 case 5: str = "Reserved"; break;
6729 case 6: str = "Abbreviated number"; break;
6730 default:
6731 str = "Reserved for extension";
6732 break;
6735 other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
6736 proto_tree_add_text(subtree, tvb, curr_offset, 1,
6737 "%s : Number Type: %s",
6738 a_bigbuf,
6739 str);
6741 switch ((oct & 0x1e) >> 1)
6743 case 0x00: str = "Unknown"; break;
6744 case 0x01: str = "ISDN/Telephony Numbering"; break;
6745 case 0x03: str = "Data Numbering (ITU-T Rec. X.121)"; break;
6746 case 0x04: str = "Telex Numbering (ITU-T Rec. F.69)"; break;
6747 case 0x09: str = "Private Numbering"; break;
6748 case 0x0f: str = "Reserved for extension"; break;
6749 default:
6750 str = "Reserved";
6751 break;
6754 other_decode_bitfield_value(a_bigbuf, oct, 0x1e, 8);
6755 proto_tree_add_text(subtree, tvb, curr_offset, 1,
6756 "%s : Number Plan: %s",
6757 a_bigbuf,
6758 str);
6760 if (oct_len > 1)
6762 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
6763 proto_tree_add_text(subtree, tvb, curr_offset, 1,
6764 "%s : MSB of first digit",
6765 a_bigbuf);
6767 curr_offset++;
6769 for (i=0; i < (oct_len - 1); i++)
6771 a_bigbuf[i] = (oct & 0x01) << 7;
6773 oct = tvb_get_guint8(tvb, curr_offset + i);
6775 a_bigbuf[i] |= (oct & 0xfe) >> 1;
6777 a_bigbuf[i] = '\0';
6779 proto_tree_add_text(subtree, tvb, curr_offset, oct_len - 1,
6780 "Digits: %s",
6781 a_bigbuf);
6783 curr_offset += (oct_len - 2);
6786 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
6787 proto_tree_add_text(subtree, tvb, curr_offset, 1,
6788 "%s : Reserved",
6789 a_bigbuf);
6791 curr_offset++;
6792 break;
6794 case ANSI_REV_MS_INFO_REC_CLG_PN:
6795 value = tvb_get_ntohs(tvb, curr_offset);
6797 oct = (value & 0xff00) >> 8;
6799 switch ((oct & 0xe0) >> 5)
6801 case 0: str = "Unknown"; break;
6802 case 1: str = "International number"; break;
6803 case 2: str = "National number"; break;
6804 case 3: str = "Network-specific number"; break;
6805 case 4: str = "Subscriber number"; break;
6806 case 5: str = "Reserved"; break;
6807 case 6: str = "Abbreviated number"; break;
6808 default:
6809 str = "Reserved for extension";
6810 break;
6813 other_decode_bitfield_value(a_bigbuf, value, 0xe000, 16);
6814 proto_tree_add_text(subtree, tvb, curr_offset, 2,
6815 "%s : Number Type: %s",
6816 a_bigbuf,
6817 str);
6819 switch ((oct & 0x1e) >> 1)
6821 case 0x00: str = "Unknown"; break;
6822 case 0x01: str = "ISDN/Telephony Numbering"; break;
6823 case 0x03: str = "Data Numbering (ITU-T Rec. X.121)"; break;
6824 case 0x04: str = "Telex Numbering (ITU-T Rec. F.69)"; break;
6825 case 0x09: str = "Private Numbering"; break;
6826 case 0x0f: str = "Reserved for extension"; break;
6827 default:
6828 str = "Reserved";
6829 break;
6832 other_decode_bitfield_value(a_bigbuf, value, 0x1e00, 16);
6833 proto_tree_add_text(subtree, tvb, curr_offset, 2,
6834 "%s : Number Plan: %s",
6835 a_bigbuf,
6836 str);
6838 switch ((value & 0x0180) >> 7)
6840 case 0: str = "Presentation allowed"; break;
6841 case 1: str = "Presentation restricted"; break;
6842 case 2: str = "Number not available"; break;
6843 default:
6844 str = "Reserved";
6845 break;
6848 other_decode_bitfield_value(a_bigbuf, value, 0x0180, 16);
6849 proto_tree_add_text(subtree, tvb, curr_offset, 2,
6850 "%s : Presentation Indicator (PI): %s",
6851 a_bigbuf,
6852 str);
6854 switch ((value & 0x0060) >> 5)
6856 case 0: str = "User-provided, not screened"; break;
6857 case 1: str = "User-provided, verified and passed"; break;
6858 case 2: str = "User-provided, verified and failed"; break;
6859 default:
6860 str = "Network-provided";
6861 break;
6864 other_decode_bitfield_value(a_bigbuf, value, 0x0060, 16);
6865 proto_tree_add_text(subtree, tvb, curr_offset, 2,
6866 "%s : Screening Indicator (SI): %s",
6867 a_bigbuf,
6868 str);
6870 if (oct_len > 2)
6872 oct = (value & 0x00ff);
6874 other_decode_bitfield_value(a_bigbuf, value, 0x001f, 16);
6875 proto_tree_add_text(subtree, tvb, curr_offset, 2,
6876 "%s : MSB of first digit",
6877 a_bigbuf);
6879 curr_offset += 2;
6881 for (i=0; i < (oct_len - 2); i++)
6883 a_bigbuf[i] = (oct & 0x1f) << 3;
6885 oct = tvb_get_guint8(tvb, curr_offset + i);
6887 a_bigbuf[i] |= (oct & 0xe0) >> 5;
6889 a_bigbuf[i] = '\0';
6891 proto_tree_add_text(subtree, tvb, curr_offset, oct_len - 2,
6892 "Digits: %s",
6893 a_bigbuf);
6895 curr_offset += (oct_len - 3);
6897 other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
6898 proto_tree_add_text(subtree, tvb, curr_offset, 1,
6899 "%s : Reserved",
6900 a_bigbuf);
6902 curr_offset++;
6904 else
6906 other_decode_bitfield_value(a_bigbuf, value, 0x001f, 16);
6907 proto_tree_add_text(subtree, tvb, curr_offset, 2,
6908 "%s : Reserved",
6909 a_bigbuf);
6911 curr_offset += 2;
6913 break;
6915 case ANSI_REV_MS_INFO_REC_SO_INFO:
6916 i = 0;
6917 saved_offset = curr_offset;
6919 while ((oct_len - (curr_offset - saved_offset)) > 2)
6921 item =
6922 proto_tree_add_text(subtree,
6923 tvb, curr_offset, 3,
6924 "Service Option [%u]",
6925 i + 1);
6927 subtree2 = proto_item_add_subtree(item, ett_so_list);
6929 oct = tvb_get_guint8(tvb, curr_offset);
6931 other_decode_bitfield_value(a_bigbuf, oct, 0xfc, 8);
6932 proto_tree_add_text(subtree2, tvb, curr_offset, 1,
6933 "%s : Reserved",
6934 a_bigbuf);
6936 other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
6937 proto_tree_add_text(subtree2, tvb, curr_offset, 1,
6938 "%s : Forward Support: %s",
6939 a_bigbuf,
6940 (oct & 0x02) ? "TRUE" : "FALSE");
6942 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
6943 proto_tree_add_text(subtree2, tvb, curr_offset, 1,
6944 "%s : Reverse Support: %s",
6945 a_bigbuf,
6946 (oct & 0x01) ? "TRUE" : "FALSE");
6948 curr_offset++;
6950 value = tvb_get_ntohs(tvb, curr_offset);
6952 str = ansi_a_so_int_to_str(value);
6953 proto_tree_add_text(subtree2, tvb, curr_offset, 2,
6954 "Service Option: %s (%u)",
6955 str,
6956 value);
6958 proto_item_append_text(item, " - (%u) %s", value, str);
6960 i++;
6961 curr_offset += 2;
6963 break;
6965 default:
6966 proto_tree_add_text(subtree,
6967 tvb, curr_offset, oct_len,
6968 "Record Content");
6970 curr_offset += oct_len;
6971 break;
6976 g_snprintf(add_string, string_len, " - %u record%s",
6977 num_recs, plurality(num_recs, "", "s"));
6979 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
6981 return(curr_offset - offset);
6985 * IOS 6.2.2.73
6987 static guint8
6988 elem_ext_ho_dir_params(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
6990 guint8 oct;
6991 guint32 value;
6992 guint32 curr_offset;
6993 const gchar *str;
6995 curr_offset = offset;
6997 oct = tvb_get_guint8(tvb, curr_offset);
6999 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
7000 proto_tree_add_text(tree, tvb, curr_offset, 1,
7001 "%s : Search Window A Size (Srch_Win_A): %u",
7002 a_bigbuf,
7003 (oct & 0xf0) >> 4);
7005 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
7006 proto_tree_add_text(tree, tvb, curr_offset, 1,
7007 "%s : Search Window N Size (Srch_Win_N): %u",
7008 a_bigbuf,
7009 oct & 0x0f);
7011 curr_offset++;
7013 NO_MORE_DATA_CHECK(len);
7015 oct = tvb_get_guint8(tvb, curr_offset);
7017 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
7018 proto_tree_add_text(tree, tvb, curr_offset, 1,
7019 "%s : Search Window R Size (Srch_Win_R): %u",
7020 a_bigbuf,
7021 (oct & 0xf0) >> 4);
7023 value = tvb_get_guint8(tvb, curr_offset + 1);
7025 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
7026 proto_tree_add_text(tree, tvb, curr_offset, 1,
7027 "%s : Add Pilot Threshold (T_Add) (MSB): %u",
7028 a_bigbuf,
7029 (oct & 0x0f) << 2 | (value & 0xc0) >> 6);
7031 curr_offset++;
7033 oct = value;
7035 other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
7036 proto_tree_add_text(tree, tvb, curr_offset, 1,
7037 "%s : Add Pilot Threshold (T_Add) (LSB)",
7038 a_bigbuf);
7040 other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
7041 proto_tree_add_text(tree, tvb, curr_offset, 1,
7042 "%s : Drop Pilot Threshold (T_Drop): %u",
7043 a_bigbuf,
7044 oct & 0x3f);
7046 curr_offset++;
7048 NO_MORE_DATA_CHECK(len);
7050 oct = tvb_get_guint8(tvb, curr_offset);
7052 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
7053 proto_tree_add_text(tree, tvb, curr_offset, 1,
7054 "%s : Compare Threshold (T_Comp): %u",
7055 a_bigbuf,
7056 (oct & 0xf0) >> 4);
7058 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
7059 proto_tree_add_text(tree, tvb, curr_offset, 1,
7060 "%s : Drop Timer Value (T_TDrop): %u",
7061 a_bigbuf,
7062 oct & 0x0f);
7064 curr_offset++;
7066 NO_MORE_DATA_CHECK(len);
7068 oct = tvb_get_guint8(tvb, curr_offset);
7070 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
7071 proto_tree_add_text(tree, tvb, curr_offset, 1,
7072 "%s : Neighbor Max Age (Nghbor_Max_AGE): %u",
7073 a_bigbuf,
7074 (oct & 0xf0) >> 4);
7076 switch (global_a_variant)
7078 case A_VARIANT_IOS401:
7079 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
7080 proto_tree_add_text(tree, tvb, curr_offset, 1,
7081 "%s : Reserved",
7082 a_bigbuf);
7083 break;
7085 case A_VARIANT_IOS501:
7086 other_decode_bitfield_value(a_bigbuf, oct, 0x0c, 8);
7087 proto_tree_add_text(tree, tvb, curr_offset, 1,
7088 "%s : Reserved",
7089 a_bigbuf);
7091 switch (oct & 0x03)
7093 case 0: str = "Only Search Window A Size is valid"; break;
7094 case 1: str = "Subset is valid"; break;
7095 case 2: str = "All fields valid"; break;
7096 default:
7097 str = "Reserved";
7098 break;
7101 other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
7102 proto_tree_add_text(tree, tvb, curr_offset, 1,
7103 "%s : Target BS Values Included: %s",
7104 a_bigbuf,
7105 str);
7106 break;
7109 curr_offset++;
7111 NO_MORE_DATA_CHECK(len);
7113 oct = tvb_get_guint8(tvb, curr_offset);
7115 other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
7116 proto_tree_add_text(tree, tvb, curr_offset, 1,
7117 "%s : Reserved",
7118 a_bigbuf);
7120 other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
7121 proto_tree_add_text(tree, tvb, curr_offset, 1,
7122 "%s : SOFT_SLOPE: %u",
7123 a_bigbuf,
7124 oct & 0x3f);
7126 curr_offset++;
7128 NO_MORE_DATA_CHECK(len);
7130 oct = tvb_get_guint8(tvb, curr_offset);
7132 other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
7133 proto_tree_add_text(tree, tvb, curr_offset, 1,
7134 "%s : Reserved",
7135 a_bigbuf);
7137 other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
7138 proto_tree_add_text(tree, tvb, curr_offset, 1,
7139 "%s : ADD_INTERCEPT: %u",
7140 a_bigbuf,
7141 oct & 0x3f);
7143 curr_offset++;
7145 NO_MORE_DATA_CHECK(len);
7147 oct = tvb_get_guint8(tvb, curr_offset);
7149 other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
7150 proto_tree_add_text(tree, tvb, curr_offset, 1,
7151 "%s : Reserved",
7152 a_bigbuf);
7154 other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
7155 proto_tree_add_text(tree, tvb, curr_offset, 1,
7156 "%s : DROP_INTERCEPT: %u",
7157 a_bigbuf,
7158 oct & 0x3f);
7160 curr_offset++;
7162 NO_MORE_DATA_CHECK(len);
7164 oct = tvb_get_guint8(tvb, curr_offset);
7166 proto_tree_add_text(tree, tvb, curr_offset, 1,
7167 "Target BS P_REV: %u",
7168 oct);
7170 curr_offset++;
7172 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
7174 return(curr_offset - offset);
7178 * IOS 6.2.2.74
7179 * UNUSED in SPEC and no IEI!
7183 * IOS 6.2.2.75
7184 * UNUSED in SPEC and no IEI!
7188 * IOS 6.2.2.76
7189 * UNUSED
7193 * IOS 6.2.2.77
7194 * UNUSED in SPEC and no IEI!
7198 * IOS 6.2.2.78
7199 * UNUSED in SPEC and no IEI!
7203 * IOS 6.2.2.79
7205 static guint8
7206 elem_cdma_sowd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
7208 guint8 oct;
7209 guint32 value;
7210 guint32 curr_offset;
7211 const gchar *str = NULL;
7213 curr_offset = offset;
7215 curr_offset += elem_cell_id(tvb, pinfo, tree, offset, len, add_string, string_len);
7216 add_string[0] = '\0';
7218 value = tvb_get_ntohs(tvb, curr_offset);
7220 proto_tree_add_text(tree,
7221 tvb, curr_offset, 2,
7222 "CDMA Serving One Way Delay: %u",
7223 value);
7225 curr_offset += 2;
7227 oct = tvb_get_guint8(tvb, curr_offset);
7229 other_decode_bitfield_value(a_bigbuf, oct, 0xfc, 8);
7230 proto_tree_add_text(tree,
7231 tvb, curr_offset, 1,
7232 "%s : Reserved",
7233 a_bigbuf);
7235 switch (oct & 0x03)
7237 case 0: str = "100 nsec"; break;
7238 case 1: str = "50 nsec"; break;
7239 case 2: str = "1/16 CDMA PN Chip"; break;
7240 case 3: str = "Reserved"; break;
7243 other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
7244 proto_tree_add_text(tree,
7245 tvb, curr_offset, 1,
7246 "%s : Resolution: %s",
7247 a_bigbuf,
7248 str);
7250 curr_offset++;
7252 if ((len - (curr_offset - offset)) > 1)
7254 proto_tree_add_text(tree,
7255 tvb, curr_offset, 2,
7256 "Timestamp");
7258 curr_offset += 2;
7261 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
7263 return(curr_offset - offset);
7267 * IOS 6.2.2.80
7268 * UNUSED
7272 * IOS 6.2.2.81
7273 * UNUSED
7277 * IOS 6.2.2.82
7279 static guint8
7280 elem_re_res(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
7282 guint8 oct;
7283 guint32 curr_offset;
7284 const gchar *str;
7286 curr_offset = offset;
7288 oct = tvb_get_guint8(tvb, curr_offset);
7290 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
7291 proto_tree_add_text(tree,
7292 tvb, curr_offset, 1,
7293 "%s : Reserved",
7294 a_bigbuf);
7296 other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
7297 proto_tree_add_text(tree,
7298 tvb, curr_offset, 1,
7299 "%s : Include Priority: MSC %s include priority in Assignment Request",
7300 a_bigbuf,
7301 (oct & 0x40) ? "should" : "does not need to");
7303 switch ((oct & 0x30) >> 4)
7305 case 0: str = "Not reported"; break;
7306 case 1: str = "radio environment is acceptable"; break;
7307 case 2: str = "radio environment is marginally acceptable"; break;
7308 default:
7309 str = "radio environment is poor";
7310 break;
7313 other_decode_bitfield_value(a_bigbuf, oct, 0x30, 8);
7314 proto_tree_add_text(tree,
7315 tvb, curr_offset, 1,
7316 "%s : Forward: %s",
7317 a_bigbuf,
7318 str);
7320 switch ((oct & 0x0c) >> 2)
7322 case 0: str = "Not reported"; break;
7323 case 1: str = "radio environment is acceptable"; break;
7324 case 2: str = "radio environment is marginally acceptable"; break;
7325 default:
7326 str = "radio environment is poor";
7327 break;
7330 other_decode_bitfield_value(a_bigbuf, oct, 0x0c, 8);
7331 proto_tree_add_text(tree,
7332 tvb, curr_offset, 1,
7333 "%s : Reverse: %s",
7334 a_bigbuf,
7335 str);
7337 other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
7338 proto_tree_add_text(tree,
7339 tvb, curr_offset, 1,
7340 "%s : Alloc: resources are %sallocated",
7341 a_bigbuf,
7342 (oct & 0x02) ? "" : "not ");
7344 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
7345 proto_tree_add_text(tree,
7346 tvb, curr_offset, 1,
7347 "%s : Avail: resources are %savailable",
7348 a_bigbuf,
7349 (oct & 0x01) ? "" : "not ");
7351 curr_offset++;
7353 /* no length check possible */
7355 return(curr_offset - offset);
7359 * IOS 6.2.2.83
7360 * UNUSED in SPEC and no IEI!
7364 * IOS 6.2.2.84
7365 * UNUSED
7369 * IOS 6.2.2.85
7370 * UNUSED
7374 * IOS 6.2.2.86
7375 * UNUSED
7379 * IOS 6.2.2.87
7380 * UNUSED
7384 * IOS 6.2.2.88
7385 * UNUSED
7389 * IOS 6.2.2.89
7390 * A3/A7
7394 * IOS 6.2.2.90
7395 * UNUSED in SPEC and no IEI!
7399 * IOS 6.2.2.91
7400 * A3/A7
7404 * IOS 6.2.2.92
7405 * UNUSED
7409 * IOS 6.2.2.93
7410 * UNUSED
7414 * IOS 6.2.2.94
7415 * UNUSED
7419 * IOS 6.2.2.95
7420 * UNUSED
7424 * IOS 6.2.2.96
7425 * A3/A7
7429 * IOS 6.2.2.97
7430 * A3/A7
7434 * IOS 6.2.2.98
7435 * A3/A7
7439 * IOS 6.2.2.99
7440 * A3/A7
7444 * IOS 6.2.2.100
7445 * UNUSED
7449 * IOS 6.2.2.101
7450 * UNUSED
7454 * IOS 6.2.2.102
7455 * UNUSED
7459 * IOS 6.2.2.103
7460 * UNUSED
7464 * IOS 6.2.2.104
7465 * UNUSED
7469 * IOS 6.2.2.105
7471 static guint8
7472 elem_cld_party_ascii_num(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
7474 guint8 oct;
7475 guint32 curr_offset;
7476 guint8 *poctets;
7477 const gchar *str;
7479 curr_offset = offset;
7481 oct = tvb_get_guint8(tvb, curr_offset);
7483 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
7484 proto_tree_add_text(tree, tvb, curr_offset, 1,
7485 "%s : Extension",
7486 a_bigbuf);
7488 switch ((oct & 0x70) >> 4)
7490 case 0: str = "Unknown"; break;
7491 case 1: str = "International number"; break;
7492 case 2: str = "National number"; break;
7493 case 3: str = "Network specific number"; break;
7494 case 4: str = "Dedicated PAD access, short code"; break;
7495 case 7: str = "Reserved for extension"; break;
7496 default:
7497 str = "Reserved";
7498 break;
7501 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
7502 proto_tree_add_text(tree,
7503 tvb, curr_offset, 1,
7504 "%s : Type of Number: %s",
7505 a_bigbuf,
7506 str);
7508 switch (oct & 0x0f)
7510 case 0x00: str = "Unknown"; break;
7511 case 0x01: str = "ISDN/telephony number plan (ITU recommendation E.164/E.163)"; break;
7512 case 0x03: str = "Data number plan (ITU recommendation X.121)"; break;
7513 case 0x04: str = "Telex numbering plan (ITU recommendation F.69)"; break;
7514 case 0x07: str = "Reserved for extension"; break;
7515 case 0x08: str = "National numbering plan"; break;
7516 case 0x09: str = "Private numbering plan"; break;
7517 default:
7518 str = "Reserved";
7519 break;
7522 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
7523 proto_tree_add_text(tree,
7524 tvb, curr_offset, 1,
7525 "%s : Numbering Plan Identification: %s",
7526 a_bigbuf,
7527 str);
7529 curr_offset++;
7531 poctets = tvb_get_string(wmem_packet_scope(), tvb, curr_offset, len - (curr_offset - offset));
7533 proto_tree_add_string_format(tree, hf_ansi_a_cld_party_ascii_num,
7534 tvb, curr_offset, len - (curr_offset - offset),
7535 (gchar *) poctets,
7536 "Digits: %s",
7537 (gchar *) format_text(poctets, len - (curr_offset - offset)));
7539 curr_offset += len - (curr_offset - offset);
7541 g_snprintf(add_string, string_len, " - (%s)", poctets);
7543 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
7545 return(curr_offset - offset);
7549 * IOS 6.2.2.106
7551 static guint8
7552 elem_band_class(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
7554 guint8 oct;
7555 guint32 curr_offset;
7556 gint temp_int;
7557 const gchar *str;
7559 curr_offset = offset;
7561 oct = tvb_get_guint8(tvb, curr_offset);
7563 other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
7564 proto_tree_add_text(tree,
7565 tvb, curr_offset, 1,
7566 "%s : Reserved",
7567 a_bigbuf);
7569 temp_int = oct & 0x1f;
7570 if ((temp_int < 0) || (temp_int >= (gint) NUM_BAND_CLASS_STR))
7572 str = "Reserved";
7574 else
7576 str = band_class_str[temp_int];
7579 other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
7580 proto_tree_add_text(tree,
7581 tvb, curr_offset, 1,
7582 "%s : Band Class: %s",
7583 a_bigbuf,
7584 str);
7586 curr_offset++;
7588 g_snprintf(add_string, string_len, " - (%s)", str);
7590 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
7592 return(curr_offset - offset);
7596 * IOS 6.2.2.107
7597 * UNUSED
7601 * IOS 6.2.2.108
7602 * A3/A7
7606 * IOS 6.2.2.109
7607 * A3/A7
7611 * IOS 6.2.2.110
7613 static guint8
7614 elem_is2000_cause(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
7616 guint32 curr_offset;
7618 curr_offset = offset;
7620 proto_tree_add_text(tree, tvb, curr_offset, len, "IS-95/IS-2000 Cause Information");
7622 curr_offset += len;
7624 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
7626 return(curr_offset - offset);
7630 * IOS 6.2.2.111
7631 * UNUSED
7635 * IOS 6.2.2.112
7636 * UNUSED
7640 * IOS 6.2.2.113
7641 * UNUSED
7645 * IOS 6.2.2.114
7647 static guint8
7648 elem_auth_event(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
7650 guint8 oct;
7651 guint32 curr_offset;
7652 const gchar *str;
7654 curr_offset = offset;
7656 if (len == 1)
7658 oct = tvb_get_guint8(tvb, curr_offset);
7660 switch (oct)
7662 case 0x01: str = "Event: Authentication parameters were NOT received from mobile"; break;
7663 case 0x02: str = "Event: RANDC mis-match"; break;
7664 case 0x03: str = "Event: Recently requested"; break;
7665 case 0x04: str = "Event: Direct channel assignment"; break;
7666 default:
7667 str = "Event";
7668 break;
7671 proto_tree_add_text(tree, tvb, curr_offset, len,
7672 "%s", str);
7674 else
7676 proto_tree_add_text(tree, tvb, curr_offset, len, "Event");
7679 curr_offset += len;
7681 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
7683 return(curr_offset - offset);
7687 * IOS 6.2.2.115
7688 * UNUSED
7692 * IOS 6.2.2.116
7693 * UNUSED
7697 * IOS 6.2.2.117
7698 * UNUSED
7702 * IOS 6.2.2.118
7703 * UNUSED
7707 * IOS 6.2.2.119
7708 * A3/A7
7712 * IOS 6.2.2.120
7713 * A3/A7
7717 * IOS 6.2.2.121
7718 * A3/A7
7722 * IOS 6.2.2.122
7723 * UNUSED
7727 * IOS 6.2.2.123
7728 * UNUSED
7732 * IOS 6.2.2.124
7733 * UNUSED
7737 * IOS 6.2.2.125
7738 * A3/A7
7742 * IOS 6.2.2.126
7743 * UNUSED
7747 * IOS 6.2.2.127
7748 * UNUSED
7752 * IOS 6.2.2.128
7753 * A3/A7
7757 * IOS 6.2.2.129
7758 * UNUSED
7762 * IOS 6.2.2.130
7763 * UNUSED
7767 * IOS 6.2.2.131
7768 * UNUSED
7772 * IOS 6.2.2.132
7773 * A3/A7
7777 * IOS 6.2.2.133
7778 * UNUSED
7782 * IOS 6.2.2.134
7783 * A3/A7
7787 * IOS 6.2.2.135
7788 * UNUSED
7792 * IOS 6.2.2.136
7793 * UNUSED
7797 * IOS 6.2.2.137
7798 * Generic decode is good enough
7802 * IOS 6.2.2.138
7804 static guint8
7805 elem_psmm_count(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
7807 guint8 oct;
7808 guint32 curr_offset;
7810 curr_offset = offset;
7812 oct = tvb_get_guint8(tvb, curr_offset);
7814 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
7815 proto_tree_add_text(tree,
7816 tvb, curr_offset, 1,
7817 "%s : Reserved",
7818 a_bigbuf);
7820 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
7821 proto_tree_add_text(tree,
7822 tvb, curr_offset, 1,
7823 "%s : PSMM Count: %u",
7824 a_bigbuf,
7825 oct & 0x0f);
7827 curr_offset++;
7829 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
7831 return(curr_offset - offset);
7835 * IOS 6.2.2.139
7837 static guint8
7838 elem_geo_loc(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
7840 guint32 curr_offset;
7842 curr_offset = offset;
7844 proto_tree_add_text(tree, tvb, curr_offset, len, "Calling Geodetic Location");
7846 curr_offset += len;
7848 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
7850 return(curr_offset - offset);
7854 * IOS 6.2.2.140
7855 * UNUSED
7859 * IOS 6.2.2.141
7860 * A3/A7
7864 * IOS 6.2.2.142
7865 * A3/A7
7869 * IOS 6.2.2.143
7870 * A3/A7
7874 * IOS 6.2.2.144
7875 * A3/A7
7879 * IOS 6.2.2.145
7880 * A3/A7
7884 * IOS 6.2.2.146
7885 * A3/A7
7889 * IOS 6.2.2.147
7890 * A3/A7
7894 * IOS 6.2.2.148
7896 static guint8
7897 elem_cct_group(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
7899 guint8 oct;
7900 guint32 value;
7901 guint32 curr_offset;
7903 curr_offset = offset;
7905 oct = tvb_get_guint8(tvb, curr_offset);
7907 other_decode_bitfield_value(a_bigbuf, oct, 0xfc, 8);
7908 proto_tree_add_text(tree,
7909 tvb, curr_offset, 1,
7910 "%s : Reserved",
7911 a_bigbuf);
7913 other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
7914 proto_tree_add_text(tree,
7915 tvb, curr_offset, 1,
7916 "%s : All Circuits",
7917 a_bigbuf);
7919 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
7920 proto_tree_add_text(tree,
7921 tvb, curr_offset, 1,
7922 "%s : Inclusive",
7923 a_bigbuf);
7925 curr_offset++;
7927 NO_MORE_DATA_CHECK(len);
7929 oct = tvb_get_guint8(tvb, curr_offset);
7931 proto_tree_add_text(tree,
7932 tvb, curr_offset, 1,
7933 "Count: %u circuit%s",
7934 oct, plurality(oct, "", "s"));
7936 g_snprintf(add_string, string_len, " - %u circuit%s",
7937 oct, plurality(oct, "", "s"));
7939 curr_offset++;
7941 value = tvb_get_ntohs(tvb, curr_offset);
7943 other_decode_bitfield_value(a_bigbuf, value, 0xffe0, 16);
7944 proto_tree_add_text(tree,
7945 tvb, curr_offset, 2,
7946 "%s : PCM Multiplexer: %u",
7947 a_bigbuf,
7948 (value & 0xffe0) >> 5);
7950 other_decode_bitfield_value(a_bigbuf, value, 0x001f, 16);
7951 proto_tree_add_text(tree,
7952 tvb, curr_offset, 2,
7953 "%s : Timeslot: %u",
7954 a_bigbuf,
7955 value & 0x001f);
7957 curr_offset += 2;
7959 NO_MORE_DATA_CHECK(len);
7961 proto_tree_add_text(tree,
7962 tvb, curr_offset, len - (curr_offset - offset),
7963 "Circuit Bitmap");
7965 curr_offset += len - (curr_offset - offset);
7967 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
7969 return(curr_offset - offset);
7973 * IOS 6.2.2.149
7975 static guint8
7976 elem_paca_ts(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
7978 guint32 curr_offset;
7980 curr_offset = offset;
7982 proto_tree_add_text(tree, tvb, curr_offset, len, "PACA Queuing Time");
7984 curr_offset += len;
7986 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
7988 return(curr_offset - offset);
7992 * IOS 6.2.2.150
7994 static guint8
7995 elem_paca_order(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
7997 guint8 oct;
7998 guint32 curr_offset;
7999 const gchar *str;
8001 curr_offset = offset;
8003 oct = tvb_get_guint8(tvb, curr_offset);
8005 other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
8006 proto_tree_add_text(tree,
8007 tvb, curr_offset, 1,
8008 "%s : Reserved",
8009 a_bigbuf);
8011 switch (oct & 0x07)
8013 case 0: str = "Reserved"; break;
8014 case 1: str = "Update Queue Position and notify MS"; break;
8015 case 2: str = "Remove MS from the queue and release MS"; break;
8016 case 3: str = "Remove MS from the queue"; break;
8017 case 4: str = "MS Requested PACA Cancel"; break;
8018 case 5: str = "BS Requested PACA Cancel"; break;
8019 default:
8020 str = "Reserved";
8021 break;
8024 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
8025 proto_tree_add_text(tree,
8026 tvb, curr_offset, 1,
8027 "%s : PACA Action Required: %s",
8028 a_bigbuf,
8029 str);
8031 curr_offset++;
8033 g_snprintf(add_string, string_len, " - (%s)", str);
8035 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
8037 return(curr_offset - offset);
8041 * IOS 6.2.2.151
8043 static guint8
8044 elem_paca_reoi(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
8046 guint8 oct;
8047 guint32 curr_offset;
8049 curr_offset = offset;
8051 oct = tvb_get_guint8(tvb, curr_offset);
8053 other_decode_bitfield_value(a_bigbuf, oct, 0xfe, 8);
8054 proto_tree_add_text(tree,
8055 tvb, curr_offset, 1,
8056 "%s : Reserved",
8057 a_bigbuf);
8059 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
8060 proto_tree_add_text(tree,
8061 tvb, curr_offset, 1,
8062 "%s : PACA Reorigination Indicator (PRI)",
8063 a_bigbuf);
8065 curr_offset++;
8067 g_snprintf(add_string, string_len, " - (%sReorigination)", (oct & 0x01) ? "" : "Not ");
8069 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
8071 return(curr_offset - offset);
8075 * IOS 5 4.2.89
8077 static guint8
8078 elem_a2p_bearer_session(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
8080 guint8 oct;
8081 guint32 curr_offset;
8083 curr_offset = offset;
8085 oct = tvb_get_guint8(tvb, curr_offset);
8087 other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
8088 proto_tree_add_text(tree,
8089 tvb, curr_offset, 1,
8090 "%s : Reserved",
8091 a_bigbuf);
8093 other_decode_bitfield_value(a_bigbuf, oct, 0x38, 8);
8094 proto_tree_add_text(tree,
8095 tvb, curr_offset, 1,
8096 "%s : Max Frames: %u",
8097 a_bigbuf,
8098 (oct & 0x38) >> 3);
8100 other_decode_bitfield_value(a_bigbuf, oct, 0x06, 8);
8101 proto_tree_add_text(tree,
8102 tvb, curr_offset, 1,
8103 "%s : Session IP Address Type: Internet Protocol IPv%s",
8104 a_bigbuf,
8105 ((oct & 0x06) >> 1) ? "6" : "4");
8107 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
8108 proto_tree_add_text(tree,
8109 tvb, curr_offset, 1,
8110 "%s : Session Address Flag",
8111 a_bigbuf);
8113 curr_offset++;
8115 if (oct & 0x01)
8117 /* session address included */
8119 if ((oct & 0x06) >> 1)
8121 SHORT_DATA_CHECK(len - (curr_offset - offset), 18);
8123 proto_tree_add_item(tree, hf_ansi_a_a2p_bearer_ipv6_addr,
8124 tvb, curr_offset, 16, ENC_NA);
8126 rtp_src_addr.type = AT_IPv6;
8127 rtp_src_addr.len = 16;
8128 rtp_src_addr.data = (guint8 *) &rtp_ipv6_addr;
8130 tvb_get_ipv6(tvb, curr_offset, &rtp_ipv6_addr);
8132 curr_offset += 16;
8134 else
8136 SHORT_DATA_CHECK(len - (curr_offset - offset), 6);
8138 proto_tree_add_item(tree, hf_ansi_a_a2p_bearer_ipv4_addr,
8139 tvb, curr_offset, 4, ENC_BIG_ENDIAN);
8141 rtp_src_addr.type = AT_IPv4;
8142 rtp_src_addr.len = 4;
8143 rtp_src_addr.data = (guint8 *) &rtp_ipv4_addr;
8145 rtp_ipv4_addr = tvb_get_ipv4(tvb, curr_offset);
8147 curr_offset += 4;
8150 proto_tree_add_item(tree, hf_ansi_a_a2p_bearer_udp_port,
8151 tvb, curr_offset, 2, ENC_BIG_ENDIAN);
8153 rtp_port = tvb_get_ntohs(tvb, curr_offset);
8155 curr_offset += 2;
8158 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
8160 return(curr_offset - offset);
8164 * IOS 5 4.2.90
8166 static guint8
8167 elem_a2p_bearer_format(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
8169 guint8 oct;
8170 proto_item *item;
8171 proto_tree *subtree;
8172 guint8 num_bearers;
8173 guint32 curr_offset, orig_offset;
8174 guint8 ip_addr_type;
8175 gboolean ext;
8176 guint8 ext_len;
8177 const gchar *str;
8178 const gchar *mime_type;
8179 int sample_rate;
8180 gboolean format_assigned;
8181 gboolean in_band_format_assigned;
8182 gboolean first_assigned_found;
8183 gboolean rtp_dyn_payload_used;
8184 guint8 rtp_payload_type;
8185 GHashTable *rtp_dyn_payload;
8186 gint *key;
8187 encoding_name_and_rate_t *encoding_name_and_rate;
8189 rtp_dyn_payload = g_hash_table_new(g_int_hash, g_int_equal);
8190 rtp_dyn_payload_used = FALSE;
8192 first_assigned_found = FALSE;
8194 curr_offset = offset;
8196 oct = tvb_get_guint8(tvb, curr_offset);
8198 other_decode_bitfield_value(a_bigbuf, oct, 0xfc, 8);
8199 proto_tree_add_text(tree,
8200 tvb, curr_offset, 1,
8201 "%s : Number of Bearer Formats: %u",
8202 a_bigbuf,
8203 (oct & 0xfc) >> 2);
8205 other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
8206 proto_tree_add_text(tree,
8207 tvb, curr_offset, 1,
8208 "%s : Session IP Address Type: Internet Protocol IPv%s",
8209 a_bigbuf,
8210 (oct & 0x03) ? "6" : "4");
8212 ip_addr_type = (oct & 0x03);
8214 curr_offset++;
8216 num_bearers = 0;
8218 while ((len - (curr_offset - offset)) > 0)
8220 orig_offset = curr_offset;
8222 item =
8223 proto_tree_add_text(tree,
8224 tvb, curr_offset, -1,
8225 "Bearer Format [%u]",
8226 num_bearers + 1);
8228 subtree = proto_item_add_subtree(item, ett_bearer_list);
8230 oct = tvb_get_guint8(tvb, curr_offset);
8232 proto_tree_add_text(subtree, tvb, curr_offset, 1,
8233 "Bearer Format Length: %u",
8234 oct);
8236 curr_offset++;
8238 NO_MORE_DATA_CHECK(len);
8240 oct = tvb_get_guint8(tvb, curr_offset);
8242 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
8243 proto_tree_add_text(subtree, tvb, curr_offset, 1,
8244 "%s : Extension",
8245 a_bigbuf);
8247 ext = (oct & 0x80) ? TRUE : FALSE;
8249 format_assigned = FALSE;
8250 in_band_format_assigned = FALSE;
8252 switch ((oct & 0x70) >> 4)
8254 case 0: str = "Unknown"; break;
8255 case 1:
8256 str = "In-band signaling";
8257 in_band_format_assigned = TRUE;
8258 break;
8259 case 2:
8260 str = "Assigned";
8261 format_assigned = TRUE;
8262 break;
8263 case 3: str = "Unassigned"; break;
8264 case 4: str = "Transcoded"; break;
8265 default:
8266 str = "Reserved";
8267 break;
8270 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
8271 proto_tree_add_text(subtree, tvb, curr_offset, 1,
8272 "%s : Bearer Format Tag Type: %s",
8273 a_bigbuf,
8274 str);
8277 * assuming default sampling rate of 8000Hz
8279 sample_rate = 8000;
8281 switch (oct & 0x0f)
8283 case 0: mime_type = str = "PCMU"; break;
8284 case 1: mime_type = str = "PCMA"; break;
8285 case 2:
8286 str = "13K Vocoder";
8287 mime_type = "QCELP";
8288 break;
8289 case 3: mime_type = str = "EVRC"; break;
8290 case 4: mime_type = str = "EVRC0"; break;
8291 case 5: mime_type = str = "SMV"; break;
8292 case 6: mime_type = str = "SMV0"; break;
8293 case 7: mime_type = str = "telephone-event"; break;
8294 case 8: mime_type = str = "EVRCB"; break;
8295 case 9: mime_type = str = "EVRCB0"; break;
8296 case 10: mime_type = str = "EVRCWB"; sample_rate = 16000; break;
8297 case 11: mime_type = str = "EVRCWB0"; sample_rate = 16000; break;
8298 case 12: mime_type = str = "EVRCNW"; sample_rate = 16000; break;
8299 case 13: mime_type = str = "EVRCNW0"; sample_rate = 16000; break;
8300 default:
8301 mime_type = str = "Reserved";
8302 break;
8305 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
8306 proto_tree_add_text(subtree, tvb, curr_offset, 1,
8307 "%s : Bearer Format ID: %s",
8308 a_bigbuf,
8309 str);
8311 proto_item_append_text(item, " - (%s)", str);
8313 curr_offset++;
8315 NO_MORE_DATA_CHECK(len);
8317 oct = tvb_get_guint8(tvb, curr_offset);
8319 rtp_payload_type = (oct & 0xfe) >> 1;
8321 other_decode_bitfield_value(a_bigbuf, oct, 0xfe, 8);
8322 proto_tree_add_text(subtree, tvb, curr_offset, 1,
8323 "%s : RTP Payload Type: %u",
8324 a_bigbuf,
8325 rtp_payload_type);
8327 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
8328 proto_tree_add_text(subtree, tvb, curr_offset, 1,
8329 "%s : Bearer Address Flag",
8330 a_bigbuf);
8332 curr_offset++;
8334 if (oct & 0x01)
8336 /* bearer address included */
8338 if (ip_addr_type != 0)
8340 SHORT_DATA_CHECK(len - (curr_offset - offset), 18);
8342 proto_tree_add_item(subtree, hf_ansi_a_a2p_bearer_ipv6_addr,
8343 tvb, curr_offset, 16, ENC_NA);
8345 if (format_assigned)
8347 rtp_src_addr.type = AT_IPv6;
8348 rtp_src_addr.len = 16;
8349 rtp_src_addr.data = (guint8 *) &rtp_ipv6_addr;
8351 tvb_get_ipv6(tvb, curr_offset, &rtp_ipv6_addr);
8354 curr_offset += 16;
8356 else
8358 SHORT_DATA_CHECK(len - (curr_offset - offset), 6);
8360 proto_tree_add_item(subtree, hf_ansi_a_a2p_bearer_ipv4_addr,
8361 tvb, curr_offset, 4, ENC_BIG_ENDIAN);
8363 if (format_assigned)
8365 rtp_src_addr.type = AT_IPv4;
8366 rtp_src_addr.len = 4;
8367 rtp_src_addr.data = (guint8 *) &rtp_ipv4_addr;
8369 rtp_ipv4_addr = tvb_get_ipv4(tvb, curr_offset);
8372 curr_offset += 4;
8375 proto_tree_add_item(subtree, hf_ansi_a_a2p_bearer_udp_port,
8376 tvb, curr_offset, 2, ENC_BIG_ENDIAN);
8378 if (format_assigned)
8380 rtp_port = tvb_get_ntohs(tvb, curr_offset);
8383 curr_offset += 2;
8386 if (ext)
8388 SHORT_DATA_CHECK(len - (curr_offset - offset), 1);
8390 oct = tvb_get_guint8(tvb, curr_offset);
8392 ext_len = (oct & 0xf0) >> 4;
8394 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
8395 proto_tree_add_text(subtree, tvb, curr_offset, 1,
8396 "%s : Extension Length: %u",
8397 a_bigbuf,
8398 ext_len);
8400 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
8401 proto_tree_add_text(subtree, tvb, curr_offset, 1,
8402 "%s : Extension ID: %u",
8403 a_bigbuf,
8404 (oct & 0x0f));
8406 curr_offset++;
8408 if (ext_len > 0)
8410 SHORT_DATA_CHECK(len - (curr_offset - offset), ext_len);
8412 proto_tree_add_text(subtree, tvb, curr_offset, ext_len,
8413 "Extension Parameter value");
8415 curr_offset += ext_len;
8419 proto_item_set_len(item, curr_offset - orig_offset);
8421 if (format_assigned &&
8422 (first_assigned_found == FALSE))
8424 key = wmem_new(wmem_file_scope(), gint);
8425 *key = rtp_payload_type;
8427 encoding_name_and_rate = wmem_new(wmem_file_scope(), encoding_name_and_rate_t);
8428 encoding_name_and_rate->encoding_name = wmem_strdup(wmem_file_scope(), mime_type);
8429 encoding_name_and_rate->sample_rate = sample_rate;
8431 g_hash_table_insert(rtp_dyn_payload, key, encoding_name_and_rate);
8432 rtp_dyn_payload_used = TRUE;
8434 first_assigned_found = TRUE;
8435 rtp_add_address(pinfo, &rtp_src_addr, rtp_port, 0, "IOS5",
8436 pinfo->fd->num, FALSE, rtp_dyn_payload);
8439 if (in_band_format_assigned)
8441 key = (gint *) wmem_alloc(wmem_file_scope(), sizeof(gint));
8442 *key = rtp_payload_type;
8444 encoding_name_and_rate = wmem_new(wmem_file_scope(), encoding_name_and_rate_t);
8445 encoding_name_and_rate->encoding_name = wmem_strdup(wmem_file_scope(), "telephone-event");
8446 encoding_name_and_rate->sample_rate = sample_rate;
8448 g_hash_table_insert(rtp_dyn_payload, key, encoding_name_and_rate);
8449 rtp_dyn_payload_used = TRUE;
8452 num_bearers++;
8455 if (rtp_dyn_payload_used == FALSE)
8457 rtp_free_hash_dyn_payload(rtp_dyn_payload);
8460 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
8462 return(curr_offset - offset);
8466 * IOS 5 4.2.88
8468 static guint8
8469 elem_ms_des_freq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
8471 guint8 oct;
8472 guint32 value;
8473 gint temp_int;
8474 guint32 curr_offset;
8475 const gchar *str;
8477 curr_offset = offset;
8479 oct = tvb_get_guint8(tvb, curr_offset);
8481 temp_int = (oct & 0xf8) >> 3;
8482 if ((temp_int < 0) || (temp_int >= (gint) NUM_BAND_CLASS_STR))
8484 str = "Reserved";
8486 else
8488 str = band_class_str[temp_int];
8491 other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
8492 proto_tree_add_text(tree,
8493 tvb, curr_offset, 1,
8494 "%s : Band Class: %s",
8495 a_bigbuf,
8496 str);
8498 value = tvb_get_guint8(tvb, curr_offset + 1) | ((oct & 0x07) << 8);
8500 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
8501 proto_tree_add_text(tree, tvb, curr_offset, 1,
8502 "%s : CDMA Channel (MSB): %u",
8503 a_bigbuf,
8504 value);
8506 curr_offset++;
8508 other_decode_bitfield_value(a_bigbuf, value & 0x00ff, 0xff, 8);
8509 proto_tree_add_text(tree, tvb, curr_offset, 1,
8510 "%s : CDMA Channel (LSB)",
8511 a_bigbuf);
8513 g_snprintf(add_string, string_len, " - (CDMA Channel: %u)", value);
8515 curr_offset++;
8517 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
8519 return(curr_offset - offset);
8523 * IOS 5 4.2.87
8525 static guint8
8526 elem_plcm_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
8528 guint8 oct;
8529 guint32 curr_offset;
8530 const gchar *str;
8532 curr_offset = offset;
8534 oct = tvb_get_guint8(tvb, curr_offset);
8537 * from C.S0005-D v1.0 L3 Table 3.7.2.3.2.21-5
8539 switch ((oct & 0xf0) >> 4)
8541 case 0x00: str = "PLCM derived from ESN or MEID"; break;
8542 case 0x01: str = "PLCM specified by the base station"; break;
8543 case 0x02: str = "PLCM derived from IMSI_O_S when IMSI_O is derived from IMSI_M"; break;
8544 case 0x03: str = "PLCM derived from IMSI_O_S when IMSI_O is derived from IMSI_T"; break;
8545 default:
8546 str = "Reserved";
8547 break;
8550 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
8551 proto_tree_add_text(tree,
8552 tvb, curr_offset, 1,
8553 "%s : PLCM_TYPE: %s",
8554 a_bigbuf,
8555 str);
8557 other_decode_bitfield_value(a_bigbuf, oct, 0x0c, 8);
8558 proto_tree_add_text(tree,
8559 tvb, curr_offset, 1,
8560 "%s : Reserved",
8561 a_bigbuf);
8563 other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
8564 proto_tree_add_text(tree, tvb, curr_offset, 1,
8565 "%s : PLCM_42 (MSB)",
8566 a_bigbuf);
8568 curr_offset++;
8570 proto_tree_add_text(tree, tvb, curr_offset, 5, "PLCM_42");
8572 curr_offset += 5;
8574 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
8576 return(curr_offset - offset);
8580 * IOS 6.2.2.152
8581 * A3/A7
8585 * IOS 6.2.2.153
8586 * A3/A7
8590 * ORDER MUST BE MAINTAINED
8592 * The value of this enum is used as an index into
8593 * elem_1_fcn[]
8596 typedef enum
8598 ANSI_A_E_ACC_NET_ID, /* Access Network Identifiers */
8599 ANSI_A_E_ADDS_USER_PART, /* ADDS User Part */
8600 ANSI_A_E_AMPS_HHO_PARAM, /* AMPS Hard Handoff Parameters */
8601 ANSI_A_E_ANCH_PDSN_ADDR, /* Anchor PDSN Address */
8602 ANSI_A_E_ANCH_PP_ADDR, /* Anchor P-P Address */
8603 ANSI_A_E_AUTH_CHLG_PARAM, /* Authentication Challenge Parameter */
8604 ANSI_A_E_AUTH_CNF_PARAM, /* Authentication Confirmation Parameter (RANDC) */
8605 ANSI_A_E_AUTH_DATA, /* Authentication Data */
8606 ANSI_A_E_AUTH_EVENT, /* Authentication Event */
8607 ANSI_A_E_AUTH_PARAM_COUNT, /* Authentication Parameter COUNT */
8608 ANSI_A_E_AUTH_RESP_PARAM, /* Authentication Response Parameter */
8609 ANSI_A_E_BAND_CLASS, /* Band Class */
8610 ANSI_A_E_CLD_PARTY_ASCII_NUM, /* Called Party ASCII Number */
8611 ANSI_A_E_CLD_PARTY_BCD_NUM, /* Called Party BCD Number */
8612 ANSI_A_E_CLG_PARTY_ASCII_NUM, /* Calling Party ASCII Number */
8613 ANSI_A_E_CAUSE, /* Cause */
8614 ANSI_A_E_CAUSE_L3, /* Cause Layer 3 */
8615 ANSI_A_E_CDMA_SOWD, /* CDMA Serving One Way Delay */
8616 ANSI_A_E_CELL_ID, /* Cell Identifier */
8617 ANSI_A_E_CELL_ID_LIST, /* Cell Identifier List */
8618 ANSI_A_E_CHAN_NUM, /* Channel Number */
8619 ANSI_A_E_CHAN_TYPE, /* Channel Type */
8620 ANSI_A_E_CCT_GROUP, /* Circuit Group */
8621 ANSI_A_E_CIC, /* Circuit Identity Code */
8622 ANSI_A_E_CIC_EXT, /* Circuit Identity Code Extension */
8623 ANSI_A_E_CM_INFO_TYPE_2, /* Classmark Information Type 2 */
8624 ANSI_A_E_DOWNLINK_RE, /* Downlink Radio Environment */
8625 ANSI_A_E_DOWNLINK_RE_LIST, /* Downlink Radio Environment List */
8626 ANSI_A_E_ENC_INFO, /* Encryption Information */
8627 ANSI_A_E_EXT_HO_DIR_PARAMS, /* Extended Handoff Direction Parameters */
8628 ANSI_A_E_GEO_LOC, /* Geographic Location */
8629 ANSI_A_E_SSCI, /* Special Service Call Indicator */
8630 ANSI_A_E_HO_POW_LEV, /* Handoff Power Level */
8631 ANSI_A_E_HHO_PARAMS, /* Hard Handoff Parameters */
8632 ANSI_A_E_IE_REQD, /* Information Element Requested */
8633 ANSI_A_E_IS2000_CHAN_ID, /* IS-2000 Channel Identity */
8634 ANSI_A_E_IS2000_CHAN_ID_3X, /* IS-2000 Channel Identity 3X */
8635 ANSI_A_E_IS2000_MOB_CAP, /* IS-2000 Mobile Capabilities */
8636 ANSI_A_E_IS2000_NN_SCR, /* IS-2000 Non-Negotiable Service Configuration Record */
8637 ANSI_A_E_IS2000_SCR, /* IS-2000 Service Configuration Record */
8638 ANSI_A_E_IS2000_CAUSE, /* IS-95/IS-2000 Cause Value */
8639 ANSI_A_E_IS2000_RED_RECORD, /* IS-2000 Redirection Record */
8640 ANSI_A_E_IS95_CHAN_ID, /* IS-95 Channel Identity */
8641 ANSI_A_E_IS95_MS_MEAS_CHAN_ID, /* IS-95 MS Measured Channel Identity */
8642 ANSI_A_E_L3_INFO, /* Layer 3 Information */
8643 ANSI_A_E_LAI, /* Location Area Information */
8644 ANSI_A_E_MWI, /* Message Waiting Indication */
8645 ANSI_A_E_MID, /* Mobile Identity */
8646 ANSI_A_E_FWD_MS_INFO_RECS, /* (Forward) MS Information Records */
8647 ANSI_A_E_ORIG_CI, /* Origination Continuation Indicator */
8648 ANSI_A_E_PACA_ORDER, /* PACA Order */
8649 ANSI_A_E_PACA_REOI, /* PACA Reorigination Indicator */
8650 ANSI_A_E_PACA_TS, /* PACA Timestamp */
8651 ANSI_A_E_PSP, /* Packet Session Parameters */
8652 ANSI_A_E_PDSN_IP_ADDR, /* PDSN IP Address */
8653 ANSI_A_E_PDI, /* Power Down Indicator */
8654 ANSI_A_E_PRIO, /* Priority */
8655 ANSI_A_E_P_REV, /* Protocol Revision */
8656 ANSI_A_E_PTYPE, /* Protocol Type */
8657 ANSI_A_E_PSMM_COUNT, /* PSMM Count */
8658 ANSI_A_E_QOS_PARAMS, /* Quality of Service Parameters */
8659 ANSI_A_E_RE_RES, /* Radio Environment and Resources */
8660 ANSI_A_E_REG_TYPE, /* Registration Type */
8661 ANSI_A_E_REJ_CAUSE, /* Reject Cause */
8662 ANSI_A_E_RESP_REQ, /* Response Request */
8663 ANSI_A_E_RETURN_CAUSE, /* Return Cause */
8664 ANSI_A_E_RF_CHAN_ID, /* RF Channel Identity */
8665 ANSI_A_E_SO, /* Service Option */
8666 ANSI_A_E_SOCI, /* Service Option Connection Identifier (SOCI) */
8667 ANSI_A_E_SO_LIST, /* Service Option List */
8668 ANSI_A_E_S_RED_INFO, /* Service Redirection Info */
8669 ANSI_A_E_SR_ID, /* Service Reference Identifier (SR_ID) */
8670 ANSI_A_E_SID, /* SID */
8671 ANSI_A_E_SIGNAL, /* Signal */
8672 ANSI_A_E_SCI, /* Slot Cycle Index */
8673 ANSI_A_E_SW_VER, /* Software Version */
8674 ANSI_A_E_SRNC_TRNC_TC, /* Source RNC to Target RNC Transparent Container */
8675 ANSI_A_E_S_PDSN_ADDR, /* Source PDSN Address */
8676 ANSI_A_E_TAG, /* Tag */
8677 ANSI_A_E_TRNC_SRNC_TC, /* Target RNC to Source RNC Transparent Container */
8678 ANSI_A_E_XMODE, /* Transcoder Mode */
8679 ANSI_A_E_UZ_ID, /* User Zone ID */
8680 ANSI_A_E_VP_REQ, /* Voice Privacy Request */
8681 ANSI_A_E_A2P_BEARER_SESSION, /* A2p Bearer Session-Level Parameters */
8682 ANSI_A_E_A2P_BEARER_FORMAT, /* A2p Bearer Format-Specific Parameters */
8683 ANSI_A_E_MS_DES_FREQ, /* MS Designated Frequency */
8684 ANSI_A_E_MOB_SUB_INFO, /* Mobile Subscription Information */
8685 ANSI_A_E_PLCM_ID, /* Public Long Code Mask Identifier */
8686 ANSI_A_E_REV_MS_INFO_RECS, /* (Reverse) MS Information Records */
8687 ANSI_A_E_NONE /* NONE */
8689 elem_idx_t;
8690 static elem_idx_t ansi_a_elem_1_max = (elem_idx_t)0;
8692 #define MAX_IOS401_NUM_ELEM_1 (sizeof(ansi_a_ios401_elem_1_strings)/sizeof(ext_value_string_t))
8693 #define MAX_IOS501_NUM_ELEM_1 (sizeof(ansi_a_ios501_elem_1_strings)/sizeof(ext_value_string_t))
8694 static gint ett_ansi_elem_1[MAX(MAX_IOS401_NUM_ELEM_1, MAX_IOS501_NUM_ELEM_1)];
8695 static guint8 (*elem_1_fcn[])(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len) =
8697 elem_acc_net_id, /* Access Network Identifiers */
8698 elem_adds_user_part, /* ADDS User Part */
8699 elem_amps_hho_param, /* AMPS Hard Handoff Parameters */
8700 elem_anchor_pdsn_addr, /* Anchor PDSN Address */
8701 elem_anchor_pp_addr, /* Anchor P-P Address */
8702 elem_auth_chlg_param, /* Authentication Challenge Parameter */
8703 NULL /* no decode required */, /* Authentication Confirmation Parameter (RANDC) */
8704 NULL /* no decode required */, /* Authentication Data */
8705 elem_auth_event, /* Authentication Event */
8706 elem_auth_param_count, /* Authentication Parameter COUNT */
8707 elem_auth_resp_param, /* Authentication Response Parameter */
8708 elem_band_class, /* Band Class */
8709 elem_cld_party_ascii_num, /* Called Party ASCII Number */
8710 elem_cld_party_bcd_num, /* Called Party BCD Number */
8711 elem_clg_party_ascii_num, /* Calling Party ASCII Number */
8712 elem_cause, /* Cause */
8713 elem_cause_l3, /* Cause Layer 3 */
8714 elem_cdma_sowd, /* CDMA Serving One Way Delay */
8715 elem_cell_id, /* Cell Identifier */
8716 elem_cell_id_list, /* Cell Identifier List */
8717 elem_chan_num, /* Channel Number */
8718 elem_chan_type, /* Channel Type */
8719 elem_cct_group, /* Circuit Group */
8720 elem_cic, /* Circuit Identity Code */
8721 elem_cic_ext, /* Circuit Identity Code Extension */
8722 elem_cm_info_type_2, /* Classmark Information Type 2 */
8723 elem_downlink_re, /* Downlink Radio Environment */
8724 elem_downlink_re_list, /* Downlink Radio Environment List */
8725 elem_enc_info, /* Encryption Information */
8726 elem_ext_ho_dir_params, /* Extended Handoff Direction Parameters */
8727 elem_geo_loc, /* Geographic Location */
8728 elem_ssci, /* Special Service Call Indicator */
8729 elem_ho_pow_lev, /* Handoff Power Level */
8730 elem_hho_params, /* Hard Handoff Parameters */
8731 elem_info_rec_req, /* Information Element Requested */
8732 elem_is2000_chan_id, /* IS-2000 Channel Identity */
8733 NULL, /* IS-2000 Channel Identity 3X */
8734 elem_is2000_mob_cap, /* IS-2000 Mobile Capabilities */
8735 elem_is2000_nn_scr, /* IS-2000 Non-Negotiable Service Configuration Record */
8736 elem_is2000_scr, /* IS-2000 Service Configuration Record */
8737 elem_is2000_cause, /* IS-95/IS-2000 Cause Value */
8738 NULL, /* IS-2000 Redirection Record */
8739 elem_is95_chan_id, /* IS-95 Channel Identity */
8740 elem_is95_ms_meas_chan_id, /* IS-95 MS Measured Channel Identity */
8741 elem_l3_info, /* Layer 3 Information */
8742 elem_lai, /* Location Area Information */
8743 elem_mwi, /* Message Waiting Indication */
8744 elem_mid, /* Mobile Identity */
8745 elem_fwd_ms_info_recs, /* (Forward) MS Information Records */
8746 NULL /* no associated data */, /* Origination Continuation Indicator */
8747 elem_paca_order, /* PACA Order */
8748 elem_paca_reoi, /* PACA Reorigination Indicator */
8749 elem_paca_ts, /* PACA Timestamp */
8750 NULL, /* Packet Session Parameters */
8751 elem_pdsn_ip_addr, /* PDSN IP Address */
8752 NULL /* no associated data */, /* Power Down Indicator */
8753 elem_prio, /* Priority */
8754 elem_p_rev, /* Protocol Revision */
8755 elem_ptype, /* Protocol Type */
8756 elem_psmm_count, /* PSMM Count */
8757 elem_qos_params, /* Quality of Service Parameters */
8758 elem_re_res, /* Radio Environment and Resources */
8759 elem_reg_type, /* Registration Type */
8760 elem_rej_cause, /* Reject Cause */
8761 NULL /* no associated data */, /* Response Request */
8762 elem_return_cause, /* Return Cause */
8763 elem_rf_chan_id, /* RF Channel Identity */
8764 elem_so, /* Service Option */
8765 elem_soci, /* Service Option Connection Identifier (SOCI) */
8766 elem_so_list, /* Service Option List */
8767 NULL, /* Service Redirection Info */
8768 elem_sr_id, /* Service Reference Identifier (SR_ID) */
8769 elem_sid, /* SID */
8770 elem_signal, /* Signal */
8771 elem_sci, /* Slot Cycle Index */
8772 elem_sw_ver, /* Software Version */
8773 NULL /* transparent */, /* Source RNC to Target RNC Transparent Container */
8774 elem_s_pdsn_ip_addr, /* Source PDSN Address */
8775 elem_tag, /* Tag */
8776 NULL /* transparent */, /* Target RNC to Source RNC Transparent Container */
8777 elem_xmode, /* Transcoder Mode */
8778 elem_uz_id, /* User Zone ID */
8779 NULL /* no associated data */, /* Voice Privacy Request */
8780 elem_a2p_bearer_session, /* A2p Bearer Session-Level Parameters */
8781 elem_a2p_bearer_format, /* A2p Bearer Format-Specific Parameters */
8782 elem_ms_des_freq, /* MS Designated Frequency */
8783 NULL, /* Mobile Subscription Information */
8784 elem_plcm_id, /* Public Long Code Mask Identification */
8785 elem_rev_ms_info_recs, /* (Reverse) MS Information Records */
8786 NULL, /* NONE */
8789 /* MESSAGE FUNCTIONS */
8792 * Type Length Value (TLV) element dissector
8794 static guint16
8795 elem_tlv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, elem_idx_t idx, guint32 offset, guint len _U_, const gchar *name_add)
8797 guint8 oct, parm_len;
8798 guint16 consumed;
8799 guint32 curr_offset;
8800 proto_tree *subtree;
8801 proto_item *item;
8802 gint dec_idx;
8804 curr_offset = offset;
8805 consumed = 0;
8807 if ((int)idx < 0 || idx >= ansi_a_elem_1_max-1)
8809 /* Unknown index, skip the element */
8810 return tvb_length_remaining(tvb, offset) ;
8813 oct = tvb_get_guint8(tvb, curr_offset);
8815 if (oct == (guint8) ansi_a_elem_1_strings[idx].value)
8817 dec_idx = ansi_a_elem_1_strings[idx].dec_index;
8819 parm_len = tvb_get_guint8(tvb, curr_offset + 1);
8821 item =
8822 proto_tree_add_text(tree,
8823 tvb, curr_offset, parm_len + 2,
8824 "%s%s",
8825 ansi_a_elem_1_strings[idx].strptr,
8826 (name_add == NULL) || (name_add[0] == '\0') ? "" : name_add);
8828 subtree = proto_item_add_subtree(item, ett_ansi_elem_1[idx]);
8830 proto_tree_add_uint_format(subtree, hf_ansi_a_elem_id, tvb,
8831 curr_offset, 1, oct,
8832 "Element ID");
8834 proto_tree_add_uint(subtree, hf_ansi_a_length, tvb,
8835 curr_offset + 1, 1, parm_len);
8837 if (parm_len > 0)
8839 if (elem_1_fcn[dec_idx] == NULL)
8841 proto_tree_add_text(subtree,
8842 tvb, curr_offset + 2, parm_len,
8843 "Element Value");
8845 consumed = parm_len;
8847 else
8849 gchar *a_add_string;
8851 a_add_string = (gchar *) wmem_alloc(wmem_packet_scope(), 1024);
8852 a_add_string[0] = '\0';
8853 consumed =
8854 (*elem_1_fcn[dec_idx])(tvb, pinfo, subtree, curr_offset + 2,
8855 parm_len, a_add_string, 1024);
8857 if (a_add_string[0] != '\0')
8859 proto_item_append_text(item, "%s", a_add_string);
8864 consumed += 2;
8867 return(consumed);
8871 * Type Value (TV) element dissector
8873 * Length cannot be used in these functions, big problem if a element dissector
8874 * is not defined for these.
8876 static guint16
8877 elem_tv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, elem_idx_t idx, guint32 offset, const gchar *name_add)
8879 guint8 oct;
8880 guint16 consumed;
8881 guint32 curr_offset;
8882 proto_tree *subtree;
8883 proto_item *item;
8884 gint dec_idx;
8887 curr_offset = offset;
8888 consumed = 0;
8890 if ((int)idx < 0 || idx >= ansi_a_elem_1_max-1)
8892 /* Unknown index, skip the element */
8893 return tvb_length_remaining(tvb, offset) ;
8896 oct = tvb_get_guint8(tvb, curr_offset);
8898 if (oct == (guint8) ansi_a_elem_1_strings[idx].value)
8900 dec_idx = ansi_a_elem_1_strings[idx].dec_index;
8902 item =
8903 proto_tree_add_text(tree,
8904 tvb, curr_offset, -1,
8905 "%s%s",
8906 ansi_a_elem_1_strings[idx].strptr,
8907 (name_add == NULL) || (name_add[0] == '\0') ? "" : name_add);
8909 subtree = proto_item_add_subtree(item, ett_ansi_elem_1[idx]);
8911 proto_tree_add_uint_format(subtree, hf_ansi_a_elem_id, tvb,
8912 curr_offset, 1, oct,
8913 "Element ID");
8915 if (elem_1_fcn[dec_idx] == NULL)
8917 /* BAD THING, CANNOT DETERMINE LENGTH */
8919 proto_tree_add_text(subtree,
8920 tvb, curr_offset + 1, 1,
8921 "No element dissector, rest of dissection may be incorrect");
8923 consumed = 1;
8925 else
8927 gchar *a_add_string;
8929 a_add_string = (gchar *) wmem_alloc(wmem_packet_scope(), 1024);
8930 a_add_string[0] = '\0';
8931 consumed = (*elem_1_fcn[dec_idx])(tvb, pinfo, subtree, curr_offset + 1, -1, a_add_string, 1024);
8933 if (a_add_string[0] != '\0')
8935 proto_item_append_text(item, "%s", a_add_string);
8939 consumed++;
8941 proto_item_set_len(item, consumed);
8944 return(consumed);
8948 * Type (T) element dissector
8950 * Length cannot be used in these functions, big problem if a element dissector
8951 * is not defined for these.
8953 static guint16
8954 elem_t(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, elem_idx_t idx, guint32 offset, const gchar *name_add)
8956 guint8 oct;
8957 guint32 curr_offset;
8958 guint16 consumed;
8961 curr_offset = offset;
8962 consumed = 0;
8964 if ((int)idx < 0 || idx >= ansi_a_elem_1_max-1)
8966 /* Unknown index, skip the element */
8967 return tvb_length_remaining(tvb, offset) ;
8970 oct = tvb_get_guint8(tvb, curr_offset);
8972 if (oct == (guint8) ansi_a_elem_1_strings[idx].value)
8974 proto_tree_add_uint_format(tree, hf_ansi_a_elem_id, tvb, curr_offset, 1, oct,
8975 "%s%s",
8976 ansi_a_elem_1_strings[idx].strptr,
8977 (name_add == NULL) || (name_add[0] == '\0') ? "" : name_add);
8979 consumed = 1;
8982 return(consumed);
8986 * Length Value (LV) element dissector
8988 static guint16
8989 elem_lv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, elem_idx_t idx, guint32 offset, guint len _U_, const gchar *name_add)
8991 guint8 parm_len;
8992 guint16 consumed;
8993 guint32 curr_offset;
8994 proto_tree *subtree;
8995 proto_item *item;
8996 gint dec_idx;
8999 curr_offset = offset;
9000 consumed = 0;
9002 if ((int)idx < 0 || idx >= ansi_a_elem_1_max-1)
9004 /* Unknown index, skip the element */
9005 return tvb_length_remaining(tvb, offset) ;
9008 dec_idx = ansi_a_elem_1_strings[idx].dec_index;
9010 parm_len = tvb_get_guint8(tvb, curr_offset);
9012 item =
9013 proto_tree_add_text(tree,
9014 tvb, curr_offset, parm_len + 1,
9015 "%s%s",
9016 ansi_a_elem_1_strings[idx].strptr,
9017 (name_add == NULL) || (name_add[0] == '\0') ? "" : name_add);
9019 subtree = proto_item_add_subtree(item, ett_ansi_elem_1[idx]);
9021 proto_tree_add_uint(subtree, hf_ansi_a_length, tvb,
9022 curr_offset, 1, parm_len);
9024 if (parm_len > 0)
9026 if (elem_1_fcn[dec_idx] == NULL)
9028 proto_tree_add_text(subtree,
9029 tvb, curr_offset + 1, parm_len,
9030 "Element Value");
9032 consumed = parm_len;
9034 else
9036 gchar *a_add_string;
9038 a_add_string = (gchar *) wmem_alloc(wmem_packet_scope(), 1024);
9039 a_add_string[0] = '\0';
9040 consumed =
9041 (*elem_1_fcn[dec_idx])(tvb, pinfo, subtree, curr_offset + 1,
9042 parm_len, a_add_string, 1024);
9044 if (a_add_string[0] != '\0')
9046 proto_item_append_text(item, "%s", a_add_string);
9051 return(consumed + 1);
9055 * Value (V) element dissector
9057 * Length cannot be used in these functions, big problem if a element dissector
9058 * is not defined for these.
9060 static guint16
9061 elem_v(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, elem_idx_t idx, guint32 offset)
9063 guint16 consumed;
9064 guint32 curr_offset;
9065 gint dec_idx;
9067 curr_offset = offset;
9069 if ((int)idx < 0 || idx >= ansi_a_elem_1_max-1)
9071 /* Unknown index, skip the element */
9072 return tvb_length_remaining(tvb, offset) ;
9075 dec_idx = ansi_a_elem_1_strings[idx].dec_index;
9077 if (elem_1_fcn[dec_idx] == NULL)
9079 /* BAD THING, CANNOT DETERMINE LENGTH */
9081 proto_tree_add_text(tree,
9082 tvb, curr_offset, 1,
9083 "No element dissector, rest of dissection may be incorrect");
9085 consumed = 1;
9087 else
9089 gchar *a_add_string;
9091 a_add_string = (gchar *) wmem_alloc(wmem_packet_scope(), 1024);
9092 a_add_string[0] = '\0';
9093 consumed = (*elem_1_fcn[dec_idx])(tvb, pinfo, tree, curr_offset, -1, a_add_string, 1024);
9096 return(consumed);
9100 #define ELEM_MAND_TLV(elem_idx, elem_name_addition) \
9102 if ((consumed = elem_tlv(tvb, pinfo, tree, elem_idx, curr_offset, curr_len, elem_name_addition)) > 0) \
9104 curr_offset += consumed; \
9105 curr_len -= consumed; \
9107 else \
9109 proto_tree_add_text(tree, \
9110 tvb, curr_offset, 0, \
9111 "Missing Mandatory element (0x%02x) %s%s, rest of dissection is suspect", \
9112 ansi_a_elem_1_strings[elem_idx].value, \
9113 ansi_a_elem_1_strings[elem_idx].strptr, \
9114 (elem_name_addition == NULL) || (elem_name_addition[0] == '\0') ? "" : elem_name_addition \
9115 ); \
9117 if (curr_len <= 0) return; \
9120 #define ELEM_OPT_TLV(elem_idx, elem_name_addition) \
9122 if ((consumed = elem_tlv(tvb, pinfo, tree, elem_idx, curr_offset, curr_len, elem_name_addition)) > 0) \
9124 curr_offset += consumed; \
9125 curr_len -= consumed; \
9127 if (curr_len <= 0) return; \
9130 #define ELEM_MAND_TV(elem_idx, elem_name_addition) \
9132 if ((consumed = elem_tv(tvb, pinfo, tree, elem_idx, curr_offset, elem_name_addition)) > 0) \
9134 curr_offset += consumed; \
9135 curr_len -= consumed; \
9137 else \
9139 proto_tree_add_text(tree, \
9140 tvb, curr_offset, 0, \
9141 "Missing Mandatory element (0x%02x) %s%s, rest of dissection is suspect", \
9142 ansi_a_elem_1_strings[elem_idx].value, \
9143 ansi_a_elem_1_strings[elem_idx].strptr, \
9144 (elem_name_addition == NULL) || (elem_name_addition[0] == '\0') ? "" : elem_name_addition \
9145 ); \
9147 if (curr_len <= 0) return; \
9150 #define ELEM_OPT_TV(elem_idx, elem_name_addition) \
9152 if ((consumed = elem_tv(tvb, pinfo, tree, elem_idx, curr_offset, elem_name_addition)) > 0) \
9154 curr_offset += consumed; \
9155 curr_len -= consumed; \
9157 if (curr_len <= 0) return; \
9160 #define ELEM_OPT_T(elem_idx, elem_name_addition) \
9162 if ((consumed = elem_t(tvb, pinfo, tree, elem_idx, curr_offset, elem_name_addition)) > 0) \
9164 curr_offset += consumed; \
9165 curr_len -= consumed; \
9167 if (curr_len <= 0) return; \
9170 #define ELEM_MAND_LV(elem_idx, elem_name_addition, from_sip) \
9172 if ((consumed = (from_sip ? \
9173 elem_tlv(tvb, pinfo, tree, elem_idx, curr_offset, curr_len, elem_name_addition) : \
9174 elem_lv(tvb, pinfo, tree, elem_idx, curr_offset, curr_len, elem_name_addition))) > 0) \
9176 curr_offset += consumed; \
9177 curr_len -= consumed; \
9179 else \
9181 /* Mandatory, but nothing we can do */ \
9183 if (curr_len <= 0) return; \
9186 #define ELEM_MAND_V(elem_idx, from_sip) \
9188 if ((consumed = (from_sip ? \
9189 elem_tv(tvb, pinfo, tree, elem_idx, curr_offset, "") : \
9190 elem_v(tvb, pinfo, tree, elem_idx, curr_offset))) > 0) \
9192 curr_offset += consumed; \
9193 curr_len -= consumed; \
9195 else \
9197 /* Mandatory, but nothing we can do */ \
9199 if (curr_len <= 0) return; \
9204 * IOS 6.1.2.1
9206 static void
9207 bsmap_cl3_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip)
9209 guint16 consumed;
9210 guint32 curr_offset;
9211 guint curr_len;
9213 curr_offset = offset;
9214 curr_len = len;
9216 if (!from_sip) {
9217 /* With femtoInterfaceMsg application, the Information Elements
9218 for the Complete Layer 3 Information message shall not be included */
9219 ELEM_MAND_TLV(ANSI_A_E_CELL_ID, "");
9221 ELEM_MAND_TLV(ANSI_A_E_L3_INFO, "");
9224 EXTRANEOUS_DATA_CHECK(curr_len, 0);
9228 * IOS 6.1.2.2
9230 static void
9231 dtap_cm_srvc_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip)
9233 guint32 curr_offset;
9234 guint32 consumed;
9235 guint curr_len;
9236 guint8 oct;
9237 proto_tree *subtree;
9238 proto_item *item;
9239 const gchar *str;
9241 curr_offset = offset;
9242 curr_len = len;
9245 * special dissection for CM Service Type
9247 oct = tvb_get_guint8(tvb, curr_offset);
9249 switch (oct & 0x0f)
9251 case 0x01: str = "Mobile Originating Call"; break;
9252 default:
9253 str = "Unknown";
9254 break;
9257 item =
9258 proto_tree_add_text(tree,
9259 tvb, curr_offset, 1,
9260 "CM Service Type: %s",
9261 str);
9263 subtree = proto_item_add_subtree(item, ett_cm_srvc_type);
9265 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
9266 proto_tree_add_text(subtree,
9267 tvb, curr_offset, 1,
9268 "%s : Element ID",
9269 a_bigbuf);
9271 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
9272 proto_tree_add_text(subtree,
9273 tvb, curr_offset, 1,
9274 "%s : Service Type: (%u) %s",
9275 a_bigbuf,
9276 oct & 0x0f,
9277 str);
9279 curr_offset++;
9280 curr_len--;
9282 ELEM_MAND_LV(ANSI_A_E_CM_INFO_TYPE_2, "", from_sip);
9284 ELEM_MAND_LV(ANSI_A_E_MID, "", from_sip);
9286 ELEM_OPT_TLV(ANSI_A_E_CLD_PARTY_BCD_NUM, "");
9288 ELEM_OPT_TLV(ANSI_A_E_MID, "");
9290 ELEM_OPT_TV(ANSI_A_E_SCI, "");
9292 ELEM_OPT_TLV(ANSI_A_E_AUTH_RESP_PARAM, "");
9294 ELEM_OPT_TV(ANSI_A_E_AUTH_CNF_PARAM, "");
9296 ELEM_OPT_TV(ANSI_A_E_AUTH_PARAM_COUNT, "");
9298 ELEM_OPT_TLV(ANSI_A_E_AUTH_CHLG_PARAM, "");
9300 ELEM_OPT_TV(ANSI_A_E_SO, "");
9302 ELEM_OPT_T(ANSI_A_E_VP_REQ, "");
9304 ELEM_OPT_TV(ANSI_A_E_RE_RES, "");
9306 ELEM_OPT_TLV(ANSI_A_E_CLD_PARTY_ASCII_NUM, "");
9308 ELEM_OPT_TV(ANSI_A_E_CIC, "");
9310 ELEM_OPT_TLV(ANSI_A_E_AUTH_EVENT, "");
9312 ELEM_OPT_TLV(ANSI_A_E_AUTH_DATA, "");
9314 ELEM_OPT_TLV(ANSI_A_E_PACA_REOI, "");
9316 ELEM_OPT_TLV(ANSI_A_E_UZ_ID, "");
9318 ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
9320 ELEM_OPT_TLV(ANSI_A_E_CDMA_SOWD, "");
9322 switch (global_a_variant)
9324 case A_VARIANT_IOS501:
9325 ELEM_OPT_TLV(ANSI_A_E_SSCI, "");
9327 ELEM_OPT_TLV(ANSI_A_E_SOCI, "");
9329 ELEM_OPT_T(ANSI_A_E_ORIG_CI, "");
9331 ELEM_OPT_TV(ANSI_A_E_RETURN_CAUSE, "");
9333 ELEM_OPT_TLV(ANSI_A_E_MID, "");
9335 ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_SESSION, "");
9337 ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_FORMAT, "");
9339 ELEM_OPT_TLV(ANSI_A_E_MOB_SUB_INFO, "");
9340 break;
9343 EXTRANEOUS_DATA_CHECK(curr_len, 0);
9347 * IOS 5 3.1.3
9349 static void
9350 dtap_cm_srvc_req_cont(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
9352 guint32 curr_offset;
9353 guint32 consumed;
9354 guint curr_len;
9356 curr_offset = offset;
9357 curr_len = len;
9359 ELEM_OPT_TLV(ANSI_A_E_CLD_PARTY_BCD_NUM, "");
9361 ELEM_OPT_TLV(ANSI_A_E_CLD_PARTY_ASCII_NUM, "");
9363 ELEM_OPT_TLV(ANSI_A_E_REV_MS_INFO_RECS, "");
9365 EXTRANEOUS_DATA_CHECK(curr_len, 0);
9369 * IOS 6.1.2.3
9371 static void
9372 bsmap_page_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
9374 guint32 curr_offset;
9375 guint32 consumed;
9376 guint curr_len;
9378 curr_offset = offset;
9379 curr_len = len;
9381 ELEM_MAND_TLV(ANSI_A_E_MID, "");
9383 ELEM_OPT_TV(ANSI_A_E_TAG, "");
9385 ELEM_OPT_TLV(ANSI_A_E_CELL_ID_LIST, "");
9387 ELEM_OPT_TV(ANSI_A_E_SCI, "");
9389 ELEM_OPT_TV(ANSI_A_E_SO, "");
9391 ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
9393 switch (global_a_variant)
9395 case A_VARIANT_IOS501:
9396 ELEM_OPT_TLV(ANSI_A_E_P_REV, "");
9398 ELEM_OPT_TLV(ANSI_A_E_MS_DES_FREQ, "");
9400 ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_FORMAT, "");
9402 ELEM_OPT_TLV(ANSI_A_E_MID, "");
9404 ELEM_OPT_TLV(ANSI_A_E_MOB_SUB_INFO, "");
9405 break;
9408 EXTRANEOUS_DATA_CHECK(curr_len, 0);
9412 * IOS 6.1.2.4
9414 static void
9415 dtap_page_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip)
9417 guint32 curr_offset;
9418 guint32 consumed;
9419 guint curr_len;
9421 curr_offset = offset;
9422 curr_len = len;
9424 ELEM_MAND_LV(ANSI_A_E_CM_INFO_TYPE_2, "", from_sip);
9426 ELEM_MAND_LV(ANSI_A_E_MID, "", from_sip);
9428 ELEM_OPT_TV(ANSI_A_E_TAG, "");
9430 ELEM_OPT_TLV(ANSI_A_E_MID, "");
9432 ELEM_OPT_TV(ANSI_A_E_SCI, "");
9434 ELEM_OPT_TLV(ANSI_A_E_AUTH_RESP_PARAM, "");
9436 ELEM_OPT_TV(ANSI_A_E_AUTH_CNF_PARAM, "");
9438 ELEM_OPT_TV(ANSI_A_E_AUTH_PARAM_COUNT, "");
9440 ELEM_OPT_TLV(ANSI_A_E_AUTH_CHLG_PARAM, "");
9442 ELEM_OPT_TV(ANSI_A_E_SO, "");
9444 ELEM_OPT_T(ANSI_A_E_VP_REQ, "");
9446 ELEM_OPT_TV(ANSI_A_E_CIC, "");
9448 ELEM_OPT_TLV(ANSI_A_E_AUTH_EVENT, "");
9450 ELEM_OPT_TV(ANSI_A_E_RE_RES, "");
9452 ELEM_OPT_TLV(ANSI_A_E_UZ_ID, "");
9454 ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
9456 ELEM_OPT_TLV(ANSI_A_E_CDMA_SOWD, "");
9458 switch (global_a_variant)
9460 case A_VARIANT_IOS501:
9461 ELEM_OPT_TLV(ANSI_A_E_SOCI, "");
9463 ELEM_OPT_TLV(ANSI_A_E_MID, "");
9465 ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_SESSION, "");
9467 ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_FORMAT, "");
9468 break;
9471 EXTRANEOUS_DATA_CHECK(curr_len, 0);
9475 * IOS 6.1.2.12
9477 static void
9478 dtap_progress(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
9480 guint32 curr_offset;
9481 guint32 consumed;
9482 guint curr_len;
9484 curr_offset = offset;
9485 curr_len = len;
9487 ELEM_OPT_TV(ANSI_A_E_SIGNAL, "");
9489 ELEM_OPT_TLV(ANSI_A_E_FWD_MS_INFO_RECS, "");
9491 ELEM_OPT_TLV(ANSI_A_E_SOCI, "");
9493 EXTRANEOUS_DATA_CHECK(curr_len, 0);
9497 * IOS 5 3.8.1
9499 static void
9500 dtap_srvc_redirection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
9502 guint32 curr_offset;
9503 guint32 consumed;
9504 guint curr_len;
9506 curr_offset = offset;
9507 curr_len = len;
9509 ELEM_MAND_TLV(ANSI_A_E_IS2000_RED_RECORD, "");
9511 ELEM_MAND_TLV(ANSI_A_E_S_RED_INFO, "");
9513 ELEM_MAND_TLV(ANSI_A_E_MID, "");
9515 ELEM_OPT_TLV(ANSI_A_E_MID, "");
9517 ELEM_OPT_TLV(ANSI_A_E_P_REV, "");
9519 ELEM_OPT_TLV(ANSI_A_E_MID, "");
9521 EXTRANEOUS_DATA_CHECK(curr_len, 0);
9525 * IOS 5 3.1.11
9527 static void
9528 dtap_srvc_release(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
9530 guint32 curr_offset;
9531 guint32 consumed;
9532 guint curr_len;
9534 curr_offset = offset;
9535 curr_len = len;
9537 ELEM_MAND_TLV(ANSI_A_E_SOCI, "");
9539 ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
9541 ELEM_OPT_TLV(ANSI_A_E_CAUSE_L3, "");
9543 EXTRANEOUS_DATA_CHECK(curr_len, 0);
9547 * IOS 5 3.1.12
9549 static void
9550 dtap_srvc_release_complete(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
9552 guint32 curr_offset;
9553 guint32 consumed;
9554 guint curr_len;
9556 curr_offset = offset;
9557 curr_len = len;
9559 ELEM_MAND_TLV(ANSI_A_E_SOCI, "");
9561 EXTRANEOUS_DATA_CHECK(curr_len, 0);
9565 * IOS 6.1.2.15
9567 static void
9568 bsmap_ass_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
9570 guint16 consumed;
9571 guint32 curr_offset;
9572 guint curr_len;
9574 curr_offset = offset;
9575 curr_len = len;
9577 ELEM_MAND_TLV(ANSI_A_E_CHAN_TYPE, "");
9579 ELEM_OPT_TV(ANSI_A_E_CIC, "");
9581 ELEM_OPT_TLV(ANSI_A_E_ENC_INFO, "");
9583 ELEM_OPT_TV(ANSI_A_E_SO, "");
9585 ELEM_OPT_TV(ANSI_A_E_SIGNAL, "");
9587 ELEM_OPT_TLV(ANSI_A_E_CLG_PARTY_ASCII_NUM, "");
9589 ELEM_OPT_TLV(ANSI_A_E_FWD_MS_INFO_RECS, "");
9591 ELEM_OPT_TLV(ANSI_A_E_PRIO, "");
9593 ELEM_OPT_TLV(ANSI_A_E_PACA_TS, "");
9595 ELEM_OPT_TLV(ANSI_A_E_QOS_PARAMS, "");
9597 switch (global_a_variant)
9599 case A_VARIANT_IOS501:
9600 ELEM_OPT_TLV(ANSI_A_E_SOCI, "");
9602 ELEM_OPT_TLV(ANSI_A_E_SR_ID, "");
9604 ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_SESSION, "");
9606 ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_FORMAT, "");
9608 ELEM_OPT_TLV(ANSI_A_E_MID, "");
9610 ELEM_OPT_TLV(ANSI_A_E_MOB_SUB_INFO, "");
9611 break;
9614 EXTRANEOUS_DATA_CHECK(curr_len, 0);
9618 * IOS 6.1.2.16
9620 static void
9621 bsmap_ass_complete(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
9623 guint16 consumed;
9624 guint32 curr_offset;
9625 guint curr_len;
9627 curr_offset = offset;
9628 curr_len = len;
9630 ELEM_MAND_TV(ANSI_A_E_CHAN_NUM, "");
9632 ELEM_OPT_TLV(ANSI_A_E_ENC_INFO, "");
9634 ELEM_OPT_TV(ANSI_A_E_SO, "");
9636 switch (global_a_variant)
9638 case A_VARIANT_IOS501:
9639 ELEM_OPT_TLV(ANSI_A_E_SOCI, "");
9641 ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_SESSION, "");
9643 ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_FORMAT, "");
9645 ELEM_OPT_TLV(ANSI_A_E_MID, "");
9646 break;
9649 EXTRANEOUS_DATA_CHECK(curr_len, 0);
9653 * IOS 6.1.2.17
9655 static void
9656 bsmap_ass_failure(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
9658 guint16 consumed;
9659 guint32 curr_offset;
9660 guint curr_len;
9662 curr_offset = offset;
9663 curr_len = len;
9665 ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
9667 ELEM_OPT_TLV(ANSI_A_E_SOCI, "");
9669 EXTRANEOUS_DATA_CHECK(curr_len, 0);
9673 * IOS 6.1.2.20
9675 static void
9676 bsmap_clr_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
9678 guint16 consumed;
9679 guint32 curr_offset;
9680 guint curr_len;
9682 curr_offset = offset;
9683 curr_len = len;
9685 ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
9687 ELEM_OPT_TLV(ANSI_A_E_CAUSE_L3, "");
9689 EXTRANEOUS_DATA_CHECK(curr_len, 0);
9693 * IOS 6.1.2.21
9695 static void
9696 bsmap_clr_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
9698 guint16 consumed;
9699 guint32 curr_offset;
9700 guint curr_len;
9702 curr_offset = offset;
9703 curr_len = len;
9705 ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
9707 ELEM_OPT_TLV(ANSI_A_E_CAUSE_L3, "");
9709 EXTRANEOUS_DATA_CHECK(curr_len, 0);
9713 * IOS 6.1.2.22
9715 static void
9716 bsmap_clr_complete(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
9718 guint16 consumed;
9719 guint32 curr_offset;
9720 guint curr_len;
9722 curr_offset = offset;
9723 curr_len = len;
9725 ELEM_OPT_T(ANSI_A_E_PDI, "");
9727 ELEM_OPT_TLV(ANSI_A_E_MOB_SUB_INFO, "");
9729 EXTRANEOUS_DATA_CHECK(curr_len, 0);
9733 * IOS 6.1.2.24
9735 static void
9736 dtap_alert_with_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
9738 guint32 curr_offset;
9739 guint32 consumed;
9740 guint curr_len;
9742 curr_offset = offset;
9743 curr_len = len;
9745 ELEM_OPT_TLV(ANSI_A_E_FWD_MS_INFO_RECS, "");
9747 ELEM_OPT_TLV(ANSI_A_E_SOCI, "");
9749 EXTRANEOUS_DATA_CHECK(curr_len, 0);
9753 * IOS 6.1.2.28
9755 static void
9756 bsmap_bs_srvc_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
9758 guint32 curr_offset;
9759 guint32 consumed;
9760 guint curr_len;
9762 curr_offset = offset;
9763 curr_len = len;
9765 ELEM_MAND_TLV(ANSI_A_E_MID, "");
9767 ELEM_OPT_TLV(ANSI_A_E_MID, "");
9769 ELEM_OPT_TV(ANSI_A_E_SO, "");
9771 ELEM_OPT_TV(ANSI_A_E_TAG, "");
9773 ELEM_OPT_TLV(ANSI_A_E_ADDS_USER_PART, "");
9775 ELEM_OPT_TLV(ANSI_A_E_SR_ID, "");
9777 ELEM_OPT_TLV(ANSI_A_E_MID, "");
9779 EXTRANEOUS_DATA_CHECK(curr_len, 0);
9783 * IOS 6.1.2.29
9785 static void
9786 bsmap_bs_srvc_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
9788 guint32 curr_offset;
9789 guint32 consumed;
9790 guint curr_len;
9792 curr_offset = offset;
9793 curr_len = len;
9795 ELEM_MAND_TLV(ANSI_A_E_MID, "");
9797 ELEM_OPT_TLV(ANSI_A_E_MID, "");
9799 ELEM_OPT_TV(ANSI_A_E_TAG, "");
9801 ELEM_OPT_TLV(ANSI_A_E_CAUSE, "");
9803 ELEM_OPT_TLV(ANSI_A_E_MID, "");
9805 EXTRANEOUS_DATA_CHECK(curr_len, 0);
9809 * IOS 5 3.1.19
9811 static void
9812 bsmap_add_srvc_noti(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
9814 guint32 curr_offset;
9815 guint32 consumed;
9816 guint curr_len;
9818 curr_offset = offset;
9819 curr_len = len;
9821 ELEM_MAND_TLV(ANSI_A_E_MID, "");
9823 ELEM_MAND_TV(ANSI_A_E_SO, "");
9825 ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_SESSION, "");
9827 EXTRANEOUS_DATA_CHECK(curr_len, 0);
9831 * IOS 5 3.1.20
9833 static void
9834 dtap_add_srvc_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
9836 guint32 curr_offset;
9837 guint32 consumed;
9838 guint curr_len;
9840 curr_offset = offset;
9841 curr_len = len;
9843 ELEM_MAND_TLV(ANSI_A_E_SOCI, "");
9845 ELEM_OPT_TLV(ANSI_A_E_CLD_PARTY_BCD_NUM, "");
9847 ELEM_MAND_TV(ANSI_A_E_SO, "");
9849 ELEM_OPT_T(ANSI_A_E_VP_REQ, "");
9851 ELEM_OPT_TLV(ANSI_A_E_CLD_PARTY_ASCII_NUM, "");
9853 ELEM_OPT_TV(ANSI_A_E_CIC, "");
9855 ELEM_OPT_TLV(ANSI_A_E_SSCI, "");
9857 ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_SESSION, "");
9859 ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_FORMAT, "");
9861 EXTRANEOUS_DATA_CHECK(curr_len, 0);
9865 * IOS 5 3.1.10
9867 static void
9868 dtap_connect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
9870 guint32 curr_offset;
9871 guint32 consumed;
9872 guint curr_len;
9874 curr_offset = offset;
9875 curr_len = len;
9877 ELEM_OPT_TLV(ANSI_A_E_SOCI, "");
9879 EXTRANEOUS_DATA_CHECK(curr_len, 0);
9883 * IOS 6.1.3.7
9885 static void
9886 dtap_flash_with_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
9888 guint32 curr_offset;
9889 guint32 consumed;
9890 guint curr_len;
9892 curr_offset = offset;
9893 curr_len = len;
9895 ELEM_OPT_TLV(ANSI_A_E_CLD_PARTY_BCD_NUM, "");
9897 ELEM_OPT_TV(ANSI_A_E_SIGNAL, "");
9899 ELEM_OPT_TV(ANSI_A_E_MWI, "");
9901 ELEM_OPT_TLV(ANSI_A_E_CLG_PARTY_ASCII_NUM, "");
9903 ELEM_OPT_TV(ANSI_A_E_TAG, "");
9905 if (pinfo->p2p_dir == P2P_DIR_RECV)
9907 ELEM_OPT_TLV(ANSI_A_E_REV_MS_INFO_RECS, "");
9909 else
9911 ELEM_OPT_TLV(ANSI_A_E_FWD_MS_INFO_RECS, "");
9914 ELEM_OPT_TLV(ANSI_A_E_SSCI, "");
9916 ELEM_OPT_TLV(ANSI_A_E_SOCI, "");
9918 EXTRANEOUS_DATA_CHECK(curr_len, 0);
9922 * IOS 6.1.3.8
9924 static void
9925 dtap_flash_with_info_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
9927 guint32 curr_offset;
9928 guint32 consumed;
9929 guint curr_len;
9931 curr_offset = offset;
9932 curr_len = len;
9934 ELEM_OPT_TV(ANSI_A_E_TAG, "");
9936 ELEM_OPT_TLV(ANSI_A_E_SOCI, "");
9938 EXTRANEOUS_DATA_CHECK(curr_len, 0);
9942 * IOS 6.1.3.9
9944 static void
9945 bsmap_feat_noti(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
9947 guint32 curr_offset;
9948 guint32 consumed;
9949 guint curr_len;
9951 curr_offset = offset;
9952 curr_len = len;
9954 ELEM_MAND_TLV(ANSI_A_E_MID, "");
9956 ELEM_OPT_TV(ANSI_A_E_TAG, "");
9958 ELEM_OPT_TLV(ANSI_A_E_CELL_ID_LIST, "");
9960 ELEM_OPT_TV(ANSI_A_E_SCI, "");
9962 ELEM_OPT_TV(ANSI_A_E_SIGNAL, "");
9964 ELEM_OPT_TV(ANSI_A_E_MWI, "");
9966 ELEM_OPT_TLV(ANSI_A_E_CLG_PARTY_ASCII_NUM, "");
9968 ELEM_OPT_TLV(ANSI_A_E_FWD_MS_INFO_RECS, "");
9970 ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
9972 ELEM_OPT_TLV(ANSI_A_E_P_REV, "");
9974 ELEM_OPT_TLV(ANSI_A_E_MS_DES_FREQ, "");
9976 ELEM_OPT_TLV(ANSI_A_E_MOB_SUB_INFO, "");
9978 EXTRANEOUS_DATA_CHECK(curr_len, 0);
9982 * IOS 6.1.3.10
9984 static void
9985 bsmap_feat_noti_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
9987 guint32 curr_offset;
9988 guint32 consumed;
9989 guint curr_len;
9991 curr_offset = offset;
9992 curr_len = len;
9994 ELEM_MAND_TLV(ANSI_A_E_MID, "");
9996 ELEM_OPT_TV(ANSI_A_E_TAG, "");
9998 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10002 * IOS 6.1.3.11
10004 static void
10005 bsmap_paca_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
10007 guint32 curr_offset;
10008 guint32 consumed;
10009 guint curr_len;
10011 curr_offset = offset;
10012 curr_len = len;
10014 ELEM_OPT_TLV(ANSI_A_E_PRIO, "");
10016 ELEM_OPT_TLV(ANSI_A_E_PACA_TS, "");
10018 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10022 * IOS 6.1.3.12
10024 static void
10025 bsmap_paca_command_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
10027 guint32 curr_offset;
10028 guint32 consumed;
10029 guint curr_len;
10031 curr_offset = offset;
10032 curr_len = len;
10034 ELEM_OPT_TLV(ANSI_A_E_CAUSE, "");
10036 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10040 * IOS 6.1.3.13
10042 static void
10043 bsmap_paca_update(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
10045 guint32 curr_offset;
10046 guint32 consumed;
10047 guint curr_len;
10049 curr_offset = offset;
10050 curr_len = len;
10052 ELEM_OPT_TLV(ANSI_A_E_MID, "");
10054 ELEM_OPT_TLV(ANSI_A_E_MID, "");
10056 ELEM_OPT_TLV(ANSI_A_E_PACA_ORDER, "");
10058 ELEM_OPT_TLV(ANSI_A_E_PRIO, "");
10060 ELEM_OPT_TLV(ANSI_A_E_AUTH_RESP_PARAM, "");
10062 ELEM_OPT_TV(ANSI_A_E_AUTH_CNF_PARAM, "");
10064 ELEM_OPT_TV(ANSI_A_E_AUTH_PARAM_COUNT, "");
10066 ELEM_OPT_TLV(ANSI_A_E_AUTH_CHLG_PARAM, "");
10068 ELEM_OPT_TLV(ANSI_A_E_AUTH_EVENT, "");
10070 ELEM_OPT_TLV(ANSI_A_E_MID, "");
10072 ELEM_OPT_TLV(ANSI_A_E_MS_DES_FREQ, "");
10074 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10078 * IOS 6.1.3.14
10080 static void
10081 bsmap_paca_update_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
10083 guint32 curr_offset;
10084 guint32 consumed;
10085 guint curr_len;
10087 curr_offset = offset;
10088 curr_len = len;
10090 ELEM_OPT_TLV(ANSI_A_E_MID, "");
10092 ELEM_OPT_TLV(ANSI_A_E_PRIO, "");
10094 ELEM_OPT_TLV(ANSI_A_E_CAUSE, "");
10096 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10100 * IOS 5 3.2.9
10102 static void
10103 bsmap_rm_pos_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
10105 guint32 curr_offset;
10106 guint32 consumed;
10107 guint curr_len;
10109 curr_offset = offset;
10110 curr_len = len;
10112 ELEM_MAND_TLV(ANSI_A_E_PSMM_COUNT, "");
10114 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10118 * IOS 5 3.2.10
10120 static void
10121 bsmap_rm_pos_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
10123 guint32 curr_offset;
10124 guint32 consumed;
10125 guint curr_len;
10127 curr_offset = offset;
10128 curr_len = len;
10130 ELEM_OPT_TLV(ANSI_A_E_CDMA_SOWD, "");
10132 ELEM_OPT_TLV(ANSI_A_E_CAUSE, "");
10134 ELEM_OPT_TLV(ANSI_A_E_DOWNLINK_RE_LIST, "");
10136 ELEM_OPT_TLV(ANSI_A_E_GEO_LOC, "");
10138 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10142 * IOS 6.1.4.1
10144 static void
10145 bsmap_auth_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
10147 guint32 curr_offset;
10148 guint32 consumed;
10149 guint curr_len;
10151 curr_offset = offset;
10152 curr_len = len;
10154 ELEM_MAND_TLV(ANSI_A_E_AUTH_CHLG_PARAM, "");
10156 ELEM_OPT_TLV(ANSI_A_E_MID, "");
10158 ELEM_OPT_TV(ANSI_A_E_TAG, "");
10160 ELEM_OPT_TLV(ANSI_A_E_CELL_ID_LIST, "");
10162 ELEM_OPT_TV(ANSI_A_E_SCI, "");
10164 ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
10166 ELEM_OPT_TLV(ANSI_A_E_P_REV, "");
10168 ELEM_OPT_TLV(ANSI_A_E_MS_DES_FREQ, "");
10170 ELEM_OPT_TLV(ANSI_A_E_MOB_SUB_INFO, "");
10172 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10175 static void
10176 dtap_auth_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip)
10178 guint32 curr_offset;
10179 guint32 consumed;
10180 guint curr_len;
10182 curr_offset = offset;
10183 curr_len = len;
10185 ELEM_MAND_LV(ANSI_A_E_AUTH_CHLG_PARAM, "", from_sip);
10187 ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
10189 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10193 * IOS 6.1.4.2
10195 static void
10196 bsmap_auth_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
10198 guint32 curr_offset;
10199 guint32 consumed;
10200 guint curr_len;
10202 curr_offset = offset;
10203 curr_len = len;
10205 ELEM_MAND_TLV(ANSI_A_E_AUTH_RESP_PARAM, "");
10207 ELEM_MAND_TLV(ANSI_A_E_MID, "");
10209 ELEM_MAND_TV(ANSI_A_E_TAG, "");
10211 ELEM_OPT_TLV(ANSI_A_E_MID, "");
10213 ELEM_OPT_TLV(ANSI_A_E_MID, "");
10215 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10219 * IOS 5
10220 * Section 3.1.21
10222 static void
10223 bsmap_bearer_upd_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
10225 guint32 curr_offset;
10226 guint32 consumed;
10227 guint curr_len;
10229 curr_offset = offset;
10230 curr_len = len;
10232 ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_SESSION, "");
10234 ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_FORMAT, "");
10236 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10240 * IOS 5
10241 * Section 3.1.22
10243 static void
10244 bsmap_bearer_upd_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
10246 guint32 curr_offset;
10247 guint32 consumed;
10248 guint curr_len;
10250 curr_offset = offset;
10251 curr_len = len;
10253 ELEM_OPT_TLV(ANSI_A_E_CAUSE, "");
10255 ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_SESSION, "");
10257 ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_FORMAT, "");
10259 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10263 * IOS 5
10264 * Section 3.1.23
10266 static void
10267 bsmap_bearer_upd_reqd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
10269 guint32 curr_offset;
10270 guint32 consumed;
10271 guint curr_len;
10273 curr_offset = offset;
10274 curr_len = len;
10276 ELEM_OPT_TLV(ANSI_A_E_CAUSE, "");
10278 ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_SESSION, "");
10280 ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_FORMAT, "");
10282 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10285 static void
10286 dtap_auth_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip)
10288 guint32 curr_offset;
10289 guint32 consumed;
10290 guint curr_len;
10292 curr_offset = offset;
10293 curr_len = len;
10295 ELEM_MAND_LV(ANSI_A_E_AUTH_RESP_PARAM, "", from_sip);
10297 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10301 * IOS 6.1.4.3
10303 static void
10304 bsmap_user_zone_update(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
10306 guint32 curr_offset;
10307 guint32 consumed;
10308 guint curr_len;
10310 curr_offset = offset;
10311 curr_len = len;
10313 ELEM_OPT_TLV(ANSI_A_E_UZ_ID, "");
10315 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10319 * IOS 5 3.3.16
10321 static void
10322 dtap_user_zone_update_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
10324 guint32 curr_offset;
10325 guint32 consumed;
10326 guint curr_len;
10328 curr_offset = offset;
10329 curr_len = len;
10331 ELEM_MAND_TLV(ANSI_A_E_UZ_ID, "");
10333 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10337 * IOS 5 3.3.17
10339 static void
10340 dtap_user_zone_update(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
10342 guint32 curr_offset;
10343 guint32 consumed;
10344 guint curr_len;
10346 curr_offset = offset;
10347 curr_len = len;
10349 ELEM_MAND_TLV(ANSI_A_E_UZ_ID, "");
10351 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10355 * IOS 5 3.3.18
10357 static void
10358 bsmap_user_zone_reject(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
10360 guint32 curr_offset;
10361 guint32 consumed;
10362 guint curr_len;
10364 curr_offset = offset;
10365 curr_len = len;
10367 ELEM_OPT_TLV(ANSI_A_E_UZ_ID, "");
10369 ELEM_MAND_TLV(ANSI_A_E_MID, "");
10371 ELEM_OPT_TLV(ANSI_A_E_CELL_ID_LIST, "");
10373 ELEM_OPT_TV(ANSI_A_E_SCI, "");
10375 ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
10377 ELEM_OPT_TLV(ANSI_A_E_P_REV, "");
10379 ELEM_OPT_TLV(ANSI_A_E_MS_DES_FREQ, "");
10381 ELEM_OPT_TLV(ANSI_A_E_MOB_SUB_INFO, "");
10383 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10387 * IOS 5 3.3.18
10389 static void
10390 dtap_user_zone_reject(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
10392 guint32 curr_offset;
10393 guint32 consumed;
10394 guint curr_len;
10396 curr_offset = offset;
10397 curr_len = len;
10399 ELEM_OPT_TLV(ANSI_A_E_UZ_ID, "");
10401 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10405 * IOS 5 3.3.19
10407 static void
10408 bsmap_reg_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
10410 guint32 curr_offset;
10411 guint32 consumed;
10412 guint curr_len;
10414 curr_offset = offset;
10415 curr_len = len;
10417 ELEM_MAND_TLV(ANSI_A_E_MID, "");
10419 ELEM_OPT_TLV(ANSI_A_E_CELL_ID_LIST, "");
10421 ELEM_OPT_TV(ANSI_A_E_SCI, "");
10423 ELEM_OPT_TLV(ANSI_A_E_P_REV, "");
10425 ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
10427 ELEM_OPT_TLV(ANSI_A_E_MS_DES_FREQ, "");
10429 ELEM_OPT_TLV(ANSI_A_E_MOB_SUB_INFO, "");
10431 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10435 * IOS 5 3.3.20
10437 static void
10438 bsmap_ms_reg_noti(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
10440 guint32 curr_offset;
10441 guint32 consumed;
10442 guint curr_len;
10444 curr_offset = offset;
10445 curr_len = len;
10447 ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
10449 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10453 * IOS 5 3.3.21
10455 static void
10456 bsmap_bs_auth_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
10458 guint32 curr_offset;
10459 guint32 consumed;
10460 guint curr_len;
10462 curr_offset = offset;
10463 curr_len = len;
10465 ELEM_MAND_TLV(ANSI_A_E_MID, "");
10467 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10471 * IOS 5 3.3.22
10473 static void
10474 bsmap_bs_auth_req_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
10476 guint32 curr_offset;
10477 guint32 consumed;
10478 guint curr_len;
10480 curr_offset = offset;
10481 curr_len = len;
10483 ELEM_MAND_TLV(ANSI_A_E_MID, "");
10485 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10489 * IOS 6.1.4.4
10491 static void
10492 dtap_ssd_update_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip)
10494 guint32 curr_offset;
10495 guint32 consumed;
10496 guint curr_len;
10498 curr_offset = offset;
10499 curr_len = len;
10501 ELEM_MAND_LV(ANSI_A_E_AUTH_CHLG_PARAM, "", from_sip);
10503 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10507 * IOS 6.1.4.5
10509 static void
10510 dtap_bs_challenge(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip)
10512 guint32 curr_offset;
10513 guint32 consumed;
10514 guint curr_len;
10516 curr_offset = offset;
10517 curr_len = len;
10519 ELEM_MAND_LV(ANSI_A_E_AUTH_CHLG_PARAM, "", from_sip);
10521 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10525 * IOS 6.1.4.6
10527 static void
10528 dtap_bs_challenge_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip)
10530 guint32 curr_offset;
10531 guint32 consumed;
10532 guint curr_len;
10534 curr_offset = offset;
10535 curr_len = len;
10537 ELEM_MAND_LV(ANSI_A_E_AUTH_RESP_PARAM, "", from_sip);
10539 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10543 * IOS 6.1.4.7
10545 static void
10546 dtap_ssd_update_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
10548 guint32 curr_offset;
10549 guint32 consumed;
10550 guint curr_len;
10552 curr_offset = offset;
10553 curr_len = len;
10555 ELEM_OPT_TLV(ANSI_A_E_CAUSE_L3, "");
10557 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10561 * IOS 6.1.4.8
10563 static void
10564 dtap_lu_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip)
10566 guint32 curr_offset;
10567 guint32 consumed;
10568 guint curr_len;
10570 curr_offset = offset;
10571 curr_len = len;
10573 ELEM_MAND_LV(ANSI_A_E_MID, "", from_sip);
10575 ELEM_OPT_TV(ANSI_A_E_LAI, "");
10577 ELEM_OPT_TLV(ANSI_A_E_CM_INFO_TYPE_2, "");
10579 ELEM_OPT_TV(ANSI_A_E_REG_TYPE, "");
10581 ELEM_OPT_TLV(ANSI_A_E_MID, "");
10583 ELEM_OPT_TV(ANSI_A_E_SCI, "");
10585 ELEM_OPT_TLV(ANSI_A_E_AUTH_RESP_PARAM, "");
10587 ELEM_OPT_TV(ANSI_A_E_AUTH_CNF_PARAM, "");
10589 ELEM_OPT_TV(ANSI_A_E_AUTH_PARAM_COUNT, "");
10591 ELEM_OPT_TLV(ANSI_A_E_AUTH_CHLG_PARAM, "");
10593 ELEM_OPT_TLV(ANSI_A_E_AUTH_EVENT, "");
10595 ELEM_OPT_TLV(ANSI_A_E_UZ_ID, "");
10597 ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
10599 ELEM_OPT_TV(ANSI_A_E_RETURN_CAUSE, "");
10601 ELEM_OPT_TLV(ANSI_A_E_MS_DES_FREQ, "");
10603 ELEM_OPT_TLV(ANSI_A_E_MID, "");
10605 ELEM_OPT_TLV(ANSI_A_E_MOB_SUB_INFO, "");
10607 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10611 * IOS 6.1.4.9
10613 static void
10614 dtap_lu_accept(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
10616 guint32 curr_offset;
10617 guint32 consumed;
10618 guint curr_len;
10620 curr_offset = offset;
10621 curr_len = len;
10623 switch (global_a_variant)
10625 case A_VARIANT_IOS401:
10626 ELEM_OPT_TV(ANSI_A_E_LAI, "");
10627 break;
10629 case A_VARIANT_IOS501:
10630 ELEM_OPT_TLV(ANSI_A_E_CAUSE, "");
10632 ELEM_OPT_TLV(ANSI_A_E_P_REV, "");
10634 ELEM_OPT_TLV(ANSI_A_E_MS_DES_FREQ, "");
10635 break;
10638 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10642 * IOS 6.1.4.10
10644 static void
10645 dtap_lu_reject(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip)
10647 guint32 curr_offset;
10648 guint32 consumed;
10649 guint curr_len;
10651 curr_offset = offset;
10652 curr_len = len;
10654 ELEM_MAND_V(ANSI_A_E_REJ_CAUSE, from_sip);
10656 switch (global_a_variant)
10658 case A_VARIANT_IOS501:
10659 ELEM_OPT_TLV(ANSI_A_E_P_REV, "");
10661 ELEM_OPT_TLV(ANSI_A_E_MS_DES_FREQ, "");
10662 break;
10665 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10669 * IOS 6.1.4.18
10671 static void
10672 bsmap_priv_mode_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
10674 guint32 curr_offset;
10675 guint32 consumed;
10676 guint curr_len;
10678 curr_offset = offset;
10679 curr_len = len;
10681 ELEM_MAND_TLV(ANSI_A_E_ENC_INFO, "");
10683 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10687 * IOS 6.1.4.19
10689 static void
10690 bsmap_priv_mode_complete(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
10692 guint32 curr_offset;
10693 guint32 consumed;
10694 guint curr_len;
10696 curr_offset = offset;
10697 curr_len = len;
10699 ELEM_OPT_TLV(ANSI_A_E_ENC_INFO, "");
10701 ELEM_OPT_T(ANSI_A_E_VP_REQ, "");
10703 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10707 * IOS 5 3.3.14
10709 static void
10710 bsmap_status_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
10712 guint32 curr_offset;
10713 guint32 consumed;
10714 guint curr_len;
10716 curr_offset = offset;
10717 curr_len = len;
10719 ELEM_MAND_TLV(ANSI_A_E_IE_REQD, "");
10721 ELEM_OPT_TLV(ANSI_A_E_MID, "");
10723 ELEM_OPT_TLV(ANSI_A_E_MID, "");
10725 ELEM_OPT_TV(ANSI_A_E_SCI, "");
10727 ELEM_OPT_TLV(ANSI_A_E_CELL_ID_LIST, "");
10729 ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
10731 ELEM_OPT_TLV(ANSI_A_E_P_REV, "");
10733 ELEM_OPT_TLV(ANSI_A_E_MS_DES_FREQ, "");
10735 ELEM_OPT_TLV(ANSI_A_E_MID, "");
10737 ELEM_OPT_TV(ANSI_A_E_TAG, "");
10739 ELEM_OPT_TLV(ANSI_A_E_MOB_SUB_INFO, "");
10741 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10745 * IOS 5 3.3.14
10747 static void
10748 dtap_status_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip)
10750 guint32 curr_offset;
10751 guint32 consumed;
10752 guint curr_len;
10754 curr_offset = offset;
10755 curr_len = len;
10757 ELEM_MAND_LV(ANSI_A_E_IE_REQD, "", from_sip);
10759 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10764 * IOS 5 3.3.15
10766 static void
10767 bsmap_status_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
10769 guint32 curr_offset;
10770 guint32 consumed;
10771 guint curr_len;
10773 curr_offset = offset;
10774 curr_len = len;
10776 ELEM_MAND_TLV(ANSI_A_E_REV_MS_INFO_RECS, "");
10778 ELEM_OPT_TLV(ANSI_A_E_MID, "");
10780 ELEM_OPT_TLV(ANSI_A_E_MID, "");
10782 ELEM_OPT_TLV(ANSI_A_E_MID, "");
10784 ELEM_OPT_TV(ANSI_A_E_TAG, "");
10786 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10790 * IOS 5 3.3.15
10792 static void
10793 dtap_status_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip)
10795 guint32 curr_offset;
10796 guint32 consumed;
10797 guint curr_len;
10799 curr_offset = offset;
10800 curr_len = len;
10802 ELEM_MAND_LV(ANSI_A_E_REV_MS_INFO_RECS, "", from_sip);
10804 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10808 * IOS 6.1.5.4
10810 static void
10811 bsmap_ho_reqd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
10813 guint32 curr_offset;
10814 guint32 consumed;
10815 guint curr_len;
10817 curr_offset = offset;
10818 curr_len = len;
10820 ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
10822 ELEM_MAND_TLV(ANSI_A_E_CELL_ID_LIST, " (Target)");
10824 ELEM_OPT_TLV(ANSI_A_E_CM_INFO_TYPE_2, "");
10826 ELEM_OPT_T(ANSI_A_E_RESP_REQ, "");
10828 ELEM_OPT_TLV(ANSI_A_E_ENC_INFO, "");
10830 ELEM_OPT_TLV(ANSI_A_E_IS95_CHAN_ID, "");
10832 ELEM_OPT_TLV(ANSI_A_E_MID, "");
10834 ELEM_OPT_TLV(ANSI_A_E_DOWNLINK_RE, "");
10836 ELEM_OPT_TV(ANSI_A_E_SO, "");
10838 ELEM_OPT_TLV(ANSI_A_E_CDMA_SOWD, "");
10840 ELEM_OPT_TLV(ANSI_A_E_IS95_MS_MEAS_CHAN_ID, "");
10842 ELEM_OPT_TLV(ANSI_A_E_IS2000_CHAN_ID, "");
10844 ELEM_OPT_TLV(ANSI_A_E_QOS_PARAMS, "");
10846 ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
10848 ELEM_OPT_TLV(ANSI_A_E_IS2000_SCR, "");
10850 switch (global_a_variant)
10852 case A_VARIANT_IOS401:
10853 ELEM_OPT_TLV(ANSI_A_E_PDSN_IP_ADDR, "");
10854 break;
10856 case A_VARIANT_IOS501:
10857 ELEM_OPT_TLV(ANSI_A_E_S_PDSN_ADDR, "");
10858 break;
10861 ELEM_OPT_TLV(ANSI_A_E_PTYPE, "");
10863 ELEM_OPT_TLV(ANSI_A_E_SRNC_TRNC_TC, "");
10865 ELEM_OPT_TV(ANSI_A_E_SCI, "");
10867 ELEM_OPT_TV(ANSI_A_E_ACC_NET_ID, "");
10869 ELEM_OPT_TLV(ANSI_A_E_SO_LIST, "");
10871 ELEM_OPT_TLV(ANSI_A_E_IS2000_CHAN_ID_3X, "");
10873 ELEM_OPT_TLV(ANSI_A_E_IS2000_NN_SCR, "");
10875 ELEM_OPT_TLV(ANSI_A_E_ANCH_PDSN_ADDR, "");
10877 ELEM_OPT_TLV(ANSI_A_E_ANCH_PP_ADDR, "");
10879 ELEM_OPT_TLV(ANSI_A_E_PSP, "");
10881 ELEM_OPT_TLV(ANSI_A_E_PLCM_ID, "");
10883 ELEM_OPT_TLV(ANSI_A_E_MID, "");
10885 ELEM_OPT_TLV(ANSI_A_E_MOB_SUB_INFO, "");
10887 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10891 * IOS 6.1.5.5
10893 static void
10894 bsmap_ho_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
10896 guint32 curr_offset;
10897 guint32 consumed;
10898 guint curr_len;
10900 curr_offset = offset;
10901 curr_len = len;
10903 ELEM_MAND_TLV(ANSI_A_E_CHAN_TYPE, "");
10905 ELEM_MAND_TLV(ANSI_A_E_ENC_INFO, "");
10907 ELEM_MAND_TLV(ANSI_A_E_CM_INFO_TYPE_2, "");
10909 ELEM_MAND_TLV(ANSI_A_E_CELL_ID_LIST, "(Target)");
10911 ELEM_OPT_TLV(ANSI_A_E_CIC_EXT, "");
10913 ELEM_OPT_TLV(ANSI_A_E_IS95_CHAN_ID, "");
10915 ELEM_OPT_TLV(ANSI_A_E_MID, "");
10917 ELEM_OPT_TLV(ANSI_A_E_MID, "");
10919 ELEM_OPT_TLV(ANSI_A_E_DOWNLINK_RE, "");
10921 ELEM_OPT_TV(ANSI_A_E_SO, "");
10923 ELEM_OPT_TLV(ANSI_A_E_CDMA_SOWD, "");
10925 ELEM_OPT_TLV(ANSI_A_E_IS95_MS_MEAS_CHAN_ID, "");
10927 ELEM_OPT_TLV(ANSI_A_E_IS2000_CHAN_ID, "");
10929 ELEM_OPT_TLV(ANSI_A_E_QOS_PARAMS, "");
10931 ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
10933 ELEM_OPT_TLV(ANSI_A_E_IS2000_SCR, "");
10935 switch (global_a_variant)
10937 case A_VARIANT_IOS401:
10938 ELEM_OPT_TLV(ANSI_A_E_PDSN_IP_ADDR, "");
10939 break;
10941 case A_VARIANT_IOS501:
10942 ELEM_OPT_TLV(ANSI_A_E_S_PDSN_ADDR, "");
10943 break;
10946 ELEM_OPT_TLV(ANSI_A_E_PTYPE, "");
10948 switch (global_a_variant)
10950 case A_VARIANT_IOS501:
10951 ELEM_OPT_TLV(ANSI_A_E_SRNC_TRNC_TC, "");
10953 ELEM_OPT_TV(ANSI_A_E_SCI, "");
10955 ELEM_OPT_TV(ANSI_A_E_ACC_NET_ID, "");
10957 ELEM_OPT_TLV(ANSI_A_E_SO_LIST, "");
10959 ELEM_OPT_TLV(ANSI_A_E_IS2000_CHAN_ID_3X, "");
10961 ELEM_OPT_TLV(ANSI_A_E_IS2000_NN_SCR, "");
10963 ELEM_OPT_TLV(ANSI_A_E_ANCH_PDSN_ADDR, "");
10965 ELEM_OPT_TLV(ANSI_A_E_ANCH_PP_ADDR, "");
10967 ELEM_OPT_TLV(ANSI_A_E_PSP, "");
10969 ELEM_OPT_TLV(ANSI_A_E_PLCM_ID, "");
10971 ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_SESSION, "");
10973 ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_FORMAT, "");
10975 ELEM_OPT_TLV(ANSI_A_E_MID, "");
10977 ELEM_OPT_TLV(ANSI_A_E_MOB_SUB_INFO, "");
10978 break;
10981 EXTRANEOUS_DATA_CHECK(curr_len, 0);
10985 * IOS 6.1.5.6
10987 static void
10988 bsmap_ho_req_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
10990 guint32 curr_offset;
10991 guint32 consumed;
10992 guint curr_len;
10994 curr_offset = offset;
10995 curr_len = len;
10997 ELEM_OPT_TLV(ANSI_A_E_IS95_CHAN_ID, "");
10999 ELEM_OPT_TLV(ANSI_A_E_CELL_ID_LIST, "");
11001 ELEM_OPT_TLV(ANSI_A_E_EXT_HO_DIR_PARAMS, "");
11003 ELEM_OPT_TV(ANSI_A_E_HHO_PARAMS, "");
11005 ELEM_OPT_TLV(ANSI_A_E_IS2000_CHAN_ID, "");
11007 ELEM_OPT_TLV(ANSI_A_E_IS2000_SCR, "");
11009 ELEM_OPT_TLV(ANSI_A_E_IS2000_NN_SCR, "");
11011 switch (global_a_variant)
11013 case A_VARIANT_IOS501:
11014 ELEM_OPT_TLV(ANSI_A_E_TRNC_SRNC_TC, "");
11016 ELEM_OPT_TLV(ANSI_A_E_SO_LIST, "");
11018 ELEM_OPT_TLV(ANSI_A_E_CAUSE, "");
11020 ELEM_OPT_TLV(ANSI_A_E_IS2000_CHAN_ID_3X, "");
11022 ELEM_OPT_TLV(ANSI_A_E_PLCM_ID, "");
11024 ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_SESSION, "");
11026 ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_FORMAT, "");
11027 break;
11030 EXTRANEOUS_DATA_CHECK(curr_len, 0);
11034 * IOS 6.1.5.7
11036 static void
11037 bsmap_ho_failure(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
11039 guint32 curr_offset;
11040 guint32 consumed;
11041 guint curr_len;
11043 curr_offset = offset;
11044 curr_len = len;
11046 ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
11048 EXTRANEOUS_DATA_CHECK(curr_len, 0);
11052 * IOS 6.1.5.8
11054 static void
11055 bsmap_ho_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
11057 guint32 curr_offset;
11058 guint32 consumed;
11059 guint curr_len;
11061 curr_offset = offset;
11062 curr_len = len;
11064 ELEM_OPT_TV(ANSI_A_E_RF_CHAN_ID, "");
11066 ELEM_OPT_TLV(ANSI_A_E_IS95_CHAN_ID, "");
11068 ELEM_OPT_TLV(ANSI_A_E_CELL_ID_LIST, "");
11070 ELEM_OPT_TLV(ANSI_A_E_HO_POW_LEV, "");
11072 ELEM_OPT_TV(ANSI_A_E_SID, "");
11074 ELEM_OPT_TLV(ANSI_A_E_EXT_HO_DIR_PARAMS, "");
11076 ELEM_OPT_TV(ANSI_A_E_HHO_PARAMS, "");
11078 ELEM_OPT_TLV(ANSI_A_E_IS2000_CHAN_ID, "");
11080 ELEM_OPT_TLV(ANSI_A_E_IS2000_SCR, "");
11082 ELEM_OPT_TLV(ANSI_A_E_IS2000_NN_SCR, "");
11084 switch (global_a_variant)
11086 case A_VARIANT_IOS501:
11087 ELEM_OPT_TLV(ANSI_A_E_TRNC_SRNC_TC, "");
11089 ELEM_OPT_TLV(ANSI_A_E_SO_LIST, "");
11091 ELEM_OPT_TLV(ANSI_A_E_CAUSE, "");
11093 ELEM_OPT_TLV(ANSI_A_E_AMPS_HHO_PARAM, "");
11095 ELEM_OPT_TLV(ANSI_A_E_IS2000_CHAN_ID_3X, "");
11097 ELEM_OPT_TLV(ANSI_A_E_PLCM_ID, "");
11098 break;
11101 EXTRANEOUS_DATA_CHECK(curr_len, 0);
11105 * IOS 5 3.4.6
11107 static void
11108 bsmap_ho_complete(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
11110 guint32 curr_offset;
11111 guint32 consumed;
11112 guint curr_len;
11114 curr_offset = offset;
11115 curr_len = len;
11117 ELEM_OPT_TV(ANSI_A_E_SO, "");
11119 EXTRANEOUS_DATA_CHECK(curr_len, 0);
11123 * IOS 6.1.5.9
11125 static void
11126 bsmap_ho_reqd_rej(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
11128 guint32 curr_offset;
11129 guint32 consumed;
11130 guint curr_len;
11132 curr_offset = offset;
11133 curr_len = len;
11135 ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
11137 EXTRANEOUS_DATA_CHECK(curr_len, 0);
11141 * IOS 6.1.5.12
11143 static void
11144 bsmap_ho_performed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
11146 guint32 curr_offset;
11147 guint32 consumed;
11148 guint curr_len;
11150 curr_offset = offset;
11151 curr_len = len;
11153 ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
11155 ELEM_OPT_TLV(ANSI_A_E_CELL_ID_LIST, "");
11157 ELEM_OPT_TV(ANSI_A_E_CHAN_NUM, "");
11159 ELEM_OPT_TLV(ANSI_A_E_BAND_CLASS, "");
11161 ELEM_OPT_TLV(ANSI_A_E_MOB_SUB_INFO, "");
11163 EXTRANEOUS_DATA_CHECK(curr_len, 0);
11167 * IOS 6.1.6.2
11169 static void
11170 bsmap_block(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
11172 guint32 curr_offset;
11173 guint32 consumed;
11174 guint curr_len;
11176 curr_offset = offset;
11177 curr_len = len;
11179 ELEM_MAND_TV(ANSI_A_E_CIC, "");
11181 ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
11183 ELEM_OPT_TLV(ANSI_A_E_CCT_GROUP, "");
11185 EXTRANEOUS_DATA_CHECK(curr_len, 0);
11189 * IOS 6.1.6.3
11191 static void
11192 bsmap_block_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
11194 guint32 curr_offset;
11195 guint32 consumed;
11196 guint curr_len;
11198 curr_offset = offset;
11199 curr_len = len;
11201 ELEM_MAND_TV(ANSI_A_E_CIC, "");
11203 EXTRANEOUS_DATA_CHECK(curr_len, 0);
11207 * IOS 6.1.6.4
11209 static void
11210 bsmap_unblock(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
11212 guint32 curr_offset;
11213 guint32 consumed;
11214 guint curr_len;
11216 curr_offset = offset;
11217 curr_len = len;
11219 ELEM_MAND_TV(ANSI_A_E_CIC, "");
11221 ELEM_OPT_TLV(ANSI_A_E_CCT_GROUP, "");
11223 EXTRANEOUS_DATA_CHECK(curr_len, 0);
11227 * IOS 6.1.6.5
11229 static void
11230 bsmap_unblock_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
11232 guint32 curr_offset;
11233 guint32 consumed;
11234 guint curr_len;
11236 curr_offset = offset;
11237 curr_len = len;
11239 ELEM_MAND_TV(ANSI_A_E_CIC, "");
11241 EXTRANEOUS_DATA_CHECK(curr_len, 0);
11245 * IOS 6.1.6.6
11247 static void
11248 bsmap_reset(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
11250 guint32 curr_offset;
11251 guint32 consumed;
11252 guint curr_len;
11254 curr_offset = offset;
11255 curr_len = len;
11257 ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
11259 ELEM_OPT_TLV(ANSI_A_E_SW_VER, "");
11261 EXTRANEOUS_DATA_CHECK(curr_len, 0);
11265 * IOS 6.1.6.7
11267 static void
11268 bsmap_reset_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
11270 guint32 curr_offset;
11271 guint32 consumed;
11272 guint curr_len;
11274 curr_offset = offset;
11275 curr_len = len;
11277 ELEM_OPT_TLV(ANSI_A_E_SW_VER, "");
11279 EXTRANEOUS_DATA_CHECK(curr_len, 0);
11283 * IOS 6.1.6.8
11285 static void
11286 bsmap_reset_cct(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
11288 guint32 curr_offset;
11289 guint32 consumed;
11290 guint curr_len;
11292 curr_offset = offset;
11293 curr_len = len;
11295 ELEM_MAND_TV(ANSI_A_E_CIC, "");
11297 ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
11299 ELEM_OPT_TLV(ANSI_A_E_CCT_GROUP, "");
11301 EXTRANEOUS_DATA_CHECK(curr_len, 0);
11305 * IOS 6.1.6.9
11307 static void
11308 bsmap_reset_cct_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
11310 guint32 curr_offset;
11311 guint32 consumed;
11312 guint curr_len;
11314 curr_offset = offset;
11315 curr_len = len;
11317 ELEM_MAND_TV(ANSI_A_E_CIC, "");
11319 EXTRANEOUS_DATA_CHECK(curr_len, 0);
11323 * IOS 6.1.6.10
11325 static void
11326 bsmap_xmode_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
11328 guint32 curr_offset;
11329 guint32 consumed;
11330 guint curr_len;
11332 curr_offset = offset;
11333 curr_len = len;
11335 ELEM_MAND_TLV(ANSI_A_E_XMODE, "");
11337 EXTRANEOUS_DATA_CHECK(curr_len, 0);
11341 * IOS 6.1.6.11
11343 static void
11344 bsmap_xmode_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
11346 guint32 curr_offset;
11347 guint32 consumed;
11348 guint curr_len;
11350 curr_offset = offset;
11351 curr_len = len;
11353 ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
11355 EXTRANEOUS_DATA_CHECK(curr_len, 0);
11359 * IOS 6.1.7.1
11361 static void
11362 bsmap_adds_page(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
11364 guint32 curr_offset;
11365 guint32 consumed;
11366 guint curr_len;
11368 curr_offset = offset;
11369 curr_len = len;
11371 ELEM_MAND_TLV(ANSI_A_E_MID, "");
11373 ELEM_MAND_TLV(ANSI_A_E_ADDS_USER_PART, "");
11375 ELEM_OPT_TV(ANSI_A_E_TAG, "");
11377 ELEM_OPT_TLV(ANSI_A_E_CELL_ID_LIST, "");
11379 ELEM_OPT_TV(ANSI_A_E_SCI, "");
11381 ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
11383 ELEM_OPT_TLV(ANSI_A_E_P_REV, "");
11385 ELEM_OPT_TLV(ANSI_A_E_MS_DES_FREQ, "");
11387 ELEM_OPT_TLV(ANSI_A_E_MOB_SUB_INFO, "");
11389 EXTRANEOUS_DATA_CHECK(curr_len, 0);
11393 * IOS 6.1.7.2
11395 static void
11396 bsmap_adds_transfer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
11398 guint32 curr_offset;
11399 guint32 consumed;
11400 guint curr_len;
11402 curr_offset = offset;
11403 curr_len = len;
11405 ELEM_MAND_TLV(ANSI_A_E_MID, "");
11407 ELEM_MAND_TLV(ANSI_A_E_ADDS_USER_PART, "");
11409 ELEM_OPT_TLV(ANSI_A_E_MID, "");
11411 ELEM_OPT_TLV(ANSI_A_E_AUTH_RESP_PARAM, "");
11413 ELEM_OPT_TV(ANSI_A_E_AUTH_CNF_PARAM, "");
11415 ELEM_OPT_TV(ANSI_A_E_AUTH_PARAM_COUNT, "");
11417 ELEM_OPT_TLV(ANSI_A_E_AUTH_CHLG_PARAM, "");
11419 ELEM_OPT_TLV(ANSI_A_E_AUTH_EVENT, "");
11421 ELEM_OPT_TLV(ANSI_A_E_CELL_ID, "");
11423 ELEM_OPT_TLV(ANSI_A_E_CDMA_SOWD, "");
11425 ELEM_OPT_TLV(ANSI_A_E_AUTH_DATA, "");
11427 ELEM_OPT_TV(ANSI_A_E_TAG, "");
11429 ELEM_OPT_TLV(ANSI_A_E_CM_INFO_TYPE_2, "");
11431 ELEM_OPT_TV(ANSI_A_E_SCI, "");
11433 ELEM_OPT_TV(ANSI_A_E_SO, "");
11435 ELEM_OPT_TLV(ANSI_A_E_UZ_ID, "");
11437 ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
11439 ELEM_OPT_TLV(ANSI_A_E_MID, "");
11441 ELEM_OPT_TLV(ANSI_A_E_MOB_SUB_INFO, "");
11443 EXTRANEOUS_DATA_CHECK(curr_len, 0);
11447 * IOS 5 3.6.4
11449 static void
11450 bsmap_adds_transfer_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
11452 guint32 curr_offset;
11453 guint32 consumed;
11454 guint curr_len;
11456 curr_offset = offset;
11457 curr_len = len;
11459 ELEM_MAND_TLV(ANSI_A_E_MID, "");
11461 ELEM_OPT_TV(ANSI_A_E_TAG, "");
11463 ELEM_OPT_TLV(ANSI_A_E_CAUSE, "");
11465 EXTRANEOUS_DATA_CHECK(curr_len, 0);
11469 * IOS 6.1.7.3
11471 static void
11472 dtap_adds_deliver(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip)
11474 guint32 curr_offset;
11475 guint32 consumed;
11476 guint curr_len;
11478 curr_offset = offset;
11479 curr_len = len;
11481 ELEM_MAND_LV(ANSI_A_E_ADDS_USER_PART, "", from_sip);
11483 ELEM_OPT_TV(ANSI_A_E_TAG, "");
11485 ELEM_OPT_TLV(ANSI_A_E_CDMA_SOWD, "");
11487 EXTRANEOUS_DATA_CHECK(curr_len, 0);
11491 * IOS 6.1.7.4
11493 static void
11494 bsmap_adds_page_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
11496 guint32 curr_offset;
11497 guint32 consumed;
11498 guint curr_len;
11500 curr_offset = offset;
11501 curr_len = len;
11503 ELEM_MAND_TLV(ANSI_A_E_MID, "");
11505 ELEM_OPT_TV(ANSI_A_E_TAG, "");
11507 ELEM_OPT_TLV(ANSI_A_E_MID, "");
11509 ELEM_OPT_TLV(ANSI_A_E_CAUSE, "");
11511 ELEM_OPT_TLV(ANSI_A_E_CELL_ID, "");
11513 ELEM_OPT_TLV(ANSI_A_E_MID, "");
11515 EXTRANEOUS_DATA_CHECK(curr_len, 0);
11519 * IOS 6.1.7.5
11521 static void
11522 dtap_adds_deliver_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
11524 guint32 curr_offset;
11525 guint32 consumed;
11526 guint curr_len;
11528 curr_offset = offset;
11529 curr_len = len;
11531 ELEM_OPT_TV(ANSI_A_E_TAG, "");
11533 ELEM_OPT_TLV(ANSI_A_E_CAUSE, "");
11535 EXTRANEOUS_DATA_CHECK(curr_len, 0);
11539 * IOS 6.1.8.1
11541 static void
11542 bsmap_rejection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
11544 guint32 curr_offset;
11545 guint32 consumed;
11546 guint curr_len;
11548 curr_offset = offset;
11549 curr_len = len;
11551 ELEM_OPT_TLV(ANSI_A_E_MID, "");
11553 ELEM_OPT_TLV(ANSI_A_E_MID, "");
11555 ELEM_OPT_TLV(ANSI_A_E_IS2000_CAUSE, "");
11557 ELEM_OPT_TLV(ANSI_A_E_MID, "");
11559 EXTRANEOUS_DATA_CHECK(curr_len, 0);
11562 static void
11563 dtap_rejection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_)
11565 guint32 curr_offset;
11566 guint32 consumed;
11567 guint curr_len;
11569 curr_offset = offset;
11570 curr_len = len;
11572 ELEM_OPT_TLV(ANSI_A_E_MID, "");
11574 ELEM_OPT_TLV(ANSI_A_E_IS2000_CAUSE, "");
11576 ELEM_OPT_TLV(ANSI_A_E_SOCI, "");
11578 ELEM_OPT_TLV(ANSI_A_E_MID, "");
11580 EXTRANEOUS_DATA_CHECK(curr_len, 0);
11583 #define ANSI_A_IOS401_BSMAP_NUM_MSG (sizeof(ansi_a_ios401_bsmap_strings)/sizeof(ext_value_string_t))
11584 #define ANSI_A_IOS501_BSMAP_NUM_MSG (sizeof(ansi_a_ios501_bsmap_strings)/sizeof(ext_value_string_t))
11585 static gint ett_bsmap_msg[MAX(ANSI_A_IOS401_BSMAP_NUM_MSG, ANSI_A_IOS501_BSMAP_NUM_MSG)];
11586 static void (*bsmap_msg_fcn[])(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip) =
11588 bsmap_add_srvc_noti, /* Additional Service Notification */
11589 bsmap_adds_page, /* ADDS Page */
11590 bsmap_adds_page_ack, /* ADDS Page Ack */
11591 bsmap_adds_transfer, /* ADDS Transfer */
11592 bsmap_adds_transfer_ack, /* ADDS Transfer Ack */
11593 bsmap_ass_complete, /* Assignment Complete */
11594 bsmap_ass_failure, /* Assignment Failure */
11595 bsmap_ass_req, /* Assignment Request */
11596 bsmap_auth_req, /* Authentication Request */
11597 bsmap_auth_resp, /* Authentication Response */
11598 NULL /* no BSMAP definition */, /* Base Station Challenge */
11599 NULL /* no BSMAP definition */, /* Base Station Challenge Response */
11600 bsmap_block, /* Block */
11601 bsmap_block_ack, /* Block Acknowledge */
11602 bsmap_bs_srvc_req, /* BS Service Request */
11603 bsmap_bs_srvc_resp, /* BS Service Response */
11604 bsmap_clr_command, /* Clear Command */
11605 bsmap_clr_complete, /* Clear Complete */
11606 bsmap_clr_req, /* Clear Request */
11607 bsmap_cl3_info, /* Complete Layer 3 Information */
11608 bsmap_feat_noti, /* Feature Notification */
11609 bsmap_feat_noti_ack, /* Feature Notification Ack */
11610 bsmap_ho_command, /* Handoff Command */
11611 NULL /* no associated data */, /* Handoff Commenced */
11612 bsmap_ho_complete, /* Handoff Complete */
11613 bsmap_ho_failure, /* Handoff Failure */
11614 bsmap_ho_performed, /* Handoff Performed */
11615 bsmap_ho_req, /* Handoff Request */
11616 bsmap_ho_req_ack, /* Handoff Request Acknowledge */
11617 bsmap_ho_reqd, /* Handoff Required */
11618 bsmap_ho_reqd_rej, /* Handoff Required Reject */
11619 bsmap_paca_command, /* PACA Command */
11620 bsmap_paca_command_ack, /* PACA Command Ack */
11621 bsmap_paca_update, /* PACA Update */
11622 bsmap_paca_update_ack, /* PACA Update Ack */
11623 bsmap_page_req, /* Paging Request */
11624 bsmap_priv_mode_command, /* Privacy Mode Command */
11625 bsmap_priv_mode_complete, /* Privacy Mode Complete */
11626 bsmap_rm_pos_req, /* Radio Measurements for Position Request */
11627 bsmap_rm_pos_resp, /* Radio Measurements for Position Response */
11628 bsmap_rejection, /* Rejection */
11629 bsmap_reg_req, /* Registration Request */
11630 bsmap_reset, /* Reset */
11631 bsmap_reset_ack, /* Reset Acknowledge */
11632 bsmap_reset_cct, /* Reset Circuit */
11633 bsmap_reset_cct_ack, /* Reset Circuit Acknowledge */
11634 NULL /* no BSMAP definition */, /* SSD Update Request */
11635 NULL /* no BSMAP definition */, /* SSD Update Response */
11636 bsmap_status_req, /* Status Request */
11637 bsmap_status_resp, /* Status Response */
11638 bsmap_xmode_ack, /* Transcoder Control Acknowledge */
11639 bsmap_xmode_req, /* Transcoder Control Request */
11640 bsmap_unblock, /* Unblock */
11641 bsmap_unblock_ack, /* Unblock Acknowledge */
11642 bsmap_user_zone_reject, /* User Zone Reject */
11643 bsmap_user_zone_update, /* User Zone Update */
11644 bsmap_bearer_upd_req, /* Bearer Update Request *//* IOS 5.0.1 */
11645 bsmap_bearer_upd_resp, /* Bearer Update Response *//* IOS 5.0.1 */
11646 bsmap_bearer_upd_reqd, /* Bearer Update Required *//* IOS 5.0.1 */
11647 bsmap_ms_reg_noti, /* Mobile Station Registered Notification *//* IOS 5.0.1 */
11648 bsmap_bs_auth_req, /* BS Authentication Request *//* IOS 5.0.1 */
11649 bsmap_bs_auth_req_ack, /* BS Authentication Request Ack *//* IOS 5.0.1 */
11650 NULL, /* NONE */
11653 #define ANSI_A_IOS401_DTAP_NUM_MSG (sizeof(ansi_a_ios401_dtap_strings)/sizeof(ext_value_string_t))
11654 #define ANSI_A_IOS501_DTAP_NUM_MSG (sizeof(ansi_a_ios501_dtap_strings)/sizeof(ext_value_string_t))
11655 static gint ett_dtap_msg[MAX(ANSI_A_IOS401_DTAP_NUM_MSG, ANSI_A_IOS501_DTAP_NUM_MSG)];
11656 static void (*dtap_msg_fcn[])(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip) =
11658 dtap_add_srvc_req, /* Additional Service Request */
11659 dtap_adds_deliver, /* ADDS Deliver */
11660 dtap_adds_deliver_ack, /* ADDS Deliver Ack */
11661 dtap_alert_with_info, /* Alert With Information */
11662 dtap_auth_req, /* Authentication Request */
11663 dtap_auth_resp, /* Authentication Response */
11664 dtap_bs_challenge, /* Base Station Challenge */
11665 dtap_bs_challenge_resp, /* Base Station Challenge Response */
11666 dtap_cm_srvc_req, /* CM Service Request */
11667 dtap_cm_srvc_req_cont, /* CM Service Request Continuation */
11668 dtap_connect, /* Connect */
11669 dtap_flash_with_info, /* Flash with Information */
11670 dtap_flash_with_info_ack, /* Flash with Information Ack */
11671 dtap_lu_accept, /* Location Updating Accept */
11672 dtap_lu_reject, /* Location Updating Reject */
11673 dtap_lu_req, /* Location Updating Request */
11674 dtap_page_resp, /* Paging Response */
11675 NULL /* no associated data */, /* Parameter Update Confirm */
11676 NULL /* no associated data */, /* Parameter Update Request */
11677 dtap_rejection, /* Rejection */
11678 dtap_progress, /* Progress */
11679 dtap_srvc_redirection, /* Service Redirection */
11680 dtap_srvc_release, /* Service Release */
11681 dtap_srvc_release_complete, /* Service Release Complete */
11682 dtap_ssd_update_req, /* SSD Update Request */
11683 dtap_ssd_update_resp, /* SSD Update Response */
11684 dtap_status_req, /* Status Request */
11685 dtap_status_resp, /* Status Response */
11686 dtap_user_zone_reject, /* User Zone Reject */
11687 dtap_user_zone_update, /* User Zone Update */
11688 dtap_user_zone_update_req, /* User Zone Update Request */
11689 NULL, /* NONE */
11692 /* Utillity function to dissect CDMA200 A1 elements in ANSI MAP messages */
11693 void
11694 dissect_cdma2000_a1_elements(tvbuff_t *tvb, _U_ packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
11696 guint32 curr_offset;
11697 guint32 consumed;
11698 guint curr_len;
11699 unsigned idx;
11700 guint8 oct;
11702 curr_offset = offset;
11703 curr_len = len;
11706 * require at least 2 octets for T(ype) and L(ength)
11708 while (curr_len > 1)
11711 * peeking at T(ype)
11713 oct = tvb_get_guint8(tvb, curr_offset);
11715 for (idx=0; idx < (unsigned)ansi_a_elem_1_max; idx++)
11717 if (oct == (guint8) ansi_a_elem_1_strings[idx].value)
11719 ELEM_OPT_TLV((elem_idx_t)idx, "");
11720 break;
11724 if (idx == (elem_idx_t)ansi_a_elem_1_max)
11727 * didn't recognize the T(ype)
11728 * assuming it is in TLV form, step over
11730 consumed = 2 + tvb_get_guint8(tvb, curr_offset + 1);
11731 curr_offset += consumed;
11732 curr_len -= consumed;
11736 EXTRANEOUS_DATA_CHECK_EXPERT(curr_len, 0);
11739 /* GENERIC DISSECTOR FUNCTIONS */
11741 static void
11742 dissect_bsmap_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean from_sip)
11744 static ansi_a_tap_rec_t tap_rec[16];
11745 static ansi_a_tap_rec_t *tap_p;
11746 static int tap_current=0;
11747 guint8 oct;
11748 guint32 offset, saved_offset;
11749 guint32 len;
11750 gint dec_idx;
11751 proto_item *bsmap_item = NULL;
11752 proto_tree *bsmap_tree = NULL;
11753 const gchar *msg_str;
11756 col_append_str(pinfo->cinfo, COL_INFO, "(BSMAP) ");
11759 * set tap record pointer
11761 tap_current++;
11762 if (tap_current == array_length(tap_rec))
11764 tap_current = 0;
11766 tap_p = &tap_rec[tap_current];
11769 offset = 0;
11770 saved_offset = offset;
11772 g_tree = tree;
11774 len = tvb_length(tvb);
11777 * add BSMAP message name
11779 oct = tvb_get_guint8(tvb, offset++);
11781 msg_str = my_try_val_to_str_idx((guint32) oct, ansi_a_bsmap_strings, &dec_idx);
11784 * create the a protocol tree
11786 if (msg_str == NULL)
11788 bsmap_item =
11789 proto_tree_add_protocol_format(tree, proto_a_bsmap, tvb, 0, len,
11790 "ANSI A-I/F BSMAP - Unknown BSMAP Message Type (%u)",
11791 oct);
11793 bsmap_tree = proto_item_add_subtree(bsmap_item, ett_bsmap);
11795 else
11797 bsmap_item =
11798 proto_tree_add_protocol_format(tree, proto_a_bsmap, tvb, 0, -1,
11799 "ANSI A-I/F BSMAP - %s",
11800 msg_str);
11802 bsmap_tree = proto_item_add_subtree(bsmap_item, ett_bsmap_msg[dec_idx]);
11804 col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", msg_str);
11808 * add BSMAP message name
11810 proto_tree_add_uint_format(bsmap_tree, hf_ansi_a_bsmap_msgtype,
11811 tvb, saved_offset, 1, oct, "Message Type");
11813 tap_p->pdu_type = BSSAP_PDU_TYPE_BSMAP;
11814 tap_p->message_type = oct;
11816 tap_queue_packet(ansi_a_tap, pinfo, tap_p);
11818 if (msg_str == NULL) return;
11820 if ((len - offset) <= 0) return;
11822 a_meid_configured = FALSE;
11825 * decode elements
11827 if (bsmap_msg_fcn[dec_idx] == NULL)
11829 proto_tree_add_text(bsmap_tree,
11830 tvb, offset, len - offset,
11831 "Message Elements");
11833 else
11835 (*bsmap_msg_fcn[dec_idx])(tvb, pinfo, bsmap_tree, offset, len - offset, from_sip);
11839 static void
11840 dissect_bsmap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
11842 dissect_bsmap_common(tvb, pinfo, tree, FALSE);
11845 static void
11846 dissect_dtap_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean from_sip)
11848 static ansi_a_tap_rec_t tap_rec[16];
11849 static ansi_a_tap_rec_t *tap_p;
11850 static int tap_current=0;
11851 guint8 oct;
11852 guint32 offset, saved_offset;
11853 guint32 len;
11854 guint32 oct_1=0, oct_2=0;
11855 gint dec_idx;
11856 proto_item *dtap_item = NULL;
11857 proto_tree *dtap_tree = NULL;
11858 proto_item *oct_1_item = NULL;
11859 proto_tree *oct_1_tree = NULL;
11860 const gchar *msg_str;
11861 const gchar *str;
11863 len = tvb_length(tvb);
11865 if ((len < 3) && !from_sip)
11868 * too short to be DTAP
11870 call_dissector(data_handle, tvb, pinfo, tree);
11871 return;
11874 col_append_str(pinfo->cinfo, COL_INFO, "(DTAP) ");
11877 * set tap record pointer
11879 tap_current++;
11880 if (tap_current == array_length(tap_rec))
11882 tap_current = 0;
11884 tap_p = &tap_rec[tap_current];
11887 offset = 0;
11888 saved_offset = offset;
11890 g_tree = tree;
11893 * get protocol discriminator
11895 if (!from_sip) {
11896 oct_1 = tvb_get_guint8(tvb, offset++);
11897 oct_2 = tvb_get_guint8(tvb, offset++);
11901 * add DTAP message name
11903 oct = tvb_get_guint8(tvb, offset++);
11905 msg_str = my_try_val_to_str_idx((guint32) oct, ansi_a_dtap_strings, &dec_idx);
11908 * create the a protocol tree
11910 if (msg_str == NULL)
11912 dtap_item =
11913 proto_tree_add_protocol_format(tree, proto_a_dtap, tvb, 0, len,
11914 "ANSI A-I/F DTAP - Unknown DTAP Message Type (%u)",
11915 oct);
11917 dtap_tree = proto_item_add_subtree(dtap_item, ett_dtap);
11919 else
11921 dtap_item =
11922 proto_tree_add_protocol_format(tree, proto_a_dtap, tvb, 0, -1,
11923 "ANSI A-I/F DTAP - %s",
11924 msg_str);
11926 dtap_tree = proto_item_add_subtree(dtap_item, ett_dtap_msg[dec_idx]);
11928 col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", msg_str);
11931 if (!from_sip) {
11933 * octet 1
11935 switch (oct_1 & 0x0f)
11937 case 3: str = "Call Control, call related SS"; break;
11938 case 5: str = "Mobility Management"; break;
11939 case 6: str = "Radio Resource Management"; break;
11940 case 9: str = "Facility Management"; break;
11941 case 11: str = "Other Signaling Procedures"; break;
11942 case 15: str = "Reserved for tests"; break;
11943 default:
11944 str = "Unknown";
11945 break;
11948 oct_1_item =
11949 proto_tree_add_text(dtap_tree,
11950 tvb, 0, 1,
11951 "Protocol Discriminator: %s",
11952 str);
11954 oct_1_tree = proto_item_add_subtree(oct_1_item, ett_dtap_oct_1);
11956 other_decode_bitfield_value(a_bigbuf, oct_1, 0xf0, 8);
11957 proto_tree_add_text(oct_1_tree,
11958 tvb, 0, 1,
11959 "%s : Reserved",
11960 a_bigbuf);
11962 other_decode_bitfield_value(a_bigbuf, oct_1, 0x0f, 8);
11963 proto_tree_add_text(oct_1_tree,
11964 tvb, 0, 1,
11965 "%s : Protocol Discriminator: %u",
11966 a_bigbuf,
11967 oct_1 & 0x0f);
11970 * octet 2
11972 switch (global_a_variant)
11974 case A_VARIANT_IS634:
11975 other_decode_bitfield_value(a_bigbuf, oct_2, 0x80, 8);
11976 proto_tree_add_text(dtap_tree,
11977 tvb, 1, 1,
11978 "%s : Transaction Identifier (TI) Flag: %s",
11979 a_bigbuf,
11980 ((oct_2 & 0x80) ? "allocated by receiver" : "allocated by sender"));
11982 other_decode_bitfield_value(a_bigbuf, oct_2, 0x70, 8);
11983 proto_tree_add_text(dtap_tree,
11984 tvb, 1, 1,
11985 "%s : Transaction Identifier (TI): %u",
11986 a_bigbuf,
11987 (oct_2 & 0x70) >> 4);
11989 other_decode_bitfield_value(a_bigbuf, oct_2, 0x0f, 8);
11990 proto_tree_add_text(dtap_tree,
11991 tvb, 1, 1,
11992 "%s : Reserved",
11993 a_bigbuf);
11994 break;
11996 default:
11997 proto_tree_add_text(dtap_tree,
11998 tvb, 1, 1,
11999 "Reserved Octet");
12000 break;
12005 * add DTAP message name
12007 proto_tree_add_uint_format(dtap_tree, hf_ansi_a_dtap_msgtype,
12008 tvb, saved_offset, 1, oct,
12009 "Message Type");
12011 tap_p->pdu_type = BSSAP_PDU_TYPE_DTAP;
12012 tap_p->message_type = oct;
12014 tap_queue_packet(ansi_a_tap, pinfo, tap_p);
12016 if (msg_str == NULL) return;
12018 if ((len - offset) <= 0) return;
12020 a_meid_configured = FALSE;
12023 * decode elements
12025 if (dtap_msg_fcn[dec_idx] == NULL)
12027 proto_tree_add_text(dtap_tree,
12028 tvb, offset, len - offset,
12029 "Message Elements");
12031 else
12033 (*dtap_msg_fcn[dec_idx])(tvb, pinfo, dtap_tree, offset, len - offset, from_sip);
12037 static void
12038 dissect_dtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
12040 dissect_dtap_common(tvb, pinfo, tree, FALSE);
12043 static void
12044 dissect_sip_dtap_bsmap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
12046 gint linelen, offset, next_offset, begin;
12047 guint8 *msg_type;
12048 tvbuff_t *ansi_a_tvb;
12049 gboolean is_dtap = TRUE;
12051 offset = 0;
12052 if ((linelen = tvb_find_line_end(tvb, offset, -1, &next_offset, TRUE)) > 0) {
12053 if (linelen >= 2) {
12054 ansi_a_tvb = tvb_new_composite();
12055 msg_type = (guint8*)wmem_alloc(pinfo->pool, 1);
12056 msg_type[0] = (guint8)strtoul(tvb_get_string(wmem_packet_scope(), tvb, offset, 2), NULL, 16);
12057 if ((begin = tvb_find_guint8(tvb, offset, linelen, '"')) > 0) {
12058 if (tvb_get_guint8(tvb, begin + 1) == '1') {
12059 is_dtap = FALSE;
12061 } else {
12062 if (my_try_val_to_str_idx((guint32) msg_type[0], ansi_a_dtap_strings, &linelen) == NULL) {
12063 is_dtap = FALSE;
12066 tvb_composite_append(ansi_a_tvb, tvb_new_child_real_data(tvb, msg_type, 1, 1));
12067 offset = next_offset;
12068 while ((linelen = tvb_find_line_end(tvb, offset, -1, &next_offset, TRUE)) > 0) {
12069 if ((begin = tvb_find_guint8(tvb, offset, linelen, '=')) > 0) {
12070 begin++;
12071 tvb_composite_append(ansi_a_tvb, base64_to_tvb(tvb, tvb_get_string(wmem_packet_scope(), tvb, begin, offset + linelen - begin)));
12073 offset = next_offset;
12075 tvb_composite_finalize(ansi_a_tvb);
12076 if (is_dtap) {
12077 add_new_data_source(pinfo, ansi_a_tvb, "ANSI DTAP");
12078 dissect_dtap_common(ansi_a_tvb, pinfo, tree, TRUE);
12079 } else {
12080 add_new_data_source(pinfo, ansi_a_tvb, "ANSI BSMAP");
12081 dissect_bsmap_common(ansi_a_tvb, pinfo, tree, TRUE);
12087 /* Register the protocol with Wireshark */
12088 void
12089 proto_register_ansi_a(void)
12091 module_t *ansi_a_module;
12092 guint i;
12093 gint last_offset;
12095 /* Setup list of header fields */
12097 static hf_register_info hf[] =
12099 { &hf_ansi_a_bsmap_msgtype,
12100 { "BSMAP Message Type", "ansi_a_bsmap.msgtype",
12101 FT_UINT8, BASE_HEX, NULL, 0x0,
12102 NULL, HFILL }
12104 { &hf_ansi_a_dtap_msgtype,
12105 { "DTAP Message Type", "ansi_a_bsmap.dtap_msgtype",
12106 FT_UINT8, BASE_HEX, NULL, 0x0,
12107 NULL, HFILL }
12109 { &hf_ansi_a_elem_id,
12110 { "Element ID", "ansi_a_bsmap.elem_id",
12111 FT_UINT8, BASE_DEC, NULL, 0,
12112 NULL, HFILL }
12114 { &hf_ansi_a_length,
12115 { "Length", "ansi_a_bsmap.len",
12116 FT_UINT8, BASE_DEC, NULL, 0,
12117 NULL, HFILL }
12119 #if 0
12120 { &hf_ansi_a_none,
12121 { "Sub tree", "ansi_a_bsmap.none",
12122 FT_NONE, BASE_NONE, 0, 0,
12123 NULL, HFILL }
12125 #endif
12126 { &hf_ansi_a_esn,
12127 { "ESN", "ansi_a_bsmap.esn",
12128 FT_UINT32, BASE_HEX, 0, 0x0,
12129 NULL, HFILL }
12131 { &hf_ansi_a_imsi,
12132 { "IMSI", "ansi_a_bsmap.imsi",
12133 FT_STRING, BASE_NONE, 0, 0,
12134 NULL, HFILL }
12136 { &hf_ansi_a_min,
12137 { "MIN", "ansi_a_bsmap.min",
12138 FT_STRING, BASE_NONE, 0, 0,
12139 NULL, HFILL }
12141 { &hf_ansi_a_meid,
12142 { "MEID", "ansi_a_bsmap.meid",
12143 FT_STRING, BASE_NONE, 0, 0,
12144 NULL, HFILL }
12146 { &hf_ansi_a_cld_party_bcd_num,
12147 { "Called Party BCD Number", "ansi_a_bsmap.cld_party_bcd_num",
12148 FT_STRING, BASE_NONE, 0, 0,
12149 NULL, HFILL }
12151 #ifdef MAYBE_USED_FOR_OLDER_CODECS
12152 { &hf_ansi_a_clg_party_bcd_num,
12153 { "Calling Party BCD Number", "ansi_a_bsmap.clg_party_bcd_num",
12154 FT_STRING, BASE_NONE, 0, 0,
12155 NULL, HFILL }
12157 #endif
12158 { &hf_ansi_a_cld_party_ascii_num,
12159 { "Called Party ASCII Number", "ansi_a_bsmap.cld_party_ascii_num",
12160 FT_STRING, BASE_NONE, 0, 0,
12161 NULL, HFILL }
12163 { &hf_ansi_a_clg_party_ascii_num,
12164 { "Calling Party ASCII Number", "ansi_a_bsmap.clg_party_ascii_num",
12165 FT_STRING, BASE_NONE, 0, 0,
12166 NULL, HFILL }
12168 { &hf_ansi_a_cell_ci,
12169 { "Cell CI", "ansi_a_bsmap.cell_ci",
12170 FT_UINT16, BASE_HEX, 0, 0x0,
12171 NULL, HFILL }
12173 { &hf_ansi_a_cell_lac,
12174 { "Cell LAC", "ansi_a_bsmap.cell_lac",
12175 FT_UINT16, BASE_HEX, 0, 0x0,
12176 NULL, HFILL }
12178 { &hf_ansi_a_cell_mscid,
12179 { "Cell MSCID", "ansi_a_bsmap.cell_mscid",
12180 FT_UINT24, BASE_HEX, 0, 0x0,
12181 NULL, HFILL }
12183 { &hf_ansi_a_pdsn_ip_addr,
12184 { "PDSN IP Address", "ansi_a_bsmap.pdsn_ip_addr",
12185 FT_IPv4, BASE_NONE, NULL, 0,
12186 "IP Address", HFILL }
12188 { &hf_ansi_a_s_pdsn_ip_addr,
12189 { "Source PDSN Address", "ansi_a_bsmap.s_pdsn_ip_addr",
12190 FT_IPv4, BASE_NONE, NULL, 0,
12191 "IP Address", HFILL }
12193 { &hf_ansi_a_anchor_ip_addr,
12194 { "Anchor PDSN Address", "ansi_a_bsmap.anchor_pdsn_ip_addr",
12195 FT_IPv4, BASE_NONE, NULL, 0,
12196 "IP Address", HFILL }
12198 { &hf_ansi_a_anchor_pp_ip_addr,
12199 { "Anchor P-P Address", "ansi_a_bsmap.anchor_pp_ip_addr",
12200 FT_IPv4, BASE_NONE, NULL, 0,
12201 "IP Address", HFILL }
12203 { &hf_ansi_a_a2p_bearer_ipv4_addr,
12204 { "A2p Bearer IP Address", "ansi_a_bsmap.a2p_bearer_ipv4_addr",
12205 FT_IPv4, BASE_NONE, NULL, 0,
12206 NULL, HFILL }
12208 { &hf_ansi_a_a2p_bearer_ipv6_addr,
12209 { "A2p Bearer IP Address", "ansi_a_bsmap.a2p_bearer_ipv6_addr",
12210 FT_IPv6, BASE_NONE, NULL, 0,
12211 NULL, HFILL }
12213 { &hf_ansi_a_a2p_bearer_udp_port,
12214 { "A2p Bearer UDP Port", "ansi_a_bsmap.a2p_bearer_udp_port",
12215 FT_UINT16, BASE_DEC, NULL, 0,
12216 NULL, HFILL }
12218 { &hf_ansi_a_so,
12219 { "Service Option", "ansi_a_bsmap.so",
12220 FT_UINT16, BASE_DEC, NULL, 0,
12221 NULL, HFILL }
12223 { &hf_ansi_a_cause_1,
12224 { "Cause", "ansi_a_bsmap.cause_1",
12225 FT_UINT8, BASE_DEC, NULL, 0,
12226 NULL, HFILL }
12228 { &hf_ansi_a_cause_2,
12229 { "Cause", "ansi_a_bsmap.cause_2",
12230 FT_UINT16, BASE_DEC, NULL, 0,
12231 NULL, HFILL }
12233 { &hf_ansi_a_meid_configured,
12234 { "Is MEID configured", "ansi_a_bsmap.meid_configured",
12235 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
12236 NULL, HFILL }
12238 { &hf_ansi_a_ms_info_rec_signal_type,
12239 { "Signal Type", "ansi_a_bsmap.ms_info_rec.signal.type",
12240 FT_UINT8, BASE_HEX, VALS(ansi_a_ms_info_rec_signal_type_vals), 0xc0,
12241 NULL, HFILL }
12243 { &hf_ansi_a_ms_info_rec_signal_alert_pitch,
12244 { "Alert Type", "ansi_a_bsmap.ms_info_rec.signal.alert_pitch",
12245 FT_UINT8, BASE_HEX, VALS(ansi_a_ms_info_rec_signal_alert_pitch_vals), 0x30,
12246 NULL, HFILL }
12248 { &hf_ansi_a_ms_info_rec_signal_tone,
12249 { "Signal", "ansi_a_bsmap.ms_info_rec.signal.tone",
12250 FT_UINT16, BASE_HEX, VALS(ansi_a_ms_info_rec_signal_tone_vals), 0x0fc0,
12251 NULL, HFILL }
12253 { &hf_ansi_a_ms_info_rec_signal_isdn_alert,
12254 { "Signal", "ansi_a_bsmap.ms_info_rec.signal.isdn_alert",
12255 FT_UINT16, BASE_HEX, VALS(ansi_a_ms_info_rec_signal_isdn_alert_vals), 0x0fc0,
12256 NULL, HFILL }
12258 { &hf_ansi_a_ms_info_rec_signal_is54b_alert,
12259 { "Signal", "ansi_a_bsmap.ms_info_rec.signal.is54b_alert",
12260 FT_UINT16, BASE_HEX, VALS(ansi_a_ms_info_rec_signal_is54b_alert_vals), 0x0fc0,
12261 NULL, HFILL }
12263 { &hf_ansi_a_ms_info_rec_call_waiting_ind,
12264 { "Call Waiting Indicator", "ansi_a_bsmap.ms_info_rec.call_waiting_ind",
12265 FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x80,
12266 NULL, HFILL }
12270 static ei_register_info ei[] = {
12271 { &ei_ansi_a_extraneous_data, { "ansi_a.extraneous_data", PI_PROTOCOL, PI_NOTE, "Extraneous Data, dissector bug or later version spec(report to wireshark.org)", EXPFILL }},
12274 expert_module_t* expert_a_bsmap;
12276 static const enum_val_t a_variant_options[] = {
12277 { "is-634-rev0", "IS-634 rev. 0", A_VARIANT_IS634 },
12278 { "tsb-80", "TSB-80", A_VARIANT_TSB80 },
12279 { "is-634-a", "IS-634-A", A_VARIANT_IS634A },
12280 { "ios-2.x", "IOS 2.x", A_VARIANT_IOS2 },
12281 { "ios-3.x", "IOS 3.x", A_VARIANT_IOS3 },
12282 { "ios-4.0.1", "IOS 4.0.1", A_VARIANT_IOS401 },
12283 { "ios-5.0.1", "IOS 5.0.1", A_VARIANT_IOS501 },
12284 { NULL, NULL, 0 }
12288 /* Setup protocol subtree array */
12289 #define MAX_NUM_DTAP_MSG MAX(ANSI_A_IOS401_DTAP_NUM_MSG, ANSI_A_IOS501_DTAP_NUM_MSG)
12290 #define MAX_NUM_BSMAP_MSG MAX(ANSI_A_IOS401_BSMAP_NUM_MSG, ANSI_A_IOS501_BSMAP_NUM_MSG)
12291 #define MAX_NUM_ELEM_1 MAX(MAX_IOS401_NUM_ELEM_1, MAX_IOS501_NUM_ELEM_1)
12292 #define NUM_INDIVIDUAL_ELEMS 18
12293 gint **ett;
12294 gint ett_len = (NUM_INDIVIDUAL_ELEMS+MAX_NUM_DTAP_MSG+MAX_NUM_BSMAP_MSG+MAX_NUM_ELEM_1+NUM_FWD_MS_INFO_REC+NUM_REV_MS_INFO_REC) * sizeof(gint *);
12297 * XXX - at least one version of the HP C compiler apparently doesn't
12298 * recognize constant expressions using the "?" operator as being
12299 * constant expressions, so you can't use the expression that
12300 * initializes "ett_let" as an array size. Therefore, we dynamically
12301 * allocate the array instead.
12303 ett = (gint **) g_malloc(ett_len);
12305 memset((void *) ett_dtap_msg, -1, sizeof(ett_dtap_msg));
12306 memset((void *) ett_bsmap_msg, -1, sizeof(ett_bsmap_msg));
12307 memset((void *) ett_ansi_elem_1, -1, sizeof(ett_ansi_elem_1));
12308 memset((void *) ett_ansi_fwd_ms_info_rec, -1, sizeof(gint) * NUM_FWD_MS_INFO_REC);
12309 memset((void *) ett_ansi_rev_ms_info_rec, -1, sizeof(gint) * NUM_REV_MS_INFO_REC);
12311 ett[0] = &ett_bsmap;
12312 ett[1] = &ett_dtap;
12313 ett[2] = &ett_elems;
12314 ett[3] = &ett_elem;
12315 ett[4] = &ett_dtap_oct_1;
12316 ett[5] = &ett_cm_srvc_type;
12317 ett[6] = &ett_ansi_ms_info_rec_reserved;
12318 ett[7] = &ett_ansi_enc_info;
12319 ett[8] = &ett_cell_list;
12320 ett[9] = &ett_bearer_list;
12321 ett[10] = &ett_re_list;
12322 ett[11] = &ett_so_list;
12323 ett[12] = &ett_scm;
12324 ett[13] = &ett_adds_user_part;
12325 ett[14] = &ett_scr;
12326 ett[15] = &ett_srvc_con_rec;
12327 ett[16] = &ett_cm2_band_class;
12328 ett[17] = &ett_vp_algs;
12330 last_offset = NUM_INDIVIDUAL_ELEMS;
12332 for (i=0; i < MAX_NUM_DTAP_MSG; i++, last_offset++)
12334 ett[last_offset] = &ett_dtap_msg[i];
12337 for (i=0; i < MAX_NUM_BSMAP_MSG; i++, last_offset++)
12339 ett[last_offset] = &ett_bsmap_msg[i];
12342 for (i=0; i < MAX_NUM_ELEM_1; i++, last_offset++)
12344 ett[last_offset] = &ett_ansi_elem_1[i];
12347 for (i=0; i < NUM_FWD_MS_INFO_REC; i++, last_offset++)
12349 ett[last_offset] = &ett_ansi_fwd_ms_info_rec[i];
12352 for (i=0; i < NUM_REV_MS_INFO_REC; i++, last_offset++)
12354 ett[last_offset] = &ett_ansi_rev_ms_info_rec[i];
12357 /* Register the protocol name and description */
12359 proto_a_bsmap =
12360 proto_register_protocol("ANSI A-I/F BSMAP", "ANSI BSMAP", "ansi_a_bsmap");
12362 proto_register_field_array(proto_a_bsmap, hf, array_length(hf));
12363 expert_a_bsmap = expert_register_protocol(proto_a_bsmap);
12364 expert_register_field_array(expert_a_bsmap, ei, array_length(ei));
12366 proto_a_dtap =
12367 proto_register_protocol("ANSI A-I/F DTAP", "ANSI DTAP", "ansi_a_dtap");
12369 is637_dissector_table =
12370 register_dissector_table("ansi_a.sms", "IS-637-A (SMS)",
12371 FT_UINT8, BASE_DEC);
12373 is683_dissector_table =
12374 register_dissector_table("ansi_a.ota", "IS-683-A (OTA)",
12375 FT_UINT8, BASE_DEC);
12377 is801_dissector_table =
12378 register_dissector_table("ansi_a.pld", "IS-801 (PLD)",
12379 FT_UINT8, BASE_DEC);
12381 proto_register_subtree_array(ett, ett_len / (int)sizeof(gint *));
12383 ansi_a_tap = register_tap("ansi_a");
12386 * setup for preferences
12388 ansi_a_module = prefs_register_protocol(proto_a_bsmap, proto_reg_handoff_ansi_a);
12390 prefs_register_enum_preference(ansi_a_module,
12391 "global_variant",
12392 "Dissect PDU as",
12393 "(if other than the default of IOS 4.0.1)",
12394 &global_a_variant,
12395 a_variant_options,
12396 FALSE);
12398 g_free(ett);
12402 void
12403 proto_reg_handoff_ansi_a(void)
12405 static gboolean ansi_a_prefs_initialized = FALSE;
12407 if (!ansi_a_prefs_initialized)
12409 dissector_handle_t bsmap_handle, sip_dtap_bsmap_handle;
12410 bsmap_handle = create_dissector_handle(dissect_bsmap, proto_a_bsmap);
12411 dtap_handle = create_dissector_handle(dissect_dtap, proto_a_dtap);
12412 sip_dtap_bsmap_handle = create_dissector_handle(dissect_sip_dtap_bsmap, proto_a_dtap);
12413 data_handle = find_dissector("data");
12415 dissector_add_uint("bsap.pdu_type", BSSAP_PDU_TYPE_BSMAP, bsmap_handle);
12416 dissector_add_uint("bsap.pdu_type", BSSAP_PDU_TYPE_DTAP, dtap_handle);
12417 dissector_add_string("media_type", "application/femtointerfacemsg", sip_dtap_bsmap_handle);
12418 dissector_add_string("media_type", "application/vnd.3gpp2.femtointerfacemsg", sip_dtap_bsmap_handle);
12420 ansi_a_prefs_initialized = TRUE;
12423 switch (global_a_variant)
12425 case A_VARIANT_IOS501:
12426 ansi_a_bsmap_strings = ansi_a_ios501_bsmap_strings;
12427 ansi_a_dtap_strings = ansi_a_ios501_dtap_strings;
12428 ansi_a_elem_1_strings = ansi_a_ios501_elem_1_strings;
12429 ansi_a_elem_1_max = (elem_idx_t)MAX_IOS501_NUM_ELEM_1;
12430 break;
12432 default:
12433 ansi_a_bsmap_strings = ansi_a_ios401_bsmap_strings;
12434 ansi_a_dtap_strings = ansi_a_ios401_dtap_strings;
12435 ansi_a_elem_1_strings = ansi_a_ios401_elem_1_strings;
12436 ansi_a_elem_1_max = (elem_idx_t)MAX_IOS401_NUM_ELEM_1;
12437 break;