35 #include "commonmacheader.pb.h" 37 class EMANE::CommonMACHeader::Implementation
41 std::uint64_t u64SequenceNumber):
42 registrationId_{registrationId},
43 u64SequenceNumber_{u64SequenceNumber}
48 return registrationId_;
53 return u64SequenceNumber_;
58 std::uint64_t u64SequenceNumber_;
67 if(pkt.
length() >= u16HeaderLength)
69 EMANEMessage::CommonMACHeader msg;
71 if(!msg.ParseFromArray(pkt.
get(),u16HeaderLength))
76 pImpl_.reset(
new Implementation{
static_cast<RegistrationId>(msg.registrationid()),
77 msg.sequencenumber()});
86 pkt.
strip(u16HeaderLength);
96 std::uint64_t u64SequenceNumber):
97 pImpl_{
new Implementation{registrationId,
103 pImpl_(
std::move(rvalue.pImpl_))
110 return pImpl_->getRegistrationId();
115 return pImpl_->getSequenceNumber();
121 EMANEMessage::CommonMACHeader msg{};
123 msg.set_registrationid(pImpl_->getRegistrationId());
124 msg.set_sequencenumber(pImpl_->getSequenceNumber());
126 std::string sSerialization;
128 if(!msg.SerializeToString(&sSerialization))
134 pkt.
prepend(sSerialization.c_str(),sSerialization.size());
142 std::to_string(pImpl_->getRegistrationId()),
144 std::to_string(pImpl_->getSequenceNumber())};
A Packet class that allows upstream processing to strip layer headers as the packet travels up the st...
SerializationException is thrown when an exception occurs during serialization or deserialization of ...
std::uint16_t stripLengthPrefixFraming()
size_t strip(size_t size)
void prepend(const void *buf, size_t size)
Specialized packet the allows downstream processing to add layer specific headers as the packet trave...
std::uint16_t RegistrationId
std::list< std::string > Strings
void prependLengthPrefixFraming(std::uint16_t u16Length)