From ef4adfa50447028330867ad40a9e261c16a94a1f Mon Sep 17 00:00:00 2001 From: Aram Drevekenin Date: Fri, 6 Sep 2019 23:06:48 +0200 Subject: [PATCH] initial commit --- .gitignore | 2 + Cargo.lock | 2459 +++++++++++++++++ Cargo.toml | 28 + src/current_connections.rs | 129 + src/lib.rs | 96 + src/main.rs | 83 + src/store.rs | 76 + src/traffic.rs | 260 ++ src/ui.rs | 248 ++ tests/cli.rs | 398 +++ tests/fakes/fake_input.rs | 136 + tests/fakes/fake_output.rs | 263 ++ tests/fakes/mod.rs | 7 + tests/snapshots/cli__basic_startup.snap | 5 + .../cli__bi_directional_traffic-2.snap | 5 + .../cli__bi_directional_traffic.snap | 5 + ...multiple_connections_from_remote_ip-2.snap | 5 + ...__multiple_connections_from_remote_ip.snap | 5 + ..._traffic_from_different_connections-2.snap | 5 + ...of_traffic_from_different_connections.snap | 5 + ...s_of_traffic_from_single_connection-2.snap | 5 + ...ets_of_traffic_from_single_connection.snap | 5 + ...processes_with_multiple_connections-2.snap | 5 + ...e_processes_with_multiple_connections.snap | 5 + .../cli__one_packet_of_traffic-2.snap | 5 + .../snapshots/cli__one_packet_of_traffic.snap | 5 + ...e_process_with_multiple_connections-2.snap | 5 + ...one_process_with_multiple_connections.snap | 5 + ...ned_traffic_from_multiple_processes-2.snap | 5 + ...ained_traffic_from_multiple_processes.snap | 5 + ...m_multiple_processes_bi_directional-2.snap | 5 + ...rom_multiple_processes_bi_directional.snap | 5 + ..._sustained_traffic_from_one_process-2.snap | 5 + ...i__sustained_traffic_from_one_process.snap | 5 + 34 files changed, 4290 insertions(+) create mode 100644 .gitignore create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 src/current_connections.rs create mode 100644 src/lib.rs create mode 100644 src/main.rs create mode 100644 src/store.rs create mode 100644 src/traffic.rs create mode 100644 src/ui.rs create mode 100644 tests/cli.rs create mode 100644 tests/fakes/fake_input.rs create mode 100644 tests/fakes/fake_output.rs create mode 100644 tests/fakes/mod.rs create mode 100644 tests/snapshots/cli__basic_startup.snap create mode 100644 tests/snapshots/cli__bi_directional_traffic-2.snap create mode 100644 tests/snapshots/cli__bi_directional_traffic.snap create mode 100644 tests/snapshots/cli__multiple_connections_from_remote_ip-2.snap create mode 100644 tests/snapshots/cli__multiple_connections_from_remote_ip.snap create mode 100644 tests/snapshots/cli__multiple_packets_of_traffic_from_different_connections-2.snap create mode 100644 tests/snapshots/cli__multiple_packets_of_traffic_from_different_connections.snap create mode 100644 tests/snapshots/cli__multiple_packets_of_traffic_from_single_connection-2.snap create mode 100644 tests/snapshots/cli__multiple_packets_of_traffic_from_single_connection.snap create mode 100644 tests/snapshots/cli__multiple_processes_with_multiple_connections-2.snap create mode 100644 tests/snapshots/cli__multiple_processes_with_multiple_connections.snap create mode 100644 tests/snapshots/cli__one_packet_of_traffic-2.snap create mode 100644 tests/snapshots/cli__one_packet_of_traffic.snap create mode 100644 tests/snapshots/cli__one_process_with_multiple_connections-2.snap create mode 100644 tests/snapshots/cli__one_process_with_multiple_connections.snap create mode 100644 tests/snapshots/cli__sustained_traffic_from_multiple_processes-2.snap create mode 100644 tests/snapshots/cli__sustained_traffic_from_multiple_processes.snap create mode 100644 tests/snapshots/cli__sustained_traffic_from_multiple_processes_bi_directional-2.snap create mode 100644 tests/snapshots/cli__sustained_traffic_from_multiple_processes_bi_directional.snap create mode 100644 tests/snapshots/cli__sustained_traffic_from_one_process-2.snap create mode 100644 tests/snapshots/cli__sustained_traffic_from_one_process.snap diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..53eaa21 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/target +**/*.rs.bk diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..e39adf2 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,2459 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "adler32" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "aho-corasick" +version = "0.6.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ansi_term" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "arrayvec" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "assert_cmd" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "escargot 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "predicates 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "predicates-core 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "predicates-tree 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "atty" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "autocfg" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "backtrace" +version = "0.3.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "backtrace-sys 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "backtrace-sys" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "base64" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "bitflags" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bitflags" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bitflags" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "block-buffer" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "block-padding 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "block-padding" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "byte-tools" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "byteorder" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bytes" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "either 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "c2-chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ppv-lite86 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cargo-insta" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", + "console 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "insta 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", + "structopt 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.43 (registry+https://github.com/rust-lang/crates.io-index)", + "walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cassowary" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "cc" +version = "1.0.41" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "cfg-if" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "chrono" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "clap" +version = "2.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "clicolors-control" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cloudabi" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "console" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "clicolors-control 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "encode_unicode 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "termios 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "console" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "clicolors-control 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "encode_unicode 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "termios 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cookie" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cookie_store" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cookie 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "publicsuffix 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "try_from 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "core-foundation" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "core-foundation-sys" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "crc32fast" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-deque" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-epoch 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arrayvec 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memoffset 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-queue" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-utils" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "difference" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "dtoa" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "either" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "encoding_rs" +version = "0.8.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "error-chain" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "backtrace 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "error-chain" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "backtrace 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)", + "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "escargot" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "serde 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "failure" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "backtrace 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)", + "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "failure_derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.43 (registry+https://github.com/rust-lang/crates.io-index)", + "synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fake-simd" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "flate2" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "miniz_oxide 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "float-cmp" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fnv" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "fuchsia-zircon" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fuchsia-zircon-sys" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "futures" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "futures-cpupool" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "generic-array" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "getrandom" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "glob" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "h2" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", + "indexmap 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "string 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "heck" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-segmentation 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "hex" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "http" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "http-body" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-buf 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "httparse" +version = "1.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "human-size" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "hwaddr" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "phf 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_codegen 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "reqwest 0.9.20 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "hyper" +version = "0.12.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "h2 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", + "http-body 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-buf 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-tcp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "want 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "hyper-tls" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.12.33 (registry+https://github.com/rust-lang/crates.io-index)", + "native-tls 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "idna" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "idna" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "indexmap" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "insta" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "console 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pest 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "pest_derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_yaml 0.8.9 (registry+https://github.com/rust-lang/crates.io-index)", + "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "iovec" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ipnetwork" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "serde 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "itertools" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "either 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "itoa" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "kernel32-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "lazy_static" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libc" +version = "0.2.60" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libflate" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "adler32 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rle-decode-fast 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "take_mut 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "lock_api" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "owning_ref 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "lock_api" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "log" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "log" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "maplit" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "matches" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "memchr" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "memoffset" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "mime" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicase 2.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "mime_guess" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "mime 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", + "unicase 2.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "miniz_oxide" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "adler32 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "mio" +version = "0.6.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "miow" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "native-tls" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl 0.10.24 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.49 (registry+https://github.com/rust-lang/crates.io-index)", + "schannel 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", + "security-framework 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "security-framework-sys 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "net2" +version = "0.2.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "netstat" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "nodrop" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "normalize-line-endings" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "num-bigint" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num-integer" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num-traits" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num_cpus" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "numtoa" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "opaque-debug" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "openssl" +version = "0.10.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.49 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "openssl-probe" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "openssl-sys" +version = "0.9.49" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", + "vcpkg 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "owning_ref" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "packet" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hwaddr 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "parking_lot" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lock_api 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "parking_lot" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lock_api 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot_core 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "parking_lot_core" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "parking_lot_core" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "percent-encoding" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "percent-encoding" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "pest" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ucd-trie 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "pest_derive" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "pest 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "pest_generator 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "pest_generator" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "pest 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "pest_meta 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.43 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "pest_meta" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "maplit 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "pest 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "sha-1 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "phf" +version = "0.7.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "phf_codegen" +version = "0.7.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "phf_generator 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "phf_generator" +version = "0.7.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "phf_shared" +version = "0.7.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "siphasher 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "pkg-config" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "pnet" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ipnetwork 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pnet_base 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pnet_datalink 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pnet_packet 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pnet_sys 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pnet_transport 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "pnet_base" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "pnet_datalink" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ipnetwork 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "pnet_base 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pnet_sys 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "pnet_macros" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "regex 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex 0.42.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex_syntax 0.42.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "pnet_macros_support" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "pnet_base 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "pnet_packet" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "pnet_base 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pnet_macros 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pnet_macros_support 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex 0.42.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "pnet_sys" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "pnet_transport" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "pnet_base 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pnet_packet 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pnet_sys 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "predicates" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "float-cmp 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "normalize-line-endings 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "predicates-core 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "predicates-core" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "predicates-tree" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "predicates-core 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "treeline 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "proc-macro2" +version = "0.4.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "procfs" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "libflate 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "publicsuffix" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "error-chain 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", + "idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "quote" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_jitter 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "getrandom 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_chacha" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_chacha" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "c2-chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "getrandom 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_hc" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_isaac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_jitter" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_os" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_pcg" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_xorshift" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "redox_syscall" +version = "0.1.56" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "redox_termios" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "regex" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "aho-corasick 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", + "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "utf8-ranges 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "regex-syntax" +version = "0.6.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ucd-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "remove_dir_all" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "reqwest" +version = "0.9.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "cookie 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cookie_store 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "encoding_rs 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)", + "flate2 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.12.33 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper-tls 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "mime 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", + "mime_guess 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "native-tls 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_urlencoded 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", + "winreg 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rle-decode-fast" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rustc-demangle" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rustc-serialize" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ryu" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "same-file" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "schannel" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "scopeguard" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "scopeguard" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "security-framework" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "security-framework-sys 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "security-framework-sys" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "serde" +version = "1.0.97" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "serde_derive 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_derive" +version = "1.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.43 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_json" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "ryu 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_urlencoded" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_yaml" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)", + "yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "sha-1" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "siphasher" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "slab" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "smallvec" +version = "0.6.10" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "stable_deref_trait" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "string" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "strsim" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "structopt" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", + "structopt-derive 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "structopt-derive" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.43 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "syn" +version = "0.15.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "synstructure" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.43 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "syntex" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "syntex_errors 0.42.0 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex_syntax 0.42.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "syntex_errors" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex_pos 0.42.0 (registry+https://github.com/rust-lang/crates.io-index)", + "term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "syntex_pos" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "syntex_syntax" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex_errors 0.42.0 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex_pos 0.42.0 (registry+https://github.com/rust-lang/crates.io-index)", + "term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "take_mut" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "tempfile" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", + "remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "term" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "termion" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "numtoa 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "termios" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "thread_local" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "time" +version = "0.1.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "timer" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "chrono 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-current-thread 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-tcp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-buf" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "either 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-current-thread" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-executor" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-io" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-reactor" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-sync 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-sync" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-tcp" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-threadpool" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-deque 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-timer" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "treeline" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "try-lock" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "try_from" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tui" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cassowary 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "either 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "termion 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-segmentation 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "typenum" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "ucd-trie" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "ucd-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "unicase" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unicode-normalization" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unicode-segmentation" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "unicode-width" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "unicode-xid" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "unicode-xid" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "url" +version = "1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "url" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "utf8-ranges" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "uuid" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "vcpkg" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "vec_map" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "version_check" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "walkdir" +version = "2.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "same-file 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "want" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "what" +version = "0.1.0" +dependencies = [ + "assert_cmd 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", + "cargo-insta 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "human-size 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "insta 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ipnetwork 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", + "netstat 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num-bigint 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "packet 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "pnet 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", + "predicates 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "procfs 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "termion 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "timer 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tui 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi-build" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winreg" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ws2_32-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "yaml-rust" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[metadata] +"checksum adler32 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7e522997b529f05601e05166c07ed17789691f562762c7f3b987263d2dedee5c" +"checksum aho-corasick 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "81ce3d38065e618af2d7b77e10c5ad9a069859b4be3c2250f674af3840d9c8a5" +"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" +"checksum arrayvec 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)" = "b8d73f9beda665eaa98ab9e4f7442bd4e7de6652587de55b2525e52e29c1b0ba" +"checksum assert_cmd 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b7ac5c260f75e4e4ba87b7342be6edcecbcb3eb6741a0507fda7ad115845cc65" +"checksum atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90" +"checksum autocfg 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "22130e92352b948e7e82a49cdb0aa94f2211761117f29e052dd397c1ac33542b" +"checksum backtrace 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)" = "1371048253fa3bac6704bfd6bbfc922ee9bdcee8881330d40f308b81cc5adc55" +"checksum backtrace-sys 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)" = "82a830b4ef2d1124a711c71d263c5abdc710ef8e907bd508c88be475cebc422b" +"checksum base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" +"checksum bitflags 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4f67931368edf3a9a51d29886d245f1c3db2f1ef0dcc9e35ff70341b78c10d23" +"checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" +"checksum bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d155346769a6855b86399e9bc3814ab343cd3d62c7e985113d46a0ec3c281fd" +"checksum block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" +"checksum block-padding 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6d4dc3af3ee2e12f3e5d224e5e1e3d73668abbeb69e566d361f7d5563a4fdf09" +"checksum byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" +"checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" +"checksum bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" +"checksum c2-chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7d64d04786e0f528460fc884753cf8dddcc466be308f6026f8e355c41a0e4101" +"checksum cargo-insta 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e22a28c661f0fb0474ef90d63b4bc834bf2c179550608783594f358f5ac74cc2" +"checksum cassowary 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53" +"checksum cc 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)" = "8dae9c4b8fedcae85592ba623c4fd08cfdab3e3b72d6df780c6ead964a69bfff" +"checksum cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b486ce3ccf7ffd79fdeb678eac06a9e6c09fc88d33836340becb8fffe87c5e33" +"checksum chrono 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "77d81f58b7301084de3b958691458a53c3f7e0b1d702f77e550b6a88e3a88abe" +"checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" +"checksum clicolors-control 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90082ee5dcdd64dc4e9e0d37fbf3ee325419e39c0092191e0393df65518f741e" +"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" +"checksum console 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8ca57c2c14b8a2bf3105bc9d15574aad80babf6a9c44b1058034cdf8bd169628" +"checksum console 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b147390a412132d75d10dd3b7b175a69cf5fd95032f7503c7091b8831ba10242" +"checksum cookie 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "888604f00b3db336d2af898ec3c1d5d0ddf5e6d462220f2ededc33a87ac4bbd5" +"checksum cookie_store 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "46750b3f362965f197996c4448e4a0935e791bf7d6631bfce9ee0af3d24c919c" +"checksum core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d" +"checksum core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b" +"checksum crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" +"checksum crossbeam-deque 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b18cd2e169ad86297e6bc0ad9aa679aee9daa4f19e8163860faf7c164e4f5a71" +"checksum crossbeam-epoch 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fedcd6772e37f3da2a9af9bf12ebe046c0dfe657992377b4df982a2b54cd37a9" +"checksum crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7c979cd6cfe72335896575c6b5688da489e420d36a27a0b9eb0c73db574b4a4b" +"checksum crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6" +"checksum difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" +"checksum digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +"checksum dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "ea57b42383d091c85abcc2706240b94ab2a8fa1fc81c10ff23c4de06e2a90b5e" +"checksum either 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5527cfe0d098f36e3f8839852688e63c8fff1c90b2b405aef730615f9a7bcf7b" +"checksum encode_unicode 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" +"checksum encoding_rs 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)" = "4155785c79f2f6701f185eb2e6b4caf0555ec03477cb4c70db67b465311620ed" +"checksum error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9435d864e017c3c6afeac1654189b06cdb491cf2ff73dbf0d73b0f292f42ff8" +"checksum error-chain 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3ab49e9dcb602294bc42f9a7dfc9bc6e936fca4418ea300dbfb84fe16de0b7d9" +"checksum escargot 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "19db1f7e74438642a5018cdf263bb1325b2e792f02dd0a3ca6d6c0f0d7b1d5a5" +"checksum failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "795bd83d3abeb9220f257e597aa0080a508b27533824adf336529648f6abf7e2" +"checksum failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ea1063915fd7ef4309e222a5a07cf9c319fb9c7836b1f89b85458672dbb127e1" +"checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" +"checksum flate2 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "2adaffba6388640136149e18ed080b77a78611c1e1d6de75aedcdf78df5d4682" +"checksum float-cmp 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "134a8fa843d80a51a5b77d36d42bc2def9edcb0262c914861d08129fd1926600" +"checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" +"checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +"checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" +"checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" +"checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" +"checksum futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)" = "45dc39533a6cae6da2b56da48edae506bb767ec07370f86f70fc062e9d435869" +"checksum futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" +"checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" +"checksum getrandom 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "34f33de6f0ae7c9cb5e574502a562e2b512799e32abb801cd1e79ad952b62b49" +"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" +"checksum h2 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)" = "a5b34c246847f938a410a03c5458c7fee2274436675e76d8b903c08efc29c462" +"checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" +"checksum hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" +"checksum http 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)" = "372bcb56f939e449117fb0869c2e8fd8753a8223d92a172c6e808cf123a5b6e4" +"checksum http-body 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292d" +"checksum httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" +"checksum human-size 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5bec6e801ef7367625bd94ad7e2965e6027189f3e9deef422388d993af2814a0" +"checksum hwaddr 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "5dae1ec80f2dce4a943659c32081a5718f1b47a021ee17ace736680eb362db65" +"checksum hyper 0.12.33 (registry+https://github.com/rust-lang/crates.io-index)" = "7cb44cbce9d8ee4fb36e4c0ad7b794ac44ebaad924b9c8291a63215bb44c2c8f" +"checksum hyper-tls 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3a800d6aa50af4b5850b2b0f659625ce9504df908e9733b635720483be26174f" +"checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" +"checksum idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" +"checksum indexmap 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a4d6d89e0948bf10c08b9ecc8ac5b83f07f857ebe2c0cbe38de15b4e4f510356" +"checksum insta 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23f83ab4ee86f38b292f0420c27fd412690a4baa9ea0ad4e3fa624bf34379b76" +"checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08" +"checksum ipnetwork 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b3d862c86f7867f19b693ec86765e0252d82e53d4240b9b629815675a0714ad1" +"checksum itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5b8467d9c1cebe26feb08c640139247fac215782d35371ade9a2136ed6085358" +"checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" +"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +"checksum lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc5729f27f159ddd61f4df6228e827e86643d4d3e7c32183cb30a1c08f604a14" +"checksum libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)" = "d44e80633f007889c7eff624b709ab43c92d708caad982295768a7b13ca3b5eb" +"checksum libflate 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)" = "90c6f86f4b0caa347206f916f8b687b51d77c6ef8ff18d52dd007491fd580529" +"checksum linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" +"checksum lock_api 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "62ebf1391f6acad60e5c8b43706dde4582df75c06698ab44511d15016bc2442c" +"checksum lock_api 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f8912e782533a93a167888781b836336a6ca5da6175c05944c86cf28c31104dc" +"checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" +"checksum log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c275b6ad54070ac2d665eef9197db647b32239c9d244bfb6f041a766d00da5b3" +"checksum maplit 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" +"checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" +"checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" +"checksum memoffset 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ce6075db033bbbb7ee5a0bbd3a3186bbae616f57fb001c485c7ff77955f8177f" +"checksum mime 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)" = "3e27ca21f40a310bd06d9031785f4801710d566c184a6e15bad4f1d9b65f9425" +"checksum mime_guess 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1a0ed03949aef72dbdf3116a383d7b38b4768e6f960528cd6a6044aa9ed68599" +"checksum miniz_oxide 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7108aff85b876d06f22503dcce091e29f76733b2bfdd91eebce81f5e68203a10" +"checksum mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)" = "83f51996a3ed004ef184e16818edc51fadffe8e7ca68be67f9dee67d84d0ff23" +"checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" +"checksum native-tls 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4b2df1a4c22fd44a62147fd8f13dd0f95c9d8ca7b2610299b2a2f9cf8964274e" +"checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" +"checksum netstat 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "48b71f6e2443299ba97e8c834edcd4724be71da3a751b1be75d8b67022801bf3" +"checksum nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9667ddcc6cc8a43afc9b7917599d7216aa09c463919ea32c59ed6cac8bc945" +"checksum normalize-line-endings 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2e0a1a39eab95caf4f5556da9289b9e68f0aafac901b2ce80daaf020d3b733a8" +"checksum num-bigint 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "57450397855d951f1a41305e54851b1a7b8f5d2e349543a02a2effe25459f718" +"checksum num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "b85e541ef8255f6cf42bbfe4ef361305c6c135d10919ecc26126c4e5ae94bc09" +"checksum num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "6ba9a427cfca2be13aa6f6403b0b7e7368fe982bfa16fccc450ce74c46cd9b32" +"checksum num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bcef43580c035376c0705c42792c294b66974abbfd2789b511784023f71f3273" +"checksum numtoa 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b8f8bdf33df195859076e54ab11ee78a1b208382d3a26ec40d142ffc1ecc49ef" +"checksum opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" +"checksum openssl 0.10.24 (registry+https://github.com/rust-lang/crates.io-index)" = "8152bb5a9b5b721538462336e3bef9a539f892715e5037fda0f984577311af15" +"checksum openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" +"checksum openssl-sys 0.9.49 (registry+https://github.com/rust-lang/crates.io-index)" = "f4fad9e54bd23bd4cbbe48fdc08a1b8091707ac869ef8508edea2fec77dcc884" +"checksum owning_ref 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "49a4b8ea2179e6a2e27411d3bca09ca6dd630821cf6894c6c7c8467a8ee7ef13" +"checksum packet 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "169f74857c7f0a625ba64ce80fc5df31b43d7e1a749d05e3c2c24d1f0372b4f6" +"checksum parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ab41b4aed082705d1056416ae4468b6ea99d52599ecf3169b00088d43113e337" +"checksum parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" +"checksum parking_lot_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94c8c7923936b28d546dfd14d4472eaf34c99b14e1c973a32b3e6d4eb04298c9" +"checksum parking_lot_core 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" +"checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" +"checksum percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +"checksum pest 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "933085deae3f32071f135d799d75667b63c8dc1f4537159756e3d4ceab41868c" +"checksum pest_derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "833d1ae558dc601e9a60366421196a8d94bc0ac980476d0b67e1d0988d72b2d0" +"checksum pest_generator 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "63120576c4efd69615b5537d3d052257328a4ca82876771d6944424ccfd9f646" +"checksum pest_meta 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f249ea6de7c7b7aba92b4ff4376a994c6dbd98fd2166c89d5c4947397ecb574d" +"checksum phf 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "b3da44b85f8e8dfaec21adae67f95d93244b2ecf6ad2a692320598dcc8e6dd18" +"checksum phf_codegen 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "b03e85129e324ad4166b06b2c7491ae27fe3ec353af72e72cd1654c7225d517e" +"checksum phf_generator 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "09364cc93c159b8b06b1f4dd8a4398984503483891b0c26b867cf431fb132662" +"checksum phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "234f71a15de2288bcb7e3b6515828d22af7ec8598ee6d24c3b526fa0a80b67a0" +"checksum pkg-config 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c1d2cfa5a714db3b5f24f0915e74fcdf91d09d496ba61329705dda7774d2af" +"checksum pnet 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)" = "63d693c84430248366146e3181ff9d330243464fa9e6146c372b2f3eb2e2d8e7" +"checksum pnet_base 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4df28acf2fcc77436dd2b91a9a0c2bb617f9ca5f2acefee1a4135058b9f9801f" +"checksum pnet_datalink 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b34f8ca857599d05b6b082e9baff8d27c54cb9c26568cf3c0993a5755816966" +"checksum pnet_macros 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2f16d1fa7fd0edebc36055587b8b5af8a109bbc29a55fb484a37e2029b971a7" +"checksum pnet_macros_support 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)" = "84684f2cddefc37a06f2fe2ca4dcc3457fc3b282734b5246507d8ee75d2780ae" +"checksum pnet_packet 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)" = "08a6cdcdaddc5174f18286298842a4e31cd3cc018933d42af51434b1fa07dcbe" +"checksum pnet_sys 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)" = "682b2eca84cc440bce8336813f78eb6d3cb0fed89fe0e87ae22acfca8363f176" +"checksum pnet_transport 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5faa55dcf725487a699adcff88dfea8f17ea34fa2640528866d9acbb4e3a104f" +"checksum ppv-lite86 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e3cbf9f658cdb5000fcf6f362b8ea2ba154b9f146a61c7a20d647034c6b6561b" +"checksum predicates 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "53e09015b0d3f5a0ec2d4428f7559bb7b3fff341b4e159fedd1d57fac8b939ff" +"checksum predicates-core 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "06075c3a3e92559ff8929e7a280684489ea27fe44805174c3ebd9328dcb37178" +"checksum predicates-tree 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8e63c4859013b38a76eca2414c64911fba30def9e3202ac461a2d22831220124" +"checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" +"checksum procfs 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7fedbab4f73bb05650bf3a74a925f6f0351f6978303e0b9570d3b677cbbde4c7" +"checksum publicsuffix 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9bf259a81de2b2eb9850ec990ec78e6a25319715584fd7652b9b26f96fcb1510" +"checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" +"checksum rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" +"checksum rand 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d47eab0e83d9693d40f825f86948aa16eff6750ead4bdffc4ab95b8b3a7f052c" +"checksum rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" +"checksum rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "03a2a90da8c7523f554344f921aa97283eadf6ac484a6d2a7d0212fa7f8d6853" +"checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +"checksum rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" +"checksum rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +"checksum rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" +"checksum rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +"checksum rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" +"checksum rand_jitter 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" +"checksum rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" +"checksum rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" +"checksum rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" +"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +"checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" +"checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" +"checksum regex 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ee84f70c8c08744ea9641a731c7fadb475bf2ecc52d7f627feb833e0b3990467" +"checksum regex-syntax 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "cd5485bf1523a9ed51c4964273f22f63f24e31632adb5dad134f488f86a3875c" +"checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" +"checksum reqwest 0.9.20 (registry+https://github.com/rust-lang/crates.io-index)" = "0f6d896143a583047512e59ac54a215cb203c29cc941917343edea3be8df9c78" +"checksum rle-decode-fast 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cabe4fa914dec5870285fa7f71f602645da47c486e68486d2b4ceb4a343e90ac" +"checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" +"checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" +"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +"checksum ryu 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c92464b447c0ee8c4fb3824ecc8383b81717b9f1e74ba2e72540aef7b9f82997" +"checksum same-file 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "585e8ddcedc187886a30fa705c47985c3fa88d06624095856b36ca0b82ff4421" +"checksum schannel 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "f2f6abf258d99c3c1c5c2131d99d064e94b7b3dd5f416483057f308fea253339" +"checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27" +"checksum scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d" +"checksum security-framework 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eee63d0f4a9ec776eeb30e220f0bc1e092c3ad744b2a379e3993070364d3adc2" +"checksum security-framework-sys 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9636f8989cbf61385ae4824b98c1aaa54c994d7d8b41f11c601ed799f0549a56" +"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +"checksum serde 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)" = "d46b3dfedb19360a74316866cef04687cd4d6a70df8e6a506c63512790769b72" +"checksum serde_derive 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)" = "01e69e1b8a631f245467ee275b8c757b818653c6d704cdbcaeb56b56767b529c" +"checksum serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)" = "051c49229f282f7c6f3813f8286cc1e3323e8051823fce42c7ea80fe13521704" +"checksum serde_urlencoded 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "642dd69105886af2efd227f75a520ec9b44a820d65bc133a9131f7d229fd165a" +"checksum serde_yaml 0.8.9 (registry+https://github.com/rust-lang/crates.io-index)" = "38b08a9a90e5260fe01c6480ec7c811606df6d3a660415808c3c3fa8ed95b582" +"checksum sha-1 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "23962131a91661d643c98940b20fcaffe62d776a823247be80a48fcb8b6fce68" +"checksum siphasher 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0b8de496cf83d4ed58b6be86c3a275b8602f6ffe98d3024a869e124147a9a3ac" +"checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" +"checksum smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "ab606a9c5e214920bb66c458cd7be8ef094f813f20fe77a54cc7dbfff220d4b7" +"checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" +"checksum string 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d24114bfcceb867ca7f71a0d3fe45d45619ec47a6fbfa98cb14e14250bfa5d6d" +"checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" +"checksum structopt 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "16c2cdbf9cc375f15d1b4141bc48aeef444806655cd0e904207edc8d68d86ed7" +"checksum structopt-derive 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "53010261a84b37689f9ed7d395165029f9cc7abb9f56bbfe86bee2597ed25107" +"checksum syn 0.15.43 (registry+https://github.com/rust-lang/crates.io-index)" = "ee06ea4b620ab59a2267c6b48be16244a3389f8bfa0986bdd15c35b890b00af3" +"checksum synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "02353edf96d6e4dc81aea2d8490a7e9db177bf8acb0e951c24940bf866cb313f" +"checksum syntex 0.42.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0a30b08a6b383a22e5f6edc127d169670d48f905bb00ca79a00ea3e442ebe317" +"checksum syntex_errors 0.42.0 (registry+https://github.com/rust-lang/crates.io-index)" = "04c48f32867b6114449155b2a82114b86d4b09e1bddb21c47ff104ab9172b646" +"checksum syntex_pos 0.42.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3fd49988e52451813c61fecbe9abb5cfd4e1b7bb6cdbb980a6fbcbab859171a6" +"checksum syntex_syntax 0.42.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7628a0506e8f9666fdabb5f265d0059b059edac9a3f810bda077abb5d826bd8d" +"checksum take_mut 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" +"checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" +"checksum term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "fa63644f74ce96fbeb9b794f66aff2a52d601cbd5e80f4b97123e3899f4570f1" +"checksum termion 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6a8fb22f7cde82c8220e5aeacb3258ed7ce996142c77cba193f203515e26c330" +"checksum termios 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "72b620c5ea021d75a735c943269bb07d30c9b77d6ac6b236bc8b5c496ef05625" +"checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" +"checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" +"checksum timer 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "31d42176308937165701f50638db1c31586f183f1aab416268216577aec7306b" +"checksum tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)" = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" +"checksum tokio-buf 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46" +"checksum tokio-current-thread 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "d16217cad7f1b840c5a97dfb3c43b0c871fef423a6e8d2118c604e843662a443" +"checksum tokio-executor 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "0f27ee0e6db01c5f0b2973824547ce7e637b2ed79b891a9677b0de9bd532b6ac" +"checksum tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "5090db468dad16e1a7a54c8c67280c5e4b544f3d3e018f0b913b400261f85926" +"checksum tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6af16bfac7e112bea8b0442542161bfc41cbfa4466b580bdda7d18cb88b911ce" +"checksum tokio-sync 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2162248ff317e2bc713b261f242b69dbb838b85248ed20bb21df56d60ea4cae7" +"checksum tokio-tcp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1d14b10654be682ac43efee27401d792507e30fd8d26389e1da3b185de2e4119" +"checksum tokio-threadpool 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "90ca01319dea1e376a001e8dc192d42ebde6dd532532a5bad988ac37db365b19" +"checksum tokio-timer 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "f2106812d500ed25a4f38235b9cae8f78a09edf43203e16e59c3b769a342a60e" +"checksum treeline 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a7f741b240f1a48843f9b8e0444fb55fb2a4ff67293b50a9179dfd5ea67f8d41" +"checksum try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" +"checksum try_from 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "283d3b89e1368717881a9d51dad843cc435380d8109c9e47d38780a324698d8b" +"checksum tui 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ff64c925f5e20d7a393c598a33b6afc9c9942e7ebc530085588f5b7667ea559" +"checksum typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6d2783fe2d6b8c1101136184eb41be8b1ad379e4657050b8aaff0c79ee7575f9" +"checksum ucd-trie 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8f00ed7be0c1ff1e24f46c3d2af4859f7e863672ba3a6e92e7cff702bf9f06c2" +"checksum ucd-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fa9b3b49edd3468c0e6565d85783f51af95212b6fa3986a5500954f00b460874" +"checksum unicase 2.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a84e5511b2a947f3ae965dcb29b13b7b1691b6e7332cf5dbc1744138d5acb7f6" +"checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" +"checksum unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "141339a08b982d942be2ca06ff8b076563cbe223d1befd5450716790d44e2426" +"checksum unicode-segmentation 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1967f4cdfc355b37fd76d2a954fb2ed3871034eb4f26d60537d88795cfc332a9" +"checksum unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526" +"checksum unicode-xid 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "36dff09cafb4ec7c8cf0023eb0b686cb6ce65499116a12201c9e11840ca01beb" +"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" +"checksum url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" +"checksum url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "75b414f6c464c879d7f9babf951f23bc3743fb7313c081b2e6ca719067ea9d61" +"checksum utf8-ranges 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9d50aa7650df78abf942826607c62468ce18d9019673d4a2ebe1865dbb96ffde" +"checksum uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "90dbc611eb48397705a6b0f6e917da23ae517e4d127123d2cf7674206627d32a" +"checksum vcpkg 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "33dd455d0f96e90a75803cfeb7f948768c08d70a6de9a8d2362461935698bf95" +"checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" +"checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" +"checksum walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "9658c94fa8b940eab2250bd5a457f9c48b748420d71293b165c8cdbe2f55f71e" +"checksum want 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230" +"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" +"checksum winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "f10e386af2b13e47c89e7236a7a14a086791a2b88ebad6df9bf42040195cf770" +"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" +"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +"checksum winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7168bab6e1daee33b4557efd0e95d5ca70a03706d39fa5f3fe7a236f584b03c9" +"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +"checksum winreg 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9" +"checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" +"checksum yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "65923dd1784f44da1d2c3dbbc5e822045628c590ba72123e1c73d3c230c4434d" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..8744d6a --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,28 @@ +[package] +edition = "2018" +name = "what" +version = "0.1.0" +authors = ["Aram Drevekenin "] + +[dependencies] +pnet = "0.22.0" +procfs = "0.5.3" +ipnetwork = "0.14.0" +timer = "0.2.0" +chrono = "0.4.7" +tui = "0.5" +termion = "1.5" +num-bigint = "0.2.2" +num-traits = "0.2.8" +netstat = "0.7.0" +human-size = "0.4.0" + +[dev-dependencies] +assert_cmd = "0.10" +predicates = "1" +insta = "*" +cargo-insta = "*" +packet = "*" + +[features] +test = [] diff --git a/src/current_connections.rs b/src/current_connections.rs new file mode 100644 index 0000000..bf0d49d --- /dev/null +++ b/src/current_connections.rs @@ -0,0 +1,129 @@ +use ::std::collections::HashMap; +use ::std::fmt; +use ::std::net::Ipv4Addr; +use ::std::net::IpAddr; + +// #[cfg(not(feature = "test"))] +// use ::procfs::Process; + +use ::num_bigint::BigUint; +use ::num_traits::{Zero, One}; + +use ::netstat::*; +use ::pnet::datalink::NetworkInterface; + +use crate::traffic::{Segment, Connection, Protocol, Direction}; +use crate::ui::IsProcess; + +// #[cfg(feature = "test")] +// pub struct Stat { +// pub comm: String +// } +// +// #[cfg(feature = "test")] +// pub struct Process { +// pub stat: Stat +// } +// #[cfg(feature = "test")] +// impl IsProcess for Process { +// // pub fn new (&self, id: i32) -> Result { +// // Ok(Process {stat: Stat { comm: String::from("foo")}}) +// // } +// } + + +pub struct CurrentConnections +where T: std::fmt::Debug +{ + // pub connections: HashMap> + pub connections: HashMap> +} + +impl CurrentConnections +where T: std::fmt::Debug + IsProcess +{ + pub fn new(create_process: &Fn(i32) -> Result>, get_sockets_info: &Fn(AddressFamilyFlags, ProtocolFlags) -> Result, Z>) -> Self + where Z: std::fmt::Debug + { + let af_flags = AddressFamilyFlags::IPV4; + let proto_flags = ProtocolFlags::TCP | ProtocolFlags::UDP; + let sockets_info = get_sockets_info(af_flags, proto_flags).unwrap(); + let mut connections = HashMap::new(); + for si in sockets_info { + match si.protocol_socket_info { + ProtocolSocketInfo::Tcp(tcp_si) => { + let local_addr = match tcp_si.local_addr { + IpAddr::V4(local_addr) => Some(local_addr), + IpAddr::V6(_) => None + }; + let remote_addr = match tcp_si.remote_addr { + IpAddr::V4(remote_addr) => Some(remote_addr), + IpAddr::V6(_) => None + }; + + match (local_addr, remote_addr) { + (Some(local_addr), Some(remote_addr)) => { + connections.insert( + Connection { + local_ip: local_addr, + local_port: tcp_si.local_port, + remote_ip: remote_addr, + remote_port: tcp_si.remote_port, + protocol: Protocol::Tcp + // tcp_si.state + }, + // si.associated_pids.iter().map(|pid| Process::new(*pid as i32).unwrap()).collect() + si.associated_pids.iter().map(|pid| create_process(*pid as i32).unwrap()).collect() + ); + }, + (_, _) => () + } + }, + ProtocolSocketInfo::Udp(udp_si) => { + let local_addr = match udp_si.local_addr { + IpAddr::V4(local_addr) => Some(local_addr), + IpAddr::V6(_) => None + }; + let remote_addr = match udp_si.remote_addr { + IpAddr::V4(remote_addr) => Some(remote_addr), + IpAddr::V6(_) => None + }; + + match (local_addr, remote_addr) { + (Some(local_addr), Some(remote_addr)) => { + connections.insert( + Connection { + local_ip: local_addr, + local_port: udp_si.local_port, + remote_ip: remote_addr, + remote_port: udp_si.remote_port, + protocol: Protocol::Udp + // tcp_si.state + }, + // si.associated_pids.iter().map(|pid| Process::new(*pid as i32).unwrap()).collect() + si.associated_pids.iter().map(|pid| create_process(*pid as i32).unwrap()).collect() + ); + }, + (_, _) => () + } + } + } + }; + CurrentConnections {connections} + } +} + +impl fmt::Debug for CurrentConnections +where T: std::fmt::Debug +{ + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{:#?}", self.connections) + } +} + +// #[cfg(feature = "test")] +// impl fmt::Debug for Process { +// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { +// write!(f, "{:#?}", self.stat.comm) +// } +// } diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..c02d56e --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,96 @@ +#![ allow( dead_code, unused_imports ) ] +mod traffic; +mod store; // TODO: change name to network_utilization +mod current_connections; +pub mod ui; + +use ::pnet::datalink::{self, NetworkInterface}; +use ::pnet::datalink::{DataLinkReceiver, Channel}; + +use ::human_size::{Size}; +use ::std::{thread, time}; +use ::std::sync::{Arc, Mutex}; +use ::std::sync::atomic::{AtomicBool, Ordering}; +use ::std::collections::HashMap; + +use traffic::{Sniffer, Segment, Connection}; +use store::{NetworkUtilization, ConnectionData}; +use ui::display_loop; + +use ::num_bigint::{BigUint, ToBigUint, ParseBigIntError}; +use ::num_traits::{Zero, One}; +use ::num_traits::cast::{ToPrimitive}; + +use ::std::io; +use ::std::io::{Write, stdout, stdin, Stdout}; +use ::tui::Terminal; +use ::tui::backend::{Backend, TermionBackend}; +use ::tui::widgets::{Widget, Block, Borders, Table, Row}; +use ::tui::layout::{Layout, Constraint, Direction, Rect}; +use ::tui::style::{Style, Color}; +use ::tui::buffer::Cell; +use ::tui::style; +use ::termion::raw::IntoRawMode; +use ::termion::event::{Key, Event, MouseEvent}; +use ::termion::input::{TermRead}; + +use ::std::fmt::Debug; +use ::netstat::*; + +pub fn start (backend: B, create_process: &'static P, get_sockets_info: &'static Q, interface: NetworkInterface, channel: Box, stdin_events: S, ) where + P: Fn(i32) -> Result>+std::marker::Sync, + B: Backend + Send + 'static, + T: ui::IsProcess + Send + Sync + Debug + 'static, + S: Iterator + Send + Sync + 'static, + Q: Fn(AddressFamilyFlags, ProtocolFlags) -> Result, Z>+std::marker::Sync, + Z: std::fmt::Debug +{ + let r = Arc::new(AtomicBool::new(true)); + let displaying = r.clone(); + let running = r.clone(); + let stdin_handler = thread::spawn(move || { + for evt in stdin_events { + match evt { + Event::Key(Key::Ctrl('c')) => { + // TODO: exit faster + r.store(false, Ordering::SeqCst); + break + }, + Event::Key(Key::Char('q')) => { + r.store(false, Ordering::SeqCst); + break + }, + _ => () + }; + }; + }); + + let mut sniffer = Sniffer::new(interface, channel); + let network_utilization = Arc::new(Mutex::new(NetworkUtilization::new())); + let mirror_utilization = Arc::clone(&network_utilization); // TODO: better name + let display_handler = thread::spawn(move || { + let mut terminal = Terminal::new(backend).unwrap(); + terminal.clear().unwrap(); + terminal.hide_cursor().unwrap(); + while displaying.load(Ordering::SeqCst) { + display_loop(&mirror_utilization, &mut terminal, &create_process, &get_sockets_info); + thread::sleep(time::Duration::from_secs(1)); + } + terminal.clear().unwrap(); + terminal.show_cursor().unwrap(); + }); + + let sniffing_handler = thread::spawn(move || { + while running.load(Ordering::SeqCst) { + match sniffer.next() { + Some(segment) => { + network_utilization.lock().unwrap().update(&segment) + }, + None => () + } + } + }); + display_handler.join().unwrap(); + sniffing_handler.join().unwrap(); + stdin_handler.join().unwrap(); +} diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..083e8d0 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,83 @@ +use ::std::io; +use ::std::env; +use ::std::io::{Write, stdout, stdin, Stdout}; +use ::termion::raw::IntoRawMode; +use ::tui::backend::TermionBackend; +use ::pnet::datalink::{self, NetworkInterface}; +use ::pnet::datalink::{DataLinkReceiver, Channel}; +use ::pnet::datalink::Channel::Ethernet; + +use ::termion::event::{Key, Event, MouseEvent}; +use ::termion::input::{TermRead}; + +use ::netstat::*; + +use ::procfs::Process; + +#[derive(Debug)] +struct GenericProcess { + proc: Process +} + +struct InputEvents { + // events: termion::input::Events +} + +impl Iterator for InputEvents { + type Item = Event; + fn next(&mut self) -> Option { + let stdin = stdin(); + let mut events = stdin.events(); // TODO: not every time? + match events.next() { + Some(res) => { + match res { + Ok(ev) => Some(ev), + Err(_) => None + } + }, + None => None + } + } +} + +impl what::ui::IsProcess for GenericProcess { + fn get_name (&self) -> String { + self.proc.stat.comm.to_string() + } +} + +fn get_channel (interface: &NetworkInterface) -> Box { + let (_tx, rx) = match datalink::channel(interface, Default::default()) { + Ok(Ethernet(tx, rx)) => (tx, rx), + Ok(_) => panic!("Unhandled channel type"), + Err(e) => panic!("An error occurred when creating the datalink channel: {}", e) + }; + rx +} + +fn get_interface () -> NetworkInterface { + let interface_name = env::args().nth(1).unwrap(); // TODO: figure this out without arg + let interface_names_match = + |iface: &NetworkInterface| iface.name == interface_name; + // Find the network interface with the provided name + let interfaces = datalink::interfaces(); + let interface = interfaces.into_iter() + .filter(interface_names_match) + .next() + .unwrap(); + interface +} + +fn create_process (id: i32) -> Result> { + let proc = Process::new(id)?; + Ok(GenericProcess {proc}) +} + +fn main () { + let stdin_events = InputEvents {}; + let stdout = io::stdout().into_raw_mode().unwrap(); + let backend = TermionBackend::new(stdout); + let interface = get_interface(); + let channel = get_channel(&interface); + what::start(backend, &create_process, &get_sockets_info, interface, channel, stdin_events) +} diff --git a/src/store.rs b/src/store.rs new file mode 100644 index 0000000..b4ae68c --- /dev/null +++ b/src/store.rs @@ -0,0 +1,76 @@ +use ::std::collections::HashMap; +use ::std::fmt; +use ::std::net::Ipv4Addr; +use ::std::net::IpAddr; + +use ::procfs::Process; + +use ::num_bigint::BigUint; +use ::num_traits::{Zero, One}; + +use ::netstat::*; +use ::pnet::datalink::NetworkInterface; + +use crate::traffic::{Segment, Connection, Protocol, Direction}; + +#[derive(Debug, Clone)] +pub struct ConnectionData { + // pub processes: Vec, // TODO: actual type + pub total_bytes_downloaded: BigUint, + pub total_bytes_uploaded: BigUint, +} + +// impl fmt::Display for ConnectionData { +// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { +// let processes: String = self.processes.clone() +// .into_iter() +// .map(|process| process.stat.comm.to_string()) +// .collect(); +// write!(f, "({}/{})", processes, self.total_bytes) +// } +// } + +impl ConnectionData { + pub fn increment_bytes_downloaded (&mut self, ip_length: &BigUint) { + self.total_bytes_downloaded += ip_length; + } + pub fn increment_bytes_uploaded (&mut self, ip_length: &BigUint) { + self.total_bytes_uploaded += ip_length; + } +} + +pub struct NetworkUtilization { + pub connections: HashMap +} + +impl NetworkUtilization { + pub fn new() -> Self { + let connections = HashMap::new(); + NetworkUtilization { connections } + } + // pub fn update(&mut self, seg: &Segment, proc: &Proc) { + pub fn reset (&mut self) { + self.connections.clear(); + } + pub fn update(&mut self, seg: &Segment) { + let connection_data = self.connections.entry(seg.connection.clone()).or_insert(ConnectionData { + total_bytes_downloaded: Zero::zero(), + total_bytes_uploaded: Zero::zero() + }); + match seg.direction { + Direction::Download => { + connection_data.increment_bytes_downloaded(&seg.ip_length) + }, + Direction::Upload => { + connection_data.increment_bytes_uploaded(&seg.ip_length) + } + + } + } +} + +impl fmt::Debug for NetworkUtilization { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{:#?}", self.connections) + } +} diff --git a/src/traffic.rs b/src/traffic.rs new file mode 100644 index 0000000..f7932c7 --- /dev/null +++ b/src/traffic.rs @@ -0,0 +1,260 @@ +use ::std::fmt; +use ::std::env; +use ::std::net::Ipv4Addr; +use ::std::error::Error; +use ::std::boxed::Box; + +use ::pnet::datalink::{self, NetworkInterface}; +use ::pnet::datalink::{DataLinkReceiver, Channel}; +use ::pnet::datalink::Channel::Ethernet; +use ::pnet::packet::{Packet, MutablePacket}; +use ::pnet::packet::ethernet::{EtherType, EthernetPacket, MutableEthernetPacket}; +use ::pnet::packet::ipv4::Ipv4Packet; +use ::pnet::packet::ip::IpNextHeaderProtocol; +use ::pnet::packet::tcp::TcpPacket; +use ::pnet::packet::udp::UdpPacket; + +use ::num_bigint::{BigUint, ToBigUint}; +use ::num_traits::{Zero, One}; + +use ::ipnetwork::IpNetwork; + + +pub struct Sniffer { + interface: NetworkInterface, + channel: Box, +} + +#[derive(PartialEq, Hash, Eq, Debug, Clone, PartialOrd)] +pub struct Connection { + pub local_ip: Ipv4Addr, + pub remote_ip: Ipv4Addr, + pub local_port: u16, + pub remote_port: u16, + pub protocol: Protocol, +} + +impl fmt::Display for Connection { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}:{} => {}:{} ({})", self.local_ip, self.local_port, self.remote_ip, self.remote_port, self.protocol) + } +} + +pub struct Segment { + pub connection: Connection, + pub direction: Direction, + pub ip_length: BigUint +} + +#[derive(PartialEq, Hash, Eq, Debug, Clone, PartialOrd)] +pub enum Protocol { + Tcp, + Udp +} + +#[derive(PartialEq, Hash, Eq, Debug, Clone, PartialOrd)] +pub enum Direction { + Download, + Upload +} + +pub struct FakeReceiver { +} +impl DataLinkReceiver for FakeReceiver { + fn next (&mut self) -> Result<&[u8], std::io::Error > { + Ok(&[11]) + } +} + +impl fmt::Display for Protocol { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match *self { + Protocol::Tcp => write!(f, "tcp"), + Protocol::Udp => write!(f, "udp") + } + } +} + +impl Segment { + pub fn from_tcp_message (ip_packet: &Ipv4Packet, self_ip_addresses: &Vec, message: TcpPacket) -> Self { + let protocol = Protocol::Tcp; + let direction = match self_ip_addresses.iter().any(|ip_network| ip_network.ip() == ip_packet.get_source()) { + true => Direction::Upload, + false => Direction::Download + }; + let connection = match direction { + Direction::Upload => { + let local_ip = ip_packet.get_source(); + let remote_ip = ip_packet.get_destination(); + let local_port = message.get_source(); + let remote_port = message.get_destination(); + Connection { local_ip, remote_ip, local_port, remote_port, protocol } + }, + Direction::Download => { + let local_ip = ip_packet.get_destination(); + let remote_ip = ip_packet.get_source(); + let local_port = message.get_destination(); + let remote_port = message.get_source(); + Connection { local_ip, remote_ip, local_port, remote_port, protocol } + } + }; + let ip_length = ip_packet.get_total_length().to_biguint().unwrap(); + Segment { connection, ip_length, direction } + } + pub fn from_udp_datagram (ip_packet: &Ipv4Packet, self_ip_addresses: &Vec, datagram: UdpPacket) -> Self { + // TODO: only leave the datagram parts here and merge the rest to a third generic method + let protocol = Protocol::Udp; + let direction = match self_ip_addresses.iter().any(|ip_network| ip_network.ip() == ip_packet.get_source()) { + true => Direction::Upload, + false => Direction::Download + }; + let connection = match direction { + Direction::Upload => { + let local_ip = ip_packet.get_source(); + let remote_ip = ip_packet.get_destination(); + let local_port = datagram.get_source(); + let remote_port = datagram.get_destination(); + Connection { local_ip, remote_ip, local_port, remote_port, protocol } + }, + Direction::Download => { + let local_ip = ip_packet.get_destination(); + let remote_ip = ip_packet.get_source(); + let local_port = datagram.get_destination(); + let remote_port = datagram.get_source(); + Connection { local_ip, remote_ip, local_port, remote_port, protocol } + } + }; + let ip_length = ip_packet.get_total_length().to_biguint().unwrap(); + Segment { connection, ip_length, direction } + } +} + +// #[cfg(not(feature = "test"))] +// fn get_interface_name_from_arg() -> String { +// env::args().nth(1).unwrap() // TODO: figure this out without arg +// } +// +// #[cfg(feature = "test")] +// fn get_interface_name_from_arg() -> String { +// String::from("foo") +// // env::args().nth(1).unwrap() // TODO: figure this out without arg +// } +// +// #[cfg(not(feature = "test"))] +// fn get_interface () -> NetworkInterface { +// let interface_name = get_interface_name_from_arg(); +// let interface_names_match = +// |iface: &NetworkInterface| iface.name == interface_name; +// // Find the network interface with the provided name +// let interfaces = datalink::interfaces(); +// let interface = interfaces.into_iter() +// .filter(interface_names_match) +// .next() +// .unwrap(); +// interface +// } + +// #[cfg(feature = "test")] +// fn get_interface () -> NetworkInterface { +// let interface = NetworkInterface { +// name: String::from("foo"), +// index: 42, +// mac: None, +// ips: vec!(IpNetwork::V4("1.1.1.1".parse().unwrap())), +// flags: 42 +// }; +// interface +// } +// +// #[cfg(not(feature = "test"))] +// fn get_channel (interface: &NetworkInterface) -> Box { +// let (_tx, rx) = match datalink::channel(interface, Default::default()) { +// Ok(Ethernet(tx, rx)) => (tx, rx), +// Ok(_) => panic!("Unhandled channel type"), +// Err(e) => panic!("An error occurred when creating the datalink channel: {}", e) +// }; +// rx +// } +// +// +// #[cfg(feature = "test")] +// fn get_channel (interface: &NetworkInterface) -> Box { +// Box::new(FakeReceiver {}) +// } + +impl Sniffer { + // pub fn new (get_interface: &I, get_channel: &C) -> Self where + pub fn new (interface: NetworkInterface, channel: Box) -> Self where +// I: &NetworkInterface, +// C: DataLinkReceiver +// I: Fn() -> NetworkInterface, +// C: Fn(&NetworkInterface) -> Box + { +// let interface = get_interface(); +// let rx = get_channel(&interface); + + Sniffer { interface, channel } + // Sniffer { interface, channel: rx } + } + pub fn next(&mut self) -> Option { + // TODO: https://github.com/libpnet/libpnet/issues/343 + // make this non-blocking for faster exits + match self.channel.next() { + // Ok(packet) => { + Ok(bytes) => { + // let packet = EthernetPacket::new(packet).unwrap(); +// println!("********************************** bytes ***********************"); +// println!("{:?}", bytes); +// println!("********************************** bytes ***********************"); + match EthernetPacket::new(bytes) { + Some(packet) => { + match packet.get_ethertype() { // TODO: better way through the module? + EtherType(2048) => { + let ip_packet = Ipv4Packet::new(packet.payload()).unwrap(); + match ip_packet.get_next_level_protocol() { + IpNextHeaderProtocol(6) => { // tcp + // Some(ip_packet.get_total_length()) + let message = TcpPacket::new(ip_packet.payload()).unwrap(); + let segment = Segment::from_tcp_message(&ip_packet, &self.interface.ips, message); + Some(segment) + + }, + IpNextHeaderProtocol(17) => { // udp + // Some(ip_packet.get_total_length()) + let datagram = UdpPacket::new(ip_packet.payload()).unwrap(); + let segment = Segment::from_udp_datagram(&ip_packet, &self.interface.ips, datagram); + Some(segment) + }, + _ => { + None + // self.next() + } + } + }, + _ => { + None + // self.next() + } + } + }, + None => None + } + }, + Err(e) => { + // If an error occurs, we can handle it here + panic!("An error occurred while reading: {}", e); + } + } + } + pub fn get_interface(&self) -> &NetworkInterface { + &self.interface + } + +} + +// impl fmt::Display for IncomingTraffic { +// fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { +// // TBD +// // write!(f, "({}, {})", self.x, self.y) +// } +// } diff --git a/src/ui.rs b/src/ui.rs new file mode 100644 index 0000000..67c7b7c --- /dev/null +++ b/src/ui.rs @@ -0,0 +1,248 @@ +#![ allow( dead_code, unused_imports ) ] + +use ::human_size::{Size}; +use ::std::{thread, time}; +use ::std::sync::{Arc, Mutex}; +use ::std::sync::atomic::{AtomicBool, Ordering}; +use ::std::collections::HashMap; + +use crate::traffic::{Connection}; +use crate::store::{NetworkUtilization, ConnectionData}; +use crate::current_connections::{CurrentConnections}; // TODO: better naming + +use ::num_bigint::{BigUint, ToBigUint, ParseBigIntError}; +use ::num_traits::{Zero, One}; +use ::num_traits::cast::{ToPrimitive}; + +use ::netstat::*; + +use ::std::io; +use ::std::io::{Write, stdout, stdin}; +use ::tui::Terminal; +use ::tui::terminal::Frame; +use ::tui::backend::{Backend, TermionBackend}; +use ::tui::widgets::{Widget, Block, Borders, Table, Row}; +use ::tui::layout::{Layout, Constraint, Direction, Rect}; +use ::tui::style::{Style, Color}; +use ::termion::raw::IntoRawMode; +use ::termion::event::{Key, Event, MouseEvent}; +use ::termion::input::{TermRead}; + +macro_rules! build_table { + ($a:expr, $b:expr, $c:expr, $d: expr) => { + Table::new( + $a.into_iter(), + $b.into_iter() + ) + .block(Block::default().title($c).borders(Borders::ALL)) + .header_style(Style::default().fg(Color::Yellow)) + .widths(&$d) + .style(Style::default().fg(Color::White)) + .column_spacing(1) + }; +} + + +struct NetworkData { + total_bytes_downloaded: BigUint, + total_bytes_uploaded: BigUint, + connection_count: BigUint +} + +impl NetworkData { + fn new () -> Self { + NetworkData { + total_bytes_downloaded: Zero::zero(), + total_bytes_uploaded: Zero::zero(), + connection_count: Zero::zero() + } + } +} + +fn display_bandwidth (bytes_per_second: &BigUint) -> String { + if bytes_per_second > &999999999.to_biguint().unwrap() { + format!("{:.2}GBps", bytes_per_second.to_f64().unwrap() / 1000000000.0) + } else if bytes_per_second > &999999.to_biguint().unwrap() { + format!("{:.2}MBps", bytes_per_second.to_f64().unwrap() / 1000000.0) + } else if bytes_per_second > &999.to_biguint().unwrap() { // TODO: do not do this each time + format!("{:.2}KBps", bytes_per_second.to_f64().unwrap() / 1000.0) + } else { + format!("{}Bps", bytes_per_second) + } +} + +pub trait IsProcess +{ + fn get_name (&self) -> String; +} + +struct UIState { + pub process_data: HashMap, + pub remote_ip_data: HashMap, + pub connection_total_bytes: HashMap, + pub process_names: Vec, + pub connections: Vec, + pub remote_ips: Vec +} + +impl UIState { + pub fn new (current_connections: &CurrentConnections, mirror_utilization: &Arc>) -> Self + where T: IsProcess + std::fmt::Debug + // where T: IsProcess + IsProcess + { + let mut process_data: HashMap = HashMap::new(); + let mut remote_ip_data: HashMap = HashMap::new(); + let mut connection_total_bytes: HashMap = HashMap::new(); + for (connection, associated_processes) in ¤t_connections.connections { + match mirror_utilization.lock().unwrap().connections.get(connection) { + Some(connection_data) => { + for process in associated_processes.iter() { + let data_for_process = process_data + // .entry(process.stat.comm.to_string()) + .entry(process.get_name()) + .or_insert(NetworkData::new()); + data_for_process.total_bytes_downloaded += &connection_data.total_bytes_downloaded; + data_for_process.total_bytes_uploaded += &connection_data.total_bytes_uploaded; + data_for_process.connection_count += &One::one(); + } + let connection_data_entry = connection_total_bytes + .entry(connection.clone()) + .or_insert(connection_data.clone()); + let data_for_remote_ip = remote_ip_data + .entry(connection.remote_ip.to_string()) + .or_insert(NetworkData::new()); // TODO: use a ConnectionData object here and in the process as well + data_for_remote_ip.total_bytes_downloaded += &connection_data.total_bytes_downloaded; + data_for_remote_ip.total_bytes_uploaded += &connection_data.total_bytes_uploaded; + data_for_remote_ip.connection_count += &One::one(); + }, + None => () + } + } + let mut process_names: Vec = Vec::new(); + let mut connections: Vec = Vec::new(); + let mut remote_ips: Vec = Vec::new(); + for (process_name, _) in &process_data { + process_names.push(process_name.to_string()); + } + for (connection, _) in &connection_total_bytes { + connections.push(connection.clone()); + } + for (remote_ip, _) in &remote_ip_data { + remote_ips.push(remote_ip.to_string()); + } + process_names.sort(); + connections.sort_by(|a, b| a.partial_cmp(b).unwrap()); + remote_ips.sort(); + UIState { + process_data, + remote_ip_data, + connection_total_bytes, + process_names, + connections, + remote_ips + } + } +} + +fn split (direction: Direction, rect: Rect) -> Vec { + Layout::default() + .direction(direction) + .margin(0) + .constraints( + [ + Constraint::Percentage(50), + Constraint::Percentage(50) + ].as_ref() + ) + .split(rect) +} + +fn render_process_table (state: &UIState, row_style: tui::style::Style, frame: &mut tui::terminal::Frame, rect: tui::layout::Rect) { + let mut process_table_rows = Vec::new(); + for process_name in &state.process_names { + let data_for_process = state.process_data.get(process_name).unwrap(); + let up_bps = display_bandwidth(&data_for_process.total_bytes_uploaded); + let down_bps = display_bandwidth(&data_for_process.total_bytes_downloaded); + process_table_rows.push(Row::StyledData( + vec![ + process_name.to_string(), + data_for_process.connection_count.to_string(), + format!("{}/{}", up_bps, down_bps) + ].into_iter(), + row_style + )); + } + let column_names = ["Process", "Connection Count", "Total Bytes"]; + let title = "Utilization by process name"; + let widths = [30, 30, 30]; + let mut table = build_table!(column_names, process_table_rows, title, widths); + table.render(frame, rect); +} + +fn render_connections_table(state: &UIState, current_connections: &CurrentConnections, row_style: tui::style::Style, frame: &mut tui::terminal::Frame, rect: tui::layout::Rect) +where T: IsProcess + std::fmt::Debug +{ + let mut connection_table_rows = Vec::new(); + for connection in &state.connections { + let connection_data = state.connection_total_bytes.get(&connection).unwrap(); + match current_connections.connections.get(&connection) { + Some(associated_processes) => { + let processes = associated_processes.iter().map(|p| p.get_name()).collect(); + let up_bps = display_bandwidth(&connection_data.total_bytes_uploaded); + let down_bps = display_bandwidth(&connection_data.total_bytes_downloaded); + connection_table_rows.push(Row::StyledData( + vec![ + connection.to_string(), + processes, + format!("{}/{}", up_bps, down_bps) + ].into_iter(), + row_style)); + }, + None => () + } + } + let column_names = ["Connection", "Processes", "Total Bytes Up/Down"]; + let title = "Utilization by connection"; + let widths = [50, 20, 20]; + let mut table = build_table!(column_names, connection_table_rows, title, widths); + table.render(frame, rect); +} + +fn render_remote_ip_table(state: &UIState, row_style: tui::style::Style, frame: &mut tui::terminal::Frame, rect: tui::layout::Rect) { + let mut remote_ip_table_rows = Vec::new(); + for remote_ip in &state.remote_ips { + let data_for_remote_ip = state.remote_ip_data.get(remote_ip).unwrap(); + let up_bps = display_bandwidth(&data_for_remote_ip.total_bytes_uploaded); + let down_bps = display_bandwidth(&data_for_remote_ip.total_bytes_downloaded); + remote_ip_table_rows.push(Row::StyledData( + vec![ + remote_ip.to_string(), + data_for_remote_ip.connection_count.to_string(), + format!("{}/{}", up_bps, down_bps) + ].into_iter(), + row_style + )); + } + let column_names = ["Remote Address", "Connection Count", "Total Bytes"]; + let title = "Utilization by remote ip"; + let widths = [50, 20, 20]; + let mut table = build_table!(column_names, remote_ip_table_rows, title, widths); + table.render(frame, rect); +} + +pub fn display_loop(mirror_utilization: &Arc>, terminal: &mut Terminal, create_process: &Fn(i32) -> Result>, get_sockets_info: &Fn(AddressFamilyFlags, ProtocolFlags) -> Result, Z>) where + T: IsProcess + std::fmt::Debug, + Z: std::fmt::Debug +{ + let current_connections = CurrentConnections::new(create_process, get_sockets_info); + let state = UIState::new(¤t_connections, mirror_utilization); + terminal.draw(|mut f| { + let screen_horizontal_halves = split(Direction::Horizontal, f.size()); + let right_side_vertical_halves = split(Direction::Vertical, screen_horizontal_halves[1]); + let row_style = Style::default().fg(Color::White); + render_connections_table(&state, ¤t_connections, row_style, &mut f, screen_horizontal_halves[0]); + render_process_table(&state, row_style, &mut f, right_side_vertical_halves[0]); + render_remote_ip_table(&state, row_style, &mut f, right_side_vertical_halves[1]); + }).unwrap(); + mirror_utilization.lock().unwrap().reset(); +} diff --git a/tests/cli.rs b/tests/cli.rs new file mode 100644 index 0000000..ca6d195 --- /dev/null +++ b/tests/cli.rs @@ -0,0 +1,398 @@ +extern crate what; +mod fakes; + +use ::std::sync::{Arc, Mutex}; + +use insta::{assert_snapshot}; + +use fakes::{ + TestBackend, + InputEvents, + NetworkFrames, + get_interface, + create_process, + get_sockets_info +}; +use fakes::TerminalEvent::*; + +use ::termion::event::{Key, Event}; + +use ::packet::builder::Builder; + +fn build_tcp_packet (source_ip: &str, destination_ip: &str, source_port: u16, destination_port: u16, payload: &'static [u8]) -> Vec { + ::packet::ether::Builder::default() + .ip().unwrap().v4().unwrap() + .source(source_ip.parse().unwrap()).unwrap() + .destination(destination_ip.parse().unwrap()).unwrap() + .tcp().unwrap() + .source(source_port).unwrap() + .destination(destination_port).unwrap() + .payload(payload).unwrap() + .build().unwrap() +} + +struct LogWithMirror { + pub write: Arc>, + pub mirror: Arc> +} + +impl LogWithMirror { + pub fn new(log: T) -> Self { + let write = Arc::new(Mutex::new(log)); + let mirror = write.clone(); + LogWithMirror { write, mirror } + } +} + +#[test] +fn basic_startup () { + let stdin_events = InputEvents::new(vec![ + None, // sleep + Some(Event::Key(Key::Ctrl('c'))) + ]); + let channel = NetworkFrames::new(vec![ + None // sleep + ]); + + let terminal_events = LogWithMirror::new(Vec::new()); + let terminal_draw_events = LogWithMirror::new(Vec::new()); + + let backend = TestBackend::new(terminal_events.write, terminal_draw_events.write); + let interface = get_interface(); + + what::start(backend, &create_process, &get_sockets_info, interface, channel, stdin_events); + + let terminal_events_mirror = terminal_events.mirror.lock().unwrap(); + let terminal_draw_events_mirror = terminal_draw_events.mirror.lock().unwrap(); + + let expected_terminal_events = vec![ Clear, HideCursor, Draw, Flush, Clear, ShowCursor ]; + assert_eq!(&terminal_events_mirror[..], &expected_terminal_events[..]); + + assert_eq!(terminal_draw_events_mirror.len(), 1); + assert_snapshot!(&terminal_draw_events_mirror[0]); +} + +#[test] +fn one_packet_of_traffic () { + let stdin_events = InputEvents::new(vec![ + None, // sleep + None, // sleep + Some(Event::Key(Key::Ctrl('c'))) + ]); + let channel = NetworkFrames::new(vec![ + Some(build_tcp_packet("10.0.0.2", "1.1.1.1", 443, 12345, b"I am a fake tcp packet")) + ]); + + let terminal_events = LogWithMirror::new(Vec::new()); + let terminal_draw_events = LogWithMirror::new(Vec::new()); + + let backend = TestBackend::new(terminal_events.write, terminal_draw_events.write); + let interface = get_interface(); + + what::start(backend, &create_process, &get_sockets_info, interface, channel, stdin_events); + + let terminal_events_mirror = terminal_events.mirror.lock().unwrap(); + let terminal_draw_events_mirror = terminal_draw_events.mirror.lock().unwrap(); + + let expected_terminal_events = vec![ Clear, HideCursor, Draw, Flush, Draw, Flush, Clear, ShowCursor ]; + assert_eq!(&terminal_events_mirror[..], &expected_terminal_events[..]); + + assert_eq!(terminal_draw_events_mirror.len(), 2); + assert_snapshot!(&terminal_draw_events_mirror[0]); + assert_snapshot!(&terminal_draw_events_mirror[1]); +} + +#[test] +fn bi_directional_traffic () { + let stdin_events = InputEvents::new(vec![ + None, // sleep + None, // sleep + Some(Event::Key(Key::Ctrl('c'))) + ]); + let channel = NetworkFrames::new(vec![ + Some(build_tcp_packet("10.0.0.2", "1.1.1.1", 443, 12345, b"I am a fake tcp upload packet")), + Some(build_tcp_packet("1.1.1.1", "10.0.0.2", 12345, 443, b"I am a fake tcp download packet")) + ]); + + let terminal_events = LogWithMirror::new(Vec::new()); + let terminal_draw_events = LogWithMirror::new(Vec::new()); + + let backend = TestBackend::new(terminal_events.write, terminal_draw_events.write); + let interface = get_interface(); + + what::start(backend, &create_process, &get_sockets_info, interface, channel, stdin_events); + + let terminal_events_mirror = terminal_events.mirror.lock().unwrap(); + let terminal_draw_events_mirror = terminal_draw_events.mirror.lock().unwrap(); + + let expected_terminal_events = vec![ Clear, HideCursor, Draw, Flush, Draw, Flush, Clear, ShowCursor ]; + assert_eq!(&terminal_events_mirror[..], &expected_terminal_events[..]); + + assert_eq!(terminal_draw_events_mirror.len(), 2); + assert_snapshot!(&terminal_draw_events_mirror[0]); + assert_snapshot!(&terminal_draw_events_mirror[1]); +} + +#[test] +fn multiple_packets_of_traffic_from_different_connections () { + let stdin_events = InputEvents::new(vec![ + None, // sleep + None, // sleep + Some(Event::Key(Key::Ctrl('c'))) + ]); + let channel = NetworkFrames::new(vec![ + Some(build_tcp_packet("1.1.1.1", "10.0.0.2", 12345, 443, b"I have come from 1.1.1.1")), + Some(build_tcp_packet("2.2.2.2", "10.0.0.2", 54321, 443, b"I come from 2.2.2.2")) + ]); + + let terminal_events = LogWithMirror::new(Vec::new()); + let terminal_draw_events = LogWithMirror::new(Vec::new()); + + let backend = TestBackend::new(terminal_events.write, terminal_draw_events.write); + let interface = get_interface(); + + what::start(backend, &create_process, &get_sockets_info, interface, channel, stdin_events); + + let terminal_events_mirror = terminal_events.mirror.lock().unwrap(); + let terminal_draw_events_mirror = terminal_draw_events.mirror.lock().unwrap(); + + let expected_terminal_events = vec![ Clear, HideCursor, Draw, Flush, Draw, Flush, Clear, ShowCursor ]; + assert_eq!(&terminal_events_mirror[..], &expected_terminal_events[..]); + + assert_eq!(terminal_draw_events_mirror.len(), 2); + assert_snapshot!(&terminal_draw_events_mirror[0]); + assert_snapshot!(&terminal_draw_events_mirror[1]); +} + +#[test] +fn multiple_packets_of_traffic_from_single_connection () { + let stdin_events = InputEvents::new(vec![ + None, // sleep + None, // sleep + Some(Event::Key(Key::Ctrl('c'))) + ]); + let channel = NetworkFrames::new(vec![ + Some(build_tcp_packet("1.1.1.1", "10.0.0.2", 12345, 443, b"I have come from 1.1.1.1")), + Some(build_tcp_packet("1.1.1.1", "10.0.0.2", 12345, 443, b"I've come from 1.1.1.1 too!")) + ]); + + let terminal_events = LogWithMirror::new(Vec::new()); + let terminal_draw_events = LogWithMirror::new(Vec::new()); + + let backend = TestBackend::new(terminal_events.write, terminal_draw_events.write); + let interface = get_interface(); + + what::start(backend, &create_process, &get_sockets_info, interface, channel, stdin_events); + + let terminal_events_mirror = terminal_events.mirror.lock().unwrap(); + let terminal_draw_events_mirror = terminal_draw_events.mirror.lock().unwrap(); + + let expected_terminal_events = vec![ Clear, HideCursor, Draw, Flush, Draw, Flush, Clear, ShowCursor ]; + assert_eq!(&terminal_events_mirror[..], &expected_terminal_events[..]); + + assert_eq!(terminal_draw_events_mirror.len(), 2); + assert_snapshot!(&terminal_draw_events_mirror[0]); + assert_snapshot!(&terminal_draw_events_mirror[1]); +} + +#[test] +fn one_process_with_multiple_connections () { + let stdin_events = InputEvents::new(vec![ + None, // sleep + None, // sleep + Some(Event::Key(Key::Ctrl('c'))) + ]); + let channel = NetworkFrames::new(vec![ + Some(build_tcp_packet("1.1.1.1", "10.0.0.2", 12345, 443, b"I have come from 1.1.1.1")), + Some(build_tcp_packet("3.3.3.3", "10.0.0.2", 1337, 443, b"Funny that, I'm from 3.3.3.3")) + ]); + + let terminal_events = LogWithMirror::new(Vec::new()); + let terminal_draw_events = LogWithMirror::new(Vec::new()); + + let backend = TestBackend::new(terminal_events.write, terminal_draw_events.write); + let interface = get_interface(); + + what::start(backend, &create_process, &get_sockets_info, interface, channel, stdin_events); + + let terminal_events_mirror = terminal_events.mirror.lock().unwrap(); + let terminal_draw_events_mirror = terminal_draw_events.mirror.lock().unwrap(); + + let expected_terminal_events = vec![ Clear, HideCursor, Draw, Flush, Draw, Flush, Clear, ShowCursor ]; + assert_eq!(&terminal_events_mirror[..], &expected_terminal_events[..]); + + assert_eq!(terminal_draw_events_mirror.len(), 2); + assert_snapshot!(&terminal_draw_events_mirror[0]); + assert_snapshot!(&terminal_draw_events_mirror[1]); +} + +#[test] +fn multiple_processes_with_multiple_connections () { + let stdin_events = InputEvents::new(vec![ + None, // sleep + None, // sleep + Some(Event::Key(Key::Ctrl('c'))) + ]); + let channel = NetworkFrames::new(vec![ + Some(build_tcp_packet("1.1.1.1", "10.0.0.2", 12345, 443, b"I have come from 1.1.1.1")), + Some(build_tcp_packet("3.3.3.3", "10.0.0.2", 1337, 443, b"Awesome, I'm from 3.3.3.3")), + Some(build_tcp_packet("2.2.2.2", "10.0.0.2", 54321, 443, b"You know, 2.2.2.2 is really nice!")), + Some(build_tcp_packet("4.4.4.4", "10.0.0.2", 1337, 443, b"I'm partial to 4.4.4.4")) + ]); + + let terminal_events = LogWithMirror::new(Vec::new()); + let terminal_draw_events = LogWithMirror::new(Vec::new()); + + let backend = TestBackend::new(terminal_events.write, terminal_draw_events.write); + let interface = get_interface(); + + what::start(backend, &create_process, &get_sockets_info, interface, channel, stdin_events); + + let terminal_events_mirror = terminal_events.mirror.lock().unwrap(); + let terminal_draw_events_mirror = terminal_draw_events.mirror.lock().unwrap(); + + let expected_terminal_events = vec![ Clear, HideCursor, Draw, Flush, Draw, Flush, Clear, ShowCursor ]; + assert_eq!(&terminal_events_mirror[..], &expected_terminal_events[..]); + + assert_eq!(terminal_draw_events_mirror.len(), 2); + assert_snapshot!(&terminal_draw_events_mirror[0]); + assert_snapshot!(&terminal_draw_events_mirror[1]); +} + +#[test] +fn multiple_connections_from_remote_ip() { + let stdin_events = InputEvents::new(vec![ + None, // sleep + None, // sleep + Some(Event::Key(Key::Ctrl('c'))) + ]); + let channel = NetworkFrames::new(vec![ + Some(build_tcp_packet("1.1.1.1", "10.0.0.2", 12345, 443, b"I have come from 1.1.1.1")), + Some(build_tcp_packet("1.1.1.1", "10.0.0.2", 12346, 443, b"Me too, but on a different port")) + ]); + + let terminal_events = LogWithMirror::new(Vec::new()); + let terminal_draw_events = LogWithMirror::new(Vec::new()); + + let backend = TestBackend::new(terminal_events.write, terminal_draw_events.write); + let interface = get_interface(); + + what::start(backend, &create_process, &get_sockets_info, interface, channel, stdin_events); + + let terminal_events_mirror = terminal_events.mirror.lock().unwrap(); + let terminal_draw_events_mirror = terminal_draw_events.mirror.lock().unwrap(); + + let expected_terminal_events = vec![ Clear, HideCursor, Draw, Flush, Draw, Flush, Clear, ShowCursor ]; + assert_eq!(&terminal_events_mirror[..], &expected_terminal_events[..]); + + assert_eq!(terminal_draw_events_mirror.len(), 2); + assert_snapshot!(&terminal_draw_events_mirror[0]); + assert_snapshot!(&terminal_draw_events_mirror[1]); +} + +#[test] +fn sustained_traffic_from_one_process () { + let stdin_events = InputEvents::new(vec![ + None, // sleep + None, // sleep + None, // sleep + Some(Event::Key(Key::Ctrl('c'))) + ]); + let channel = NetworkFrames::new(vec![ + Some(build_tcp_packet("1.1.1.1", "10.0.0.2", 12345, 443, b"I have come from 1.1.1.1")), + None, // sleep + Some(build_tcp_packet("1.1.1.1", "10.0.0.2", 12345, 443, b"Same here, but one second later")), + ]); + + let terminal_events = LogWithMirror::new(Vec::new()); + let terminal_draw_events = LogWithMirror::new(Vec::new()); + + let backend = TestBackend::new(terminal_events.write, terminal_draw_events.write); + let interface = get_interface(); + + what::start(backend, &create_process, &get_sockets_info, interface, channel, stdin_events); + + let terminal_events_mirror = terminal_events.mirror.lock().unwrap(); + let terminal_draw_events_mirror = terminal_draw_events.mirror.lock().unwrap(); + + let expected_terminal_events = vec![ Clear, HideCursor, Draw, Flush, Draw, Flush, Draw, Flush, Clear, ShowCursor ]; + assert_eq!(&terminal_events_mirror[..], &expected_terminal_events[..]); + + assert_eq!(terminal_draw_events_mirror.len(), 3); + assert_snapshot!(&terminal_draw_events_mirror[1]); + assert_snapshot!(&terminal_draw_events_mirror[2]); +} + +#[test] +fn sustained_traffic_from_multiple_processes () { + let stdin_events = InputEvents::new(vec![ + None, // sleep + None, // sleep + None, // sleep + Some(Event::Key(Key::Ctrl('c'))) + ]); + let channel = NetworkFrames::new(vec![ + Some(build_tcp_packet("1.1.1.1", "10.0.0.2", 12345, 443, b"I have come from 1.1.1.1")), + Some(build_tcp_packet("3.3.3.3", "10.0.0.2", 1337, 443, b"I come from 3.3.3.3")), + None, // sleep + Some(build_tcp_packet("1.1.1.1", "10.0.0.2", 12345, 443, b"I have come from 1.1.1.1 one second later")), + Some(build_tcp_packet("3.3.3.3", "10.0.0.2", 1337, 443, b"I come 3.3.3.3 one second later")) + ]); + + let terminal_events = LogWithMirror::new(Vec::new()); + let terminal_draw_events = LogWithMirror::new(Vec::new()); + + let backend = TestBackend::new(terminal_events.write, terminal_draw_events.write); + let interface = get_interface(); + + what::start(backend, &create_process, &get_sockets_info, interface, channel, stdin_events); + + let terminal_events_mirror = terminal_events.mirror.lock().unwrap(); + let terminal_draw_events_mirror = terminal_draw_events.mirror.lock().unwrap(); + + let expected_terminal_events = vec![ Clear, HideCursor, Draw, Flush, Draw, Flush, Draw, Flush, Clear, ShowCursor ]; + assert_eq!(&terminal_events_mirror[..], &expected_terminal_events[..]); + + assert_eq!(terminal_draw_events_mirror.len(), 3); + assert_snapshot!(&terminal_draw_events_mirror[1]); + assert_snapshot!(&terminal_draw_events_mirror[2]); +} + +#[test] +fn sustained_traffic_from_multiple_processes_bi_directional () { + let stdin_events = InputEvents::new(vec![ + None, // sleep + None, // sleep + None, // sleep + Some(Event::Key(Key::Ctrl('c'))) + ]); + let channel = NetworkFrames::new(vec![ + Some(build_tcp_packet("10.0.0.2", "3.3.3.3", 443, 1337, b"omw to 3.3.3.3")), + Some(build_tcp_packet("3.3.3.3", "10.0.0.2", 1337, 443, b"I was just there!")), + Some(build_tcp_packet("1.1.1.1", "10.0.0.2", 12345, 443, b"Is it nice there? I think 1.1.1.1 is dull")), + Some(build_tcp_packet("10.0.0.2", "1.1.1.1", 443, 12345, b"Well, I heard 1.1.1.1 is all the rage")), + None, // sleep + Some(build_tcp_packet("10.0.0.2", "3.3.3.3", 443, 1337, b"Wait for me!")), + Some(build_tcp_packet("3.3.3.3", "10.0.0.2", 1337, 443, b"They're waiting for you...")), + Some(build_tcp_packet("1.1.1.1", "10.0.0.2", 12345, 443, b"1.1.1.1 forever!")), + Some(build_tcp_packet("10.0.0.2", "1.1.1.1", 443, 12345, b"10.0.0.2 forever!")) + ]); + + let terminal_events = LogWithMirror::new(Vec::new()); + let terminal_draw_events = LogWithMirror::new(Vec::new()); + + let backend = TestBackend::new(terminal_events.write, terminal_draw_events.write); + let interface = get_interface(); + + what::start(backend, &create_process, &get_sockets_info, interface, channel, stdin_events); + + let terminal_events_mirror = terminal_events.mirror.lock().unwrap(); + let terminal_draw_events_mirror = terminal_draw_events.mirror.lock().unwrap(); + + let expected_terminal_events = vec![ Clear, HideCursor, Draw, Flush, Draw, Flush, Draw, Flush, Clear, ShowCursor ]; + assert_eq!(&terminal_events_mirror[..], &expected_terminal_events[..]); + + assert_eq!(terminal_draw_events_mirror.len(), 3); + assert_snapshot!(&terminal_draw_events_mirror[1]); + assert_snapshot!(&terminal_draw_events_mirror[2]); +} diff --git a/tests/fakes/fake_input.rs b/tests/fakes/fake_input.rs new file mode 100644 index 0000000..1f57ec8 --- /dev/null +++ b/tests/fakes/fake_input.rs @@ -0,0 +1,136 @@ +extern crate what; + +use ::pnet::datalink::NetworkInterface; +use ::ipnetwork::IpNetwork; +use ::pnet::datalink::DataLinkReceiver; +use ::termion::event::Event; +use ::std::{thread, time}; +use ::std::net::{IpAddr}; + +use ::netstat::*; + +pub struct InputEvents { + pub events: Vec> +} + +impl InputEvents { + pub fn new(mut events: Vec>) -> Self { + events.reverse(); // this is so that we do not have to shift the array + InputEvents { events } + } +} +impl Iterator for InputEvents { + type Item = Event; + fn next(&mut self) -> Option { + match self.events.pop() { + Some(ev) => { + match ev { + Some(ev) => Some(ev), // TODO: better + None => { + thread::sleep(time::Duration::from_secs(1)); + self.next() + } + } + }, + None => None + } + } +} + +pub struct NetworkFrames { + pub packets: Vec>>, + pub current_index: usize +} + +impl NetworkFrames { + pub fn new (packets: Vec>>) -> Box { + Box::new(NetworkFrames { packets, current_index: 0 }) + } + fn next_packet (&mut self) -> &Option>{ + let next_index = self.current_index; + self.current_index += 1; + &self.packets[next_index] + } +} +impl DataLinkReceiver for NetworkFrames { + fn next (&mut self) -> Result<&[u8], std::io::Error > { + if self.current_index == 0 { + // make it less likely to have a race condition with the display loop + // this is so the tests pass consistently + thread::sleep(time::Duration::from_millis(500)); + } + match self.current_index < self.packets.len() { + true => { + let action = self.next_packet(); + match action { + Some(packet) => { + Ok(&packet[..]) // TODO: better + }, + None => { + thread::sleep(time::Duration::from_secs(1)); + Ok(&[][..]) + } + } + }, + false => { + thread::sleep(time::Duration::from_secs(1)); + Ok(&[][..]) + } + } + } +} + +fn create_fake_socket (associated_pids: Vec, local_ip: IpAddr, remote_ip: IpAddr, local_port: u16, remote_port: u16) -> SocketInfo { + let protocol_socket_info = TcpSocketInfo { + local_addr: local_ip, + remote_addr: remote_ip, + local_port: local_port, + remote_port: remote_port, + state: TcpState::Listen + }; + SocketInfo { + protocol_socket_info: ProtocolSocketInfo::Tcp(protocol_socket_info), + associated_pids: associated_pids, + inode: 2 + } +} + +pub fn get_sockets_info( + _af_flags: AddressFamilyFlags, + _proto_flags: ProtocolFlags, +) -> Result, Error> { + let fake_open_sockets = vec![ + create_fake_socket(vec![1, 2, 3], IpAddr::V4("10.0.0.2".parse().unwrap()), IpAddr::V4("1.1.1.1".parse().unwrap()), 443, 12345), + create_fake_socket(vec![4], IpAddr::V4("10.0.0.2".parse().unwrap()), IpAddr::V4("2.2.2.2".parse().unwrap()), 443, 54321), + create_fake_socket(vec![1], IpAddr::V4("10.0.0.2".parse().unwrap()), IpAddr::V4("3.3.3.3".parse().unwrap()), 443, 1337), + create_fake_socket(vec![4], IpAddr::V4("10.0.0.2".parse().unwrap()), IpAddr::V4("4.4.4.4".parse().unwrap()), 443, 1337), + create_fake_socket(vec![1, 2, 3], IpAddr::V4("10.0.0.2".parse().unwrap()), IpAddr::V4("1.1.1.1".parse().unwrap()), 443, 12346) + ]; + Ok(fake_open_sockets) +} + +#[derive(Debug)] +pub struct GenericProcess { + pub id: i32 +} + +impl what::ui::IsProcess for GenericProcess { + fn get_name (&self) -> String { + self.id.to_string() + } +} + +pub fn create_process (id: i32) -> Result> { + Ok(GenericProcess {id}) +} + +pub fn get_interface () -> NetworkInterface { + let interface = NetworkInterface { + name: String::from("foo"), + index: 42, + mac: None, + ips: vec!(IpNetwork::V4("10.0.0.2".parse().unwrap())), + flags: 42 + }; + interface +} diff --git a/tests/fakes/fake_output.rs b/tests/fakes/fake_output.rs new file mode 100644 index 0000000..4714bad --- /dev/null +++ b/tests/fakes/fake_output.rs @@ -0,0 +1,263 @@ +// mostly copied and adjusted from https://github.com/fdehau/tui-rs/blob/master/src/backend/termion.rs + +use std::fmt; +use std::io; + +use ::std::sync::{Arc, Mutex}; + +use ::tui::backend::Backend; +use ::tui::buffer::Cell; +use ::tui::layout::Rect; +use ::tui::style; + +#[derive(Hash, Debug, PartialEq)] +pub enum TerminalEvent { + Clear, + HideCursor, + ShowCursor, + GetCursor, + Flush, + Draw +} + +pub struct TestBackend { + pub events: Arc>>, + pub draw_events: Arc>> +} + +impl TestBackend { + pub fn new(log: Arc>>, draw_log: Arc>>) -> TestBackend { + TestBackend { events: log, draw_events: draw_log } + } +} + +impl Backend for TestBackend { + + /// Clears the entire screen and move the cursor to the top left of the screen + fn clear(&mut self) -> io::Result<()> { + self.events.lock().unwrap().push(TerminalEvent::Clear); + Ok(()) + } + + /// Hides cursor + fn hide_cursor(&mut self) -> io::Result<()> { + self.events.lock().unwrap().push(TerminalEvent::HideCursor); + Ok(()) + } + + /// Shows cursor + fn show_cursor(&mut self) -> io::Result<()> { + self.events.lock().unwrap().push(TerminalEvent::ShowCursor); + Ok(()) + } + + /// Gets cursor position (0-based index) + fn get_cursor(&mut self) -> io::Result<(u16, u16)> { + self.events.lock().unwrap().push(TerminalEvent::GetCursor); + Ok((0, 0)) + } + + /// Sets cursor position (0-based index) + fn set_cursor(&mut self, _x: u16, _y: u16) -> io::Result<()> { + Ok(()) + } + + fn draw<'a, I>(&mut self, content: I) -> io::Result<()> + where + I: Iterator, + { + use std::fmt::Write; + self.events.lock().unwrap().push(TerminalEvent::Draw); + + let mut string = String::with_capacity(content.size_hint().0 * 3); + let mut style = style::Style::default(); + let mut last_y = 0; + let mut last_x = 0; + let mut inst = 0; + for (x, y, cell) in content { + if y != last_y || x != last_x + 1 || inst == 0 { + write!(string, "{}", termion::cursor::Goto(x + 1, y + 1)).unwrap(); + inst += 1; + } + last_x = x; + last_y = y; + if cell.style.modifier != style.modifier { + write!( + string, + "{}", + ModifierDiff { + from: style.modifier, + to: cell.style.modifier + } + ) + .unwrap(); + style.modifier = cell.style.modifier; + inst += 1; + } + if cell.style.fg != style.fg { + write!(string, "{}", Fg(cell.style.fg)).unwrap(); + style.fg = cell.style.fg; + inst += 1; + } + if cell.style.bg != style.bg { + write!(string, "{}", Bg(cell.style.bg)).unwrap(); + style.bg = cell.style.bg; + inst += 1; + } + string.push_str(&cell.symbol); + inst += 1; + } + self.draw_events.lock().unwrap().push(string.clone()); + // uncomment this to print to screen + // + // write!(self.stdout, "{}", termion::clear::All)?; + // write!( + // self.stdout, + // "{}{}{}{}", + // string, + // Fg(style::Color::Reset), + // Bg(style::Color::Reset), + // termion::style::Reset, + // ); + Ok(()) + } + + /// Return the size of the terminal + fn size(&self) -> io::Result { + Ok(Rect::new(0, 0, 190, 50)) + } + + fn flush(&mut self) -> io::Result<()> { + self.events.lock().unwrap().push(TerminalEvent::Flush); + Ok(()) + } +} + +struct Fg(style::Color); + +struct Bg(style::Color); + +struct ModifierDiff { + from: style::Modifier, + to: style::Modifier, +} + +impl fmt::Display for Fg { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + use termion::color::Color; + match self.0 { + style::Color::Reset => termion::color::Reset.write_fg(f), + style::Color::Black => termion::color::Black.write_fg(f), + style::Color::Red => termion::color::Red.write_fg(f), + style::Color::Green => termion::color::Green.write_fg(f), + style::Color::Yellow => termion::color::Yellow.write_fg(f), + style::Color::Blue => termion::color::Blue.write_fg(f), + style::Color::Magenta => termion::color::Magenta.write_fg(f), + style::Color::Cyan => termion::color::Cyan.write_fg(f), + style::Color::Gray => termion::color::White.write_fg(f), + style::Color::DarkGray => termion::color::LightBlack.write_fg(f), + style::Color::LightRed => termion::color::LightRed.write_fg(f), + style::Color::LightGreen => termion::color::LightGreen.write_fg(f), + style::Color::LightBlue => termion::color::LightBlue.write_fg(f), + style::Color::LightYellow => termion::color::LightYellow.write_fg(f), + style::Color::LightMagenta => termion::color::LightMagenta.write_fg(f), + style::Color::LightCyan => termion::color::LightCyan.write_fg(f), + style::Color::White => termion::color::LightWhite.write_fg(f), + style::Color::Indexed(i) => termion::color::AnsiValue(i).write_fg(f), + style::Color::Rgb(r, g, b) => termion::color::Rgb(r, g, b).write_fg(f), + } + } +} +impl fmt::Display for Bg { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + use termion::color::Color; + match self.0 { + style::Color::Reset => termion::color::Reset.write_bg(f), + style::Color::Black => termion::color::Black.write_bg(f), + style::Color::Red => termion::color::Red.write_bg(f), + style::Color::Green => termion::color::Green.write_bg(f), + style::Color::Yellow => termion::color::Yellow.write_bg(f), + style::Color::Blue => termion::color::Blue.write_bg(f), + style::Color::Magenta => termion::color::Magenta.write_bg(f), + style::Color::Cyan => termion::color::Cyan.write_bg(f), + style::Color::Gray => termion::color::White.write_bg(f), + style::Color::DarkGray => termion::color::LightBlack.write_bg(f), + style::Color::LightRed => termion::color::LightRed.write_bg(f), + style::Color::LightGreen => termion::color::LightGreen.write_bg(f), + style::Color::LightBlue => termion::color::LightBlue.write_bg(f), + style::Color::LightYellow => termion::color::LightYellow.write_bg(f), + style::Color::LightMagenta => termion::color::LightMagenta.write_bg(f), + style::Color::LightCyan => termion::color::LightCyan.write_bg(f), + style::Color::White => termion::color::LightWhite.write_bg(f), + style::Color::Indexed(i) => termion::color::AnsiValue(i).write_bg(f), + style::Color::Rgb(r, g, b) => termion::color::Rgb(r, g, b).write_bg(f), + } + } +} + +impl fmt::Display for ModifierDiff { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let remove = self.from - self.to; + if remove.contains(style::Modifier::REVERSED) { + write!(f, "{}", termion::style::NoInvert)?; + } + if remove.contains(style::Modifier::BOLD) { + // XXX: the termion NoBold flag actually enables double-underline on ECMA-48 compliant + // terminals, and NoFaint additionally disables bold... so we use this trick to get + // the right semantics. + write!(f, "{}", termion::style::NoFaint)?; + + if self.to.contains(style::Modifier::DIM) { + write!(f, "{}", termion::style::Faint)?; + } + } + if remove.contains(style::Modifier::ITALIC) { + write!(f, "{}", termion::style::NoItalic)?; + } + if remove.contains(style::Modifier::UNDERLINED) { + write!(f, "{}", termion::style::NoUnderline)?; + } + if remove.contains(style::Modifier::DIM) { + write!(f, "{}", termion::style::NoFaint)?; + + // XXX: the NoFaint flag additionally disables bold as well, so we need to re-enable it + // here if we want it. + if self.to.contains(style::Modifier::BOLD) { + write!(f, "{}", termion::style::Bold)?; + } + } + if remove.contains(style::Modifier::CROSSED_OUT) { + write!(f, "{}", termion::style::NoCrossedOut)?; + } + if remove.contains(style::Modifier::SLOW_BLINK) + || remove.contains(style::Modifier::RAPID_BLINK) + { + write!(f, "{}", termion::style::NoBlink)?; + } + + let add = self.to - self.from; + if add.contains(style::Modifier::REVERSED) { + write!(f, "{}", termion::style::Invert)?; + } + if add.contains(style::Modifier::BOLD) { + write!(f, "{}", termion::style::Bold)?; + } + if add.contains(style::Modifier::ITALIC) { + write!(f, "{}", termion::style::Italic)?; + } + if add.contains(style::Modifier::UNDERLINED) { + write!(f, "{}", termion::style::Underline)?; + } + if add.contains(style::Modifier::DIM) { + write!(f, "{}", termion::style::Faint)?; + } + if add.contains(style::Modifier::CROSSED_OUT) { + write!(f, "{}", termion::style::CrossedOut)?; + } + if add.contains(style::Modifier::SLOW_BLINK) || add.contains(style::Modifier::RAPID_BLINK) { + write!(f, "{}", termion::style::Blink)?; + } + + Ok(()) + } +} diff --git a/tests/fakes/mod.rs b/tests/fakes/mod.rs new file mode 100644 index 0000000..90009d8 --- /dev/null +++ b/tests/fakes/mod.rs @@ -0,0 +1,7 @@ +extern crate what; + +mod fake_input; +mod fake_output; + +pub use fake_input::*; +pub use fake_output::*; diff --git a/tests/snapshots/cli__basic_startup.snap b/tests/snapshots/cli__basic_startup.snap new file mode 100644 index 0000000..ca350fb --- /dev/null +++ b/tests/snapshots/cli__basic_startup.snap @@ -0,0 +1,5 @@ +--- +source: tests/cli.rs +expression: "&draw_log_copy.lock().unwrap()[0]" +--- +┌Utilizationbyconnection────────────────────────────────────────────────────────────────────┐┌Utilizationbyprocessname──────────────────────────────────────────────────────────────────┐│ConnectionProcessesTotal Bytes Up/Down││ProcessConnection CountTotal Bytes│││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││└─────────────────────────────────────────────────────────────────────────────────────────────┘││┌Utilizationbyremoteip─────────────────────────────────────────────────────────────────────┐│││Remote AddressConnection CountTotal Bytes│││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││└─────────────────────────────────────────────────────────────────────────────────────────────┘└─────────────────────────────────────────────────────────────────────────────────────────────┘ diff --git a/tests/snapshots/cli__bi_directional_traffic-2.snap b/tests/snapshots/cli__bi_directional_traffic-2.snap new file mode 100644 index 0000000..53f504d --- /dev/null +++ b/tests/snapshots/cli__bi_directional_traffic-2.snap @@ -0,0 +1,5 @@ +--- +source: tests/cli.rs +expression: "&draw_log_copy.lock().unwrap()[1]" +--- +10.0.0.2:443 => 1.1.1.1:12345 (tcp)12369Bps/71Bps1169Bps/71Bps2169Bps/71Bps3169Bps/71Bps1.1.1.1169Bps/71Bps diff --git a/tests/snapshots/cli__bi_directional_traffic.snap b/tests/snapshots/cli__bi_directional_traffic.snap new file mode 100644 index 0000000..ca350fb --- /dev/null +++ b/tests/snapshots/cli__bi_directional_traffic.snap @@ -0,0 +1,5 @@ +--- +source: tests/cli.rs +expression: "&draw_log_copy.lock().unwrap()[0]" +--- +┌Utilizationbyconnection────────────────────────────────────────────────────────────────────┐┌Utilizationbyprocessname──────────────────────────────────────────────────────────────────┐│ConnectionProcessesTotal Bytes Up/Down││ProcessConnection CountTotal Bytes│││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││└─────────────────────────────────────────────────────────────────────────────────────────────┘││┌Utilizationbyremoteip─────────────────────────────────────────────────────────────────────┐│││Remote AddressConnection CountTotal Bytes│││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││└─────────────────────────────────────────────────────────────────────────────────────────────┘└─────────────────────────────────────────────────────────────────────────────────────────────┘ diff --git a/tests/snapshots/cli__multiple_connections_from_remote_ip-2.snap b/tests/snapshots/cli__multiple_connections_from_remote_ip-2.snap new file mode 100644 index 0000000..17b734d --- /dev/null +++ b/tests/snapshots/cli__multiple_connections_from_remote_ip-2.snap @@ -0,0 +1,5 @@ +--- +source: tests/cli.rs +expression: "&terminal_draw_events_mirror[1]" +--- +10.0.0.2:443 => 1.1.1.1:12345 (tcp)1230Bps/64Bps120Bps/135Bps10.0.0.2:443 => 1.1.1.1:12346 (tcp)1230Bps/71Bps220Bps/135Bps320Bps/135Bps1.1.1.120Bps/135Bps diff --git a/tests/snapshots/cli__multiple_connections_from_remote_ip.snap b/tests/snapshots/cli__multiple_connections_from_remote_ip.snap new file mode 100644 index 0000000..ca350fb --- /dev/null +++ b/tests/snapshots/cli__multiple_connections_from_remote_ip.snap @@ -0,0 +1,5 @@ +--- +source: tests/cli.rs +expression: "&draw_log_copy.lock().unwrap()[0]" +--- +┌Utilizationbyconnection────────────────────────────────────────────────────────────────────┐┌Utilizationbyprocessname──────────────────────────────────────────────────────────────────┐│ConnectionProcessesTotal Bytes Up/Down││ProcessConnection CountTotal Bytes│││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││└─────────────────────────────────────────────────────────────────────────────────────────────┘││┌Utilizationbyremoteip─────────────────────────────────────────────────────────────────────┐│││Remote AddressConnection CountTotal Bytes│││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││└─────────────────────────────────────────────────────────────────────────────────────────────┘└─────────────────────────────────────────────────────────────────────────────────────────────┘ diff --git a/tests/snapshots/cli__multiple_packets_of_traffic_from_different_connections-2.snap b/tests/snapshots/cli__multiple_packets_of_traffic_from_different_connections-2.snap new file mode 100644 index 0000000..e564b54 --- /dev/null +++ b/tests/snapshots/cli__multiple_packets_of_traffic_from_different_connections-2.snap @@ -0,0 +1,5 @@ +--- +source: tests/cli.rs +expression: "&draw_log_copy.lock().unwrap()[1]" +--- +10.0.0.2:443 => 1.1.1.1:12345 (tcp)1230Bps/64Bps110Bps/64Bps10.0.0.2:443 => 2.2.2.2:54321 (tcp)40Bps/59Bps210Bps/64Bps310Bps/64Bps410Bps/59Bps1.1.1.110Bps/64Bps2.2.2.210Bps/59Bps diff --git a/tests/snapshots/cli__multiple_packets_of_traffic_from_different_connections.snap b/tests/snapshots/cli__multiple_packets_of_traffic_from_different_connections.snap new file mode 100644 index 0000000..ca350fb --- /dev/null +++ b/tests/snapshots/cli__multiple_packets_of_traffic_from_different_connections.snap @@ -0,0 +1,5 @@ +--- +source: tests/cli.rs +expression: "&draw_log_copy.lock().unwrap()[0]" +--- +┌Utilizationbyconnection────────────────────────────────────────────────────────────────────┐┌Utilizationbyprocessname──────────────────────────────────────────────────────────────────┐│ConnectionProcessesTotal Bytes Up/Down││ProcessConnection CountTotal Bytes│││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││└─────────────────────────────────────────────────────────────────────────────────────────────┘││┌Utilizationbyremoteip─────────────────────────────────────────────────────────────────────┐│││Remote AddressConnection CountTotal Bytes│││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││└─────────────────────────────────────────────────────────────────────────────────────────────┘└─────────────────────────────────────────────────────────────────────────────────────────────┘ diff --git a/tests/snapshots/cli__multiple_packets_of_traffic_from_single_connection-2.snap b/tests/snapshots/cli__multiple_packets_of_traffic_from_single_connection-2.snap new file mode 100644 index 0000000..a8255ff --- /dev/null +++ b/tests/snapshots/cli__multiple_packets_of_traffic_from_single_connection-2.snap @@ -0,0 +1,5 @@ +--- +source: tests/cli.rs +expression: "&terminal_draw_events_mirror[1]" +--- +10.0.0.2:443 => 1.1.1.1:12345 (tcp)1230Bps/131Bps110Bps/131Bps210Bps/131Bps310Bps/131Bps1.1.1.110Bps/131Bps diff --git a/tests/snapshots/cli__multiple_packets_of_traffic_from_single_connection.snap b/tests/snapshots/cli__multiple_packets_of_traffic_from_single_connection.snap new file mode 100644 index 0000000..ca350fb --- /dev/null +++ b/tests/snapshots/cli__multiple_packets_of_traffic_from_single_connection.snap @@ -0,0 +1,5 @@ +--- +source: tests/cli.rs +expression: "&draw_log_copy.lock().unwrap()[0]" +--- +┌Utilizationbyconnection────────────────────────────────────────────────────────────────────┐┌Utilizationbyprocessname──────────────────────────────────────────────────────────────────┐│ConnectionProcessesTotal Bytes Up/Down││ProcessConnection CountTotal Bytes│││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││└─────────────────────────────────────────────────────────────────────────────────────────────┘││┌Utilizationbyremoteip─────────────────────────────────────────────────────────────────────┐│││Remote AddressConnection CountTotal Bytes│││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││└─────────────────────────────────────────────────────────────────────────────────────────────┘└─────────────────────────────────────────────────────────────────────────────────────────────┘ diff --git a/tests/snapshots/cli__multiple_processes_with_multiple_connections-2.snap b/tests/snapshots/cli__multiple_processes_with_multiple_connections-2.snap new file mode 100644 index 0000000..f33b7a7 --- /dev/null +++ b/tests/snapshots/cli__multiple_processes_with_multiple_connections-2.snap @@ -0,0 +1,5 @@ +--- +source: tests/cli.rs +expression: "&terminal_draw_events_mirror[1]" +--- +10.0.0.2:443 => 1.1.1.1:12345 (tcp)1230Bps/64Bps120Bps/129Bps10.0.0.2:443 => 2.2.2.2:54321 (tcp)40Bps/73Bps210Bps/64Bps10.0.0.2:443 => 3.3.3.3:1337 (tcp)10Bps/65Bps310Bps/64Bps10.0.0.2:443 => 4.4.4.4:1337 (tcp)40Bps/62Bps420Bps/135Bps1.1.1.110Bps/64Bps2.2.2.210Bps/73Bps3.3.3.310Bps/65Bps4.4.4.410Bps/62Bps diff --git a/tests/snapshots/cli__multiple_processes_with_multiple_connections.snap b/tests/snapshots/cli__multiple_processes_with_multiple_connections.snap new file mode 100644 index 0000000..ca350fb --- /dev/null +++ b/tests/snapshots/cli__multiple_processes_with_multiple_connections.snap @@ -0,0 +1,5 @@ +--- +source: tests/cli.rs +expression: "&draw_log_copy.lock().unwrap()[0]" +--- +┌Utilizationbyconnection────────────────────────────────────────────────────────────────────┐┌Utilizationbyprocessname──────────────────────────────────────────────────────────────────┐│ConnectionProcessesTotal Bytes Up/Down││ProcessConnection CountTotal Bytes│││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││└─────────────────────────────────────────────────────────────────────────────────────────────┘││┌Utilizationbyremoteip─────────────────────────────────────────────────────────────────────┐│││Remote AddressConnection CountTotal Bytes│││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││└─────────────────────────────────────────────────────────────────────────────────────────────┘└─────────────────────────────────────────────────────────────────────────────────────────────┘ diff --git a/tests/snapshots/cli__one_packet_of_traffic-2.snap b/tests/snapshots/cli__one_packet_of_traffic-2.snap new file mode 100644 index 0000000..0e962c7 --- /dev/null +++ b/tests/snapshots/cli__one_packet_of_traffic-2.snap @@ -0,0 +1,5 @@ +--- +source: tests/cli.rs +expression: "&draw_log_copy.lock().unwrap()[1]" +--- +10.0.0.2:443 => 1.1.1.1:12345 (tcp)12362Bps/0Bps1162Bps/0Bps2162Bps/0Bps3162Bps/0Bps1.1.1.1162Bps/0Bps diff --git a/tests/snapshots/cli__one_packet_of_traffic.snap b/tests/snapshots/cli__one_packet_of_traffic.snap new file mode 100644 index 0000000..ca350fb --- /dev/null +++ b/tests/snapshots/cli__one_packet_of_traffic.snap @@ -0,0 +1,5 @@ +--- +source: tests/cli.rs +expression: "&draw_log_copy.lock().unwrap()[0]" +--- +┌Utilizationbyconnection────────────────────────────────────────────────────────────────────┐┌Utilizationbyprocessname──────────────────────────────────────────────────────────────────┐│ConnectionProcessesTotal Bytes Up/Down││ProcessConnection CountTotal Bytes│││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││└─────────────────────────────────────────────────────────────────────────────────────────────┘││┌Utilizationbyremoteip─────────────────────────────────────────────────────────────────────┐│││Remote AddressConnection CountTotal Bytes│││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││└─────────────────────────────────────────────────────────────────────────────────────────────┘└─────────────────────────────────────────────────────────────────────────────────────────────┘ diff --git a/tests/snapshots/cli__one_process_with_multiple_connections-2.snap b/tests/snapshots/cli__one_process_with_multiple_connections-2.snap new file mode 100644 index 0000000..6519e47 --- /dev/null +++ b/tests/snapshots/cli__one_process_with_multiple_connections-2.snap @@ -0,0 +1,5 @@ +--- +source: tests/cli.rs +expression: "&terminal_draw_events_mirror[1]" +--- +10.0.0.2:443 => 1.1.1.1:12345 (tcp)1230Bps/64Bps120Bps/132Bps10.0.0.2:443 => 3.3.3.3:1337 (tcp)10Bps/68Bps210Bps/64Bps310Bps/64Bps1.1.1.110Bps/64Bps3.3.3.310Bps/68Bps diff --git a/tests/snapshots/cli__one_process_with_multiple_connections.snap b/tests/snapshots/cli__one_process_with_multiple_connections.snap new file mode 100644 index 0000000..ca350fb --- /dev/null +++ b/tests/snapshots/cli__one_process_with_multiple_connections.snap @@ -0,0 +1,5 @@ +--- +source: tests/cli.rs +expression: "&draw_log_copy.lock().unwrap()[0]" +--- +┌Utilizationbyconnection────────────────────────────────────────────────────────────────────┐┌Utilizationbyprocessname──────────────────────────────────────────────────────────────────┐│ConnectionProcessesTotal Bytes Up/Down││ProcessConnection CountTotal Bytes│││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││└─────────────────────────────────────────────────────────────────────────────────────────────┘││┌Utilizationbyremoteip─────────────────────────────────────────────────────────────────────┐│││Remote AddressConnection CountTotal Bytes│││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││└─────────────────────────────────────────────────────────────────────────────────────────────┘└─────────────────────────────────────────────────────────────────────────────────────────────┘ diff --git a/tests/snapshots/cli__sustained_traffic_from_multiple_processes-2.snap b/tests/snapshots/cli__sustained_traffic_from_multiple_processes-2.snap new file mode 100644 index 0000000..5ef6d48 --- /dev/null +++ b/tests/snapshots/cli__sustained_traffic_from_multiple_processes-2.snap @@ -0,0 +1,5 @@ +--- +source: tests/cli.rs +expression: "&terminal_draw_events_mirror[2]" +--- +81527181818171 diff --git a/tests/snapshots/cli__sustained_traffic_from_multiple_processes.snap b/tests/snapshots/cli__sustained_traffic_from_multiple_processes.snap new file mode 100644 index 0000000..79d285a --- /dev/null +++ b/tests/snapshots/cli__sustained_traffic_from_multiple_processes.snap @@ -0,0 +1,5 @@ +--- +source: tests/cli.rs +expression: "&terminal_draw_events_mirror[1]" +--- +10.0.0.2:443 => 1.1.1.1:12345 (tcp)1230Bps/64Bps120Bps/123Bps10.0.0.2:443 => 3.3.3.3:1337 (tcp)10Bps/59Bps210Bps/64Bps310Bps/64Bps1.1.1.110Bps/64Bps3.3.3.310Bps/59Bps diff --git a/tests/snapshots/cli__sustained_traffic_from_multiple_processes_bi_directional-2.snap b/tests/snapshots/cli__sustained_traffic_from_multiple_processes_bi_directional-2.snap new file mode 100644 index 0000000..f8ebe2c --- /dev/null +++ b/tests/snapshots/cli__sustained_traffic_from_multiple_processes_bi_directional-2.snap @@ -0,0 +1,5 @@ +--- +source: tests/cli.rs +expression: "&terminal_draw_events_mirror[2]" +--- +5560922266556556556266 diff --git a/tests/snapshots/cli__sustained_traffic_from_multiple_processes_bi_directional.snap b/tests/snapshots/cli__sustained_traffic_from_multiple_processes_bi_directional.snap new file mode 100644 index 0000000..6e651fb --- /dev/null +++ b/tests/snapshots/cli__sustained_traffic_from_multiple_processes_bi_directional.snap @@ -0,0 +1,5 @@ +--- +source: tests/cli.rs +expression: "&terminal_draw_events_mirror[1]" +--- +10.0.0.2:443 => 1.1.1.1:12345 (tcp)12377Bps/81Bps12131Bps/138Bps10.0.0.2:443 => 3.3.3.3:1337 (tcp)154Bps/57Bps2177Bps/81Bps3177Bps/81Bps1.1.1.1177Bps/81Bps3.3.3.3154Bps/57Bps diff --git a/tests/snapshots/cli__sustained_traffic_from_one_process-2.snap b/tests/snapshots/cli__sustained_traffic_from_one_process-2.snap new file mode 100644 index 0000000..2f9c2de --- /dev/null +++ b/tests/snapshots/cli__sustained_traffic_from_one_process-2.snap @@ -0,0 +1,5 @@ +--- +source: tests/cli.rs +expression: "&terminal_draw_events_mirror[2]" +--- +7171717171 diff --git a/tests/snapshots/cli__sustained_traffic_from_one_process.snap b/tests/snapshots/cli__sustained_traffic_from_one_process.snap new file mode 100644 index 0000000..beb1b0b --- /dev/null +++ b/tests/snapshots/cli__sustained_traffic_from_one_process.snap @@ -0,0 +1,5 @@ +--- +source: tests/cli.rs +expression: "&draw_log_copy.lock().unwrap()[1]" +--- +10.0.0.2:443 => 1.1.1.1:12345 (tcp)1230Bps/64Bps110Bps/64Bps210Bps/64Bps310Bps/64Bps1.1.1.110Bps/64Bps