#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-prefix_ senf::PacketInterpreterBase::range senf::GenericOptTypeTLVPacketParser::value() const {
+prefix_ senf::PacketInterpreterBase::range senf::GenericOptTypeTLVParser::value() const {
senf::PacketData::iterator begin (boost::next(i(), 2 ));
return PacketInterpreterBase::range(begin, boost::next( begin, optionLength()) );
}
///////////////////////////////ct.p////////////////////////////////////////
template <class ForwardReadableRange>
-prefix_ void senf::GenericOptTypeTLVPacketParser::value(ForwardReadableRange const &range)
+prefix_ void senf::GenericOptTypeTLVParser::value(ForwardReadableRange const &range)
{
unsigned int rangeSize = boost::size(range);
safe_data_iterator si( data(), boost::next(i(), 2 + optionLength() ) );
-// if ( rangeSize > optionLength() ){
-// std::cout << "rangeSize > optionLength()" << std::endl;
-// data().insert(si, rangeSize - optionLength(),0 );
-// }
-// if (rangeSize < optionLength() ){
-// std::cout << "rangeSize < optionLength()" << std::endl;
-// data().erase(si, si + (optionLength() - rangeSize));
-// }
if ( (rangeSize-2) != optionLength() )
resize(optionLength()+2, rangeSize);
}
template <class ForwardReadableRange>
-prefix_ void senf::GenericOptTypeTLVPacketParser::setPayload(ForwardReadableRange const &range)
+prefix_ void senf::GenericOptTypeTLVParser::setPayload(ForwardReadableRange const &range)
{
unsigned int rangeSize = boost::size(range);
if ( rangeSize != optionLength() )
template <class Parser>
-prefix_ Parser& senf::GenericOptTypeTLVPacketParser::init()
+prefix_ Parser& senf::GenericOptTypeTLVParser::init()
{
size_type oldSize ( bytes() );
safe_data_iterator j( data(), i() );
}
// template <class Parser>
-// prefix_ Parser& senf::GenericOptTypeTLVPacketParser::get()
+// prefix_ Parser& senf::GenericOptTypeTLVParser::get()
// {
// SENF_ASSERT (optionType() == typeCode);
// return *(this);
///////////////////////////////hh.p////////////////////////////////////////
namespace senf {
- class OptTypeTLVPacketParser : public PacketParserBase
+ class OptTypeTLVParser : public PacketParserBase
{
public:
# include SENF_PARSER()
SENF_PARSER_BITFIELD (changeFlag, 1, unsigned);
SENF_PARSER_BITFIELD (optionType, 5, unsigned);
SENF_PARSER_FIELD (optionLength, UInt8Parser);
- SENF_PARSER_FINALIZE (OptTypeTLVPacketParser);
+ SENF_PARSER_FINALIZE (OptTypeTLVParser);
};
- struct GenericOptTypeTLVPacketParser : public OptTypeTLVPacketParser
+ struct GenericOptTypeTLVParser : public OptTypeTLVParser
{
# include SENF_PARSER()
- SENF_PARSER_INHERIT ( OptTypeTLVPacketParser );
+ SENF_PARSER_INHERIT ( OptTypeTLVParser );
SENF_PARSER_SKIP ( optionLength(), 0 );
- SENF_PARSER_FINALIZE ( GenericOptTypeTLVPacketParser );
+ SENF_PARSER_FINALIZE ( GenericOptTypeTLVParser );
senf::PacketInterpreterBase::range value() const;
///////////////////////////////cc.p////////////////////////////////////////
namespace {
- senf::PacketRegistry<senf::IpTypes>::RegistrationProxy<senf::IPv6Extension_Fragment>
- registerIPv6ExtensionType_Fragment (44);
- senf::PacketRegistry<senf::IpTypes>::RegistrationProxy<senf::IPv6Extension_Routing>
- registerIPv6ExtensionType_Routing (43);
- senf::PacketRegistry<senf::IpTypes>::RegistrationProxy<senf::IPv6Extension_HopByHop>
- registerIPv6ExtensionType_HopByHop (0u);
- senf::PacketRegistry<senf::IpTypes>::RegistrationProxy<senf::IPv6Extension_Destination>
- registerIPv6ExtensionType_Destination (60u);
+ senf::PacketRegistry<senf::IpTypes>::RegistrationProxy<senf::IPv6Fragment>
+ registerIPv6FragmentType (44);
+ senf::PacketRegistry<senf::IpTypes>::RegistrationProxy<senf::IPv6Routing>
+ registerIPv6RoutingType (43);
+ senf::PacketRegistry<senf::IpTypes>::RegistrationProxy<senf::IPv6HopByHop>
+ registerIPv6HopByHopType (0u);
+ senf::PacketRegistry<senf::IpTypes>::RegistrationProxy<senf::IPv6Destination>
+ registerIPv6DestinationType (60u);
}
-prefix_ void senf::IPv6ExtensionType_Fragment::dump(packet p, std::ostream & os)
+prefix_ void senf::IPv6FragmentType::dump(packet p, std::ostream & os)
{
os << "Internet protocol Version 6 fragment extension:\n"
<< " next header : " << unsigned(p->nextHeader()) << "\n"
<< " id : " << std::hex << unsigned(p->id()) << "\n";
}
-prefix_ void senf::IPv6ExtensionType_Routing::dump(packet p, std::ostream & os)
+prefix_ void senf::IPv6RoutingType::dump(packet p, std::ostream & os)
{
os << "Internet protocol Version 6 routing extension:\n"
<< " next header : " << unsigned (p->nextHeader()) << "\n"
<< " header length : " << unsigned (p->headerLength()) << "\n"
<< " routing type : " << unsigned (p->routingType()) << "\n"
<< " segments left : " << unsigned (p->segmentsLeft()) << "\n";
- IPv6Extension_Routing::Parser::hopAddresses_t::container hopAddresses (p->hopAddresses());
+ IPv6Routing::Parser::hopAddresses_t::container hopAddresses (p->hopAddresses());
os << " further Hop Addresses : \n";
if ( p->segmentsLeft() != 0 ){
- for (IPv6Extension_Routing::Parser::hopAddresses_t::container::iterator i (hopAddresses.begin()); i != hopAddresses.end(); ++i)
+ for (IPv6Routing::Parser::hopAddresses_t::container::iterator i (hopAddresses.begin()); i != hopAddresses.end(); ++i)
os << *i << "\n";
}
}
-prefix_ void senf::IPv6ExtensionType_HopByHop::dump(packet p, std::ostream & os)
+prefix_ void senf::IPv6HopByHopType::dump(packet p, std::ostream & os)
{
os << "Internet protocol Version 6 Hop-By-Hop extension:\n"
<< " next header : " << unsigned (p->nextHeader()) << "\n"
<< " header length : " << unsigned (p->headerLength()) << "\n";
os << " OptionTypes:\n";
- IPv6Extension_HopByHop::Parser::options_t::container options (p->options());
- IPv6Extension_HopByHop::Parser::options_t::container::iterator optIter(options.begin());
+ IPv6HopByHop::Parser::options_t::container options (p->options());
+ IPv6HopByHop::Parser::options_t::container::iterator optIter(options.begin());
for(;optIter != options.end(); ++optIter){
os << " AltAction : " << (unsigned) optIter->altAction()
<< "\n ChangeFlag : " << (unsigned) optIter->changeFlag()
}
}
-prefix_ void senf::IPv6ExtensionType_Destination::dump(packet p, std::ostream & os)
+prefix_ void senf::IPv6DestinationType::dump(packet p, std::ostream & os)
{
os << "Internet protocol Version 6 Destination Options extension:\n"
<< " next header : " << unsigned (p->nextHeader()) << "\n"
\see IPv6ExtensionType_Fragment \n
<a href="http://tools.ietf.org/html/rfc2460">RFC 2460</a>
*/
- struct IPv6PacketParserExtension_Fragment : public PacketParserBase
+ struct IPv6FragmentPacketParser : public PacketParserBase
{
# include SENF_FIXED_PARSER()
SENF_PARSER_BITFIELD ( moreFragments , 1, bool );
SENF_PARSER_FIELD ( id , UInt32Parser );
- SENF_PARSER_FINALIZE(IPv6PacketParserExtension_Fragment);
+ SENF_PARSER_FINALIZE(IPv6FragmentPacketParser);
};
/** \brief IPv6 fragment extension
\ingroup protocolbundle_default
*/
- struct IPv6ExtensionType_Fragment
+ struct IPv6FragmentType
: public PacketTypeBase,
- public PacketTypeMixin<IPv6ExtensionType_Fragment, IpTypes>
+ public PacketTypeMixin<IPv6FragmentType, IpTypes>
{
#ifndef DOXYGEN
- typedef PacketTypeMixin<IPv6ExtensionType_Fragment, IpTypes> mixin;
+ typedef PacketTypeMixin<IPv6FragmentType, IpTypes> mixin;
#endif
/** \brief IPv6 fragment extension packet typedef */
- typedef ConcretePacket<IPv6ExtensionType_Fragment> packet;
+ typedef ConcretePacket<IPv6FragmentType> packet;
/** \brief typedef to the parser of IPv6 fragment extension packet */
- typedef IPv6PacketParserExtension_Fragment parser;
+ typedef IPv6FragmentPacketParser parser;
using mixin::nextPacketRange;
using mixin::nextPacketType;
};
/** \brief IPv6 fragment extension packet typedef */
- typedef ConcretePacket<IPv6ExtensionType_Fragment> IPv6Extension_Fragment;
+ typedef ConcretePacket<IPv6FragmentType> IPv6Fragment;
// =====================================================================================================
*/
//Routing Header Extension (type 0 only)
- struct IPv6PacketParserExtension_Routing : public PacketParserBase
+ struct IPv6PRoutingPacketParser : public PacketParserBase
{
/*
The Type 0 Routing header has the following format: (RFC 2460)
SENF_PARSER_FIELD ( reserved, UInt32Parser ); //set to zero by RFC
SENF_PARSER_VECTOR ( hopAddresses, segmentsLeft, INet6AddressParser );
- SENF_PARSER_FINALIZE ( IPv6PacketParserExtension_Routing );
+ SENF_PARSER_FINALIZE ( IPv6PRoutingPacketParser );
//provisionary, since only type 0 is implemented
SENF_PARSER_INIT() {
\ingroup protocolbundle_default
*/
- struct IPv6ExtensionType_Routing
+ struct IPv6RoutingType
: public PacketTypeBase,
- public PacketTypeMixin<IPv6ExtensionType_Routing, IpTypes>
+ public PacketTypeMixin<IPv6RoutingType, IpTypes>
{
#ifndef DOXYGEN
- typedef PacketTypeMixin<IPv6ExtensionType_Routing, IpTypes> mixin;
+ typedef PacketTypeMixin<IPv6RoutingType, IpTypes> mixin;
#endif
/** \brief IPv6 routing extension packet typedef */
- typedef ConcretePacket<IPv6ExtensionType_Routing> packet;
+ typedef ConcretePacket<IPv6RoutingType> packet;
/** \brief typedef to the parser of IPv6 routing extension packet */
- typedef IPv6PacketParserExtension_Routing parser;
+ typedef IPv6PRoutingPacketParser parser;
using mixin::nextPacketRange;
using mixin::nextPacketType;
};
/** \brief IPv6 routing extension packet typedef */
- typedef ConcretePacket<IPv6ExtensionType_Routing> IPv6Extension_Routing;
+ typedef ConcretePacket<IPv6RoutingType> IPv6Routing;
// =====================================================================================================
// Hop-By-Hop Extension Header
- struct IPv6PacketParserExtension_HopByHop : public PacketParserBase {
+ struct IPv6HopByHopPacketParser : public PacketParserBase {
# include SENF_PARSER()
SENF_PARSER_FIELD ( nextHeader, UInt8Parser );
SENF_PARSER_FIELD ( headerLength, UInt8Parser );
typedef detail::FixedAuxParserPolicy<UInt8Parser, 1u> ListOptionTypeAuxPolicy;
- typedef detail::ListOptionTypeParser_Policy<GenericOptTypeTLVPacketParser, ListOptionTypeAuxPolicy> ListOptionTypePolicy;
+ typedef detail::ListOptionTypeParser_Policy<GenericOptTypeTLVParser, ListOptionTypeAuxPolicy> ListOptionTypePolicy;
typedef ListParser<ListOptionTypePolicy> ListOptionTypeParser;
SENF_PARSER_FIELD ( options, ListOptionTypeParser);
- SENF_PARSER_FINALIZE ( IPv6PacketParserExtension_HopByHop );
+ SENF_PARSER_FINALIZE ( IPv6HopByHopPacketParser );
};
/** \brief IPv6 Hop-By-Hop extension
\ingroup protocolbundle_default
*/
- struct IPv6ExtensionType_HopByHop
+ struct IPv6HopByHopType
: public PacketTypeBase,
- public PacketTypeMixin<IPv6ExtensionType_HopByHop, IpTypes>
+ public PacketTypeMixin<IPv6HopByHopType, IpTypes>
{
#ifndef DOXYGEN
- typedef PacketTypeMixin<IPv6ExtensionType_HopByHop, IpTypes> mixin;
+ typedef PacketTypeMixin<IPv6HopByHopType, IpTypes> mixin;
#endif
/** \brief IPv6 Hop-By-Hop extension packet typedef */
- typedef ConcretePacket<IPv6ExtensionType_HopByHop> packet;
+ typedef ConcretePacket<IPv6HopByHopType> packet;
/** \brief typedef to the parser of IPv6 Hop-By-Hop extension packet */
- typedef IPv6PacketParserExtension_HopByHop parser;
+ typedef IPv6HopByHopPacketParser parser;
using mixin::nextPacketRange;
using mixin::nextPacketType;
};
/** \brief IPv6 routing Hop-By-Hop packet typedef */
- typedef ConcretePacket<IPv6ExtensionType_HopByHop> IPv6Extension_HopByHop;
+ typedef ConcretePacket<IPv6HopByHopType> IPv6HopByHop;
// =====================================================================================================
// Destination Options skeleton without TLV-Options
- struct IPv6PacketParserExtension_Destination : public PacketParserBase {
+ struct IPv6DestinationPacketParser : public PacketParserBase {
# include SENF_PARSER()
SENF_PARSER_FIELD ( nextHeader, UInt8Parser );
SENF_PARSER_FIELD ( headerLength, UInt8Parser );
- SENF_PARSER_FINALIZE ( IPv6PacketParserExtension_Destination );
+ SENF_PARSER_FINALIZE ( IPv6DestinationPacketParser );
};
/** \brief IPv6 Destination Options extension
\ingroup protocolbundle_default
*/
- struct IPv6ExtensionType_Destination
+ struct IPv6DestinationType
: public PacketTypeBase,
- public PacketTypeMixin<IPv6ExtensionType_Destination, IpTypes>
+ public PacketTypeMixin<IPv6DestinationType, IpTypes>
{
#ifndef DOXYGEN
- typedef PacketTypeMixin<IPv6ExtensionType_Destination, IpTypes> mixin;
+ typedef PacketTypeMixin<IPv6DestinationType, IpTypes> mixin;
#endif
/** \brief IPv6 Destination Options extension packet typedef */
- typedef ConcretePacket<IPv6ExtensionType_Destination> packet;
+ typedef ConcretePacket<IPv6DestinationType> packet;
/** \brief typedef to the parser of IPv6 Destination Options extension packet */
- typedef IPv6PacketParserExtension_Destination parser;
+ typedef IPv6DestinationPacketParser parser;
using mixin::nextPacketRange;
using mixin::nextPacketType;
};
/** \brief IPv6 routing Destination Options packet typedef */
- typedef ConcretePacket<IPv6ExtensionType_Destination> IPv6Extension_Destination;
+ typedef ConcretePacket<IPv6DestinationType> IPv6Destination;
} //namespace senf
std::ostringstream oss (std::ostringstream::out);
SENF_CHECK_NO_THROW( pFragment_packet.dump( oss));
- BOOST_CHECK( pFragment_packet.next().is<senf::IPv6Extension_Fragment>() );
+ BOOST_CHECK( pFragment_packet.next().is<senf::IPv6Fragment>() );
- senf::IPv6Extension_Fragment fFragment_packet (pFragment_packet.next().as<senf::IPv6Extension_Fragment>());
+ senf::IPv6Fragment fFragment_packet (pFragment_packet.next().as<senf::IPv6Fragment>());
BOOST_CHECK_EQUAL( fFragment_packet->nextHeader(), 17u );
BOOST_CHECK_EQUAL( fFragment_packet->fragmentOffset(), 160u );
std::ostringstream oss (std::ostringstream::out);
SENF_CHECK_NO_THROW( pRouting_packet.dump( oss));
- BOOST_REQUIRE( pRouting_packet.next().is<senf::IPv6Extension_Routing>() );
+ BOOST_REQUIRE( pRouting_packet.next().is<senf::IPv6Routing>() );
- senf::IPv6Extension_Routing pRouting_extension (pRouting_packet.next().as<senf::IPv6Extension_Routing>());
+ senf::IPv6Routing pRouting_extension (pRouting_packet.next().as<senf::IPv6Routing>());
BOOST_CHECK_EQUAL( pRouting_extension->nextHeader(), 58u );
BOOST_CHECK_EQUAL( pRouting_extension->headerLength(), 0x00 );
std::ostringstream oss (std::ostringstream::out);
SENF_CHECK_NO_THROW( pHop_packet.dump( oss ));
- BOOST_REQUIRE( pHop_packet.next().is<senf::IPv6Extension_HopByHop>() );
- senf::IPv6Extension_HopByHop pHop_extension (pHop_packet.next().as<senf::IPv6Extension_HopByHop>());
+ BOOST_REQUIRE( pHop_packet.next().is<senf::IPv6HopByHop>() );
+ senf::IPv6HopByHop pHop_extension (pHop_packet.next().as<senf::IPv6HopByHop>());
BOOST_CHECK_EQUAL( pHop_extension->nextHeader(), 58u );
BOOST_CHECK_EQUAL( pHop_extension->headerLength(), 0x00 );
- senf::IPv6Extension_HopByHop::Parser::options_t::container optC(pHop_extension->options() );
- senf::IPv6Extension_HopByHop::Parser::options_t::container::iterator listIter (optC.begin());
+ senf::IPv6HopByHop::Parser::options_t::container optC(pHop_extension->options() );
+ senf::IPv6HopByHop::Parser::options_t::container::iterator listIter (optC.begin());
BOOST_CHECK_EQUAL( listIter->altAction(), 0u);
BOOST_CHECK_EQUAL( listIter->changeFlag(), 0u);
ip->hopLimit() = 1u;
ip->source() = senf::INet6Address::from_string("fe80::219:b9ff:feeb:b226");
ip->destination() = senf::INet6Address::from_string("ff02::16");
- senf::IPv6Extension_HopByHop pext (senf::IPv6Extension_HopByHop::createAfter(ip) );
+ senf::IPv6HopByHop pext (senf::IPv6HopByHop::createAfter(ip) );
pext->nextHeader() = 58u;
pext->headerLength() = 0u;
{
- senf::IPv6Extension_HopByHop::Parser::options_t::container optC(pext->options() );
+ senf::IPv6HopByHop::Parser::options_t::container optC(pext->options() );
optC.push_back_space();
- senf::GenericOptTypeTLVPacketParser opt = optC.back().init<senf::GenericOptTypeTLVPacketParser>();
+ senf::GenericOptTypeTLVParser opt = optC.back().init<senf::GenericOptTypeTLVParser>();
opt.altAction() = 0u;
opt.changeFlag() = 0u;
opt.optionType() = 5u;
opt.setPayload(val);
optC.push_back_space();
- opt = optC.back().init<senf::GenericOptTypeTLVPacketParser>();
+ opt = optC.back().init<senf::GenericOptTypeTLVParser>();
opt.altAction() = 0u;
opt.changeFlag() = 0u;
opt.optionType() = 2u;
SENF_PARSER_FIELD( size, senf::UInt8Parser );
typedef senf::detail::FixedAuxParserPolicy<senf::UInt8Parser, 1u> ListOptionTypeAuxPolicy;
- typedef senf::detail::ListOptionTypeParser_Policy<senf::GenericOptTypeTLVPacketParser, ListOptionTypeAuxPolicy> ListOptionTypePolicy;
+ typedef senf::detail::ListOptionTypeParser_Policy<senf::GenericOptTypeTLVParser, ListOptionTypeAuxPolicy> ListOptionTypePolicy;
typedef senf::ListParser<ListOptionTypePolicy> ListOptionTypeParser;
SENF_PARSER_FIELD ( list, ListOptionTypeParser);