DoIP Server POC implementation - #1
Draft
VinaykumarRS1995 wants to merge 22 commits into
Draft
Conversation
VinaykumarRS1995
marked this pull request as draft
January 23, 2026 07:54
Document DoIP server block diagram, supported message types, and build instructions. Include PlantUML diagrams for startup, TCP connection, UDP request, and graceful shutdown flows. Signed-off-by: VinaykumarRS1995 <Vinaykumarrs1995@gmail.com>
Define crate as library and binary. Add tokio, serde, toml, tracing, and thiserror dependencies. Declare top-level modules. Signed-off-by: VinaykumarRS1995 <Vinaykumarrs1995@gmail.com>
Introduce ServerConfig for TCP, UDP, and ECU identity settings. Provide InMemoryProvider for defaults and TomlProvider for file-based configuration loading. Signed-off-by: VinaykumarRS1995 <Vinaykumarrs1995@gmail.com>
Implement 8-byte header parsing with version validation. Define TcpPayloadType and UdpPayloadType enums for all supported message types (0x0001-0x8003) per ISO 13400-2. Signed-off-by: VinaykumarRS1995 <Vinaykumarrs1995@gmail.com>
Introduce PayloadHandler<PayloadType, Request> trait for handler implementations. Build Dispatcher with HashMap-based routing from payload type to handler, generic over transport. Signed-off-by: VinaykumarRS1995 <Vinaykumarrs1995@gmail.com>
Define SovdProxy trait with forward() for UDS byte translation. StubProxy returns NRC 0x11 pending real backend integration. MockProxy echoes input for unit testing. Signed-off-by: VinaykumarRS1995 <Vinaykumarrs1995@gmail.com>
Add handlers for VehicleIdentification (0x0001-0x0003), VIN request (0x0004), and EntityStatus (0x4001). Vehicle ID handlers share common announcement-building logic. Signed-off-by: VinaykumarRS1995 <Vinaykumarrs1995@gmail.com>
Add AliveCheck (0x0007) responding to keep-alive pings. RoutingActivation (0x0005) returns 0x10 as placeholder until full state-machine logic is implemented. Signed-off-by: VinaykumarRS1995 <Vinaykumarrs1995@gmail.com>
Add DiagnosticsHandler (0x8001) forwarding UDS bytes via SovdProxy and returning DiagnosticMessagePositiveAck. Wire all handlers into build_tcp_dispatcher() and build_udp_dispatcher(). Signed-off-by: VinaykumarRS1995 <Vinaykumarrs1995@gmail.com>
Add TCP listener with per-connection task spawning. DoIP framer reconstructs complete messages from partial reads. UDP uses simple recv-parse-dispatch loop with no framing needed. Signed-off-by: VinaykumarRS1995 <Vinaykumarrs1995@gmail.com>
Enforce max concurrent TCP connections using atomic counter. SessionSlot acts as RAII guard that auto-releases on drop, ensuring cleanup on disconnection or task cancellation. Signed-off-by: VinaykumarRS1995 <Vinaykumarrs1995@gmail.com>
Add Server struct that starts both listeners concurrently and coordinates graceful shutdown via cancellation token. Signed-off-by: VinaykumarRS1995 <Vinaykumarrs1995@gmail.com>
Wire all layers in main(): load config, build dispatchers, start transports, handle SIGINT shutdown. Include DoIP tester for manual integration testing against a running server. Signed-off-by: VinaykumarRS1995 <Vinaykumarrs1995@gmail.com>
- Convert to Cargo workspace (lib + app + client) - Narrow tokio features to specific set - Refactor handlers to accept EcuConfig directly - Tighten visibility (pub(super), pub(in crate::...)) - Remove DEFAULT_ prefix in defaults module - Add compile_fail doc test for transport segregation - Add TODO comments for future improvements - Update README (headings, commands, abbreviations) - Add sample-doip-server.toml - Regenerate SVGs from updated puml sources
- Rename common.rs to utils.rs in vehicle identification handlers - Rename InMemoryConfigProvider to DefaultConfigProvider - Fix Toml_provider casing to toml_provider - Move sample-doip-server.toml into app/ - Add ISO references, design decisions, and validation TODOs across codebase Signed-off-by: VinaykumarRS1995 <Vinaykumarrs1995@gmail.com>
rpreddyhv
force-pushed
the
doip-server-poc
branch
from
July 7, 2026 06:37
31bb2dc to
ce5f702
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Checklist
Related
Notes for Reviewers