Package dpkt :: Module ethernet :: Class Ethernet
[hide private]
[frames] | no frames]

Class Ethernet

source code

object --+        
         |        
   ??.Temp --+    
             |    
   dpkt.Packet --+
                 |
                Ethernet

Ethernet.

Ethernet II, LLC (802.3+802.2), LLC/SNAP, and Novell raw 802.3,
with automatic 802.1q, MPLS, PPPoE, and Cisco ISL decapsulation.

Attributes:
    __hdr__: Header fields of Ethernet.
    TODO.

Instance Methods [hide private]
 
__init__(self, *args, **kwargs)
Packet constructor with ([buf], [field=val,...]) prototype.
source code
 
_unpack_data(self, buf) source code
 
unpack(self, buf)
Unpack packet header fields from buf, and set self.data.
source code
 
pack_hdr(self)
Return packed header string.
source code
 
__str__(self)
str(x)
source code
 
__len__(self) source code

Inherited from dpkt.Packet: __bytes__, __getitem__, __repr__, pack

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Class Methods [hide private]
 
set_type(cls, t, pktclass) source code
 
get_type(cls, t) source code
 
get_type_rev(cls, k) source code
Class Variables [hide private]
  __hdr__ = (('dst', '6s', ''), ('src', '6s', ''), ('type', 'H',...
  _typesw = {2048: <class 'dpkt.ip.IP'>, 2054: <class 'dpkt.arp....
  _typesw_rev = {<class 'dpkt.aoe.AOE'>: 34978, <class 'dpkt.arp...
  __hdr_defaults__ = {'dst': '', 'src': '', 'type': 2048}
  __hdr_fields__ = ['dst', 'src', 'type']
  __hdr_fmt__ = '>6s6sH'
  __hdr_len__ = 14
Properties [hide private]
  data
  dst
  src
  type

Inherited from object: __class__

Method Details [hide private]

__init__(self, *args, **kwargs)
(Constructor)

source code 
Packet constructor with ([buf], [field=val,...]) prototype.

Arguments:

buf -- optional packet buffer to unpack

Optional keyword arguments correspond to members to set
(matching fields in self.__hdr__, or 'data').

Overrides: object.__init__
(inherited documentation)

unpack(self, buf)

source code 
Unpack packet header fields from buf, and set self.data.

Overrides: dpkt.Packet.unpack
(inherited documentation)

pack_hdr(self)

source code 
Return packed header string.

Overrides: dpkt.Packet.pack_hdr
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 
str(x)

Overrides: object.__str__
(inherited documentation)

__len__(self)
(Length operator)

source code 
Overrides: dpkt.Packet.__len__

Class Variable Details [hide private]

__hdr__

Value:
(('dst', '6s', ''), ('src', '6s', ''), ('type', 'H', 2048))

_typesw

Value:
{2048: <class 'dpkt.ip.IP'>,
 2054: <class 'dpkt.arp.ARP'>,
 8192: <class 'dpkt.cdp.CDP'>,
 8196: <class 'dpkt.dtp.DTP'>,
 25944: <class 'dpkt.ethernet.Ethernet'>,
 33079: <class 'dpkt.ipx.IPX'>,
 34525: <class 'dpkt.ip6.IP6'>,
 34827: <class 'dpkt.ppp.PPP'>,
...

_typesw_rev

Value:
{<class 'dpkt.aoe.AOE'>: 34978,
 <class 'dpkt.arp.ARP'>: 2054,
 <class 'dpkt.cdp.CDP'>: 8192,
 <class 'dpkt.dtp.DTP'>: 8196,
 <class 'dpkt.ethernet.Ethernet'>: 25944,
 <class 'dpkt.ipx.IPX'>: 33079,
 <class 'dpkt.ip.IP'>: 2048,
 <class 'dpkt.ip6.IP6'>: 34525,
...