2008-12-23 21:00:04 +00:00
|
|
|
/* packet-mac-lte.h
|
|
|
|
*
|
|
|
|
* Martin Mathieson
|
|
|
|
* $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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
2009-05-30 11:57:39 +00:00
|
|
|
*
|
|
|
|
* This header file may also be distributed under
|
|
|
|
* the terms of the BSD Licence as follows:
|
|
|
|
*
|
|
|
|
* Copyright (C) 2009 Martin Mathieson. All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE
|
2008-12-23 21:00:04 +00:00
|
|
|
*/
|
|
|
|
|
2009-02-19 22:25:36 +00:00
|
|
|
/* radioType */
|
|
|
|
#define FDD_RADIO 1
|
|
|
|
#define TDD_RADIO 2
|
|
|
|
|
2009-05-13 09:36:42 +00:00
|
|
|
/* Direction */
|
2009-02-12 12:08:05 +00:00
|
|
|
#define DIRECTION_UPLINK 0
|
|
|
|
#define DIRECTION_DOWNLINK 1
|
2008-12-23 21:00:04 +00:00
|
|
|
|
2009-02-19 22:25:36 +00:00
|
|
|
/* rntiType */
|
2009-09-02 16:39:39 +00:00
|
|
|
#define NO_RNTI 0
|
|
|
|
#define P_RNTI 1
|
|
|
|
#define RA_RNTI 2
|
|
|
|
#define C_RNTI 3
|
|
|
|
#define SI_RNTI 4
|
|
|
|
#define SPS_RNTI 5
|
2009-02-12 12:08:05 +00:00
|
|
|
|
|
|
|
|
2009-10-26 15:39:00 +00:00
|
|
|
typedef enum mac_lte_oob_event {
|
|
|
|
ltemac_send_preamble,
|
|
|
|
ltemac_send_sr,
|
|
|
|
ltemac_sr_failure
|
|
|
|
} mac_lte_oob_event;
|
|
|
|
|
2009-02-12 12:08:05 +00:00
|
|
|
/* Context info attached to each LTE MAC frame */
|
2008-12-23 21:00:04 +00:00
|
|
|
typedef struct mac_lte_info
|
|
|
|
{
|
|
|
|
/* Needed for decode */
|
|
|
|
guint8 radioType;
|
|
|
|
guint8 direction;
|
|
|
|
guint8 rntiType;
|
|
|
|
|
|
|
|
/* Extra info to display */
|
|
|
|
guint16 rnti;
|
|
|
|
guint16 ueid;
|
|
|
|
guint16 subframeNumber;
|
2009-03-16 15:39:52 +00:00
|
|
|
guint8 isPredefinedData;
|
2008-12-23 21:00:04 +00:00
|
|
|
guint16 length;
|
2009-03-16 15:39:52 +00:00
|
|
|
guint8 reTxCount;
|
2009-03-24 17:28:30 +00:00
|
|
|
guint8 crcStatusValid;
|
2009-03-23 22:16:25 +00:00
|
|
|
guint8 crcStatus;
|
2009-10-26 15:39:00 +00:00
|
|
|
|
|
|
|
/* Relating to out-of-band events */
|
|
|
|
mac_lte_oob_event oob_event;
|
|
|
|
guint8 rapid;
|
|
|
|
guint8 rach_attempt_number;
|
2008-12-23 21:00:04 +00:00
|
|
|
} mac_lte_info;
|
|
|
|
|
2009-02-12 12:08:05 +00:00
|
|
|
|
|
|
|
typedef struct mac_lte_tap_info {
|
|
|
|
/* Info from context */
|
|
|
|
guint16 rnti;
|
2009-03-24 17:28:30 +00:00
|
|
|
guint8 rntiType;
|
|
|
|
guint8 isPredefinedData;
|
2009-03-16 15:39:52 +00:00
|
|
|
guint8 reTxCount;
|
2009-03-24 17:28:30 +00:00
|
|
|
guint8 crcStatusValid;
|
2009-03-23 22:16:25 +00:00
|
|
|
guint8 crcStatus;
|
2009-02-12 12:08:05 +00:00
|
|
|
guint8 direction;
|
|
|
|
|
|
|
|
/* Number of bytes (which part is used depends upon context settings) */
|
|
|
|
guint32 single_number_of_bytes;
|
|
|
|
guint32 bytes_for_lcid[11];
|
2009-02-25 18:02:09 +00:00
|
|
|
guint32 sdus_for_lcid[11];
|
2009-04-21 12:35:50 +00:00
|
|
|
guint8 number_of_rars;
|
2009-02-12 12:08:05 +00:00
|
|
|
} mac_lte_tap_info;
|
|
|
|
|
2009-05-28 02:24:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************/
|
|
|
|
/* UDP framing format */
|
|
|
|
/* ----------------------- */
|
|
|
|
/* Several people have asked about dissecting MAC by framing */
|
|
|
|
/* PDUs over IP. A suggested format over UDP has been */
|
|
|
|
/* and implemented by this dissector, using the definitions */
|
2009-05-30 12:54:08 +00:00
|
|
|
/* below. A link to an example program showing you how to encode */
|
|
|
|
/* these headers and send LTE MAC PDUs on a UDP socket is */
|
|
|
|
/* provided at http://wiki.wireshark.org/MAC-LTE */
|
2009-05-28 02:24:27 +00:00
|
|
|
/* */
|
2009-05-30 12:54:08 +00:00
|
|
|
/* A heuristic dissecter (enabled by a preference) will */
|
2009-05-28 02:24:27 +00:00
|
|
|
/* recognise a signature at the beginning of these frames . */
|
2009-05-30 12:54:08 +00:00
|
|
|
/* Until someone is using this format, suggestions for changes */
|
2009-05-28 02:24:27 +00:00
|
|
|
/* are welcome. */
|
|
|
|
/*****************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
/* Signature. Rather than try to define a port for this, or make the
|
|
|
|
port number a preference, frames will start with this string (with no
|
|
|
|
terminating NULL */
|
|
|
|
#define MAC_LTE_START_STRING "mac-lte"
|
|
|
|
|
|
|
|
/* Fixed fields. This is followed by the following 3 mandatory fields:
|
|
|
|
- radioType (1 byte)
|
|
|
|
- direction (1 byte)
|
|
|
|
- rntiType (1 byte)
|
|
|
|
(where the allowed values are defined above */
|
|
|
|
|
|
|
|
/* Optional fields. Attaching this info to frames will allow you
|
|
|
|
to show you display/filter/plot/add-custom-columns on these fields, so should
|
|
|
|
be added if available.
|
|
|
|
The format is to have the tag, followed by the value (there is no length field,
|
|
|
|
its implicit from the tag) */
|
|
|
|
|
|
|
|
#define MAC_LTE_RNTI_TAG 0x02
|
|
|
|
/* 2 bytes, network order */
|
|
|
|
|
|
|
|
#define MAC_LTE_UEID_TAG 0x03
|
|
|
|
/* 2 bytes, network order */
|
|
|
|
|
|
|
|
#define MAC_LTE_SUBFRAME_TAG 0x04
|
|
|
|
/* 2 bytes, network order */
|
|
|
|
|
|
|
|
#define MAC_LTE_PREDFINED_DATA_TAG 0x05
|
|
|
|
/* 1 byte */
|
|
|
|
|
|
|
|
#define MAC_LTE_RETX_TAG 0x06
|
|
|
|
/* 1 byte */
|
|
|
|
|
|
|
|
#define MAC_LTE_CRC_STATUS_TAG 0x07
|
|
|
|
/* 1 byte */
|
|
|
|
|
|
|
|
|
|
|
|
/* MAC PDU. Following this tag comes the actual MAC PDU (there is no length, the PDU
|
|
|
|
continues until the end of the frame) */
|
|
|
|
#define MAC_LTE_PAYLOAD_TAG 0x01
|
|
|
|
|