Registries.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_Registries_
18 #define HH_SENF_Packets_DefaultBundle_Registries_ 1
19 
20 // Custom includes
21 
22 //-/////////////////////////////////////////////////////////////////////////////////////////////////
23 
24 namespace senf {
25 
34  struct EtherTypes {
35  typedef boost::uint16_t key_t;
36  };
37 
39  typedef boost::uint64_t key_t;
40 
41  static key_t type(boost::uint32_t oui, boost::uint16_t extType) {
42  return (boost::uint64_t(oui & 0x00ffffff) << 16) | extType;
43  }
44  static boost::uint32_t oui(key_t key) {
45  return boost::uint32_t( key >> 16);
46  }
47  static boost::uint16_t ext_type(key_t key) {
48  return boost::uint16_t( key);
49  }
50  };
51 
52 
60  struct IPTypes {
61  typedef boost::uint8_t key_t;
62  };
63 
64  // ICMP type registry
65  struct ICMPTypes {
66  typedef boost::uint8_t key_t;
67  };
68 }
69 
70 //-/////////////////////////////////////////////////////////////////////////////////////////////////
71 //#include "EthernetPacket.cci"
72 //#include "EthernetPacket.ct"
73 //#include "EthernetPacket.cti"
74 #endif
75 
76 
77 // Local Variables:
78 // mode: c++
79 // fill-column: 100
80 // c-file-style: "senf"
81 // indent-tabs-mode: nil
82 // ispell-local-dictionary: "american"
83 // compile-command: "scons -u test"
84 // comment-column: 40
85 // End:
static boost::uint32_t oui(key_t key)
Definition: Registries.hh:44
boost::uint8_t key_t
Definition: Registries.hh:66
boost::uint8_t key_t
Definition: Registries.hh:61
static boost::uint16_t ext_type(key_t key)
Definition: Registries.hh:47
boost::uint64_t key_t
Definition: Registries.hh:39
EtherType registry.
Definition: Registries.hh:34
boost::uint16_t key_t
Definition: Registries.hh:35
IP protocol number registry.
Definition: Registries.hh:60
static key_t type(boost::uint32_t oui, boost::uint16_t extType)
Definition: Registries.hh:41