0

I need help with the ConditionalField in Scapy. I am having trouble with the lambda function, how can I get the lambda function to check for a specific layer in the packet?

At present I have the code

lamda pkt: pkt.haslayer(RTP) == 1

This doesnt appear to work, I dont think pkt contains the contents of the pkt, how can I get around this?

Thanks for any help

4

1 回答 1

1

试试lambda pkt: pkt.haslayer(RTP)。我的猜测是haslayer()返回的东西被 Python 视为True但不等于 1,所以你与 1 的比较总是返回False

于 2011-01-04T19:15:39.030 回答