How xam74er1/kadmelia works
Key Components
• Peer Node: This is at the heart of the system. Each node is responsible for joining the network, performing lookups, and handling file transfers. Label it clearly with sub-components such as:
• Command-Line Interface (CLI): Handles arguments like -p, -i, -q, -m, and -s.
• Network Communication Module: Responsible for both TCP and UDP communication (evident in utilitaires/TCP.c and UDP.c, and tests in Test/peerUDP.c, etc.).
• File Transfer Module: Manage sending and receiving files (see Test/filetransfertClient.c, Test/filetransfertServer.c, gestion/envois_fichier.c, and package/SendFileTCP.c).
• DHT/Routing Module: Implements core Kademlia functions such as node lookup, finding values, and pinging neighbors (the package directory contains files like find_node.c, find_value.c, node.c, ping.c, and related tests like kademiliaTest.c).
• Storage/Database Module: Uses SQLite (see lib/sqlite3.c/h) to store metadata about downloaded files and network state.
• Cryptography & Security Module: Integrates OpenSSL (contents in lib/openssl) which is used for encryption/decryption and secure communications.
Network Layer & External Interactions
• How nodes send control messages (for network joins and lookups) and data messages (file contents) across the network.
• Input mechanism of command options (from the CLI) that trigger interactions with the networking layers.
Architectural Patterns & Design Principles
• Layered Approach: Consider grouping the lower-level libraries (like OpenSSL and SQLite) as underlying service layers supporting higher-level application logic.