Python 如何将PyShark中的数据包解码为decode_as
在Wireshark GUI中,我们可以将UPD数据包解码为RTP,在tshark中也可以使用Python 如何将PyShark中的数据包解码为decode_as,python,python-3.x,networking,tshark,pyshark,Python,Python 3.x,Networking,Tshark,Pyshark,在Wireshark GUI中,我们可以将UPD数据包解码为RTP,在tshark中也可以使用d==, 我怎样才能在PyShark做同样的事情? 我试着做了以下几件事 import pyshark cap = pyshark.FileCapture("Test.pcap", display filter='udp', decode_as='rtp') for pkt in cap: print(pkt) 但它显示了以下错误 AttributeError: 'str' object ha
d==,
我怎样才能在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'
解码_作为参数应该是dict而不是str 例如:
decode_as={'udp.port==1234':'rtp'}