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-15 allows for a version-specific parameter type that restricts one.

Four types do. FORWARD, Section 9.2.1.10: “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.1.6, says the same of Ascending (0x1) and Descending (0x2). SUBSCRIBER_PRIORITY, Section 9.2.1.5: “The range is restricted to 0-255. If a publisher receives a value outside this range, it MUST close the session with PROTOCOL_VIOLATION.” DYNAMIC_GROUPS, Section 9.2.1.11: “Values larger than 1 are a Protocol Violation.”

Group Order is the one to read twice. Where drafts 07 through 14 carried it as a message field and let a request send 0x0 to mean “no preference”, the parameter form has no such value: a subscriber with no preference omits the parameter, and 0x0 closes the session in every message that carries it. The asymmetry that governs the field form does not survive into this one.

PUBLISHER_PRIORITY (0x0E) is deliberately absent. Section 9.2.1.4 says “The value is from 0 to 255 and lower numbers get higher priority”, points at Section 7 for the ordering itself, and adds “Priorities above 255 are invalid.” — and stops, where each of the four above names a consequence in the next clause. Adding it here would close sessions on a sentence the draft did not write.