summaryrefslogtreecommitdiff
path: root/src/ipcpd/unicast/dir
Commit message (Collapse)AuthorAgeFilesLines
* lib: Refactor reading packet from rbuffDimitri Staessens2022-03-301-1/+1
| | | | | | | | | | | | Reading packets from the rbuff and checking their validity (non-zero size, pass crc check, pass decryption) is now extracted into a function. Also adds a function to get the length of an sdu_du_buff instead of subtracting the tail and head pointers. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* ipcpd: Refactor kad_req_createDimitri Staessens2022-03-081-20/+25
| | | | | | | A small refactor of the kad_req_create function's cleanup code. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* ipcpd: Fix some unchecked return valuesDimitri Staessens2022-03-031-7/+10
| | | | | | | Fixes some unchecked and wrongly checked return values. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* ipcpd: Fix deadlock in dht_unregDimitri Staessens2022-02-181-8/+3
| | | | | | | | | The dht_del function was called under lock in dht_unreg, and then tried to take the lock again, a 100% deadlock. Also fix uninitialized value in dht_retrieve. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* ipcpd: Fix initialization of hash width in DHTDimitri Staessens2022-02-171-5/+7
| | | | | | | | | | The width of the Kademlia hash function (dht->b) was set only after the ID was created. This should have failed miserably, but the bytes after were fine as they were just a randomized ID in the Kademlia network. Nasty. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* ipcpd: Allow creation of multiple directoriesDimitri Staessens2021-12-294-409/+508
| | | | | | | | | To allow merging large network layers, a situation will arise where multiple directories need to coexist within the layer. This reverts commit 9422e6be94ac1007e8115a920379fd545055e531. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* ipcpd: Consolidate policies within folderDimitri Staessens2021-12-062-0/+25
| | | | | | | | Each policy folder will now have a pol.h file, so that (in most cases) adding a new policy only requires changes inside the policy folder. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* ipcpd: Make the DHT a directory policyDimitri Staessens2021-12-066-0/+3050
The DHT is now a proper directory policy instead of a unicast IPCP component. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>