14 #ifndef HH_WiBACK_DataPlane_Packets_TIMPacket_ 15 #define HH_WiBACK_DataPlane_Packets_TIMPacket_ 1 28 # include SENF_FIXED_PARSER() 43 static constexpr std::uint32_t TSBits = 14;
44 static constexpr std::uint32_t SeqNoBits = 24;
50 using mixin::initSize;
53 static factory_t nextPacketType(packet p);
56 static void dump(packet p, std::ostream & os);
57 static void finalize(packet p);
59 static std::int32_t timeStampDiff(std::uint32_t tstamp2, std::uint32_t tstamp1);
60 static std::int32_t seqNoDiff(std::uint32_t current, std::uint32_t last);
83 processed = good = goodBytes = duplicate = late = lost = 0;
92 bool process(std::uint32_t seqNo, std::uint32_t payloadSize) {
96 goodBytes = payloadSize;
106 goodBytes += payloadSize;
110 else if (diff == 0) {
133 return process(tim->sequenceNumber(), tim.
size() - TIMPacketType::parser::fixed_bytes);
137 return process(tim->linkLocalSeqNo(), tim.
size() - TIMPacketType::parser::fixed_bytes);
141 os <<
"processed " << processed <<
", good " << good <<
", goodBytes " << goodBytes;
146 os <<
", duplicate " << duplicate <<
", late " << late <<
", lost " << lost;
147 os <<
", resyncs " << resyncs;
168 lastPD_ = 0x7FFFFFFF;
180 pdv.accumulate(
unsigned(abs(diff - lastPD_)));
185 diff = (TIMPacketParser::timestamp_t::max_value + 1);
186 delay.accumulate(
unsigned(diff));
config::time_type clock_type
senf::UIntFieldParser<?,?+14 > timestamp() const
static std::int32_t timeStampDiff(std::uint32_t tstamp2, std::uint32_t tstamp1)
#define SENF_PARSER_BITFIELD(name, bits, type)
static SENF_CLOCKSERVICE_CONSTEXPR int64_type in_milliseconds(clock_type const &v)
senf::FlagParser<?> syn() const
PacketInterpreterBase::optional_range optional_range
SENF_PACKET_PREVENT_TEMPLATE_INSTANTIATION(senf::TIMPacket)
senf::UIntFieldParser<?,?+24 > linkLocalSeqNo() const
senf::PacketTypeMixin< TIMPacketType > mixin
Annotations public header.
#define SENF_PARSER_FINALIZE(name)
void dump(std::ostream &os, DirectoryNode &dir=root())
bool processLLSeqNo(TIMPacket const &tim)
Incoming packet timestamp.
senf::StatisticAccumulator< std::uint32_t > pdv
senf::StatisticAccumulator< std::uint32_t > delay
Annotation & annotation()
static std::int32_t seqNoDiff(std::uint32_t current, std::uint32_t last)
void process(TIMPacket const &tim)
senf::FlagParser<?> oddSize() const
std::uint32_t as_milli_seconds(std::uint32_t modulo=0xffffffff) const
bool process(std::uint32_t seqNo, std::uint32_t payloadSize)
senf::ConcretePacket< TIMPacketType > TIMPacket
bool processSeqNo(TIMPacket const &tim)
senf::UIntFieldParser<?,?+24 > sequenceNumber() const
PacketInterpreterBase::factory_t factory_t
senf::ConcretePacket< TIMPacketType > packet
::phoenix::function< detail::clear > const clear
void dump(std::ostream &os, senf::ClockService::clock_type const &period=senf::ClockService::clock_type(0))