Skip to content

Commit

Permalink
Create a version that compiles with Wireshark v.2.2 (original code on…
Browse files Browse the repository at this point in the history
…ly works with v2.3+)

 - Switch ENC_TIME_SECS to ENC_TIME_TIMESPEC
 - Change dissector_add_for_decode_as_with_preference to issector_add_for_decode_as
  • Loading branch information
thephez committed Jun 8, 2017
1 parent b362a8e commit 5e2e2a6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions plugins/dash/packet-dash.c
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,7 @@ dissect_dash_msg_addr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, v
ti = proto_tree_add_item(tree, &hfi_msg_addr_address, tvb, offset, 30, ENC_NA);
subtree = create_address_tree(tvb, ti, offset+4);

proto_tree_add_item(subtree, &hfi_msg_addr_timestamp, tvb, offset, 4, ENC_TIME_SECS|ENC_LITTLE_ENDIAN);
proto_tree_add_item(subtree, &hfi_msg_addr_timestamp, tvb, offset, 4, ENC_TIME_TIMESPEC|ENC_LITTLE_ENDIAN);
offset += 26;
offset += 4;
}
Expand Down Expand Up @@ -1484,7 +1484,7 @@ dissect_dash_msg_block(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
proto_tree_add_item(tree, &hfi_msg_block_merkle_root, tvb, offset, 32, ENC_NA);
offset += 32;

proto_tree_add_item(tree, &hfi_msg_block_time, tvb, offset, 4, ENC_TIME_SECS|ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, &hfi_msg_block_time, tvb, offset, 4, ENC_TIME_TIMESPEC|ENC_LITTLE_ENDIAN);
offset += 4;

proto_tree_add_item(tree, &hfi_msg_block_bits, tvb, offset, 4, ENC_LITTLE_ENDIAN);
Expand Down Expand Up @@ -1545,7 +1545,7 @@ dissect_dash_msg_headers(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree
proto_tree_add_item(subtree, &hfi_msg_headers_merkle_root, tvb, offset, 32, ENC_NA);
offset += 32;

proto_tree_add_item(subtree, &hfi_msg_headers_time, tvb, offset, 4, ENC_TIME_SECS|ENC_LITTLE_ENDIAN);
proto_tree_add_item(subtree, &hfi_msg_headers_time, tvb, offset, 4, ENC_TIME_TIMESPEC|ENC_LITTLE_ENDIAN);
offset += 4;

proto_tree_add_item(subtree, &hfi_msg_headers_bits, tvb, offset, 4, ENC_LITTLE_ENDIAN);
Expand Down Expand Up @@ -1698,7 +1698,7 @@ dissect_dash_msg_merkleblock(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
proto_tree_add_item(tree, &hfi_msg_merkleblock_merkle_root, tvb, offset, 32, ENC_NA);
offset += 32;

proto_tree_add_item(tree, &hfi_msg_merkleblock_time, tvb, offset, 4, ENC_TIME_SECS|ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, &hfi_msg_merkleblock_time, tvb, offset, 4, ENC_TIME_TIMESPEC|ENC_LITTLE_ENDIAN);
offset += 4;

proto_tree_add_item(tree, &hfi_msg_merkleblock_bits, tvb, offset, 4, ENC_LITTLE_ENDIAN);
Expand Down Expand Up @@ -2620,7 +2620,8 @@ proto_reg_handoff_dash(void)
{
dissector_handle_t command_handle;

dissector_add_for_decode_as_with_preference("tcp.port", dash_handle);
//dissector_add_for_decode_as_with_preference("tcp.port", dash_handle); // Only works with Wireshark v2.3+
dissector_add_for_decode_as("tcp.port", dash_handle);

heur_dissector_add( "tcp", dissect_dash_heur, "Dash over TCP", "dash_tcp", hfi_dash->id, HEURISTIC_ENABLE);

Expand Down

0 comments on commit 5e2e2a6

Please sign in to comment.