Skip to main content

bssh/ssh/control/
mod.rs

1// Copyright 2025 Lablup Inc. and Jeongkyu Shin
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8
9//! Typed connection-multiplexing configuration and wire primitives.
10//!
11//! This module deliberately contains no CLI, dispatcher, or live SSH runtime
12//! integration. It is the policy and protocol boundary those layers use.
13
14mod config;
15mod path;
16mod protocol;
17mod runtime;
18mod socket;
19
20pub use config::{
21    ControlCommand, ControlConfigError, ControlMasterMode, ControlPersist, ControlPolicy,
22};
23pub use path::{
24    ControlPathContext, ControlPathError, expand_control_path, unix_socket_path_capacity,
25    validate_control_socket_path,
26};
27pub use protocol::{
28    CONTROL_PROTOCOL_VERSION, ControlData, ControlDataStream, ControlMessage, ControlOperation,
29    ControlProtocolError, ControlRequest, ControlResponse, ControlResponseKind,
30    MAX_CONTROL_DATA_BYTES, MAX_CONTROL_FRAME_BYTES, SessionOpenRequest, read_control_message,
31    write_control_message,
32};
33pub use runtime::{
34    AttachOutcome, AttachedSession, RunningControlMaster, attach_session, prepare_attached_session,
35    send_control_command, start_control_master, start_control_master_with_bootstrap_session,
36};
37#[cfg(unix)]
38pub use socket::verify_same_user;
39pub use socket::{
40    ControlSocketGuard, bind_control_socket, connect_control_socket, remove_stale_control_socket,
41};