WizardsSleeve
WizardsSleeve

Reputation: 195

Scapy ConditionalField Help

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

Upvotes: 0

Views: 1023

Answers (1)

kindall
kindall

Reputation: 184211

Try lambda pkt: pkt.haslayer(RTP). My guess is that haslayer() returns something that is seen by Python as True but is not equal to 1, so your comparison to 1 is always returning False.

Upvotes: 1

Related Questions