/epan/dissectors/packet-ansi_a.c
C | 12314 lines | 8618 code | 2590 blank | 1106 comment | 392 complexity | 0e55385666d58e100917bf601fb15a56 MD5 | raw file
Possible License(s): GPL-2.0, BSD-3-Clause
Large files files are truncated, but you can click here to view the full file
- /* packet-ansi_a.c
- * Routines for ANSI A Interface (IS-634/IOS) dissection
- *
- * Copyright 2003, Michael Lum <mlum [AT] telostech.com>
- * In association with Telos Technology Inc.
- * Copyright 2008, Michael Lum <michael.lum [AT] utstar.com>
- * In association with UTStarcom Inc.
- * Copyright 2008, Michael Lum <michael.lum [AT] starsolutions.com>
- * In association with Star Solutions
- *
- * Title 3GPP2 Other
- *
- * Inter-operability Specification (IOS) for CDMA
- * 2000 Access Network Interfaces
- * 3GPP2 A.S0001-1 TIA/EIA-2001
- *
- * $Id$
- *
- * Wireshark - Network traffic analyzer
- * By Gerald Combs <gerald@wireshark.org>
- * Copyright 1998 Gerald Combs
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
- #include "config.h"
- #include <string.h>
- #include <epan/packet.h>
- #include <epan/prefs.h>
- #include <epan/tap.h>
- #include <epan/strutil.h>
- #include <epan/wmem/wmem.h>
- #include <epan/expert.h>
- #include <epan/base64.h>
- #include "packet-rtp.h"
- #include "packet-bssap.h"
- #include "packet-ansi_a.h"
- /*
- * IOS 4, probably most common
- */
- static gint global_a_variant = A_VARIANT_IOS401;
- /* PROTOTYPES/FORWARDS */
- void proto_register_ansi_a(void);
- void proto_reg_handoff_ansi_a(void);
- static const gchar *
- my_try_val_to_str_idx(guint32 val, const ext_value_string_t *vs, gint *dec_idx)
- {
- gint i = 0;
- while (vs[i].strptr)
- {
- if (vs[i].value == val)
- {
- *dec_idx = vs[i].dec_index;
- return(vs[i].strptr);
- }
- i++;
- }
- *dec_idx = -1;
- return(NULL);
- }
- const ext_value_string_t ansi_a_ios401_bsmap_strings[] =
- {
- { 0x69, "Additional Service Notification", 0 },
- { 0x65, "ADDS Page", 1 },
- { 0x66, "ADDS Page Ack", 2 },
- { 0x67, "ADDS Transfer", 3 },
- { 0x68, "ADDS Transfer Ack", 4 },
- { 0x02, "Assignment Complete", 5 },
- { 0x03, "Assignment Failure", 6 },
- { 0x01, "Assignment Request", 7 },
- { 0x45, "Authentication Request", 8 },
- { 0x46, "Authentication Response", 9 },
- { 0x48, "Base Station Challenge", 10 },
- { 0x49, "Base Station Challenge Response", 11 },
- { 0x40, "Block", 12 },
- { 0x41, "Block Acknowledge", 13 },
- { 0x09, "BS Service Request", 14 },
- { 0x0A, "BS Service Response", 15 },
- { 0x20, "Clear Command", 16 },
- { 0x21, "Clear Complete", 17 },
- { 0x22, "Clear Request", 18 },
- { 0x57, "Complete Layer 3 Information", 19 },
- { 0x60, "Feature Notification", 20 },
- { 0x61, "Feature Notification Ack", 21 },
- { 0x13, "Handoff Command", 22 },
- { 0x15, "Handoff Commenced", 23 },
- { 0x14, "Handoff Complete", 24 },
- { 0x16, "Handoff Failure", 25 },
- { 0x17, "Handoff Performed", 26 },
- { 0x10, "Handoff Request", 27 },
- { 0x12, "Handoff Request Acknowledge", 28 },
- { 0x11, "Handoff Required", 29 },
- { 0x1A, "Handoff Required Reject", 30 },
- { 0x6C, "PACA Command", 31 },
- { 0x6D, "PACA Command Ack", 32 },
- { 0x6E, "PACA Update", 33 },
- { 0x6F, "PACA Update Ack", 34 },
- { 0x52, "Paging Request", 35 },
- { 0x53, "Privacy Mode Command", 36 },
- { 0x55, "Privacy Mode Complete", 37 },
- { 0x23, "Radio Measurements for Position Request", 38 },
- { 0x25, "Radio Measurements for Position Response", 39 },
- { 0x56, "Rejection", 40 },
- { 0x05, "Registration Request", 41 },
- { 0x30, "Reset", 42 },
- { 0x31, "Reset Acknowledge", 43 },
- { 0x34, "Reset Circuit", 44 },
- { 0x35, "Reset Circuit Acknowledge", 45 },
- { 0x47, "SSD Update Request", 46 },
- { 0x4A, "SSD Update Response", 47 },
- { 0x6A, "Status Request", 48 },
- { 0x6B, "Status Response", 49 },
- { 0x39, "Transcoder Control Acknowledge", 50 },
- { 0x38, "Transcoder Control Request", 51 },
- { 0x42, "Unblock", 52 },
- { 0x43, "Unblock Acknowledge", 53 },
- { 0x0B, "User Zone Reject", 54 },
- { 0x04, "User Zone Update", 55 },
- { 0, NULL, 0 }
- };
- const ext_value_string_t ansi_a_ios401_dtap_strings[] =
- {
- { 0x62, "Additional Service Request", 0 },
- { 0x53, "ADDS Deliver", 1 },
- { 0x54, "ADDS Deliver Ack", 2 },
- { 0x26, "Alert With Information", 3 },
- { 0x45, "Authentication Request", 4 },
- { 0x46, "Authentication Response", 5 },
- { 0x48, "Base Station Challenge", 6 },
- { 0x49, "Base Station Challenge Response", 7 },
- { 0x24, "CM Service Request", 8 },
- { 0x25, "CM Service Request Continuation", 9 },
- { 0x07, "Connect", 10 },
- { 0x10, "Flash with Information", 11 },
- { 0x50, "Flash with Information Ack", 12 },
- { 0x02, "Location Updating Accept", 13 },
- { 0x04, "Location Updating Reject", 14 },
- { 0x08, "Location Updating Request", 15 },
- { 0x27, "Paging Response", 16 },
- { 0x2B, "Parameter Update Confirm", 17 },
- { 0x2C, "Parameter Update Request", 18 },
- { 0x56, "Rejection", 19 },
- { 0x03, "Progress", 20 },
- { 0x70, "Service Redirection", 21 },
- { 0x2E, "Service Release", 22 },
- { 0x2F, "Service Release Complete", 23 },
- { 0x47, "SSD Update Request", 24 },
- { 0x4A, "SSD Update Response", 25 },
- { 0x6A, "Status Request", 26 },
- { 0x6B, "Status Response", 27 },
- { 0x0B, "User Zone Reject", 28 },
- { 0x0C, "User Zone Update", 29 },
- { 0x0D, "User Zone Update Request", 30 },
- { 0, NULL, 0 }
- };
- const ext_value_string_t ansi_a_ios401_elem_1_strings[] =
- {
- { 0x20, "Access Network Identifiers", 0 },
- { 0x3D, "ADDS User Part", 1 },
- { 0x25, "AMPS Hard Handoff Parameters", 2 },
- { 0x30, "Anchor PDSN Address", 3 },
- { 0x7C, "Anchor P-P Address", 4 },
- { 0x41, "Authentication Challenge Parameter", 5 },
- { 0x28, "Authentication Confirmation Parameter (RANDC)", 6 },
- { 0x59, "Authentication Data", 7 },
- { 0x4A, "Authentication Event", 8 },
- { 0x40, "Authentication Parameter COUNT", 9 },
- { 0x42, "Authentication Response Parameter", 10 },
- { 0x37, "Band Class", 11 },
- { 0x5B, "Called Party ASCII Number", 12 },
- { 0x5E, "Called Party BCD Number", 13 },
- { 0x4B, "Calling Party ASCII Number", 14 },
- { 0x04, "Cause", 15 },
- { 0x08, "Cause Layer 3", 16 },
- { 0x0C, "CDMA Serving One Way Delay", 17 },
- { 0x05, "Cell Identifier", 18 },
- { 0x1A, "Cell Identifier List", 19 },
- { 0x23, "Channel Number", 20 },
- { 0x0B, "Channel Type", 21 },
- { 0x19, "Circuit Group", 22 },
- { 0x01, "Circuit Identity Code", 23 },
- { 0x24, "Circuit Identity Code Extension", 24 },
- { 0x12, "Classmark Information Type 2", 25 },
- { 0x29, "Downlink Radio Environment", 26 },
- { 0x2B, "Downlink Radio Environment List", 27 },
- { 0x0A, "Encryption Information", 28 },
- { 0x10, "Extended Handoff Direction Parameters", 29 },
- { 0x2C, "Geographic Location", 30 },
- { 0x5A, "Special Service Call Indicator", 31 },
- { 0x26, "Handoff Power Level", 32 },
- { 0x16, "Hard Handoff Parameters", 33 },
- { 0x2E, "Information Element Requested", 34 },
- { 0x09, "IS-2000 Channel Identity", 35 },
- { 0x27, "IS-2000 Channel Identity 3X", 36 },
- { 0x11, "IS-2000 Mobile Capabilities", 37 },
- { 0x0F, "IS-2000 Non-Negotiable Service Configuration Record", 38 },
- { 0x0E, "IS-2000 Service Configuration Record", 39 },
- { 0x62, "IS-95/IS-2000 Cause Value", 40 },
- { 0x67, "IS-2000 Redirection Record", 41 },
- { 0x22, "IS-95 Channel Identity", 42 },
- { 0x64, "IS-95 MS Measured Channel Identity", 43 },
- { 0x17, "Layer 3 Information", 44 },
- { 0x13, "Location Area Information", 45 },
- { 0x38, "Message Waiting Indication", 46 },
- { 0x0D, "Mobile Identity", 47 },
- { 0x15, "MS Information Records (Forward)", 48 },
- { 0xA0, "Origination Continuation Indicator", 49 },
- { 0x5F, "PACA Order", 50 },
- { 0x60, "PACA Reorigination Indicator", 51 },
- { 0x4E, "PACA Timestamp", 52 },
- { 0x70, "Packet Session Parameters", 53 },
- { 0x14, "PDSN IP Address", 54 },
- { 0xA2, "Power Down Indicator", 55 },
- { 0x06, "Priority", 56 },
- { 0x3B, "Protocol Revision", 57 },
- { 0x18, "Protocol Type", 58 },
- { 0x2D, "PSMM Count", 59 },
- { 0x07, "Quality of Service Parameters", 60 },
- { 0x1D, "Radio Environment and Resources", 61 },
- { 0x1F, "Registration Type", 62 },
- { 0x44, "Reject Cause", 63 },
- { 0x1B, "Response Request", 64 },
- { 0x68, "Return Cause", 65 },
- { 0x21, "RF Channel Identity", 66 },
- { 0x03, "Service Option", 67 },
- { 0x1E, "Service Option Connection Identifier (SOCI)", 68 },
- { 0x2A, "Service Option List", 69 },
- { 0x69, "Service Redirection Info", 70 },
- { 0x71, "Service Reference Identifier (SR_ID)", 71 },
- { 0x32, "SID", 72 },
- { 0x34, "Signal", 73 },
- { 0x35, "Slot Cycle Index", 74 },
- { 0x31, "Software Version", 75 },
- { 0x39, "Source RNC to Target RNC Transparent Container", 76 },
- { 0x14, "Source PDSN Address", 77 },
- { 0x33, "Tag", 78 },
- { 0x3A, "Target RNC to Source RNC Transparent Container", 79 },
- { 0x36, "Transcoder Mode", 80 }, /* XXX 0x1C in IOS 4.0.1 */
- { 0x02, "User Zone ID", 81 },
- { 0xA1, "Voice Privacy Request", 82 },
- { 0x15, "MS Information Records (Reverse)", 88 },
- { 0, NULL, 0 }
- };
- const ext_value_string_t ansi_a_ios501_bsmap_strings[] =
- {
- { 0x69, "Additional Service Notification", 0 },
- { 0x65, "ADDS Page", 1 },
- { 0x66, "ADDS Page Ack", 2 },
- { 0x67, "ADDS Transfer", 3 },
- { 0x68, "ADDS Transfer Ack", 4 },
- { 0x02, "Assignment Complete", 5 },
- { 0x03, "Assignment Failure", 6 },
- { 0x01, "Assignment Request", 7 },
- { 0x45, "Authentication Request", 8 },
- { 0x46, "Authentication Response", 9 },
- { 0x48, "Base Station Challenge", 10 },
- { 0x49, "Base Station Challenge Response", 11 },
- { 0x40, "Block", 12 },
- { 0x41, "Block Acknowledge", 13 },
- { 0x09, "BS Service Request", 14 },
- { 0x0A, "BS Service Response", 15 },
- { 0x20, "Clear Command", 16 },
- { 0x21, "Clear Complete", 17 },
- { 0x22, "Clear Request", 18 },
- { 0x57, "Complete Layer 3 Information", 19 },
- { 0x60, "Feature Notification", 20 },
- { 0x61, "Feature Notification Ack", 21 },
- { 0x13, "Handoff Command", 22 },
- { 0x15, "Handoff Commenced", 23 },
- { 0x14, "Handoff Complete", 24 },
- { 0x16, "Handoff Failure", 25 },
- { 0x17, "Handoff Performed", 26 },
- { 0x10, "Handoff Request", 27 },
- { 0x12, "Handoff Request Acknowledge", 28 },
- { 0x11, "Handoff Required", 29 },
- { 0x1A, "Handoff Required Reject", 30 },
- { 0x6C, "PACA Command", 31 },
- { 0x6D, "PACA Command Ack", 32 },
- { 0x6E, "PACA Update", 33 },
- { 0x6F, "PACA Update Ack", 34 },
- { 0x52, "Paging Request", 35 },
- { 0x53, "Privacy Mode Command", 36 },
- { 0x55, "Privacy Mode Complete", 37 },
- { 0x23, "Radio Measurements for Position Request", 38 },
- { 0x25, "Radio Measurements for Position Response", 39 },
- { 0x56, "Rejection", 40 },
- { 0x05, "Registration Request", 41 },
- { 0x30, "Reset", 42 },
- { 0x31, "Reset Acknowledge", 43 },
- { 0x34, "Reset Circuit", 44 },
- { 0x35, "Reset Circuit Acknowledge", 45 },
- { 0x47, "SSD Update Request", 46 },
- { 0x4A, "SSD Update Response", 47 },
- { 0x6A, "Status Request", 48 },
- { 0x6B, "Status Response", 49 },
- { 0x39, "Transcoder Control Acknowledge", 50 },
- { 0x38, "Transcoder Control Request", 51 },
- { 0x42, "Unblock", 52 },
- { 0x43, "Unblock Acknowledge", 53 },
- { 0x0B, "User Zone Reject", 54 },
- { 0x04, "User Zone Update", 55 },
- { 0x58, "Bearer Update Request", 56 },
- { 0x59, "Bearer Update Response", 58 },
- { 0x5A, "Bearer Update Required", 57 },
- { 0x71, "Mobile Station Registered Notification", 59 },
- { 0x07, "BS Authentication Request", 60 },
- { 0x08, "BS Authentication Request Ack", 61 },
- { 0, NULL, 0 }
- };
- const ext_value_string_t ansi_a_ios501_dtap_strings[] =
- {
- { 0x62, "Additional Service Request", 0 },
- { 0x53, "ADDS Deliver", 1 },
- { 0x54, "ADDS Deliver Ack", 2 },
- { 0x26, "Alert With Information", 3 },
- { 0x45, "Authentication Request", 4 },
- { 0x46, "Authentication Response", 5 },
- { 0x48, "Base Station Challenge", 6 },
- { 0x49, "Base Station Challenge Response", 7 },
- { 0x24, "CM Service Request", 8 },
- { 0x25, "CM Service Request Continuation", 9 },
- { 0x07, "Connect", 10 },
- { 0x10, "Flash with Information", 11 },
- { 0x50, "Flash with Information Ack", 12 },
- { 0x02, "Location Updating Accept", 13 },
- { 0x04, "Location Updating Reject", 14 },
- { 0x08, "Location Updating Request", 15 },
- { 0x27, "Paging Response", 16 },
- { 0x2B, "Parameter Update Confirm", 17 },
- { 0x2C, "Parameter Update Request", 18 },
- { 0x56, "Rejection", 19 },
- { 0x03, "Progress", 20 },
- { 0x70, "Service Redirection", 21 },
- { 0x2E, "Service Release", 22 },
- { 0x2F, "Service Release Complete", 23 },
- { 0x47, "SSD Update Request", 24 },
- { 0x4A, "SSD Update Response", 25 },
- { 0x6A, "Status Request", 26 },
- { 0x6B, "Status Response", 27 },
- { 0x0B, "User Zone Reject", 28 },
- { 0x0C, "User Zone Update", 29 },
- { 0x0D, "User Zone Update Request", 30 },
- { 0, NULL, 0 }
- };
- /*
- * ORDER MUST MATCH
- * ansi_a_ios401_elem_1_strings when the same element
- * is being described.
- */
- const ext_value_string_t ansi_a_ios501_elem_1_strings[] =
- {
- { 0x20, "Access Network Identifiers", 0 },
- { 0x3D, "ADDS User Part", 1 },
- { 0x25, "AMPS Hard Handoff Parameters", 2 },
- { 0x30, "Anchor PDSN Address", 3 },
- { 0x7C, "Anchor P-P Address", 4 },
- { 0x41, "Authentication Challenge Parameter", 5 },
- { 0x28, "Authentication Confirmation Parameter (RANDC)", 6 },
- { 0x59, "Authentication Data", 7 },
- { 0x4A, "Authentication Event", 8 },
- { 0x40, "Authentication Parameter COUNT", 9 },
- { 0x42, "Authentication Response Parameter", 10 },
- { 0x37, "Band Class", 11 },
- { 0x5B, "Called Party ASCII Number", 12 },
- { 0x5E, "Called Party BCD Number", 13 },
- { 0x4B, "Calling Party ASCII Number", 14 },
- { 0x04, "Cause", 15 },
- { 0x08, "Cause Layer 3", 16 },
- { 0x0C, "CDMA Serving One Way Delay", 17 },
- { 0x05, "Cell Identifier", 18 },
- { 0x1A, "Cell Identifier List", 19 },
- { 0x23, "Channel Number", 20 },
- { 0x0B, "Channel Type", 21 },
- { 0x19, "Circuit Group", 22 },
- { 0x01, "Circuit Identity Code", 23 },
- { 0x24, "Circuit Identity Code Extension", 24 },
- { 0x12, "Classmark Information Type 2", 25 },
- { 0x29, "Downlink Radio Environment", 26 },
- { 0x2B, "Downlink Radio Environment List", 27 },
- { 0x0A, "Encryption Information", 28 },
- { 0x10, "Extended Handoff Direction Parameters", 29 },
- { 0x2C, "Geographic Location", 30 },
- { 0x5A, "Special Service Call Indicator", 31 },
- { 0x26, "Handoff Power Level", 32 },
- { 0x16, "Hard Handoff Parameters", 33 },
- { 0x2E, "Information Element Requested", 34 },
- { 0x09, "IS-2000 Channel Identity", 35 },
- { 0x27, "IS-2000 Channel Identity 3X", 36 },
- { 0x11, "IS-2000 Mobile Capabilities", 37 },
- { 0x0F, "IS-2000 Non-Negotiable Service Configuration Record", 38 },
- { 0x0E, "IS-2000 Service Configuration Record", 39 },
- { 0x62, "IS-95/IS-2000 Cause Value", 40 },
- { 0x67, "IS-2000 Redirection Record", 41 },
- { 0x22, "IS-95 Channel Identity", 42 },
- { 0x64, "IS-95 MS Measured Channel Identity", 43 },
- { 0x17, "Layer 3 Information", 44 },
- { 0x13, "Location Area Information", 45 },
- { 0x38, "Message Waiting Indication", 46 },
- { 0x0D, "Mobile Identity", 47 },
- { 0x15, "MS Information Records (Forward)", 48 },
- { 0xA0, "Origination Continuation Indicator", 49 },
- { 0x5F, "PACA Order", 50 },
- { 0x60, "PACA Reorigination Indicator", 51 },
- { 0x4E, "PACA Timestamp", 52 },
- { 0x70, "Packet Session Parameters", 53 },
- { 0x14, "PDSN IP Address", 54 },
- { 0xA2, "Power Down Indicator", 55 },
- { 0x06, "Priority", 56 },
- { 0x3B, "Protocol Revision", 57 },
- { 0x18, "Protocol Type", 58 },
- { 0x2D, "PSMM Count", 59 },
- { 0x07, "Quality of Service Parameters", 60 },
- { 0x1D, "Radio Environment and Resources", 61 },
- { 0x1F, "Registration Type", 62 },
- { 0x44, "Reject Cause", 63 },
- { 0x1B, "Response Request", 64 },
- { 0x68, "Return Cause", 65 },
- { 0x21, "RF Channel Identity", 66 },
- { 0x03, "Service Option", 67 },
- { 0x1E, "Service Option Connection Identifier (SOCI)", 68 },
- { 0x2A, "Service Option List", 69 },
- { 0x69, "Service Redirection Info", 70 },
- { 0x71, "Service Reference Identifier (SR_ID)", 71 },
- { 0x32, "SID", 72 },
- { 0x34, "Signal", 73 },
- { 0x35, "Slot Cycle Index", 74 },
- { 0x31, "Software Version", 75 },
- { 0x39, "Source RNC to Target RNC Transparent Container", 76 },
- { 0x14, "Source PDSN Address", 77 },
- { 0x33, "Tag", 78 },
- { 0x3A, "Target RNC to Source RNC Transparent Container", 79 },
- { 0x36, "Transcoder Mode", 80 }, /* XXX 0x1C in IOS 4.0.1 */
- { 0x02, "User Zone ID", 81 },
- { 0xA1, "Voice Privacy Request", 82 },
- { 0x45, "A2p Bearer Session-Level Parameters", 83 },
- { 0x46, "A2p Bearer Format-Specific Parameters", 84 },
- { 0x73, "MS Designated Frequency", 85 },
- { 0x7D, "Mobile Subscription Information", 86 },
- { 0x72, "Public Long Code Mask Identification", 87 },
- { 0x15, "MS Information Records (Reverse)", 88 },
- { 0, NULL, 0 }
- };
- /*
- * From Table 3.7.5-1 C.S0005-D v1.0 L3
- */
- #define ANSI_FWD_MS_INFO_REC_DISPLAY 0x01
- #define ANSI_FWD_MS_INFO_REC_CLD_PN 0x02
- #define ANSI_FWD_MS_INFO_REC_CLG_PN 0x03
- #define ANSI_FWD_MS_INFO_REC_CONN_N 0x04
- #define ANSI_FWD_MS_INFO_REC_SIGNAL 0x05
- #define ANSI_FWD_MS_INFO_REC_MW 0x06
- #define ANSI_FWD_MS_INFO_REC_SC 0x07
- #define ANSI_FWD_MS_INFO_REC_CLD_PSA 0x08
- #define ANSI_FWD_MS_INFO_REC_CLG_PSA 0x09
- #define ANSI_FWD_MS_INFO_REC_CONN_SA 0x0a
- #define ANSI_FWD_MS_INFO_REC_RED_N 0x0b
- #define ANSI_FWD_MS_INFO_REC_RED_SA 0x0c
- #define ANSI_FWD_MS_INFO_REC_MP 0x0d
- #define ANSI_FWD_MS_INFO_REC_PA 0x0e
- #define ANSI_FWD_MS_INFO_REC_LC 0x0f
- #define ANSI_FWD_MS_INFO_REC_EDISPLAY 0x10
- #define ANSI_FWD_MS_INFO_REC_NNSC 0x13
- #define ANSI_FWD_MS_INFO_REC_MC_EDISPLAY 0x14
- #define ANSI_FWD_MS_INFO_REC_CWI 0x15
- #define ANSI_FWD_MS_INFO_REC_EMC_EDISPLAY 0x16
- #define ANSI_FWD_MS_INFO_REC_ERTI 0xfe
- static const value_string ansi_fwd_ms_info_rec_str[] = {
- { ANSI_FWD_MS_INFO_REC_DISPLAY, "Display" },
- { ANSI_FWD_MS_INFO_REC_CLD_PN, "Called Party Number" },
- { ANSI_FWD_MS_INFO_REC_CLG_PN, "Calling Party Number" },
- { ANSI_FWD_MS_INFO_REC_CONN_N, "Connected Number" },
- { ANSI_FWD_MS_INFO_REC_SIGNAL, "Signal" },
- { ANSI_FWD_MS_INFO_REC_MW, "Message Waiting" },
- { ANSI_FWD_MS_INFO_REC_SC, "Service Configuration" },
- { ANSI_FWD_MS_INFO_REC_CLD_PSA, "Called Party Subaddress" },
- { ANSI_FWD_MS_INFO_REC_CLG_PSA, "Calling Party Subaddress" },
- { ANSI_FWD_MS_INFO_REC_CONN_SA, "Connected Subaddress" },
- { ANSI_FWD_MS_INFO_REC_RED_N, "Redirecting Number" },
- { ANSI_FWD_MS_INFO_REC_RED_SA, "Redirecting Subaddress" },
- { ANSI_FWD_MS_INFO_REC_MP, "Meter Pulses" },
- { ANSI_FWD_MS_INFO_REC_PA, "Parametric Alerting" },
- { ANSI_FWD_MS_INFO_REC_LC, "Line Control" },
- { ANSI_FWD_MS_INFO_REC_EDISPLAY, "Extended Display" },
- { ANSI_FWD_MS_INFO_REC_NNSC, "Non-Negotiable Service Configuration" },
- { ANSI_FWD_MS_INFO_REC_MC_EDISPLAY, "Multiple Character Extended Display" },
- { ANSI_FWD_MS_INFO_REC_CWI, "Call Waiting Indicator" },
- { ANSI_FWD_MS_INFO_REC_EMC_EDISPLAY, "Enhanced Multiple Character Extended Display" },
- { ANSI_FWD_MS_INFO_REC_ERTI, "Extended Record Type International" },
- { 0, NULL }
- };
- #define NUM_FWD_MS_INFO_REC (sizeof(ansi_fwd_ms_info_rec_str)/sizeof(value_string))
- static gint ett_ansi_fwd_ms_info_rec[NUM_FWD_MS_INFO_REC];
- /*
- * From Table 2.7.4-1 C.S0005-D v1.0 L3
- */
- #define ANSI_REV_MS_INFO_REC_KEYPAD_FAC 0x03
- #define ANSI_REV_MS_INFO_REC_CLD_PN 0x04
- #define ANSI_REV_MS_INFO_REC_CLG_PN 0x05
- #define ANSI_REV_MS_INFO_REC_CALL_MODE 0x07
- #define ANSI_REV_MS_INFO_REC_TERM_INFO 0x08
- #define ANSI_REV_MS_INFO_REC_ROAM_INFO 0x09
- #define ANSI_REV_MS_INFO_REC_SECUR_STS 0x0a
- #define ANSI_REV_MS_INFO_REC_CONN_N 0x0b
- #define ANSI_REV_MS_INFO_REC_IMSI 0x0c
- #define ANSI_REV_MS_INFO_REC_ESN 0x0d
- #define ANSI_REV_MS_INFO_REC_BAND_INFO 0x0e
- #define ANSI_REV_MS_INFO_REC_POWER_INFO 0x0f
- #define ANSI_REV_MS_INFO_REC_OP_MODE_INFO 0x10
- #define ANSI_REV_MS_INFO_REC_SO_INFO 0x11
- #define ANSI_REV_MS_INFO_REC_MO_INFO 0x12
- #define ANSI_REV_MS_INFO_REC_SC_INFO 0x13
- #define ANSI_REV_MS_INFO_REC_CLD_PSA 0x14
- #define ANSI_REV_MS_INFO_REC_CLG_PSA 0x15
- #define ANSI_REV_MS_INFO_REC_CONN_SA 0x16
- #define ANSI_REV_MS_INFO_REC_PCI 0x17
- #define ANSI_REV_MS_INFO_REC_IMSI_M 0x18
- #define ANSI_REV_MS_INFO_REC_IMSI_T 0x19
- #define ANSI_REV_MS_INFO_REC_CAP_INFO 0x1a
- #define ANSI_REV_MS_INFO_REC_CCC_INFO 0x1b
- #define ANSI_REV_MS_INFO_REC_EMO_INFO 0x1c
- #define ANSI_REV_MS_INFO_REC_GEO_CAP 0x1e
- #define ANSI_REV_MS_INFO_REC_BAND_SUB 0x1f
- #define ANSI_REV_MS_INFO_REC_GECO 0x20
- #define ANSI_REV_MS_INFO_REC_HOOK 0x21
- #define ANSI_REV_MS_INFO_REC_QOS_PARAM 0x22
- #define ANSI_REV_MS_INFO_REC_ENCRYPT_CAP 0x23
- #define ANSI_REV_MS_INFO_REC_SMI_CAP 0x24
- #define ANSI_REV_MS_INFO_REC_UIM_ID 0x25
- #define ANSI_REV_MS_INFO_REC_ESN_ME 0x26
- #define ANSI_REV_MS_INFO_REC_MEID 0x27
- #define ANSI_REV_MS_INFO_REC_EKEYPAD_FAC 0x28
- #define ANSI_REV_MS_INFO_REC_SYNC_ID 0x29
- #define ANSI_REV_MS_INFO_REC_ERTI 0xfe
- static const value_string ansi_rev_ms_info_rec_str[] = {
- { ANSI_REV_MS_INFO_REC_KEYPAD_FAC, "Keypad Facility" },
- { ANSI_REV_MS_INFO_REC_CLD_PN, "Called Party Number" },
- { ANSI_REV_MS_INFO_REC_CLG_PN, "Calling Party Number" },
- { ANSI_REV_MS_INFO_REC_CALL_MODE, "Call Mode" },
- { ANSI_REV_MS_INFO_REC_TERM_INFO, "Terminal Information" },
- { ANSI_REV_MS_INFO_REC_ROAM_INFO, "Roaming Information" },
- { ANSI_REV_MS_INFO_REC_SECUR_STS, "Security Status" },
- { ANSI_REV_MS_INFO_REC_CONN_N, "Connected Number" },
- { ANSI_REV_MS_INFO_REC_IMSI, "IMSI" },
- { ANSI_REV_MS_INFO_REC_ESN, "ESN" },
- { ANSI_REV_MS_INFO_REC_BAND_INFO, "Band Class Information" },
- { ANSI_REV_MS_INFO_REC_POWER_INFO, "Power Class Information" },
- { ANSI_REV_MS_INFO_REC_OP_MODE_INFO, "Operating Mode Information" },
- { ANSI_REV_MS_INFO_REC_SO_INFO, "Service Option Information" },
- { ANSI_REV_MS_INFO_REC_MO_INFO, "Multiplex Option Information" },
- { ANSI_REV_MS_INFO_REC_SC_INFO, "Service Configuration Information" },
- { ANSI_REV_MS_INFO_REC_CLD_PSA, "Called Party Subaddress" },
- { ANSI_REV_MS_INFO_REC_CLG_PSA, "Calling Party Subaddress" },
- { ANSI_REV_MS_INFO_REC_CONN_SA, "Connected Subaddress" },
- { ANSI_REV_MS_INFO_REC_PCI, "Power Control Information" },
- { ANSI_REV_MS_INFO_REC_IMSI_M, "IMSI_M" },
- { ANSI_REV_MS_INFO_REC_IMSI_T, "IMSI_T" },
- { ANSI_REV_MS_INFO_REC_CAP_INFO, "Capability Information" },
- { ANSI_REV_MS_INFO_REC_CCC_INFO, "Channel Configuration Capability Information" },
- { ANSI_REV_MS_INFO_REC_EMO_INFO, "Extended Multiplex Option Information" },
- { ANSI_REV_MS_INFO_REC_GEO_CAP, "Geo-Location Capability" },
- { ANSI_REV_MS_INFO_REC_BAND_SUB, "Band Subclass Information" },
- { ANSI_REV_MS_INFO_REC_GECO, "Global Emergency Call" },
- { ANSI_REV_MS_INFO_REC_HOOK, "Hook Status" },
- { ANSI_REV_MS_INFO_REC_QOS_PARAM, "QoS Parameters" },
- { ANSI_REV_MS_INFO_REC_ENCRYPT_CAP, "Encryption Capability" },
- { ANSI_REV_MS_INFO_REC_SMI_CAP, "Signaling Message Integrity Capability" },
- { ANSI_REV_MS_INFO_REC_UIM_ID, "UIM_ID" },
- { ANSI_REV_MS_INFO_REC_ESN_ME, "ESN_ME" },
- { ANSI_REV_MS_INFO_REC_MEID, "MEID" },
- { ANSI_REV_MS_INFO_REC_EKEYPAD_FAC, "Extended Keypad Facility" },
- { ANSI_REV_MS_INFO_REC_SYNC_ID, "SYNC_ID" },
- { ANSI_REV_MS_INFO_REC_ERTI, "Extended Record Type International" },
- { 0, NULL }
- };
- #define NUM_REV_MS_INFO_REC (sizeof(ansi_rev_ms_info_rec_str)/sizeof(value_string))
- static gint ett_ansi_rev_ms_info_rec[NUM_REV_MS_INFO_REC];
- /*
- * C.S0057 Table 1.5-1
- */
- static const gchar *band_class_str[] = {
- "800 MHz Cellular System",
- "1.850 to 1.990 GHz Broadband PCS",
- "872 to 960 MHz TACS Band",
- "832 to 925 MHz JTACS Band",
- "1.750 to 1.870 GHz Korean PCS",
- "450 MHz NMT",
- "2 GHz IMT-2000",
- "Upper 700 MHz",
- "1.710 to 1.880 GHz PCS",
- "880 to 960 MHz",
- "Secondary 800 MHz",
- "400 MHz European PAMR",
- "800 MHz European PAMR",
- "2.5 GHz IMT-2000 Extension",
- "US PCS 1.9 GHz",
- "AWS",
- "US 2.5 GHz",
- "US 2.5 GHz Forward Link Only",
- "700 MHz Public Safety",
- "Lower 700 MHz"
- };
- #define NUM_BAND_CLASS_STR (sizeof(band_class_str)/sizeof(gchar *))
- static const gchar *cell_disc_str[] = {
- "whole Cell Global Identification (CGI)",
- "LAC/CI",
- "Cell Identity (CI)",
- "None",
- "Location Area Identification (LAI)",
- "Location Area Code (LAC)",
- "ALL",
- "IS-41 whole Cell Global Identification (ICGI)",
- "Enhanced whole Cell Global Identification (ECGI)"
- };
- #define NUM_CELL_DISC_STR (sizeof(cell_disc_str)/sizeof(gchar *))
- /* Initialize the protocol and registered fields */
- static int proto_a_bsmap = -1;
- static int proto_a_dtap = -1;
- const ext_value_string_t *ansi_a_bsmap_strings = NULL;
- const ext_value_string_t *ansi_a_dtap_strings = NULL;
- const ext_value_string_t *ansi_a_elem_1_strings = NULL;
- static int ansi_a_tap = -1;
- /* static int hf_ansi_a_none = -1; */
- static int hf_ansi_a_bsmap_msgtype = -1;
- static int hf_ansi_a_dtap_msgtype = -1;
- static int hf_ansi_a_length = -1;
- static int hf_ansi_a_elem_id = -1;
- static int hf_ansi_a_esn = -1;
- static int hf_ansi_a_imsi = -1;
- static int hf_ansi_a_min = -1;
- static int hf_ansi_a_meid = -1;
- static int hf_ansi_a_cld_party_bcd_num = -1;
- #ifdef MAYBE_USED_FOR_OLDER_CODECS
- static int hf_ansi_a_clg_party_bcd_num = -1;
- #endif
- static int hf_ansi_a_cld_party_ascii_num = -1;
- static int hf_ansi_a_clg_party_ascii_num = -1;
- static int hf_ansi_a_cell_ci = -1;
- static int hf_ansi_a_cell_lac = -1;
- static int hf_ansi_a_cell_mscid = -1;
- static int hf_ansi_a_pdsn_ip_addr = -1;
- static int hf_ansi_a_s_pdsn_ip_addr = -1;
- static int hf_ansi_a_anchor_ip_addr = -1;
- static int hf_ansi_a_anchor_pp_ip_addr = -1;
- static int hf_ansi_a_a2p_bearer_ipv4_addr = -1;
- static int hf_ansi_a_a2p_bearer_ipv6_addr = -1;
- static int hf_ansi_a_a2p_bearer_udp_port = -1;
- static int hf_ansi_a_so = -1;
- static int hf_ansi_a_cause_1 = -1; /* 1 octet cause */
- static int hf_ansi_a_cause_2 = -1; /* 2 octet cause */
- static int hf_ansi_a_meid_configured = -1;
- /* Initialize the subtree pointers */
- static gint ett_bsmap = -1;
- static gint ett_dtap = -1;
- static gint ett_elems = -1;
- static gint ett_elem = -1;
- static gint ett_dtap_oct_1 = -1;
- static gint ett_cm_srvc_type = -1;
- static gint ett_ansi_ms_info_rec_reserved = -1;
- static gint ett_ansi_enc_info = -1;
- static gint ett_scm = -1;
- static gint ett_cell_list = -1;
- static gint ett_bearer_list = -1;
- static gint ett_re_list = -1;
- static gint ett_so_list = -1;
- static gint ett_adds_user_part = -1;
- static gint ett_scr = -1;
- static gint ett_srvc_con_rec = -1;
- static gint ett_cm2_band_class = -1;
- static gint ett_vp_algs = -1;
- static expert_field ei_ansi_a_extraneous_data = EI_INIT;
- static char a_bigbuf[1024];
- static dissector_handle_t rtp_handle=NULL;
- static dissector_handle_t data_handle;
- static dissector_handle_t dtap_handle;
- static dissector_table_t is637_dissector_table; /* IS-637-A Transport Layer (SMS) */
- static dissector_table_t is683_dissector_table; /* IS-683-A (OTA) */
- static dissector_table_t is801_dissector_table; /* IS-801 (PLD) */
- static proto_tree *g_tree;
- static address rtp_src_addr;
- static guint32 rtp_ipv4_addr;
- static struct e_in6_addr rtp_ipv6_addr;
- static guint16 rtp_port;
- static gboolean a_meid_configured = FALSE;
- typedef struct ansi_a_dgt_set_t
- {
- /*
- * would typically be 15 but to allow MEID decoding this
- * needs to have room for full hexadecimal representation
- */
- unsigned char out[16];
- }
- ansi_a_dgt_set_t;
- /*
- * As per A.S0001 Called Party BCD Number
- */
- static ansi_a_dgt_set_t Dgt_tbcd = {
- {
- /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
- '0','1','2','3','4','5','6','7','8','9','*','#','a','b','c', 0
- }
- };
- static ansi_a_dgt_set_t Dgt_msid = {
- {
- /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
- '0','1','2','3','4','5','6','7','8','9','?','?','?','?','?', 0
- }
- };
- static ansi_a_dgt_set_t Dgt_meid = {
- {
- /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
- '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'
- }
- };
- /* FUNCTIONS */
- /*
- * Unpack BCD input pattern into output ASCII pattern
- *
- * Input Pattern is supplied using the same format as the digits
- *
- * Returns: length of unpacked pattern
- */
- static int
- my_dgt_tbcd_unpack(
- char *out, /* ASCII pattern out */
- guchar *in, /* packed pattern in */
- int num_octs, /* Number of octets to unpack */
- ansi_a_dgt_set_t *dgt /* Digit definitions */
- )
- {
- int cnt = 0;
- unsigned char i;
- while (num_octs)
- {
- /*
- * unpack first value in byte
- */
- i = *in++;
- *out++ = dgt->out[i & 0x0f];
- cnt++;
- /*
- * unpack second value in byte
- */
- i >>= 4;
- if ((num_octs == 1) && (i == 0x0f)) /* odd number bytes - hit filler */
- break;
- *out++ = dgt->out[i];
- cnt++;
- num_octs--;
- }
- *out = '\0';
- return(cnt);
- }
- static const gchar *
- ansi_a_so_int_to_str(
- gint32 so)
- {
- const gchar *str = NULL;
- switch (so)
- {
- case 1: str = "Basic Variable Rate Voice Service (8 kbps)"; break;
- case 2: str = "Mobile Station Loopback (8 kbps)"; break;
- case 3: str = "(EVRC) Enhanced Variable Rate Voice Service (8 kbps)"; break;
- case 4: str = "Asynchronous Data Service (9.6 kbps)"; break;
- case 5: str = "Group 3 Facsimile (9.6 kbps)"; break;
- case 6: str = "Short Message Services (Rate Set 1)"; break;
- case 7: str = "Packet Data Service: Internet or ISO Protocol Stack (9.6 kbps)"; break;
- case 8: str = "Packet Data Service: CDPD Protocol Stack (9.6 kbps)"; break;
- case 9: str = "Mobile Station Loopback (13 kbps)"; break;
- case 10: str = "STU-III Transparent Service"; break;
- case 11: str = "STU-III Non-Transparent Service"; break;
- case 12: str = "Asynchronous Data Service (14.4 or 9.6 kbps)"; break;
- case 13: str = "Group 3 Facsimile (14.4 or 9.6 kbps)"; break;
- case 14: str = "Short Message Services (Rate Set 2)"; break;
- case 15: str = "Packet Data Service: Internet or ISO Protocol Stack (14.4 kbps)"; break;
- case 16: str = "Packet Data Service: CDPD Protocol Stack (14.4 kbps)"; break;
- case 17: str = "High Rate Voice Service (13 kbps)"; break;
- case 32768: str = "QCELP (13 kbps)"; break;
- case 32798: /* 0x801e */ str = "Qualcomm Loopback"; break;
- case 32799: /* 0x801f */ str = "Qualcomm Markov 8 kbps Loopback"; break;
- case 32800: /* 0x8020 */ str = "Qualcomm Packet Data"; break;
- case 32801: /* 0x8021 */ str = "Qualcomm Async Data"; break;
- case 18: str = "Over-the-Air Parameter Administration (Rate Set 1)"; break;
- case 19: str = "Over-the-Air Parameter Administration (Rate Set 2)"; break;
- case 20: str = "Group 3 Analog Facsimile (Rate Set 1)"; break;
- case 21: str = "Group 3 Analog Facsimile (Rate Set 2)"; break;
- case 22: str = "High Speed Packet Data Service: Internet or ISO Protocol Stack (RS1 forward, RS1 reverse)"; break;
- case 23: str = "High Speed Packet Data Service: Internet or ISO Protocol Stack (RS1 forward, RS2 reverse)"; break;
- case 24: str = "High Speed Packet Data Service: Internet or ISO Protocol Stack (RS2 forward, RS1 reverse)"; break;
- case 25: str = "High Speed Packet Data Service: Internet or ISO Protocol Stack (RS2 forward, RS2 reverse)"; break;
- case 26: str = "High Speed Packet Data Service: CDPD Protocol Stack (RS1 forward, RS1 reverse)"; break;
- case 27: str = "High Speed Packet Data Service: CDPD Protocol Stack (RS1 forward, RS2 reverse)"; break;
- case 28: str = "High Speed Packet Data Service: CDPD Protocol Stack (RS2 forward, RS1 reverse)"; break;
- case 29: str = "High Speed Packet Data Service: CDPD Protocol Stack (RS2 forward, RS2 reverse)"; break;
- case 30: str = "Supplemental Channel Loopback Test for Rate Set 1"; break;
- case 31: str = "Supplemental Channel Loopback Test for Rate Set 2"; break;
- case 32: str = "Test Data Service Option (TDSO)"; break;
- case 33: str = "cdma2000 High Speed Packet Data Service, Internet or ISO Protocol Stack"; break;
- case 34: str = "cdma2000 High Speed Packet Data Service, CDPD Protocol Stack"; break;
- case 35: str = "Location Services (PDS), Rate Set 1 (9.6 kbps)"; break;
- case 36: str = "Location Services (PDS), Rate Set 2 (14.4 kbps)"; break;
- case 37: str = "ISDN Interworking Service (64 kbps)"; break;
- case 38: str = "GSM Voice"; break;
- case 39: str = "GSM Circuit Data"; break;
- case 40: str = "GSM Packet Data"; break;
- case 41: str = "GSM Short Message Service"; break;
- case 42: str = "None Reserved for MC-MAP standard service options"; break;
- case 54: str = "Markov Service Option (MSO)"; break;
- case 55: str = "Loopback Service Option (LSO)"; break;
- case 56: str = "Selectable Mode Vocoder"; break;
- case 57: str = "32 kbps Circuit Video Conferencing"; break;
- case 58: str = "64 kbps Circuit Video Conferencing"; break;
- case 59: str = "HRPD Accounting Records Identifier"; break;
- case 60: str = "Link Layer Assisted Robust Header Compression (LLA ROHC) - Header Removal"; break;
- case 61: str = "Link Layer Assisted Robust Header Compression (LLA ROHC) - Header Compression"; break;
- case 62: str = "- 4099 None Reserved for standard service options"; break;
- case 68: str = "(EVRC-B NB) Enhanced Variable Rate Voice Service"; break;
- case 70: str = "(EVRC-B WB) Enhanced Variable Rate Voice Service"; break;
- case 73: str = "(EVRC-NW) Enhanced Variable Rate Voice Service"; break;
- case 4100: str = "Asynchronous Data Service, Revision 1 (9.6 or 14.4 kbps)"; break;
- case 4101: str = "Group 3 Facsimile, Revision 1 (9.6 or 14.4 kbps)"; break;
- case 4102: str = "Reserved for standard service option"; break;
- case 4103: str = "Packet Data Service: Internet or ISO Protocol Stack, Revision 1 (9.6 or 14.4 kbps)"; break;
- case 4104: str = "Packet Data Service: CDPD Protocol Stack, Revision 1 (9.6 or 14.4 kbps)"; break;
- default:
- if ((so >= 4105) && (so <= 32767)) { str = "Reserved for standard service options"; }
- else if ((so >= 32769) && (so <= 32771)) { str = "Proprietary QUALCOMM Incorporated"; }
- else if ((so >= 32772) && (so <= 32775)) { str = "Proprietary OKI Telecom"; }
- else if ((so >= 32776) && (so <= 32779)) { str = "Proprietary Lucent Technologies"; }
- else if ((so >= 32780) && (so <=32783)) { str = "Nokia"; }
- else if ((so >= 32784) && (so <=32787)) { str = "NORTEL NETWORKS"; }
- else if ((so >= 32788) && (so <=32791)) { str = "Sony Electronics Inc."; }
- else if ((so >= 32792) && (so <=32795)) { str = "Motorola"; }
- else if ((so >= 32796) && (so <=32799)) { str = "QUALCOMM Incorporated"; }
- else if ((so >= 32800) && (so <=32803)) { str = "QUALCOMM Incorporated"; }
- else if ((so >= 32804) && (so <=32807)) { str = "QUALCOMM Incorporated"; }
- else if ((so >= 32808) && (so <=32811)) { str = "QUALCOMM Incorporated"; }
- else if ((so >= 32812) && (so <=32815)) { str = "Lucent Technologies"; }
- else if ((so >= 32816) && (so <=32819)) { str = "Denso International"; }
- else if ((so >= 32820) && (so <=32823)) { str = "Motorola"; }
- else if ((so >= 32824) && (so <=32827)) { str = "Denso International"; }
- else if ((so >= 32828) && (so <=32831)) { str = "Denso International"; }
- else if ((so >= 32832) && (so <=32835)) { str = "Denso International"; }
- else if ((so >= 32836) && (so <=32839)) { str = "NEC America"; }
- else if ((so >= 32840) && (so <=32843)) { str = "Samsung Electronics"; }
- else if ((so >= 32844) && (so <=32847)) { str = "Texas Instruments Incorporated"; }
- else if ((so >= 32848) && (so <=32851)) { str = "Toshiba Corporation"; }
- else if ((so >= 32852) && (so <=32855)) { str = "LG Electronics Inc."; }
- else if ((so >= 32856) && (so <=32859)) { str = "VIA Telecom Inc."; }
- else { str = "Reserved"; }
- break;
- }
- return(str);
- }
- /* ELEMENT FUNCTIONS */
- #define EXTRANEOUS_DATA_CHECK(edc_len, edc_max_len) \
- if ((edc_len) > (edc_max_len)) \
- { \
- proto_tree_add_text(tree, tvb, \
- curr_offset, (edc_len) - (edc_max_len), "Extraneous Data"); \
- curr_offset += ((edc_len) - (edc_max_len)); \
- }
- #define EXTRANEOUS_DATA_CHECK_EXPERT(edc_len, edc_max_len) \
- if ((edc_len) > (edc_max_len)) \
- { \
- proto_tree_add_expert(tree, pinfo, &ei_ansi_a_extraneous_data, \
- tvb, curr_offset, (edc_len) - (edc_max_len)); \
- curr_offset += ((edc_len) - (edc_max_len)); \
- }
- #define SHORT_DATA_CHECK(sdc_len, sdc_min_len) \
- if ((sdc_len) < (sdc_min_len)) \
- { \
- proto_tree_add_text(tree, tvb, \
- curr_offset, (sdc_len), "Short Data (?)"); \
- curr_offset += (sdc_len); \
- return(curr_offset - offset); \
- }
- #define EXACT_DATA_CHECK(edc_len, edc_eq_len) \
- if ((edc_len) != (edc_eq_len)) \
- { \
- proto_tree_add_text(tree, tvb, \
- asn1->offset, (edc_len), "Unexpected Data Length"); \
- asn1->offset += (edc_len); \
- return; \
- }
- #define NO_MORE_DATA_CHECK(nmdc_len) \
- if ((nmdc_len) == (curr_offset - offset)) return(nmdc_len);
- /*
- * IOS 6.2.2.6
- */
- static guint8
- elem_chan_num(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len)
- {
- guint32 value;
- guint32 curr_offset;
- curr_offset = offset;
- value = tvb_get_ntohs(tvb, curr_offset);
- switch (global_a_variant)
- {
- case A_VARIANT_IOS401:
- proto_tree_add_text(tree,
- tvb, curr_offset, 2,
- "Channel Number: %u",
- value);
- g_snprintf(add_string, string_len, " - (%u)", value);
- break;
- case A_VARIANT_IOS501:
- other_decode_bitfield_value(a_bigbuf, value >> 8, 0xf8, 8);
- proto_tree_add_text(tree,
- tvb, curr_offset, 1,
- "%s : Reserved",
- a_bigbuf);
- other_decode_bitfield_value(a_bigbuf, value >> 8, 0x07, 8);
- proto_tree_add_text(tree, tvb, curr_offset, 1,
- "%s : ARFCN (MSB): %u",
- a_bigbuf,
- value & 0x07ff);
- other_decode_bitfield_value(a_bigbuf, value & 0x00ff, 0xff, 8);
- proto_tree_add_text(tree, tvb, curr_offset + 1, 1,
- "%s : ARFCN (LSB)",
- a_bigbuf);
- g_snprintf(add_string, string_len, " - (ARFCN: %u)", value & 0x07ff);
- break;
- }
- curr_offset += 2;
- /* no length check possible */
- return(curr_offset - offset);
- }
- /*
- * IOS 6.2.2.7
- */
- static guint8
- elem_chan_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
- {
- guint8 oct;
- guint32 curr_offset;
- const gchar *str = NULL;
- gboolean data;
- curr_offset = offset;
- data = FALSE;
- oct = tvb_get_guint8(tvb, curr_offset);
- switch (oct)
- {
- case 0: str = "No Alert"; break;
- case 1: str = "Speech"; break;
- case 2: str = "Data"; data = TRUE; break;
- case 3: str = "Signaling"; break;
- default:
- str = "Unknown";
- break;
- }
- proto_tree_add_text(tree,
- tvb, curr_offset, 1,
- "Speech or Data Indicator: %s",
- str);
- g_snprintf(add_string, string_len, " - (%s)", str);
- curr_offset++;
- NO_MORE_DATA_CHECK(len);
- oct = tvb_get_guint8(tvb, curr_offset);
- switch (oct)
- {
- case 0: str = "Reserved (invalid)"; break;
- case 1: str = "DCCH"; break;
- case 2: str = "Reserved for future use (invalid)"; break;
- case 8: str = "Full rate TCH channel Bm"; break;
- case 9: str = "Half rate TCH channel Lm"; break;
- default:
- str = "Unknown";
- break;
- }
- proto_tree_add_text(tree,
- tvb, curr_offset, 1,
- "Channel Rate and Type: %s",
- str);
- curr_offset++;
- NO_MORE_DATA_CHECK(len);
- oct = tvb_get_guint8(tvb, curr_offset);
- if (data)
- {
- other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
- proto_tree_add_text(tree,
- tvb, curr_offset, 1,
- "%s : Extension",
- a_bigbuf);
- other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
- proto_tree_add_text(tree,
- tvb, curr_offset, 1,
- "%s : %sTransparent service",
- a_bigbuf,
- (oct & 0x40) ? "Non-" : "");
- other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
- proto_tree_add_text(tree,
- tvb, curr_offset, 1,
- "%s : Reserved",
- a_bigbuf);
- }
- else
- {
- switch (oct)
- {
- case 0: str = "No Resources Required (invalid)"; break;
- case 1: str = "Reserved"; break;
- case 2: str = "Reserved"; break;
- case 3: str = "TIA/EIA-IS-2000 8 kb/s vocoder"; break;
- case 4: str = "8 kb/s enhanced vocoder (EVRC)"; break;
- case 5: str = "13 kb/s vocoder"; break;
- case 6: str = "ADPCM"; break;
- default:
- str = "Reserved";
- break;
- }
- proto_tree_add_text(tree,
- tvb, curr_offset, 1,
- "Speech Encoding Algorithm/data rate + Transparency Indicator: %s",
- str);
- }
- curr_offset++;
- EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
- return(curr_offset - offset);
- }
- /*
- * IOS 5 4.2.83
- */
- static guint8
- elem_return_cause(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
- {
- guint8 oct;
- const gchar *str;
- guint32 curr_offset;
- curr_offset = offset;
- oct = tvb_get_guint8(tvb, curr_offset);
- other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
- proto_tree_add_text(tree, tvb, curr_offset, 1,
- "%s : Reserved",
- a_bigbuf);
- switch (oct & 0x0f)
- {
- case 0: str = "Normal access"; break;
- case 1: str = "Service redirection failed as a result of system not found"; break;
- case 2: str = "Service redirection failed as a result of protocol mismatch"; break;
- case 3: str = "Service redirection failed as a result of registration rejection"; break;
- case 4: str = "Service redirection failed as a result of wrong SID"; break;
- case 5: str = "Service redirection failed as a result of wrong NID"; break;
- default:
- str = "Reserved";
- break;
- }
- other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
- proto_tree_add_text(tree, tvb, curr_offset, 1,
- "%s : Return Cause: %s",
- a_bigbuf,
- str);
- curr_offset++;
- /* no length check possible */
- return(curr_offset - offset);
- }
- /*
- * IOS 6.2.2.8
- */
- static guint8
- elem_rf_chan_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len)
- {
- guint8 oct;
- guint32 value;
- guint32 curr_offset;
- curr_offset = offset;
- proto_tree_add_text(tree, tvb, curr_offset, 1,
- "Color Code");
- curr_offset++;
- oct = tvb_get_guint8(tvb, curr_offset);
- other_decode_bitfield_value(a_bigbuf, oct, 0xfc, 8);
- proto_tree_add_text(tree, tvb, curr_offset, 1,
- "%s : Reserved",
- a_bigbuf);
- other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
- proto_tree_add_text(tree, tvb, curr_offset, 1,
- "%s : N-AMPS",
- a_bigbuf);
- other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
- proto_tree_add_text(tree, tvb, curr_offset, 1,
- "%s : ANSI/EIA/TIA-553",
- a_bigbuf);
- curr_offset++;
- oct = tvb_get_guint8(tvb, curr_offset);
- other_decode_bitfield_value(a_bigbuf, oct, 0xfc, 8);
- proto_tree_add_text(tree, tvb, curr_offset, 1,
- "%s : Reserved",
- a_bigbuf);
- other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
- proto_tree_add_text(tree, tvb, curr_offset, 1,
- "%s : Timeslot Number",
- a_bigbuf);
- curr_offset++;
- value = tvb_get_ntohs(tvb, curr_offset);
- other_decode_bitfield_value(a_bigbuf, value >> 8, 0xf8, 8);
- proto_tree_add_text(tree, tvb, curr_offset, 1,
- "%s : Reserved",
- a_bigbuf);
- other_decode_bitfield_value(a_bigbuf, value >> 8, 0x07, 8);
- proto_tree_add_text(tree, tvb, curr_offset, 1,
- "%s : ARFCN (MSB): %u",
- a_bigbuf,
- value & 0x07ff);
- other_decode_bitfield_value(a_bigbuf, value & 0x00ff, 0xff, 8);
- proto_tree_add_text(tree, tvb, curr_offset + 1, 1,
- "%s : ARFCN (LSB)"…
Large files files are truncated, but you can click here to view the full file