NDPOptions.cc
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 #include "NDPOptions.hh"
15 
16 #define prefix_
17 //-/////////////////////////////////////////////////////////////////////////////////////////////////
22 
23 prefix_ void senf::NDPSourceLLAddressTLVParser::dump(std::ostream & os) const
24 {
25  os << "Source Link-layer Address Option:" << "\n";
26  os << senf::fieldName("Link-layer Address") << source() << "\n";
27 }
28 
29 prefix_ void senf::NDPTargetLLAddressTLVParser::dump(std::ostream & os) const
30 {
31  os << "Target Link-layer Address Option:" << "\n";
32  os << senf::fieldName("Link-layer Address") << target() << "\n";
33 }
34 
36 {
37  os << "Prefix Information Option:" << "\n";
38  os << senf::fieldName("Prefix Length") << unsigned(prefixLength()) << "\n";
39  os << senf::fieldName("On-link Flag") << unsigned(l()) << "\n";
40  os << senf::fieldName("Autonomous Address-configuration Flag") << unsigned(a()) << "\n";
41  os << senf::fieldName("Reserved(6Bit)") << unsigned(reserved1()) << "\n";
42  os << senf::fieldName("Valid Lifetime") << unsigned(validLifetime()) << "\n";
43  os << senf::fieldName("Preferred Lifetime") << unsigned(preferredLifetime()) << "\n";
44  os << senf::fieldName("Reserved(32Bit)") << unsigned(reserved2()) << "\n";
45  os << senf::fieldName("Prefix") << prefix() << "\n";
46 }
47 
48 prefix_ void senf::NDPMTUTLVParser::dump(std::ostream & os) const
49 {
50  os << "MTU Information Option:" << "\n";
51  os << senf::fieldName("MTU") << unsigned(mtu()) << "\n";
52 }
53 
54 //-/////////////////////////////////////////////////////////////////////////////////////////////////
55 #undef prefix_
void dump(std::ostream &os) const
Definition: NDPOptions.cc:48
std::string fieldName(std::string const &s)
Definition: DumpFormat.cc:28
#define prefix_
Definition: NDPOptions.cc:16
void dump(std::ostream &os) const
Definition: NDPOptions.cc:29
MACAddressParser source() const
SENF_PACKET_TLV_REGISTRY_REGISTER(senf::NDPSourceLLAddressTLVParser)
void dump(std::ostream &os) const
Definition: NDPOptions.cc:23
void dump(std::ostream &os) const
Definition: NDPOptions.cc:35