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

802.1Q VLAN-tagged Ethernet II frame header. More...

#include <protocol.h>

+ Collaboration diagram for profinet::EthernetVLANHeader:

Public Member Functions

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

Static Public Member Functions

static EthernetVLANHeader Parse (const Bytes &data)
 Parse a VLAN-tagged Ethernet header and payload from raw frame bytes.
 

Public Attributes

MacAddress dst {}
 Destination MAC address.
 
MacAddress src {}
 Source MAC address.
 
std::uint16_t tPid = 0
 Tag Protocol Identifier (0x8100 for 802.1Q).
 
std::uint16_t tCI = 0
 Tag Control Information (priority, DEI, VLAN ID).
 
std::uint16_t type = 0
 Inner EtherType field.
 
Bytes payload
 Frame payload following the header.
 

Detailed Description

802.1Q VLAN-tagged Ethernet II frame header.

Definition at line 109 of file protocol.h.

Member Function Documentation

◆ Parse()

static EthernetVLANHeader profinet::EthernetVLANHeader::Parse ( const Bytes data)
inlinestatic

Parse a VLAN-tagged Ethernet header and payload from raw frame bytes.

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

Definition at line 132 of file protocol.h.

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

+ Here is the call graph for this function:

◆ ToBytes()

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

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

Returns
The encoded frame bytes.

Definition at line 153 of file protocol.h.

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

+ Here is the call graph for this function:

Member Data Documentation

◆ dst

MacAddress profinet::EthernetVLANHeader::dst {}

Destination MAC address.

Definition at line 112 of file protocol.h.

Referenced by Parse(), and ToBytes().

◆ payload

Bytes profinet::EthernetVLANHeader::payload

Frame payload following the header.

Definition at line 127 of file protocol.h.

Referenced by Parse(), and ToBytes().

◆ src

MacAddress profinet::EthernetVLANHeader::src {}

Source MAC address.

Definition at line 115 of file protocol.h.

Referenced by Parse(), and ToBytes().

◆ tCI

std::uint16_t profinet::EthernetVLANHeader::tCI = 0

Tag Control Information (priority, DEI, VLAN ID).

Definition at line 121 of file protocol.h.

Referenced by Parse(), and ToBytes().

◆ tPid

std::uint16_t profinet::EthernetVLANHeader::tPid = 0

Tag Protocol Identifier (0x8100 for 802.1Q).

Definition at line 118 of file protocol.h.

Referenced by Parse(), and ToBytes().

◆ type

std::uint16_t profinet::EthernetVLANHeader::type = 0

Inner EtherType field.

Definition at line 124 of file protocol.h.

Referenced by Parse(), and ToBytes().


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