6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 * This header file may also be distributed under
25 * the terms of the BSD Licence as follows:
27 * Copyright (C) 2009 Martin Mathieson. All rights reserved.
29 * Redistribution and use in source and binary forms, with or without
30 * modification, are permitted provided that the following conditions
32 * 1. Redistributions of source code must retain the above copyright
33 * notice, this list of conditions and the following disclaimer.
34 * 2. Redistributions in binary form must reproduce the above copyright
35 * notice, this list of conditions and the following disclaimer in the
36 * documentation and/or other materials provided with the distribution.
38 * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
39 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
41 * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
42 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
43 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
44 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
45 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
46 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
47 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
56 #define DIRECTION_UPLINK 0
57 #define DIRECTION_DOWNLINK 1
68 typedef enum mac_lte_oob_event {
74 typedef enum mac_lte_dl_retx {
80 typedef enum mac_lte_crc_status {
83 crc_high_code_rate = 2,
87 /* Context info attached to each LTE MAC frame */
88 typedef struct mac_lte_info
90 /* Needed for decode */
95 /* Extra info to display */
98 guint16 subframeNumber;
99 gboolean subframeNumberOfGrantPresent;
100 guint16 subframeNumberOfGrant;
101 gboolean isPredefinedData;
103 guint8 reTxCount; /* UL */
104 mac_lte_crc_status crcStatusValid;
106 mac_lte_dl_retx dl_retx;
108 /* More Physical layer info (direction-specific) */
110 struct mac_lte_ul_phy_info
113 guint8 modulation_type;
115 guint8 resource_block_length;
116 guint8 resource_block_start;
118 struct mac_lte_dl_phy_info
122 guint8 resource_allocation_type;
123 guint8 aggregation_level;
125 guint8 redundancy_version_index;
126 guint8 resource_block_length;
127 mac_lte_crc_status crc_status;
133 /* Relating to out-of-band events */
134 mac_lte_oob_event oob_event;
136 guint8 rach_attempt_number;
140 typedef struct mac_lte_tap_info {
141 /* Info from context */
145 guint8 isPredefinedData;
146 guint8 crcStatusValid;
147 mac_lte_crc_status crcStatus;
154 /* Number of bytes (which part is used depends upon context settings) */
155 guint32 single_number_of_bytes;
156 guint32 bytes_for_lcid[11];
157 guint32 sdus_for_lcid[11];
158 guint8 number_of_rars;
160 /* Number of padding bytes includes padding subheaders and trailing padding */
161 guint16 padding_bytes;
166 /* Accessor function to check if a frame was considered to be ReTx */
167 int is_mac_lte_frame_retx(packet_info *pinfo, guint8 direction);
169 /*****************************************************************/
170 /* UDP framing format */
171 /* ----------------------- */
172 /* Several people have asked about dissecting MAC by framing */
173 /* PDUs over IP. A suggested format over UDP has been created */
174 /* and implemented by this dissector, using the definitions */
175 /* below. A link to an example program showing you how to encode */
176 /* these headers and send LTE MAC PDUs on a UDP socket is */
177 /* provided at http://wiki.wireshark.org/MAC-LTE */
179 /* A heuristic dissecter (enabled by a preference) will */
180 /* recognise a signature at the beginning of these frames . */
181 /* Until someone is using this format, suggestions for changes */
183 /*****************************************************************/
186 /* Signature. Rather than try to define a port for this, or make the
187 port number a preference, frames will start with this string (with no
189 #define MAC_LTE_START_STRING "mac-lte"
191 /* Fixed fields. This is followed by the following 3 mandatory fields:
195 (where the allowed values are defined above */
197 /* Optional fields. Attaching this info to frames will allow you
198 to show you display/filter/plot/add-custom-columns on these fields, so should
199 be added if available.
200 The format is to have the tag, followed by the value (there is no length field,
201 its implicit from the tag) */
203 #define MAC_LTE_RNTI_TAG 0x02
204 /* 2 bytes, network order */
206 #define MAC_LTE_UEID_TAG 0x03
207 /* 2 bytes, network order */
209 #define MAC_LTE_SUBFRAME_TAG 0x04
210 /* 2 bytes, network order */
212 #define MAC_LTE_PREDFINED_DATA_TAG 0x05
215 #define MAC_LTE_RETX_TAG 0x06
218 #define MAC_LTE_CRC_STATUS_TAG 0x07
222 /* MAC PDU. Following this tag comes the actual MAC PDU (there is no length, the PDU
223 continues until the end of the frame) */
224 #define MAC_LTE_PAYLOAD_TAG 0x01