From 03fe0ba806f11b11c6a0629cf380edfbd5d9728d Mon Sep 17 00:00:00 2001 From: mikael-lovqvists-claude-agent Date: Wed, 25 Mar 2026 22:30:56 +0000 Subject: [PATCH] Change discovery function field to u16 bitfield A node can declare multiple roles simultaneously (e.g. relay + sink). Replaces the function string with a fixed-size flags field; keeps the payload layout simple and fixed-width up to the name. Co-Authored-By: Claude Sonnet 4.6 --- architecture.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/architecture.md b/architecture.md index 355e471..0823301 100644 --- a/architecture.md +++ b/architecture.md @@ -321,10 +321,20 @@ Payload fields: |---|---|---| | `protocol_version` | u8 | Wire format version | | `tcp_port` | u16 | Port where this node accepts transport connections | +| `function_flags` | u16 | Bitfield declaring node capabilities (see below) | | `name_len` | u8 | Length of name string | | `name` | bytes | Node name (`namespace:instance`, e.g. `v4l2:microscope`) | -| `function_len` | u8 | Length of function string | -| `function` | bytes | Node function identifier (`source`, `relay`, `sink`, ...) | + +`function_flags` bits: + +| Bit | Mask | Meaning | +|---|---|---| +| 0 | `0x0001` | Source — produces video | +| 1 | `0x0002` | Relay — receives and distributes streams | +| 2 | `0x0004` | Sink — consumes video (display, archiver, etc.) | +| 3 | `0x0008` | Controller — participates in control plane coordination | + +A node may set multiple bits — a relay that also archives sets both `RELAY` and `SINK`. ### Behaviour