Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,729 changes: 2,728 additions & 1 deletion Cargo.lock

Large diffs are not rendered by default.

42 changes: 38 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,42 @@
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0

[package]
name = "uds2sovd-proxy"
[workspace.package]
version = "0.1.0"
edition = "2024"
license = "Apache-2.0"
homepage = "https://github.com/eclipse-opensovd/uds2sovd-proxy"

[lints]
workspace = true
[workspace]
resolver = "3"
members = ["proxy-core"]

[workspace.dependencies]
proxy-core = { path = "proxy-core" }
proxy-doip = { path = "proxy-doip" }
proxy-sovd = { path = "proxy-sovd" }
cda-core = { git = "https://github.com/eclipse-opensovd/classic-diagnostic-adapter.git", rev = "cf7fd9c18a7c49467e9e6c9ceae1e771c613e49b" }
cda-database = { git = "https://github.com/eclipse-opensovd/classic-diagnostic-adapter.git", rev = "cf7fd9c18a7c49467e9e6c9ceae1e771c613e49b" }
cda-interfaces = { git = "https://github.com/eclipse-opensovd/classic-diagnostic-adapter.git", rev = "cf7fd9c18a7c49467e9e6c9ceae1e771c613e49b" }
cda-plugin-security = { git = "https://github.com/eclipse-opensovd/classic-diagnostic-adapter.git", rev = "cf7fd9c18a7c49467e9e6c9ceae1e771c613e49b" }

# ---- common crates ----
async-trait = "0.1.89"
thiserror = "2.0.17"
serde = "1.0"
serde_json = "1.0"
tokio = { version = "1.48.0", default-features = false }
bytes = "1"
clap = "4.6.1"
toml = "0.9.8"

# ---- networking crates ----
reqwest = { version = "0.12.24", default-features = false }
url = { version = "2", features = ["serde"] }

# ---- tracing & logging crates ----
tracing = "0.1.41"
tracing-subscriber = { version = "0.3.20", default-features = false }

# Lints are aligned with shared-lints.toml from:
# https://github.com/eclipse-opensovd/cicd-workflows/tree/main/shared-lints
Expand Down Expand Up @@ -44,3 +71,10 @@ clone_on_ref_ptr = "warn"
# enforce that the type suffix of a literal is always appended directly
# eg. 12u8 instead of 12_u8
separated_literal_suffix = "deny"

