Reading the documentation it seems this might not be possible, but it seems that a lot of people have been able to beat more complicated functionality into pythons lambda function.
I'm leveraging the scapy libraries to do some packet creation. Specially this questions is about the ConditionalField which takes it a field and a comparison function, the field only being added to the packet if the comparison is true, but I need to do 2 comparisons.
Example with only one check, this works:
ConditionalField(XShortField("chksum",None),lambda pkt:pkt.chksumpresent==1)
What I want:
ConditionalField(XShortField("chksum",None),lambda pkt:pkt.chksumpresent==1 or (lamba pkt:pkt.special == 1))
This isn't giving expected results. Is there a way to do this?