John Zwinckの言葉通り、あなたはおそらく、LuaまたはCのどちらかでかなり簡単に管理できる連鎖型のディセクタのようなものを望むでしょう。そのためには、あなたのロジックをディセクタとして実装したいのは間違いありません。 Luaのでは、このような何か:
do
--TODO set up your extra "data" field
local tcp_table = DissectorTable.get("tcp.port")
local third_party_dissector tcp_table:get_dissector(PROTO_PORT)
function your_protocol.dissector(tvb, pinfo, tree)
--call the third party dissector
third_party_dissector:call(tvb, pinfo, tree)
--TODO do what you need with the data
end
--take over the port your protocol runs over
tcp_table_add(PROTO_PORT, your_protocol)
end
手にAPIをしてください、しかし、WiresharkのでLuaの解剖がちょうどプロトタイピングのために実際にあることも覚えておいてください。同等のCベースのディセプタよりも効率が悪く、APIはC解剖APIの後ろにいくつかのバージョンに遅れがちです。
WiresharkのQ&Aサイトhttp://ask.wireshark.org/ – sylvanaar