From: g0dil Date: Thu, 17 Jan 2008 15:07:28 +0000 (+0000) Subject: Packtes: Add missing 'nothrow' parameters X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=53abe407b3c60b165f5d7e55d7c63b1b2b7227aa;p=senf.git Packtes: Add missing 'nothrow' parameters git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@619 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Examples/RateStuffer/ratestuffer.cc b/Examples/RateStuffer/ratestuffer.cc index b9e774c..c9dbd89 100644 --- a/Examples/RateStuffer/ratestuffer.cc +++ b/Examples/RateStuffer/ratestuffer.cc @@ -47,8 +47,8 @@ class RateFilter SENF_PPI_MODULE(RateFilter); public: - connector::ActiveInput input; - connector::ActiveOutput output; + connector::ActiveInput<> input; + connector::ActiveOutput<> output; RateFilter(senf::ClockService::clock_type interval); @@ -82,8 +82,8 @@ class RateStuffer RateFilter rateFilter; public: - connector::PassiveInput & input; - connector::ActiveOutput & output; + connector::PassiveInput<> & input; + connector::ActiveOutput<> & output; RateStuffer(senf::ClockService::clock_type interval, senf::Packet packet, diff --git a/Packets/DefaultBundle/IPv6Extensions.hh b/Packets/DefaultBundle/IPv6Extensions.hh index 728a621..7f1bcbc 100644 --- a/Packets/DefaultBundle/IPv6Extensions.hh +++ b/Packets/DefaultBundle/IPv6Extensions.hh @@ -93,7 +93,7 @@ namespace senf { static void dump(packet p, std::ostream & os); static void finalize(packet p) - { p->nextHeader() << key(p.next()); } + { p->nextHeader() << key(p.next(nothrow)); } }; /** \brief IPv6 fragment extension packet typedef */ diff --git a/Packets/DefaultBundle/IPv6Packet.cc b/Packets/DefaultBundle/IPv6Packet.cc index 2f3fe8b..7f4029c 100644 --- a/Packets/DefaultBundle/IPv6Packet.cc +++ b/Packets/DefaultBundle/IPv6Packet.cc @@ -66,7 +66,7 @@ prefix_ void senf::IPv6PacketType::dump(packet p, std::ostream & os) prefix_ void senf::IPv6PacketType::finalize(packet p) { p->length() << (p.size() - IPv6PacketParser::fixed_bytes); - p->nextHeader() << key(p.next()); + p->nextHeader() << key(p.next(nothrow)); } ///////////////////////////////cc.e//////////////////////////////////////// diff --git a/Packets/DefaultBundle/LlcSnapPacket.cc b/Packets/DefaultBundle/LlcSnapPacket.cc index e804d8f..99461bb 100644 --- a/Packets/DefaultBundle/LlcSnapPacket.cc +++ b/Packets/DefaultBundle/LlcSnapPacket.cc @@ -61,7 +61,7 @@ prefix_ senf::PacketInterpreterBase::factory_t senf::LlcSnapPacketType::nextPack prefix_ void senf::LlcSnapPacketType::finalize(packet p) { - optional_registry_key_t k = key(p.next()); + optional_registry_key_t k = key(p.next(nothrow)); if (k) p->type_length() << k; else diff --git a/Packets/MPEGDVBBundle/GREPacket.hh b/Packets/MPEGDVBBundle/GREPacket.hh index 87c3e2a..26a4a19 100644 --- a/Packets/MPEGDVBBundle/GREPacket.hh +++ b/Packets/MPEGDVBBundle/GREPacket.hh @@ -95,7 +95,7 @@ namespace senf { return p->protocol_type(); } static void finalize(packet p) { - p->protocol_type() << key(p.next()); + p->protocol_type() << key(p.next(nothrow)); p->version_number() = 0; // as per RFC2784, 2.3.1 if (p->checksum_present()) { diff --git a/Packets/MPEGDVBBundle/MPESection.cc b/Packets/MPEGDVBBundle/MPESection.cc index 5cbc486..8035cdb 100644 --- a/Packets/MPEGDVBBundle/MPESection.cc +++ b/Packets/MPEGDVBBundle/MPESection.cc @@ -99,7 +99,7 @@ prefix_ senf::PacketInterpreterBase::factory_t senf::MPESectionType::nextPacketT prefix_ void senf::MPESectionType::finalize(packet p) { - p->llc_snap_flag() = p.next().is() ? 1 : 0; + p->llc_snap_flag() = p.next(nothrow) && p.next().is() ? 1 : 0; p->section_length() = p.data().size() - 3; // p->crc() = p->calcCrc(); } diff --git a/Packets/MPEGDVBBundle/TLVPacket.ct b/Packets/MPEGDVBBundle/TLVPacket.ct index 1b965a4..9afc7d7 100644 --- a/Packets/MPEGDVBBundle/TLVPacket.ct +++ b/Packets/MPEGDVBBundle/TLVPacket.ct @@ -43,10 +43,15 @@ prefix_ void senf::TLVPacketType::dump(packet p, std:: template prefix_ void senf::TLVPacketType::finalize(packet p) { - PacketData::size_type size = p.next().data().size(); - if ( size > LengthParser::max_value ) - throw(UnsuportedTLVPacketException()); - p->length() = size; + try { + PacketData::size_type size = p.next().data().size(); + if ( size > LengthParser::max_value ) + throw(UnsuportedTLVPacketException()); + p->length() = size; + } + catch (InvalidPacketChainException & ex) { + ; + } } template diff --git a/Packets/PacketType.hh b/Packets/PacketType.hh index 8a519db..6f07b6b 100644 --- a/Packets/PacketType.hh +++ b/Packets/PacketType.hh @@ -276,7 +276,7 @@ namespace senf { // Set the type field by querying the type of the next packet. This is an // optional assignment: If the key is not found, the value returned by 'key' // is an empty optional and the assignment will be skipped. - p->typeField << key(p.next()); + p->typeField << key(p.next(senf::nothrow)); // optionally complete the packet by generating auto-generated information // (like checksums)