|
PROFINET IO Controller Stack 1.0.0
Modern C++ implementation of a PROFINET IO Controller stack
|
Abstract interface for raw Ethernet frame transport. More...
#include <IRawEthernetSocket.h>
Inheritance diagram for profinet::IRawEthernetSocket:
Collaboration diagram for profinet::IRawEthernetSocket:Public Member Functions | |
| virtual | ~IRawEthernetSocket ()=default |
| Virtual destructor for polymorphic use. | |
| virtual void | Send (const std::vector< std::uint8_t > &frame)=0 |
| Send one complete raw Ethernet frame. | |
| virtual std::vector< std::uint8_t > | Recv ()=0 |
| Receive one raw Ethernet frame. | |
| virtual void | SetTimeout (std::chrono::milliseconds timeout)=0 |
| Set the receive timeout. | |
Abstract interface for raw Ethernet frame transport.
Implementations may use a platform packet API, libpcap/Npcap, or an in-memory transport. Protocol components must not depend on the selected implementation.
Ethernet frames are returned beginning at the destination MAC address. VLAN tags are preserved as part of the returned frame.
Definition at line 35 of file IRawEthernetSocket.h.
|
virtualdefault |
Virtual destructor for polymorphic use.
|
pure virtual |
Receive one raw Ethernet frame.
Waits for and returns a complete Ethernet frame received from the underlying raw socket.
The returned frame starts at the first byte of the Ethernet header. VLAN tags, when present, remain part of the returned frame and are therefore available to the PROFINET parser.
| std::system_error | When the underlying socket reports a receive error. |
Implemented in profinet::AsioEthernetSocket, profinet::sim::InMemoryEthernetSocket, profinet::cyclic::test::CyclicRawEthernetSocketStub, profinet::cyclic::test::BlockingRawEthernetSocket, and profinet::cyclic::test::LifetimeTrackingRawEthernetSocket.
Referenced by profinet::dcp::ReadResponse(), profinet::dcp::ReceiveHello(), and profinet::dcp::RecvSetResponse().
Here is the caller graph for this function:
|
pure virtual |
Send one complete raw Ethernet frame.
Transmits the complete Ethernet frame supplied by the caller. The frame includes all Ethernet-level headers and protocol payload.
Depending on the caller, this may include:
| frame | Complete Ethernet frame to transmit. |
| std::system_error | When the underlying socket reports a transmission error, if the concrete implementation uses exception-based error reporting. |
Implemented in profinet::cyclic::test::LifetimeTrackingRawEthernetSocket, profinet::cyclic::test::CyclicRawEthernetSocketStub, profinet::cyclic::test::BlockingRawEthernetSocket, profinet::AsioEthernetSocket, and profinet::sim::InMemoryEthernetSocket.
Referenced by profinet::dcp::GetParam(), profinet::dcp::ResetToFactory(), profinet::dcp::SendDiscover(), profinet::dcp::SendHello(), profinet::dcp::SendRequest(), profinet::dcp::SetIp(), profinet::dcp::SetParam(), and profinet::dcp::SignalDevice().
Here is the caller graph for this function:
|
pure virtual |
Set the receive timeout.
| timeout | Maximum time that Recv() waits for a matching frame. Zero means wait indefinitely. |
The timeout is an abstraction-level receive timeout. The concrete transport is responsible for implementing the timeout using its underlying packet-access mechanism.
Implemented in profinet::AsioEthernetSocket, profinet::sim::InMemoryEthernetSocket, profinet::cyclic::test::BlockingRawEthernetSocket, profinet::cyclic::test::CyclicRawEthernetSocketStub, and profinet::cyclic::test::LifetimeTrackingRawEthernetSocket.
Referenced by profinet::dcp::ReadResponse(), profinet::dcp::ReceiveHello(), and profinet::dcp::RecvSetResponse().
Here is the caller graph for this function: