From ce1fb356f38439df64ad1bdcafaade20b1a54d44 Mon Sep 17 00:00:00 2001 From: emanuele-f Date: Thu, 15 Aug 2019 18:13:59 +0200 Subject: [PATCH] Add dissector port note --- wireshark/README.md | 2 ++ wireshark/n2n.lua | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/wireshark/README.md b/wireshark/README.md index 26c5e40..4c0b6fd 100644 --- a/wireshark/README.md +++ b/wireshark/README.md @@ -5,3 +5,5 @@ Quick load: ``` wireshark -X lua_script:n2n.lua ``` + +NOTE: the dissector only decodes traffic on UDP port 50001. In order to decode n2n traffic on another UDP port you can use the "Decode As..." function of wireshark. diff --git a/wireshark/n2n.lua b/wireshark/n2n.lua index 954be5e..ff45341 100644 --- a/wireshark/n2n.lua +++ b/wireshark/n2n.lua @@ -1,6 +1,6 @@ -- (C) 2019 - ntop.org and contributors -n2n_protocol = Proto("n2n", "n2n Protocol") +n2n = Proto("n2n", "n2n Protocol") -- ############################################# @@ -107,7 +107,7 @@ register_super_ack_num_sn = ProtoField.uint8("n2n.register_super_ack.num_sn", "N -- ############################################# -n2n_protocol.fields = { +n2n.fields = { version, ttl, packet_type, flags, from_supernode_flag, socket_flag, options_flag, community, @@ -267,14 +267,14 @@ end -- ############################################# -function n2n_protocol.dissector(buffer, pinfo, tree) +function n2n.dissector(buffer, pinfo, tree) local length = buffer:len() if length < 20 then return end - pinfo.cols.protocol = n2n_protocol.name + pinfo.cols.protocol = n2n.name local pkt_type = bit.band(buffer(2,2):uint(), packet_type_mask) - local subtree = tree:add(n2n_protocol, buffer(), string.format("n2n Protocol, Type: %s", pkt_type_2_str[pkt_type] or "Unknown")) + local subtree = tree:add(n2n, buffer(), string.format("n2n Protocol, Type: %s", pkt_type_2_str[pkt_type] or "Unknown")) -- Common subtree:add(version, buffer(0,1)) @@ -313,4 +313,4 @@ end -- ############################################# local udp_port = DissectorTable.get("udp.port") -udp_port:add(15015, n2n_protocol) +udp_port:add(50001, n2n)