diff --git a/Cargo.lock b/Cargo.lock index 0c58714..d78b66a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -106,31 +106,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.98" +version = "1.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" - -[[package]] -name = "async-stream" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" -dependencies = [ - "async-stream-impl", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-stream-impl" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.102", -] +checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" [[package]] name = "async-trait" @@ -189,18 +167,16 @@ dependencies = [ [[package]] name = "axum" -version = "0.6.20" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" +checksum = "021e862c184ae977658b36c4500f7feac3221ca5da43e3f25bd04ab6c79a29b5" dependencies = [ - "async-trait", "axum-core", - "bitflags 1.3.2", "bytes", "futures-util", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.32", + "http 1.3.1", + "http-body", + "http-body-util", "itoa", "matchit", "memchr", @@ -209,25 +185,27 @@ dependencies = [ "pin-project-lite", "rustversion", "serde", - "sync_wrapper 0.1.2", - "tower 0.4.13", + "sync_wrapper", + "tower 0.5.2", "tower-layer", "tower-service", ] [[package]] name = "axum-core" -version = "0.3.4" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" +checksum = "68464cd0412f486726fb3373129ef5d2993f90c34bc2bc1c1e9943b2f4fc7ca6" dependencies = [ - "async-trait", "bytes", - "futures-util", - "http 0.2.12", - "http-body 0.4.6", + "futures-core", + "http 1.3.1", + "http-body", + "http-body-util", "mime", + "pin-project-lite", "rustversion", + "sync_wrapper", "tower-layer", "tower-service", ] @@ -287,7 +265,7 @@ version = "0.72.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895" dependencies = [ - "bitflags 2.9.1", + "bitflags", "cexpr", "clang-sys", "itertools", @@ -301,12 +279,6 @@ dependencies = [ "syn 2.0.102", ] -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - [[package]] name = "bitflags" version = "2.9.1" @@ -402,9 +374,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.47" +version = "4.5.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eac00902d9d136acd712710d71823fb8ac8004ca445a89e73a41d45aa712931" +checksum = "e2134bb3ea021b78629caa971416385309e0131b351b25e01dc16fb54e1b5fae" dependencies = [ "clap_builder", "clap_derive", @@ -412,9 +384,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.47" +version = "4.5.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ad9bbf750e73b5884fb8a211a9424a1906c1e156724260fdae972f31d70e1d6" +checksum = "c2ba64afa3c0a6df7fa517765e31314e983f51dda798ffba27b988194fb65dc9" dependencies = [ "anstream", "anstyle", @@ -450,7 +422,7 @@ dependencies = [ "futures", "http 0.2.12", "http-body-util", - "hyper 1.6.0", + "hyper", "hyper-util", "hyperlocal", "serde", @@ -482,6 +454,15 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +[[package]] +name = "convert_case" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb402b8d4c85569410425650ce3eddc7d698ed96d39a73f941b08fb63082f1e7" +dependencies = [ + "unicode-segmentation", +] + [[package]] name = "core-foundation" version = "0.9.4" @@ -555,15 +536,17 @@ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crossterm" -version = "0.27.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" +checksum = "d8b9f2e4c67f833b660cdb0a3523065869fb35570177239812ed4c905aeff87b" dependencies = [ - "bitflags 2.9.1", + "bitflags", "crossterm_winapi", - "libc", - "mio 0.8.11", + "derive_more", + "document-features", + "mio", "parking_lot", + "rustix", "signal-hook", "signal-hook-mio", "winapi", @@ -605,6 +588,27 @@ dependencies = [ "zeroize", ] +[[package]] +name = "derive_more" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "syn 2.0.102", +] + [[package]] name = "dhcproto" version = "0.13.0" @@ -649,6 +653,15 @@ dependencies = [ "syn 2.0.102", ] +[[package]] +name = "document-features" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95249b50c6c185bee49034bcb378a49dc2b5dff0be90ff6616d31d64febab05d" +dependencies = [ + "litrs", +] + [[package]] name = "dotenvy" version = "0.15.7" @@ -758,11 +771,12 @@ dependencies = [ "feos-utils", "futures", "host-service", + "hyper-util", "image-service", "libc", "log", "netlink-packet-route", - "nix 0.29.0", + "nix", "once_cell", "pnet", "prost", @@ -791,6 +805,7 @@ dependencies = [ "env_logger", "feos-proto", "hex", + "hyper-util", "log", "prost", "sha2", @@ -820,7 +835,7 @@ dependencies = [ "libc", "log", "netlink-packet-route", - "nix 0.29.0", + "nix", "pnet", "rtnetlink", "socket2 0.6.0", @@ -1026,25 +1041,6 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" -[[package]] -name = "h2" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http 0.2.12", - "indexmap 2.9.0", - "slab", - "tokio", - "tokio-util", - "tracing", -] - [[package]] name = "h2" version = "0.4.10" @@ -1185,11 +1181,11 @@ dependencies = [ "feos-utils", "hex", "http-body-util", - "hyper 1.6.0", + "hyper", "hyper-rustls", "hyper-util", "log", - "nix 0.29.0", + "nix", "prost", "prost-types", "rustls-pki-types", @@ -1231,17 +1227,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "http-body" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" -dependencies = [ - "bytes", - "http 0.2.12", - "pin-project-lite", -] - [[package]] name = "http-body" version = "1.0.1" @@ -1261,7 +1246,7 @@ dependencies = [ "bytes", "futures-core", "http 1.3.1", - "http-body 1.0.1", + "http-body", "pin-project-lite", ] @@ -1277,30 +1262,6 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" -[[package]] -name = "hyper" -version = "0.14.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2 0.3.26", - "http 0.2.12", - "http-body 0.4.6", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2 0.5.10", - "tokio", - "tower-service", - "tracing", - "want", -] - [[package]] name = "hyper" version = "1.6.0" @@ -1310,9 +1271,9 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.10", + "h2", "http 1.3.1", - "http-body 1.0.1", + "http-body", "httparse", "httpdate", "itoa", @@ -1329,7 +1290,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" dependencies = [ "http 1.3.1", - "hyper 1.6.0", + "hyper", "hyper-util", "log", "rustls 0.23.31", @@ -1342,14 +1303,15 @@ dependencies = [ [[package]] name = "hyper-timeout" -version = "0.4.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" +checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0" dependencies = [ - "hyper 0.14.32", + "hyper", + "hyper-util", "pin-project-lite", "tokio", - "tokio-io-timeout", + "tower-service", ] [[package]] @@ -1360,7 +1322,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", - "hyper 1.6.0", + "hyper", "hyper-util", "native-tls", "tokio", @@ -1380,8 +1342,8 @@ dependencies = [ "futures-core", "futures-util", "http 1.3.1", - "http-body 1.0.1", - "hyper 1.6.0", + "http-body", + "hyper", "ipnet", "libc", "percent-encoding", @@ -1400,7 +1362,7 @@ checksum = "986c5ce3b994526b3cd75578e62554abd09f0899d6206de48b3e96ab34ccc8c7" dependencies = [ "hex", "http-body-util", - "hyper 1.6.0", + "hyper", "hyper-util", "pin-project-lite", "tokio", @@ -1583,7 +1545,7 @@ version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "046fa2d4d00aea763528b4950358d0ead425372445dc8ff86312b3c69ff7727b" dependencies = [ - "bitflags 2.9.1", + "bitflags", "cfg-if", "libc", ] @@ -1747,6 +1709,12 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" +[[package]] +name = "litrs" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5e54036fe321fd421e10d732f155734c4e4afd610dd556d9a82833ab3ee0bed" + [[package]] name = "lock_api" version = "0.4.13" @@ -1765,9 +1733,9 @@ checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" [[package]] name = "matchit" -version = "0.7.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" +checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" [[package]] name = "md-5" @@ -1815,18 +1783,6 @@ dependencies = [ "adler2", ] -[[package]] -name = "mio" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" -dependencies = [ - "libc", - "log", - "wasi 0.11.1+wasi-snapshot-preview1", - "windows-sys 0.48.0", -] - [[package]] name = "mio" version = "1.0.4" @@ -1834,6 +1790,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" dependencies = [ "libc", + "log", "wasi 0.11.1+wasi-snapshot-preview1", "windows-sys 0.59.0", ] @@ -1863,46 +1820,30 @@ dependencies = [ [[package]] name = "netlink-packet-core" -version = "0.7.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72724faf704479d67b388da142b186f916188505e7e0b26719019c525882eda4" +checksum = "3463cbb78394cb0141e2c926b93fc2197e473394b761986eca3b9da2c63ae0f4" dependencies = [ - "anyhow", - "byteorder", - "netlink-packet-utils", + "paste", ] [[package]] name = "netlink-packet-route" -version = "0.19.0" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c171cd77b4ee8c7708da746ce392440cb7bcf618d122ec9ecc607b12938bf4" +checksum = "3ec2f5b6839be2a19d7fa5aab5bc444380f6311c2b693551cb80f45caaa7b5ef" dependencies = [ - "anyhow", - "byteorder", + "bitflags", "libc", "log", "netlink-packet-core", - "netlink-packet-utils", -] - -[[package]] -name = "netlink-packet-utils" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ede8a08c71ad5a95cdd0e4e52facd37190977039a4704eb82a283f713747d34" -dependencies = [ - "anyhow", - "byteorder", - "paste", - "thiserror 1.0.69", ] [[package]] name = "netlink-proto" -version = "0.11.5" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72452e012c2f8d612410d89eea01e2d9b56205274abb35d53f60200b2ec41d60" +checksum = "b65d130ee111430e47eed7896ea43ca693c387f097dd97376bffafbf25812128" dependencies = [ "bytes", "futures", @@ -1925,24 +1866,13 @@ dependencies = [ "tokio", ] -[[package]] -name = "nix" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" -dependencies = [ - "bitflags 2.9.1", - "cfg-if", - "libc", -] - [[package]] name = "nix" version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" dependencies = [ - "bitflags 2.9.1", + "bitflags", "cfg-if", "cfg_aliases", "libc", @@ -2080,7 +2010,7 @@ version = "0.10.73" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8505734d46c8ab1e19a1dce3aef597ad87dcb4c37e7188231769bd6bd51cebf8" dependencies = [ - "bitflags 2.9.1", + "bitflags", "cfg-if", "foreign-types", "libc", @@ -2386,9 +2316,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.12.6" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" +checksum = "2796faa41db3ec313a31f7624d9286acf277b52de526150b7e69f3debf891ee5" dependencies = [ "bytes", "prost-derive", @@ -2396,11 +2326,10 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.12.6" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" +checksum = "be769465445e8c1474e9c5dac2018218498557af32d9ed057325ec9a41ae81bf" dependencies = [ - "bytes", "heck 0.5.0", "itertools", "log", @@ -2417,9 +2346,9 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.12.6" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" +checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d" dependencies = [ "anyhow", "itertools", @@ -2430,9 +2359,9 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.12.6" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" +checksum = "52c2c1bf36ddb1a1c396b3601a3cec27c2462e45f07c386894ec3ccf5332bd16" dependencies = [ "prost", ] @@ -2517,7 +2446,7 @@ version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6" dependencies = [ - "bitflags 2.9.1", + "bitflags", ] [[package]] @@ -2560,9 +2489,9 @@ dependencies = [ "futures-core", "futures-util", "http 1.3.1", - "http-body 1.0.1", + "http-body", "http-body-util", - "hyper 1.6.0", + "hyper", "hyper-tls", "hyper-util", "js-sys", @@ -2574,7 +2503,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", - "sync_wrapper 1.0.2", + "sync_wrapper", "tokio", "tokio-native-tls", "tokio-util", @@ -2624,18 +2553,17 @@ dependencies = [ [[package]] name = "rtnetlink" -version = "0.14.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b684475344d8df1859ddb2d395dd3dac4f8f3422a1aa0725993cb375fc5caba5" +checksum = "08fd15aa4c64c34d0b3178e45ec6dad313a9f02b193376d501668a7950264bb7" dependencies = [ "futures", "log", "netlink-packet-core", "netlink-packet-route", - "netlink-packet-utils", "netlink-proto", "netlink-sys", - "nix 0.27.1", + "nix", "thiserror 1.0.69", "tokio", ] @@ -2658,7 +2586,7 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" dependencies = [ - "bitflags 2.9.1", + "bitflags", "errno", "libc", "linux-raw-sys", @@ -2792,7 +2720,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.9.1", + "bitflags", "core-foundation 0.9.4", "core-foundation-sys", "libc", @@ -2805,7 +2733,7 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b369d18893388b345804dc0007963c99b7d665ae71d275812d828c6f089640" dependencies = [ - "bitflags 2.9.1", + "bitflags", "core-foundation 0.10.1", "core-foundation-sys", "libc", @@ -2922,7 +2850,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd" dependencies = [ "libc", - "mio 0.8.11", + "mio", "signal-hook", ] @@ -3112,7 +3040,7 @@ checksum = "1ed31390216d20e538e447a7a9b959e06ed9fc51c37b514b46eb758016ecd418" dependencies = [ "atoi", "base64 0.21.7", - "bitflags 2.9.1", + "bitflags", "byteorder", "bytes", "crc", @@ -3155,7 +3083,7 @@ checksum = "7c824eb80b894f926f89a0b9da0c7f435d27cdd35b8c655b114e58223918577e" dependencies = [ "atoi", "base64 0.21.7", - "bitflags 2.9.1", + "bitflags", "byteorder", "crc", "dotenvy", @@ -3261,12 +3189,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "sync_wrapper" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - [[package]] name = "sync_wrapper" version = "1.0.2" @@ -3384,7 +3306,7 @@ dependencies = [ "bytes", "io-uring", "libc", - "mio 1.0.4", + "mio", "parking_lot", "pin-project-lite", "signal-hook-registry", @@ -3394,16 +3316,6 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "tokio-io-timeout" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" -dependencies = [ - "pin-project-lite", - "tokio", -] - [[package]] name = "tokio-macros" version = "2.5.0" @@ -3461,26 +3373,28 @@ dependencies = [ [[package]] name = "tonic" -version = "0.11.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76c4eb7a4e9ef9d4763600161f12f5070b92a578e1b634db88a6887844c91a13" +checksum = "7e581ba15a835f4d9ea06c55ab1bd4dce26fc53752c69a04aac00703bfb49ba9" dependencies = [ - "async-stream", "async-trait", "axum", - "base64 0.21.7", + "base64 0.22.1", "bytes", - "h2 0.3.26", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.32", + "h2", + "http 1.3.1", + "http-body", + "http-body-util", + "hyper", "hyper-timeout", + "hyper-util", "percent-encoding", "pin-project", "prost", + "socket2 0.5.10", "tokio", "tokio-stream", - "tower 0.4.13", + "tower 0.5.2", "tower-layer", "tower-service", "tracing", @@ -3488,13 +3402,14 @@ dependencies = [ [[package]] name = "tonic-build" -version = "0.11.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4ef6dd70a610078cb4e338a0f79d06bc759ff1b22d2120c2ff02ae264ba9c2" +checksum = "eac6f67be712d12f0b41328db3137e0d0757645d8904b4cb7d51cd9c2279e847" dependencies = [ "prettyplease", "proc-macro2", "prost-build", + "prost-types", "quote", "syn 2.0.102", ] @@ -3528,11 +3443,15 @@ checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" dependencies = [ "futures-core", "futures-util", + "indexmap 2.9.0", "pin-project-lite", - "sync_wrapper 1.0.2", + "slab", + "sync_wrapper", "tokio", + "tokio-util", "tower-layer", "tower-service", + "tracing", ] [[package]] @@ -3541,11 +3460,11 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2" dependencies = [ - "bitflags 2.9.1", + "bitflags", "bytes", "futures-util", "http 1.3.1", - "http-body 1.0.1", + "http-body", "iri-string", "pin-project-lite", "tower 0.5.2", @@ -3721,12 +3640,12 @@ dependencies = [ "cloud-hypervisor-client", "dotenvy", "feos-proto", - "hyper 1.6.0", + "hyper", "hyper-util", "hyperlocal", "image-service", "log", - "nix 0.29.0", + "nix", "once_cell", "openssl", "prost", @@ -4133,7 +4052,7 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" dependencies = [ - "bitflags 2.9.1", + "bitflags", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 7e99660..d22d711 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,15 +17,15 @@ edition = "2021" [workspace.dependencies] tokio = { version = "1.47.1", features = ["full"] } tokio-stream = { version = "0.1.15", features = ["net"] } -tonic = "0.11.0" -prost = "0.12.3" -prost-types = "0.12.3" -anyhow = "1.0.80" +tonic = "0.13.0" +prost = "0.13.5" +prost-types = "0.13.5" +anyhow = "1.0.100" nix = { version = "0.29.0", features = ["mount", "user", "reboot", "feature", "net", "aio", "signal", "process", "fs", "hostname"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0.132" uuid = { version = "1.18.1", features = ["v4"] } -tonic-build = "0.11.0" +tonic-build = "0.13.0" log = "0.4.28" env_logger = "0.11" openssl = { version = "0.10.72", features = ["vendored"] } @@ -35,14 +35,15 @@ tower = { version = "0.4", features = ["full"] } sha2 = "0.10" hex = "0.4" digest = "0.10" -clap = { version = "4.5.47", features = ["derive", "env"] } +clap = { version = "4.5.48", features = ["derive", "env"] } dotenvy = { version = "0.15"} libc = "0.2" -rtnetlink = "0.14.1" -netlink-packet-route = "~0.19.0" +rtnetlink = "0.18.1" +netlink-packet-route = "~0.25.0" pnet = "0.35.0" dhcproto = "0.13.0" socket2 = "0.6.0" futures = "0.3.31" chrono = "0.4.42" +hyper-util = { version = "0.1.14", features = ["tokio"] } feos-proto = { path = "feos/proto" } \ No newline at end of file diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 9b8dd55..af0ad0c 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -16,11 +16,12 @@ tonic = { workspace = true } anyhow = { workspace = true } log = { workspace = true } tokio-stream = { workspace = true } +hyper-util = { workspace = true } prost = { workspace = true } tower = { workspace = true } clap = { workspace = true, features = ["derive", "env"] } # CLI specific dependencies env_logger = { workspace = true } -crossterm = "0.27" +crossterm = "0.29" chrono = { workspace = true } \ No newline at end of file diff --git a/cli/src/image_commands.rs b/cli/src/image_commands.rs index 0816dc7..55a9ccb 100644 --- a/cli/src/image_commands.rs +++ b/cli/src/image_commands.rs @@ -7,6 +7,7 @@ use feos_proto::image_service::{ image_service_client::ImageServiceClient, DeleteImageRequest, ImageState, ListImagesRequest, PullImageRequest, WatchImageStatusRequest, }; +use hyper_util::rt::TokioIo; use std::path::PathBuf; use tokio::net::UnixStream; use tokio_stream::StreamExt; @@ -55,7 +56,8 @@ pub enum ImageCommand { async fn get_image_client(socket: PathBuf) -> Result> { let channel = Endpoint::try_from("http://[::1]:50051")? .connect_with_connector(service_fn(move |_: Uri| { - UnixStream::connect(socket.clone()) + let socket = socket.clone(); + async move { UnixStream::connect(socket).await.map(TokioIo::new) } })) .await .context("Failed to connect to ImageService via Unix socket")?; diff --git a/cli/src/vm_commands.rs b/cli/src/vm_commands.rs index 904cfc5..3a20379 100644 --- a/cli/src/vm_commands.rs +++ b/cli/src/vm_commands.rs @@ -349,15 +349,12 @@ async fn wait_for_vm_state( } } Err(status) => { - anyhow::bail!("Error in event stream: {}", status); + anyhow::bail!("Error in event stream: {status}"); } } } - anyhow::bail!( - "Event stream ended before reaching target state: {:?}", - target_state - ) + anyhow::bail!("Event stream ended before reaching target state: {target_state:?}") } async fn create_vm( diff --git a/feos/Cargo.toml b/feos/Cargo.toml index 4ee3a61..5b0dfd9 100644 --- a/feos/Cargo.toml +++ b/feos/Cargo.toml @@ -53,6 +53,7 @@ log = { workspace = true } env_logger = { workspace = true } tokio-stream = { workspace = true } prost = { workspace = true } +hyper-util = { workspace = true } once_cell = "1.19" regex = "1.10" tower = { workspace = true } diff --git a/feos/proto/build.rs b/feos/proto/build.rs index fd4bc3b..388c06f 100644 --- a/feos/proto/build.rs +++ b/feos/proto/build.rs @@ -6,7 +6,7 @@ fn main() -> Result<(), Box> { tonic_build::configure() .protoc_arg("--experimental_allow_proto3_optional") - .compile( + .compile_protos( &[ format!("{proto_dir}/vm.proto"), format!("{proto_dir}/host.proto"), diff --git a/feos/services/vm-service/src/api.rs b/feos/services/vm-service/src/api.rs index 6b35834..3343958 100644 --- a/feos/services/vm-service/src/api.rs +++ b/feos/services/vm-service/src/api.rs @@ -131,7 +131,7 @@ impl VmService for VmApiHandler { info!("VmApi: Received StreamVmConsole stream request."); let grpc_input_stream = request.into_inner(); let (grpc_output_tx, grpc_output_rx) = mpsc::channel(32); - let cmd = Command::StreamVmConsole(grpc_input_stream, grpc_output_tx); + let cmd = Command::StreamVmConsole(Box::new(grpc_input_stream), grpc_output_tx); self.dispatcher_tx .send(cmd) .await diff --git a/feos/services/vm-service/src/dispatcher.rs b/feos/services/vm-service/src/dispatcher.rs index f4857c9..dd7d52f 100644 --- a/feos/services/vm-service/src/dispatcher.rs +++ b/feos/services/vm-service/src/dispatcher.rs @@ -85,7 +85,7 @@ impl VmServiceDispatcher { handle_delete_vm_command(&self.repository, &self.healthcheck_cancel_bus, req, responder, hypervisor, event_bus_tx).await; } Command::StreamVmConsole(input_stream, output_tx) => { - tokio::spawn(worker::handle_stream_vm_console(input_stream, output_tx, hypervisor)); + tokio::spawn(worker::handle_stream_vm_console(*input_stream, output_tx, hypervisor)); } Command::ListVms(req, responder) => { handle_list_vms_command(&self.repository, req, responder).await; diff --git a/feos/services/vm-service/src/dispatcher_handlers.rs b/feos/services/vm-service/src/dispatcher_handlers.rs index 5cfdf50..0587903 100644 --- a/feos/services/vm-service/src/dispatcher_handlers.rs +++ b/feos/services/vm-service/src/dispatcher_handlers.rs @@ -14,6 +14,7 @@ use feos_proto::{ VmStateChangedEvent, }, }; +use hyper_util::rt::TokioIo; use image_service::IMAGE_SERVICE_SOCKET; use log::{error, info, warn}; use nix::unistd::Pid; @@ -34,7 +35,12 @@ pub(crate) async fn get_image_service_client( Endpoint::try_from("http://[::1]:50051") .unwrap() .connect_with_connector(service_fn(move |_: Uri| { - tokio::net::UnixStream::connect(socket_path.clone()) + let socket_path = socket_path.clone(); + async move { + tokio::net::UnixStream::connect(socket_path) + .await + .map(TokioIo::new) + } })) .await .map(ImageServiceClient::new) diff --git a/feos/services/vm-service/src/lib.rs b/feos/services/vm-service/src/lib.rs index 4cb12d3..82601af 100644 --- a/feos/services/vm-service/src/lib.rs +++ b/feos/services/vm-service/src/lib.rs @@ -47,7 +47,7 @@ pub enum Command { oneshot::Sender>, ), StreamVmConsole( - Streaming, + Box>, mpsc::Sender>, ), ListVms( diff --git a/feos/services/vm-service/src/persistence/repository.rs b/feos/services/vm-service/src/persistence/repository.rs index 7a61aa0..e4a53fa 100644 --- a/feos/services/vm-service/src/persistence/repository.rs +++ b/feos/services/vm-service/src/persistence/repository.rs @@ -33,7 +33,7 @@ fn string_to_vm_state(s: &str) -> Result { "VM_STATE_STOPPED" => Ok(VmState::Stopped), "VM_STATE_CRASHED" => Ok(VmState::Crashed), "VM_STATE_UNSPECIFIED" => Ok(VmState::Unspecified), - _ => Err(anyhow!("Invalid state string '{}' in database", s)), + _ => Err(anyhow!("Invalid state string '{s}' in database")), } } @@ -61,7 +61,7 @@ impl VmRepository { if let Some(row) = row_opt { let config = VmConfig::decode(&*row.config_blob) - .map_err(|e| anyhow!("Failed to decode VmConfig blob: {}", e))?; + .map_err(|e| anyhow!("Failed to decode VmConfig blob: {e}"))?; let state = string_to_vm_state(&row.state)?; diff --git a/feos/src/main.rs b/feos/src/main.rs index 3d9a38e..d4d0bac 100644 --- a/feos/src/main.rs +++ b/feos/src/main.rs @@ -27,13 +27,13 @@ async fn main() -> Result<()> { }); if root_fstype == "rootfs" { - move_root().map_err(|e| anyhow::anyhow!("[feos] move_root failed: {}", e))?; + move_root().map_err(|e| anyhow::anyhow!("[feos] move_root failed: {e}"))?; let argv: Vec = env::args() .map(|arg| CString::new(arg).unwrap_or_default()) .collect(); - let _ = execv(&argv[0], &argv) - .map_err(|e| anyhow::anyhow!("[feos] execv failed: {}", e))?; + let _ = + execv(&argv[0], &argv).map_err(|e| anyhow::anyhow!("[feos] execv failed: {e}"))?; return Err(anyhow::anyhow!("execv failed to replace process")); } diff --git a/feos/tests/integration_tests.rs b/feos/tests/integration_tests.rs index 9835d8e..34d6bc6 100644 --- a/feos/tests/integration_tests.rs +++ b/feos/tests/integration_tests.rs @@ -17,6 +17,7 @@ use feos_proto::{ VmEvent, VmState, VmStateChangedEvent, }, }; +use hyper_util::rt::TokioIo; use image_service::{IMAGE_DIR, IMAGE_SERVICE_SOCKET}; use log::{error, info, warn}; use nix::sys::signal::{kill, Signal}; @@ -102,8 +103,10 @@ async fn get_public_clients() -> Result<(VmServiceClient, HostServiceCl async fn get_image_service_client() -> Result> { let endpoint = Endpoint::from_static("http://[::1]:50051"); let channel = endpoint - .connect_with_connector(service_fn(|_: Uri| { + .connect_with_connector(service_fn(|_: Uri| async { UnixStream::connect(IMAGE_SERVICE_SOCKET) + .await + .map(TokioIo::new) })) .await?; Ok(ImageServiceClient::new(channel)) diff --git a/feos/utils/src/network/dhcpv6.rs b/feos/utils/src/network/dhcpv6.rs index af42038..26ddb37 100644 --- a/feos/utils/src/network/dhcpv6.rs +++ b/feos/utils/src/network/dhcpv6.rs @@ -5,7 +5,7 @@ use dhcproto::v6::*; use futures::stream::TryStreamExt; use log::{error, info, warn}; use netlink_packet_route::route::{ - RouteAddress, RouteAttribute, RouteProtocol, RouteScope, RouteType, + RouteAddress, RouteAttribute, RouteMessage, RouteProtocol, RouteScope, RouteType, }; use netlink_packet_route::AddressFamily; use nix::net::if_::if_nametoindex; @@ -498,8 +498,8 @@ pub async fn add_ipv6_route( .try_next() .await? .ok_or(Error::RequestFailed)?; - let mut req = handle.route().add(); - let msg = req.message_mut(); + + let mut msg = RouteMessage::default(); msg.header.address_family = AddressFamily::Inet6; msg.header.scope = RouteScope::Universe; msg.header.protocol = RouteProtocol::Static; @@ -515,7 +515,8 @@ pub async fn add_ipv6_route( } msg.attributes.push(RouteAttribute::Oif(link.header.index)); msg.attributes.push(RouteAttribute::Priority(metric)); - req.execute().await + + handle.route().add(msg).execute().await } pub async fn set_ipv6_gateway( @@ -531,8 +532,8 @@ pub async fn set_ipv6_gateway( .try_next() .await? .ok_or(Error::RequestFailed)?; - let mut req = handle.route().add(); - let msg = req.message_mut(); + + let mut msg = RouteMessage::default(); msg.header.address_family = AddressFamily::Inet6; msg.header.scope = RouteScope::Universe; msg.header.protocol = RouteProtocol::Static; @@ -541,5 +542,6 @@ pub async fn set_ipv6_gateway( msg.attributes .push(RouteAttribute::Gateway(RouteAddress::Inet6(ipv6_gateway))); msg.attributes.push(RouteAttribute::Oif(link.header.index)); - req.execute().await + + handle.route().add(msg).execute().await } diff --git a/feos/utils/src/network/utils.rs b/feos/utils/src/network/utils.rs index 5b1306d..e5b63a5 100644 --- a/feos/utils/src/network/utils.rs +++ b/feos/utils/src/network/utils.rs @@ -4,6 +4,7 @@ use super::dhcpv6::*; use futures::stream::TryStreamExt; use log::{error, info, warn}; +use netlink_packet_route::link::{LinkAttribute, LinkFlags, LinkMessage}; use netlink_packet_route::route::RouteType; use rtnetlink::new_connection; use std::fs::File; @@ -162,10 +163,14 @@ pub async fn configure_network_devices() -> Result, Strin .map_err(|e| format!("{interface_name} not found: {e}"))? .ok_or("Link not found".to_string())?; + let mut link_msg = LinkMessage::default(); + link_msg.header.index = link.header.index; + link_msg.header.flags = link.header.flags | LinkFlags::Up; + link_msg.header.change_mask = LinkFlags::Up; + handle .link() - .set(link.header.index) - .up() + .set(link_msg) .execute() .await .map_err(|e| format!("{interface_name} can not be set up: {e}"))?; @@ -173,13 +178,13 @@ pub async fn configure_network_devices() -> Result, Strin info!("{interface_name}:"); for attr in link.attributes { match attr { - netlink_packet_route::link::LinkAttribute::Address(mac_bytes) => { + LinkAttribute::Address(mac_bytes) => { info!(" mac: {}", format_mac(mac_bytes.clone())); } - netlink_packet_route::link::LinkAttribute::Carrier(carrier) => { + LinkAttribute::Carrier(carrier) => { info!(" carrier: {carrier}"); } - netlink_packet_route::link::LinkAttribute::Mtu(mtu) => { + LinkAttribute::Mtu(mtu) => { info!(" mtu: {mtu}"); } _ => (),