aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/asn1/h248/packet-h248-template.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/asn1/h248/packet-h248-template.c')
-rw-r--r--epan/dissectors/asn1/h248/packet-h248-template.c165
1 files changed, 83 insertions, 82 deletions
diff --git a/epan/dissectors/asn1/h248/packet-h248-template.c b/epan/dissectors/asn1/h248/packet-h248-template.c
index af1a2ba83c..54a40d08e7 100644
--- a/epan/dissectors/asn1/h248/packet-h248-template.c
+++ b/epan/dissectors/asn1/h248/packet-h248-template.c
@@ -18,6 +18,7 @@
#include <epan/exceptions.h>
#include <epan/tap.h>
#include <epan/asn1.h>
+#include <epan/proto_data.h>
#include <epan/prefs.h>
#include <epan/exported_pdu.h>
#include <epan/address_types.h>
@@ -28,69 +29,69 @@
#include "packet-h248.h"
#define PNAME "H.248 MEGACO"
-#define PSNAME "H248"
+#define PSNAME "H.248"
#define PFNAME "h248"
void proto_register_h248(void);
/* Initialize the protocol and registered fields */
-static int proto_h248 = -1;
-static int hf_248_magic_num = -1;
-static int hf_h248_mtpaddress_ni = -1;
-static int hf_h248_mtpaddress_pc = -1;
-static int hf_h248_pkg_name = -1;
-static int hf_248_pkg_param = -1;
-static int hf_h248_event_name = -1;
-static int hf_h248_signal_name = -1;
-static int hf_h248_signal_code = -1;
-static int hf_h248_event_code = -1;
-static int hf_h248_pkg_bcp_BNCChar_PDU = -1;
-
-
-
-static int hf_h248_context_id = -1;
-static int hf_h248_term_wild_type = -1;
-static int hf_h248_term_wild_level = -1;
-static int hf_h248_term_wild_position = -1;
-
-static int hf_h248_no_pkg = -1;
-static int hf_h248_no_sig = -1;
-static int hf_h248_no_evt = -1;
-static int hf_h248_param = -1;
-
-static int hf_h248_serviceChangeReasonStr = -1;
-static int hf_h248_transactionId64 = -1;
-static int hf_h248_context_id64 = -1;
+static int proto_h248;
+static int hf_248_magic_num;
+static int hf_h248_mtpaddress_ni;
+static int hf_h248_mtpaddress_pc;
+static int hf_h248_pkg_name;
+static int hf_248_pkg_param;
+static int hf_h248_event_name;
+static int hf_h248_signal_name;
+static int hf_h248_signal_code;
+static int hf_h248_event_code;
+static int hf_h248_pkg_bcp_BNCChar_PDU;
+
+
+
+static int hf_h248_context_id;
+static int hf_h248_term_wild_type;
+static int hf_h248_term_wild_level;
+static int hf_h248_term_wild_position;
+
+static int hf_h248_no_pkg;
+static int hf_h248_no_sig;
+static int hf_h248_no_evt;
+static int hf_h248_param;
+
+static int hf_h248_serviceChangeReasonStr;
+static int hf_h248_transactionId64;
+static int hf_h248_context_id64;
/* h248v1 support */
-static int hf_h248_auditValueReplyV1 = -1;
+static int hf_h248_auditValueReplyV1;
#include "packet-h248-hf.c"
/* Initialize the subtree pointers */
-static gint ett_h248 = -1;
-static gint ett_mtpaddress = -1;
-static gint ett_packagename = -1;
-static gint ett_codec = -1;
-static gint ett_wildcard = -1;
+static gint ett_h248;
+static gint ett_mtpaddress;
+static gint ett_packagename;
+static gint ett_codec;
+static gint ett_wildcard;
-static gint ett_h248_no_pkg = -1;
-static gint ett_h248_no_sig = -1;
-static gint ett_h248_no_evt = -1;
+static gint ett_h248_no_pkg;
+static gint ett_h248_no_sig;
+static gint ett_h248_no_evt;
-static int h248_tap = -1;
+static int h248_tap;
-static gcp_hf_ett_t h248_arrel = {{-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1}};
+static gcp_hf_ett_t h248_arrel;
static gint exported_pdu_tap = -1;
#include "packet-h248-ett.c"
-static expert_field ei_h248_errored_command = EI_INIT;
-static expert_field ei_h248_transactionId64 = EI_INIT;
-static expert_field ei_h248_context_id64 = EI_INIT;
-static expert_field ei_h248_octet_string_expected = EI_INIT;
+static expert_field ei_h248_errored_command;
+static expert_field ei_h248_transactionId64;
+static expert_field ei_h248_context_id64;
+static expert_field ei_h248_octet_string_expected;
static dissector_table_t subdissector_table;
@@ -843,14 +844,14 @@ static dissector_handle_t h248_term_handle;
static dissector_handle_t h248_tpkt_handle;
/* Forward declarations */
-static int dissect_h248_ServiceChangeReasonStr(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index);
+static int dissect_h248_ServiceChangeReasonStr(bool implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index);
/* h248v1 support */
-static int dissect_h248_AuditReplyV1(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index);
+static int dissect_h248_AuditReplyV1(bool implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index);
-static int dissect_h248_EventParameterV1(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index);
-static int dissect_h248_SigParameterV1(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index);
-static int dissect_h248_SigParamValueV1(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index);
+static int dissect_h248_EventParameterV1(bool implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index);
+static int dissect_h248_SigParameterV1(bool implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index);
+static int dissect_h248_SigParamValueV1(bool implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index);
#if 0
static const value_string context_id_type[] = {
@@ -908,7 +909,7 @@ static const value_string base_package_name_vals[] = {
{ 0x0027, "Intrusion Tones Q.1950 Annex A" },
{ 0x0028, "Business Tones Q.1950 Annex A" },
{ 0x0029, "Media Gateway Resource Congestion Handling H.248.10" }, /* H.248.10 */
- { 0x002a, "H245 package H248.12" }, /* H.248.12 */
+ { 0x002a, "H245 package H.248.12" }, /* H.248.12 */
{ 0x002b, "H323 bearer control package H.248.12" }, /* H.248.12 */
{ 0x002c, "H324 package H.248.12" }, /* H.248.12 */
{ 0x002d, "H245 command package H.248.12" }, /* H.248.12 */
@@ -1430,7 +1431,7 @@ static void
export_h248_pdu(packet_info *pinfo, tvbuff_t *tvb)
{
if (have_tap_listener(exported_pdu_tap)) {
- exp_pdu_data_t *exp_pdu_data = export_pdu_create_common_tags(pinfo, "h248", EXP_PDU_TAG_PROTO_NAME);
+ exp_pdu_data_t *exp_pdu_data = export_pdu_create_common_tags(pinfo, "h248", EXP_PDU_TAG_DISSECTOR_NAME);
exp_pdu_data->tvb_captured_length = tvb_captured_length(tvb);
exp_pdu_data->tvb_reported_length = tvb_reported_length(tvb);
@@ -1443,19 +1444,19 @@ export_h248_pdu(packet_info *pinfo, tvbuff_t *tvb)
extern void h248_param_ber_integer(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, int hfid, h248_curr_info_t* u _U_, void* implicit) {
asn1_ctx_t asn1_ctx;
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
- dissect_ber_integer(implicit ? *((gboolean*)implicit) : FALSE, &asn1_ctx, tree, tvb, 0, hfid, NULL);
+ dissect_ber_integer(implicit ? *((bool*)implicit) : FALSE, &asn1_ctx, tree, tvb, 0, hfid, NULL);
}
extern void h248_param_ber_octetstring(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, int hfid, h248_curr_info_t* u _U_, void* implicit) {
asn1_ctx_t asn1_ctx;
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
- dissect_ber_octet_string(implicit ? *((gboolean*)implicit) : FALSE, &asn1_ctx, tree, tvb, 0, hfid, NULL);
+ dissect_ber_octet_string(implicit ? *((bool*)implicit) : FALSE, &asn1_ctx, tree, tvb, 0, hfid, NULL);
}
extern void h248_param_ber_boolean(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, int hfid, h248_curr_info_t* u _U_, void* implicit) {
asn1_ctx_t asn1_ctx;
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
- dissect_ber_boolean(implicit ? *((gboolean*)implicit) : FALSE, &asn1_ctx, tree, tvb, 0, hfid, NULL);
+ dissect_ber_boolean(implicit ? *((bool*)implicit) : FALSE, &asn1_ctx, tree, tvb, 0, hfid, NULL);
}
extern void h248_param_bytes_item(proto_tree* tree,
@@ -1488,7 +1489,7 @@ static const h248_pkg_sig_t no_signal = { 0, &hf_h248_no_sig, &ett_h248_no_sig,
static const h248_pkg_param_t no_param = { 0, &hf_h248_param, h248_param_uint_item, NULL };
static const h248_pkg_evt_t no_event = { 0, &hf_h248_no_evt, &ett_h248_no_evt, NULL, NULL };
-const h248_package_t *find_package_id(guint16 pkgid);
+static const h248_package_t *find_package_id(guint16 pkgid);
static wmem_tree_t* packages = NULL;
extern void h248_param_PkgdName(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo , int hfid _U_, h248_curr_info_t* u1 _U_, void* u2 _U_) {
@@ -1509,7 +1510,7 @@ extern void h248_param_PkgdName(proto_tree* tree, tvbuff_t* tvb, packet_info* pi
pkg = find_package_id(name_major);
/* do the prettification */
proto_item_append_text(asn1_ctx.created_item, " %s (%04x)",
- val_to_str(0, pkg->param_names, "Unknown Package"),
+ val_to_str_const(0, pkg->param_names, "Unknown Package"),
name_major);
if(tree){
@@ -1518,7 +1519,7 @@ extern void h248_param_PkgdName(proto_tree* tree, tvbuff_t* tvb, packet_info* pi
package_tree = proto_item_add_subtree(asn1_ctx.created_item, ett_packagename);
proto_tree_add_uint_format(package_tree, hf_h248_pkg_name, tvb, offset-4, 2, name_major,
- "%s (0x%04x)", val_to_str(0, pkg->param_names, "Unknown Package"), name_major);
+ "%s (0x%04x)", val_to_str_const(0, pkg->param_names, "Unknown Package"), name_major);
pi = proto_tree_add_uint(package_tree, hf_248_pkg_param, tvb, offset-2, 2, name_minor);
@@ -1535,10 +1536,10 @@ extern void h248_param_PkgdName(proto_tree* tree, tvbuff_t* tvb, packet_info* pi
}
-static int dissect_h248_trx_id(gboolean implicit_tag, packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, guint32* trx_id_p) {
+static int dissect_h248_trx_id(bool implicit_tag, packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, guint32* trx_id_p) {
guint64 trx_id = 0;
gint8 ber_class;
- gboolean pc;
+ bool pc;
gint32 tag;
guint32 len;
guint32 i;
@@ -1573,9 +1574,9 @@ static int dissect_h248_trx_id(gboolean implicit_tag, packet_info *pinfo, proto_
return offset;
}
-static int dissect_h248_ctx_id(gboolean implicit_tag, packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, guint32* ctx_id_p) {
+static int dissect_h248_ctx_id(bool implicit_tag, packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, guint32* ctx_id_p) {
gint8 ber_class;
- gboolean pc;
+ bool pc;
gint32 tag;
guint32 len;
guint64 ctx_id = 0;
@@ -1627,7 +1628,7 @@ static s_h248_package_t *s_find_package_id(guint16 pkgid) {
return s_pkg;
}
-const h248_package_t *find_package_id(guint16 pkgid) {
+static const h248_package_t *find_package_id(guint16 pkgid) {
s_h248_package_t *s_pkg = NULL;
s_pkg = s_find_package_id(pkgid); /*(packages, GUINT_TO_POINTER((guint32)(pkgid))); */
if (! s_pkg ) return &no_package;
@@ -1747,7 +1748,7 @@ void h248_register_package(h248_package_t* pkg, pkg_reg_action reg_action) {
static guint32 packageandid;
-static int dissect_h248_PkgdName(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index) {
+static int dissect_h248_PkgdName(bool implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index) {
tvbuff_t *new_tvb = NULL;
proto_tree *package_tree=NULL;
guint16 name_major, name_minor;
@@ -1764,13 +1765,13 @@ static int dissect_h248_PkgdName(gboolean implicit_tag, tvbuff_t *tvb, int offse
pkg = find_package_id(name_major);
/* do the prettification */
proto_item_append_text(actx->created_item, " %s (%04x)",
- val_to_str(0, pkg->param_names, "Unknown Package"),
+ val_to_str_const(0, pkg->param_names, "Unknown Package"),
name_major);
if(tree){
package_tree = proto_item_add_subtree(actx->created_item, ett_packagename);
proto_tree_add_uint_format(package_tree, hf_h248_pkg_name, tvb, offset-4, 2, name_major,
- "PkgName: %s (0x%04x)", val_to_str(0, pkg->param_names, "Unknown Package"), name_major);
+ "PkgName: %s (0x%04x)", val_to_str_const(0, pkg->param_names, "Unknown Package"), name_major);
}
{
@@ -1794,7 +1795,7 @@ static int dissect_h248_PkgdName(gboolean implicit_tag, tvbuff_t *tvb, int offse
return offset;
}
-static int dissect_h248_EventName(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index) {
+static int dissect_h248_EventName(bool implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index) {
tvbuff_t *new_tvb;
proto_tree *package_tree=NULL;
guint16 name_major, name_minor;
@@ -1812,13 +1813,13 @@ static int dissect_h248_EventName(gboolean implicit_tag, tvbuff_t *tvb, int offs
pkg = find_package_id(name_major);
/* do the prettification */
proto_item_append_text(actx->created_item, " %s (%04x)",
- val_to_str(0, pkg->param_names, "Unknown Package"),
+ val_to_str_const(0, pkg->param_names, "Unknown Package"),
name_major);
if(tree){
package_tree = proto_item_add_subtree(actx->created_item, ett_packagename);
}
proto_tree_add_uint_format(package_tree, hf_h248_pkg_name, tvb, offset-4, 2, name_major,
- "%s (0x%04x)", val_to_str(0, pkg->param_names, "Unknown Package"), name_major);
+ "%s (0x%04x)", val_to_str_const(0, pkg->param_names, "Unknown Package"), name_major);
curr_info.pkg = pkg;
@@ -1859,7 +1860,7 @@ static int dissect_h248_EventName(gboolean implicit_tag, tvbuff_t *tvb, int offs
-static int dissect_h248_SignalName(gboolean implicit_tag , tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index) {
+static int dissect_h248_SignalName(bool implicit_tag , tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index) {
tvbuff_t *new_tvb;
proto_tree *package_tree=NULL;
guint16 name_major, name_minor;
@@ -1877,13 +1878,13 @@ static int dissect_h248_SignalName(gboolean implicit_tag , tvbuff_t *tvb, int of
pkg = find_package_id(name_major);
/* do the prettification */
proto_item_append_text(actx->created_item, " %s (%04x)",
- val_to_str(0, pkg->param_names, "Unknown Package"),
+ val_to_str_const(0, pkg->param_names, "Unknown Package"),
name_major);
if(tree){
package_tree = proto_item_add_subtree(actx->created_item, ett_packagename);
}
proto_tree_add_uint_format(package_tree, hf_h248_pkg_name, tvb, offset-4, 2, name_major,
- "%s (0x%04x)", val_to_str(0, pkg->param_names, "Unknown Package"), name_major);
+ "%s (0x%04x)", val_to_str_const(0, pkg->param_names, "Unknown Package"), name_major);
if (pkg->signals) {
for (sig = pkg->signals; sig->hfid; sig++) {
@@ -1922,10 +1923,10 @@ static int dissect_h248_SignalName(gboolean implicit_tag , tvbuff_t *tvb, int of
return offset;
}
-static int dissect_h248_PropertyID(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) {
+static int dissect_h248_PropertyID(bool implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) {
gint8 ber_class;
- gboolean pc, ind;
+ bool pc, ind;
gint32 tag;
guint32 len;
guint16 name_minor;
@@ -1969,7 +1970,7 @@ static int dissect_h248_PropertyID(gboolean implicit_tag _U_, tvbuff_t *tvb, int
-static int dissect_h248_SigParameterName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) {
+static int dissect_h248_SigParameterName(bool implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) {
tvbuff_t *next_tvb;
guint32 param_id = 0xffffffff;
const h248_pkg_param_t* sigpar;
@@ -2009,10 +2010,10 @@ static int dissect_h248_SigParameterName(gboolean implicit_tag _U_, tvbuff_t *tv
return offset;
}
-static int dissect_h248_SigParamValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) {
+static int dissect_h248_SigParamValue(bool implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) {
int end_offset;
gint8 ber_class;
- gboolean pc, ind;
+ bool pc, ind;
gint32 tag;
guint32 len;
tvbuff_t *next_tvb = NULL;
@@ -2037,12 +2038,12 @@ static int dissect_h248_SigParamValue(gboolean implicit_tag _U_, tvbuff_t *tvb,
return end_offset;
}
-static int dissect_h248_SigParamValueV1(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) {
+static int dissect_h248_SigParamValueV1(bool implicit_tag _U_, tvbuff_t *tvb, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) {
return dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, NULL);
}
-static int dissect_h248_EventParameterName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) {
+static int dissect_h248_EventParameterName(bool implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) {
tvbuff_t *next_tvb;
guint32 param_id = 0xffffffff;
const h248_pkg_param_t* evtpar;
@@ -2088,11 +2089,11 @@ static int dissect_h248_EventParameterName(gboolean implicit_tag _U_, tvbuff_t *
return offset;
}
-static int dissect_h248_EventParamValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) {
+static int dissect_h248_EventParamValue(bool implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) {
tvbuff_t *next_tvb;
int end_offset;
gint8 ber_class;
- gboolean pc, ind;
+ bool pc, ind;
gint32 tag;
guint32 len;
@@ -2116,12 +2117,12 @@ static int dissect_h248_EventParamValue(gboolean implicit_tag _U_, tvbuff_t *tvb
return end_offset;
}
-static int dissect_h248_EventParamValueV1(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) {
+static int dissect_h248_EventParamValueV1(bool implicit_tag _U_, tvbuff_t *tvb, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) {
return dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, &tvb);
}
-static int dissect_h248_MtpAddress(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index) {
+static int dissect_h248_MtpAddress(bool implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index) {
tvbuff_t *new_tvb;
proto_tree *mtp_tree=NULL;
guint32 val;
@@ -2362,7 +2363,7 @@ void proto_register_h248(void) {
expert_h248 = expert_register_protocol(proto_h248);
expert_register_field_array(expert_h248, ei, array_length(ei));
- subdissector_table = register_dissector_table("h248.magic_num", "H248 Magic Num", proto_h248, FT_UINT32, BASE_HEX);
+ subdissector_table = register_dissector_table("h248.magic_num", "H.248 Magic Num", proto_h248, FT_UINT32, BASE_HEX);
h248_module = prefs_register_protocol(proto_h248, NULL);
prefs_register_bool_preference(h248_module, "ctx_info",