|
PROFINET IO Controller Stack 1.0.0
Modern C++ implementation of a PROFINET IO Controller stack
|
Classes | |
| struct | RawRpcHeader |
| DREP-aware fields we need out of a raw incoming RPC request; PROFINET block payloads inside the NRD body are always big-endian regardless of DREP, but the RPC/NRD header fields follow the DREP byte order. More... | |
Enumerations | |
| enum class | Flags1 : std::uint8_t { None = 0x00 , Reserved1 = 1 << 7 , Broadcast = 1 << 6 , Idempotent = 1 << 5 , Maybe = 1 << 4 , NoFack = 1 << 3 , Fragment = 1 << 2 , LastFragment = 1 << 1 , Reserved0 = 1 << 0 } |
| Represents bitwise flags for Application Ready Response header options (byte 1). More... | |
Functions | |
| constexpr Flags1 | operator| (Flags1 lhs, Flags1 rhs) noexcept |
| Bitwise OR operator for combining two ApplicationReadyResponseFlags1 values. | |
| constexpr Flags1 | operator& (Flags1 lhs, Flags1 rhs) noexcept |
| Bitwise AND operator for intersecting two ApplicationReadyResponseFlags1 values. | |
| constexpr std::uint8_t | operator& (std::uint8_t lhs, Flags1 rhs) noexcept |
| Bitwise AND between a raw integer byte and an ApplicationReadyResponseFlags1 value. | |
| constexpr std::uint8_t | operator& (Flags1 lhs, std::uint8_t rhs) noexcept |
| Bitwise AND between an ApplicationReadyResponseFlags1 value and a raw integer byte. | |
| constexpr std::uint8_t | operator| (std::uint8_t lhs, Flags1 rhs) noexcept |
| Bitwise OR between a raw integer byte and an ApplicationReadyResponseFlags1 value. | |
| constexpr std::uint8_t | operator| (Flags1 lhs, std::uint8_t rhs) noexcept |
| Bitwise OR between an ApplicationReadyResponseFlags1 value and a raw integer byte. | |
| constexpr bool | HasFlag (Flags1 flags, Flags1 test) noexcept |
| Checks if all flag bits in 'test' are set within 'flags'. | |
| constexpr bool | HasFlag (std::uint8_t flags, Flags1 test) noexcept |
| Checks if all flag bits in 'test' are set within raw integer byte 'flags'. | |
| constexpr bool | HasFlag (Flags1 flags, std::uint8_t test) noexcept |
| Checks if all flag bits in raw integer byte 'test' are set within enum 'flags'. | |
| std::optional< RawRpcHeader > | ParseRawRpcHeader (const Bytes &data) |
| Parses a raw network byte vector into a structured DCE/RPC v4 Connectionless Header. | |
|
strong |
Represents bitwise flags for Application Ready Response header options (byte 1).
Definition at line 195 of file rpcTypes.h.
Checks if all flag bits in 'test' are set within 'flags'.
| flags | The flag mask to inspect. |
| test | The flag bit(s) to test for. |
Definition at line 283 of file rpcTypes.h.
|
constexprnoexcept |
Checks if all flag bits in raw integer byte 'test' are set within enum 'flags'.
| flags | The enum flag mask to inspect. |
| test | The raw integer bit(s) to test for. |
Definition at line 302 of file rpcTypes.h.
|
constexprnoexcept |
Checks if all flag bits in 'test' are set within raw integer byte 'flags'.
| flags | The raw integer byte to inspect. |
| test | The enum flag bit(s) to test for. |
Definition at line 292 of file rpcTypes.h.
Bitwise AND operator for intersecting two ApplicationReadyResponseFlags1 values.
| lhs | Left-hand operand. |
| rhs | Right-hand operand. |
Definition at line 238 of file rpcTypes.h.
|
constexprnoexcept |
Bitwise AND between an ApplicationReadyResponseFlags1 value and a raw integer byte.
| lhs | Enum flag to test or extract. |
| rhs | Raw integer byte. |
Definition at line 256 of file rpcTypes.h.
|
constexprnoexcept |
Bitwise AND between a raw integer byte and an ApplicationReadyResponseFlags1 value.
| lhs | Raw integer byte. |
| rhs | Enum flag to test or extract. |
Definition at line 247 of file rpcTypes.h.
Bitwise OR operator for combining two ApplicationReadyResponseFlags1 values.
| lhs | Left-hand operand. |
| rhs | Right-hand operand. |
Definition at line 229 of file rpcTypes.h.
|
constexprnoexcept |
Bitwise OR between an ApplicationReadyResponseFlags1 value and a raw integer byte.
| lhs | Enum flag to apply. |
| rhs | Raw integer byte. |
Definition at line 274 of file rpcTypes.h.
|
constexprnoexcept |
Bitwise OR between a raw integer byte and an ApplicationReadyResponseFlags1 value.
| lhs | Raw integer byte. |
| rhs | Enum flag to apply. |
Definition at line 265 of file rpcTypes.h.
| std::optional< RawRpcHeader > profinet::rpc::raw::ParseRawRpcHeader | ( | const Bytes & | data | ) |
Parses a raw network byte vector into a structured DCE/RPC v4 Connectionless Header.
This function extracts the fixed-size 80-byte header from the incoming PROFINET acyclic data stream. It evaluates the DREP (Data Representation) fields to determine the payload's endianness and processes multi-byte numeric fields using safe, endian-aware lambdas.
| Offset (Dec) | Offset (Hex) | Field Name | Size (Bytes) | Description / Parsing Logic |
|---|---|---|---|---|
| 0 | 0x00 | rpc_vers | 1 | Protocol Version (0x04) |
| 1 | 0x01 | ptype | 1 | Packet Type (0x00 = Req, 0x02 = Resp) |
| 2 | 0x02 | flags1 | 1 | First flags group |
| 3 | 0x03 | flags2 | 1 | Second flags group |
| 4 | 0x04 | drep | 3 | Data Representation (drep[0] defines Endianness) |
| 7 | 0x07 | serial_hi | 1 | Split tracking sequence byte (High) |
| 8 | 0x08 | object | 16 | Object UUID (DREP-aware) |
| 24 | 0x18 | if_id | 16 | Interface UUID (DREP-aware) |
| 40 | 0x28 | act_id | 16 | Activity UUID (DREP-aware) |
| 56 | 0x38 | server_boot | 4 | Server Boot Time (DREP-aware, skipped here) |
| 60 | 0x3C | if_vers | 4 | Interface Version (DREP-aware) |
| 64 | 0x40 | seqnum | 4 | Sequence Number (DREP-aware) |
| 68 | 0x44 | opnum | 2 | Operation Number (DREP-aware) |
| 70–77 | 0x46–0x4D | Hint/Len/Frag | 8 | Internal routing data (skipped here) |
| 78 | 0x4E | auth_proto | 1 | Authentication Protocol ID |
| 79 | 0x4F | serial_lo | 1 | Split tracking sequence byte (Low) |
| data | The raw incoming byte stream containing the RPC packet frame. |
std::nullopt if the buffer underflows PNRPCHeader::kFixedSize. Definition at line 1858 of file rpc.cpp.
References profinet::rpc::raw::RawRpcHeader::activityUuid, profinet::rpc::raw::RawRpcHeader::drep, profinet::wire::Reader::Fixed(), profinet::rpc::raw::RawRpcHeader::flags1, profinet::rpc::raw::RawRpcHeader::flags2, profinet::rpc::raw::RawRpcHeader::interfaceUuid, profinet::rpc::raw::RawRpcHeader::interfaceVersion, profinet::rpc::raw::RawRpcHeader::isLittleEndian, profinet::PNRPCHeader::kFixedSize, profinet::rpc::raw::RawRpcHeader::kLittleEndianDrepFlag, profinet::rpc::raw::RawRpcHeader::objectUuid, profinet::rpc::raw::RawRpcHeader::operationNumber, profinet::rpc::raw::RawRpcHeader::packetType, profinet::rpc::raw::RawRpcHeader::payload, profinet::rpc::raw::RawRpcHeader::sequenceNumber, profinet::rpc::raw::RawRpcHeader::serialHigh, profinet::rpc::raw::RawRpcHeader::serialLow, profinet::wire::Reader::SkipTo(), profinet::wire::Reader::U16(), profinet::wire::Reader::U16LittleEndian(), profinet::wire::Reader::U32(), profinet::wire::Reader::U32LittleEndian(), profinet::wire::Reader::U8(), profinet::uuidLenght, and profinet::rpc::raw::RawRpcHeader::version.
Referenced by profinet::rpc::RPCCon::ApplicationReady(), profinet::rpc::RPCCon::Connect(), profinet::rpc::TEST_F(), profinet::rpc::TEST_F(), profinet::rpc::TEST_F(), profinet::rpc::TEST_F(), profinet::rpc::TEST_F(), profinet::rpc::TEST_F(), and profinet::rpc::TEST_F().
Here is the call graph for this function:
Here is the caller graph for this function: