Commit Graph
339 Commits
Author SHA1 Message Date
Lee Smet 979ed476cb Remove etherparse dependency
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-27 15:04:51 +02:00
Lee Smet ad95fb2712 Improve src and dst ip extraction
Since we only care about these fields, don't parse the full header

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-27 15:02:08 +02:00
Lee Smet 39ac4ebd0d Correct typo on peer constant
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-27 11:22:49 +02:00
Lee Smet fcfab20d82 Make peer send buf size a constant
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-27 10:48:15 +02:00
Lee Smet 3e1bbe63e5 Add release build optimizations
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-26 17:37:09 +02:00
Lee Smet 57e8b8e8e0 Set addr on proper veth pair
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-26 16:32:49 +02:00
Lee Smet 352f2f2903 Add protocol version in packet header
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-25 16:14:35 +02:00
Lee Smet 739d3871f5 Allow access to PacketBuffer header
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-25 15:45:53 +02:00
Lee Smet e2aa2bdcdf Update dependencies
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-25 14:16:06 +02:00
dependabot[bot] 6ee18f40cd Bump aes-gcm from 0.10.2 to 0.10.3
Bumps [aes-gcm](https://github.com/RustCrypto/AEADs) from 0.10.2 to 0.10.3.
- [Commits](https://github.com/RustCrypto/AEADs/compare/aes-gcm-v0.10.2...aes-gcm-v0.10.3)

---
updated-dependencies:
- dependency-name: aes-gcm
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-25 13:44:48 +02:00
Lee Smet 02dfbfb870 Fix PacketBuffer tests
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-25 13:34:26 +02:00
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