Managers provide the ability to instantiate and utilize the various plugins
in Snort++.  There is a separate manager class for each plugin type, plus
one for modules, plugins, scripts, and packets.

The only plugin that is reloadable is Inspector.  It has reference counts
so that it won't be freed while an active flow is using it.

When reload removes an inspector, packet threads normally call tterm() on
the old inspector while terminating the removed map.  If the inspector still
has references on that packet thread, for example through flow->gadget,
InspectorManager defers tterm() instead.  The pending entry is thread local
and stores only the Inspector*.  It also takes a self-reference so the
inspector object cannot be deleted before the pending tterm() is drained.

The pending entry intentionally does not store NetworkPolicy or
InspectionPolicy pointers because the old SnortConfig can be reaped before
the deferred tterm() runs.  Pending tterm() entries are drained during
thread reinitialization, thread termination, or when a flow releases the
pending service gadget reference once the thread's refcount has dropped
to the self-reference.

During reload, InspectorManager does not blindly rebind stale flow gadgets.
If a pending tterm() has already run, packet processing clears the old
gadget and resets flow->service to nullptr so binder and wizard can
rediscover the service.

Dropped inspectors that still own surviving flows can opt in to the
ReloadSurvivorSubscriptions (RSS) framework so their DataBus handlers
keep firing across reload generations.  During reconcile_map(), each
newly-dropped inspector gets a chance to attach handlers to the
matching policy in the new SnortConfig, matched by user_policy_id.
A second pass walks the RSS registry to cover survivors from earlier
reloads that are no longer in the previous InspectorVector but still
need handlers rebound to the new DataBus.  If the matching policy no
longer exists in the new config, handlers are not registered and the
inspector drains normally instead.

rss_list_survivors() hands reconcile_map() a raw Inspector* snapshot
while holding the registry lock only briefly, then releases it.
Without further synchronization a packet thread's finish_pending_tterm()
could call tterm() on that same survivor while reconcile_map() is still
reading/rebuilding its state on the main thread.  RSS closes this with
a per-entry "reconciling" flag: rss_list_survivors() sets it on every entry
it returns, and rss_await_quiescent() (which every object-level tterm()
path calls before tterm()) refuses to proceed while it is set,
returning false instead.  A scope-bound reconciliation guard owns the
snapshot in reconcile_map() and clears every returned entry when the
survivor sweep ends, including policy-lookup failures and early skips.
The reconciling window therefore lasts for the duration of the sweep,
not just the processing time for one survivor.
finish_pending_tterm() treats a false rss_await_quiescent() as "not yet"
and leaves the pending_tterm entry queued for the next drain call.  The
one exception is InspectorManager::thread_term()'s full-shutdown path:
since the thread is exiting and nothing will retry the drain afterward,
it blocks on rss_await_quiescent() (finish_pending_tterm_blocking())
instead of dropping the entry -- reconciliation delays completion until
the active survivor sweep ends, while an in-flight callback may keep the
wait running longer.  rss_await_quiescent()
only drains in-flight dispatch leases; it does not prevent a later callback
from starting.  A survivor handler that receives owner-identifying context
must validate that context before accessing owner-specific state.  A handler
without owner-identifying context must limit itself to state guaranteed to
outlive the inspector's tterm(); an owner-agnostic handler that needs
inspector-specific state must not be a survivor subscription.  Replacement
leaves the new instance's normal handler and the outgoing instance's
survivor handler on the same event, so a survivor handler runs once per
surviving generation and must be idempotent.  Safety after tterm() alone
does not justify surviving.  The handler
subscriptions are retired later, in
rss_release(), whose sole caller is ~Inspector once every thread slot
is inactive.

The same-API replacement and deferred cleanup paths retry while
rss_await_quiescent() reports that reconciliation is active.  These retries
are intentionally unbounded for correctness.  Every refusal bumps
rss_reconcile_deferrals, and a gate held past the slow-wait threshold warns,
naming the survivor, the configuration the gate opened on top of and how many
release or quiescence requests it has refused.  Like a slow drain it re-warns
at a widening interval rather than once, since a skipped rss_end_reconcile()
makes every later release fail for good -- that pairing is what the warning
points at.

If reload initializes a same-API inspector while an old same-API inspector
is removed, the old inspector's tterm() may run before the new tinit() to
avoid colliding thread-local state.  Other referenced removed inspectors
stay on the deferred cleanup path.

Only the action, codec, and inspector managers have thread local state:

* action manager has an action function
* codec manager has the grinder and related stats
* inspector manager has the current InspectorVector pointer and pending
  deferred tterm() entries

Some Lua files are here as they are coupled closely with C++ code in this
directory (module_manager.cc):

* bootstrap.lua provides FFI for adding table names and prefixes to
  snort's lua whitelist. This whitelist is used to ignore warnings
  when snort modules are not found for table names. This file also
  has the FFI used to resolve file includes in lua file.

* finalize.lua provides the ability to parse a Lua configuration.  It
  is much easier to traverse the Lua tables via Lua itself.  This file
  leverages the LuaJIT FFI to open and close tables and set values.

* snort_plugin.lua provides FFI for script plugins (ips options and
  loggers).  This is pretty thin at the moment and should be expanded to
  provide more data.

These Lua files get installed in LUA_PATH.

Module manager recursively sets default values for all parameters within a
module.  While list items have default values, default lists are not
provided by modules; that is strictly done in Lua with snort_defaults.lua.
This not only simplifies the code somewhat, it also makes the most sense
from a user perspective.

The ConnectorManager (and associated) classes manage the set of Connector
objects.  One ConnectorCommon is created to encapsulate a vector of
configuration objects.  At thread startup, these config objects are used
to instantiate thread specific instances of each configured Connector.
