Reading the documentation seems like it might not be possible, but it seems like many people were able to use more complex functions in the pythons lambda function.
I use scapy libraries to create some packages. Especially these questions relate to ConditionalField, which accepts this field and the comparison function, and the field is added only to the package if the comparison is true, but I need to make 2 comparisons.
One check example, 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 does not give the expected results. Is there any way to do this?
source
share