在Wireshark GUI中,我们可以将UPD数据包解码为RTP,并且可以使用d <layer type>==<selector>,<decode-as protocol>
在tshark中完成相同的操作
我怎么能在PyShark中做同样的事情?我尝试过以下操作
import pyshark
cap = pyshark.FileCapture("Test.pcap", display filter='udp', decode_as='rtp')
for pkt in cap:
print(pkt)
但它显示以下错误
AttributeError: 'str' object has no attribute 'items'
decode_as参数应该是一个dict而不是str例如:
decode_as={'udp.port==1234':'rtp'}