Python Scapy运算符,'真的可以吗?pipe in types

问题描述 投票:7回答:1

With scapy we can to this :

p = Ether() / IP()

What kind of operation does '

<Ether  ... | IP ...>

' 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.

python scapy
1个回答
5
投票

鸿沟 / 操作符在Scapy中用于 叠层:

该操作符已被用作两层之间的合成操作符。在这样做的时候,下层可以根据上层的情况,使其一个或多个默认字段过载。

| 在您的打印输出中,只是一个文本分隔符,以帮助您区分堆叠层。

© www.soinside.com 2019 - 2024. All rights reserved.