Vector BLF: EthernetFrame.h Source File

Vector BLF

Loading...
Searching...
No Matches
EthernetFrame.h
1// SPDX-FileCopyrightText: 2013-2021 Tobias Lorenz <tobias.lorenz@gmx.net>
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
5#pragma once
6
7#include <Vector/BLF/platform.h>
8
9#include <array>
10#include <vector>
11
12#include <Vector/BLF/AbstractFile.h>
13#include <Vector/BLF/ObjectHeader.h>
14
15#include <Vector/BLF/vector_blf_export.h>
16
17namespace Vector {
18namespace BLF {
19
25 struct VECTOR_BLF_EXPORT EthernetFrame final : ObjectHeader {
26 EthernetFrame();
27
28 void read(AbstractFile & is) override;
29 void write(AbstractFile & os) override;
30 uint32_t calculateObjectSize() const override;
31
36 std::array<uint8_t, 6> sourceAddress {};
37
41 uint16_t channel {};
42
47 std::array<uint8_t, 6> destinationAddress {};
48
50 enum Dir : uint16_t {
51 Rx = 0,
52 Tx = 1,
53 TxRq = 2
54 };
55
61 uint16_t dir {};
62
70 uint16_t type {};
71
76 uint16_t tpid {};
77
82 uint16_t tci {};
83
90 uint16_t payLoadLength {};
91
93 uint64_t reservedEthernetFrame {};
94
101 std::vector<uint8_t> payLoad {};
102};
103
104}
105}
Vector::BLF::AbstractFile
Definition AbstractFile.h:19
Vector::BLF::EthernetFrame
ETHERNET_FRAME.
Definition EthernetFrame.h:25
Vector::BLF::EthernetFrame::Dir
Dir
Definition EthernetFrame.h:50
Vector::BLF::ObjectHeader
Object header.
Definition ObjectHeader.h:22