Wireshark 2.9.0-477-g68ec514b The Wireshark network protocol analyzer

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

packet-h248.h
1 /* Do not modify this file. Changes will be overwritten. */
2 /* Generated automatically by the ASN.1 to Wireshark dissector compiler */
3 /* packet-h248.h */
4 /* asn2wrs.py -b -p h248 -c ./h248.cnf -s ./packet-h248-template -D . -O ../.. h248v3.asn h248v1support.asn */
5
6 /* Input file: packet-h248-template.h */
7
8 #line 1 "./asn1/h248/packet-h248-template.h"
9 /* packet-h248.h
10 * Definitions for H.248/MEGACO packet dissection
11 *
12 * Ronnie Sahlberg 2004
13 * Luis Ontanon 2005
14 *
15 * Wireshark - Network traffic analyzer
16 * By Gerald Combs <gerald@wireshark.org>
17 * Copyright 1998 Gerald Combs
18 *
19 * SPDX-License-Identifier: GPL-2.0-or-later
20 */
21
22 #ifndef PACKET_H248_H
23 #define PACKET_H248_H
24
25 #include "ws_symbol_export.h"
26
27 #include <epan/packet.h>
28 #include <epan/expert.h>
29 #include <wsutil/nstime.h>
30
31 /* Gateway Control Protocol -- Context Tracking */
32
33 typedef struct _gcp_hf_ett_t {
34 struct {
35 int ctx;
36 int ctx_cmd;
37 int ctx_term;
38 int ctx_term_type;
39 int ctx_term_bir;
40 int ctx_term_nsap;
41 } hf;
42
43 struct {
44 gint ctx;
45 gint ctx_cmds;
46 gint ctx_terms;
47 gint ctx_term;
48 } ett;
49 } gcp_hf_ett_t;
50
51 #define NULL_CONTEXT 0
52 #define CHOOSE_CONTEXT 0xFFFFFFFE
53 #define ALL_CONTEXTS 0xFFFFFFFF
54
55
56 typedef enum {
57 GCP_CMD_NONE,
58 GCP_CMD_ADD_REQ,
59 GCP_CMD_MOVE_REQ,
60 GCP_CMD_MOD_REQ,
61 GCP_CMD_SUB_REQ,
62 GCP_CMD_AUDITCAP_REQ,
63 GCP_CMD_AUDITVAL_REQ,
64 GCP_CMD_NOTIFY_REQ,
65 GCP_CMD_SVCCHG_REQ,
66 GCP_CMD_TOPOLOGY_REQ,
67 GCP_CMD_CTX_ATTR_AUDIT_REQ,
68 GCP_CMD_OTHER_REQ,
69 GCP_CMD_ADD_REPLY,
70 GCP_CMD_MOVE_REPLY,
71 GCP_CMD_MOD_REPLY,
72 GCP_CMD_SUB_REPLY,
73 GCP_CMD_AUDITCAP_REPLY,
74 GCP_CMD_AUDITVAL_REPLY,
75 GCP_CMD_NOTIFY_REPLY,
76 GCP_CMD_SVCCHG_REPLY,
77 GCP_CMD_TOPOLOGY_REPLY,
78 GCP_CMD_REPLY
79 } gcp_cmd_type_t;
80
81 typedef enum {
82 GCP_TRX_NONE,
83 GCP_TRX_REQUEST,
84 GCP_TRX_PENDING,
85 GCP_TRX_REPLY,
86 GCP_TRX_ACK
87 } gcp_trx_type_t;
88
89
90 typedef struct _gcp_msg_t {
91 guint32 lo_addr;
92 guint32 hi_addr;
93 guint32 framenum;
94 nstime_t frametime;
95 struct _gcp_trx_msg_t* trxs;
96 gboolean committed;
97 } gcp_msg_t;
98
99 typedef struct _gcp_trx_msg_t {
100 struct _gcp_trx_t* trx;
101 struct _gcp_trx_msg_t* next;
102 struct _gcp_trx_msg_t* last;
103 } gcp_trx_msg_t;
104
105 typedef struct _gcp_cmd_msg_t {
106 struct _gcp_cmd_t* cmd;
107 struct _gcp_cmd_msg_t* next;
108 struct _gcp_cmd_msg_t* last;
109 } gcp_cmd_msg_t;
110
111 typedef struct _gcp_trx_t {
112 gcp_msg_t* initial;
113 guint32 id;
114 gcp_trx_type_t type;
115 guint pendings;
116 struct _gcp_cmd_msg_t* cmds;
117 struct _gcp_trx_ctx_t* ctxs;
118 guint error;
119 } gcp_trx_t;
120
121 #define GCP_TERM_TYPE_UNKNOWN 0
122 #define GCP_TERM_TYPE_AAL1 1
123 #define GCP_TERM_TYPE_AAL2 2
124 #define GCP_TERM_TYPE_AAL1_STRUCT 3
125 #define GCP_TERM_TYPE_IP_RTP 4
126 #define GCP_TERM_TYPE_TDM 5
127
128 typedef enum _gcp_wildcard_t {
129 GCP_WILDCARD_NONE,
130 GCP_WILDCARD_CHOOSE,
131 GCP_WILDCARD_ALL
132 } gcp_wildcard_t;
133
134 typedef struct _gcp_term_t {
135 const gchar* str;
136
137 const guint8* buffer;
138 guint len;
139
140 guint type;
141 gchar* bir;
142 gchar* nsap;
143
144 gcp_msg_t* start;
145
146 } gcp_term_t;
147
148 typedef struct _gcp_terms_t {
149 gcp_term_t* term;
150 struct _gcp_terms_t* next;
151 struct _gcp_terms_t* last;
152 } gcp_terms_t;
153
154 typedef struct _gcp_cmd_t {
155 guint offset;
156 const gchar* str;
157 gcp_cmd_type_t type;
158 gcp_terms_t terms;
159 struct _gcp_msg_t* msg;
160 struct _gcp_trx_t* trx;
161 struct _gcp_ctx_t* ctx;
162 guint error;
163 } gcp_cmd_t;
164
165
166 typedef struct _gcp_ctx_t {
167 gcp_msg_t* initial;
168 guint32 id;
169 struct _gcp_cmd_msg_t* cmds;
170 struct _gcp_ctx_t* prev;
171 gcp_terms_t terms;
172 } gcp_ctx_t;
173
174 extern gcp_msg_t* gcp_msg(packet_info* pinfo, int o, gboolean persistent);
175 extern gcp_trx_t* gcp_trx(gcp_msg_t* m ,guint32 t_id , gcp_trx_type_t type, gboolean persistent);
176 extern gcp_ctx_t* gcp_ctx(gcp_msg_t* m, gcp_trx_t* t, guint32 c_id, gboolean persistent);
177 extern gcp_cmd_t* gcp_cmd(gcp_msg_t* m, gcp_trx_t* t, gcp_ctx_t* c, gcp_cmd_type_t type, guint offset, gboolean persistent);
178 extern gcp_term_t* gcp_cmd_add_term(gcp_msg_t* m, gcp_trx_t* tr, gcp_cmd_t* c, gcp_term_t* t, gcp_wildcard_t wildcard, gboolean persistent);
179 extern void gcp_analyze_msg(proto_tree* gcp_tree, packet_info* pinfo, tvbuff_t* gcp_tvb, gcp_msg_t* m, gcp_hf_ett_t* ids, expert_field* command_err);
180
181 #define GCP_ETT_ARR_ELEMS(gi) &(gi.ett.ctx),&(gi.ett.ctx_cmds),&(gi.ett.ctx_terms),&(gi.ett.ctx_term)
182
183 #define GCP_HF_ARR_ELEMS(n,gi) \
184 { &(gi.hf.ctx), { "Context", n ".ctx", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }}, \
185 { &(gi.hf.ctx_term), { "Termination", n ".ctx.term", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, \
186 { &(gi.hf.ctx_term_type), { "Type", n ".ctx.term.type", FT_UINT32, BASE_HEX, VALS(gcp_term_types), 0, NULL, HFILL }}, \
187 { &(gi.hf.ctx_term_bir), { "BIR", n ".ctx.term.bir", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, \
188 { &(gi.hf.ctx_term_nsap), { "NSAP", n ".ctx.term.nsap", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, \
189 { &(gi.hf.ctx_cmd), { "Command in Frame", n ".ctx.cmd", FT_FRAMENUM, BASE_NONE, NULL, 0, NULL, HFILL }}
190
191 WS_DLL_PUBLIC const value_string gcp_cmd_type[];
192 WS_DLL_PUBLIC const value_string gcp_term_types[];
193
194 extern const gchar* gcp_msg_to_str(gcp_msg_t* m, gboolean persistent);
195
196 #define gcp_cmd_set_error(c,e) (c->error = e)
197 #define gcp_trx_set_error(t,e) (t->error = e)
198
199 /* END Gateway Control Protocol -- Context Tracking */
200
201 typedef struct _h248_curr_info_t h248_curr_info_t;
202
203 typedef void (*h248_pkg_param_dissector_t)(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo _U_, int hfid, h248_curr_info_t*, void*);
204
205 extern void h248_param_bytes_item(proto_tree*, tvbuff_t*, packet_info* , int, h248_curr_info_t*,void* ignored);
206 extern void h248_param_uint_item(proto_tree*, tvbuff_t*, packet_info* , int, h248_curr_info_t*,void* ignored);
207 WS_DLL_PUBLIC void h248_param_ber_integer(proto_tree*, tvbuff_t*, packet_info* , int, h248_curr_info_t*,void* ignored);
208 extern void h248_param_ber_octetstring(proto_tree*, tvbuff_t*, packet_info* , int, h248_curr_info_t*,void* ignored);
209 extern void h248_param_ber_boolean(proto_tree*, tvbuff_t*, packet_info* , int, h248_curr_info_t*,void* ignored);
210 extern void external_dissector(proto_tree*, tvbuff_t*, packet_info* , int, h248_curr_info_t*,void* dissector_handle);
211 extern void h248_param_PkgdName(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo , int hfid _U_, h248_curr_info_t* u _U_, void* dissector_hdl);
212 extern void h248_param_external_dissector(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo , int hfid _U_, h248_curr_info_t* u _U_, void* dissector_hdl);
213
214 typedef enum {
215 ADD_PKG, /* add package at registration ONLY if no matching package ID */
216 REPLACE_PKG, /* replace/add package at registration */
217 MERGE_PKG_HIGH, /* merge h248_package_t at registration favor new package */
218 MERGE_PKG_LOW /* merge h248_package_t at registration favor current package */
219 } pkg_reg_action;
220
221 typedef struct _h248_pkg_param_t {
222 guint32 id;
223 int* hfid;
224 h248_pkg_param_dissector_t dissector;
225 void* data;
226 } h248_pkg_param_t;
227
228 typedef struct _h248_pkg_sig_t {
229 guint32 id;
230 int* hfid;
231 gint* ett;
232 const h248_pkg_param_t* parameters;
233 const value_string* param_names;
234 } h248_pkg_sig_t;
235
236 typedef struct _h248_pkg_evt_t {
237 guint32 id;
238 int* hfid;
239 gint* ett;
240 const h248_pkg_param_t* parameters;
241 const value_string* param_names;
242 } h248_pkg_evt_t;
243
244 typedef struct _h248_pkg_stat_t {
245 guint32 id;
246 int* hfid;
247 gint* ett;
248 const h248_pkg_param_t* parameters;
249 const value_string* param_names;
250 } h248_pkg_stat_t;
251
252 typedef struct _h248_package_t {
253 guint32 id;
254 int* hfid;
255 gint* ett;
256 const value_string* param_names;
257 const value_string* signal_names;
258 const value_string* event_names;
259 const value_string* stats_names;
260 const h248_pkg_param_t* properties;
261 const h248_pkg_sig_t* signals;
262 const h248_pkg_evt_t* events;
263 const h248_pkg_stat_t* statistics;
264 } h248_package_t;
265
266 typedef struct _save_h248_package_t {
267 h248_package_t *pkg;
268 gboolean is_default;
269 } s_h248_package_t;
270
271 struct _h248_curr_info_t {
272 gcp_ctx_t* ctx;
273 gcp_trx_t* trx;
274 gcp_msg_t* msg;
275 gcp_term_t* term;
276 gcp_cmd_t* cmd;
277 const h248_package_t* pkg;
278 const h248_pkg_evt_t* evt;
279 const h248_pkg_sig_t* sig;
280 const h248_pkg_stat_t* stat;
281 const h248_pkg_param_t* par;
282 };
283
284 typedef struct h248_term_info {
285 guint8 wild_card;
286 gchar *str;
287 } h248_term_info_t;
288
289 WS_DLL_PUBLIC
290 void h248_register_package(h248_package_t* pkg, pkg_reg_action reg_action);
291
292 #endif /* PACKET_H248_H */
_h248_package_t
Definition: packet-h248-template.h:244
_gcp_ctx_t
Definition: packet-h248-template.h:158
_gcp_msg_t
Definition: packet-h248-template.h:82
_packet_info
Definition: packet_info.h:44
_h248_pkg_param_t
Definition: packet-h248-template.h:213
_save_h248_package_t
Definition: packet-h248-template.h:258
_gcp_cmd_t
Definition: packet-h248-template.h:146
_h248_pkg_evt_t
Definition: packet-h248-template.h:228
_gcp_term_t
Definition: packet-h248-template.h:126
_gcp_terms_t
Definition: packet-h248-template.h:140
_h248_curr_info_t
Definition: packet-h248-template.h:263
tvbuff
Definition: tvbuff-int.h:35
_gcp_hf_ett_t
Definition: packet-h248-template.h:25
dissector_handle
Definition: packet.c:659
nstime_t
Definition: nstime.h:27
_h248_pkg_sig_t
Definition: packet-h248-template.h:220
nstime.h
expert_field
Definition: expert.h:37
_gcp_trx_msg_t
Definition: packet-h248-template.h:91
h248_term_info
Definition: packet-h248-template.h:276
_gcp_cmd_msg_t
Definition: packet-h248-template.h:97
buffer
Definition: mcast_stream.h:30
_value_string
Definition: value_string.h:24
_proto_node
Definition: proto.h:759
_h248_pkg_stat_t
Definition: packet-h248-template.h:236
_gcp_trx_t
Definition: packet-h248-template.h:103