diff --git a/.cargo/config b/.cargo/config index ac2b23f..2282ebe 100644 --- a/.cargo/config +++ b/.cargo/config @@ -1,2 +1,12 @@ [target.x86_64-pc-windows-msvc] rustflags = ["-C", "target-feature=+crt-static"] + +# TODO not good as a default +[target.armv7-unknown-linux-gnueabihf] +linker = "arm-linux-gnueabihf-gcc" + +[target.aarch64-unknown-linux-gnu] +linker = "aarch64-linux-gnu-gcc" + +[target.i686-unknown-linux-gnu] +linker = "i686-linux-gnu-gcc" diff --git a/.github/workflows/armhf.yml b/.github/workflows/armhf.yml deleted file mode 100644 index 9df0098..0000000 --- a/.github/workflows/armhf.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Build ARMHF - -on: [push, pull_request] - -jobs: - armhfbuild: - name: build-armhf - runs-on: ubuntu-latest - container: node:current-buster-slim - steps: - - uses: actions/checkout@v2 - - name: Install basic tools - run: | - apt-get update - apt-get install --assume-yes --no-install-recommends sudo curl ca-certificates build-essential - - name: Add armhf as a foreign architecture - run: | - sudo dpkg --add-architecture armhf - - name: Install cross compile tools - run: | - sudo apt-get update - sudo apt-get install --assume-yes --no-install-recommends gcc-arm-linux-gnueabihf - - name: Install armhf gstreamer - run: | - sudo apt-get update - sudo apt-get install --assume-yes --no-install-recommends \ - libgstrtspserver-1.0-dev:armhf \ - libgstreamer1.0-dev:armhf \ - libgtk2.0-dev:armhf - - name: Install rustup armv7 - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - target: armv7-unknown-linux-gnueabihf - - name: Build armfh - uses: actions-rs/cargo@v1 - with: - command: build - args: --release --all-features --target=armv7-unknown-linux-gnueabihf - env: - CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc - CC_armv7_unknown_linux_gnueabihf: arm-linux-gnueabihf-gcc - CXX_armv7_unknown_linux_gnueabihf: arm-linux-gnueabihf-g++ - PKG_CONFIG_ALLOW_CROSS: 1 - PKG_CONFIG_PATH: /usr/lib/arm-linux-gnueabihf/pkgconfig:/usr/share/pkgconfig/ - PKG_CONFIG_LIBDIR: /usr/lib/arm-linux-gnueabihf/pkgconfig:/usr/share/pkgconfig/ - - uses: actions/upload-artifact@v2 - with: - name: release-armhf - path: "target/armv7-unknown-linux-gnueabihf/release/neolink*" diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml deleted file mode 100644 index fa00f76..0000000 --- a/.github/workflows/build.yaml +++ /dev/null @@ -1,49 +0,0 @@ -name: CI - -on: [push, pull_request] - -jobs: - ubuntu: - name: build - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-18.04, windows-2019] - steps: - - uses: actions/checkout@v2 - - if: runner.os == 'Linux' - name: apt install gstreamer - run: | - sudo apt update - sudo apt install -y libgstrtspserver-1.0-dev libgstreamer1.0-dev libgtk2.0-dev - - if: runner.os == 'Windows' - name: Install Gstreamer - run: | - choco install -y --no-progress gstreamer --version=1.16.2.20200527 - choco install -y --no-progress gstreamer-devel --version=1.16.2 - echo "Updating Cargo environment" - echo "C:\gstreamer\1.0\x86_64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - echo "GSTREAMER_1_0_ROOT_X86_64=C:\gstreamer\1.0\x86_64\" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - - name: Cache cargo registry - uses: actions/cache@v1 - with: - path: ~/.cargo/registry - key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - - name: Cache cargo index - uses: actions/cache@v1 - with: - path: ~/.cargo/git - key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} - - name: Cache cargo build - uses: actions/cache@v1 - with: - path: target - key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} - - uses: actions-rs/cargo@v1 - with: - command: build - args: --release --all-features - - uses: actions/upload-artifact@v2 - with: - name: release-${{ matrix.os }} - path: "target/release/neolink*" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..8fcf811 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,120 @@ +name: CI + +on: [push, pull_request] + +jobs: + native: + name: build + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-18.04, windows-2019, macos-10.15] + steps: + - uses: actions/checkout@v2 + name: Checkout onto ${{ runner.os }} + - if: runner.os == 'Linux' + name: apt install gstreamer + run: | + sudo apt update + sudo apt install -y libgstrtspserver-1.0-dev libgstreamer1.0-dev libgtk2.0-dev + - if: runner.os == 'Windows' + name: Install Gstreamer + run: | + choco install -y --no-progress gstreamer --version=1.16.2.20200527 + choco install -y --no-progress gstreamer-devel --version=1.16.2 + echo "Updating Cargo environment" + echo "C:\gstreamer\1.0\x86_64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + echo "GSTREAMER_1_0_ROOT_X86_64=C:\gstreamer\1.0\x86_64\" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + - if: runner.os == 'macOS' + name: Install Gstreamer on macOS + run: | + curl -L 'https://gstreamer.freedesktop.org/data/pkg/osx/1.16.2/gstreamer-1.0-devel-1.16.2-x86_64.pkg' -o "$(pwd)/gstreamer-devel.pkg" + sudo installer -verbose -pkg "$(pwd)/gstreamer-devel.pkg" -target / + PKG_CONFIG_PATH="/Library/Frameworks/GStreamer.framework/Versions/1.0/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" + echo "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}" >> "${GITHUB_ENV}" + - name: Cache cargo registry + uses: actions/cache@v1 + with: + path: ~/.cargo/registry + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + - name: Cache cargo index + uses: actions/cache@v1 + with: + path: ~/.cargo/git + key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} + - name: Cache cargo build + if: runner.os != 'macOS' # Random missing crates on macOS, unclear why + uses: actions/cache@v1 + with: + path: target + key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} + - uses: actions-rs/cargo@v1 + with: + command: build + args: --release --all-features + - uses: actions/upload-artifact@v2 + with: + name: release-${{ matrix.os }} + path: "target/release/neolink*" + cross: + name: cross + runs-on: ubuntu-latest + container: "node:current-buster-slim" + strategy: + fail-fast: false + matrix: + # Everyone has a slightly different screwball naming scheme; + # Rust uses the target triple, GCC generally targets a family + # with a specific prefix, and dpkg's arch does its own thing + include: + - arch: armhf + target: armv7-unknown-linux-gnueabihf + gcc: arm-linux-gnueabihf + pkgconfig: arm-linux-gnueabihf + - arch: arm64 + target: aarch64-unknown-linux-gnu + gcc: aarch64-linux-gnu + pkgconfig: aarch64-linux-gnu + - arch: i386 + target: i686-unknown-linux-gnu + gcc: i686-linux-gnu + # on i686, the pkgconfig path doesn't match the prefix! + pkgconfig: i386-linux-gnu + steps: + - uses: actions/checkout@v2 + - name: Install basic tools + run: | + apt-get update + apt-get install --assume-yes --no-install-recommends curl ca-certificates + - name: Install ${{ matrix.arch }} cross compiler and gstreamer + id: setup + run: | + dpkg --add-architecture ${{ matrix.arch }} + apt-get update + apt-get install --assume-yes --no-install-recommends \ + build-essential \ + gcc-${{ matrix.gcc }} \ + libgstrtspserver-1.0-dev:${{ matrix.arch }} \ + libgstreamer1.0-dev:${{ matrix.arch }} \ + libgtk2.0-dev:${{ matrix.arch }} \ + libglib2.0-dev:${{ matrix.arch }} + - name: Install ${{ matrix.arch }} Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + target: ${{ matrix.target }} + profile: minimal + - name: Build + uses: actions-rs/cargo@v1 + with: + command: build + args: --release --all-features --target=${{ matrix.target }} + env: + # Retarget pkg-config as described in https://www.freedesktop.org/wiki/Software/pkg-config/CrossCompileProposal/ + PKG_CONFIG_ALLOW_CROSS: 1 + PKG_CONFIG_LIBDIR: /usr/lib/${{ matrix.pkgconfig }}/pkgconfig + - uses: actions/upload-artifact@v2 + with: + name: release-${{ matrix.arch }}-buster + path: "target/${{ matrix.target }}/release/neolink*" diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yml similarity index 100% rename from .github/workflows/docker.yaml rename to .github/workflows/docker.yml diff --git a/.github/workflows/style_checks.yaml b/.github/workflows/style_checks.yml similarity index 100% rename from .github/workflows/style_checks.yaml rename to .github/workflows/style_checks.yml diff --git a/Cargo.lock b/Cargo.lock index 64d5001..de5cfa3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -344,9 +344,9 @@ dependencies = [ [[package]] name = "glib" -version = "0.10.1" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e0533f48640d86e8e2f3cee778a9f97588d4a0bec8be065ee51ea52346d6c1" +checksum = "0c685013b7515e668f1b57a165b009d4d28cb139a8a989bbd699c10dad29d0c5" dependencies = [ "bitflags", "futures-channel", diff --git a/Cargo.toml b/Cargo.toml index a9acc5f..6c80ef6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ cookie-factory = "0.3" crossbeam = "0.7" env_logger = "*" err-derive = "0.2" -glib = "*" +glib = ">=0.10.3" gio = "0.9" gstreamer = "0.16" gstreamer-app = "0.16" diff --git a/Dockerfile b/Dockerfile index e59a34a..2ff879a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,11 @@ FROM docker.io/rust:1-alpine AS build MAINTAINER thirtythreeforty@gmail.com -RUN apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing \ +# Until Alpine merges gst-rtsp-server into a release, pull all Gstreamer packages +# from the "testing" release +RUN apk add --no-cache \ + -X http://dl-cdn.alpinelinux.org/alpine/edge/main \ + -X http://dl-cdn.alpinelinux.org/alpine/edge/testing \ gst-rtsp-server-dev RUN apk add --no-cache musl-dev gcc @@ -21,7 +25,10 @@ RUN cargo build --release # Create the release container. Match the base OS used to build FROM docker.io/alpine:latest -RUN apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing libgcc \ +RUN apk add --no-cache \ + -X http://dl-cdn.alpinelinux.org/alpine/edge/main \ + -X http://dl-cdn.alpinelinux.org/alpine/edge/testing \ + libgcc \ tzdata \ gstreamer \ gst-plugins-base \ diff --git a/README.md b/README.md index 3f60f15..2cb8740 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,15 @@ Neolink does not support other cameras such as the RLC-420, since they already In the future Neolink will be much easier to install. For now, follow these steps. +Builds are provided for the following platforms: + +- Windows x86_64 ([download][win-ci-download]) +- macOS x86_64 ([download][macos-ci-download]) +- Ubuntu x86_64 ([download][ubuntu-ci-download]) +- Debian x86 ([download][debian-x86-ci-download]) +- Debian aarch64 ([download][debian-aarch-ci-download]) +- Debian armhf ([download][debian-armhf-ci-download]) +- Docker x86 (see below) ### Windows/Linux @@ -51,6 +60,9 @@ or your package manager on Linux. 3. Download and extract a [prebuilt binary from continuous integration][ci-download] (click on the topmost commit for the most recent build). +3. Download and unpack Neolink from the links above. + 1. Note: you can also click on [this link][ci-download] to see all historical builds. + You will need to be logged in to GitHub to download directly from the builds page. 4. Write a configuration file for your cameras. See the section below. 5. Launch Neolink from a shell, passing your configuration file: @@ -69,6 +81,13 @@ or your package manager on Linux. [gstreamer]: https://gstreamer.freedesktop.org/documentation/installing/index.html [ci-download]: https://github.com/thirtythreeforty/neolink/actions?query=workflow%3ACI+branch%3Amaster+ +[win-ci-download]: https://nightly.link/thirtythreeforty/neolink/workflows/build/master/release-windows-2019.zip +[macos-ci-download]: https://nightly.link/thirtythreeforty/neolink/workflows/build/master/release-macos-10.15.zip +[ubuntu-ci-download]: https://nightly.link/thirtythreeforty/neolink/workflows/build/master/release-ubuntu-18.04.zip +[debian-x86-ci-download]: https://nightly.link/thirtythreeforty/neolink/workflows/build/master/release-i386-buster.zip +[debian-armhf-ci-download]: https://nightly.link/thirtythreeforty/neolink/workflows/build/master/release-armhf-buster.zip +[debian-aarch-ci-download]: https://nightly.link/thirtythreeforty/neolink/workflows/build/master/release-arm64-buster.zip + ### Docker A Docker image is also available containing Neolink and all its dependencies. diff --git a/build.rs b/build.rs index d265dfe..801c327 100644 --- a/build.rs +++ b/build.rs @@ -18,6 +18,10 @@ fn build_ver() { } fn git_ver() -> Option { + github_ver().or_else(git_cmd_ver) +} + +fn git_cmd_ver() -> Option { let mut git_cmd = Command::new("git"); git_cmd.args(&["describe", "--tags"]); @@ -32,6 +36,15 @@ fn git_ver() -> Option { } } +fn github_ver() -> Option { + if let Ok(sha1) = env::var("GITHUB_SHA") { + println!("cargo:rerun-if-env-changed=GITHUB_SHA"); + Some(sha1) + } else { + None + } +} + #[cfg(windows)] fn platform_cfg() { let gstreamer_dir = env::var_os("GSTREAMER_1_0_ROOT_X86_64") diff --git a/dissector/baichuan.lua b/dissector/baichuan.lua index 3ee0568..2131c62 100644 --- a/dissector/baichuan.lua +++ b/dissector/baichuan.lua @@ -165,7 +165,12 @@ end function get_header_len(buffer) local magic = buffer(0, 4):le_uint() - if magic ~= 0x0abcdef0 then + if magic == 0x0abcdef0 then + -- Client <-> BC + elseif magic == 0x0fedcba0 then + -- BC <-> BC + else + -- Unknown magic return -1 -- No header found end local header_len = header_lengths[buffer(18, 2):le_uint()] diff --git a/dissector/messages.md b/dissector/messages.md index b1f851c..3b1f904 100644 --- a/dissector/messages.md +++ b/dissector/messages.md @@ -11,9 +11,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------| - | f0 de bc 0a | 01 00 00 00 | 2c 07 00 00 | 00 00 00 01 | 01 | dc | 14 65 | + | magic | message id | message length | encryption offset | encrypt | unknown | message class | + |--------------|--------------|----------------|-------------------|---------|---------|---------------| + | f0 de bc 0a | 01 00 00 00 | 2c 07 00 00 | 00 00 00 01 | 01 | dc | 14 65 | - Body @@ -29,9 +29,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------| - | f0 de bc 0a | 01 00 00 00 | 91 00 00 00 | 00 00 00 01 | 01 | dd | 14 66 | + | magic | message id | message length | encryption offset | encrypt | unknown | message class | + |--------------|--------------|----------------|-------------------|---------|---------|---------------| + | f0 de bc 0a | 01 00 00 00 | 91 00 00 00 | 00 00 00 01 | 01 | dd | 14 66 | - Body @@ -47,16 +47,17 @@ a PR to improve it. - **Notes:** Sends back a NONCE used for the modern login message. This is effectively an upgrade request to use the modern xml style over legacy. - A legacy camera likely replies differently but I don't have one to test on. + Legacy cameras respond with status code `c8 00`, message class `00 00` and a basic camera description payload. + The legacy protocol beyond this point is not documented and not implemented in Neolink. - 1: Login Modern - Client - Header - | Magic | Message ID | Message Length | Encryption Offset | Encryption Flag | Unknown | Message Class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | f0 de bc 0a | 01 00 00 00 | 28 01 00 00 | 00 00 00 01 | 00 | 00 | 14 64 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | f0 de bc 0a | 01 00 00 00 | 28 01 00 00 | 00 00 00 01 | 00 00 | 14 64 | 00 00 00 00 | - Binary @@ -79,9 +80,9 @@ a PR to improve it. - Header - | Magic | Message ID | Message Length | Encryption Offset | Encryption Flag | Unknown | Message Class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | f0 de bc 0a | 01 00 00 00 | 2e 06 00 00 | 00 00 00 01 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | f0 de bc 0a | 01 00 00 00 | 2e 06 00 00 | 00 00 00 01 | c8 00 | 00 00 | 00 00 00 00 | - Binary @@ -173,9 +174,9 @@ a PR to improve it. - Header - | Magic | Message ID | Message Length | Encryption Offset | Encryption Flag | Unknown | Message Class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | f0 de bc 0a | 03 00 00 00 | aa 00 00 00 | 00 00 00 09 | 00 | 00 | 14 64 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | f0 de bc 0a | 03 00 00 00 | aa 00 00 00 | 00 00 00 09 | 00 00 | 14 64 | 00 00 00 00 | - Binary @@ -196,9 +197,9 @@ a PR to improve it. - Header - | Magic | Message ID | Message Length | Encryption Offset | Encryption Flag | Unknown | Message Class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | f0 de bc 0a | 03 00 00 00 | 8a 00 00 00 | 00 00 00 09 | c8 | 00 | 00 00 | 6a 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | f0 de bc 0a | 03 00 00 00 | 8a 00 00 00 | 00 00 00 09 | c8 00 | 00 00 | 6a 00 00 00 | - Body @@ -222,9 +223,9 @@ a PR to improve it. - Header - | Magic | Message ID | Message Length | Encryption Offset | Encryption Flag | Unknown | Message Class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | f0 de bc 0a | 03 00 00 00 | e8 5e 00 00 | 00 00 00 09 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | f0 de bc 0a | 03 00 00 00 | e8 5e 00 00 | 00 00 00 09 | c8 00 | 00 00 | 00 00 00 00 | - Body @@ -237,9 +238,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 04 | 00 00 00 86 | 2b 00 00 00 | 00 | 00 | 64 14 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 04 | 00 00 00 86 | 2b 00 00 00 | 00 00 | 64 14 | 00 00 00 00 | - Binary @@ -257,9 +258,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 04 | 00 00 00 00 | 2b 00 00 00 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 04 | 00 00 00 00 | 2b 00 00 00 | c8 00 | 00 00 | 00 00 00 00 | - 10: `` @@ -267,9 +268,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 0a | 00 00 00 68 | 0b 00 00 00 | 00 | 00 | 64 14 | 00 00 00 68 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 0a | 00 00 00 68 | 0b 00 00 00 | 00 00 | 64 14 | 00 00 00 68 | - Body @@ -284,9 +285,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 0a | 00 00 01 f7 | 0b 00 00 00 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 0a | 00 00 01 f7 | 0b 00 00 00 | c8 00 | 00 00 | 00 00 00 00 | - Binary @@ -320,9 +321,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 12 | 00 00 00 a4 | 1e 00 00 00 | 00 | 00 | 64 14 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 12 | 00 00 00 a4 | 1e 00 00 00 | 00 00 | 64 14 | 00 00 00 00 | - Binary @@ -341,9 +342,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 12 | 00 00 00 00 | 1e 00 00 00 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 12 | 00 00 00 00 | 1e 00 00 00 | c8 00 | 00 00 | 00 00 00 00 | - 25: `` (write) @@ -351,9 +352,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 19 | 00 00 05 c2 | 64 00 00 00 | 00 | 00 | 64 14 | 00 00 00 68 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 19 | 00 00 05 c2 | 64 00 00 00 | 00 00 | 64 14 | 00 00 00 68 | - Body @@ -452,9 +453,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 19 | 00 00 00 00 | 64 00 00 00 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 19 | 00 00 00 00 | 64 00 00 00 | c8 00 | 00 00 | 00 00 00 00 | - 26: `` @@ -463,9 +464,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 1a | 00 00 00 68 | 2d 00 00 00 | 00 | 00 | 64 14 | 00 00 00 68 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 1a | 00 00 00 68 | 2d 00 00 00 | 00 00 | 64 14 | 00 00 00 68 | - Body @@ -480,9 +481,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 1a | 00 00 05 7c | 2d 00 00 00 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 1a | 00 00 05 7c | 2d 00 00 00 | c8 00 | 00 00 | 00 00 00 00 | - Binary @@ -575,17 +576,17 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 1f | 00 00 00 00 | 05 00 00 00 | 00 | 00 | 64 14 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 1f | 00 00 00 00 | 05 00 00 00 | 00 00 | 64 14 | 00 00 00 00 | - Camera - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 1f | 00 00 00 00 | 05 00 00 00 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 1f | 00 00 00 00 | 05 00 00 00 | c8 00 | 00 00 | 00 00 00 00 | - **Notes:** The camera will not send message 33 to the client until after this msg has been recieved @@ -596,9 +597,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 21 | 00 00 00 f0 | 05 00 00 00 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 21 | 00 00 00 f0 | 05 00 00 00 | c8 00 | 00 00 | 00 00 00 00 | - Binary @@ -622,9 +623,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 2c | 00 00 00 68 | 30 00 00 00 | 00 | 00 | 64 14 | 00 00 00 68 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 2c | 00 00 00 68 | 30 00 00 00 | 00 00 | 64 14 | 00 00 00 68 | - Body @@ -639,9 +640,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 2c | 00 00 01 df | 30 00 00 00 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 2c | 00 00 01 df | 30 00 00 00 | c8 00 | 00 00 | 00 00 00 00 | - Binary @@ -675,9 +676,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 2d | 00 00 02 23 | 32 00 00 00 | 00 | 00 | 64 14 | 00 00 00 68 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 2d | 00 00 02 23 | 32 00 00 00 | 00 00 | 64 14 | 00 00 00 68 | - Body @@ -716,9 +717,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 2d | 00 00 00 00 | 32 00 00 00 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 2d | 00 00 00 00 | 32 00 00 00 | c8 00 | 00 00 | 00 00 00 00 | - 52: `` @@ -726,9 +727,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 34 | 00 00 00 68 | 36 00 00 00 | 00 | 00 | 64 14 | 00 00 00 68 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 34 | 00 00 00 68 | 36 00 00 00 | 00 00 | 64 14 | 00 00 00 68 | - Body @@ -743,9 +744,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 34 | 00 00 00 96 | 36 00 00 00 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 34 | 00 00 00 96 | 36 00 00 00 | c8 00 | 00 00 | 00 00 00 00 | - Binary @@ -766,9 +767,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 35 | 00 00 01 d7 | 38 00 00 00 | 00 | 00 | 64 14 | 00 00 00 68 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 35 | 00 00 01 d7 | 38 00 00 00 | 00 00 | 64 14 | 00 00 00 68 | - Body @@ -813,9 +814,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 35 | 00 00 00 00 | 38 00 00 00 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 35 | 00 00 00 00 | 38 00 00 00 | c8 00 | 00 00 | 00 00 00 00 | - 54: `` @@ -823,9 +824,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 36 | 00 00 00 68 | 14 00 00 00 | 00 | 00 | 64 14 | 00 00 00 68 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 36 | 00 00 00 68 | 14 00 00 00 | 00 00 | 64 14 | 00 00 00 68 | - Body @@ -840,9 +841,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 36 | 00 00 00 ed | 14 00 00 00 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 36 | 00 00 00 ed | 14 00 00 00 | c8 00 | 00 00 | 00 00 00 00 | - Binary @@ -865,9 +866,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 37 | 00 00 01 3b | 16 00 00 00 | 00 | 00 | 64 14 | 00 00 00 68 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 37 | 00 00 01 3b | 16 00 00 00 | 00 00 | 64 14 | 00 00 00 68 | - Body @@ -896,9 +897,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 37 | 00 00 00 00 | 16 00 00 00 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 37 | 00 00 00 00 | 16 00 00 00 | c8 00 | 00 00 | 00 00 00 00 | - 56: `` @@ -906,9 +907,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 38 | 00 00 00 68 | 1d 00 00 00 | 00 | 00 | 64 14 | 00 00 00 68 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 38 | 00 00 00 68 | 1d 00 00 00 | 00 00 | 64 14 | 00 00 00 68 | - Body @@ -923,9 +924,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 38 | 00 00 03 61 | 1d 00 00 00 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 38 | 00 00 03 61 | 1d 00 00 00 | c8 00 | 00 00 | 00 00 00 00 | - Binary @@ -975,9 +976,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 39 | 00 00 02 bc | 1f 00 00 00 | 00 | 00 | 64 14 | 00 00 00 68 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 39 | 00 00 02 bc | 1f 00 00 00 | 00 00 | 64 14 | 00 00 00 68 | - Body @@ -1023,9 +1024,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 39 | 00 00 00 00 | 1f 00 00 00 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 39 | 00 00 00 00 | 1f 00 00 00 | c8 00 | 00 00 | 00 00 00 00 | - 58: `` @@ -1033,9 +1034,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 3a | 00 00 00 6b | 03 00 00 00 | 00 | 00 | 64 14 | 00 00 00 6b | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 3a | 00 00 00 6b | 03 00 00 00 | 00 00 | 64 14 | 00 00 00 6b | - Body @@ -1050,9 +1051,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 3a | 00 00 03 a4 | 03 00 00 00 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 3a | 00 00 03 a4 | 03 00 00 00 | c8 00 | 00 00 | 00 00 00 00 | - Binary @@ -1116,17 +1117,17 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 4c | 00 00 00 00 | 22 00 00 00 | 00 | 00 | 64 14 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 4c | 00 00 00 00 | 22 00 00 00 | 00 00 | 64 14 | 00 00 00 00 | - Camera - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 4c | 00 00 01 69 | 22 00 00 00 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 4c | 00 00 01 69 | 22 00 00 00 | c8 00 | 00 00 | 00 00 00 00 | - Binary @@ -1158,9 +1159,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 4d | 00 00 01 5b | 25 00 00 00 | 00 | 00 | 64 14 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 4d | 00 00 01 5b | 25 00 00 00 | 00 00 | 64 14 | 00 00 00 00 | - Binary @@ -1190,9 +1191,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 4d | 00 00 00 00 | 14 00 00 00 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 4d | 00 00 00 00 | 14 00 00 00 | c8 00 | 00 00 | 00 00 00 00 | - 78: `` @@ -1200,9 +1201,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 4e | 00 00 00 d3 | 1b 00 00 00 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 4e | 00 00 00 d3 | 1b 00 00 00 | c8 00 | 00 00 | 00 00 00 00 | - Binary @@ -1225,9 +1226,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 4f | 00 00 01 3b | 1b 00 00 00 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 4f | 00 00 01 3b | 1b 00 00 00 | c8 00 | 00 00 | 00 00 00 00 | - Binary @@ -1253,17 +1254,17 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 50 | 00 00 00 00 | 08 00 00 00 | 00 | 00 | 64 14 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 50 | 00 00 00 00 | 08 00 00 00 | 00 00 | 64 14 | 00 00 00 00 | - Camera - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 50 | 00 00 01 f0 | 08 00 00 00 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 50 | 00 00 01 f0 | 08 00 00 00 | c8 00 | 00 00 | 00 00 00 00 | - Binary @@ -1292,9 +1293,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 51 | 00 00 00 68 | 19 00 00 00 | 00 | 00 | 64 14 | 00 00 00 68 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 51 | 00 00 00 68 | 19 00 00 00 | 00 00 | 64 14 | 00 00 00 68 | - Body @@ -1309,9 +1310,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 51 | 00 00 04 30 | 19 00 00 00 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 51 | 00 00 04 30 | 19 00 00 00 | c8 00 | 00 00 | 00 00 00 00 | - Binary @@ -1380,9 +1381,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 52 | 00 00 05 da | 1a 00 00 00 | 00 | 00 | 64 14 | 00 00 00 68 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 52 | 00 00 05 da | 1a 00 00 00 | 00 00 | 64 14 | 00 00 00 68 | - Body @@ -1475,9 +1476,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 52 | 00 00 00 00 | 1a 00 00 00 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 52 | 00 00 00 00 | 1a 00 00 00 | c8 00 | 00 00 | 00 00 00 00 | - 93: `` @@ -1485,9 +1486,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 5d | 00 00 00 00 | 17 00 00 00 | 00 | 00 | 64 14 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 5d | 00 00 00 00 | 17 00 00 00 | 00 00 | 64 14 | 00 00 00 00 | - 102: `` @@ -1495,17 +1496,17 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 66 | 00 00 00 00 | 07 00 00 00 | 00 | 00 | 64 14 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 66 | 00 00 00 00 | 07 00 00 00 | 00 00 | 64 14 | 00 00 00 00 | - Camera - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 66 | 00 00 00 55 | 07 00 00 00 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 66 | 00 00 00 55 | 07 00 00 00 | c8 00 | 00 00 | 00 00 00 00 | - Binary @@ -1522,17 +1523,17 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 68 | 00 00 00 00 | 0a 00 00 00 | 00 | 00 | 64 14 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 68 | 00 00 00 00 | 0a 00 00 00 | 00 00 | 64 14 | 00 00 00 00 | - Camera - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 68 | 00 00 01 a5 | 0a 00 00 00 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 68 | 00 00 01 a5 | 0a 00 00 00 | c8 00 | 00 00 | 00 00 00 00 | - Binary @@ -1565,17 +1566,17 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 73 | 00 00 00 00 | 0c 00 00 00 | 00 | 00 | 64 14 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 73 | 00 00 00 00 | 0c 00 00 00 | 00 00 | 64 14 | 00 00 00 00 | - Camera - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 73 | 00 00 00 75 | 0c 00 00 00 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 73 | 00 00 00 75 | 0c 00 00 00 | c8 00 | 00 00 | 00 00 00 00 | - Binary @@ -1594,9 +1595,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 84 | 00 00 00 68 | 65 00 00 00 | 00 | 00 | 64 14 | 00 00 00 68 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 84 | 00 00 00 68 | 65 00 00 00 | 00 00 | 64 14 | 00 00 00 68 | - Body @@ -1611,9 +1612,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 84 | 00 00 05 7c | 65 00 00 00 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 84 | 00 00 05 7c | 65 00 00 00 | c8 00 | 00 00 | 00 00 00 00 | - Binary @@ -1706,17 +1707,17 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 85 | 00 00 00 00 | 06 00 00 00 | 00 | 00 | 64 14 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 85 | 00 00 00 00 | 06 00 00 00 | 00 00 | 64 14 | 00 00 00 00 | - Camera - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 85 | 00 00 00 7f | 06 00 00 00 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 85 | 00 00 00 7f | 06 00 00 00 | c8 00 | 00 00 | 00 00 00 00 | - Binary @@ -1736,17 +1737,17 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 92 | 00 00 00 00 | 04 00 00 00 | 00 | 00 | 64 14 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 92 | 00 00 00 00 | 04 00 00 00 | 00 00 | 64 14 | 00 00 00 00 | - Camera - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 92 | 00 00 02 fc | 04 00 00 00 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 92 | 00 00 02 fc | 04 00 00 00 | c8 00 | 00 00 | 00 00 00 00 | - Binary @@ -1789,9 +1790,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 97 | 00 00 00 a7 | 02 00 00 00 | 00 | 00 | 64 14 | 00 00 00 a7 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 97 | 00 00 00 a7 | 02 00 00 00 | 00 00 | 64 14 | 00 00 00 a7 | - Body @@ -1807,9 +1808,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 97 | 00 00 03 ac | 02 00 00 00 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 97 | 00 00 03 ac | 02 00 00 00 | c8 00 | 00 00 | 00 00 00 00 | - Binary @@ -1856,9 +1857,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 be | 00 00 00 68 | 0d 00 00 00 | 00 | 00 | 64 14 | 00 00 00 68 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 be | 00 00 00 68 | 0d 00 00 00 | 00 00 | 64 14 | 00 00 00 68 | - Body @@ -1873,9 +1874,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 be | 00 00 00 86 | 0d 00 00 00 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 be | 00 00 00 86 | 0d 00 00 00 | c8 00 | 00 00 | 00 00 00 00 | - Binary @@ -1895,17 +1896,17 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 c0 | 00 00 00 00 | 05 00 00 00 | 00 | 00 | 64 14 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 c0 | 00 00 00 00 | 05 00 00 00 | 00 00 | 64 14 | 00 00 00 00 | - Camera - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 c0 | 00 00 00 00 | 05 00 00 00 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 c0 | 00 00 00 00 | 05 00 00 00 | c8 00 | 00 00 | 00 00 00 00 | - 199: `` @@ -1913,17 +1914,17 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 c7 | 00 00 00 00 | 02 00 00 00 | 00 | 00 | 64 14 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 c7 | 00 00 00 00 | 02 00 00 00 | 00 00 | 64 14 | 00 00 00 00 | - Camera - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 c7 | 00 00 05 f6 | 02 00 00 00 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 c7 | 00 00 05 f6 | 02 00 00 00 | c8 00 | 00 00 | 00 00 00 00 | - Binary @@ -2007,9 +2008,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 d0 | 00 00 00 68 | 2e 00 00 00 | 00 | 00 | 64 14 | 00 00 00 68 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 d0 | 00 00 00 68 | 2e 00 00 00 | 00 00 | 64 14 | 00 00 00 68 | - Body @@ -2024,9 +2025,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 d0 | 00 00 00 c2 | 2e 00 00 00 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 d0 | 00 00 00 c2 | 2e 00 00 00 | c8 00 | 00 00 | 00 00 00 00 | - Binary @@ -2048,9 +2049,9 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 d1 | 00 00 01 10 | 85 00 00 00 | 00 | 00 | 64 14 | 00 00 00 68 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 d1 | 00 00 01 10 | 85 00 00 00 | 00 00 | 64 14 | 00 00 00 68 | - Body @@ -2078,6 +2079,6 @@ a PR to improve it. - Header - | magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | Binary Offset | - |--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| - | 0a bc de f0 | 00 00 00 d1 | 00 00 00 00 | 85 00 00 00 | c8 | 00 | 00 00 | 00 00 00 00 | + | Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | + |--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| + | 0a bc de f0 | 00 00 00 d1 | 00 00 00 00 | 85 00 00 00 | c8 00 | 00 00 | 00 00 00 00 | diff --git a/dissector/protocol.md b/dissector/protocol.md index fd81dce..55552f1 100644 --- a/dissector/protocol.md +++ b/dissector/protocol.md @@ -16,29 +16,38 @@ Each message has the general format: The header has the format: -| magic | message id | message length | encryption offset | Encryption flag | Unknown | message class | -|--------------|--------------|----------------|-------------------|-----------------|---------|---------------| -| f0 de bc 0a | 01 00 00 00 | 2c 07 00 00 | 00 00 00 01 | 01 | dc | 14 65 | +| magic | message id | message length | encryption offset | encrypt | unknown | message class | +|--------------|--------------|----------------|-------------------|---------|---------|---------------| +| f0 de bc 0a | 01 00 00 00 | 2c 07 00 00 | 00 00 00 01 | 01 | dc | 14 65 | + +- Magic 4 bytes +- ID 4 bytes +- Message length 4 bytes +- Encryption offset 4 bytes +- Encryption flag 1 byte +- Unknown 1 byte +- Message class 2 bytes Or -| Magic | Message ID | Message Length | Encryption Offset | Encryption Flag | Unknown | Message Class | Binary Offset | -|--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| -| f0 de bc 0a | 01 00 00 00 | 28 01 00 00 | 00 00 00 01 | 00 | 00 | 14 64 | 00 00 00 00 | +| Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | +|--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| +| f0 de bc 0a | 01 00 00 00 | 28 01 00 00 | 00 00 00 01 | c8 00 | 14 64 | 00 00 00 00 | - Magic 4 bytes - ID 4 bytes - Message length 4 bytes - Encryption offset 4 bytes -- Encryption flag (not always honoured by clients) 1 byte -- Unknown 1 byte (always zero) +- Status Code 2 bytes +- Message class 2 bytes - Binary offset 4 bytes (Presence depend on message class) #### Magic -The magic bytes for BC messages is always `f0 de bc 0a`. When receiving packet -this should be used to quickly discard invalid packets. +The magic bytes for BC messages is always `f0 de bc 0a` for client <-> device. +Or magic `a0 cd ed 0f` for device <-> device, eg NVR <-> IPC. +When receiving packet these should be used to quickly discard invalid packets. #### Message ID @@ -80,19 +89,32 @@ The key is the same for all cameras. Older cameras do not use encryption and all messages are sent as plain text. +The offset bytes are actually made up of other useful information +channel_id 1 byte - NVR channel related to request/response or `00` if N/A. +stream_id 1 byte - `00`=clear, `01`=fluent, `04`=balanced +unknown 1 byte - Always `00` +message_handle 1 byte - client increments per request, replies use request handle + #### Encryption Flag -This flag is 0 for unencrypted or non zero for encrypted. This flag seems -only to be valid during the login step, and seems to be arbitrary otherwise. +This flag is 0 for unencrypted or non zero for encrypted. Clients should decide to use encryption or not based on this byte that the -camera send during login. Then should use that same setting for all further +camera sent during login. Then should use that same setting for all further messages with the camera. #### Unknown -The purpose of this byte is unknown but is always zero. If you figure out -what it does please submit a PR. +The purpose of this byte is unknown. +Observed - `dc` = client request, `dd` = device reply +If you figure out what it does please submit a PR. + +#### Status Code + +In a request this is set to `00 00`. +In a reply this is a http style response code. +`c8 00` = 200 OK +`90 01` = 400 Bad Request #### Message class @@ -191,9 +213,9 @@ the [docs](dissector/mediapacket.md) Other data can be received from the camera by sending the appropriate header to the camera. For example sending the header for ID 78 -| Magic | Message ID | Message Length | Encryption Offset | Encryption Flag | Unknown | Message Class | Binary Offset | -|--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| -| f0 de bc 0a | 4e 00 00 00 | d3 00 00 00 | 08 db 9c 00 | c8 | 00 | 00 00 | 00 00 00 00 | +| Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | +|--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| +| f0 de bc 0a | 4e 00 00 00 | d3 00 00 00 | 08 db 9c 00 | c8 00 | 00 00 | 00 00 00 00 | The camera will reply with an xml with brightness and contrast @@ -214,9 +236,9 @@ Some message IDs also require input along with the request header. For example ID 151 which is the users ability info requires the header -| Magic | Message ID | Message Length | Encryption Offset | Encryption Flag | Unknown | Message Class | Binary Offset | -|--------------|--------------|----------------|-------------------|-----------------|---------|---------------|---------------| -| f0 de bc 0a | 97 00 00 00 | a7 00 00 00 | 00 00 00 02 | 00 | 00 | 14 64 | a7 00 00 00 | +| Magic | Message ID | Message Length | Encryption Offset | Status Code | Message Class | Binary Offset | +|--------------|--------------|----------------|-------------------|-------------------|---------------|---------------| +| f0 de bc 0a | 97 00 00 00 | a7 00 00 00 | 00 00 00 02 | 00 00 | 14 64 | a7 00 00 00 | and the body of diff --git a/sample_config.toml b/sample_config.toml index 3c1e8d1..cbe4fa2 100644 --- a/sample_config.toml +++ b/sample_config.toml @@ -2,6 +2,7 @@ # You can chage this to a specfic network e.g. "192.168.1.101" here # Or to no networks e.g. this computer only "127.0.0.1" bind = "0.0.0.0" + # Default port is 8554 but you can change it by uncommenting the following # bind_port = 8554 @@ -11,6 +12,10 @@ bind = "0.0.0.0" # If TLS is activated you must connect with "rtsps://" and not "rtsp://" # certificate = "/path/to/pem/with/cert/and/key" +# Choose if the client is required to provide a certificate signed by the server's CA. +# none|requested|required - default none +# tls_client_auth = "required" + # You can password protect the rtsp server mount points by adding users # like the following me and someone. If you do not add [[users]] # then anyone can connect without a password or username @@ -30,15 +35,22 @@ name = "driveway" username = "admin" password = "12345678" address = "192.168.1.187:9000" + # By default any of the users can connect (or anyone at all if no users are specfied) # You can uncomment the following to permit only specfic users # permitted_users = [ "me" ] +# By default "both" "mainStream" and "subStream" are connected +# If your device has user connection limits try a single stream instead. +# stream = "mainStream" + + [[cameras]] name = "storage shed" username = "admin" password = "987654321" address = "192.168.1.245:9000" -# By default the camera is assumed to be in H.265 format -# Some camera's e.g. E1 use H.264. You can use the following to change this -# format = "h264" + +# By default channel_id = 0. Eg the first connected camera on the device +# Note this counts from 0. An 8 channel NVR would have channels 0 through 7 +# channel_id = 1 diff --git a/src/bc/model.rs b/src/bc/model.rs index ae507ae..3906586 100644 --- a/src/bc/model.rs +++ b/src/bc/model.rs @@ -7,6 +7,7 @@ pub(super) const MAGIC_HEADER: u32 = 0xabcdef0; pub const MSG_ID_LOGIN: u32 = 1; pub const MSG_ID_VIDEO: u32 = 3; +pub const MSG_ID_VERSION: u32 = 80; pub const MSG_ID_PING: u32 = 93; pub const MSG_ID_GET_GENERAL: u32 = 104; pub const MSG_ID_SET_GENERAL: u32 = 105; diff --git a/src/bc/xml.rs b/src/bc/xml.rs index 2a83c9d..761fdd9 100644 --- a/src/bc/xml.rs +++ b/src/bc/xml.rs @@ -36,6 +36,8 @@ pub struct BcXml { pub login_net: Option, #[yaserde(rename = "DeviceInfo")] pub device_info: Option, + #[yaserde(rename = "VersionInfo")] + pub version_info: Option, #[yaserde(rename = "Preview")] pub preview: Option, #[yaserde(rename = "SystemGeneral")] @@ -107,6 +109,17 @@ pub struct DeviceInfo { pub resolution: Resolution, } +#[derive(PartialEq, Eq, Default, Debug, YaDeserialize, YaSerialize)] +pub struct VersionInfo { + pub name: String, + pub serialNumber: String, + pub buildDay: String, + pub hardwareVersion: String, + pub cfgVersion: String, + pub firmwareVersion: String, + pub detail: String, +} + #[derive(PartialEq, Eq, Default, Debug, YaDeserialize, YaSerialize)] pub struct Resolution { #[yaserde(rename = "resolutionName")] diff --git a/src/bc_protocol.rs b/src/bc_protocol.rs index 09159a9..58c01b4 100644 --- a/src/bc_protocol.rs +++ b/src/bc_protocol.rs @@ -62,6 +62,9 @@ pub enum Error { #[error(display = "Credential error")] AuthFailed, + #[error(display = "Failed to translate camera address")] + AddrResolutionError, + #[error(display = "ADPCM Decoding Error")] AdpcmDecodingError(&'static str), @@ -85,30 +88,42 @@ impl Drop for BcCamera { } impl BcCamera { - pub fn new_with_addr(hostname: T, channel_id: u8) -> Result { - let address = hostname - .to_socket_addrs()? - .next() - .ok_or(Error::Other("Address resolution failed"))?; + pub fn new_with_addr(host: T, channel_id: u8) -> Result { + let addr_iter = match host.to_socket_addrs() { + Ok(iter) => iter, + Err(_) => return Err(Error::AddrResolutionError), + }; - Ok(Self { - address, - channel_id, - message_num: AtomicU16::new(0), - connection: None, - logged_in: false, - }) + for addr in addr_iter { + debug!("Trying {}", addr); + let conn = match BcConnection::new(addr, RX_TIMEOUT) { + Ok(conn) => conn, + Err(err) => match err { + connection::Error::CommunicationError(ref err) => { + debug!("Assuming timeout from {}", err); + continue; + } + err => return Err(err.into()), + }, + }; + + debug!("Success: {}", addr); + return Ok(Self { + address: addr, + connection: Some(conn), + message_num: AtomicU16::new(0), + channel_id, + logged_in: false, + }); + } + + Err(Error::Timeout) } pub fn new_message_num(&self) -> u16 { self.message_num.fetch_add(1, Ordering::Relaxed) } - pub fn connect(&mut self) -> Result<()> { - self.connection = Some(BcConnection::new(self.address, RX_TIMEOUT)?); - Ok(()) - } - pub fn disconnect(&mut self) { if let Err(err) = self.logout() { warn!("Could not log out, ignoring: {}", err); @@ -250,6 +265,53 @@ impl BcCamera { Ok(()) } + pub fn version(&self) -> Result { + let connection = self + .connection + .as_ref() + .expect("Must be connected to get version info"); + let sub_version = connection.subscribe(MSG_ID_VERSION)?; + + let version = Bc { + meta: BcMeta { + msg_id: MSG_ID_VERSION, + channel_id: self.channel_id, + msg_num: self.new_message_num(), + stream_type: 0, + response_code: 0, + class: 0x6414, // IDK why + }, + body: BcBody::ModernMsg(ModernMsg { + ..Default::default() + }), + }; + + sub_version.send(version)?; + + let modern_reply = sub_version.rx.recv_timeout(RX_TIMEOUT)?; + let version_info; + match modern_reply.body { + BcBody::ModernMsg(ModernMsg { + payload: + Some(BcPayloads::BcXml(BcXml { + version_info: Some(info), + .. + })), + .. + }) => { + version_info = info; + } + _ => { + return Err(Error::UnintelligibleReply { + reply: modern_reply, + why: "Expected a VersionInfo message", + }) + } + } + + Ok(version_info) + } + pub fn ping(&self) -> Result<()> { let connection = self.connection.as_ref().expect("Must be connected to ping"); let sub_ping = connection.subscribe(MSG_ID_PING)?; diff --git a/src/bc_protocol/adpcm.rs b/src/bc_protocol/adpcm.rs index e8b8793..a42b0cd 100644 --- a/src/bc_protocol/adpcm.rs +++ b/src/bc_protocol/adpcm.rs @@ -225,7 +225,7 @@ pub fn adpcm_to_pcm(bytes: &[u8]) -> Result, Error> { // Some formats e.g. OKI are not in the full PCM range of values // To convert we must scale it to the i16 range // We also cast to i16 at this point ready for the conversion to u8 bytes of the output - let scaled_sample = (sample as i32 * (i16::MAX as i32) + let scaled_sample = (sample as i32 * (std::i16::MAX as i32) / (context.max_sample_size - 1) as i32) as i16; diff --git a/src/config.rs b/src/config.rs index dc836b8..9942e66 100644 --- a/src/config.rs +++ b/src/config.rs @@ -2,7 +2,6 @@ use lazy_static::lazy_static; use regex::Regex; use serde::Deserialize; use std::clone::Clone; -use std::net::SocketAddr; use std::time::Duration; use validator::{Validate, ValidationError}; use validator_derive::Validate; @@ -45,7 +44,7 @@ pub struct CameraConfig { pub name: String, #[serde(rename = "address")] - pub camera_addr: SocketAddr, + pub camera_addr: String, pub username: String, pub password: Option, diff --git a/src/main.rs b/src/main.rs index 4ae8036..811f5b1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -34,7 +34,7 @@ pub enum Error { } fn main() -> Result<(), Error> { - env_logger::from_env(Env::default().default_filter_or("info")).init(); + env_logger::Builder::from_env(Env::default().default_filter_or("info")).init(); info!( "Neolink {} {}", @@ -199,7 +199,7 @@ fn camera_main( ) -> Result { let mut connected = false; (|| { - let mut camera = BcCamera::new_with_addr(camera_config.camera_addr, camera_config.channel_id)?; + let mut camera = BcCamera::new_with_addr(&camera_config.camera_addr, camera_config.channel_id)?; if camera_config.timeout.is_some() { warn!("The undocumented `timeout` config option has been removed and is no longer needed."); warn!("Please update your config file."); @@ -209,7 +209,6 @@ fn camera_main( "{}: Connecting to camera at {}", camera_config.name, camera_config.camera_addr ); - camera.connect()?; camera.login(&camera_config.username, camera_config.password.as_deref())?; @@ -217,29 +216,7 @@ fn camera_main( info!("{}: Connected and logged in", camera_config.name); if manage { - let cam_time = camera.get_time()?; - if let Some(time) = cam_time { - info!( - "{}: Camera time is already set: {}", - camera_config.name, time - ); - } else { - let new_time = time::OffsetDateTime::now_local(); - warn!( - "{}: Camera has no time set, setting to {}", - camera_config.name, new_time - ); - camera.set_time(new_time)?; - let cam_time = camera.get_time()?; - if let Some(time) = cam_time { - info!( - "{}: Camera time is now set: {}", - camera_config.name, time - ); - } else { - error!("{}: Camera did not accept new time (is {} an admin?)", camera_config.name, camera_config.username); - } - } + do_camera_management(&mut camera, camera_config)?; } info!( @@ -250,3 +227,56 @@ fn camera_main( })() .map_err(|err| CameraErr { connected, err }) } + +fn do_camera_management( + camera: &mut BcCamera, + camera_config: &CameraConfig, +) -> Result<(), neolink::Error> { + let cam_time = camera.get_time()?; + if let Some(time) = cam_time { + info!( + "{}: Camera time is already set: {}", + camera_config.name, time + ); + } else { + use time::OffsetDateTime; + // We'd like now_local() but it's deprecated - try to get the local time, but if no + // time zone, fall back to UTC. + let new_time = + OffsetDateTime::try_now_local().unwrap_or_else(|_| OffsetDateTime::now_utc()); + + warn!( + "{}: Camera has no time set, setting to {}", + camera_config.name, new_time + ); + camera.set_time(new_time)?; + let cam_time = camera.get_time()?; + if let Some(time) = cam_time { + info!("{}: Camera time is now set: {}", camera_config.name, time); + } else { + error!( + "{}: Camera did not accept new time (is {} an admin?)", + camera_config.name, camera_config.username + ); + } + } + + use neolink::bc::xml::VersionInfo; + if let Ok(VersionInfo { + firmwareVersion: firmware_version, + .. + }) = camera.version() + { + info!( + "{}: Camera reports firmware version {}", + camera_config.name, firmware_version + ); + } else { + info!( + "{}: Could not fetch version information", + camera_config.name + ); + } + + Ok(()) +}