Skip to content

Commit 492d7c7

Browse files
committed
add search reply-to-source-port flag
1 parent 43740f2 commit 492d7c7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pva.lua

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ local fsearch_addr = ProtoField.bytes("pva.addr", "Address")
101101
local fsearch_port = ProtoField.uint16("pva.port", "Port")
102102
local fsearch_mask = ProtoField.uint8("pva.mask", "Mask", base.HEX)
103103
local fsearch_mask_repl = ProtoField.uint8("pva.reply", "Reply", base.HEX, {[0]="Optional",[1]="Required"}, 0x01)
104+
local fsearch_mask_port = ProtoField.uint8("pva.reply_port", "ReplySrcPort", base.HEX, {[0]="Use Field",[1]="Use Source"}, 0x02)
104105
local fsearch_mask_bcast = ProtoField.uint8("pva.ucast", "Reply", base.HEX, {[0]="Broadcast",[1]="Unicast"}, 0x80)
105106
local fsearch_proto = ProtoField.string("pva.proto", "Transport Protocol")
106107
local fsearch_count = ProtoField.uint16("pva.count", "PV Count")
@@ -115,7 +116,7 @@ pva.fields = {
115116
fcid, fsid, fioid, fsubcmd, fsubcmd_proc, fsubcmd_init, fsubcmd_dstr, fsubcmd_get, fsubcmd_gtpt, fstatus,
116117
fbeacon_seq, fbeacon_change,
117118
fvalid_bsize, fvalid_isize, fvalid_qos, fvalid_authz,
118-
fsearch_seq, fsearch_addr, fsearch_port, fsearch_mask, fsearch_mask_repl, fsearch_mask_bcast,
119+
fsearch_seq, fsearch_addr, fsearch_port, fsearch_mask, fsearch_mask_repl, fsearch_mask_port, fsearch_mask_bcast,
119120
fsearch_proto, fsearch_count, fsearch_cid, fsearch_name,
120121
fsearch_found,
121122
}
@@ -379,9 +380,13 @@ local function pva_client_search (buf, pkt, t, isbe, cmd)
379380
t:add(fsearch_seq, buf(0,4), seq)
380381
local mask = t:add(fsearch_mask, buf(4,1))
381382
mask:add(fsearch_mask_repl, buf(4,1))
383+
mask:add(fsearch_mask_port, buf(4,1))
382384
mask:add(fsearch_mask_bcast, buf(4,1))
383385
t:add(fsearch_addr, buf(8,16))
384-
t:add(fsearch_port, buf(24,2), port)
386+
local f_port = t:add(fsearch_port, buf(24,2), port)
387+
if bit.band(buf(4,1):uint(), 0x02) then
388+
f_port:append_text(" (effective "..pkt.src_port..")")
389+
end
385390

386391
local nproto, npv
387392

0 commit comments

Comments
 (0)