TunnelCtrlPacket.hh
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 #ifndef HH_SENF_Ext_NetEmu_P2PTunnel_TunnelCtrlPacket_
18 #define HH_SENF_Ext_NetEmu_P2PTunnel_TunnelCtrlPacket_ 1
19 
20 // Custom includes
21 #include <senf/Packets/Packets.hh>
22 
23 //-/////////////////////////////////////////////////////////////////////////////////////////////////
24 
25 namespace senf {
26 namespace emu {
27 
29  {
30 # include SENF_FIXED_PARSER()
34  };
35 
37  {
38  enum CmdCode { // order is important.
39  SetupRequest=1, SetupAck, SetupReject, TerminateRequest, TerminateAck, EchoRequest, EchoReply };
40 
41 # include SENF_PARSER()
43  SENF_PARSER_VARIANT ( code__, code,
44  ( ids( na, na, na, key(0, VoidPacketParser )) )
45  ( ids( capacity, has_capacity, add_capacity, key(SetupRequest, TunnelCapacityPacketParser)) ) );
47  };
48 
50  : public PacketTypeBase,
51  public PacketTypeMixin<TunnelCtrlPacketType>
52  {
56 
57  using mixin::nextPacketRange;
58  using mixin::initSize;
59  using mixin::init;
60 
61  static void dump(packet p, std::ostream & os);
62  };
63 
65 
66 }};
67 
69 
70 //-/////////////////////////////////////////////////////////////////////////////////////////////////
71 //#include "TunnelCtrlPacket.cci"
72 //#include "TunnelCtrlPacket.ct"
73 //#include "TunnelCtrlPacket.cti"
74 #endif
75 
76 
77 // Local Variables:
78 // mode: c++
79 // fill-column: 100
80 // comment-column: 40
81 // c-file-style: "senf"
82 // indent-tabs-mode: nil
83 // ispell-local-dictionary: "american"
84 // compile-command: "scons -u test"
85 // End:
SENF_PACKET_PREVENT_TEMPLATE_INSTANTIATION(AnnotationsPacket)
ConcretePacket< TunnelCtrlPacketType > packet
#define SENF_PARSER_FIELD(name, type)
#define SENF_PARSER_VARIANT(name, chooser, types)
TunnelCtrlPacketParser parser
#define SENF_PARSER_FINALIZE(name)
void dump(std::ostream &os, DirectoryNode &dir=root())
UInt32Parser fromClientToServer() const
PacketTypeMixin< TunnelCtrlPacketType > mixin
ConcretePacket< TunnelCtrlPacketType > TunnelCtrlPacket
UInt32Parser fromServerToClient() const