开发者

How access other layers field in Lua tap listener or tap higher layer?

开发者 https://www.devze.com 2023-02-07 04:24 出处:网络
Going to do some statistics operation on a trace with Lua.开发者_运维知识库 Each IP packet can have multiple TCAP and each TCAP may have multiple CAP operation, like

Going to do some statistics operation on a trace with Lua.开发者_运维知识库 Each IP packet can have multiple TCAP and each TCAP may have multiple CAP operation, like

IP {[SCTP-M3UA-SCCP-TCAP-CAP,CAP] [SCTP-M3UA-SCCP-TCAP-CAP,CAP,CAP]}

Now I want to access the whole tree or iterate somehow in TCAP layer in Lua listener tap. The purpose of this kind of iteration is that something like follow TCP stream because the transaction ID is kept in TCAP layer while operation and parameters in sequence of Camel (CAP) layer should be considered.

How can I access the dissector tree in listener tap or dissect upper layer if get the lower layer data part ?

For example the node ID come in first operation of 1 new session in highest layer(CAP) along with another sessions in same packet. Then another parameter that needed to be counted comes in another operation/packet, while same TID in TCAP to be checked to be sure on it belongs to same node.


It is not a reply to your question, only tip.

You should use array for fields extractor instead of plain value. For example:

tap_diameter = nil
diaSessionIdExtr = Field.new("diameter.Session-Id")
tap_diameter = Listener.new("frame", "diameter && !tcp.analysis.retransmission && !tcp.analysis.lost_segment")

function tap_diameter.packet(pinfo,tvb,userdata)
    local answers = {diaSessionIdExtr()}  -- this is how to do it
    for i in pairs(answers) do
       debug(answers[i])
    end
end
0

精彩评论

暂无评论...
验证码 换一张
取 消