# cryptoevil-dev/opendpi architecture

> Architecture diagram of the GitHub repository cryptoevil-dev/opendpi, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cryptoevil-dev/opendpi
- Repository: https://github.com/cryptoevil-dev/opendpi

## Overview

OpenDPI is described as a defensive traffic gateway, but this checkout contains only TCP/address utilities and configuration support; `main.cpp` has no runtime workflow. The README’s proxy, security-analysis, and core/toolchain modules have no corresponding source paths in the tree, so they are not represented as implemented components. Edges below reflect only shown calls and interface use.

Main entry points: [`src/net/tcp.cpp`](https://github.com/cryptoevil-dev/opendpi/blob/main/src/net/tcp.cpp) (TCP listener), [`src/conf/yaml.cpp`](https://github.com/cryptoevil-dev/opendpi/blob/main/src/conf/yaml.cpp) (YAML reader), [`src/conf/iconf.hpp`](https://github.com/cryptoevil-dev/opendpi/blob/main/src/conf/iconf.hpp) (Schema validation), [`src/net/addrs.cpp`](https://github.com/cryptoevil-dev/opendpi/blob/main/src/net/addrs.cpp) (IP and socket addresses)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_network["Network primitives"]
  node_socket_addresses["IP and socket addresses<br/>[addrs.cpp]"]
  node_tcp_stream["TCP streams<br/>[tcp.cpp]"]
  node_tcp_listener["TCP listener<br/>[tcp.cpp]"]
end

subgraph group_configuration["Configuration"]
  node_config_reader["Config reader interface<br/>[iconf.hpp]"]
  node_yaml_reader["YAML reader<br/>[yaml.cpp]"]
  node_schema_validator["Schema validation<br/>[iconf.hpp]"]
  node_validation_result["Validation results<br/>[iconf.cpp]"]
end

node_main["Program entry<br/>[main.cpp]"]
node_yaml_library["RapidYAML parser"]

node_tcp_stream -->|"uses address"| node_socket_addresses
node_tcp_listener -->|"uses address"| node_socket_addresses
node_tcp_listener -->|"accepts as"| node_tcp_stream
node_schema_validator -->|"reads values"| node_config_reader
node_yaml_reader -->|"implements"| node_config_reader
node_yaml_reader -->|"parses with"| node_yaml_library
node_schema_validator -->|"releases"| node_validation_result

click node_main "https://github.com/cryptoevil-dev/opendpi/blob/main/main.cpp"
click node_socket_addresses "https://github.com/cryptoevil-dev/opendpi/blob/main/src/net/addrs.cpp"
click node_tcp_stream "https://github.com/cryptoevil-dev/opendpi/blob/main/src/net/tcp.cpp"
click node_tcp_listener "https://github.com/cryptoevil-dev/opendpi/blob/main/src/net/tcp.cpp"
click node_config_reader "https://github.com/cryptoevil-dev/opendpi/blob/main/src/conf/iconf.hpp"
click node_yaml_reader "https://github.com/cryptoevil-dev/opendpi/blob/main/src/conf/yaml.cpp"
click node_schema_validator "https://github.com/cryptoevil-dev/opendpi/blob/main/src/conf/iconf.hpp"
click node_validation_result "https://github.com/cryptoevil-dev/opendpi/blob/main/src/conf/iconf.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_socket_addresses,node_tcp_stream,node_tcp_listener toneBlue
class node_config_reader,node_yaml_reader,node_schema_validator,node_validation_result toneAmber
class node_main toneTeal
class node_yaml_library toneMint
```

## Components

### Network primitives

- [IP and socket addresses](https://github.com/cryptoevil-dev/opendpi/blob/main/src/net/addrs.cpp): `src/net/addrs.cpp`
- [TCP streams](https://github.com/cryptoevil-dev/opendpi/blob/main/src/net/tcp.cpp): `src/net/tcp.cpp`
- [TCP listener](https://github.com/cryptoevil-dev/opendpi/blob/main/src/net/tcp.cpp): `src/net/tcp.cpp`

### Configuration

- [Config reader interface](https://github.com/cryptoevil-dev/opendpi/blob/main/src/conf/iconf.hpp): `src/conf/iconf.hpp`
- [YAML reader](https://github.com/cryptoevil-dev/opendpi/blob/main/src/conf/yaml.cpp): `src/conf/yaml.cpp`
- [Schema validation](https://github.com/cryptoevil-dev/opendpi/blob/main/src/conf/iconf.hpp): `src/conf/iconf.hpp`
- [Validation results](https://github.com/cryptoevil-dev/opendpi/blob/main/src/conf/iconf.cpp): `src/conf/iconf.cpp`

### Other components

- [Program entry](https://github.com/cryptoevil-dev/opendpi/blob/main/main.cpp): `main.cpp`
- **RapidYAML parser**

## Connections

- TCP streams → IP and socket addresses: uses address (evidence: `src/net/tcp.cpp`)
- TCP listener → IP and socket addresses: uses address (evidence: `src/net/tcp.cpp`)
- TCP listener → TCP streams: accepts as (evidence: `src/net/tcp.cpp`)
- Schema validation → Config reader interface: reads values (evidence: `src/conf/iconf.hpp`)
- YAML reader → Config reader interface: implements
- YAML reader → RapidYAML parser: parses with (evidence: `src/conf/yaml.cpp`)
- Schema validation → Validation results: releases (evidence: `src/conf/iconf.cpp`)
