I'm trying to create my own protocol for scapy and have been stuck for the last couple of days.
What I'm looking to do is use the first 14 bytes for the first layer, 6 for dst mac, 6 src mac, 2 for padding. The rest of the packet would be the payload.
The problem is I'm not exactly sure how to make the 5th and 6th byte in the packet to be a field that would give an ShortField value.
class MyEther(Packet):
name = "MyEther"
fields_desc =[
MACField("dst", None),
MACField("src", None),
StrLenField('padding', None, length_from=lambda x: 2)
]
help is much appreciated!