aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-netsync.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-netsync.c')
-rw-r--r--epan/dissectors/packet-netsync.c93
1 files changed, 46 insertions, 47 deletions
diff --git a/epan/dissectors/packet-netsync.c b/epan/dissectors/packet-netsync.c
index 2e545d4210..fe874a2fa8 100644
--- a/epan/dissectors/packet-netsync.c
+++ b/epan/dissectors/packet-netsync.c
@@ -21,6 +21,8 @@
void proto_register_netsync(void);
void proto_reg_handoff_netsync(void);
+static dissector_handle_t netsync_handle;
+
/*
* See
*
@@ -77,61 +79,61 @@ static const value_string netsync_cmd_vals[] = {
#define NETSNYC_MERKLE_HASH_LENGTH 20
/* Define the monotone netsync proto */
-static int proto_netsync = -1;
+static int proto_netsync;
-static int hf_netsync_version = -1;
-static int hf_netsync_command = -1;
-static int hf_netsync_size = -1;
-static int hf_netsync_data = -1;
-static int hf_netsync_checksum = -1;
+static int hf_netsync_version;
+static int hf_netsync_command;
+static int hf_netsync_size;
+static int hf_netsync_data;
+static int hf_netsync_checksum;
-static int hf_netsync_cmd_done_level = -1;
-static int hf_netsync_cmd_done_type = -1;
+static int hf_netsync_cmd_done_level;
+static int hf_netsync_cmd_done_type;
-static int hf_netsync_cmd_hello_keyname = -1;
-static int hf_netsync_cmd_hello_key = -1;
-static int hf_netsync_cmd_nonce = -1;
+static int hf_netsync_cmd_hello_keyname;
+static int hf_netsync_cmd_hello_key;
+static int hf_netsync_cmd_nonce;
-static int hf_netsync_cmd_anonymous_role = -1;
-static int hf_netsync_cmd_anonymous_collection = -1;
+static int hf_netsync_cmd_anonymous_role;
+static int hf_netsync_cmd_anonymous_collection;
-static int hf_netsync_cmd_send_data_type = -1;
-static int hf_netsync_cmd_send_data_id = -1;
+static int hf_netsync_cmd_send_data_type;
+static int hf_netsync_cmd_send_data_id;
-static int hf_netsync_cmd_error_msg = -1;
+static int hf_netsync_cmd_error_msg;
-static int hf_netsync_cmd_confirm_sig = -1;
+static int hf_netsync_cmd_confirm_sig;
-static int hf_netsync_cmd_auth_role = -1;
-static int hf_netsync_cmd_auth_collection = -1;
-static int hf_netsync_cmd_auth_id = -1;
-static int hf_netsync_cmd_auth_nonce1 = -1;
-static int hf_netsync_cmd_auth_nonce2 = -1;
-static int hf_netsync_cmd_auth_sig = -1;
+static int hf_netsync_cmd_auth_role;
+static int hf_netsync_cmd_auth_collection;
+static int hf_netsync_cmd_auth_id;
+static int hf_netsync_cmd_auth_nonce1;
+static int hf_netsync_cmd_auth_nonce2;
+static int hf_netsync_cmd_auth_sig;
-static int hf_netsync_cmd_data_type = -1;
-static int hf_netsync_cmd_data_id = -1;
-static int hf_netsync_cmd_data_compressed = -1;
-static int hf_netsync_cmd_data_payload = -1;
+static int hf_netsync_cmd_data_type;
+static int hf_netsync_cmd_data_id;
+static int hf_netsync_cmd_data_compressed;
+static int hf_netsync_cmd_data_payload;
-static int hf_netsync_cmd_delta_type = -1;
-static int hf_netsync_cmd_delta_base_id = -1;
-static int hf_netsync_cmd_delta_ident_id = -1;
-static int hf_netsync_cmd_delta_compressed = -1;
-static int hf_netsync_cmd_delta_payload = -1;
+static int hf_netsync_cmd_delta_type;
+static int hf_netsync_cmd_delta_base_id;
+static int hf_netsync_cmd_delta_ident_id;
+static int hf_netsync_cmd_delta_compressed;
+static int hf_netsync_cmd_delta_payload;
-static int hf_netsync_cmd_refine_tree_node = -1;
+static int hf_netsync_cmd_refine_tree_node;
-static int hf_netsync_cmd_send_delta_type = -1;
-static int hf_netsync_cmd_send_delta_base_id = -1;
-static int hf_netsync_cmd_send_delta_ident_id = -1;
+static int hf_netsync_cmd_send_delta_type;
+static int hf_netsync_cmd_send_delta_base_id;
+static int hf_netsync_cmd_send_delta_ident_id;
-static int hf_netsync_cmd_nonexistent_type = -1;
-static int hf_netsync_cmd_nonexistent_id = -1;
+static int hf_netsync_cmd_nonexistent_type;
+static int hf_netsync_cmd_nonexistent_id;
/* Define the tree for netsync */
-static int ett_netsync = -1;
+static int ett_netsync;
/*
@@ -148,7 +150,7 @@ static gint dissect_netsync_cmd_error( tvbuff_t *tvb, gint offset, proto_tree *
offset += tvb_get_varint( tvb, offset, FT_VARINT_MAX_LEN, &len, ENC_VARINT_PROTOBUF );
proto_tree_add_item(tree, hf_netsync_cmd_error_msg, tvb,
- offset, (gint)len, ENC_ASCII|ENC_NA );
+ offset, (gint)len, ENC_ASCII );
offset += (gint)len;
return offset;
@@ -166,7 +168,7 @@ static gint dissect_netsync_cmd_hello(tvbuff_t *tvb, gint offset, proto_tree *t
offset += tvb_get_varint( tvb, offset, FT_VARINT_MAX_LEN, &len, ENC_VARINT_PROTOBUF );
proto_tree_add_item(tree, hf_netsync_cmd_hello_keyname, tvb,
- offset, (gint)len, ENC_ASCII|ENC_NA );
+ offset, (gint)len, ENC_ASCII );
offset += (gint)len;
@@ -193,7 +195,7 @@ static gint dissect_netsync_cmd_anonymous(tvbuff_t *tvb, gint offset, proto_tre
offset += tvb_get_varint( tvb, offset, FT_VARINT_MAX_LEN, &len, ENC_VARINT_PROTOBUF );
proto_tree_add_item(tree, hf_netsync_cmd_anonymous_collection, tvb,
- offset, (gint)len, ENC_ASCII|ENC_NA );
+ offset, (gint)len, ENC_ASCII );
offset += (gint)len;
proto_tree_add_item(tree, hf_netsync_cmd_nonce, tvb,
@@ -215,7 +217,7 @@ static gint dissect_netsync_cmd_auth(tvbuff_t *tvb, gint offset, proto_tree *tr
offset += tvb_get_varint( tvb, offset, FT_VARINT_MAX_LEN, &len, ENC_VARINT_PROTOBUF );
proto_tree_add_item(tree, hf_netsync_cmd_auth_collection, tvb,
- offset, (gint)len, ENC_ASCII|ENC_NA );
+ offset, (gint)len, ENC_ASCII );
offset += (gint)len;
proto_tree_add_item(tree, hf_netsync_cmd_auth_id, tvb,
@@ -708,15 +710,12 @@ proto_register_netsync(void)
" To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
&netsync_desegment);
+ netsync_handle = register_dissector("netsync", dissect_netsync, proto_netsync);
}
void
proto_reg_handoff_netsync(void)
{
- dissector_handle_t netsync_handle;
-
- netsync_handle = create_dissector_handle(dissect_netsync, proto_netsync);
-
dissector_add_uint_with_preference("tcp.port", TCP_PORT_NETSYNC, netsync_handle);
}