30#ifndef TINS_ETHERNET_II_H
31#define TINS_ETHERNET_II_H
34#include <tins/macros.h>
36#include <tins/config.h>
37#include <tins/endianness.h>
38#include <tins/hw_address.h>
103 return header_.dst_mac;
112 return header_.src_mac;
120 return Endian::be_to_host(header_.payload_type);
205 struct ethernet_header {
206 uint8_t dst_mac[address_type::address_size];
207 uint8_t src_mac[address_type::address_size];
211 void write_serialization(uint8_t* buffer, uint32_t total_sz);
213 ethernet_header header_;
Represents a range of addresses.
Definition address_range.h:167
Represents an Ethernet II PDU.
Definition ethernetII.h:46
static const address_type BROADCAST
Represents the ethernetII broadcast address.
Definition ethernetII.h:61
HWAddress< 6 > address_type
The hardware address type.
Definition ethernetII.h:51
address_type dst_addr() const
Getter for the destination's hardware address.
Definition ethernetII.h:102
EthernetII * clone() const
Definition ethernetII.h:197
address_type src_addr() const
Getter for the source's hardware address.
Definition ethernetII.h:111
PDUType pdu_type() const
Getter for the PDU's type.
Definition ethernetII.h:190
uint16_t payload_type() const
Getter for the payload_type.
Definition ethernetII.h:119
Abstraction of a network interface.
Definition network_interface.h:47
Base class for protocol data units.
Definition pdu.h:107
PDUType
Enum which identifies each type of PDU.
Definition pdu.h:127
Sends packets through a network interface.
Definition packet_sender.h:118
The Tins namespace.
Definition address_range.h:38