1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! The autonomous-injector declaration a writer sends on a command socket.
/// Control-frame prefix a writer uses to declare that it is an AUTONOMOUS
/// INJECTOR: a producer of commands generated on the node rather than by a
/// human operator (the plugin host driving guided setpoints, the MSP relay).
/// The rest of the payload is the writer's `client_id`, optionally followed by
/// `;ticket=<ticket>` — the attestation the FC-write path verifies against the
/// pairing key so a spoofed `client_id` cannot claim the injector lane.
///
/// Like [`super::IPC_DECLARE_OFF_BOX_SOURCE`] this is one-way and downward: declaring
/// injector can only ever SUBJECT the writer to the PIC arbiter (an operator
/// holding the manual-control claim refuses it), never grant it authority. A
/// writer that does not declare is treated as the operator/human path and is
/// NEVER gated — the load-bearing invariant. Sticky for the connection, never
/// forwarded to the flight controller.
pub const IPC_DECLARE_INJECTOR_PREFIX: & = b"\x00ados-ipc/injector=";
/// A writer's declared autonomous-injector identity (see
/// [`IPC_DECLARE_INJECTOR_PREFIX`]). Carried raw to the FC-write path, which
/// verifies `ticket` against the pairing key before treating `client_id` as the
/// attested injector; a `None` ticket is an unverified claim that can never win
/// the lane away from a human holder.
/// Build the [`IPC_DECLARE_INJECTOR_PREFIX`] control frame a writer sends to
/// declare itself an autonomous injector. The inverse of
/// [`parse_injector_declaration`], kept beside it so a producer's declaration
/// and the router's parse cannot drift on the wire format. `ticket` is the
/// pairing-key attestation for `client_id`; omit it on an unpaired node.
/// Parse an [`IPC_DECLARE_INJECTOR_PREFIX`] control frame into an
/// [`InjectorClaim`]. `None` when the payload is not an injector declaration or
/// carries an empty client id (a declaration with no identity is not a claim).