move all code directory readmes into docs/project-structure.md

This commit is contained in:
Jeff 2022-08-06 09:34:05 -04:00
parent 13c71c3626
commit badf72838e
No known key found for this signature in database
GPG Key ID: 025C02EE3A092F2D
4 changed files with 110 additions and 140 deletions

View File

@ -1,75 +0,0 @@
grab bag directory for non core related platform specific non source code
[Network Manager shims](NetworkManager)
[apparmor profiles](apparmor)
[default self signed network bootstrap files](bootstrap)
[continuous integration scripts](ci)
[cross compile cmake toolchains](cross)
[embedded lokinet example code](liblokinet)
[macos related hacks and associated hellscape items](macos)
[static deps patch files](patches)
[python scripts](py)
[systemd-resolved profiles](systemd-resolved)
android build shim:
* android.sh
* android-configure.sh
windows via mingw cross compiler build shim:
* windows.sh
* windows-configure.sh
macos build shim:
* mac.sh
iphone build shim:
* ios.sh
linux cross compile build shim:
* cross.sh
apply multiple patches script:
* apply-patches.sh
[bencode](https://www.bittorrent.org/beps/bep_0003.html#bencoding) pretty-print script:
* bencode-dump.py
deb.oxen.io apt repo pubkey:
* deb.oxen.io.gpg
clang-format / jsonnetfmt / swiftformat helper, will check or correct code style:
* format.sh
git hooks:
* git-hook-pre-push.sh
base16 to [z-base32](https://philzimmermann.com/docs/human-oriented-base-32-encoding.txt) converter
* hex-to-base32z.py
lokinet logo:
* lokinet.svg
cpack installer text:
* readme-installer.txt

View File

@ -1,10 +0,0 @@
this contains the main functions for all of our executables
lokinet.cpp - lokinet full daemon
lokinet.swift - macos sysex/appex
lokinet-bootstrap.cpp - lokinet-bootstrap binary (deprecated / to be removed)
lokinet-vpn.cpp - lokinet-vpn tool for rpc control of lokinet, needs a better name.

110
docs/project-structure.md Normal file
View File

@ -0,0 +1,110 @@
# Lokinet project structure
this codebase is a bit large. this is a high level map of the current code structure.
## lokinet executable main functions `(/daemon)`
* `lokinet.cpp`: lokinet daemon executable
* `lokinet.swift`: macos sysex/appex executable
* `lokinet-vpn.cpp`: lokinet rpc tool for controlling exit node usage
* `lokinet-bootstrap.cpp`: legacy util for windows, downloads a bootstrap file via https
## lokinet public headers `(/include)`
`lokinet.h and lokinet/*.h`: C headers for embedded lokinet
`llarp.hpp`: semi-internal C++ header for lokinet executables
## lokinet core library `(/llarp)`
* `/llarp`: contains a few straggling compilation units
* `/llarp/android`: android platform compat shims
* `/llarp/apple`: all apple platform specific code
* `/llarp/config`: configuration structs, generation/parsing/validating of config files
* `/llarp/consensus`: network consenus and inter relay testing
* `/llarp/constants`: contains all compile time constants
* `/llarp/crypto`: cryptography interface and implementation, includes various secure helpers
* `/llarp/dht`: dht message structs, parsing, validation and handlers of dht related parts of the protocol
* `/llarp/dns`: dns subsytem, dns udp wire parsers, resolver, server, rewriter/intercepter, the works
* `/llarp/ev`: event loop interfaces and implementations
* `/llarp/exit`: `.snode` endpoint "backend"
* `/llarp/handlers`: packet endpoint "frontends"
* `/llarp/iwp`: "internet wire protocol", hacky homegrown durable udp wire protocol used in lokinet
* `/llarp/link`: linklayer (node to node) communcation subsystem
* `/llarp/messages`: linklayer message parsing and handling
* `/llarp/net`: wrappers and helpers for ip addresses / ip ranges / sockaddrs, hides platform specific implemenation details
* `/llarp/path`: onion routing path logic, both client and relay side, path selection algorithms.
* `/llarp/peerstats`: deprecated
* `/llarp/quic`: plainquic shims for quic protocol inside lokinet
* `/llarp/router`: the relm of the god objects
* `/llarp/routing`: routing messages (onion routed messages sent over paths), parsing, validation and handler interfaces.
* `/llarp/rpc`: lokinet zmq rpc server and zmq client for externalizing logic (like with blockchain state and custom `.loki` endpoint orchestration)
* `/llarp/service`: `.loki` endpoint "backend"
* `/llarp/simulation`: network simulation shims
* `/llarp/tooling`: network simulation tooling
* `/llarp/util`: utility function dumping ground
* `/llarp/vpn`: vpn tunnel implemenation for each supported platform
* `/llarp/win32`: windows specific code
## component relations
### `/llarp/service` / `/llarp/handlers` / `/llarp/exit`
for all codepaths for traffic over lokinet, there is 2 parts, the "frontend" and the "backend".
the "backend" is responsible for sending and recieving data inside lokinet using our internal formats via paths, it handles flow management, lookups, timeouts, handover, and all state we have inside lokinet.
the "fontend", is a translation layer that takes in IP Packets from the OS, and send it to the backend to go where ever it wants to go, and recieves data from the "backend" and sends it to the OS as an IP Packet.
there are 2 'backends': `.snode` and `.loki`
there are 2 'frontends': "tun" (generic OS vpn interface) and "null" (does nothing)
* `//TODO: the backends need to be split up into multiple sub components as they are a kitchen sink.`
* `//TODO: the frontends blend into the backend too much and need to have their boundery clearer.`
### `/llarp/ev` / `/llarp/net` / `/llarp/vpn`
these contain most of the os/platform specific bits
* `//TODO: untangle these`
### `/llarp/link` / `/llarp/iwp`
node to node traffic logic and wire protocol dialects
* `//TODO: make better definitions of interfaces`
* `//TODO: separte implementation details from interfaces`
## platform contrib code `(/contrib)`
grab bag directory for non core related platform specific non source code
* `/contrib/format.sh`: clang-format / jsonnetfmt / swiftformat helper, will check or correct code style.
system layer and packaging related:
* `/contrib/NetworkManager`
* `/contrib/apparmor`
* `/contrib/systemd-resolved`
* `/contrib/lokinet-resolvconf`
* `/contrib/bootstrap`
build shims / ci helpers
* `/contrib/ci`
* `/contrib/patches`
* `/contrib/cross`
* `/contrib/android.sh`
* `/contrib/android-configure.sh`
* `/contrib/windows.sh`
* `/contrib/windows-configure.sh`
* `/contrib/mac.sh`
* `/contrib/ios.sh`
* `/contrib/cross.sh`

View File

@ -1,55 +0,0 @@
this directory contains the meat of the lokinet core implemenation
components:
[apple platform specific bits](apple)
[configuration bits](config)
[network consensus parts](consensus)
[compile time constants](constants)
[cryptography interface and implementations](crypto)
[DHT related code](dht)
[DNS client/server/parsing library](dns)
[event loop interface and implementations](ev)
[snode endpoint backend implementation](exit)
[onion endpoint frontend adapters](handlers)
[lokinet wire protocol](iwp)
[lokinet link layer interface types](link)
[link layer (node to node) messages](messages)
[platform agnostic-ish network api](net)
[onion path management](path)
[peer stats collection (likely to be refactored)](peerstats)
[quic over lokinet abstraction](quic)
[central god objects](router)
[routing (onion routed over paths) messages](routing)
[rpc client/server](rpc)
[onion endpoint backend implemenation](service)
[net simulation code (likely to be binned)](simulation)
[net simulation tooling (used by pybind)](tooling)
[utility function dumping ground (to be fixed up)](util)
[platform specific vpn bits with high level abstractions](vpn)
[windows platform bits](win32)