Lee Smet
459de51493
Use Peer instead of RouteKey in entry_mut
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-07-03 11:59:58 +02:00
Lee Smet
906d8f2d85
Add more structured traces
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-07-03 11:51:07 +02:00
Lee Smet
bb5bcc1089
Change some logs to strucutred traces
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-07-03 10:48:00 +02:00
Lee Smet
17c8d6f468
Use Display impl to log fields in structured log
...
Where we already use it, use the % sigil to inform tracing we want to
use the display impl of the fields to log them.
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-07-03 10:39:22 +02:00
Lee Smet
63e6b62fb7
Add Display impl for SeqnoRequest
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-07-03 10:38:23 +02:00
Lee Smet
5acb0b09d5
Use dedicated unselect method in router
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-07-03 10:20:02 +02:00
Lee Smet
70ddd49053
Remove unused RouteList::entry method
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-07-03 10:19:42 +02:00
Lee Smet
c3fd23469f
Remove leftover allow(dead_code) module attribute
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-07-03 10:18:53 +02:00
Lee Smet
4b94d05f53
Remove unused IndexMut import
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-07-03 10:18:24 +02:00
Lee Smet
6b10c033fd
Add unselect method
...
Just makes sure no route is selected for a list of routes to a subnet
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-07-03 10:17:18 +02:00
Lee Smet
2765b97aec
Fix doc comment typo
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-07-03 10:13:14 +02:00
Lee Smet
2f06bff7f8
Rework update handler to get entry more directly
...
Previously we got the index of a possible entry and then loaded the
entry (using the now removed IndexMut impl). Now we just get the entry
and unwrap it based on it's internal value.
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-07-03 10:11:04 +02:00
Lee Smet
e59152abe0
Add RouteEntryGuard::is_some method
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-07-03 10:10:38 +02:00
Lee Smet
ac5c87f664
Remove broken IndexMut for RouteList
...
Since it returned a &mut RouteEntry instead of a RouteEntryGuard, items
returned by it are not updated, so outright remove it.
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-07-03 10:02:03 +02:00
Lee Smet
f2198ee116
Use dedicated selected method of RouteList
...
Instead of iterating, which is wastefull since the RouteList internally
keeps the selected route as the first element (if one exists).
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-07-02 14:43:23 +02:00
dependabot[bot]
b1f9f5203a
Bump serde_json from 1.0.117 to 1.0.120 in /myceliumd
...
Bumps [serde_json](https://github.com/serde-rs/json ) from 1.0.117 to 1.0.120.
- [Release notes](https://github.com/serde-rs/json/releases )
- [Commits](https://github.com/serde-rs/json/compare/v1.0.117...v1.0.120 )
---
updated-dependencies:
- dependency-name: serde_json
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com >
2024-07-02 11:37:15 +02:00
dependabot[bot]
172ca1d068
Bump clap from 4.5.7 to 4.5.8 in /myceliumd
...
Bumps [clap](https://github.com/clap-rs/clap ) from 4.5.7 to 4.5.8.
- [Release notes](https://github.com/clap-rs/clap/releases )
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md )
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.7...v4.5.8 )
---
updated-dependencies:
- dependency-name: clap
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com >
2024-07-02 11:36:55 +02:00
dependabot[bot]
f8a95840a5
Bump clap from 4.5.7 to 4.5.8 in /myceliumd-private
...
Bumps [clap](https://github.com/clap-rs/clap ) from 4.5.7 to 4.5.8.
- [Release notes](https://github.com/clap-rs/clap/releases )
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md )
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.7...v4.5.8 )
---
updated-dependencies:
- dependency-name: clap
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com >
2024-07-02 11:36:09 +02:00
dependabot[bot]
83aedcb7d3
Bump serde_json from 1.0.117 to 1.0.120 in /myceliumd-private
...
Bumps [serde_json](https://github.com/serde-rs/json ) from 1.0.117 to 1.0.120.
- [Release notes](https://github.com/serde-rs/json/releases )
- [Commits](https://github.com/serde-rs/json/compare/v1.0.117...v1.0.120 )
---
updated-dependencies:
- dependency-name: serde_json
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com >
2024-07-02 11:34:52 +02:00
Lee Smet
5c2bb2d52c
Simplify expired route if check
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-07-02 11:24:00 +02:00
Lee Smet
e05853c915
Demote seqno cache duplicate request WARN to DEBUG
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-07-02 11:07:20 +02:00
Lee Smet
dbc11a6804
Remove exists flag on RoutingTableIterEntryMut
...
The flag is not needed, since these types are always the result of an
iterator, therefore the returned value always exists.
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-07-02 11:01:28 +02:00
Lee Smet
a08865909b
Reduce the seqno cache backing allocation on sweep
...
The cache seems to stay small when observed on nodes connected to the
network, but still it's good practice to clean up after ourselves. For
now we aggressively shrink as much as possible since the cache is
generally small. If needed (i.e. it is found the cache adds a bunch of
noticeable overhead), we can choose to make this less aggressive in the
future.
Closes #291
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-07-01 16:03:03 +02:00
Lee Smet
42f87b519b
Setup inbound quic connections in separate futures
...
Since the full setup requires waiting for a client to send data, move
this to a separate future collection which gets polled next to the main
accept future. Also limit the amount of time the future is allowed to
take by wrapping it in a timeout.
Fixes #309
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-07-01 15:08:45 +02:00
Lee Smet
da19bd9977
Update lockfiles with updated dependency
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-07-01 11:29:48 +02:00
dependabot[bot]
0427897050
Bump netdev from 0.28.0 to 0.29.0
...
Bumps [netdev](https://github.com/shellrow/netdev ) from 0.28.0 to 0.29.0.
- [Release notes](https://github.com/shellrow/netdev/releases )
- [Commits](https://github.com/shellrow/netdev/compare/v0.28.0...v0.29.0 )
---
updated-dependencies:
- dependency-name: netdev
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com >
2024-07-01 11:27:31 +02:00
Lee Smet
6cc4b5de93
Add reworked route table to CHANGELOG.md
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-06-28 10:46:06 +02:00
Lee Smet
962c890418
Update comment for increased defealt link cost
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-06-28 10:44:49 +02:00
Lee Smet
3c0f183642
Fix stale comment in router
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-06-28 10:32:30 +02:00
Lee Smet
76c4bc3024
Add missing doc comment on routing table iterator
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-06-28 10:28:58 +02:00
Lee Smet
811f020bd4
Add missing struct docs to RoutingTable::iter_mut
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-06-28 10:28:58 +02:00
Lee Smet
3e13d184b0
Reduce scope of write access to routing table
...
Since selecting subnets takes write locks for each subnets, make sure we
aren't holding one currently.
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-06-28 10:28:58 +02:00
Lee Smet
ad9cf0d867
Fix transmute type in routing_table::iter_mut
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-06-28 10:28:58 +02:00
Lee Smet
db3379712d
Implement mutable iterator for routing table
...
This solves the previous issue using a read only iterator and attempting
to write updates. Since the iterator keeps a read handle, this causes a
deadlock on the second update.
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-06-28 10:28:58 +02:00
Lee Smet
36cd5e5db6
Move RouteEntry to submodule
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-06-28 10:28:58 +02:00
Lee Smet
49e397969c
Move RouteKey to submodule
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-06-28 10:28:58 +02:00
Lee Smet
34e4a7b5a7
Drop route entry guard before triggered_updates
...
Also drop it in places we didn't do so yet
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-06-28 10:28:58 +02:00
Lee Smet
7f337897f5
Drop route entries before triggered update
...
Since the changes are reflected once the guard is dropped, we need to
make sure this happens first
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-06-28 10:28:58 +02:00
Lee Smet
04e537d8d4
Actually select routes
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-06-28 10:28:58 +02:00
Lee Smet
487ef4c1be
Inline deprecated select_best_route method
...
Since it now just forwards a call to RoutingTable it can be inlined on
th call site.
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-06-28 10:28:58 +02:00
Lee Smet
6c2b8e5d5e
Add pubkey and shared secret lookup for routes
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-06-28 10:28:58 +02:00
Lee Smet
e35b07b4e0
Fix source table tests
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-06-28 10:28:58 +02:00
Lee Smet
0eed34bc57
Save SharedSecret on RouteEntry
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-06-28 10:28:58 +02:00
Lee Smet
7ba424a983
Add method to get best route entries for IP
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-06-28 10:28:58 +02:00
Lee Smet
537618c0b2
Continue new routing table integration
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-06-28 10:28:58 +02:00
Lee Smet
723b5c950b
Add iter method to RoutingTable
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-06-28 10:28:58 +02:00
Lee Smet
16b1ae1de8
Start implementing new routing table in router
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-06-28 10:28:58 +02:00
Lee Smet
af44fa9c08
Clean up new routing table imports
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-06-28 10:28:58 +02:00
Lee Smet
a201b14414
Add method to get selected route entry mutably
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-06-28 10:28:58 +02:00
Lee Smet
18b97122a9
Add setter for RouterId on RouteEntry
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com >
2024-06-28 10:28:58 +02:00