| Wireshark 4.7.0 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
packet-gmr1_common.h
1/* packet-gmr1_common.h
2 *
3 * Headers for GMR-1 dissection in wireshark (common stuff).
4 * Copyright (c) 2011 Sylvain Munaut <tnt@246tNt.com>
5 *
6 * References:
7 * [1] ETSI TS 101 376-4-8 V1.3.1 - GMR-1 04.008
8 * [2] ETSI TS 101 376-4-8 V2.2.1 - GMPRS-1 04.008
9 * [3] ETSI TS 101 376-4-8 V3.1.1 - GMR-1 3G 44.008
10 * [4] ETSI TS 100 940 V7.21.0 - GSM 04.08
11 * [5] ETSI TS 101 376-4-12 V3.2.1 - GMR-1 3G 44.060
12 * [6] ETSI TS 101 376-5-6 V1.3.1 - GMR-1 05.008
13 *
14 * Wireshark - Network traffic analyzer
15 * By Gerald Combs <gerald@wireshark.org>
16 * Copyright 1998 Gerald Combs
17 *
18 * SPDX-License-Identifier: GPL-2.0-or-later
19 */
20
21#ifndef __PACKET_GMR1_COMMON_H__
22#define __PACKET_GMR1_COMMON_H__
23
24#include "packet-gsm_a_common.h"
25
26
27/* Protocol descriptor (see [1] 11.2 & [4] 10.2) */
28typedef enum {
29 GMR1_PD_CC = 0x03,
30 GMR1_PD_MM = 0x05,
31 GMR1_PD_RR = 0x06,
32 GMR1_PD_GMM = 0x08,
33 GMR1_PD_SM = 0x0a,
34 GMR1_PD_DTRS = 0x1e
35} gmr1_pd_e;
36
37#define GMR1_PD_EXT_MSK 0x0f
38#define GMR1_PD_EXT_VAL 0x0e
39
40extern const value_string gmr1_pd_vals[];
41extern const value_string gmr1_pd_short_vals[];
42
43
44/* Common IEs */
45enum gmr1_ie_common_idx {
46 GMR1_IE_COM_CM2, /* [1] 11.5.1.6 */
47 GMR1_IE_COM_SPARE_NIBBLE, /* [1] 11.5.1.8 */
48 NUM_GMR1_IE_COMMON /* Terminator */
49};
50
51extern int hf_gmr1_skip_ind;
52extern int hf_gmr1_l3_pd;
53extern int hf_gmr1_elem_id;
54extern int hf_gmr1_len;
55
56
57/* Message & IEs parsing */
58
59typedef void (*gmr1_msg_func_t)(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int offset, int len);
60
61#define GMR1_IE_FUNC(fn_name) \
62 static uint16_t \
63 fn_name (tvbuff_t *tvb _U_, proto_tree *tree _U_, packet_info *pinfo _U_, uint32_t offset _U_, unsigned len _U_, char *add_string _U_, int string_len _U_)
64
65#define GMR1_MSG_FUNC(fn_name) \
66 static void \
67 fn_name (tvbuff_t *tvb _U_, proto_tree *tree _U_, packet_info *pinfo _U_, int offset, int len)
68
69#define GMR1_MSG_FUNC_BEGIN \
70 int curr_offset; \
71 int curr_len; \
72 int consumed; \
73 \
74 curr_offset = offset; \
75 curr_len = len; \
76 consumed = 0;
77
78#define GMR1_MSG_FUNC_END
79
80
81extern void
82gmr1_get_msg_params(gmr1_pd_e pd, uint8_t oct, const char **msg_str,
83 int *ett_tree, int *hf_idx, gmr1_msg_func_t *msg_func_p);
84
85
86#endif /* __PACKET_GMR1_COMMON_H__ */
_packet_info
Definition packet_info.h:43
_proto_node
Definition proto.h:907
_value_string
Mapping between a 32-bit integer value and its string representation.
Definition value_string.h:33
tvbuff
Definition tvbuff-int.h:35