Say I have the following:
class Delimiter(Packet):
name = "Delimiter"
fields_desc = [
ByteField("val", 0)
]
class OutHeader(Packet):
name = "Out Header"
fields_desc = [
ShortField("index", 0)
]
bind_layers(Delimiter, OutHeader, val=0)
bind_layers(OutHeader, Ether)
And I want to make Delimeter
a layer 2 header, such that there is no Ether header at the top of the packet. How can I do this? With just this code, Scapy reads this instead:
###[ 802.3 ]###
dst = 00:51:99:ff:ff:ff
src = ff:ff:ff:00:00:00
len = 0
###[ Padding ]###
00
frame delimiter. The frame starts immediately after the11
in the SoF. Other data-link protocols do it differently. – Ron Maupin