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
//! # rsvici
//!
//! The rsvici is a client library to configure, control, and monitor the IKE daemon `charon` using the VICI protocol.
//! All the features are implemented on top of the Tokio runtime to asynchronously interact with `charon`.
//!
//!
//! ## Basic Usage
//!
//! 1. Refer to [Client-initiated commands][] and [Server-issued events][].
//! 1. Define structs for the request and response.
//! 1. Connect to the IKE daemon either over a Unix socket or a TCP connection.
//!
//! ## Hints on serializing/deserializing
//!
//! The serialization/deserialization implementation has certain behaviors specific to the VICI protocol:
//!
//! * `bool` values are serialized to or deserialized from `"yes"` or `"no"`.
//! * Sections with zero-based index are serialized to or deserialized from `Vec<T>`.
//!
//! ## Example
//!
//! Connecting to the IKE daemon and retrieving the version information looks like the following:
//!
//! use std::error::Error;
//!
//! use serde::Deserialize;
//!
//! #[derive(Debug, Deserialize)]
//! struct Version {
//! daemon: String,
//! version: String,
//! sysname: String,
//! release: String,
//! machine: String,
//! }
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn Error>> {
//! let mut client = rsvici::unix::connect("/run/charon.vici").await?;
//!
//! let version: Version = client.request("version", ()).await?;
//! println!("Version: {:#?}", version);
//!
//! Ok(())
//! }
//! ```
//!
//! [Client-initiated commands]: https://github.com/strongswan/strongswan/blob/5.9.5/src/libcharon/plugins/vici/README.md#client-initiated-commands
//! [Server-issued events]: https://github.com/strongswan/strongswan/blob/5.9.5/src/libcharon/plugins/vici/README.md#server-issued-events
pub use crate*;
pub use crateError;