aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-optommp.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-optommp.c')
-rw-r--r--epan/dissectors/packet-optommp.c47
1 files changed, 24 insertions, 23 deletions
diff --git a/epan/dissectors/packet-optommp.c b/epan/dissectors/packet-optommp.c
index 779a426ba2..e6d838a434 100644
--- a/epan/dissectors/packet-optommp.c
+++ b/epan/dissectors/packet-optommp.c
@@ -26,26 +26,26 @@
#define OPTOMMP_READ_BLOCK_RESPONSE 7
/* Initialize the protocol and registered fields */
-static gint proto_optommp = -1;
+static gint proto_optommp;
static dissector_handle_t optommp_tcp_handle;
static dissector_handle_t optommp_udp_handle;
-static gint hf_optommp_nodest_id = -1;
-static gint hf_optommp_dest_id = -1;
-static gint hf_optommp_boot_id = -1;
-static gint hf_optommp_tl = -1;
-static gint hf_optommp_tcode = -1;
-static gint hf_optommp_source_ID = -1;
-static gint hf_optommp_rcode = -1;
-static gint hf_optommp_quadlet_data = -1;
-static gint hf_optommp_data_length = -1;
-static gint hf_optommp_dest_offset = -1;
-static gint hf_optommp_data_block_byte = -1;
-static gint hf_optommp_data_block_quadlet = -1;
+static gint hf_optommp_nodest_id;
+static gint hf_optommp_dest_id;
+static gint hf_optommp_boot_id;
+static gint hf_optommp_tl;
+static gint hf_optommp_tcode;
+static gint hf_optommp_source_ID;
+static gint hf_optommp_rcode;
+static gint hf_optommp_quadlet_data;
+static gint hf_optommp_data_length;
+static gint hf_optommp_dest_offset;
+static gint hf_optommp_data_block_byte;
+static gint hf_optommp_data_block_quadlet;
/* Initialize the subtree pointers */
-static gint ett_optommp = -1;
-static gint ett_dest_id = -1;
-static gint ett_data_block_q = -1;
-static gint ett_data_block_b = -1;
+static gint ett_optommp;
+static gint ett_dest_id;
+static gint ett_data_block_q;
+static gint ett_data_block_b;
static const value_string optommp_tcode_names[] = {
{ 0, "Write Quadlet Request" },
@@ -207,7 +207,7 @@ static const range_string optommp_mm_areas[] = {
"Public I/O Tag Configuration (Channels 0-31) - Read/Write" },
{ 0xF2290000, 0xF2295FFF,
"Public Tag Revision Number" },
- { 0xF2293000, 0xF228FFFF,
+ { 0xF2293000, 0xF229FFFF,
"Public PID Tag Configuration" },
{ 0xF22A0000, 0xF22AFFFF,
"Public I/O Tag Configuration (Channels 32-63) - Read/Write" },
@@ -377,7 +377,7 @@ static gint dissect_optommp(tvbuff_t *tvb, packet_info *pinfo, proto_tree
guint64 destination_offset = 0;
destination_offset = tvb_get_ntoh48(tvb, 6);
col_add_fstr(pinfo->cinfo, COL_INFO,
- " type: %s, dest_off: 0x%012" G_GINT64_MODIFIER "x",
+ " type: %s, dest_off: 0x%012" PRIx64,
val_to_str(tcode, optommp_tcode_names, "Unknown (0x%02x)"),
destination_offset);
}
@@ -408,7 +408,7 @@ static gint dissect_optommp(tvbuff_t *tvb, packet_info *pinfo, proto_tree
guint64 destination_offset = 0;
destination_offset = tvb_get_ntoh48(tvb, 6);
proto_item_append_text(root_ti,
- ", dest_off: 0x%012" G_GINT64_MODIFIER "x",
+ ", dest_off: 0x%012" PRIx64,
destination_offset);
}
/* Add an expansion to the tree */
@@ -911,6 +911,10 @@ void proto_register_optommp(void)
proto_optommp = proto_register_protocol("OptoMMP", "OptoMMP", "optommp");
proto_register_field_array(proto_optommp, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
+
+ /* The dissectors */
+ optommp_tcp_handle = register_dissector("optommp.tcp", dissect_optommp_reassemble_tcp, proto_optommp);
+ optommp_udp_handle = register_dissector("optommp.udp", dissect_optommp_reassemble_udp, proto_optommp);
}
/****************************************************************************
@@ -920,9 +924,6 @@ purpose: plug into wireshark with a handle
****************************************************************************/
void proto_reg_handoff_optommp(void)
{
- optommp_tcp_handle = create_dissector_handle(dissect_optommp_reassemble_tcp, proto_optommp);
- optommp_udp_handle = create_dissector_handle(dissect_optommp_reassemble_udp, proto_optommp);
-
dissector_add_for_decode_as_with_preference("tcp.port", optommp_tcp_handle);
dissector_add_for_decode_as_with_preference("udp.port", optommp_udp_handle);
}