You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the __contains__ method in packet.py to see if I can find a specific protocol within a layer, but of course it doesn't work for all protocols. In my pcap file, I have a number of packets that have either a f1ap layer, or a ngap layer. I have this code:
import pyshark
cap = pyshark.FileCapture("./tc.pcap")
for packet in cap:
print(packet.__contains__("ngap"))
This of course returns true or false depending on the packet. According to tshark -G, both f1ap and ngap protocols are recognised as protocols by tshark. The protocol nas-5gs is also recognised by tshark as a protocol, but pyshark won't find the nas-5gs protocol. Subsequently, the following code returns all falses.
import pyshark
cap = pyshark.FileCapture("./tc.pcap")
for packet in cap:
print(packet.__contains__("nas-5gs"))
The problem might be that the nas-5gs protocol data is actually within the ngap layer.
To Reproduce
It's difficult to reproduce this issue, unless you have a pcap file that contains specific 5G traffic.
Expected behavior
I would hope that the nas-5gs protocol is treated as a layer, and the __contains__ method would return true for packets where the nas-5gs protocol is found within the ngap layer. Equally, the nr-rrc protocol is found within the f1ap layer, and I would expect a similar search for nr-rrc to return true when found in f1ap packets.
Versions (please complete the following information):
OS: macOS 13.6.4
pyshark version: 0.5.3
tshark version: 4.2.3
The text was updated successfully, but these errors were encountered:
I'm using the
__contains__
method inpacket.py
to see if I can find a specific protocol within a layer, but of course it doesn't work for all protocols. In my pcap file, I have a number of packets that have either af1ap
layer, or angap
layer. I have this code:This of course returns true or false depending on the packet. According to
tshark -G
, bothf1ap
andngap
protocols are recognised as protocols by tshark. The protocolnas-5gs
is also recognised by tshark as a protocol, but pyshark won't find thenas-5gs
protocol. Subsequently, the following code returns all falses.The problem might be that the
nas-5gs
protocol data is actually within thengap
layer.To Reproduce
It's difficult to reproduce this issue, unless you have a pcap file that contains specific 5G traffic.
Expected behavior
I would hope that the
nas-5gs
protocol is treated as a layer, and the__contains__
method would return true for packets where thenas-5gs
protocol is found within thengap
layer. Equally, thenr-rrc
protocol is found within thef1ap
layer, and I would expect a similar search fornr-rrc
to return true when found inf1ap
packets.Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: