TunnelCtrlPacket.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 
17 #include "TunnelCtrlPacket.hh"
18 
19 // Custom includes
21 
22 #define prefix_
23 //-/////////////////////////////////////////////////////////////////////////////////////////////////
24 
27 
29 
30 
32 {
33  static const char * cmdCodes[] = {
34  "invalid", "SetupRequest", "SetupAck", "SetupReject", "TerminateRequest",
35  "TerminateAck", "EchoRequest", "EchoReply" };
36  os << "SENF NetEmu Tunnel Control Packet:\n"
37  << senf::fieldName("Code") << unsigned(p->code()) << " ("
38  << (p->code() <= TunnelCtrlPacketParser::EchoReply ? cmdCodes[p->code()] : "unknown")
39  << ")" << std::endl;
40  if (p->has_capacity()) {
41  os << "Capacity:" << std::endl
42  << " from client to server: " << p->capacity().fromClientToServer() << std::endl
43  << " from server to client: " << p->capacity().fromServerToClient() << std::endl;
44  }
45 
46 }
47 
48 //-/////////////////////////////////////////////////////////////////////////////////////////////////
49 #undef prefix_
50 
51 
52 // Local Variables:
53 // mode: c++
54 // fill-column: 100
55 // comment-column: 40
56 // c-file-style: "senf"
57 // indent-tabs-mode: nil
58 // ispell-local-dictionary: "american"
59 // compile-command: "scons -u test"
60 // End:
TunnelControlPacket public header.
static const std::uint32_t OUI_Fraunhofer_FIT
static void dump(packet p, std::ostream &os)
#define prefix_
SENF_PACKET_REGISTRY_REGISTER(senf::EtherOUIExtTypes, senf::EtherOUIExtTypes::type(senf::EthOUIExtensionPacketType::OUI_Fraunhofer_FIT, 0x42), senf::emu::TunnelCtrlPacket)
SENF_PACKET_INSTANTIATE_TEMPLATE(senf::emu::TunnelCtrlPacket)
static key_t type(boost::uint32_t oui, boost::uint16_t extType)