IPv6Packet.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_Packets_DefaultBundle_IPv6Packet_
18 #define HH_SENF_Packets_DefaultBundle_IPv6Packet_ 1
19 
20 // Custom includes
22 #include <senf/Packets/Packets.hh>
23 #include "Registries.hh"
24 
25 //-/////////////////////////////////////////////////////////////////////////////////////////////////
26 
27 namespace senf {
28 
34  : public ArrayValueParserBase<INet6AddressParser, INet6Address>
35  {
37 
38  using Base::operator=;
39  };
40 
48  {
49 # include SENF_FIXED_PARSER()
50 
51  SENF_PARSER_BITFIELD( version, 4, unsigned );
52  SENF_PARSER_BITFIELD( trafficClass, 8, unsigned );
53  SENF_PARSER_BITFIELD( flowLabel, 20, unsigned );
54 
60 
62 
64  version() = 6;
65  }
66  };
67 
108  : public PacketTypeBase,
109  public PacketTypeMixin<IPv6PacketType, IPTypes>
110  {
114 
115  using mixin::nextPacketRange;
116  using mixin::nextPacketType;
117  using mixin::initSize;
118  using mixin::init;
119 
120  static key_t nextPacketKey(packet p)
121  { return p->nextHeader(); }
122 
124  static void dump(packet p, std::ostream & os);
125 
126  static void finalize(packet p);
127 
133  static const EtherTypes::key_t etherType = 0x86dd;
134  };
135 
141 }
142 
143 //-/////////////////////////////////////////////////////////////////////////////////////////////////
144 //#include "IPv6Packet.cci"
145 //#include "IPv6Packet.ct"
146 //#include "IPv6Packet.cti"
147 #endif
148 
149 
150 // Local Variables:
151 // mode: c++
152 // fill-column: 100
153 // c-file-style: "senf"
154 // indent-tabs-mode: nil
155 // ispell-local-dictionary: "american"
156 // compile-command: "scons -u test"
157 // comment-column: 40
158 // End:
#define SENF_PARSER_BITFIELD(name, bits, type)
Define bit-field.
IPv6 packet.
Definition: IPv6Packet.hh:107
Mixin to provide standard implementations for nextPacketRange and nextPacketType. ...
Definition: PacketType.hh:300
Parse 8bit unsigned byte aligned integer.
Definition: IntParser.hh:91
Packets public header.
DefaultBundle packet registries public header.
#define SENF_PARSER_FIELD(name, type)
Define normal parser field.
INet6AddressParser(data_iterator i, state_type s)
Definition: IPv6Packet.hh:36
#define SENF_PARSER_FINALIZE(name)
Generate parser control members.
Parse an IPv6 packet.
Definition: IPv6Packet.hh:47
ConcretePacket< IPv6PacketType > IPv6Packet
IPv6 packet typedef.
Definition: IPv6Packet.hh:139
void dump(std::ostream &os, DirectoryNode &dir=root())
Protocol specific packet handle.
Definition: Packet.hh:87
Helper base-class implementing the PacketType interface.
Definition: PacketType.hh:100
Packet data STL-sequence view.
Definition: PacketData.hh:61
#define SENF_PARSER_INIT()
Define parser initialization routine.
data_iterator i() const
Return beginning of data to parse.
SENF_PACKET_PREVENT_TEMPLATE_INSTANTIATION(RadiotapPacket)
PacketTypeMixin< IPv6PacketType, IPTypes > mixin
Definition: IPv6Packet.hh:111
Parser Base class.
Parse an IPv6 address.
Definition: IPv6Packet.hh:33
Parse 16bit unsigned byte aligned integer.
Definition: IntParser.hh:174
static key_t nextPacketKey(packet p)
Definition: IPv6Packet.hh:120
boost::uint16_t key_t
Definition: Registries.hh:35
detail::packet::iterator data_iterator
Raw data iterator type.
IPv6PacketParser parser
typedef to the parser of IPv6 packet
Definition: IPv6Packet.hh:113
ConcretePacket< IPv6PacketType > packet
IPv6 packet typedef.
Definition: IPv6Packet.hh:112