34#include <tins/macros.h>
36#include <tins/config.h>
37#include <tins/endianness.h>
38#include <tins/hw_address.h>
94 Dot3(
const uint8_t* buffer, uint32_t total_sz);
103 return header_.dst_mac;
112 return header_.src_mac;
120 return Endian::be_to_host(header_.length);
130 void dst_addr(
const address_type& address);
137 void src_addr(
const address_type& address);
144 void length(uint16_t value);
154 uint32_t header_size()
const;
156 #if !defined(_WIN32) || defined(TINS_HAVE_PACKET_SENDER_PCAP_SENDPACKET)
170 bool matches_response(
const uint8_t* ptr, uint32_t total_sz)
const;
189 return new Dot3(*
this);
197 uint8_t dst_mac[address_type::address_size];
198 uint8_t src_mac[address_type::address_size];
202 void write_serialization(uint8_t* buffer, uint32_t total_sz);
uint16_t length() const
Getter for the length field.
Definition dot3.h:119
static const PDU::PDUType pdu_flag
This PDU's flag.
Definition dot3.h:56
address_type src_addr() const
Getter for the source hardware address.
Definition dot3.h:111
static const address_type BROADCAST
Represents the Dot3 broadcast address.
Definition dot3.h:61
Dot3 * clone() const
Definition dot3.h:188
PDUType pdu_type() const
Getter for the PDU's type.
Definition dot3.h:183
static metadata extract_metadata(const uint8_t *buffer, uint32_t total_sz)
Extracts metadata for this protocol based on the buffer provided.
Definition dot3.cpp:57
HWAddress< 6 > address_type
The address type.
Definition dot3.h:51
address_type dst_addr() const
Getter for the destination hardware address.
Definition dot3.h:102
Dot3(const address_type &dst_hw_addr=address_type(), const address_type &src_hw_addr=address_type())
Constructor for creating an Dot3 PDU.
Definition dot3.cpp:64
Represents a hardware address.
Definition hw_address.h:91
Abstraction of a network interface.
Definition network_interface.h:47
Base class for protocol data units.
Definition pdu.h:107
PDU()
Default constructor.
Definition pdu.cpp:50
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