3.3.1. Location Filters
A Location filter specifies an inclusive range of Locations. Only objects with Locations within the inclusive range pass the filter. A Location filter is encoded as specified in Section 9.20.10.
Subscribers can specify a Location filter on a subscription indicating to the publisher which Objects to send. Subscriptions without a filter pass all Objects published or received via upstream subscriptions.
Fetch requests can also specify a Location filter. Fetch requests without a
filter include all Locations from {0, 0} up to Largest Object
(Section 3.1.3).
Some Location filters are defined to be relative to the Largest Object
(Section 3.1.3).
A Location Filter on a subscription is always valid, even if it specifies a range entirely before Largest Object.
Note that due to network reordering or prioritization, relays can receive
Objects with Locations smaller than Largest Object after the filter is
processed, but these Objects do not pass a filter that starts at the Next
Object.
A publisher MUST NOT send subscription-delivered objects from outside the requested range. Because updating filters is asynchronous, subscribers can receive objects outside the current filter.
A publisher does not end a subscription solely because the Largest Object advances past the end of the current Location Filter.
Fill-delivered objects are governed by the Location filter in FILL_PARAMETERS (see Section 3.4).
3.3.2. Range Filters
Range Filters are parameters in SUBSCRIBE, FETCH, or SUBSCRIBE_TRACKS that tell a publisher to filter tracks (via TRACK PROPERTY FILTER) and objects according to subscriber-provided criteria. Range filters are specified as ranges of integer values in Track and Object Properties and other Object header fields (Subgroup ID, Object ID, and Publisher Priority). There are five Range Filter parameter types, 0x25-0x29. They share the encoding specified in Section 8.6.
An object matches the filter if its value falls within any Range (i.e., Ranges are OR'd within a filter parameter).
Filter parameters with the same SetID are AND'd; distinct SetIDs are OR'd. The final result is SetID=0 OR SetID=1 OR ... SetID=255, where each SetID=i is the AND of all filter parameters carrying that SetID.
The Track Property filter parameter MAY appear multiple times in a SUBSCRIBE_TRACKS message or REQUEST_UPDATE for it. All other filter parameters MAY appear multiple times in a FETCH, SUBSCRIBE, SUBSCRIBE_TRACKS, or REQUEST_UPDATE (on a subscription, from the subscriber only) message. If the same combination of Parameter Type, SetID, and Property Type (only in the Track and Object Property Filters) repeat in any message, an endpoint MUST reject this with REQUEST_ERROR with error code INVALID_FILTER.
In REQUEST_UPDATE, Length of 0 removes the filter; non-zero replaces it entirely. If a filter parameter is omitted from REQUEST_UPDATE, it is unchanged. If omitted from other messages, the default is no filter.
Range Filters are only allowed if the setup option MAX_FILTER_RANGES is non-zero, which limits the total number of Ranges allowed in all Range Filter parameters for a given subscription or fetch. If this limit is exceeded, an endpoint MUST reject this with REQUEST_ERROR with error code INVALID_FILTER.
The Track Property Filter can be used in SUBSCRIBE_TRACKS to filter PUBLISH messages with required Track Property types and values. PUBLISH messages which pass the filter will be forwarded while those which do not pass it will not be forwarded nor will any Objects.
The Object Property Filter can be used to filter Objects with required Object Property types and values. It only filters Object Properties in the Object header, and does not evaluate Track Properties in PUBLISH messages.
3.3.3. Combining Filters
All filter types are combined using logical "AND" operations to further restrict which tracks and objects pass all filter criteria. This includes all Range Filters Section 3.3.2 and Location Filters Section 3.3.1, which can be evaluated in any order. The Forward parameter is also a type of filter. The publisher MUST forward only objects that pass all filters.
Pass = Forward AND Location Filters AND Range Filters