Converts between EthernetMacAddressFields and binary (network byte order) 802.3 MAC addresses header.
More...
#include <EthernetMacHeaderSerializer.h>
Converts between EthernetMacAddressFields and binary (network byte order) 802.3 MAC addresses header.
◆ EthernetMacAddressFieldsSerializer()
| inet::EthernetMacAddressFieldsSerializer::EthernetMacAddressFieldsSerializer |
( |
| ) |
|
|
inline |
25 : FieldsChunkSerializer() {}
◆ deserialize()
Deserializes a chunk from a stream by reading the bytes at the current position of the stream.
The current stream position is updated according to the length of the returned chunk.
Implements inet::FieldsChunkSerializer.
37 auto header = makeShared<EthernetMacAddressFields>();
38 header->setDest(stream.readMacAddress());
39 header->setSrc(stream.readMacAddress());
◆ serialize()
| void inet::EthernetMacAddressFieldsSerializer::serialize |
( |
MemoryOutputStream & |
stream, |
|
|
const Ptr< const Chunk > & |
chunk |
|
) |
| const |
|
overrideprotectedvirtual |
Serializes a chunk into a stream by writing all bytes representing the chunk at the end of the stream.
Implements inet::FieldsChunkSerializer.
30 const auto& header = staticPtrCast<const EthernetMacAddressFields>(chunk);
31 stream.writeMacAddress(header->getDest());
32 stream.writeMacAddress(header->getSrc());
The documentation for this class was generated from the following files: