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
//! Library for communication with the Bird BGP server, supporting both sync and async.
//!
//! ## Examples
//! ```no_run
//! use birdc::*;
//!
//! // create the client
//! let client = Client::for_unix_socket("/run/bird/bird.ctl");
//!
//! // we can either use raw protocol
//! async fn show_interfaces_raw(client: &Client) -> Result<()> {
//! let mut connection = client.connect().await?;
//!
//! // we can either use raw protocol
//! let messages = connection.send_request("show interfaces").await?;
//! for message in &messages {
//! println!("received message: {:?}", message);
//! }
//! Ok(())
//! }
//!
//! // or we can use structured exchange
//! async fn show_interfaces(client: &Client) -> Result<()> {
//! let mut connection = client.connect().await?;
//!
//! // let's make a semantic call now
//! match connection.show_interfaces().await {
//! Ok(entries) => {
//! for e in &entries {
//! println!("received entry: {:?}", e);
//! }
//! }
//! Err(Error::ParseError(messages)) => {
//! // we can still go through the raw response
//! // even though semantic parsing failed
//! for msg in &messages {
//! println!("raw message: {:?}", msg);
//! }
//! }
//! Err(e) => {
//! return Err(e);
//! }
//! }
//! Ok(())
//! }
//! ```
//!
//! ## Compatibility
//! This library has been tested only against Bird2
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;