epan/dissectors/pidl/samr/samr.cnf cnf_dissect_lsa_BinaryString => lsarpc_dissect_str...
[wireshark-sm.git] / epan / dissectors / packet-h248.h
blobe6578e422e16fc8f7d869a3923f1ddf2dd10bc54
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 */
6 /* packet-h248.h
7 * Definitions for H.248/MEGACO packet dissection
9 * Ronnie Sahlberg 2004
10 * Luis Ontanon 2005
12 * Wireshark - Network traffic analyzer
13 * By Gerald Combs <gerald@wireshark.org>
14 * Copyright 1998 Gerald Combs
16 * SPDX-License-Identifier: GPL-2.0-or-later
19 #ifndef PACKET_H248_H
20 #define PACKET_H248_H
22 #include "ws_symbol_export.h"
24 #include <epan/packet.h>
25 #include <epan/expert.h>
26 #include <wsutil/nstime.h>
28 /* Gateway Control Protocol -- Context Tracking */
30 typedef 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;
40 struct {
41 int ctx;
42 int ctx_cmds;
43 int ctx_terms;
44 int ctx_term;
45 } ett;
46 } gcp_hf_ett_t;
48 #define NULL_CONTEXT 0
49 #define CHOOSE_CONTEXT 0xFFFFFFFE
50 #define ALL_CONTEXTS 0xFFFFFFFF
53 typedef 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;
78 typedef 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;
87 typedef 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;
96 typedef 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;
100 } gcp_trx_msg_t;
102 typedef 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;
106 } gcp_cmd_msg_t;
108 typedef 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;
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
125 typedef enum _gcp_wildcard_t {
126 GCP_WILDCARD_NONE,
127 GCP_WILDCARD_CHOOSE,
128 GCP_WILDCARD_ALL
129 } gcp_wildcard_t;
131 typedef struct _gcp_term_t {
132 const char* str;
134 const uint8_t* buffer;
135 unsigned len;
137 unsigned type;
138 char* bir;
139 char* nsap;
141 gcp_msg_t* start;
143 } gcp_term_t;
145 typedef struct _gcp_terms_t {
146 gcp_term_t* term;
147 struct _gcp_terms_t* next;
148 struct _gcp_terms_t* last;
149 } gcp_terms_t;
151 typedef 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;
163 typedef 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;
171 extern gcp_msg_t* gcp_msg(packet_info* pinfo, int o, bool persistent);
172 extern gcp_trx_t* gcp_trx(gcp_msg_t* m ,uint32_t t_id , gcp_trx_type_t type, packet_info *pinfo, bool persistent);
173 extern gcp_ctx_t* gcp_ctx(gcp_msg_t* m, gcp_trx_t* t, uint32_t c_id, packet_info *pinfo, bool persistent);
174 extern 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);
175 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, packet_info *pinfo, bool persistent);
176 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);
178 #define GCP_ETT_ARR_ELEMS(gi) &(gi.ett.ctx),&(gi.ett.ctx_cmds),&(gi.ett.ctx_terms),&(gi.ett.ctx_term)
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 }}
188 WS_DLL_PUBLIC const value_string gcp_cmd_type[];
189 WS_DLL_PUBLIC const value_string gcp_term_types[];
191 extern const char* gcp_msg_to_str(gcp_msg_t* m, wmem_allocator_t *scope, bool persistent);
193 #define gcp_cmd_set_error(c,e) (c->error = e)
194 #define gcp_trx_set_error(t,e) (t->error = e)
196 /* END Gateway Control Protocol -- Context Tracking */
198 typedef struct _h248_curr_info_t h248_curr_info_t;
200 typedef void (*h248_pkg_param_dissector_t)(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo _U_, int hfid, h248_curr_info_t*, void*);
202 extern void h248_param_bytes_item(proto_tree*, tvbuff_t*, packet_info* , int, h248_curr_info_t*,void* ignored);
203 extern void h248_param_uint_item(proto_tree*, tvbuff_t*, packet_info* , int, h248_curr_info_t*,void* ignored);
204 WS_DLL_PUBLIC void h248_param_ber_integer(proto_tree*, tvbuff_t*, packet_info* , int, h248_curr_info_t*,void* ignored);
205 extern void h248_param_ber_octetstring(proto_tree*, tvbuff_t*, packet_info* , int, h248_curr_info_t*,void* ignored);
206 extern void h248_param_ber_boolean(proto_tree*, tvbuff_t*, packet_info* , int, h248_curr_info_t*,void* ignored);
207 extern void external_dissector(proto_tree*, tvbuff_t*, packet_info* , int, h248_curr_info_t*,void* dissector_handle);
208 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);
209 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);
211 typedef 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;
218 typedef struct _h248_pkg_param_t {
219 uint32_t id;
220 int* hfid;
221 h248_pkg_param_dissector_t dissector;
222 void* data;
223 } h248_pkg_param_t;
225 typedef 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;
231 } h248_pkg_sig_t;
233 typedef 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;
239 } h248_pkg_evt_t;
241 typedef 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;
247 } h248_pkg_stat_t;
249 typedef struct _h248_package_t {
250 uint32_t id; /**< Package ID */
251 int* hfid; /**< hfid that will display the package name */
252 int* ett; /**< The ett for this item */
253 const value_string* param_names; /**< The parameter names, Value 00000 should be the package name */
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;
261 } h248_package_t;
263 typedef struct _save_h248_package_t {
264 h248_package_t *pkg;
265 bool is_default;
266 } s_h248_package_t;
268 struct _h248_curr_info_t {
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;
281 typedef struct h248_term_info {
282 uint8_t wild_card;
283 char *str;
284 } h248_term_info_t;
286 WS_DLL_PUBLIC
287 void h248_register_package(h248_package_t* pkg, pkg_reg_action reg_action);
289 #endif /* PACKET_H248_H */