34 #include <tins/macros.h> 36 #include <tins/config.h> 37 #include <tins/endianness.h> 38 #include <tins/hw_address.h> 69 static metadata extract_metadata(
const uint8_t *buffer, uint32_t total_sz);
81 Dot3(
const address_type& dst_hw_addr = address_type(),
82 const address_type& src_hw_addr = address_type());
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) 161 #endif // !_WIN32 || 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);
209 #endif // TINS_DOT3_H uint16_t length() const
Getter for the length field.
Definition: dot3.h:119
HWAddress< 6 > address_type
The address type.
Definition: dot3.h:51
static const address_type BROADCAST
Represents the Dot3 broadcast address.
Definition: dot3.h:61
PDUType
Enum which identifies each type of PDU.
Definition: pdu.h:127
Sends packets through a network interface.
Definition: packet_sender.h:116
address_type src_addr() const
Getter for the source hardware address.
Definition: dot3.h:111
address_type dst_addr() const
Getter for the destination hardware address.
Definition: dot3.h:102
Class representing an IEEE 802.3 PDU.
Definition: dot3.h:46
The Tins namespace.
Definition: address_range.h:38
Abstraction of a network interface.
Definition: network_interface.h:47
Dot3 * clone() const
Definition: dot3.h:188
PDUType pdu_type() const
Getter for the PDU's type.
Definition: dot3.h:183
Base class for protocol data units.
Definition: pdu.h:107