# duraki/jeep architecture

> Architecture diagram of the GitHub repository duraki/jeep, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/duraki/jeep
- Repository: https://github.com/duraki/jeep

## Overview

##### Main Components

a) Core System Components:
- Kernel Module Layer (vxcan driver)
- SocketCAN Interface
- Core Framework
- Built-in Modules
- API Interface
- User Interface Layer

b) Network Components:
- Virtual CAN Tunnel
- Docker Container Network
- Host Network Interface

**[Hardware Layer]**

**[Kernel Layer (vxcan)]**

**[SocketCAN Layer]**

**[Jeep Core Framework]**
- [Built-in Modules]
- [API Interface]
- [User Interface]

##### Component Details

a) Hardware Layer:
- Physical CAN interface connection
- Raspberry Pi/SBC connection point

b) Kernel Module Layer:
- Vxcan driver component
- Kernel module interactions
- Can-gw module

c) Framework Core:
- Relationship between src/jeep.c and builtin components
- Frame handling system (src/builtin/frame)
- Bus communication system (src/builtin/bus)

d) Module System:
- Modular architecture
- API integration points
- Sniffing capabilities

##### Data Flow Representation

- CAN frame flow from hardware to application
- Virtual network tunneling
- Inter-module communication
- API interactions

##### Technical Details

- Network configuration (172.17.0.0/16)
- Virtual CAN tunnel endpoints
- API entry points (src/builtin/api.h)
- Frame structure handling (src/builtin/frame)

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Hardware
        PHY[Physical CAN Interface]
        RPI[Raspberry Pi/SBC]
    end

    subgraph Kernel
        VXCAN[vxcan Driver]:::kernel
        CANGW[CAN Gateway]:::kernel
        SOCK[SocketCAN Interface]:::kernel
    end

    subgraph Framework
        CORE[Core Framework]:::core
        API[API Interface]:::api
        FRAME[Frame Handler]:::core
        BUS[Bus Communication]:::core
        UI[User Interface]:::ui
    end

    subgraph Modules
        SNIFF[Sniff Module]:::module
        BUILTINS[Built-in Modules]:::module
    end

    subgraph Network
        VNET[Virtual CAN Network]:::network
        DOCKER[Docker Network Bridge]:::network
        HOST[Host Network Interface]:::network
    end

    %% Connections
    PHY --> RPI
    RPI --> VXCAN
    VXCAN --> SOCK
    SOCK --> CORE
    CORE --> API
    CORE --> FRAME
    CORE --> BUS
    CORE --> UI
    API --> BUILTINS
    BUILTINS --> SNIFF
    VXCAN --> VNET
    VNET --> DOCKER
    DOCKER --> HOST
    CANGW --> SOCK

    %% Click Events
    click VXCAN "https://github.com/duraki/jeep/blob/master/drivers/vxcan/vxcan.c"
    click CORE "https://github.com/duraki/jeep/blob/master/src/jeep.c"
    click API "https://github.com/duraki/jeep/blob/master/src/builtin/api.h"
    click FRAME "https://github.com/duraki/jeep/blob/master/src/builtin/frame/frame.c"
    click BUS "https://github.com/duraki/jeep/blob/master/src/builtin/bus/bus.c"
    click UI "https://github.com/duraki/jeep/blob/master/src/builtin/ui.h"
    click SOCK "https://github.com/duraki/jeep/blob/master/src/include/linux/can/raw.h"
    click SNIFF "https://github.com/duraki/jeep/blob/master/src/builtin/sniff.c"
    click BUILTINS "https://github.com/duraki/jeep/tree/master/src/builtin/"
    click CANGW "https://github.com/duraki/jeep/blob/master/src/include/linux/can/gw.h"

    %% Styles
    classDef kernel fill:#f9f,stroke:#333,stroke-width:2px
    classDef core fill:#9cf,stroke:#333,stroke-width:2px
    classDef api fill:#fc9,stroke:#333,stroke-width:2px
    classDef ui fill:#cfc,stroke:#333,stroke-width:2px
    classDef module fill:#ff9,stroke:#333,stroke-width:2px
    classDef network fill:#ccc,stroke:#333,stroke-width:2px

    %% Legend
    subgraph Legend
        L1[Kernel Components]:::kernel
        L2[Core Components]:::core
        L3[API Layer]:::api
        L4[User Interface]:::ui
        L5[Modules]:::module
        L6[Network]:::network
    end
```
