THREAD_LOCAL OdpThreadContext* odp_thread_local_ctxt = nullptr;
THREAD_LOCAL OdpContext* pkt_thread_odp_ctxt = nullptr;
-unsigned AppIdInspector::pub_id = 0;
+unsigned AppIdInspector::cached_global_pub_id = 0;
+static THREAD_LOCAL unsigned appid_pub_id = 0;
static THREAD_LOCAL PacketTracer::TracerMute appid_mute;
assert(ctxt);
return *ctxt;
}
+unsigned AppIdInspector::get_pub_id()
+{
+ return appid_pub_id;
+}
bool AppIdInspector::configure(SnortConfig* sc)
{
DataBus::subscribe_global(intrinsic_pub_key, IntrinsicEventIds::FLOW_NO_SERVICE,
new AppIdServiceEventHandler(*this), *sc);
- pub_id = DataBus::get_id(appid_pub_key);
+ cached_global_pub_id = DataBus::get_id(appid_pub_key);
+ appid_pub_id = cached_global_pub_id;
return true;
}
void AppIdInspector::tinit()
{
+ appid_pub_id = cached_global_pub_id;
appid_mute = PacketTracer::get_mute();
AppIdStatistics::initialize_manager(*config);
AppIdContext& get_ctxt() const;
const AppIdConfig& get_config() const { return *config; }
- static unsigned get_pub_id() { return pub_id; }
+ static unsigned get_pub_id();
private:
const AppIdConfig* config = nullptr;
AppIdContext* ctxt = nullptr;
- static unsigned pub_id;
+ static unsigned cached_global_pub_id;
};
extern const snort::InspectApi appid_inspector_api;