Skip to content

Commit

Permalink
feat: support bolt lua script parse mutil-port (#353)
Browse files Browse the repository at this point in the history
  • Loading branch information
alpha-baby authored Jun 27, 2024
1 parent 1e3d89d commit 12ef565
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
14 changes: 14 additions & 0 deletions plugins/wireshark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,17 @@ For advanced usage, you can search for any property under the bolt protocol, suc
```
bolt.trace_id == 0bxxxx335162832343267634611586
```

如果你想此 bolt 协议的解析脚本去解析更多的端口那么可以在此处添加更多的端口

If you want the bolt protocol parsing script to parse more ports then you can add more ports here

example:

```lua
local ports = {12200, 12199, 12198}

for _, port in ipairs(ports) do
DissectorTable.get("tcp.port"):add(port, bolt_protocol)
end
```
11 changes: 8 additions & 3 deletions plugins/wireshark/bolt.lua
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,11 @@ function get_status_name(statuscode)
end

-- register our dissector upon tcp port 12200 (default)
bolt_protocol.prefs.port = Pref.uint("Bolt TCP port", 12200)
local tcp_port = DissectorTable.get("tcp.port")
tcp_port:add(bolt_protocol.prefs.port, bolt_protocol)
local ports = {12200}
-- 如果你想此 bolt 协议的解析脚本去解析更多的端口那么可以在此处添加更多的端口
-- If you want the bolt protocol parsing script to parse more ports then you can add more ports here
-- like: local ports = {12200, 12199, 12198}

for _, port in ipairs(ports) do
DissectorTable.get("tcp.port"):add(port, bolt_protocol)
end

0 comments on commit 12ef565

Please sign in to comment.