MPLSPacket.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 "MPLSPacket.hh"
15 
16 // Custom includes
18 #include "TIMPacket.hh"
19 
20 #define prefix_
21 
23 // downstream assigned label - RFC 5331 (default)
26 
27 prefix_ void senf::MPLSPacketType::dump(packet p, std::ostream & os)
28 {
29  os << "MPLS Header: \n"
30  << " label : " << p->label() << "\n"
31  << " tc : " << p->tc() << "\n"
32  << " bottom of stack : " << p->s() << "\n"
33  << " Time-to-live : " << unsigned(p->ttl()) << "\n";
34 }
35 
37 #undef prefix_
#define prefix_
Definition: MPLSPacket.cc:20
SENF_PACKET_REGISTRY_REGISTER(senf::EtherTypes, senf::MPLSPacketType::etherType, senf::MPLSPacket)
static void dump(packet p, std::ostream &os)
Dump given MPLSPacket in readable form to given output stream.
Definition: MPLSPacket.cc:27
SENF_PACKET_INSTANTIATE_TEMPLATE(senf::MPLSPacket)
static constexpr std::uint16_t etherType
Definition: MPLSPacket.hh:54