Skip to content

Instantly share code, notes, and snippets.

@thomasives
Created April 3, 2023 12:13
Show Gist options
  • Save thomasives/362501b883edfcede29c6d49766ae4b2 to your computer and use it in GitHub Desktop.
Save thomasives/362501b883edfcede29c6d49766ae4b2 to your computer and use it in GitHub Desktop.
pva.lua patch
diff --git a/pva.lua b/home/tri/.config/wireshark/pva.lua
index f3030e2..9b6ec6a 100644
--- a/pva.lua
+++ b/home/tri/.config/wireshark/pva.lua
@@ -103,6 +103,7 @@ local fsearch_mask = ProtoField.uint8("pva.mask", "Mask", base.HEX)
local fsearch_mask_repl = ProtoField.uint8("pva.reply", "Reply", base.HEX, {[0]="Optional",[1]="Required"}, 0x01)
local fsearch_mask_bcast = ProtoField.uint8("pva.ucast", "Reply", base.HEX, {[0]="Broadcast",[1]="Unicast"}, 0x80)
local fsearch_proto = ProtoField.string("pva.proto", "Transport Protocol")
+local fsearch_count = ProtoField.uint16("pva.count", "Count")
local fsearch_cid = ProtoField.uint32("pva.cid", "CID")
local fsearch_name = ProtoField.string("pva.pv", "Name")
@@ -115,7 +116,7 @@ pva.fields = {
fbeacon_seq, fbeacon_change,
fvalid_bsize, fvalid_isize, fvalid_qos, fvalid_authz,
fsearch_seq, fsearch_addr, fsearch_port, fsearch_mask, fsearch_mask_repl, fsearch_mask_bcast,
- fsearch_proto, fsearch_cid, fsearch_name,
+ fsearch_proto, fsearch_count, fsearch_cid, fsearch_name,
fsearch_found,
}
@@ -395,6 +396,7 @@ local function pva_client_search (buf, pkt, t, isbe, cmd)
else
npv = buf(0,2):le_uint()
end
+ t:add(fsearch_count, npv);
if npv>0 then
buf = buf(2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment