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
extern crate rustyline;
#[macro_use] extern crate log;
extern crate clap;
extern crate libc;
extern crate errno;
extern crate regex;
extern crate nix;
extern crate base64;
extern crate bufstream;
#[macro_use] extern crate error_chain;
#[macro_use] extern crate cfg_if;
#[cfg(target_os="linux")]
extern crate caps;
#[cfg(feature="network")]
extern crate rustls;
#[cfg(feature="network")]
extern crate webpki;
#[cfg(feature="network")]
extern crate crypto as rust_crypto;
#[cfg(feature="network")]
extern crate hyper;
#[cfg(feature="network")]
extern crate hyper_rustls;
#[cfg(feature="network")]
extern crate tokio_core;
#[cfg(feature="network")]
extern crate futures;
mod error {
use clap;
use regex;
use errno;
#[cfg(feature="network")]
use hyper;
#[cfg(target_os="linux")]
use caps;
use std::io;
use std::num;
error_chain! {
errors {
Errno(errno: errno::Errno) {
description("errno")
display("errno: {:?}", errno)
}
}
foreign_links {
Args(clap::Error);
Io(io::Error);
InvalidNum(num::ParseIntError);
InvalidRegex(regex::Error);
Uri(hyper::error::UriError) #[cfg(feature="network")];
Http(hyper::Error) #[cfg(feature="network")];
Caps(caps::errors::Error) #[cfg(target_os="linux")];
}
}
}
pub use self::error::{Result, Error, ErrorKind};
#[macro_use] mod macros;
pub mod busybox;
#[cfg(feature="network")]
pub mod crypto;
pub mod ctrl;
pub mod ffi;
pub mod shell;
pub use shell::{Shell, Toolbox};
pub use shell::{Command, NativeCommand, ForeignCommand};
pub type Arguments = Vec<String>;