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
Lee Smet
1a2b7994ba
Add test flow for encryption and decryption flow
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-09-12 14:31:25 +02:00
Lee Smet
b635484d64
Retain PacketBuffer allocation if it isn't used
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-09-12 12:57:26 +02:00
Lee Smet
fb1e1efa2f
Avoid reallocation in decrypt flow
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-09-12 11:13:46 +02:00
Lee Smet
d18f8de813
Close #22 : Avoid reallocations in encrypt flow
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-09-11 18:03:31 +02:00
Lee Smet
1dffc61206
Use dedicated RouterId type in existing code
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-09-11 14:55:46 +02:00
Lee Smet
f6232ba034
Add dedicated RouterId type
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-09-11 14:55:29 +02:00
Lee Smet
22f307d57e
Elide RoutingTable::iter lifetime bounds
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-09-11 10:28:41 +02:00
Lee Smet
d06bd6e120
Make RoutingTable field private
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-09-11 10:25:25 +02:00
Lee Smet
e09f1d7f49
Remove obsolete ControlStruct type
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-09-08 15:18:26 +02:00
Lee Smet
e429f04625
Improve control packet handling
...
- Pass actual packet to handler function instead of wrapper enum.
- Pass the peer who sent the control packet instead of extracting the IP
from the control packet and doing a lookup in the router.
- Rework PeerInner to only contain data, move the actual stream
management task to the parent Peer.
- Inject a clone of the peer in the channel with the control packet.
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-09-08 14:59:00 +02:00
Lee Smet
d07b6f86a6
Remove legacy commented code
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-09-08 14:10:46 +02:00
Lee Smet
0c8638a7ce
Remove unused router function
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-09-08 14:09:46 +02:00
Lee Smet
6332946d08
Update dependencies to latest versions
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-09-08 14:09:25 +02:00
Lee Smet
0e932795ea
Remove explicit rand and getrandom dependencies
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-09-07 16:08:43 +02:00
Lee Smet
8fcb8aaff3
Update x25519-dalek dependency to v2.0.0
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-09-07 16:07:03 +02:00
Lee Smet
5ec9ed8a58
Remove console-subscriber dependency
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-09-07 14:57:29 +02:00
Lee Smet
7d4cfd801f
Remve leftover useless clone
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-09-07 14:29:35 +02:00
Lee Smet
97d073f918
Use synchronous routing method to send from TUN
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-09-07 14:02:33 +02:00
Lee Smet
40b5f9cd14
Refactor routing logic to a sync method as well
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-09-07 14:01:17 +02:00
Lee Smet
4c566957b3
Update tokio dependencies to latest version
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-09-07 11:56:16 +02:00
Lee Smet
06843b646a
Remove commented line of code
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-09-07 11:38:47 +02:00
Lee Smet
2ec5274380
Clean up route priting
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-09-06 16:34:25 +02:00
Lee Smet
0b5d86835d
Close #20 : Implement dedicated subnet type
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-09-06 15:29:58 +02:00
Lee Smet
4ed14440f2
Implement a basic subnet module
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-09-06 15:27:28 +02:00
Lee Smet
be06e5c0a0
Add IpNet dependency
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-09-06 13:20:32 +02:00
Lee Smet
e1fadc1842
Disable Nagle's algorithm
...
Set TCP_NODELAY on TCP streams. By default, Nagle's algorithm is
enabled, which caused rather large latency spikes from time to time.
Making sure this is disabled leads to smooth latency graphs without
outliers
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-09-05 15:46:44 +02:00
Lee Smet
63aa5cd696
Change erronous return to continue
...
Leftover return after this was refactored from a closure to a while
loop, caused router exit in case invalid data was received.
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-09-01 16:49:06 +02:00
Lee Smet
db2b99da04
Remove some useless clones
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-09-01 16:15:43 +02:00
Lee Smet
fccb20ae6a
Code cleanup
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-09-01 15:50:09 +02:00
Lee Smet
bfa8e5d452
Rework code to avoid Sync requirement on router
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-09-01 15:47:08 +02:00
Lee Smet
4b36322a35
Switch router concurrency to left-right
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-08-31 18:35:36 +02:00
Lee Smet
3e27fbd484
Only wrap updates when sending
...
This avoids a needless match statement and allows proper type checking
for sending updates
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-08-31 17:23:17 +02:00
Lee Smet
a253d9ddb3
Remove unused imports
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-08-28 17:10:22 +02:00
Lee Smet
437476b3ff
Apply clippy suggestion
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-08-28 17:07:44 +02:00
Lee Smet
1576a061c0
Send all ready packets to a peer in one go
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-08-28 15:12:30 +02:00
Lee Smet
905001deff
Rework TUN stream driver to feed into router sink
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-08-28 15:12:30 +02:00
Lee Smet
03cf4010df
Remove broken reexports in tun.rs
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-08-28 15:12:30 +02:00
Lee Smet
cc1f48ea53
Remove wrapper Sink and Stream structs for tun
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-08-28 15:12:30 +02:00
Lee Smet
524f18cb80
Don't process packets concurrently from tun
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2023-08-28 15:12:30 +02:00