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
//! Easy to use Wireguard config generator.
//!
//! - Use [`InterfaceBuilder`] and [`PeerBuilder`] for interface/peers creation.
//! - Use [`Interface`]'s and [`Peer`]'s [`std::fmt::Display`] for exporting Wireguard config (`.to_string()`, [`write!()`], etc).
//! - Use [`PrivateKey`], [`PublicKey`] and [`PresharedKey`] for generating, importing and
//! exporting keys.
//! - Use [`AmneziaSettings`] for generating/using AmneziaWG obfuscation values.
//!
//! # Features
//!
//! - `amneziawg` -- adds AmneziaWG obfuscation values support [(see)](https://docs.amnezia.org/documentation/amnezia-wg/).
//! - `serde` -- adds implementions of [`serde::Serialize`] and [`serde::Deserialize`] for all
//! structs.
//!
//! # Example
//!
//! ```rust
//! use wireguard_conf::prelude::*;
//! use wireguard_conf::as_ipnet;
//!
//! let peer = Peer::builder()
//! .allowed_ips([as_ipnet!("10.0.0.2/24")])
//! .build();
//!
//! let interface = Interface::builder()
//! .address([as_ipnet!("10.0.0.1/24")])
//! .peers([peer.clone()])
//! .build();
//!
//! // to export configs, use `println!()`, `writeln!()`, `.to_string()`, etc.
//!
//! println!("Server's config:");
//! println!("{}\n", interface);
//!
//! println!("Client's config:");
//! println!("{}", peer.to_interface(&interface, ToInterfaceOptions::new()).unwrap());
//! ```
pub use ipnet;
pub use *;
pub use *;