diff --git a/Cargo.lock b/Cargo.lock index e8bc606..e90a9ee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -37,9 +37,9 @@ dependencies = [ [[package]] name = "adler2" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "aho-corasick" @@ -56,12 +56,6 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - [[package]] name = "android_system_properties" version = "0.1.5" @@ -71,20 +65,11 @@ dependencies = [ "libc", ] -[[package]] -name = "ansi_term" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -dependencies = [ - "winapi", -] - [[package]] name = "anstream" -version = "0.6.18" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" +checksum = "3ae563653d1938f79b1ab1b5e668c87c76a9930414574a6583a7b7e11a8e6192" dependencies = [ "anstyle", "anstyle-parse", @@ -97,48 +82,49 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" +checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" [[package]] name = "anstyle-parse" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.2" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" +checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] name = "anstyle-wincon" -version = "3.0.6" +version = "3.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" +checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a" dependencies = [ "anstyle", - "windows-sys 0.59.0", + "once_cell_polyfill", + "windows-sys 0.60.2", ] [[package]] name = "anyhow" -version = "1.0.99" +version = "1.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0674a1ddeecb70197781e945de4b3b8ffb61fa939a5597bcf48503737663100" +checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" [[package]] name = "api_identity" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#ff423d49a72d77433ab659025d7a4c1be9847d07" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#e76962a5f67b8c5bf813ee24a7600634de708b35" dependencies = [ "omicron-workspace-hack", "proc-macro2", @@ -182,7 +168,7 @@ version = "0.1.0" dependencies = [ "aal", "anyhow", - "bindgen 0.72.0", + "bindgen", "cc", "cfg-if", "chrono", @@ -193,7 +179,7 @@ dependencies = [ "propolis", "rand 0.9.2", "schemars", - "semver 1.0.26", + "semver 1.0.27", "serde", "serde_json", "slog", @@ -264,33 +250,22 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ef1bb8d1b645fe38d51dfc331d720fb5fc2c94b440c76cc79c80ff265ca33e3" dependencies = [ - "rustix 0.38.40", + "rustix 0.38.44", "tempfile", "windows-sys 0.52.0", ] -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", -] - [[package]] name = "autocfg" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "aws-lc-rs" -version = "1.13.3" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c953fe1ba023e6b7730c0d4b031d06f267f23a46167dcbd40316644b10a17ba" +checksum = "94b8ff6c09cd57b16da53641caa860168b88c172a5ee163b0288d3d6eea12786" dependencies = [ "aws-lc-sys", "untrusted 0.7.1", @@ -299,11 +274,11 @@ dependencies = [ [[package]] name = "aws-lc-sys" -version = "0.30.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbfd150b5dbdb988bcc8fb1fe787eb6b7ee6180ca24da683b61ea5405f3d43ff" +checksum = "0e44d16778acaf6a9ec9899b92cebd65580b83f685446bf2e1f5d3d732f99dcd" dependencies = [ - "bindgen 0.69.5", + "bindgen", "cc", "cmake", "dunce", @@ -364,7 +339,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b62ddb9cb1ec0a098ad4bbf9344d0713fa193ae1a80af55febcff2627b6a00c1" dependencies = [ "futures-core", - "getrandom 0.2.15", + "getrandom 0.2.16", "instant", "pin-project-lite", "rand 0.8.5", @@ -373,9 +348,9 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.74" +version = "0.3.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" dependencies = [ "addr2line", "cfg-if", @@ -400,9 +375,19 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" -version = "1.6.0" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55248b47b0caf0546f7988906588779981c43bb1bc9d0c44087278f80cdb44ba" + +[[package]] +name = "bcs" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" +checksum = "85b6598a2f5d564fb7855dc6b06fd1c38cff5a72bd8b863a4d021938497b440a" +dependencies = [ + "serde", + "thiserror 1.0.69", +] [[package]] name = "bhyve_api" @@ -417,7 +402,7 @@ dependencies = [ [[package]] name = "bhyve_api" version = "0.0.0" -source = "git+https://github.com/oxidecomputer/propolis#aadc0998c0f07f08ab15a95c006074291734800f" +source = "git+https://github.com/oxidecomputer/propolis#827e6615bfebfd94d41504dcd1517a0f22e3166a" dependencies = [ "bhyve_api_sys 0.0.0 (git+https://github.com/oxidecomputer/propolis)", "libc", @@ -436,7 +421,7 @@ dependencies = [ [[package]] name = "bhyve_api_sys" version = "0.0.0" -source = "git+https://github.com/oxidecomputer/propolis#aadc0998c0f07f08ab15a95c006074291734800f" +source = "git+https://github.com/oxidecomputer/propolis#827e6615bfebfd94d41504dcd1517a0f22e3166a" dependencies = [ "libc", "strum 0.26.3", @@ -444,34 +429,11 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.69.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" -dependencies = [ - "bitflags 2.9.2", - "cexpr", - "clang-sys", - "itertools 0.12.1", - "lazy_static", - "lazycell", - "log", - "prettyplease", - "proc-macro2", - "quote", - "regex", - "rustc-hash 1.1.0", - "shlex", - "syn 2.0.106", - "which", -] - -[[package]] -name = "bindgen" -version = "0.72.0" +version = "0.72.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f72209734318d0b619a5e0f5129918b848c416e122a3c4ce054e03cb87b726f" +checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.4", "cexpr", "clang-sys", "itertools 0.13.0", @@ -480,7 +442,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "rustc-hash 2.1.1", + "rustc-hash", "shlex", "syn 2.0.106", ] @@ -508,9 +470,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.9.2" +version = "2.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a65b545ab31d687cff52899d4890855fec459eb6afe0da6417b8a18da87aa29" +checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394" dependencies = [ "serde", ] @@ -558,9 +520,9 @@ dependencies = [ [[package]] name = "blake3" -version = "1.5.4" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d82033247fd8e890df8f740e407ad4d038debb9eb1f40533fffb32e7d17dc6f7" +checksum = "3888aaa89e4b2a40fca9848e400f6a658a5a3978de7be858e209cafa8be9a4a0" dependencies = [ "arrayref", "arrayvec", @@ -592,15 +554,15 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" [[package]] name = "bytecount" -version = "0.6.8" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce89b21cab1437276d2650d57e971f9d548a2d9037cc231abdc0562b97498ce" +checksum = "175812e0be2bccb6abe50bb8d566126198344f707e304f45c648fd8f2cc0365e" [[package]] name = "byteorder" @@ -619,11 +581,11 @@ dependencies = [ [[package]] name = "camino" -version = "1.1.11" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d07aa9a93b00c76f71bc35d598bed923f6d4f3a9ca5c24b7737ae1a292841c0" +checksum = "e1de8bc0aa9e9385ceb3bf0c152e3a9b9544f6c4a912c8ae504e80c1f0368603" dependencies = [ - "serde", + "serde_core", ] [[package]] @@ -651,9 +613,9 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" +checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" dependencies = [ "serde", ] @@ -666,7 +628,7 @@ checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", - "semver 1.0.26", + "semver 1.0.27", "serde", "serde_json", "thiserror 1.0.69", @@ -674,10 +636,11 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.34" +version = "1.2.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42bc4aea80032b7bf409b0bc7ccad88853858911b7713a8062fdc0623867bedc" +checksum = "80f41ae168f955c12fb8960b057d70d0ca153fb83182b57d86380443527be7e9" dependencies = [ + "find-msvc-tools", "jobserver", "libc", "shlex", @@ -706,50 +669,45 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "chrono" -version = "0.4.41" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" +checksum = "145052bdd345b87320e369255277e3fb5152762ad123a901ef5c262dd38fe8d2" dependencies = [ - "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "serde", "wasm-bindgen", - "windows-link", + "windows-link 0.2.0", ] [[package]] -name = "clang-sys" -version = "1.8.1" +name = "chrono-tz" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +checksum = "a6139a8597ed92cf816dfb33f5dd6cf0bb93a6adc938f11039f371bc5bcd26c3" dependencies = [ - "glob", - "libc", - "libloading 0.8.5", + "chrono", + "phf", + "serde", ] [[package]] -name = "clap" -version = "2.34.0" +name = "clang-sys" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" dependencies = [ - "ansi_term", - "atty", - "bitflags 1.3.2", - "strsim 0.8.0", - "textwrap 0.11.0", - "unicode-width 0.1.14", - "vec_map", + "glob", + "libc", + "libloading 0.8.9", ] [[package]] name = "clap" -version = "4.5.21" +version = "4.5.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb3b4b9e5a7c7514dfa52869339ee98b3156b0bfb4e8a77c4ff4babb64b1604f" +checksum = "e2134bb3ea021b78629caa971416385309e0131b351b25e01dc16fb54e1b5fae" dependencies = [ "clap_builder", "clap_derive", @@ -757,22 +715,22 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.21" +version = "4.5.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b17a95aa67cc7b5ebd32aa5370189aa0d79069ef1c64ce893bd30fb24bff20ec" +checksum = "c2ba64afa3c0a6df7fa517765e31314e983f51dda798ffba27b988194fb65dc9" dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.11.1", + "strsim", "terminal_size", ] [[package]] name = "clap_derive" -version = "4.5.18" +version = "4.5.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" +checksum = "bbfd7eae0b0f1a6e63d4b13c9c478de77c2eb546fba158ad50b4203dc24b9f9c" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -782,14 +740,14 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.3" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7" +checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" [[package]] name = "clickhouse-admin-types" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#ff423d49a72d77433ab659025d7a4c1be9847d07" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#e76962a5f67b8c5bf813ee24a7600634de708b35" dependencies = [ "anyhow", "atomicwrites", @@ -808,6 +766,22 @@ dependencies = [ "slog", ] +[[package]] +name = "clickward" +version = "0.1.0" +source = "git+https://github.com/oxidecomputer/clickward?rev=e3d9a1c35cf3cd04f9cb2e997b0ad88324d30737#e3d9a1c35cf3cd04f9cb2e997b0ad88324d30737" +dependencies = [ + "anyhow", + "camino", + "clap", + "derive_more", + "schemars", + "serde", + "serde_json", + "thiserror 1.0.69", + "tokio", +] + [[package]] name = "cmake" version = "0.1.54" @@ -819,14 +793,17 @@ dependencies = [ [[package]] name = "cobs" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" +checksum = "0fa961b519f0b462e3a3b4a34b64d119eeaca1d59af726fe450bbba07a9fc0a1" +dependencies = [ + "thiserror 2.0.16", +] [[package]] name = "cockroach-admin-types" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#ff423d49a72d77433ab659025d7a4c1be9847d07" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#e76962a5f67b8c5bf813ee24a7600634de708b35" dependencies = [ "chrono", "csv", @@ -834,14 +811,14 @@ dependencies = [ "omicron-workspace-hack", "schemars", "serde", - "thiserror 2.0.12", + "thiserror 2.0.16", ] [[package]] name = "colorchoice" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" [[package]] name = "colored" @@ -886,13 +863,13 @@ dependencies = [ [[package]] name = "common" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/dendrite#fa210df3b3eadab8ed514dd715b8fed3d1937f98" +source = "git+https://github.com/oxidecomputer/dendrite?branch=main#6ba23e71121c196e1e3c4e0621ba7a6f046237c7" dependencies = [ "anyhow", "chrono", "oximeter", "oxnet", - "rand 0.8.5", + "rand 0.9.2", "schemars", "serde", "serde_json", @@ -905,34 +882,17 @@ dependencies = [ "tokio", ] -[[package]] -name = "common" -version = "0.1.0" -source = "git+https://github.com/oxidecomputer/lldp#ffa23656a6f7ba189836f736ec68c8de8b1eec8e" -dependencies = [ - "anyhow", - "dpd-client 0.1.0 (git+https://github.com/oxidecomputer/dendrite)", - "schemars", - "serde", - "serde_json", - "slog", - "slog-async", - "slog-bunyan", - "slog-term", - "thiserror 1.0.69", -] - [[package]] name = "console" -version = "0.15.8" +version = "0.15.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" +checksum = "054ccb5b10f9f2cbf51eb355ca1d05c2d279ce1804688d0db74b4733a5aeafd8" dependencies = [ "encode_unicode", - "lazy_static", "libc", - "unicode-width 0.1.14", - "windows-sys 0.52.0", + "once_cell", + "unicode-width 0.2.1", + "windows-sys 0.59.0", ] [[package]] @@ -974,6 +934,26 @@ dependencies = [ "tracing-subscriber", ] +[[package]] +name = "const_format" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126f97965c8ad46d6d9163268ff28432e8f6a1196a55578867832e3049df63dd" +dependencies = [ + "const_format_proc_macros", +] + +[[package]] +name = "const_format_proc_macros" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + [[package]] name = "constant_time_eq" version = "0.3.1" @@ -1014,9 +994,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca741a962e1b0bff6d724a1a0958b686406e853bb14061f218562e1896f95e6" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" dependencies = [ "libc", ] @@ -1024,19 +1004,19 @@ dependencies = [ [[package]] name = "cpuid_utils" version = "0.0.0" -source = "git+https://github.com/oxidecomputer/propolis#aadc0998c0f07f08ab15a95c006074291734800f" +source = "git+https://github.com/oxidecomputer/propolis#827e6615bfebfd94d41504dcd1517a0f22e3166a" dependencies = [ "bhyve_api 0.0.0 (git+https://github.com/oxidecomputer/propolis)", - "bitflags 2.9.2", + "bitflags 2.9.4", "propolis_types", "thiserror 1.0.69", ] [[package]] name = "crc32fast" -version = "1.4.2" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" dependencies = [ "cfg-if", ] @@ -1064,9 +1044,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" dependencies = [ "crossbeam-epoch", "crossbeam-utils", @@ -1083,9 +1063,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crucible-smf" @@ -1096,7 +1076,7 @@ dependencies = [ "libc", "num-derive 0.4.2", "num-traits", - "thiserror 2.0.12", + "thiserror 2.0.16", ] [[package]] @@ -1139,9 +1119,9 @@ dependencies = [ [[package]] name = "csv-core" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5efa2b3d7902f4b634a20cae3c9c4e6209dc4779feb6863329607560143efa70" +checksum = "7d02f3b0da4c6504f86e9cd789d8dbafab48c2321be74e9987593de5a894d93d" dependencies = [ "memchr", ] @@ -1202,79 +1182,44 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" -dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", -] - -[[package]] -name = "darling" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08440b3dd222c3d0433e63e097463969485f112baff337dfdaca043a0d760570" -dependencies = [ - "darling_core 0.21.2", - "darling_macro 0.21.2", -] - -[[package]] -name = "darling_core" -version = "0.20.10" +version = "0.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +checksum = "9cdf337090841a411e2a7f3deb9187445851f91b309c0c0a29e05f74a00a48c0" dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.11.1", - "syn 2.0.106", + "darling_core", + "darling_macro", ] [[package]] name = "darling_core" -version = "0.21.2" +version = "0.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d25b7912bc28a04ab1b7715a68ea03aaa15662b43a1a4b2c480531fd19f8bf7e" +checksum = "1247195ecd7e3c85f83c8d2a366e4210d588e802133e1e355180a9870b517ea4" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", - "syn 2.0.106", -] - -[[package]] -name = "darling_macro" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" -dependencies = [ - "darling_core 0.20.10", - "quote", + "strsim", "syn 2.0.106", ] [[package]] name = "darling_macro" -version = "0.21.2" +version = "0.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce154b9bea7fb0c8e8326e62d00354000c36e79770ff21b8c84e3aa267d9d531" +checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81" dependencies = [ - "darling_core 0.21.2", + "darling_core", "quote", "syn 2.0.106", ] [[package]] name = "data-encoding" -version = "2.6.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" +checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" [[package]] name = "debug-ignore" @@ -1284,9 +1229,18 @@ checksum = "ffe7ed1d93f4553003e20b629abe9085e1e81b1429520f897f8f8860bc6dfc21" [[package]] name = "defmt" -version = "0.3.8" +version = "0.3.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a99dd22262668b887121d4672af5a64b238f026099f1a2a1b322066c9ecfe9e0" +checksum = "f0963443817029b2024136fc4dd07a5107eb8f977eaf18fcd1fdeb11306b64ad" +dependencies = [ + "defmt 1.0.1", +] + +[[package]] +name = "defmt" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "548d977b6da32fa1d1fda2876453da1e7df63ad0304c8b3dae4dbe7b96f39b78" dependencies = [ "bitflags 1.3.2", "defmt-macros", @@ -1294,12 +1248,12 @@ dependencies = [ [[package]] name = "defmt-macros" -version = "0.3.9" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3a9f309eff1f79b3ebdf252954d90ae440599c26c2c553fe87a2d17195f2dcb" +checksum = "3d4fc12a85bcf441cfe44344c4b72d58493178ce635338a3f3b78943aceb258e" dependencies = [ "defmt-parser", - "proc-macro-error", + "proc-macro-error2", "proc-macro2", "quote", "syn 2.0.106", @@ -1307,18 +1261,18 @@ dependencies = [ [[package]] name = "defmt-parser" -version = "0.3.4" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4a5fefe330e8d7f31b16a318f9ce81000d8e35e69b93eae154d16d2278f70f" +checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" dependencies = [ - "thiserror 1.0.69", + "thiserror 2.0.16", ] [[package]] name = "deranged" -version = "0.3.11" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +checksum = "d630bccd429a5bb5a64b5e94f693bfc48c9f8566418fda4c494cc94f911f87cc" dependencies = [ "powerfmt", ] @@ -1396,7 +1350,7 @@ dependencies = [ [[package]] name = "dladm" version = "0.0.0" -source = "git+https://github.com/oxidecomputer/propolis#aadc0998c0f07f08ab15a95c006074291734800f" +source = "git+https://github.com/oxidecomputer/propolis#827e6615bfebfd94d41504dcd1517a0f22e3166a" dependencies = [ "libc", "strum 0.26.3", @@ -1405,50 +1359,54 @@ dependencies = [ [[package]] name = "dlpi" version = "0.2.0" -source = "git+https://github.com/oxidecomputer/dlpi-sys?branch=main#1d587ea98cf2d36f1b1624b0b960559c76d475d2" +source = "git+https://github.com/oxidecomputer/dlpi-sys?branch=main#555fa6e1315a64f40c72716e4d168697c03795c6" dependencies = [ "libc", "libdlpi-sys 0.1.0 (git+https://github.com/oxidecomputer/dlpi-sys?branch=main)", - "num_enum 0.5.11", - "pretty-hex 0.2.1", - "thiserror 1.0.69", + "num_enum 0.7.4", + "pretty-hex", + "thiserror 2.0.16", "tokio", ] [[package]] name = "dlpi" version = "0.2.0" -source = "git+https://github.com/oxidecomputer/dlpi-sys#8e2d840d6c0b41f3bd0066690e8d9cc8163a679f" +source = "git+https://github.com/oxidecomputer/dlpi-sys#555fa6e1315a64f40c72716e4d168697c03795c6" dependencies = [ "libc", "libdlpi-sys 0.1.0 (git+https://github.com/oxidecomputer/dlpi-sys)", "num_enum 0.7.4", - "pretty-hex 0.4.1", - "thiserror 2.0.12", + "pretty-hex", + "thiserror 2.0.16", ] [[package]] name = "dof" -version = "0.1.5" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e6b21a1211455e82b1245d6e1b024f30606afbb734c114515d40d0e0b34ce81" +checksum = "558e5396321b677a59d2c43b3cc3bc44683109c63ac49275f3bbbf41c0ecd002" dependencies = [ + "goblin 0.8.2", + "pretty-hex", + "serde", + "serde_json", "thiserror 1.0.69", - "zerocopy 0.3.2", + "zerocopy 0.7.35", ] [[package]] name = "dof" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "558e5396321b677a59d2c43b3cc3bc44683109c63ac49275f3bbbf41c0ecd002" +checksum = "0ed9b77e3c2a83995eedff2fbf992eef44c9f319b8016254f68108e27a4d06e7" dependencies = [ - "goblin", - "pretty-hex 0.4.1", + "goblin 0.10.1", + "pretty-hex", "serde", "serde_json", - "thiserror 1.0.69", - "zerocopy 0.7.35", + "thiserror 2.0.16", + "zerocopy 0.8.27", ] [[package]] @@ -1467,6 +1425,7 @@ dependencies = [ "asic", "cfg-if", "chrono", + "clap", "common 0.1.0", "console-subscriber", "csv", @@ -1494,7 +1453,7 @@ dependencies = [ "regress", "reqwest", "schemars", - "semver 1.0.26", + "semver 1.0.27", "serde", "serde_json", "signal-hook", @@ -1503,7 +1462,6 @@ dependencies = [ "slog-async", "slog-term", "smf 0.10.0", - "structopt", "strum 0.26.3", "thiserror 1.0.69", "tokio", @@ -1545,7 +1503,7 @@ dependencies = [ "parking_lot", "pcap", "pretty_assertions", - "progenitor 0.11.0", + "progenitor 0.11.1", "rand 0.9.2", "regress", "reqwest", @@ -1564,16 +1522,16 @@ dependencies = [ [[package]] name = "dpd-client" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/dendrite#fa210df3b3eadab8ed514dd715b8fed3d1937f98" +source = "git+https://github.com/oxidecomputer/dendrite?branch=main#6ba23e71121c196e1e3c4e0621ba7a6f046237c7" dependencies = [ "async-trait", "chrono", - "common 0.1.0 (git+https://github.com/oxidecomputer/dendrite)", + "common 0.1.0 (git+https://github.com/oxidecomputer/dendrite?branch=main)", "crc8", "futures", "http", "oxnet", - "progenitor 0.9.1", + "progenitor 0.11.1", "regress", "reqwest", "schemars", @@ -1603,9 +1561,9 @@ dependencies = [ [[package]] name = "dropshot" -version = "0.16.3" +version = "0.16.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eedf902e40c1024b8ed9ca16378a54e9655cdf0e698245ba82d81a3778dcbc54" +checksum = "7cd9bdeafc752f117ed20e659b9763695ae5900adf3a32e93f9f6f4052fd5d66" dependencies = [ "async-stream", "async-trait", @@ -1617,12 +1575,12 @@ dependencies = [ "dropshot_endpoint", "form_urlencoded", "futures", - "hostname 0.4.0", + "hostname 0.4.1", "http", "http-body-util", "hyper", "hyper-util", - "indexmap 2.10.0", + "indexmap 2.11.4", "multer", "openapiv3", "paste", @@ -1631,7 +1589,7 @@ dependencies = [ "rustls-pemfile", "schemars", "scopeguard", - "semver 1.0.26", + "semver 1.0.27", "serde", "serde_json", "serde_path_to_error", @@ -1642,10 +1600,10 @@ dependencies = [ "slog-bunyan", "slog-json", "slog-term", - "thiserror 2.0.12", + "thiserror 2.0.16", "tokio", "tokio-rustls 0.25.0", - "toml 0.9.5", + "toml 0.9.7", "usdt 0.5.0", "uuid", "version_check", @@ -1654,24 +1612,24 @@ dependencies = [ [[package]] name = "dropshot_endpoint" -version = "0.16.3" +version = "0.16.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "085c02a4c441ce91e77db3f9a8d1a2d557fc13f5d594dac98a5b389781a8642e" +checksum = "89d09440e73a9dcf8a0f7fbd6ab889a7751d59f0fe76e5082a0a6d5623ec6da3" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "semver 1.0.26", + "semver 1.0.27", "serde", - "serde_tokenstream 0.2.2", + "serde_tokenstream", "syn 2.0.106", ] [[package]] name = "dtrace-parser" -version = "0.1.14" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bed110893a7f9f4ceb072e166354a09f6cb4cc416eec5b5e5e8ee367442d434b" +checksum = "71734e3eb68cd4df338d04dffdcc024f89eb0b238150cc95b826fbfad756452b" dependencies = [ "pest", "pest_derive", @@ -1680,13 +1638,13 @@ dependencies = [ [[package]] name = "dtrace-parser" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71734e3eb68cd4df338d04dffdcc024f89eb0b238150cc95b826fbfad756452b" +checksum = "dc09b90bda5770641457f1c0a42c8203c48f5a3d9799dcf1bafbd84e30ccf080" dependencies = [ "pest", "pest_derive", - "thiserror 1.0.69", + "thiserror 2.0.16", ] [[package]] @@ -1697,9 +1655,9 @@ checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "dyn-clone" -version = "1.0.17" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" [[package]] name = "either" @@ -1721,9 +1679,9 @@ checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" [[package]] name = "encode_unicode" -version = "0.3.6" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" [[package]] name = "encoding_rs" @@ -1754,18 +1712,19 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "erased-serde" -version = "0.4.5" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24e2389d65ab4fab27dc2a5de7b191e1f6617d1f1c8855c0dc569c94a4cbb18d" +checksum = "259d404d09818dec19332e31d94558aeb442fea04c817006456c24b5460bbd4b" dependencies = [ "serde", + "serde_core", "typeid", ] [[package]] name = "ereport-types" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#ff423d49a72d77433ab659025d7a4c1be9847d07" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#e76962a5f67b8c5bf813ee24a7600634de708b35" dependencies = [ "dropshot", "omicron-uuid-kinds", @@ -1773,17 +1732,17 @@ dependencies = [ "schemars", "serde", "serde_json", - "thiserror 2.0.12", + "thiserror 2.0.16", ] [[package]] name = "errno" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.61.0", ] [[package]] @@ -1800,22 +1759,28 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "filetime" -version = "0.2.25" +version = "0.2.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" +checksum = "bc0505cd1b6fa6580283f6bdf70a73fcf4aba1184038c90902b92b3dd0df63ed" dependencies = [ "cfg-if", "libc", "libredox", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] +[[package]] +name = "find-msvc-tools" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ced73b1dacfc750a6db6c0a0c3a3853c8b41997e2e2c563dc90804ae6867959" + [[package]] name = "fixedbitset" version = "0.4.2" @@ -1830,9 +1795,9 @@ checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" [[package]] name = "flate2" -version = "1.0.34" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" +checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d" dependencies = [ "crc32fast", "miniz_oxide", @@ -1856,6 +1821,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + [[package]] name = "foreign-types" version = "0.3.2" @@ -1900,18 +1871,18 @@ checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" [[package]] name = "form_urlencoded" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" dependencies = [ "percent-encoding", ] [[package]] name = "fragile" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" +checksum = "28dd6caf6059519a65843af8fe2a3ae298b14b80179855aeb4adc2c1934ee619" [[package]] name = "fs_extra" @@ -2017,7 +1988,7 @@ dependencies = [ [[package]] name = "gateway-client" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#ff423d49a72d77433ab659025d7a4c1be9847d07" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#e76962a5f67b8c5bf813ee24a7600634de708b35" dependencies = [ "base64 0.22.1", "chrono", @@ -2034,7 +2005,7 @@ dependencies = [ "serde", "serde_json", "slog", - "thiserror 2.0.12", + "thiserror 2.0.16", "tokio", "uuid", ] @@ -2044,7 +2015,7 @@ name = "gateway-messages" version = "0.1.0" source = "git+https://github.com/oxidecomputer/management-gateway-service?rev=77e316c812aa057b9714d0d99c4a7bdd36d45be2#77e316c812aa057b9714d0d99c4a7bdd36d45be2" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.4", "hubpack", "serde", "serde-big-array", @@ -2053,13 +2024,13 @@ dependencies = [ "strum 0.27.2", "strum_macros 0.27.2", "uuid", - "zerocopy 0.8.26", + "zerocopy 0.8.27", ] [[package]] name = "gateway-types" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#ff423d49a72d77433ab659025d7a4c1be9847d07" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#e76962a5f67b8c5bf813ee24a7600634de708b35" dependencies = [ "daft", "dropshot", @@ -2070,25 +2041,11 @@ dependencies = [ "omicron-workspace-hack", "schemars", "serde", - "thiserror 2.0.12", + "thiserror 2.0.16", "tufaceous-artifact", "uuid", ] -[[package]] -name = "generator" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "605183a538e3e2a9c1038635cc5c2d194e2ee8fd0d1b66b8349fad7dbacce5a2" -dependencies = [ - "cc", - "cfg-if", - "libc", - "log", - "rustversion", - "windows 0.60.0", -] - [[package]] name = "generic-array" version = "0.14.7" @@ -2099,29 +2056,41 @@ dependencies = [ "version_check", ] +[[package]] +name = "gethostname" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc3655aa6818d65bc620d6911f05aa7b6aeb596291e1e9f79e52df85583d1e30" +dependencies = [ + "rustix 0.38.44", + "windows-targets 0.52.6", +] + [[package]] name = "getrandom" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", "js-sys", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi 0.11.1+wasi-snapshot-preview1", "wasm-bindgen", ] [[package]] name = "getrandom" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" dependencies = [ "cfg-if", + "js-sys", "libc", - "wasi 0.13.3+wasi-0.2.2", - "windows-targets 0.52.6", + "r-efi", + "wasi 0.14.7+wasi-0.2.4", + "wasm-bindgen", ] [[package]] @@ -2136,7 +2105,7 @@ version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b903b73e45dc0c6c596f2d37eccece7c1c8bb6e4407b001096387c63d0d93724" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.4", "libc", "libgit2-sys", "log", @@ -2158,8 +2127,8 @@ dependencies = [ "aho-corasick", "bstr", "log", - "regex-automata 0.4.9", - "regex-syntax 0.8.5", + "regex-automata", + "regex-syntax", ] [[package]] @@ -2170,14 +2139,25 @@ checksum = "1b363a30c165f666402fe6a3024d3bec7ebc898f96a4a23bd1c99f8dbf3f4f47" dependencies = [ "log", "plain", - "scroll", + "scroll 0.12.0", +] + +[[package]] +name = "goblin" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6a80adfd63bd7ffd94fefc3d22167880c440a724303080e5aa686fa36abaa96" +dependencies = [ + "log", + "plain", + "scroll 0.13.0", ] [[package]] name = "h2" -version = "0.4.6" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" +checksum = "f3c0b69cfcb4e1b9f1bf2f53f95f766e4661169728ec61cd3fe5a0166f2d1386" dependencies = [ "atomic-waker", "bytes", @@ -2185,7 +2165,7 @@ dependencies = [ "futures-core", "futures-sink", "http", - "indexmap 2.10.0", + "indexmap 2.11.4", "slab", "tokio", "tokio-util", @@ -2215,17 +2195,26 @@ checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ "allocator-api2", "equivalent", - "foldhash", + "foldhash 0.1.5", ] [[package]] -name = "hdrhistogram" -version = "7.5.4" +name = "hashbrown" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "765c9198f173dd59ce26ff9f95ef0aafd0a0fe01fb9d72841bc5066a4c06511d" +checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" dependencies = [ - "base64 0.21.7", - "byteorder", + "allocator-api2", +] + +[[package]] +name = "hdrhistogram" +version = "7.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "765c9198f173dd59ce26ff9f95ef0aafd0a0fe01fb9d72841bc5066a4c06511d" +dependencies = [ + "base64 0.21.7", + "byteorder", "flate2", "nom", "num-traits", @@ -2241,15 +2230,6 @@ dependencies = [ "stable_deref_trait", ] -[[package]] -name = "heck" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" -dependencies = [ - "unicode-segmentation", -] - [[package]] name = "heck" version = "0.4.1" @@ -2264,24 +2244,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - -[[package]] -name = "hermit-abi" -version = "0.4.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" [[package]] name = "hex" @@ -2300,9 +2265,9 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "hickory-proto" -version = "0.24.1" +version = "0.24.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07698b8420e2f0d6447a436ba999ec85d8fbf2a398bbd737b82cac4a2e96e512" +checksum = "92652067c9ce6f66ce53cc38d1169daa36e6e7eb7dd3b63b5103bd9d97117248" dependencies = [ "async-trait", "cfg-if", @@ -2311,7 +2276,7 @@ dependencies = [ "futures-channel", "futures-io", "futures-util", - "idna 0.4.0", + "idna", "ipnet", "once_cell", "rand 0.8.5", @@ -2335,12 +2300,12 @@ dependencies = [ "futures-channel", "futures-io", "futures-util", - "idna 1.1.0", + "idna", "ipnet", "once_cell", "rand 0.9.2", "ring", - "thiserror 2.0.12", + "thiserror 2.0.16", "tinyvec", "tokio", "tracing", @@ -2349,13 +2314,13 @@ dependencies = [ [[package]] name = "hickory-resolver" -version = "0.24.3" +version = "0.24.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf287bde7b776e85d7188e6e5db7cf410a2f9531fe82817eb87feed034c8d14" +checksum = "cbb117a1ca520e111743ab2f6688eddee69db4e0ea242545a604dce8a66fd22e" dependencies = [ "cfg-if", "futures-util", - "hickory-proto 0.24.1", + "hickory-proto 0.24.4", "ipconfig", "lru-cache", "once_cell", @@ -2384,7 +2349,7 @@ dependencies = [ "rand 0.9.2", "resolv-conf", "smallvec", - "thiserror 2.0.12", + "thiserror 2.0.16", "tokio", "tracing", ] @@ -2395,15 +2360,6 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9040319a6910b901d5d49cbada4a99db52836a1b63228a05f7e2b7f8feef89b1" -[[package]] -name = "home" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "hostname" version = "0.3.1" @@ -2417,13 +2373,13 @@ dependencies = [ [[package]] name = "hostname" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9c7c7c8ac16c798734b8a24560c1362120597c40d5e1459f09498f8f6c8f2ba" +checksum = "a56f203cd1c76362b69e3863fd987520ac36cf70a8c92627449b2f64a8cf7d65" dependencies = [ "cfg-if", "libc", - "windows 0.52.0", + "windows-link 0.1.3", ] [[package]] @@ -2462,9 +2418,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.5" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] name = "httpdate" @@ -2495,19 +2451,20 @@ dependencies = [ [[package]] name = "humantime" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b112acc8b3adf4b107a8ec20977da0273a8c386765a3ec0229bd500a1443f9f" +checksum = "135b12329e5e3ce057a9f972339ea52bc954fe1e9358ef27f95e89716fbc5424" [[package]] name = "hyper" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" +checksum = "eb3aa54a13a0dfe7fbe3a59e0c76093041720fdc77b110cc0fc260fafb4dc51e" dependencies = [ + "atomic-waker", "bytes", "futures-channel", - "futures-util", + "futures-core", "h2", "http", "http-body", @@ -2515,6 +2472,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", + "pin-utils", "smallvec", "tokio", "want", @@ -2522,20 +2480,19 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.3" +version = "0.27.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" +checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" dependencies = [ - "futures-util", "http", "hyper", "hyper-util", - "rustls 0.23.16", + "rustls 0.23.32", "rustls-pki-types", "tokio", - "tokio-rustls 0.26.0", + "tokio-rustls 0.26.3", "tower-service", - "webpki-roots 0.26.6", + "webpki-roots", ] [[package]] @@ -2569,9 +2526,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d9b05277c7e8da2c93a568989bb6207bef0112e8d17df7a6eda4a3cf143bc5e" +checksum = "3c6995591a8f1380fcb4ba966a252a4b29188d51d2b89e3a252f5305be65aea8" dependencies = [ "base64 0.22.1", "bytes", @@ -2595,16 +2552,17 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.61" +version = "0.1.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +checksum = "33e57f83510bb73707521ebaffa789ec8caf86f9657cad665b092b581d40e9fb" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", + "log", "wasm-bindgen", - "windows-core 0.52.0", + "windows-core", ] [[package]] @@ -2705,7 +2663,7 @@ dependencies = [ [[package]] name = "id-map" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#ff423d49a72d77433ab659025d7a4c1be9847d07" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#e76962a5f67b8c5bf813ee24a7600634de708b35" dependencies = [ "daft", "derive-where", @@ -2716,19 +2674,19 @@ dependencies = [ [[package]] name = "iddqd" -version = "0.3.11" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32fdf1948b8b266e6159b301497280248f0399d2769611a7b75b4621812327b5" +checksum = "f73e38c7e0c1b237e00655516f8f633c584c0bd59ce63fedac6f49efeba15613" dependencies = [ "allocator-api2", "daft", "equivalent", - "foldhash", - "hashbrown 0.15.5", + "foldhash 0.2.0", + "hashbrown 0.16.0", "ref-cast", - "rustc-hash 2.1.1", + "rustc-hash", "schemars", - "serde", + "serde_core", "serde_json", ] @@ -2738,16 +2696,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" -[[package]] -name = "idna" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "idna" version = "1.1.0" @@ -2782,15 +2730,15 @@ dependencies = [ [[package]] name = "illumos-sys-hdrs" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/opte?rev=6a5d3f336685a2aeb291962ae7f583b9355f3022#6a5d3f336685a2aeb291962ae7f583b9355f3022" +source = "git+https://github.com/oxidecomputer/opte?rev=77f1ff9ceea1afe5733f0003f73f806b8c8c58ae#77f1ff9ceea1afe5733f0003f73f806b8c8c58ae" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.4", ] [[package]] name = "illumos-utils" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#ff423d49a72d77433ab659025d7a4c1be9847d07" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#e76962a5f67b8c5bf813ee24a7600634de708b35" dependencies = [ "anyhow", "async-trait", @@ -2820,7 +2768,7 @@ dependencies = [ "slog", "slog-error-chain", "smf 0.2.3", - "thiserror 2.0.12", + "thiserror 2.0.16", "tokio", "uuid", "whoami", @@ -2845,13 +2793,14 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.10.0" +version = "2.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" +checksum = "4b0f83760fb341a774ed326568e19f5a863af4a952def8c39f9ab92fd95b88e5" dependencies = [ "equivalent", - "hashbrown 0.15.5", + "hashbrown 0.16.0", "serde", + "serde_core", ] [[package]] @@ -2860,12 +2809,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a17a93829808685f3b6882763901d7489efc1155ad4ae568499d1b303067ca6" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.4", "ingot-macros", "ingot-types", "macaddr", "serde", - "zerocopy 0.8.26", + "zerocopy 0.8.27", ] [[package]] @@ -2874,7 +2823,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4c94e8b5b5e08b71943d585acdb6062daaeb6b19de82ebb377c7c9cbeff44bb" dependencies = [ - "darling 0.21.2", + "darling", "itertools 0.14.0", "proc-macro2", "quote", @@ -2890,7 +2839,7 @@ checksum = "2d0d55db2f1de52564cc3781ffd5a7ebb7f2c6e1888841c2fa54231a9498db5f" dependencies = [ "ingot-macros", "macaddr", - "zerocopy 0.8.26", + "zerocopy 0.8.27", ] [[package]] @@ -2905,7 +2854,7 @@ dependencies = [ [[package]] name = "internal-dns-resolver" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#ff423d49a72d77433ab659025d7a4c1be9847d07" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#e76962a5f67b8c5bf813ee24a7600634de708b35" dependencies = [ "futures", "hickory-proto 0.25.2", @@ -2917,13 +2866,13 @@ dependencies = [ "qorb", "reqwest", "slog", - "thiserror 2.0.12", + "thiserror 2.0.16", ] [[package]] name = "internal-dns-types" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#ff423d49a72d77433ab659025d7a4c1be9847d07" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#e76962a5f67b8c5bf813ee24a7600634de708b35" dependencies = [ "anyhow", "chrono", @@ -2942,11 +2891,11 @@ checksum = "fc6d6206008e25125b1f97fbe5d309eb7b85141cf9199d52dbd3729a1584dd16" [[package]] name = "io-uring" -version = "0.7.8" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b86e202f00093dcba4275d4636b93ef9dd75d025ae560d2521b45ea28ab49013" +checksum = "046fa2d4d00aea763528b4950358d0ead425372445dc8ff86312b3c69ff7727b" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.4", "cfg-if", "libc", ] @@ -2965,9 +2914,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.10.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" [[package]] name = "ipnetwork" @@ -2991,13 +2940,13 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.13" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" dependencies = [ - "hermit-abi 0.4.0", + "hermit-abi", "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -3043,9 +2992,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "jiff" @@ -3090,18 +3039,19 @@ dependencies = [ [[package]] name = "jobserver" -version = "0.1.32" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" dependencies = [ + "getrandom 0.3.3", "libc", ] [[package]] name = "js-sys" -version = "0.3.77" +version = "0.3.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +checksum = "852f13bec5eba4ba9afbeb93fd7c13fe56147f055939ae21c43a29a0ecb2702e" dependencies = [ "once_cell", "wasm-bindgen", @@ -3110,7 +3060,7 @@ dependencies = [ [[package]] name = "kstat-macro" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/opte?rev=6a5d3f336685a2aeb291962ae7f583b9355f3022#6a5d3f336685a2aeb291962ae7f583b9355f3022" +source = "git+https://github.com/oxidecomputer/opte?rev=77f1ff9ceea1afe5733f0003f73f806b8c8c58ae#77f1ff9ceea1afe5733f0003f73f806b8c8c58ae" dependencies = [ "quote", "syn 2.0.106", @@ -3132,27 +3082,21 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - [[package]] name = "libc" -version = "0.2.175" +version = "0.2.176" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" +checksum = "58f929b4d672ea937a23a1ab494143d968337a5f47e56d0815df1e0890ddf174" [[package]] name = "libdlpi-sys" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/dlpi-sys?branch=main#1d587ea98cf2d36f1b1624b0b960559c76d475d2" +source = "git+https://github.com/oxidecomputer/dlpi-sys?branch=main#555fa6e1315a64f40c72716e4d168697c03795c6" [[package]] name = "libdlpi-sys" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/dlpi-sys#8e2d840d6c0b41f3bd0066690e8d9cc8163a679f" +source = "git+https://github.com/oxidecomputer/dlpi-sys#555fa6e1315a64f40c72716e4d168697c03795c6" [[package]] name = "libgit2-sys" @@ -3178,24 +3122,24 @@ dependencies = [ [[package]] name = "libloading" -version = "0.8.5" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" +checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" dependencies = [ "cfg-if", - "windows-targets 0.52.6", + "windows-link 0.2.0", ] [[package]] name = "libm" -version = "0.2.11" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" +checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" [[package]] name = "libnet" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/netadm-sys?branch=main#3ec34ad27bf01f124cfb1f74c7729da17addce49" +source = "git+https://github.com/oxidecomputer/netadm-sys?branch=main#aeabd725ad7b4626042e536c9e3d452cd4a122bb" dependencies = [ "anyhow", "cfg-if", @@ -3203,24 +3147,24 @@ dependencies = [ "dlpi 0.2.0 (git+https://github.com/oxidecomputer/dlpi-sys)", "libc", "num_enum 0.7.4", - "nvpair", + "nvpair 0.5.0", "nvpair-sys", "oxnet", "rand 0.9.2", "rusty-doors", "socket2 0.6.0", - "thiserror 2.0.12", + "thiserror 2.0.16", "tracing", "winnow 0.7.13", ] [[package]] name = "libredox" -version = "0.1.3" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +checksum = "416f7e718bdb06000964960ffa43b4335ad4012ae8b99060261aa4a8088d5ccb" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.4", "libc", "redox_syscall", ] @@ -3257,9 +3201,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.20" +version = "1.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2d16453e800a8cf6dd2fc3eb4bc99b786a9b90c663b8559a5b1a041bf89e472" +checksum = "8b70e7a7df205e92a1a4cd9aaae7898dac0aa555503cc0a649494d0d60e7651d" dependencies = [ "cc", "libc", @@ -3281,15 +3225,15 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.14" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "linux-raw-sys" -version = "0.9.4" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" +checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" [[package]] name = "litemap" @@ -3300,11 +3244,11 @@ checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" [[package]] name = "lldpd-client" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/lldp#ffa23656a6f7ba189836f736ec68c8de8b1eec8e" +source = "git+https://github.com/oxidecomputer/lldp#4e04e870f502c4076ca16d19b4a12fa11ee14eba" dependencies = [ "chrono", - "common 0.1.0 (git+https://github.com/oxidecomputer/lldp)", "futures", + "lldpd-common", "progenitor 0.9.1", "protocol", "reqwest", @@ -3315,6 +3259,23 @@ dependencies = [ "uuid", ] +[[package]] +name = "lldpd-common" +version = "0.1.0" +source = "git+https://github.com/oxidecomputer/lldp#4e04e870f502c4076ca16d19b4a12fa11ee14eba" +dependencies = [ + "anyhow", + "dpd-client 0.1.0 (git+https://github.com/oxidecomputer/dendrite?branch=main)", + "schemars", + "serde", + "serde_json", + "slog", + "slog-async", + "slog-bunyan", + "slog-term", + "thiserror 1.0.69", +] + [[package]] name = "lock_api" version = "0.4.13" @@ -3327,22 +3288,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" - -[[package]] -name = "loom" -version = "0.7.2" +version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "419e0dc8046cb947daa77eb95ae174acfbddb7673b4151f56d1eed8e93fbfaca" -dependencies = [ - "cfg-if", - "generator", - "scoped-tls", - "tracing", - "tracing-subscriber", -] +checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" [[package]] name = "lru-cache" @@ -3353,6 +3301,12 @@ dependencies = [ "linked-hash-map", ] +[[package]] +name = "lru-slab" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" + [[package]] name = "macaddr" version = "1.0.1" @@ -3376,11 +3330,11 @@ checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" [[package]] name = "matchers" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" dependencies = [ - "regex-automata 0.1.10", + "regex-automata", ] [[package]] @@ -3391,9 +3345,9 @@ checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" [[package]] name = "memchr" -version = "2.7.4" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] name = "memmap" @@ -3407,9 +3361,9 @@ dependencies = [ [[package]] name = "memmap2" -version = "0.9.5" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f" +checksum = "843a98750cd611cc2965a8213b53b43e715f13c37a9e096c6408e69990961db7" dependencies = [ "libc", ] @@ -3426,7 +3380,7 @@ dependencies = [ [[package]] name = "mg-admin-client" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/maghemite?rev=fa5f15cdcd5864161a929e2ec01534f70dfba216#fa5f15cdcd5864161a929e2ec01534f70dfba216" +source = "git+https://github.com/oxidecomputer/maghemite?rev=e3c587a47039a6c7aff6cc53b8e72e5328d57fc0#e3c587a47039a6c7aff6cc53b8e72e5328d57fc0" dependencies = [ "anyhow", "chrono", @@ -3453,23 +3407,22 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.0" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" dependencies = [ "adler2", ] [[package]] name = "mio" -version = "1.0.2" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" dependencies = [ - "hermit-abi 0.3.9", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.52.0", + "wasi 0.11.1+wasi-snapshot-preview1", + "windows-sys 0.59.0", ] [[package]] @@ -3500,20 +3453,19 @@ dependencies = [ [[package]] name = "moka" -version = "0.12.10" +version = "0.12.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9321642ca94a4282428e6ea4af8cc2ca4eac48ac7a6a4ea8f33f76d0ce70926" +checksum = "8261cd88c312e0004c1d51baad2980c66528dfdb2bee62003e643a4d8f86b077" dependencies = [ "crossbeam-channel", "crossbeam-epoch", "crossbeam-utils", - "loom", + "equivalent", "parking_lot", "portable-atomic", "rustc_version 0.4.1", "smallvec", "tagptr", - "thiserror 1.0.69", "uuid", ] @@ -3536,9 +3488,9 @@ dependencies = [ [[package]] name = "native-tls" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" +checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" dependencies = [ "libc", "log", @@ -3562,13 +3514,12 @@ dependencies = [ [[package]] name = "newtype-uuid" -version = "1.3.0" +version = "1.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "980493932a63b13905b6732671f5295dd11c53d763c91dbde8a7a780611c9189" +checksum = "a17d82edb1c8a6c20c238747ae7aae9181133e766bc92cd2556fdd764407d0d1" dependencies = [ "schemars", "serde", - "serde_json", "uuid", ] @@ -3584,7 +3535,7 @@ dependencies = [ [[package]] name = "nexus-client" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#ff423d49a72d77433ab659025d7a4c1be9847d07" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#e76962a5f67b8c5bf813ee24a7600634de708b35" dependencies = [ "chrono", "futures", @@ -3609,7 +3560,7 @@ dependencies = [ [[package]] name = "nexus-sled-agent-shared" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#ff423d49a72d77433ab659025d7a4c1be9847d07" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#e76962a5f67b8c5bf813ee24a7600634de708b35" dependencies = [ "camino", "chrono", @@ -3627,7 +3578,7 @@ dependencies = [ "serde_json", "sled-hardware-types", "strum 0.27.2", - "thiserror 2.0.12", + "thiserror 2.0.16", "tufaceous-artifact", "uuid", ] @@ -3635,14 +3586,14 @@ dependencies = [ [[package]] name = "nexus-types" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#ff423d49a72d77433ab659025d7a4c1be9847d07" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#e76962a5f67b8c5bf813ee24a7600634de708b35" dependencies = [ "anyhow", "api_identity", "async-trait", "base64 0.22.1", "chrono", - "clap 4.5.21", + "clap", "clickhouse-admin-types", "cockroach-admin-types", "cookie", @@ -3670,12 +3621,13 @@ dependencies = [ "omicron-uuid-kinds", "omicron-workspace-hack", "openssl", + "oximeter-db", "oxnet", "oxql-types", "parse-display", "regex", "schemars", - "semver 1.0.26", + "semver 1.0.27", "serde", "serde_json", "serde_with", @@ -3684,8 +3636,8 @@ dependencies = [ "steno", "strum 0.27.2", "tabled 0.15.0", - "textwrap 0.16.2", - "thiserror 2.0.12", + "textwrap", + "thiserror 2.0.16", "tokio", "tough", "tufaceous-artifact", @@ -3697,11 +3649,11 @@ dependencies = [ [[package]] name = "nix" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.4", "cfg-if", "cfg_aliases", "libc", @@ -3718,16 +3670,6 @@ dependencies = [ "minimal-lexical", ] -[[package]] -name = "nu-ansi-term" -version = "0.46.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" -dependencies = [ - "overload", - "winapi", -] - [[package]] name = "num" version = "0.4.3" @@ -3858,7 +3800,7 @@ version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", @@ -3870,7 +3812,7 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77e878c846a8abae00dd069496dbe8751b16ac1c3d6bd2a7283a938e8228f90d" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 3.4.0", "proc-macro2", "quote", "syn 2.0.106", @@ -3885,6 +3827,15 @@ dependencies = [ "libc", ] +[[package]] +name = "nvpair" +version = "0.0.0" +source = "git+https://github.com/oxidecomputer/propolis#827e6615bfebfd94d41504dcd1517a0f22e3166a" +dependencies = [ + "libc", + "nvpair_sys", +] + [[package]] name = "nvpair" version = "0.5.0" @@ -3900,11 +3851,19 @@ name = "nvpair-sys" version = "0.4.0" source = "git+https://github.com/jmesmon/rust-libzfs?branch=master#ecd5a922247a6c5acef55d76c5b8d115572bc850" +[[package]] +name = "nvpair_sys" +version = "0.0.0" +source = "git+https://github.com/oxidecomputer/propolis#827e6615bfebfd94d41504dcd1517a0f22e3166a" +dependencies = [ + "libc", +] + [[package]] name = "object" -version = "0.36.5" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "memchr", ] @@ -3923,7 +3882,7 @@ dependencies = [ [[package]] name = "omicron-common" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#ff423d49a72d77433ab659025d7a4c1be9847d07" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#e76962a5f67b8c5bf813ee24a7600634de708b35" dependencies = [ "anyhow", "api_identity", @@ -3951,7 +3910,7 @@ dependencies = [ "regress", "reqwest", "schemars", - "semver 1.0.26", + "semver 1.0.27", "serde", "serde_human_bytes", "serde_json", @@ -3959,7 +3918,7 @@ dependencies = [ "slog", "slog-error-chain", "strum 0.27.2", - "thiserror 2.0.12", + "thiserror 2.0.16", "tokio", "tufaceous-artifact", "uuid", @@ -3968,7 +3927,7 @@ dependencies = [ [[package]] name = "omicron-passwords" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#ff423d49a72d77433ab659025d7a4c1be9847d07" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#e76962a5f67b8c5bf813ee24a7600634de708b35" dependencies = [ "argon2", "omicron-workspace-hack", @@ -3977,13 +3936,13 @@ dependencies = [ "secrecy", "serde", "serde_with", - "thiserror 2.0.12", + "thiserror 2.0.16", ] [[package]] name = "omicron-uuid-kinds" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#ff423d49a72d77433ab659025d7a4c1be9847d07" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#e76962a5f67b8c5bf813ee24a7600634de708b35" dependencies = [ "daft", "newtype-uuid", @@ -4015,7 +3974,7 @@ dependencies = [ "futures-util", "hex", "reqwest", - "semver 1.0.26", + "semver 1.0.27", "serde", "serde_derive", "serde_json", @@ -4031,21 +3990,27 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.20.2" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" dependencies = [ "critical-section", "portable-atomic", ] +[[package]] +name = "once_cell_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" + [[package]] name = "openapiv3" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c8d427828b22ae1fff2833a03d8486c2c881367f1c336349f307f321e7f4d05" dependencies = [ - "indexmap 2.10.0", + "indexmap 2.11.4", "serde", "serde_json", ] @@ -4056,7 +4021,7 @@ version = "0.10.73" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8505734d46c8ab1e19a1dce3aef597ad87dcb4c37e7188231769bd6bd51cebf8" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.4", "cfg-if", "foreign-types 0.3.2", "libc", @@ -4078,9 +4043,9 @@ dependencies = [ [[package]] name = "openssl-probe" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] name = "openssl-sys" @@ -4097,9 +4062,9 @@ dependencies = [ [[package]] name = "opte" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/opte?rev=6a5d3f336685a2aeb291962ae7f583b9355f3022#6a5d3f336685a2aeb291962ae7f583b9355f3022" +source = "git+https://github.com/oxidecomputer/opte?rev=77f1ff9ceea1afe5733f0003f73f806b8c8c58ae#77f1ff9ceea1afe5733f0003f73f806b8c8c58ae" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.4", "dyn-clone", "illumos-sys-hdrs", "ingot", @@ -4110,13 +4075,13 @@ dependencies = [ "serde", "tabwriter", "version_check", - "zerocopy 0.8.26", + "zerocopy 0.8.27", ] [[package]] name = "opte-api" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/opte?rev=6a5d3f336685a2aeb291962ae7f583b9355f3022#6a5d3f336685a2aeb291962ae7f583b9355f3022" +source = "git+https://github.com/oxidecomputer/opte?rev=77f1ff9ceea1afe5733f0003f73f806b8c8c58ae#77f1ff9ceea1afe5733f0003f73f806b8c8c58ae" dependencies = [ "illumos-sys-hdrs", "ingot", @@ -4129,7 +4094,7 @@ dependencies = [ [[package]] name = "opte-ioctl" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/opte?rev=6a5d3f336685a2aeb291962ae7f583b9355f3022#6a5d3f336685a2aeb291962ae7f583b9355f3022" +source = "git+https://github.com/oxidecomputer/opte?rev=77f1ff9ceea1afe5733f0003f73f806b8c8c58ae#77f1ff9ceea1afe5733f0003f73f806b8c8c58ae" dependencies = [ "libc", "libnet", @@ -4137,15 +4102,9 @@ dependencies = [ "oxide-vpc", "postcard", "serde", - "thiserror 2.0.12", + "thiserror 2.0.16", ] -[[package]] -name = "overload" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" - [[package]] name = "owo-colors" version = "4.2.2" @@ -4166,7 +4125,7 @@ dependencies = [ [[package]] name = "oxide-vpc" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/opte?rev=6a5d3f336685a2aeb291962ae7f583b9355f3022#6a5d3f336685a2aeb291962ae7f583b9355f3022" +source = "git+https://github.com/oxidecomputer/opte?rev=77f1ff9ceea1afe5733f0003f73f806b8c8c58ae#77f1ff9ceea1afe5733f0003f73f806b8c8c58ae" dependencies = [ "cfg-if", "illumos-sys-hdrs", @@ -4174,17 +4133,17 @@ dependencies = [ "serde", "tabwriter", "uuid", - "zerocopy 0.8.26", + "zerocopy 0.8.27", ] [[package]] name = "oximeter" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#ff423d49a72d77433ab659025d7a4c1be9847d07" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#e76962a5f67b8c5bf813ee24a7600634de708b35" dependencies = [ "anyhow", "chrono", - "clap 4.5.21", + "clap", "omicron-workspace-hack", "oximeter-macro-impl", "oximeter-schema", @@ -4196,10 +4155,63 @@ dependencies = [ "uuid", ] +[[package]] +name = "oximeter-db" +version = "0.1.0" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#e76962a5f67b8c5bf813ee24a7600634de708b35" +dependencies = [ + "anyhow", + "async-recursion", + "async-trait", + "bcs", + "bytes", + "camino", + "chrono", + "chrono-tz", + "clap", + "clickward", + "const_format", + "debug-ignore", + "dropshot", + "futures", + "gethostname", + "highway", + "iana-time-zone", + "indexmap 2.11.4", + "libc", + "nom", + "num", + "omicron-common", + "omicron-workspace-hack", + "oxide-tokio-rt", + "oximeter", + "oxql-types", + "parse-display", + "qorb", + "quote", + "regex", + "reqwest", + "schemars", + "serde", + "serde_json", + "slog", + "slog-async", + "slog-dtrace", + "slog-error-chain", + "slog-term", + "strum 0.27.2", + "termtree", + "thiserror 2.0.16", + "tokio", + "tokio-util", + "usdt 0.5.0", + "uuid", +] + [[package]] name = "oximeter-instruments" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#ff423d49a72d77433ab659025d7a4c1be9847d07" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#e76962a5f67b8c5bf813ee24a7600634de708b35" dependencies = [ "cfg-if", "chrono", @@ -4209,7 +4221,7 @@ dependencies = [ "omicron-workspace-hack", "oximeter", "slog", - "thiserror 2.0.12", + "thiserror 2.0.16", "tokio", "uuid", ] @@ -4217,7 +4229,7 @@ dependencies = [ [[package]] name = "oximeter-macro-impl" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#ff423d49a72d77433ab659025d7a4c1be9847d07" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#e76962a5f67b8c5bf813ee24a7600634de708b35" dependencies = [ "omicron-workspace-hack", "proc-macro2", @@ -4228,7 +4240,7 @@ dependencies = [ [[package]] name = "oximeter-producer" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#ff423d49a72d77433ab659025d7a4c1be9847d07" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#e76962a5f67b8c5bf813ee24a7600634de708b35" dependencies = [ "chrono", "dropshot", @@ -4242,7 +4254,7 @@ dependencies = [ "serde", "slog", "slog-dtrace", - "thiserror 2.0.12", + "thiserror 2.0.16", "tokio", "uuid", ] @@ -4250,11 +4262,11 @@ dependencies = [ [[package]] name = "oximeter-schema" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#ff423d49a72d77433ab659025d7a4c1be9847d07" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#e76962a5f67b8c5bf813ee24a7600634de708b35" dependencies = [ "anyhow", "chrono", - "clap 4.5.21", + "clap", "heck 0.5.0", "omicron-workspace-hack", "oximeter-types", @@ -4271,7 +4283,7 @@ dependencies = [ [[package]] name = "oximeter-timeseries-macro" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#ff423d49a72d77433ab659025d7a4c1be9847d07" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#e76962a5f67b8c5bf813ee24a7600634de708b35" dependencies = [ "omicron-workspace-hack", "oximeter-schema", @@ -4284,7 +4296,7 @@ dependencies = [ [[package]] name = "oximeter-types" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#ff423d49a72d77433ab659025d7a4c1be9847d07" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#e76962a5f67b8c5bf813ee24a7600634de708b35" dependencies = [ "bytes", "chrono", @@ -4297,19 +4309,19 @@ dependencies = [ "schemars", "serde", "strum 0.27.2", - "thiserror 2.0.12", + "thiserror 2.0.16", "uuid", ] [[package]] name = "oxlog" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#ff423d49a72d77433ab659025d7a4c1be9847d07" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#e76962a5f67b8c5bf813ee24a7600634de708b35" dependencies = [ "anyhow", "camino", "chrono", - "clap 4.5.21", + "clap", "glob", "jiff", "omicron-workspace-hack", @@ -4333,7 +4345,7 @@ dependencies = [ [[package]] name = "oxql-types" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#ff423d49a72d77433ab659025d7a4c1be9847d07" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#e76962a5f67b8c5bf813ee24a7600634de708b35" dependencies = [ "anyhow", "chrono", @@ -4343,23 +4355,25 @@ dependencies = [ "oximeter-types", "schemars", "serde", + "serde_json", + "uuid", ] [[package]] name = "p4rs" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/p4?branch=main#906a601bbea198bcbedf8b1dd5942d836bc3696d" +source = "git+https://github.com/oxidecomputer/p4?branch=main#c13435444832c28e0fb19bc65eaa8b431583a1cf" dependencies = [ "bitvec", "num", "serde", - "usdt 0.3.5", + "usdt 0.5.0", ] [[package]] name = "p9ds" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/p9fs#4b8362b894e8ecbb6da34e2e71d7a248918ecd8f" +source = "git+https://github.com/oxidecomputer/p9fs#113f170aff6aa1d5add00c19b3a2f3241e16a763" dependencies = [ "ispf", "num_enum 0.5.11", @@ -4395,13 +4409,13 @@ dependencies = [ [[package]] name = "papergrid" -version = "0.14.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b915f831b85d984193fdc3d3611505871dc139b2534530fa01c1a6a6707b6723" +checksum = "6978128c8b51d8f4080631ceb2302ab51e32cc6e8615f735ee2f83fd269ae3f1" dependencies = [ "bytecount", "fnv", - "unicode-width 0.2.0", + "unicode-width 0.2.1", ] [[package]] @@ -4435,7 +4449,7 @@ checksum = "287d8d3ebdce117b8539f59411e4ed9ec226e0a4153c7f55495c6070d68e6f72" dependencies = [ "parse-display-derive", "regex", - "regex-syntax 0.8.5", + "regex-syntax", ] [[package]] @@ -4447,7 +4461,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "regex-syntax 0.8.5", + "regex-syntax", "structmeta", "syn 2.0.106", ] @@ -4473,7 +4487,7 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" name = "pcap" version = "0.1.0" dependencies = [ - "bindgen 0.72.0", + "bindgen", "cc", ] @@ -4489,26 +4503,26 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.1" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "pest" -version = "2.7.14" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879952a81a83930934cbf1786752d6dedc3b1f29e8f8fb2ad1d0a36f377cf442" +checksum = "21e0a3a33733faeaf8651dfee72dd0f388f0c8e5ad496a3478fa5a922f49cfa8" dependencies = [ "memchr", - "thiserror 1.0.69", + "thiserror 2.0.16", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.7.14" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d214365f632b123a47fd913301e14c946c61d1c183ee245fa76eb752e59a02dd" +checksum = "bc58706f770acb1dbd0973e6530a3cff4746fb721207feb3a8a6064cd0b6c663" dependencies = [ "pest", "pest_generator", @@ -4516,9 +4530,9 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.14" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb55586734301717aea2ac313f50b2eb8f60d2fc3dc01d190eefa2e625f60c4e" +checksum = "6d4f36811dfe07f7b8573462465d5cb8965fffc2e71ae377a33aecf14c2c9a2f" dependencies = [ "pest", "pest_meta", @@ -4529,11 +4543,10 @@ dependencies = [ [[package]] name = "pest_meta" -version = "2.7.14" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b75da2a70cf4d9cb76833c990ac9cd3923c9a8905a8929789ce347c84564d03d" +checksum = "42919b05089acbd0a5dcd5405fb304d17d1053847b81163d09c4ad18ce8e8420" dependencies = [ - "once_cell", "pest", "sha2", ] @@ -4545,7 +4558,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset 0.4.2", - "indexmap 2.10.0", + "indexmap 2.11.4", "serde", "serde_derive", ] @@ -4558,24 +4571,42 @@ checksum = "54acf3a685220b533e437e264e4d932cfbdc4cc7ec0cd232ed73c08d03b8a7ca" dependencies = [ "fixedbitset 0.5.7", "hashbrown 0.15.5", - "indexmap 2.10.0", + "indexmap 2.11.4", "serde", ] +[[package]] +name = "phf" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "913273894cec178f401a31ec4b656318d95473527be05c0752cc41cdc32be8b7" +dependencies = [ + "phf_shared", +] + +[[package]] +name = "phf_shared" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06005508882fb681fd97892ecff4b7fd0fee13ef1aa569f8695dae7ab9099981" +dependencies = [ + "siphasher", +] + [[package]] name = "pin-project" -version = "1.1.7" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" +checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.7" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" +checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", @@ -4584,9 +4615,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -4596,9 +4627,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "plain" @@ -4623,9 +4654,9 @@ dependencies = [ [[package]] name = "postcard" -version = "1.0.10" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f7f0a8d620d71c457dd1d47df76bb18960378da56af4527aaa10f515eee732e" +checksum = "6764c3b5dd454e283a30e6dfe78e9b31096d9e32036b5d1eaac7a6119ccb9a24" dependencies = [ "cobs", "embedded-io 0.4.0", @@ -4635,9 +4666,9 @@ dependencies = [ [[package]] name = "potential_utf" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" +checksum = "84df19adbe5b5a0782edcab45899906947ab039ccf4573713735ee7de1e6b08a" dependencies = [ "zerovec", ] @@ -4650,18 +4681,18 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.20" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" dependencies = [ - "zerocopy 0.7.35", + "zerocopy 0.8.27", ] [[package]] name = "predicates" -version = "3.1.2" +version = "3.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e9086cc7640c29a356d1a29fd134380bee9d8f79a17410aa76e7ad295f42c97" +checksum = "a5d19ee57562043d37e82899fade9a22ebab7be9cef5026b07fda9cdd4293573" dependencies = [ "anstyle", "predicates-core", @@ -4669,26 +4700,20 @@ dependencies = [ [[package]] name = "predicates-core" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae8177bee8e75d6846599c6b9ff679ed51e882816914eec639944d7c9aa11931" +checksum = "727e462b119fe9c93fd0eb1429a5f7647394014cf3c04ab2c0350eeb09095ffa" [[package]] name = "predicates-tree" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41b740d195ed3166cd147c8047ec98db0e22ec019eb8eeb76d343b795304fb13" +checksum = "72dd2d6d381dfb73a193c7fca536518d7caee39fc8503f74e7dc0be0531b425c" dependencies = [ "predicates-core", "termtree", ] -[[package]] -name = "pretty-hex" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5c99d529f0d30937f6f4b8a86d988047327bb88d04d2c4afc356de74722131" - [[package]] name = "pretty-hex" version = "0.4.1" @@ -4725,6 +4750,15 @@ dependencies = [ "toml_edit 0.19.15", ] +[[package]] +name = "proc-macro-crate" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "219cb19e96be00ab2e37d6e299658a0cfa83e52429179969b0f0121b4ac46983" +dependencies = [ + "toml_edit 0.23.6", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -4804,13 +4838,13 @@ dependencies = [ [[package]] name = "progenitor" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7b99ef43fdd69d70aa4df8869db24b10ac704a2dbbc387ffac51944a1f3c0a8" +checksum = "135a23fcb9ad36a46ef4be323d006e195ad5121779c9da64ef95cf0600771b77" dependencies = [ - "progenitor-client 0.11.0", - "progenitor-impl 0.11.0", - "progenitor-macro 0.11.0", + "progenitor-client 0.11.1", + "progenitor-impl 0.11.1", + "progenitor-macro 0.11.1", ] [[package]] @@ -4845,9 +4879,9 @@ dependencies = [ [[package]] name = "progenitor-client" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3832a961a5f1b0b5a5ccda5fbf67cae2ba708f6add667401007764ba504ffebf" +checksum = "920f044db9ec07a3339175729794d3701e11d338dcf8cfd946df838102307780" dependencies = [ "bytes", "futures-core", @@ -4866,7 +4900,7 @@ checksum = "37adc80a94c9cae890e82deeeecc9d8f2a5cb153256caaf1bf0f03611e537214" dependencies = [ "heck 0.5.0", "http", - "indexmap 2.10.0", + "indexmap 2.11.4", "openapiv3", "proc-macro2", "quote", @@ -4875,7 +4909,7 @@ dependencies = [ "serde", "serde_json", "syn 2.0.106", - "thiserror 2.0.12", + "thiserror 2.0.16", "typify 0.3.0", "unicode-ident", ] @@ -4888,7 +4922,7 @@ checksum = "b17e5363daa50bf1cccfade6b0fb970d2278758fd5cfa9ab69f25028e4b1afa3" dependencies = [ "heck 0.5.0", "http", - "indexmap 2.10.0", + "indexmap 2.11.4", "openapiv3", "proc-macro2", "quote", @@ -4897,20 +4931,20 @@ dependencies = [ "serde", "serde_json", "syn 2.0.106", - "thiserror 2.0.12", + "thiserror 2.0.16", "typify 0.4.3", "unicode-ident", ] [[package]] name = "progenitor-impl" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7646201b823e61712dd72f37428ceecaa8fb2a6c841e5d7cf909edb9a17f5677" +checksum = "8276d558f1dfd4cc7fc4cceee0a51dab482b5a4be2e69e7eab8c57fbfb1472f4" dependencies = [ "heck 0.5.0", "http", - "indexmap 2.10.0", + "indexmap 2.11.4", "openapiv3", "proc-macro2", "quote", @@ -4919,7 +4953,7 @@ dependencies = [ "serde", "serde_json", "syn 2.0.106", - "thiserror 2.0.12", + "thiserror 2.0.16", "typify 0.4.3", "unicode-ident", ] @@ -4937,7 +4971,7 @@ dependencies = [ "schemars", "serde", "serde_json", - "serde_tokenstream 0.2.2", + "serde_tokenstream", "serde_yaml", "syn 2.0.106", ] @@ -4955,25 +4989,25 @@ dependencies = [ "schemars", "serde", "serde_json", - "serde_tokenstream 0.2.2", + "serde_tokenstream", "serde_yaml", "syn 2.0.106", ] [[package]] name = "progenitor-macro" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e710a11140d9b4241b7d8a90748f6125b6796d7a1205238eddb08dc790ce3830" +checksum = "5dd79317ec8ab905738484d2744d368beee6e357fc043944d985f85a0174f1f7" dependencies = [ "openapiv3", "proc-macro2", - "progenitor-impl 0.11.0", + "progenitor-impl 0.11.1", "quote", "schemars", "serde", "serde_json", - "serde_tokenstream 0.2.2", + "serde_tokenstream", "serde_yaml", "syn 2.0.106", ] @@ -4981,12 +5015,12 @@ dependencies = [ [[package]] name = "propolis" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/propolis#aadc0998c0f07f08ab15a95c006074291734800f" +source = "git+https://github.com/oxidecomputer/propolis#827e6615bfebfd94d41504dcd1517a0f22e3166a" dependencies = [ "anyhow", "async-trait", "bhyve_api 0.0.0 (git+https://github.com/oxidecomputer/propolis)", - "bitflags 2.9.2", + "bitflags 2.9.4", "bitstruct", "byteorder", "cpuid_utils", @@ -5001,7 +5035,7 @@ dependencies = [ "p9ds", "pin-project-lite", "propolis_types", - "rand 0.8.5", + "rand 0.9.2", "rfb", "rgb_frame", "serde", @@ -5015,13 +5049,13 @@ dependencies = [ "usdt 0.5.0", "uuid", "viona_api", - "zerocopy 0.7.35", + "zerocopy 0.8.27", ] [[package]] name = "propolis_types" version = "0.0.0" -source = "git+https://github.com/oxidecomputer/propolis#aadc0998c0f07f08ab15a95c006074291734800f" +source = "git+https://github.com/oxidecomputer/propolis#827e6615bfebfd94d41504dcd1517a0f22e3166a" dependencies = [ "schemars", "serde", @@ -5029,19 +5063,19 @@ dependencies = [ [[package]] name = "proptest" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fcdab19deb5195a31cf7726a210015ff1496ba1464fd42cb4f537b8b01b471f" +checksum = "2bb0be07becd10686a0bb407298fb425360a5c44a663774406340c59a22de4ce" dependencies = [ "bit-set", "bit-vec", - "bitflags 2.9.2", + "bitflags 2.9.4", "lazy_static", "num-traits", "rand 0.9.2", "rand_chacha 0.9.0", "rand_xorshift", - "regex-syntax 0.8.5", + "regex-syntax", "rusty-fork", "tempfile", "unarray", @@ -5049,9 +5083,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.13.4" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c0fef6c4230e4ccf618a35c59d7ede15dea37de8427500f50aff708806e42ec" +checksum = "2796faa41db3ec313a31f7624d9286acf277b52de526150b7e69f3debf891ee5" dependencies = [ "bytes", "prost-derive", @@ -5059,12 +5093,12 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.13.4" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "157c5a9d7ea5c2ed2d9fb8f495b64759f7816c7eaea54ba3978f0d63000162e3" +checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d" dependencies = [ "anyhow", - "itertools 0.13.0", + "itertools 0.14.0", "proc-macro2", "quote", "syn 2.0.106", @@ -5072,9 +5106,9 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.13.4" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2f1e56baa61e93533aebc21af4d2134b70f66275e0fcdf3cbe43d77ff7e8fc" +checksum = "52c2c1bf36ddb1a1c396b3601a3cec27c2462e45f07c386894ec3ccf5332bd16" dependencies = [ "prost", ] @@ -5082,7 +5116,7 @@ dependencies = [ [[package]] name = "protocol" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/lldp#ffa23656a6f7ba189836f736ec68c8de8b1eec8e" +source = "git+https://github.com/oxidecomputer/lldp#4e04e870f502c4076ca16d19b4a12fa11ee14eba" dependencies = [ "anyhow", "schemars", @@ -5101,10 +5135,10 @@ dependencies = [ "debug-ignore", "derive-where", "futures", - "hickory-resolver 0.24.3", + "hickory-resolver 0.24.4", "rand 0.9.2", "serde", - "thiserror 2.0.12", + "thiserror 2.0.16", "tokio", "tokio-stream", "tracing", @@ -5119,37 +5153,40 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quinn" -version = "0.11.6" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62e96808277ec6f97351a2380e6c25114bc9e67037775464979f3037c92d05ef" +checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" dependencies = [ "bytes", + "cfg_aliases", "pin-project-lite", "quinn-proto", "quinn-udp", - "rustc-hash 2.1.1", - "rustls 0.23.16", - "socket2 0.5.10", - "thiserror 2.0.12", + "rustc-hash", + "rustls 0.23.32", + "socket2 0.6.0", + "thiserror 2.0.16", "tokio", "tracing", + "web-time", ] [[package]] name = "quinn-proto" -version = "0.11.9" +version = "0.11.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2fe5ef3495d7d2e377ff17b1a8ce2ee2ec2a18cde8b6ad6619d65d0701c135d" +checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31" dependencies = [ "bytes", - "getrandom 0.2.15", - "rand 0.8.5", + "getrandom 0.3.3", + "lru-slab", + "rand 0.9.2", "ring", - "rustc-hash 2.1.1", - "rustls 0.23.16", + "rustc-hash", + "rustls 0.23.32", "rustls-pki-types", "slab", - "thiserror 2.0.12", + "thiserror 2.0.16", "tinyvec", "tracing", "web-time", @@ -5157,16 +5194,16 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.7" +version = "0.5.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d5a626c6807713b15cac82a6acaccd6043c9a5408c24baae07611fec3f243da" +checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" dependencies = [ "cfg_aliases", "libc", "once_cell", - "socket2 0.5.10", + "socket2 0.6.0", "tracing", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] @@ -5178,6 +5215,12 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + [[package]] name = "radium" version = "0.7.0" @@ -5231,7 +5274,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.16", ] [[package]] @@ -5240,7 +5283,7 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" dependencies = [ - "getrandom 0.3.1", + "getrandom 0.3.3", ] [[package]] @@ -5274,11 +5317,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.7" +version = "0.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" +checksum = "5407465600fb0548f1442edf71dd20683c6ed326200ace4b1ef0763521bb3b77" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.4", ] [[package]] @@ -5303,47 +5346,32 @@ dependencies = [ [[package]] name = "regex" -version = "1.11.1" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +checksum = "23d7fd106d8c02486a8d64e778353d1cffe08ce79ac2e82f540c86d0facf6912" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.9", - "regex-syntax 0.8.5", + "regex-automata", + "regex-syntax", ] [[package]] name = "regex-automata" -version = "0.1.10" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" -dependencies = [ - "regex-syntax 0.6.29", -] - -[[package]] -name = "regex-automata" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +checksum = "6b9458fa0bfeeac22b5ca447c63aaf45f28439a709ccd244698632f9aa6394d6" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.5", + "regex-syntax", ] [[package]] name = "regex-syntax" -version = "0.6.29" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - -[[package]] -name = "regex-syntax" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" +checksum = "caf4aa5b0f434c91fe5c7f1ecb6a5ece2130b02ad2a590589dda5146df959001" [[package]] name = "regress" @@ -5381,7 +5409,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn", - "rustls 0.23.16", + "rustls 0.23.32", "rustls-pki-types", "serde", "serde_json", @@ -5389,7 +5417,7 @@ dependencies = [ "sync_wrapper", "tokio", "tokio-native-tls", - "tokio-rustls 0.26.0", + "tokio-rustls 0.26.3", "tokio-util", "tower 0.5.2", "tower-http", @@ -5399,39 +5427,35 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", - "webpki-roots 1.0.2", + "webpki-roots", ] [[package]] name = "resolv-conf" -version = "0.7.0" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" -dependencies = [ - "hostname 0.3.1", - "quick-error", -] +checksum = "6b3789b30bd25ba102de4beabd95d21ac45b69b1be7d14522bab988c526d6799" [[package]] name = "rfb" version = "0.0.0" -source = "git+https://github.com/oxidecomputer/propolis#aadc0998c0f07f08ab15a95c006074291734800f" +source = "git+https://github.com/oxidecomputer/propolis#827e6615bfebfd94d41504dcd1517a0f22e3166a" dependencies = [ "ascii", - "bitflags 2.9.2", + "bitflags 2.9.4", "futures", "rgb_frame", "strum 0.26.3", "thiserror 1.0.69", "tokio", "tokio-util", - "zerocopy 0.7.35", + "zerocopy 0.8.27", ] [[package]] name = "rgb_frame" version = "0.0.0" -source = "git+https://github.com/oxidecomputer/propolis#aadc0998c0f07f08ab15a95c006074291734800f" +source = "git+https://github.com/oxidecomputer/propolis#827e6615bfebfd94d41504dcd1517a0f22e3166a" dependencies = [ "strum 0.26.3", ] @@ -5444,7 +5468,7 @@ checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ "cc", "cfg-if", - "getrandom 0.2.15", + "getrandom 0.2.16", "libc", "untrusted 0.9.0", "windows-sys 0.52.0", @@ -5452,15 +5476,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" - -[[package]] -name = "rustc-hash" -version = "1.1.0" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" [[package]] name = "rustc-hash" @@ -5483,33 +5501,33 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.26", + "semver 1.0.27", ] [[package]] name = "rustix" -version = "0.38.40" +version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99e4ea3e1cdc4b559b8e5650f9c8e5998e3e5c1343b4eaf034565f32318d63c0" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.4", "errno", "libc", - "linux-raw-sys 0.4.14", - "windows-sys 0.52.0", + "linux-raw-sys 0.4.15", + "windows-sys 0.59.0", ] [[package]] name = "rustix" -version = "1.0.8" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11181fbabf243db407ef8df94a6ce0b2f9a733bd8be4ad02b4eda9602296cac8" +checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.4", "errno", "libc", - "linux-raw-sys 0.9.4", - "windows-sys 0.59.0", + "linux-raw-sys 0.11.0", + "windows-sys 0.61.0", ] [[package]] @@ -5521,23 +5539,23 @@ dependencies = [ "log", "ring", "rustls-pki-types", - "rustls-webpki", + "rustls-webpki 0.102.8", "subtle", "zeroize", ] [[package]] name = "rustls" -version = "0.23.16" +version = "0.23.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eee87ff5d9b36712a58574e12e9f0ea80f915a5b0ac518d322b24a465617925e" +checksum = "cd3c25631629d034ce7cd9940adc9d45762d46de2b0f57193c4443b92c6d4d40" dependencies = [ "aws-lc-rs", "log", "once_cell", "ring", "rustls-pki-types", - "rustls-webpki", + "rustls-webpki 0.103.6", "subtle", "zeroize", ] @@ -5553,11 +5571,12 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.10.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" +checksum = "229a4a4c221013e7e1f1a043678c5cc39fe5171437c88fb47151a21e6f5b5c79" dependencies = [ "web-time", + "zeroize", ] [[package]] @@ -5565,6 +5584,17 @@ name = "rustls-webpki" version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted 0.9.0", +] + +[[package]] +name = "rustls-webpki" +version = "0.103.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8572f3c2cb9934231157b45499fc41e1f58c589fdfb81a844ba873265e80f8eb" dependencies = [ "aws-lc-rs", "ring", @@ -5574,9 +5604,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.18" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" [[package]] name = "rusty-doors" @@ -5610,9 +5640,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "same-file" @@ -5625,11 +5655,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.26" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" +checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.61.0", ] [[package]] @@ -5642,7 +5672,7 @@ dependencies = [ "chrono", "dyn-clone", "schemars_derive", - "semver 1.0.26", + "semver 1.0.27", "serde", "serde_json", "url", @@ -5661,12 +5691,6 @@ dependencies = [ "syn 2.0.106", ] -[[package]] -name = "scoped-tls" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" - [[package]] name = "scopeguard" version = "1.2.0" @@ -5679,14 +5703,34 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ab8598aa408498679922eff7fa985c25d58a90771bd6be794434c5277eab1a6" dependencies = [ - "scroll_derive", + "scroll_derive 0.12.1", +] + +[[package]] +name = "scroll" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1257cd4248b4132760d6524d6dda4e053bc648c9070b960929bf50cfb1e7add" +dependencies = [ + "scroll_derive 0.13.1", ] [[package]] name = "scroll_derive" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f81c2fde025af7e69b1d1420531c8a8811ca898919db177141a85313b1cb932" +checksum = "1783eabc414609e28a5ba76aee5ddd52199f7107a0b24c2e9746a1ecc34a683d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "scroll_derive" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed76efe62313ab6610570951494bdaa81568026e0318eaa55f167de70eeea67d" dependencies = [ "proc-macro2", "quote", @@ -5714,7 +5758,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.4", "core-foundation", "core-foundation-sys", "libc", @@ -5723,9 +5767,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.12.1" +version = "2.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa39c7303dc58b5543c94d22c1766b0d31f2ee58306363ea622b10bbc075eaa2" +checksum = "cc1f0cbffaac4852523ce30d8bd3c5cdc873501d96ff467ca09b6767bb8cd5c0" dependencies = [ "core-foundation-sys", "libc", @@ -5739,19 +5783,21 @@ checksum = "d4f410fedcf71af0345d7607d246e7ad15faaadd49d240ee3b24e5dc21a820ac" [[package]] name = "semver" -version = "1.0.26" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" +checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" dependencies = [ "serde", + "serde_core", ] [[package]] name = "serde" -version = "1.0.219" +version = "1.0.226" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +checksum = "0dca6411025b24b60bfa7ec1fe1f8e710ac09782dca409ee8237ba74b51295fd" dependencies = [ + "serde_core", "serde_derive", ] @@ -5773,11 +5819,20 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_core" +version = "1.0.226" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba2ba63999edb9dac981fb34b3e5c0d111a69b0924e253ed29d83f7c99e966a4" +dependencies = [ + "serde_derive", +] + [[package]] name = "serde_derive" -version = "1.0.219" +version = "1.0.226" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +checksum = "8db53ae22f34573731bafa1db20f04027b2d25e02d8205921b569171699cdb33" dependencies = [ "proc-macro2", "quote", @@ -5806,24 +5861,26 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.143" +version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d401abef1d108fbd9cbaebc3e46611f4b1021f714a0597a71f41ee463f5f4a5a" +checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" dependencies = [ "itoa", "memchr", "ryu", "serde", + "serde_core", ] [[package]] name = "serde_path_to_error" -version = "0.1.17" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59fab13f937fa393d08645bf3a84bdfe86e296747b506ada67bb15f10f218b2a" +checksum = "10a9ff822e371bb5403e391ecd83e182e0e77ba7f6fe0160b795797109d1b457" dependencies = [ "itoa", "serde", + "serde_core", ] [[package]] @@ -5837,9 +5894,9 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.19" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" +checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" dependencies = [ "proc-macro2", "quote", @@ -5857,22 +5914,11 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40734c41988f7306bb04f0ecf60ec0f3f1caa34290e4e8ea471dcd3346483b83" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_tokenstream" -version = "0.1.7" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "797ba1d80299b264f3aac68ab5d12e5825a561749db4df7cd7c8083900c5d4e9" +checksum = "5417783452c2be558477e104686f7de5dae53dba813c28435e0e70f82d9b04ee" dependencies = [ - "proc-macro2", - "serde", - "syn 1.0.109", + "serde_core", ] [[package]] @@ -5901,9 +5947,9 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.14.0" +version = "3.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2c45cd61fefa9db6f254525d46e392b852e0e61d9a1fd36e5bd183450a556d5" +checksum = "c522100790450cf78eeac1507263d0a350d4d5b30df0c8e1fe051a10c22b376e" dependencies = [ "base64 0.22.1", "chrono", @@ -5917,11 +5963,11 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.14.0" +version = "3.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de90945e6565ce0d9a25098082ed4ee4002e047cb59892c318d66821e14bb30f" +checksum = "327ada00f7d64abaac1e55a6911e90cf665aa051b9a561c7006c157f4633135e" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", "syn 2.0.106", @@ -5933,7 +5979,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.10.0", + "indexmap 2.11.4", "itoa", "ryu", "serde", @@ -5953,9 +5999,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.8" +version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ "cfg-if", "cpufeatures", @@ -5989,9 +6035,9 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.2" +version = "1.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +checksum = "b2a4719bff48cee6b39d12c020eeb490953ad2443b7055bd0b21fca26bd8c28b" dependencies = [ "libc", ] @@ -6019,23 +6065,26 @@ dependencies = [ [[package]] name = "similar" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1de1d4f81173b03af4c0cbed3c898f6bff5b870e4a7f5d6f4057d62a7a4b686e" +checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" + +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" [[package]] name = "slab" -version = "0.4.9" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] +checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" [[package]] name = "sled-hardware-types" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#ff423d49a72d77433ab659025d7a4c1be9847d07" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#e76962a5f67b8c5bf813ee24a7600634de708b35" dependencies = [ "illumos-utils", "omicron-common", @@ -6135,9 +6184,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.2" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "smawk" @@ -6174,16 +6223,16 @@ dependencies = [ "bitflags 1.3.2", "byteorder", "cfg-if", - "defmt", + "defmt 0.3.100", "heapless", "managed", ] [[package]] name = "snafu" -version = "0.8.7" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0062a372b26c4a6e9155d099a3416d732514fd47ae2f235b3695b820afcee74a" +checksum = "6e84b3f4eacbf3a1ce05eac6763b4d629d60cbc94d632e4092c54ade71f1e1a2" dependencies = [ "futures-core", "pin-project", @@ -6192,9 +6241,9 @@ dependencies = [ [[package]] name = "snafu-derive" -version = "0.8.7" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e5fd9e3263fc19d73abd5107dbd4d43e37949212d2b15d4d334ee5db53022b8" +checksum = "c1c97747dbf44bb1ca44a561ece23508e99cb592e862f22222dcf42f51d1e451" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -6225,7 +6274,7 @@ dependencies = [ [[package]] name = "softnpu" version = "0.2.0" -source = "git+https://github.com/oxidecomputer/softnpu?branch=main#b016b192ed6bb7e2ebee024f48263f627bade5a4" +source = "git+https://github.com/oxidecomputer/softnpu?branch=main#7e015d167a914777bc21434d1c61f205f22993b1" dependencies = [ "p4rs", "serde", @@ -6236,7 +6285,7 @@ dependencies = [ [[package]] name = "softnpu" version = "0.2.0" -source = "git+https://github.com/oxidecomputer/softnpu#b016b192ed6bb7e2ebee024f48263f627bade5a4" +source = "git+https://github.com/oxidecomputer/softnpu#7e015d167a914777bc21434d1c61f205f22993b1" dependencies = [ "p4rs", "serde", @@ -6284,12 +6333,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "strsim" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" - [[package]] name = "strsim" version = "0.11.1" @@ -6319,30 +6362,6 @@ dependencies = [ "syn 2.0.106", ] -[[package]] -name = "structopt" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c6b5c64445ba8094a6ab0c3cd2ad323e07171012d9c98b0b15651daf1787a10" -dependencies = [ - "clap 2.34.0", - "lazy_static", - "structopt-derive", -] - -[[package]] -name = "structopt-derive" -version = "0.4.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcb5ae327f9cc13b68763b5749770cb9e048a99bd9dfdfa58d0cf05d5f64afe0" -dependencies = [ - "heck 0.3.3", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "strum" version = "0.26.3" @@ -6398,6 +6417,7 @@ version = "0.1.0" dependencies = [ "anyhow", "chrono", + "clap", "colored 2.2.0", "common 0.1.0", "dpd-client 0.1.0", @@ -6405,7 +6425,6 @@ dependencies = [ "oxide-tokio-rt", "oxnet", "slog", - "structopt", "tabwriter", "tokio", ] @@ -6440,30 +6459,18 @@ dependencies = [ [[package]] name = "sync_wrapper" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" dependencies = [ "futures-core", ] [[package]] name = "synstructure" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "unicode-xid", -] - -[[package]] -name = "synstructure" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", @@ -6476,7 +6483,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.4", "core-foundation", "system-configuration-sys", ] @@ -6504,12 +6511,13 @@ dependencies = [ [[package]] name = "tabled" -version = "0.18.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "121d8171ee5687a4978d1b244f7d99c43e7385a272185a2f1e1fa4dc0979d444" +checksum = "e39a2ee1fbcd360805a771e1b300f78cc88fec7b8d3e2f71cd37bbf23e725c7d" dependencies = [ - "papergrid 0.14.0", - "tabled_derive 0.10.0", + "papergrid 0.17.0", + "tabled_derive 0.11.0", + "testing_table", ] [[package]] @@ -6527,9 +6535,9 @@ dependencies = [ [[package]] name = "tabled_derive" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52d9946811baad81710ec921809e2af67ad77719418673b2a3794932d57b7538" +checksum = "0ea5d1b13ca6cff1f9231ffd62f15eefd72543dab5e468735f1a456728a02846" dependencies = [ "heck 0.5.0", "proc-macro-error2", @@ -6544,7 +6552,7 @@ version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fce91f2f0ec87dff7e6bcbbeb267439aa1188703003c6055193c821487400432" dependencies = [ - "unicode-width 0.2.0", + "unicode-width 0.2.1", ] [[package]] @@ -6567,9 +6575,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tar" -version = "0.4.43" +version = "0.4.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c65998313f8e17d0d553d28f91a0df93e4dbbbf770279c7bc21ca0f09ea1a1f6" +checksum = "1d863878d212c87a19c1a610eb53bb01fe12951c0501cf5a0d65f724914a667a" dependencies = [ "filetime", "libc", @@ -6578,41 +6586,41 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.21.0" +version = "3.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15b61f8f20e3a6f7e0649d825294eaf317edce30f82cf6026e7e4cb9222a7d1e" +checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16" dependencies = [ "fastrand", - "getrandom 0.3.1", + "getrandom 0.3.3", "once_cell", - "rustix 1.0.8", - "windows-sys 0.59.0", + "rustix 1.1.2", + "windows-sys 0.61.0", ] [[package]] name = "term" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a43bddab41f8626c7bdaab872bbba75f8df5847b516d77c569c746e2ae5eb746" +checksum = "2111ef44dae28680ae9752bb89409e7310ca33a8c621ebe7b106cf5c928b3ac0" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.61.0", ] [[package]] name = "terminal_size" -version = "0.4.0" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f599bd7ca042cfdf8f4512b277c02ba102247820f9d9d4a9f521f496751a6ef" +checksum = "60b8cb979cb11c32ce1603f8137b22262a9d131aaa5c37b5678025f22b8becd0" dependencies = [ - "rustix 0.38.40", - "windows-sys 0.59.0", + "rustix 1.1.2", + "windows-sys 0.60.2", ] [[package]] name = "termtree" -version = "0.4.1" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" +checksum = "8f50febec83f5ee1df3015341d8bd429f2d1cc62bcba7ea2076759d315084683" [[package]] name = "test-strategy" @@ -6628,12 +6636,12 @@ dependencies = [ ] [[package]] -name = "textwrap" -version = "0.11.0" +name = "testing_table" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +checksum = "0f8daae29995a24f65619e19d8d31dea5b389f3d853d8bf297bbf607cd0014cc" dependencies = [ - "unicode-width 0.1.14", + "unicode-width 0.2.1", ] [[package]] @@ -6645,7 +6653,7 @@ dependencies = [ "smawk", "terminal_size", "unicode-linebreak", - "unicode-width 0.2.0", + "unicode-width 0.2.1", ] [[package]] @@ -6655,6 +6663,7 @@ dependencies = [ "anyhow", "cc", "chrono", + "clap", "common 0.1.0", "csv", "dpd-client 0.1.0", @@ -6680,7 +6689,6 @@ dependencies = [ "slog", "smf 0.10.0", "socket2 0.6.0", - "structopt", "thiserror 1.0.69", "tokio", "uuid", @@ -6697,11 +6705,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.12" +version = "2.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +checksum = "3467d614147380f2e4e374161426ff399c91084acd2363eaf549172b3d5e60c0" dependencies = [ - "thiserror-impl 2.0.12", + "thiserror-impl 2.0.16", ] [[package]] @@ -6717,9 +6725,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.12" +version = "2.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +checksum = "6c5e1be1c48b9172ee610da68fd9cd2770e7a4056cb3fc98710ee6906f0c7960" dependencies = [ "proc-macro2", "quote", @@ -6736,21 +6744,30 @@ dependencies = [ "winapi", ] +[[package]] +name = "thread-id" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99043e46c5a15af379c06add30d9c93a6c0e8849de00d244c4a2c417da128d80" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + [[package]] name = "thread_local" -version = "1.1.8" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" dependencies = [ "cfg-if", - "once_cell", ] [[package]] name = "time" -version = "0.3.36" +version = "0.3.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +checksum = "91e7d9e3bb61134e77bde20dd4825b97c010155709965fedf0f49bb138e52a9d" dependencies = [ "deranged", "itoa", @@ -6765,15 +6782,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.2" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" +checksum = "40868e7c1d2f0b8d73e4a8c7f0ff63af4f6d19be117e90bd73eb1d62cf831c6b" [[package]] name = "time-macros" -version = "0.2.18" +version = "0.2.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +checksum = "30cfb0125f12d9c277f35663a0a33f8c30190f4e4574868a330595412d34ebf3" dependencies = [ "num-conv", "time-core", @@ -6791,9 +6808,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" dependencies = [ "tinyvec_macros", ] @@ -6841,7 +6858,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f5eb4bcf85c373ff09a8beb87a477c2df185cd8842a770386a88bc3ff7ac5abb" dependencies = [ - "thiserror 2.0.12", + "thiserror 2.0.16", "tokio", "usdt 0.5.0", ] @@ -6880,20 +6897,19 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.26.0" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +checksum = "05f63835928ca123f1bef57abbcd23bb2ba0ac9ae1235f1e65bda0d06e7786bd" dependencies = [ - "rustls 0.23.16", - "rustls-pki-types", + "rustls 0.23.32", "tokio", ] [[package]] name = "tokio-stream" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" dependencies = [ "futures-core", "pin-project-lite", @@ -6903,14 +6919,15 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.12" +version = "0.7.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" +checksum = "14307c986784f72ef81c89db7d9e28d6ac26d16213b109ea501696195e6e3ce5" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", + "slab", "tokio", ] @@ -6940,14 +6957,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.9.5" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75129e1dc5000bfbaa9fee9d1b21f974f9fbad9daec557a521ee6e080825f6e8" +checksum = "00e5e5d9bf2475ac9d4f0d9edab68cc573dc2fd644b0dba36b0c30a92dd9eaa0" dependencies = [ - "indexmap 2.10.0", - "serde", - "serde_spanned 1.0.0", - "toml_datetime 0.7.0", + "indexmap 2.11.4", + "serde_core", + "serde_spanned 1.0.2", + "toml_datetime 0.7.2", "toml_parser", "toml_writer", "winnow 0.7.13", @@ -6964,11 +6981,11 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bade1c3e902f58d73d3f294cd7f20391c1cb2fbcb643b73566bc773971df91e3" +checksum = "32f1085dec27c2b6632b04c80b3bb1b4300d6495d1e129693bdda7d91e72eec1" dependencies = [ - "serde", + "serde_core", ] [[package]] @@ -6977,7 +6994,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.10.0", + "indexmap 2.11.4", "serde", "serde_spanned 0.6.9", "toml_datetime 0.6.11", @@ -6990,7 +7007,7 @@ version = "0.22.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" dependencies = [ - "indexmap 2.10.0", + "indexmap 2.11.4", "serde", "serde_spanned 0.6.9", "toml_datetime 0.6.11", @@ -6998,11 +7015,23 @@ dependencies = [ "winnow 0.7.13", ] +[[package]] +name = "toml_edit" +version = "0.23.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3effe7c0e86fdff4f69cdd2ccc1b96f933e24811c5441d44904e8683e27184b" +dependencies = [ + "indexmap 2.11.4", + "toml_datetime 0.7.2", + "toml_parser", + "winnow 0.7.13", +] + [[package]] name = "toml_parser" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b551886f449aa90d4fe2bdaa9f4a2577ad2dde302c61ecf262d80b116db95c10" +checksum = "4cf893c33be71572e0e9aa6dd15e6677937abd686b066eac3f8cd3531688a627" dependencies = [ "winnow 0.7.13", ] @@ -7015,9 +7044,9 @@ checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" [[package]] name = "toml_writer" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc842091f2def52017664b53082ecbbeb5c7731092bad69d2c63050401dfd64" +checksum = "d163a63c116ce562a22cda521fcc4d79152e7aba014456fb5eb442f6d6a10109" [[package]] name = "tonic" @@ -7076,7 +7105,7 @@ dependencies = [ "pem", "percent-encoding", "reqwest", - "rustls 0.23.16", + "rustls 0.23.32", "serde", "serde_json", "serde_plain", @@ -7131,7 +7160,7 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.4", "bytes", "futures-util", "http", @@ -7157,9 +7186,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "pin-project-lite", "tracing-attributes", @@ -7168,9 +7197,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" dependencies = [ "proc-macro2", "quote", @@ -7179,50 +7208,36 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" dependencies = [ "once_cell", "valuable", ] -[[package]] -name = "tracing-log" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" -dependencies = [ - "log", - "once_cell", - "tracing-core", -] - [[package]] name = "tracing-subscriber" -version = "0.3.18" +version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +checksum = "2054a14f5307d601f88daf0553e1cbf472acc4f2c51afab632431cdcd72124d5" dependencies = [ "matchers", - "nu-ansi-term", "once_cell", - "regex", + "regex-automata", "sharded-slab", - "smallvec", "thread_local", "tracing", "tracing-core", - "tracing-log", ] [[package]] name = "transceiver-controller" version = "0.1.1" -source = "git+https://github.com/oxidecomputer/transceiver-control?branch=main#9fc521c4bd0a7fa4331c555296b2888089db32a2" +source = "git+https://github.com/oxidecomputer/transceiver-control?branch=main#3d583e15f4ad2b94112b0fa163d31bae218881c5" dependencies = [ "anyhow", - "clap 4.5.21", + "clap", "hubpack", "itertools 0.14.0", "nix", @@ -7231,38 +7246,38 @@ dependencies = [ "slog", "slog-async", "slog-term", - "tabled 0.18.0", - "thiserror 2.0.12", + "tabled 0.20.0", + "thiserror 2.0.16", "tokio", "transceiver-decode", "transceiver-messages", - "usdt 0.5.0", + "usdt 0.6.0", "version_check", ] [[package]] name = "transceiver-decode" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/transceiver-control?branch=main#9fc521c4bd0a7fa4331c555296b2888089db32a2" +source = "git+https://github.com/oxidecomputer/transceiver-control?branch=main#3d583e15f4ad2b94112b0fa163d31bae218881c5" dependencies = [ "schemars", "serde", "static_assertions", - "thiserror 2.0.12", + "thiserror 2.0.16", "transceiver-messages", ] [[package]] name = "transceiver-messages" version = "0.1.1" -source = "git+https://github.com/oxidecomputer/transceiver-control?branch=main#9fc521c4bd0a7fa4331c555296b2888089db32a2" +source = "git+https://github.com/oxidecomputer/transceiver-control?branch=main#3d583e15f4ad2b94112b0fa163d31bae218881c5" dependencies = [ - "bitflags 2.9.2", - "clap 4.5.21", + "bitflags 2.9.4", + "clap", "hubpack", "schemars", "serde", - "thiserror 2.0.12", + "thiserror 2.0.16", ] [[package]] @@ -7274,18 +7289,18 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tufaceous-artifact" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/tufaceous?branch=main#57832718056c6585b4cddb4f3ebc04b9a07c7bd7" +source = "git+https://github.com/oxidecomputer/tufaceous?branch=main#db072743d0cfde918dcf981a064f225b0003b98d" dependencies = [ "daft", "hex", "proptest", "schemars", - "semver 1.0.26", + "semver 1.0.27", "serde", "serde_human_bytes", "strum 0.26.3", "test-strategy", - "thiserror 2.0.12", + "thiserror 2.0.16", ] [[package]] @@ -7296,15 +7311,15 @@ checksum = "82205ffd44a9697e34fc145491aa47310f9871540bb7909eaa9365e0a9a46607" [[package]] name = "typeid" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e13db2e0ccd5e14a544e8a246ba2312cd25223f616442d7f2cb0e3db614236e" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" [[package]] name = "typenum" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" [[package]] name = "typify" @@ -7338,11 +7353,11 @@ dependencies = [ "quote", "regress", "schemars", - "semver 1.0.26", + "semver 1.0.27", "serde", "serde_json", "syn 2.0.106", - "thiserror 2.0.12", + "thiserror 2.0.16", "unicode-ident", ] @@ -7358,11 +7373,11 @@ dependencies = [ "quote", "regress", "schemars", - "semver 1.0.26", + "semver 1.0.27", "serde", "serde_json", "syn 2.0.106", - "thiserror 2.0.12", + "thiserror 2.0.16", "unicode-ident", ] @@ -7375,10 +7390,10 @@ dependencies = [ "proc-macro2", "quote", "schemars", - "semver 1.0.26", + "semver 1.0.27", "serde", "serde_json", - "serde_tokenstream 0.2.2", + "serde_tokenstream", "syn 2.0.106", "typify-impl 0.3.0", ] @@ -7392,10 +7407,10 @@ dependencies = [ "proc-macro2", "quote", "schemars", - "semver 1.0.26", + "semver 1.0.27", "serde", "serde_json", - "serde_tokenstream 0.2.2", + "serde_tokenstream", "syn 2.0.106", "typify-impl 0.4.3", ] @@ -7412,17 +7427,11 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" -[[package]] -name = "unicode-bidi" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" - [[package]] name = "unicode-ident" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" +checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d" [[package]] name = "unicode-linebreak" @@ -7453,9 +7462,9 @@ checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "unicode-width" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" +checksum = "4a1a07cc7db3810833284e8d372ccdc6da29741639ecc70c9ec107df0fa6154c" [[package]] name = "unicode-xid" @@ -7484,7 +7493,7 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "update-engine" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#ff423d49a72d77433ab659025d7a4c1be9847d07" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#e76962a5f67b8c5bf813ee24a7600634de708b35" dependencies = [ "anyhow", "cancel-safe-futures", @@ -7494,7 +7503,7 @@ dependencies = [ "either", "futures", "indent_write", - "indexmap 2.10.0", + "indexmap 2.11.4", "libsw", "linear-map", "omicron-workspace-hack", @@ -7516,6 +7525,7 @@ name = "uplinkd" version = "0.1.0" dependencies = [ "anyhow", + "clap", "common 0.1.0", "libc", "oxide-tokio-rt", @@ -7523,35 +7533,21 @@ dependencies = [ "signal-hook", "slog", "smf 0.10.0", - "structopt", "tokio", ] [[package]] name = "url" -version = "2.5.5" +version = "2.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec961601b32b6f5d14ae8dabd35ff2ff2e2c6cb4c0e6641845ff105abe96d958" +checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" dependencies = [ "form_urlencoded", - "idna 1.1.0", + "idna", "percent-encoding", "serde", ] -[[package]] -name = "usdt" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b4c48f9e522b977bbe938a0d7c4d36633d267ba0155aaa253fb57d0531be0fb" -dependencies = [ - "dtrace-parser 0.1.14", - "serde", - "usdt-attr-macro 0.3.5", - "usdt-impl 0.3.5", - "usdt-macro 0.3.5", -] - [[package]] name = "usdt" version = "0.5.0" @@ -7560,7 +7556,7 @@ checksum = "5bf5c47fb471a0bff3d7b17a250817bba8c6cc99b0492abaefe5b3bb99045f02" dependencies = [ "dof 0.3.0", "dtrace-parser 0.2.0", - "goblin", + "goblin 0.8.2", "memmap", "serde", "usdt-attr-macro 0.5.0", @@ -7569,17 +7565,18 @@ dependencies = [ ] [[package]] -name = "usdt-attr-macro" -version = "0.3.5" +name = "usdt" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e6ae4f982ae74dcbaa8eb17baf36ca0d464a3abc8a7172b3bd74c73e9505d6" +checksum = "1953f8d8a98ac7883c230963291acb65c7ed6ae3e2e4c99d5c65f4e65cc9db38" dependencies = [ - "dtrace-parser 0.1.14", - "proc-macro2", - "quote", - "serde_tokenstream 0.1.7", - "syn 1.0.109", - "usdt-impl 0.3.5", + "dof 0.4.0", + "goblin 0.10.1", + "memmap2", + "serde", + "usdt-attr-macro 0.6.0", + "usdt-impl 0.6.0", + "usdt-macro 0.6.0", ] [[package]] @@ -7591,29 +7588,23 @@ dependencies = [ "dtrace-parser 0.2.0", "proc-macro2", "quote", - "serde_tokenstream 0.2.2", + "serde_tokenstream", "syn 2.0.106", "usdt-impl 0.5.0", ] [[package]] -name = "usdt-impl" -version = "0.3.5" +name = "usdt-attr-macro" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f53b4ca0b33aae466dc47b30b98adc4f88454928837af8010b6ed02d18474cb1" +checksum = "55d0d673848744c556fcfe8479f87b6974459106e4c41f38375f6d559bb0ee28" dependencies = [ - "byteorder", - "dof 0.1.5", - "dtrace-parser 0.1.14", - "libc", + "dtrace-parser 0.3.0", "proc-macro2", "quote", - "serde", - "serde_json", - "syn 1.0.109", - "thiserror 1.0.69", - "thread-id", - "version_check", + "serde_tokenstream", + "syn 2.0.106", + "usdt-impl 0.6.0", ] [[package]] @@ -7632,22 +7623,27 @@ dependencies = [ "serde_json", "syn 2.0.106", "thiserror 1.0.69", - "thread-id", + "thread-id 4.2.2", "version_check", ] [[package]] -name = "usdt-macro" -version = "0.3.5" +name = "usdt-impl" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cb093f9653dc91632621c754f9ed4ee25d14e46e0239b6ccaf74a6c0c2788bd" +checksum = "cf0085a93af1ca095d8b1dc8672cc4620fcd1db5dff8d165486067badce05555" dependencies = [ - "dtrace-parser 0.1.14", + "byteorder", + "dof 0.4.0", + "dtrace-parser 0.3.0", + "libc", "proc-macro2", "quote", - "serde_tokenstream 0.1.7", - "syn 1.0.109", - "usdt-impl 0.3.5", + "serde", + "serde_json", + "syn 2.0.106", + "thiserror 2.0.16", + "thread-id 5.0.0", ] [[package]] @@ -7659,11 +7655,25 @@ dependencies = [ "dtrace-parser 0.2.0", "proc-macro2", "quote", - "serde_tokenstream 0.2.2", + "serde_tokenstream", "syn 2.0.106", "usdt-impl 0.5.0", ] +[[package]] +name = "usdt-macro" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9bf594f86b676f7e2fd3d523d50f9d0cffecff6c19729ff5dbebe86c4cb8cb2" +dependencies = [ + "dtrace-parser 0.3.0", + "proc-macro2", + "quote", + "serde_tokenstream", + "syn 2.0.106", + "usdt-impl 0.6.0", +] + [[package]] name = "utf8_iter" version = "1.0.4" @@ -7678,11 +7688,11 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.18.0" +version = "1.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f33196643e165781c20a5ead5582283a7dacbb87855d867fbc2df3f81eddc1be" +checksum = "2f87b8aa10b915a06587d0dec516c282ff295b475d94abf425d62b57710070a2" dependencies = [ - "getrandom 0.3.1", + "getrandom 0.3.3", "js-sys", "serde", "wasm-bindgen", @@ -7690,9 +7700,9 @@ dependencies = [ [[package]] name = "valuable" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" [[package]] name = "vcpkg" @@ -7700,12 +7710,6 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" -[[package]] -name = "vec_map" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" - [[package]] name = "vergen" version = "8.3.2" @@ -7731,16 +7735,17 @@ checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "viona_api" version = "0.0.0" -source = "git+https://github.com/oxidecomputer/propolis#aadc0998c0f07f08ab15a95c006074291734800f" +source = "git+https://github.com/oxidecomputer/propolis#827e6615bfebfd94d41504dcd1517a0f22e3166a" dependencies = [ "libc", + "nvpair 0.0.0", "viona_api_sys", ] [[package]] name = "viona_api_sys" version = "0.0.0" -source = "git+https://github.com/oxidecomputer/propolis#aadc0998c0f07f08ab15a95c006074291734800f" +source = "git+https://github.com/oxidecomputer/propolis#827e6615bfebfd94d41504dcd1517a0f22e3166a" dependencies = [ "libc", ] @@ -7784,17 +7789,26 @@ dependencies = [ [[package]] name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasi" -version = "0.13.3+wasi-0.2.2" +version = "0.14.7+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "883478de20367e224c0090af9cf5f9fa85bed63a95c1abf3afc5c083ebc06e8c" +dependencies = [ + "wasip2", +] + +[[package]] +name = "wasip2" +version = "1.0.1+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" dependencies = [ - "wit-bindgen-rt", + "wit-bindgen", ] [[package]] @@ -7805,21 +7819,22 @@ checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" [[package]] name = "wasm-bindgen" -version = "0.2.100" +version = "0.2.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +checksum = "ab10a69fbd0a177f5f649ad4d8d3305499c42bab9aef2f7ff592d0ec8f833819" dependencies = [ "cfg-if", "once_cell", "rustversion", "wasm-bindgen-macro", + "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.100" +version = "0.2.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +checksum = "0bb702423545a6007bbc368fde243ba47ca275e549c8a28617f56f6ba53b1d1c" dependencies = [ "bumpalo", "log", @@ -7831,21 +7846,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.45" +version = "0.4.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" +checksum = "a0b221ff421256839509adbb55998214a70d829d3a28c69b4a6672e9d2a42f67" dependencies = [ "cfg-if", "js-sys", + "once_cell", "wasm-bindgen", "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.100" +version = "0.2.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +checksum = "fc65f4f411d91494355917b605e1480033152658d71f722a90647f56a70c88a0" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -7853,9 +7869,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.100" +version = "0.2.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +checksum = "ffc003a991398a8ee604a401e194b6b3a39677b3173d6e74495eb51b82e99a32" dependencies = [ "proc-macro2", "quote", @@ -7866,9 +7882,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.100" +version = "0.2.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +checksum = "293c37f4efa430ca14db3721dfbe48d8c33308096bd44d80ebaa775ab71ba1cf" dependencies = [ "unicode-ident", ] @@ -7888,9 +7904,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.72" +version = "0.3.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" +checksum = "fbe734895e869dc429d78c4b433f8d17d95f8d05317440b4fad5ab2d33e596dc" dependencies = [ "js-sys", "wasm-bindgen", @@ -7906,15 +7922,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki-roots" -version = "0.26.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" -dependencies = [ - "rustls-pki-types", -] - [[package]] name = "webpki-roots" version = "1.0.2" @@ -7924,34 +7931,22 @@ dependencies = [ "rustls-pki-types", ] -[[package]] -name = "which" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" -dependencies = [ - "either", - "home", - "once_cell", - "rustix 0.38.40", -] - [[package]] name = "whoami" -version = "1.5.2" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "372d5b87f58ec45c384ba03563b03544dc5fadc3983e434b286913f5b4a9bb6d" +checksum = "5d4a4db5077702ca3015d3d02d74974948aba2ad9e12ab7df718ee64ccd7e97d" dependencies = [ - "redox_syscall", + "libredox", "wasite", "web-sys", ] [[package]] name = "widestring" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" +checksum = "dd7cf3379ca1aac9eea11fba24fd7e315d621f8dfe35c8d7d2be8b793726e07d" [[package]] name = "winapi" @@ -7971,11 +7966,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.9" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.61.0", ] [[package]] @@ -7984,75 +7979,24 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" -dependencies = [ - "windows-core 0.52.0", - "windows-targets 0.52.6", -] - -[[package]] -name = "windows" -version = "0.60.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddf874e74c7a99773e62b1c671427abf01a425e77c3d3fb9fb1e4883ea934529" -dependencies = [ - "windows-collections", - "windows-core 0.60.1", - "windows-future", - "windows-link", - "windows-numerics", -] - -[[package]] -name = "windows-collections" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5467f79cc1ba3f52ebb2ed41dbb459b8e7db636cc3429458d9a852e15bc24dec" -dependencies = [ - "windows-core 0.60.1", -] - [[package]] name = "windows-core" -version = "0.52.0" +version = "0.62.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-core" -version = "0.60.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca21a92a9cae9bf4ccae5cf8368dce0837100ddf6e6d57936749e85f152f6247" +checksum = "57fe7168f7de578d2d8a05b07fd61870d2e73b4020e9f49aa00da8471723497c" dependencies = [ "windows-implement", "windows-interface", - "windows-link", - "windows-result", - "windows-strings", -] - -[[package]] -name = "windows-future" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a787db4595e7eb80239b74ce8babfb1363d8e343ab072f2ffe901400c03349f0" -dependencies = [ - "windows-core 0.60.1", - "windows-link", + "windows-link 0.2.0", + "windows-result 0.4.0", + "windows-strings 0.5.0", ] [[package]] name = "windows-implement" -version = "0.59.0" +version = "0.60.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83577b051e2f49a058c308f17f273b570a6a758386fc291b5f6a934dd84e48c1" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" dependencies = [ "proc-macro2", "quote", @@ -8072,47 +8016,61 @@ dependencies = [ [[package]] name = "windows-link" -version = "0.1.0" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dccfd733ce2b1753b03b6d3c65edf020262ea35e20ccdf3e288043e6dd620e3" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" [[package]] -name = "windows-numerics" -version = "0.1.1" +name = "windows-link" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "005dea54e2f6499f2cee279b8f703b3cf3b5734a2d8d21867c8f44003182eeed" +checksum = "45e46c0661abb7180e7b9c281db115305d49ca1709ab8242adf09666d2173c65" + +[[package]] +name = "windows-registry" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b8a9ed28765efc97bbc954883f4e6796c33a06546ebafacbabee9696967499e" dependencies = [ - "windows-core 0.60.1", - "windows-link", + "windows-link 0.1.3", + "windows-result 0.3.4", + "windows-strings 0.4.2", ] [[package]] -name = "windows-registry" -version = "0.5.0" +name = "windows-result" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c44a98275e31bfd112bb06ba96c8ab13c03383a3753fdddd715406a1824c7e0" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" dependencies = [ - "windows-link", - "windows-result", - "windows-strings", + "windows-link 0.1.3", ] [[package]] name = "windows-result" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06374efe858fab7e4f881500e6e86ec8bc28f9462c47e5a9941a0142ad86b189" +checksum = "7084dcc306f89883455a206237404d3eaf961e5bd7e0f312f7c91f57eb44167f" dependencies = [ - "windows-link", + "windows-link 0.2.0", ] [[package]] name = "windows-strings" -version = "0.3.1" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +dependencies = [ + "windows-link 0.1.3", +] + +[[package]] +name = "windows-strings" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87fa48cc5d406560701792be122a10132491cff9d0aeb23583cc2dcafc847319" +checksum = "7218c655a553b0bed4426cf54b20d7ba363ef543b52d515b3e48d7fd55318dda" dependencies = [ - "windows-link", + "windows-link 0.2.0", ] [[package]] @@ -8142,6 +8100,24 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.3", +] + +[[package]] +name = "windows-sys" +version = "0.61.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e201184e40b2ede64bc2ea34968b28e33622acdbbf37104f0e4a33f7abe657aa" +dependencies = [ + "windows-link 0.2.0", +] + [[package]] name = "windows-targets" version = "0.48.5" @@ -8166,13 +8142,30 @@ dependencies = [ "windows_aarch64_gnullvm 0.52.6", "windows_aarch64_msvc 0.52.6", "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", + "windows_i686_gnullvm 0.52.6", "windows_i686_msvc 0.52.6", "windows_x86_64_gnu 0.52.6", "windows_x86_64_gnullvm 0.52.6", "windows_x86_64_msvc 0.52.6", ] +[[package]] +name = "windows-targets" +version = "0.53.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91" +dependencies = [ + "windows-link 0.1.3", + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -8185,6 +8178,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -8197,6 +8196,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -8209,12 +8214,24 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -8227,6 +8244,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -8239,6 +8262,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -8251,6 +8280,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -8263,6 +8298,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + [[package]] name = "winnow" version = "0.5.40" @@ -8292,13 +8333,10 @@ dependencies = [ ] [[package]] -name = "wit-bindgen-rt" -version = "0.33.0" +name = "wit-bindgen" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" -dependencies = [ - "bitflags 2.9.2", -] +checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" [[package]] name = "writeable" @@ -8317,13 +8355,12 @@ dependencies = [ [[package]] name = "xattr" -version = "1.3.1" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" +checksum = "32e45ad4206f6d2479085147f02bc2ef834ac85886624a23575ae137c8aa8156" dependencies = [ "libc", - "linux-raw-sys 0.4.14", - "rustix 0.38.40", + "rustix 1.1.2", ] [[package]] @@ -8333,12 +8370,12 @@ dependencies = [ "anyhow", "camino", "chrono", + "clap", "curl", "omicron-zone-package", "search_path", "serde", "serde_json", - "structopt", "tokio", ] @@ -8369,17 +8406,7 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.106", - "synstructure 0.13.1", -] - -[[package]] -name = "zerocopy" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da091bab2bd35db397c46f5b81748b56f28f8fda837087fab9b6b07b6d66e3f1" -dependencies = [ - "byteorder", - "zerocopy-derive 0.2.0", + "synstructure", ] [[package]] @@ -8394,22 +8421,11 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" -dependencies = [ - "zerocopy-derive 0.8.26", -] - -[[package]] -name = "zerocopy-derive" -version = "0.2.0" +version = "0.8.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d498dbd1fd7beb83c86709ae1c33ca50942889473473d287d56ce4770a18edfb" +checksum = "0894878a5fa3edfd6da3f88c4805f4c8558e2b996227a3d864f47fe11e38282c" dependencies = [ - "proc-macro2", - "syn 1.0.109", - "synstructure 0.12.6", + "zerocopy-derive 0.8.27", ] [[package]] @@ -8425,9 +8441,9 @@ dependencies = [ [[package]] name = "zerocopy-derive" -version = "0.8.26" +version = "0.8.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" +checksum = "88d2b8d9c68ad2b9e4340d7832716a4d21a22a1154777ad56ea55c51a9cf3831" dependencies = [ "proc-macro2", "quote", @@ -8436,23 +8452,23 @@ dependencies = [ [[package]] name = "zerofrom" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", "syn 2.0.106", - "synstructure 0.13.1", + "synstructure", ] [[package]] @@ -8508,9 +8524,9 @@ dependencies = [ [[package]] name = "zone_cfg_derive" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5c4f01d3785e222d5aca11c9813e9c46b69abfe258756c99c9b628683626cc8" +checksum = "ea6cd6c20bb854b78a242e19d51b21077fb60f5e409259d7573279a43bacdffa" dependencies = [ "heck 0.4.1", "proc-macro-error", diff --git a/Cargo.toml b/Cargo.toml index bd10670..3f2fa96 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -63,6 +63,7 @@ camino = { version = "1.1", features = ["serde1"] } cfg-if = "1" chrono = "0.4" colored = "2" +clap = { version = "4.5.8", features = [ "derive" ] } csv = "1.3" curl = "0.4" display-error-chain = "0.2" @@ -96,7 +97,6 @@ slog-async = "2.8" slog-bunyan = "2.5" slog-term = "2.9" socket2 = { version = "0.6", features = ["all"] } -structopt = "0.3" strum = { version = "0.26.3", features = [ "derive" ] } syn = { version = "2.0", features = ["extra-traits"]} tabwriter = { version = "1", features = ["ansi_formatting"] } diff --git a/README.md b/README.md index 52535e7..26c8088 100644 --- a/README.md +++ b/README.md @@ -307,7 +307,7 @@ Configuring a nat entry using `swadm`: ``` sh $ ./target/release/swadm nat add \ -e 10.85.0.211 \ - -h 65535 \ + -H 65535 \ -m A8:40:25:F6:F9:94 \ -i fd00:1122:3344:101::1 \ -l 1024 \ diff --git a/aal/Cargo.toml b/aal/Cargo.toml index 8a7da6a..4237c82 100644 --- a/aal/Cargo.toml +++ b/aal/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "aal" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/aal/src/match_action.rs b/aal/src/match_action.rs index e713a22..1dc54e6 100644 --- a/aal/src/match_action.rs +++ b/aal/src/match_action.rs @@ -370,10 +370,10 @@ impl TryFrom<&ValueTypes> for u32 { fn try_from(v: &ValueTypes) -> Result { let mask = (1u64 << 32) - 1; - if let ValueTypes::U64(v) = v { - if v & mask == *v { - return Ok((v & mask) as u32); - } + if let ValueTypes::U64(v) = v + && v & mask == *v + { + return Ok((v & mask) as u32); } Err("value not 32 bits") @@ -400,10 +400,10 @@ impl TryFrom<&ValueTypes> for u8 { fn try_from(v: &ValueTypes) -> Result { let mask = (1u64 << 8) - 1; - if let ValueTypes::U64(v) = v { - if v & mask == *v { - return Ok((v & mask) as u8); - } + if let ValueTypes::U64(v) = v + && v & mask == *v + { + return Ok((v & mask) as u8); } Err("value not 8 bits") diff --git a/aal_macros/Cargo.toml b/aal_macros/Cargo.toml index 9a7c2b9..2e9fee1 100644 --- a/aal_macros/Cargo.toml +++ b/aal_macros/Cargo.toml @@ -1,7 +1,7 @@ [package] version = "0.0.1" name = "aal_macros" -edition = "2021" +edition = "2024" [lib] proc-macro = true diff --git a/aal_macros/src/lib.rs b/aal_macros/src/lib.rs index c8bfdd4..230a374 100644 --- a/aal_macros/src/lib.rs +++ b/aal_macros/src/lib.rs @@ -370,7 +370,7 @@ fn get_fields<'a>( return Err(Error::new( f.span(), format!("unrecognized key type: {x}"), - )) + )); } }, }; @@ -391,7 +391,7 @@ fn get_fields<'a>( } // Parse all of the arguments to an action -fn get_action_args(variant: &Variant) -> Result> { +fn get_action_args(variant: &Variant) -> Result>> { let mut args = Vec::new(); let named = match variant.fields { diff --git a/asic/Cargo.toml b/asic/Cargo.toml index 27d4900..e4b6973 100644 --- a/asic/Cargo.toml +++ b/asic/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "asic" version = "0.1.0" -edition = "2021" +edition = "2024" [features] tofino_asic = [ diff --git a/asic/build.rs b/asic/build.rs index e072933..b75a0bc 100644 --- a/asic/build.rs +++ b/asic/build.rs @@ -97,7 +97,7 @@ fn sde_prep() -> Result<()> { let sde_dir = env::var("SDE").with_context(|| "failed to get SDE env var")?; - env::set_var("CFLAGS", format!("-I{sde_dir}/include")); + unsafe { env::set_var("CFLAGS", format!("-I{sde_dir}/include")) }; println!("cargo:rerun-if-changed={TOFINO_DIR}/{FN_FILE}"); println!("cargo:rerun-if-changed={TOFINO_DIR}/{TYPE_FILE}"); @@ -121,7 +121,7 @@ fn sde_prep() -> Result<()> { fn main() -> Result<()> { #[cfg(target_os = "illumos")] - { + unsafe { env::set_var("AR", "/usr/bin/gar"); env::set_var("LIBCLANG_PATH", "/opt/ooce/llvm/lib"); } diff --git a/asic/src/chaos/mod.rs b/asic/src/chaos/mod.rs index ab87da1..f943d93 100644 --- a/asic/src/chaos/mod.rs +++ b/asic/src/chaos/mod.rs @@ -17,9 +17,9 @@ use aal::{ }; use common::ports::{PortFec, PortId, PortMedia, PortPrbsMode, PortSpeed}; +use crate::Identifiers; pub use crate::faux_fsm::FsmState; pub use crate::faux_fsm::PortFsmState; -use crate::Identifiers; pub mod table; @@ -117,11 +117,11 @@ impl TableChaos { id: &str, message: &str, ) -> AsicResult<()> { - if let Some(value) = self.values.get(id) { - if *value >= random() { - slog::error!(log, "chaos table error: {}", message); - return Err(AsicError::Synthetic(message.into())); - } + if let Some(value) = self.values.get(id) + && *value >= random() + { + slog::error!(log, "chaos table error: {}", message); + return Err(AsicError::Synthetic(message.into())); } Ok(()) } diff --git a/asic/src/chaos/table.rs b/asic/src/chaos/table.rs index 24699d8..08acb4f 100644 --- a/asic/src/chaos/table.rs +++ b/asic/src/chaos/table.rs @@ -4,13 +4,13 @@ // // Copyright 2025 Oxide Computer Company -use std::collections::hash_map::DefaultHasher; use std::collections::HashSet; +use std::collections::hash_map::DefaultHasher; use std::hash::Hash; use std::hash::Hasher; use std::sync::Mutex; -use crate::chaos::{table_unfurl, Handle}; +use crate::chaos::{Handle, table_unfurl}; use aal::{ ActionParse, AsicError, AsicResult, CounterData, MatchParse, TableOps, }; diff --git a/asic/src/lib.rs b/asic/src/lib.rs index 28eb40b..93aad08 100644 --- a/asic/src/lib.rs +++ b/asic/src/lib.rs @@ -127,44 +127,44 @@ pub mod tofino_asic; #[cfg(feature = "tofino_asic")] mod plat { - pub use super::tofino_asic::stats::AsicLinkStats; - pub use super::tofino_asic::table::Table; pub use super::tofino_asic::FsmState; pub use super::tofino_asic::Handle; pub use super::tofino_asic::PortFsmState; + pub use super::tofino_asic::stats::AsicLinkStats; + pub use super::tofino_asic::table::Table; } #[cfg(feature = "tofino_stub")] pub mod tofino_stub; #[cfg(feature = "tofino_stub")] mod plat { - pub use super::tofino_stub::table::Table; pub use super::tofino_stub::AsicLinkStats; pub use super::tofino_stub::FsmState; pub use super::tofino_stub::PortFsmState; pub use super::tofino_stub::StubHandle as Handle; + pub use super::tofino_stub::table::Table; } #[cfg(feature = "softnpu")] pub mod softnpu; #[cfg(feature = "softnpu")] mod plat { - pub use super::softnpu::table::Table; pub use super::softnpu::AsicLinkStats; pub use super::softnpu::FsmState; pub use super::softnpu::Handle; pub use super::softnpu::PortFsmState; + pub use super::softnpu::table::Table; } #[cfg(feature = "chaos")] pub mod chaos; #[cfg(feature = "chaos")] mod plat { - pub use super::chaos::table::Table; pub use super::chaos::AsicLinkStats; pub use super::chaos::FsmState; pub use super::chaos::Handle; pub use super::chaos::PortFsmState; + pub use super::chaos::table::Table; } pub use plat::AsicLinkStats; diff --git a/asic/src/softnpu/mod.rs b/asic/src/softnpu/mod.rs index 73d2095..cd980b4 100644 --- a/asic/src/softnpu/mod.rs +++ b/asic/src/softnpu/mod.rs @@ -7,14 +7,14 @@ use std::collections::HashMap; use std::sync::Mutex; -use slog::{o, Logger}; +use slog::{Logger, o}; use tokio::sync::mpsc; use uuid::Uuid; +use crate::Identifiers; pub use crate::faux_fsm::FsmState; pub use crate::faux_fsm::FsmType; pub use crate::faux_fsm::PortFsmState; -use crate::Identifiers; use aal::{ AsicError, AsicId, AsicOps, AsicResult, Connector, PortHdl, PortUpdate, @@ -118,7 +118,7 @@ impl Handle { None => { return Err(AsicError::InvalidArg( "softnpu unix domain socket missing".to_string(), - )) + )); } }, }; @@ -279,12 +279,12 @@ impl AsicOps for Handle { _speed: PortSpeed, _fec: PortFec, ) -> AsicResult<(PortHdl, u16)> { - if let Some(link_id) = lane { - if link_id > 0 { - return Err(AsicError::InvalidArg( - "softnpu only supports lane 0".into(), - )); - } + if let Some(link_id) = lane + && link_id > 0 + { + return Err(AsicError::InvalidArg( + "softnpu only supports lane 0".into(), + )); } let mut ports = self.ports.lock().unwrap(); // Each switch port / connector only supports a single channel, and so a diff --git a/asic/src/softnpu/table.rs b/asic/src/softnpu/table.rs index 718ecae..b06bbfc 100644 --- a/asic/src/softnpu/table.rs +++ b/asic/src/softnpu/table.rs @@ -155,7 +155,10 @@ impl TableOps for Table { params.extend_from_slice(&v.to_le_bytes()); } x => { - error!(hdl.log, "unexpected parameter: {dpd_table}::index {x}") + error!( + hdl.log, + "unexpected parameter: {dpd_table}::index {x}" + ) } } } @@ -185,7 +188,10 @@ impl TableOps for Table { ); } x => { - error!(hdl.log, "unexpected parameter: {dpd_table}::forward {x}") + error!( + hdl.log, + "unexpected parameter: {dpd_table}::forward {x}" + ) } } } @@ -221,7 +227,10 @@ impl TableOps for Table { ); } x => { - error!(hdl.log, "unexpected parameter: {dpd_table}::forward_vlan {x}") + error!( + hdl.log, + "unexpected parameter: {dpd_table}::forward_vlan {x}" + ) } } } @@ -249,7 +258,10 @@ impl TableOps for Table { params.extend_from_slice(&v.to_le_bytes()); } x => { - error!(hdl.log, "unexpected parameter: {dpd_table}::index {x}") + error!( + hdl.log, + "unexpected parameter: {dpd_table}::index {x}" + ) } } } @@ -273,7 +285,10 @@ impl TableOps for Table { ); } x => { - error!(hdl.log, "unexpected parameter: {dpd_table}::forward {x}") + error!( + hdl.log, + "unexpected parameter: {dpd_table}::forward {x}" + ) } } } @@ -305,7 +320,10 @@ impl TableOps for Table { ); } x => { - error!(hdl.log, "unexpected parameter: {dpd_table}::forward_vlan {x}") + error!( + hdl.log, + "unexpected parameter: {dpd_table}::forward_vlan {x}" + ) } } } diff --git a/asic/src/tofino_asic/bf_wrapper.rs b/asic/src/tofino_asic/bf_wrapper.rs index 421519a..3a52b4d 100644 --- a/asic/src/tofino_asic/bf_wrapper.rs +++ b/asic/src/tofino_asic/bf_wrapper.rs @@ -15,7 +15,7 @@ use tokio::sync::mpsc; use aal::{AsicError, AsicResult, PortUpdate}; use crate::tofino_asic::genpd::*; -use crate::tofino_asic::{bf_status_t, CheckError, TofinoFamily}; +use crate::tofino_asic::{CheckError, TofinoFamily, bf_status_t}; // State needed to allow callbacks from the SDE to communicate with the // mainline dpd code. @@ -190,7 +190,7 @@ pub(crate) fn send_port_update(callback: &str, update: PortUpdate) { // callback will generally be a no-op. The only exception would be if somebody // were using the bf cli to manipulate ports, at which point all bets are off as // to what's happening with the port. -#[no_mangle] +#[unsafe(no_mangle)] extern "C" fn port_admin_state_cb( dev_id: bf_dev_id_t, port: bf_dev_port_t, @@ -214,7 +214,7 @@ extern "C" fn port_admin_state_cb( } // Called whenever a port's link state changes between up and down. -#[no_mangle] +#[unsafe(no_mangle)] extern "C" fn port_status_int_cb( dev_id: bf_dev_id_t, port: bf_dev_port_t, @@ -238,7 +238,7 @@ extern "C" fn port_status_int_cb( } // Called whenever a port's presence-detect bit changes -#[no_mangle] +#[unsafe(no_mangle)] extern "C" fn port_presence_cb( dev_id: bf_dev_id_t, port: bf_dev_port_t, @@ -270,7 +270,7 @@ static mut TOFINO_FAMILY: Option = None; // This gets called when a tofino device is added to the bf_switchd // infrastructure in the SDE. This should happen exactly once, when we call // bf_drv_init() below. We take this opportunity to do some basic sanity tests. -#[no_mangle] +#[unsafe(no_mangle)] extern "C" fn device_add_cb( dev_id: bf_dev_id_t, dev_family: bf_dev_family_t, @@ -329,7 +329,7 @@ pub fn register_handler( None => Err(AsicError::Uninitialized( "register_handler() called with no callback state".into(), )), - Some(ref mut cb) => { + Some(cb) => { cb.update_tx = Some(update_tx); Ok(()) } @@ -406,7 +406,7 @@ pub fn bf_init( return Err(crate::tofino_asic::sde_error( "initializing bf context", rval, - )) + )); } } }; diff --git a/asic/src/tofino_asic/link_fsm.rs b/asic/src/tofino_asic/link_fsm.rs index cbd735d..7d50698 100644 --- a/asic/src/tofino_asic/link_fsm.rs +++ b/asic/src/tofino_asic/link_fsm.rs @@ -7,9 +7,9 @@ use std::convert::TryFrom; use std::fmt; +use crate::tofino_asic::TofinoFamily; use crate::tofino_asic::bf_wrapper; use crate::tofino_asic::genpd; -use crate::tofino_asic::TofinoFamily; use aal::AsicError; use aal::AsicResult; @@ -134,7 +134,7 @@ pub enum PortFsmState { impl fmt::Display for PortFsmState { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "{:?}", self) + write!(f, "{self:?}") } } @@ -268,7 +268,7 @@ pub enum MediaFsmState { impl fmt::Display for MediaFsmState { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "{:?}", self) + write!(f, "{self:?}") } } @@ -350,7 +350,7 @@ pub enum QsfpFsmState { impl fmt::Display for QsfpFsmState { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "{:?}", self) + write!(f, "{self:?}") } } @@ -460,13 +460,13 @@ impl TryFrom for QsfpChannelFsmState { impl fmt::Display for QsfpChannelFsmState { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "{:?}", self) + write!(f, "{self:?}") } } /// An FFI-compatible routine that the SDE's C code can call when an FSM /// transitions from one state to another. -#[no_mangle] +#[unsafe(no_mangle)] pub extern "C" fn bf_pm_fsm_transition_callback( fsm: genpd::bf_fsm_type_t, asic_id: u32, diff --git a/asic/src/tofino_asic/mcast.rs b/asic/src/tofino_asic/mcast.rs index 214b801..f064be5 100644 --- a/asic/src/tofino_asic/mcast.rs +++ b/asic/src/tofino_asic/mcast.rs @@ -10,8 +10,8 @@ use slog::{debug, error, info}; use crate::tofino_asic::bf_wrapper::*; use crate::tofino_asic::genpd::*; -use crate::tofino_asic::{CheckError, Handle}; use crate::tofino_asic::{BF_MC_LAG_ARRAY_SIZE, BF_MC_PORT_ARRAY_SIZE}; +use crate::tofino_asic::{CheckError, Handle}; use aal::{AsicError, AsicResult}; @@ -318,7 +318,9 @@ pub fn domain_remove_port( let mc = match domain.ports.remove(&port) { Some(n) => n, None => { - return Err(AsicError::InvalidArg("port not in domain".to_string())) + return Err(AsicError::InvalidArg( + "port not in domain".to_string(), + )); } }; diff --git a/asic/src/tofino_asic/mod.rs b/asic/src/tofino_asic/mod.rs index 90c4464..46bf61f 100644 --- a/asic/src/tofino_asic/mod.rs +++ b/asic/src/tofino_asic/mod.rs @@ -10,8 +10,8 @@ use std::sync::{Mutex, MutexGuard}; use slog::{error, info, o}; use tofino::fuse::ChipId; -use crate::tofino_common; use crate::Identifiers; +use crate::tofino_common; use aal::PortUpdate; use common::ports::*; @@ -372,7 +372,7 @@ impl Handle { self.board_rev.to_string() } - pub fn bf_get(&self) -> MutexGuard { + pub fn bf_get(&self) -> MutexGuard<'_, bf_wrapper::BfCommon> { self.bf.lock().unwrap() } @@ -461,8 +461,8 @@ pub const BF_PORT_COUNT: u32 = BF_PIPE_PORT_COUNT * BF_PIPE_COUNT; // total port pub const BF_LAG_COUNT: u32 = 256; // LAGs in the ASIC // Sizes of the port and LAG bitmap arrays in a multicast group -pub const BF_MC_PORT_ARRAY_SIZE: usize = (BF_PORT_COUNT as usize + 7) / 8; -pub const BF_MC_LAG_ARRAY_SIZE: usize = (BF_LAG_COUNT as usize + 7) / 8; +pub const BF_MC_PORT_ARRAY_SIZE: usize = (BF_PORT_COUNT as usize).div_ceil(8); +pub const BF_MC_LAG_ARRAY_SIZE: usize = (BF_LAG_COUNT as usize).div_ceil(8); #[cfg(test)] mod tests { diff --git a/asic/src/tofino_asic/ports.rs b/asic/src/tofino_asic/ports.rs index a5f3ae4..98d40fd 100644 --- a/asic/src/tofino_asic/ports.rs +++ b/asic/src/tofino_asic/ports.rs @@ -668,7 +668,7 @@ pub fn init(dev_id: i32) -> AsicResult { let eth_port = match unsafe { bf_eth_cpu_port_get(dev_id) } { -1 => None, x if x >= 0 && x < BF_PORT_COUNT as i32 => Some(x as PortId), - x => panic!("invalid CPU ETH port: {}", x), + x => panic!("invalid CPU ETH port: {x}"), }; // Iterate over all of the ports the SDE has inventoried, populating our @@ -702,10 +702,7 @@ pub fn init(dev_id: i32) -> AsicResult { map_to_asic_id.insert((connector, chan), asic_id); map_from_asic_id.insert(asic_id, (connector, chan)); - fp = match x.get_next() { - Ok(x) => Some(x), - Err(_) => None, - } + fp = x.get_next().ok() } let _ = unsafe { bf_pm_port_delete_all(dev_id) }; diff --git a/asic/src/tofino_asic/qsfp.rs b/asic/src/tofino_asic/qsfp.rs index c726874..195870e 100644 --- a/asic/src/tofino_asic/qsfp.rs +++ b/asic/src/tofino_asic/qsfp.rs @@ -89,15 +89,15 @@ cfg_if::cfg_if! { use libc::c_int; use libc::c_uint; use libc::c_void; +use slog::Logger; use slog::debug; use slog::error; use slog::trace; -use slog::Logger; use std::convert::TryFrom; use std::ptr::copy_nonoverlapping; -use std::sync::atomic::AtomicBool; use std::sync::RwLock; use std::sync::RwLockReadGuard; +use std::sync::atomic::AtomicBool; use std::time::Duration; use tokio::sync::mpsc; use tokio::sync::oneshot; @@ -336,7 +336,7 @@ struct bf_qsfp_vec_t { /// Platform-specific initialization of the QSFP modules. #[cfg(not(target_os = "linux"))] -#[no_mangle] +#[unsafe(no_mangle)] pub extern "C" fn bf_pltfm_qsfp_init(_: *mut c_void) -> c_int { // Inform the BF SDE that the number of QSFP ports is one fewer than the // total number of ports on the system, so that it does not include the CPU @@ -370,7 +370,7 @@ pub extern "C" fn bf_pltfm_qsfp_init(_: *mut c_void) -> c_int { /// Platform-specific initialization of the QSFP modules. #[cfg(target_os = "linux")] -#[no_mangle] +#[unsafe(no_mangle)] pub extern "C" fn bf_pltfm_qsfp_init(_: *mut c_void) -> c_int { slog::warn!( get_logger(), @@ -380,7 +380,7 @@ pub extern "C" fn bf_pltfm_qsfp_init(_: *mut c_void) -> c_int { } /// Report the presence of a QSFP module. -#[no_mangle] +#[unsafe(no_mangle)] pub extern "C" fn bf_pltfm_detect_qsfp(module: c_uint) -> bool { let log = get_logger(); if module > MAX_PORT { @@ -445,7 +445,7 @@ pub extern "C" fn bf_pltfm_detect_qsfp(module: c_uint) -> bool { /// Using it would require a large about of extra work on our part, to cache the /// page and bank the SDE wants to access for each module. Instead we implement /// the `bf_qsfp_vec_t` struct and the functions it points to. -#[no_mangle] +#[unsafe(no_mangle)] pub extern "C" fn bf_pltfm_qsfp_read_module( _module: c_uint, _offset: c_int, @@ -463,7 +463,7 @@ pub extern "C" fn bf_pltfm_qsfp_read_module( /// Using it would require a large about of extra work on our part, to cache the /// page and bank the SDE wants to access for each module. Instead we implement /// the `bf_qsfp_vec_t` struct and the functions it points to. -#[no_mangle] +#[unsafe(no_mangle)] pub extern "C" fn bf_pltfm_qsfp_write_module( _module: c_uint, _offset: c_int, @@ -747,8 +747,7 @@ fn send_bitmask_request(request: SdeTransceiverRequest) -> Option<(u32, u32)> { None } (_, _) => panic!( - "Unexpected messages: request = {:?}, response = {:?}", - request, response + "Unexpected messages: request = {request:?}, response = {response:?}" ), }, } @@ -766,25 +765,27 @@ fn send_bitmask_request(request: SdeTransceiverRequest) -> Option<(u32, u32)> { /// /// This function dereferences the raw pointer arguments. // -#[no_mangle] +#[unsafe(no_mangle)] pub unsafe extern "C" fn bf_pltfm_qsfp_get_presence_mask( port_1_32: *mut u32, port_33_64: *mut u32, cpu_port: *mut u32, ) -> c_int { - let Some((backplane, qsfp)) = - send_bitmask_request(SdeTransceiverRequest::PresenceMask) - else { - return -1; - }; + unsafe { + let Some((backplane, qsfp)) = + send_bitmask_request(SdeTransceiverRequest::PresenceMask) + else { + return -1; + }; - // Invert the presence bits. We use 1 to indicate presence, the SDE uses 0. - *port_1_32 = !backplane; - *port_33_64 = !qsfp; + // Invert the presence bits. We use 1 to indicate presence, the SDE uses 0. + *port_1_32 = !backplane; + *port_33_64 = !qsfp; - // CPU port is always present. - *cpu_port = !0; - 0 + // CPU port is always present. + *cpu_port = !0; + 0 + } } /// Return the interrupt status of each QSFP module. @@ -795,25 +796,27 @@ pub unsafe extern "C" fn bf_pltfm_qsfp_get_presence_mask( /// # Safety /// /// This function dereferences the raw pointer arguments. -#[no_mangle] +#[unsafe(no_mangle)] pub unsafe extern "C" fn bf_pltfm_qsfp_get_int_mask( port_1_32: *mut u32, port_33_64: *mut u32, cpu_port: *mut u32, ) -> c_int { - let Some((backplane, qsfp)) = - send_bitmask_request(SdeTransceiverRequest::InterruptMask) - else { - return -1; - }; + unsafe { + let Some((backplane, qsfp)) = + send_bitmask_request(SdeTransceiverRequest::InterruptMask) + else { + return -1; + }; - // Invert the interrupt bits. We use 1 to indicate a pending interrupt, the - // SDE uses 0. - *port_1_32 = !backplane; - *port_33_64 = !qsfp; - // Never interrupts on CPU port. - *cpu_port = !0; - 0 + // Invert the interrupt bits. We use 1 to indicate a pending interrupt, the + // SDE uses 0. + *port_1_32 = !backplane; + *port_33_64 = !qsfp; + // Never interrupts on CPU port. + *cpu_port = !0; + 0 + } } /// Return the low-power mode of each QSFP module. @@ -824,32 +827,34 @@ pub unsafe extern "C" fn bf_pltfm_qsfp_get_int_mask( /// # Safety /// /// This function dereferences the raw pointer arguments. -#[no_mangle] +#[unsafe(no_mangle)] pub unsafe extern "C" fn bf_pltfm_qsfp_get_lpmode_mask( port_1_32: *mut u32, port_33_64: *mut u32, cpu_port: *mut u32, ) -> c_int { - let Some((backplane, qsfp)) = - send_bitmask_request(SdeTransceiverRequest::LpModeMask) - else { - return -1; - }; + unsafe { + let Some((backplane, qsfp)) = + send_bitmask_request(SdeTransceiverRequest::LpModeMask) + else { + return -1; + }; - // We don't need to invert this mask. A 1 means the module is _in_ low-power - // mode, which is what we report in the messaging protocol. - *port_1_32 = backplane; - *port_33_64 = qsfp; - // CPU port is always in high-power mode. - *cpu_port = 0; - 0 + // We don't need to invert this mask. A 1 means the module is _in_ low-power + // mode, which is what we report in the messaging protocol. + *port_1_32 = backplane; + *port_33_64 = qsfp; + // CPU port is always in high-power mode. + *cpu_port = 0; + 0 + } } /// Set the low-power mode of a QSFP module. /// /// NOTE: The C signature for this function does actually take a signed integer, /// in contrast to the other functions which accept a u32. -#[no_mangle] +#[unsafe(no_mangle)] pub extern "C" fn bf_pltfm_qsfp_set_lpmode( module: c_int, lp_mode: bool, @@ -923,7 +928,7 @@ pub extern "C" fn bf_pltfm_qsfp_set_lpmode( /// /// NOTE: The C signature for this function does actually take a signed integer, /// in contrast to the other functions which accept a u32. -#[no_mangle] +#[unsafe(no_mangle)] pub extern "C" fn bf_pltfm_qsfp_module_reset( module: c_int, reset: bool, @@ -1040,13 +1045,13 @@ fn send_to_dpd( #[cfg(test)] mod tests { - use super::read_qsfp_module; - use super::send_to_dpd; - use super::write_qsfp_module; use super::SdeTransceiverMessage; use super::SdeTransceiverRequest; use super::SdeTransceiverResponse; use super::SendError; + use super::read_qsfp_module; + use super::send_to_dpd; + use super::write_qsfp_module; use crate::tofino_asic::genpd::bf_drv_device_type_get; use tokio::sync::mpsc; diff --git a/asic/src/tofino_asic/sde_log.rs b/asic/src/tofino_asic/sde_log.rs index 3add607..5a72c2d 100644 --- a/asic/src/tofino_asic/sde_log.rs +++ b/asic/src/tofino_asic/sde_log.rs @@ -146,7 +146,7 @@ impl fmt::Display for BfSdeLogModule { /// An FFI-compatible routine that the SDE's C code can call when it has a /// message to be logged. -#[no_mangle] +#[unsafe(no_mangle)] pub extern "C" fn bf_sys_log_callback( module: ::core::ffi::c_uint, level: ::core::ffi::c_uint, diff --git a/asic/src/tofino_asic/stats.rs b/asic/src/tofino_asic/stats.rs index ce127c6..7ff7944 100644 --- a/asic/src/tofino_asic/stats.rs +++ b/asic/src/tofino_asic/stats.rs @@ -4,10 +4,10 @@ // // Copyright 2025 Oxide Computer Company +use crate::FsmStats; use crate::tofino_asic::genpd::*; use crate::tofino_asic::ports; use crate::tofino_asic::{CheckError, Handle, PortFsmState}; -use crate::FsmStats; use std::collections::BTreeMap; use chrono::{DateTime, Utc}; diff --git a/asic/src/tofino_asic/table.rs b/asic/src/tofino_asic/table.rs index a113a76..43de3a1 100644 --- a/asic/src/tofino_asic/table.rs +++ b/asic/src/tofino_asic/table.rs @@ -453,7 +453,7 @@ impl Trigger { } } -#[no_mangle] +#[unsafe(no_mangle)] extern "C" fn sync_cb(_tgt: *mut bf_rt_target_t, cookie: *mut c_void) { let trigger = unsafe { (cookie as *mut Trigger) @@ -567,9 +567,8 @@ impl Table { }, Err(e) => { break Err(AsicError::Internal(format!( - "sync block failed: {:?}", - e - ))) + "sync block failed: {e:?}" + ))); } } }; diff --git a/asic/src/tofino_common/mod.rs b/asic/src/tofino_common/mod.rs index 104f91d..cebb27b 100644 --- a/asic/src/tofino_common/mod.rs +++ b/asic/src/tofino_common/mod.rs @@ -283,7 +283,7 @@ fn infer_p4_dir() -> AsicResult { _ => { return Err(AsicError::P4Missing( "dpd not in a workspace or dist package".into(), - )) + )); } }; Ok(exe_path @@ -359,18 +359,18 @@ impl BfRt { } } - if let Some(data) = &t.data { - if !data.is_empty() { - println!(" data:"); - for d in data { - let s = &d.singleton; - println!( - " {} {} {}", - s.name, - s.id, - s.dtype.as_ref().unwrap().dtype - ); - } + if let Some(data) = &t.data + && !data.is_empty() + { + println!(" data:"); + for d in data { + let s = &d.singleton; + println!( + " {} {} {}", + s.name, + s.id, + s.dtype.as_ref().unwrap().dtype + ); } } } @@ -384,7 +384,7 @@ impl BfRt { None => { return Err(AsicError::InvalidArg(format!( "no such table: {name}" - ))) + ))); } }; @@ -408,7 +408,7 @@ impl BfRt { "uint32" => 4, "uint16" => 2, "uint8" => 1, - _ => panic!("unknown type in {:?}", k), + _ => panic!("unknown type in {k:?}"), }, }, match_type: match k.match_type.as_str() { @@ -416,7 +416,7 @@ impl BfRt { "LPM" => MatchType::Lpm, "Ternary" => MatchType::Mask, "Range" => MatchType::Range, - x => panic!("unrecognized match type: {}", x), + x => panic!("unrecognized match type: {x}"), }, }; keys.insert(get_short(&k.name), f); diff --git a/asic/src/tofino_common/ports.rs b/asic/src/tofino_common/ports.rs index b28dec5..82b4a20 100644 --- a/asic/src/tofino_common/ports.rs +++ b/asic/src/tofino_common/ports.rs @@ -296,7 +296,7 @@ impl PhysPort { x => { return Err(AsicError::InvalidArg(format!( "unsupported speed: {x:?}", - ))) + ))); } }; if let Some(lane) = lane { diff --git a/asic/src/tofino_stub/mod.rs b/asic/src/tofino_stub/mod.rs index 9191fba..3e8d671 100644 --- a/asic/src/tofino_stub/mod.rs +++ b/asic/src/tofino_stub/mod.rs @@ -10,8 +10,8 @@ use std::sync::Mutex; use slog::{info, o}; use tokio::sync::mpsc; -use crate::tofino_common::*; use crate::Identifiers; +use crate::tofino_common::*; use aal::{ AsicError, AsicOps, AsicResult, Connector, PortHdl, PortUpdate, SidecarIdentifiers, diff --git a/asic/src/tofino_stub/ports.rs b/asic/src/tofino_stub/ports.rs index 6b86ee9..874490b 100644 --- a/asic/src/tofino_stub/ports.rs +++ b/asic/src/tofino_stub/ports.rs @@ -7,11 +7,11 @@ use std::collections::BTreeMap; use std::convert::TryFrom; +use crate::tofino_common::ports::CHANNELS_PER_SWITCH_PORT; pub use crate::tofino_common::ports::PhysPort; pub use crate::tofino_common::ports::PortData; pub use crate::tofino_common::ports::PortId; pub use crate::tofino_common::ports::TofinoPort; -use crate::tofino_common::ports::CHANNELS_PER_SWITCH_PORT; use crate::tofino_stub::FsmType; use crate::tofino_stub::PortFsmState; diff --git a/common/Cargo.toml b/common/Cargo.toml index 24235a3..7242f0e 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -2,7 +2,7 @@ name = "common" version = "0.1.0" authors = ["Nils Nieuwejaar "] -edition = "2021" +edition = "2024" [dependencies] anyhow.workspace = true diff --git a/common/src/lib.rs b/common/src/lib.rs index 2f375c4..f09c6f8 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -21,7 +21,7 @@ pub mod ports; pub mod illumos; mod smf; -pub use smf::{is_smf_active, SmfError, SmfResult}; +pub use smf::{SmfError, SmfResult, is_smf_active}; /// The default port on which the Dendrite API server listens. pub const DEFAULT_DPD_PORT: u16 = 12224; diff --git a/common/src/logging.rs b/common/src/logging.rs index a51085b..2092477 100644 --- a/common/src/logging.rs +++ b/common/src/logging.rs @@ -6,7 +6,7 @@ use std::str::FromStr; -use slog::{o, Drain}; +use slog::{Drain, o}; #[derive(Debug, Eq, PartialEq, Clone, Copy)] pub enum LogFormat { diff --git a/common/src/network.rs b/common/src/network.rs index a949f4c..f34ac11 100644 --- a/common/src/network.rs +++ b/common/src/network.rs @@ -250,9 +250,9 @@ pub fn validate_vlan(id: impl Into) -> Result<(), VlanError> { #[cfg(test)] mod tests { - use super::generate_ipv6_link_local; use super::Ipv6Addr; use super::MacAddr; + use super::generate_ipv6_link_local; #[test] fn test_into() { diff --git a/common/src/ports.rs b/common/src/ports.rs index 2917fc5..6f33007 100644 --- a/common/src/ports.rs +++ b/common/src/ports.rs @@ -254,7 +254,7 @@ impl JsonSchema for PortId { } fn json_schema( - _: &mut schemars::gen::SchemaGenerator, + _: &mut schemars::r#gen::SchemaGenerator, ) -> schemars::schema::Schema { const QSFP_REGEX: &str = r#"(^[qQ][sS][fF][pP](([0-9])|([1-2][0-9])|(3[0-1]))$)"#; diff --git a/dpd-client/Cargo.toml b/dpd-client/Cargo.toml index e30305a..b957076 100644 --- a/dpd-client/Cargo.toml +++ b/dpd-client/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "dpd-client" version = "0.1.0" -edition = "2021" +edition = "2024" description = "Client library for the Dendrite data plane daemon" [features] diff --git a/dpd-client/src/lib.rs b/dpd-client/src/lib.rs index 2c68a69..35ac31b 100644 --- a/dpd-client/src/lib.rs +++ b/dpd-client/src/lib.rs @@ -6,11 +6,11 @@ //! Client library for the Dendrite data plane daemon. +pub use common::ROLLBACK_FAILURE_ERROR_CODE; use common::counters; use common::nat; use common::network; use common::ports; -pub use common::ROLLBACK_FAILURE_ERROR_CODE; use slog::Logger; use std::cmp::Ordering; use std::fmt; @@ -359,8 +359,8 @@ impl fmt::Display for types::TfportData { impl fmt::Display for types::SffComplianceCode { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { - Self::Extended(ext) => write!(f, "{}", ext), - Self::Ethernet(eth) => write!(f, "{}", eth), + Self::Extended(ext) => write!(f, "{ext}"), + Self::Ethernet(eth) => write!(f, "{eth}"), } } } diff --git a/dpd-client/tests/chaos_tests/port_settings.rs b/dpd-client/tests/chaos_tests/port_settings.rs index 97b40aa..ff30ffa 100644 --- a/dpd-client/tests/chaos_tests/port_settings.rs +++ b/dpd-client/tests/chaos_tests/port_settings.rs @@ -9,19 +9,19 @@ use super::harness::{ new_dpd_client, run_dpd, }; use super::util::{link_list_ipv4, link_list_ipv6}; -use asic::chaos::{table, AsicConfig, Chaos, TableChaos}; +use asic::chaos::{AsicConfig, Chaos, TableChaos, table}; use asic::table_chaos; use dpd_client::types::{ LinkCreate, LinkId, LinkSettings, PortFec, PortId, PortSettings, PortSpeed, }; use dpd_client::{Client, ROLLBACK_FAILURE_ERROR_CODE}; use http::status::StatusCode; -use pretty_assertions::{assert_eq, Comparison}; +use pretty_assertions::{Comparison, assert_eq}; use rand::Rng; use std::collections::HashMap; use std::net::{Ipv4Addr, Ipv6Addr}; -use std::sync::atomic::{AtomicU8, Ordering}; use std::sync::Arc; +use std::sync::atomic::{AtomicU8, Ordering}; use tokio::time::Duration; const TESTING_RADIX: usize = 33; @@ -498,10 +498,10 @@ fn is_rollback_error(e: &dpd_client::Error) -> bool { if e.status() != Some(StatusCode::INTERNAL_SERVER_ERROR) { return false; } - if let dpd_client::Error::ErrorResponse(err) = e { - if err.error_code == Some(ROLLBACK_FAILURE_ERROR_CODE.into()) { - return true; - } + if let dpd_client::Error::ErrorResponse(err) = e + && err.error_code == Some(ROLLBACK_FAILURE_ERROR_CODE.into()) + { + return true; } false } diff --git a/dpd-client/tests/chaos_tests/util.rs b/dpd-client/tests/chaos_tests/util.rs index 413103e..22bc5c9 100644 --- a/dpd-client/tests/chaos_tests/util.rs +++ b/dpd-client/tests/chaos_tests/util.rs @@ -4,8 +4,8 @@ // // Copyright 2025 Oxide Computer Company -use dpd_client::types::{Ipv4Entry, Ipv6Entry}; use dpd_client::Client; +use dpd_client::types::{Ipv4Entry, Ipv6Entry}; use futures::TryStreamExt; pub(crate) async fn link_list_ipv4( diff --git a/dpd-client/tests/integration_tests/common.rs b/dpd-client/tests/integration_tests/common.rs index 0f2b4b7..362a416 100644 --- a/dpd-client/tests/integration_tests/common.rs +++ b/dpd-client/tests/integration_tests/common.rs @@ -8,7 +8,7 @@ use std::fmt::Write; use std::net::{IpAddr, Ipv4Addr, Ipv6Addr}; use std::sync::atomic::AtomicBool; use std::sync::atomic::Ordering; -use std::sync::{mpsc, Arc, Mutex}; +use std::sync::{Arc, Mutex, mpsc}; use std::time::Duration; use std::{fmt, thread}; @@ -18,18 +18,18 @@ use oxnet::Ipv6Net; use slog::Drain; use ::common::network::MacAddr; -use dpd_client::types; use dpd_client::Client; use dpd_client::ClientInfo; use dpd_client::ClientState; +use dpd_client::types; +use packet::Endpoint; +use packet::Packet; use packet::arp; use packet::eth; use packet::icmp; use packet::ipv4; use packet::ipv6; use packet::sidecar; -use packet::Endpoint; -use packet::Packet; use types::PortId; const SHOW_VERBOSE: u8 = 0x01; @@ -786,11 +786,13 @@ impl Switch { match errors.len() { 0 => Ok(()), - _ => Err(anyhow!(errors - .iter() - .map(|e| e.to_string()) - .collect::>() - .join(", "))), + _ => Err(anyhow!( + errors + .iter() + .map(|e| e.to_string()) + .collect::>() + .join(", ") + )), } } @@ -838,7 +840,7 @@ pub fn gen_tcp_packet_loaded( IpAddr::V6(_) => vec![ipv6::IPPROTO_TCP.into(), eth::ETHER_IPV6], }; - Packet::gen(src, dst, tcp_stack, Some(body)).unwrap() + Packet::generate(src, dst, tcp_stack, Some(body)).unwrap() } // Construct a single UDP packet with an optional payload @@ -852,7 +854,7 @@ pub fn gen_udp_packet_loaded( IpAddr::V6(_) => vec![ipv6::IPPROTO_UDP.into(), eth::ETHER_IPV6], }; - Packet::gen(src, dst, udp_stack, Some(body)).unwrap() + Packet::generate(src, dst, udp_stack, Some(body)).unwrap() } // Construct a single ICMP packet with an optional payload @@ -866,7 +868,7 @@ pub fn gen_icmp_packet_loaded( IpAddr::V6(_) => vec![ipv6::IPPROTO_ICMPV6.into(), eth::ETHER_IPV6], }; - Packet::gen(src, dst, icmp_stack, Some(body)).unwrap() + Packet::generate(src, dst, icmp_stack, Some(body)).unwrap() } // Given an ingressing IP packet, generate a corresponding IP packet egressing @@ -993,7 +995,7 @@ pub fn gen_geneve_packet( } }; - let mut pkt = Packet::gen(src, dst, udp_stack, Some(payload)).unwrap(); + let mut pkt = Packet::generate(src, dst, udp_stack, Some(payload)).unwrap(); let geneve = pkt.hdrs.geneve_hdr.as_mut().unwrap(); geneve.vni = vni; @@ -1394,7 +1396,7 @@ pub fn gen_ipv4_ping( ) -> Packet { let type_code: u16 = (icmp_type as u16) << 8 | icmp_code as u16; - Packet::gen( + Packet::generate( src, tgt, vec![type_code, ipv4::IPPROTO_ICMP as u16, eth::ETHER_IPV4], @@ -1404,15 +1406,16 @@ pub fn gen_ipv4_ping( } pub fn gen_arp_reply(src: Endpoint, tgt: Endpoint) -> Packet { - Packet::gen(src, tgt, vec![arp::ARPOP_REPLY, eth::ETHER_ARP], None).unwrap() + Packet::generate(src, tgt, vec![arp::ARPOP_REPLY, eth::ETHER_ARP], None) + .unwrap() } pub mod prelude { - pub use super::get_switch; + pub use super::NO_PORT; pub use super::PhysPort; + pub use super::SERVICE_PORT; pub use super::Switch; pub use super::TestPacket; pub use super::TestResult; - pub use super::NO_PORT; - pub use super::SERVICE_PORT; + pub use super::get_switch; } diff --git a/dpd-client/tests/integration_tests/counters.rs b/dpd-client/tests/integration_tests/counters.rs index 26b623a..6d2ed4c 100644 --- a/dpd-client/tests/integration_tests/counters.rs +++ b/dpd-client/tests/integration_tests/counters.rs @@ -18,9 +18,9 @@ use crate::integration_tests::common; use crate::integration_tests::common::prelude::*; use crate::integration_tests::icmp_ipv4; use ::common::network::MacAddr; +use dpd_client::ClientInfo; use dpd_client::types::Ipv4Entry; use dpd_client::types::Ipv6Entry; -use dpd_client::ClientInfo; // Run a single drop test. This sends a packet that we expect to be dropped, // and verifies that the expected drop counter is bumped by one. If the test diff --git a/dpd-client/tests/integration_tests/geneve.rs b/dpd-client/tests/integration_tests/geneve.rs index 49d3041..259c904 100644 --- a/dpd-client/tests/integration_tests/geneve.rs +++ b/dpd-client/tests/integration_tests/geneve.rs @@ -6,9 +6,9 @@ use std::sync::Arc; +use packet::Endpoint; use packet::eth; use packet::geneve; -use packet::Endpoint; use crate::integration_tests::common; use crate::integration_tests::common::prelude::*; diff --git a/dpd-client/tests/integration_tests/icmp_ipv4.rs b/dpd-client/tests/integration_tests/icmp_ipv4.rs index c2a882b..9d353dc 100644 --- a/dpd-client/tests/integration_tests/icmp_ipv4.rs +++ b/dpd-client/tests/integration_tests/icmp_ipv4.rs @@ -8,12 +8,12 @@ use std::net::{IpAddr, Ipv4Addr}; use std::sync::Arc; use ::common::network::MacAddr; -use dpd_client::types; use dpd_client::ClientInfo; +use dpd_client::types; +use packet::Endpoint; use packet::eth; use packet::icmp; use packet::ipv4; -use packet::Endpoint; use crate::integration_tests::common; use crate::integration_tests::common::prelude::*; diff --git a/dpd-client/tests/integration_tests/mcast.rs b/dpd-client/tests/integration_tests/mcast.rs index 45965a9..10f0e9d 100644 --- a/dpd-client/tests/integration_tests/mcast.rs +++ b/dpd-client/tests/integration_tests/mcast.rs @@ -14,10 +14,10 @@ use crate::integration_tests::common; use crate::integration_tests::common::prelude::*; use ::common::network::MacAddr; use anyhow::anyhow; -use dpd_client::{types, Error}; +use dpd_client::{Error, types}; use futures::TryStreamExt; use oxnet::{Ipv4Net, MulticastMac}; -use packet::{eth, geneve, ipv4, ipv6, udp, Endpoint}; +use packet::{Endpoint, eth, geneve, ipv4, ipv6, udp}; const MULTICAST_TEST_IPV4: Ipv4Addr = Ipv4Addr::new(224, 0, 1, 0); const MULTICAST_TEST_IPV6: Ipv6Addr = @@ -448,9 +448,15 @@ async fn test_nonexisting_group() { match res { Error::ErrorResponse(inner) => { - assert_eq!(inner.status(), 404, "Expected 404 Not Found status code"); - }, - _ => panic!("Expected ErrorResponse when getting a non-existent multicast group"), + assert_eq!( + inner.status(), + 404, + "Expected 404 Not Found status code" + ); + } + _ => panic!( + "Expected ErrorResponse when getting a non-existent multicast group" + ), } } @@ -536,7 +542,8 @@ async fn test_group_creation_with_validation() -> TestResult { .into_inner(); assert_eq!( - get_external_group_id(&internal_group), created.external_group_id, + get_external_group_id(&internal_group), + created.external_group_id, "External group should reference the same external group ID as the internal group" ); @@ -1817,8 +1824,8 @@ async fn test_ipv4_multicast_basic_replication_nat_ingress() -> TestResult { #[tokio::test] #[ignore] -async fn test_encapped_multicast_geneve_mcast_tag_to_external_members( -) -> TestResult { +async fn test_encapped_multicast_geneve_mcast_tag_to_external_members() +-> TestResult { let switch = &*get_switch().await; // Define test ports @@ -1959,8 +1966,8 @@ async fn test_encapped_multicast_geneve_mcast_tag_to_external_members( #[tokio::test] #[ignore] -async fn test_encapped_multicast_geneve_mcast_tag_to_underlay_members( -) -> TestResult { +async fn test_encapped_multicast_geneve_mcast_tag_to_underlay_members() +-> TestResult { let switch = &*get_switch().await; // Define test ports @@ -2098,8 +2105,8 @@ async fn test_encapped_multicast_geneve_mcast_tag_to_underlay_members( #[tokio::test] #[ignore] -async fn test_encapped_multicast_geneve_mcast_tag_to_underlay_and_external_members( -) -> TestResult { +async fn test_encapped_multicast_geneve_mcast_tag_to_underlay_and_external_members() +-> TestResult { let switch = &*get_switch().await; // Define test ports diff --git a/dpd-client/tests/integration_tests/nat.rs b/dpd-client/tests/integration_tests/nat.rs index 5784455..71583d6 100644 --- a/dpd-client/tests/integration_tests/nat.rs +++ b/dpd-client/tests/integration_tests/nat.rs @@ -13,8 +13,9 @@ use oxnet::Ipv6Net; use ::common::nat::Vni; use ::common::network::MacAddr; -use dpd_client::types; use dpd_client::ClientInfo; +use dpd_client::types; +use packet::Endpoint; use packet::eth; use packet::geneve; use packet::icmp; @@ -22,7 +23,6 @@ use packet::ipv4; use packet::ipv6; use packet::tcp; use packet::udp; -use packet::Endpoint; use crate::integration_tests::common; use crate::integration_tests::common::prelude::*; diff --git a/dpd-client/tests/integration_tests/port_api.rs b/dpd-client/tests/integration_tests/port_api.rs index 7e66c3c..1c20028 100644 --- a/dpd-client/tests/integration_tests/port_api.rs +++ b/dpd-client/tests/integration_tests/port_api.rs @@ -14,9 +14,9 @@ use reqwest::StatusCode; use ::common::ports::Ipv4Entry; use ::common::ports::Ipv6Entry; -use dpd_client::types; use dpd_client::ClientInfo; use dpd_client::Error; +use dpd_client::types; use types::PortId; use crate::integration_tests::common::prelude::*; @@ -382,13 +382,15 @@ async fn test_ipv6_clear() -> TestResult { .link_ipv6_delete(&port_id, &link_id, &c) .await .unwrap(); - assert!(switch - .client - .link_ipv6_list_stream(&port_id, &link_id, None) - .try_collect::>() - .await - .unwrap() - .is_empty()); + assert!( + switch + .client + .link_ipv6_list_stream(&port_id, &link_id, None) + .try_collect::>() + .await + .unwrap() + .is_empty() + ); Ok(()) } @@ -686,8 +688,8 @@ async fn test_create_existing_ipv6_address_fails() -> TestResult { // The same tests as above, but adding the IP address to a _different_ link. #[tokio::test] #[ignore] -async fn test_create_existing_ipv4_address_on_different_link_fails( -) -> TestResult { +async fn test_create_existing_ipv4_address_on_different_link_fails() +-> TestResult { let switch = &*get_switch().await; let entry = types::Ipv4Entry { @@ -719,8 +721,8 @@ async fn test_create_existing_ipv4_address_on_different_link_fails( #[tokio::test] #[ignore] -async fn test_create_existing_ipv6_address_on_different_link_fails( -) -> TestResult { +async fn test_create_existing_ipv6_address_on_different_link_fails() +-> TestResult { let switch = &*get_switch().await; let entry = types::Ipv6Entry { diff --git a/dpd-client/tests/integration_tests/route_ipv4.rs b/dpd-client/tests/integration_tests/route_ipv4.rs index 36b9f55..bcd0ee5 100644 --- a/dpd-client/tests/integration_tests/route_ipv4.rs +++ b/dpd-client/tests/integration_tests/route_ipv4.rs @@ -12,8 +12,8 @@ use oxnet::Ipv4Net; use crate::integration_tests::common; use crate::integration_tests::common::prelude::*; -use packet::eth::EthQHdr; use packet::Endpoint; +use packet::eth::EthQHdr; use dpd_client::types; diff --git a/dpd-client/tests/integration_tests/route_ipv6.rs b/dpd-client/tests/integration_tests/route_ipv6.rs index f4bdd84..c6c81f9 100644 --- a/dpd-client/tests/integration_tests/route_ipv6.rs +++ b/dpd-client/tests/integration_tests/route_ipv6.rs @@ -10,7 +10,7 @@ use std::sync::Arc; use oxnet::Ipv6Net; use ::common::network::MacAddr; -use packet::{ipv6, sidecar, Endpoint}; +use packet::{Endpoint, ipv6, sidecar}; use crate::integration_tests::common; use crate::integration_tests::common::prelude::*; @@ -571,8 +571,7 @@ async fn test_ipv6_link_local_multicast_hop_limit_one() -> TestResult { switch.get_counter("ipv6_ttl_invalid", None).await.unwrap(); assert_eq!( - ctr_final_hop_limit, - ctr_baseline_hop_limit, + ctr_final_hop_limit, ctr_baseline_hop_limit, "Hop limit invalid counter should not increment for link-local multicast with hop limit 1" ); diff --git a/dpd-client/tests/integration_tests/service.rs b/dpd-client/tests/integration_tests/service.rs index 6dcd6b1..a3ac1f7 100644 --- a/dpd-client/tests/integration_tests/service.rs +++ b/dpd-client/tests/integration_tests/service.rs @@ -7,9 +7,9 @@ use std::sync::Arc; use ::common::network::MacAddr; -use dpd_client::types::Ipv4Entry; use dpd_client::ClientInfo; -use packet::{eth, icmp, ipv4, sidecar, Endpoint}; +use dpd_client::types::Ipv4Entry; +use packet::{Endpoint, eth, icmp, ipv4, sidecar}; use crate::integration_tests::common; use crate::integration_tests::common::prelude::*; @@ -379,7 +379,8 @@ async fn execute_test_service_lldp(nat_only: bool) -> TestResult { // contains a single data-bearing TLV, while a real LLDP header has at // least 3 TLVs. let send_pkt = - packet::Packet::gen(src, tgt, vec![eth::ETHER_LLDP], None).unwrap(); + packet::Packet::generate(src, tgt, vec![eth::ETHER_LLDP], None) + .unwrap(); let mut recv_pkt = send_pkt.clone(); let send = TestPacket { diff --git a/dpd-client/tests/integration_tests/table_tests.rs b/dpd-client/tests/integration_tests/table_tests.rs index aee6ba4..88eb7a8 100644 --- a/dpd-client/tests/integration_tests/table_tests.rs +++ b/dpd-client/tests/integration_tests/table_tests.rs @@ -15,9 +15,9 @@ use oxnet::Ipv6Net; use reqwest::StatusCode; use crate::integration_tests::common::prelude::*; -use dpd_client::types; use dpd_client::ClientInfo; use dpd_client::ResponseValue; +use dpd_client::types; // The expected sizes of each table. The values are copied from constants.p4. // diff --git a/dpd-types/src/link.rs b/dpd-types/src/link.rs index f2201bb..622e473 100644 --- a/dpd-types/src/link.rs +++ b/dpd-types/src/link.rs @@ -106,9 +106,9 @@ impl std::fmt::Debug for LinkState { LinkState::Up => write!(f, "Up"), LinkState::Down => write!(f, "Down"), LinkState::ConfigError(detail) => { - write!(f, "ConfigError - {:?}", detail) + write!(f, "ConfigError - {detail:?}") } - LinkState::Faulted(reason) => write!(f, "Faulted - {:?}", reason), + LinkState::Faulted(reason) => write!(f, "Faulted - {reason:?}"), LinkState::Unknown => write!(f, "Unknown"), } } diff --git a/dpd-types/src/mcast.rs b/dpd-types/src/mcast.rs index a4e5935..cf90b5f 100644 --- a/dpd-types/src/mcast.rs +++ b/dpd-types/src/mcast.rs @@ -91,8 +91,8 @@ pub enum IpSrc { impl fmt::Display for IpSrc { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { - IpSrc::Exact(ip) => write!(f, "{}", ip), - IpSrc::Subnet(subnet) => write!(f, "{}", subnet), + IpSrc::Exact(ip) => write!(f, "{ip}"), + IpSrc::Subnet(subnet) => write!(f, "{subnet}"), } } } diff --git a/dpd/Cargo.toml b/dpd/Cargo.toml index c8460a8..404081b 100644 --- a/dpd/Cargo.toml +++ b/dpd/Cargo.toml @@ -2,7 +2,7 @@ name = "dpd" version = "0.2.0" authors = ["nils "] -edition = "2021" +edition = "2024" [features] tofino_asic = ["asic/tofino_asic"] @@ -30,6 +30,7 @@ dpd-types.workspace = true anyhow.workspace = true cfg-if.workspace = true chrono.workspace = true +clap.workspace = true console-subscriber = { version = "0.4.1", optional = true } csv.workspace = true display-error-chain.workspace = true @@ -46,7 +47,6 @@ serde_json.workspace = true signal-hook.workspace = true signal-hook-tokio.workspace = true slog.workspace = true -structopt.workspace = true strum.workspace = true thiserror.workspace = true tokio = { workspace = true, features = ["full"] } diff --git a/dpd/build.rs b/dpd/build.rs index d6c0445..6c6660f 100644 --- a/dpd/build.rs +++ b/dpd/build.rs @@ -31,7 +31,7 @@ compile_error!( fn err(what: T) -> io::Error { let tmp = format!("{what}"); - io::Error::new(io::ErrorKind::Other, tmp) + io::Error::other(tmp) } fn project_root() -> io::Result { diff --git a/dpd/src/api_server.rs b/dpd/src/api_server.rs index 7440357..8656591 100644 --- a/dpd/src/api_server.rs +++ b/dpd/src/api_server.rs @@ -58,7 +58,7 @@ use crate::switch_port::FixedSideDevice; use crate::switch_port::LedState; use crate::transceivers::PowerState; use crate::types::DpdError; -use crate::{arp, loopback, nat, ports, route, Switch}; +use crate::{Switch, arp, loopback, nat, ports, route}; use common::nat::{Ipv4Nat, Ipv6Nat, NatTarget}; use common::network::MacAddr; use common::ports::PortId; @@ -96,7 +96,7 @@ impl DpdApi for DpdApiImpl { WhichPage::Next(ArpToken { ip }) => match ip { IpAddr::V6(ip) => Some(ip), IpAddr::V4(_) => { - return Err(DpdError::Invalid("bad token".into()).into()) + return Err(DpdError::Invalid("bad token".into()).into()); } }, }; @@ -180,7 +180,7 @@ impl DpdApi for DpdApiImpl { WhichPage::First(..) => None, WhichPage::Next(ArpToken { ip }) => match ip { IpAddr::V6(_) => { - return Err(DpdError::Invalid("bad token".into()).into()) + return Err(DpdError::Invalid("bad token".into()).into()); } IpAddr::V4(ip) => Some(ip), }, @@ -2208,14 +2208,13 @@ mod tests { let re = regex::Regex::new(r"SDE_COMMIT=(\S*)").unwrap(); let all = re.captures(&config).unwrap(); if all.len() != 2 { - panic!("{} is missing the SDE_COMMIT= line", path); + panic!("{path} is missing the SDE_COMMIT= line"); } all[1].to_string() }; if !expected_sde.contains(build_sde) { panic!( - "dpd built with SDE ({}). repo configured for SDE ({}).", - build_sde, expected_sde + "dpd built with SDE ({build_sde}). repo configured for SDE ({expected_sde})." ); } } diff --git a/dpd/src/arp.rs b/dpd/src/arp.rs index 96dc5e6..51237e2 100644 --- a/dpd/src/arp.rs +++ b/dpd/src/arp.rs @@ -13,7 +13,7 @@ use chrono::prelude::*; use slog::debug; use crate::types::{DpdError, DpdResult}; -use crate::{table, Switch}; +use crate::{Switch, table}; use common::network::MacAddr; #[derive(Clone)] diff --git a/dpd/src/config.rs b/dpd/src/config.rs index 238731f..336ead5 100644 --- a/dpd/src/config.rs +++ b/dpd/src/config.rs @@ -12,7 +12,7 @@ use crate::types::DpdResult; #[cfg(target_os = "illumos")] use common::illumos::smf; -use common::{network::MacAddr, SmfError, SmfResult}; +use common::{SmfError, SmfResult, network::MacAddr}; #[cfg(feature = "chaos")] use asic::chaos::AsicConfig; diff --git a/dpd/src/counters.rs b/dpd/src/counters.rs index 530775f..dfad527 100644 --- a/dpd/src/counters.rs +++ b/dpd/src/counters.rs @@ -17,9 +17,9 @@ use std::convert::TryInto; use std::sync::Arc; use std::sync::Mutex; +use crate::Switch; use crate::table; use crate::types::{DpdError, DpdResult}; -use crate::Switch; use aal::MatchParse; use aal_macros::*; use asic::Handle; @@ -372,7 +372,7 @@ fn reason_label(ctr: u8) -> Result, String> { async fn port_label(switch: &Switch, ctr: u16) -> Option { switch .asic_port_id_to_port_link(ctr) - .map(|(port, link)| format!("{}/{}", port, link)) + .map(|(port, link)| format!("{port}/{link}")) .ok() } diff --git a/dpd/src/link.rs b/dpd/src/link.rs index 50e9e61..ea1f8ae 100644 --- a/dpd/src/link.rs +++ b/dpd/src/link.rs @@ -6,21 +6,21 @@ //! Manage logical Ethernet links on the Sidecar switch. +use crate::MacAddr; +use crate::Switch; use crate::fault::AutonegTracker; use crate::fault::Faultable; use crate::fault::LinkUpTracker; use crate::ports::AdminEvent; use crate::ports::Event; +use crate::table::MacOps; use crate::table::mcast; use crate::table::port_ip; use crate::table::port_mac; use crate::table::port_nat; -use crate::table::MacOps; use crate::transceivers::qsfp_xcvr_mpn; use crate::types::DpdError; use crate::types::DpdResult; -use crate::MacAddr; -use crate::Switch; use aal::AsicId; use aal::AsicOps; use aal::AsicResult; @@ -48,9 +48,9 @@ use slog::error; use slog::info; use slog::o; use slog::warn; -use std::collections::btree_map::Entry; use std::collections::BTreeMap; use std::collections::BTreeSet; +use std::collections::btree_map::Entry; use std::net::Ipv4Addr; use std::net::Ipv6Addr; use std::sync::Arc; @@ -915,12 +915,11 @@ impl Switch { // We count transitions from down->up, but ignore any // up->up events. In practice those shouldn't happen, // but there is no guarantee. - if old_state == LinkState::Down { - if let Some(fault) = + if old_state == LinkState::Down + && let Some(fault) = link.linkup_tracker.process_event(&()) - { - self.link_set_fault_locked(&mut link, fault)?; - } + { + self.link_set_fault_locked(&mut link, fault)?; } } else if !old_state.is_fault() { // If we are in a faulted state, we stay there until the @@ -1825,11 +1824,9 @@ async fn reconcile_link( false }; - if destroy { - if let Err(e) = unplumb_link(switch, &log, &mut link) { - error!(log, "failed to unplumb link: {e:?}"); - return; - } + if destroy && let Err(e) = unplumb_link(switch, &log, &mut link) { + error!(log, "failed to unplumb link: {e:?}"); + return; } if link.config.delete_me { @@ -1841,23 +1838,20 @@ async fn reconcile_link( } drop(links); - if !link.plumbed.link_created { - if let Err(e) = plumb_link(switch, &log, &mut link, &mpn) { - error!(log, "Failed to plumb link: {e:?}"); - record_plumb_failure( - switch, - &mut link, - "configuring link in the switch asic", - &e, - ); - if let Err(e) = unplumb_link(switch, &log, &mut link) { - error!( - log, - "Failed to clean up following plumb failure: {e:?}" - ); - } - return; + if !link.plumbed.link_created + && let Err(e) = plumb_link(switch, &log, &mut link, &mpn) + { + error!(log, "Failed to plumb link: {e:?}"); + record_plumb_failure( + switch, + &mut link, + "configuring link in the switch asic", + &e, + ); + if let Err(e) = unplumb_link(switch, &log, &mut link) { + error!(log, "Failed to clean up following plumb failure: {e:?}"); } + return; } let asic_id = link.asic_port_id; @@ -1975,7 +1969,7 @@ async fn reconcile_link( record_plumb_failure( switch, &mut link, - &format!("updating PRBS mode to {}", prbs), + &format!("updating PRBS mode to {prbs}"), &e, ); error!(log, "Failed to set PRBS: {:?}", e); diff --git a/dpd/src/loopback.rs b/dpd/src/loopback.rs index 4401a62..1275d82 100644 --- a/dpd/src/loopback.rs +++ b/dpd/src/loopback.rs @@ -4,7 +4,7 @@ // // Copyright 2025 Oxide Computer Company -use crate::{table, DpdError, DpdResult, Switch}; +use crate::{DpdError, DpdResult, Switch, table}; use aal::AsicError; use common::ports::{Ipv4Entry, Ipv6Entry}; use slog::debug; diff --git a/dpd/src/macaddrs.rs b/dpd/src/macaddrs.rs index 7074faf..951f19b 100644 --- a/dpd/src/macaddrs.rs +++ b/dpd/src/macaddrs.rs @@ -10,14 +10,14 @@ use dpd_types::link::LinkId; use slog::debug; use slog::o; +use crate::Switch; use crate::types::DpdError; use crate::types::DpdResult; -use crate::Switch; use common::network::MacAddr; -use common::ports::PortId; use common::ports::PORT_COUNT_INTERNAL; use common::ports::PORT_COUNT_QSFP; use common::ports::PORT_COUNT_REAR; +use common::ports::PortId; cfg_if::cfg_if! { if #[cfg(feature = "tofino_asic")] { @@ -102,7 +102,7 @@ pub(crate) enum BaseMac { impl core::fmt::Display for BaseMac { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self) + write!(f, "{self:?}") } } diff --git a/dpd/src/main.rs b/dpd/src/main.rs index 30b0192..dd9467b 100644 --- a/dpd/src/main.rs +++ b/dpd/src/main.rs @@ -16,6 +16,7 @@ use std::sync::Mutex; use std::sync::MutexGuard; use anyhow::Context; +use clap::{Parser, Subcommand}; use dpd_api::LinkCreate; use dpd_types::link::LinkId; use dpd_types::oxstats::OximeterMetadata; @@ -30,10 +31,9 @@ use signal_hook_tokio::Signals; use slog::debug; use slog::error; use slog::info; -use structopt::StructOpt; use tokio::sync::Mutex as TokioMutex; -use tokio::time::sleep; use tokio::time::Duration; +use tokio::time::sleep; use crate::macaddrs::BaseMac; use crate::port_map::SidecarRevision; @@ -80,8 +80,15 @@ mod transceivers; mod types; mod version; -#[derive(Debug, StructOpt)] -#[structopt(name = "dpd", about = "dataplane controller for oxide switch")] +/// dataplane controller for oxide switch +#[derive(Debug, Parser)] +pub struct Cli { + #[command(subcommand)] + args: Args, +} + +#[derive(Debug, Subcommand)] +#[clap(name = "dpd")] pub(crate) enum Args { /// Run the Dendrite API server. Run(Opt), @@ -89,101 +96,83 @@ pub(crate) enum Args { Openapi, } -#[derive(Debug, Default, StructOpt)] -#[structopt(name = "dpd", about = "dataplane controller for oxide switch")] +/// dataplane controller for oxide switch +#[derive(Debug, Default, Parser)] +#[clap(name = "dpd")] pub(crate) struct Opt { - #[structopt( - long, - about = "send log data to the named file rather than stdout" - )] + /// send log data to the named file rather than stdout + #[clap(long)] log_file: Option, - #[structopt( - long, - short = "l", - about = "log format", - help = "format logs for 'human' or 'json' consumption" - )] + /// log format + /// + /// format logs for 'human' or 'json' consumption + #[clap(long, short = 'l')] log_format: Option, // TODO-correctness: This argument may need to change or go away. The // control plane ultimately will set the addresses for each switch port // independently, but it's not clear whether that makes sense in the SoftNPU // and Intel simulator implementations. - #[structopt( - long, - help = "set the base mac address for the switch", - parse(try_from_str) - )] + /// set the base mac address for the switch + #[clap(long)] mac_base: Option, - #[structopt( - long, - help = "file defining the ports to configure at startup" - )] + /// file defining the ports to configure at startup + #[clap(long)] port_config: Option, - #[structopt( - long, - help = "file describing alternate settings for some transceivers" - )] + /// file describing alternate settings for some transceivers + #[clap(long)] xcvr_defaults: Option, // TODO-completeness: This will ultimately go away in the product, or be // ignored, as the value will ideally be determined from the FRUID data in // the Sidecar itself. + /// Revision of the Sidecar which Dendrite will manage #[cfg_attr(not(feature = "tofino_asic"), allow(dead_code))] - #[structopt( - long, - help = "Revision of the Sidecar which Dendrite will manage", - parse(try_from_str) - )] + #[clap(long)] sidecar_revision: Option, - #[structopt( - long, - help = "IP addresses and ports on which to expose the API server" - )] + /// IP addresses and ports on which to expose the API server + #[clap(long)] listen_addresses: Option>, + /// path to the tofino device #[cfg(feature = "tofino_asic")] - #[structopt(long, about = "path to the tofino device")] + #[clap(long)] device_path: Option, + /// path to the the chaos testing configuration #[cfg(feature = "chaos")] - #[structopt(long, about = "path to the the chaos testing configuration")] + #[clap(long)] chaos_config: Option, // NOTE: This should never be set to something other than the default // `sidecar0` in the product. + /// IP interface over which to communicate with + /// the Hubris transceivers task for controlling + /// QSFP modules #[cfg_attr(not(feature = "tofino_asic"), allow(dead_code))] - #[structopt( - long, - help = "\ - IP interface over which to communicate with \ - the Hubris transceivers task for controlling \ - QSFP modules." - )] + #[clap(long)] transceiver_interface: Option, + /// Mechanism for controlling SoftNPU emulated switch #[cfg(feature = "softnpu")] - #[structopt( - long, - about = "Mechanism for controlling SoftNPU emulated switch" - )] + #[clap(long)] softnpu_management: Option, + /// Path to UNIX domain socket to use for communicating with asic #[cfg(feature = "softnpu")] - #[structopt( - long, - about = "Path to UNIX domain socket to use for communicating with asic" - )] + #[clap(long)] uds_path: Option, - #[structopt(long, about = "Enable RPW services.")] + /// Enable RPW services + #[clap(long)] enable_rpw: bool, - #[structopt(long, about = "IP address and port of nexus server.")] + /// IP address and port of nexus server + #[clap(long)] nexus_address: Option, } @@ -274,7 +263,7 @@ impl Switch { Err(AsicError::AsicMissing) => { panic!("Unable to find the network switch ASIC") } - Err(e) => panic!("unable to initialize bf: {:?}", e), + Err(e) => panic!("unable to initialize bf: {e:?}"), }; let switch_ports = SwitchPorts::new( @@ -326,7 +315,7 @@ impl Switch { pub fn table_get( &self, id: table::TableType, - ) -> DpdResult> { + ) -> DpdResult> { match self.tables.get(&id) { Some(table) => Ok(table.lock().unwrap()), None => Err("no such table".into()), @@ -799,9 +788,9 @@ async fn sidecar_main(mut switch: Switch) -> anyhow::Result<()> { } fn main() -> anyhow::Result<()> { - let args = Args::from_args(); + let cli = Cli::parse(); - match args { + match cli.args { Args::Openapi => print_openapi(), Args::Run(opt) => oxide_tokio_rt::run(run_dpd(opt)), } diff --git a/dpd/src/mcast/mod.rs b/dpd/src/mcast/mod.rs index a26a5aa..801b179 100644 --- a/dpd/src/mcast/mod.rs +++ b/dpd/src/mcast/mod.rs @@ -13,13 +13,13 @@ //! //! There are two types of multicast groups: //! - **External (Overlay) groups**: Entry points for overlay traffic, -//! have NAT targets, VLAN IDs, and no direct members. External groups -//! reference internal groups via NAT targets to perform the -//! actual packet replication and forwarding. +//! have NAT targets, VLAN IDs, and no direct members. External groups +//! reference internal groups via NAT targets to perform the +//! actual packet replication and forwarding. //! //! - **Internal (Underlay) groups**: Handle actual packet replication to -//! members, containing ALL members (either direction - overlay or -//! underlay). +//! members, containing ALL members (either direction - overlay or +//! underlay). //! //! ### Member Directions //! @@ -76,9 +76,8 @@ use oxnet::Ipv4Net; use slog::{debug, error, warn}; use crate::{ - table, + Switch, table, types::{DpdError, DpdResult}, - Switch, }; mod rollback; @@ -97,12 +96,11 @@ impl Drop for ScopedIdInner { /// Only return to free pool if not taken and if the free pool still /// exists. fn drop(&mut self) { - if self.0 != 0 { - if let Some(free_ids) = self.1.upgrade() { - if let Ok(mut pool) = free_ids.lock() { - pool.push(self.0); - } - } + if self.0 != 0 + && let Some(free_ids) = self.1.upgrade() + && let Ok(mut pool) = free_ids.lock() + { + pool.push(self.0); } } } @@ -116,7 +114,7 @@ struct ScopedGroupId(Arc); impl ScopedGroupId { /// Get the underlying group ID value. fn id(&self) -> MulticastGroupId { - self.0 .0 + self.0.0 } } @@ -651,11 +649,9 @@ pub(crate) fn modify_group_external( ) } Some(_) => Ok(()), // Internal group exists but has no replication - None => { - Err(DpdError::Invalid(format!( - "internal group not found when updating bitmap: internal_ip={internal_ip}, external_group={group_ip}", - ))) - } + None => Err(DpdError::Invalid(format!( + "internal group not found when updating bitmap: internal_ip={internal_ip}, external_group={group_ip}", + ))), }; if let Err(e) = bitmap_result { @@ -881,11 +877,7 @@ pub(crate) fn reset_untagged(s: &Switch) -> DpdResult<()> { .iter() .filter_map( |(ip, group)| { - if group.tag.is_none() { - Some(*ip) - } else { - None - } + if group.tag.is_none() { Some(*ip) } else { None } }, ) .collect::>() @@ -1914,8 +1906,8 @@ mod tests { // Pool should have all IDs back (minus any that might still be in use) let pool_size = { let data = mcast_data.lock().unwrap(); - let pool_len = data.free_group_ids.lock().unwrap().len(); - pool_len + + data.free_group_ids.lock().unwrap().len() }; // Should have close to the original number of IDs diff --git a/dpd/src/mcast/rollback.rs b/dpd/src/mcast/rollback.rs index a7de12c..f862f38 100644 --- a/dpd/src/mcast/rollback.rs +++ b/dpd/src/mcast/rollback.rs @@ -20,11 +20,11 @@ use slog::{debug, error}; use common::{nat::NatTarget, ports::PortId}; use super::{ - add_source_filters, remove_source_filters, update_fwding_tables, - update_replication_tables, Direction, IpSrc, LinkId, MulticastGroup, - MulticastGroupId, MulticastGroupMember, MulticastReplicationInfo, + Direction, IpSrc, LinkId, MulticastGroup, MulticastGroupId, + MulticastGroupMember, MulticastReplicationInfo, add_source_filters, + remove_source_filters, update_fwding_tables, update_replication_tables, }; -use crate::{table, types::DpdResult, Switch}; +use crate::{Switch, table, types::DpdResult}; /// Trait providing shared rollback functionality for multicast group operations. /// @@ -777,19 +777,19 @@ impl<'a> GroupUpdateRollbackContext<'a> { removed_ports: &[MulticastGroupMember], ) -> E { // Get replication info from original group - if let Some(replication_info) = &self.original_group.replication_info { - if let Err(rollback_err) = self.rollback_internal_update( + if let Some(replication_info) = &self.original_group.replication_info + && let Err(rollback_err) = self.rollback_internal_update( added_ports, removed_ports, replication_info, - ) { - error!( - self.switch.log, - "rollback failed for internal group update"; - "group" => %self.group_ip, - "error" => ?rollback_err, - ); - } + ) + { + error!( + self.switch.log, + "rollback failed for internal group update"; + "group" => %self.group_ip, + "error" => ?rollback_err, + ); } error } diff --git a/dpd/src/mcast/validate.rs b/dpd/src/mcast/validate.rs index 75ee442..f039469 100644 --- a/dpd/src/mcast/validate.rs +++ b/dpd/src/mcast/validate.rs @@ -189,14 +189,13 @@ fn validate_ipv6_multicast( /// Validates that IPv6 addresses are not admin-scoped for external group creation. pub(crate) fn validate_not_admin_scoped_ipv6(addr: IpAddr) -> DpdResult<()> { - if let IpAddr::V6(ipv6) = addr { - if oxnet::Ipv6Net::new_unchecked(ipv6, 128).is_admin_scoped_multicast() - { - return Err(DpdError::Invalid(format!( - "{addr} is an admin-scoped multicast address and \ + if let IpAddr::V6(ipv6) = addr + && oxnet::Ipv6Net::new_unchecked(ipv6, 128).is_admin_scoped_multicast() + { + return Err(DpdError::Invalid(format!( + "{addr} is an admin-scoped multicast address and \ must be created via the internal multicast API", - ))); - } + ))); } Ok(()) } @@ -314,45 +313,59 @@ mod tests { assert!( validate_ipv4_multicast(Ipv4Addr::new(224, 0, 0, 5), None).is_err() ); // Link-local - assert!(validate_ipv4_multicast(Ipv4Addr::new(192, 168, 1, 1), None) - .is_err()); // Not multicast + assert!( + validate_ipv4_multicast(Ipv4Addr::new(192, 168, 1, 1), None) + .is_err() + ); // Not multicast } #[test] fn test_ipv6_validation() { // These should be allowed - assert!(validate_ipv6_multicast( - Ipv6Addr::new(0xff0e, 0, 0, 0, 0, 0, 0, 0x1234), - None - ) - .is_ok()); // Global - assert!(validate_ipv6_multicast( - Ipv6Addr::new(0xff05, 0, 0, 0, 0, 0, 0, 0x1111), - None - ) - .is_ok()); // Site-local - assert!(validate_ipv6_multicast( - Ipv6Addr::new(0xff08, 0, 0, 0, 0, 0, 0, 0x5678), - None - ) - .is_ok()); // Organization-local + assert!( + validate_ipv6_multicast( + Ipv6Addr::new(0xff0e, 0, 0, 0, 0, 0, 0, 0x1234), + None + ) + .is_ok() + ); // Global + assert!( + validate_ipv6_multicast( + Ipv6Addr::new(0xff05, 0, 0, 0, 0, 0, 0, 0x1111), + None + ) + .is_ok() + ); // Site-local + assert!( + validate_ipv6_multicast( + Ipv6Addr::new(0xff08, 0, 0, 0, 0, 0, 0, 0x5678), + None + ) + .is_ok() + ); // Organization-local // These should be rejected - assert!(validate_ipv6_multicast( - Ipv6Addr::new(0xff02, 0, 0, 0, 0, 0, 0, 0x1), - None - ) - .is_err()); // Link-local - assert!(validate_ipv6_multicast( - Ipv6Addr::new(0xff01, 0, 0, 0, 0, 0, 0, 0x2,), - None - ) - .is_err()); // Interface-local - assert!(validate_ipv6_multicast( - Ipv6Addr::new(0x2001, 0xdb8, 0, 0, 0, 0, 0, 0x1), - None - ) - .is_err()); // Not multicast + assert!( + validate_ipv6_multicast( + Ipv6Addr::new(0xff02, 0, 0, 0, 0, 0, 0, 0x1), + None + ) + .is_err() + ); // Link-local + assert!( + validate_ipv6_multicast( + Ipv6Addr::new(0xff01, 0, 0, 0, 0, 0, 0, 0x2,), + None + ) + .is_err() + ); // Interface-local + assert!( + validate_ipv6_multicast( + Ipv6Addr::new(0x2001, 0xdb8, 0, 0, 0, 0, 0, 0x1), + None + ) + .is_err() + ); // Not multicast } #[test] @@ -379,7 +392,9 @@ mod tests { assert!(validate_ipv4_multicast(ssm_addr, Some(&[])).is_err()); // SSM address with exact source - should pass - assert!(validate_ipv4_multicast(ssm_addr, Some(&exact_sources)).is_ok()); + assert!( + validate_ipv4_multicast(ssm_addr, Some(&exact_sources)).is_ok() + ); // SSM address with subnet source - should pass assert!( @@ -387,15 +402,23 @@ mod tests { ); // SSM address with mixed sources - should pass - assert!(validate_ipv4_multicast(ssm_addr, Some(&mixed_sources)).is_ok()); + assert!( + validate_ipv4_multicast(ssm_addr, Some(&mixed_sources)).is_ok() + ); // Non-SSM address with sources - should fail as source specs only allowed for SSM - assert!(validate_ipv4_multicast(non_ssm_addr, Some(&exact_sources)) - .is_err()); - assert!(validate_ipv4_multicast(non_ssm_addr, Some(&subnet_sources)) - .is_err()); - assert!(validate_ipv4_multicast(non_ssm_addr, Some(&mixed_sources)) - .is_err()); + assert!( + validate_ipv4_multicast(non_ssm_addr, Some(&exact_sources)) + .is_err() + ); + assert!( + validate_ipv4_multicast(non_ssm_addr, Some(&subnet_sources)) + .is_err() + ); + assert!( + validate_ipv4_multicast(non_ssm_addr, Some(&mixed_sources)) + .is_err() + ); // Non-SSM address without sources - should pass assert!(validate_ipv4_multicast(non_ssm_addr, None).is_ok()); @@ -417,11 +440,15 @@ mod tests { assert!(validate_ipv6_multicast(ssm_global, Some(&[])).is_err()); // SSM address with IPv6 source - should pass - assert!(validate_ipv6_multicast(ssm_global, Some(&ip6_sources)).is_ok()); + assert!( + validate_ipv6_multicast(ssm_global, Some(&ip6_sources)).is_ok() + ); // Non-SSM address with IPv6 source - should fail - assert!(validate_ipv6_multicast(non_ssm_global, Some(&ip6_sources)) - .is_err()); + assert!( + validate_ipv6_multicast(non_ssm_global, Some(&ip6_sources)) + .is_err() + ); // Non-SSM address without sources - should pass assert!(validate_ipv6_multicast(non_ssm_global, None).is_ok()); @@ -461,76 +488,94 @@ mod tests { // Test the main validate_multicast_address function // Valid IPv4 non-SSM address, no sources - assert!(validate_multicast_address( - IpAddr::V4(Ipv4Addr::new(224, 1, 0, 1)), - None - ) - .is_ok()); + assert!( + validate_multicast_address( + IpAddr::V4(Ipv4Addr::new(224, 1, 0, 1)), + None + ) + .is_ok() + ); // Valid IPv4 SSM address with sources let sources = vec![ IpSrc::Exact(IpAddr::V4(Ipv4Addr::new(192, 168, 1, 1))), IpSrc::Subnet(Ipv4Net::from_str("10.0.0.0/8").unwrap()), ]; - assert!(validate_multicast_address( - IpAddr::V4(Ipv4Addr::new(232, 1, 2, 3)), - Some(&sources) - ) - .is_ok()); + assert!( + validate_multicast_address( + IpAddr::V4(Ipv4Addr::new(232, 1, 2, 3)), + Some(&sources) + ) + .is_ok() + ); // Valid IPv6 non-SSM address, no sources - assert!(validate_multicast_address( - IpAddr::V6(Ipv6Addr::new(0xff0e, 0, 0, 0, 0, 0, 0, 0x1234)), - None - ) - .is_ok()); + assert!( + validate_multicast_address( + IpAddr::V6(Ipv6Addr::new(0xff0e, 0, 0, 0, 0, 0, 0, 0x1234)), + None + ) + .is_ok() + ); // Valid IPv6 SSM address with sources let ip6_sources = vec![IpSrc::Exact(IpAddr::V6(Ipv6Addr::new( 0x2001, 0xdb8, 0, 0, 0, 0, 0, 0x1, )))]; - assert!(validate_multicast_address( - IpAddr::V6(Ipv6Addr::new(0xff3e, 0, 0, 0, 0, 0, 0, 0x1234)), - Some(&ip6_sources) - ) - .is_ok()); + assert!( + validate_multicast_address( + IpAddr::V6(Ipv6Addr::new(0xff3e, 0, 0, 0, 0, 0, 0, 0x1234)), + Some(&ip6_sources) + ) + .is_ok() + ); // Error cases // Not a multicast address - assert!(validate_multicast_address( - IpAddr::V4(Ipv4Addr::new(192, 168, 1, 1)), - None - ) - .is_err()); + assert!( + validate_multicast_address( + IpAddr::V4(Ipv4Addr::new(192, 168, 1, 1)), + None + ) + .is_err() + ); // IPv4 SSM without sources - assert!(validate_multicast_address( - IpAddr::V4(Ipv4Addr::new(232, 1, 2, 3)), - None - ) - .is_err()); + assert!( + validate_multicast_address( + IpAddr::V4(Ipv4Addr::new(232, 1, 2, 3)), + None + ) + .is_err() + ); // IPv4 non-SSM with sources - assert!(validate_multicast_address( - IpAddr::V4(Ipv4Addr::new(224, 1, 2, 3)), - Some(&sources) - ) - .is_err()); + assert!( + validate_multicast_address( + IpAddr::V4(Ipv4Addr::new(224, 1, 2, 3)), + Some(&sources) + ) + .is_err() + ); // IPv6 SSM without sources - assert!(validate_multicast_address( - IpAddr::V6(Ipv6Addr::new(0xff3e, 0, 0, 0, 0, 0, 0, 0x1234)), - None - ) - .is_err()); + assert!( + validate_multicast_address( + IpAddr::V6(Ipv6Addr::new(0xff3e, 0, 0, 0, 0, 0, 0, 0x1234)), + None + ) + .is_err() + ); // IPv6 non-SSM with sources - assert!(validate_multicast_address( - IpAddr::V6(Ipv6Addr::new(0xff0e, 0, 0, 0, 0, 0, 0, 0x1234)), - Some(&ip6_sources) - ) - .is_err()); + assert!( + validate_multicast_address( + IpAddr::V6(Ipv6Addr::new(0xff0e, 0, 0, 0, 0, 0, 0, 0x1234)), + Some(&ip6_sources) + ) + .is_err() + ); } #[test] @@ -611,7 +656,9 @@ mod tests { // Invalid multicast subnet let invalid_mcast_subnet = vec![IpSrc::Subnet(Ipv4Net::from_str("224.0.0.0/24").unwrap())]; - assert!(validate_source_addresses(Some(&invalid_mcast_subnet)).is_err()); + assert!( + validate_source_addresses(Some(&invalid_mcast_subnet)).is_err() + ); // Invalid loopback subnet let invalid_loopback_subnet = @@ -634,11 +681,13 @@ mod tests { // Valid case: SSM address with valid unicast sources let valid_sources = vec![IpSrc::Exact(IpAddr::V4(Ipv4Addr::new(192, 168, 1, 1)))]; - assert!(validate_multicast_address( - IpAddr::V4(Ipv4Addr::new(232, 1, 2, 3)), - Some(&valid_sources) - ) - .is_ok()); + assert!( + validate_multicast_address( + IpAddr::V4(Ipv4Addr::new(232, 1, 2, 3)), + Some(&valid_sources) + ) + .is_ok() + ); // Invalid case: SSM address with multicast source (should fail source validation first) let invalid_mcast_sources = @@ -648,10 +697,12 @@ mod tests { Some(&invalid_mcast_sources), ); assert!(result.is_err()); - assert!(result - .unwrap_err() - .to_string() - .contains("must be a unicast address")); + assert!( + result + .unwrap_err() + .to_string() + .contains("must be a unicast address") + ); // Invalid case: SSM address with loopback source let invalid_loopback_sources = @@ -661,9 +712,11 @@ mod tests { Some(&invalid_loopback_sources), ); assert!(result.is_err()); - assert!(result - .unwrap_err() - .to_string() - .contains("is not a valid source address")); + assert!( + result + .unwrap_err() + .to_string() + .contains("is not a valid source address") + ); } } diff --git a/dpd/src/nat.rs b/dpd/src/nat.rs index cf33627..37177c9 100644 --- a/dpd/src/nat.rs +++ b/dpd/src/nat.rs @@ -10,9 +10,9 @@ use std::fmt; use std::net::{Ipv4Addr, Ipv6Addr}; use std::ops::Bound; +use crate::Switch; use crate::table::nat; use crate::types::{DpdError, DpdResult}; -use crate::Switch; use common::nat::{Ipv4Nat, Ipv6Nat, NatTarget}; trait PortRange { @@ -245,10 +245,10 @@ pub fn get_ipv6_mapping( high: u16, ) -> DpdResult { let nat = switch.nat.lock().unwrap(); - if let Some(v) = nat.ipv6_mappings.get(&nat_ip) { - if let Some(idx) = find_first_mapping(v, low, high) { - return Ok(v[idx].tgt); - } + if let Some(v) = nat.ipv6_mappings.get(&nat_ip) + && let Some(idx) = find_first_mapping(v, low, high) + { + return Ok(v[idx].tgt); } Err(DpdError::Missing("no mapping".into())) } @@ -271,7 +271,7 @@ pub fn set_ipv6_mapping( let mut nat = switch.nat.lock().unwrap(); let (entries, idx) = match nat.ipv6_mappings.get_mut(&nat_ip) { Some(e) => { - if e.iter().any(|entry| *entry == new_entry) { + if e.contains(&new_entry) { // entry already exists return Ok(()); } @@ -280,8 +280,7 @@ pub fn set_ipv6_mapping( None => { trace!( switch.log, - "unable to add nat entry {}: conflicting mapping", - full + "unable to add nat entry {}: conflicting mapping", full ); return Err(DpdError::Exists("conflicting mapping".into())); } @@ -317,26 +316,24 @@ pub fn clear_ipv6_mapping( let mut nat = switch.nat.lock().unwrap(); trace!(switch.log, "clearing nat entry {}/{}-{}", nat_ip, low, high); - if let Some(mappings) = nat.ipv6_mappings.get_mut(&nat_ip) { - if let Some(idx) = find_first_mapping(mappings, low, high) { - let ent = mappings.remove(idx); - if mappings.is_empty() { - nat.ipv6_mappings.remove(&nat_ip); - } - let full = ipv6_entry(nat_ip, &ent); - return match nat::delete_ipv6_entry( - switch, nat_ip, ent.low, ent.high, - ) { - Err(e) => { - error!(switch.log, "failed to clear {}: {:?}", full, e); - Err(e) - } - _ => { - debug!(switch.log, "cleared nat entry {}", full); - Ok(()) - } - }; + if let Some(mappings) = nat.ipv6_mappings.get_mut(&nat_ip) + && let Some(idx) = find_first_mapping(mappings, low, high) + { + let ent = mappings.remove(idx); + if mappings.is_empty() { + nat.ipv6_mappings.remove(&nat_ip); } + let full = ipv6_entry(nat_ip, &ent); + return match nat::delete_ipv6_entry(switch, nat_ip, ent.low, ent.high) { + Err(e) => { + error!(switch.log, "failed to clear {}: {:?}", full, e); + Err(e) + } + _ => { + debug!(switch.log, "cleared nat entry {}", full); + Ok(()) + } + }; } Ok(()) @@ -408,10 +405,10 @@ pub fn get_ipv4_mapping( high: u16, ) -> DpdResult { let nat = switch.nat.lock().unwrap(); - if let Some(v) = nat.ipv4_mappings.get(&nat_ip) { - if let Some(idx) = find_first_mapping(v, low, high) { - return Ok(v[idx].tgt); - } + if let Some(v) = nat.ipv4_mappings.get(&nat_ip) + && let Some(idx) = find_first_mapping(v, low, high) + { + return Ok(v[idx].tgt); } Err(DpdError::Missing("no mapping".into())) } @@ -434,7 +431,7 @@ pub fn set_ipv4_mapping( let mut nat = switch.nat.lock().unwrap(); let (entries, idx) = match nat.ipv4_mappings.get_mut(&nat_ip) { Some(e) => { - if e.iter().any(|entry| *entry == new_entry) { + if e.contains(&new_entry) { // entry already exists return Ok(()); } @@ -479,32 +476,27 @@ pub fn clear_ipv4_mapping( let mut nat = switch.nat.lock().unwrap(); trace!( switch.log, - "clearing nat entry covering {}/{}-{}", - nat_ip, - low, - high + "clearing nat entry covering {}/{}-{}", nat_ip, low, high ); - if let Some(mappings) = nat.ipv4_mappings.get_mut(&nat_ip) { - if let Some(idx) = find_first_mapping(mappings, low, high) { - let ent = mappings.remove(idx); - if mappings.is_empty() { - nat.ipv4_mappings.remove(&nat_ip); - } - let full = ipv4_entry(nat_ip, &ent); - return match nat::delete_ipv4_entry( - switch, nat_ip, ent.low, ent.high, - ) { - Err(e) => { - error!(switch.log, "failed to clear {}: {:?}", full, e); - Err(e) - } - _ => { - debug!(switch.log, "cleared nat entry {}", full); - Ok(()) - } - }; + if let Some(mappings) = nat.ipv4_mappings.get_mut(&nat_ip) + && let Some(idx) = find_first_mapping(mappings, low, high) + { + let ent = mappings.remove(idx); + if mappings.is_empty() { + nat.ipv4_mappings.remove(&nat_ip); } + let full = ipv4_entry(nat_ip, &ent); + return match nat::delete_ipv4_entry(switch, nat_ip, ent.low, ent.high) { + Err(e) => { + error!(switch.log, "failed to clear {}: {:?}", full, e); + Err(e) + } + _ => { + debug!(switch.log, "cleared nat entry {}", full); + Ok(()) + } + }; } Ok(()) @@ -521,10 +513,7 @@ pub fn clear_overlapping_ipv4_mappings( let mut nat = switch.nat.lock().unwrap(); trace!( switch.log, - "clearing all nat entries overlapping with {}/{}-{}", - nat_ip, - low, - high + "clearing all nat entries overlapping with {}/{}-{}", nat_ip, low, high ); if let Some(mappings) = nat.ipv4_mappings.get_mut(&nat_ip) { @@ -579,11 +568,11 @@ pub fn reset_ipv4(switch: &Switch) -> DpdResult<()> { } } -pub fn set_ipv4_nat_generation(switch: &Switch, gen: i64) { +pub fn set_ipv4_nat_generation(switch: &Switch, generation: i64) { let mut nat = switch.nat.lock().unwrap(); debug!(switch.log, "setting nat generation"); - nat.ipv4_generation = gen; + nat.ipv4_generation = generation; } pub fn get_ipv4_nat_generation(switch: &Switch) -> i64 { diff --git a/dpd/src/oxstats.rs b/dpd/src/oxstats.rs index e87e840..28f4f7b 100644 --- a/dpd/src/oxstats.rs +++ b/dpd/src/oxstats.rs @@ -22,14 +22,14 @@ use uuid::Uuid; use omicron_common::api::internal::nexus::{ProducerEndpoint, ProducerKind}; use omicron_common::api::internal::shared::SledIdentifiers; use omicron_common::backoff::{ - retry_notify, retry_policy_internal_service_aggressive, BackoffError, + BackoffError, retry_notify, retry_policy_internal_service_aggressive, }; use oximeter::types::{ProducerRegistry, Sample}; use oximeter::{MetricsError, Producer}; -use crate::table; use crate::DpdResult; use crate::Switch; +use crate::table; use aal::PortHdl; use asic::AsicLinkStats; use asic::FsmStats; @@ -639,7 +639,10 @@ async fn wait_for_switch_identifiers( ); return Ok(idents); } else { - info!(log, "missing switch identifiers from configuration, will continue to poll"); + info!( + log, + "missing switch identifiers from configuration, will continue to poll" + ); } } diff --git a/dpd/src/port_map.rs b/dpd/src/port_map.rs index 0e45ad0..2f00119 100644 --- a/dpd/src/port_map.rs +++ b/dpd/src/port_map.rs @@ -68,7 +68,7 @@ impl fmt::Display for SidecarRevision { SidecarRevision::A => "A".into(), SidecarRevision::B => "B".into(), SidecarRevision::Soft { front, rear } => - format!("Soft_{}_{}", front, rear), + format!("Soft_{front}_{rear}"), SidecarRevision::Chaos => "chaos".into(), } ) @@ -270,7 +270,7 @@ mod tests { panic!(); }; let link = BackplaneLink::from_cubby(rear.as_u8()).unwrap(); - println!("{i} -> {:?} -> {port_id}", link); + println!("{i} -> {link:?} -> {port_id}"); } } diff --git a/dpd/src/port_settings.rs b/dpd/src/port_settings.rs index adf5b7d..3ef0366 100644 --- a/dpd/src/port_settings.rs +++ b/dpd/src/port_settings.rs @@ -4,11 +4,11 @@ // // Copyright 2025 Oxide Computer Company -use crate::link::Link; -use crate::link::LinkParams; use crate::DpdError; use crate::DpdResult; use crate::Switch; +use crate::link::Link; +use crate::link::LinkParams; use aal::AsicOps; use common::ports::Ipv4Entry; use common::ports::Ipv6Entry; @@ -19,10 +19,10 @@ use common::ports::TxEq; use dpd_api::LinkSettings; use dpd_api::PortSettings; use dpd_types::link::LinkId; +use slog::Logger; use slog::debug; use slog::error; use slog::trace; -use slog::Logger; use std::collections::BTreeSet; use std::collections::HashMap; use std::net::IpAddr; diff --git a/dpd/src/ports.rs b/dpd/src/ports.rs index dae46cd..0783f90 100644 --- a/dpd/src/ports.rs +++ b/dpd/src/ports.rs @@ -19,8 +19,8 @@ use aal::AsicOps; use aal::Connector; use aal::PortHdl; -use crate::types::DpdResult; use crate::Switch; +use crate::types::DpdResult; use common::ports::PortId; /// Represents a specific administrative action taken on a link diff --git a/dpd/src/route.rs b/dpd/src/route.rs index 8665100..28a8bb6 100644 --- a/dpd/src/route.rs +++ b/dpd/src/route.rs @@ -107,7 +107,6 @@ use std::collections::BTreeMap; use std::convert::TryFrom; -use std::convert::TryInto; use std::net::{IpAddr, Ipv4Addr, Ipv6Addr}; use std::ops::Bound; @@ -119,7 +118,7 @@ use slog::info; use crate::freemap; use crate::types::{DpdError, DpdResult}; -use crate::{table, Switch}; +use crate::{Switch, table}; use common::ports::PortId; use oxnet::{IpNet, Ipv4Net, Ipv6Net}; @@ -237,58 +236,6 @@ impl RouteEntry { } } -/// A Vlan identifier, made up of a port, link, and vlan tag. -#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Clone)] -struct VlanId { - // The switch port out which routed traffic is sent. - port_id: PortId, - // The link out which routed traffic is sent. - link_id: LinkId, - // Vlan tag - 0 for an untagged network - vlan_id: u16, -} - -impl VlanId { - fn new(port_id: PortId, link_id: LinkId, vlan_id: u16) -> DpdResult { - if vlan_id > 0 { - common::network::validate_vlan(vlan_id)?; - } - Ok(VlanId { - port_id, - link_id, - vlan_id, - }) - } -} - -impl TryFrom<&Ipv4Route> for VlanId { - type Error = DpdError; - fn try_from(route: &Ipv4Route) -> DpdResult { - VlanId::new(route.port_id, route.link_id, route.vlan_id.unwrap_or(0)) - } -} - -impl TryFrom for VlanId { - type Error = DpdError; - fn try_from(route: Ipv4Route) -> DpdResult { - (&route).try_into() - } -} - -impl TryFrom<&Ipv6Route> for VlanId { - type Error = DpdError; - fn try_from(route: &Ipv6Route) -> DpdResult { - VlanId::new(route.port_id, route.link_id, route.vlan_id.unwrap_or(0)) - } -} - -impl TryFrom for VlanId { - type Error = DpdError; - fn try_from(route: Ipv6Route) -> DpdResult { - (&route).try_into() - } -} - pub struct RouteData { v4: BTreeMap, v6: BTreeMap, @@ -435,18 +382,18 @@ fn replace_route_targets( "replacing targets for {subnet} with: {targets:?}" ); let old_entry = route_data.remove(subnet); - if let Some(ref old) = old_entry { - if let Err(e) = match subnet { + if let Some(ref old) = old_entry + && let Err(e) = match subnet { IpNet::V4(v4) => table::route_ipv4::delete_route_index(switch, &v4), IpNet::V6(v6) => table::route_ipv6::delete_route_index(switch, &v6), - } { - debug!( - switch.log, - "failed to delete route index, restoring internal data" - ); - route_data.insert(subnet, old.clone()); - return Err(e); } + { + debug!( + switch.log, + "failed to delete route index, restoring internal data" + ); + route_data.insert(subnet, old.clone()); + return Err(e); } // If the new set of targets is empty, the route has been deleted and there @@ -587,10 +534,10 @@ async fn add_route( let mut route_data = switch.routes.lock().await; // Adding the same route multiple times is a harmless no-op - if let Some(entry) = route_data.get(subnet) { - if entry.targets.iter().any(|hop| hop.route == route) { - return Ok(()); - } + if let Some(entry) = route_data.get(subnet) + && entry.targets.iter().any(|hop| hop.route == route) + { + return Ok(()); } add_route_locked(switch, &mut route_data, subnet, route, asic_port_id) } diff --git a/dpd/src/rpw/mod.rs b/dpd/src/rpw/mod.rs index a9ddded..7235e61 100644 --- a/dpd/src/rpw/mod.rs +++ b/dpd/src/rpw/mod.rs @@ -10,22 +10,22 @@ use std::{ sync::{Arc, RwLock}, }; -use anyhow::{anyhow, Result}; +use anyhow::{Result, anyhow}; use common::{ nat::{NatTarget, Vni}, network::MacAddr, }; use internal_dns_resolver::Resolver; use internal_dns_types::names::ServiceName; -use slog::{debug, error, info, o, Logger}; +use slog::{Logger, debug, error, info, o}; use tokio::{ spawn, - time::{sleep, Duration, Instant}, + time::{Duration, Instant, sleep}, }; -use crate::{nat, oxstats::is_localhost, types::DpdError::Exists, Switch}; -use nexus_client::types::NatEntryView; +use crate::{Switch, nat, oxstats::is_localhost, types::DpdError::Exists}; use nexus_client::Client as NexusClient; +use nexus_client::types::NatEntryView; static IPV4_NAT_INTERVAL: Duration = Duration::from_secs(30); pub const NEXUS_INTERNAL_PORT: u16 = 12221; @@ -110,21 +110,26 @@ pub async fn ipv4_nat_workflow( wait(timer.clone()).await; debug!(log, "starting ipv4 nat reconciliation"); - let gen = nat::get_ipv4_nat_generation(&switch); - debug!(log, "we are currently at ipv4 nat generation: {gen}"); + let generation = nat::get_ipv4_nat_generation(&switch); + debug!( + log, + "we are currently at ipv4 nat generation: {}", generation + ); - let mut updates = match fetch_nat_updates(&client, gen, &log).await { - Some(value) => value, - None => { - update_timer(timer.clone(), IPV4_NAT_INTERVAL); - continue; - } - }; + let mut updates = + match fetch_nat_updates(&client, generation, &log).await { + Some(value) => value, + None => { + update_timer(timer.clone(), IPV4_NAT_INTERVAL); + continue; + } + }; debug!(log, "request successful"; "response" => ?updates); while !updates.is_empty() { debug!(log, "applying updates"); - let new_gen = apply_updates(&switch, gen, updates.into_inner()); + let new_gen = + apply_updates(&switch, generation, updates.into_inner()); updates = match fetch_nat_updates(&client, new_gen, &log).await { Some(value) => value, @@ -139,11 +144,11 @@ pub async fn ipv4_nat_workflow( async fn fetch_nat_updates( client: &NexusClient, - gen: i64, + generation: i64, log: &Logger, ) -> Option>> { debug!(log, "checking Nexus for updates"); - let updates = match client.ipv4_nat_changeset(gen, 100).await { + let updates = match client.ipv4_nat_changeset(generation, 100).await { Ok(response) => response, Err(e) => { error!(log, "unable to retrieve nat updates"; "error" => ?e); @@ -157,7 +162,7 @@ async fn fetch_nat_updates( /// applied change. fn apply_updates( switch: &Switch, - mut gen: i64, + mut generation: i64, updates: Vec, ) -> i64 { for entry in &updates { @@ -223,10 +228,10 @@ fn apply_updates( } } // update gen if nat entry update was successful - gen = entry.gen; - nat::set_ipv4_nat_generation(switch, gen); + generation = entry.r#gen; + nat::set_ipv4_nat_generation(switch, generation); } - gen + generation } async fn wait(timer: Arc>) { @@ -297,5 +302,5 @@ async fn nexus_client_with_resolver( // Create nexus client using fixed ip address fn nexus_client(address: &str, log: &slog::Logger) -> NexusClient { - nexus_client::Client::new(&format!("http://{}", address), log.clone()) + nexus_client::Client::new(&format!("http://{address}"), log.clone()) } diff --git a/dpd/src/softnpu_api_server.rs b/dpd/src/softnpu_api_server.rs index 3820d1b..dbfd71d 100644 --- a/dpd/src/softnpu_api_server.rs +++ b/dpd/src/softnpu_api_server.rs @@ -6,16 +6,16 @@ use std::sync::Arc; -use dropshot::endpoint; use dropshot::HttpError; use dropshot::HttpResponseOk; use dropshot::HttpResponseUpdatedNoContent; use dropshot::Path; use dropshot::RequestContext; use dropshot::TypedBody; +use dropshot::endpoint; -use crate::types::DpdError; use crate::Switch; +use crate::types::DpdError; use aal::AsicOps; use common::ports::TxEq; use common::ports::TxEqSwHw; diff --git a/dpd/src/switch_identifiers.rs b/dpd/src/switch_identifiers.rs index 1f7daa9..91612a7 100644 --- a/dpd/src/switch_identifiers.rs +++ b/dpd/src/switch_identifiers.rs @@ -18,7 +18,7 @@ use aal::{AsicOps, SidecarIdentifiers}; use omicron_common::{ address::MGS_PORT, backoff::{ - retry_notify, retry_policy_internal_service_aggressive, BackoffError, + BackoffError, retry_notify, retry_policy_internal_service_aggressive, }, }; diff --git a/dpd/src/switch_port.rs b/dpd/src/switch_port.rs index a18f298..8362449 100644 --- a/dpd/src/switch_port.rs +++ b/dpd/src/switch_port.rs @@ -222,7 +222,7 @@ impl SwitchPort { #[cfg(feature = "tofino_asic")] pub fn as_backplane(&self) -> Option<&FakeQsfpModule> { match &self.fixed_side { - FixedSideDevice::Backplane { ref device, .. } => Some(device), + FixedSideDevice::Backplane { device, .. } => Some(device), _ => None, } } @@ -234,7 +234,7 @@ impl SwitchPort { #[cfg(feature = "tofino_asic")] pub fn as_backplane_mut(&mut self) -> Option<&mut FakeQsfpModule> { match &mut self.fixed_side { - FixedSideDevice::Backplane { ref mut device, .. } => Some(device), + FixedSideDevice::Backplane { device, .. } => Some(device), _ => None, } } @@ -244,7 +244,7 @@ impl SwitchPort { /// If the port is not a QSFP port, `None` will be returned. pub fn as_qsfp(&self) -> Option<&QsfpDevice> { match &self.fixed_side { - FixedSideDevice::Qsfp { ref device, .. } => Some(device), + FixedSideDevice::Qsfp { device, .. } => Some(device), _ => None, } } @@ -255,7 +255,7 @@ impl SwitchPort { /// If the port is not a QSFP port, `None` will be returned. pub fn as_qsfp_mut(&mut self) -> Option<&mut QsfpDevice> { match &mut self.fixed_side { - FixedSideDevice::Qsfp { ref mut device, .. } => Some(device), + FixedSideDevice::Qsfp { device, .. } => Some(device), _ => None, } } @@ -264,7 +264,7 @@ impl SwitchPort { #[cfg_attr(not(feature = "tofino_asic"), allow(dead_code))] pub fn led_policy(&self) -> Option<&LedPolicy> { match &self.fixed_side { - FixedSideDevice::Qsfp { ref led_policy, .. } => Some(led_policy), + FixedSideDevice::Qsfp { led_policy, .. } => Some(led_policy), _ => None, } } @@ -273,9 +273,7 @@ impl SwitchPort { #[cfg_attr(not(feature = "tofino_asic"), allow(dead_code))] pub fn led_policy_mut(&mut self) -> Option<&mut LedPolicy> { match &mut self.fixed_side { - FixedSideDevice::Qsfp { - ref mut led_policy, .. - } => Some(led_policy), + FixedSideDevice::Qsfp { led_policy, .. } => Some(led_policy), _ => None, } } diff --git a/dpd/src/table/arp_ipv4.rs b/dpd/src/table/arp_ipv4.rs index 21d27e8..95c050b 100644 --- a/dpd/src/table/arp_ipv4.rs +++ b/dpd/src/table/arp_ipv4.rs @@ -7,8 +7,8 @@ use std::convert::TryInto; use std::net::Ipv4Addr; -use crate::table::*; use crate::Switch; +use crate::table::*; use aal_macros::*; use common::network::MacAddr; diff --git a/dpd/src/table/mcast/mcast_egress.rs b/dpd/src/table/mcast/mcast_egress.rs index ff7086f..e050c2a 100644 --- a/dpd/src/table/mcast/mcast_egress.rs +++ b/dpd/src/table/mcast/mcast_egress.rs @@ -8,7 +8,7 @@ use std::fmt; -use crate::{table::*, Switch}; +use crate::{Switch, table::*}; use aal::{ActionParse, MatchParse}; use aal_macros::*; diff --git a/dpd/src/table/mcast/mcast_nat.rs b/dpd/src/table/mcast/mcast_nat.rs index d01c4f1..044c7cb 100644 --- a/dpd/src/table/mcast/mcast_nat.rs +++ b/dpd/src/table/mcast/mcast_nat.rs @@ -8,7 +8,7 @@ use std::net::{Ipv4Addr, Ipv6Addr}; -use crate::{table::*, Switch}; +use crate::{Switch, table::*}; use super::{Ipv4MatchKey, Ipv6MatchKey}; diff --git a/dpd/src/table/mcast/mcast_replication.rs b/dpd/src/table/mcast/mcast_replication.rs index a1e60ef..46fef82 100644 --- a/dpd/src/table/mcast/mcast_replication.rs +++ b/dpd/src/table/mcast/mcast_replication.rs @@ -8,7 +8,7 @@ use std::net::Ipv6Addr; -use crate::{table::*, Switch}; +use crate::{Switch, table::*}; use super::Ipv6MatchKey; diff --git a/dpd/src/table/mcast/mcast_route.rs b/dpd/src/table/mcast/mcast_route.rs index f6abd95..8fcf789 100644 --- a/dpd/src/table/mcast/mcast_route.rs +++ b/dpd/src/table/mcast/mcast_route.rs @@ -8,7 +8,7 @@ use std::net::{Ipv4Addr, Ipv6Addr}; -use crate::{table::*, Switch}; +use crate::{Switch, table::*}; use super::{Ipv4MatchKey, Ipv6MatchKey}; diff --git a/dpd/src/table/mcast/mcast_src_filter.rs b/dpd/src/table/mcast/mcast_src_filter.rs index c058640..133de4b 100644 --- a/dpd/src/table/mcast/mcast_src_filter.rs +++ b/dpd/src/table/mcast/mcast_src_filter.rs @@ -11,7 +11,7 @@ use std::{ net::{Ipv4Addr, Ipv6Addr}, }; -use crate::{table::*, Switch}; +use crate::{Switch, table::*}; use aal::{ActionParse, MatchParse}; use aal_macros::*; diff --git a/dpd/src/table/mod.rs b/dpd/src/table/mod.rs index 295373b..34ca62f 100644 --- a/dpd/src/table/mod.rs +++ b/dpd/src/table/mod.rs @@ -9,8 +9,8 @@ use std::hash::Hash; use slog::{debug, error, info}; -use crate::types::*; use crate::Switch; +use crate::types::*; use aal::ActionParse; use aal::MatchParse; use aal::TableOps; diff --git a/dpd/src/table/nat.rs b/dpd/src/table/nat.rs index 0cbd26b..43bb40b 100644 --- a/dpd/src/table/nat.rs +++ b/dpd/src/table/nat.rs @@ -13,8 +13,8 @@ use slog::debug; use aal::{ActionParse, MatchParse, MatchRange}; use aal_macros::*; -use crate::table::*; use crate::Switch; +use crate::table::*; use common::nat::NatTarget; use common::network::MacAddr; diff --git a/dpd/src/table/neighbor_ipv6.rs b/dpd/src/table/neighbor_ipv6.rs index 996180c..fb54c74 100644 --- a/dpd/src/table/neighbor_ipv6.rs +++ b/dpd/src/table/neighbor_ipv6.rs @@ -12,8 +12,8 @@ use slog::debug; use aal::{ActionParse, MatchParse}; use aal_macros::*; -use crate::table::*; use crate::Switch; +use crate::table::*; use common::network::MacAddr; pub const TABLE_NAME: &str = "pipe.Ingress.l3_router.Router6.Ndp.tbl"; diff --git a/dpd/src/table/port_ip.rs b/dpd/src/table/port_ip.rs index 0a3d322..f81524a 100644 --- a/dpd/src/table/port_ip.rs +++ b/dpd/src/table/port_ip.rs @@ -11,8 +11,8 @@ use std::net::Ipv6Addr; use slog::error; use slog::info; -use crate::table::*; use crate::Switch; +use crate::table::*; use aal::ActionParse; use aal::MatchMask; use aal::MatchParse; diff --git a/dpd/src/table/port_nat.rs b/dpd/src/table/port_nat.rs index 64b5a5c..64eabcb 100644 --- a/dpd/src/table/port_nat.rs +++ b/dpd/src/table/port_nat.rs @@ -8,8 +8,8 @@ use std::convert::TryInto; use slog::{error, info}; -use crate::table::*; use crate::Switch; +use crate::table::*; use aal::{ActionParse, MatchParse}; use aal_macros::*; diff --git a/dpd/src/table/route_ipv4.rs b/dpd/src/table/route_ipv4.rs index 429938b..93d1003 100644 --- a/dpd/src/table/route_ipv4.rs +++ b/dpd/src/table/route_ipv4.rs @@ -7,8 +7,8 @@ use std::convert::TryInto; use std::net::Ipv4Addr; -use crate::table::*; use crate::Switch; +use crate::table::*; use aal::ActionParse; use aal::MatchParse; use aal_macros::*; diff --git a/dpd/src/table/route_ipv6.rs b/dpd/src/table/route_ipv6.rs index e13cb34..e96c20f 100644 --- a/dpd/src/table/route_ipv6.rs +++ b/dpd/src/table/route_ipv6.rs @@ -7,8 +7,8 @@ use std::convert::TryInto; use std::net::Ipv6Addr; -use crate::table::*; use crate::Switch; +use crate::table::*; use aal::ActionParse; use aal::MatchParse; use aal_macros::*; diff --git a/dpd/src/tofino_api_server.rs b/dpd/src/tofino_api_server.rs index 216afc5..b663726 100644 --- a/dpd/src/tofino_api_server.rs +++ b/dpd/src/tofino_api_server.rs @@ -8,19 +8,19 @@ use std::sync::Arc; use dpd_api::LinkPath; use dpd_types::link::LinkId; -use dropshot::endpoint; use dropshot::HttpError; use dropshot::HttpResponseOk; use dropshot::HttpResponseUpdatedNoContent; use dropshot::Path; use dropshot::RequestContext; use dropshot::TypedBody; +use dropshot::endpoint; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; -use crate::types::DpdError; use crate::PortId; use crate::Switch; +use crate::types::DpdError; use asic::tofino_asic::serdes; use asic::tofino_asic::stats; use common::counters::FecRSCounters; @@ -30,20 +30,6 @@ use common::counters::RMonCountersAll; use common::ports::TxEq; use common::ports::TxEqSwHw; -/// A logical lane within a link -pub(crate) type LaneId = u8; - -/// Identifies a single logical lane within a link -#[derive(Deserialize, Serialize, JsonSchema)] -pub(crate) struct LanePath { - /// The switch port on which to operate. - pub port_id: PortId, - /// The link in the switch port on which to operate. - pub link_id: LinkId, - /// The lane within the link on which to operate. - pub lane_id: LaneId, -} - /// The FEC counters for a specific link, including its link ID. #[derive(Clone, Debug, Deserialize, JsonSchema, Serialize)] pub struct LinkFecRSCounters { diff --git a/dpd/src/transceivers/stub_impl.rs b/dpd/src/transceivers/stub_impl.rs index 06fa7ab..7f74816 100644 --- a/dpd/src/transceivers/stub_impl.rs +++ b/dpd/src/transceivers/stub_impl.rs @@ -11,9 +11,9 @@ //! `dpd`, such as in the API endpoint handlers themselves, should have stub //! implementations. +use crate::Switch; use crate::types::DpdError; use crate::types::DpdResult; -use crate::Switch; use common::ports::QsfpPort; use tokio::sync::RwLockReadGuard; use transceiver_controller::Controller; @@ -60,7 +60,7 @@ impl Switch { pub async fn transceiver_controller( &self, - ) -> DpdResult> { + ) -> DpdResult> { Err(DpdError::NoTransceiverController) } } diff --git a/dpd/src/transceivers/tofino_impl.rs b/dpd/src/transceivers/tofino_impl.rs index 9005070..e8e308b 100644 --- a/dpd/src/transceivers/tofino_impl.rs +++ b/dpd/src/transceivers/tofino_impl.rs @@ -41,13 +41,13 @@ // both in some conditions. Regardless, the controller must always be acquired // first to avoid deadlocks. +use crate::Switch; use crate::port_map::PortMap; use crate::switch_port::LedState; use crate::switch_port::SwitchPort; use crate::switch_port::SwitchPorts; use crate::types::DpdError; use crate::types::DpdResult; -use crate::Switch; use aal::Connector; use asic::tofino_asic::qsfp::ReadRequest; use asic::tofino_asic::qsfp::SdeTransceiverMessage; @@ -61,32 +61,26 @@ use dpd_types::switch_port::LedPolicy; use dpd_types::switch_port::ManagementMode; use dpd_types::transceivers::FaultReason; use dpd_types::transceivers::Transceiver; +use slog::Logger; use slog::debug; use slog::error; use slog::info; use slog::o; use slog::trace; use slog::warn; -use slog::Logger; use std::collections::BTreeMap; use std::convert::TryFrom; -use std::sync::atomic::AtomicBool; -use std::sync::atomic::Ordering; use std::sync::Arc; use std::sync::Mutex as StdMutex; +use std::sync::atomic::AtomicBool; +use std::sync::atomic::Ordering; use std::time::Duration; -use tokio::sync::mpsc; use tokio::sync::MappedMutexGuard; use tokio::sync::Mutex; use tokio::sync::MutexGuard; use tokio::sync::Notify; +use tokio::sync::mpsc; use tokio::time::sleep; -use transceiver_controller::filter_module_data; -use transceiver_controller::message::ExtendedStatus; -use transceiver_controller::mgmt; -use transceiver_controller::mgmt::cmis::page_accepts_bank_number; -use transceiver_controller::mgmt::ManagementInterface; -use transceiver_controller::mgmt::MemoryPage; use transceiver_controller::Datapath; use transceiver_controller::DecodeError; use transceiver_controller::Error as ControllerError; @@ -96,6 +90,12 @@ use transceiver_controller::ModuleId; use transceiver_controller::Monitors; use transceiver_controller::PowerState; use transceiver_controller::SpRequest; +use transceiver_controller::filter_module_data; +use transceiver_controller::message::ExtendedStatus; +use transceiver_controller::mgmt; +use transceiver_controller::mgmt::ManagementInterface; +use transceiver_controller::mgmt::MemoryPage; +use transceiver_controller::mgmt::cmis::page_accepts_bank_number; use usdt::UniqueId; #[usdt::provider(provider = "dpd")] @@ -574,10 +574,9 @@ struct CheckedModules { mod transceiver_chaos { const DEFAULT_ERROR_RATE: f32 = 0.1; use rand::random; - use slog::debug; use slog::Logger; + use slog::debug; use std::env::var; - use transceiver_controller::mgmt::ManagementInterface; use transceiver_controller::DecodeError; use transceiver_controller::ExtendedStatus; use transceiver_controller::ExtendedStatusResult; @@ -586,6 +585,7 @@ mod transceiver_chaos { use transceiver_controller::ModuleId; use transceiver_controller::ModuleResult; use transceiver_controller::TransceiverError; + use transceiver_controller::mgmt::ManagementInterface; use transceiver_messages::filter_module_data; // A kind of status error that can be injected. @@ -1797,7 +1797,7 @@ impl Switch { } Err(e) => { probes::sde__presence__mask__request__failed!( - || (e.to_string()) + || e.to_string() ) } } @@ -1812,9 +1812,9 @@ impl Switch { ) .await; match &response { - Ok(r) => probes::sde__lpmode__request__done!(|| (r)), + Ok(r) => probes::sde__lpmode__request__done!(|| r), Err(e) => probes::sde__lpmode__request__failed!( - || (e.to_string()) + || e.to_string() ), } response @@ -1829,7 +1829,7 @@ impl Switch { match &response { Ok(r) => probes::sde__interrupt__request__done!(|| r), Err(e) => probes::sde__interrupt__request__failed!( - || (e.to_string()) + || e.to_string() ), } response @@ -1866,7 +1866,7 @@ impl Switch { ) .await } - SdeTransceiverRequest::Write(ref write) => { + SdeTransceiverRequest::Write(write) => { probes::sde__write__request__start!(|| write); let response = handle_write_request( &self.log, @@ -1886,7 +1886,7 @@ impl Switch { } response } - SdeTransceiverRequest::Read(ref read) => { + SdeTransceiverRequest::Read(read) => { probes::sde__read__request__start!(|| read); let response = handle_read_request( &self.log, @@ -1956,7 +1956,9 @@ impl Switch { /// transceivers. /// /// If the controller isn't available, an error is returned. - pub async fn transceiver_controller(&self) -> DpdResult { + pub async fn transceiver_controller( + &self, + ) -> DpdResult> { LockedController::new(&self.transceivers.controller).await } @@ -1979,7 +1981,7 @@ impl Switch { pub async fn acquire_transceiver_resources( &self, qsfp_port: QsfpPort, - ) -> DpdResult<(LockedController, MutexGuard)> { + ) -> DpdResult<(LockedController<'_>, MutexGuard<'_, SwitchPort>)> { let port_id = PortId::from(qsfp_port); let port_lock = self .switch_ports @@ -2365,7 +2367,7 @@ async fn handle_presence_mask_request( return Ok(SdeTransceiverResponse::PresenceMask { backplane, qsfp: 0, - }) + }); } Ok(controller) => { module_status(log, &controller, ModuleId::all_sidecar()).await? @@ -2436,7 +2438,7 @@ async fn handle_lp_mode_mask_request( return Ok(SdeTransceiverResponse::LpModeMask { backplane, qsfp: 0, - }) + }); } Ok(controller) => { module_status(log, &controller, ModuleId::all_sidecar()).await? @@ -2482,7 +2484,7 @@ async fn handle_interrupt_mask_request( return Ok(SdeTransceiverResponse::InterruptMask { backplane: 0, qsfp: 0, - }) + }); } Ok(controller) => { module_status(log, &controller, ModuleId::all_sidecar()).await? @@ -3614,7 +3616,7 @@ where const SIZE: u8; fn build_one(page: P, offset: u8, len: u8) - -> Result; + -> Result; fn build_many( page: P, @@ -3661,15 +3663,6 @@ impl LargeCmisOp for mgmt::MemoryWrite { #[cfg(test)] mod tests { - use super::handle_assert_reset_request; - use super::handle_detect_request; - use super::handle_interrupt_mask_request; - use super::handle_lp_mode_mask_request; - use super::handle_presence_mask_request; - use super::handle_read_request; - use super::handle_set_lp_mode_request; - use super::handle_write_request; - use super::mgmt; use super::Connector; use super::Controller; use super::ExtendedStatus; @@ -3681,6 +3674,15 @@ mod tests { use super::SdeTransceiverResponse; use super::SwitchPorts; use super::WriteRequest; + use super::handle_assert_reset_request; + use super::handle_detect_request; + use super::handle_interrupt_mask_request; + use super::handle_lp_mode_mask_request; + use super::handle_presence_mask_request; + use super::handle_read_request; + use super::handle_set_lp_mode_request; + use super::handle_write_request; + use super::mgmt; use crate::port_map::SidecarRevision; use crate::transceivers::FakeQsfpModule; use common::ports::PortId; @@ -3834,7 +3836,7 @@ mod tests { let modules = ModuleId::all_sidecar(); for i in 0..modules.selected_transceiver_count() { let i = i as u8; - let is_present = i % 2 == 0; + let is_present = i.is_multiple_of(2); let modules = ModuleId::single(i).unwrap(); let data = if is_present { vec![super::PRESENT_FOR_SDE] @@ -3895,12 +3897,16 @@ mod tests { // SDE module indices are 1-based. let log = logger(); - assert!(handle_detect_request(&log, &switch_ports, &controller, 0) - .await - .is_err()); - assert!(handle_detect_request(&log, &switch_ports, &controller, 100) - .await - .is_err()); + assert!( + handle_detect_request(&log, &switch_ports, &controller, 0) + .await + .is_err() + ); + assert!( + handle_detect_request(&log, &switch_ports, &controller, 100) + .await + .is_err() + ); } #[tokio::test] @@ -4138,24 +4144,28 @@ mod tests { // SDE module indices are 1-based. let log = logger(); - assert!(handle_set_lp_mode_request( - &log, - &switch_ports, - &controller, - 0, - true - ) - .await - .is_err()); - assert!(handle_set_lp_mode_request( - &log, - &switch_ports, - &controller, - 100, - true - ) - .await - .is_err()); + assert!( + handle_set_lp_mode_request( + &log, + &switch_ports, + &controller, + 0, + true + ) + .await + .is_err() + ); + assert!( + handle_set_lp_mode_request( + &log, + &switch_ports, + &controller, + 100, + true + ) + .await + .is_err() + ); } #[tokio::test] @@ -4775,9 +4785,11 @@ mod tests { } // Read and check. - assert!(handle_read_request(&log, &switch_ports, &controller, read) - .await - .is_ok()); + assert!( + handle_read_request(&log, &switch_ports, &controller, read) + .await + .is_ok() + ); let port = switch_ports.ports.get(&port_id).unwrap().lock().await; let device = port.as_backplane().expect("Expected a backplane port"); assert_eq!( diff --git a/dpd/src/types.rs b/dpd/src/types.rs index 0b448b0..d466d96 100644 --- a/dpd/src/types.rs +++ b/dpd/src/types.rs @@ -7,10 +7,10 @@ //! General types used throughout Dendrite. use aal::AsicError; +use common::ROLLBACK_FAILURE_ERROR_CODE; +use common::SmfError; use common::ports::PortId; use common::ports::QsfpPort; -use common::SmfError; -use common::ROLLBACK_FAILURE_ERROR_CODE; use dpd_types::link::LinkId; use slog::error; use std::{convert, net::IpAddr}; diff --git a/dpd/tests/test_openapi.rs b/dpd/tests/test_openapi.rs index 213b945..0977d68 100644 --- a/dpd/tests/test_openapi.rs +++ b/dpd/tests/test_openapi.rs @@ -64,17 +64,17 @@ use libc::c_int; use libc::c_uint; use libc::c_void; -#[no_mangle] +#[unsafe(no_mangle)] pub extern "C" fn bf_pltfm_qsfp_init(_: *mut c_void) -> c_int { panic!(); } -#[no_mangle] +#[unsafe(no_mangle)] pub extern "C" fn bf_pltfm_detect_qsfp(_module: c_uint) -> bool { panic!(); } -#[no_mangle] +#[unsafe(no_mangle)] pub extern "C" fn bf_pltfm_qsfp_read_module( _module: c_uint, _offset: c_int, @@ -84,7 +84,7 @@ pub extern "C" fn bf_pltfm_qsfp_read_module( panic!(); } -#[no_mangle] +#[unsafe(no_mangle)] pub extern "C" fn bf_pltfm_qsfp_write_module( _module: c_uint, _offset: c_int, @@ -94,7 +94,7 @@ pub extern "C" fn bf_pltfm_qsfp_write_module( panic!(); } -#[no_mangle] +#[unsafe(no_mangle)] pub unsafe extern "C" fn bf_pltfm_qsfp_get_presence_mask( _port_1_32: *mut u32, _port_33_64: *mut u32, @@ -103,7 +103,7 @@ pub unsafe extern "C" fn bf_pltfm_qsfp_get_presence_mask( panic!() } -#[no_mangle] +#[unsafe(no_mangle)] pub unsafe extern "C" fn bf_pltfm_qsfp_get_int_mask( _port_1_32: *mut u32, _port_33_64: *mut u32, @@ -112,7 +112,7 @@ pub unsafe extern "C" fn bf_pltfm_qsfp_get_int_mask( panic!(); } -#[no_mangle] +#[unsafe(no_mangle)] pub unsafe extern "C" fn bf_pltfm_qsfp_get_lpmode_mask( _port_1_32: *mut u32, _port_33_64: *mut u32, @@ -121,7 +121,7 @@ pub unsafe extern "C" fn bf_pltfm_qsfp_get_lpmode_mask( panic!() } -#[no_mangle] +#[unsafe(no_mangle)] pub extern "C" fn bf_pltfm_qsfp_set_lpmode( _module: c_int, _lp_mode: bool, @@ -129,7 +129,7 @@ pub extern "C" fn bf_pltfm_qsfp_set_lpmode( panic!(); } -#[no_mangle] +#[unsafe(no_mangle)] pub extern "C" fn bf_pltfm_qsfp_module_reset( _module: c_int, _reset: bool, diff --git a/packet/Cargo.toml b/packet/Cargo.toml index f9231f1..d06d2c7 100644 --- a/packet/Cargo.toml +++ b/packet/Cargo.toml @@ -2,7 +2,7 @@ name = "packet" version = "0.1.0" authors = ["Nils Nieuwejaar "] -edition = "2021" +edition = "2024" [dependencies] common.workspace = true diff --git a/packet/src/arp.rs b/packet/src/arp.rs index a0f97be..c40aeaa 100644 --- a/packet/src/arp.rs +++ b/packet/src/arp.rs @@ -10,14 +10,14 @@ use std::net::Ipv4Addr; use bytes::BufMut; use bytes::BytesMut; -use crate::eth; -use crate::sidecar; use crate::Endpoint; use crate::Headers; use crate::MacAddr; use crate::Packet; use crate::PacketResult; use crate::Protocol; +use crate::eth; +use crate::sidecar; pub const ARPOP_REQUEST: u16 = 1; pub const ARPOP_REPLY: u16 = 2; @@ -88,7 +88,7 @@ impl Protocol for ArpHdr { Ok(hdrs) } - fn gen( + fn generate( src: Endpoint, dst: Endpoint, mut protos: Vec, diff --git a/packet/src/eth.rs b/packet/src/eth.rs index adb271b..4e29834 100644 --- a/packet/src/eth.rs +++ b/packet/src/eth.rs @@ -8,11 +8,11 @@ use std::fmt; use bytes::{BufMut, BytesMut}; +use crate::PacketResult; use crate::arp::ArpHdr; use crate::ipv4::Ipv4Hdr; use crate::ipv6::Ipv6Hdr; use crate::lldp::LldpHdr; -use crate::PacketResult; use crate::{Endpoint, Headers, L2Endpoint, MacAddr, Packet, Protocol}; const ETH_HDR_SZ: usize = 14; @@ -114,7 +114,7 @@ impl Protocol for EthHdr { Ok(hdrs) } - fn gen( + fn generate( src: Endpoint, dst: Endpoint, mut protos: Vec, @@ -123,10 +123,10 @@ impl Protocol for EthHdr { let eth_type = protos.pop().unwrap_or_default(); let mut pkt = match eth_type { - ETHER_LLDP => LldpHdr::gen(src, dst, protos, body)?, - ETHER_ARP => ArpHdr::gen(src, dst, protos, body)?, - ETHER_IPV4 => Ipv4Hdr::gen(src, dst, protos, body)?, - ETHER_IPV6 => Ipv6Hdr::gen(src, dst, protos, body)?, + ETHER_LLDP => LldpHdr::generate(src, dst, protos, body)?, + ETHER_ARP => ArpHdr::generate(src, dst, protos, body)?, + ETHER_IPV4 => Ipv4Hdr::generate(src, dst, protos, body)?, + ETHER_IPV6 => Ipv6Hdr::generate(src, dst, protos, body)?, _ => { println!( "unsupported ethertype: {}", diff --git a/packet/src/geneve.rs b/packet/src/geneve.rs index 0ef870b..4eb5b3b 100644 --- a/packet/src/geneve.rs +++ b/packet/src/geneve.rs @@ -9,8 +9,8 @@ use std::fmt; use bytes::{BufMut, BytesMut}; use crate::PacketResult; -use crate::{udp, Protocol}; use crate::{Endpoint, Headers, Packet}; +use crate::{Protocol, udp}; pub const GENEVE_UDP_PORT: u16 = 6081; const GENEVE_HDR_SZ: usize = 8; @@ -76,7 +76,7 @@ impl Protocol for GeneveHdr { Ok(hdrs) } - fn gen( + fn generate( _src: Endpoint, _dst: Endpoint, mut protos: Vec, diff --git a/packet/src/icmp.rs b/packet/src/icmp.rs index c603c63..787fb31 100644 --- a/packet/src/icmp.rs +++ b/packet/src/icmp.rs @@ -11,8 +11,8 @@ use bytes::BufMut; use bytes::BytesMut; use crate::PacketResult; -use crate::{ipv4, ipv6}; use crate::{Endpoint, Headers, Packet, Protocol}; +use crate::{ipv4, ipv6}; pub const ICMP_ECHOREPLY: u8 = 0; pub const ICMP_DEST_UNREACH: u8 = 3; @@ -123,7 +123,7 @@ impl Protocol for IcmpHdr { Ok(v) } - fn gen( + fn generate( _src: Endpoint, dst: Endpoint, mut protos: Vec, diff --git a/packet/src/ipv4.rs b/packet/src/ipv4.rs index e0a0e28..4a60709 100644 --- a/packet/src/ipv4.rs +++ b/packet/src/ipv4.rs @@ -10,8 +10,8 @@ use std::net::Ipv4Addr; use bytes::{Buf, BufMut, BytesMut}; use crate::PacketResult; -use crate::{eth, icmp, sidecar, tcp, udp}; use crate::{Endpoint, Headers, Packet, Protocol}; +use crate::{eth, icmp, sidecar, tcp, udp}; const IPV4_HDR_SZ: usize = 5 * 4; // 5 words with no options @@ -169,7 +169,7 @@ impl Protocol for Ipv4Hdr { Ok(hdrs) } - fn gen( + fn generate( src: Endpoint, dst: Endpoint, mut protos: Vec, @@ -178,9 +178,9 @@ impl Protocol for Ipv4Hdr { let proto = protos.pop().unwrap_or_default() as u8; let mut pkt = match proto { - IPPROTO_ICMP => icmp::IcmpHdr::gen(src, dst, protos, body)?, - IPPROTO_TCP => tcp::TcpHdr::gen(src, dst, protos, body)?, - IPPROTO_UDP => udp::UdpHdr::gen(src, dst, protos, body)?, + IPPROTO_ICMP => icmp::IcmpHdr::generate(src, dst, protos, body)?, + IPPROTO_TCP => tcp::TcpHdr::generate(src, dst, protos, body)?, + IPPROTO_UDP => udp::UdpHdr::generate(src, dst, protos, body)?, _ => { println!("unsupported ip protocol: {proto}"); Packet::new(body) diff --git a/packet/src/ipv6.rs b/packet/src/ipv6.rs index 3b84a42..7595f64 100644 --- a/packet/src/ipv6.rs +++ b/packet/src/ipv6.rs @@ -11,8 +11,8 @@ use std::net::Ipv6Addr; use bytes::{BufMut, BytesMut}; use crate::PacketResult; -use crate::{eth, icmp, sidecar, tcp, udp}; use crate::{Endpoint, Headers, IpAddr, L3Endpoint, Packet, Protocol}; +use crate::{eth, icmp, sidecar, tcp, udp}; const IPV6_HDR_SZ: usize = 40; @@ -107,7 +107,7 @@ impl Protocol for Ipv6Hdr { Ok(hdrs) } - fn gen( + fn generate( src: Endpoint, dst: Endpoint, mut protos: Vec, @@ -122,9 +122,9 @@ impl Protocol for Ipv6Hdr { })?; let mut pkt = match proto { - IPPROTO_ICMPV6 => icmp::IcmpHdr::gen(src, dst, protos, body)?, - IPPROTO_TCP => tcp::TcpHdr::gen(src, dst, protos, body)?, - IPPROTO_UDP => udp::UdpHdr::gen(src, dst, protos, body)?, + IPPROTO_ICMPV6 => icmp::IcmpHdr::generate(src, dst, protos, body)?, + IPPROTO_TCP => tcp::TcpHdr::generate(src, dst, protos, body)?, + IPPROTO_UDP => udp::UdpHdr::generate(src, dst, protos, body)?, _ => Packet::new(body), }; diff --git a/packet/src/lib.rs b/packet/src/lib.rs index ac52de2..4fba21d 100644 --- a/packet/src/lib.rs +++ b/packet/src/lib.rs @@ -73,7 +73,7 @@ type PacketResult = Result; pub trait Protocol { fn parse(pb: &mut ParseBuffer) -> PacketResult; fn doc(&self) -> (Option, Option, Option); - fn gen( + fn generate( src: Endpoint, dst: Endpoint, protos: Vec, @@ -421,13 +421,13 @@ impl Packet { } } - pub fn gen( + pub fn generate( src: Endpoint, dst: Endpoint, protos: Vec, body: Option<&[u8]>, ) -> PacketResult { - eth::EthHdr::gen(src, dst, protos, body) + eth::EthHdr::generate(src, dst, protos, body) } pub fn parse_protocol(data: &[u8], protocol: u16) -> PacketResult { diff --git a/packet/src/lldp.rs b/packet/src/lldp.rs index f60519c..01cc245 100644 --- a/packet/src/lldp.rs +++ b/packet/src/lldp.rs @@ -9,8 +9,8 @@ use std::fmt::{self}; use bytes::{BufMut, BytesMut}; use crate::PacketResult; -use crate::{eth, sidecar}; use crate::{Endpoint, Headers, Packet, Protocol}; +use crate::{eth, sidecar}; #[derive(Eq, PartialEq, Clone, Debug)] pub struct LldpTlv { @@ -85,7 +85,7 @@ impl Protocol for LldpHdr { } } - fn gen( + fn generate( _src: Endpoint, _dst: Endpoint, _protos: Vec, diff --git a/packet/src/pbuf.rs b/packet/src/pbuf.rs index 745e164..a001b6b 100644 --- a/packet/src/pbuf.rs +++ b/packet/src/pbuf.rs @@ -6,9 +6,9 @@ use std::net::{Ipv4Addr, Ipv6Addr}; -use crate::parse_error; use crate::MacAddr; use crate::PacketResult; +use crate::parse_error; pub struct ParseBuffer<'a> { data: &'a [u8], @@ -18,7 +18,7 @@ pub struct ParseBuffer<'a> { } impl ParseBuffer<'_> { - pub fn new_from_slice(d: &[u8]) -> ParseBuffer { + pub fn new_from_slice(d: &[u8]) -> ParseBuffer<'_> { ParseBuffer { data: d, byte: 0, @@ -74,11 +74,7 @@ impl ParseBuffer<'_> { pub fn bits_left(&mut self) -> usize { let consumed = (self.byte * 8) + self.bit; - if consumed < self.len { - self.len - consumed - } else { - 0 - } + self.len.saturating_sub(consumed) } fn get_chunk(&mut self, bits: usize) -> (u32, usize) { diff --git a/packet/src/sidecar.rs b/packet/src/sidecar.rs index 28f1c3f..fbd4cc6 100644 --- a/packet/src/sidecar.rs +++ b/packet/src/sidecar.rs @@ -11,8 +11,8 @@ use bytes::BufMut; use bytes::BytesMut; use crate::PacketResult; -use crate::{arp, eth, ipv4, ipv6, lldp}; use crate::{Endpoint, Headers, Packet, Protocol}; +use crate::{arp, eth, ipv4, ipv6, lldp}; pub const SC_FWD_FROM_USERSPACE: u8 = 0; pub const SC_FWD_TO_USERSPACE: u8 = 1; @@ -66,7 +66,7 @@ impl Protocol for SidecarHdr { Ok(hdrs) } - fn gen( + fn generate( _src: Endpoint, _dst: Endpoint, mut protos: Vec, @@ -149,7 +149,11 @@ impl fmt::Debug for SidecarHdr { write!( f, "sidecar op code: {} ingress: {} egress: {} ether_type: {:x} payload: {:?}", - self.sc_code, self.sc_ingress, self.sc_egress, self.sc_ether_type, self.sc_payload + self.sc_code, + self.sc_ingress, + self.sc_egress, + self.sc_ether_type, + self.sc_payload ) } } diff --git a/packet/src/tcp.rs b/packet/src/tcp.rs index bbba9c8..f9c3433 100644 --- a/packet/src/tcp.rs +++ b/packet/src/tcp.rs @@ -12,8 +12,8 @@ use bytes::BytesMut; use crate::PacketResult; use crate::ParseBuffer; -use crate::{checksum, ipv4, ipv6}; use crate::{Endpoint, Headers, Packet, Protocol}; +use crate::{checksum, ipv4, ipv6}; const TCP_HDR_SZ: usize = 20; // without options @@ -236,7 +236,7 @@ impl Protocol for TcpHdr { Ok(hdrs) } - fn gen( + fn generate( src: Endpoint, dst: Endpoint, _protos: Vec, diff --git a/packet/src/udp.rs b/packet/src/udp.rs index edc94a9..974dcbc 100644 --- a/packet/src/udp.rs +++ b/packet/src/udp.rs @@ -12,8 +12,8 @@ use bytes::BufMut; use bytes::BytesMut; use crate::PacketResult; -use crate::{geneve, ipv4, ipv6}; use crate::{Endpoint, Headers, L4Endpoint, Packet}; +use crate::{geneve, ipv4, ipv6}; const UDP_HDR_SZ: usize = 8; @@ -100,7 +100,7 @@ impl crate::Protocol for UdpHdr { Ok(hdrs) } - fn gen( + fn generate( src: Endpoint, dst: Endpoint, protos: Vec, @@ -110,7 +110,7 @@ impl crate::Protocol for UdpHdr { let udp_dst = L4Endpoint::try_from(dst)?; let mut pkt = match udp_dst.port { geneve::GENEVE_UDP_PORT => { - geneve::GeneveHdr::gen(src, dst, protos, body)? + geneve::GeneveHdr::generate(src, dst, protos, body)? } _ => Packet::new(body), }; diff --git a/pcap/Cargo.toml b/pcap/Cargo.toml index ca50f49..ae9c9dc 100644 --- a/pcap/Cargo.toml +++ b/pcap/Cargo.toml @@ -2,7 +2,7 @@ name = "pcap" version = "0.1.0" authors = ["Nils Nieuwejaar "] -edition = "2021" +edition = "2024" [build-dependencies] cc = "1.0" diff --git a/pcap/build.rs b/pcap/build.rs index 5660878..94c8a54 100644 --- a/pcap/build.rs +++ b/pcap/build.rs @@ -39,7 +39,7 @@ fn gen_bindings() -> std::io::Result<()> { fn main() { #[cfg(target_os = "illumos")] - { + unsafe { std::env::set_var("AR", "/usr/bin/gar"); std::env::set_var("LIBCLANG_PATH", "/opt/ooce/llvm/lib"); } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 56e0aa3..5806553 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] # We choose a specific toolchain (rather than "stable") for repeatability. The # intent is to keep this up-to-date with recently-released stable Rust. -channel = "1.85.0" +channel = "1.90.0" profile = "default" diff --git a/swadm/Cargo.toml b/swadm/Cargo.toml index db73159..beeaa60 100644 --- a/swadm/Cargo.toml +++ b/swadm/Cargo.toml @@ -3,11 +3,12 @@ name = "swadm" description = "Management CLI for the Oxide switch" version = "0.1.0" authors = ["nils "] -edition = "2021" +edition = "2024" [dependencies] anyhow.workspace = true chrono.workspace = true +clap.workspace = true colored.workspace = true common.workspace = true dpd-client.workspace = true @@ -15,6 +16,5 @@ futures.workspace = true oxide-tokio-rt.workspace = true oxnet.workspace = true slog.workspace = true -structopt.workspace = true tabwriter.workspace = true tokio.workspace = true diff --git a/swadm/src/addr.rs b/swadm/src/addr.rs index a16c0cc..76b4024 100644 --- a/swadm/src/addr.rs +++ b/swadm/src/addr.rs @@ -4,41 +4,42 @@ // // Copyright 2025 Oxide Computer Company -use std::io::{stdout, Write}; +use std::io::{Write, stdout}; use std::net::IpAddr; use anyhow::Context; +use clap::Subcommand; use colored::*; use futures::stream::TryStreamExt; -use structopt::*; use tabwriter::TabWriter; use dpd_client::Client; -use crate::misc_err; use crate::LinkName; use crate::LinkPath; +use crate::misc_err; -#[derive(Debug, StructOpt)] -#[structopt(about = "address management")] +#[derive(Debug, Subcommand)] +/// address management pub enum Addr { /// List addresses assigned to a link. - #[structopt(visible_alias = "ls")] + #[clap(alias = "ls")] List { - #[structopt(about = "limit output to IPv4", short = "4")] + /// limit output to IPv4 + #[clap(short = '4')] ipv4: bool, - #[structopt(about = "limit output to IPv6", short = "6")] + /// limit output to IPv6 + #[clap(short = '6')] ipv6: bool, - #[structopt(help = "provide parseable output", short = "p")] + /// provide parseable output + #[clap(short = 'p')] parseable: bool, /// List addresses for a specific link - #[structopt(parse(try_from_str))] link: Option, }, /// Add an address to a link. Add { /// The link on which to add the address. - #[structopt(parse(try_from_str))] link: LinkName, /// The IP address to add. addr: IpAddr, @@ -46,7 +47,6 @@ pub enum Addr { /// Delete an IP address from a link. Del { /// The link from which to delete the address. - #[structopt(parse(try_from_str))] link: LinkName, /// The IP address to delete. addr: IpAddr, @@ -188,7 +188,7 @@ async fn addr_list_all( return Err(misc_err( "must specify -4 or -6 for parseable output".to_string(), ) - .into()) + .into()); } }; if !addrs.is_empty() { diff --git a/swadm/src/arp.rs b/swadm/src/arp.rs index 407c417..cf01f36 100644 --- a/swadm/src/arp.rs +++ b/swadm/src/arp.rs @@ -4,46 +4,46 @@ // // Copyright 2025 Oxide Computer Company -use std::io::{stdout, Write}; +use std::io::{Write, stdout}; use std::net::IpAddr; use anyhow::Context; use chrono::prelude::*; +use clap::Subcommand; use colored::*; use futures::stream::TryStreamExt; -use structopt::*; use tabwriter::TabWriter; use common::network::MacAddr; -use dpd_client::types; use dpd_client::Client; use dpd_client::ClientInfo; +use dpd_client::types; use crate::IpFamily; -#[derive(Debug, StructOpt)] -#[structopt(about = "manage the ARP or NDP tables")] +#[derive(Debug, Subcommand)] +/// manage the ARP or NDP tables pub enum Arp { - #[structopt(about = "list all ARP / NDP entries")] + /// list all ARP / NDP entries List { - #[structopt(about = "IPv4 or IPv6")] + /// IPv4 or IPv6 family: Option, }, - #[structopt(about = "get one ARP / NDP table entry")] + /// get one ARP / NDP table entry Get { - #[structopt(help = "host IP address")] + /// host IP address ip: IpAddr, }, - #[structopt(about = "add one ARP / NDP table entry")] + /// add one ARP / NDP table entry Add { - #[structopt(help = "host IP address")] + /// host IP address ip: IpAddr, - #[structopt(help = "MAC address")] + /// MAC address mac: MacAddr, }, - #[structopt(about = "delete one ARP / NDP entry")] + /// delete one ARP / NDP entry Del { - #[structopt(help = "host IP address")] + /// host IP address ip: IpAddr, }, } diff --git a/swadm/src/compliance.rs b/swadm/src/compliance.rs index 5eedc2f..5e6628f 100644 --- a/swadm/src/compliance.rs +++ b/swadm/src/compliance.rs @@ -4,19 +4,19 @@ // // Copyright 2025 Oxide Computer Company -use std::io::{stdout, Write}; +use std::io::{Write, stdout}; use anyhow::Context; +use clap::Subcommand; use colored::*; -use structopt::*; use tabwriter::TabWriter; use common::ports::{PortFec, PortSpeed}; -use dpd_client::types; use dpd_client::Client; +use dpd_client::types; -#[derive(Debug, StructOpt)] -#[structopt(about = "Commands for compliance testing")] +#[derive(Debug, Subcommand)] +/// Commands for compliance testing pub enum Compliance { /// View/Manage port and link state /// @@ -53,40 +53,39 @@ pub enum Compliance { /// swadm compliance ports power high qsfp0 # Set qsfp0 transceiver to high power /// swadm compliance ports power low qsfp0 # Set qsfp0 transceiver to low power /// swadm compliance ports power off --force # Power off all qsfp transceivers, deleting links - #[structopt(verbatim_doc_comment)] Ports { - #[structopt(subcommand)] + #[clap(subcommand)] action: PortAction, }, } -#[derive(Debug, StructOpt)] +#[derive(Debug, Subcommand)] pub enum PortAction { /// List links with their enabled status and operational state - #[structopt(visible_alias = "ls")] + #[clap(visible_alias = "ls")] List { /// Link pattern to match. Can be specific link like "rear0/0", or substring pattern pattern: Option, /// Include all links (default: qsfp links only) - #[structopt(long)] + #[clap(long)] all: bool, }, /// Enable links (bring them up) - #[structopt(visible_alias = "on")] + #[clap(visible_alias = "on")] Up { /// Link pattern to match. Can be specific link like "rear0/0", or substring pattern pattern: Option, /// Include all links (default: qsfp links only) - #[structopt(long)] + #[clap(long)] all: bool, }, /// Disable links (bring them down) - #[structopt(visible_alias = "off")] + #[clap(visible_alias = "off")] Down { /// Link pattern to match. Can be specific link like "rear0/0", or substring pattern pattern: Option, /// Include all links (default: qsfp links only) - #[structopt(long)] + #[clap(long)] all: bool, }, /// Create links on switch ports with default compliance settings @@ -94,19 +93,19 @@ pub enum PortAction { /// Switch port pattern to match. Can be specific port like "qsfp0", or substring pattern pattern: Option, /// The speed for the new links - #[structopt(short, long, parse(try_from_str), default_value = "200G")] + #[clap(short, long, default_value = "200G")] speed: PortSpeed, /// The error-correction scheme for the links (override server default) - #[structopt(short, long, parse(try_from_str))] + #[clap(short, long)] fec: Option, /// Enable autonegotiation on the links - #[structopt(short, long)] + #[clap(short, long)] autoneg: bool, /// Enable KR mode for the links - #[structopt(short, long)] + #[clap(short, long)] kr: bool, /// Create links on all switch ports (default: qsfp ports only) - #[structopt(long)] + #[clap(long)] all: bool, }, /// Delete links from switch ports @@ -114,7 +113,7 @@ pub enum PortAction { /// Link pattern to match. Can be specific link like "qsfp0/0", or substring pattern pattern: Option, /// Include all links (default: qsfp links only) - #[structopt(long)] + #[clap(long)] all: bool, }, /// Control transceiver power state @@ -124,7 +123,7 @@ pub enum PortAction { /// Port pattern to match. Can be specific port like "qsfp0", or substring pattern pattern: Option, /// Force power operation, deleting links if necessary - #[structopt(short, long)] + #[clap(short, long)] force: bool, }, } @@ -238,7 +237,7 @@ async fn compliance_ports_list( Ok(power) => { let state = power.into_inner(); // Convert to a cleaner string representation - format!("{:?}", state).to_lowercase() + format!("{state:?}").to_lowercase() } Err(_) => "N/A".to_string(), }; @@ -246,12 +245,12 @@ async fn compliance_ports_list( let links = client .link_list(&port_id) .await - .context(format!("failed to list links for port {}", port_id))? + .context(format!("failed to list links for port {port_id}"))? .into_inner(); if links.is_empty() { // Port has no links - writeln!(tw, "{}\t{}\t-\t-\tNo links", port_id, power_state)?; + writeln!(tw, "{port_id}\t{power_state}\t-\t-\tNo links")?; } else { // Port has links - show each link with the same power state for link in links { @@ -312,9 +311,9 @@ async fn get_matching_links( .into_inner(); // Apply client-side filtering if needed - let filtered_links = if !all && pattern.is_some() { + let filtered_links = if !all && let Some(user_pattern) = pattern { // Filter the qsfp links by user's pattern - let user_pattern = pattern.unwrap(); + //let user_pattern = pattern.unwrap(); links .into_iter() .filter(|link| link.to_string().contains(user_pattern)) @@ -373,8 +372,15 @@ async fn compliance_ports_setup( let port_type = if all { "all" } else { "qsfp" }; let fec_display = fec.map_or("default".to_string(), |f| f.to_string()); - println!("Creating links on {} {} switch ports with speed={}, fec={}, autoneg={}, kr={}", - switch_ports.len(), port_type, speed, fec_display, autoneg, kr); + println!( + "Creating links on {} {} switch ports with speed={}, fec={}, autoneg={}, kr={}", + switch_ports.len(), + port_type, + speed, + fec_display, + autoneg, + kr + ); let mut created_count = 0; let mut error_count = 0; @@ -395,19 +401,18 @@ async fn compliance_ports_setup( created_count += 1; } Err(e) => { - eprintln!("Failed to create link on {}: {}", port_id, e); + eprintln!("Failed to create link on {port_id}: {e}"); error_count += 1; } } } println!( - "Setup complete: {} links created, {} errors", - created_count, error_count + "Setup complete: {created_count} links created, {error_count} errors" ); if error_count > 0 { - anyhow::bail!("Setup completed with {} errors", error_count); + anyhow::bail!("Setup completed with {error_count} errors"); } Ok(()) @@ -447,12 +452,11 @@ async fn compliance_ports_teardown( } println!( - "Teardown complete: {} links deleted, {} errors", - deleted_count, error_count + "Teardown complete: {deleted_count} links deleted, {error_count} errors" ); if error_count > 0 { - anyhow::bail!("Teardown completed with {} errors", error_count); + anyhow::bail!("Teardown completed with {error_count} errors"); } Ok(()) @@ -506,10 +510,7 @@ async fn compliance_ports_power( let current_mode = match client.management_mode_get(&port_id).await { Ok(mode) => mode.into_inner(), Err(e) => { - eprintln!( - "Failed to get management mode for {}: {}", - port_id, e - ); + eprintln!("Failed to get management mode for {port_id}: {e}"); error_count += 1; continue; } @@ -564,12 +565,11 @@ async fn compliance_ports_power( .await { Ok(_) => { - println!("Set port {} to manual management mode", port_id); + println!("Set port {port_id} to manual management mode"); } Err(e) => { eprintln!( - "Failed to set management mode for {}: {}", - port_id, e + "Failed to set management mode for {port_id}: {e}" ); error_count += 1; continue; @@ -580,13 +580,12 @@ async fn compliance_ports_power( // Set the power state match client.transceiver_power_set(&port_id, state).await { Ok(_) => { - println!("Set power {} on port {}", power_state_str, port_id); + println!("Set power {power_state_str} on port {port_id}"); success_count += 1; } Err(e) => { eprintln!( - "Failed to set power {} on port {}: {}", - power_state_str, port_id, e + "Failed to set power {power_state_str} on port {port_id}: {e}" ); error_count += 1; } @@ -594,12 +593,11 @@ async fn compliance_ports_power( } println!( - "Power operation complete: {} ports succeeded, {} errors", - success_count, error_count + "Power operation complete: {success_count} ports succeeded, {error_count} errors" ); if error_count > 0 { - anyhow::bail!("Power operation completed with {} errors", error_count); + anyhow::bail!("Power operation completed with {error_count} errors"); } Ok(()) diff --git a/swadm/src/counters.rs b/swadm/src/counters.rs index 6d24d67..3c8e6e0 100644 --- a/swadm/src/counters.rs +++ b/swadm/src/counters.rs @@ -4,36 +4,36 @@ // // Copyright 2025 Oxide Computer Company -use std::io::stdout; use std::io::Write; +use std::io::stdout; -use anyhow::anyhow; use anyhow::Context; +use anyhow::anyhow; +use clap::Subcommand; use colored::*; -use structopt::*; use tabwriter::TabWriter; -use dpd_client::types; use dpd_client::Client; +use dpd_client::types; -#[derive(Debug, StructOpt)] -/// Report counter data collected by the P4 program. These counters are -/// primarily intended to be used to debug the P4 code rather than diagnosing -/// run-time issues with a connected sidecar. For non-development debugging, -/// you probably want "swadm link counters". -#[structopt(verbatim_doc_comment)] +#[derive(Debug, Subcommand)] +/// Report counter data collected by the P4 program. +/// +/// These counters are primarily intended to be used to debug the P4 code +/// rather than diagnosing run-time issues with a connected sidecar. For +/// non-development debugging, you probably want "swadm link counters". pub enum P4Counters { - #[structopt(about = "list all available counters")] + /// list all available counters List, - #[structopt(about = "get data from the given counter")] + /// get data from the given counter Get { - #[structopt(short = "f")] + #[clap(short = 'f')] /// sync the counter data from the ASIC to memory even if the normal /// refresh timeout hasn't expired. force_sync: bool, name: String, }, - #[structopt(about = "reset the data for a given counter")] + /// reset the data for a given counter Reset { name: String }, } diff --git a/swadm/src/link.rs b/swadm/src/link.rs index c231622..3b2a6ad 100644 --- a/swadm/src/link.rs +++ b/swadm/src/link.rs @@ -4,15 +4,16 @@ // // Copyright 2025 Oxide Computer Company -use std::io::{stdout, Write}; +use std::collections::HashMap; +use std::io::{Write, stdout}; use std::net::IpAddr; use std::str::FromStr; -use anyhow::bail; use anyhow::Context; +use anyhow::bail; +use clap::{Parser, Subcommand}; use colored::*; use futures::stream::TryStreamExt; -use structopt::*; use tabwriter::TabWriter; use common::counters::RMonCounters; @@ -21,29 +22,28 @@ use common::ports::PortFec; use common::ports::PortMedia; use common::ports::PortPrbsMode; use common::ports::PortSpeed; -use dpd_client::types; use dpd_client::Client; +use dpd_client::types; -use crate::parse_port_id; -use crate::switchport::SwitchId; use crate::IpFamily; use crate::LinkPath; +use crate::parse_port_id; +use crate::switchport::SwitchId; -#[derive(Debug, StructOpt)] -#[structopt(about = "Link-specific statistics")] +#[derive(Debug, Subcommand)] +/// Link-specific statistics pub enum LinkCounters { /// Fetch RMON counters. - #[structopt(about = "get RMON counters")] Rmon { /// The link to fetch counters for. link: LinkPath, /// Interval on which to re-fetch and print, in seconds. - #[structopt(long, short = "i")] + #[clap(long, short = 'i')] interval: Option, /// The level of detail. - #[structopt(short = "l", default_value = "1")] + #[clap(short = 'l', default_value = "1")] level: u8, }, /// Fetch physical coding sublayer counters, for one link or all. @@ -59,7 +59,6 @@ pub enum LinkCounters { /// UnknErr Count of Unknown Error Events /// InvErr Count of Invalid Error Events /// BipErr Bit Inteleaved Parity errors (per PCS lane) - #[structopt(verbatim_doc_comment)] Pcs { /// The link to fetch counters for. /// @@ -79,7 +78,6 @@ pub enum LinkCounters { /// FecSer1 Count of FEC Symbol Errors On Lane 1 /// FecSer2 Count of FEC Symbol Errors On Lane 2 /// FecSer3 Count of FEC Symbol Errors On Lane 3 - #[structopt(verbatim_doc_comment)] Fec { /// The link to fetch counters for. /// @@ -92,7 +90,6 @@ pub enum LinkCounters { /// /// Current Shows the link-up count since the link was last enabled /// Total Shows the link-up count since the link was created - #[structopt(verbatim_doc_comment)] Up { /// The link to fetch counters for. /// @@ -105,7 +102,6 @@ pub enum LinkCounters { /// /// Current Shows the per-state count since the link was last enabled /// Total Shows the per-state count since the link was created - #[structopt(verbatim_doc_comment)] Fsm { /// The link to fetch counters for. link: LinkPath, @@ -127,25 +123,22 @@ pub enum LinkCounters { /// on the other end of the link. When the administrator believes that the /// underlying failure has been addressed, the fault can be "cleared", which /// will notify the dataplane daemon that it can try to bring the port online. -#[derive(Debug, StructOpt)] +#[derive(Debug, Subcommand)] pub enum Fault { /// Show the kind of fault that has been detected Show { /// The link path, specified as `switch_port/link`. - #[structopt(parse(try_from_str))] link_path: LinkPath, }, /// Mark the fault as "cleared" Clear { /// The link path, specified as `switch_port/link`. - #[structopt(parse(try_from_str))] link_path: LinkPath, }, /// Move a link into the faulted state. This is most likely to be used only /// for debugging. Inject { /// The link path, specified as `switch_port/link`. - #[structopt(parse(try_from_str))] link_path: LinkPath, /// The nominal reason for the injected fault @@ -154,33 +147,30 @@ pub enum Fault { } /// Diagnostic commands to examine the hardware and software state of a link's SERDES -#[derive(Debug, StructOpt)] +#[derive(Debug, Subcommand)] pub enum GetSerdes { /// Fetch the logical->physical lane mappings for this port - #[structopt(visible_alias = "map")] + #[clap(visible_alias = "map")] LaneMap { /// The link path, specified as `switch_port/link`. /// /// For example `rear0/0` is the first link on the rear0 switch port. - #[structopt(parse(try_from_str))] link_path: LinkPath, }, /// Fetch the speed and encoding configuration for each lane in this port - #[structopt(visible_alias = "enc")] + #[clap(visible_alias = "enc")] EncSpeed { /// The link path, specified as `switch_port/link`. /// /// For example `rear0/0` is the first link on the rear0 switch port. - #[structopt(parse(try_from_str))] link_path: LinkPath, }, /// Fetch the combined autonegotiation / link-training state for this port - #[structopt(alias = "anlt")] + #[clap(visible_alias = "anlt")] AnLt { /// The link path, specified as `switch_port/link`. /// /// For example `rear0/0` is the first link on the rear0 switch port. - #[structopt(parse(try_from_str))] link_path: LinkPath, }, /// Fetch the eye data for this port @@ -188,71 +178,72 @@ pub enum GetSerdes { /// The link path, specified as `switch_port/link`. /// /// For example `rear0/0` is the first link on the rear0 switch port. - #[structopt(parse(try_from_str))] link_path: LinkPath, }, /// Fetch the rx adaptation counts for this port - #[structopt(alias = "adapt")] + #[clap(visible_alias = "adapt")] RxAdapt { /// The link path, specified as `switch_port/link`. /// /// For example `rear0/0` is the first link on the rear0 switch port. - #[structopt(parse(try_from_str))] link_path: LinkPath, }, /// Fetch the tx equalization settings for this port. This displays both /// the initial software setting followed by the current hardware setting in /// parenthesis. - #[structopt(alias = "txeq")] + #[clap(visible_alias = "txeq")] TxEq { /// The link path, specified as `switch_port/link`. /// /// For example `rear0/0` is the first link on the rear0 switch port. - #[structopt(parse(try_from_str))] link_path: LinkPath, }, /// Fetch the rx signal info for this port - #[structopt(alias = "rxsig")] + #[clap(visible_alias = "rxsig")] RxSig { /// The link path, specified as `switch_port/link`. /// /// For example `rear0/0` is the first link on the rear0 switch port. - #[structopt(parse(try_from_str))] link_path: LinkPath, }, } -#[derive(Debug, StructOpt)] +#[derive(Debug, Subcommand)] /// Diagnostic commands to updated the settings of a link's SERDES pub enum SetSerdes { /// Update the tx equalization settings for this port. Only the main setting is /// required. All others will default to 0. Note: to set a negative value, /// you must use the "=" option syntax. e.g., "--pre1=-1" - #[structopt(alias = "txeq")] + #[clap(visible_alias = "txeq")] TxEq { /// The link path, specified as `switch_port/link`. /// /// For example `rear0/0` is the first link on the rear0 switch port. - #[structopt(parse(try_from_str))] link_path: LinkPath, - #[structopt(long)] + #[clap(long)] pre2: Option, - #[structopt(long)] + #[clap(long)] pre1: Option, - #[structopt(long)] + #[clap(long)] main: Option, - #[structopt(long)] + #[clap(long)] post1: Option, - #[structopt(long)] + #[clap(long)] post2: Option, }, } -#[derive(Debug, StructOpt)] +#[derive(Debug, Subcommand)] /// Commands to monitor and manage a link's SERDES pub enum Serdes { - Get(GetSerdes), - Set(SetSerdes), + Get { + #[command(subcommand)] + cmd: GetSerdes, + }, + Set { + #[command(subcommand)] + cmd: SetSerdes, + }, } /// Manage Ethernet links. @@ -260,7 +251,7 @@ pub enum Serdes { /// Links are always referenced to the switch port that contains them. This /// is normally done by using a "link path", which is structured like /// `switch_port/link_id`, e.g., `rear0/0`. -#[derive(Debug, StructOpt)] +#[derive(Debug, Subcommand)] pub enum Link { /// Create a new link on a switch port. Create(LinkCreate), @@ -270,76 +261,69 @@ pub enum Link { /// The link path, specified as `switch_port/link`. /// /// For example `rear0/0` is the first link on the rear0 switch port. - #[structopt(parse(try_from_str))] link_path: LinkPath, /// Display verbose output - #[structopt(short, long, conflicts_with("parseable"))] + #[clap(short, long, conflicts_with("parseable"))] verbose: bool, /// Provide machine-parseable output. - #[structopt( - short, - long, - requires("fields"), - conflicts_with("verbose") - )] + #[clap(short, long, requires("fields"), conflicts_with("verbose"))] parseable: bool, /// Which fields to output. - #[structopt(short = "o", parse(try_from_str = parse_link_fields))] + #[clap(short = 'o', value_parser = parse_link_fields)] fields: Option, /// The field separator. - #[structopt(short = "s", requires("parseable"))] + #[clap(short = 's', requires("parseable"))] sep: Option, /// Rather than printing a link, list the parseable fields that can be /// printed. - #[structopt(long)] + #[clap(long)] list_fields: bool, }, /// List all links on a switch port. List { /// The port whose links should be listed. - #[structopt(parse(try_from_str = parse_port_id))] + #[clap(value_parser = parse_port_id)] port_id: types::PortId, /// Provide machine-parseable output. - #[structopt(short, long, requires("fields"))] + #[clap(short, long, requires("fields"))] parseable: bool, /// Which fields to output. - #[structopt(short = "o", parse(try_from_str = parse_link_fields))] + #[clap(short = 'o', value_parser = parse_link_fields)] fields: Option, /// The field separator. - #[structopt(short = "s", requires("parseable"))] + #[clap(short = 's', requires("parseable"))] sep: Option, /// Rather than printing a link, list the parseable fields that can be /// printed. - #[structopt(long)] + #[clap(long)] list_fields: bool, }, /// Delete a link on a switch port. - #[structopt(visible_alias = "del")] + #[clap(visible_alias = "del")] Delete { /// The link path, specified as `switch_port/link`. /// /// For example `rear0/0` is the first link on the rear0 switch port. - #[structopt(parse(try_from_str))] link_path: LinkPath, }, /// List all links on all switch ports. - #[structopt(visible_alias = "ls")] + #[clap(visible_alias = "ls")] ListAll { /// Provide machine-parseable output. - #[structopt(short, long, requires("fields"))] + #[clap(short, long, requires("fields"))] parseable: bool, /// Which fields to output. - #[structopt(short = "o", parse(try_from_str = parse_link_fields))] + #[clap(short = 'o', value_parser = parse_link_fields)] fields: Option, /// The field separator. - #[structopt(short = "s", requires("parseable"))] + #[clap(short = 's', requires("parseable"))] sep: Option, /// Rather than printing a link, list the parseable fields that can be /// printed. - #[structopt(long)] + #[clap(long)] list_fields: bool, /// Filter output to those links whose name contains the provided substring. /// @@ -360,7 +344,7 @@ pub enum Link { /// The link to set the property on. link: LinkPath, /// The property to be set. - #[structopt(flatten)] + #[command(subcommand)] property: SetLinkProp, }, @@ -369,7 +353,7 @@ pub enum Link { /// The link to get the property for. link: LinkPath, /// The property to be fetched. - #[structopt(flatten)] + #[command(subcommand)] property: LinkProp, }, @@ -388,57 +372,122 @@ pub enum Link { /// The link to get the history of. link: LinkPath, /// Display raw timestamps rather than relative - #[structopt(long, visible_alias = "R")] + #[clap(long, visible_alias = "R")] raw: bool, /// Display history from oldest event to newest event - #[structopt(long, short)] + #[clap(long, short)] reverse: bool, /// Maximum number of events to display - #[structopt(short)] + #[clap(short)] n: Option, }, /// Manage a link in the Faulted state - Fault(Fault), + Fault { + #[command(subcommand)] + cmd: Fault, + }, /// Display counters related to the link. - #[structopt(visible_alias = "ctr", visible_alias = "co")] - Counters(LinkCounters), + #[clap(visible_aliases = ["ctr", "co"])] + Counters { + #[command(subcommand)] + cmd: LinkCounters, + }, + + #[clap(visible_alias = "sd")] + Serdes { + #[command(subcommand)] + cmd: Serdes, + }, - #[structopt(visible_alias = "sd")] - Serdes(Serdes), + /// Use the mechanism omicron uses to set up a link + Apply { + /// The link path + #[clap(long)] + link: LinkPath, + /// Dpd tag to use + #[clap(long)] + tag: String, + /// The first lane of the port to use for the new link + #[clap(long)] + lane: Option, + /// The requested speed of the link. + #[clap(long)] + speed: PortSpeed, + /// The requested forward-error correction method. If this is None, the + /// standard FEC for the underlying media will be applied if it can be + /// determined. + #[clap(long)] + fec: Option, + /// Whether the link is configured to autonegotiate with its peer during + /// link training. + /// + /// This is generally only true for backplane links, and defaults to + #[clap(long)] + autoneg: bool, + /// Whether the link is configured in KR mode, an electrical specification + /// generally only true for backplane link. + /// + #[clap(long)] + kr: bool, + + /// Uniform equalization parameter to apply to all cursors. + #[clap(long)] + tx_eq: Option, + + /// Transmit equalization precursor 1. + #[clap(long, conflicts_with = "tx_eq")] + pre1: Option, + + /// Transmit equalization precursor 2. + #[clap(long, conflicts_with = "tx_eq")] + pre2: Option, + + /// Transmit equalization main precursor. + #[clap(long, conflicts_with = "tx_eq")] + main: Option, + + /// Transmit equalization postcursor 1. + #[clap(long, conflicts_with = "tx_eq")] + post1: Option, + + /// Transmit equalization postcursor 2. + #[clap(long, conflicts_with = "tx_eq")] + post2: Option, + }, } -#[derive(Debug, StructOpt)] +#[derive(Debug, Parser)] pub struct LinkCreate { /// The ID of the switch port on which to create the link. - #[structopt(parse(try_from_str = parse_port_id))] + #[clap(value_parser = parse_port_id)] port_id: types::PortId, /// The first lane of the port to use for this link - #[structopt(long, parse(try_from_str))] + #[clap(long)] lane: Option, /// The speed for the new link. - #[structopt(short = "s", long, parse(try_from_str))] + #[clap(short = 's')] speed: PortSpeed, /// The error-correction scheme for the link. - #[structopt(long, parse(try_from_str))] + #[clap(long)] fec: Option, /// If provided, configure the link to use autonegotiation with its peer. - #[structopt(short, long)] + #[clap(short, long)] autoneg: bool, /// If provided, configure the link in KR mode. /// /// This is generally only appropriate for backplane links. - #[structopt(short, long)] + #[clap(short, long)] kr: bool, } -#[derive(Clone, Copy, Debug, PartialEq, StructOpt)] +#[derive(Clone, Copy, Debug, PartialEq, Subcommand)] pub enum LinkProp { /// Fetch the MAC address of the link. Mac, @@ -451,66 +500,48 @@ pub enum LinkProp { /// The error-correction scheme for the link. Fec, /// Fetch whether autonegotiation is enabled for the link. - #[structopt(visible_alias = "an")] + #[clap(visible_alias = "an")] Autoneg, /// Fetch whether nat-only restrictions are enabled for the link. NatOnly, /// Fetch whether the link is enabled. - #[structopt(visible_alias = "ena")] + #[clap(visible_alias = "ena")] Enabled, /// Fetch the link state. State, /// Fetch the IP addresses assigned to a link. Ip { - #[structopt(short = "f", long)] + #[clap(short = 'f', long)] family: Option, }, /// Fetch whether the link is configured for IPv6 - #[structopt(visible_alias = "ipv6")] + #[clap(visible_alias = "ipv6")] Ipv6Enabled, /// Fetch the PRBS mode for the link. Prbs, } -#[derive(Debug, StructOpt)] +#[derive(Debug, Clone, Subcommand)] pub enum SetLinkProp { /// Set the MAC address of the link. Mac { mac: MacAddr }, /// Set the KR mode for the link. - Kr { - #[structopt(parse(try_from_str))] - kr: bool, - }, + Kr { kr: bool }, /// Set whether autonegotiation is enabled for the link. - #[structopt(visible_alias = "an")] - Autoneg { - #[structopt(parse(try_from_str))] - autoneg: bool, - }, + #[clap(visible_alias = "an")] + Autoneg { autoneg: bool }, /// Set whether nat-only restrictions are enabled for the link. - NatOnly { - #[structopt(parse(try_from_str))] - nat_only: bool, - }, + NatOnly { nat_only: bool }, /// Set whether the link is enabled. - #[structopt(visible_alias = "ena")] - Enabled { - #[structopt(parse(try_from_str))] - enabled: bool, - }, + #[clap(visible_alias = "ena")] + Enabled { enabled: bool }, /// Assign an IP address to the link. Ip { ip: IpAddr }, /// Set whether the link is configured for IPv6 - #[structopt(visible_alias = "ipv6")] - Ipv6Enabled { - #[structopt(parse(try_from_str))] - enabled: bool, - }, + #[clap(visible_alias = "ipv6")] + Ipv6Enabled { enabled: bool }, /// Set the PRBS mode for the link. (7, 9, 11, 15, 23, 31, or mission/off) - Prbs { - #[structopt(parse(try_from_str))] - prbs: PortPrbsMode, - }, + Prbs { prbs: PortPrbsMode }, } async fn link_pcs_counters( @@ -518,11 +549,13 @@ async fn link_pcs_counters( maybe_link: Option, ) -> anyhow::Result<()> { let counters = if let Some(link) = maybe_link { - vec![client - .pcs_counters_get(&link.port_id, &link.link_id) - .await - .context("failed to get PCS counters") - .map(|r| r.into_inner())?] + vec![ + client + .pcs_counters_get(&link.port_id, &link.link_id) + .await + .context("failed to get PCS counters") + .map(|r| r.into_inner())?, + ] } else { let mut counters = client .pcs_counters_list() @@ -560,7 +593,7 @@ async fn link_pcs_counters( .bip_errors_per_pcs_lane .iter() .enumerate() - .filter(|(_, &cnt)| cnt > 0) + .filter(|&(_, &cnt)| cnt > 0) .map(|(i, cnt)| format!("{i}: {cnt}")) .collect(); let bip = match non_zero.len() { @@ -661,11 +694,13 @@ async fn link_up_counters( maybe_link: Option, ) -> anyhow::Result<()> { let counters = if let Some(link) = maybe_link { - vec![client - .link_up_counters_get(&link.port_id, &link.link_id) - .await - .map(|r| r.into_inner()) - .context("failed to get link-up counters")?] + vec![ + client + .link_up_counters_get(&link.port_id, &link.link_id) + .await + .map(|r| r.into_inner()) + .context("failed to get link-up counters")?, + ] } else { client .link_up_counters_list() @@ -1234,7 +1269,7 @@ impl FromStr for LinkField { "f" | "fec" => LinkField::Fec, "m" | "mac" => LinkField::Mac, "6" | "ipv6" => LinkField::Ipv6Enabled, - _ => bail!("Invalid link field: \"{}\"", s), + _ => bail!("Invalid link field: \"{s}\""), }) } } @@ -1263,7 +1298,7 @@ impl LinkField { } } -// Newtype needed to convince `structopt` to parse a list of fields. +// Newtype needed to convince `clap` to parse a list of fields. #[derive(Clone, Debug)] pub struct FieldList(Vec); @@ -1410,7 +1445,7 @@ fn print_link_verbose( types::LinkState::Up => "Up".to_string(), types::LinkState::Down => "Down".to_string(), types::LinkState::ConfigError(ref detail) => - format!("ConfigError({})", detail), + format!("ConfigError({detail})"), types::LinkState::Faulted(_) => "Faulted".to_string(), types::LinkState::Unknown => "Unknown".to_string(), }, @@ -1702,7 +1737,7 @@ pub async fn link_cmd(client: &Client, link: Link) -> anyhow::Result<()> { .await .context("failed to fetch PRBS mode")? .into_inner(); - println!("{}", prbs); + println!("{prbs}"); } _ => { // These properties do not have specific endpoints, so we @@ -1828,7 +1863,7 @@ pub async fn link_cmd(client: &Client, link: Link) -> anyhow::Result<()> { .context("failed to get Link history")?; display_link_history(history.into_inner(), raw, reverse, n); } - Link::Fault(fault) => match fault { + Link::Fault { cmd: fault } => match fault { Fault::Show { link_path } => { let cond = client .link_fault_get(&link_path.port_id, &link_path.link_id) @@ -1856,7 +1891,7 @@ pub async fn link_cmd(client: &Client, link: Link) -> anyhow::Result<()> { .context("failed to inject fault")?; } }, - Link::Counters(counters) => match counters { + Link::Counters { cmd: counters } => match counters { LinkCounters::Rmon { link, level, @@ -1890,8 +1925,8 @@ pub async fn link_cmd(client: &Client, link: Link) -> anyhow::Result<()> { .await .context("failed to fetch link BER")?, }, - Link::Serdes(serdes) => match serdes { - Serdes::Get(get) => match get { + Link::Serdes { cmd: serdes } => match serdes { + Serdes::Get { cmd: get } => match get { GetSerdes::EncSpeed { link_path } => { link_serdes_enc_speed(client, link_path) .await @@ -1928,7 +1963,7 @@ pub async fn link_cmd(client: &Client, link: Link) -> anyhow::Result<()> { .context("failed to fetch lane mapping")?; } }, - Serdes::Set(set) => match set { + Serdes::Set { cmd: set } => match set { SetSerdes::TxEq { link_path, pre2, @@ -1945,6 +1980,68 @@ pub async fn link_cmd(client: &Client, link: Link) -> anyhow::Result<()> { } }, }, + + Link::Apply { + link, + tag, + lane, + speed, + fec, + autoneg, + kr, + tx_eq, + pre1, + pre2, + main, + post1, + post2, + } => { + let port_id = &link.port_id; + let mut body = types::PortSettings { + links: HashMap::default(), + }; + + let txeq = if pre1.is_none() + && pre2.is_none() + && main.is_none() + && post1.is_none() + && post2.is_none() + { + tx_eq.map(|x| types::TxEq { + pre1: Some(x), + pre2: Some(x), + main: Some(x), + post1: Some(x), + post2: Some(x), + }) + } else { + Some(types::TxEq { + pre1, + pre2, + main, + post1, + post2, + }) + }; + body.links.insert( + String::from("0"), + types::LinkSettings { + addrs: Vec::default(), + params: types::LinkCreate { + autoneg, + fec: fec.map(|f| f.into()), + kr, + lane, + speed: speed.into(), + tx_eq: txeq, + }, + }, + ); + client + .port_settings_apply(port_id, Some(tag.as_str()), &body) + .await + .context("port settings apply failed")?; + } } Ok(()) } diff --git a/swadm/src/main.rs b/swadm/src/main.rs index 757e9f0..957fa23 100644 --- a/swadm/src/main.rs +++ b/swadm/src/main.rs @@ -9,12 +9,13 @@ use std::io; use std::str::FromStr; use anyhow::Context; -use structopt::*; -use dpd_client::default_port; -use dpd_client::types; +use clap::{Parser, Subcommand, ValueEnum}; + use dpd_client::Client; use dpd_client::ClientState; +use dpd_client::default_port; +use dpd_client::types; mod addr; mod arp; @@ -26,42 +27,64 @@ mod route; mod switchport; mod table; -#[derive(Debug, StructOpt)] -#[structopt( - name = "swadm", - about = "provides a command-line interface to the Oxide Switch Controller", - version = "0.0.1" -)] +/// provides a command-line interface to the Oxide Switch Controller +#[derive(Debug, Parser)] +#[command(name = "swadm", version = "0.0.1")] struct GlobalOpts { - #[structopt( - short, - long, - help = "switch controller's hostname or IP address" - )] + /// switch controller's hostname or IP address + #[arg(long)] host: Option, - #[structopt(help = "switch controller's TCP port", short, long)] + /// switch controller's TCP port + #[arg(long)] port: Option, - #[structopt(subcommand)] + #[command(subcommand)] cmd: Commands, } -#[derive(Debug, StructOpt)] +#[derive(Debug, Subcommand)] enum Commands { /// Print detailed build information about the `dpd` server. - #[structopt(visible_alias = "build-info")] + #[clap(visible_alias = "build-info")] DpdBuildInfo, - Arp(arp::Arp), - Route(route::Route), - Addr(addr::Addr), - Nat(nat::Nat), - Counters(counters::P4Counters), - #[structopt(visible_alias = "sp")] - SwitchPort(switchport::SwitchPort), - Link(link::Link), - Table(table::Table), - Compliance(compliance::Compliance), + Arp { + #[command(subcommand)] + cmd: arp::Arp, + }, + Route { + #[command(subcommand)] + cmd: route::Route, + }, + Addr { + #[command(subcommand)] + cmd: addr::Addr, + }, + Nat { + #[command(subcommand)] + cmd: nat::Nat, + }, + Counters { + #[command(subcommand)] + cmd: counters::P4Counters, + }, + #[clap(visible_alias = "sp")] + SwitchPort { + #[command(subcommand)] + cmd: switchport::SwitchPort, + }, + Link { + #[command(subcommand)] + cmd: link::Link, + }, + Table { + #[command(subcommand)] + cmd: table::Table, + }, + Compliance { + #[command(subcommand)] + cmd: compliance::Compliance, + }, } // A LinkPath or "loopback", used when either is appropriate. @@ -87,7 +110,7 @@ impl FromStr for LinkName { } // A "path" to a link, structured as `port_id/link_id`. -#[derive(Clone, Debug, StructOpt)] +#[derive(Clone, Debug, Parser)] pub struct LinkPath { port_id: types::PortId, link_id: types::LinkId, @@ -110,7 +133,7 @@ impl FromStr for LinkPath { } } -#[derive(Clone, Copy, Debug, StructOpt, Eq, PartialEq)] +#[derive(Clone, Copy, Debug, ValueEnum, Eq, PartialEq)] pub enum IpFamily { V4, V6, @@ -134,19 +157,19 @@ pub fn parse_qsfp_port_id(value: &str) -> Result { value .parse::() .map_err(|_| { - format!("'{}' is invalid; QSFP ports are named qsfp<0-31>", value) + format!("'{value}' is invalid; QSFP ports are named qsfp<0-31>") }) .map(types::PortId::Qsfp) } pub fn parse_port_id(value: &str) -> Result { value.parse().map_err(|_| { - format!("'{}' is invalid; valid port-ids include qsfp<0-31>, rear<0-31>, or int0", value) + format!("'{value}' is invalid; valid port-ids include qsfp<0-31>, rear<0-31>, or int0") }) } pub fn misc_err(msg: T) -> io::Error { - io::Error::new(io::ErrorKind::Other, msg.to_string()) + io::Error::other(msg.to_string()) } async fn build_info(client: &Client) -> anyhow::Result<()> { @@ -178,7 +201,7 @@ fn main() -> anyhow::Result<()> { } async fn main_impl() -> anyhow::Result<()> { - let opts = GlobalOpts::from_args(); + let opts = GlobalOpts::parse(); let port = opts.port.unwrap_or_else(default_port); let host = opts.host.unwrap_or_else(|| "localhost".to_string()); let log = slog::Logger::root(slog::Discard, slog::o!()); @@ -190,15 +213,19 @@ async fn main_impl() -> anyhow::Result<()> { match opts.cmd { Commands::DpdBuildInfo => build_info(&client).await, - Commands::Arp(a) => arp::arp_cmd(&client, a).await, - Commands::Route(r) => route::route_cmd(&client, r).await, - Commands::Addr(p) => addr::addr_cmd(&client, p).await, - Commands::Nat(p) => nat::nat_cmd(&client, p).await, - Commands::Counters(c) => counters::ctrs_cmd(&client, c).await, - Commands::SwitchPort(p) => switchport::switch_cmd(&client, p).await, - Commands::Link(link) => link::link_cmd(&client, link).await, - Commands::Table(table) => table::table_cmd(&client, table).await, - Commands::Compliance(compliance) => { + Commands::Arp { cmd: a } => arp::arp_cmd(&client, a).await, + Commands::Route { cmd: r } => route::route_cmd(&client, r).await, + Commands::Addr { cmd: p } => addr::addr_cmd(&client, p).await, + Commands::Nat { cmd: p } => nat::nat_cmd(&client, p).await, + Commands::Counters { cmd: c } => counters::ctrs_cmd(&client, c).await, + Commands::SwitchPort { cmd: p } => { + switchport::switch_cmd(&client, p).await + } + Commands::Link { cmd: link } => link::link_cmd(&client, link).await, + Commands::Table { cmd: table } => { + table::table_cmd(&client, table).await + } + Commands::Compliance { cmd: compliance } => { compliance::compliance_cmd(&client, compliance).await } } diff --git a/swadm/src/nat.rs b/swadm/src/nat.rs index 2e6e864..f6f4bd0 100644 --- a/swadm/src/nat.rs +++ b/swadm/src/nat.rs @@ -5,61 +5,65 @@ // Copyright 2025 Oxide Computer Company use std::convert::TryFrom; -use std::io::{stdout, Write}; +use std::io::{Write, stdout}; use std::net::{IpAddr, Ipv4Addr, Ipv6Addr}; use anyhow::Context; +use clap::Subcommand; use colored::*; use futures::stream::TryStreamExt; -use structopt::*; use tabwriter::TabWriter; use common::nat; use common::network::MacAddr; -use dpd_client::types; use dpd_client::Client; +use dpd_client::types; -#[derive(Debug, StructOpt)] -#[structopt(about = "manage NAT reservations")] +#[derive(Debug, Subcommand)] +/// manage NAT reservations pub enum Nat { - #[structopt(about = "list all NAT reservations", alias = "ls")] + /// list all NAT reservations + #[clap(visible_alias = "ls")] List { - #[structopt( - help = "limit to the given external IP address", - short = "e" - )] + /// limit to the given external IP address", + #[clap(short = 'e')] external: Option, }, - #[structopt(about = "get a single NAT reservation")] + /// get a single NAT reservation Get { - #[structopt(help = "external IP address", short = "e")] + /// external IP address + #[clap(short = 'e')] external: IpAddr, - #[structopt( - help = "any port within the external port range", - short = "p" - )] + /// any port within the external port range + #[clap(short = 'p')] port: u16, }, - #[structopt(about = "add a new NAT reservation")] + /// add a new NAT reservation Add { - #[structopt(help = "external IP address", short = "e")] + /// external IP address + #[clap(short = 'e')] external: IpAddr, - #[structopt(help = "start of external port range", short = "l")] + /// start of external port range + #[clap(short = 'l')] low: u16, - #[structopt(help = "end of external port range", short = "h")] + /// end of external port range + #[clap(short = 'H')] high: u16, - #[structopt(help = "internal IP address", short = "i")] + /// internal IP address + #[clap(short = 'i')] internal: Ipv6Addr, - #[structopt(help = "inner MAC address", short = "m")] + /// inner MAC address + #[clap(short = 'm')] inner: MacAddr, - #[structopt(help = "Geneve VNI", short = "v")] + /// Geneve VNI + #[clap(short = 'v')] vni: nat::Vni, }, - #[structopt(about = "delete a single NAT reservation")] + /// delete a single NAT reservation Del { - #[structopt(help = "external IP address")] + /// external IP address external: IpAddr, - #[structopt(help = "low end of external port range")] + /// low end of external port range port: u16, }, } diff --git a/swadm/src/route.rs b/swadm/src/route.rs index 3b4469a..c946a5b 100644 --- a/swadm/src/route.rs +++ b/swadm/src/route.rs @@ -4,36 +4,37 @@ // // Copyright 2025 Oxide Computer Company -use std::io::{stdout, Write}; +use std::io::{Write, stdout}; use std::net::IpAddr; +use anyhow::Context; use anyhow::anyhow; use anyhow::bail; -use anyhow::Context; +use clap::Subcommand; use colored::*; use futures::stream::TryStreamExt; use oxnet::{IpNet, Ipv4Net, Ipv6Net}; -use structopt::*; use tabwriter::TabWriter; -use dpd_client::types; use dpd_client::Client; use dpd_client::ClientInfo; +use dpd_client::types; use crate::IpFamily; use crate::LinkPath; -#[derive(Debug, StructOpt)] -#[structopt(about = "manage the L3 routing table")] +#[derive(Debug, Subcommand)] +/// manage the L3 routing table pub enum Route { - #[structopt(about = "list all routes", visible_alias = "ls")] + /// list all routes + #[clap(visible_alias = "ls")] List { - #[structopt(about = "IPv4 or IPv6")] + /// IPv4 or IPv6 family: Option, }, - #[structopt(about = "get one route")] + /// get one route Get { - #[structopt(help = "route CIDR")] + /// route CIDR cidr: IpNet, }, /// Add a route to a link. @@ -45,7 +46,6 @@ pub enum Route { /// Routes are used to direct traffic for a subnet to a particular /// endpoint, a link within a switch port. This should be specified as /// `port_id/link_id`, e.g., `qsfp0/0`. - #[structopt(parse(try_from_str))] link_path: LinkPath, /// The gateway to which traffic should be sent. /// @@ -54,15 +54,14 @@ pub enum Route { gw: IpAddr, /// If specified, this indicates the VLAN tag that will be applied to /// packets forwarded across this route. - #[structopt(alias = "vlan")] + #[clap(visible_alias = "vlan")] vlan_id: Option, }, - #[structopt(about = "delete one route")] + /// delete one route Del { - #[structopt(help = "route CIDR")] + /// route CIDR cidr: IpNet, /// Identify a specific target to delete - #[structopt(parse(try_from_str))] link_path: Option, /// Identify a specific target to delete gw: Option, diff --git a/swadm/src/switchport.rs b/swadm/src/switchport.rs index 9def1df..847c753 100644 --- a/swadm/src/switchport.rs +++ b/swadm/src/switchport.rs @@ -5,26 +5,25 @@ // Copyright 2025 Oxide Computer Company use std::collections::{BTreeMap, HashMap}; -use std::convert::TryFrom; -use std::io::{stdout, Write}; +use std::io::{Write, stdout}; use std::str::FromStr; -use anyhow::bail; use anyhow::Context; +use anyhow::bail; +use clap::{Subcommand, ValueEnum}; use colored::*; -use structopt::*; use tabwriter::TabWriter; +use dpd_client::Client; use dpd_client::types::{ self, CmisDatapath, CmisLaneStatus, PortId, Sff8636Datapath, SffComplianceCode, }; -use dpd_client::Client; use crate::LinkPath; use crate::{parse_port_id, parse_qsfp_port_id}; -// Newtype needed to convince `structopt` to parse a list of fields. +// Newtype needed to convince `clap` to parse a list of fields. #[derive(Clone, Debug)] pub struct BackplaneMapFieldList(Vec); @@ -145,10 +144,10 @@ fn print_backplane_map_fields() { } /// Manage physical switch ports. -#[derive(Debug, StructOpt)] +#[derive(Debug, Subcommand)] pub enum SwitchPort { /// List all switch ports. - #[structopt(visible_alias = "ls")] + #[clap(visible_alias = "ls")] List { /// Limit output to those ports containing the provided name. /// @@ -157,13 +156,19 @@ pub enum SwitchPort { name: Option, }, /// Fetch the free MAC lanes in the port. - #[structopt(visible_alias = "avail")] + #[clap(visible_alias = "avail")] Free, /// Manage the Sidecar QSFP transceivers. - #[structopt(visible_alias = "xcvr")] - Transceiver(Transceiver), + #[clap(visible_aliases = ["xcvr", "txr"])] + Transceiver { + #[command(subcommand)] + cmd: Transceiver, + }, /// Manage the attention LEDs on the Sidecar QSFP switch ports. - Led(Led), + Led { + #[command(subcommand)] + cmd: Led, + }, /// Get the management mode for a switch port's transceiver. /// /// In most situations, QSFP switch ports are managed automatically, meaning @@ -174,104 +179,112 @@ pub enum SwitchPort { /// Modules may be turned to manual management mode, which allows the /// operator to explicitly control their power. The software will not change /// the power of such a module automatically. - #[structopt(visible_aliases = &["mgmt", "mode"])] + #[clap(visible_aliases = ["mgmt", "mode"])] ManagementMode { /// The QSFP port to operate on. - #[structopt(parse(try_from_str = parse_qsfp_port_id))] + #[clap(value_parser = parse_qsfp_port_id)] port_id: types::PortId, }, /// Set the management mode for a switch port's transceiver. /// /// See the help for `management-mode` for details. - #[structopt(visible_aliases = &["set-mgmt", "set-mode"])] + #[clap(visible_aliases = ["set-mgmt", "set-mode"])] SetManagementMode { /// The QSFP port to operate on. - #[structopt(parse(try_from_str = parse_qsfp_port_id))] + #[clap(value_parser = parse_qsfp_port_id)] port_id: types::PortId, /// The management mode to set the port to. - #[structopt( - possible_values = &["automatic", "auto", "manual"], - parse(try_from_str = parse_management_mode) - )] mode: types::ManagementMode, }, /// Return the backplane map. BackplaneMap { /// If true, provide parseable ouptut, separated by a `,`. - #[structopt(short, long)] + #[clap(short, long)] parseable: bool, /// Which backplane map fields to print. - #[structopt(short = "o", parse(try_from_str = parse_backplane_map_fields))] + #[clap(short = 'o', value_parser = parse_backplane_map_fields)] fields: Option, /// List the available fields for printing. - #[structopt(short, long)] + #[clap(short, long)] list_fields: bool, }, } +#[derive(Debug, ValueEnum, Copy, Clone)] +pub enum ManagementMode { + Automatic, + Auto, + Manual, +} + +impl From for types::ManagementMode { + fn from(value: ManagementMode) -> Self { + match value { + ManagementMode::Manual => types::ManagementMode::Manual, + ManagementMode::Auto => types::ManagementMode::Automatic, + ManagementMode::Automatic => types::ManagementMode::Automatic, + } + } +} + /// Manage the Sidecar QSFP transceivers. -#[derive(Debug, StructOpt)] +#[derive(Debug, Subcommand, Clone)] pub enum Transceiver { /// List basic transceiver information. - #[structopt(visible_alias = "ls")] + #[clap(visible_alias = "ls")] List, /// Get basic transceiver information about one transceiver. Get { /// The QSFP port to fetch transceiver information from. - #[structopt(parse(try_from_str = parse_port_id))] + #[clap(value_parser = parse_port_id)] port_id: PortId, }, /// Reset a transceiver module. Reset { /// The QSFP port whose module should be reset. - #[structopt(parse(try_from_str = parse_port_id))] + #[clap(value_parser = parse_port_id)] port_id: PortId, }, /// Fetch the power state of a transceiver module Power { /// The QSFP port whose module to fetch the power for. - #[structopt(parse(try_from_str = parse_port_id))] + #[clap(value_parser = parse_port_id)] port_id: PortId, }, /// Set the power state of a transceiver module. SetPower { /// The QSFP port whose module should be controlled. - #[structopt(parse(try_from_str = parse_port_id))] + #[clap(value_parser = parse_port_id)] port_id: PortId, /// The power state to which to set the module. state: types::PowerState, }, /// Fetch the environmental monitoring data for a transceiver. + #[clap(visible_alias = "mon")] Monitors { /// The QSFP port to fetch the transceiver monitoring data from. - #[structopt(parse(try_from_str = parse_port_id))] + #[clap(value_parser = parse_port_id)] port_id: PortId, }, /// Fetch the state of the datapath for a transceiver. + #[clap(visible_alias = "dp")] Datapath { /// The QSFP port to fetch the transceiver datapath from. - #[structopt(parse(try_from_str = parse_port_id))] + #[clap(value_parser = parse_port_id)] port_id: PortId, }, } -fn parse_management_mode(s: &str) -> anyhow::Result { - if s.eq_ignore_ascii_case("auto") { - return Ok(types::ManagementMode::Automatic); - } - types::ManagementMode::try_from(s).context("parsing management mode") -} - /// Manage the attention LEDs on the Sidecar QSFP switch ports. -#[derive(Debug, StructOpt)] +#[derive(Debug, Subcommand)] pub enum Led { /// List the state of all LEDs. - #[structopt(visible_alias = "ls")] + #[clap(visible_alias = "ls")] List, /// Get the state of a single LED. Get { /// The QSFP port whose LED state should be fetched. - #[structopt(parse(try_from_str = parse_port_id))] + #[clap(value_parser = parse_port_id)] port_id: PortId, }, /// Override the state of a single LED. @@ -285,31 +298,20 @@ pub enum Led { /// automatic`. Set { /// The QSFP port whose LED should be controlled. - #[structopt(parse(try_from_str = parse_port_id))] + #[clap(value_parser = parse_port_id)] port_id: PortId, /// The state to set the LED to. - #[structopt(possible_values = &["on", "off", "blink", "automatic", "auto"])] state: SetLedState, }, } -#[derive(Debug)] +#[derive(Debug, ValueEnum, Copy, Clone)] pub enum SetLedState { + Auto, Automatic, - Override(types::LedState), -} - -impl FromStr for SetLedState { - type Err = anyhow::Error; - fn from_str(s: &str) -> Result { - if s.eq_ignore_ascii_case("auto") || s.eq_ignore_ascii_case("automatic") - { - return Ok(SetLedState::Automatic); - } - types::LedState::try_from(s) - .map(SetLedState::Override) - .context("parsing LED state") - } + Off, + On, + Blink, } // Helper used to stringify an optional displayable item, or `-`, if it is None. @@ -364,7 +366,7 @@ fn print_faulted_transceiver_row( port_id: &PortId, reason: &types::FaultReason, ) -> anyhow::Result<()> { - writeln!(tw, "{}\tfaulted ({:?})\t\t\t\t\t\t\t", port_id, reason) + writeln!(tw, "{port_id}\tfaulted ({reason:?})\t\t\t\t\t\t\t") .map_err(|e| e.into()) } @@ -372,7 +374,7 @@ fn print_unsupported_transceiver_row( tw: &mut TabWriter, port_id: &PortId, ) -> anyhow::Result<()> { - writeln!(tw, "{}\tunsupported\t\t\t\t\t\t\t", port_id).map_err(|e| e.into()) + writeln!(tw, "{port_id}\tunsupported\t\t\t\t\t\t\t").map_err(|e| e.into()) } fn print_supported_transceiver_row( @@ -393,11 +395,7 @@ fn print_supported_transceiver_row( |m| { m.software_override.map( |t| { - if t { - "Software" - } else { - "Hardware" - } + if t { "Software" } else { "Hardware" } }, ) } @@ -572,7 +570,7 @@ async fn transceivers_cmd( .await .context("failed to get transceiver monitors")? .into_inner(); - println!("Port monitors: {}", port_id); + println!("Port monitors: {port_id}"); const UNSUPPORTED: &str = "-"; const WIDTH: usize = 22; @@ -740,7 +738,7 @@ fn print_sff_datapath( .map(|b| if b { "Yes" } else { "No" }) .collect::>() .join("\t"); - writeln!(tw, "{:>WIDTH$}: {}", name, cols).unwrap(); + writeln!(tw, "{name:>WIDTH$}: {cols}").unwrap(); } tw.flush().expect("Failed to flush tabwriter"); @@ -873,7 +871,7 @@ fn print_cmis_datapath( .map(getter) .collect::>() .join("\t"); - writeln!(tw, "{:>WIDTH$}: {}", name, cols).unwrap(); + writeln!(tw, "{name:>WIDTH$}: {cols}").unwrap(); } tw.flush().unwrap(); } @@ -926,12 +924,21 @@ async fn led_cmd(client: &Client, led: Led) -> anyhow::Result<()> { tw.flush()?; } Led::Set { port_id, state } => match state { - SetLedState::Automatic => { + SetLedState::Automatic | SetLedState::Auto => { client.led_set_auto(&port_id).await?.into_inner() } - SetLedState::Override(state) => { - client.led_set(&port_id, state).await?.into_inner() - } + SetLedState::Off => client + .led_set(&port_id, types::LedState::Off) + .await? + .into_inner(), + SetLedState::On => client + .led_set(&port_id, types::LedState::On) + .await? + .into_inner(), + SetLedState::Blink => client + .led_set(&port_id, types::LedState::Blink) + .await? + .into_inner(), }, } Ok(()) @@ -944,12 +951,12 @@ pub async fn switch_cmd( match switch_port { SwitchPort::List { name } => { for p in client.port_list().await?.into_inner() { - if let Some(name) = name.as_ref() { - if !p.to_string().contains(name) { - continue; - } + if let Some(name) = name.as_ref() + && !p.to_string().contains(name) + { + continue; } - println!("{}", p) + println!("{p}") } } SwitchPort::Free => { @@ -975,7 +982,9 @@ pub async fn switch_cmd( )?; } } - SwitchPort::Transceiver(xcvr) => transceivers_cmd(client, xcvr).await?, + SwitchPort::Transceiver { cmd: xcvr } => { + transceivers_cmd(client, xcvr).await? + } SwitchPort::ManagementMode { port_id } => { let mode = client.management_mode_get(&port_id).await?.into_inner(); println!("{mode:?}"); @@ -983,7 +992,7 @@ pub async fn switch_cmd( SwitchPort::SetManagementMode { port_id, mode } => { client.management_mode_set(&port_id, mode).await?; } - SwitchPort::Led(led) => led_cmd(client, led).await?, + SwitchPort::Led { cmd: led } => led_cmd(client, led).await?, SwitchPort::BackplaneMap { parseable, fields, @@ -1022,7 +1031,7 @@ pub async fn switch_cmd( for (i, field) in fields.iter().enumerate() { match field { BackplaneMapField::PortId => { - print!("{}", port_id) + print!("{port_id}") } BackplaneMapField::TofinoConnector => { print!("{:<}", entry.tofino_connector) @@ -1052,7 +1061,7 @@ pub async fn switch_cmd( } match field { BackplaneMapField::PortId => { - write!(&mut tw, "{}", port_id)? + write!(&mut tw, "{port_id}")? } BackplaneMapField::TofinoConnector => { write!(&mut tw, "{:<}", entry.tofino_connector)? @@ -1185,10 +1194,7 @@ mod test { assert_eq!( lhs.order_by_id(&rhs), order, - "{:?} should be {:?} than {:?}", - lhs, - order, - rhs + "{lhs:?} should be {order:?} than {rhs:?}" ); } } diff --git a/swadm/src/table.rs b/swadm/src/table.rs index c998ca4..d4be99c 100644 --- a/swadm/src/table.rs +++ b/swadm/src/table.rs @@ -4,51 +4,50 @@ // // Copyright 2025 Oxide Computer Company -use std::collections::btree_map::Entry; use std::collections::BTreeMap; -use std::io::stdout; +use std::collections::btree_map::Entry; use std::io::Write; +use std::io::stdout; +use clap::Subcommand; use colored::Colorize; -use structopt::*; use tabwriter::TabWriter; -use dpd_client::types; use dpd_client::Client; +use dpd_client::types; -use crate::counters::get_counter_type; use crate::counters::CounterType; +use crate::counters::get_counter_type; -#[derive(Debug, StructOpt)] +#[derive(Debug, Subcommand)] /// Access the raw contents of the tables used by the P4 program. -#[structopt(verbatim_doc_comment)] pub enum Table { - #[structopt(alias = "ls")] + #[clap(visible_alias = "ls")] /// List the names of the dynamic p4 tables. List, /// Fetch the data programmed into the specified table. Dump { - #[structopt(short = "a")] + #[clap(short = 'a')] /// Display only those entries with the specified action. action: Option, - #[structopt(short = "s")] + #[clap(short = 's')] /// Displays the schema rather than the table contents. The order in /// which the names are the displayed match the order in which the /// actual data will be displayed as 'parseable' output. schema: bool, - #[structopt(short = "p")] + #[clap(short = 'p')] /// Display the data in a parseable format rather then user-friendly. parseable: bool, /// The name of the table to display. name: String, }, /// Fetch any counter data associated with the specified table. - #[structopt(visible_alias = "ctrs")] + #[clap(visible_alias = "ctrs")] Counters { - #[structopt(short = "p")] + #[clap(short = 'p')] /// Display the data in a parseable format rather then user-friendly. parseable: bool, - #[structopt(short = "f")] + #[clap(short = 'f')] /// sync the counter data from the ASIC to memory even if the normal /// refresh timeout hasn't expired. force_sync: bool, @@ -116,10 +115,10 @@ async fn table_dump( .unwrap(); } for entry in &t.entries { - if let Some(filter) = &action_filter { - if &entry.action != filter { - continue; - } + if let Some(filter) = &action_filter + && &entry.action != filter + { + continue; } let keys: Vec = schema @@ -238,7 +237,7 @@ pub async fn table_cmd( match table_cmd { Table::List => { for t in client.table_list().await?.into_inner() { - println!("{}", t) + println!("{t}") } Ok(()) } diff --git a/swadm/tests/counters.rs b/swadm/tests/counters.rs index 3217af3..50d7739 100644 --- a/swadm/tests/counters.rs +++ b/swadm/tests/counters.rs @@ -19,7 +19,7 @@ fn swadm() -> Command { #[ignore] fn test_p4_counter_list() { let output = swadm() - .arg("-h") + .arg("--host") .arg("[::1]") .arg("counters") .arg("list") @@ -62,9 +62,7 @@ fn test_p4_counter_list() { for counter in &expected_counters { assert!( stdout.contains(counter), - "Counter list should contain '{}' counter. Output: {}", - counter, - stdout + "Counter list should contain '{counter}' counter. Output: {stdout}" ); } } diff --git a/tfportd/Cargo.toml b/tfportd/Cargo.toml index 0cb3cb5..21b484d 100644 --- a/tfportd/Cargo.toml +++ b/tfportd/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "tfportd" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] dpd-client.workspace = true @@ -26,7 +26,7 @@ signal-hook.workspace = true slog.workspace = true smf.workspace = true socket2.workspace = true -structopt.workspace = true +clap.workspace = true thiserror.workspace = true tokio.workspace = true uuid.workspace = true diff --git a/tfportd/src/arp.rs b/tfportd/src/arp.rs index 328b1d4..2969267 100644 --- a/tfportd/src/arp.rs +++ b/tfportd/src/arp.rs @@ -13,13 +13,13 @@ use anyhow::anyhow; use futures::TryStreamExt; use slog::{debug, error, info}; +use crate::Global; use crate::poll_interval; use crate::sidecar; -use crate::Global; use common::network::MacAddr; -use dpd_client::types; use dpd_client::Client; use dpd_client::ClientInfo; +use dpd_client::types; const ARP: &str = "/usr/sbin/arp"; const DEFAULT_IPV4_MASK: Ipv4Addr = Ipv4Addr::new(255, 255, 255, 255); @@ -119,7 +119,7 @@ fn parse_arp(line: &str) -> anyhow::Result { let last = fields.len() - 1; if last < 3 { - return Err(anyhow!("bad arp line: {}", line)); + return Err(anyhow!("bad arp line: {line}")); } let iface = fields[0].to_string(); diff --git a/tfportd/src/config.rs b/tfportd/src/config.rs index b1a95d3..cefe4d6 100644 --- a/tfportd/src/config.rs +++ b/tfportd/src/config.rs @@ -247,7 +247,9 @@ fn update_from_cli( .iter() .all(|addr| addr.ip().is_loopback()) { - eprintln!("No non-localhost IPv6 addresses found in provided listen_addresses"); + eprintln!( + "No non-localhost IPv6 addresses found in provided listen_addresses" + ); } } diff --git a/tfportd/src/linklocal.rs b/tfportd/src/linklocal.rs index cfc4257..4b61b24 100644 --- a/tfportd/src/linklocal.rs +++ b/tfportd/src/linklocal.rs @@ -7,8 +7,8 @@ use std::collections::BTreeMap; use std::net::Ipv6Addr; -use anyhow::anyhow; use anyhow::Result; +use anyhow::anyhow; use slog::debug; use crate::Global; @@ -110,10 +110,10 @@ fn test_parse_ipadm() -> Result<()> { ); // test too many fields - assert!(parse_ipadm_line( - r"tfport10/ll:fe80\:\:aa40\:25ff\:fe04\:392:garbage" - ) - .is_err()); + assert!( + parse_ipadm_line(r"tfport10/ll:fe80\:\:aa40\:25ff\:fe04\:392:garbage") + .is_err() + ); // test too few fields assert!(parse_ipadm_line(r"tfport10/ll").is_err()); diff --git a/tfportd/src/main.rs b/tfportd/src/main.rs index e6e55b0..ca0555b 100644 --- a/tfportd/src/main.rs +++ b/tfportd/src/main.rs @@ -7,7 +7,7 @@ use std::collections::BTreeMap; use std::net::Ipv6Addr; use std::net::SocketAddrV6; -use std::sync::{atomic, Arc, Mutex}; +use std::sync::{Arc, Mutex, atomic}; use std::thread; use std::time::Duration; @@ -22,7 +22,7 @@ use signal_hook::consts::signal::*; use signal_hook::iterator::Signals; use slog::{debug, error, info, warn}; -use structopt::StructOpt; +use clap::Parser; use tokio::runtime::Handle; use tokio::sync::watch; use tokio::task; @@ -56,42 +56,46 @@ pub fn poll_interval() -> Duration { ) } -#[derive(Debug, Default, StructOpt)] -#[structopt(name = "tfportd", about = "tfport management daemon")] +/// tfport management daemon +#[derive(Debug, Default, Parser)] +#[clap(name = "tfportd")] pub(crate) struct Opt { - #[structopt(long, about = "log file")] + /// log file + #[clap(long)] log_file: Option, - #[structopt( - long, - short = "l", - about = "log format", - help = "format logs for 'human' or 'json' consumption" - )] + /// log format + /// + /// format logs for 'human' or 'json' consumption + #[clap(long, short = 'l')] log_format: Option, - #[structopt( - long, - help = "IPv6 addresses and ports on which to expose the producer(s)" - )] + /// IPv6 addresses and ports on which to expose the producer(s) + #[clap(long)] listen_addresses: Option>, - #[structopt(long, short, about = "packet source to layer tfports over")] + /// packet source to layer tfports over + #[clap(long, short)] pkt_source: Option, - #[structopt(long, about = "dpd host name/addr")] + /// dpd host name/addr + #[clap(long)] dpd_host: Option, - #[structopt(long, about = "dpd port number")] + /// dpd port number + #[clap(long)] dpd_port: Option, - #[structopt(long, about = "link on which vlans should be created")] + /// link on which vlans should be created + #[clap(long)] vlan_link: Option, - #[structopt(long, about = "vlan config file")] + /// vlan config file + #[clap(long)] vlan_data: Option, - #[structopt(long, help = "only run arp/ndp synchronization")] + /// only run arp/ndp synchronization + #[clap(long)] sync_only: bool, /// Bootstrap prefix to advertise over techport0. @@ -99,7 +103,7 @@ pub(crate) struct Opt { /// If the argument is not provided at all, or it is the exact string /// `"none"`, then **NO ADVERTISEMENT** will be done. If provided, this must /// be a valid `/64` IPv6 prefix. - #[structopt(long)] + #[clap(long)] techport0_prefix: Option, /// Bootstrap prefix to advertise over techport1. @@ -107,7 +111,7 @@ pub(crate) struct Opt { /// If the argument is not provided at all, or it is the exact string /// `"none"`, then **NO ADVERTISEMENT** will be done. If provided, this must /// be a valid `/64` IPv6 prefix. - #[structopt(long)] + #[clap(long)] techport1_prefix: Option, } @@ -257,7 +261,7 @@ fn main() -> anyhow::Result<()> { } async fn main_impl() -> anyhow::Result<()> { - let opts = Opt::from_args(); + let opts = Opt::parse(); let config = config::build_config(&opts)?; const CLIENT_NAME: &str = "tfportd"; diff --git a/tfportd/src/ndp.rs b/tfportd/src/ndp.rs index 35f25ae..a4325ab 100644 --- a/tfportd/src/ndp.rs +++ b/tfportd/src/ndp.rs @@ -15,9 +15,9 @@ use dpd_client::types; use futures::TryStreamExt; use slog::{debug, error, info}; +use crate::Global; use crate::poll_interval; use crate::sidecar; -use crate::Global; use common::network::MacAddr; use dpd_client::ClientInfo; diff --git a/tfportd/src/netsupport.rs b/tfportd/src/netsupport.rs index 58b1a6a..99061e5 100644 --- a/tfportd/src/netsupport.rs +++ b/tfportd/src/netsupport.rs @@ -9,7 +9,7 @@ use std::net::{IpAddr, Ipv6Addr}; use anyhow::anyhow; -extern "C" { +unsafe extern "C" { pub fn link_local_get( ifname: *const ::std::os::raw::c_char, addr: *mut u8, diff --git a/tfportd/src/oxstats.rs b/tfportd/src/oxstats.rs index 818b477..ce69ed9 100644 --- a/tfportd/src/oxstats.rs +++ b/tfportd/src/oxstats.rs @@ -7,7 +7,7 @@ //! Metrics produced by tfport and vlan links for collection by oximeter. use std::{ - collections::{hash_map::Entry, HashMap, HashSet}, + collections::{HashMap, HashSet, hash_map::Entry}, net::{Ipv6Addr, SocketAddr}, sync::{Arc, RwLock}, time::Duration, @@ -24,7 +24,7 @@ use omicron_common::api::internal::{ shared::SledIdentifiers, }; use omicron_common::backoff::{ - retry_notify, retry_policy_internal_service_aggressive, BackoffError, + BackoffError, retry_notify, retry_policy_internal_service_aggressive, }; use oximeter::types::ProducerRegistry; use oximeter_instruments::kstat::{CollectionDetails, KstatSampler, TargetId}; @@ -522,7 +522,8 @@ async fn fetch_switch_identifiers( return Ok(idents); } Err(e) => { - error!(g.log, + error!( + g.log, "failed to fetch switch identifiers from dpd-client: {e:?}, \ will retry", ) diff --git a/tfportd/src/oxstats/link.rs b/tfportd/src/oxstats/link.rs index 8637471..6a9c3b6 100644 --- a/tfportd/src/oxstats/link.rs +++ b/tfportd/src/oxstats/link.rs @@ -8,9 +8,9 @@ use std::fmt; -use oximeter::{types::Cumulative, Sample}; +use oximeter::{Sample, types::Cumulative}; use oximeter_instruments::kstat::{ - hrtime_to_utc, ConvertNamedData, Error, KstatList, KstatTarget, + ConvertNamedData, Error, KstatList, KstatTarget, hrtime_to_utc, }; use chrono::{DateTime, Utc}; diff --git a/tfportd/src/packet_queue.rs b/tfportd/src/packet_queue.rs index c9e7122..f1bfa63 100644 --- a/tfportd/src/packet_queue.rs +++ b/tfportd/src/packet_queue.rs @@ -9,7 +9,7 @@ use std::sync::Mutex; use slog::debug; -use crate::{now, Global}; +use crate::{Global, now}; use packet::Packet; // An enqueued packet awaiting resolution of an IP to MAC address. diff --git a/tfportd/src/ports.rs b/tfportd/src/ports.rs index ade0bd1..9f202c3 100644 --- a/tfportd/src/ports.rs +++ b/tfportd/src/ports.rs @@ -36,16 +36,16 @@ use std::sync::Arc; use anyhow::Context; use anyhow::Result; -use dpd_client::types; use dpd_client::ClientInfo; +use dpd_client::types; use slog::debug; use slog::error; use slog::info; use slog::warn; +use crate::Global; use crate::poll_interval; use crate::tfport; -use crate::Global; use common::network::MacAddr; /// Information about a single link in `dpd`, and its associated `tfport` if it @@ -235,31 +235,31 @@ async fn illumos_port_update( // happen if the mac address changes which, as noted in dpd_port_update(), // would also be very weird. async fn ensure_address_match(g: &Global, link: &LinkInfo) -> Result<()> { - if let Some(addr) = link.dpd_link_local { - if link.dpd_link_local != link.tfport_link_local { - warn!(g.log, "deleting stale dpd address: {addr}"); - g.client - .link_ipv6_delete(&link.port_id, &link.link_id, &addr) - .await - .context("deleting stale link-local address")?; - } + if let Some(addr) = link.dpd_link_local + && link.dpd_link_local != link.tfport_link_local + { + warn!(g.log, "deleting stale dpd address: {addr}"); + g.client + .link_ipv6_delete(&link.port_id, &link.link_id, &addr) + .await + .context("deleting stale link-local address")?; } - if let Some(addr) = link.tfport_link_local { - if link.dpd_link_local != link.tfport_link_local { - info!(g.log, "sending new tfport address: {addr}"); - g.client - .link_ipv6_create( - &link.port_id, - &link.link_id, - &types::Ipv6Entry { - tag: g.client.inner().tag.clone(), - addr, - }, - ) - .await - .context("sending new link-local address")?; - } + if let Some(addr) = link.tfport_link_local + && link.dpd_link_local != link.tfport_link_local + { + info!(g.log, "sending new tfport address: {addr}"); + g.client + .link_ipv6_create( + &link.port_id, + &link.link_id, + &types::Ipv6Entry { + tag: g.client.inner().tag.clone(), + addr, + }, + ) + .await + .context("sending new link-local address")?; } Ok(()) diff --git a/tfportd/src/sidecar.rs b/tfportd/src/sidecar.rs index beec04c..d87c029 100644 --- a/tfportd/src/sidecar.rs +++ b/tfportd/src/sidecar.rs @@ -10,10 +10,10 @@ use std::sync::Arc; use slog::debug; use slog::error; -use crate::netsupport; use crate::Global; +use crate::netsupport; use common::network::MacAddr; -use packet::{sidecar, Packet}; +use packet::{Packet, sidecar}; // Any packets that were blocked pending an ARP/NDP resolution which completed // successfully can now be retransmitted. diff --git a/tfportd/src/simport.rs b/tfportd/src/simport.rs index 4fe7e4b..31eb207 100644 --- a/tfportd/src/simport.rs +++ b/tfportd/src/simport.rs @@ -12,9 +12,9 @@ use std::sync::Arc; use futures::TryStreamExt; use slog::{debug, error, warn}; +use crate::Global; use crate::oxstats::link; use crate::poll_interval; -use crate::Global; use common::illumos; use dpd_client::types; diff --git a/tfportd/src/techport.rs b/tfportd/src/techport.rs index 99279a3..a3615b3 100644 --- a/tfportd/src/techport.rs +++ b/tfportd/src/techport.rs @@ -15,11 +15,11 @@ use slog::{error, info, warn}; use socket2::{Domain, Protocol, Socket, Type}; use tokio::time::sleep; -use crate::netsupport; use crate::Global; +use crate::netsupport; use common::illumos; -use dpd_client::types; use dpd_client::ClientInfo; +use dpd_client::types; const ICMP6_RA_TYPE: u8 = 134; const ICMP6_RA_CODE: u8 = 0; diff --git a/tfportd/src/tfport.rs b/tfportd/src/tfport.rs index 1924db8..2285707 100644 --- a/tfportd/src/tfport.rs +++ b/tfportd/src/tfport.rs @@ -7,22 +7,22 @@ use std::collections::BTreeMap; use std::net::Ipv6Addr; -use anyhow::anyhow; -use anyhow::bail; use anyhow::Context; use anyhow::Result; +use anyhow::anyhow; +use anyhow::bail; use slog::debug; use slog::error; use slog::info; use slog::warn; +use crate::Global; use crate::linklocal; use crate::netsupport; use crate::oxstats::link; use crate::packet_queue; use crate::ports; use crate::vlans; -use crate::Global; use common::illumos; use common::network::MacAddr; @@ -152,10 +152,9 @@ pub async fn tfport_delete(g: &Global, link: &str) -> anyhow::Result<()> { if let Err(e) = vlans::vlans_cleanup(g, link) .await .context("failed to clean up vlans on {link}") + && err.is_none() { - if err.is_none() { - err = Some(e); - } + err = Some(e); } if let Some(asic_id) = g.tfport_to_asic.lock().unwrap().get(link) { @@ -179,10 +178,9 @@ pub async fn tfport_delete(g: &Global, link: &str) -> anyhow::Result<()> { if let Err(e) = illumos::tfport_delete(link) .await .context("failed to delete tport {link}") + && err.is_none() { - if err.is_none() { - err = Some(e); - } + err = Some(e); } match err { Some(e) => Err(e), @@ -220,10 +218,10 @@ pub async fn tfport_ensure( } // If the tfport is the vlan link, ensure that the vlans are created. - if let Some(vlan_link) = &g.vlan_link { - if tfport == vlan_link { - vlans::ensure_vlans(g, tfport).await?; - } + if let Some(vlan_link) = &g.vlan_link + && tfport == vlan_link + { + vlans::ensure_vlans(g, tfport).await?; } packet_queue::ensure_queue_exists(g, tfport, link.asic_id); @@ -313,7 +311,9 @@ fn test_parse_tfport() -> Result<()> { assert!(parse_tfport_line(r"tfport0:ba\:70\:57\:bf\:a1\:38").is_err()); // Too many fields - assert!(parse_tfport_line(r"tfport0:10:10:ba\:70\:57\:bf\:a1\:38").is_err()); + assert!( + parse_tfport_line(r"tfport0:10:10:ba\:70\:57\:bf\:a1\:38").is_err() + ); // Invalid mac addresses assert!( parse_tfport_line(r"tfport0:10:ba\:70\:57\:bf\:a1\:38\:44").is_err() diff --git a/tfportd/src/vlans.rs b/tfportd/src/vlans.rs index a0f4ca1..4038e10 100644 --- a/tfportd/src/vlans.rs +++ b/tfportd/src/vlans.rs @@ -8,16 +8,16 @@ use std::collections::BTreeMap; use std::collections::BTreeSet; use std::net::Ipv6Addr; +use anyhow::Context; use anyhow::anyhow; use anyhow::bail; -use anyhow::Context; use serde::Deserialize; use slog::error; use slog::info; +use crate::Global; use crate::linklocal; use crate::oxstats::link; -use crate::Global; use common::illumos; #[derive(Debug, Deserialize)] @@ -127,12 +127,12 @@ pub async fn ensure_vlans(g: &Global, link: &str) -> anyhow::Result<()> { let mut to_delete = existing_vlans.keys().cloned().collect::>(); for expected_vlan in &g.vlans { - if let Some(current_vlan) = existing_vlans.get(&expected_vlan.name) { - if current_vlan.vid == expected_vlan.vid { - // This vlan has the right name and ID, so we leave it alone - let _ = to_delete.remove(&expected_vlan.name); - continue; - } + if let Some(current_vlan) = existing_vlans.get(&expected_vlan.name) + && current_vlan.vid == expected_vlan.vid + { + // This vlan has the right name and ID, so we leave it alone + let _ = to_delete.remove(&expected_vlan.name); + continue; } to_create.insert(expected_vlan.name.to_string(), expected_vlan.vid); } diff --git a/uplinkd/Cargo.toml b/uplinkd/Cargo.toml index 286299c..b0714d0 100644 --- a/uplinkd/Cargo.toml +++ b/uplinkd/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "uplinkd" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -15,5 +15,5 @@ oxnet.workspace = true signal-hook.workspace = true slog.workspace = true smf.workspace = true -structopt.workspace = true +clap.workspace = true tokio.workspace = true diff --git a/uplinkd/src/main.rs b/uplinkd/src/main.rs index 2169dde..ef918f0 100644 --- a/uplinkd/src/main.rs +++ b/uplinkd/src/main.rs @@ -27,17 +27,18 @@ // // TODO: get repeated log messages under control. -use std::collections::btree_map::Entry; use std::collections::BTreeMap; use std::collections::BTreeSet; +use std::collections::btree_map::Entry; use std::net::Ipv4Addr; use std::net::Ipv6Addr; use std::sync::mpsc; use std::time::Duration; -use anyhow::anyhow; use anyhow::Context; use anyhow::Result; +use anyhow::anyhow; +use clap::Parser; use libc::c_int; use oxnet::IpNet; use oxnet::Ipv4Net; @@ -49,7 +50,6 @@ use signal_hook::iterator::Signals; use slog::debug; use slog::error; use slog::info; -use structopt::StructOpt; use common::illumos; @@ -63,22 +63,22 @@ struct Global { current: BTreeMap>, } -#[derive(Debug, StructOpt)] -#[structopt(name = "uplinkd", about = "uplink address management daemon")] +/// uplink address management daemon +#[derive(Debug, Parser)] +#[clap(name = "uplinkd")] struct Opt { - #[structopt(long, short, about = "use ipadm to establish PtP links")] + /// use ipadm to establish PtP links + #[clap(long, short)] ipadm: bool, - #[structopt(long, about = "log file")] + /// log file + #[clap(long)] log_file: Option, - #[structopt( - long, - short = "l", - default_value = "human", - about = "log format", - help = "format logs for 'human' or 'json' consumption" - )] + /// log format + /// + /// format logs for 'human' or 'json' consumption + #[clap(long, short = 'l', default_value = "human")] log_format: common::logging::LogFormat, } @@ -97,10 +97,10 @@ fn interface_vlan_id(iface: &str) -> (String, Option) { let fields: Vec<&str> = iface.split('.').collect(); let mut rval = None; - if fields.len() == 2 { - if let Ok(Some(vlan_id)) = parse_vlan_id(fields[1]) { - rval = Some(vlan_id); - } + if fields.len() == 2 + && let Ok(Some(vlan_id)) = parse_vlan_id(fields[1]) + { + rval = Some(vlan_id); } (fields[0].to_string(), rval) } @@ -187,9 +187,10 @@ fn refresh_smf_config(g: &mut Global) -> Result<()> { let (addr, vlan_id) = match parse_uplink_property(&s) { Ok(a) => a, Err(e) => { - error!(g.log, + error!( + g.log, "failed to parse {s} as an uplink address for {link}: {e:?}" - ); + ); continue; } }; @@ -464,23 +465,21 @@ async fn reconcile_interfaces(g: &mut Global) { // listed in SMF. We create any missing vlan links. let desired_ifaces: Vec = g.desired.keys().cloned().collect(); for iface in &desired_ifaces { - if let Entry::Vacant(e) = g.current.entry(iface.to_string()) { - if let (link, Some(vlan_id)) = interface_vlan_id(iface) { - info!(g.log, "creating vlan link {iface}"); - if let Err(e) = - illumos::vlan_create(&link, vlan_id, iface).await - { - error!(g.log, "failed to create vlan link {iface}: {e:?}"); - } - - // Even if the vlan link creation failed, we will still attempt - // to create the desired addresses. In the best case, the - // creation failed because it already exists, so we definitely - // want to set up the addresses. In the worst case, the link - // doesn't exist, and the subsequent address creation will also - // fail. - e.insert(BTreeMap::new()); + if let Entry::Vacant(e) = g.current.entry(iface.to_string()) + && let (link, Some(vlan_id)) = interface_vlan_id(iface) + { + info!(g.log, "creating vlan link {iface}"); + if let Err(e) = illumos::vlan_create(&link, vlan_id, iface).await { + error!(g.log, "failed to create vlan link {iface}: {e:?}"); } + + // Even if the vlan link creation failed, we will still attempt + // to create the desired addresses. In the best case, the + // creation failed because it already exists, so we definitely + // want to set up the addresses. In the worst case, the link + // doesn't exist, and the subsequent address creation will also + // fail. + e.insert(BTreeMap::new()); } } } @@ -502,12 +501,11 @@ async fn reconcile(g: &mut Global) { let mut max_uplink = 0; let uplink_prefix = format!("{iface}/uplink"); for addrobj in current_addrs.keys() { - if let Some(idx) = addrobj.strip_prefix(&uplink_prefix) { - if let Ok(idx) = idx.parse::() { - if idx > max_uplink { - max_uplink = idx; - } - } + if let Some(idx) = addrobj.strip_prefix(&uplink_prefix) + && let Ok(idx) = idx.parse::() + && idx > max_uplink + { + max_uplink = idx; } } @@ -569,7 +567,7 @@ fn main() -> anyhow::Result<()> { } async fn main_impl() -> anyhow::Result<()> { - let opts = Opt::from_args(); + let opts = Opt::parse(); let mut global = Global { log: common::logging::init("uplinkd", &opts.log_file, opts.log_format)?, diff --git a/uplinkd/src/sys.rs b/uplinkd/src/sys.rs index 0c154d4..33633e7 100644 --- a/uplinkd/src/sys.rs +++ b/uplinkd/src/sys.rs @@ -25,7 +25,6 @@ use signal_hook::iterator::Signals; use slog::debug; use slog::error; use slog::info; -use structopt::StructOpt; use common::network::Cidr; use common::network::Ipv4Cidr; diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index 2018a06..533a69c 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -1,14 +1,14 @@ [package] name = "xtask" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] search_path = "0.1.4" camino.workspace = true chrono.workspace = true -structopt.workspace = true +clap.workspace = true anyhow.workspace = true curl.workspace = true omicron-zone-package.workspace = true diff --git a/xtask/src/codegen.rs b/xtask/src/codegen.rs index ca02e37..3416b6e 100644 --- a/xtask/src/codegen.rs +++ b/xtask/src/codegen.rs @@ -8,7 +8,7 @@ use std::fs; use std::path::Path; use std::process::Command; -use anyhow::{anyhow, Context, Result}; +use anyhow::{Context, Result, anyhow}; use serde::Serialize; /// Describes the ASIC the p4 program was built for @@ -132,8 +132,8 @@ pub fn build( ) -> Result<()> { let root = super::project_root()?; let src_dir = match app_name.as_str() { - "sidecar" => format!("{}/dpd/p4", root), - name => format!("{}/{}/p4", root, name), + "sidecar" => format!("{root}/dpd/p4"), + name => format!("{root}/{name}/p4"), }; let app_path = format!("{src_dir}/{app_name}.p4"); @@ -199,7 +199,7 @@ pub fn build( // already been done for us. let fw_dir = match sde_location.starts_with("/opt") { true => sde_location.clone(), - false => format!("{}/install", sde_location), + false => format!("{sde_location}/install"), }; // Copy the serdes firmware blobs diff --git a/xtask/src/illumos.rs b/xtask/src/illumos.rs index e7d4f0a..3164578 100644 --- a/xtask/src/illumos.rs +++ b/xtask/src/illumos.rs @@ -10,10 +10,10 @@ use std::io::BufRead; use std::io::Write; use std::process::Command; -use anyhow::anyhow; -use anyhow::bail; use anyhow::Context; use anyhow::Result; +use anyhow::anyhow; +use anyhow::bail; use camino::Utf8Path; use omicron_zone_package::config::PackageName; @@ -184,7 +184,7 @@ fn generate_manifest(features: &str) -> Result { "tofino_asic" => "omicron-asic-manifest.toml", "tofino_stub" => "omicron-stub-manifest.toml", "softnpu" => "omicron-softnpu-manifest.toml", - x => bail!("{} is not a recognized asic type", x), + x => bail!("{x} is not a recognized asic type"), }; let manifest_path = format!("{}/tools/{}", project_root()?, manifest_file); diff --git a/xtask/src/main.rs b/xtask/src/main.rs index f1a4ef5..529581f 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -11,8 +11,8 @@ use std::io::Read; use std::path::Path; use std::str::FromStr; -use anyhow::{anyhow, Context, Result}; -use structopt::*; +use anyhow::{Context, Result, anyhow}; +use clap::{Parser, Subcommand, ValueEnum}; mod codegen; @@ -28,7 +28,7 @@ use linux as plat; // Possible formats for a bundled dendrite distro. Currently the two "zone" // package formats are helios-only. -#[derive(PartialEq, Debug)] +#[derive(PartialEq, Debug, ValueEnum, Copy, Clone)] pub enum DistFormat { Native, // .deb or .p5p, depending on the platform Omicron, // package to be included in an omicron zone @@ -53,49 +53,46 @@ impl FromStr for DistFormat { } } -#[derive(Debug, StructOpt)] -#[structopt(name = "xtask", about = "dendrite xtask support")] -enum Xtasks { - #[structopt(about = "compile a p4 program")] +#[derive(Debug, Parser)] +struct Xtasks { + #[command(subcommand)] + subcommand: XtaskCommands, +} + +/// dendrite xtask support +#[derive(Debug, Subcommand)] +#[clap(name = "xtask")] +enum XtaskCommands { + /// compile a p4 program Codegen { - #[structopt( - short, - help = "name of p4 program to build", - default_value = "sidecar" - )] + /// name of p4 program to build + #[clap(short, default_value = "sidecar")] name: String, - #[structopt( - long, - help = "location of the tofino SDE", - default_value = "/opt/oxide/tofino_sde" - )] + /// location of the tofino SDE + #[clap(long, default_value = "/opt/oxide/tofino_sde")] sde: String, - #[structopt(long, help = "pipeline stages to build for")] + /// pipeline stages to build for + #[clap(long)] stages: Option, }, - #[structopt(about = "build an installable dataplane controller package")] + /// build an installable dataplane controller package Dist { - #[structopt(long, help = "tofino_asic, tofino_stub, or softnpu")] + /// tofino_asic, tofino_stub, or softnpu + #[clap(long)] features: Option, - #[structopt( - short, - help = "list of p4 programs to include", - default_value = "sidecar" - )] + /// list of p4 programs to include + #[clap(short, default_value = "sidecar")] names: Vec, - #[structopt(short, long, help = "package release bits ")] + /// package release bits + #[clap(short, long)] release: bool, - #[structopt( - short, - long, - help = "package format: omicron, global, native", - default_value = "native" - )] + /// package format: omicron, global, native + #[clap(short, long, default_value = "native")] format: DistFormat, }, } @@ -147,11 +144,10 @@ fn copylinks(dst: &str, links: HashMap) -> Result<()> { } for (tgt, orig) in links { - println!("-- Linking: {} to {}", tgt, orig); + println!("-- Linking: {tgt} to {orig}"); let link_file = dst_dir.join(&tgt); - std::os::unix::fs::symlink(&orig, &link_file).with_context(|| { - format!("linking {:?} to {:?}", link_file, orig) - })?; + std::os::unix::fs::symlink(&orig, &link_file) + .with_context(|| format!("linking {link_file:?} to {orig:?}"))?; } Ok(()) } @@ -163,7 +159,7 @@ fn copyfiles(src: &str, dst: &str, file: &[T]) -> Result<()> { let dst_dir = Path::new(dst); if !src_dir.is_dir() { - return Err(anyhow!("source '{}' isn't a directory", src)); + return Err(anyhow!("source '{src}' isn't a directory")); } if !dst_dir.is_dir() { @@ -174,10 +170,9 @@ fn copyfiles(src: &str, dst: &str, file: &[T]) -> Result<()> { let f = f.to_string(); let src_file = src_dir.join(&f); let dst_file = dst_dir.join(&f); - println!("-- Installing: {:?}", dst_file); - fs::copy(src_file, dst_file).with_context(|| { - format!("copying {:?} from {} to {}", f, src, dst) - })?; + println!("-- Installing: {dst_file:?}"); + fs::copy(src_file, dst_file) + .with_context(|| format!("copying {f:?} from {src} to {dst}"))?; } Ok(()) @@ -188,7 +183,7 @@ pub fn copydir(src: &str, dst: &str) -> Result<()> { let src_dir = Path::new(src); if !src_dir.is_dir() { - return Err(anyhow!("source '{}' isn't a directory", src)); + return Err(anyhow!("source '{src}' isn't a directory")); } let mut files = Vec::new(); @@ -248,12 +243,12 @@ fn collect_binaries( )] #[tokio::main] async fn main() { - let task = Xtasks::from_args(); - if let Err(e) = match task { - Xtasks::Codegen { name, sde, stages } => { + let task = Xtasks::parse(); + if let Err(e) = match task.subcommand { + XtaskCommands::Codegen { name, sde, stages } => { codegen::build(name, sde, stages) } - Xtasks::Dist { + XtaskCommands::Dist { features, names, release,