1 /* Do not modify this file. Changes will be overwritten. */
2 /* Generated automatically by the ASN.1 to Wireshark dissector compiler */
4 /* asn2wrs.py -b -q -L -p h248 -c ./h248.cnf -s ./packet-h248-template -D . -O ../.. h248v3.asn h248v1support.asn */
7 * Definitions for H.248/MEGACO packet dissection
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
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
{
48 #define NULL_CONTEXT 0
49 #define CHOOSE_CONTEXT 0xFFFFFFFE
50 #define ALL_CONTEXTS 0xFFFFFFFF
64 GCP_CMD_CTX_ATTR_AUDIT_REQ
,
70 GCP_CMD_AUDITCAP_REPLY
,
71 GCP_CMD_AUDITVAL_REPLY
,
74 GCP_CMD_TOPOLOGY_REPLY
,
87 typedef struct _gcp_msg_t
{
92 struct _gcp_trx_msg_t
* trxs
;
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
;
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
;
108 typedef struct _gcp_trx_t
{
113 struct _gcp_cmd_msg_t
* cmds
;
114 struct _gcp_trx_ctx_t
* ctxs
;
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
{
131 typedef struct _gcp_term_t
{
134 const uint8_t* buffer
;
145 typedef struct _gcp_terms_t
{
147 struct _gcp_terms_t
* next
;
148 struct _gcp_terms_t
* last
;
151 typedef struct _gcp_cmd_t
{
156 struct _gcp_msg_t
* msg
;
157 struct _gcp_trx_t
* trx
;
158 struct _gcp_ctx_t
* ctx
;
163 typedef struct _gcp_ctx_t
{
166 struct _gcp_cmd_msg_t
* cmds
;
167 struct _gcp_ctx_t
* prev
;
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
);
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 */
218 typedef struct _h248_pkg_param_t
{
221 h248_pkg_param_dissector_t dissector
;
225 typedef struct _h248_pkg_sig_t
{
229 const h248_pkg_param_t
* parameters
;
230 const value_string
* param_names
;
233 typedef struct _h248_pkg_evt_t
{
237 const h248_pkg_param_t
* parameters
;
238 const value_string
* param_names
;
241 typedef struct _h248_pkg_stat_t
{
245 const h248_pkg_param_t
* parameters
;
246 const value_string
* param_names
;
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
;
263 typedef struct _save_h248_package_t
{
268 struct _h248_curr_info_t
{
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
{
287 void h248_register_package(h248_package_t
* pkg
, pkg_reg_action reg_action
);
289 #endif /* PACKET_H248_H */