rust_ipmi/
lib.rs

1//!
2//! rust-ipmi is a client library for remotely managing/monitoring systems with hardware support for IPMI.
3//! IPMI is a specification which allows software to interact and communicate with systems through the BMC
4//! (Baseboard Management Controller). BMC is a hardware component which enables interaction with a computer's
5//! chassis, motherboard, and storage through LAN and serial.This library currently supports the following:
6//!
7//! * IPMI over LAN using IPMI v2 / RMCP+ (it does NOT currently support v1.5)
8//!
9//! # Examples
10//!
11//! Creating an ipmi client, authenticating against the BMC, and running a raw request
12//!
13//! ```no_run
14//! use rust_ipmi::{IPMIClient, NetFn};
15//!
16//! fn main() {
17//!     // create the client for the server you want to execute IPMI commands against
18//!     let mut client: IPMIClient =
19//!         IPMIClient::new("192.168.88.10:623").expect("Failed to create ipmi client");
20//!
21//!     // establish a session with the BMC using the credentials specified
22//!     client
23//!         .establish_connection("billybob123", "superpassword")
24//!         .expect("Failed to establish the session with the BMC");
25//!     
26//!     // send a command to the BMC using raw values
27//!     let response = client.send_raw_request(NetFn::App, 0x3b, Some(vec![0x04]));
28//!
29//!     match response {
30//!         Err(err) => println!("Failed to send the raw request; err = {:?}", err),
31//!         Ok(n) => println!("{}", n), // print the response
32//!     }
33//! }
34//!
35//! ```
36mod commands;
37mod err;
38mod helpers;
39mod ipmi_client;
40mod parser;
41
42pub use commands::Command;
43pub use err::IPMIClientError;
44pub use ipmi_client::IPMIClient;
45pub use parser::ipmi_payload::NetFn;
46pub use parser::ipmi_payload_response::CompletionCode;