MPLSPacket.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 
14 #ifndef HH_WiBACK_DataPlane_Packets_MPLSPacket_
15 #define HH_WiBACK_DataPlane_Packets_MPLSPacket_ 1
16 
17 // Custom includes
18 #include <senf/Packets/Packets.hh>
19 
21 namespace senf {
22 
24  {
25 # include SENF_FIXED_PARSER()
26 
27  SENF_PARSER_BITFIELD( label, 20, unsigned);
28  SENF_PARSER_BITFIELD( tc, 3, unsigned);
29  SENF_PARSER_BITFIELD_RO( s, 1, bool);
31 
33 
34  friend struct MPLSPacketType;
35  };
36 
38  : public PacketTypeBase,
39  public PacketTypeMixin<MPLSPacketType>
40  {
44 
45  using mixin::nextPacketRange;
46  using mixin::initSize;
47  using mixin::init;
48 
49  static factory_t nextPacketType(packet p);
51  static void dump(packet p, std::ostream & os);
52  static void finalize(packet p);
53 
54  static constexpr std::uint16_t etherType = 0x8847;
55  };
56 
59 }
60 
62 #include "MPLSPacket.cci"
63 //#include "MPLSPacket.ct"
64 //#include "MPLSPacket.cti"
65 #endif
#define SENF_PARSER_BITFIELD(name, bits, type)
SENF_PACKET_PREVENT_TEMPLATE_INSTANTIATION(AnnotationsPacket)
#define SENF_PARSER_FIELD(name, type)
#define SENF_PARSER_FINALIZE(name)
MPLSPacketParser parser
Definition: MPLSPacket.hh:43
void dump(std::ostream &os, DirectoryNode &dir=root())
senf::UIntFieldParser<?,?+3 > tc() const
senf::UIntFieldParser<?,?+20 > label() const
#define SENF_PARSER_BITFIELD_RO(name, bits, type)
UInt8Parser ttl() const
senf::FlagParser<?>::value_type s() const
PacketTypeMixin< MPLSPacketType > mixin
Definition: MPLSPacket.hh:41
ConcretePacket< MPLSPacketType > MPLSPacket
Definition: MPLSPacket.hh:57
PacketInterpreterBase::factory_t factory_t
ConcretePacket< MPLSPacketType > packet
Definition: MPLSPacket.hh:42