[workspace.lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(nightly)'] }

[patch.crates-io]
aide = { git = "https://github.com/alexmohr/aide.git", rev = "56355cb" }
flatbuffers = { git = "https://github.com/alexmohr/flatbuffers.git", rev = "0ba3307d" }
78 changes: 75 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,92 @@ SOVD-enabled vehicle architectures without modification.
- 🛡️ safe & secure
- ⚡ fast startup

## introduction
## features

### usage
- **MDD-Agnostic**: Works with any valid MDD file
- **DoIP Server**: ISO 13400-2 compliant, port configurable (default: `13400`)
- **SOVD Mapping**: UDS ↔ SOVD REST API conversion
- **Mock Gateway**: Built-in SOVD mock responses for testing
- **Service Resolution**: DID → service mapping via MDD (MUX map or brute-force)

### prerequisites
## prerequisites

To run the proxy you will need at least one `MDD` file. Check out [eclipse-opensovd/odx-converter](https://github.com/eclipse-opensovd/odx-converter) on how to create `MDD`(s) from ODX.

Sample ODX/MDD files are available in the CDA repository: [testcontainer/odx](https://github.com/eclipse-opensovd/classic-diagnostic-adapter/tree/main/testcontainer/odx)

Once you have the `MDD`(s) you can place them in `testcontainer/mdd/` or pass the path via `--mdd-dir`.

### build the executable

```shell
cargo build --release
```

### running

Ensure that the config (`examples/config.toml`) fits your setup:

- `doip_port` is set to the desired DoIP server port (default: `13400`)
- `gateway_url` points to the SOVD gateway (CDA or mock)
- `mock_gateway = true` enables built-in mock responses for testing without a real CDA

Run the proxy:

```shell
cargo run --release -- --mdd-dir testcontainer/mdd
```

Or with a specific MDD file:

```shell
cargo run --release -- --mdd-file FLXC1000.mdd
```

### running with SOVD Server

To use the proxy with a real SOVD Server instance, set `mock_gateway = false` in `examples/config.toml` and point `gateway_url` to the SOVD Server endpoint.

## architecture

```
DoIP Client (port 13400)
↓ UDS request (0x22 DID)
Proxy (service resolution via MDD)
↓ SOVD REST (GET /data/vindataidentifier_read)
Mock Gateway OR Real SOVD Server
↓ SOVD JSON response
Proxy (MDD-based UDS encoding)
↓ UDS response (0x62 DID data)
DoIP Client
```

## directory structure

- `proxy-core/`: Shared types, errors, MDD engine, and `DiagHandler` trait
- `proxy-doip/`: DoIP transport layer (ISO 13400-2) — server and session handling
- `proxy-sovd/`: SOVD REST client and UDS ↔ SOVD mapping
- `proxy-main/`: Binary entry point, CLI, configuration, and example clients
- `testcontainer/mdd/`: MDD files (FLXC1000.mdd)
- `proxy-main/examples/`: Test clients for each MDD

## configuration

Edit `examples/config.toml`:

- `doip_port = 13_400`: DoIP server port
- `mock_gateway = true`: Use built-in mock responses
- `gateway_url`: SOVD gateway endpoint
- MDD directory: `--mdd-dir testcontainer/mdd` (default)

## developing

### pre commit

```shell
uv run https://raw.githubusercontent.com/eclipse-opensovd/cicd-workflows/main/run_checks.py
```

### codestyle

see [codestyle](CODESTYLE.md)
Expand All @@ -58,6 +128,7 @@ see [codestyle](CODESTYLE.md)
#### unit tests

Unittests are placed in the relevant module as usual in rust:

```rust
...
#[cfg(test)]
Expand All @@ -67,6 +138,7 @@ mod test {
```

Run unit tests with:

```shell
cargo test --locked --lib
```
Expand Down
20 changes: 17 additions & 3 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@
all-features = false
no-default-features = false


[output]
feature-depth = 1


# This section is considered when running `cargo deny check advisories`
# More documentation for the advisories section can be found here:
# https://embarkstudios.github.io/cargo-deny/checks/advisories/cfg.html
[advisories]
ignore = []
ignore = ["RUSTSEC-2023-0071"]


# This section is considered when running `cargo deny check licenses`
# More documentation for the licenses section can be found here:
Expand All @@ -32,15 +35,24 @@ ignore = []
# List of explicitly allowed licenses
# See https://spdx.org/licenses/ for list of possible licenses
# [possible values: any SPDX 3.11 short identifier (+ optional exception)].
allow = ["Apache-2.0", "MIT"]

allow = [
"Apache-2.0",
"MIT",
"BSD-3-Clause",
"Zlib",
"ISC",
"Unicode-3.0",
"CDLA-Permissive-2.0",
]
confidence-threshold = 0.9
exceptions = []


[licenses.private]
ignore = true
registries = []


# This section is considered when running `cargo deny check bans`.
# More documentation about the 'bans' section can be found here:
# https://embarkstudios.github.io/cargo-deny/checks/bans/cfg.html
Expand All @@ -57,6 +69,7 @@ deny = []
skip = []
skip-tree = []


# This section is considered when running `cargo deny check sources`.
# More documentation about the 'sources' section can be found here:
# https://embarkstudios.github.io/cargo-deny/checks/sources/cfg.html
Expand All @@ -72,6 +85,7 @@ allow-git = [
"https://github.com/alexmohr/flatbuffers.git",
]


[sources.allow-org]
github = []
gitlab = []
Expand Down
Loading
Loading