2 * Routines for ANSI IS-683 (OTA (Mobile)) dissection
4 * Copyright 2003, Michael Lum <mlum [AT] telostech.com>
5 * In association with Telos Technology Inc.
6 * Copyright 2008, Michael Lum <mglum [AT] shaw.ca>
7 * In association with Global Star Solutions, ULC.
10 * http://www.3gpp2.org/Public_html/specs/C.S0016-C_v2.0_081031.pdf
12 * Wireshark - Network traffic analyzer
13 * By Gerald Combs <gerald@wireshark.org>
14 * Copyright 1998 Gerald Combs
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License
18 * as published by the Free Software Foundation; either version 2
19 * of the License, or (at your option) any later version.
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
35 #include <epan/packet.h>
36 #include <epan/to_str.h>
38 void proto_register_ansi_683(void);
39 void proto_reg_handoff_ansi_683(void);
42 static const char *ansi_proto_name = "ANSI IS-683 (OTA (Mobile))";
43 static const char *ansi_proto_name_short = "IS-683";
45 #define ANSI_683_FORWARD 0
46 #define ANSI_683_REVERSE 1
49 /* Initialize the subtree pointers */
50 static gint ett_ansi_683 = -1;
51 static gint ett_for_nam_block = -1;
52 static gint ett_for_sspr_block = -1;
53 static gint ett_rev_sspr_block = -1;
54 static gint ett_rev_nam_block = -1;
55 static gint ett_key_p = -1;
56 static gint ett_key_g = -1;
57 static gint ett_rev_feat = -1;
58 static gint ett_for_val_block = -1;
59 static gint ett_band_cap = -1;
60 static gint ett_scm = -1;
61 static gint ett_for_puzl_block = -1;
62 static gint ett_rev_puzl_block = -1;
63 static gint ett_for_3gpd_block = -1;
64 static gint ett_rev_3gpd_block = -1;
65 static gint ett_for_mmd_block = -1;
66 static gint ett_rev_mmd_block = -1;
67 static gint ett_for_mms_block = -1;
68 static gint ett_rev_mms_block = -1;
69 static gint ett_rev_cap = -1;
70 static gint ett_segment = -1;
72 /* Initialize the protocol and registered fields */
73 static int proto_ansi_683 = -1;
74 static int hf_ansi_683_none = -1;
75 static int hf_ansi_683_for_msg_type = -1;
76 static int hf_ansi_683_rev_msg_type = -1;
77 static int hf_ansi_683_length = -1;
79 static char bigbuf[1024];
81 static const char dtmf_digits[16] = {'?','1','2','3','4','5','6','7','8','9','0','?','?','?','?','?'};
82 static const char bcd_digits[16] = {'0','1','2','3','4','5','6','7','8','9','?','?','?','?','?','?'};
88 #define EXTRANEOUS_DATA_CHECK(edc_len, edc_max_len) \
89 if ((edc_len) > (edc_max_len)) \
91 proto_tree_add_none_format(tree, hf_ansi_683_none, tvb, \
92 offset, (edc_len) - (edc_max_len), "Extraneous Data"); \
95 #define SHORT_DATA_CHECK(sdc_len, sdc_min_len) \
96 if ((sdc_len) < (sdc_min_len)) \
98 proto_tree_add_none_format(tree, hf_ansi_683_none, tvb, \
99 offset, (sdc_len), "Short Data (?)"); \
103 #define EXACT_DATA_CHECK(edc_len, edc_eq_len) \
104 if ((edc_len) != (edc_eq_len)) \
106 proto_tree_add_none_format(tree, hf_ansi_683_none, tvb, \
107 offset, (edc_len), "Unexpected Data Length"); \
112 fresh_handler(tvbuff_t *tvb, proto_tree *tree, guint len _U_, guint32 offset)
117 oct = tvb_get_guint8(tvb, offset);
121 value = tvb_get_ntohs(tvb, offset);
123 other_decode_bitfield_value(bigbuf, value, 0x8000, 16);
124 proto_tree_add_none_format(tree, hf_ansi_683_none,
126 "%s : FRESH_INCL : TRUE",
129 other_decode_bitfield_value(bigbuf, value, 0x7fff, 16);
130 proto_tree_add_none_format(tree, hf_ansi_683_none,
138 other_decode_bitfield_value(bigbuf, oct, 0x80, 8);
139 proto_tree_add_none_format(tree, hf_ansi_683_none,
141 "%s : FRESH_INCL : FALSE",
144 other_decode_bitfield_value(bigbuf, oct, 0x7f, 8);
145 proto_tree_add_none_format(tree, hf_ansi_683_none,
154 * Table 3.5.1.2-1 Result Codes
157 rev_res_code_type(guint8 res_code)
163 case 0: str = "Accepted - Operation successful"; break;
164 case 1: str = "Rejected - Unknown reason"; break;
165 case 2: str = "Rejected - Data size mismatch"; break;
166 case 3: str = "Rejected - Protocol version mismatch"; break;
167 case 4: str = "Rejected - Invalid parameter"; break;
168 case 5: str = "Rejected - SID/NID length mismatch"; break;
169 case 6: str = "Rejected - Message not expected in this mode"; break;
170 case 7: str = "Rejected - BLOCK_ID value not supported"; break;
171 case 8: str = "Rejected - Preferred roaming list length mismatch"; break;
172 case 9: str = "Rejected - CRC error"; break;
173 case 10: str = "Rejected - Mobile station locked"; break;
174 case 11: str = "Rejected - Invalid SPC"; break;
175 case 12: str = "Rejected - SPC change denied by the user"; break;
176 case 13: str = "Rejected - Invalid SPASM"; break;
177 case 14: str = "Rejected - BLOCK_ID not expected in this mode"; break;
178 case 15: str = "Rejected - User Zone already in PUZL"; break;
179 case 16: str = " Rejected - User Zone not in PUZL"; break;
180 case 17: str = " Rejected - No entries in PUZL"; break;
181 case 18: str = "Rejected - Operation Mode mismatch"; break;
182 case 19: str = "Rejected - SimpleIP MAX_NUM_NAI mismatch"; break;
183 case 20: str = "Rejected - SimpleIP MAX_NAI_LENGTH mismatch"; break;
184 case 21: str = "Rejected - MobileIP MAX_NUM_NAI mismatch"; break;
185 case 22: str = "Rejected - MobileIP MAX_NAI_LENGTH mismatch"; break;
186 case 23: str = "Rejected - SimpleIP PAP MAX_SS_LENGTH mismatch"; break;
187 case 24: str = "Rejected - SimpleIP CHAP MAX_SS_LENGTH mismatch"; break;
188 case 25: str = "Rejected - MobileIP MAX_MNAAA_SS_LENGTH mismatch"; break;
189 case 26: str = "Rejected - MobileIP MAX_MN-HA_SS_LENGTH mismatch"; break;
190 case 27: str = "Rejected - MobileIP MN-AAA_AUTH_ALGORITHM mismatch"; break;
191 case 28: str = "Rejected - MobileIP MN-HA_AUTH_ALGORITHM mismatch"; break;
192 case 29: str = "Rejected - SimpleIP ACT_NAI_ENTRY_INDEX mismatch"; break;
193 case 30: str = "Rejected - MobileIP ACT_NAI_ENTRY_INDEX mismatch"; break;
194 case 31: str = "Rejected - SimpleIP PAP NAI_ENTRY_INDEX mismatch"; break;
195 case 32: str = "Rejected - SimpleIP CHAP NAI_ENTRY_INDEX mismatch"; break;
196 case 33: str = "Rejected - MobileIP NAI_ENTRY_INDEX mismatch"; break;
197 case 34: str = "Rejected - Unexpected PRL_BLOCK_ID change"; break;
198 case 35: str = "Rejected - PRL format mismatch"; break;
199 case 36: str = "Rejected - HRPD Access Authentication MAX_NAI_LENGTH mismatch"; break;
200 case 37: str = "Rejected - HRPD Access Authentication CHAP MAX_SS_LENGTH mismatch"; break;
201 case 38: str = " Rejected - MMD MAX_NUM_IMPU mismatch"; break;
202 case 39: str = " Rejected - MMD MAX_IMPU_LENGTH mismatch"; break;
203 case 40: str = " Rejected - MMD MAX_NUM_P-CSCF mismatch"; break;
204 case 41: str = " Rejected - MMD MAX_P-CSCF_LENGTH mismatch"; break;
205 case 42: str = " Rejected - Unexpected System Tag BLOCK_ID Change"; break;
206 case 43: str = " Rejected - System Tag Format mismatch"; break;
207 case 44: str = " Rejected - NUM_MMS_URI mismatch"; break;
208 case 45: str = " Rejected - MMS_URI _LENGTH mismatch"; break;
209 case 46: str = " Rejected - Invalid MMS_URI"; break;
211 if ((res_code >= 47) && (res_code <= 127)) { str = "Reserved for future standardization"; break; }
212 else if ((res_code >= 128) && (res_code <= 254)) { str = "Available for manufacturer-specific Result Code definitions"; break; }
213 else { str = "Reserved"; break; }
220 * Table 3.5.1.7-1 Feature Identifier
223 rev_feat_id_type(guint8 feat_id)
229 case 0: str = "NAM Download (DATA_P_REV)"; break;
230 case 1: str = "Key Exchange (A_KEY_P_REV)"; break;
231 case 2: str = "System Selection for Preferred Roaming (SSPR_P_REV)"; break;
232 case 3: str = "Service Programming Lock (SPL_P_REV)"; break;
233 case 4: str = "Over-The-Air Parameter Administration (OTAPA_P_REV)"; break;
234 case 5: str = "Preferred User Zone List (PUZL_P_REV)"; break;
235 case 6: str = "3G Packet Data (3GPD)"; break;
236 case 7: str = "Secure MODE (SECURE_MODE_P_REV)"; break;
237 case 8: str = "Multimedia Domain (MMD)"; break;
238 case 9: str = "System Tag Download (TAG_P_REV)"; break;
239 case 10: str = "Multimedia Messaging Service (MMS)"; break;
241 if ((feat_id >= 11) && (feat_id <= 191)) { str = "Reserved for future standardization"; break; }
242 else if ((feat_id >= 192) && (feat_id <= 254)) { str = "Available for manufacturer-specific features"; break; }
243 else { str = "Reserved"; break; }
249 #define REV_TYPE_CAP_INFO_OP_MODE 0
250 #define REV_TYPE_CAP_INFO_CDMA_BAND 1
251 #define REV_TYPE_CAP_INFO_MEID 2
252 #define REV_TYPE_CAP_INFO_ICCID 3
253 #define REV_TYPE_CAP_INFO_EXT_UIM_ID 4
254 #define REV_TYPE_CAP_INFO_MEID_ME 5
257 * Table 3.5.1.17.1-1 Capability Information Record Types
260 rev_cap_info_record_type(guint8 rec_type)
266 case 0: str = "Operating Mode Information"; break;
267 case 1: str = "CDMA Band Class Information"; break;
268 case 2: str = "MEID"; break;
269 case 3: str = "ICCID"; break;
270 case 4: str = "EXT_UIM_ID"; break;
271 case 5: str = "MEID_ME"; break;
273 str = "Reserved"; break;
279 #define FOR_BLOCK_VAL_VERIFY_SPC 0
280 #define FOR_BLOCK_VAL_CHANGE_SPC 1
281 #define FOR_BLOCK_VAL_VALDATE_SPASM 2
284 * Table 4.5.4-1 Validation Parameter Block Types
287 for_param_block_val(guint8 block_type)
293 case 0: str = "Verify SPC"; break;
294 case 1: str = "Change SPC"; break;
295 case 2: str = "Validate SPASM"; break;
297 if ((block_type >= 3) && (block_type <= 127)) { str = "Reserved for future standardization"; break; }
298 else if ((block_type >= 128) && (block_type <= 254)) { str = "Available for manufacturer-specific parameter block definitions"; break; }
299 else { str = "Reserved"; break; }
305 #define REV_BLOCK_SSPR_PRL_DIM 0
306 #define REV_BLOCK_SSPR_PRL 1
307 #define REV_BLOCK_SSPR_EXT_PRL_DIM 2
310 * Table 3.5.3-1 SSPR Parameter Block Types
313 rev_param_block_sspr(guint8 block_type)
319 case 0: str = "Preferred Roaming List Dimensions"; break;
320 case 1: str = "Preferred Roaming List"; break;
321 case 2: str = "Extended Preferred Roaming List Dimensions"; break;
323 if ((block_type >= 3) && (block_type <= 127)) { str = "Reserved for future standardization"; break; }
324 else if ((block_type >= 128) && (block_type <= 254)) { str = "Available for manufacturer-specific parameter block definitions"; break; }
325 else { str = "Reserved"; break; }
331 #define FOR_BLOCK_SSPR_PRL 0
332 #define FOR_BLOCK_SSPR_EXT_PRL 1
335 * Table 4.5.3-1 SSPR Parameter Block Types
338 for_param_block_sspr(guint8 block_type)
344 case 0: str = "Preferred Roaming List"; break;
345 case 1: str = "Extended Preferred Roaming List with SSPR_P_REV greater than 00000001"; break;
347 if ((block_type >= 2) && (block_type <= 127)) { str = "Reserved for future standardization"; break; }
348 else if ((block_type >= 128) && (block_type <= 254)) { str = "Available for manufacturer-specific parameter block definitions"; break; }
349 else { str = "Reserved"; break; }
355 #define REV_BLOCK_NAM_CDMA_ANALOG 0
356 #define REV_BLOCK_NAM_MDN 1
357 #define REV_BLOCK_NAM_CDMA 2
358 #define REV_BLOCK_NAM_IMSI_T 3
361 * Table 3.5.2-1 NAM Parameter Block Types
364 rev_param_block_nam(guint8 block_type)
370 case 0: str = "CDMA/Analog NAM"; break;
371 case 1: str = "Mobile Directory Number"; break;
372 case 2: str = "CDMA NAM"; break;
373 case 3: str = "IMSI_T"; break;
375 if ((block_type >= 4) && (block_type <= 127)) { str = "Reserved for future standardization"; break; }
376 else if ((block_type >= 128) && (block_type <= 254)) { str = "Available for manufacturer-specific parameter block definitions"; break; }
377 else { str = "Reserved"; break; }
383 #define FOR_BLOCK_NAM_CDMA_ANALOG 0
384 #define FOR_BLOCK_NAM_MDN 1
385 #define FOR_BLOCK_NAM_CDMA 2
386 #define FOR_BLOCK_NAM_IMSI_T 3
389 * Table 4.5.2-1 NAM Parameter Block Types
392 for_param_block_nam(guint8 block_type)
398 case 0: str = "CDMA/Analog NAM Download"; break;
399 case 1: str = "Mobile Directory Number"; break;
400 case 2: str = "CDMA NAM Download"; break;
401 case 3: str = "IMSI_T"; break;
403 if ((block_type >= 4) && (block_type <= 127)) { str = "Reserved for future standardization"; break; }
404 else if ((block_type >= 128) && (block_type <= 254)) { str = "Available for manufacturer-specific parameter block definitions"; break; }
405 else { str = "Reserved"; break; }
412 * Table 3.5.6-1 PUZL Parameter Block Types
415 rev_param_block_puzl(guint8 block_type)
421 case 0: str = "PUZL Dimensions"; break;
422 case 1: str = "PUZL Priorities"; break;
423 case 2: str = "User Zone"; break;
424 case 3: str = "Preferred User Zone List"; break;
426 if ((block_type >= 4) && (block_type <= 127)) { str = "Reserved for future standardization"; break; }
427 else if ((block_type >= 128) && (block_type <= 254)) { str = "Available for manufacturer-specific parameter block definitions"; break; }
428 else { str = "Reserved"; break; }
434 #define FOR_BLOCK_PUZL_UZ_INS 0
435 #define FOR_BLOCK_PUZL_UZ_UPD 1
436 #define FOR_BLOCK_PUZL_UZ_DEL 2
437 #define FOR_BLOCK_PUZL_UZ_PRI_CHANGE 3
438 #define FOR_BLOCK_PUZL_FLAGS 4
441 * Table 4.5.6-1 PUZL Parameter Block Types
444 for_param_block_puzl(guint8 block_type)
450 case 0: str = "User Zone Insert"; break;
451 case 1: str = "User Zone Update"; break;
452 case 2: str = "User Zone Delete"; break;
453 case 3: str = "User Zone Priority Change"; break;
454 case 4: str = "PUZL Flags"; break;
456 if ((block_type >= 5) && (block_type <= 127)) { str = "Reserved for future standardization"; break; }
457 else if ((block_type >= 128) && (block_type <= 254)) { str = "Available for manufacturer-specific parameter block definitions"; break; }
458 else { str = "Reserved"; break; }
464 #define REV_BLOCK_3GPD_OP_CAP 0
465 #define REV_BLOCK_3GPD_OP_MODE 1
466 #define REV_BLOCK_3GPD_SIP_CAP 2
467 #define REV_BLOCK_3GPD_MIP_CAP 3
468 #define REV_BLOCK_3GPD_SIP_USER_PRO 4
469 #define REV_BLOCK_3GPD_MIP_USER_PRO 5
470 #define REV_BLOCK_3GPD_SIP_STATUS 6
471 #define REV_BLOCK_3GPD_MIP_STATUS 7
472 #define REV_BLOCK_3GPD_SIP_PAP_SS 8
473 #define REV_BLOCK_3GPD_SIP_CHAP_SS 9
474 #define REV_BLOCK_3GPD_MIP_SS 10
475 #define REV_BLOCK_3GPD_HRPD_ACC_AUTH_CAP 11
476 #define REV_BLOCK_3GPD_HRPD_ACC_AUTH_USER 12
477 #define REV_BLOCK_3GPD_HRPD_ACC_AUTH_CHAP_SS 13
480 * Table 3.5.8-1 3GPD Parameter Block Types
483 rev_param_block_3gpd(guint8 block_type)
489 case 0: str = "3GPD Operation Capability Parameters"; break;
490 case 1: str = "3GPD Operation Mode Parameters"; break;
491 case 2: str = "SimpleIP Capability Parameters"; break;
492 case 3: str = "MobileIP Capability Parameters"; break;
493 case 4: str = "SimpleIP User Profile Parameters"; break;
494 case 5: str = "Mobile IP User Profile Parameters"; break;
495 case 6: str = "SimpleIP Status Parameters"; break;
496 case 7: str = "MobileIP Status Parameters"; break;
497 case 8: str = "SimpleIP PAP SS Parameters"; break;
498 case 9: str = "SimpleIP CHAP SS Parameters"; break;
499 case 10: str = "MobileIP SS Parameters"; break;
500 case 11: str = "HRPD Access Authentication Capability Parameters"; break;
501 case 12: str = "HRPD Access Authentication User Profile Parameters"; break;
502 case 13: str = "HRPD Access Authentication CHAP SS Parameters"; break;
504 str = "Reserved"; break;
510 #define FOR_BLOCK_3GPD_OP_MODE 0
511 #define FOR_BLOCK_3GPD_SIP_USER_PRO 1
512 #define FOR_BLOCK_3GPD_MIP_USER_PRO 2
513 #define FOR_BLOCK_3GPD_SIP_STATUS 6
514 #define FOR_BLOCK_3GPD_MIP_STATUS 7
515 #define FOR_BLOCK_3GPD_SIP_PAP_SS 8
516 #define FOR_BLOCK_3GPD_SIP_CHAP_SS 9
517 #define FOR_BLOCK_3GPD_MIP_SS 10
518 #define FOR_BLOCK_3GPD_HRPD_ACC_AUTH_USER 11
519 #define FOR_BLOCK_3GPD_HRPD_ACC_AUTH_CHAP_SS 12
522 * Table 4.5.7-1 3GPD Parameter Block Types
525 for_param_block_3gpd(guint8 block_type)
531 case 0: str = "3GPD Operation Mode Parameters"; break;
532 case 1: str = "SimpleIP User Profile Parameters"; break;
533 case 2: str = "Mobile IP User Profile Parameters"; break;
534 case 6: str = "SimpleIP Status Parameters"; break;
535 case 7: str = "MobileIP Status Parameters"; break;
536 case 8: str = "SimpleIP PAP SS Parameters"; break;
537 case 9: str = "SimpleIP CHAP SS Parameters"; break;
538 case 10: str = "MobileIP SS Parameters"; break;
539 case 11: str = "HRPD Access Authentication User Profile Parameters"; break;
540 case 12: str = "HRPD Access Authentication CHAP SS Parameters"; break;
542 str = "Reserved"; break;
548 #define REV_BLOCK_MMD_APP 0
551 * Table 3.5.9-1 MMD Parameter Block Types
554 rev_param_block_mmd(guint8 block_type)
560 case 0: str = "MMD Application Parameters"; break;
562 str = "Reserved"; break;
568 #define FOR_BLOCK_MMD_APP 0
571 * Table 4.5.8-1 MMD Parameter Block Types
574 for_param_block_mmd(guint8 block_type)
580 case 0: str = "MMD Application Parameters"; break;
582 str = "Reserved"; break;
588 #define REV_BLOCK_SYSTAG_HOME_SYSTAG 0
589 #define REV_BLOCK_SYSTAG_GROUP_TAG_LIST_DIM 1
590 #define REV_BLOCK_SYSTAG_GROUP_TAG_LIST 2
591 #define REV_BLOCK_SYSTAG_SPEC_TAG_LIST_DIM 3
592 #define REV_BLOCK_SYSTAG_SPEC_TAG_LIST 4
593 #define REV_BLOCK_SYSTAG_CALL_PROMPT_LIST_DIM 5
594 #define REV_BLOCK_SYSTAG_CALL_PROMPT_LIST 6
597 * Table 3.5.10-1 System Tag Parameter Block Types
600 rev_param_block_systag(guint8 block_type)
606 case 0: str = "Home System Tag"; break;
607 case 1: str = "Group Tag List Dimensions"; break;
608 case 2: str = "Group Tag List"; break;
609 case 3: str = "Specific Tag List Dimensions"; break;
610 case 4: str = "Specific Tag List"; break;
611 case 5: str = "Call Prompt List Dimensions"; break;
612 case 6: str = "Call Prompt List"; break;
614 str = "Reserved"; break;
621 * Table 4.5.9-1 System Tag Parameter Block Types
624 for_param_block_systag(guint8 block_type)
630 case 0: str = "Home System Tag"; break;
631 case 1: str = "Group Tag List"; break;
632 case 2: str = "Specific Tag List"; break;
633 case 3: str = "Call Prompt List"; break;
635 if ((block_type >= 4) && (block_type <= 127)) { str = "Reserved for future standardization"; break; }
636 else if ((block_type >= 128) && (block_type <= 254)) { str = "Available for manufacturer-specific parameter block definitions"; break; }
637 else { str = "Reserved"; break; }
643 #define REV_BLOCK_MMS_URI 0
644 #define REV_BLOCK_MMS_URI_CAP 1
647 * Table 3.5.12-1 MMS Parameter Block Types
650 rev_param_block_mms(guint8 block_type)
656 case 0: str = "MMS URI Parameters"; break;
657 case 1: str = "MMS URI Capability Parameters"; break;
659 str = "Reserved"; break;
665 #define FOR_BLOCK_MMS_URI 0
668 * Table 4.5.10-1 MMS Parameter Block Types
671 for_param_block_mms(guint8 block_type)
677 case 0: str = "MMS URI Parameters"; break;
679 str = "Reserved"; break;
685 /* PARAMETER BLOCK DISSECTION */
691 rev_param_block_nam_cdma_analog(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
693 guint32 saved_offset;
698 const gchar *str = NULL;
700 saved_offset = offset;
702 value = tvb_get_ntohs(tvb, offset);
704 other_decode_bitfield_value(bigbuf, value, 0xffe0, 16);
705 proto_tree_add_none_format(tree, hf_ansi_683_none,
707 "%s : First paging channel (FIRSTCHP) used in the home system (%u)",
709 (value & 0xffe0) >> 5);
713 value = tvb_get_ntoh24(tvb, offset);
715 other_decode_bitfield_value(bigbuf, value, 0x1fffc0, 24);
716 proto_tree_add_none_format(tree, hf_ansi_683_none,
718 "%s : Home system identification (HOME_SID) (%u)",
720 (value & 0x1fffc0) >> 6);
722 other_decode_bitfield_value(bigbuf, value, 0x20, 8);
723 proto_tree_add_none_format(tree, hf_ansi_683_none,
725 "%s : Extended address indicator (EX)",
730 value = tvb_get_ntohs(tvb, offset);
732 other_decode_bitfield_value(bigbuf, value, 0x1fe0, 16);
734 proto_tree_add_none_format(tree, hf_ansi_683_none,
736 "%s : Station class mark (SCM) (%u)",
738 (value & 0x1fe0) >> 5);
741 * following SCM decode is from:
742 * 3GPP2 C.S0005-0 section 2.3.3
743 * 3GPP2 C.S0072-0 section 2.1.2
745 subtree = proto_item_add_subtree(item, ett_scm);
747 other_decode_bitfield_value(bigbuf, value, 0x1000, 16);
748 proto_tree_add_none_format(subtree, hf_ansi_683_none,
750 "%s : Extended SCM Indicator: %s",
752 (value & 0x1000) ? "Band Classes 1,4" : "Other bands");
754 other_decode_bitfield_value(bigbuf, value, 0x0800, 16);
755 proto_tree_add_none_format(subtree, hf_ansi_683_none,
759 (value & 0x0800) ? "Dual Mode" : "CDMA Only");
761 other_decode_bitfield_value(bigbuf, value, 0x0400, 16);
762 proto_tree_add_none_format(subtree, hf_ansi_683_none,
766 (value & 0x0400) ? "Slotted" : "Non-Slotted");
771 proto_item_append_text(item, "%s", " (MEID configured)");
778 other_decode_bitfield_value(bigbuf, value, 0x0200, 16);
779 proto_tree_add_none_format(subtree, hf_ansi_683_none,
781 "%s : MEID %sconfigured",
785 other_decode_bitfield_value(bigbuf, value, 0x0100, 16);
786 proto_tree_add_none_format(subtree, hf_ansi_683_none,
788 "%s : 25 MHz Bandwidth",
791 other_decode_bitfield_value(bigbuf, value, 0x0080, 16);
792 proto_tree_add_none_format(subtree, hf_ansi_683_none,
794 "%s : %s Transmission",
796 (value & 0x0080) ? "Discontinuous" : "Continuous");
798 switch ((value & 0x0060) >> 5)
800 case 0x00: str = "Class I"; break;
801 case 0x01: str = "Class II"; break;
802 case 0x02: str = "Class III"; break;
803 case 0x03: str = "Reserved"; break;
806 other_decode_bitfield_value(bigbuf, value, 0x0060, 16);
807 proto_tree_add_none_format(subtree, hf_ansi_683_none,
809 "%s : Power Class for Band Class 0 Analog Operation: %s",
815 value = tvb_get_ntohs(tvb, offset);
817 other_decode_bitfield_value(bigbuf, value, 0x1fe0, 16);
818 proto_tree_add_none_format(tree, hf_ansi_683_none,
820 "%s : Mobile station protocol revision number (MOB_P_REV) (%u)",
822 (value & 0x1fe0) >> 5);
824 other_decode_bitfield_value(bigbuf, value, 0x10, 8);
825 proto_tree_add_none_format(tree, hf_ansi_683_none,
827 "%s : IMSI_M Class assignment of the mobile station (IMSI_M_CLASS), Class %u",
829 (value & 0x10) >> 4);
831 other_decode_bitfield_value(bigbuf, value, 0x0e, 8);
832 proto_tree_add_none_format(tree, hf_ansi_683_none,
834 "%s : Number of IMSI_M address digits (IMSI_M_ADDR_NUM) (%u), %u digits in NMSI",
837 (value & 0x10) ? ((value & 0x0e) >> 1) + 4 : 0);
841 value = tvb_get_ntoh24(tvb, offset);
843 other_decode_bitfield_value(bigbuf, value, 0x01ff80, 24);
844 proto_tree_add_none_format(tree, hf_ansi_683_none,
846 "%s : Mobile country code (MCC_M)",
849 other_decode_bitfield_value(bigbuf, value, 0x7f, 8);
850 proto_tree_add_none_format(tree, hf_ansi_683_none,
852 "%s : 11th and 12th digits of the IMSI_M (IMSI__M_11_12)",
857 proto_tree_add_none_format(tree, hf_ansi_683_none,
859 "The least significant 10 digits of the IMSI_M (IMSI_M_S) (34 bits)");
863 value = tvb_get_guint8(tvb, offset);
865 other_decode_bitfield_value(bigbuf, value, 0x3c, 8);
866 proto_tree_add_none_format(tree, hf_ansi_683_none,
868 "%s : Access overload class (ACCOLC) (%u)",
870 (value & 0x3c) >> 2);
872 other_decode_bitfield_value(bigbuf, value, 0x02, 8);
873 proto_tree_add_none_format(tree, hf_ansi_683_none,
875 "%s : Local control status (LOCAL_CONTROL)",
878 other_decode_bitfield_value(bigbuf, value, 0x01, 8);
879 proto_tree_add_none_format(tree, hf_ansi_683_none,
881 "%s : Termination indicator for the home system (MOB_TERM_HOME)",
886 value = tvb_get_guint8(tvb, offset);
888 other_decode_bitfield_value(bigbuf, value, 0x80, 8);
889 proto_tree_add_none_format(tree, hf_ansi_683_none,
891 "%s : Termination indicator for SID roaming (MOB_TERM_FOR_SID)",
894 other_decode_bitfield_value(bigbuf, value, 0x40, 8);
895 proto_tree_add_none_format(tree, hf_ansi_683_none,
897 "%s : Termination indicator for NID roaming (MOB_TERM_FOR_NID)",
900 value = tvb_get_ntohs(tvb, offset);
902 other_decode_bitfield_value(bigbuf, value, 0x3fc0, 16);
903 proto_tree_add_none_format(tree, hf_ansi_683_none,
905 "%s : Maximum stored SID/NID pairs (MAX_SID_NID) (%u)",
907 (value & 0x3fc0) >> 6);
911 value = tvb_get_ntohs(tvb, offset);
913 count = (value & 0x3fc0) >> 6;
915 other_decode_bitfield_value(bigbuf, value, 0x3fc0, 16);
916 proto_tree_add_none_format(tree, hf_ansi_683_none,
918 "%s : Number of stored SID/NID pairs (STORED_SID_NID) (%u)",
922 other_decode_bitfield_value(bigbuf, value, 0x003f, 16);
923 proto_tree_add_none_format(tree, hf_ansi_683_none,
925 "%s : SID/NID pairs (MSB)",
930 proto_tree_add_none_format(tree, hf_ansi_683_none,
931 tvb, offset, len - (offset - saved_offset),
932 "SID/NID pairs, Reserved");
940 param_block_nam_mdn(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
942 guint32 saved_offset;
943 guint32 value, count, i;
945 saved_offset = offset;
947 value = tvb_get_guint8(tvb, offset);
949 count = (value & 0xf0) >> 4;
951 other_decode_bitfield_value(bigbuf, value, 0xf0, 8);
952 proto_tree_add_none_format(tree, hf_ansi_683_none,
954 "%s : Number of digits (N_DIGITS) (%u)",
958 for (i=0; i < count; i++)
960 bigbuf[i] = dtmf_digits[(value & 0x0f)];
965 value = tvb_get_guint8(tvb, offset);
966 bigbuf[i+1] = dtmf_digits[(value & 0xf0) >> 4];
972 proto_tree_add_none_format(tree, hf_ansi_683_none,
973 tvb, saved_offset, len,
974 "Mobile directory number, %s",
979 other_decode_bitfield_value(bigbuf, value, 0x0f, 8);
980 proto_tree_add_none_format(tree, hf_ansi_683_none,
991 rev_param_block_nam_cdma(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
993 guint32 saved_offset;
997 saved_offset = offset;
999 value = tvb_get_guint8(tvb, offset);
1001 other_decode_bitfield_value(bigbuf, value, 0xc0, 8);
1002 proto_tree_add_none_format(tree, hf_ansi_683_none,
1007 other_decode_bitfield_value(bigbuf, value, 0x20, 8);
1008 proto_tree_add_none_format(tree, hf_ansi_683_none,
1010 "%s : Slotted Mode",
1013 other_decode_bitfield_value(bigbuf, value, 0x1f, 8);
1014 proto_tree_add_none_format(tree, hf_ansi_683_none,
1021 value = tvb_get_guint8(tvb, offset);
1023 other_decode_bitfield_value(bigbuf, value, 0xff, 8);
1024 proto_tree_add_none_format(tree, hf_ansi_683_none,
1026 "%s : Mobile station protocol revision number (MOB_P_REV) (%u)",
1032 value = tvb_get_ntohs(tvb, offset);
1034 other_decode_bitfield_value(bigbuf, value, 0x8000, 16);
1035 proto_tree_add_none_format(tree, hf_ansi_683_none,
1037 "%s : IMSI_M Class assignment of the mobile station (IMSI_M_CLASS), Class %u",
1039 (value & 0x8000) >> 15);
1041 other_decode_bitfield_value(bigbuf, value, 0x7000, 16);
1042 proto_tree_add_none_format(tree, hf_ansi_683_none,
1044 "%s : Number of IMSI_M address digits (IMSI_M_ADDR_NUM) (%u), %u digits in NMSI",
1046 (value & 0x7000) >> 12,
1047 (value & 0x8000) ? ((value & 0x7000) >> 12) + 4 : 0);
1049 other_decode_bitfield_value(bigbuf, value, 0x0ffc, 16);
1050 proto_tree_add_none_format(tree, hf_ansi_683_none,
1052 "%s : Mobile country code (MCC_M)",
1057 value = tvb_get_ntohs(tvb, offset);
1059 other_decode_bitfield_value(bigbuf, value, 0x3f80, 16);
1060 proto_tree_add_none_format(tree, hf_ansi_683_none,
1062 "%s : 11th and 12th digits of the IMSI_M (IMSI__M_11_12)",
1067 proto_tree_add_none_format(tree, hf_ansi_683_none,
1069 "The least significant 10 digits of the IMSI_M (IMSI_M_S) (34 bits)");
1073 value = tvb_get_ntohs(tvb, offset);
1075 other_decode_bitfield_value(bigbuf, value, 0x01e0, 16);
1076 proto_tree_add_none_format(tree, hf_ansi_683_none,
1078 "%s : Access overload class (ACCOLC) (%u)",
1080 (value & 0x01e0) >> 5);
1082 other_decode_bitfield_value(bigbuf, value, 0x0010, 16);
1083 proto_tree_add_none_format(tree, hf_ansi_683_none,
1085 "%s : Local control status (LOCAL_CONTROL)",
1088 other_decode_bitfield_value(bigbuf, value, 0x0008, 16);
1089 proto_tree_add_none_format(tree, hf_ansi_683_none,
1091 "%s : Termination indicator for the home system (MOB_TERM_HOME)",
1094 other_decode_bitfield_value(bigbuf, value, 0x0004, 16);
1095 proto_tree_add_none_format(tree, hf_ansi_683_none,
1097 "%s : Termination indicator for SID roaming (MOB_TERM_FOR_SID)",
1100 other_decode_bitfield_value(bigbuf, value, 0x0002, 16);
1101 proto_tree_add_none_format(tree, hf_ansi_683_none,
1103 "%s : Termination indicator for NID roaming (MOB_TERM_FOR_NID)",
1108 value = tvb_get_ntohs(tvb, offset);
1110 other_decode_bitfield_value(bigbuf, value, 0x01fe, 16);
1111 proto_tree_add_none_format(tree, hf_ansi_683_none,
1113 "%s : Maximum stored SID/NID pairs (MAX_SID_NID) (%u)",
1115 (value & 0x01fe) >> 1);
1119 value = tvb_get_ntohs(tvb, offset);
1121 count = (value & 0x01fe) >> 1;
1123 other_decode_bitfield_value(bigbuf, value, 0x01fe, 16);
1124 proto_tree_add_none_format(tree, hf_ansi_683_none,
1126 "%s : Number of stored SID/NID pairs (STORED_SID_NID) (%u)",
1130 other_decode_bitfield_value(bigbuf, value, 0x0001, 16);
1131 proto_tree_add_none_format(tree, hf_ansi_683_none,
1133 "%s : SID/NID pairs (MSB)",
1138 proto_tree_add_none_format(tree, hf_ansi_683_none,
1139 tvb, offset, len - (offset - saved_offset),
1140 "SID/NID pairs, Reserved");
1148 param_block_nam_imsi_t(tvbuff_t *tvb, proto_tree *tree, guint len _U_, guint32 offset)
1152 value = tvb_get_guint8(tvb, offset);
1154 other_decode_bitfield_value(bigbuf, value, 0x80, 8);
1155 proto_tree_add_none_format(tree, hf_ansi_683_none,
1157 "%s : IMSI_T Class assignment of the mobile station (IMSI_T_CLASS), Class %u",
1159 (value & 0x80) >> 7);
1161 other_decode_bitfield_value(bigbuf, value, 0x70, 8);
1162 proto_tree_add_none_format(tree, hf_ansi_683_none,
1164 "%s : Number of IMSI_T address digits (IMSI_T_ADDR_NUM ) (%u), %u digits in NMSI",
1166 (value & 0x70) >> 4,
1167 (value & 0x80) ? ((value & 0x70) >> 4) + 4 : 0);
1169 value = tvb_get_ntohs(tvb, offset);
1171 other_decode_bitfield_value(bigbuf, value, 0x0ffc, 16);
1172 proto_tree_add_none_format(tree, hf_ansi_683_none,
1174 "%s : Mobile country code (MCC_T)",
1179 value = tvb_get_ntohs(tvb, offset);
1181 other_decode_bitfield_value(bigbuf, value, 0x03f8, 16);
1182 proto_tree_add_none_format(tree, hf_ansi_683_none,
1184 "%s : 11th and 12th digits of the IMSI_T (IMSI__T_11_12)",
1189 proto_tree_add_none_format(tree, hf_ansi_683_none,
1191 "The least significant 10 digits of the IMSI_T (IMSI_T_S) (34 bits)");
1195 value = tvb_get_guint8(tvb, offset);
1197 other_decode_bitfield_value(bigbuf, value, 0x01, 8);
1198 proto_tree_add_none_format(tree, hf_ansi_683_none,
1208 for_param_block_nam_cdma_analog(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
1210 guint32 saved_offset;
1214 saved_offset = offset;
1216 value = tvb_get_ntohs(tvb, offset);
1218 other_decode_bitfield_value(bigbuf, value, 0xffe0, 16);
1219 proto_tree_add_none_format(tree, hf_ansi_683_none,
1221 "%s : First paging channel (FIRSTCHP) used in the home system (%u)",
1223 (value & 0xffe0) >> 5);
1227 value = tvb_get_ntoh24(tvb, offset);
1229 other_decode_bitfield_value(bigbuf, value, 0x1fffc0, 24);
1230 proto_tree_add_none_format(tree, hf_ansi_683_none,
1232 "%s : Home system identification (HOME_SID) (%u)",
1234 (value & 0x1fffc0) >> 6);
1236 other_decode_bitfield_value(bigbuf, value, 0x20, 8);
1237 proto_tree_add_none_format(tree, hf_ansi_683_none,
1239 "%s : Extended address indicator (EX)",
1242 other_decode_bitfield_value(bigbuf, value, 0x10, 8);
1243 proto_tree_add_none_format(tree, hf_ansi_683_none,
1245 "%s : IMSI_M Class assignment of the mobile station (IMSI_M_CLASS), Class %u",
1247 (value & 0x10) >> 4);
1249 other_decode_bitfield_value(bigbuf, value, 0x0e, 8);
1250 proto_tree_add_none_format(tree, hf_ansi_683_none,
1252 "%s : Number of IMSI_M address digits (IMSI_M_ADDR_NUM) (%u), %u digits in NMSI",
1254 (value & 0x0e) >> 1,
1255 (value & 0x10) ? ((value & 0x0e) >> 1) + 4 : 0);
1259 value = tvb_get_ntoh24(tvb, offset);
1261 other_decode_bitfield_value(bigbuf, value, 0x01ff80, 24);
1262 proto_tree_add_none_format(tree, hf_ansi_683_none,
1264 "%s : Mobile country code (MCC_M)",
1267 other_decode_bitfield_value(bigbuf, value, 0x7f, 8);
1268 proto_tree_add_none_format(tree, hf_ansi_683_none,
1270 "%s : 11th and 12th digits of the IMSI_M (IMSI__M_11_12)",
1275 proto_tree_add_none_format(tree, hf_ansi_683_none,
1277 "The least significant 10 digits of the IMSI_M (IMSI_M_S) (34 bits)");
1281 value = tvb_get_guint8(tvb, offset);
1283 other_decode_bitfield_value(bigbuf, value, 0x3c, 8);
1284 proto_tree_add_none_format(tree, hf_ansi_683_none,
1286 "%s : Access overload class (ACCOLC) (%u)",
1288 (value & 0x3c) >> 2);
1290 other_decode_bitfield_value(bigbuf, value, 0x02, 8);
1291 proto_tree_add_none_format(tree, hf_ansi_683_none,
1293 "%s : Local control status (LOCAL_CONTROL)",
1296 other_decode_bitfield_value(bigbuf, value, 0x01, 8);
1297 proto_tree_add_none_format(tree, hf_ansi_683_none,
1299 "%s : Termination indicator for the home system (MOB_TERM_HOME)",
1304 value = tvb_get_ntohs(tvb, offset);
1306 other_decode_bitfield_value(bigbuf, value, 0x8000, 16);
1307 proto_tree_add_none_format(tree, hf_ansi_683_none,
1309 "%s : Termination indicator for SID roaming (MOB_TERM_FOR_SID)",
1312 other_decode_bitfield_value(bigbuf, value, 0x4000, 16);
1313 proto_tree_add_none_format(tree, hf_ansi_683_none,
1315 "%s : Termination indicator for NID roaming (MOB_TERM_FOR_NID)",
1318 count = (value & 0x3fc0) >> 6;
1320 other_decode_bitfield_value(bigbuf, value, 0x3fc0, 16);
1321 proto_tree_add_none_format(tree, hf_ansi_683_none,
1323 "%s : Number of SID/NID pairs (N_SID_NID) (%u)",
1327 other_decode_bitfield_value(bigbuf, value, 0x003f, 16);
1328 proto_tree_add_none_format(tree, hf_ansi_683_none,
1330 "%s : SID/NID pairs (MSB)",
1335 proto_tree_add_none_format(tree, hf_ansi_683_none,
1336 tvb, offset, len - (offset - saved_offset),
1337 "SID/NID pairs, Reserved");
1342 * see param_block_nam_mdn()
1349 for_param_block_nam_cdma(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
1351 guint32 saved_offset;
1355 saved_offset = offset;
1357 value = tvb_get_ntohs(tvb, offset);
1359 other_decode_bitfield_value(bigbuf, value, 0x8000, 16);
1360 proto_tree_add_none_format(tree, hf_ansi_683_none,
1362 "%s : IMSI_M Class assignment of the mobile station (IMSI_M_CLASS), Class %u",
1364 (value & 0x8000) >> 15);
1366 other_decode_bitfield_value(bigbuf, value, 0x7000, 16);
1367 proto_tree_add_none_format(tree, hf_ansi_683_none,
1369 "%s : Number of IMSI_M address digits (IMSI_M_ADDR_NUM) (%u), %u digits in NMSI",
1371 (value & 0x7000) >> 12,
1372 (value & 0x8000) ? ((value & 0x7000) >> 12) + 4 : 0);
1374 other_decode_bitfield_value(bigbuf, value, 0x0ffc, 16);
1375 proto_tree_add_none_format(tree, hf_ansi_683_none,
1377 "%s : Mobile country code (MCC_M)",
1382 value = tvb_get_ntohs(tvb, offset);
1384 other_decode_bitfield_value(bigbuf, value, 0x3f80, 16);
1385 proto_tree_add_none_format(tree, hf_ansi_683_none,
1387 "%s : 11th and 12th digits of the IMSI_M (IMSI__M_11_12)",
1392 proto_tree_add_none_format(tree, hf_ansi_683_none,
1394 "The least significant 10 digits of the IMSI_M (IMSI_M_S) (34 bits)");
1398 value = tvb_get_ntohs(tvb, offset);
1400 other_decode_bitfield_value(bigbuf, value, 0x01e0, 16);
1401 proto_tree_add_none_format(tree, hf_ansi_683_none,
1403 "%s : Access overload class (ACCOLC) (%u)",
1405 (value & 0x01e0) >> 5);
1407 other_decode_bitfield_value(bigbuf, value, 0x0010, 16);
1408 proto_tree_add_none_format(tree, hf_ansi_683_none,
1410 "%s : Local control status (LOCAL_CONTROL)",
1413 other_decode_bitfield_value(bigbuf, value, 0x0008, 16);
1414 proto_tree_add_none_format(tree, hf_ansi_683_none,
1416 "%s : Termination indicator for the home system (MOB_TERM_HOME)",
1419 other_decode_bitfield_value(bigbuf, value, 0x0004, 16);
1420 proto_tree_add_none_format(tree, hf_ansi_683_none,
1422 "%s : Termination indicator for SID roaming (MOB_TERM_FOR_SID)",
1425 other_decode_bitfield_value(bigbuf, value, 0x0002, 16);
1426 proto_tree_add_none_format(tree, hf_ansi_683_none,
1428 "%s : Termination indicator for NID roaming (MOB_TERM_FOR_NID)",
1433 value = tvb_get_ntohs(tvb, offset);
1435 count = (value & 0x01fe) >> 1;
1437 other_decode_bitfield_value(bigbuf, value, 0x01fe, 16);
1438 proto_tree_add_none_format(tree, hf_ansi_683_none,
1440 "%s : Number of SID/NID pairs (N_SID_NID) (%u)",
1444 other_decode_bitfield_value(bigbuf, value, 0x0001, 16);
1445 proto_tree_add_none_format(tree, hf_ansi_683_none,
1447 "%s : SID/NID pairs (MSB)",
1452 proto_tree_add_none_format(tree, hf_ansi_683_none,
1453 tvb, offset, len - (offset - saved_offset),
1454 "SID/NID pairs, Reserved");
1459 * see param_block_nam_imsi_t()
1467 for_param_block_val_spc(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
1469 guint32 saved_offset;
1472 EXACT_DATA_CHECK(len, 3);
1474 saved_offset = offset;
1476 value = tvb_get_guint8(tvb, offset++);
1477 bigbuf[0] = bcd_digits[(value & 0x0f)];
1478 bigbuf[1] = bcd_digits[(value & 0xf0) >> 4];
1480 value = tvb_get_guint8(tvb, offset++);
1481 bigbuf[2] = bcd_digits[(value & 0x0f)];
1482 bigbuf[3] = bcd_digits[(value & 0xf0) >> 4];
1484 value = tvb_get_guint8(tvb, offset++);
1485 bigbuf[4] = bcd_digits[(value & 0x0f)];
1486 bigbuf[5] = bcd_digits[(value & 0xf0) >> 4];
1489 proto_tree_add_none_format(tree, hf_ansi_683_none,
1490 tvb, saved_offset, len,
1491 "Service programming code: %s",
1499 for_param_block_val_spasm(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
1505 value = tvb_get_guint8(tvb, offset);
1507 other_decode_bitfield_value(bigbuf, value, 0x80, 8);
1508 proto_tree_add_none_format(tree, hf_ansi_683_none,
1510 "%s : OTAPA SPASM validation signature %sincluded indicator",
1512 (value & 0x80) ? "" : "not ");
1514 other_decode_bitfield_value(bigbuf, value, 0x40, 8);
1515 proto_tree_add_none_format(tree, hf_ansi_683_none,
1517 "%s : %s SPASM protection for the active NAM",
1519 (value & 0x40) ? "Activate" : "Do not activate");
1521 other_decode_bitfield_value(bigbuf, value, 0x3f, 8);
1522 proto_tree_add_none_format(tree, hf_ansi_683_none,
1529 EXACT_DATA_CHECK(len, 3);
1531 value = tvb_get_ntoh24(tvb, offset);
1533 other_decode_bitfield_value(bigbuf, value, 0x800000, 24);
1534 proto_tree_add_none_format(tree, hf_ansi_683_none,
1536 "%s : OTAPA SPASM validation signature %sincluded indicator",
1538 (value & 0x800000) ? "" : "not ");
1540 other_decode_bitfield_value(bigbuf, value, 0x7fffe0, 24);
1541 proto_tree_add_none_format(tree, hf_ansi_683_none,
1543 "%s : OTAPA SPASM validation signature (0x%x)",
1545 (value & 0x7fffe0) >> 5);
1547 other_decode_bitfield_value(bigbuf, value, 0x000010, 24);
1548 proto_tree_add_none_format(tree, hf_ansi_683_none,
1550 "%s : %s SPASM protection for the active NAM",
1552 (value & 0x000010) ? "Activate" : "Do not activate");
1554 other_decode_bitfield_value(bigbuf, value, 0x00000f, 24);
1555 proto_tree_add_none_format(tree, hf_ansi_683_none,
1562 /* FORWARD MESSAGES */
1568 msg_config_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
1570 guint8 oct, num_blocks;
1571 const gchar *str = NULL;
1572 guint32 i, saved_offset;
1574 SHORT_DATA_CHECK(len, 1);
1576 saved_offset = offset;
1578 num_blocks = tvb_get_guint8(tvb, offset);
1580 proto_tree_add_none_format(tree, hf_ansi_683_none,
1582 "Number of parameter blocks (%u)",
1587 SHORT_DATA_CHECK((len - (offset - saved_offset)), num_blocks);
1589 for (i=0; i < num_blocks; i++)
1591 oct = tvb_get_guint8(tvb, offset);
1593 str = rev_param_block_nam(oct);
1595 proto_tree_add_none_format(tree, hf_ansi_683_none,
1605 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
1612 msg_download_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
1614 guint8 block_id, num_blocks, block_len;
1615 const gchar *str = NULL;
1616 proto_tree *subtree;
1618 guint32 i, saved_offset;
1620 SHORT_DATA_CHECK(len, 1);
1622 saved_offset = offset;
1624 num_blocks = tvb_get_guint8(tvb, offset);
1626 proto_tree_add_none_format(tree, hf_ansi_683_none,
1628 "Number of parameter blocks (%u)",
1633 for (i=0; i < num_blocks; i++)
1635 block_id = tvb_get_guint8(tvb, offset);
1637 str = for_param_block_nam(block_id);
1640 proto_tree_add_none_format(tree, hf_ansi_683_none,
1647 subtree = proto_item_add_subtree(item, ett_for_nam_block);
1650 block_len = tvb_get_guint8(tvb, offset);
1652 proto_tree_add_uint(subtree, hf_ansi_683_length,
1653 tvb, offset, 1, block_len);
1656 if (block_len > (len - (offset - saved_offset)))
1658 proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb,
1659 offset, len - (offset - saved_offset), "Short Data (?)");
1667 case FOR_BLOCK_NAM_CDMA_ANALOG:
1668 for_param_block_nam_cdma_analog(tvb, subtree, block_len, offset);
1671 case FOR_BLOCK_NAM_MDN:
1672 param_block_nam_mdn(tvb, subtree, block_len, offset);
1675 case FOR_BLOCK_NAM_CDMA:
1676 for_param_block_nam_cdma(tvb, subtree, block_len, offset);
1679 case FOR_BLOCK_NAM_IMSI_T:
1680 param_block_nam_imsi_t(tvb, subtree, block_len, offset);
1684 proto_tree_add_none_format(subtree, hf_ansi_683_none,
1685 tvb, offset, block_len, "Block Data");
1689 offset += block_len;
1693 if (len > (offset - saved_offset))
1696 fresh_handler(tvb, tree, len - (offset - saved_offset), offset);
1699 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
1706 msg_ms_key_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
1708 guint8 akey_prev, param_len;
1709 proto_tree *subtree;
1711 guint32 saved_offset;
1712 const gchar *str = NULL;
1714 SHORT_DATA_CHECK(len, 1);
1716 saved_offset = offset;
1718 akey_prev = tvb_get_guint8(tvb, offset);
1722 case 0x02: str = "2G A-key generation"; break;
1723 case 0x03: str = "2G A-key and 3G Root Key generation"; break;
1724 case 0x04: str = "3G Root Key generation"; break;
1725 case 0x05: str = "Enhanced 3G Root Key generation"; break;
1726 default: str = "Unknown"; break;
1729 proto_tree_add_none_format(tree, hf_ansi_683_none,
1731 "A-Key Protocol Revision (%u): %s",
1736 if (akey_prev < 0x03)
1738 param_len = tvb_get_guint8(tvb, offset);
1741 proto_tree_add_none_format(tree, hf_ansi_683_none,
1742 tvb, offset, param_len + 1,
1743 "Key exchange parameter P");
1744 subtree = proto_item_add_subtree(item, ett_key_p);
1746 proto_tree_add_uint(subtree, hf_ansi_683_length,
1747 tvb, offset, 1, param_len);
1752 proto_tree_add_none_format(subtree, hf_ansi_683_none,
1753 tvb, offset, param_len,
1755 offset += param_len;
1758 param_len = tvb_get_guint8(tvb, offset);
1761 proto_tree_add_none_format(tree, hf_ansi_683_none,
1762 tvb, offset, param_len + 1,
1763 "Key exchange parameter G");
1764 subtree = proto_item_add_subtree(item, ett_key_g);
1766 proto_tree_add_uint(subtree, hf_ansi_683_length,
1767 tvb, offset, 1, param_len);
1772 proto_tree_add_none_format(subtree, hf_ansi_683_none,
1773 tvb, offset, param_len,
1775 offset += param_len;
1779 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
1786 msg_key_gen_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
1789 guint32 saved_offset;
1791 SHORT_DATA_CHECK(len, 2);
1793 saved_offset = offset;
1795 param_len = tvb_get_guint8(tvb, offset);
1797 proto_tree_add_uint(tree, hf_ansi_683_length,
1798 tvb, offset, 1, param_len);
1801 SHORT_DATA_CHECK((len - (offset - saved_offset)), param_len);
1805 proto_tree_add_none_format(tree, hf_ansi_683_none,
1806 tvb, offset, param_len,
1807 "Base Station Calculation Result");
1808 offset += param_len;
1811 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
1818 msg_reauth_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
1821 EXACT_DATA_CHECK(len, 4);
1823 proto_tree_add_none_format(tree, hf_ansi_683_none,
1825 "Random Challenge value");
1830 * Commit Request (no data associated)
1837 msg_protocap_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
1839 guint32 i, saved_offset;
1840 guint8 oct, num_cap;
1841 const gchar *str = NULL;
1846 * if the base station did not request new cap info OR
1847 * this is an earlier release
1852 saved_offset = offset;
1854 proto_tree_add_none_format(tree, hf_ansi_683_none,
1856 "OTASP protocol revision");
1860 num_cap = tvb_get_guint8(tvb, offset);
1862 proto_tree_add_none_format(tree, hf_ansi_683_none,
1864 "Number of Capability Records (%u)",
1869 SHORT_DATA_CHECK((len - (offset - saved_offset)), num_cap);
1871 for (i=0; i < num_cap; i++)
1873 oct = tvb_get_guint8(tvb, offset);
1875 str = rev_cap_info_record_type(oct);
1877 proto_tree_add_none_format(tree, hf_ansi_683_none,
1887 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
1894 msg_sspr_config_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
1897 const gchar *str = NULL;
1898 guint32 saved_offset;
1900 proto_tree *subtree;
1903 SHORT_DATA_CHECK(len, 1);
1905 saved_offset = offset;
1907 oct = tvb_get_guint8(tvb, offset);
1909 str = rev_param_block_sspr(oct);
1912 proto_tree_add_none_format(tree, hf_ansi_683_none,
1920 if (oct == REV_BLOCK_SSPR_PRL)
1922 subtree = proto_item_add_subtree(item, ett_rev_sspr_block);
1924 if ((len - (offset - saved_offset)) < 3)
1926 proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb,
1927 offset, len - (offset - saved_offset), "Short Data (?)");
1931 value = tvb_get_ntohs(tvb, offset);
1933 proto_tree_add_none_format(subtree, hf_ansi_683_none,
1935 "Segment offset (%u)",
1939 oct = tvb_get_guint8(tvb, offset);
1941 proto_tree_add_none_format(subtree, hf_ansi_683_none,
1943 "Maximum segment size (%u)",
1948 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
1955 msg_sspr_download_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
1957 guint8 oct, block_len;
1958 const gchar *str = NULL;
1959 guint32 saved_offset;
1960 proto_tree *subtree;
1963 SHORT_DATA_CHECK(len, 2);
1965 saved_offset = offset;
1967 oct = tvb_get_guint8(tvb, offset);
1969 str = for_param_block_sspr(oct);
1972 proto_tree_add_none_format(tree, hf_ansi_683_none,
1978 subtree = proto_item_add_subtree(item, ett_for_sspr_block);
1981 block_len = tvb_get_guint8(tvb, offset);
1983 proto_tree_add_uint(subtree, hf_ansi_683_length,
1984 tvb, offset, 1, block_len);
1987 if (block_len > (len - (offset - saved_offset)))
1989 proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb,
1990 offset, len - (offset - saved_offset), "Short Data (?)");
1996 proto_tree_add_none_format(subtree, hf_ansi_683_none,
1997 tvb, offset, block_len, "Block Data");
1998 offset += block_len;
2001 if (len > (offset - saved_offset))
2004 fresh_handler(tvb, tree, len - (offset - saved_offset), offset);
2007 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
2014 msg_validate_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
2016 guint8 block_id, num_blocks, block_len;
2017 const gchar *str = NULL;
2018 proto_tree *subtree;
2020 guint32 i, saved_offset;
2022 SHORT_DATA_CHECK(len, 1);
2024 saved_offset = offset;
2026 num_blocks = tvb_get_guint8(tvb, offset);
2028 proto_tree_add_none_format(tree, hf_ansi_683_none,
2030 "Number of parameter blocks (%u)",
2035 SHORT_DATA_CHECK((len - (offset - saved_offset)), (guint32)(num_blocks * 2));
2037 for (i=0; i < num_blocks; i++)
2039 block_id = tvb_get_guint8(tvb, offset);
2041 str = for_param_block_val(block_id);
2044 proto_tree_add_none_format(tree, hf_ansi_683_none,
2051 subtree = proto_item_add_subtree(item, ett_for_val_block);
2054 block_len = tvb_get_guint8(tvb, offset);
2056 proto_tree_add_uint(subtree, hf_ansi_683_length,
2057 tvb, offset, 1, block_len);
2061 if (block_len > (len - (offset - saved_offset)))
2063 proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb,
2064 offset, len - (offset - saved_offset), "Short Data (?)");
2072 case FOR_BLOCK_VAL_VERIFY_SPC:
2073 case FOR_BLOCK_VAL_CHANGE_SPC:
2074 for_param_block_val_spc(tvb, subtree, block_len, offset);
2077 case FOR_BLOCK_VAL_VALDATE_SPASM:
2078 for_param_block_val_spasm(tvb, subtree, block_len, offset);
2082 proto_tree_add_none_format(subtree, hf_ansi_683_none,
2083 tvb, offset, block_len, "Block Data");
2087 offset += block_len;
2091 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
2098 msg_otapa_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
2102 EXACT_DATA_CHECK(len, 1);
2104 oct = tvb_get_guint8(tvb, offset);
2106 other_decode_bitfield_value(bigbuf, oct, 0x80, 8);
2107 proto_tree_add_none_format(tree, hf_ansi_683_none,
2109 "%s : %s OTAPA session",
2111 (oct & 0x80) ? "Start" : "Stop");
2113 other_decode_bitfield_value(bigbuf, oct, 0x7f, 8);
2114 proto_tree_add_none_format(tree, hf_ansi_683_none,
2126 msg_puzl_config_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
2128 guint8 oct, block_len;
2129 const gchar *str = NULL;
2130 guint32 saved_offset;
2131 proto_tree *subtree;
2134 SHORT_DATA_CHECK(len, 1);
2136 saved_offset = offset;
2138 oct = tvb_get_guint8(tvb, offset);
2140 str = rev_param_block_puzl(oct);
2143 proto_tree_add_none_format(tree, hf_ansi_683_none,
2149 block_len = len - (offset - saved_offset);
2153 subtree = proto_item_add_subtree(item, ett_rev_puzl_block);
2155 proto_tree_add_none_format(subtree, hf_ansi_683_none,
2156 tvb, offset, block_len, "Block Data");
2157 offset += block_len;
2160 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
2167 msg_puzl_download_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
2169 guint8 block_id, num_blocks, block_len;
2170 const gchar *str = NULL;
2171 proto_tree *subtree;
2173 guint32 i, saved_offset;
2175 SHORT_DATA_CHECK(len, 1);
2177 saved_offset = offset;
2179 num_blocks = tvb_get_guint8(tvb, offset);
2181 proto_tree_add_none_format(tree, hf_ansi_683_none,
2183 "Number of parameter blocks (%u)",
2188 for (i=0; i < num_blocks; i++)
2190 block_id = tvb_get_guint8(tvb, offset);
2192 str = for_param_block_puzl(block_id);
2195 proto_tree_add_none_format(tree, hf_ansi_683_none,
2202 subtree = proto_item_add_subtree(item, ett_for_puzl_block);
2205 block_len = tvb_get_guint8(tvb, offset);
2207 proto_tree_add_uint(subtree, hf_ansi_683_length,
2208 tvb, offset, 1, block_len);
2211 if (block_len > (len - (offset - saved_offset)))
2213 proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb,
2214 offset, len - (offset - saved_offset), "Short Data (?)");
2222 case FOR_BLOCK_PUZL_UZ_INS:
2223 case FOR_BLOCK_PUZL_UZ_UPD:
2224 case FOR_BLOCK_PUZL_UZ_DEL:
2225 case FOR_BLOCK_PUZL_UZ_PRI_CHANGE:
2226 case FOR_BLOCK_PUZL_FLAGS:
2228 proto_tree_add_none_format(subtree, hf_ansi_683_none,
2229 tvb, offset, block_len, "Block Data");
2233 offset += block_len;
2237 if (len > (offset - saved_offset))
2240 fresh_handler(tvb, tree, len - (offset - saved_offset), offset);
2243 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
2250 msg_3gpd_config_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
2252 guint8 oct, num_blocks;
2253 const gchar *str = NULL;
2254 guint32 i, saved_offset;
2256 SHORT_DATA_CHECK(len, 1);
2258 saved_offset = offset;
2260 num_blocks = tvb_get_guint8(tvb, offset);
2262 proto_tree_add_none_format(tree, hf_ansi_683_none,
2264 "Number of parameter blocks (%u)",
2269 SHORT_DATA_CHECK((len - (offset - saved_offset)), num_blocks);
2271 for (i=0; i < num_blocks; i++)
2273 oct = tvb_get_guint8(tvb, offset);
2275 str = rev_param_block_3gpd(oct);
2277 proto_tree_add_none_format(tree, hf_ansi_683_none,
2287 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
2294 msg_3gpd_download_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
2296 guint8 block_id, num_blocks, block_len;
2297 const gchar *str = NULL;
2298 proto_tree *subtree;
2300 guint32 i, saved_offset;
2302 SHORT_DATA_CHECK(len, 1);
2304 saved_offset = offset;
2306 num_blocks = tvb_get_guint8(tvb, offset);
2308 proto_tree_add_none_format(tree, hf_ansi_683_none,
2310 "Number of parameter blocks (%u)",
2315 for (i=0; i < num_blocks; i++)
2317 block_id = tvb_get_guint8(tvb, offset);
2319 str = for_param_block_3gpd(block_id);
2322 proto_tree_add_none_format(tree, hf_ansi_683_none,
2329 subtree = proto_item_add_subtree(item, ett_for_3gpd_block);
2332 block_len = tvb_get_guint8(tvb, offset);
2334 proto_tree_add_uint(subtree, hf_ansi_683_length,
2335 tvb, offset, 1, block_len);
2338 if (block_len > (len - (offset - saved_offset)))
2340 proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb,
2341 offset, len - (offset - saved_offset), "Short Data (?)");
2349 case FOR_BLOCK_3GPD_OP_MODE:
2350 case FOR_BLOCK_3GPD_SIP_USER_PRO:
2351 case FOR_BLOCK_3GPD_MIP_USER_PRO:
2352 case FOR_BLOCK_3GPD_SIP_STATUS:
2353 case FOR_BLOCK_3GPD_MIP_STATUS:
2354 case FOR_BLOCK_3GPD_SIP_PAP_SS:
2355 case FOR_BLOCK_3GPD_SIP_CHAP_SS:
2356 case FOR_BLOCK_3GPD_MIP_SS:
2357 case FOR_BLOCK_3GPD_HRPD_ACC_AUTH_USER:
2358 case FOR_BLOCK_3GPD_HRPD_ACC_AUTH_CHAP_SS:
2360 proto_tree_add_none_format(subtree, hf_ansi_683_none,
2361 tvb, offset, block_len, "Block Data");
2365 offset += block_len;
2369 if (len > (offset - saved_offset))
2372 fresh_handler(tvb, tree, len - (offset - saved_offset), offset);
2375 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
2382 msg_secure_mode_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
2385 const gchar *str = NULL;
2386 guint32 saved_offset;
2388 SHORT_DATA_CHECK(len, 1);
2390 saved_offset = offset;
2392 oct = tvb_get_guint8(tvb, offset);
2394 other_decode_bitfield_value(bigbuf, oct, 0x80, 8);
2395 proto_tree_add_none_format(tree, hf_ansi_683_none,
2397 "%s : %s Secure Mode",
2399 (oct & 0x80) ? "Start" : "Stop");
2403 switch ((oct & 0x78) >> 3)
2405 case 0x0: str = "SMCK generation using SSD_A and SSD_B"; break;
2406 case 0x1: str = "SMCK generation using 3G Root Key"; break;
2407 default: str = "Key in use indicator"; break;
2412 str = "Key in use indicator";
2415 other_decode_bitfield_value(bigbuf, oct, 0x78, 8);
2416 proto_tree_add_none_format(tree, hf_ansi_683_none,
2422 other_decode_bitfield_value(bigbuf, oct, 0x07, 8);
2423 proto_tree_add_none_format(tree, hf_ansi_683_none,
2432 SHORT_DATA_CHECK(len, 8);
2434 proto_tree_add_text(tree,
2436 "Random Number used for SMCK generation");
2441 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
2453 msg_mmd_config_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
2455 guint8 oct, num_blocks;
2456 const gchar *str = NULL;
2457 guint32 i, saved_offset;
2459 SHORT_DATA_CHECK(len, 1);
2461 saved_offset = offset;
2463 num_blocks = tvb_get_guint8(tvb, offset);
2465 proto_tree_add_none_format(tree, hf_ansi_683_none,
2467 "Number of parameter blocks (%u)",
2472 SHORT_DATA_CHECK((len - (offset - saved_offset)), num_blocks);
2474 for (i=0; i < num_blocks; i++)
2476 oct = tvb_get_guint8(tvb, offset);
2478 str = rev_param_block_mmd(oct);
2480 proto_tree_add_none_format(tree, hf_ansi_683_none,
2490 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
2497 msg_mmd_download_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
2499 guint8 block_id, num_blocks, block_len;
2500 const gchar *str = NULL;
2501 proto_tree *subtree;
2503 guint32 i, saved_offset;
2505 SHORT_DATA_CHECK(len, 1);
2507 saved_offset = offset;
2509 num_blocks = tvb_get_guint8(tvb, offset);
2511 proto_tree_add_none_format(tree, hf_ansi_683_none,
2513 "Number of parameter blocks (%u)",
2518 for (i=0; i < num_blocks; i++)
2520 block_id = tvb_get_guint8(tvb, offset);
2522 str = for_param_block_mmd(block_id);
2525 proto_tree_add_none_format(tree, hf_ansi_683_none,
2532 subtree = proto_item_add_subtree(item, ett_for_mmd_block);
2535 block_len = tvb_get_guint8(tvb, offset);
2537 proto_tree_add_uint(subtree, hf_ansi_683_length,
2538 tvb, offset, 1, block_len);
2541 if (block_len > (len - (offset - saved_offset)))
2543 proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb,
2544 offset, len - (offset - saved_offset), "Short Data (?)");
2552 case FOR_BLOCK_MMD_APP:
2554 proto_tree_add_none_format(subtree, hf_ansi_683_none,
2555 tvb, offset, block_len, "Block Data");
2559 offset += block_len;
2563 if (len > (offset - saved_offset))
2566 fresh_handler(tvb, tree, len - (offset - saved_offset), offset);
2569 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
2576 msg_systag_config_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
2579 const gchar *str = NULL;
2580 guint32 saved_offset;
2582 proto_tree *subtree;
2585 SHORT_DATA_CHECK(len, 1);
2587 saved_offset = offset;
2589 oct = tvb_get_guint8(tvb, offset);
2591 str = rev_param_block_systag(oct);
2594 proto_tree_add_none_format(tree, hf_ansi_683_none,
2603 * possible values, but unclear in spec
2604 * REV_BLOCK_SYSTAG_HOME_SYSTAG
2605 * REV_BLOCK_SYSTAG_GROUP_TAG_LIST_DIM
2606 * REV_BLOCK_SYSTAG_GROUP_TAG_LIST
2607 * REV_BLOCK_SYSTAG_SPEC_TAG_LIST_DIM
2608 * REV_BLOCK_SYSTAG_SPEC_TAG_LIST
2609 * REV_BLOCK_SYSTAG_CALL_PROMPT_LIST_DIM
2610 * REV_BLOCK_SYSTAG_CALL_PROMPT_LIST
2612 if (len > (offset - saved_offset))
2614 SHORT_DATA_CHECK(len, 3);
2616 subtree = proto_item_add_subtree(item, ett_segment);
2618 value = tvb_get_ntohs(tvb, offset);
2620 proto_tree_add_none_format(subtree, hf_ansi_683_none,
2622 "Segment offset (%u)",
2626 oct = tvb_get_guint8(tvb, offset);
2628 proto_tree_add_none_format(subtree, hf_ansi_683_none,
2630 "Maximum segment size (%u)",
2635 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
2642 msg_systag_download_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
2644 guint8 oct, block_len;
2645 const gchar *str = NULL;
2646 guint32 saved_offset;
2648 SHORT_DATA_CHECK(len, 2);
2650 saved_offset = offset;
2652 oct = tvb_get_guint8(tvb, offset);
2654 str = for_param_block_systag(oct);
2656 proto_tree_add_none_format(tree, hf_ansi_683_none,
2664 block_len = tvb_get_guint8(tvb, offset);
2666 proto_tree_add_uint(tree, hf_ansi_683_length,
2667 tvb, offset, 1, block_len);
2670 SHORT_DATA_CHECK((len - (offset - saved_offset)), block_len);
2674 proto_tree_add_none_format(tree, hf_ansi_683_none,
2675 tvb, offset, block_len, "Block Data");
2676 offset += block_len;
2679 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
2687 msg_srvckey_gen_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
2689 guint32 saved_offset;
2692 SHORT_DATA_CHECK(len, 2);
2694 saved_offset = offset;
2696 value = tvb_get_ntohs(tvb, offset);
2698 other_decode_bitfield_value(bigbuf, value, 0x8000, 16);
2699 proto_tree_add_none_format(tree, hf_ansi_683_none,
2701 "%s : Key ID: IMS Root Key",
2704 other_decode_bitfield_value(bigbuf, value, 0x4000, 16);
2705 proto_tree_add_none_format(tree, hf_ansi_683_none,
2707 "%s : Key ID: BCMCS Root Key",
2710 other_decode_bitfield_value(bigbuf, value, 0x2000, 16);
2711 proto_tree_add_none_format(tree, hf_ansi_683_none,
2713 "%s : Key ID: WLAN Root Key",
2716 other_decode_bitfield_value(bigbuf, value, 0x1ff0, 16);
2717 proto_tree_add_none_format(tree, hf_ansi_683_none,
2719 "%s : Key ID: Reserved",
2722 other_decode_bitfield_value(bigbuf, value, 0x000f, 16);
2723 proto_tree_add_none_format(tree, hf_ansi_683_none,
2730 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
2737 msg_mms_config_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
2739 guint8 oct, num_blocks;
2740 const gchar *str = NULL;
2741 guint32 i, saved_offset;
2743 SHORT_DATA_CHECK(len, 1);
2745 saved_offset = offset;
2747 num_blocks = tvb_get_guint8(tvb, offset);
2749 proto_tree_add_none_format(tree, hf_ansi_683_none,
2751 "Number of parameter blocks (%u)",
2756 SHORT_DATA_CHECK((len - (offset - saved_offset)), num_blocks);
2758 for (i=0; i < num_blocks; i++)
2760 oct = tvb_get_guint8(tvb, offset);
2762 str = rev_param_block_mms(oct);
2764 proto_tree_add_none_format(tree, hf_ansi_683_none,
2774 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
2781 msg_mms_download_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
2783 guint8 block_id, num_blocks, block_len;
2784 const gchar *str = NULL;
2785 proto_tree *subtree;
2787 guint32 i, saved_offset;
2789 SHORT_DATA_CHECK(len, 1);
2791 saved_offset = offset;
2793 num_blocks = tvb_get_guint8(tvb, offset);
2795 proto_tree_add_none_format(tree, hf_ansi_683_none,
2797 "Number of parameter blocks (%u)",
2802 for (i=0; i < num_blocks; i++)
2804 block_id = tvb_get_guint8(tvb, offset);
2806 str = for_param_block_mms(block_id);
2809 proto_tree_add_none_format(tree, hf_ansi_683_none,
2816 subtree = proto_item_add_subtree(item, ett_for_mms_block);
2819 block_len = tvb_get_guint8(tvb, offset);
2821 proto_tree_add_uint(subtree, hf_ansi_683_length,
2822 tvb, offset, 1, block_len);
2825 if (block_len > (len - (offset - saved_offset)))
2827 proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb,
2828 offset, len - (offset - saved_offset), "Short Data (?)");
2836 case FOR_BLOCK_MMS_URI:
2838 proto_tree_add_none_format(subtree, hf_ansi_683_none,
2839 tvb, offset, block_len, "Block Data");
2843 offset += block_len;
2847 if (len > (offset - saved_offset))
2850 fresh_handler(tvb, tree, len - (offset - saved_offset), offset);
2853 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
2856 /* REVERSE MESSAGES */
2862 msg_config_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
2864 guint8 oct, block_id, num_blocks, block_len;
2865 const gchar *str = NULL;
2866 guint32 i, saved_offset;
2867 proto_tree *subtree;
2870 SHORT_DATA_CHECK(len, 1);
2872 saved_offset = offset;
2874 num_blocks = tvb_get_guint8(tvb, offset);
2876 proto_tree_add_none_format(tree, hf_ansi_683_none,
2878 "Number of parameter blocks (%u)",
2883 SHORT_DATA_CHECK((len - (offset - saved_offset)), (guint32)(num_blocks * 2));
2885 for (i=0; i < num_blocks; i++)
2887 block_id = tvb_get_guint8(tvb, offset);
2889 str = rev_param_block_nam(block_id);
2892 proto_tree_add_none_format(tree, hf_ansi_683_none,
2899 subtree = proto_item_add_subtree(item, ett_rev_nam_block);
2902 block_len = tvb_get_guint8(tvb, offset);
2904 proto_tree_add_uint(subtree, hf_ansi_683_length,
2905 tvb, offset, 1, block_len);
2908 if (block_len > (len - (offset - saved_offset)))
2910 proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb,
2911 offset, len - (offset - saved_offset), "Short Data (?)");
2919 case REV_BLOCK_NAM_CDMA_ANALOG:
2920 rev_param_block_nam_cdma_analog(tvb, subtree, block_len, offset);
2923 case REV_BLOCK_NAM_MDN:
2924 param_block_nam_mdn(tvb, subtree, block_len, offset);
2927 case REV_BLOCK_NAM_CDMA:
2928 rev_param_block_nam_cdma(tvb, subtree, block_len, offset);
2931 case REV_BLOCK_NAM_IMSI_T:
2932 param_block_nam_imsi_t(tvb, subtree, block_len, offset);
2936 proto_tree_add_none_format(subtree, hf_ansi_683_none,
2937 tvb, offset, block_len, "Block Data");
2941 offset += block_len;
2945 SHORT_DATA_CHECK((len - (offset - saved_offset)), num_blocks);
2947 for (i=0; i < num_blocks; i++)
2949 oct = tvb_get_guint8(tvb, offset);
2951 str = rev_res_code_type(oct);
2953 proto_tree_add_none_format(tree, hf_ansi_683_none,
2963 if (len > (offset - saved_offset))
2966 fresh_handler(tvb, tree, len - (offset - saved_offset), offset);
2969 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
2976 msg_download_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
2978 guint8 oct, num_blocks;
2979 const gchar *str = NULL;
2980 guint32 i, saved_offset;
2981 proto_tree *subtree;
2984 SHORT_DATA_CHECK(len, 1);
2986 saved_offset = offset;
2988 num_blocks = tvb_get_guint8(tvb, offset);
2990 proto_tree_add_none_format(tree, hf_ansi_683_none,
2992 "Number of parameter blocks (%u)",
2997 SHORT_DATA_CHECK((len - (offset - saved_offset)), (guint32)(num_blocks * 2));
2999 for (i=0; i < num_blocks; i++)
3001 oct = tvb_get_guint8(tvb, offset);
3003 str = for_param_block_nam(oct);
3006 proto_tree_add_none_format(tree, hf_ansi_683_none,
3013 subtree = proto_item_add_subtree(item, ett_for_nam_block);
3016 oct = tvb_get_guint8(tvb, offset);
3018 str = rev_res_code_type(oct);
3020 proto_tree_add_none_format(subtree, hf_ansi_683_none,
3029 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
3036 msg_ms_key_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
3039 const gchar *str = NULL;
3041 EXACT_DATA_CHECK(len, 1);
3043 oct = tvb_get_guint8(tvb, offset);
3045 str = rev_res_code_type(oct);
3047 proto_tree_add_none_format(tree, hf_ansi_683_none,
3049 "Key exchange result code, %s (%u)",
3060 msg_key_gen_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
3062 guint8 oct, result_len;
3063 const gchar *str = NULL;
3064 guint32 saved_offset;
3066 SHORT_DATA_CHECK(len, 2);
3068 saved_offset = offset;
3070 oct = tvb_get_guint8(tvb, offset);
3072 str = rev_res_code_type(oct);
3074 proto_tree_add_none_format(tree, hf_ansi_683_none,
3076 "Key exchange result code, %s (%u)",
3082 result_len = tvb_get_guint8(tvb, offset);
3084 proto_tree_add_uint(tree, hf_ansi_683_length,
3085 tvb, offset, 1, result_len);
3088 SHORT_DATA_CHECK((len - (offset - saved_offset)), result_len);
3092 proto_tree_add_none_format(tree, hf_ansi_683_none,
3093 tvb, offset, result_len, "Mobile station calculation result");
3094 offset += result_len;
3097 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
3104 msg_reauth_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
3108 EXACT_DATA_CHECK(len, 7);
3110 value = tvb_get_ntoh24(tvb, offset);
3112 other_decode_bitfield_value(bigbuf, value, 0xffffc0, 24);
3113 proto_tree_add_none_format(tree, hf_ansi_683_none,
3115 "%s : Authentication signature data (AUTHR) (%u)",
3117 (value & 0xffffc0) >> 6);
3121 value = tvb_get_ntohs(tvb, offset);
3123 other_decode_bitfield_value(bigbuf, value, 0x3fc0, 16);
3124 proto_tree_add_none_format(tree, hf_ansi_683_none,
3126 "%s : Random challenge value (RANDC) (%u)",
3128 (value & 0x3fc0) >> 6);
3130 other_decode_bitfield_value(bigbuf, value, 0x3f, 8);
3131 proto_tree_add_none_format(tree, hf_ansi_683_none,
3133 "%s : Call history parameter (COUNT) (%u)",
3139 value = tvb_get_ntoh24(tvb, offset);
3141 other_decode_bitfield_value(bigbuf, value, 0xffffff, 24);
3142 proto_tree_add_none_format(tree, hf_ansi_683_none,
3144 "%s : Authentication Data input parameter (AUTH_DATA) (%u)",
3153 msg_commit_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
3156 const gchar *str = NULL;
3158 EXACT_DATA_CHECK(len, 1);
3160 oct = tvb_get_guint8(tvb, offset);
3162 str = rev_res_code_type(oct);
3164 proto_tree_add_none_format(tree, hf_ansi_683_none,
3166 "Data commit result code, %s (%u)",
3177 msg_protocap_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
3179 guint8 oct, num_feat, add_len;
3180 const gchar *str = NULL;
3181 guint32 i, saved_offset;
3183 proto_tree *subtree;
3186 SHORT_DATA_CHECK(len, 5);
3188 saved_offset = offset;
3190 value = tvb_get_ntohs(tvb, offset);
3192 proto_tree_add_none_format(tree, hf_ansi_683_none,
3194 "Mobile station firmware revision number (%u)",
3199 oct = tvb_get_guint8(tvb, offset);
3201 proto_tree_add_none_format(tree, hf_ansi_683_none,
3203 "Mobile station manufacturer's model number (%u)",
3208 num_feat = tvb_get_guint8(tvb, offset);
3210 proto_tree_add_none_format(tree, hf_ansi_683_none,
3212 "Number of features (%u)",
3217 SHORT_DATA_CHECK((len - (offset - saved_offset)), (guint32)(num_feat * 2));
3219 for (i=0; i < num_feat; i++)
3221 oct = tvb_get_guint8(tvb, offset);
3223 str = rev_feat_id_type(oct);
3226 proto_tree_add_none_format(tree, hf_ansi_683_none,
3228 "[%u]: Feature ID, %s (%u)",
3233 subtree = proto_item_add_subtree(item, ett_rev_feat);
3236 oct = tvb_get_guint8(tvb, offset);
3238 proto_tree_add_none_format(subtree, hf_ansi_683_none,
3240 "Feature protocol version (%u)",
3246 add_len = tvb_get_guint8(tvb, offset);
3248 proto_tree_add_uint(tree, hf_ansi_683_length,
3249 tvb, offset, 1, add_len);
3252 SHORT_DATA_CHECK((len - (offset - saved_offset)), add_len);
3256 oct = tvb_get_guint8(tvb, offset);
3259 proto_tree_add_none_format(tree, hf_ansi_683_none,
3261 "Band/Mode Capability Information");
3263 subtree = proto_item_add_subtree(item, ett_band_cap);
3265 other_decode_bitfield_value(bigbuf, oct, 0x80, 8);
3266 proto_tree_add_none_format(subtree, hf_ansi_683_none,
3268 "%s : Band Class 0 Analog",
3271 other_decode_bitfield_value(bigbuf, oct, 0x40, 8);
3272 proto_tree_add_none_format(subtree, hf_ansi_683_none,
3274 "%s : Band Class 0 CDMA",
3277 other_decode_bitfield_value(bigbuf, oct, 0x20, 8);
3278 proto_tree_add_none_format(subtree, hf_ansi_683_none,
3280 "%s : Band Class 1 CDMA",
3283 other_decode_bitfield_value(bigbuf, oct, 0x10, 8);
3284 proto_tree_add_none_format(subtree, hf_ansi_683_none,
3286 "%s : Band Class 3 CDMA",
3289 other_decode_bitfield_value(bigbuf, oct, 0x08, 8);
3290 proto_tree_add_none_format(subtree, hf_ansi_683_none,
3292 "%s : Band Class 6 CDMA",
3295 other_decode_bitfield_value(bigbuf, oct, 0x07, 8);
3296 proto_tree_add_none_format(subtree, hf_ansi_683_none,
3305 proto_tree_add_none_format(tree, hf_ansi_683_none,
3306 tvb, offset, add_len - 1,
3307 "More Additional Fields");
3308 offset += (add_len - 1);
3312 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
3319 msg_sspr_config_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
3321 guint8 oct, block_len;
3322 const gchar *str = NULL;
3323 guint32 saved_offset;
3325 SHORT_DATA_CHECK(len, 3);
3327 saved_offset = offset;
3329 oct = tvb_get_guint8(tvb, offset);
3331 str = rev_param_block_sspr(oct);
3333 proto_tree_add_none_format(tree, hf_ansi_683_none,
3341 oct = tvb_get_guint8(tvb, offset);
3343 str = rev_res_code_type(oct);
3345 proto_tree_add_none_format(tree, hf_ansi_683_none,
3347 "SSPR Configuration result code, %s (%u)",
3353 block_len = tvb_get_guint8(tvb, offset);
3355 proto_tree_add_uint(tree, hf_ansi_683_length,
3356 tvb, offset, 1, block_len);
3359 SHORT_DATA_CHECK((len - (offset - saved_offset)), block_len);
3363 proto_tree_add_none_format(tree, hf_ansi_683_none,
3364 tvb, offset, block_len, "Block Data");
3365 offset += block_len;
3368 if (len > (offset - saved_offset))
3371 fresh_handler(tvb, tree, len - (offset - saved_offset), offset);
3374 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
3381 msg_sspr_download_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
3383 guint8 oct, block_id;
3384 const gchar *str = NULL;
3387 EXACT_DATA_CHECK(len, 5);
3389 block_id = tvb_get_guint8(tvb, offset);
3391 str = for_param_block_sspr(block_id);
3393 proto_tree_add_none_format(tree, hf_ansi_683_none,
3401 oct = tvb_get_guint8(tvb, offset);
3403 str = rev_res_code_type(oct);
3405 proto_tree_add_none_format(tree, hf_ansi_683_none,
3407 "SSPR Download result code, %s (%u)",
3415 case FOR_BLOCK_SSPR_PRL:
3416 case FOR_BLOCK_SSPR_EXT_PRL:
3417 value = tvb_get_ntohs(tvb, offset);
3419 proto_tree_add_none_format(tree, hf_ansi_683_none,
3421 "Segment offset (%u)",
3425 oct = tvb_get_guint8(tvb, offset);
3427 proto_tree_add_none_format(tree, hf_ansi_683_none,
3429 "Maximum segment size (%u)",
3440 msg_validate_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
3442 guint8 oct, block_id, num_blocks;
3443 const gchar *str = NULL;
3444 guint32 i, saved_offset;
3445 proto_tree *subtree;
3448 SHORT_DATA_CHECK(len, 1);
3450 saved_offset = offset;
3452 num_blocks = tvb_get_guint8(tvb, offset);
3454 proto_tree_add_none_format(tree, hf_ansi_683_none,
3456 "Number of parameter blocks (%u)",
3461 SHORT_DATA_CHECK((len - (offset - saved_offset)), (guint32)(num_blocks * 2));
3463 for (i=0; i < num_blocks; i++)
3465 block_id = tvb_get_guint8(tvb, offset);
3467 str = for_param_block_val(block_id);
3470 proto_tree_add_none_format(tree, hf_ansi_683_none,
3477 subtree = proto_item_add_subtree(item, ett_for_val_block);
3480 oct = tvb_get_guint8(tvb, offset);
3482 str = rev_res_code_type(oct);
3484 proto_tree_add_none_format(subtree, hf_ansi_683_none,
3493 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
3500 msg_otapa_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
3503 const gchar *str = NULL;
3504 guint32 saved_offset;
3506 SHORT_DATA_CHECK(len, 2);
3508 saved_offset = offset;
3510 oct = tvb_get_guint8(tvb, offset);
3512 str = rev_res_code_type(oct);
3514 proto_tree_add_none_format(tree, hf_ansi_683_none,
3522 oct = tvb_get_guint8(tvb, offset);
3524 other_decode_bitfield_value(bigbuf, oct, 0xfe, 8);
3525 proto_tree_add_none_format(tree, hf_ansi_683_none,
3530 other_decode_bitfield_value(bigbuf, oct, 0x01, 8);
3531 proto_tree_add_none_format(tree, hf_ansi_683_none,
3533 "%s : NAM_LOCK indicator",
3540 SHORT_DATA_CHECK((len - (offset - saved_offset)), 4);
3542 proto_tree_add_none_format(tree, hf_ansi_683_none,
3544 "SPASM random challenge");
3548 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
3555 msg_puzl_config_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
3557 guint8 oct, block_len;
3558 const gchar *str = NULL;
3559 guint32 saved_offset;
3561 SHORT_DATA_CHECK(len, 3);
3563 saved_offset = offset;
3565 oct = tvb_get_guint8(tvb, offset);
3567 str = rev_param_block_puzl(oct);
3569 proto_tree_add_none_format(tree, hf_ansi_683_none,
3577 oct = tvb_get_guint8(tvb, offset);
3579 str = rev_res_code_type(oct);
3581 proto_tree_add_none_format(tree, hf_ansi_683_none,
3583 "PUZL Configuration result code, %s (%u)",
3589 block_len = tvb_get_guint8(tvb, offset);
3591 proto_tree_add_uint(tree, hf_ansi_683_length,
3592 tvb, offset, 1, block_len);
3595 SHORT_DATA_CHECK((len - (offset - saved_offset)), block_len);
3599 proto_tree_add_none_format(tree, hf_ansi_683_none,
3600 tvb, offset, block_len, "Block Data");
3601 offset += block_len;
3604 if (len > (offset - saved_offset))
3607 fresh_handler(tvb, tree, len - (offset - saved_offset), offset);
3610 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
3617 msg_puzl_download_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
3619 guint8 oct, block_id, num_blocks;
3620 const gchar *str = NULL;
3621 guint32 i, saved_offset;
3622 proto_tree *subtree;
3624 guint32 value, temp_value;
3626 SHORT_DATA_CHECK(len, 1);
3628 saved_offset = offset;
3630 num_blocks = tvb_get_guint8(tvb, offset);
3632 proto_tree_add_none_format(tree, hf_ansi_683_none,
3634 "Number of parameter blocks (%u)",
3639 /* minimum required length */
3640 SHORT_DATA_CHECK((len - (offset - saved_offset)), (guint32)(num_blocks * 3));
3642 for (i=0; i < num_blocks; i++)
3644 block_id = tvb_get_guint8(tvb, offset);
3646 str = for_param_block_puzl(block_id);
3649 proto_tree_add_none_format(tree, hf_ansi_683_none,
3656 subtree = proto_item_add_subtree(item, ett_for_puzl_block);
3659 oct = tvb_get_guint8(tvb, offset);
3661 str = rev_res_code_type(oct);
3663 proto_tree_add_none_format(subtree, hf_ansi_683_none,
3671 oct = tvb_get_guint8(tvb, offset);
3675 SHORT_DATA_CHECK(len, 4);
3677 value = tvb_get_ntohs(tvb, offset);
3679 other_decode_bitfield_value(bigbuf, value, 0x8000, 16);
3680 proto_tree_add_none_format(tree, hf_ansi_683_none,
3682 "%s : Identifiers present",
3685 other_decode_bitfield_value(bigbuf, value, 0x7fff, 16);
3686 proto_tree_add_none_format(tree, hf_ansi_683_none,
3688 "%s : User Zone ID (MSB)",
3693 temp_value = (value & 0x7fff) << 1;
3694 value = tvb_get_ntohs(tvb, offset);
3696 other_decode_bitfield_value(bigbuf, value, 0x8000, 16);
3697 proto_tree_add_none_format(tree, hf_ansi_683_none,
3699 "%s : User Zone ID (%u)",
3701 temp_value + ((value & 0x8000) >> 15));
3703 other_decode_bitfield_value(bigbuf, value, 0x7fff, 16);
3704 proto_tree_add_none_format(tree, hf_ansi_683_none,
3706 "%s : User Zone SID (%u)",
3714 other_decode_bitfield_value(bigbuf, oct, 0x80, 8);
3715 proto_tree_add_none_format(tree, hf_ansi_683_none,
3717 "%s : Identifiers not present",
3720 other_decode_bitfield_value(bigbuf, oct, 0x7f, 8);
3721 proto_tree_add_none_format(tree, hf_ansi_683_none,
3730 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
3737 msg_3gpd_config_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
3739 guint8 oct, block_id, num_blocks, block_len;
3740 const gchar *str = NULL;
3741 guint32 i, saved_offset;
3742 proto_tree *subtree;
3745 SHORT_DATA_CHECK(len, 1);
3747 saved_offset = offset;
3749 num_blocks = tvb_get_guint8(tvb, offset);
3751 proto_tree_add_none_format(tree, hf_ansi_683_none,
3753 "Number of parameter blocks (%u)",
3758 /* minimum required length */
3759 SHORT_DATA_CHECK((len - (offset - saved_offset)), (guint32)(num_blocks * 3));
3761 for (i=0; i < num_blocks; i++)
3763 block_id = tvb_get_guint8(tvb, offset);
3765 str = rev_param_block_3gpd(block_id);
3768 proto_tree_add_none_format(tree, hf_ansi_683_none,
3775 subtree = proto_item_add_subtree(item, ett_rev_3gpd_block);
3778 block_len = tvb_get_guint8(tvb, offset);
3780 proto_tree_add_uint(subtree, hf_ansi_683_length,
3781 tvb, offset, 1, block_len);
3784 if (block_len > (len - (offset - saved_offset)))
3786 proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb,
3787 offset, len - (offset - saved_offset), "Short Data (?)");
3795 case REV_BLOCK_3GPD_OP_CAP:
3796 case REV_BLOCK_3GPD_OP_MODE:
3797 case REV_BLOCK_3GPD_SIP_CAP:
3798 case REV_BLOCK_3GPD_MIP_CAP:
3799 case REV_BLOCK_3GPD_SIP_USER_PRO:
3800 case REV_BLOCK_3GPD_MIP_USER_PRO:
3801 case REV_BLOCK_3GPD_SIP_STATUS:
3802 case REV_BLOCK_3GPD_MIP_STATUS:
3803 case REV_BLOCK_3GPD_SIP_PAP_SS:
3804 case REV_BLOCK_3GPD_SIP_CHAP_SS:
3805 case REV_BLOCK_3GPD_MIP_SS:
3806 case REV_BLOCK_3GPD_HRPD_ACC_AUTH_CAP:
3807 case REV_BLOCK_3GPD_HRPD_ACC_AUTH_USER:
3808 case REV_BLOCK_3GPD_HRPD_ACC_AUTH_CHAP_SS:
3810 proto_tree_add_none_format(subtree, hf_ansi_683_none,
3811 tvb, offset, block_len, "Block Data");
3815 offset += block_len;
3818 SHORT_DATA_CHECK(len, 1);
3820 oct = tvb_get_guint8(tvb, offset);
3822 str = rev_res_code_type(oct);
3824 proto_tree_add_none_format(tree, hf_ansi_683_none,
3833 if (len > (offset - saved_offset))
3836 fresh_handler(tvb, tree, len - (offset - saved_offset), offset);
3839 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
3846 msg_3gpd_download_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
3848 guint8 oct, num_blocks;
3849 const gchar *str = NULL;
3850 guint32 i, saved_offset;
3851 proto_tree *subtree;
3854 SHORT_DATA_CHECK(len, 1);
3856 saved_offset = offset;
3858 num_blocks = tvb_get_guint8(tvb, offset);
3860 proto_tree_add_none_format(tree, hf_ansi_683_none,
3862 "Number of parameter blocks (%u)",
3867 SHORT_DATA_CHECK((len - (offset - saved_offset)), (guint32)(num_blocks * 2));
3869 for (i=0; i < num_blocks; i++)
3871 oct = tvb_get_guint8(tvb, offset);
3873 str = for_param_block_3gpd(oct);
3876 proto_tree_add_none_format(tree, hf_ansi_683_none,
3883 subtree = proto_item_add_subtree(item, ett_for_3gpd_block);
3886 oct = tvb_get_guint8(tvb, offset);
3888 str = rev_res_code_type(oct);
3890 proto_tree_add_none_format(subtree, hf_ansi_683_none,
3899 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
3906 msg_secure_mode_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
3909 const gchar *str = NULL;
3911 EXACT_DATA_CHECK(len, 1);
3913 oct = tvb_get_guint8(tvb, offset);
3915 str = rev_res_code_type(oct);
3917 proto_tree_add_none_format(tree, hf_ansi_683_none,
3919 "Secure Mode result code, %s (%u)",
3930 msg_ext_protocap_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
3932 guint8 oct, block_id, num_recs, block_len;
3933 const gchar *str = NULL;
3934 guint32 i, saved_offset;
3936 proto_tree *subtree;
3939 SHORT_DATA_CHECK(len, 6);
3941 saved_offset = offset;
3943 oct = tvb_get_guint8(tvb, offset);
3945 proto_tree_add_none_format(tree, hf_ansi_683_none,
3947 "OTASP Mobile Protocol Revision (%u)",
3952 value = tvb_get_ntohs(tvb, offset);
3954 proto_tree_add_none_format(tree, hf_ansi_683_none,
3956 "Mobile station firmware revision number (%u)",
3961 oct = tvb_get_guint8(tvb, offset);
3963 proto_tree_add_none_format(tree, hf_ansi_683_none,
3965 "Mobile station manufacturer's model number (%u)",
3970 num_recs = tvb_get_guint8(tvb, offset);
3972 proto_tree_add_none_format(tree, hf_ansi_683_none,
3974 "Number of features (%u)",
3979 SHORT_DATA_CHECK((len - (offset - saved_offset)), (guint32)(num_recs * 2));
3981 for (i=0; i < num_recs; i++)
3983 oct = tvb_get_guint8(tvb, offset);
3985 str = rev_feat_id_type(oct);
3988 proto_tree_add_none_format(tree, hf_ansi_683_none,
3990 "[%u]: Feature ID, %s (%u)",
3995 subtree = proto_item_add_subtree(item, ett_rev_feat);
3998 oct = tvb_get_guint8(tvb, offset);
4000 proto_tree_add_none_format(subtree, hf_ansi_683_none,
4002 "Feature protocol version (%u)",
4008 SHORT_DATA_CHECK((len - (offset - saved_offset)), 1);
4010 num_recs = tvb_get_guint8(tvb, offset);
4012 proto_tree_add_none_format(tree, hf_ansi_683_none,
4014 "Number of Capability Records (%u)",
4019 /* minimum required length */
4020 SHORT_DATA_CHECK((len - (offset - saved_offset)), (guint32)(num_recs * 2));
4022 for (i=0; i < num_recs; i++)
4024 block_id = tvb_get_guint8(tvb, offset);
4026 str = rev_cap_info_record_type(block_id);
4029 proto_tree_add_none_format(tree, hf_ansi_683_none,
4036 subtree = proto_item_add_subtree(item, ett_rev_cap);
4039 block_len = tvb_get_guint8(tvb, offset);
4041 proto_tree_add_uint(subtree, hf_ansi_683_length,
4042 tvb, offset, 1, block_len);
4045 if (block_len > (len - (offset - saved_offset)))
4047 proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb,
4048 offset, len - (offset - saved_offset), "Short Data (?)");
4057 case REV_TYPE_CAP_INFO_OP_MODE:
4058 case REV_TYPE_CAP_INFO_CDMA_BAND:
4059 case REV_TYPE_CAP_INFO_MEID:
4060 case REV_TYPE_CAP_INFO_ICCID:
4061 case REV_TYPE_CAP_INFO_EXT_UIM_ID:
4062 rev_param_block_mmd_app(tvb, subtree, block_len, offset);
4067 proto_tree_add_none_format(subtree, hf_ansi_683_none,
4068 tvb, offset, block_len, "Capability Data");
4072 offset += block_len;
4076 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
4083 msg_mmd_config_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
4085 guint8 oct, block_id, num_blocks, block_len;
4086 const gchar *str = NULL;
4087 guint32 i, saved_offset;
4088 proto_tree *subtree;
4091 SHORT_DATA_CHECK(len, 1);
4093 saved_offset = offset;
4095 num_blocks = tvb_get_guint8(tvb, offset);
4097 proto_tree_add_none_format(tree, hf_ansi_683_none,
4099 "Number of parameter blocks (%u)",
4104 /* minimum required length */
4105 SHORT_DATA_CHECK((len - (offset - saved_offset)), (guint32)(num_blocks * 3));
4107 for (i=0; i < num_blocks; i++)
4109 block_id = tvb_get_guint8(tvb, offset);
4111 str = rev_param_block_mmd(block_id);
4114 proto_tree_add_none_format(tree, hf_ansi_683_none,
4121 subtree = proto_item_add_subtree(item, ett_rev_mmd_block);
4124 block_len = tvb_get_guint8(tvb, offset);
4126 proto_tree_add_uint(subtree, hf_ansi_683_length,
4127 tvb, offset, 1, block_len);
4130 if (block_len > (len - (offset - saved_offset)))
4132 proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb,
4133 offset, len - (offset - saved_offset), "Short Data (?)");
4142 case REV_BLOCK_MMD_APP:
4143 rev_param_block_mmd_app(tvb, subtree, block_len, offset);
4148 proto_tree_add_none_format(subtree, hf_ansi_683_none,
4149 tvb, offset, block_len, "Block Data");
4153 offset += block_len;
4156 SHORT_DATA_CHECK(len, 1);
4158 oct = tvb_get_guint8(tvb, offset);
4160 str = rev_res_code_type(oct);
4162 proto_tree_add_none_format(tree, hf_ansi_683_none,
4171 if (len > (offset - saved_offset))
4174 fresh_handler(tvb, tree, len - (offset - saved_offset), offset);
4177 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
4184 msg_mmd_download_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
4186 guint8 oct, num_blocks;
4187 const gchar *str = NULL;
4188 guint32 i, saved_offset;
4189 proto_tree *subtree;
4192 SHORT_DATA_CHECK(len, 1);
4194 saved_offset = offset;
4196 num_blocks = tvb_get_guint8(tvb, offset);
4198 proto_tree_add_none_format(tree, hf_ansi_683_none,
4200 "Number of parameter blocks (%u)",
4205 SHORT_DATA_CHECK((len - (offset - saved_offset)), (guint32)(num_blocks * 2));
4207 for (i=0; i < num_blocks; i++)
4209 oct = tvb_get_guint8(tvb, offset);
4211 str = for_param_block_mmd(oct);
4214 proto_tree_add_none_format(tree, hf_ansi_683_none,
4221 subtree = proto_item_add_subtree(item, ett_for_mmd_block);
4224 oct = tvb_get_guint8(tvb, offset);
4226 str = rev_res_code_type(oct);
4228 proto_tree_add_none_format(subtree, hf_ansi_683_none,
4237 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
4244 msg_systag_config_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
4246 guint8 oct, block_len;
4247 const gchar *str = NULL;
4248 guint32 saved_offset;
4250 SHORT_DATA_CHECK(len, 3);
4252 saved_offset = offset;
4254 oct = tvb_get_guint8(tvb, offset);
4256 str = rev_param_block_systag(oct);
4258 proto_tree_add_none_format(tree, hf_ansi_683_none,
4266 oct = tvb_get_guint8(tvb, offset);
4268 str = rev_res_code_type(oct);
4270 proto_tree_add_none_format(tree, hf_ansi_683_none,
4272 "System Tag result code, %s (%u)",
4278 block_len = tvb_get_guint8(tvb, offset);
4280 proto_tree_add_uint(tree, hf_ansi_683_length,
4281 tvb, offset, 1, block_len);
4284 SHORT_DATA_CHECK((len - (offset - saved_offset)), block_len);
4288 proto_tree_add_none_format(tree, hf_ansi_683_none,
4289 tvb, offset, block_len, "Block Data");
4290 offset += block_len;
4293 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
4300 msg_systag_download_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
4302 guint8 oct, block_id;
4303 const gchar *str = NULL;
4304 guint32 saved_offset;
4307 SHORT_DATA_CHECK(len, 2);
4309 saved_offset = offset;
4311 block_id = tvb_get_guint8(tvb, offset);
4313 str = for_param_block_systag(block_id);
4315 proto_tree_add_none_format(tree, hf_ansi_683_none,
4323 oct = tvb_get_guint8(tvb, offset);
4325 str = rev_res_code_type(oct);
4327 proto_tree_add_none_format(tree, hf_ansi_683_none,
4329 "System Tag Download result code, %s (%u)",
4337 case 0x01: /* Group Tag List Parameter */
4338 case 0x02: /* Specific Tag List Parameter */
4339 case 0x03: /* Call Prompt List Parameter */
4340 SHORT_DATA_CHECK(len, 3);
4342 value = tvb_get_ntohs(tvb, offset);
4344 proto_tree_add_none_format(tree, hf_ansi_683_none,
4346 "Segment offset (%u)",
4350 oct = tvb_get_guint8(tvb, offset);
4352 proto_tree_add_none_format(tree, hf_ansi_683_none,
4354 "Segment size (%u)",
4363 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
4370 msg_srvckey_gen_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
4373 const gchar *str = NULL;
4375 EXACT_DATA_CHECK(len, 1);
4377 oct = tvb_get_guint8(tvb, offset);
4379 str = rev_res_code_type(oct);
4381 proto_tree_add_none_format(tree, hf_ansi_683_none,
4383 "Service Key Generation result code, %s (%u)",
4394 msg_mms_config_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
4396 guint8 oct, block_id, num_blocks, block_len;
4397 const gchar *str = NULL;
4398 guint32 i, saved_offset;
4399 proto_tree *subtree;
4402 SHORT_DATA_CHECK(len, 1);
4404 saved_offset = offset;
4406 num_blocks = tvb_get_guint8(tvb, offset);
4408 proto_tree_add_none_format(tree, hf_ansi_683_none,
4410 "Number of parameter blocks (%u)",
4415 /* minimum required length */
4416 SHORT_DATA_CHECK((len - (offset - saved_offset)), (guint32)(num_blocks * 3));
4418 for (i=0; i < num_blocks; i++)
4420 block_id = tvb_get_guint8(tvb, offset);
4422 str = rev_param_block_mms(block_id);
4425 proto_tree_add_none_format(tree, hf_ansi_683_none,
4432 subtree = proto_item_add_subtree(item, ett_rev_mms_block);
4435 block_len = tvb_get_guint8(tvb, offset);
4437 proto_tree_add_uint(subtree, hf_ansi_683_length,
4438 tvb, offset, 1, block_len);
4441 if (block_len > (len - (offset - saved_offset)))
4443 proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb,
4444 offset, len - (offset - saved_offset), "Short Data (?)");
4453 case REV_BLOCK_MMS_URI:
4454 rev_param_block_mms_uri(tvb, subtree, block_len, offset);
4457 case REV_BLOCK_MMS_URI_CAP:
4458 rev_param_block_mms_uri_cap(tvb, subtree, block_len, offset);
4463 proto_tree_add_none_format(subtree, hf_ansi_683_none,
4464 tvb, offset, block_len, "Block Data");
4468 offset += block_len;
4471 SHORT_DATA_CHECK(len, 1);
4473 oct = tvb_get_guint8(tvb, offset);
4475 str = rev_res_code_type(oct);
4477 proto_tree_add_none_format(tree, hf_ansi_683_none,
4486 if (len > (offset - saved_offset))
4489 fresh_handler(tvb, tree, len - (offset - saved_offset), offset);
4492 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
4499 msg_mms_download_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
4501 guint8 oct, num_blocks;
4502 const gchar *str = NULL;
4503 guint32 i, saved_offset;
4504 proto_tree *subtree;
4507 SHORT_DATA_CHECK(len, 1);
4509 saved_offset = offset;
4511 num_blocks = tvb_get_guint8(tvb, offset);
4513 proto_tree_add_none_format(tree, hf_ansi_683_none,
4515 "Number of parameter blocks (%u)",
4520 SHORT_DATA_CHECK((len - (offset - saved_offset)), (guint32)(num_blocks * 2));
4522 for (i=0; i < num_blocks; i++)
4524 oct = tvb_get_guint8(tvb, offset);
4526 str = for_param_block_mms(oct);
4529 proto_tree_add_none_format(tree, hf_ansi_683_none,
4536 subtree = proto_item_add_subtree(item, ett_for_mms_block);
4539 oct = tvb_get_guint8(tvb, offset);
4541 str = rev_res_code_type(oct);
4543 proto_tree_add_none_format(subtree, hf_ansi_683_none,
4552 EXTRANEOUS_DATA_CHECK(len, offset - saved_offset);
4555 static const value_string for_msg_type_strings[] = {
4556 { 0, "Configuration Request" },
4557 { 1, "Download Request" },
4558 { 2, "MS Key Request" },
4559 { 3, "Key Generation Request" },
4560 { 4, "Re-Authenticate Request" },
4561 { 5, "Commit Request" },
4562 { 6, "Protocol Capability Request" },
4563 { 7, "SSPR Configuration Request" },
4564 { 8, "SSPR Download Request" },
4565 { 9, "Validation Request" },
4566 { 10, "OTAPA Request" },
4567 { 11, "PUZL Configuration Request" },
4568 { 12, "PUZL Download Request" },
4569 { 13, "3GPD Configuration Request" },
4570 { 14, "3GPD Download Request" },
4571 { 15, "Secure Mode Request" },
4573 { 17, "MMD Configuration Request" },
4574 { 18, "MMD Download Request" },
4575 { 19, "System Tag Configuration Request" },
4576 { 20, "System Tag Download Request" },
4577 { 21, "Service Key Generation Request" },
4578 { 22, "MMS Configuration Request" },
4579 { 23, "MMS Download Request" },
4582 #define NUM_FOR_MSGS (sizeof(for_msg_type_strings)/sizeof(value_string))
4583 static void (*ansi_683_for_msg_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) = {
4584 msg_config_req, /* Configuration Request */
4585 msg_download_req, /* Download Request */
4586 msg_ms_key_req, /* MS Key Request */
4587 msg_key_gen_req, /* Key Generation Request */
4588 msg_reauth_req, /* Re-Authenticate Request */
4589 NULL /* No data */, /* Commit Request */
4590 msg_protocap_req, /* Protocol Capability Request */
4591 msg_sspr_config_req, /* SSPR Configuration Request */
4592 msg_sspr_download_req, /* SSPR Download Request */
4593 msg_validate_req, /* Validation Request */
4594 msg_otapa_req, /* OTAPA Request */
4595 msg_puzl_config_req, /* PUZL Configuration Request */
4596 msg_puzl_download_req, /* PUZL Download Request */
4597 msg_3gpd_config_req, /* 3GPD Configuration Request */
4598 msg_3gpd_download_req, /* 3GPD Download Request */
4599 msg_secure_mode_req, /* Secure Mode Request */
4600 NULL, /* Reserved */
4601 msg_mmd_config_req, /* MMD Configuration Request */
4602 msg_mmd_download_req, /* MMD Download Request */
4603 msg_systag_config_req, /* System Tag Configuration Request */
4604 msg_systag_download_req, /* System Tag Download Request */
4605 msg_srvckey_gen_req, /* Service Key Generation Request */
4606 msg_mms_config_req, /* MMS Configuration Request */
4607 msg_mms_download_req, /* MMS Download Request */
4611 static const value_string rev_msg_type_strings[] = {
4612 { 0, "Configuration Response" },
4613 { 1, "Download Response" },
4614 { 2, "MS Key Response" },
4615 { 3, "Key Generation Response" },
4616 { 4, "Re-Authenticate Response" },
4617 { 5, "Commit Response" },
4618 { 6, "Protocol Capability Response" },
4619 { 7, "SSPR Configuration Response" },
4620 { 8, "SSPR Download Response" },
4621 { 9, "Validation Response" },
4622 { 10, "OTAPA Response" },
4623 { 11, "PUZL Configuration Response" },
4624 { 12, "PUZL Download Response" },
4625 { 13, "3GPD Configuration Response" },
4626 { 14, "3GPD Download Response" },
4627 { 15, "Secure Mode Response" },
4628 { 16, "Extended Protocol Capability Response" },
4629 { 17, "MMD Configuration Response" },
4630 { 18, "MMD Download Response" },
4631 { 19, "System Tag Configuration Response" },
4632 { 20, "System Tag Download Response" },
4633 { 21, "Service Key Generation Response" },
4634 { 22, "MMS Configuration Response" },
4635 { 23, "MMS Download Response" },
4638 #define NUM_REV_MSGS (sizeof(rev_msg_type_strings)/sizeof(value_string))
4639 static void (*ansi_683_rev_msg_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) = {
4640 msg_config_rsp, /* Configuration Response */
4641 msg_download_rsp, /* Download Response */
4642 msg_ms_key_rsp, /* MS Key Response */
4643 msg_key_gen_rsp, /* Key Generation Response */
4644 msg_reauth_rsp, /* Re-Authenticate Response */
4645 msg_commit_rsp, /* Commit Response */
4646 msg_protocap_rsp, /* Protocol Capability Response */
4647 msg_sspr_config_rsp, /* SSPR Configuration Response */
4648 msg_sspr_download_rsp, /* SSPR Download Response */
4649 msg_validate_rsp, /* Validation Response */
4650 msg_otapa_rsp, /* OTAPA Response */
4651 msg_puzl_config_rsp, /* PUZL Configuration Response */
4652 msg_puzl_download_rsp, /* PUZL Download Response */
4653 msg_3gpd_config_rsp, /* 3GPD Configuration Response */
4654 msg_3gpd_download_rsp, /* 3GPD Download Response */
4655 msg_secure_mode_rsp, /* Secure Mode Response */
4656 msg_ext_protocap_rsp, /* Extended Protocol Capability Response */
4657 msg_mmd_config_rsp, /* MMD Configuration Response */
4658 msg_mmd_download_rsp, /* MMD Download Response */
4659 msg_systag_config_rsp, /* System Tag Configuration Response */
4660 msg_systag_download_rsp, /* System Tag Download Response */
4661 msg_srvckey_gen_rsp, /* Service Key Generation Response */
4662 msg_mms_config_rsp, /* MMS Configuration Response */
4663 msg_mms_download_rsp, /* MMS Download Response */
4669 dissect_ansi_683_for_message(tvbuff_t *tvb, proto_tree *ansi_683_tree)
4673 const gchar *str = NULL;
4676 msg_type = tvb_get_guint8(tvb, 0);
4678 str = try_val_to_str_idx(msg_type, for_msg_type_strings, &idx);
4686 * No Information column data
4689 proto_tree_add_uint(ansi_683_tree, hf_ansi_683_for_msg_type,
4690 tvb, 0, 1, msg_type);
4692 if (ansi_683_for_msg_fcn[idx] != NULL)
4694 (*ansi_683_for_msg_fcn[idx])(tvb, ansi_683_tree, tvb_length(tvb) - 1, 1);
4699 dissect_ansi_683_rev_message(tvbuff_t *tvb, proto_tree *ansi_683_tree)
4703 const gchar *str = NULL;
4706 msg_type = tvb_get_guint8(tvb, 0);
4708 str = try_val_to_str_idx(msg_type, rev_msg_type_strings, &idx);
4716 * No Information column data
4719 proto_tree_add_uint(ansi_683_tree, hf_ansi_683_rev_msg_type,
4720 tvb, 0, 1, msg_type);
4722 (*ansi_683_rev_msg_fcn[idx])(tvb, ansi_683_tree, tvb_length(tvb) - 1, 1);
4726 dissect_ansi_683(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
4728 proto_item *ansi_683_item;
4729 proto_tree *ansi_683_tree = NULL;
4731 col_set_str(pinfo->cinfo, COL_PROTOCOL, ansi_proto_name_short);
4733 /* In the interest of speed, if "tree" is NULL, don't do any work not
4734 * necessary to generate protocol tree items.
4739 * create the ansi_683 protocol tree
4742 proto_tree_add_protocol_format(tree, proto_ansi_683, tvb, 0, -1,
4745 (pinfo->match_uint == ANSI_683_FORWARD) ? "Forward" : "Reverse");
4748 proto_item_add_subtree(ansi_683_item, ett_ansi_683);
4750 if (pinfo->match_uint == ANSI_683_FORWARD)
4752 dissect_ansi_683_for_message(tvb, ansi_683_tree);
4756 dissect_ansi_683_rev_message(tvb, ansi_683_tree);
4762 /* Register the protocol with Wireshark */
4764 proto_register_ansi_683(void)
4767 /* Setup list of header fields */
4768 static hf_register_info hf[] =
4770 { &hf_ansi_683_for_msg_type,
4771 { "Forward Link Message Type",
4772 "ansi_683.for_msg_type",
4773 FT_UINT8, BASE_DEC, VALS(for_msg_type_strings), 0,
4775 { &hf_ansi_683_rev_msg_type,
4776 { "Reverse Link Message Type",
4777 "ansi_683.rev_msg_type",
4778 FT_UINT8, BASE_DEC, VALS(rev_msg_type_strings), 0,
4780 { &hf_ansi_683_length,
4781 { "Length", "ansi_683.len",
4782 FT_UINT8, BASE_DEC, NULL, 0,
4785 { &hf_ansi_683_none,
4786 { "Sub tree", "ansi_683.none",
4787 FT_NONE, BASE_NONE, 0, 0,
4792 /* Setup protocol subtree array */
4793 #define NUM_INDIVIDUAL_PARAMS 21
4794 static gint *ett[NUM_INDIVIDUAL_PARAMS];
4796 memset((void *) ett, 0, sizeof(ett));
4798 ett[0] = &ett_ansi_683;
4799 ett[1] = &ett_for_nam_block;
4800 ett[2] = &ett_rev_nam_block;
4801 ett[3] = &ett_key_p;
4802 ett[4] = &ett_key_g;
4803 ett[5] = &ett_rev_feat;
4804 ett[6] = &ett_for_val_block;
4805 ett[7] = &ett_for_sspr_block;
4806 ett[8] = &ett_band_cap;
4807 ett[9] = &ett_rev_sspr_block;
4809 ett[11] = &ett_for_puzl_block;
4810 ett[12] = &ett_rev_puzl_block;
4811 ett[13] = &ett_for_3gpd_block;
4812 ett[14] = &ett_rev_3gpd_block;
4813 ett[15] = &ett_for_mmd_block;
4814 ett[16] = &ett_rev_mmd_block;
4815 ett[17] = &ett_for_mms_block;
4816 ett[18] = &ett_rev_mms_block;
4817 ett[19] = &ett_rev_cap;
4818 ett[20] = &ett_segment;
4820 /* Register the protocol name and description */
4822 proto_register_protocol(ansi_proto_name, "ANSI IS-683 (OTA (Mobile))", "ansi_683");
4824 /* Required function calls to register the header fields and subtrees used */
4825 proto_register_field_array(proto_ansi_683, hf, array_length(hf));
4826 proto_register_subtree_array(ett, array_length(ett));
4831 proto_reg_handoff_ansi_683(void)
4833 dissector_handle_t ansi_683_handle;
4835 ansi_683_handle = create_dissector_handle(dissect_ansi_683, proto_ansi_683);
4837 dissector_add_uint("ansi_map.ota", ANSI_683_FORWARD, ansi_683_handle);
4838 dissector_add_uint("ansi_map.ota", ANSI_683_REVERSE, ansi_683_handle);
4839 dissector_add_uint("ansi_a.ota", ANSI_683_FORWARD, ansi_683_handle);
4840 dissector_add_uint("ansi_a.ota", ANSI_683_REVERSE, ansi_683_handle);