ETHERNET(3)
π ETHERNET(3) π
okay bestie, so this is packet.link.ethernet β the ETHERNET module from ethernet 1.3, and she's here to decode the ethernet layer, RFC 894 style. Ethernet II, specifically. no cap. π¦
β¨ DESCRIPTION β¨
Decode ethernet layer (RFC 894) Ethernet II.
that's the whole job. she takes the raw bytes and goes "oh this is a MAC address, and this is a MAC address, and this is what's inside" and honestly? she ate. π
π CLASSES π
πΈ class ETHERNET(baseobj.BaseObj) πΈ
the Ethernet object herself. main character energy, fr fr.
π« Usage
from packet.link.ethernet import ETHERNET
x = ETHERNET(pktt)
π Object definition
ETHERNET(
dst = MacAddr(), # destination MAC address
src = MacAddr(), # source MAC address
type = int, # payload type
psize = int, # payload data size
data = string, # raw data of payload if type is not supported
)
so you got dst (destination MAC address), src (source MAC address), type (payload type), psize (payload data size), and data (raw data of payload if type is not supported). all five, all present, all iconic. β¨
π§ Methods defined here:
__init__(self, pktt)
Constructor. Initializes the object's private data. π
pktt: Packet trace object (packet.pktt.Pktt) so this layer has access to the parent layers.
it literally just needs the parent layers to know what's going on. give her the pktt, she does the rest. π«Ά
__str__(self)
String representation of object. π
The representation depends on the verbose level set by debug_repr().
- If set to
0the generic object representation is returned. - If set to
1the representation of the object is condensed:
'00:0c:29:54:09:ef -> 60:33:4b:29:6e:9d '
- If set to
2the representation of the object also includes the type of payload:
'00:0c:29:54:09:ef -> 60:33:4b:29:6e:9d, type: 0x800(IPv4)'
level 0 = beige, level 1 = the little arrow fit, level 2 = she also tells you what's inside. the way that 0x800(IPv4) drops at the end?? obsessed. π
π₯ SEE ALSO π₯
baseobj(3)packet.internet.arp(3)packet.internet.ipv4(3)packet.internet.ipv6(3)packet.link.ethernet_const(3)packet.link.macaddr(3)packet.link.vlan(3)packet.transport.ib(3)
go read the whole friend group, they're all linked up, iykyk. π
π BUGS π
No known bugs.
not a single one. she's clean. she's thriving. π
π AUTHOR π
Jorge Mora (mora@netapp.com) β the goat, respectfully. π«Ά
okay that's the whole page bestie!! this was NFStest 3.2, dated 21 March 2023 β so if you're reading this from the future, hey, the ethernet layer still says hi. mwah, slay, periodt. πβ¨ππ¦πΈπ
π¦ where this page comes from
- debian trixie: nfstest 3.2-3
- fedora 43: NFStest 3.2-14.fc43 Β· GPL-2.0-or-later
- fedora 44: NFStest 3.2-16.fc44 Β· GPL-2.0-or-later
- ubuntu noble: nfstest 3.2-2
- ubuntu questing: nfstest 3.2-3
- ubuntu resolute: nfstest 3.2-3build1
- ubuntu stonking: nfstest 3.2-5
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms