PROFINET IO Controller Stack 1.0.0
Modern C++ implementation of a PROFINET IO Controller stack
Loading...
Searching...
No Matches
profinet::EthernetHeader Struct Reference

Plain (untagged) Ethernet II frame header. More...

#include <protocol.h>

+ Collaboration diagram for profinet::EthernetHeader:

Public Member Functions

Bytes ToBytes () const
 Serialize this header and its payload back to raw frame bytes.
 

Static Public Member Functions

static EthernetHeader Parse (const Bytes &data)
 Parse an Ethernet header and payload from raw frame bytes.
 

Public Attributes

MacAddress dst {}
 Destination MAC address.
 
MacAddress src {}
 Source MAC address.
 
std::uint16_t type = 0
 EtherType field.
 
Bytes payload
 Frame payload following the header.
 

Detailed Description

Plain (untagged) Ethernet II frame header.

Definition at line 478 of file protocol.h.

Member Function Documentation

◆ Parse()

static EthernetHeader profinet::EthernetHeader::Parse ( const Bytes &  data)
inlinestatic

Parse an Ethernet header and payload from raw frame bytes.

Parameters
dataComplete frame bytes, starting at the destination MAC.
Returns
The parsed header.

Definition at line 495 of file protocol.h.

References dst, profinet::wire::Reader::Fixed(), profinet::macAddressLength, payload, profinet::wire::Reader::ReadBytes(), profinet::wire::Reader::Remaining(), src, type, and profinet::wire::Reader::U16().

Referenced by profinet::dcp::ParseSetResponse(), profinet::dcp::RecvSetResponse(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), TEST_F(), TEST_F(), and profinet::rpc::TEST_F().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ToBytes()

Bytes profinet::EthernetHeader::ToBytes ( ) const
inline

Serialize this header and its payload back to raw frame bytes.

Returns
The encoded frame bytes.

Definition at line 513 of file protocol.h.

References dst, payload, profinet::wire::PutFixed(), profinet::wire::PutU16(), src, and type.

Referenced by profinet::rpc::RpcTests::MakeDcpResponseFrame(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), and TEST_F().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ dst

◆ payload

◆ src

◆ type


The documentation for this struct was generated from the following file: