/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
-/* .\packet-h248.c */
+/* ./packet-h248.c */
/* ../../tools/asn2wrs.py -b -e -p h248 -c h248.cnf -s packet-h248-template h248v3.asn */
/* Input file: packet-h248-template.c */
*/
#include "packet-h248.h"
+#include "packet-tpkt.h"
#define PNAME "H.248 MEGACO"
#define PSNAME "H248"
#define GATEWAY_CONTROL_PROTOCOL_USER_ID 14
+
/* Initialize the protocol and registered fields */
static int proto_h248 = -1;
static int hf_h248_mtpaddress_ni = -1;
static int hf_h248_NotifyCompletion_onIteration = -1;
/*--- End of included file: packet-h248-hf.c ---*/
-#line 72 "packet-h248-template.c"
+#line 74 "packet-h248-template.c"
/* Initialize the subtree pointers */
static gint ett_h248 = -1;
static gint ett_h248_Value = -1;
/*--- End of included file: packet-h248-ett.c ---*/
-#line 91 "packet-h248-template.c"
+#line 93 "packet-h248-template.c"
static dissector_handle_t h248_term_handle;
static gboolean h248_prefs_initialized = FALSE;
static gboolean keep_persistent_data = FALSE;
-static guint32 udp_port = 0;
-static guint32 temp_udp_port = 0;
+static guint32 udp_port = 2945;
+static guint32 temp_udp_port = 2945;
+static guint32 tcp_port = 2945;
+static guint32 temp_tcp_port = 2945;
+static gboolean h248_desegment = TRUE;
+
static proto_tree *h248_tree;
static dissector_handle_t h248_handle;
static dissector_handle_t h248_term_handle;
+static dissector_handle_t h248_tpkt_handle;
static const value_string term_types[] = {
{ H248_TERM_TYPE_AAL1, "aal1" },
/*--- End of included file: packet-h248-fn.c ---*/
-#line 1845 "packet-h248-template.c"
+#line 1852 "packet-h248-template.c"
+
+static void dissect_h248_tpkt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
+ dissect_tpkt_encap(tvb, pinfo, tree, h248_desegment, h248_handle);
+}
static void
dissect_h248(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
} else {
if ( udp_port )
dissector_delete("udp.port", udp_port, h248_handle);
+
+ if ( tcp_port)
+ dissector_delete("tcp.port", tcp_port, h248_tpkt_handle);
}
udp_port = temp_udp_port;
-
+ tcp_port = temp_tcp_port;
+
if ( udp_port ) {
dissector_add("udp.port", udp_port, h248_handle);
}
+ if ( tcp_port) {
+ dissector_add("tcp.port", tcp_port, h248_tpkt_handle);
+ }
}
/*--- proto_register_h248 ----------------------------------------------*/
"", HFILL }},
/*--- End of included file: packet-h248-hfarr.c ---*/
-#line 1990 "packet-h248-template.c"
+#line 2008 "packet-h248-template.c"
{ &hf_h248_ctx, { "Context", "h248.ctx", FT_UINT32, BASE_HEX, NULL, 0, "", HFILL }},
{ &hf_h248_ctx_term, { "Termination", "h248.ctx.term", FT_STRING, BASE_NONE, NULL, 0, "", HFILL }},
&ett_h248_Value,
/*--- End of included file: packet-h248-ettarr.c ---*/
-#line 2015 "packet-h248-template.c"
+#line 2033 "packet-h248-template.c"
};
module_t *h248_module;
/* Register protocol */
proto_h248 = proto_register_protocol(PNAME, PSNAME, PFNAME);
register_dissector("h248", dissect_h248, proto_h248);
+ register_dissector("h248.tpkt", dissect_h248_tpkt, proto_h248);
/* Register fields and subtrees */
proto_register_field_array(proto_h248, hf, array_length(hf));
"Port to be decoded as h248",
10,
&temp_udp_port);
-
+ prefs_register_uint_preference(h248_module, "tcp_port",
+ "TCP port",
+ "Port to be decoded as h248",
+ 10,
+ &temp_tcp_port);
+ prefs_register_bool_preference(h248_module, "desegment",
+ "Desegment H.248 over TCP",
+ "Desegment H.248 messages that span more TCP segments",
+ &h248_desegment);
+
+
register_init_routine( &h248_init );
msgs = se_tree_create(EMEM_TREE_TYPE_RED_BLACK, "h248_msgs");
h248_handle = find_dissector("h248");
h248_term_handle = find_dissector("h248term");
+ h248_tpkt_handle = find_dissector("h248.tpkt");
dissector_add("mtp3.service_indicator", GATEWAY_CONTROL_PROTOCOL_USER_ID, h248_handle);
dissector_add("sctp.ppi", H248_PAYLOAD_PROTOCOL_ID, h248_handle);
dissector_add("udp.port", udp_port, h248_handle);
+ dissector_add("tcp.port", tcp_port, h248_tpkt_handle);
}