From 909aa14fe2a00df96188cfc44dc8eaa884a81411 Mon Sep 17 00:00:00 2001 From: John Smith Date: Thu, 10 Mar 2022 09:51:53 -0500 Subject: [PATCH] no-std-net fix more network refactor --- .gitmodules | 3 + .vscode/launch.json | 7 + Cargo.lock | 742 ++++++++++++------ external/no-std-net | 1 + veilid-core/Cargo.toml | 2 +- veilid-core/src/connection_manager.rs | 1 + veilid-core/src/intf/native/network/mod.rs | 3 +- .../intf/native/network/start_protocols.rs | 48 +- .../native/utils/network_interfaces/mod.rs | 5 +- veilid-core/src/lease_manager.rs | 1 + veilid-core/src/receipt_manager.rs | 9 +- veilid-core/src/rpc_processor/mod.rs | 2 +- veilid-core/src/veilid_api/debug.rs | 66 +- veilid-core/src/veilid_config.rs | 24 +- veilid-core/src/xx/tools.rs | 33 + veilid-flutter/example/lib/main.dart | 15 +- veilid-server/src/settings.rs | 62 +- 17 files changed, 667 insertions(+), 357 deletions(-) create mode 160000 external/no-std-net diff --git a/.gitmodules b/.gitmodules index 0460f25d..be74275d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,3 +16,6 @@ [submodule "external/netlink"] path = external/netlink url = ../netlink.git +[submodule "external/no-std-net"] + path = external/no-std-net + url = git@gitlab.hackers.town:veilid/no-std-net.git diff --git a/.vscode/launch.json b/.vscode/launch.json index 04647bda..40a1d3ca 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -11,6 +11,13 @@ "program": "${workspaceFolder}/target/debug/veilid-server", "pid": "${command:pickMyProcess}" }, + { + "type": "lldb", + "request": "attach", + "name": "Attach to veilid-flutter example", + "program": "${workspaceFolder}/veilid-flutter/example/build/linux/x64/debug/bundle/veilid_example", + "pid": "${command:pickMyProcess}" + }, { "type": "lldb", "request": "launch", diff --git a/Cargo.lock b/Cargo.lock index bc19f650..0cbe99c5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,7 +23,7 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" dependencies = [ - "generic-array", + "generic-array 0.14.5", ] [[package]] @@ -44,7 +44,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be14c7498ea50828a38d0e24a765ed2effe92a705885b57d029cd67d45744072" dependencies = [ "cipher 0.2.5", - "opaque-debug", + "opaque-debug 0.3.0", ] [[package]] @@ -54,16 +54,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea2e11f5e94c2f7d386164cc2aa1f97823fed6f259e486940a71c174dd01b0ce" dependencies = [ "cipher 0.2.5", - "opaque-debug", + "opaque-debug 0.3.0", ] +[[package]] +name = "ahash" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e" + [[package]] name = "ahash" version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom 0.2.4", + "getrandom 0.2.5", "once_cell", "version_check", ] @@ -127,9 +133,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.53" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94a45b455c14666b85fc40a019e8ab9eb75e3a124e05494f5397122bc9eb06e0" +checksum = "4361135be9122e0870de935d7c439aef945b9f9ddd4199a553b5270b49c82a27" dependencies = [ "backtrace", ] @@ -195,9 +201,9 @@ dependencies = [ [[package]] name = "async-global-executor" -version = "2.0.2" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9586ec52317f36de58453159d48351bc244bc24ced3effc1fce22f3d48664af6" +checksum = "c026b7e44f1316b567ee750fea85103f87fcb80792b860e979f221259796ca0a" dependencies = [ "async-channel", "async-executor", @@ -230,9 +236,9 @@ dependencies = [ [[package]] name = "async-lock" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6a8ea61bf9947a1007c5cada31e647dbc77b103c679858150003ba697ea798b" +checksum = "e97a171d191782fba31bb902b14ad94e24a68145032b7eedf871ab0bc0d077b6" dependencies = [ "event-listener", ] @@ -294,9 +300,9 @@ dependencies = [ [[package]] name = "async-task" -version = "4.1.0" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d306121baf53310a3fd342d88dc0824f6bbeace68347593658525565abee8" +checksum = "30696a84d817107fc028e049980e09d5e140e8da8f1caeb17e8e950658a3cea9" [[package]] name = "async-tls" @@ -311,6 +317,17 @@ dependencies = [ "webpki-roots 0.21.1", ] +[[package]] +name = "async-trait" +version = "0.1.52" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "061a7acccaa286c011ddc30970520b98fa40e00c9d644633fb26b5fc63a265e3" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "async-tungstenite" version = "0.8.0" @@ -327,9 +344,9 @@ dependencies = [ [[package]] name = "async-tungstenite" -version = "0.16.1" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5682ea0913e5c20780fe5785abacb85a411e7437bf52a1bedb93ddb3972cb8dd" +checksum = "7922abeade7dd8948c20dfa1f85dc48cc952d2e0791f7c42b8b1cbb07a57129d" dependencies = [ "async-std", "async-tls", @@ -337,7 +354,7 @@ dependencies = [ "futures-util", "log", "pin-project-lite", - "tungstenite 0.16.0", + "tungstenite 0.17.2", ] [[package]] @@ -395,9 +412,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" @@ -434,9 +451,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitvec" -version = "0.20.4" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7774144344a4faa177370406a7ff5f1da24303817368584c6206c8303eb07848" +checksum = "1489fcb93a5bb47da0462ca93ad252ad6af2145cce58d10d46a83931ba9f016b" dependencies = [ "funty", "radium", @@ -468,13 +485,34 @@ dependencies = [ "syn", ] +[[package]] +name = "block-buffer" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" +dependencies = [ + "block-padding 0.1.5", + "byte-tools", + "byteorder", + "generic-array 0.12.4", +] + [[package]] name = "block-buffer" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "generic-array", + "generic-array 0.14.5", +] + +[[package]] +name = "block-buffer" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +dependencies = [ + "generic-array 0.14.5", ] [[package]] @@ -483,10 +521,19 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57a0e8073e8baa88212fb5823574c02ebccb395136ba9a164ab89379ec6072f0" dependencies = [ - "block-padding", + "block-padding 0.2.1", "cipher 0.2.5", ] +[[package]] +name = "block-padding" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +dependencies = [ + "byte-tools", +] + [[package]] name = "block-padding" version = "0.2.1" @@ -539,9 +586,15 @@ checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" [[package]] name = "byte-slice-cast" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d30c751592b77c499e7bce34d99d67c2c11bdc0574e9a488ddade14150a4698" +checksum = "87c5fdd0166095e1d463fc6cc01aa8ce547ad77a4e84d42eb6762b084e28067e" + +[[package]] +name = "byte-tools" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "byteorder" @@ -596,9 +649,9 @@ dependencies = [ [[package]] name = "capnpc" -version = "0.14.5" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "682f2a7a680ac01d07fcc5e201cf23e5de65f528dfad7305e4a0a5312d35952f" +checksum = "c7ed9b80f792ac01a8b328ccbc509c2bd756fb5dec18af0163e7963dde23c0b5" dependencies = [ "capnp", ] @@ -614,9 +667,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.72" +version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" [[package]] name = "cesu8" @@ -680,7 +733,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" dependencies = [ - "generic-array", + "generic-array 0.14.5", ] [[package]] @@ -689,7 +742,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" dependencies = [ - "generic-array", + "generic-array 0.14.5", ] [[package]] @@ -705,9 +758,9 @@ dependencies = [ [[package]] name = "clap" -version = "3.0.13" +version = "3.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08799f92c961c7a1cf0cc398a9073da99e21ce388b46372c37f3191f2f3eed3e" +checksum = "d8c93436c21e4698bacadf42917db28b23017027a4deccb35dbe47a7e7840123" dependencies = [ "atty", "bitflags", @@ -715,7 +768,7 @@ dependencies = [ "os_str_bytes", "strsim", "termcolor", - "textwrap 0.14.2", + "textwrap 0.15.0", ] [[package]] @@ -753,8 +806,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19b076e143e1d9538dde65da30f8481c2a6c44040edb8e02b9bf1351edb92ce3" dependencies = [ "lazy_static", - "nom", - "rust-ini", + "nom 5.1.2", + "rust-ini 0.13.0", "serde 1.0.136", "serde-hjson", "serde_json", @@ -764,15 +817,18 @@ dependencies = [ [[package]] name = "config" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1b9d958c2b1368a663f05538fc1b5975adce1e19f435acceae987aceeeb369" +checksum = "54ad70579325f1a38ea4c13412b82241c5900700a69785d73e2736bd65a33f86" dependencies = [ + "async-trait", + "json5", "lazy_static", - "nom", - "rust-ini", + "nom 7.1.0", + "pathdiff", + "ron", + "rust-ini 0.17.0", "serde 1.0.136", - "serde-hjson", "serde_json", "toml", "yaml-rust", @@ -816,9 +872,9 @@ dependencies = [ [[package]] name = "core-foundation" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6888e10551bb93e424d8df1d07f1a8b4fceb0001a3a4b048bfc47554946f47b3" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" dependencies = [ "core-foundation-sys 0.8.3", "libc", @@ -913,9 +969,9 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.6" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97242a70df9b89a65d0b6df3c4bf5b9ce03c5b7309019777fbde37e7537f8762" +checksum = "c00d6d2ea26e8b151d99093005cb442fb9a37aeaca582a03ec70946f49ab5ed9" dependencies = [ "cfg-if 1.0.0", "crossbeam-utils", @@ -926,9 +982,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcae03edb34f947e64acdb1c33ec169824e20657e9ecb61cef6c8c74dcb8120" +checksum = "b5e5bed1f1c269533fa816a0a5492b3545209a205ca1a54842be180eb63a16a6" dependencies = [ "cfg-if 1.0.0", "lazy_static", @@ -965,13 +1021,23 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[package]] +name = "crypto-common" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57952ca27b5e3606ff4dd79b0020231aaf9d6aa76dc05fd30137538c50bd3ce8" +dependencies = [ + "generic-array 0.14.5", + "typenum", +] + [[package]] name = "crypto-mac" version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bff07008ec701e8028e2ceb8f83f0e4274ee62bd2dbdc4fefff2e9a91824081a" dependencies = [ - "generic-array", + "generic-array 0.14.5", "subtle", ] @@ -1021,7 +1087,7 @@ dependencies = [ name = "cursive" version = "0.17.0-alpha.0" dependencies = [ - "ahash", + "ahash 0.7.6", "cfg-if 1.0.0", "crossbeam-channel", "crossterm", @@ -1063,7 +1129,7 @@ dependencies = [ name = "cursive_core" version = "0.3.0-alpha.0" dependencies = [ - "ahash", + "ahash 0.7.6", "async-std", "chrono", "crossbeam-channel", @@ -1086,7 +1152,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" dependencies = [ "byteorder", - "digest", + "digest 0.9.0", "rand_core 0.5.1", "subtle", "zeroize", @@ -1099,7 +1165,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c359b7249347e46fb28804470d071c921156ad62b3eef5d34e2ba867533dec8" dependencies = [ "byteorder", - "digest", + "digest 0.9.0", "rand_core 0.6.3", "subtle-ng", "zeroize", @@ -1167,13 +1233,32 @@ dependencies = [ "syn", ] +[[package]] +name = "digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +dependencies = [ + "generic-array 0.12.4", +] + [[package]] name = "digest" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array", + "generic-array 0.14.5", +] + +[[package]] +name = "digest" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +dependencies = [ + "block-buffer 0.10.2", + "crypto-common", ] [[package]] @@ -1197,10 +1282,19 @@ dependencies = [ ] [[package]] -name = "ed25519" -version = "1.3.0" +name = "dlv-list" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74e1069e39f1454367eb2de793ed062fac4c35c2934b76a81d90dd9abcd28816" +checksum = "68df3f2b690c1b86e65ef7830956aededf3cb0a16f898f79b9a6f421a7b6211b" +dependencies = [ + "rand 0.8.5", +] + +[[package]] +name = "ed25519" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eed12bbf7b5312f8da1c2722bc06d8c6b12c2d86a7fb35a194c7f3e6fc2bbe39" dependencies = [ "signature", ] @@ -1298,9 +1392,9 @@ dependencies = [ [[package]] name = "err-derive" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcc7f65832b62ed38939f98966824eb6294911c3629b0e9a262bfb80836d9686" +checksum = "c34a887c8df3ed90498c1c437ce21f211c8e27672921a8ffa293cb8d6d4caa9e" dependencies = [ "proc-macro-error", "proc-macro2", @@ -1312,9 +1406,9 @@ dependencies = [ [[package]] name = "ethbloom" -version = "0.11.1" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfb684ac8fa8f6c5759f788862bb22ec6fe3cb392f6bfd08e3c64b603661e3f8" +checksum = "11da94e443c60508eb62cf256243a64da87304c2802ac2528847f79d750007ef" dependencies = [ "crunchy", "fixed-hash", @@ -1325,9 +1419,9 @@ dependencies = [ [[package]] name = "ethereum-types" -version = "0.12.1" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05136f7057fe789f06e6d41d07b34e6f70d8c86e5693b60f97aaa6553553bdaf" +checksum = "b2827b94c556145446fcce834ca86b7abf0c39a805883fe20e72c5bfdb5a0dc6" dependencies = [ "ethbloom", "fixed-hash", @@ -1365,6 +1459,12 @@ dependencies = [ "synstructure", ] +[[package]] +name = "fake-simd" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" + [[package]] name = "fallible-iterator" version = "0.2.0" @@ -1403,7 +1503,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" dependencies = [ "byteorder", - "rand 0.8.4", + "rand 0.8.5", "rustc-hex", "static_assertions", ] @@ -1452,15 +1552,15 @@ dependencies = [ [[package]] name = "funty" -version = "1.1.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28560757fe2bb34e79f907794bb6b22ae8b0e5c669b638a1132f2592b19035b4" +checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" dependencies = [ "futures-channel", "futures-core", @@ -1473,9 +1573,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3dda0b6588335f360afc675d0564c17a77a2bda81ca178a4b6081bd86c7f0b" +checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" dependencies = [ "futures-core", "futures-sink", @@ -1483,15 +1583,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c8ff0461b82559810cdccfde3215c3f373807f5e5232b71479bff7bb2583d7" +checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" [[package]] name = "futures-executor" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29d6d2ff5bb10fb95c85b8ce46538a2e5f5e7fdc755623a7d4529ab8a4ed9d2a" +checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6" dependencies = [ "futures-core", "futures-task", @@ -1500,9 +1600,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f9d34af5a1aac6fb380f735fe510746c38067c5bf16c7fd250280503c971b2" +checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" [[package]] name = "futures-lite" @@ -1521,9 +1621,9 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbd947adfffb0efc70599b3ddcf7b5597bb5fa9e245eb99f62b3a5f7bb8bd3c" +checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" dependencies = [ "proc-macro2", "quote", @@ -1532,21 +1632,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3055baccb68d74ff6480350f8d6eb8fcfa3aa11bdc1a1ae3afdd0514617d508" +checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" [[package]] name = "futures-task" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ee7c6485c30167ce4dfb83ac568a849fe53274c831081476ee13e0dce1aad72" +checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" [[package]] name = "futures-util" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b5cf40b47a271f77a8b1bec03ca09044d99d2372c0de244e66430761127164" +checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" dependencies = [ "futures-channel", "futures-core", @@ -1560,6 +1660,15 @@ dependencies = [ "slab", ] +[[package]] +name = "generic-array" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" +dependencies = [ + "typenum", +] + [[package]] name = "generic-array" version = "0.14.5" @@ -1583,9 +1692,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" +checksum = "d39cd93900197114fa1fcb7ae84ca742095eed9442088988ae74fa744e930e77" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -1624,13 +1733,22 @@ version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" +[[package]] +name = "hashbrown" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" +dependencies = [ + "ahash 0.4.7", +] + [[package]] name = "hashbrown" version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" dependencies = [ - "ahash", + "ahash 0.7.6", ] [[package]] @@ -1639,7 +1757,7 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c21d40587b92fa6a6c6e3c1bdbf87d75511db5672f9c93175574b3a00df1758" dependencies = [ - "ahash", + "ahash 0.7.6", ] [[package]] @@ -1672,7 +1790,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51ab2f639c231793c5f6114bdb9bbe50a7dbbfcd7c7c6bd8475dec2d991e964f" dependencies = [ - "digest", + "digest 0.9.0", "hmac", ] @@ -1683,7 +1801,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1441c6b1e930e2817404b5046f1f989899143a12bf92de603b69f4e0aee1e15" dependencies = [ "crypto-mac", - "digest", + "digest 0.9.0", ] [[package]] @@ -1699,9 +1817,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acd94fdbe1d4ff688b67b04eee2e17bd50995534a61539e45adfefb45e5e5503" +checksum = "9100414882e15fb7feccb4897e5f0ff0ff1ca7d1a86a23208ada4d7a18e6c6c4" [[package]] name = "ident_case" @@ -1732,9 +1850,9 @@ dependencies = [ [[package]] name = "impl-codec" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "161ebdfec3c8e3b52bf61c4f3550a1eea4f9579d10dc1b936f3171ebdcd6c443" +checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" dependencies = [ "parity-scale-codec", ] @@ -1759,9 +1877,9 @@ dependencies = [ [[package]] name = "impl-trait-for-tuples" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5dacb10c5b3bb92d46ba347505a9041e676bb20ad220101326bffb0c93031ee" +checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" dependencies = [ "proc-macro2", "quote", @@ -1856,10 +1974,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "078e285eafdfb6c4b434e0d31e8cfcb5115b651496faca5749b88fafd4f23bfd" [[package]] -name = "keccak-hash" -version = "0.8.0" +name = "json5" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce2bd4c29270e724d3eaadf7bdc8700af4221fc0ed771b855eadcd1b98d52851" +checksum = "96b0db21af676c1ce64250b5f40f3ce2cf27e4e47cb91ed91eb6fe9350b430c1" +dependencies = [ + "pest", + "pest_derive", + "serde 1.0.136", +] + +[[package]] +name = "keccak-hash" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82bc5d5ca345b067619615f62ac6f93e7daa67eb82d080bc380ed480708ec9e3" dependencies = [ "primitive-types", "tiny-keccak", @@ -1884,8 +2013,8 @@ dependencies = [ "backtrace", "byteorder", "cfg-if 1.0.0", - "clap 3.0.13", - "core-foundation 0.9.2", + "clap 3.1.6", + "core-foundation 0.9.3", "core-foundation-sys 0.8.3", "directories", "fs4", @@ -1901,7 +2030,7 @@ dependencies = [ "security-framework-sys", "serde 1.0.136", "serde_cbor", - "serial_test 0.5.1", + "serial_test 0.6.0", "simplelog", "snailquote", "tempfile", @@ -1946,7 +2075,7 @@ dependencies = [ "keyvaluedb-shared-tests", "log", "parking_lot 0.12.0", - "rand 0.8.4", + "rand 0.8.5", "rusqlite", "sysinfo", "tempfile", @@ -2001,15 +2130,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.116" +version = "0.2.119" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "565dbd88872dbe4cc8a46e527f26483c1d1f7afa6b884a3bd6cd893d4f98da74" +checksum = "1bf2e165bb3457c8e098ea76f3e3bc9db55f87aa90d52d0e6be741470916aaa4" [[package]] name = "libsqlite3-sys" -version = "0.23.2" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2cafc7c74096c336d9d27145f7ebd4f4b6f95ba16aa5a282387267e6925cb58" +checksum = "cb644c388dfaefa18035c12614156d285364769e818893da0dda9030c80ad2ba" dependencies = [ "cc", "pkg-config", @@ -2023,7 +2152,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d262045c5b87c0861b3f004610afd0e2c851e2908d08b6c870cbb9d5f494ecd" dependencies = [ "serde 0.8.23", - "serde_test", + "serde_test 0.8.23", ] [[package]] @@ -2062,9 +2191,9 @@ dependencies = [ [[package]] name = "lru" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "274353858935c992b13c0ca408752e2121da852d07dec7ce5f108c77dfa14d1f" +checksum = "fcb87f3080f6d1d69e8c564c0fcfde1d7aa8cc451ce40cae89479111f03bc0eb" dependencies = [ "hashbrown 0.11.2", ] @@ -2102,6 +2231,12 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.4.4" @@ -2158,16 +2293,23 @@ dependencies = [ ] [[package]] -name = "ndk-glue" -version = "0.6.0" +name = "ndk-context" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04c0d14b0858eb9962a5dac30b809b19f19da7e4547d64af2b0bb051d2e55d79" +checksum = "4e3c5cc68637e21fe8f077f6a1c9e0b9ca495bb74895226b476310f613325884" + +[[package]] +name = "ndk-glue" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9ffb7443daba48349d545028777ca98853b018b4c16624aa01223bc29e078da" dependencies = [ "android_logger", "lazy_static", "libc", "log", "ndk", + "ndk-context", "ndk-macro", "ndk-sys", ] @@ -2179,7 +2321,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0df7ac00c4672f9d5aece54ee3347520b7e20f158656c7db2e6de01902eb7a6c" dependencies = [ "darling", - "proc-macro-crate 1.1.0", + "proc-macro-crate 1.1.3", "proc-macro2", "quote", "syn", @@ -2291,8 +2433,10 @@ dependencies = [ [[package]] name = "no-std-net" version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43794a0ace135be66a25d3ae77d41b91615fb68ae937f904090203e81f755b65" +dependencies = [ + "serde 1.0.136", + "serde_test 1.0.136", +] [[package]] name = "nom" @@ -2306,10 +2450,21 @@ dependencies = [ ] [[package]] -name = "ntapi" -version = "0.3.6" +name = "nom" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" +checksum = "1b1d11e1ef389c76fe5b81bcaf2ea32cf88b62bc494e19f493d0b30e7a930109" +dependencies = [ + "memchr", + "minimal-lexical", + "version_check", +] + +[[package]] +name = "ntapi" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" dependencies = [ "winapi", ] @@ -2444,20 +2599,20 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "720d3ea1055e4e4574c0c0b0f8c3fd4f24c4cdaf465948206dea090b57b526ad" +checksum = "cf5395665662ef45796a4ff5486c5d41d29e0c09640af4c5f17fd94ee2c119c9" dependencies = [ "num_enum_derive", ] [[package]] name = "num_enum_derive" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d992b768490d7fe0d8586d9b5745f6c49f557da6d81dc982b1d167ad4edbb21" +checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce" dependencies = [ - "proc-macro-crate 1.1.0", + "proc-macro-crate 1.1.3", "proc-macro2", "quote", "syn", @@ -2474,9 +2629,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" +checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" [[package]] name = "oorandom" @@ -2484,12 +2639,28 @@ version = "11.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" +[[package]] +name = "opaque-debug" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" + [[package]] name = "opaque-debug" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +[[package]] +name = "ordered-multimap" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c672c7ad9ec066e428c00eb917124a06f08db19e2584de982cc34b1f4c12485" +dependencies = [ + "dlv-list", + "hashbrown 0.9.1", +] + [[package]] name = "os_str_bytes" version = "6.0.0" @@ -2510,9 +2681,9 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "2.3.1" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "373b1a4c1338d9cd3d1fa53b3a11bdab5ab6bd80a20f7f7becd76953ae2be909" +checksum = "2a7f3fcf5e45fc28b84dcdab6b983e77f197ec01f325a33f404ba6855afd1070" dependencies = [ "arrayvec 0.7.2", "bitvec", @@ -2524,11 +2695,11 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "2.3.1" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1557010476e0595c9b568d16dcfb81b93cdeb157612726f5170d31aa707bed27" +checksum = "2c6e626dc84025ff56bf1476ed0e30d10c84d7f89a475ef46ebabee1095a8fba" dependencies = [ - "proc-macro-crate 1.1.0", + "proc-macro-crate 1.1.3", "proc-macro2", "quote", "syn", @@ -2568,7 +2739,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87f5ec2493a61ac0506c0f4199f99070cbe83857b0337006a30f3e6719b8ef58" dependencies = [ "lock_api 0.4.6", - "parking_lot_core 0.9.0", + "parking_lot_core 0.9.1", ] [[package]] @@ -2594,20 +2765,20 @@ dependencies = [ "cfg-if 1.0.0", "instant", "libc", - "redox_syscall 0.2.10", + "redox_syscall 0.2.11", "smallvec", "winapi", ] [[package]] name = "parking_lot_core" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2f4f894f3865f6c0e02810fc597300f34dc2510f66400da262d8ae10e75767d" +checksum = "28141e0cc4143da2443301914478dc976a61ffdb3f043058310c70df2fed8954" dependencies = [ "cfg-if 1.0.0", "libc", - "redox_syscall 0.2.10", + "redox_syscall 0.2.11", "smallvec", "windows-sys", ] @@ -2618,12 +2789,61 @@ version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0744126afe1a6dd7f394cb50a716dbe086cb06e255e53d8d0185d82828358fb5" +[[package]] +name = "pathdiff" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" + [[package]] name = "percent-encoding" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +[[package]] +name = "pest" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53" +dependencies = [ + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "833d1ae558dc601e9a60366421196a8d94bc0ac980476d0b67e1d0988d72b2d0" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99b8db626e31e5b81787b9783425769681b347011cc59471e33ea46d2ea0cf55" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pest_meta" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54be6e404f5317079812fc8f9f5279de376d8856929e21c184ecf6bbd692a11d" +dependencies = [ + "maplit", + "pest", + "sha-1 0.8.2", +] + [[package]] name = "pharos" version = "0.5.3" @@ -2740,7 +2960,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "048aeb476be11a4b6ca432ca569e375810de9294ae78f4774e78ea98a9246ede" dependencies = [ "cpufeatures 0.2.1", - "opaque-debug", + "opaque-debug 0.3.0", "universal-hash", ] @@ -2752,9 +2972,9 @@ checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" [[package]] name = "primitive-types" -version = "0.10.1" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05e4722c697a58a99d5d06a08c30821d7c082a4632198de1eaa5a6c22ef42373" +checksum = "e28720988bff275df1f51b171e1b2a18c30d194c4d2b61defdacecd625a5d94a" dependencies = [ "fixed-hash", "impl-codec", @@ -2774,9 +2994,9 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "1.1.0" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ebace6889caf889b4d3f76becee12e90353f2b8c7d875534a71e5742f8f6f83" +checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" dependencies = [ "thiserror", "toml", @@ -2826,9 +3046,9 @@ dependencies = [ [[package]] name = "radium" -version = "0.6.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643f8f41a8ebc4c5dc4515c82bb8abd397b527fc20fd681b7c011c2aee5d44fb" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" [[package]] name = "rand" @@ -2840,19 +3060,18 @@ dependencies = [ "libc", "rand_chacha 0.2.2", "rand_core 0.5.1", - "rand_hc 0.2.0", + "rand_hc", ] [[package]] name = "rand" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha 0.3.1", "rand_core 0.6.3", - "rand_hc 0.3.1", ] [[package]] @@ -2890,7 +3109,7 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" dependencies = [ - "getrandom 0.2.4", + "getrandom 0.2.5", ] [[package]] @@ -2902,15 +3121,6 @@ dependencies = [ "rand_core 0.5.1", ] -[[package]] -name = "rand_hc" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" -dependencies = [ - "rand_core 0.6.3", -] - [[package]] name = "rayon" version = "1.5.1" @@ -2944,9 +3154,9 @@ checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" [[package]] name = "redox_syscall" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" +checksum = "8380fe0152551244f0747b1bf41737e0f8a74f97a14ccefd1148187271634f3c" dependencies = [ "bitflags", ] @@ -2957,15 +3167,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" dependencies = [ - "getrandom 0.2.4", - "redox_syscall 0.2.10", + "getrandom 0.2.5", + "redox_syscall 0.2.11", ] [[package]] name = "regex" -version = "1.5.4" +version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" +checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" dependencies = [ "aho-corasick", "memchr", @@ -3018,6 +3228,17 @@ dependencies = [ "rustc-hex", ] +[[package]] +name = "ron" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b861ecaade43ac97886a512b360d01d66be9f41f3c61088b42cedf92e03d678" +dependencies = [ + "base64 0.13.0", + "bitflags", + "serde 1.0.136", +] + [[package]] name = "rpassword" version = "5.0.1" @@ -3043,9 +3264,9 @@ dependencies = [ [[package]] name = "rusqlite" -version = "0.26.3" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ba4d3462c8b2e4d7f4fcfcf2b296dc6b65404fbbc7b63daa37fd485c149daf7" +checksum = "85127183a999f7db96d1a976a309eebbfb6ea3b0b400ddd8340190129de6eb7a" dependencies = [ "bitflags", "fallible-iterator", @@ -3081,6 +3302,16 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e52c148ef37f8c375d49d5a73aa70713125b7f19095948a923f80afdeb22ec2" +[[package]] +name = "rust-ini" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63471c4aa97a1cf8332a5f97709a79a4234698de6a1f5087faf66f2dae810e22" +dependencies = [ + "cfg-if 1.0.0", + "ordered-multimap", +] + [[package]] name = "rustc-demangle" version = "0.1.21" @@ -3187,7 +3418,7 @@ dependencies = [ "hkdf", "lazy_static", "num 0.3.1", - "rand 0.8.4", + "rand 0.8.5", "serde 1.0.136", "sha2", "zbus", @@ -3198,12 +3429,12 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.6.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fed7948b6c68acbb6e20c334f55ad635dc0f75506963de4464289fbd3b051ac" +checksum = "2dc14f172faf8a0194a3aded622712b0de276821addc574fa54fc0a1167e10dc" dependencies = [ "bitflags", - "core-foundation 0.9.2", + "core-foundation 0.9.3", "core-foundation-sys 0.8.3", "libc", "security-framework-sys", @@ -3211,9 +3442,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.6.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a57321bf8bc2362081b2599912d2961fe899c0efadf1b4b2f8d48b3e253bb96c" +checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" dependencies = [ "core-foundation-sys 0.8.3", "libc", @@ -3221,9 +3452,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.4" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012" +checksum = "a4a3381e03edd24287172047536f20cabde766e2cd3e65e6b00fb3af51c4f38d" [[package]] name = "send_wrapper" @@ -3292,9 +3523,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.78" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d23c1ba4cf0efd44be32017709280b32d1cea5c3f1275c3b6d9e8bc54f758085" +checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95" dependencies = [ "itoa 1.0.1", "ryu", @@ -3321,6 +3552,15 @@ dependencies = [ "serde 0.8.23", ] +[[package]] +name = "serde_test" +version = "1.0.136" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21675ba6f9d97711cc00eee79d8dd7d0a31e571c350fb4d8a7c78f70c0e7b0e9" +dependencies = [ + "serde 1.0.136", +] + [[package]] name = "serde_yaml" version = "0.8.23" @@ -3346,13 +3586,13 @@ dependencies = [ [[package]] name = "serial_test" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0bccbcf40c8938196944a3da0e133e031a33f4d6b72db3bda3cc556e361905d" +checksum = "e5bcc41d18f7a1d50525d080fd3e953be87c4f9f1a974f3c21798ca00d54ec15" dependencies = [ "lazy_static", "parking_lot 0.11.2", - "serial_test_derive 0.5.1", + "serial_test_derive 0.6.0", ] [[package]] @@ -3368,26 +3608,51 @@ dependencies = [ [[package]] name = "serial_test_derive" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2acd6defeddb41eb60bb468f8825d0cfd0c2a76bc03bfd235b6a1dc4f6a1ad5" +checksum = "2881bccd7d60fb32dfa3d7b3136385312f8ad75e2674aab2852867a09790cae8" dependencies = [ + "proc-macro-error", "proc-macro2", "quote", + "rustversion", "syn", ] +[[package]] +name = "sha-1" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" +dependencies = [ + "block-buffer 0.7.3", + "digest 0.8.1", + "fake-simd", + "opaque-debug 0.2.3", +] + [[package]] name = "sha-1" version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" dependencies = [ - "block-buffer", + "block-buffer 0.9.0", "cfg-if 1.0.0", "cpufeatures 0.2.1", - "digest", - "opaque-debug", + "digest 0.9.0", + "opaque-debug 0.3.0", +] + +[[package]] +name = "sha-1" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures 0.2.1", + "digest 0.10.3", ] [[package]] @@ -3396,11 +3661,11 @@ version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ - "block-buffer", + "block-buffer 0.9.0", "cfg-if 1.0.0", "cpufeatures 0.2.1", - "digest", - "opaque-debug", + "digest 0.9.0", + "opaque-debug 0.3.0", ] [[package]] @@ -3543,9 +3808,9 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.23.0" +version = "0.23.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e757000a4bed2b1be9be65a3f418b9696adf30bb419214c73997422de73a591" +checksum = "07fa4c84a5305909b0eedfcc8d1f2fafdbede645bb700a45ecaafe681a0ac5d6" dependencies = [ "cfg-if 1.0.0", "core-foundation-sys 0.8.3", @@ -3571,16 +3836,16 @@ dependencies = [ "cfg-if 1.0.0", "fastrand", "libc", - "redox_syscall 0.2.10", + "redox_syscall 0.2.11", "remove_dir_all", "winapi", ] [[package]] name = "termcolor" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" dependencies = [ "winapi-util", ] @@ -3596,9 +3861,9 @@ dependencies = [ [[package]] name = "textwrap" -version = "0.14.2" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0066c8d12af8b5acd21e00547c3797fde4e8677254a7ee429176ccebbe93dd80" +checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" [[package]] name = "thiserror" @@ -3666,9 +3931,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.16.1" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c27a64b625de6d309e8c57716ba93021dccf1b3b5c97edd6d3dd2d2135afc0a" +checksum = "2af73ac49756f3f7c01172e34a23e5d0216f6c32333757c2c61feb2bbff5a5ee" dependencies = [ "bytes 1.1.0", "memchr", @@ -3698,16 +3963,16 @@ dependencies = [ "input_buffer", "log", "rand 0.7.3", - "sha-1", + "sha-1 0.9.8", "url", "utf-8", ] [[package]] name = "tungstenite" -version = "0.16.0" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ad3713a14ae247f22a728a0456a545df14acf3867f905adff84be99e23b3ad1" +checksum = "d96a2dea40e7570482f28eb57afbe42d97551905da6a9400acc5c328d24004f5" dependencies = [ "base64 0.13.0", "byteorder", @@ -3715,8 +3980,8 @@ dependencies = [ "http", "httparse", "log", - "rand 0.8.4", - "sha-1", + "rand 0.8.5", + "sha-1 0.10.0", "thiserror", "url", "utf-8", @@ -3729,10 +3994,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" [[package]] -name = "uint" -version = "0.9.2" +name = "ucd-trie" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1b413ebfe8c2c74a69ff124699dd156a7fa41cb1d09ba6df94aa2f2b0a4a3a" +checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" + +[[package]] +name = "uint" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f03af7ccf01dd611cc450a0d10dbc9b745770d096473e2faf0ca6e2d66d1e0" dependencies = [ "byteorder", "crunchy", @@ -3766,9 +4037,9 @@ dependencies = [ [[package]] name = "unicode-segmentation" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" +checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" [[package]] name = "unicode-width" @@ -3794,7 +4065,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" dependencies = [ - "generic-array", + "generic-array 0.14.5", "subtle", ] @@ -3850,7 +4121,7 @@ dependencies = [ "capnp-rpc", "capnpc", "cfg-if 1.0.0", - "clap 3.0.13", + "clap 3.1.6", "config 0.10.1", "crossbeam-channel", "cursive", @@ -3878,7 +4149,7 @@ dependencies = [ "async-lock", "async-std", "async-tls", - "async-tungstenite 0.16.1", + "async-tungstenite 0.17.1", "async_executors", "backtrace", "blake3", @@ -3888,16 +4159,16 @@ dependencies = [ "cfg-if 1.0.0", "chacha20poly1305", "chrono", - "config 0.11.0", + "config 0.12.0", "console_error_panic_hook", "curve25519-dalek-ng", "data-encoding", - "digest", + "digest 0.9.0", "directories", "ed25519-dalek", "futures-util", - "generic-array", - "getrandom 0.2.4", + "generic-array 0.14.5", + "getrandom 0.2.5", "hashbrown 0.12.0", "hex", "ifstructs", @@ -3930,7 +4201,7 @@ dependencies = [ "serde-big-array", "serde_cbor", "serde_json", - "serial_test 0.5.1", + "serial_test 0.6.0", "simplelog", "socket2", "static_assertions", @@ -3981,14 +4252,14 @@ name = "veilid-server" version = "0.1.0" dependencies = [ "async-std", - "async-tungstenite 0.16.1", + "async-tungstenite 0.17.1", "bugsalot", "capnp", "capnp-rpc", "capnpc", "cfg-if 1.0.0", - "clap 3.0.13", - "config 0.11.0", + "clap 3.1.6", + "config 0.12.0", "ctrlc", "daemonize", "directories", @@ -4000,7 +4271,7 @@ dependencies = [ "serde 1.0.136", "serde_derive", "serde_yaml", - "serial_test 0.5.1", + "serial_test 0.6.0", "simplelog", "url", "veilid-core", @@ -4285,9 +4556,9 @@ dependencies = [ [[package]] name = "windows-sys" -version = "0.29.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceb069ac8b2117d36924190469735767f0990833935ab430155e71a44bafe148" +checksum = "3df6e476185f92a12c072be4a189a0210dcdcf512a1891d6dff9edb874deadc6" dependencies = [ "windows_aarch64_msvc", "windows_i686_gnu", @@ -4298,33 +4569,33 @@ dependencies = [ [[package]] name = "windows_aarch64_msvc" -version = "0.29.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d027175d00b01e0cbeb97d6ab6ebe03b12330a35786cbaca5252b1c4bf5d9b" +checksum = "d8e92753b1c443191654ec532f14c199742964a061be25d77d7a96f09db20bf5" [[package]] name = "windows_i686_gnu" -version = "0.29.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8793f59f7b8e8b01eda1a652b2697d87b93097198ae85f823b969ca5b89bba58" +checksum = "6a711c68811799e017b6038e0922cb27a5e2f43a2ddb609fe0b6f3eeda9de615" [[package]] name = "windows_i686_msvc" -version = "0.29.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8602f6c418b67024be2996c512f5f995de3ba417f4c75af68401ab8756796ae4" +checksum = "146c11bb1a02615db74680b32a68e2d61f553cc24c4eb5b4ca10311740e44172" [[package]] name = "windows_x86_64_gnu" -version = "0.29.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3d615f419543e0bd7d2b3323af0d86ff19cbc4f816e6453f36a2c2ce889c354" +checksum = "c912b12f7454c6620635bbff3450962753834be2a594819bd5e945af18ec64bc" [[package]] name = "windows_x86_64_msvc" -version = "0.29.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d95421d9ed3672c280884da53201a5c46b7b2765ca6faf34b0d71cf34a3561" +checksum = "504a2476202769977a040c6364301a3f65d0cc9e3fb08600b2bda150a0488316" [[package]] name = "ws_stream_wasm" @@ -4346,9 +4617,12 @@ dependencies = [ [[package]] name = "wyz" -version = "0.2.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" +checksum = "30b31594f29d27036c383b53b59ed3476874d518f0efb151b27a4c275141390e" +dependencies = [ + "tap", +] [[package]] name = "x25519-dalek-ng" @@ -4357,7 +4631,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf7074de8999662970c3c4c8f7f30925028dd8f4ca31ad4c055efa9cdf2ec326" dependencies = [ "curve25519-dalek-ng", - "rand 0.8.4", + "rand 0.8.5", "rand_core 0.6.3", "zeroize", ] @@ -4420,18 +4694,18 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.5.1" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4062c749be08d90be727e9c5895371c3a0e49b90ba2b9592dc7afda95cc2b719" +checksum = "50344758e2f40e3a1fcfc8f6f91aa57b5f8ebd8d27919fe6451f15aaaf9ee608" dependencies = [ "zeroize_derive", ] [[package]] name = "zeroize_derive" -version = "1.3.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81e8f13fef10b63c06356d65d416b070798ddabcadc10d3ece0c5be9b3c7eddb" +checksum = "3f8f187641dad4f680d25c4bfc4225b418165984179f26ca76ec4fb6441d3a17" dependencies = [ "proc-macro2", "quote", @@ -4459,7 +4733,7 @@ version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4ca5e22593eb4212382d60d26350065bf2a02c34b85bc850474a74b589a3de9" dependencies = [ - "proc-macro-crate 1.1.0", + "proc-macro-crate 1.1.3", "proc-macro2", "quote", "syn", diff --git a/external/no-std-net b/external/no-std-net new file mode 160000 index 00000000..c57e56ff --- /dev/null +++ b/external/no-std-net @@ -0,0 +1 @@ +Subproject commit c57e56ff4ee4653bf17f8bd35dc2fd0f56dc74e7 diff --git a/veilid-core/Cargo.toml b/veilid-core/Cargo.toml index fbd5b38a..9c6eeca8 100644 --- a/veilid-core/Cargo.toml +++ b/veilid-core/Cargo.toml @@ -80,7 +80,7 @@ wasm-bindgen-futures = "^0" wasm-logger = "^0" hashbrown = "^0" lru = {version = "^0", features = ["hashbrown"] } -no-std-net = "^0" +no-std-net = { path = "../external/no-std-net", features = ["serde"] } keyvaluedb-web = { path = "../external/keyvaluedb/keyvaluedb-web" } data-encoding = { version = "^2", default_features = false, features = ["alloc"] } serde = { version = "^1", default-features = false, features = ["derive", "alloc"] } diff --git a/veilid-core/src/connection_manager.rs b/veilid-core/src/connection_manager.rs index c139ce8c..d7d5e751 100644 --- a/veilid-core/src/connection_manager.rs +++ b/veilid-core/src/connection_manager.rs @@ -68,6 +68,7 @@ impl ConnectionManager { } pub async fn startup(&self) { + trace!("startup connection manager"); let mut inner = self.arc.inner.lock().await; let cac = async_channel::bounded(CONNECTION_PROCESSOR_CHANNEL_SIZE); // xxx move to config inner.connection_add_channel_tx = Some(cac.0); diff --git a/veilid-core/src/intf/native/network/mod.rs b/veilid-core/src/intf/native/network/mod.rs index 97c3aa5b..883910ee 100644 --- a/veilid-core/src/intf/native/network/mod.rs +++ b/veilid-core/src/intf/native/network/mod.rs @@ -389,7 +389,7 @@ impl Network { } pub async fn startup(&self) -> Result<(), String> { - info!("starting network"); + trace!("startup network"); // initialize interfaces let mut interfaces = NetworkInterfaces::new(); @@ -424,6 +424,7 @@ impl Network { if protocol_config.tcp_listen { self.start_tcp_listeners().await?; } + // release caches of available listener ports // this releases the 'first bound' ports we use to guarantee // that we have ports available to us diff --git a/veilid-core/src/intf/native/network/start_protocols.rs b/veilid-core/src/intf/native/network/start_protocols.rs index 545845fa..e0ae60b8 100644 --- a/veilid-core/src/intf/native/network/start_protocols.rs +++ b/veilid-core/src/intf/native/network/start_protocols.rs @@ -111,22 +111,17 @@ impl Network { ]; Ok((port, ip_addrs)) } else { + // If no address is specified, but the port is, use ipv4 and ipv6 unspecified // If the address is specified, only use the specified port and fail otherwise - let sockaddrs: Vec = listen_address - .to_socket_addrs() - .await - .map_err(|e| format!("Unable to resolve address: {}\n{}", listen_address, e))? - .collect(); - + let sockaddrs = listen_address_to_socket_addrs(&listen_address)?; if sockaddrs.is_empty() { - Err(format!("No valid listen address: {}", listen_address)) + return Err(format!("No valid listen address: {}", listen_address)); + } + let port = sockaddrs[0].port(); + if self.bind_first_udp_port(port) { + Ok((port, sockaddrs.iter().map(|s| s.ip()).collect())) } else { - let port = sockaddrs[0].port(); - if self.bind_first_udp_port(port) { - Ok((port, sockaddrs.iter().map(|s| s.ip()).collect())) - } else { - Err("Could not find free udp port to listen on".to_owned()) - } + Err("Could not find free udp port to listen on".to_owned()) } } } @@ -144,22 +139,17 @@ impl Network { ]; Ok((port, ip_addrs)) } else { + // If no address is specified, but the port is, use ipv4 and ipv6 unspecified // If the address is specified, only use the specified port and fail otherwise - let sockaddrs: Vec = listen_address - .to_socket_addrs() - .await - .map_err(|e| format!("Unable to resolve address: {}\n{}", listen_address, e))? - .collect(); - + let sockaddrs = listen_address_to_socket_addrs(&listen_address)?; if sockaddrs.is_empty() { - Err(format!("No valid listen address: {}", listen_address)) + return Err(format!("No valid listen address: {}", listen_address)); + } + let port = sockaddrs[0].port(); + if self.bind_first_tcp_port(port) { + Ok((port, sockaddrs.iter().map(|s| s.ip()).collect())) } else { - let port = sockaddrs[0].port(); - if self.bind_first_tcp_port(port) { - Ok((port, sockaddrs.iter().map(|s| s.ip()).collect())) - } else { - Err("Could not find free tcp port to listen on".to_owned()) - } + Err("Could not find free tcp port to listen on".to_owned()) } } } @@ -167,6 +157,7 @@ impl Network { ///////////////////////////////////////////////////// pub(super) async fn start_udp_listeners(&self) -> Result<(), String> { + trace!("starting udp listeners"); let routing_table = self.routing_table(); let (listen_address, public_address) = { let c = self.config.get(); @@ -238,6 +229,7 @@ impl Network { } pub(super) async fn start_ws_listeners(&self) -> Result<(), String> { + trace!("starting ws listeners"); let routing_table = self.routing_table(); let (listen_address, url, path) = { let c = self.config.get(); @@ -332,6 +324,8 @@ impl Network { } pub(super) async fn start_wss_listeners(&self) -> Result<(), String> { + trace!("starting wss listeners"); + let routing_table = self.routing_table(); let (listen_address, url) = { let c = self.config.get(); @@ -403,6 +397,8 @@ impl Network { } pub(super) async fn start_tcp_listeners(&self) -> Result<(), String> { + trace!("starting tcp listeners"); + let routing_table = self.routing_table(); let (listen_address, public_address) = { let c = self.config.get(); diff --git a/veilid-core/src/intf/native/utils/network_interfaces/mod.rs b/veilid-core/src/intf/native/utils/network_interfaces/mod.rs index 7eba6a72..0bc3481d 100644 --- a/veilid-core/src/intf/native/utils/network_interfaces/mod.rs +++ b/veilid-core/src/intf/native/utils/network_interfaces/mod.rs @@ -329,13 +329,14 @@ impl NetworkInterfaces { // returns Ok(false) if refresh had no changes, Ok(true) if changes were present pub async fn refresh(&mut self) -> Result { self.valid = false; - + eprintln!("a"); let last_interfaces = core::mem::take(&mut self.interfaces); let mut platform_support = PlatformSupport::new().map_err(logthru_net!())?; platform_support .get_interfaces(&mut self.interfaces) .await?; + eprintln!("b"); self.valid = true; @@ -343,6 +344,8 @@ impl NetworkInterfaces { if changed { trace!("NetworkInterfaces refreshed: {:#?}?", self); } + eprintln!("c"); +xxx investigate why things get stuck here. threading and dart issue with logging ? Ok(changed) } pub fn len(&self) -> usize { diff --git a/veilid-core/src/lease_manager.rs b/veilid-core/src/lease_manager.rs index cb53b429..18688cfd 100644 --- a/veilid-core/src/lease_manager.rs +++ b/veilid-core/src/lease_manager.rs @@ -54,6 +54,7 @@ impl LeaseManager { self.inner.lock().network_manager.clone() } pub async fn startup(&self) -> Result<(), String> { + trace!("startup lease manager"); // Retrieve config { let mut inner = self.inner.lock(); diff --git a/veilid-core/src/receipt_manager.rs b/veilid-core/src/receipt_manager.rs index 39130e6f..f106decb 100644 --- a/veilid-core/src/receipt_manager.rs +++ b/veilid-core/src/receipt_manager.rs @@ -197,6 +197,7 @@ impl ReceiptManager { } pub async fn startup(&self) -> Result<(), String> { + trace!("startup receipt manager"); // Retrieve config /* { @@ -319,9 +320,7 @@ impl ReceiptManager { callback, ))); let mut inner = self.inner.lock(); - inner - .receipts_by_nonce - .insert(receipt.get_nonce(), record); + inner.receipts_by_nonce.insert(receipt.get_nonce(), record); } pub fn record_single_shot_receipt( @@ -334,9 +333,7 @@ impl ReceiptManager { &receipt, expiration, eventual, ))); let mut inner = self.inner.lock(); - inner - .receipts_by_nonce - .insert(receipt.get_nonce(), record); + inner.receipts_by_nonce.insert(receipt.get_nonce(), record); } fn update_next_oldest_timestamp(inner: &mut ReceiptManagerInner) { diff --git a/veilid-core/src/rpc_processor/mod.rs b/veilid-core/src/rpc_processor/mod.rs index 22a03ce7..ac326083 100644 --- a/veilid-core/src/rpc_processor/mod.rs +++ b/veilid-core/src/rpc_processor/mod.rs @@ -1256,7 +1256,7 @@ impl RPCProcessor { } pub async fn startup(&self) -> Result<(), String> { - trace!("VeilidCore::startup init RPC processor"); + trace!("startup rpc processor"); let mut inner = self.inner.lock(); // make local copy of node id for easy access let c = self.config.get(); diff --git a/veilid-core/src/veilid_api/debug.rs b/veilid-core/src/veilid_api/debug.rs index 13448c8a..e136bc07 100644 --- a/veilid-core/src/veilid_api/debug.rs +++ b/veilid-core/src/veilid_api/debug.rs @@ -75,15 +75,13 @@ impl VeilidAPI { )?; } // Dump routing table bucket info - let rpc = self.rpc_processor()?; - let routing_table = rpc.routing_table(); + let routing_table = self.network_manager()?.routing_table(); Ok(routing_table.debug_info_buckets(min_state)) } async fn debug_dialinfo(&self, _args: String) -> Result { // Dump routing table dialinfo - let rpc = self.rpc_processor()?; - let routing_table = rpc.routing_table(); + let routing_table = self.network_manager()?.routing_table(); Ok(routing_table.debug_info_dialinfo()) } @@ -107,8 +105,7 @@ impl VeilidAPI { } // Dump routing table entries - let rpc = self.rpc_processor()?; - let routing_table = rpc.routing_table(); + let routing_table = self.network_manager()?.routing_table(); Ok(routing_table.debug_info_entries(limit, min_state)) } @@ -118,15 +115,13 @@ impl VeilidAPI { let node_id = get_debug_argument_at(&args, 0, "debug_entry", "node_id", get_dht_key)?; // Dump routing table entry - let rpc = self.rpc_processor()?; - let routing_table = rpc.routing_table(); + let routing_table = self.network_manager()?.routing_table(); Ok(routing_table.debug_info_entry(node_id)) } async fn debug_nodeinfo(&self, _args: String) -> Result { // Dump routing table entry - let rpc = self.rpc_processor()?; - let routing_table = rpc.routing_table(); + let routing_table = self.network_manager()?.routing_table(); Ok(routing_table.debug_info_nodeinfo()) } @@ -141,22 +136,26 @@ impl VeilidAPI { let (arg, rest) = args.split_once(' ').unwrap_or((args, "")); let rest = rest.trim_start().to_owned(); - // Must be detached - if matches!( - self.get_state().await?.attachment, - AttachmentState::Detached | AttachmentState::Detaching - ) { - return Err(VeilidAPIError::Internal { - message: "Must be detached to change config".to_owned(), - }); - } - // One argument is 'config get' if rest.is_empty() { return config .get_key_json(arg) .map_err(|e| VeilidAPIError::Internal { message: e }); } + + // More than one argument is 'config set' + + // Must be detached + if !matches!( + self.get_state().await?.attachment, + AttachmentState::Detached + ) { + return Err(VeilidAPIError::Internal { + message: "Must be detached to change config".to_owned(), + }); + } + + // Change the config key config .set_key_json(arg, &rest) .map_err(|e| VeilidAPIError::Internal { message: e })?; @@ -225,6 +224,7 @@ impl VeilidAPI { pub async fn debug_help(&self, _args: String) -> Result { Ok(r#">>> Debug commands: + help buckets [dead|reliable] dialinfo entries [dead|reliable] [limit] @@ -247,28 +247,28 @@ impl VeilidAPI { let (arg, rest) = args.split_once(' ').unwrap_or((args, "")); let rest = rest.trim_start().to_owned(); - let mut out = String::new(); - if arg == "buckets" { - out += self.debug_buckets(rest).await?.as_str(); + if arg == "help" { + self.debug_help(rest).await + } else if arg == "buckets" { + self.debug_buckets(rest).await } else if arg == "dialinfo" { - out += self.debug_dialinfo(rest).await?.as_str(); + self.debug_dialinfo(rest).await } else if arg == "entries" { - out += self.debug_entries(rest).await?.as_str(); + self.debug_entries(rest).await } else if arg == "entry" { - out += self.debug_entry(rest).await?.as_str(); + self.debug_entry(rest).await } else if arg == "nodeinfo" { - out += self.debug_nodeinfo(rest).await?.as_str(); + self.debug_nodeinfo(rest).await } else if arg == "purge" { - out += self.debug_purge(rest).await?.as_str(); + self.debug_purge(rest).await } else if arg == "attach" { - out += self.debug_attach(rest).await?.as_str(); + self.debug_attach(rest).await } else if arg == "detach" { - out += self.debug_detach(rest).await?.as_str(); + self.debug_detach(rest).await } else if arg == "config" { - out += self.debug_config(rest).await?.as_str(); + self.debug_config(rest).await } else { - out += ">>> Unknown command\n"; + Ok(">>> Unknown command\n".to_owned()) } - Ok(out) } } diff --git a/veilid-core/src/veilid_config.rs b/veilid-core/src/veilid_config.rs index e50a3dc0..5aced93d 100644 --- a/veilid-core/src/veilid_config.rs +++ b/veilid-core/src/veilid_config.rs @@ -359,22 +359,26 @@ impl VeilidConfig { pub fn get_key_json(&self, key: &str) -> Result { let c = self.get(); - // Split key into path parts - let keypath: Vec<&str> = key.split('.').collect(); // Generate json from whole config let jc = serde_json::to_string(&*c).map_err(map_to_string)?; let jvc = json::parse(&jc).map_err(map_to_string)?; // Find requested subkey - let mut out = &jvc; - for k in keypath { - if !jvc.has_key(k) { - return Err(format!("invalid subkey '{}' in key '{}'", k, key)); + if key.is_empty() { + Ok(jvc.to_string()) + } else { + // Split key into path parts + let keypath: Vec<&str> = key.split('.').collect(); + let mut out = &jvc; + for k in keypath { + if !out.has_key(k) { + return Err(format!("invalid subkey '{}' in key '{}'", k, key)); + } + out = &out[k]; } - out = &jvc[k]; + Ok(out.to_string()) } - Ok(out.to_string()) } pub fn set_key_json(&self, key: &str, value: &str) -> Result<(), String> { let mut c = self.get_mut(); @@ -394,10 +398,10 @@ impl VeilidConfig { // Replace subkey let mut out = &mut jvc; for k in objkeypath { - if !jvc.has_key(*k) { + if !out.has_key(*k) { return Err(format!("invalid subkey '{}' in key '{}'", *k, key)); } - out = &mut jvc[*k]; + out = &mut out[*k]; } if !out.has_key(objkeyname) { return Err(format!("invalid subkey '{}' in key '{}'", objkeyname, key)); diff --git a/veilid-core/src/xx/tools.rs b/veilid-core/src/xx/tools.rs index 96c4bcaf..14165531 100644 --- a/veilid-core/src/xx/tools.rs +++ b/veilid-core/src/xx/tools.rs @@ -135,3 +135,36 @@ where } } } + +pub fn listen_address_to_socket_addrs(listen_address: &str) -> Result, String> { + // If no address is specified, but the port is, use ipv4 and ipv6 unspecified + // If the address is specified, only use the specified port and fail otherwise + let ip_addrs = vec![ + IpAddr::V4(Ipv4Addr::UNSPECIFIED), + IpAddr::V6(Ipv6Addr::UNSPECIFIED), + ]; + + Ok(if let Some(portstr) = listen_address.strip_prefix(':') { + let port = portstr.parse::().map_err(|_| { + format!( + "Invalid port format in udp listen address: {}", + listen_address + ) + })?; + ip_addrs.iter().map(|a| SocketAddr::new(*a, port)).collect() + } else if let Ok(port) = listen_address.parse::() { + ip_addrs.iter().map(|a| SocketAddr::new(*a, port)).collect() + } else { + cfg_if! { + if #[cfg(target_arch = "wasm32")] { + use core::str::FromStr; + vec![SocketAddr::from_str(listen_address).map_err(|_| format!("Unable to parse address: {}", listen_address))?] + } else { + listen_address + .to_socket_addrs() + .map_err(|_| format!("Unable to resolve address: {}", listen_address))? + .collect() + } + } + }) +} diff --git a/veilid-flutter/example/lib/main.dart b/veilid-flutter/example/lib/main.dart index f8e7bd89..205e5b38 100644 --- a/veilid-flutter/example/lib/main.dart +++ b/veilid-flutter/example/lib/main.dart @@ -12,6 +12,18 @@ import 'config.dart'; // Loggy tools const LogLevel traceLevel = LogLevel('trace', 1); +class ConsolePrinter extends LoggyPrinter { + ConsolePrinter(this.childPrinter) : super(); + + final LoggyPrinter childPrinter; + + @override + void onLog(LogRecord record) { + debugPrint(record.toString()); + childPrinter.onLog(record); + } +} + extension TraceLoggy on Loggy { void trace(dynamic message, [Object? error, StackTrace? stackTrace]) => log(traceLevel, message, error, stackTrace); @@ -25,13 +37,12 @@ LogOptions getLogOptions(LogLevel? level) { } void setRootLogLevel(LogLevel? level) { - print("setRootLogLevel: $level"); Loggy('').level = getLogOptions(level); } void initLoggy() { Loggy.initLoggy( - logPrinter: StreamPrinter( + logPrinter: ConsolePrinter( const PrettyDeveloperPrinter(), ), logOptions: getLogOptions(null), diff --git a/veilid-server/src/settings.rs b/veilid-server/src/settings.rs index 1295f1be..07a56160 100644 --- a/veilid-server/src/settings.rs +++ b/veilid-server/src/settings.rs @@ -6,11 +6,12 @@ use parking_lot::*; use serde_derive::*; use std::ffi::OsStr; -use std::net::{SocketAddr, ToSocketAddrs}; +use std::net::SocketAddr; use std::path::{Path, PathBuf}; use std::str::FromStr; use std::sync::Arc; use url::Url; +use veilid_core::xx::*; pub fn load_default_config(cfg: &mut config::Config) -> Result<(), config::ConfigError> { let default_config = String::from( @@ -84,38 +85,38 @@ core: application: https: enabled: false - listen_address: '[::]:5150' + listen_address: ':5150' path: 'app' # url: 'https://localhost:5150' http: enabled: false - listen_address: '[::]:5150' + listen_address: ':5150' path: 'app' # url: 'http://localhost:5150' protocol: udp: enabled: true socket_pool_size: 0 - listen_address: '[::]:5150' + listen_address: ':5150' # public_address: '' tcp: connect: true listen: true max_connections: 32 - listen_address: '[::]:5150' + listen_address: ':5150' #'public_address: '' ws: connect: true listen: true max_connections: 16 - listen_address: '[::]:5150' + listen_address: ':5150' path: 'ws' # url: 'ws://localhost:5150/ws' wss: connect: true listen: false max_connections: 16 - listen_address: '[::]:5150' + listen_address: ':5150' path: 'ws' # url: '' leases: @@ -323,10 +324,11 @@ pub struct NamedSocketAddrs { impl FromStr for NamedSocketAddrs { type Err = std::io::Error; fn from_str(s: &str) -> Result { - let addr_iter = s.to_socket_addrs()?; + let addr_iter = listen_address_to_socket_addrs(s) + .map_err(|e| std::io::Error::new(std::io::ErrorKind::InvalidInput, e))?; Ok(NamedSocketAddrs { name: s.to_owned(), - addrs: addr_iter.collect(), + addrs: addr_iter, }) } } @@ -1102,10 +1104,7 @@ mod tests { assert_eq!(s.client_api.listen_address.name, "localhost:5959"); assert_eq!( s.client_api.listen_address.addrs, - "localhost:5959" - .to_socket_addrs() - .unwrap() - .collect::>() + listen_address_to_socket_addrs("localhost:5959").unwrap() ); assert_eq!(s.auto_attach, true); assert_eq!(s.logging.terminal.enabled, true); @@ -1190,14 +1189,11 @@ mod tests { assert_eq!(s.core.network.application.https.enabled, false); assert_eq!( s.core.network.application.https.listen_address.name, - "[::]:5150" + ":5150" ); assert_eq!( s.core.network.application.https.listen_address.addrs, - "[::]:5150" - .to_socket_addrs() - .unwrap() - .collect::>() + listen_address_to_socket_addrs(":5150").unwrap() ); assert_eq!( s.core.network.application.https.path, @@ -1205,16 +1201,10 @@ mod tests { ); assert_eq!(s.core.network.application.https.url, None); assert_eq!(s.core.network.application.http.enabled, false); - assert_eq!( - s.core.network.application.http.listen_address.name, - "[::]:5150" - ); + assert_eq!(s.core.network.application.http.listen_address.name, ":5150"); assert_eq!( s.core.network.application.http.listen_address.addrs, - "[::]:5150" - .to_socket_addrs() - .unwrap() - .collect::>() + listen_address_to_socket_addrs(":5150").unwrap() ); assert_eq!( s.core.network.application.http.path, @@ -1227,10 +1217,7 @@ mod tests { assert_eq!(s.core.network.protocol.udp.listen_address.name, "[::]:5150"); assert_eq!( s.core.network.protocol.udp.listen_address.addrs, - "[::]:5150" - .to_socket_addrs() - .unwrap() - .collect::>() + listen_address_to_socket_addrs(":5150").unwrap() ); assert_eq!(s.core.network.protocol.udp.public_address, None); @@ -1241,10 +1228,7 @@ mod tests { assert_eq!(s.core.network.protocol.tcp.listen_address.name, "[::]:5150"); assert_eq!( s.core.network.protocol.tcp.listen_address.addrs, - "[::]:5150" - .to_socket_addrs() - .unwrap() - .collect::>() + listen_address_to_socket_addrs(":5150").unwrap() ); assert_eq!(s.core.network.protocol.tcp.public_address, None); @@ -1255,10 +1239,7 @@ mod tests { assert_eq!(s.core.network.protocol.ws.listen_address.name, "[::]:5150"); assert_eq!( s.core.network.protocol.ws.listen_address.addrs, - "[::]:5150" - .to_socket_addrs() - .unwrap() - .collect::>() + listen_address_to_socket_addrs(":5150").unwrap() ); assert_eq!( s.core.network.protocol.ws.path, @@ -1272,10 +1253,7 @@ mod tests { assert_eq!(s.core.network.protocol.wss.listen_address.name, "[::]:5150"); assert_eq!( s.core.network.protocol.wss.listen_address.addrs, - "[::]:5150" - .to_socket_addrs() - .unwrap() - .collect::>() + listen_address_to_socket_addrs(":5150").unwrap() ); assert_eq!( s.core.network.protocol.wss.path,