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