1ETHERNET(3) ethernet 1.3 ETHERNET(3)
2
3
4
6 packet.link.ethernet - ETHERNET module
7
9 Decode ethernet layer (RFC 894) Ethernet II.
10
12 class ETHERNET(baseobj.BaseObj)
13 Ethernet object
14
15 Usage:
16 from packet.link.ethernet import ETHERNET
17
18 x = ETHERNET(pktt)
19
20 Object definition:
21
22 ETHERNET(
23 dst = MacAddr(), # destination MAC address
24 src = MacAddr(), # source MAC address
25 type = int, # payload type
26 psize = int, # payload data size
27 data = string, # raw data of payload if type is not supported
28 )
29
30
31 Methods defined here:
32 ---------------------
33
34 __init__(self, pktt)
35 Constructor
36
37 Initialize object's private data.
38
39
40 pktt: Packet trace object (packet.pktt.Pktt) so this layer has
41 access to the parent layers.
42
43 __str__(self)
44 String representation of object
45
46 The representation depends on the verbose level set by debug_repr().
47 If set to 0 the generic object representation is returned.
48 If set to 1 the representation of the object is condensed:
49 '00:0c:29:54:09:ef -> 60:33:4b:29:6e:9d '
50
51 If set to 2 the representation of the object also includes the type
52 of payload:
53 '00:0c:29:54:09:ef -> 60:33:4b:29:6e:9d, type: 0x800(IPv4)'
54
56 baseobj(3), packet.internet.arp(3), packet.internet.ipv4(3), packet.in‐
57 ternet.ipv6(3), packet.link.ethernet_const(3), packet.link.macaddr(3),
58 packet.link.vlan(3), packet.transport.ib(3)
59
60
62 No known bugs.
63
65 Jorge Mora (mora@netapp.com)
66
67
68
69NFStest 3.2 21 March 2023 ETHERNET(3)