diff --git a/README.md b/README.md index b8d2da8..b9bbb65 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # 🔍 Wireshark dissectors for Ethereum devp2p protocols -This repo contains a set of network protocol dissectors for Ethereum that you can load into the widely popular Wireshark to begin inspecting Ethereum traffic. +This repo contains a set of network protocol dissectors for Ethereum that you can load into the widely popular Wireshark to begin inspecting Ethereum traffic. -Currently we support the UDP-based discovery protocol, but support for the RLPx Wire protocol and the ETH subprotocol are in the works. +Currently we support the UDP-based discovery protocol, but support for the RLPx Wire protocol and the ETH subprotocol are in the works.

Ethereum discovery dissector demo @@ -46,8 +46,8 @@ Here are the features currently supported by the Ethereum Discovery dissector (w ``` $ cd ${WIRESHARK_SRC} -$ # check out the latest 2.6 tag (could be higher) -$ git checkout wireshark-2.6.2 +$ # check out the latest 3.2 tag (could be higher) +$ git checkout wireshark-3.2.1 $ mkdir ../wireshark-ninja $ cd ../wireshark-ninja $ cmake -G Ninja ../wireshark @@ -82,7 +82,7 @@ Ordered alphabetically by surname. In the Protocol Engineering Groups and Systems team (PegaSys) at ConsenSys, we specialise in the low-level, deep aspects of the Ethereum technology. Some of the challenges we tackle are: scalability, secrecy, modularity, finality, permissioning, etc. -To perform our job we need tooling to x-ray into different parts of the system. One of those parts is the networking layer. No central authority exists in public chain Ethereum, hence all communication is peer-to-peer (P2P), which gives rise to both RPC-style and gossip-like communication patterns we need full insight of during development, research and testing. +To perform our job we need tooling to x-ray into different parts of the system. One of those parts is the networking layer. No central authority exists in public chain Ethereum, hence all communication is peer-to-peer (P2P), which gives rise to both RPC-style and gossip-like communication patterns we need full insight of during development, research and testing. [devp2p](https://github.com/ethereum/devp2p) is the name of the networking subsystem of Ethereum, along with its collection of core protocols on top of which subprotocols like ETH, Whisper, Swarm, Light Ethereum, etc. are layered. @@ -94,7 +94,7 @@ Unfortunately no Wireshark dissectors exist yet for Ethereum devp2p protocols. T PegaSys logo -PegaSys’ mission is to build blockchain solutions ready for production in business environments. We are committed to open source, and are creating a framework for collaborative innovation for the public-chain community and leading enterprises. +PegaSys’ mission is to build blockchain solutions ready for production in business environments. We are committed to open source, and are creating a framework for collaborative innovation for the public-chain community and leading enterprises. Our team is composed of engineers leading in the areas of big data processing, applied cryptography, open source computing, cloud services, and blockchain development. diff --git a/packet-ethereum-disc.c b/packet-ethereum-disc.c index e8aab4b..494fcb4 100644 --- a/packet-ethereum-disc.c +++ b/packet-ethereum-disc.c @@ -1032,7 +1032,7 @@ static gboolean dissect_ethereum_heur(tvbuff_t *tvb, packet_info *pinfo, proto_t * @param st Statistics tree. */ static void ethereum_discovery_stats_tree_init(stats_tree *st) { - st_node_packets = stats_tree_create_node(st, st_str_packets, 0, TRUE); + st_node_packets = stats_tree_create_node(st, st_str_packets, 0, STAT_DT_INT, TRUE); st_node_packet_types = stats_tree_create_pivot(st, st_str_packet_types, st_node_packets); st_node_packet_nodes_count = stats_tree_create_range_node(st, st_str_packet_nodecount, 0, "0-5", "6-10", "11-", NULL); @@ -1045,9 +1045,9 @@ static void ethereum_discovery_stats_tree_init(stats_tree *st) { * @param pinfo The packet info. * @param edt Data about the dissection. * @param p A pointer to the statistics struct. - * @return TRUE if successful; FALSE otherwise. + * @return TAP_PACKET_REDRAW if successful; TAP_PACKET_FAILED otherwise. */ -static int ethereum_discovery_stats_tree_packet(stats_tree *st, +static tap_packet_status ethereum_discovery_stats_tree_packet(stats_tree *st, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *p) { @@ -1058,7 +1058,7 @@ static int ethereum_discovery_stats_tree_packet(stats_tree *st, if (stat->packet_type == NODES) { stats_tree_tick_range(st, st_str_packet_nodecount, 0, stat->node_count); } - return TRUE; + return TAP_PACKET_REDRAW; } /** @@ -1074,14 +1074,11 @@ static void register_ethereum_stat_trees(void) { * * @param srt Data about the registration. * @param srt_array The array of SRT tables. - * @param gui_callback GUI callback. - * @param gui_data GUI data. */ -static void ethereum_srt_table_init(struct register_srt *srt _U_, GArray *srt_array, - srt_gui_init_cb gui_callback, void *gui_data) { +static void ethereum_srt_table_init(struct register_srt *srt _U_, GArray *srt_array) { srt_stat_table *eth_srt_table; eth_srt_table = init_srt_table("Ethereum discovery packets", NULL, srt_array, 2, - NULL, NULL, gui_callback, gui_data, NULL); + NULL, NULL, NULL); init_srt_table_row(eth_srt_table, 0, "PING->PONG response time"); init_srt_table_row(eth_srt_table, 1, "FIND_NODE->NODES response time"); } @@ -1094,9 +1091,9 @@ static void ethereum_srt_table_init(struct register_srt *srt _U_, GArray *srt_ar * @param pinfo The packet info. * @param edt Dissection data. * @param prv A pointer to the statistics struct. - * @return TRUE if successful; FALSE otherwise. + * @return TAP_PACKET_REDRAW if successful; TAP_PACKET_FAILED otherwise. */ -static int ethereum_srt_table_packet(void *pss, +static tap_packet_status ethereum_srt_table_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const void *prv) { @@ -1104,11 +1101,11 @@ static int ethereum_srt_table_packet(void *pss, srt_data_t *data = (srt_data_t *) pss; const ethereum_disc_stat_t *stat = (const ethereum_disc_stat_t *) prv; if (!stat || stat->is_request || !(stat->has_request)) { - return FALSE; + return TAP_PACKET_FAILED; } eth_srt_table = g_array_index(data->srt_array, srt_stat_table*, 0); add_srt_table_data(eth_srt_table, (stat->packet_type - 1) / 2, &stat->rq_time, pinfo); - return TRUE; + return TAP_PACKET_REDRAW; } /**