Skip to main content

parameter_value_in_range

Function parameter_value_in_range 

Source
fn parameter_value_in_range(key: u64, value: u64) -> bool
Expand description

Whether value is inside the range draft-16 allows for a Message Parameter type that restricts one.

Four types do. FORWARD, Section 9.2.2.8: “The allowed values are 0 (don’t forward) or 1 (forward). If an endpoint receives a value outside this range, it MUST close the session with PROTOCOL_VIOLATION.” GROUP_ORDER, Section 9.2.2.4, says the same of Ascending (0x1) and Descending (0x2). SUBSCRIBER_PRIORITY, Section 9.2.2.3: “The range is restricted to 0-255. If a publisher receives a value outside this range, it MUST close the session with PROTOCOL_VIOLATION.” DELIVERY_TIMEOUT, Section 9.2.2.2: “DELIVERY_TIMEOUT, if present, MUST contain a value greater than 0. If an endpoint receives a DELIVERY_TIMEOUT equal to 0 it MUST close the session with PROTOCOL_VIOLATION.”

The fourth is stated by draft-16 alone, and stated twice — once here and once in Section 11.1 of the extension header namespace, which track_extension_value_in_range answers. Draft-15 has no such sentence and draft-17 renamed the type to OBJECT_DELIVERY_TIMEOUT and dropped the range, so this is one draft wide in both namespaces. A zero timeout is the case worth having: it reads as “no timeout” to an implementation that treats absence and zero alike, which is the opposite of what a timeout of zero would mean if it were legal.

Draft-15’s fourth entry, DYNAMIC_GROUPS, is not here: draft-16 moved it out of the parameter registry and into the extension header registry as a Track Extension, where track_extension_value_in_range holds it to the range it states there. Draft-15’s PUBLISHER_PRIORITY is gone for a different reason — draft-16 does not define the parameter at all.