Commit Graph
328 Commits
Author SHA1 Message Date
Lee Smet affe79b0c2 Reserve space for a header inside encrypted data
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-25 11:41:53 +02:00
Lee Smet 82a9ccde9b Clean up obsolete comment
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-22 16:14:21 +02:00
Lee Smet c96f42f4f6 Standardize arguments in tun setup
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-22 16:13:58 +02:00
Lee Smet d98a8b8d5c Continue the extract loop instead of returning
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-22 16:09:06 +02:00
Lee Smet ff4e1941f7 Use subnets in TUN code
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-22 15:24:23 +02:00
Lee Smet d84d52d9f9 Implement a data plane to handle user data
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-22 11:58:24 +02:00
Lee Smet 188415b6de Add basic DataPacket documentation
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-21 17:15:01 +02:00
Lee Smet da0f1c83d2 Expand DataPacket header to be 4 bytes
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-21 17:04:17 +02:00
Lee Smet d873c67492 Add basic packet docs
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-21 16:46:19 +02:00
Lee Smet a29c058652 Expand Packet header to be 4 bytes
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-21 16:02:23 +02:00
Lee Smet d90b65974c Remove obsolete clone
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-21 15:50:03 +02:00
Lee Smet 49f1b1cbc3 Fix data packet source IP transmission
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-21 15:12:39 +02:00
Lee Smet a7c00b9b59 Accept empty set for now
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-21 15:07:41 +02:00
Lee Smet a7278c8ee4 Remove obsolete codec.rs file
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-21 15:01:33 +02:00
Lee Smet 7ee6161596 Split packet codecs to proper packet files
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-21 15:00:32 +02:00
Lee Smet 576efd0735 Split packet types into separate modules
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-21 13:49:37 +02:00
Lee Smet 4275efd8f0 Add 4th NS when creating test setup
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-21 13:35:54 +02:00
Lee Smet 6a9da2de27 Use src_ip in DataPacket instead of src pubkey
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-21 11:43:38 +02:00
Lee Smet 40f9a0e39c Fix buffer reservation when writing data
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-20 17:30:33 +02:00
Lee Smet a52712690a Annotate babel update flags with allow(dead_code)
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-20 17:02:16 +02:00
Lee Smet ebcbd81e07 Remove unused IPPubkeyMap::remove method
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-20 17:01:20 +02:00
Lee Smet dcabfef13d Add dedicated error type for decryption failures
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-20 17:00:34 +02:00
Lee Smet 2981674692 Add CI github action
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-20 16:25:09 +02:00
Lee Smet 2db606d110 Avoid cloning packet on receive apth
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-20 16:22:36 +02:00
Lee Smet 690eabe93c Don't return a result for routing packets
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-20 16:11:10 +02:00
Lee Smet 6486d3cc03 Fix bad comment on RouteFilter::allow trait method
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-20 15:28:52 +02:00
Lee Smet 49eb9e95b0 Fix broken doc links
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-20 15:28:15 +02:00
Lee Smet 014f829268 Add Default impl for SecretKey and PacketBuffer
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-20 15:24:33 +02:00
Lee Smet 5af941a7ab Fix Subnet contains_subnet doc test
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-20 15:19:55 +02:00
Lee Smet 4c816a4e75 Move business logic to library
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-20 15:17:07 +02:00
Lee Smet ea5d2a696b Properly keep route structure indexed by RouteKey
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-20 14:52:02 +02:00
Lee Smet 53493f693a Refactor routing table to use a trie
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-20 14:52:02 +02:00
Lee Smet ec5ef0be1d Add abstraction for ip pubkey mapping
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-19 17:12:41 +02:00
Lee Smet 0e6681161e Add IP Trie dependency
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-19 15:19:34 +02:00
Lee Smet 89a5935e2c Add update filter to limit subnet size
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-19 14:41:39 +02:00
Lee Smet aed423ba34 Rework RoutingTable retain to remove_peer
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-19 12:59:42 +02:00
Lee Smet 36e69c105d Remove obsolete peer_by_ip and RouteEntry next_hop
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-19 11:46:39 +02:00
Lee Smet b4ff95577a Extract Peer from RouteEntry when sending
Also when removing routes in the routing table

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-19 11:44:20 +02:00
Lee Smet 97570c49e2 Add Peer in RouteKey instad of overlay IP
The babel spec mentions overlay IP, however we have a designated type
for this, so it's better to outright use that and avoid some hassle in
lookiing up the proper Peer later on

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-19 11:30:49 +02:00
Lee Smet dd9ad18ec4 Add network method to Subnet
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-19 10:25:01 +02:00
Lee Smet d9f1ae306d Conditionally enable linux only dependencies
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-18 15:31:11 +02:00
Lee Smet 3bb14e9a4a Cleaner transfer of tun read result
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-18 15:16:45 +02:00
Lee Smet 289fdff937 Rework Router to tkae a subnet for tun address
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-18 12:04:47 +02:00
Lee Smet b1584f4aea Use RoutintTable lookup method in router
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-18 12:04:17 +02:00
Lee Smet 0603ef4861 Add method to find route in routing table for IP
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-18 12:02:29 +02:00
Lee Smet f4dea15307 Add method to check if IP is contained in a subnet
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-18 12:01:42 +02:00
Lee Smet 094d0c57ef Close #24: use subnet filter for incoming updates
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-13 16:36:38 +02:00
Lee Smet c40a550f62 Add basic RouteUpdateFilter implementation
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-13 16:14:33 +02:00
Lee Smet 6a44994877 Add contains_subnet method for Subnet
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-13 16:10:59 +02:00
Lee Smet f3551f1428 Lower MTU to avoid physical nic MTU overflow
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-12 16:27:32 +02:00