DOC: filters: Document the filter instance mode and the legacy mode
The filter API was reworked to support filter instances declared with
"filter-config" and referring to a filter class, while the historical
"filter" directive is still supported through the legacy mode. Update the
documentation accordingly.
In the internal API documentation, define the new wording: a "filter
instance" is the configuration entity declared in a proxy, which is
user-visible, and a "stream filter instance" is the per-stream entity
attached to a stream, represented by 'struct filter' in the code.
Explain the two declaration modes and how a proxy selects one of them: the
explicit declarations select the mode and a proxy using only implicit
filters works in the new mode, unless the "filter-api" global option is set
to "downgrade-to-legacy". Describe how to write a filter for the new mode:
the filter class, its registration and placement, the instance parse
callback and its constraints. In particular, the instances are finalized
after the whole configuration was parsed, their configuration is shared and
read-only, they are disabled by default and they may be implicit or
inherited. Explain how the legacy mode is kept working and how the parsing
code can be shared between both modes with flt_parse_instance_legacy().
Update the descriptions of the filter configuration and instance structures,
document the helpers used to reference a filter configuration from other
directives (flt_has_filter(), flt_foreach_conf() and flt_find_conf()) and
add the FAQ section announced by the summary.
In the configuration manual, document the "filter-config", "filter-enable",
"filter-disable" and "filter-sequence" directives, their interaction with
the legacy "filter" directive, the two declaration modes, the
"legacy-filter-mode" global option enforcing the legacy mode on the proxies
without explicit declaration, and the "filter-config" syntax of every
supported filter. In the management manual, document the "show filter
classes", "show filter instance" and "show filter instances" CLI commands.