With scapy we can to this :
p = Ether() / IP()
What kind of operation does '/' really do ? What kind of object does it return ? If I type p in a python interpreter it returns this
<Ether ... | IP ...>
What does '|' mean in this case ?
I was trying to change the field dst of IP after creating p without recreating the object entirely, but I didn't manage to do it as I don't know what kind of object I am facing.
Thank you.
The div /
operator is used in Scapy to stack layers:
The / operator has been used as a composition operator between two layers. When doing so, the lower layer can have one or more of its defaults fields overloaded according to the upper layer.
The |
in your printing output is just a text separator to help you distinguish between stacked layers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With