SENF_PPI_MODULE(RateFilter);
public:
- connector::ActiveInput input;
- connector::ActiveOutput output;
+ connector::ActiveInput<> input;
+ connector::ActiveOutput<> output;
RateFilter(senf::ClockService::clock_type interval);
RateFilter rateFilter;
public:
- connector::PassiveInput & input;
- connector::ActiveOutput & output;
+ connector::PassiveInput<> & input;
+ connector::ActiveOutput<> & output;
RateStuffer(senf::ClockService::clock_type interval,
senf::Packet packet,
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 */
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////////////////////////////////////////
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
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()) {
prefix_ void senf::MPESectionType::finalize(packet p)
{
- p->llc_snap_flag() = p.next().is<LlcSnapPacket>() ? 1 : 0;
+ p->llc_snap_flag() = p.next(nothrow) && p.next().is<LlcSnapPacket>() ? 1 : 0;
p->section_length() = p.data().size() - 3;
// p->crc() = p->calcCrc();
}
template <class TypeParser, class LengthParser>
prefix_ void senf::TLVPacketType<TypeParser, LengthParser>::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 <class TypeParser, class LengthParser>
// 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)