X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FPPI%2FConnectors.cc;h=04ce2bd056b856023ca88a9b3afa80dbf3676db1;hb=c92498e86ff9f107be25e9cf159c38f7122dbfc7;hp=debe7ec32acbf72b8009b026eb2143f3048fd7fc;hpb=45b346fa3a120720280b67b0f405b1954c0885d4;p=senf.git diff --git a/senf/PPI/Connectors.cc b/senf/PPI/Connectors.cc index debe7ec..04ce2bd 100644 --- a/senf/PPI/Connectors.cc +++ b/senf/PPI/Connectors.cc @@ -120,40 +120,44 @@ namespace { ConsoleRegister::ConsoleRegister() { senf::ppi::ModuleManager::instance().consoleDir() - .add("tracing", SENF_FNP(senf::ppi::connector::Connector::TraceState, - senf::ppi::connector::Connector::tracing, ())) - .doc("Log every packet sent or received by any module.\n" - "There are three different tracing levels:\n" - "\n" - " NO_TRACING don't output any tracing information\n" - " TRACE_IDS trace packet id's but do not show packet contents\n" - " TRACE_CONTENTS trace complete packet contents\n" - "\n" - "A log message is generated whenever the packet traverses a connector. The\n" - "TRACE_IDS log message has the following format:\n" - "\n" - " PPI packet trace: \n" - " on connector \n" - " PPI throttling trace: \n" - " on connector \n" - "\n" - "The fields are:\n" - "\n" - " direction 'IN' for packets/throttle notifications entering the module,\n" - " 'OUT' for packets/throttle notifications leaving it\n" - " packet-id Numeric unique packet id. This value is unique for packets\n" - " alive at the same time, packets at different times may (and\n" - " will) share id's\n" - " packet-type The type of the packet header\n" - " module-id Unique module id\n" - " module-type Type of the module the packet is sent to/from\n" - " connector-id Unique connector id\n" - " throttle-msg Type of throttling event\n"); + .add("tracing", senf::console::factory::Command( + SENF_FNP(senf::ppi::connector::Connector::TraceState, + senf::ppi::connector::Connector::tracing, ())) + .doc("Log every packet sent or received by any module.\n" + "There are three different tracing levels:\n" + "\n" + " NO_TRACING don't output any tracing information\n" + " TRACE_IDS trace packet id's but do not show packet contents\n" + " TRACE_CONTENTS trace complete packet contents\n" + "\n" + "A log message is generated whenever the packet traverses a connector. The\n" + "TRACE_IDS log message has the following format:\n" + "\n" + " PPI packet trace: \n" + " on connector \n" + " PPI throttling trace: \n" + " on connector \n" + "\n" + "The fields are:\n" + "\n" + " direction 'IN' for packets/throttle notifications entering the module,\n" + " 'OUT' for packets/throttle notifications leaving it\n" + " packet-id Numeric unique packet id. This value is unique for packets\n" + " alive at the same time, packets at different times may (and\n" + " will) share id's\n" + " packet-type The type of the packet header\n" + " module-id Unique module id\n" + " module-type Type of the module the packet is sent to/from\n" + " connector-id Unique connector id\n" + " throttle-msg Type of throttling event\n") + ); senf::ppi::ModuleManager::instance().consoleDir() - .add("tracing", SENF_FNP(void, senf::ppi::connector::Connector::tracing, - (senf::ppi::connector::Connector::TraceState))) - .arg("state", "new tracing state"); + .add("tracing", senf::console::factory::Command( + SENF_FNP(void, senf::ppi::connector::Connector::tracing, + (senf::ppi::connector::Connector::TraceState))) + .arg("state", "new tracing state") + ); } ConsoleRegister consoleRegister; @@ -268,6 +272,13 @@ prefix_ void senf::ppi::connector::ActiveConnector::registerRoute(ForwardingRout notifyRoutes_.push_back(&route); } +prefix_ void senf::ppi::connector::ActiveConnector::unregisterRoute(ForwardingRoute & route) +{ + NotifyRoutes::iterator i (std::find(notifyRoutes_.begin(), notifyRoutes_.end(), &route)); + if (i != notifyRoutes_.end()) + notifyRoutes_.erase(i); +} + /////////////////////////////////////////////////////////////////////////// // senf::ppi::connector::InputConnector