diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 01929efa..d0568654 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -12,6 +12,11 @@ on: type: boolean description: "Use base image testpr" default: false + build_latest_as_test: + required: false + type: boolean + description: "Build latest as test" + default: false push: branches: - main @@ -36,9 +41,11 @@ jobs: env: INPUTS_REASON: ${{ github.event.inputs.reason }} INPUTS_USE_TEST_IMAGE: ${{ github.event.inputs.use_test_image }} + INPUTS_BUILD_LATEST_AS_TEST: ${{ github.event.inputs.build_latest_as_test }} run: | echo "Workflow dispatch reason: $INPUTS_REASON" echo "Use test image: $INPUTS_USE_TEST_IMAGE" + echo "Build latest as test: $INPUTS_BUILD_LATEST_AS_TEST" binary_build_armv7: name: Build Binary - armv7 @@ -75,7 +82,7 @@ jobs: outputs: type=local,dest=./image_armv7/ - name: Upload artifact armv7 binary - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v4.0.0 with: name: acars_router.armv7 path: ./image_armv7/acars_router @@ -115,7 +122,7 @@ jobs: outputs: type=local,dest=./image_arm64/ - name: Upload artifact arm64 binary - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v4.0.0 with: name: acars_router.arm64 path: ./image_arm64/acars_router @@ -155,7 +162,7 @@ jobs: outputs: type=local,dest=./image_amd64/ - name: Upload artifact amd64 binary - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v4.0.0 with: name: acars_router.amd64 path: ./image_amd64/acars_router @@ -167,17 +174,17 @@ jobs: steps: - run: mkdir -p ./bin - - uses: actions/download-artifact@master + - uses: actions/download-artifact@v4.0.0 with: name: acars_router.amd64 path: ./bin/acars_router.amd64 - - uses: actions/download-artifact@master + - uses: actions/download-artifact@v4.0.0 with: name: acars_router.armv7 path: ./bin/acars_router.armv7 - - uses: actions/download-artifact@master + - uses: actions/download-artifact@v4.0.0 with: name: acars_router.arm64 path: ./bin/acars_router.arm64 @@ -192,6 +199,10 @@ jobs: release_binaries: name: Release Binaries + if: | + (github.event.inputs.build_latest_as_test == 'false' || + github.event.inputs.build_latest_as_test == '') && + (github.event.inputs.use_test_image == 'false' || github.event.inputs.use_test_image == '') needs: [ binary_build_amd64, @@ -244,6 +255,9 @@ jobs: deploy: name: Deploy + if: | + github.event.inputs.build_latest_as_test == 'false' || + github.event.inputs.build_latest_as_test == '' needs: [consolidate_binaries] uses: sdr-enthusiasts/common-github-workflows/.github/workflows/build_and_push_image.yml@main with: @@ -266,3 +280,32 @@ jobs: build_baseimage_url: :base/:base-test-pr secrets: ghcr_token: ${{ secrets.GITHUB_TOKEN }} + + deploy_test: + name: Deploy as test + if: | + github.event.inputs.build_latest_as_test == 'true' && + (github.event.inputs.use_test_image == 'false' || github.event.inputs.use_test_image == '') + needs: [consolidate_binaries] + uses: sdr-enthusiasts/common-github-workflows/.github/workflows/build_and_push_image.yml@main + with: + push_enabled: true + push_destinations: ghcr.io + ghcr_repo_owner: ${{ github.repository_owner }} + ghcr_repo: ${{ github.repository }} + build_with_tmpfs: true + get_version_method: cargo_toml_file_in_repo:file=/Cargo.toml + cache_enabled: true + cache_path: ./bin/ + cache_key: ${{ github.run_id }} + # set build_latest to true if github.event.inputs.use_test_image is false + build_latest: true + docker_latest_tag: test + build_baseimage_test: false + # only build the entire stack if we are not using the test image + build_version_specific: false + build_platform_specific: false + build_nohealthcheck: false + build_baseimage_url: :base/:base-test-pr + secrets: + ghcr_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/markdownlint.yml b/.github/workflows/markdownlint.yml index 37b061e9..f0ca676b 100644 --- a/.github/workflows/markdownlint.yml +++ b/.github/workflows/markdownlint.yml @@ -20,4 +20,4 @@ jobs: - name: Pull markdownlint/markdownlint:latest Image run: docker pull markdownlint/markdownlint:latest - name: Run markdownlint against *.md files - run: docker run --rm -i -v "$(pwd)":/workdir --workdir /workdir markdownlint/markdownlint:latest --rules ~MD013,~MD033,~MD026,~MD002,~MD022 $(find . -type f -iname '*.md' | grep -v '/.git/') + run: docker run --rm -i -v "$(pwd)":/workdir --workdir /workdir markdownlint/markdownlint:latest --rules ~MD013,~MD033,~MD026,~MD002,~MD022,~MD007 $(find . -type f -iname '*.md' | grep -v '/.git/') diff --git a/.github/workflows/on_pr.yaml b/.github/workflows/on_pr.yaml index 5118546d..6d08a5f7 100644 --- a/.github/workflows/on_pr.yaml +++ b/.github/workflows/on_pr.yaml @@ -139,7 +139,7 @@ jobs: outputs: type=local,dest=./image_armv7/ - name: Upload artifact armv7 binary - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v4.0.0 with: name: acars_router.armv7 path: ./image_armv7/acars_router @@ -179,7 +179,7 @@ jobs: outputs: type=local,dest=./image_arm64/ - name: Upload artifact arm64 binary - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v4.0.0 with: name: acars_router.arm64 path: ./image_arm64/acars_router @@ -219,7 +219,7 @@ jobs: outputs: type=local,dest=./image_amd64/ - name: Upload artifact amd64 binary - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v4.0.0 with: name: acars_router.amd64 path: ./image_amd64/acars_router @@ -231,17 +231,17 @@ jobs: steps: - run: mkdir -p ./bin - - uses: actions/download-artifact@master + - uses: actions/download-artifact@v4.0.0 with: name: acars_router.amd64 path: ./bin/acars_router.amd64 - - uses: actions/download-artifact@master + - uses: actions/download-artifact@v4.0.0 with: name: acars_router.armv7 path: ./bin/acars_router.armv7 - - uses: actions/download-artifact@master + - uses: actions/download-artifact@v4.0.0 with: name: acars_router.arm64 path: ./bin/acars_router.arm64 diff --git a/Cargo.lock b/Cargo.lock index 2d154841..23495a7a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,7 +4,7 @@ version = 3 [[package]] name = "acars_config" -version = "1.0.22" +version = "1.1.0-beta.5" dependencies = [ "clap", "log", @@ -13,7 +13,7 @@ dependencies = [ [[package]] name = "acars_connection_manager" -version = "1.0.22" +version = "1.1.0-beta.5" dependencies = [ "acars_config", "acars_vdlm2_parser", @@ -30,12 +30,10 @@ dependencies = [ [[package]] name = "acars_router" -version = "1.0.22" +version = "1.1.0-beta.5" dependencies = [ "acars_config", "acars_connection_manager", - "chrono", - "failure", "log", "sdre-rust-logging", "serde", @@ -46,7 +44,7 @@ dependencies = [ [[package]] name = "acars_vdlm2_parser" version = "0.2.1" -source = "git+https://github.com/jcdeimos/acars_vdlm2_parser#50c04d44361d6a7ef04f67211dc1e29ba8b98d57" +source = "git+https://github.com/fredclausen/acars_vdlm2_parser?branch=hfdl-and-dependency-updates#8bea595eff65544624ede1b08c803b29738e51c8" dependencies = [ "log", "serde", @@ -71,9 +69,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" dependencies = [ "cfg-if", "once_cell", @@ -113,9 +111,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +checksum = "d664a92ecae85fd0a7392615844904654d1d5f5514837f471ddef4a057aba1b6" dependencies = [ "anstyle", "anstyle-parse", @@ -133,41 +131,41 @@ checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anstyle-parse" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.1" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" dependencies = [ "anstyle", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "async-trait" -version = "0.1.76" +version = "0.1.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531b97fb4cd3dfdce92c35dedbfdc1f0b9d8091c8ca943d6dae340ef5012d514" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn", ] [[package]] @@ -227,9 +225,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.15.5" +version = "0.15.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03915af431787e6ffdcc74c645077518c6b6e01f80b761e0fbbfa288536311b3" +checksum = "6100bc57b6209840798d95cb2775684849d332f7bd788db2a8c8caf7ef82a41a" dependencies = [ "smallvec", "target-lexicon", @@ -252,14 +250,14 @@ dependencies = [ "js-sys", "num-traits", "wasm-bindgen", - "windows-targets", + "windows-targets 0.48.5", ] [[package]] name = "clap" -version = "4.4.12" +version = "4.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcfab8ba68f3668e89f6ff60f5b205cea56aa7b769451a59f34b8682f51c056d" +checksum = "52bdc885e4cacc7f7c9eedc1ef6da641603180c783c41a15c264944deeaab642" dependencies = [ "clap_builder", "clap_derive", @@ -286,7 +284,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.39", + "syn", ] [[package]] @@ -303,15 +301,15 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[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 = "crossbeam" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2801af0d36612ae591caa9568261fddce32ce6e08a7275ea334a06a4ad021a2c" +checksum = "6eb9105919ca8e40d437fc9cbb8f1975d916f1bd28afe795a48aae32a2cc8920" dependencies = [ "cfg-if", "crossbeam-channel", @@ -323,9 +321,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.8" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +checksum = "82a9b73a36529d9c47029b9fb3a6f0ea3cc916a261195352ba19e770fc1748b2" dependencies = [ "cfg-if", "crossbeam-utils", @@ -333,9 +331,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +checksum = "fca89a0e215bab21874660c67903c5f143333cab1da83d041c7ded6053774751" dependencies = [ "cfg-if", "crossbeam-epoch", @@ -344,22 +342,20 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.15" +version = "0.9.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +checksum = "0e3681d554572a651dda4186cd47240627c3d0114d45a95f6ad27f2f22e7548d" dependencies = [ "autocfg", "cfg-if", "crossbeam-utils", - "memoffset", - "scopeguard", ] [[package]] name = "crossbeam-queue" -version = "0.3.8" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" +checksum = "adc6598521bb5a83d491e8c1fe51db7296019d2ca3cb93cc6c2a20369a4d78a2" dependencies = [ "cfg-if", "crossbeam-utils", @@ -367,9 +363,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +checksum = "c3a430a770ebd84726f584a90ee7f020d28db52c6d02138900f22341f866d39c" dependencies = [ "cfg-if", ] @@ -412,34 +408,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f258a7194e7f7c2a7837a8913aeab7fd8c383457034fa20ce4dd3dcb813e8eb8" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ "libc", - "windows-sys", -] - -[[package]] -name = "failure" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" -dependencies = [ - "backtrace", - "failure_derive", -] - -[[package]] -name = "failure_derive" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "synstructure", + "windows-sys 0.52.0", ] [[package]] @@ -498,7 +472,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn", ] [[package]] @@ -544,15 +518,15 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "hashbrown" -version = "0.14.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", "allocator-api2", @@ -578,9 +552,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "iana-time-zone" -version = "0.1.58" +version = "0.1.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" +checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -611,20 +585,20 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" dependencies = [ "hermit-abi", "rustix", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "jobserver" @@ -637,9 +611,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.65" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" +checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" dependencies = [ "wasm-bindgen", ] @@ -656,15 +630,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.150" +version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" [[package]] name = "linux-raw-sys" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829" +checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" [[package]] name = "lock_api" @@ -684,18 +658,9 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" - -[[package]] -name = "memoffset" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "miniz_oxide" @@ -708,13 +673,13 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.9" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "wasi", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -738,18 +703,18 @@ dependencies = [ [[package]] name = "object" -version = "0.32.1" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +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 = "parking_lot" @@ -771,7 +736,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-targets", + "windows-targets 0.48.5", ] [[package]] @@ -788,9 +753,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "69d3587f8a9e599cc7ec2c00e331f71c4e69a5f9a4b8a6efd5b07466b9736f9a" [[package]] name = "ppv-lite86" @@ -800,18 +765,18 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.69" +version = "1.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -912,22 +877,22 @@ checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustix" -version = "0.38.25" +version = "0.38.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc99bc2d4f1fed22595588a013687477aedf3cdcfb26558c559edb67b4d9b22e" +checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" dependencies = [ "bitflags 2.4.1", "errno", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "same-file" @@ -946,9 +911,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sdre-rust-logging" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78cb771c3ce3d5ff02f2ec4e9c98693a7212e98e81f97eb8c6cf26343fb0a09e" +checksum = "15f56a89f4a19854056cbce45293c38fc4b420f4286fc38559e3bc9397e10821" dependencies = [ "chrono", "env_logger", @@ -957,9 +922,9 @@ dependencies = [ [[package]] name = "sdre-stubborn-io" -version = "0.4.4" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da384fd715ddc4f7ca727e0193afee555e2bceaa0d78d640d688ad15378cd36f" +checksum = "106eca72e3117d542866aba201f070c7adb64becb61b80ae40594b6c681e433e" dependencies = [ "log", "rand", @@ -968,29 +933,29 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.193" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn", ] [[package]] name = "serde_json" -version = "1.0.109" +version = "1.0.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0652c533506ad7a2e353cce269330d6afd8bdfb6d75e0ace5b35aacbd7b9e9" +checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" dependencies = [ "itoa", "ryu", @@ -999,9 +964,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" dependencies = [ "serde", ] @@ -1037,49 +1002,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - -[[package]] -name = "syn" -version = "1.0.109" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] +checksum = "ccbca6f34534eb78dbee83f6b2c9442fea7113f43d9e80ea320f0972ae5dc08d" [[package]] name = "syn" -version = "2.0.39" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] -[[package]] -name = "synstructure" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "unicode-xid", -] - [[package]] name = "system-deps" version = "6.2.0" @@ -1095,9 +1037,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.12" +version = "0.12.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" +checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae" [[package]] name = "termcolor" @@ -1110,22 +1052,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.50" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.50" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn", ] [[package]] @@ -1158,7 +1100,7 @@ dependencies = [ "socket2", "tokio-macros", "tracing", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -1169,7 +1111,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn", ] [[package]] @@ -1260,12 +1202,6 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" -[[package]] -name = "unicode-xid" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" - [[package]] name = "utf8parse" version = "0.2.1" @@ -1291,7 +1227,7 @@ checksum = "f49e7f3f3db8040a100710a11932239fd30697115e2ba4107080d8252939845e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn", ] [[package]] @@ -1324,9 +1260,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" +checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1334,24 +1270,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" +checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.39", + "syn", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" +checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1359,22 +1295,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" +checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" +checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" [[package]] name = "winapi" @@ -1409,11 +1345,11 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-core" -version = "0.51.1" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets", + "windows-targets 0.52.0", ] [[package]] @@ -1422,7 +1358,16 @@ 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.0", ] [[package]] @@ -1431,13 +1376,28 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" 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.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.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", ] [[package]] @@ -1446,69 +1406,111 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + [[package]] name = "windows_i686_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + [[package]] name = "windows_i686_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + [[package]] name = "winnow" -version = "0.5.19" +version = "0.5.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" +checksum = "b7520bbdec7211caa7c4e682eb1fbe07abe20cee6756b6e00f537c82c11816aa" dependencies = [ "memchr", ] [[package]] name = "zerocopy" -version = "0.7.26" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.26" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 6be66815..f3d330cf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,17 +1,17 @@ [workspace] members = [ - "rust/bin/acars_router", - "rust/libraries/acars_config", - "rust/libraries/acars_connection_manager", + "rust/bin/acars_router", + "rust/libraries/acars_config", + "rust/libraries/acars_connection_manager", ] resolver = "2" [workspace.package] edition = "2021" -version = "1.0.22" +version = "1.1.0-beta.5" authors = ["Fred Clausen", "Mike Nye", "Alex Austin"] -description = "ACARS Router: A Utility to ingest ACARS/VDLM2 from many sources, process, and feed out to many consumers." +description = "ACARS Router: A Utility to ingest ACARS/VDLM2/HFDL from many sources, process, and feed out to many consumers." documentation = "https://github.com/sdr-enthusiasts/acars_router" homepage = "https://github.com/sdr-enthusiasts/acars_router" repository = "https://github.com/sdr-enthusiasts/acars_router" diff --git a/Dockerfile b/Dockerfile index 9fd85369..a318f395 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,10 +4,17 @@ ENV AR_LISTEN_UDP_ACARS=5550 \ AR_LISTEN_TCP_ACARS=5550 \ AR_LISTEN_UDP_VDLM2=5555 \ AR_LISTEN_TCP_VDLM2=5555 \ + AR_LISTEN_UDP_HFDL=5556 \ + AR_LISTEN_TCP_HFDL=5556 \ + AR_LISTEN_ZMQ_ACARS=35550 \ + AR_LISTEN_ZMQ_VDLM2=35555 \ + AR_LISTEN_ZMQ_HFDL=35556 \ AR_SERVE_TCP_ACARS=15550 \ AR_SERVE_TCP_VDLM2=15555 \ + AR_SERVE_TCP_HFDL=15556 \ AR_SERVE_ZMQ_ACARS=45550 \ AR_SERVE_ZMQ_VDLM2=45555 \ + AR_SERVE_ZMQ_HFDL=45556 \ AR_ADD_PROXY_ID=true SHELL ["/bin/bash", "-o", "pipefail", "-c"] diff --git a/Dockerfile.build_binary b/Dockerfile.build_binary index 06b86bde..59f9969f 100644 --- a/Dockerfile.build_binary +++ b/Dockerfile.build_binary @@ -1,4 +1,4 @@ -FROM rust:1.75.0-bullseye as builder +FROM rust:1.75.0 as builder ENV CARGO_NET_GIT_FETCH_WITH_CLI=true WORKDIR /tmp/acars_router # hadolint ignore=DL3008,DL3003,SC1091,DL3009 diff --git a/Dockerfile.local b/Dockerfile.local index 5cd500da..40ae8b93 100644 --- a/Dockerfile.local +++ b/Dockerfile.local @@ -1,4 +1,4 @@ -FROM rust:1.75.0-bullseye as builder +FROM rust:1.75.0 as builder WORKDIR /tmp/acars_router # hadolint ignore=DL3008,DL3003,SC1091 RUN set -x && \ @@ -14,10 +14,17 @@ ENV AR_LISTEN_UDP_ACARS=5550 \ AR_LISTEN_TCP_ACARS=5550 \ AR_LISTEN_UDP_VDLM2=5555 \ AR_LISTEN_TCP_VDLM2=5555 \ + AR_LISTEN_UDP_HFDL=5556 \ + AR_LISTEN_TCP_HFDL=5556 \ + AR_LISTEN_ZMQ_ACARS=35550 \ + AR_LISTEN_ZMQ_VDLM2=35555 \ + AR_LISTEN_ZMQ_HFDL=35556 \ AR_SERVE_TCP_ACARS=15550 \ AR_SERVE_TCP_VDLM2=15555 \ + AR_SERVE_TCP_HFDL=15556 \ AR_SERVE_ZMQ_ACARS=45550 \ AR_SERVE_ZMQ_VDLM2=45555 \ + AR_SERVE_ZMQ_HFDL=45556 \ AR_ADD_PROXY_ID=true SHELL ["/bin/bash", "-o", "pipefail", "-c"] diff --git a/README.md b/README.md index a45ffea8..4629d750 100644 --- a/README.md +++ b/README.md @@ -11,39 +11,26 @@ volumes: - acarshub_run services: - acarsdec: - image: ghcr.io/sdr-enthusiasts/docker-acarsdec:latest - tty: true - container_name: acarsdec - restart: always - devices: - - /dev/bus/usb:/dev/bus/usb - environment: - - TZ=${FEEDER_TZ} - - SERIAL=XXX - - FREQUENCIES=XXX;XXX;XXX - - GAIN=XXX - - SERVER=acars_router - - SERVER_PORT=5550 - tmpfs: - - /run:exec,size=64M - - /var/log - - dumpvdl2: - image: ghcr.io/sdr-enthusiasts/docker-dumpvdl2:latest + acarshub: + image: ghcr.io/sdr-enthusiasts/docker-acarshub:latest tty: true - container_name: dumpvdl2 + container_name: acarshub restart: always - devices: - - /dev/bus/usb:/dev/bus/usb + ports: + - 8080:80 environment: - - TZ=${FEEDER_TZ} - - SERIAL=XXX - - FREQUENCIES=XXX;XXX;XXX - - GAIN=XXX - - ZMQ_MODE=server - - ZMQ_ENDPOINT=tcp://0.0.0.0:45555 + - ENABLE_VDLM=EXTERNAL + - ENABLE_ACARS=EXTERNAL + - FEED=true + - IATA_OVERRIDE=UP|UPS|United Parcel Service;GS|FTH|Mountain Aviation (Foothills);GS|EJA|ExecJet + - ENABLE_ADSB=true + - ADSB_LAT=${FEEDER_LAT} + - ADSB_LON=${FEEDER_LON} + - ADSB_URL=${ACARS_TAR_HOST} + volumes: + - "acars_run:/run/acars" tmpfs: + - /database:exec,size=64M - /run:exec,size=64M - /var/log @@ -54,32 +41,12 @@ services: restart: always environment: - TZ=${FEEDER_TZ} - - AR_SEND_UDP_ACARS=acarshub:5550 + - AR_ENABLE_DEDUPE=true + - AR_SEND_UDP_ACARS=acarshub:5550;feed.airframes.io:5550 - AR_SEND_UDP_VDLM2=acarshub:5555 + - AR_SEND_TCP_VDLM2=feed.airframes.io:5553 + - AR_SEND_TCP_HFDL=feed.airframes.io:5556 - AR_RECV_ZMQ_VDLM2=dumpvdl2:45555 - - AR_OVERRIDE_STATION_NAME=${FEEDER_NAME} - - AR_STATS_VERBOSE=false - tmpfs: - - /run:exec,size=64M - - /var/log - - acarshub: - image: ghcr.io/sdr-enthusiasts/docker-acarshub:latest - tty: true - container_name: acarshub - hostname: acarshub - restart: always - ports: - - 8080:80 - environment: - - TZ=${FEEDER_TZ} - - ADSB_LAT=${FEEDER_LAT} - - ADSB_LON=${FEEDER_LONG} - - ENABLE_ADSB=true - - ENABLE_ACARS=external - - ENABLE_VDLM=external - volumes: - - acarshub_run:/run/acars tmpfs: - /run:exec,size=64M - /var/log @@ -93,3 +60,97 @@ With the above deployment: - `acars_router` will connect to `dumpvdl2` via TCP/ZMQ and receive JSON messages. - `acars_router` will set your station ID on all messages. - `acars_router` will then output to `acarshub`. + +## Ports + +All ports are configurable. By default, the following ports will be used: + +| Port | Protocol | Description | +| ------- | -------- | -------------------------------------------------------------------------------- | +| `5550` | `UDP` | ACARS injest. Clients will send acars data to this port via UDP. | +| `5550` | `TCP` | ACARS injest. Clients will send acars data to this port via TCP. | +| `5555` | `UDP` | VDLM2 injest. Clients will send VDLM2 data to this port via UDP. | +| `5555` | `TCP` | VDLM2 injest. Clients will send VDLM2 data to this port via TCP. | +| `5556` | `UDP` | HFDL injest. Clients will send HFDL data to this port via UDP. | +| `5556` | `TCP` | HFDL injest. Clients will send HFDL data to this port via TCP. | +| `15550` | `TCP` | ACARS server. Can be used for other clients to connect and get messages | +| `15555` | `TCP` | VDLM2 server. Can be used for other clients to connect and get messages | +| `15556` | `TCP` | HFDL server. Can be used for other clients to connect and get messages | +| `35550` | `ZMQ` | ACARS injest. Clients will connect to this port and send acars messages over ZMQ | +| `35555` | `ZMQ` | VDLM2 injest. Clients will connect to this port and send VDLM2 messages over ZMQ | +| `35556` | `ZMQ` | HFDL injest. Clients will connect to this port and send HFDL messages over ZMQ | +| `45550` | `ZMQ` | ACARS server. Can be used for other ZMQ clients to connect and get messages | +| `45555` | `ZMQ` | VDLM2 server. Can be used for other ZMQ clients to connect and get messages | +| `45556` | `ZMQ` | HFDL server. Can be used for other ZMQ clients to connect and get messages | + +If you want any port(s) to be exposed outside of the docker network, please be sure to append them to the ports section of the `docker-compose.yml` file. + +## Environment Variables + +All env variables with `SEND` or `RECV` in them can have multiple destinations. Each destination should be separated by a `;`. For example, `SEND_UDP_ACARS=acarshub:5550;acarshub2:5550` will send UDP ACARS messages to both `acarshub` and `acarshub2`. + +The nomenclature for the environment variables is as follows: + +### Nomenclature used in variable naming + +#### Input/Inbound data + +- Receiver: ACARS router will connect out to a remote host and receive data from it. (TCP/ZMQ) +- Listener: ACARS router will listen on a port for incoming data (UDP) or incoming connection based on socket type (TCP/ZMQ) + +#### Output/Outbound data + +- Sender: ACARS router will connect out to a remote host and send data to it. (TCP/ZMQ) +- Server: ACARS router will send data to a remote host (UDP) or listen for incoming connection (TCP/ZMQ) and send data to it. + +### Outbound data + +| Env Variable | Command Line Switch | Default | Description | +| ------------------ | ------------------- | ------- | ---------------------------------------- | +| AR_SEND_UDP_ACARS | --send-udp-acars | `unset` | UDP host:port to send ACARS messages to | +| AR_SEND_UDP_VDLM2 | --send-udp-vdlm2 | `unset` | UDP host:port to send VDLM2 messages to | +| AR_SEND_UDP_HFDL | --send-udp-hfdl | `unset` | UDP host:port to send HFDL messages to | +| AR_SEND_TCP_ACARS | --send-tcp-acars | `unset` | TCP host:port to send ACARS messages to | +| AR_SEND_TCP_VDLM2 | --send-tcp-vdlm2 | `unset` | TCP host:port to send VDLM2 messages to | +| AR_SEND_TCP_HFDL | --send-tcp-hfdl | `unset` | TCP host:port to send HFDL messages to | +| AR_SERVE_TCP_ACARS | --serve-tcp-acars | `5550` | TCP host:port to serve ACARS messages to | +| AR_SERVE_TCP_VDLM2 | --serve-tcp-vdlm2 | `5555` | TCP host:port to serve VDLM2 messages to | +| AR_SERVE_TCP_HFDL | --serve-tcp-hfdl | `5556` | TCP host:port to serve HFDL messages to | +| AR_SERVE_ZMQ_ACARS | --serve-zmq-acars | `45550` | ZMQ host:port to serve ACARS messages to | +| AR_SERVE_ZMQ_VDLM2 | --serve-zmq-vdlm2 | `45555` | ZMQ host:port to serve VDLM2 messages to | +| AR_SERVE_ZMQ_HFDL | --serve-zmq-hfdl | `45556` | ZMQ host:port to serve HFDL messages to | + +### Inbound data + +| Env Variable | Command Line Switch | Default | Description | +| ------------------- | ------------------- | ------- | -------------------------------------------- | +| AR_RECV_ZMQ_ACARS | --recv-zmq-acars | `unset` | ZMQ host:port to receive ACARS messages from | +| AR_RECV_ZMQ_VDLM2 | --recv-zmq-vdlm2 | `unset` | ZMQ host:port to receive VDLM2 messages from | +| AR_RECV_ZMQ_HFDL | --recv-zmq-hfdl | `unset` | ZMQ host:port to receive HFDL messages from | +| AR_RECV_TCP_ACARS | --recv-tcp-acars | `unset` | TCP host:port to receive ACARS messages from | +| AR_RECV_TCP_VDLM2 | --recv-tcp-vdlm2 | `unset` | TCP host:port to receive VDLM2 messages from | +| AR_RECV_TCP_HFDL | --recv-tcp-hfdl | `unset` | TCP host:port to receive HFDL messages from | +| AR_LISTEN_TCP_ACARS | --listen-tcp-acars | `5550` | TCP port to listen for ACARS messages from | +| AR_LISTEN_TCP_VDLM2 | --listen-tcp-vdlm2 | `5555` | TCP port to listen for VDLM2 messages from | +| AR_LISTEN_TCP_HFDL | --listen-tcp-hfdl | `5556` | TCP port to listen for HFDL messages from | +| AR_LISTEN_UDP_ACARS | --listen-udp-acars | `5550` | UDP port to listen for ACARS messages from | +| AR_LISTEN_UDP_VDLM2 | --listen-udp-vdlm2 | `5555` | UDP port to listen for VDLM2 messages from | +| AR_LISTEN_UDP_HFDL | --listen-udp-hfdl | `5556` | UDP port to listen for HFDL messages from | +| AR_LISTEN_ZMQ_ACARS | --listen-zmq-acars | `35550` | ZMQ port to listen for ACARS messages from | +| AR_LISTEN_ZMQ_VDLM2 | --listen-zmq-vdlm2 | `35555` | ZMQ port to listen for VDLM2 messages from | +| AR_LISTEN_ZMQ_HFDL | --listen-zmq-hfdl | `35556` | ZMQ port to listen for HFDL messages from | + +### General Options + +| Env Variable | Command Line Switch | Default | Description | +| ------------------------ | ----------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| AR_VERBOSITY | --verbose | `info` | Verbosity level. Valid values are `debug`, `info`, `warning`, `error` | +| AR_ENABLE_DEDUPE | --enable-dedupe | `false` | Enable message deduplication. Valid values are `true` or `false` | +| AR_DEDUPE_WINDOW | --dedupe-window | `2` | Window for how long a message will be considered a duplicate if the same message is received again. | +| AR_SKEW_WINDOW | --skew-window | `5` | If a message is older then the skew window it will be automatically rejected, in seconds. If you are receiving only ACARS/VDLM2 1 or 2 seconds is a good value. With HFDL you will need to increase the window. | +| AR_MAX_UDP_PACKET_SIZE | --max-udp-packet-size | `60000` | Maximum UDP packet size. Messages greater then this will be send in multiple parts | +| AR_ADD_PROXY_ID | --add-proxy-id | `true` | Append to the message a header indicating that acars router processed the message | +| AR_OVERRIDE_STATION_NAME | --override-station-name | `unset` | Change the station id field (identifying your station name for unstream clients) is set to this instead of what was in the message originally | +| AR_STATS_EVERY | --stats-every | `5` | How often to print stats to the log in minutes | +| AR_STATS_VERBOSE | --stats-verbose | `false` | Print verbose stats to the log | +| AR_REASSEMBLY_WINDOW | --reassemble-window | `1.0` | If a message comes in, but part of the message is missing, this value will be used to keep the partial message fragment around while attempting to wait for the second (or subsequent) part(s) | diff --git a/rootfs/etc/s6-overlay/scripts/acars_router b/rootfs/etc/s6-overlay/scripts/acars_router index 1e42b918..e856e965 100755 --- a/rootfs/etc/s6-overlay/scripts/acars_router +++ b/rootfs/etc/s6-overlay/scripts/acars_router @@ -13,6 +13,10 @@ if [[ -n $AR_LISTEN_TCP_ACARS ]]; then AR_COMMAND+=("--listen-tcp-acars" "$AR_LISTEN_TCP_ACARS") fi +if [[ -n $AR_LISTEN_ZMQ_ACARS ]]; then + AR_COMMAND+=("--listen-zmq-acars" "$AR_LISTEN_ZMQ_ACARS") +fi + if [[ -n $AR_RECV_TCP_ACARS ]]; then AR_COMMAND+=("--receive-tcp-acars" "$AR_RECV_TCP_ACARS") fi @@ -31,6 +35,10 @@ if [[ -n $AR_LISTEN_TCP_VDLM2 ]]; then AR_COMMAND+=("--listen-tcp-vdlm2" "$AR_LISTEN_TCP_VDLM2") fi +if [[ -n $AR_LISTEN_ZMQ_VDLM2 ]]; then + AR_COMMAND+=("--listen-zmq-vdlm2" "$AR_LISTEN_ZMQ_VDLM2") +fi + if [[ -n $AR_RECV_TCP_VDLM2 ]]; then AR_COMMAND+=("--receive-tcp-vdlm2" "$AR_RECV_TCP_VDLM2") fi @@ -39,6 +47,28 @@ if [[ -n $AR_RECV_ZMQ_VDLM2 ]]; then AR_COMMAND+=("--receive-zmq-vdlm2" "$AR_RECV_ZMQ_VDLM2") fi +# HFDL input + +if [[ -n $AR_LISTEN_UDP_HFDL ]]; then + AR_COMMAND+=("--listen-udp-hfdl" "$AR_LISTEN_UDP_HFDL") +fi + +if [[ -n $AR_LISTEN_TCP_HFDL ]]; then + AR_COMMAND+=("--listen-tcp-hfdl" "$AR_LISTEN_TCP_HFDL") +fi + +if [[ -n $AR_LISTEN_ZMQ_HFDL ]]; then + AR_COMMAND+=("--listen-zmq-hfdl" "$AR_LISTEN_ZMQ_HFDL") +fi + +if [[ -n $AR_RECV_TCP_HFDL ]]; then + AR_COMMAND+=("--receive-tcp-hfdl" "$AR_RECV_TCP_HFDL") +fi + +if [[ -n $AR_RECV_ZMQ_HFDL ]]; then + AR_COMMAND+=("--receive-zmq-hfdl" "$AR_RECV_ZMQ_HFDL") +fi + # ACARS Output if [[ -n $AR_SEND_UDP_ACARS ]]; then @@ -75,4 +105,22 @@ if [[ -n $AR_SERVE_ZMQ_VDLM2 ]]; then AR_COMMAND+=("--serve-zmq-vdlm2" "$AR_SERVE_ZMQ_VDLM2") fi +# HFDL Output + +if [[ -n $AR_SEND_UDP_HFDL ]]; then + AR_COMMAND+=("--send-udp-hfdl" "$AR_SEND_UDP_HFDL") +fi + +if [[ -n $AR_SEND_TCP_HFDL ]]; then + AR_COMMAND+=("--send-tcp-hfdl" "$AR_SEND_TCP_HFDL") +fi + +if [[ -n $AR_SERVE_TCP_HFDL ]]; then + AR_COMMAND+=("--serve-tcp-hfdl" "$AR_SERVE_TCP_HFDL") +fi + +if [[ -n $AR_SERVE_ZMQ_HFDL ]]; then + AR_COMMAND+=("--serve-zmq-hfdl" "$AR_SERVE_ZMQ_HFDL") +fi + /opt/acars_router "${AR_COMMAND[@]}" diff --git a/rust/bin/acars_router/Cargo.toml b/rust/bin/acars_router/Cargo.toml index 5e42dafb..1c4dc6c0 100644 --- a/rust/bin/acars_router/Cargo.toml +++ b/rust/bin/acars_router/Cargo.toml @@ -14,10 +14,8 @@ rust-version.workspace = true [dependencies] log = "0.4.20" tokio = { version = "1.35.1", features = ["full", "tracing"] } -chrono = "0.4.31" -serde = { version = "1.0.193", features = ["derive"] } -serde_json = "1.0.109" -failure = "0.1.8" +serde = { version = "1.0.195", features = ["derive"] } +serde_json = "1.0.111" acars_config = { path = "../../libraries/acars_config" } -sdre-rust-logging = "0.2.0" +sdre-rust-logging = "0.2.1" acars_connection_manager = { path = "../../libraries/acars_connection_manager" } diff --git a/rust/bin/acars_router/src/main.rs b/rust/bin/acars_router/src/main.rs index f500b47c..e0ed6b9e 100644 --- a/rust/bin/acars_router/src/main.rs +++ b/rust/bin/acars_router/src/main.rs @@ -9,8 +9,6 @@ extern crate log; extern crate acars_config; extern crate acars_connection_manager; -extern crate chrono; -extern crate failure; extern crate sdre_rust_logging; extern crate serde; extern crate serde_json; diff --git a/rust/libraries/acars_config/Cargo.toml b/rust/libraries/acars_config/Cargo.toml index 6de305b0..070a2d32 100644 --- a/rust/libraries/acars_config/Cargo.toml +++ b/rust/libraries/acars_config/Cargo.toml @@ -6,6 +6,6 @@ edition.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -clap = { version = "4.4.12", features = ["derive", "env"] } +clap = { version = "4.4.13", features = ["derive", "env"] } log = "0.4.20" -sdre-rust-logging = "0.2.0" +sdre-rust-logging = "0.2.1" diff --git a/rust/libraries/acars_config/src/lib.rs b/rust/libraries/acars_config/src/lib.rs index 9163a74f..6b1b27ca 100644 --- a/rust/libraries/acars_config/src/lib.rs +++ b/rust/libraries/acars_config/src/lib.rs @@ -29,7 +29,7 @@ pub struct Input { #[clap(long, env = "AR_DEDUPE_WINDOW", value_parser, default_value = "2")] pub dedupe_window: u64, /// Reject messages with a timestamp greater than +/- this many seconds. - #[clap(long, env = "AR_SKEW_WINDOW", value_parser, default_value = "1")] + #[clap(long, env = "AR_SKEW_WINDOW", value_parser, default_value = "5")] pub skew_window: u64, /// Set maximum UDP packet size, peer-to-peer. #[clap( @@ -61,36 +61,77 @@ pub struct Input { default_value = "1.0" )] pub reassembly_window: f64, + // Input Options // ACARS + /// ACARS Router will listen for ACARS messages on the specified UDP ports. /// Semi-Colon separated list of arguments. ie 5550;5551;5552 #[clap(long, value_parser, value_delimiter = ';')] pub listen_udp_acars: Option>, + /// ACARS Router will listen for connections from a client for ACARS messages on the specified TCP ports. /// Semi-Colon separated list of arguments. ie 5550;5551;5552 #[clap(long, value_parser, value_delimiter = ';')] pub listen_tcp_acars: Option>, + /// ACARS Router will listen for connections from a client for ACARS messages on the specified ZMQ ports. + /// Semi-Colon separated list of arguments. ie 5550;5551;5552 + #[clap(long, value_parser, value_delimiter = ';')] + pub listen_zmq_acars: Option>, + /// ACARS Router will connect to the specified hosts for ACARS messages over TCP. /// Semi-Colon separated list of arguments. ie host:5550;host:5551;host:5552 #[clap(long, value_parser, value_delimiter = ';')] pub receive_tcp_acars: Option>, + /// ACARS Router will connect to the specified hosts for ACARS messages in ZMQ format. /// Semi-Colon separated list of arguments. io host:5550;host:5551;host:5552 #[clap(long, value_parser, value_delimiter = ';')] pub receive_zmq_acars: Option>, // VDLM2 + /// ACARS Router will listen for VDLM2 messages on the specified UDP ports. /// Semi-Colon separated list of arguments. ie 5555;5556;5557 #[clap(long, value_parser, value_delimiter = ';')] pub listen_udp_vdlm2: Option>, + /// ACARS Router will listen for connections from a client for VDLM2 messages on the specified TCP ports. /// Semi-Colon separated list of arguments. ie 5555;5556;5557 #[clap(long, value_parser, value_delimiter = ';')] pub listen_tcp_vdlm2: Option>, + #[clap(long, value_parser, value_delimiter = ';')] + /// ACARS Router will listen for connections from a client for VDLM2 messages on the specified ZMQ ports. + /// Semi-Colon separated list of arguments. ie 5555;5556;5557 + pub listen_zmq_vdlm2: Option>, + /// ACARS Router will connect to the specified hosts for VDLM2 messages over TCP. /// Semi-Colon separated list of arguments. ie host:5550;host:5551;host:5552 #[clap(long, value_parser, value_delimiter = ';')] pub receive_tcp_vdlm2: Option>, + /// ACARS Router will connect to the specified hosts for VDLM2 messages in ZMQ format. /// Semi-Colon separated list of arguments. ie host:5550;host:5551;host:5552 #[clap(long, value_parser, value_delimiter = ';')] pub receive_zmq_vdlm2: Option>, + + // HFDL + /// ACARS Router will listen for HFDL messages on the specified UDP ports. + /// Semi-Colon separated list of arguments. ie 5555;5556;5557 + #[clap(long, value_parser, value_delimiter = ';')] + pub listen_udp_hfdl: Option>, + /// ACARS Router will listen for connections from a client for HFDL messages on the specified TCP ports. + /// Semi-Colon separated list of arguments. ie 5555;5556;5557 + #[clap(long, value_parser, value_delimiter = ';')] + pub listen_tcp_hfdl: Option>, + /// ACARS Router will listen for connections from a client for HFDL messages on the specified ZMQ ports. + /// Semi-Colon separated list of arguments. ie 5555;5556;5557 + #[clap(long, value_parser, value_delimiter = ';')] + pub listen_zmq_hfdl: Option>, + /// ACARS Router will connect to the specified hosts for HFDL messages over TCP. + /// Semi-Colon separated list of arguments. ie host:5550;host:5551;host:5552 + #[clap(long, value_parser, value_delimiter = ';')] + pub receive_tcp_hfdl: Option>, + /// ACARS Router will connect to the specified hosts for HFDL messages in ZMQ format. + /// Semi-Colon separated list of arguments. ie host:5550;host:5551;host:5552 + #[clap(long, value_parser, value_delimiter = ';')] + pub receive_zmq_hfdl: Option>, + // JSON Output options + // ACARS /// Semi-Colon separated list of arguments. ie host:5550;host:5551;host:5552 #[clap(long, value_parser, value_delimiter = ';')] @@ -104,6 +145,7 @@ pub struct Input { /// Semi-Colon separated list of arguments. ie 5550;5551;5552 #[clap(long, value_parser, value_delimiter = ';')] pub serve_zmq_acars: Option>, + // VDLM /// Semi-Colon separated list of arguments. ie host:5555;host:5556;host:5557 #[clap(long, value_parser, value_delimiter = ';')] @@ -117,6 +159,20 @@ pub struct Input { /// Semi-Colon separated list of arguments. ie 5550;5551;5552 #[clap(long, value_parser, value_delimiter = ';')] pub serve_zmq_vdlm2: Option>, + + // HFDL + /// Semi-Colon separated list of arguments. ie host:5555;host:5556;host:5557 + #[clap(long, value_parser, value_delimiter = ';')] + pub send_udp_hfdl: Option>, + /// Semi-Colon separated list of arguments. ie host:5555;host:5556;host:5557 + #[clap(long, value_parser, value_delimiter = ';')] + pub send_tcp_hfdl: Option>, + /// Semi-Colon separated list of arguments. ie 5550;5551;5552 + #[clap(long, value_parser, value_delimiter = ';')] + pub serve_tcp_hfdl: Option>, + /// Semi-Colon separated list of arguments. ie 5550;5551;5552 + #[clap(long, value_parser, value_delimiter = ';')] + pub serve_zmq_hfdl: Option>, } impl Input { @@ -147,6 +203,18 @@ impl Input { debug!("AR_SERVE_ZMQ_VDLM2: {:?}", self.serve_zmq_vdlm2); debug!("AR_MAX_UDP_PACKET_SIZE: {:?}", self.max_udp_packet_size); debug!("AR_REASSEMBLY_WINDOW: {:?}", self.reassembly_window); + debug!("AR_STATS_VERBOSE: {:?}", self.stats_verbose); + debug!("AR_LISTEN_UDP_HFDL: {:?}", self.listen_udp_hfdl); + debug!("AR_LISTEN_TCP_HFDL: {:?}", self.listen_tcp_hfdl); + debug!("AR_RECV_TCP_HFDL: {:?}", self.receive_tcp_hfdl); + debug!("AR_RECV_ZMQ_HFDL: {:?}", self.receive_zmq_hfdl); + debug!("AR_SEND_UDP_HFDL: {:?}", self.send_udp_hfdl); + debug!("AR_SEND_TCP_HFDL: {:?}", self.send_tcp_hfdl); + debug!("AR_SERVE_TCP_HFDL: {:?}", self.serve_tcp_hfdl); + debug!("AR_SERVE_ZMQ_HFDL: {:?}", self.serve_zmq_hfdl); + debug!("AR_LISTEN_ZMQ_ACARS: {:?}", self.listen_zmq_acars); + debug!("AR_LISTEN_ZMQ_VDLM2: {:?}", self.listen_zmq_vdlm2); + debug!("AR_LISTEN_ZMQ_HFDL: {:?}", self.listen_zmq_hfdl); } pub fn acars_configured(&self) -> bool { @@ -170,4 +238,15 @@ impl Input { || self.serve_tcp_vdlm2.is_some() || self.serve_zmq_vdlm2.is_some() } + + pub fn hfdl_configured(&self) -> bool { + self.receive_tcp_hfdl.is_some() + || self.listen_udp_hfdl.is_some() + || self.listen_tcp_hfdl.is_some() + || self.receive_zmq_hfdl.is_some() + || self.send_udp_hfdl.is_some() + || self.send_tcp_hfdl.is_some() + || self.serve_tcp_hfdl.is_some() + || self.serve_zmq_hfdl.is_some() + } } diff --git a/rust/libraries/acars_connection_manager/Cargo.toml b/rust/libraries/acars_connection_manager/Cargo.toml index cefd8355..fc0ae828 100644 --- a/rust/libraries/acars_connection_manager/Cargo.toml +++ b/rust/libraries/acars_connection_manager/Cargo.toml @@ -6,14 +6,16 @@ edition.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -sdre-stubborn-io = "0.4.4" +sdre-stubborn-io = "0.5.1" +#sdre-stubborn-io = "0.4.4" log = "0.4.20" tokio = { version = "1.35.1", features = ["full", "tracing"] } tokio-util = { version = "0.7.10", features = ["full"] } tokio-stream = "0.1.14" futures = "0.3.30" -async-trait = "0.1.76" +async-trait = "0.1.77" zmq = "0.10.0" tmq = "0.4.0" -acars_vdlm2_parser = { git = "https://github.com/jcdeimos/acars_vdlm2_parser", version = "0.2.1" } +#acars_vdlm2_parser = { git = "https://github.com/jcdeimos/acars_vdlm2_parser", version = "0.2.1" } +acars_vdlm2_parser = { git = "https://github.com/fredclausen/acars_vdlm2_parser", branch = "hfdl-and-dependency-updates" } acars_config = { path = "../acars_config" } diff --git a/rust/libraries/acars_connection_manager/src/lib.rs b/rust/libraries/acars_connection_manager/src/lib.rs index 841d24d5..605b6fc9 100644 --- a/rust/libraries/acars_connection_manager/src/lib.rs +++ b/rust/libraries/acars_connection_manager/src/lib.rs @@ -69,6 +69,7 @@ pub(crate) enum SocketType { pub(crate) enum ServerType { Acars, Vdlm2, + Hfdl, } #[derive(Debug, Clone, Default)] @@ -84,6 +85,7 @@ pub(crate) struct SenderServerConfig { pub(crate) struct OutputServerConfig { pub(crate) listen_udp: Option>, pub(crate) listen_tcp: Option>, + pub(crate) listen_zmq: Option>, pub(crate) receive_tcp: Option>, pub(crate) receive_zmq: Option>, pub(crate) reassembly_window: f64, @@ -137,6 +139,7 @@ impl fmt::Display for ServerType { match self { ServerType::Acars => write!(f, "ACARS"), ServerType::Vdlm2 => write!(f, "VDLM"), + ServerType::Hfdl => write!(f, "HFDL"), } } } diff --git a/rust/libraries/acars_connection_manager/src/message_handler.rs b/rust/libraries/acars_connection_manager/src/message_handler.rs index 54b8e150..f3211058 100644 --- a/rust/libraries/acars_connection_manager/src/message_handler.rs +++ b/rust/libraries/acars_connection_manager/src/message_handler.rs @@ -189,6 +189,27 @@ impl MessageHandlerConfig { } } + if !found { + let new_frequency: FrequencyCount = FrequencyCount { + freq: frequency, + count: 1, + }; + all_frequencies_logged.lock().await.push(new_frequency); + } + } + AcarsVdlm2Message::HfdlMessage(m) => { + // get the freq from HfdlMessage::HfdlBody + let frequency: String = m.hfdl.freq.to_string(); + + let mut found: bool = false; + for freq in all_frequencies_logged.lock().await.iter_mut() { + if freq.freq == frequency { + freq.count += 1; + found = true; + break; + } + } + if !found { let new_frequency: FrequencyCount = FrequencyCount { freq: frequency, diff --git a/rust/libraries/acars_connection_manager/src/packet_handler.rs b/rust/libraries/acars_connection_manager/src/packet_handler.rs index 588068c7..980758aa 100644 --- a/rust/libraries/acars_connection_manager/src/packet_handler.rs +++ b/rust/libraries/acars_connection_manager/src/packet_handler.rs @@ -16,6 +16,7 @@ use tokio::sync::Mutex; pub struct PacketHandler { name: String, + listener_type: String, // Hashmap key is peer, stores a tuple of time and message queue: Arc>>, reassembly_window: f64, @@ -43,7 +44,10 @@ impl ProcessAssembly for Option { Some(reassembled_msg) => { let parsed_msg: MessageResult = reassembled_msg.to_string_newline(); match parsed_msg { - Err(parse_error) => error!("{}", parse_error), + Err(parse_error) => error!( + "[{} Listener Server: {}] {}", + listener_type, proto_name, parse_error + ), Ok(msg) => { trace!( "[{} Listener SERVER: {}] Received message: {:?}", @@ -74,10 +78,11 @@ impl ProcessAssembly for Option { } impl PacketHandler { - pub fn new(name: &str, reassembly_window: f64) -> PacketHandler { + pub fn new(name: &str, listener_type: &str, reassembly_window: f64) -> PacketHandler { PacketHandler { name: name.to_string(), queue: Arc::new(Mutex::new(HashMap::new())), + listener_type: listener_type.to_string(), reassembly_window, } } @@ -108,8 +113,8 @@ impl PacketHandler { if self.queue.lock().await.contains_key(&peer) { info!( - "[UDP SERVER: {}] Message received from {} is being reassembled", - self.name, peer + "[{} SERVER: {}] Message received from {} is being reassembled", + self.listener_type, self.name, peer ); let (time, message_to_test) = self.queue.lock().await.get(&peer).unwrap().clone(); old_time = Some(time); // We have a good peer, save the time @@ -118,8 +123,8 @@ impl PacketHandler { Err(e) => info!("{e}"), Ok(msg_deserialized) => { info!( - "[UDP SERVER: {}] Reassembled a message from peer {}", - self.name, peer + "[{} SERVER: {}] Reassembled a message from peer {}", + self.listener_type, self.name, peer ); // The default skew_window and are the same (1 second, but it doesn't matter) // So we shouldn't see any weird issues where the message is reassembled @@ -170,7 +175,10 @@ impl PacketHandler { }; if current_time == 0.0 { - error!("[UDP SERVER: {}] Error getting current time", self.name); + error!( + "[{} SERVER: {}] Error getting current time", + self.listener_type, self.name + ); return; } @@ -178,10 +186,10 @@ impl PacketHandler { let (time, _) = old_messages; let time_diff: f64 = current_time - *time; if time_diff > self.reassembly_window { - debug!("[UDP SERVER {}] Peer {peer} has been idle for {time_diff} seconds, removing from queue", self.name); + debug!("[{} SERVER {}] Peer {peer} has been idle for {time_diff} seconds, removing from queue", self.listener_type, self.name); false } else { - debug!("[UDP SERVER {}] Peer {peer} has been idle for {time_diff} seconds, keeping in queue", self.name); + debug!("[{} SERVER {}] Peer {peer} has been idle for {time_diff} seconds, keeping in queue", self.listener_type, self.name); true } }); diff --git a/rust/libraries/acars_connection_manager/src/service_init.rs b/rust/libraries/acars_connection_manager/src/service_init.rs index 9fa9431d..62b6be83 100644 --- a/rust/libraries/acars_connection_manager/src/service_init.rs +++ b/rust/libraries/acars_connection_manager/src/service_init.rs @@ -9,7 +9,7 @@ use crate::message_handler::MessageHandlerConfig; use crate::packet_handler::{PacketHandler, ProcessAssembly}; use crate::tcp_services::{TCPListenerServer, TCPReceiverServer, TCPServeServer}; use crate::udp_services::{UDPListenerServer, UDPSenderServer}; -use crate::zmq_services::ZMQListnerServer; +use crate::zmq_services::{ZMQListenerServer, ZMQReceiverServer}; use crate::{ reconnect_options, OutputServerConfig, SenderServer, SenderServerConfig, ServerType, Shared, SocketListenerServer, SocketType, @@ -33,6 +33,16 @@ use tokio::time::{sleep, Duration}; use tokio_stream::StreamExt; use tokio_util::codec::{Framed, LinesCodec}; +/// Nomenclature used in the code: +/// Input: +/// Receiver: ACARS router will connect out to a remote host and receive data from it. (TCP/ZMQ) +/// Listener: ACARS router will listen on a port for incoming data or incoming connection +/// based on socket type (TCP/UDP/ZMQ) +/// Output: +/// Sender: ACARS router will connect out to a remote host and send data to it. (TCP/ZMQ) +/// Server: ACARS router will send data to a remote host (UDP) or listen for incoming connection (TCP/ZMQ) +/// and send data to it. + pub async fn start_processes(args: Input) { args.print_values(); @@ -40,6 +50,8 @@ pub async fn start_processes(args: Input) { MessageHandlerConfig::new(&args, "ACARS"); let message_handler_config_vdlm: MessageHandlerConfig = MessageHandlerConfig::new(&args, "VDLM"); + let message_handler_config_hfdl: MessageHandlerConfig = + MessageHandlerConfig::new(&args, "HFDL"); // ACARS Servers // Create the input channel all receivers will send their data to. @@ -54,6 +66,11 @@ pub async fn start_processes(args: Input) { let (tx_receivers_vdlm, rx_receivers_vdlm) = mpsc::channel(32); // Create the input channel processed messages will be sent to let (tx_processed_vdlm, rx_processed_vdlm) = mpsc::channel(32); + // HFDL + // Create the input channel all receivers will send their data to. + let (tx_receivers_hfdl, rx_receivers_hfdl) = mpsc::channel(32); + // Create the input channel processed messages will be sent to + let (tx_processed_hfdl, rx_processed_hfdl) = mpsc::channel(32); // start the input servers debug!("Starting input servers"); @@ -62,6 +79,7 @@ pub async fn start_processes(args: Input) { let acars_input_config: OutputServerConfig = OutputServerConfig::new( &args.listen_udp_acars, &args.listen_tcp_acars, + &args.listen_zmq_acars, &args.receive_tcp_acars, &args.receive_zmq_acars, &args.reassembly_window, @@ -74,6 +92,7 @@ pub async fn start_processes(args: Input) { let vdlm_input_config: OutputServerConfig = OutputServerConfig::new( &args.listen_udp_vdlm2, &args.listen_tcp_vdlm2, + &args.listen_zmq_vdlm2, &args.receive_tcp_vdlm2, &args.receive_zmq_vdlm2, &args.reassembly_window, @@ -83,6 +102,20 @@ pub async fn start_processes(args: Input) { vdlm_input_config.start_listeners(tx_receivers_vdlm); }); + let hfdl_input_config: OutputServerConfig = OutputServerConfig::new( + &args.listen_udp_hfdl, + &args.listen_tcp_hfdl, + &args.listen_zmq_hfdl, + &args.receive_tcp_hfdl, + &args.receive_zmq_hfdl, + &args.reassembly_window, + ServerType::Hfdl, + ); + + tokio::spawn(async move { + hfdl_input_config.start_listeners(tx_receivers_hfdl); + }); + // start the output servers debug!("Starting output servers"); @@ -116,6 +149,21 @@ pub async fn start_processes(args: Input) { .await; }); + info!("Starting HFDL Output Servers"); + let hfdl_output_config: SenderServerConfig = SenderServerConfig::new( + &args.send_udp_hfdl, + &args.send_tcp_hfdl, + &args.serve_tcp_hfdl, + &args.serve_zmq_hfdl, + &args.max_udp_packet_size, + ); + + tokio::spawn(async move { + hfdl_output_config + .start_senders(rx_processed_hfdl, "HFDL") + .await; + }); + // Start the message handler tasks. // Don't start the queue watcher UNLESS there is a valid input source AND output source for the message type @@ -143,6 +191,18 @@ pub async fn start_processes(args: Input) { ); } + if args.hfdl_configured() { + tokio::spawn(async move { + message_handler_config_hfdl + .watch_message_queue(rx_receivers_hfdl, tx_processed_hfdl) + .await; + }); + } else { + info!( + "Not starting the HFDL message handler task. No input and/or output sources specified." + ); + } + trace!("Starting the sleep loop"); loop { @@ -154,6 +214,7 @@ impl OutputServerConfig { fn new( listen_udp: &Option>, listen_tcp: &Option>, + listen_zmq: &Option>, receive_tcp: &Option>, receive_zmq: &Option>, reassembly_window: &f64, @@ -162,6 +223,7 @@ impl OutputServerConfig { Self { listen_udp: listen_udp.clone(), listen_tcp: listen_tcp.clone(), + listen_zmq: listen_zmq.clone(), receive_tcp: receive_tcp.clone(), receive_zmq: receive_zmq.clone(), reassembly_window: *reassembly_window, @@ -201,6 +263,17 @@ impl OutputServerConfig { ); } + if let Some(listen_zmq) = self.listen_zmq { + // Start the ZMQ listener servers for server_type + info!( + "Starting ZMQ listener servers for {}", + &self.output_server_type.to_string() + ); + + listen_zmq + .zmq_port_listener(&self.output_server_type.to_string(), tx_receivers.clone()); + } + // Start the ZMQ listeners if let Some(receive_zmq) = self.receive_zmq { @@ -249,6 +322,7 @@ trait StartPortListener { channel: Sender, reassembly_window: &f64, ); + fn zmq_port_listener(self, decoder_type: &str, channel: Sender); } impl StartHostListeners for Vec { @@ -258,7 +332,7 @@ impl StartHostListeners for Vec { let proto_name: String = format!("{}_ZMQ_RECEIVER_{}", decoder_type, host); tokio::spawn(async move { - let zmq_listener_server = ZMQListnerServer { + let zmq_listener_server = ZMQReceiverServer { host: host.to_string(), proto_name: proto_name.to_string(), }; @@ -325,6 +399,17 @@ impl StartPortListener for Vec { tokio::spawn(async move { server.run(&server_udp_port, new_channel).await }); } } + + fn zmq_port_listener(self, decoder_type: &str, channel: Sender) { + for zmq_port in self { + let new_channel: Sender = channel.clone(); + let server_zmq_port: String = zmq_port.to_string(); + let proto_name: String = format!("{}_ZMQ_LISTEN_{}", decoder_type, &server_zmq_port); + let server: ZMQListenerServer = ZMQListenerServer::new(&proto_name); + debug!("Starting {decoder_type} ZMQ server on {server_zmq_port}"); + tokio::spawn(async move { server.run(server_zmq_port, new_channel).await }); + } + } } impl SenderServerConfig { @@ -559,8 +644,11 @@ impl SocketListenerServer { BufReader>, LinesCodec, > = Framed::new(reader, LinesCodec::new()); - let packet_handler: PacketHandler = - PacketHandler::new(&self.proto_name, self.reassembly_window); + let packet_handler: PacketHandler = PacketHandler::new( + &self.proto_name, + "TCP", + self.reassembly_window, + ); while let Some(Ok(line)) = lines.next().await { let split_messages_by_newline: Vec<&str> = line.split_terminator('\n').collect(); @@ -667,8 +755,11 @@ impl SocketListenerServer { self.proto_name, socket.local_addr()? ); - let packet_handler: PacketHandler = - PacketHandler::new(&self.proto_name, self.reassembly_window); + let packet_handler: PacketHandler = PacketHandler::new( + &self.proto_name, + "UDP", + self.reassembly_window, + ); loop { if let Some((size, peer)) = to_send { let msg_string = match std::str::from_utf8( diff --git a/rust/libraries/acars_connection_manager/src/tcp_services.rs b/rust/libraries/acars_connection_manager/src/tcp_services.rs index 47fdb040..ab77ff8f 100644 --- a/rust/libraries/acars_connection_manager/src/tcp_services.rs +++ b/rust/libraries/acars_connection_manager/src/tcp_services.rs @@ -25,11 +25,15 @@ use tokio_util::codec::{Framed, LinesCodec}; use crate::packet_handler::{PacketHandler, ProcessAssembly}; use crate::{reconnect_options, Rx, SenderServer, Shared}; +/// TCP Listener server. This is used to listen for incoming TCP connections and process them. +/// Used for incoming TCP data for ACARS Router to process pub(crate) struct TCPListenerServer { pub(crate) proto_name: String, pub(crate) reassembly_window: f64, } +/// TCP Listener server. This is used to listen for incoming TCP connections and process them. +/// Used for incoming TCP data for ACARS Router to process impl TCPListenerServer { pub(crate) fn new(proto_name: &str, reassembly_window: &f64) -> Self { Self { @@ -90,6 +94,8 @@ impl TCPListenerServer { } } +/// This function is used to process the TCP socket. It will read the socket and send the messages to the channel. +/// Used for incoming TCP data for ACARS Router to process async fn process_tcp_sockets( stream: TcpStream, proto_name: &str, @@ -99,7 +105,7 @@ async fn process_tcp_sockets( ) -> Result<(), Box> { let mut lines = Framed::new(stream, LinesCodec::new_with_max_length(8000)); - let packet_handler = PacketHandler::new(proto_name, reassembly_window); + let packet_handler = PacketHandler::new(proto_name, "TCP", reassembly_window); while let Some(Ok(line)) = lines.next().await { let split_messages_by_newline: Vec<&str> = line.split_terminator('\n').collect(); @@ -151,12 +157,16 @@ async fn process_tcp_sockets( Ok(()) } +/// TCP Receiver server. This is used to connect to a remote TCP server and process the messages. +/// Used for incoming TCP data for ACARS Router to process pub struct TCPReceiverServer { pub host: String, pub proto_name: String, pub reassembly_window: f64, } +/// TCP Receiver server. This is used to connect to a remote TCP server and process the messages. +/// Used for incoming TCP data for ACARS Router to process impl TCPReceiverServer { pub(crate) fn new(server_host: &str, proto_name: &str, reassembly_window: f64) -> Self { Self { @@ -200,7 +210,7 @@ impl TCPReceiverServer { let reader = tokio::io::BufReader::new(stream); let mut lines = Framed::new(reader, LinesCodec::new()); - let packet_handler = PacketHandler::new(&self.proto_name, self.reassembly_window); + let packet_handler = PacketHandler::new(&self.proto_name, "TCP", self.reassembly_window); while let Some(Ok(line)) = lines.next().await { // Clean up the line endings. This is probably unnecessary but it's here for safety. @@ -272,6 +282,8 @@ impl TCPReceiverServer { } } +/// TCP Sender server. This is used to connect to a remote TCP server and send the messages. +/// Used for outgoing TCP data for ACARS Router to a client impl SenderServer> { pub async fn send_message(mut self) { tokio::spawn(async move { @@ -294,6 +306,8 @@ impl SenderServer> { } } +/// TCP Serve Server. This is used to listen for incoming TCP connections and process them. +/// Used for outgoing TCP data for ACARS Router to a client pub struct TCPServeServer { pub socket: TcpListener, pub proto_name: String, @@ -351,6 +365,8 @@ impl Peer { } } +/// TCP Serve Server. This is used to listen for incoming TCP connections and process them. +/// Used for outgoing TCP data for ACARS Router to a client impl TCPServeServer { pub(crate) fn new(socket: TcpListener, proto_name: &str) -> Self { Self { diff --git a/rust/libraries/acars_connection_manager/src/udp_services.rs b/rust/libraries/acars_connection_manager/src/udp_services.rs index c1a25c6f..858689d4 100644 --- a/rust/libraries/acars_connection_manager/src/udp_services.rs +++ b/rust/libraries/acars_connection_manager/src/udp_services.rs @@ -15,12 +15,16 @@ use tokio::net::UdpSocket; use tokio::sync::mpsc::{Receiver, Sender}; use tokio::time::{sleep, Duration}; +/// UDPListenerServer is a struct that contains the configuration for a UDP server +/// that will listen for incoming UDP packets and process them #[derive(Debug, Clone)] pub(crate) struct UDPListenerServer { pub(crate) proto_name: String, pub(crate) reassembly_window: f64, } +/// UDPSenderServer is a struct that contains the configuration for a UDP server +/// that will send out UDP packets #[derive(Debug)] pub(crate) struct UDPSenderServer { pub(crate) host: Vec, @@ -30,6 +34,8 @@ pub(crate) struct UDPSenderServer { pub(crate) channel: Receiver, } +/// UDPListenerServer is a struct that contains the configuration for a UDP server +/// that will listen for incoming UDP packets and process them impl UDPListenerServer { pub(crate) fn new(proto_name: &str, reassembly_window: &f64) -> Self { Self { @@ -61,7 +67,7 @@ impl UDPListenerServer { ); let packet_handler: PacketHandler = - PacketHandler::new(&self.proto_name, self.reassembly_window); + PacketHandler::new(&self.proto_name, "UDP", self.reassembly_window); loop { if let Some((size, peer)) = to_send { @@ -131,6 +137,8 @@ impl UDPListenerServer { } } +/// UDPSenderServer is a struct that contains the configuration for a UDP server +/// that will send out UDP packets impl UDPSenderServer { pub(crate) fn new( send_udp: &[String], diff --git a/rust/libraries/acars_connection_manager/src/zmq_services.rs b/rust/libraries/acars_connection_manager/src/zmq_services.rs index cfd3785d..81a2997f 100644 --- a/rust/libraries/acars_connection_manager/src/zmq_services.rs +++ b/rust/libraries/acars_connection_manager/src/zmq_services.rs @@ -5,7 +5,7 @@ // Full license information available in the project LICENSE file. // -// NOTE: This is a listener. WE **SUB** to a *PUB* socket. +// NOTE: WE **SUB** to a *PUB* socket. use crate::SenderServer; use acars_vdlm2_parser::AcarsVdlm2Message; @@ -15,14 +15,18 @@ use tmq::publish::Publish; use tmq::{subscribe, Context, Result}; use tokio::sync::mpsc::{Receiver, Sender}; -pub struct ZMQListnerServer { +/// ZMQ Receiver server. This is used to connect to a remote ZMQ server and process the messages. +/// Used for incoming ZMQ data for ACARS Router to process +pub struct ZMQReceiverServer { pub host: String, pub proto_name: String, } -impl ZMQListnerServer { +/// ZMQ Receiver server. This is used to connect to a remote ZMQ server and process the messages. +/// Used for incoming ZMQ data for ACARS Router to process +impl ZMQReceiverServer { pub async fn run(self, channel: Sender) -> Result<()> { - debug!("[ZMQ LISTENER SERVER {}] Starting", self.proto_name); + debug!("[ZMQ RECEIVER SERVER {}] Starting", self.proto_name); let address = format!("tcp://{}", self.host); let mut socket = subscribe(&Context::new()) .connect(&address)? @@ -32,7 +36,7 @@ impl ZMQListnerServer { let message = match msg { Ok(message) => message, Err(e) => { - error!("[ZMQ LISTENER SERVER {}] Error: {:?}", self.proto_name, e); + error!("[ZMQ RECEIVER SERVER {}] Error: {:?}", self.proto_name, e); continue; } }; @@ -43,7 +47,7 @@ impl ZMQListnerServer { .collect::>() .join(" "); trace!( - "[ZMQ LISTENER SERVER {}] Received: {}", + "[ZMQ RECEIVER SERVER {}] Received: {}", self.proto_name, composed_message ); @@ -54,11 +58,11 @@ impl ZMQListnerServer { match channel.send(stripped.to_string()).await { Ok(_) => trace!( - "[ZMQ LISTENER SERVER {}] Message sent to channel", + "[ZMQ RECEIVER SERVER {}] Message sent to channel", self.proto_name ), Err(e) => error!( - "[ZMQ LISTENER SERVER {}] Error sending message to channel: {}", + "[ZMQ RECEIVER SERVER {}] Error sending message to channel: {}", self.proto_name, e ), } @@ -67,6 +71,66 @@ impl ZMQListnerServer { } } +/// ZMQ Listener server. This is used to listen for incoming ZMQ data for ACARS Router to process +/// Used for incoming ZMQ data for ACARS Router to process +pub struct ZMQListenerServer { + pub(crate) proto_name: String, +} + +/// ZMQ Listener server. This is used to listen for incoming ZMQ data for ACARS Router to process +/// Used for incoming ZMQ data for ACARS Router to process +impl ZMQListenerServer { + pub fn new(proto_name: &str) -> Self { + Self { + proto_name: proto_name.to_string(), + } + } + pub async fn run(self, listen_acars_zmq_port: String, channel: Sender) -> Result<()> { + debug!("[ZMQ LISTENER SERVER {}] Starting", self.proto_name); + let address = format!("tcp://0.0.0.0:{}", listen_acars_zmq_port); + debug!( + "[ZMQ LISTENER SERVER {}] Listening on {}", + self.proto_name, address + ); + let mut socket = subscribe(&Context::new()).bind(&address)?.subscribe(b"")?; + + while let Some(msg) = socket.next().await { + match msg { + Ok(message) => { + for item in message { + let composed_message = item + .as_str() + .unwrap_or("invalid text") + .strip_suffix("\r\n") + .or_else(|| item.as_str().unwrap_or("invalid text").strip_suffix('\n')) + .unwrap_or(item.as_str().unwrap_or("invalid text")); + trace!( + "[ZMQ LISTENER SERVER {}] Received: {}", + self.proto_name, + composed_message + ); + match channel.send(composed_message.to_string()).await { + Ok(_) => trace!( + "[ZMQ LISTENER SERVER {}] Message sent to channel", + self.proto_name + ), + Err(e) => error!( + "[ZMQ LISTENER SERVER {}] Error sending message to channel: {}", + self.proto_name, e + ), + } + } + } + Err(e) => error!("[ZMQ LISTENER SERVER {}] Error: {:?}", self.proto_name, e), + } + } + + Ok(()) + } +} + +/// ZMQ Sender server. This is used to send messages to a remote ZMQ server. +/// Used for outgoing ZMQ data for ACARS Router to process impl SenderServer { pub(crate) fn new( server_address: &str, @@ -95,7 +159,7 @@ impl SenderServer { // if they aren't sub'd to the topic we're broadcasting on. This should fix the issue with moronic (hello node) // zmq implementations not getting the message if the topic is blank. // TODO: verify this doesn't break other kinds of zmq implementations....Like perhaps acars_router itself? - Ok(payload) => match self.socket.send(vec!["acars", &payload]).await { + Ok(payload) => match self.socket.send(vec![&payload]).await { Ok(_) => (), Err(e) => error!( "[ZMQ SENDER]: Error sending message on 'acars' topic: {:?}",