diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8072381d..ec646d8d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -119,9 +119,9 @@ jobs: - name: Create the FFI modules dir run: mkdir ffi-modules\${{ matrix.target }} - name: Build FFI - run: cargo build -p rodbus-ffi --release --target ${{ matrix.target }} --message-format json | Out-File -encoding "UTF8" .\ffi-modules\${{ matrix.target }}\build.ffi.log + run: cargo build -p rodbus-ffi --release --target ${{ matrix.target }} - name: Build JNI - run: cargo build -p rodbus-ffi-java --release --target ${{ matrix.target }} --message-format json | Out-File -encoding "UTF8" .\ffi-modules\${{ matrix.target }}\build.jni.log + run: cargo build -p rodbus-ffi-java --release --target ${{ matrix.target }} - name: Copy the FFI and JNI libs shell: pwsh run: | @@ -144,12 +144,15 @@ jobs: run: cargo run --bin rodbus-bindings -- --java -r ${{ matrix.target }} -a ./target/${{ matrix.target }}/release # Build bindings on MacOS [64-bit macOS (10.7+, Lion+) (x86_64-apple-darwin)] bindings-macos: - runs-on: macos-latest strategy: fail-fast: false matrix: - target: - - x86_64-apple-darwin # 64-bit macOS (10.7+, Lion+) + include: + - runner: macos-14 + target: aarch64-apple-darwin + - runner: macos-13 + target: x86_64-apple-darwin + runs-on: ${{ matrix.runner }} steps: - name: Checkout uses: actions/checkout@v3 @@ -158,9 +161,9 @@ jobs: - name: Create FFI modules dir run: mkdir -p ffi-modules/${{ matrix.target }} - name: Build FFI - run: cargo build -p rodbus-ffi --release --message-format json > ffi-modules/${{ matrix.target }}/build.ffi.log + run: cargo build -p rodbus-ffi --release - name: Build JNI - run: cargo build -p rodbus-ffi-java --release --message-format json > ffi-modules/${{ matrix.target }}/build.jni.log + run: cargo build -p rodbus-ffi-java --release - name: Copy the FFI and JNI libs run: | cp ./target/release/librodbus_ffi.dylib ./ffi-modules/${{ matrix.target }} @@ -204,9 +207,9 @@ jobs: - name: Create ffi-modules dir run: mkdir -p ffi-modules/${{ matrix.target }} - name: Build FFI - run: cross build -p rodbus-ffi --release --target ${{ matrix.target }} --message-format json > ffi-modules/${{ matrix.target }}/build.ffi.log + run: cross build -p rodbus-ffi --release --target ${{ matrix.target }} - name: Build JNI - run: cross build -p rodbus-ffi-java --release --target ${{ matrix.target }} --message-format json > ffi-modules/${{ matrix.target }}/build.jni.log + run: cross build -p rodbus-ffi-java --release --target ${{ matrix.target }} - name: Copy the FFI and JNI libs run: | cp ./target/${{ matrix.target }}/release/librodbus_ffi.so ./ffi-modules/${{ matrix.target }} @@ -242,26 +245,36 @@ jobs: steps: - name: Install Rust uses: dtolnay/rust-toolchain@stable - - name: Checkout BOM tools repo - uses: actions/checkout@v3 - with: - repository: stepfunc/bom-tools - ref: 0.1.0 - path: bom-tools - - name: Install BOM tools - working-directory: bom-tools - run: cargo install --path bom-tools + - name: Install Cargo CycloneDx + run: cargo install cargo-cyclonedx + - name: Install custom allow-list tool + run: cargo install --git https://github.com/stepfunc/bom-tools.git - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Download compiled FFI uses: actions/download-artifact@v3 with: name: ffi-modules path: ffi-modules + - name: Create SBOMs + run: | + for dir in ffi-modules/*; do + echo "processing path: $dir" + target=`basename "${dir}"` + cargo cyclonedx -f json --target $target + mv ./ffi/rodbus-ffi/rodbus-ffi.cdx.json ffi-modules/$target + mv ./ffi/rodbus-ffi-java/rodbus-ffi-java.cdx.json ffi-modules/$target + done - name: Create FFI third-party-licenses.txt - run: bom-tools gen-licenses-dir ./ffi-modules build.ffi.log ./dep_config.json > third-party-licenses.txt - - name: Package all bindings - run: cargo run --bin rodbus-bindings -- --package ./ffi-modules --options ./packaging.json -f third-party-licenses.txt + run: allow-list gen-licenses-dir -l ffi-modules -b rodbus-ffi.cdx.json -c allowed.json > third-party-licenses.txt + - name: Create FFI third-party-licenses-java.txt + run: allow-list gen-licenses-dir -l ffi-modules -b rodbus-ffi-java.cdx.json -c allowed.json > third-party-licenses-java.txt + - name: Package C/C++ bindings + run: cargo run --bin rodbus-bindings -- --c --package ./ffi-modules --options ./packaging.json -f third-party-licenses.txt + - name: Package .NET bindings + run: cargo run --bin rodbus-bindings -- --dotnet --package ./ffi-modules --options ./packaging.json -f third-party-licenses.txt + - name: Package Java bindings + run: cargo run --bin rodbus-bindings -- --java --package ./ffi-modules --options ./packaging.json -f third-party-licenses-java.txt - name: Upload C/C++ bindings uses: actions/upload-artifact@v3 with: diff --git a/Cargo.lock b/Cargo.lock index 3ad982ac..3b5ff564 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,32 +2,11 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "CoreFoundation-sys" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0e9889e6db118d49d88d84728d0e964d973a5680befb5f85f55141beea5c20b" -dependencies = [ - "libc", - "mach", -] - -[[package]] -name = "IOKit-sys" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99696c398cbaf669d2368076bdb3d627fb0ce51a26899d7c61228c5c0af3bf4a" -dependencies = [ - "CoreFoundation-sys", - "libc", - "mach", -] - [[package]] name = "addr2line" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ "gimli", ] @@ -40,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aes" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" dependencies = [ "cfg-if", "cipher", @@ -51,9 +30,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -84,51 +63,51 @@ dependencies = [ [[package]] name = "anstream" -version = "0.3.2" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", - "is-terminal", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.1" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" [[package]] name = "anstyle-parse" -version = "0.2.1" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" dependencies = [ - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "1.0.1" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" dependencies = [ "anstyle", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -166,15 +145,15 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.68" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" dependencies = [ "addr2line", "cc", @@ -187,9 +166,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.21.2" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" @@ -205,9 +184,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.0.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "487f1e0fcbe47deb8b0574e646def1c903389d95241dd1bbcc6ce4a715dfc0c1" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "block-buffer" @@ -229,15 +208,15 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytes" -version = "1.4.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "cbc" @@ -250,9 +229,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.79" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "099a5357d84c4c61eb35fc8eafa9a79a902c2f76911e5747ced4e032edd8d9b4" [[package]] name = "cesu8" @@ -268,14 +247,14 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.26" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", - "winapi", + "windows-targets 0.52.5", ] [[package]] @@ -305,34 +284,33 @@ dependencies = [ [[package]] name = "clap" -version = "4.3.19" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd304a20bff958a57f04c4e96a2e7594cc4490a0e809cbd48bb6437edaa452d" +checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" dependencies = [ "clap_builder", "clap_derive", - "once_cell", ] [[package]] name = "clap_builder" -version = "4.3.19" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01c6a3f08f1fe5662a35cfe393aec09c4df95f60ee93b7556505260f75eee9e1" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.10.0", + "strsim 0.11.1", ] [[package]] name = "clap_derive" -version = "4.3.12" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54a9bb5758fc5dfe728d1019941681eccaf0cf8a4189b692a0ee2f2ecf90a050" +checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" dependencies = [ - "heck", + "heck 0.5.0", "proc-macro2", "quote", "syn", @@ -340,21 +318,21 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.5.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" [[package]] name = "combine" -version = "4.6.6" +version = "4.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" dependencies = [ "bytes", "memchr", @@ -362,39 +340,39 @@ dependencies = [ [[package]] name = "const-oid" -version = "0.9.4" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "795bc6e66a8e340f075fcf6227e417a2dc976b92b91f3cdc778bb858778b6747" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpufeatures" -version = "0.2.9" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] [[package]] name = "crc" -version = "3.0.1" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" +checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" dependencies = [ "crc-catalog", ] [[package]] name = "crc-catalog" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cace84e55f07e7301bae1c519df89cdad8cc3cd868413d3fdbdeca9ff3db484" +checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" [[package]] name = "crypto-common" @@ -408,9 +386,9 @@ dependencies = [ [[package]] name = "der" -version = "0.7.7" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7ed52955ce76b1554f509074bb357d3fb8ac9b51288a65a3fd480d1dfba946" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", "pem-rfc7468", @@ -434,32 +412,11 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" -[[package]] -name = "errno" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" -dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys", -] - -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "libc", -] - [[package]] name = "futures" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -472,9 +429,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -482,15 +439,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -499,15 +456,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", @@ -516,21 +473,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -554,11 +511,22 @@ dependencies = [ "version_check", ] +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + [[package]] name = "gimli" -version = "0.27.3" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "heck" @@ -566,6 +534,12 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hermit-abi" version = "0.1.19" @@ -577,9 +551,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hmac" @@ -592,16 +566,16 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.57" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows", + "windows-core", ] [[package]] @@ -624,33 +598,26 @@ dependencies = [ ] [[package]] -name = "io-lifetimes" -version = "1.0.11" +name = "io-kit-sys" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +checksum = "617ee6cf8e3f66f3b4ea67a4058564628cde41901316e19f559e14c7c72c5e7b" dependencies = [ - "hermit-abi 0.3.2", - "libc", - "windows-sys", + "core-foundation-sys", + "mach2", ] [[package]] -name = "is-terminal" -version = "0.4.7" +name = "is_terminal_polyfill" +version = "1.70.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" -dependencies = [ - "hermit-abi 0.3.2", - "io-lifetimes", - "rustix", - "windows-sys", -] +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jni" @@ -674,9 +641,9 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -689,54 +656,30 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.147" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" - -[[package]] -name = "linux-raw-sys" -version = "0.3.8" +version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" +checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" [[package]] name = "log" -version = "0.4.19" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" - -[[package]] -name = "mach" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd13ee2dd61cc82833ba05ade5a30bb3d63f7ced605ef827063c63078302de9" -dependencies = [ - "libc", -] +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "mach2" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d0d1830bcd151a6fc4aea1369af235b36c1528fe976b8ff678683c9995eade8" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" dependencies = [ "libc", ] -[[package]] -name = "matchers" -version = "0.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" -dependencies = [ - "regex-automata 0.1.10", -] - [[package]] name = "memchr" -version = "2.5.0" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "memoffset" @@ -749,23 +692,23 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.8" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "log", "wasi", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -783,16 +726,15 @@ dependencies = [ [[package]] name = "nix" -version = "0.26.2" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" +checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" dependencies = [ "bitflags 1.3.2", "cfg-if", "libc", "memoffset", "pin-utils", - "static_assertions", ] [[package]] @@ -807,9 +749,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.16" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] @@ -820,35 +762,35 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.2", + "hermit-abi 0.3.9", "libc", ] [[package]] name = "object" -version = "0.31.1" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "oo-bindgen" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f851acb1e31bb0638f21e44f989f116b80859bfd9a4eccc18fd9def44ddf492a" +checksum = "08bdc3553c414516c4e287168049b1f97a89be4d80721bd480e206d97191e024" dependencies = [ "backtrace", - "clap 4.3.19", + "clap 4.5.4", "dunce", - "heck", + "heck 0.4.1", "lazy_static", "platforms", "regex", @@ -877,9 +819,9 @@ dependencies = [ [[package]] name = "pem" -version = "2.0.1" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b13fe415cdf3c8e44518e18a7c95a13431d9bdf6d15367d82b23c377fdd441a" +checksum = "8e459365e590736a54c3fa561947c84837534b8e9af6fc5bf781307e82658fae" dependencies = [ "base64", "serde", @@ -896,9 +838,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.10" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -941,18 +883,18 @@ checksum = "e8d0eef3571242013a0d5dc84861c3ae4a652e56e12adf8bdc26ff5f8cb34c94" [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.32" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -965,68 +907,53 @@ checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" [[package]] name = "regex" -version = "1.9.1" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.3", - "regex-syntax 0.7.4", -] - -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" -dependencies = [ - "regex-syntax 0.6.29", + "regex-automata", + "regex-syntax", ] [[package]] name = "regex-automata" -version = "0.3.3" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.4", + "regex-syntax", ] [[package]] name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - -[[package]] -name = "regex-syntax" -version = "0.7.4" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "ring" -version = "0.16.20" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", + "cfg-if", + "getrandom", "libc", - "once_cell", "spin", "untrusted", - "web-sys", - "winapi", + "windows-sys 0.52.0", ] [[package]] name = "rodbus" version = "1.3.1" dependencies = [ - "clap 4.3.19", + "clap 4.5.4", "crc", "rx509", "scursor", @@ -1039,7 +966,7 @@ dependencies = [ "tokio-test", "tokio-util", "tracing", - "tracing-subscriber 0.3.17", + "tracing-subscriber", ] [[package]] @@ -1049,7 +976,7 @@ dependencies = [ "oo-bindgen", "rodbus-schema", "tracing", - "tracing-subscriber 0.3.17", + "tracing-subscriber", ] [[package]] @@ -1060,7 +987,7 @@ dependencies = [ "rodbus", "tokio", "tracing", - "tracing-subscriber 0.2.25", + "tracing-subscriber", ] [[package]] @@ -1078,7 +1005,7 @@ dependencies = [ "tokio", "tracing", "tracing-core", - "tracing-subscriber 0.2.25", + "tracing-subscriber", ] [[package]] @@ -1102,67 +1029,53 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" - -[[package]] -name = "rustix" -version = "0.37.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys", - "windows-sys", -] +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustls" -version = "0.21.5" +version = "0.23.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79ea77c539259495ce8ca47f53e66ae0330a8819f67e23ac96ca02f50e7b7d36" +checksum = "afabcee0551bd1aa3e18e5adbf2c0544722014b899adb31bd186ec638d3da97e" dependencies = [ "log", + "once_cell", "ring", - "rustls-webpki 0.101.1", - "sct", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", ] [[package]] -name = "rustls-webpki" -version = "0.100.1" +name = "rustls-pki-types" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6207cd5ed3d8dca7816f8f3725513a34609c0c765bf652b8c3cb4cfd87db46b" -dependencies = [ - "ring", - "untrusted", -] +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" [[package]] name = "rustls-webpki" -version = "0.101.1" +version = "0.102.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15f36a6828982f422756984e47912a7a51dcbc2a197aa791158f8ca61cd8204e" +checksum = "f3bce581c0dd41bce533ce695a1437fa16a7ab5ac3ccfa99fe1a620a7885eabf" dependencies = [ "ring", + "rustls-pki-types", "untrusted", ] [[package]] name = "rx509" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c177a3ff729f263173df3a7a58442fde7c0eb93d79ee8aaa66e67503c5c42fb" +checksum = "d3b4a7d26e4a603b3cedff6a968d356e445c10dbc3e4cf6bd414fd5428437e73" [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "salsa20" @@ -1199,42 +1112,32 @@ dependencies = [ "sha2", ] -[[package]] -name = "sct" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "scursor" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d22f5a1672640fcdfc63720cdda822d784d62d89070e8d05b39a5319006f7f7" +checksum = "49e9e097d5ccc66dd9a88d94c7ddad0833b13a35ed8f30d6ea28a8d5269cbd58" [[package]] name = "semver" -version = "1.0.18" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.175" +version = "1.0.201" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d25439cd7397d044e2748a6fe2432b5e85db703d6d097bd014b3c0ad1ebff0b" +checksum = "780f1cebed1629e4753a1a38a3c72d30b97ec044f0aef68cb26650a3c5cf363c" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.175" +version = "1.0.201" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b23f7ade6f110613c0d63858ddb8b94c1041f550eab58a16b371bdf2c9c80ab4" +checksum = "c5e405930b9796f1c00bee880d03fc7e0bb4b9a11afc776885ffe84320da2865" dependencies = [ "proc-macro2", "quote", @@ -1243,9 +1146,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.103" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d03b412469450d4404fe8499a268edd7f8b79fecb074b0d812ad64ca21f4031b" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ "itoa", "ryu", @@ -1254,18 +1157,19 @@ dependencies = [ [[package]] name = "serialport" -version = "4.2.1" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "353dc2cbfc67c9a14a89a1292a9d8e819bd51066b083e08c1974ba08e3f48c62" +checksum = "8f5a15d0be940df84846264b09b51b10b931fb2f275becb80934e3568a016828" dependencies = [ - "CoreFoundation-sys", - "IOKit-sys", - "bitflags 2.0.2", + "bitflags 2.5.0", "cfg-if", + "core-foundation-sys", + "io-kit-sys", "mach2", "nix", "regex", "scopeguard", + "unescaper", "winapi", ] @@ -1277,22 +1181,22 @@ checksum = "91547be5cac1551a6401a7cfa571524bbcb4d9d818b2756cbe3012b48cc79aaf" [[package]] name = "sfio-rustls-config" -version = "0.1.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8781e206d0f231ad07f17b66a5eca34b993a741882e505c5d44d903cec77def8" +checksum = "e75dd8a8718cf231b832016c9535e05cfe33f09440fd1a5611257b9688844780" dependencies = [ "pem", "pkcs8", "rustls", - "rustls-webpki 0.100.1", + "rustls-webpki", "rx509", ] [[package]] name = "sfio-tokio-ffi" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7264a1340f2fa1d79e749b85c1f9965dedbd811d1dfb32a6b354e8253cad2286" +checksum = "f18d418ee525a2027c0b3e1ab34dc050e1f676834b93389829d40aed2bfefecb" dependencies = [ "oo-bindgen", ] @@ -1308,18 +1212,18 @@ dependencies = [ [[package]] name = "sfio-tracing-ffi" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94955ac2db413b6f32297e862581db2c05f6312881939393f4b68f173a8be8b4" +checksum = "8ad957e7cc9c0efe86f4a395c0fd063fbb3460bd83fade7bff80188c8eadef35" dependencies = [ "oo-bindgen", ] [[package]] name = "sha2" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", @@ -1328,60 +1232,54 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ "lazy_static", ] [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] [[package]] name = "smallvec" -version = "1.11.0" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.4.9" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "winapi", + "windows-sys 0.52.0", ] [[package]] name = "spin" -version = "0.5.2" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] name = "spki" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", "der", ] -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - [[package]] name = "strsim" version = "0.8.0" @@ -1390,9 +1288,9 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "subtle" @@ -1402,9 +1300,9 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" -version = "2.0.27" +version = "2.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b60f673f44a8255b9c8c657daf66a596d435f2da81a555b06dc644d080ba45e0" +checksum = "bf5be731623ca1a1fb7d8be6f261a3be6d3e2337b8a1f97be944d020c8fcb704" dependencies = [ "proc-macro2", "quote", @@ -1422,18 +1320,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.44" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" +checksum = "579e9083ca58dd9dcf91a9923bb9054071b9ebbd800b342194c9feb0ee89fc18" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.44" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" +checksum = "e2470041c06ec3ac1ab38d0356a6119054dedaea53e12fbefc0de730a1c08524" dependencies = [ "proc-macro2", "quote", @@ -1442,9 +1340,9 @@ dependencies = [ [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ "cfg-if", "once_cell", @@ -1452,11 +1350,10 @@ dependencies = [ [[package]] name = "tokio" -version = "1.29.1" +version = "1.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" dependencies = [ - "autocfg", "backtrace", "bytes", "libc", @@ -1465,14 +1362,14 @@ dependencies = [ "pin-project-lite", "socket2", "tokio-macros", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] name = "tokio-macros" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", @@ -1481,11 +1378,12 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.24.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ "rustls", + "rustls-pki-types", "tokio", ] @@ -1504,9 +1402,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" dependencies = [ "futures-core", "pin-project-lite", @@ -1515,9 +1413,9 @@ dependencies = [ [[package]] name = "tokio-test" -version = "0.4.2" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53474327ae5e166530d17f2d956afcb4f8a004de581b3cae10f12006bc8163e3" +checksum = "2468baabc3311435b55dd935f702f42cd1b8abb7e754fb7dfb16bd36aa88f9f7" dependencies = [ "async-stream", "bytes", @@ -1528,25 +1426,23 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -1554,9 +1450,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", @@ -1565,9 +1461,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", "valuable", @@ -1575,12 +1471,12 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" dependencies = [ - "lazy_static", "log", + "once_cell", "tracing-core", ] @@ -1596,63 +1492,54 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.2.25" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ - "ansi_term", "chrono", - "lazy_static", - "matchers", - "regex", + "nu-ansi-term", "serde", "serde_json", "sharded-slab", "smallvec", "thread_local", - "tracing", "tracing-core", "tracing-log", "tracing-serde", ] [[package]] -name = "tracing-subscriber" -version = "0.3.17" +name = "typenum" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" -dependencies = [ - "nu-ansi-term", - "sharded-slab", - "smallvec", - "thread_local", - "tracing-core", - "tracing-log", -] +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] -name = "typenum" -version = "1.16.0" +name = "unescaper" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "0adf6ad32eb5b3cadff915f7b770faaac8f7ff0476633aa29eb0d9584d889d34" +dependencies = [ + "thiserror", +] [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" [[package]] name = "untrusted" -version = "0.7.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "utf8parse" @@ -1680,9 +1567,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "walkdir" -version = "2.3.3" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -1696,9 +1583,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1706,9 +1593,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", @@ -1721,9 +1608,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1731,9 +1618,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", @@ -1744,19 +1631,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" - -[[package]] -name = "web-sys" -version = "0.3.64" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" -dependencies = [ - "js-sys", - "wasm-bindgen", -] +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "winapi" @@ -1776,11 +1653,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" dependencies = [ - "winapi", + "windows-sys 0.52.0", ] [[package]] @@ -1790,12 +1667,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] -name = "windows" -version = "0.48.0" +name = "windows-core" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets", + "windows-targets 0.52.5", ] [[package]] @@ -1804,68 +1681,141 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets", + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.5", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "zeroize" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" diff --git a/Cargo.toml b/Cargo.toml index 87c6d557..ebd0d2f2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,4 +1,5 @@ [workspace] +resolver = "2" members = [ "rodbus", @@ -9,5 +10,14 @@ members = [ "ffi/rodbus-schema", ] +[workspace.dependencies] +oo-bindgen = "0.8.6" +sfio-tokio-ffi = "0.9.0" +sfio-tracing-ffi = "0.9.0" +tokio = "1.37.0" +tracing = "0.1.40" +tracing-subscriber = { version = "0.3.18" } + + [profile.release] lto=true diff --git a/dep_config.json b/allowed.json similarity index 94% rename from dep_config.json rename to allowed.json index badbc754..74045fec 100644 --- a/dep_config.json +++ b/allowed.json @@ -22,6 +22,7 @@ "heck", "io-lifetimes", "is-terminal", + "is_terminal_polyfill", "miniz_oxide", "linux-raw-sys", "object", @@ -630,6 +631,23 @@ } ] }, + "getrandom": { + "id": "getrandom", + "source": "crates.io", + "authors": null, + "licenses": [ + { + "MIT": { + "copyright": { + "Lines": [ + "Copyright (c) 2018-2024 The rust-random Project Developers", + "Copyright (c) 2014 The Rust Project Developers" + ] + } + } + } + ] + }, "hmac": { "id": "hmac", "source": "crates.io", @@ -645,6 +663,21 @@ } ] }, + "io-kit-sys": { + "id": "io-kit-sys", + "source": "crates.io", + "licenses": [ + { + "MIT": { + "copyright": { + "Lines": [ + "Copyright (c) 2017-2018 Junji Takakura" + ] + } + } + } + ] + }, "IOKit-sys": { "id": "IOKit-sys", "source": "crates.io", @@ -898,6 +931,22 @@ } ] }, + "nu-ansi-term": { + "id": "nu-ansi-term", + "source": "crates.io", + "licenses": [ + { + "MIT": { + "copyright": { + "Lines": [ + "Copyright (c) 2014 Benjamin Sago", + "Copyright (c) 2021-2022 The Nushell Project Developers" + ] + } + } + } + ] + }, "num-integer": { "id": "num-integer", "source": "crates.io", @@ -969,6 +1018,21 @@ } ] }, + "overload": { + "id": "opaque-debug", + "source": "crates.io", + "licenses": [ + { + "MIT": { + "copyright": { + "Lines": [ + "Copyright (c) 2018-2019 The RustCrypto Project Developers" + ] + } + } + } + ] + }, "pbkdf2": { "id": "pbkdf2", "source": "crates.io", @@ -1202,6 +1266,21 @@ } ] }, + "rustls-pki-types": { + "id": "rustls-pki-types", + "source": "crates.io", + "licenses": [ + { + "MIT": { + "copyright": { + "Lines": [ + "Copyright (c) 2023 Dirkjan Ochtman " + ] + } + } + } + ] + }, "rustls-webpki": { "id": "rustls-webpki", "source": "crates.io", @@ -1663,6 +1742,21 @@ } ] }, + "unescaper": { + "id": "unescaper", + "source": "crates.io", + "licenses": [ + { + "MIT": { + "copyright": { + "Lines": [ + "Copyright (c) 2023 Hack Ink" + ] + } + } + } + ] + }, "unicode-ident": { "id": "unicode-ident", "source": "crates.io", diff --git a/ffi/bindings/c/client_example.cpp b/ffi/bindings/c/client_example.cpp index cb3b3553..77f37407 100644 --- a/ffi/bindings/c/client_example.cpp +++ b/ffi/bindings/c/client_example.cpp @@ -80,15 +80,11 @@ class WriteCallback : public rodbus::WriteCallback }; /// ANCHOR_END: write_callback -int run_channel(rodbus::ClientChannel& channel) +void run_command(rodbus::ClientChannel &channel, const std::string &cmd) { - // ANCHOR: enable_channel - channel.enable(); - // ANCHOR_END: enable_channel - // request param that we will be reusing // ANCHOR: request_param - const auto param = rodbus::RequestParam(1, // Unit ID + const auto param = rodbus::RequestParam(1, // Unit ID std::chrono::seconds(1) // Timeout ); // ANCHOR_END: request_param @@ -100,77 +96,90 @@ int run_channel(rodbus::ClientChannel& channel) ); // ANCHOR_END: address_range - while (true) - { + if (cmd == "ec") { + // enable channel + channel.enable(); + } + else if (cmd == "dc") { + // disable channel + channel.disable(); + } + else if (cmd == "ed") { + // enable decoding + channel.set_decode_level(rodbus::DecodeLevel(rodbus::AppDecodeLevel::data_values, rodbus::FrameDecodeLevel::header, rodbus::PhysDecodeLevel::length)); + } + else if (cmd == "dd") { + // disable decoding + channel.set_decode_level(rodbus::DecodeLevel::nothing()); + } + else if (cmd == "rc") { + /// ANCHOR: read_coils + channel.read_coils(param, range, std::make_unique()); + /// ANCHOR_END: read_coils + } + else if (cmd == "rdi") { + channel.read_discrete_inputs(param, range, std::make_unique()); + } + else if (cmd == "rhr") { + channel.read_holding_registers(param, range, std::make_unique()); + } + else if (cmd == "rir") { + channel.read_input_registers(param, range, std::make_unique()); + } + else if (cmd == "wsc") { + const auto bit_value = rodbus::BitValue(0, true); + channel.write_single_coil(param, bit_value, std::make_unique()); + } + else if (cmd == "wsr") { + /// ANCHOR: write_single_coil + const auto register_value = rodbus::RegisterValue(0, 76); + channel.write_single_register(param, register_value, std::make_unique()); + /// ANCHOR_END: write_single_coil + } + else if (cmd == "wmc") { + // create the bitlist + auto bit_list = std::vector(); + bit_list.emplace_back(true); + bit_list.emplace_back(false); + + // send the request + channel.write_multiple_coils(param, 0, bit_list, std::make_unique()); + } + else if (cmd == "wmr") { + // create the register list + // ANCHOR: write_multiple_registers + auto register_list = std::vector(); + register_list.emplace_back(0xCA); + register_list.emplace_back(0xFE); + + // send the request + channel.write_multiple_registers(param, 0, register_list, std::make_unique()); + // ANCHOR_END: write_multiple_registers + } + else { + std::cout << "unknown command: " << cmd << std::endl; + } +} + +int run_channel(rodbus::ClientChannel& channel) +{ + // ANCHOR: enable_channel + channel.enable(); + // ANCHOR_END: enable_channel + + while (true) { std::string cmd; std::getline(std::cin, cmd); if (cmd == "x") { return 0; } - else if (cmd == "ec") { - // enable channel - channel.enable(); - } - else if (cmd == "dc") { - // disable channel - channel.disable(); - } - else if (cmd == "ed") { - // enable decoding - channel.set_decode_level( - rodbus::DecodeLevel(rodbus::AppDecodeLevel::data_values, rodbus::FrameDecodeLevel::header, rodbus::PhysDecodeLevel::length)); - } - else if (cmd == "dd") { - // disable decoding - channel.set_decode_level(rodbus::DecodeLevel::nothing()); - } - else if (cmd == "rc") { - /// ANCHOR: read_coils - channel.read_coils(param, range, std::make_unique()); - /// ANCHOR_END: read_coils - } - else if (cmd == "rdi") { - channel.read_discrete_inputs(param, range, std::make_unique()); - } - else if (cmd == "rhr") { - channel.read_holding_registers(param, range, std::make_unique()); - } - else if (cmd == "rir") { - channel.read_input_registers(param, range, std::make_unique()); - } - else if (cmd == "wsc") { - const auto bit_value = rodbus::BitValue(0, true); - channel.write_single_coil(param, bit_value, std::make_unique()); - } - else if (cmd == "wsr") { - /// ANCHOR: write_single_coil - const auto register_value = rodbus::RegisterValue(0, 76); - channel.write_single_register(param, register_value, std::make_unique()); - /// ANCHOR_END: write_single_coil - } - else if (cmd == "wmc") { - // create the bitlist - auto bit_list = std::vector(); - bit_list.emplace_back(true); - bit_list.emplace_back(false); - // send the request - channel.write_multiple_coils(param, 0, bit_list, std::make_unique()); + try { + run_command(channel, cmd); } - else if (cmd == "wmr") { - // create the register list - // ANCHOR: write_multiple_registers - auto register_list = std::vector(); - register_list.emplace_back(0xCA); - register_list.emplace_back(0xFE); - - // send the request - channel.write_multiple_registers(param, 0, register_list, std::make_unique()); - // ANCHOR_END: write_multiple_registers - } - else { - std::cout << "unknown command: " << cmd << std::endl; + catch (rodbus::ParamException ex) { + std::cout << ex.what() << std::endl; } } } @@ -182,7 +191,7 @@ int run_tcp_channel(rodbus::Runtime& runtime) runtime, "127.0.0.1", 502, - 100, + 16, rodbus::RetryStrategy(), rodbus::DecodeLevel::nothing(), std::make_unique() diff --git a/ffi/bindings/dotnet/rodbus-tests/IntegrationTest.cs b/ffi/bindings/dotnet/rodbus-tests/IntegrationTest.cs index 836ecd42..66660d84 100644 --- a/ffi/bindings/dotnet/rodbus-tests/IntegrationTest.cs +++ b/ffi/bindings/dotnet/rodbus-tests/IntegrationTest.cs @@ -2,6 +2,7 @@ using rodbus; using System; +using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; @@ -62,9 +63,22 @@ public WriteResult WriteMultipleRegisters(ushort start, ICollection states = new(); + + public void WaitForState(ClientState state) + { + while(true) + { + if(states.Take() == state) + { + return; + } + } + } + public void OnChange(ClientState state) { - + states.Add(state); } } @@ -190,10 +204,12 @@ public void ClientAndServerCommunication() } }); + var listener = new ClientStateListener(); var server = Server.CreateTcp(runtime, ENDPOINT, PORT, AddressFilter.Any(), 100, map, DecodeLevel.Nothing()); - var client = ClientChannel.CreateTcp(runtime, ENDPOINT, PORT, 10, new RetryStrategy(), DecodeLevel.Nothing(), new ClientStateListener()); + var client = ClientChannel.CreateTcp(runtime, ENDPOINT, PORT, 10, new RetryStrategy(), DecodeLevel.Nothing(), listener); client.Enable(); + listener.WaitForState(ClientState.Connected); // set a unique pattern to test reads server.UpdateDatabase(UNIT_ID, db => diff --git a/ffi/bindings/dotnet/rodbus-tests/rodbus-tests.csproj b/ffi/bindings/dotnet/rodbus-tests/rodbus-tests.csproj index f3dff999..07861866 100644 --- a/ffi/bindings/dotnet/rodbus-tests/rodbus-tests.csproj +++ b/ffi/bindings/dotnet/rodbus-tests/rodbus-tests.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 rodbus_tests false @@ -11,7 +11,6 @@ - diff --git a/ffi/bindings/java/examples/pom.xml b/ffi/bindings/java/examples/pom.xml index a067014e..78c7f9a0 100644 --- a/ffi/bindings/java/examples/pom.xml +++ b/ffi/bindings/java/examples/pom.xml @@ -16,7 +16,7 @@ io.stepfunc rodbus - 1.0.0 + 1.3.1 diff --git a/ffi/bindings/java/rodbus-tests/pom.xml b/ffi/bindings/java/rodbus-tests/pom.xml index 2fd06d1f..fd790c25 100644 --- a/ffi/bindings/java/rodbus-tests/pom.xml +++ b/ffi/bindings/java/rodbus-tests/pom.xml @@ -26,7 +26,7 @@ io.stepfunc rodbus - 1.0.0 + 1.3.1 org.junit.jupiter diff --git a/ffi/bindings/java/rodbus-tests/src/test/java/io/stepfunc/rodbus/tests/IntegrationTest.java b/ffi/bindings/java/rodbus-tests/src/test/java/io/stepfunc/rodbus/tests/IntegrationTest.java index a57531d8..5e858bbd 100644 --- a/ffi/bindings/java/rodbus-tests/src/test/java/io/stepfunc/rodbus/tests/IntegrationTest.java +++ b/ffi/bindings/java/rodbus-tests/src/test/java/io/stepfunc/rodbus/tests/IntegrationTest.java @@ -5,11 +5,12 @@ import io.stepfunc.rodbus.Runtime; import org.joou.*; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.parallel.Execution; import java.time.Duration; import java.util.Arrays; import java.util.List; +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.BlockingQueue; import java.util.concurrent.ExecutionException; import static org.assertj.core.api.Assertions.assertThat; @@ -66,9 +67,25 @@ public WriteResult writeMultipleRegisters(UShort start, List it, } } - static class NullClientStateListener implements ClientStateListener { + static class BlockingClientStateListener implements ClientStateListener { + BlockingQueue states = new ArrayBlockingQueue<>(10); + public void waitForState(ClientState state) throws InterruptedException { + while(true) { + if(this.states.take() == state) { + return; + } + } + } + @Override - public void onChange(ClientState state) {} + public void onChange(ClientState state) { + try { + states.put(state); + } + catch (InterruptedException ignored) { + + } + } } @Test @@ -86,11 +103,16 @@ void clientAndServerCommunication() throws ExecutionException, InterruptedExcept } }); + final BlockingClientStateListener listener = new BlockingClientStateListener(); + final Server server = Server.createTcp(runtime, ENDPOINT, PORT, AddressFilter.any(), ushort(100), deviceMap, DecodeLevel.nothing()); - final ClientChannel client = ClientChannel.createTcp(runtime, ENDPOINT, PORT, ushort(10), new RetryStrategy(), DecodeLevel.nothing(), new NullClientStateListener()); + final ClientChannel client = ClientChannel.createTcp(runtime, ENDPOINT, PORT, ushort(10), new RetryStrategy(), DecodeLevel.nothing(), listener); client.enable(); + // wait for connection + listener.waitForState(ClientState.CONNECTED); + // Set a unique pattern to test reads server.updateDatabase(UNIT_ID, db -> { db.updateDiscreteInput(ushort(3), true); diff --git a/ffi/rodbus-bindings/Cargo.toml b/ffi/rodbus-bindings/Cargo.toml index d3d03b46..0232c0d5 100644 --- a/ffi/rodbus-bindings/Cargo.toml +++ b/ffi/rodbus-bindings/Cargo.toml @@ -4,14 +4,14 @@ version = "1.3.1" authors = ["Step Function I/O LLC "] edition = "2021" description = "oobindgen schema for Rodbus" -keywords = ["ffi", "c", "modbus", "ics", "industrial", "plc", "security"] +keywords = ["ffi", "c", "modbus", "industrial", "plc"] categories = ["network-programming"] repository = "https://github.com/stepfunc/rodbus" readme = "../README.md" [dependencies] -oo-bindgen = "0.8" +oo-bindgen = { workspace = true } rodbus-schema = { path = "../rodbus-schema" } -tracing = "^0.1" -tracing-subscriber = "^0.3" +tracing = { workspace = true } +tracing-subscriber = { workspace = true } diff --git a/ffi/rodbus-ffi-java/Cargo.toml b/ffi/rodbus-ffi-java/Cargo.toml index 5a939b64..c74acff9 100644 --- a/ffi/rodbus-ffi-java/Cargo.toml +++ b/ffi/rodbus-ffi-java/Cargo.toml @@ -19,4 +19,4 @@ tls = ["rodbus-ffi/tls"] [build-dependencies] rodbus-schema = { path = "../rodbus-schema" } -oo-bindgen = "0.8" \ No newline at end of file +oo-bindgen = { workspace = true } diff --git a/ffi/rodbus-ffi/Cargo.toml b/ffi/rodbus-ffi/Cargo.toml index c2071263..f9bcfa50 100644 --- a/ffi/rodbus-ffi/Cargo.toml +++ b/ffi/rodbus-ffi/Cargo.toml @@ -4,7 +4,7 @@ version = "1.3.1" authors = ["Step Function I/O LLC "] edition = "2021" description = "FFI for Rodbus" -keywords = ["ffi", "c", "modbus", "ics", "industrial", "plc", "security"] +keywords = ["ffi", "c", "modbus", "industrial", "plc"] categories = ["network-programming"] repository = "https://github.com/stepfunc/rodbus" readme = "../README.md" @@ -16,17 +16,17 @@ crate-type = ["rlib", "cdylib"] lazy_static = "1.0" tracing = "0.1" tracing-core = "0.1" -tracing-subscriber = "0.2" -rodbus = { path = "../../rodbus", default-features = false } -tokio = { version = "1.5", features = ["rt-multi-thread"]} +tracing-subscriber = { workspace = true, features = ["json", "chrono"] } +rodbus = { path = "../../rodbus", default-features = false, features = ["ffi"] } +tokio = { workspace = true, features = ["rt-multi-thread"]} num_cpus = "1" sfio-promise = "0.2" [build-dependencies] rodbus-schema = { path = "../rodbus-schema" } -oo-bindgen = "0.8" -sfio-tracing-ffi = "0.8" -sfio-tokio-ffi = "0.8" +oo-bindgen = { workspace = true } +sfio-tokio-ffi = { workspace = true } +sfio-tracing-ffi = { workspace = true } [features] diff --git a/ffi/rodbus-ffi/src/client.rs b/ffi/rodbus-ffi/src/client.rs index 8fac5f40..5cb825c4 100644 --- a/ffi/rodbus-ffi/src/client.rs +++ b/ffi/rodbus-ffi/src/client.rs @@ -1,5 +1,6 @@ use crate::ffi; -use rodbus::client::{ClientState, HostAddr, Listener, WriteMultiple}; +use crate::ffi::ParamError; +use rodbus::client::{ClientState, FfiSessionError, HostAddr, Listener, WriteMultiple}; use rodbus::{AddressRange, MaybeAsync}; use std::net::IpAddr; @@ -156,14 +157,8 @@ pub(crate) unsafe fn client_channel_read_coils( let channel = channel.as_ref().ok_or(ffi::ParamError::NullParameter)?; let range = AddressRange::try_from(range.start, range.count)?; let callback = sfio_promise::wrap(callback); - let mut session = param.build_session(channel); - channel.runtime.spawn(async move { - session - .read_coils(range, |res| callback.complete(res)) - .await - })?; - + session.read_coils(range, |res| callback.complete(res))?; Ok(()) } @@ -176,14 +171,8 @@ pub(crate) unsafe fn client_channel_read_discrete_inputs( let channel = channel.as_ref().ok_or(ffi::ParamError::NullParameter)?; let range = AddressRange::try_from(range.start, range.count)?; let callback = sfio_promise::wrap(callback); - let mut session = param.build_session(channel); - channel.runtime.spawn(async move { - session - .read_discrete_inputs(range, |res| callback.complete(res)) - .await - })?; - + session.read_discrete_inputs(range, |res| callback.complete(res))?; Ok(()) } @@ -196,14 +185,8 @@ pub(crate) unsafe fn client_channel_read_holding_registers( let channel = channel.as_ref().ok_or(ffi::ParamError::NullParameter)?; let range = AddressRange::try_from(range.start, range.count)?; let callback = sfio_promise::wrap(callback); - let mut session = param.build_session(channel); - channel.runtime.spawn(async move { - session - .read_holding_registers(range, |res| callback.complete(res)) - .await - })?; - + session.read_holding_registers(range, |res| callback.complete(res))?; Ok(()) } @@ -216,14 +199,8 @@ pub(crate) unsafe fn client_channel_read_input_registers( let channel = channel.as_ref().ok_or(ffi::ParamError::NullParameter)?; let range = AddressRange::try_from(range.start, range.count)?; let callback = sfio_promise::wrap(callback); - let mut session = param.build_session(channel); - channel.runtime.spawn(async move { - session - .read_input_registers(range, |res| callback.complete(res)) - .await - })?; - + session.read_input_registers(range, |res| callback.complete(res))?; Ok(()) } @@ -235,14 +212,8 @@ pub(crate) unsafe fn client_channel_write_single_coil( ) -> Result<(), ffi::ParamError> { let channel = channel.as_ref().ok_or(ffi::ParamError::NullParameter)?; let callback = sfio_promise::wrap(callback); - let mut session = param.build_session(channel); - channel.runtime.spawn(async move { - session - .write_single_coil(bit.into(), |res| callback.complete(res)) - .await - })?; - + session.write_single_coil(bit.into(), |res| callback.complete(res))?; Ok(()) } @@ -256,11 +227,7 @@ pub(crate) unsafe fn client_channel_write_single_register( let callback = sfio_promise::wrap(callback); let mut session = param.build_session(channel); - channel.runtime.spawn(async move { - session - .write_single_register(register.into(), |res| callback.complete(res)) - .await - })?; + session.write_single_register(register.into(), |res| callback.complete(res))?; Ok(()) } @@ -276,14 +243,8 @@ pub(crate) unsafe fn client_channel_write_multiple_coils( let items = items.as_ref().ok_or(ffi::ParamError::NullParameter)?; let args = WriteMultiple::from(start, items.inner.clone())?; let callback = sfio_promise::wrap(callback); - let mut session = param.build_session(channel); - channel.runtime.spawn(async move { - session - .write_multiple_coils(args, |res| callback.complete(res)) - .await - })?; - + session.write_multiple_coils(args, |res| callback.complete(res))?; Ok(()) } @@ -298,14 +259,8 @@ pub(crate) unsafe fn client_channel_write_multiple_registers( let items = items.as_ref().ok_or(ffi::ParamError::NullParameter)?; let args = WriteMultiple::from(start, items.inner.clone())?; let callback = sfio_promise::wrap(callback); - let mut session = param.build_session(channel); - channel.runtime.spawn(async move { - session - .write_multiple_registers(args, |res| callback.complete(res)) - .await - })?; - + session.write_multiple_registers(args, |res| callback.complete(res))?; Ok(()) } @@ -450,3 +405,13 @@ impl TryFrom for rodbus::client::TlsClientConfig { Ok(config) } } + +impl From for ParamError { + fn from(err: FfiSessionError) -> Self { + match err { + FfiSessionError::ChannelFull => ParamError::TooManyRequests, + FfiSessionError::ChannelClosed => ParamError::Shutdown, + FfiSessionError::BadRange(err) => err.into(), + } + } +} diff --git a/ffi/rodbus-ffi/src/helpers/ext.rs b/ffi/rodbus-ffi/src/helpers/ext.rs index f0fc6578..9aefc0d3 100644 --- a/ffi/rodbus-ffi/src/helpers/ext.rs +++ b/ffi/rodbus-ffi/src/helpers/ext.rs @@ -1,10 +1,12 @@ use crate::ffi; -use rodbus::client::{CallbackSession, RequestParam}; +use rodbus::client::RequestParam; use rodbus::{BitIterator, RegisterIterator, RequestError, UnitId}; +use rodbus::client::FfiSession; + impl ffi::RequestParam { - pub(crate) fn build_session(&self, channel: &crate::ClientChannel) -> CallbackSession { - CallbackSession::new( + pub(crate) fn build_session(&self, channel: &crate::ClientChannel) -> FfiSession { + FfiSession::new( channel.inner.clone(), RequestParam::new(UnitId::new(self.unit_id()), self.timeout()), ) diff --git a/ffi/rodbus-schema/Cargo.toml b/ffi/rodbus-schema/Cargo.toml index 30b14854..14bae334 100644 --- a/ffi/rodbus-schema/Cargo.toml +++ b/ffi/rodbus-schema/Cargo.toml @@ -5,12 +5,12 @@ version = "1.3.1" authors = ["Step Function I/O LLC "] edition = "2021" description = "oobindgen schema for Rodbus" -keywords = ["ffi", "c", "modbus", "ics", "industrial", "plc", "security"] +keywords = ["ffi", "c", "modbus", "industrial", "plc"] categories = ["network-programming"] repository = "https://github.com/stepfunc/rodbus" readme = "../README.md" [dependencies] -oo-bindgen = "0.8" -sfio-tokio-ffi = "0.8" -sfio-tracing-ffi = "0.8" +oo-bindgen = { workspace = true } +sfio-tokio-ffi = { workspace = true } +sfio-tracing-ffi = { workspace = true } diff --git a/ffi/rodbus-schema/src/common.rs b/ffi/rodbus-schema/src/common.rs index a0c87c1b..6451789a 100644 --- a/ffi/rodbus-schema/src/common.rs +++ b/ffi/rodbus-schema/src/common.rs @@ -126,6 +126,10 @@ fn build_error_type(lib: &mut LibraryBuilder) -> BackTraced { .add_error("bad_tls_config", "Bad TLS configuration")? .add_error("shutdown", "The task has been shutdown")? .add_error("invalid_utf8", "String argument was not valid UTF-8")? + .add_error( + "too_many_requests", + "Number of requests exceeds configured limit", + )? .doc("Error type that indicates a bad parameter or bad programmer logic")? .build()?; diff --git a/packaging.json b/packaging.json index 45e4488e..e727be9a 100644 --- a/packaging.json +++ b/packaging.json @@ -10,6 +10,11 @@ "dotnet": true, "java": false }, + "aarch64-apple-darwin": { + "cpp": false, + "dotnet": true, + "java": true + }, "x86_64-apple-darwin": { "cpp": false, "dotnet": true, diff --git a/rodbus-client/Cargo.toml b/rodbus-client/Cargo.toml index 8354fc1e..fcc7d638 100644 --- a/rodbus-client/Cargo.toml +++ b/rodbus-client/Cargo.toml @@ -16,6 +16,6 @@ path = "src/main.rs" [dependencies] rodbus = { path = "../rodbus", default-features = false } clap = "2.33" -tokio = { version = "1", features = ["macros", "time"] } -tracing = "0.1" -tracing-subscriber = "0.2" +tokio = { workspace = true, features = ["macros", "time"] } +tracing = { workspace = true } +tracing-subscriber = { workspace = true } diff --git a/rodbus/Cargo.toml b/rodbus/Cargo.toml index 33417ffe..d4aa0022 100644 --- a/rodbus/Cargo.toml +++ b/rodbus/Cargo.toml @@ -13,14 +13,14 @@ readme = "README.md" [dependencies] crc = "3.0" -scursor = "0.1" -tokio = { version = "1", features = ["net", "sync", "io-util", "io-std", "time", "rt", "rt-multi-thread", "macros"] } -tracing = "0.1" +scursor = "0.2.0" +tokio = { workspace = true, features = ["net", "sync", "io-util", "io-std", "time", "rt", "rt-multi-thread", "macros"] } +tracing = { workspace = true } # TLS dependencies rx509 = { version = "^0.2", optional = true } -sfio-rustls-config = { version = "0.1.0", optional = true } -tokio-rustls = { version = "0.24", features = ["tls12"], default-features = false, optional = true } +sfio-rustls-config = { version = "0.3.2", optional = true } +tokio-rustls = { version = "0.26.0", features = ["tls12"], default-features = false, optional = true } # serial dependencies tokio-serial = { version = "5.4", default-features = false, optional = true } @@ -31,9 +31,10 @@ tokio-stream = "0.1" tokio-util = { version = "0.7", features = ["codec"] } tokio-test = "0.4.2" sfio-tokio-mock-io = "0.2" -tracing-subscriber = "0.3" +tracing-subscriber = { workspace = true } [features] default = ["tls", "serial"] +ffi = [] tls = ["rx509", "sfio-rustls-config", "tokio-rustls"] serial = ["tokio-serial"] diff --git a/rodbus/src/client/channel.rs b/rodbus/src/client/channel.rs index 3b58340e..ac603ad0 100644 --- a/rodbus/src/client/channel.rs +++ b/rodbus/src/client/channel.rs @@ -243,12 +243,17 @@ impl Channel { /// This interface removes some allocations when returning results. /// Its primary use is for the bindings. Rust users should prefer /// interacting with the channel directly. +#[deprecated( + since = "1.4.0", + note = "Use Channel. This type will be removed in 2.0" +)] #[derive(Debug, Clone)] pub struct CallbackSession { tx: tokio::sync::mpsc::Sender, param: RequestParam, } +#[allow(deprecated)] impl CallbackSession { /// Create a [CallbackSession] from a [Channel] and the specified [RequestParam] pub fn new(channel: Channel, param: RequestParam) -> Self { @@ -385,6 +390,6 @@ impl CallbackSession { } } -fn wrap(param: RequestParam, details: RequestDetails) -> Command { +pub(crate) fn wrap(param: RequestParam, details: RequestDetails) -> Command { Command::Request(Request::new(param.id, param.response_timeout, details)) } diff --git a/rodbus/src/client/ffi_session.rs b/rodbus/src/client/ffi_session.rs new file mode 100644 index 00000000..182783b1 --- /dev/null +++ b/rodbus/src/client/ffi_session.rs @@ -0,0 +1,205 @@ +use crate::client::message::{Command, Promise, RequestDetails}; +use crate::client::requests::read_bits::ReadBits; +use crate::client::requests::read_registers::ReadRegisters; +use crate::client::requests::write_multiple::MultipleWriteRequest; +use crate::client::requests::write_single::SingleWrite; +use crate::client::{Channel, RequestParam, WriteMultiple}; +use crate::{AddressRange, BitIterator, Indexed, InvalidRange, RegisterIterator, RequestError}; +use tokio::sync::mpsc::error::TrySendError; + +/// Callback-based, non-async session used only in combination with the FFI library. +/// +/// No semver guarantees are applied to this type. +#[derive(Debug, Clone)] +pub struct FfiSession { + tx: tokio::sync::mpsc::Sender, + param: RequestParam, +} + +/// Errors returned on methods of the FfiSession +#[derive(Copy, Clone, Debug)] +pub enum FfiSessionError { + /// Channel is full + ChannelFull, + /// Channel is closed + ChannelClosed, + /// Bad range value + BadRange(InvalidRange), +} + +impl FfiSession { + /// Create a [FfiSession] from a [Channel] and the specified [RequestParam] + pub fn new(channel: Channel, param: RequestParam) -> Self { + Self { + tx: channel.tx, + param, + } + } + + /// Read coils from the server + pub fn read_coils(&mut self, range: AddressRange, callback: C) -> Result<(), FfiSessionError> + where + C: FnOnce(Result) + Send + Sync + 'static, + { + self.read_bits(range, callback, RequestDetails::ReadCoils) + } + + /// Read discrete inputs from the server + pub fn read_discrete_inputs( + &mut self, + range: AddressRange, + callback: C, + ) -> Result<(), FfiSessionError> + where + C: FnOnce(Result) + Send + Sync + 'static, + { + self.read_bits(range, callback, RequestDetails::ReadDiscreteInputs) + } + + /// Read holding registers from the server + pub fn read_holding_registers( + &mut self, + range: AddressRange, + callback: C, + ) -> Result<(), FfiSessionError> + where + C: FnOnce(Result) + Send + Sync + 'static, + { + self.read_registers(range, callback, RequestDetails::ReadHoldingRegisters) + } + + /// Read input registers from the server + pub fn read_input_registers( + &mut self, + range: AddressRange, + callback: C, + ) -> Result<(), FfiSessionError> + where + C: FnOnce(Result) + Send + Sync + 'static, + { + self.read_registers(range, callback, RequestDetails::ReadInputRegisters) + } + + /// Write a single coil to the server + pub fn write_single_coil( + &mut self, + value: Indexed, + callback: C, + ) -> Result<(), FfiSessionError> + where + C: FnOnce(Result, RequestError>) + Send + Sync + 'static, + { + self.send(crate::client::channel::wrap( + self.param, + RequestDetails::WriteSingleCoil(SingleWrite::new(value, Promise::new(callback))), + )) + } + + /// Write a single registers to the server + pub fn write_single_register( + &mut self, + value: Indexed, + callback: C, + ) -> Result<(), FfiSessionError> + where + C: FnOnce(Result, RequestError>) + Send + Sync + 'static, + { + self.send(crate::client::channel::wrap( + self.param, + RequestDetails::WriteSingleRegister(SingleWrite::new(value, Promise::new(callback))), + )) + } + + /// Write multiple contiguous registers to the server + pub fn write_multiple_registers( + &mut self, + value: WriteMultiple, + callback: C, + ) -> Result<(), FfiSessionError> + where + C: FnOnce(Result) + Send + Sync + 'static, + { + self.send(crate::client::channel::wrap( + self.param, + RequestDetails::WriteMultipleRegisters(MultipleWriteRequest::new( + value, + Promise::new(callback), + )), + )) + } + + /// Write multiple contiguous coils to the server + pub fn write_multiple_coils( + &mut self, + value: WriteMultiple, + callback: C, + ) -> Result<(), FfiSessionError> + where + C: FnOnce(Result) + Send + Sync + 'static, + { + self.send(crate::client::channel::wrap( + self.param, + RequestDetails::WriteMultipleCoils(MultipleWriteRequest::new( + value, + Promise::new(callback), + )), + )) + } + + fn read_bits( + &mut self, + range: AddressRange, + callback: C, + wrap_req: W, + ) -> Result<(), FfiSessionError> + where + C: FnOnce(Result) + Send + Sync + 'static, + W: Fn(ReadBits) -> RequestDetails, + { + let range = range.of_read_bits()?; + let promise = crate::client::requests::read_bits::Promise::new(callback); + self.send(crate::client::channel::wrap( + self.param, + wrap_req(ReadBits::new(range, promise)), + )) + } + + fn read_registers( + &mut self, + range: AddressRange, + callback: C, + wrap_req: W, + ) -> Result<(), FfiSessionError> + where + C: FnOnce(Result) + Send + Sync + 'static, + W: Fn(ReadRegisters) -> RequestDetails, + { + let promise = crate::client::requests::read_registers::Promise::new(callback); + let range = range.of_read_registers()?; + self.send(crate::client::channel::wrap( + self.param, + wrap_req(ReadRegisters::new(range, promise)), + )) + } + + fn send(&mut self, command: Command) -> Result<(), FfiSessionError> { + // dropping the command will automatically fail requests with SHUTDOWN + self.tx.try_send(command)?; + Ok(()) + } +} + +impl From for FfiSessionError { + fn from(err: InvalidRange) -> FfiSessionError { + Self::BadRange(err) + } +} + +impl From> for FfiSessionError { + fn from(err: TrySendError) -> FfiSessionError { + match err { + TrySendError::Full(_) => FfiSessionError::ChannelFull, + TrySendError::Closed(_) => FfiSessionError::ChannelClosed, + } + } +} diff --git a/rodbus/src/client/mod.rs b/rodbus/src/client/mod.rs index 368e5e42..414556f0 100644 --- a/rodbus/src/client/mod.rs +++ b/rodbus/src/client/mod.rs @@ -9,11 +9,18 @@ pub(crate) mod message; pub(crate) mod requests; pub(crate) mod task; +#[cfg(feature = "ffi")] +/// Only enabled for FFI builds +mod ffi_session; + pub use crate::client::channel::*; pub use crate::client::listener::*; pub use crate::client::requests::write_multiple::WriteMultiple; pub use crate::retry::*; +#[cfg(feature = "ffi")] +pub use ffi_session::*; + #[cfg(feature = "tls")] pub use crate::tcp::tls::client::TlsClientConfig; #[cfg(feature = "tls")] diff --git a/rodbus/src/client/task.rs b/rodbus/src/client/task.rs index 6b92d238..8d8f055f 100644 --- a/rodbus/src/client/task.rs +++ b/rodbus/src/client/task.rs @@ -137,7 +137,7 @@ impl ClientLoop { } } - pub(crate) async fn poll(&mut self, io: &mut PhysLayer) -> Result<(), SessionError> { + async fn poll(&mut self, io: &mut PhysLayer) -> Result<(), SessionError> { tokio::select! { frame = self.reader.next_frame(io, self.decode) => { match frame { @@ -267,21 +267,26 @@ impl ClientLoop { } } + pub(crate) async fn fail_requests(&mut self) -> StateChange { + loop { + if let Err(err) = self.fail_next_request().await { + return err; + } + } + } + pub(crate) async fn fail_requests_for( &mut self, duration: Duration, ) -> Result<(), StateChange> { let deadline = Instant::now() + duration; - - loop { - tokio::select! { - _ = tokio::time::sleep_until(deadline) => { - // Timeout occurred - return Ok(()) - } - x = self.fail_next_request() => { - x? - } + tokio::select! { + _ = tokio::time::sleep_until(deadline) => { + // Timeout occurred + Ok(()) + } + x = self.fail_requests() => { + Err(x) } } } diff --git a/rodbus/src/lib.rs b/rodbus/src/lib.rs index 3377bbdb..d0eacced 100644 --- a/rodbus/src/lib.rs +++ b/rodbus/src/lib.rs @@ -121,7 +121,6 @@ pub_use_of_private_extern_crate, unknown_crate_types, order_dependent_trait_objects, - illegal_floating_point_literal_pattern, improper_ctypes, late_bound_lifetime_arguments, non_camel_case_types, @@ -129,7 +128,6 @@ non_snake_case, non_upper_case_globals, no_mangle_generic_items, - private_in_public, stable_features, type_alias_bounds, tyvar_behind_raw_pointer, @@ -143,7 +141,7 @@ trivial_casts, trivial_numeric_casts, unused_import_braces, - unused_qualifications, + //unused_qualifications, clippy::all )] #![forbid( diff --git a/rodbus/src/tcp/client.rs b/rodbus/src/tcp/client.rs index 5faa14a3..762ca38d 100644 --- a/rodbus/src/tcp/client.rs +++ b/rodbus/src/tcp/client.rs @@ -119,9 +119,20 @@ impl TcpChannelTask { } } + async fn connect(&mut self) -> Result, StateChange> { + tokio::select! { + res = self.host.connect() => { + Ok(res) + } + res = self.client_loop.fail_requests() => { + Err(res) + } + } + } + async fn try_connect_and_run(&mut self) -> Result<(), StateChange> { self.listener.update(ClientState::Connecting).get().await; - match self.host.connect().await { + match self.connect().await? { Err(err) => { let delay = self.connect_retry.after_failed_connect(); tracing::warn!( diff --git a/rodbus/src/tcp/tls/client.rs b/rodbus/src/tcp/tls/client.rs index ce03eeaa..963d2024 100644 --- a/rodbus/src/tcp/tls/client.rs +++ b/rodbus/src/tcp/tls/client.rs @@ -1,12 +1,13 @@ use std::convert::TryFrom; use std::net::Ipv4Addr; -use sfio_rustls_config::NameVerifier; +use sfio_rustls_config::{ProtocolVersions, ServerNameVerification}; use std::path::Path; use std::sync::Arc; use tokio::net::TcpStream; use tokio_rustls::rustls; +use tokio_rustls::rustls::pki_types::InvalidDnsNameError; use tracing::Instrument; use crate::client::{Channel, ClientState, HostAddr, Listener, RetryStrategy}; @@ -18,7 +19,7 @@ use crate::DecodeLevel; /// TLS configuration pub struct TlsClientConfig { - server_name: rustls::ServerName, + server_name: rustls::pki_types::ServerName<'static>, config: Arc, } @@ -119,12 +120,14 @@ impl TlsClientConfig { ) -> Result { let (name_verifier, server_name) = match server_subject_name { None => ( - NameVerifier::any(), - rustls::ServerName::IpAddress(Ipv4Addr::UNSPECIFIED.into()), + ServerNameVerification::DisableNameVerification, + rustls::pki_types::ServerName::IpAddress(rustls::pki_types::IpAddr::V4( + Ipv4Addr::UNSPECIFIED.into(), + )), ), Some(x) => { - let server_name = rustls::ServerName::try_from(x.as_str())?; - (NameVerifier::equal_to(x), server_name) + let server_name = rustls::pki_types::ServerName::try_from(x)?; + (ServerNameVerification::SanOrCommonName, server_name) } }; @@ -168,7 +171,9 @@ impl TlsClientConfig { Ok(Self { // it doesn't matter what we put here, it just needs to be an IP so that the client won't send an SNI extension - server_name: rustls::ServerName::IpAddress(Ipv4Addr::UNSPECIFIED.into()), + server_name: rustls::pki_types::ServerName::IpAddress(rustls::pki_types::IpAddr::V4( + Ipv4Addr::UNSPECIFIED.into(), + )), config: Arc::new(config), }) } @@ -187,3 +192,18 @@ impl TlsClientConfig { } } } + +impl From for TlsError { + fn from(_: InvalidDnsNameError) -> Self { + TlsError::InvalidDnsName + } +} + +impl From for ProtocolVersions { + fn from(value: MinTlsVersion) -> Self { + match value { + MinTlsVersion::V1_2 => ProtocolVersions::v12_only(), + MinTlsVersion::V1_3 => ProtocolVersions::new().enable_v12().enable_v13(), + } + } +} diff --git a/rodbus/src/tcp/tls/mod.rs b/rodbus/src/tcp/tls/mod.rs index a6d0fb9a..812fe67f 100644 --- a/rodbus/src/tcp/tls/mod.rs +++ b/rodbus/src/tcp/tls/mod.rs @@ -3,7 +3,6 @@ pub(crate) mod server; pub(crate) use client::*; pub(crate) use server::*; -use tokio_rustls::rustls::client::InvalidDnsNameError; /// Determines how the certificate(s) presented by the peer are validated /// @@ -76,6 +75,7 @@ pub enum MinTlsVersion { V1_3, } +/* impl From for sfio_rustls_config::MinProtocolVersion { fn from(value: MinTlsVersion) -> Self { match value { @@ -90,3 +90,4 @@ impl From for TlsError { Self::InvalidDnsName } } +*/ diff --git a/rodbus/src/tcp/tls/server.rs b/rodbus/src/tcp/tls/server.rs index 7cb5422e..460cec60 100644 --- a/rodbus/src/tcp/tls/server.rs +++ b/rodbus/src/tcp/tls/server.rs @@ -1,5 +1,4 @@ -use sfio_rustls_config::NameVerifier; - +use sfio_rustls_config::ClientNameVerification; use std::path::Path; use std::sync::Arc; @@ -37,7 +36,7 @@ impl TlsServerConfig { )?, CertificateMode::AuthorityBased => sfio_rustls_config::server::authority( min_tls_version.into(), - NameVerifier::any(), + ClientNameVerification::None, peer_cert_path, local_cert_path, private_key_path, @@ -70,9 +69,7 @@ impl TlsServerConfig { .1 .peer_certificates() .and_then(|x| x.first()) - .ok_or_else(|| "No peer certificate".to_string())? - .0 - .as_slice(); + .ok_or_else(|| "No peer certificate".to_string())?; let parsed = rx509::x509::Certificate::parse(peer_cert) .map_err(|err| format!("ASNError: {err}"))?; diff --git a/rodbus/src/types.rs b/rodbus/src/types.rs index 0f9d94eb..518107ae 100644 --- a/rodbus/src/types.rs +++ b/rodbus/src/types.rs @@ -249,7 +249,7 @@ impl AddressRange { return Err(InvalidRange::CountOfZero); } - let max_start = std::u16::MAX - (count - 1); + let max_start = u16::MAX - (count - 1); if start > max_start { return Err(InvalidRange::AddressOverflow(start, count)); diff --git a/rodbus/tests/integration_test.rs b/rodbus/tests/integration_test.rs index d49b9ca5..07375b29 100644 --- a/rodbus/tests/integration_test.rs +++ b/rodbus/tests/integration_test.rs @@ -26,6 +26,22 @@ impl Handler { } } +struct ClientStateListener { + tx: tokio::sync::mpsc::Sender, +} + +impl Listener for ClientStateListener { + fn update(&mut self, value: ClientState) -> MaybeAsync<()> { + let update = { + let tx = self.tx.clone(); + async move { + let _ = tx.send(value).await; + } + }; + MaybeAsync::asynchronous(update) + } +} + impl RequestHandler for Handler { fn read_coil(&self, address: u16) -> Result { match self.coils.get(address as usize) { @@ -110,16 +126,27 @@ async fn test_requests_and_responses() { .await .unwrap(); + let (tx, mut rx) = tokio::sync::mpsc::channel(8); + let listener = ClientStateListener { tx }; + let mut channel = spawn_tcp_client_task( HostAddr::ip(addr.ip(), addr.port()), 10, default_retry_strategy(), DecodeLevel::default(), - None, + Some(Box::new(listener)), ); channel.enable().await.unwrap(); + // wait until we're connected + loop { + let state = rx.recv().await.unwrap(); + if state == ClientState::Connected { + break; + } + } + let params = RequestParam::new(UnitId::new(0x01), Duration::from_secs(1)); {