53 thread_ = std::thread{&NEMOTAAdapter::processPacketQueue,
this};
58 ERROR_LEVEL,
"NEMOTAAdapter::NEMOTAAdapter: Unable to set Priority");
64 if(!bCancel_ && thread_.joinable())
84 if(thread_.joinable())
102 std::lock_guard<std::mutex> m(mutex_);
104 queue_.emplace_back(pkt, msgs);
110 void EMANE::NEMOTAAdapter::processPacketQueue()
114 std::unique_lock<std::mutex> lock(mutex_);
116 while(queue_.empty() && !bCancel_)
126 DownstreamPacketQueue queue{};
132 for(
auto & entry : queue)
138 catch(std::exception & exp)
143 "NEMOTAAdapter::processPacketQueue Excepetion caught: %s",
151 "NEMOTAAdapter::processPacketQueue Excepetion caught");
A Packet class that allows upstream processing to strip layer headers as the packet travels up the st...
void registerOTAUser(NEMId id, OTAUser *pOTAUser) override
void sendOTAPacket(NEMId id, const DownstreamPacket &pkt, const ControlMessages &msgs) const override
void processOTAPacket(UpstreamPacket &pkt, const ControlMessages &msgs)
std::list< const ControlMessage * > ControlMessages
Specialized packet the allows downstream processing to add layer specific headers as the packet trave...
void unregisterOTAUser(NEMId id) override
void processDownstreamPacket(DownstreamPacket &pkt, const ControlMessages &msgs)
void sendUpstreamPacket(UpstreamPacket &pkt, const ControlMessages &msgs=empty)
#define LOGGER_STANDARD_LOGGING(logger, level, fmt, args...)
static OTAManager * instance()
int elevate(std::thread &thread)