Document the new Copy Profile button.
[obnox/wireshark/wip.git] / epan / dissectors / packet-pdcp-lte.h
1 /* packet-pdcp-lte.h
2  *
3  * Martin Mathieson
4  * $Id$
5  *
6  * Wireshark - Network traffic analyzer
7  * By Gerald Combs <gerald@wireshark.org>
8  * Copyright 1998 Gerald Combs
9  *
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.
14  *
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.
19  *
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.
23  */
24
25
26 /* Direction */
27 #define DIRECTION_UPLINK   0
28 #define DIRECTION_DOWNLINK 1
29
30 enum pdcp_plane
31 {
32   SIGNALING_PLANE = 1,
33   USER_PLANE = 2
34 };
35
36 enum rohc_mode
37 {
38   UNIDIRECTIONAL = 1,
39   OPTIMISTIC_BIDIRECTIONAL = 2,
40   RELIABLE_BIDIRECTIONAL = 3
41 };
42
43 typedef enum LogicalChannelType
44 {
45     Channel_DCCH=1,
46     Channel_BCCH=2,
47     Channel_CCCH=3,
48     Channel_PCCH=4
49 } LogicalChannelType;
50
51 typedef enum
52 {
53     BCH_TRANSPORT=1,
54     DLSCH_TRANSPORT=2
55 } BCCHTransportType;
56
57
58 #define CID_IN_PDCP_HEADER 0
59 #define CID_IN_ROHC_PACKET 1
60
61 #define PDCP_SN_LENGTH_7_BITS 7
62 #define PDCP_SN_LENGTH_12_BITS 12
63
64
65
66 /* Info attached to each LTE PDCP/RoHC packet */
67 typedef struct pdcp_lte_info
68 {
69     /* Channel info is needed for RRC parsing */
70     guint8             direction;
71     LogicalChannelType channelType;
72     BCCHTransportType  BCCHTransport;
73
74     /* Details of PDCP header */
75     gboolean           no_header_pdu;
76     enum pdcp_plane    plane;
77     guint8             seqnum_length;
78
79     /* RoHC settings */
80     gboolean           rohc_compression;
81     unsigned short     rohc_ip_version;
82     gboolean           cid_inclusion_info;
83     gboolean           large_cid_present;
84     enum rohc_mode     mode;
85     gboolean           rnd;
86     gboolean           udp_checkum_present;
87     unsigned short     profile;
88 } pdcp_lte_info;
89
90
91 /*****************************************************************/
92 /* UDP framing format                                            */
93 /* -----------------------                                       */
94 /* Several people have asked about dissecting PDCP by framing    */
95 /* PDUs over IP.  A suggested format over UDP has been defined   */
96 /* and implemented by this dissector, using the definitions      */
97 /* below. A link to an example program showing you how to encode */
98 /* these headers and send LTE PDCP PDUs on a UDP socket is       */
99 /* provided at http://wiki.wireshark.org/PDCP-LTE                */
100 /*                                                               */
101 /* A heuristic dissecter (enabled by a preference) will          */
102 /* recognise a signature at the beginning of these frames.       */
103 /* Until someone is using this format, suggestions for changes   */
104 /* are welcome.                                                  */
105 /*****************************************************************/
106
107
108 /* Signature.  Rather than try to define a port for this, or make the
109    port number a preference, frames will start with this string (with no
110    terminating NULL */
111 #define PDCP_LTE_START_STRING "pdcp-lte"
112
113 /* Fixed fields.  This is followed by the following 3 mandatory fields:
114    - no_header_pdu (1 byte)
115    - plane (1 byte)
116    - rohc_compression ( byte)
117    (where the allowed values are defined above) */
118
119 /* Conditional field. This field is mandatory in case of User Plane PDCP PDU.
120    The format is to have the tag, followed by the value (there is no length field,
121    its implicit from the tag). The allowed values are defined above. */
122
123 #define PDCP_LTE_SEQNUM_LENGTH_TAG          0x02
124 /* 1 byte */
125
126 /* Optional fields. Attaching this info to frames will allow you
127    to show you display/filter/plot/add-custom-columns on these fields, so should
128    be added if available.
129    The format is to have the tag, followed by the value (there is no length field,
130    its implicit from the tag) */
131
132 #define PDCP_LTE_DIRECTION_TAG              0x03
133 /* 1 byte */
134
135 #define PDCP_LTE_LOG_CHAN_TYPE_TAG          0x04
136 /* 1 byte */
137
138 #define PDCP_LTE_BCCH_TRANSPORT_TYPE_TAG    0x05
139 /* 1 byte */
140
141 #define PDCP_LTE_ROHC_IP_VERSION_TAG        0x06
142 /* 2 bytes, network order */
143
144 #define PDCP_LTE_ROHC_CID_INC_INFO_TAG      0x07
145 /* 1 byte */
146
147 #define PDCP_LTE_ROHC_LARGE_CID_PRES_TAG    0x08
148 /* 1 byte */
149
150 #define PDCP_LTE_ROHC_MODE_TAG              0x09
151 /* 1 byte */
152
153 #define PDCP_LTE_ROHC_RND_TAG               0x0A
154 /* 1 byte */
155
156 #define PDCP_LTE_ROHC_UDP_CHECKSUM_PRES_TAG 0x0B
157 /* 1 byte */
158
159 #define PDCP_LTE_ROHC_PROFILE_TAG           0x0C
160 /* 2 bytes, network order */
161
162
163 /* PDCP PDU. Following this tag comes the actual PDCP PDU (there is no length, the PDU
164    continues until the end of the frame) */
165 #define PDCP_LTE_PAYLOAD_TAG                0x01