TIMPacket.cc
Go to the documentation of this file.
1 //
2 // Copyright (c) 2020 Fraunhofer Institute for Applied Information Technology (FIT)
3 // Network Research Group (NET)
4 // Schloss Birlinghoven, 53754 Sankt Augustin, GERMANY
5 // Contact: support@wiback.org
6 //
7 // This file is part of the SENF code tree.
8 // It is licensed under the 3-clause BSD License (aka New BSD License).
9 // See LICENSE.txt in the top level directory for details or visit
10 // https://opensource.org/licenses/BSD-3-Clause
11 //
12 
13 
14 #include "TIMPacket.hh"
15 
16 // Custom includes
17 
18 #define prefix_
19 
22 
23 prefix_ void senf::TIMPacketType::dump(packet p, std::ostream & os)
24 {
25  os << "TIM Header: \n"
26  << " linkLocal seqNo : " << p->linkLocalSeqNo() << std::endl
27  << " sequence number : " << p->sequenceNumber() << std::endl
28  << " timestamp : " << p->timestamp() << std::endl
29  << " GPS synchronized : " << p->syn() << std::endl
30  << " Odd size flag : " << p->oddSize() << std::endl
31  << " padding : " << p->padding() << std::endl;
32 }
33 
34 
36 // senf::TIMSeqNoStats
37 
39  : SequenceNumberStatistics(22, 64)
40 {
41  reset();
42 }
43 
45  : SequenceNumberStatistics(22, 32)
46 {
47  reset();
48 
49  if (llSeq) {
50  processLLSeqNo(tim);
51  } else {
52  processSeqNo(tim);
53  }
54 }
55 
57 // senf::TIMTimestampStats
58 
61 {
62  reset();
63 }
64 
65 
67 #undef prefix_
#define prefix_
Definition: TIMPacket.cc:18
SENF_PACKET_INSTANTIATE_TEMPLATE(senf::TIMPacket)
bool processSeqNo(TIMPacket const &tim)
bool processLLSeqNo(TIMPacket const &tim)
static void dump(packet p, std::ostream &os)
Dump given TIMPacket in readable form to given output stream.
Definition: TIMPacket.cc:23