(** APID virtual switch orchestrator. Accepts guest connections, routes frames between tenants, enforces APID ownership and inter-guest policy. *) type t (** The switch instance. *) val v : config:Config.t -> ?on_system:(Space_wire.Msg.t -> Space_wire.Msg.t option) -> ?on_uplink:(Space_wire.Msg.t -> unit) -> unit -> t (** [v ~config ?on_system ?on_uplink ()] builds a switch. @param on_system Handler for system-range APIDs (0x001–0x00F). Returns an optional response frame. @param on_uplink Handler for frames destined for DTN uplink. *) val pp : Format.formatter -> t -> unit (** Pretty-print a switch (shows configuration summary). *) val run : t -> sw:Eio.Switch.t -> net:_ Eio.Net.t -> unit (** [run t ~sw ~net] starts the switch: creates per-tenant Unix sockets, accepts guests, and routes frames. *) val inject : t -> Space_wire.Msg.t -> unit (** [inject t frame] injects a frame from DTN (no source validation). *) val stop : t -> unit (** [stop t] signals the switch to stop. *) val space_packet_uplink : seq_count:(unit -> int) -> Space_wire.Msg.t -> Space_packet.t option (** [space_packet_uplink ~seq_count frame] wraps a SpaceOS frame in a CCSDS Space Packet for DTN uplink. Returns [None] if the APID is out of range. *)