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 /* Context info attached to each LTE MAC frame */
81 typedef struct mac_lte_info
83 /* Needed for decode */
88 /* Extra info to display */
91 guint16 subframeNumber;
92 guint8 isPredefinedData;
94 guint8 reTxCount; /* UL */
95 guint8 crcStatusValid;
97 mac_lte_dl_retx dl_retx;
99 /* More Physical layer info (direction-specific) */
101 struct mac_lte_ul_phy_info
104 guint8 modulation_type;
106 guint8 resource_block_length;
107 guint8 resource_block_start;
109 struct mac_lte_dl_phy_info
113 guint8 resource_allocation_type;
114 guint8 aggregation_level;
116 guint8 redundancy_version_index;
117 guint8 resource_block_length;
122 /* Relating to out-of-band events */
123 mac_lte_oob_event oob_event;
125 guint8 rach_attempt_number;
129 typedef struct mac_lte_tap_info {
130 /* Info from context */
134 guint8 isPredefinedData;
135 guint8 crcStatusValid;
141 /* Number of bytes (which part is used depends upon context settings) */
142 guint32 single_number_of_bytes;
143 guint32 bytes_for_lcid[11];
144 guint32 sdus_for_lcid[11];
145 guint8 number_of_rars;
147 /* Number of padding bytes includes padding subheaders and trailing padding */
148 guint16 padding_bytes;
153 /* Accessor function to check if a frame was considered to be ReTx */
154 int is_mac_lte_frame_retx(packet_info *pinfo, guint8 direction);
156 /*****************************************************************/
157 /* UDP framing format */
158 /* ----------------------- */
159 /* Several people have asked about dissecting MAC by framing */
160 /* PDUs over IP. A suggested format over UDP has been created */
161 /* and implemented by this dissector, using the definitions */
162 /* below. A link to an example program showing you how to encode */
163 /* these headers and send LTE MAC PDUs on a UDP socket is */
164 /* provided at http://wiki.wireshark.org/MAC-LTE */
166 /* A heuristic dissecter (enabled by a preference) will */
167 /* recognise a signature at the beginning of these frames . */
168 /* Until someone is using this format, suggestions for changes */
170 /*****************************************************************/
173 /* Signature. Rather than try to define a port for this, or make the
174 port number a preference, frames will start with this string (with no
176 #define MAC_LTE_START_STRING "mac-lte"
178 /* Fixed fields. This is followed by the following 3 mandatory fields:
182 (where the allowed values are defined above */
184 /* Optional fields. Attaching this info to frames will allow you
185 to show you display/filter/plot/add-custom-columns on these fields, so should
186 be added if available.
187 The format is to have the tag, followed by the value (there is no length field,
188 its implicit from the tag) */
190 #define MAC_LTE_RNTI_TAG 0x02
191 /* 2 bytes, network order */
193 #define MAC_LTE_UEID_TAG 0x03
194 /* 2 bytes, network order */
196 #define MAC_LTE_SUBFRAME_TAG 0x04
197 /* 2 bytes, network order */
199 #define MAC_LTE_PREDFINED_DATA_TAG 0x05
202 #define MAC_LTE_RETX_TAG 0x06
205 #define MAC_LTE_CRC_STATUS_TAG 0x07
209 /* MAC PDU. Following this tag comes the actual MAC PDU (there is no length, the PDU
210 continues until the end of the frame) */
211 #define MAC_LTE_PAYLOAD_TAG 0x01