Commit Graph

457 Commits

Author SHA1 Message Date
Lee Smet d1ff31b084 Clsoe #62: Make topic part of init packet
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-15 15:46:50 +01:00
Lee Smet c0953cfd22 Close #48
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-14 22:37:53 +01:00
Lee Smet e32d18c154 Fix debug assert when inserting selected route
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-14 22:15:35 +01:00
Lee Smet f50496f74e Close #44: Implement route hold timers
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-14 16:43:55 +01:00
Lee Smet a5ffdb60f2 Close #60: Improve routing table management
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-14 14:10:44 +01:00
Lee Smet edf2b2741e Clean up filter doc comment
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-14 10:15:09 +01:00
Lee Smet c8cacbcac6 Clean up update handler a bit
Mostly remove the old "remove and insert" code from when we had 2
separate routing tables, in favour of mutating entries in place.

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-13 23:16:29 +01:00
Lee Smet 5e39a65b97 Force selected route entries to be first element
This is a marginal performance improvement for looking up the selected
route.

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-13 22:45:16 +01:00
Lee Smet 48f9863c1d Close #57: Join routing tables
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-13 22:13:43 +01:00
Lee Smet bc6fc7f9fe Rework routing table to use Vec instead of HashSet
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-13 21:45:13 +01:00
Lee Smet b012dd47ea Close #53: Avoid rapid seqno bumping
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-13 16:35:39 +01:00
Lee Smet cba9bafee3 Close #46: Don't send update for route to next-hop
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-13 16:02:49 +01:00
Lee Smet d166163d57 Close #49: Add source entry expiration timers
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-13 14:59:58 +01:00
Lee Smet 1f10cab765 Fix #56: Don't update source entry for retractions
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-13 11:40:15 +01:00
Lee Smet d71e94f01d Fix #54: Enforce hops to have a cost
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-13 11:33:25 +01:00
Lee Smet 687666a5e2 Fix #52: Don't include peer link cost in update
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-13 11:27:12 +01:00
Lee Smet ddb95d3da4 Fix #51: Properly handle retractions
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-10 18:16:18 +01:00
Lee Smet 9d067bab54 Don't remove infinite metric when adding
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-10 17:52:41 +01:00
Lee Smet 40626b8bcd Don't forward packets over fallback route
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-10 17:52:17 +01:00
Lee Smet 11aa41155a Fix #50: Allow fallback only routes
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-09 15:41:02 +01:00
Lee Smet 7bf155644c Clean up dead code
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-08 19:50:22 +01:00
Lee Smet 219749a486 Fix #47: Better update handling and route selection
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-08 19:47:58 +01:00
Lee Smet e57930ad7e Improve sending updates
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-08 18:27:32 +01:00
Lee Smet a0a1b41165 Add update filter to ensure router id owns subnet
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-08 10:54:29 +01:00
Lee Smet 0cdedb51e4 Fix handling of seqno requests for local routes
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-07 18:11:49 +01:00
Lee Smet 1e6ebbc8fb Fix comment on SeqNoRequest
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-07 17:53:21 +01:00
Lee Smet d320ac6c8d Also print route seqno
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-07 16:52:03 +01:00
Lee Smet 3cc6e5e439 Add SeqNoRequest tests
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-07 16:01:52 +01:00
Lee Smet c57126858f Send seqno requests in update handler
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-07 14:58:38 +01:00
Lee Smet 14ff3de87f Add more peer underlay debugging info
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-07 12:06:42 +01:00
Lee Smet c9d1bf10f7 Add source peer underlay IP to update log
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-07 12:01:09 +01:00
Lee Smet a14d4b7569 Also drop read handle if route is for ourselves
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-07 11:52:27 +01:00
Lee Smet b6d3b98eed Implement SeqNo request and handling
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-07 11:45:41 +01:00
Lee Smet 4f2da4b4f7 Use more constants for router timings
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-06 15:45:40 +01:00
Lee Smet a2c44e68db Add debug log when sending update
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-06 14:53:53 +01:00
Lee Smet d5b641e7dc Set proper seqno when distributing routes
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-06 14:16:11 +01:00
Lee Smet cd10da1056 Add log when connecting to peer
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-06 13:22:01 +01:00
Lee Smet f608849fcd Fix #41: Harden peer exchange handshake
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-06 11:46:01 +01:00
Lee Smet 880160673b Also print cli message resp in decoded form
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-06 11:26:30 +01:00
Lee Smet 67981388e1 Vendor openssl for now
To unblock musl static builds

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-03 18:03:36 +01:00
Lee Smet 5d3130c91c Add basic docs about the current message system
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-03 17:53:53 +01:00
Lee Smet 0444ef0dfa Update api.yaml
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-03 17:32:17 +01:00
Lee Smet 6f777d74f5 Rename message info fields to camelCase
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-03 17:29:42 +01:00
Lee Smet e1aa5bca5a Change reply_to into reply-to
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-03 17:26:56 +01:00
Lee Smet dfc6eef755 Correct URL when sending reply
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-03 17:22:41 +01:00
Lee Smet 548b076059 Add message subcommands
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-03 17:19:42 +01:00
Lee Smet b673611b7e Add extra documentation for --no-tun on CLI
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-03 11:42:00 +01:00
Lee Smet 0cecc5d528 Add error log if set route or addr on TUN fails
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-03 11:40:07 +01:00
Lee Smet 0d65c433f8 Correct typo when running with TUN on non linux
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-03 11:38:05 +01:00
Lee Smet cc122f4325 Enable mycelium info logging by default
Also add a flag to enable debug logging. It is no longer needed to add
the RUST_LOG=mycelium=... variable to enable logging (and it won't work
anymore to set the log level).

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-03 10:35:14 +01:00