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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
//! Omnisor is an asynchronous and easy-to-use high level SSH client library
//! for Rust with the tokio runtime. Powered by the Rust SSH implementation
//! [russh](https://github.com/warp-tech/russh).
//!
//! # Features
//!
//! * **Standard SSH Client** - Connect, authenticate, and execute commands on remote hosts
//! * **Network Device Sessions** - Interactive PTY sessions for routers, switches, and firewalls
//! * **Vendor Presets** - Built-in support for Cisco, Juniper, Arista, and more
//! * **Legacy Device Support** - Configurable SSH algorithms for older network equipment
//!
//! # Quick Start - Standard SSH
//!
//! For simple command execution on Linux/Unix servers:
//!
//! ```no_run
//! use omnisor::{Client, AuthMethod, ServerCheckMethod};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), omnisor::Error> {
//! let mut client = Client::connect(
//! ("10.10.10.2", 22),
//! "root",
//! AuthMethod::with_password("password"),
//! ServerCheckMethod::NoCheck,
//! ).await?;
//!
//! let result = client.execute("echo Hello SSH").await?;
//! assert_eq!(result.stdout, "Hello SSH\n");
//! assert_eq!(result.exit_status, 0);
//!
//! Ok(())
//! }
//! ```
//!
//! # Quick Start - Network Devices
//!
//! For interactive sessions with network devices (routers, switches, firewalls):
//!
//! ```no_run
//! use omnisor::{DeviceSession, CiscoVariant};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), omnisor::Error> {
//! let mut session = DeviceSession::connect(
//! ("192.168.1.1", 22),
//! "admin",
//! "password",
//! CiscoVariant::Ios,
//! ).await?;
//!
//! let result = session.send_command("show version").await?;
//! println!("{}", result.output);
//!
//! let result = session.send_command("show ip route").await?;
//! println!("{}", result.output);
//!
//! session.close().await?;
//! Ok(())
//! }
//! ```
//!
//! # Authentication Methods
//!
//! ```no_run
//! use omnisor::AuthMethod;
//!
//! // Password authentication
//! let auth = AuthMethod::with_password("secret");
//!
//! // Private key from file
//! let auth = AuthMethod::with_key_file("~/.ssh/id_rsa", None);
//!
//! // Private key with passphrase
//! let auth = AuthMethod::with_key_file("~/.ssh/id_rsa", Some("passphrase"));
//!
//! // SSH agent (Unix/Linux only)
//! #[cfg(not(target_os = "windows"))]
//! let auth = AuthMethod::with_agent();
//! ```
//!
//! # Device Session Builder
//!
//! For more control over device connections:
//!
//! ```no_run
//! use omnisor::{DeviceSession, CiscoVariant, SshAlgorithms, AuthMethod};
//! use std::time::Duration;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), omnisor::Error> {
//! let mut session = DeviceSession::builder()
//! .address("192.168.1.1")
//! .port(22)
//! .username("admin")
//! .auth(AuthMethod::with_key_file("~/.ssh/id_rsa", None))
//! .vendor(CiscoVariant::NxOs)
//! .command_timeout(Duration::from_secs(60))
//! .connect()
//! .await?;
//!
//! let result = session.send_command("show version").await?;
//! println!("{}", result.output);
//!
//! session.close().await?;
//! Ok(())
//! }
//! ```
//!
//! # Legacy Device Support
//!
//! For older devices requiring legacy SSH algorithms:
//!
//! ```no_run
//! use omnisor::{DeviceSession, CiscoVariant};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), omnisor::Error> {
//! // Use the IosLegacy variant for older Cisco devices
//! let mut session = DeviceSession::connect(
//! ("192.168.1.1", 22),
//! "admin",
//! "password",
//! CiscoVariant::IosLegacy,
//! ).await?;
//!
//! let result = session.send_command("show version").await?;
//! println!("{}", result.output);
//!
//! session.close().await?;
//! Ok(())
//! }
//! ```
//!
//! # Supported Vendors
//!
//! | Vendor | Variants |
//! |--------|----------|
//! | Cisco | `Ios`, `IosXe`, `IosXr`, `NxOs`, `Asa`, `Wlc`, `IosLegacy` |
//! | Juniper | `Junos`, `ScreenOs` |
//! | Arista | `AristaEos` |
//! | Linux | `Linux` (generic) |
pub use ;
pub use Error;
pub use ToSocketAddrsWithHostname;
// Re-export commonly used device types at crate root for convenience
pub use ;
// Re-export russh algorithm modules for direct use
pub use cipher;
pub use kex;
pub use mac;