MGENPacket.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 "MGENPacket.hh"
15 
16 // Custom includes
17 #include <iomanip>
18 
19 #define prefix_
20 
21 prefix_ void MGENPacketType::dump(packet p, std::ostream & os)
22 {
23  os << "MGENPacket\n"
24  << " messageSize: " << unsigned(p->messageSize()) << "\n"
25  << " version: " << unsigned(p->version()) << "\n"
26  << " flags: " << unsigned(p->flags()) << "\n"
27  << " flowId: " << unsigned(p->flowId()) << "\n"
28  << " sequenceNumber: " << unsigned(p->sequenceNumber()) << "\n"
29  << " txTimeSeconds: " << unsigned(p->txTimeSeconds()) << "\n"
30  << " txTimeMicroseconds: " << unsigned(p->txTimeMicroseconds()) << "\n"
31  << " dstPort: " << unsigned(p->dstPort()) << "\n"
32  << " dstAddrType: " << unsigned(p->dstAddrType()) << "\n"
33  << " dstAddrLen: " << unsigned(p->dstAddrLen()) << "\n"
34  << " dstAddr: ";
35  switch (p->dstAddrType()) {
36  case 0:
37  os << "n/a" << "\n";
38  break;
39  case 1:
40  os << p->dstAddrV4() << "\n";
41  break;
42  case 2:
43  os << p->dstAddrV6() << "\n";
44  break;
45  }
46 }
47 
48 #undef prefix_
49 
50 
51 // Local Variables:
52 // mode: c++
53 // fill-column: 100
54 // c-file-style: "senf"
55 // indent-tabs-mode: nil
56 // ispell-local-dictionary: "american"
57 // compile-command: "scons -u test"
58 // comment-column: 40
59 // End:
#define prefix_
Definition: MGENPacket.cc:19
static void dump(packet p, std::ostream &os)
Definition: MGENPacket.cc:21