---
name: "packet.link.ethernet"
section: "3"
platform: "linux"
package: "nfstest"
version: "3.2-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/packet.link.ethernet"
---

# packet.link.ethernet(3)

ETHERNET module

## NAME

packet.link.ethernet - ETHERNET module

## DESCRIPTION

Decode ethernet layer (RFC 894) Ethernet II.

## CLASSES

### class ETHERNET(baseobj.BaseObj)

```
Ethernet object
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
)
```

**Methods defined here:** ---------------------

**\_\_init\_\_(self, pktt)** Constructor

Initialize object's private data.

- **pktt:**

  Packet trace object (packet.pktt.Pktt) so this layer has access to the parent layers.

**\_\_str\_\_(self)** String representation of object

The representation depends on the verbose level set by debug\_repr(). If set to 0 the generic object representation is returned. If set to 1 the representation of the object is condensed:\
     '00:0c:29:54:09:ef -\> 60:33:4b:29:6e:9d '

If set to 2 the 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)'

## SEE ALSO

**[baseobj(3)](/baseobj/3.md),** **[packet.internet.arp(3)](/packet.internet.arp/3.md),** **[packet.internet.ipv4(3)](/packet.internet.ipv4/3.md),** **[packet.internet.ipv6(3)](/packet.internet.ipv6/3.md),** **[packet.link.ethernet\_const(3)](/packet.link.ethernet_const/3.md),** **[packet.link.macaddr(3)](/packet.link.macaddr/3.md),** **[packet.link.vlan(3)](/packet.link.vlan/3.md),** **[packet.transport.ib(3)](/packet.transport.ib/3.md)**

## BUGS

No known bugs.

## AUTHOR

Jorge Mora (mora@netapp.com)
