Packets.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_Packets_
18 #define HH_SENF_Ext_NetEmu_Packets_ 1
19 
20 // Custom includes
21 #include <senf/Packets/Packets.hh>
22 
23 //-/////////////////////////////////////////////////////////////////////////////////////////////////
24 
25 namespace senf {
26 namespace emu {
27 
33  {
34 # include SENF_FIXED_PARSER()
35 
41 
43  };
44 
49  {
50  typedef boost::uint32_t key_t;
51  };
52 
66  : public PacketTypeBase,
67  public PacketTypeMixin<PacketHeaderType, InterfaceTypes>
68  {
72 
73  using mixin::nextPacketRange;
74  using mixin::nextPacketType;
75  using mixin::initSize;
76  using mixin::init;
77 
78  static key_t nextPacketKey(packet p);
80  static void dump(packet p, std::ostream & os);
81  static void finalize(packet p);
82  };
83 
86 
87 
101  {
102  dumpPacketInfo(senf::Packet const & p) : packet (p) {}
104  };
105 
107  std::ostream & operator<<(std::ostream & os, dumpPacketInfo const & info);
108 
109 
113  {
114 # include SENF_PARSER()
115  SENF_PARSER_BITFIELD( mgt, 1, bool );
118  mgt() = false;
119  }
120  };
121 
125  : public PacketTypeBase,
126  public PacketTypeMixin<WLANPacketHeaderType>
127  {
131 
132  using mixin::nextPacketRange;
133  using mixin::initSize;
134  using mixin::init;
135 
136  static factory_t nextPacketType(packet p);
137  static void dump(packet p, std::ostream & os);
138  static void finalize(packet p);
139  };
140 
142 
143 
147  {
148 # include SENF_FIXED_PARSER()
149 
154  SENF_PARSER_FIELD( modulationId, UInt32Parser );
155 
157  };
158 
162  : public PacketTypeBase,
163  public PacketTypeMixin<EmulatedWirelessPacketHeaderType, InterfaceTypes>
164  {
168 
169  using mixin::nextPacketRange;
170  using mixin::nextPacketType;
171  using mixin::initSize;
172  using mixin::init;
173 
174  static key_t nextPacketKey(packet p);
175  static void dump(packet p, std::ostream & os);
176  static void finalize(packet p);
177  };
178 
180 
181 
185  {
186 # include SENF_FIXED_PARSER()
187 
189  };
190 
194  : public PacketTypeBase,
195  public PacketTypeMixin<DVBPacketHeaderType>
196  {
200 
201  using mixin::nextPacketRange;
202  using mixin::initSize;
203  using mixin::init;
204 
205  static factory_t nextPacketType(packet p);
206  static void dump(packet p, std::ostream & os);
207  };
208 
210 
211 
215  {
216 # include SENF_FIXED_PARSER()
217 
219  };
220 
224  : public PacketTypeBase,
225  public PacketTypeMixin<EthernetPacketHeaderType>
226  {
230 
231  using mixin::nextPacketRange;
232  using mixin::initSize;
233  using mixin::init;
234 
235  static factory_t nextPacketType(packet p);
236  static void dump(packet p, std::ostream & os);
237  };
238 
240 }};
241 
247 
248 
249 //-/////////////////////////////////////////////////////////////////////////////////////////////////
250 #include "Packets.cci"
251 //#include "Packets.ct"
252 //#include "Packets.cti"
253 #endif
254 
255 
256 // Local Variables:
257 // mode: c++
258 // fill-column: 100
259 // comment-column: 40
260 // c-file-style: "senf"
261 // indent-tabs-mode: nil
262 // ispell-local-dictionary: "american"
263 // compile-command: "scons -u test"
264 // End:
PacketTypeMixin< DVBPacketHeaderType > mixin
Definition: Packets.hh:197
PacketTypeMixin< EmulatedWirelessPacketHeaderType, InterfaceTypes > mixin
Definition: Packets.hh:165
Packet packet() const
#define SENF_PARSER_BITFIELD(name, bits, type)
ConcretePacket< PacketHeaderType > PacketHeader
PacketHeader packet typedef.
Definition: Packets.hh:85
Internal: WLAN Specific emulated interface packet header.
Definition: Packets.hh:112
UInt32Parser nodeId() const
Int64Parser timestamp() const
SENF_PACKET_PREVENT_TEMPLATE_INSTANTIATION(AnnotationsPacket)
UInt32Parser interfaceIndex() const
PacketTypeMixin< PacketHeaderType, InterfaceTypes > mixin
Definition: Packets.hh:69
Emulated interface packet header.
Definition: Packets.hh:65
Internal: Wireless Specific emulated interface packet header.
Definition: Packets.hh:146
ConcretePacket< EthernetPacketHeaderType > packet
Definition: Packets.hh:228
Internal: DVB Specific emulated interface packet header.
Definition: Packets.hh:184
PacketTypeMixin< EthernetPacketHeaderType > mixin
Definition: Packets.hh:227
#define SENF_PARSER_FIELD(name, type)
ConcretePacket< PacketHeaderType > packet
PacketHeader packet typedef.
Definition: Packets.hh:70
ConcretePacket< WLANPacketHeaderType > WLANPacketHeader
Definition: Packets.hh:141
Helper to log all emulated packet information.
Definition: Packets.hh:100
Emulated network packet header parser.
Definition: Packets.hh:32
UInt32Parser sequenceNumber() const
#define SENF_PARSER_FINALIZE(name)
void dump(std::ostream &os, DirectoryNode &dir=root())
#define SENF_PARSER_INIT()
dumpPacketInfo(senf::Packet const &p)
Definition: Packets.hh:102
PacketHeaderParser parser
typedef to the parser of PacketHeader
Definition: Packets.hh:71
WLANPacketHeaderParser parser
Definition: Packets.hh:130
Internal Wireless Specific emulated interface packet type.
Definition: Packets.hh:161
ConcretePacket< EmulatedWirelessPacketHeaderType > EmulatedWirelessPacketHeader
Definition: Packets.hh:179
ConcretePacket< EthernetPacketHeaderType > EthernetPacketHeader
Definition: Packets.hh:239
Internal DVB Specific emulated interface packet type.
Definition: Packets.hh:193
ConcretePacket< DVBPacketHeaderType > DVBPacketHeader
Definition: Packets.hh:209
Internal WLAN Specific emulated interface packet type.
Definition: Packets.hh:124
ConcretePacket< EmulatedWirelessPacketHeaderType > packet
Definition: Packets.hh:166
boost::uint32_t key_t
Definition: Packets.hh:50
UInt32Parser interfaceType() const
EthernetPacketHeaderParser parser
Definition: Packets.hh:229
std::ostream & operator<<(std::ostream &os, InterfaceDeviceId const &id)
Definition: InterfaceId.cc:105
EmulatedWirelessPacketHeaderParser parser
Definition: Packets.hh:167
Internal: Ethernet Specific emulated interface packet header.
Definition: Packets.hh:214
PacketTypeMixin< WLANPacketHeaderType > mixin
Definition: Packets.hh:128
PacketInterpreterBase::factory_t factory_t
Emulated interface header type packet registry.
Definition: Packets.hh:48
ConcretePacket< WLANPacketHeaderType > packet
Definition: Packets.hh:129
Internal DVB Specific emulated interface packet type.
Definition: Packets.hh:223
ConcretePacket< DVBPacketHeaderType > packet
Definition: Packets.hh:198
DVBPacketHeaderParser parser
Definition: Packets.hh:199