From 40abd362d29182cc6f4542ef0081df3774515ce7 Mon Sep 17 00:00:00 2001 From: Karl Knutsson Date: Thu, 24 Aug 2023 15:35:16 +0200 Subject: [PATCH 1/2] Update dissector for peer sharing Update dissector for the peer sharing protocol. --- .../wireshark-plugin/ouroboros_network.lua | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/ouroboros-network/wireshark-plugin/ouroboros_network.lua b/ouroboros-network/wireshark-plugin/ouroboros_network.lua index 86d1d7dc895..640c1d71957 100644 --- a/ouroboros-network/wireshark-plugin/ouroboros_network.lua +++ b/ouroboros-network/wireshark-plugin/ouroboros_network.lua @@ -22,7 +22,9 @@ local conv_ids = { [0x8004] = "TxSubmission Responder", [0x0004] = "TxSubmission Initiator", [0x8008] = "KeepAlive Responder", - [0x0008] = "KeepAlive Initiator" + [0x0008] = "KeepAlive Initiator", + [0x800a] = "Peer Sharing Responder", + [0x000a] = "Peer Sharing Initiator" } local on_conversation = ProtoField.uint16("ouroboros.conv", "Conversation", base.HEX, conv_ids, nil, "Conversation ids") @@ -81,6 +83,14 @@ local keepalive_msg_codes = { local on_keepalive_msg = ProtoField.uint8("ouroboros.keepalivemsg", "KeepAlive Message", base.DEC, keepalive_msg_codes, nil, "KeepAlive Message Types") +local peersharing_msg_codes = { + [0] = "MsgShareRequest", + [1] = "MsgSharePeers", + [2] = "MsgDone" +} + +local on_peersharing_msg = ProtoField.uint8("ouroboros.peersharingmsg", "PeerSharing Message", base.DEC, peersharing_msg_codes, nil, "PeerSharing Message Types") + ouroboros.fields = { on_transmission_time, @@ -90,7 +100,8 @@ ouroboros.fields = { on_chainsync_msg, on_blockfetch_msg, on_txsubmission_msg, - on_keepalive_msg + on_keepalive_msg, + on_peersharing_msg } @@ -151,6 +162,7 @@ dissectOuroboros = function (tvbuf, pktinfo, root, offset) elseif convId == 3 then subtree:add(on_blockfetch_msg, tvbuf:range(offset + 9, 1)) elseif convId == 4 then subtree:add(on_txsubmission_msg, tvbuf:range(offset + 9, 1)) elseif convId == 8 then subtree:add(on_keepalive_msg, tvbuf:range(offset + 9, 1)) + elseif convId == 10 then subtree:add(on_peersharing_msg, tvbuf:range(offset + 9, 1)) end cbor:call(tvbuf(ON_HDR_LEN):tvb(), pktinfo, subtree) From fb1c1da3fc45a8f7b6612ba8a0c0da7066efccd0 Mon Sep 17 00:00:00 2001 From: Karl Knutsson Date: Thu, 24 Aug 2023 15:36:42 +0200 Subject: [PATCH 2/2] update changelog --- ouroboros-network/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/ouroboros-network/CHANGELOG.md b/ouroboros-network/CHANGELOG.md index d9dc3b4b811..2f5a7ef870d 100644 --- a/ouroboros-network/CHANGELOG.md +++ b/ouroboros-network/CHANGELOG.md @@ -7,6 +7,7 @@ ### Non-breaking changes * Less aggresive churning of established and known peers. +* Add peer sharing to wireshark dissector. ## 0.9.1.0 -- 2023-08-22