From: g0dil Date: Fri, 23 Nov 2007 12:47:50 +0000 (+0000) Subject: Documentation updates X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=67608d39cb73231d6deaae285aa5477762246e50;p=senf.git Documentation updates Rename IpV[46]* -> IPv[46]* git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@530 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Packets/DefaultBundle/EthernetPacket.test.cc b/Packets/DefaultBundle/EthernetPacket.test.cc index f96049c..176eef3 100644 --- a/Packets/DefaultBundle/EthernetPacket.test.cc +++ b/Packets/DefaultBundle/EthernetPacket.test.cc @@ -27,7 +27,7 @@ // Custom includes #include "EthernetPacket.hh" -#include "IpV4Packet.hh" +#include "IPv4Packet.hh" #include "../../Utils/auto_unit_test.hh" #include @@ -86,7 +86,7 @@ BOOST_AUTO_UNIT_TEST(ethernetPacket_create) BOOST_CHECK_EQUAL(eth->type_length(), 0x8100u); BOOST_CHECK_EQUAL(vlan->type(), 0u); - senf::IpV4Packet ip (senf::IpV4Packet::createAfter(vlan)); + senf::IPv4Packet ip (senf::IPv4Packet::createAfter(vlan)); eth.finalize(); BOOST_CHECK_EQUAL(vlan->type(), 0x0800u); } @@ -127,7 +127,7 @@ BOOST_AUTO_UNIT_TEST(llcsnap_create) BOOST_CHECK_EQUAL( llcsnap->protocolId(), 0x000000u ); BOOST_CHECK_EQUAL( llcsnap->type(), 0u); - senf::IpV4Packet ip (senf::IpV4Packet::createAfter(llcsnap)); + senf::IPv4Packet ip (senf::IPv4Packet::createAfter(llcsnap)); eth.finalize(); BOOST_CHECK_EQUAL(llcsnap->type(), 0x0800u); } diff --git a/Packets/DefaultBundle/IpV4Packet.cc b/Packets/DefaultBundle/IPv4Packet.cc similarity index 87% rename from Packets/DefaultBundle/IpV4Packet.cc rename to Packets/DefaultBundle/IPv4Packet.cc index ec35159..8cac8ca 100644 --- a/Packets/DefaultBundle/IpV4Packet.cc +++ b/Packets/DefaultBundle/IPv4Packet.cc @@ -21,10 +21,10 @@ // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** \file - \brief IpV4Packet non-inline non-template implementation */ + \brief IPv4Packet non-inline non-template implementation */ -#include "IpV4Packet.hh" -//#include "IpV4Packet.ih" +#include "IPv4Packet.hh" +//#include "IPv4Packet.ih" // Custom includes #include @@ -39,17 +39,17 @@ ///////////////////////////////cc.p//////////////////////////////////////// namespace { - senf::PacketRegistry::RegistrationProxy - registerIpV4Packet (0x0800); + senf::PacketRegistry::RegistrationProxy + registerIPv4Packet (0x0800); - senf::PacketRegistry::RegistrationProxy - regsiterIpV4Packet2 (4); // IP-in-IP encapsulation + senf::PacketRegistry::RegistrationProxy + regsiterIPv4Packet2 (4); // IP-in-IP encapsulation } /////////////////////////////////////////////////////////////////////////// -// senf::Parse_IpV4 +// senf::Parse_IPv4 -prefix_ boost::uint16_t senf::Parse_IpV4::calcChecksum() +prefix_ boost::uint16_t senf::Parse_IPv4::calcChecksum() const { validate(bytes(*this)); @@ -63,9 +63,9 @@ prefix_ boost::uint16_t senf::Parse_IpV4::calcChecksum() } /////////////////////////////////////////////////////////////////////////// -// senf::IpV4PacketType +// senf::IPv4PacketType -prefix_ void senf::IpV4PacketType::dump(packet p, std::ostream & os) +prefix_ void senf::IPv4PacketType::dump(packet p, std::ostream & os) { boost::io::ios_all_saver ias(os); os << "Internet protocol Version 4:\n" @@ -85,7 +85,7 @@ prefix_ void senf::IpV4PacketType::dump(packet p, std::ostream & os) << " destination : " << p->destination() << "\n"; } -prefix_ void senf::IpV4PacketType::finalize(packet p) +prefix_ void senf::IPv4PacketType::finalize(packet p) { p->length() << p.size(); p->protocol() << key(p.next()); diff --git a/Packets/DefaultBundle/IpV4Packet.hh b/Packets/DefaultBundle/IPv4Packet.hh similarity index 76% rename from Packets/DefaultBundle/IpV4Packet.hh rename to Packets/DefaultBundle/IPv4Packet.hh index 004efaf..c047b96 100644 --- a/Packets/DefaultBundle/IpV4Packet.hh +++ b/Packets/DefaultBundle/IPv4Packet.hh @@ -21,21 +21,21 @@ // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** \file - \brief IpV4Packet public header */ + \brief IPv4Packet public header */ -#ifndef HH_IpV4Packet_ -#define HH_IpV4Packet_ 1 +#ifndef HH_IPv4Packet_ +#define HH_IPv4Packet_ 1 // Custom includes #include "../../Socket/Protocols/INet/INet4Address.hh" #include "../../Packets/Packets.hh" -//#include "IpV4Packet.mpp" +//#include "IPv4Packet.mpp" ///////////////////////////////hh.p//////////////////////////////////////// namespace senf { - /** \brief Parse in IpV4 address + /** \brief Parse in IPv4 address \see INet4Address */ @@ -56,16 +56,16 @@ namespace senf { { value(other); return *this; } }; - /** \brief Parse an IpV4 packet + /** \brief Parse an IPv4 packet - Parser implementing the IpV4 header. + Parser implementing the IPv4 header. - \see IpV4PacketType \n + \see IPv4PacketType \n RFC 791 \todo Implement options */ - struct Parse_IpV4 : public PacketParserBase + struct Parse_IPv4 : public PacketParserBase { # include SENF_FIXED_PARSER() @@ -93,7 +93,7 @@ namespace senf { ihl() = 5; } - SENF_PARSER_FINALIZE(Parse_IpV4); + SENF_PARSER_FINALIZE(Parse_IPv4); boost::uint16_t calcChecksum() const; @@ -113,7 +113,7 @@ namespace senf { typedef boost::uint16_t key_t; }; - /** \brief IpV4 packet + /** \brief IPv4 packet @@ -123,32 +123,32 @@ namespace senf { - - - - + + + + - - - - - + + + + + - - - + + + - + - +
20 24 28 31
\ref Parse_IpV4::version() "Version"\ref Parse_IpV4::ihl() "IHL"\ref Parse_IpV4::tos() "TOS"\ref Parse_IpV4::length() "Length"\ref Parse_IPv4::version() "Version"\ref Parse_IPv4::ihl() "IHL"\ref Parse_IPv4::tos() "TOS"\ref Parse_IPv4::length() "Length"
\ref Parse_IpV4::identifier() "Identifier"\ref Parse_IpV4::reserved() "R"\ref Parse_IpV4::df() "DF"\ref Parse_IpV4::mf() "MF"\ref Parse_IpV4::frag() "Fragment Offset"\ref Parse_IPv4::identifier() "Identifier"\ref Parse_IPv4::reserved() "R"\ref Parse_IPv4::df() "DF"\ref Parse_IPv4::mf() "MF"\ref Parse_IPv4::frag() "Fragment Offset"
\ref Parse_IpV4::ttl() "Time to Live (ttl)"\ref Parse_IpV4::protocol() "Protocol"\ref Parse_IpV4::checksum() "Header Checksum"\ref Parse_IPv4::ttl() "Time to Live (ttl)"\ref Parse_IPv4::protocol() "Protocol"\ref Parse_IPv4::checksum() "Header Checksum"
\ref Parse_IpV4::source() "Source Address"\ref Parse_IPv4::source() "Source Address"
\ref Parse_IpV4::destination() "Destination Address"\ref Parse_IPv4::destination() "Destination Address"
\par Packet type (typedef): - \ref IpV4Packet + \ref IPv4Packet \par Fields: - \ref Parse_IpV4 + \ref Parse_IPv4 \par Associated registries: \ref IpTypes @@ -160,14 +160,14 @@ namespace senf { \ingroup protocolbundle_default */ - struct IpV4PacketType + struct IPv4PacketType : public PacketTypeBase, - public PacketTypeMixin + public PacketTypeMixin { #ifndef DOXYGEN - typedef PacketTypeMixin mixin; - typedef ConcretePacket packet; - typedef Parse_IpV4 parser; + typedef PacketTypeMixin mixin; + typedef ConcretePacket packet; + typedef Parse_IPv4 parser; #endif using mixin::nextPacketRange; using mixin::nextPacketType; @@ -181,17 +181,17 @@ namespace senf { static void finalize(packet p); }; - /** \brief IpV4 packet typedef */ - typedef ConcretePacket IpV4Packet; + /** \brief IPv4 packet typedef */ + typedef ConcretePacket IPv4Packet; } ///////////////////////////////hh.e//////////////////////////////////////// #endif #ifndef SENF_PACKETS_DECL_ONLY -//#include IpV4Packet.cci" -//#include "IpV4Packet.ct" -//#include "IpV4Packet.cti" +//#include IPv4Packet.cci" +//#include "IPv4Packet.ct" +//#include "IPv4Packet.cti" #endif diff --git a/Packets/DefaultBundle/IpV4Packet.test.cc b/Packets/DefaultBundle/IPv4Packet.test.cc similarity index 94% rename from Packets/DefaultBundle/IpV4Packet.test.cc rename to Packets/DefaultBundle/IPv4Packet.test.cc index 68fc7b0..854d95f 100644 --- a/Packets/DefaultBundle/IpV4Packet.test.cc +++ b/Packets/DefaultBundle/IPv4Packet.test.cc @@ -22,11 +22,11 @@ // Unit tests -//#include "IpV4Packet.test.hh" -//#include "IpV4Packet.test.ih" +//#include "IPv4Packet.test.hh" +//#include "IPv4Packet.test.ih" // Custom includes -#include "IpV4Packet.hh" +#include "IPv4Packet.hh" #include "UDPPacket.hh" #include "../../Utils/auto_unit_test.hh" @@ -47,7 +47,7 @@ BOOST_AUTO_UNIT_TEST(ipV4Packet_packet) 0x15, 0x16, 0x17, 0x18 }; - senf::IpV4Packet p (senf::IpV4Packet::create(data)); + senf::IPv4Packet p (senf::IPv4Packet::create(data)); BOOST_CHECK_EQUAL( p->version(), 0x00u ); BOOST_CHECK_EQUAL( p->ihl(), 0x01u ); @@ -67,7 +67,7 @@ BOOST_AUTO_UNIT_TEST(ipV4Packet_packet) BOOST_AUTO_UNIT_TEST(ipV4Packet_create) { - senf::IpV4Packet ip (senf::IpV4Packet::create()); + senf::IPv4Packet ip (senf::IPv4Packet::create()); BOOST_CHECK_EQUAL( ip->version(), 4u ); BOOST_CHECK_EQUAL( ip->ihl(), 5u ); diff --git a/Packets/DefaultBundle/IpV6Extensions.cc b/Packets/DefaultBundle/IPv6Extensions.cc similarity index 84% rename from Packets/DefaultBundle/IpV6Extensions.cc rename to Packets/DefaultBundle/IPv6Extensions.cc index 288197e..a450ff6 100644 --- a/Packets/DefaultBundle/IpV6Extensions.cc +++ b/Packets/DefaultBundle/IPv6Extensions.cc @@ -19,23 +19,23 @@ // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** \file - \brief IpV6Extensions non-inline non-template implementation */ + \brief IPv6Extensions non-inline non-template implementation */ -#include "IpV6Extensions.hh" -//#include "IpV6Extensions.ih" +#include "IPv6Extensions.hh" +//#include "IPv6Extensions.ih" // Custom includes -//#include "IpV6Extensions.mpp" +//#include "IPv6Extensions.mpp" #define prefix_ ///////////////////////////////cc.p//////////////////////////////////////// namespace { - senf::PacketRegistry::RegistrationProxy - registerIpV6ExtensionType_Fragment (44); + senf::PacketRegistry::RegistrationProxy + registerIPv6ExtensionType_Fragment (44); } -prefix_ void senf::IpV6ExtensionType_Fragment::dump(packet p, std::ostream & os) +prefix_ void senf::IPv6ExtensionType_Fragment::dump(packet p, std::ostream & os) { os << "Internet protocol Version 6 fragment extension:\n" << " next header : " << unsigned(p->nextHeader()) << "\n" @@ -46,7 +46,7 @@ prefix_ void senf::IpV6ExtensionType_Fragment::dump(packet p, std::ostream & os) ///////////////////////////////cc.e//////////////////////////////////////// #undef prefix_ -//#include "IpV6Extensions.mpp" +//#include "IPv6Extensions.mpp" // Local Variables: diff --git a/Packets/DefaultBundle/IpV6Extensions.hh b/Packets/DefaultBundle/IPv6Extensions.hh similarity index 71% rename from Packets/DefaultBundle/IpV6Extensions.hh rename to Packets/DefaultBundle/IPv6Extensions.hh index 96a2ab4..24b94de 100644 --- a/Packets/DefaultBundle/IpV6Extensions.hh +++ b/Packets/DefaultBundle/IPv6Extensions.hh @@ -19,27 +19,27 @@ // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** \file - \brief IpV6Extensions public header */ + \brief IPv6Extensions public header */ -#ifndef HH_IpV6Extensions_ -#define HH_IpV6Extensions_ 1 +#ifndef HH_IPv6Extensions_ +#define HH_IPv6Extensions_ 1 // Custom includes -#include "IpV6Packet.hh" +#include "IPv6Packet.hh" -//#include "IpV6Extensions.mpp" +//#include "IPv6Extensions.mpp" ///////////////////////////////hh.p//////////////////////////////////////// namespace senf { - /** \brief Parse in IpV6 fragment extension header + /** \brief Parse in IPv6 fragment extension header - Parser implementing the IpV6 fragment extension. The fields implemented are: + Parser implementing the IPv6 fragment extension. The fields implemented are: - \see IpV6ExtensionType_Fragment \n + \see IPv6ExtensionType_Fragment \n RFC 2460 */ - struct Parse_IpV6Extension_Fragment : public PacketParserBase + struct Parse_IPv6Extension_Fragment : public PacketParserBase { # include SENF_FIXED_PARSER() @@ -52,16 +52,16 @@ namespace senf { SENF_PARSER_FIELD( id , Parse_UInt32 ); - SENF_PARSER_FINALIZE(Parse_IpV6Extension_Fragment); + SENF_PARSER_FINALIZE(Parse_IPv6Extension_Fragment); }; - /** \brief IpV6 fragment extension + /** \brief IPv6 fragment extension \par Packet type (typedef): - \ref IpV6Extension_Fragment + \ref IPv6Extension_Fragment \par Fields: - \ref Parse_IpV6Extension_Fragment + \ref Parse_IPv6Extension_Fragment \par Associated registries: \par IpTypes @@ -71,14 +71,14 @@ namespace senf { \ingroup protocolbundle_default */ - struct IpV6ExtensionType_Fragment + struct IPv6ExtensionType_Fragment : public PacketTypeBase, - public PacketTypeMixin + public PacketTypeMixin { #ifndef DOXYGEN - typedef PacketTypeMixin mixin; - typedef ConcretePacket packet; - typedef Parse_IpV6Extension_Fragment parser; + typedef PacketTypeMixin mixin; + typedef ConcretePacket packet; + typedef Parse_IPv6Extension_Fragment parser; #endif using mixin::nextPacketRange; using mixin::nextPacketType; @@ -94,16 +94,16 @@ namespace senf { { p->nextHeader() << key(p.next()); } }; - /** \brief IpV6 fragment extension packet typedef */ - typedef ConcretePacket IpV6Extension_Fragment; + /** \brief IPv6 fragment extension packet typedef */ + typedef ConcretePacket IPv6Extension_Fragment; } ///////////////////////////////hh.e//////////////////////////////////////// #endif #ifndef SENF_PACKETS_DECL_ONLY -//#include "IpV6Extensions.cci" -//#include "IpV6Extensions.ct" -//#include "IpV6Extensions.cti" +//#include "IPv6Extensions.cci" +//#include "IPv6Extensions.ct" +//#include "IPv6Extensions.cti" #endif diff --git a/Packets/DefaultBundle/IpV6Extensions.test.cc b/Packets/DefaultBundle/IPv6Extensions.test.cc similarity index 91% rename from Packets/DefaultBundle/IpV6Extensions.test.cc rename to Packets/DefaultBundle/IPv6Extensions.test.cc index f74e893..70b754c 100644 --- a/Packets/DefaultBundle/IpV6Extensions.test.cc +++ b/Packets/DefaultBundle/IPv6Extensions.test.cc @@ -19,14 +19,14 @@ // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** \file - \brief IpV6Extensions.test unit tests */ + \brief IPv6Extensions.test unit tests */ -//#include "IpV6Extensions.test.hh" -//#include "IpV6Extensions.test.ih" +//#include "IPv6Extensions.test.hh" +//#include "IPv6Extensions.test.ih" // Custom includes -#include "IpV6Extensions.hh" -#include "IpV6Packet.hh" +#include "IPv6Extensions.hh" +#include "IPv6Packet.hh" #include "UDPPacket.hh" #include "../../Socket/Protocols/INet/INetAddressing.hh" @@ -64,16 +64,16 @@ BOOST_AUTO_UNIT_TEST(ipv6Extension_Fragment_packet) 0x11, 0x12, 0x13, 0x14 }; - senf::IpV6Packet p (senf::IpV6Packet::create(data)); + senf::IPv6Packet p (senf::IPv6Packet::create(data)); BOOST_CHECK_EQUAL( p->version(), 6u ); BOOST_CHECK_EQUAL( p->length(), 20u ); BOOST_CHECK_EQUAL( p->nextHeader(), 44u ); BOOST_CHECK_EQUAL( p->source().value(), senf::INet6Address::from_string("2001::1") ); BOOST_CHECK_EQUAL( p->destination().value(), senf::INet6Address::from_string("2001::2") ); - BOOST_CHECK( p.next().is() ); + BOOST_CHECK( p.next().is() ); - senf::IpV6Extension_Fragment f (p.next().as()); + senf::IPv6Extension_Fragment f (p.next().as()); BOOST_CHECK_EQUAL( f->nextHeader(), 17u ); BOOST_CHECK_EQUAL( f->fragmentOffset(), 160u ); diff --git a/Packets/DefaultBundle/IpV6Packet.cc b/Packets/DefaultBundle/IPv6Packet.cc similarity index 84% rename from Packets/DefaultBundle/IpV6Packet.cc rename to Packets/DefaultBundle/IPv6Packet.cc index e96eaec..bb405d4 100644 --- a/Packets/DefaultBundle/IpV6Packet.cc +++ b/Packets/DefaultBundle/IPv6Packet.cc @@ -19,10 +19,10 @@ // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** \file - \brief IpV6Packet non-inline non-template implementation */ + \brief IPv6Packet non-inline non-template implementation */ -#include "IpV6Packet.hh" -//#include "IpV6Packet.ih" +#include "IPv6Packet.hh" +//#include "IPv6Packet.ih" // Custom includes #include @@ -30,22 +30,22 @@ #include "EthernetPacket.hh" #include "../../Socket/Protocols/INet/INetAddressing.hh" -//#include "IpV6Packet.mpp" +//#include "IPv6Packet.mpp" #define prefix_ ///////////////////////////////cc.p//////////////////////////////////////// namespace { - senf::PacketRegistry::RegistrationProxy - registerIpV6Packet (0x86dd); + senf::PacketRegistry::RegistrationProxy + registerIPv6Packet (0x86dd); - senf::PacketRegistry::RegistrationProxy - registerIpV6Packet2 (41); // IP6-in-IP(6) encapsulation + senf::PacketRegistry::RegistrationProxy + registerIPv6Packet2 (41); // IP6-in-IP(6) encapsulation senf::PacketRegistry::RegistrationProxy registerNoNextHeader (59); } -prefix_ void senf::IpV6PacketType::dump(packet p, std::ostream & os) +prefix_ void senf::IPv6PacketType::dump(packet p, std::ostream & os) { boost::io::ios_all_saver ias(os); os << "Internet protocol Version 6:\n" @@ -61,15 +61,15 @@ prefix_ void senf::IpV6PacketType::dump(packet p, std::ostream & os) << " destination : " << p->destination() << "\n"; } -prefix_ void senf::IpV6PacketType::finalize(packet p) +prefix_ void senf::IPv6PacketType::finalize(packet p) { - p->length() << (p.size() - Parse_IpV6::fixed_bytes); + p->length() << (p.size() - Parse_IPv6::fixed_bytes); p->nextHeader() << key(p.next()); } ///////////////////////////////cc.e//////////////////////////////////////// #undef prefix_ -//#include "IpV6Packet.mpp" +//#include "IPv6Packet.mpp" // Local Variables: diff --git a/Packets/DefaultBundle/IpV6Packet.hh b/Packets/DefaultBundle/IPv6Packet.hh similarity index 81% rename from Packets/DefaultBundle/IpV6Packet.hh rename to Packets/DefaultBundle/IPv6Packet.hh index bb7feb4..509419c 100644 --- a/Packets/DefaultBundle/IpV6Packet.hh +++ b/Packets/DefaultBundle/IPv6Packet.hh @@ -19,22 +19,22 @@ // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** \file - \brief IpV6Packet public header */ + \brief IPv6Packet public header */ -#ifndef HH_IpV6Packet_ -#define HH_IpV6Packet_ 1 +#ifndef HH_IPv6Packet_ +#define HH_IPv6Packet_ 1 // Custom includes #include "../../Socket/Protocols/INet/INet6Address.hh" #include "../../Packets/Packets.hh" -#include "IpV4Packet.hh" +#include "IPv4Packet.hh" -//#include "IpV6Packet.mpp" +//#include "IPv6Packet.mpp" ///////////////////////////////hh.p//////////////////////////////////////// namespace senf { - /** \brief Parse an IpV6 address + /** \brief Parse an IPv6 address \see INet6Address */ @@ -55,12 +55,12 @@ namespace senf { { value(other); return *this; } }; - /** \brief Parse an IpV6 packet + /** \brief Parse an IPv6 packet - \see IpV6PacketType \n + \see IPv6PacketType \n RFC 2460 */ - struct Parse_IpV6 : public PacketParserBase + struct Parse_IPv6 : public PacketParserBase { # include SENF_FIXED_PARSER() @@ -78,16 +78,16 @@ namespace senf { version() = 6; } - SENF_PARSER_FINALIZE(Parse_IpV6); + SENF_PARSER_FINALIZE(Parse_IPv6); }; - /** \brief IpV6 packet + /** \brief IPv6 packet \par Packet type (typedef): - \ref IpV6Packet + \ref IPv6Packet \par Fields: - \ref Parse_IpV6 + \ref Parse_IPv6 \par Associated registries: \ref IpTypes @@ -98,14 +98,14 @@ namespace senf { \ingroup protocolbundle_default */ - struct IpV6PacketType + struct IPv6PacketType : public PacketTypeBase, - public PacketTypeMixin + public PacketTypeMixin { #ifndef DOXYGEN - typedef PacketTypeMixin mixin; - typedef ConcretePacket packet; - typedef Parse_IpV6 parser; + typedef PacketTypeMixin mixin; + typedef ConcretePacket packet; + typedef Parse_IPv6 parser; #endif using mixin::nextPacketRange; using mixin::nextPacketType; @@ -120,8 +120,8 @@ namespace senf { static void finalize(packet p); }; - /** \brief IpV6 packet typedef */ - typedef ConcretePacket IpV6Packet; + /** \brief IPv6 packet typedef */ + typedef ConcretePacket IPv6Packet; ///@} } @@ -129,9 +129,9 @@ namespace senf { ///////////////////////////////hh.e//////////////////////////////////////// #endif #ifndef SENF_PACKETS_DECL_ONLY -//#include "IpV6Packet.cci" -//#include "IpV6Packet.ct" -//#include "IpV6Packet.cti" +//#include "IPv6Packet.cci" +//#include "IPv6Packet.ct" +//#include "IPv6Packet.cti" #endif diff --git a/Packets/DefaultBundle/IpV6Packet.test.cc b/Packets/DefaultBundle/IPv6Packet.test.cc similarity index 93% rename from Packets/DefaultBundle/IpV6Packet.test.cc rename to Packets/DefaultBundle/IPv6Packet.test.cc index 8838cc5..da0b2d3 100644 --- a/Packets/DefaultBundle/IpV6Packet.test.cc +++ b/Packets/DefaultBundle/IPv6Packet.test.cc @@ -19,13 +19,13 @@ // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** \file - \brief IpV6Packet unit tests */ + \brief IPv6Packet unit tests */ -//#include "IpV6Packet.test.hh" -//#include "IpV6Packet.test.ih" +//#include "IPv6Packet.test.hh" +//#include "IPv6Packet.test.ih" // Custom includes -#include "IpV6Packet.hh" +#include "IPv6Packet.hh" #include "../../Socket/Protocols/INet/INetAddressing.hh" #include "../../Packets/DataPacket.hh" @@ -45,7 +45,7 @@ BOOST_AUTO_UNIT_TEST(ipV6Packet_packet) 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0xff }; - senf::IpV6Packet p (senf::IpV6Packet::create(data)); + senf::IPv6Packet p (senf::IPv6Packet::create(data)); BOOST_CHECK_EQUAL( p->version(), 0x06u ); BOOST_CHECK_EQUAL( p->trafficClass(), 0x01u ); diff --git a/Packets/DefaultBundle/UDPPacket.cc b/Packets/DefaultBundle/UDPPacket.cc index 7ae0079..d3808e4 100644 --- a/Packets/DefaultBundle/UDPPacket.cc +++ b/Packets/DefaultBundle/UDPPacket.cc @@ -25,15 +25,15 @@ #include "UDPPacket.hh" //#include "UDPPacket.ih" -#include "IpV4Packet.hh" +#include "IPv4Packet.hh" // Custom includes #include #include #include "../../Packets/Packets.hh" #include "../../Utils/IpChecksum.hh" -#include "IpV4Packet.hh" -#include "IpV6Packet.hh" +#include "IPv4Packet.hh" +#include "IPv6Packet.hh" #define prefix_ ///////////////////////////////cc.p//////////////////////////////////////// @@ -54,30 +54,30 @@ prefix_ boost::uint16_t senf::Parse_UDP::calcChecksum() summer.feed( i()+checksum_offset+2, data().end() ); // Now on to the awkward part: the IP pseudo header - IpV4Packet ipv4 (packet().prev(nothrow)); + IPv4Packet ipv4 (packet().prev(nothrow)); if (ipv4) { // Pseudo header defined in RFC768 summer.feed( ipv4->source().i(), - ipv4->source().i() + Parse_IpV4::source_t::fixed_bytes ); - ///\fixme What about a hop-by-hop routing option? Which destination is used in IpV4 ? + ipv4->source().i() + Parse_IPv4::source_t::fixed_bytes ); + ///\fixme What about a hop-by-hop routing option? Which destination is used in IPv4 ? summer.feed( ipv4->destination().i(), - ipv4->destination().i() + Parse_IpV4::destination_t::fixed_bytes ); + ipv4->destination().i() + Parse_IPv4::destination_t::fixed_bytes ); summer.feed( 0u ); - ///\fixme May there be another header between the IpV4 header and UDP? if so, we + ///\fixme May there be another header between the IPv4 header and UDP? if so, we /// need to hack the correct protocol number here ... summer.feed( 17u ); summer.feed( i() + length_offset, i() + length_offset + 2 ); } else { // Pseudo header defined in RFC2460 - IpV6Packet ipv6 (packet().prev(nothrow)); + IPv6Packet ipv6 (packet().prev(nothrow)); if (ipv6) { summer.feed( ipv6->source().i(), - ipv6->source().i() + Parse_IpV6::source_t::fixed_bytes ); + ipv6->source().i() + Parse_IPv6::source_t::fixed_bytes ); ///\todo Implement routing header support // The destination used here must be the *final* destination ... summer.feed( ipv6->destination().i(), - ipv6->destination().i() + Parse_IpV6::destination_t::fixed_bytes ); + ipv6->destination().i() + Parse_IPv6::destination_t::fixed_bytes ); /// This is a simplification. The value is really 32bit to support UDP Jumbograms /// (RFC2147). However, skipping an even number of 0 bytes does not change the checksum summer.feed( i() + length_offset, i() + length_offset + 2 ); diff --git a/Packets/DefaultBundle/UDPPacket.test.cc b/Packets/DefaultBundle/UDPPacket.test.cc index 744c439..7e95c5c 100644 --- a/Packets/DefaultBundle/UDPPacket.test.cc +++ b/Packets/DefaultBundle/UDPPacket.test.cc @@ -27,7 +27,7 @@ // Custom includes #include "UDPPacket.hh" -#include "IpV4Packet.hh" +#include "IPv4Packet.hh" #include "../../Utils/auto_unit_test.hh" #include @@ -58,7 +58,7 @@ BOOST_AUTO_UNIT_TEST(udpPacket_create) 0x00, 0x12, 0xfa, 0x6e, 0x54, 0x45, 0x53, 0x54, 0x2d, 0x57, 0x52, 0x49, 0x54, 0x45 }; - senf::IpV4Packet ip (senf::IpV4Packet::create()); + senf::IPv4Packet ip (senf::IPv4Packet::create()); ip->source() = senf::INet4Address::Loopback; ip->destination() = senf::INet4Address::Loopback; ip->df() = true; diff --git a/Packets/MPEGDVBBundle/DTCPPacket.hh b/Packets/MPEGDVBBundle/DTCPPacket.hh index 420f0a7..5b43e92 100644 --- a/Packets/MPEGDVBBundle/DTCPPacket.hh +++ b/Packets/MPEGDVBBundle/DTCPPacket.hh @@ -7,28 +7,28 @@ #define DTCPPACKET_HH_ #include "../../Packets/Packets.hh" -#include "../../Packets/DefaultBundle/IpV4Packet.hh" -#include "../../Packets/DefaultBundle/IpV6Packet.hh" +#include "../../Packets/DefaultBundle/IPv4Packet.hh" +#include "../../Packets/DefaultBundle/IPv6Packet.hh" namespace senf { //first we have to define some helpers - struct DTCPIpV4AddressListParser : public PacketParserBase { + struct DTCPIPv4AddressListParser : public PacketParserBase { # include SENF_PARSER() SENF_PARSER_PRIVATE_FIELD ( num_of_fbips, Parse_UInt8 ); SENF_PARSER_PRIVATE_FIELD ( reserved , Parse_UInt8 ); //must be zero SENF_PARSER_VEC_N ( fbiplist, num_of_fbips, Parse_INet4Address ); - SENF_PARSER_FINALIZE(DTCPIpV4AddressListParser); + SENF_PARSER_FINALIZE(DTCPIPv4AddressListParser); }; - struct DTCPIpV6AddressListParser : public PacketParserBase { + struct DTCPIPv6AddressListParser : public PacketParserBase { # include SENF_PARSER() SENF_PARSER_PRIVATE_FIELD ( num_of_fbips, Parse_UInt8 ); SENF_PARSER_PRIVATE_FIELD ( reserved, Parse_UInt8 ); //must be zero SENF_PARSER_VEC_N ( fbiplist, num_of_fbips, Parse_INet6Address ); - SENF_PARSER_FINALIZE(DTCPIpV6AddressListParser); + SENF_PARSER_FINALIZE(DTCPIPv6AddressListParser); }; /** \brief Parse a DTCP packet @@ -56,9 +56,9 @@ namespace senf { * (senf::VoidPacketParser) //1 * (senf::VoidPacketParser) //2 * (senf::VoidPacketParser) //3 - * (senf::Parse_ListB< IpV4Packet, num_of_fbips>) //4 + * (senf::Parse_ListB< IPv4Packet, num_of_fbips>) //4 * (senf::VoidPacketParser) //5 - * (senf::Parse_ListB< IpV6Packet, num_of_fbips>) ); //6 + * (senf::Parse_ListB< IPv6Packet, num_of_fbips>) ); //6 * This can't work for two reasons: * -SENF_PARSER_PRIVATE_VARIANT only accepts 6 templates in types but you have to start from 0. * -you NEVER can use templated Parsers in these macros since the macro-preprocessor won't recognize the <> brackets and will @@ -87,8 +87,8 @@ namespace senf { }; SENF_PARSER_VARIANT_TRANS ( fbiplist, ip_version, ip_version_translator, - (senf::DTCPIpV4AddressListParser) //IPv4 - (senf::DTCPIpV6AddressListParser) ); //IPv6 + (senf::DTCPIPv4AddressListParser) //IPv4 + (senf::DTCPIPv6AddressListParser) ); //IPv6 SENF_PARSER_FINALIZE(Parse_DTCPPacket); }; diff --git a/Packets/MPEGDVBBundle/DtcpPacket.cc b/Packets/MPEGDVBBundle/DtcpPacket.cc deleted file mode 100644 index 77919fa..0000000 --- a/Packets/MPEGDVBBundle/DtcpPacket.cc +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (C) 2007 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum NETwork research (NET) -// David Wagner -// -#include "DtcpPacket.hh" diff --git a/Packets/MPEGDVBBundle/DtcpPacket.hh b/Packets/MPEGDVBBundle/DtcpPacket.hh deleted file mode 100644 index 420f0a7..0000000 --- a/Packets/MPEGDVBBundle/DtcpPacket.hh +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (C) 2007 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum NETwork research (NET) -// David Wagner -// -#ifndef DTCPPACKET_HH_ -#define DTCPPACKET_HH_ - -#include "../../Packets/Packets.hh" -#include "../../Packets/DefaultBundle/IpV4Packet.hh" -#include "../../Packets/DefaultBundle/IpV6Packet.hh" - -namespace senf { - - //first we have to define some helpers - struct DTCPIpV4AddressListParser : public PacketParserBase { -# include SENF_PARSER() - SENF_PARSER_PRIVATE_FIELD ( num_of_fbips, Parse_UInt8 ); - SENF_PARSER_PRIVATE_FIELD ( reserved , Parse_UInt8 ); //must be zero - SENF_PARSER_VEC_N ( fbiplist, num_of_fbips, Parse_INet4Address ); - - SENF_PARSER_FINALIZE(DTCPIpV4AddressListParser); - }; - - struct DTCPIpV6AddressListParser : public PacketParserBase { -# include SENF_PARSER() - SENF_PARSER_PRIVATE_FIELD ( num_of_fbips, Parse_UInt8 ); - SENF_PARSER_PRIVATE_FIELD ( reserved, Parse_UInt8 ); //must be zero - SENF_PARSER_VEC_N ( fbiplist, num_of_fbips, Parse_INet6Address ); - - SENF_PARSER_FINALIZE(DTCPIpV6AddressListParser); - }; - - /** \brief Parse a DTCP packet - - Parser implementing the DTCP packet according to RFC 3077 - - \see DTCPPacketType - */ - struct Parse_DTCPPacket : public PacketParserBase - { -# include SENF_PARSER() - - SENF_PARSER_BITFIELD ( version_number, 4, unsigned ); // =1 according to rfc3077 - SENF_PARSER_BITFIELD ( command, 4, unsigned ); // 1=JOIN 2=LEAVE - SENF_PARSER_FIELD ( interval, Parse_UInt8 ); // 5 according to rfc3077 - SENF_PARSER_FIELD ( sequence_number, Parse_UInt16 ); - SENF_PARSER_PRIVATE_BITFIELD ( reserved, 3, unsigned ); - SENF_PARSER_BITFIELD ( receive_capable_feed, 1, bool ); // 0=send only, 1=receive_capable_feed - SENF_PARSER_BITFIELD ( ip_version, 4, unsigned ); // 4=IPv4, 6=IPv6 - SENF_PARSER_FIELD ( tunnel_protocol, Parse_UInt8 ); - /* Please consider the following comments on the implementation given in this class: - * 1. you could think of simply using SENF_PARSER_PRIVATE_VARIANT and List / Vectorparser like this: - * SENF_PARSER_PRIVATE_VARIANT ( fbiplist, ip_version, - * (senf::VoidPacketParser) //ip_version=0 - * (senf::VoidPacketParser) //1 - * (senf::VoidPacketParser) //2 - * (senf::VoidPacketParser) //3 - * (senf::Parse_ListB< IpV4Packet, num_of_fbips>) //4 - * (senf::VoidPacketParser) //5 - * (senf::Parse_ListB< IpV6Packet, num_of_fbips>) ); //6 - * This can't work for two reasons: - * -SENF_PARSER_PRIVATE_VARIANT only accepts 6 templates in types but you have to start from 0. - * -you NEVER can use templated Parsers in these macros since the macro-preprocessor won't recognize the <> brackets and will - * interpret the "," - * - * The first problem is solved by using (actually inventing) SENF_PARSER_VARIANT_TRANS which has the same limitations - * concerning the number of types but isn't limited to the values used. This is achieved by a translating function - * as you can see. - * The second problem is solved by introducing Helper-Parser which cover both the list and the number field. By that no - * templates have to be used. - */ - - struct ip_version_translator { - static unsigned fromChooser(ip_version_t::value_type in) { - switch (in) { - case 4: return 0; - case 6: return 1; - } - } - static ip_version_t::value_type toChooser(unsigned in) { - switch (in) { - case 0: return 4; - case 1: return 6; - } - } - }; - - SENF_PARSER_VARIANT_TRANS ( fbiplist, ip_version, ip_version_translator, - (senf::DTCPIpV4AddressListParser) //IPv4 - (senf::DTCPIpV6AddressListParser) ); //IPv6 - - SENF_PARSER_FINALIZE(Parse_DTCPPacket); - }; - - /** \brief DTCP packet - - \par Packet type (typedef): - \ref DTCPPacket - - \par Fields: - \ref Parse_DTCPPacket - - \ingroup protocolbundle_mpegdvb - */ - struct DTCPPacketType - : public PacketTypeBase, - public PacketTypeMixin - { - typedef PacketTypeMixin mixin; - typedef ConcretePacket packet; - typedef Parse_DTCPPacket parser; - - using mixin::nextPacketRange; - using mixin::init; - using mixin::initSize; - - static void dump(packet p, std::ostream & os); - }; - - /** \brief DTCP packet typedef */ - typedef DTCPPacketType::packet DTCPPacket; -} - -#endif /*DTCPPACKET_HH_*/ diff --git a/Packets/Mainpage.dox b/Packets/Mainpage.dox index 22a0f1b..166c6f0 100644 --- a/Packets/Mainpage.dox +++ b/Packets/Mainpage.dox @@ -35,7 +35,7 @@ \code senf::EthernetPacket eth (senf::EthernetPacket::create()); - senf::IpV4Packet ip (senf::IpV4Packet ::createAfter(ethernet)); + senf::IPv4Packet ip (senf::IPv4Packet ::createAfter(ethernet)); senf::UDPPacket udp (senf::UDPPacket ::createAfter(ip)); senf::DataPacket payload (senf::DataPacket ::createAfter(udp, std::string("Hello, world!"))); @@ -80,7 +80,7 @@ \code eth.next() == ip; // true - eth.next().is(); // true + eth.next().is(); // true eth.next().next() == udp; // true eth.next().is(); // false eth.next() == udp; // true @@ -88,7 +88,7 @@ udp.next(); // throws InvalidPacketChainException udp.next(senf::nothrow); // a senf::Packet testing as false udp.findNext == udp; // true - udp.first() == ip; // true + udp.first() == ip; // true udp.prev() == ip; // true udp.prev() == eth // true diff --git a/Packets/PacketParser.ih b/Packets/PacketParser.ih index defec14..00b5636 100644 --- a/Packets/PacketParser.ih +++ b/Packets/PacketParser.ih @@ -61,6 +61,16 @@ namespace detail { template struct ParserInitBytes_Choose : public boost::integral_constant {}; + // ^^-- g++ error signaled here: + // error: 'fixed_bytes' is not a member of 'some-class-name' + // + // The 'some-class-name' class (as given in the error message) does not seem to be a parser at + // all (it has neither a 'fixed_bytes' nor an 'init_bytes' member). + // + // Either 'some-class-name' is not the class you wanted to use (it really is no parser) or you + // left out either 'init_bytes' or 'fixed_bytes' when defining the parser. This will also + // happen, if you forget to call 'SENF_PARSER_FINALIZE()' when defining a composite parser. + /////////////////////////////////////////////////////////////////////////////////////////////// // If Parser::init_bytes is not defined, this specialization is chosen which instead uses // 'Parser::fixed_bytes' diff --git a/Packets/ParseListN.test.cc b/Packets/ParseListN.test.cc index 7decaa3..bd78e2f 100644 --- a/Packets/ParseListN.test.cc +++ b/Packets/ParseListN.test.cc @@ -44,7 +44,7 @@ namespace { SENF_PARSER_PRIVATE_FIELD( size, senf::Parse_UInt8 ); SENF_PARSER_VEC_N( vec, size, senf::Parse_UInt16 ); - + SENF_PARSER_FINALIZE(MyVec); }; } diff --git a/Packets/ParseVariant.hh b/Packets/ParseVariant.hh index 0c33791..f7e9670 100644 --- a/Packets/ParseVariant.hh +++ b/Packets/ParseVariant.hh @@ -164,8 +164,9 @@ namespace senf { This macro is a special helper to define a senf::Parse_Variant_Direct type field. This is a variant field which chooses the sub-type by directly taking the value of some other field. - This is a dynamically sized parser. Nevertheless, the chooser field \e must have a \e fixed - distance to this field, the \a chooser must be a fixed-size value parser. + \warning + This is a dynamically sized parser. Nevertheless, the chooser field \e must have a + \e fixed distance to this field, the \a chooser must be a fixed-size value parser. \code struct SomeParser : public PacketParserBase @@ -180,7 +181,7 @@ namespace senf { (senf::Parse_UInt24) (senf::Parse_UInt32) ); - senf::Parse_UInt8 uint8() const { return content().get<1>(); } + senf::Parse_UInt8 uint8() const { return content().get<1>(); } senf::Parse_UInt16 uint16() const { return content().get<2>(); } senf::Parse_UInt24 uint24() const { return content().get<3>(); } senf::Parse_UInt32 uint32() const { return content().get<4>(); } @@ -244,8 +245,7 @@ namespace senf { default : return 2 ; } } - - static chooser_field_t::value_type foChooser(unsigned value) { + static chooser_field_t::value_type toChooser(unsigned value) { static chooser_field_t::value_type table[] const = { 1, 5, 0 }; return table[value]; }