Commit Graph

651 Commits

Author SHA1 Message Date
Lee Smet ab3626b281 Update addresses in README.md to new range
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-02-26 10:31:13 +01:00
Lee Smet 9b2edb2fee Add get_peers to CHANGELOG.md
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-02-23 16:09:10 +01:00
Lee Smet f8bc7f976f Document get_peers method in API spec
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-02-23 16:08:10 +01:00
Lee Smet 7e1d9cb85d Add get_peers method to http API
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-02-23 16:07:54 +01:00
Lee Smet 52e93ae345 Inject PeerManager in Http server
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-02-23 16:07:13 +01:00
Lee Smet fa05b80d73 Add exposed PeerStats in PeerManager
Includes info about peers we already keep track of in other structs

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-02-23 16:04:10 +01:00
Lee Smet e22272a44a Derive additional bounds on Peer related types
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-02-23 16:02:13 +01:00
Lee Smet 422a33176c Add wintun.dll to .gitignore
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-02-22 10:37:52 +01:00
Lee Smet b46d294507 Add .vs to .gitignore
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-02-22 10:36:54 +01:00
Lee Smet 80b1db1f7e Bump version to v0.4.0
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-02-22 10:05:59 +01:00
Lee Smet eb3b454dd4 Close #126: Increase packet length field size
This increases the potential max size of packet to 512K, in case we ever
want to enable TSO/GSO/GRO.

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-02-21 12:09:20 +01:00
Lee Smet 53e21522a7 Don't validate packet destination address
This previously lead to packets being dropped silently. We now
let this pass and instead rely on the route step to not find a route and
then construct a proper ICMP.

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-02-20 16:01:05 +01:00
Lee Smet 0caeda4861 Add source IP validation to CHANGELOG.md
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-02-20 15:54:54 +01:00
Lee Smet 593ca06c92 Close #81: Validate source IP of tun packet
For now validate that the IP is at least part of the global overlay. In
theory this can be restricted even further to be part of the node
subnet.

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-02-20 15:52:39 +01:00
Lee Smet 93adb94016 Specify the need for wintun.dll on Windows
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-02-20 12:50:26 +01:00
Lee Smet 9a5b7af2ef Merge pull request #124 from a-kenji/fix/typos
Fix various typos
2024-02-20 11:55:19 +01:00
Lee Smet 562566b417 Move windows support to right version in CHANGELOG
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-02-20 11:27:31 +01:00
Lee Smet 58c925c495 Close #105: Rework key file generation
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-02-20 11:26:09 +01:00
a-kenji 8fa6c830fb Fix various typos 2024-02-20 11:23:09 +01:00
Lee Smet 1e246f850a Move key save logic out of crypto
It's up to the application itself to define how a key is saved.

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-02-20 10:56:06 +01:00
Lee Smet 9e030c725d Add state of windows support 2024-02-20 10:33:51 +01:00
Lee Smet 018ed5282a Add network range change to CHANGELOG.md
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-02-19 14:09:55 +01:00
Lee Smet 35c6a75013 Change overlay IP's to be part of 400::/7
This diverts from the original design, current implementation will
propagate routes but won't be able to send data since packets not
destined to 200::/7 are dropped immediately in the local node.

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-02-19 14:00:57 +01:00
Lee Smet 1c259a6c80 Log endpoint when connection can't be established
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-02-16 14:33:24 +01:00
Lee Smet f228d28ebc Use array in Cmd.args in tun/windows add_address
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-02-15 16:53:20 +01:00
Lee Smet 995536dfcb Patch windows tunnel set address
The library does not work on windows 11 to properly set up the address.
This is caused by an incorrect `netsh` command. Manually implement the
correct command for now, until the library is patched. To be seen if
this works on windows 10

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-02-15 16:42:58 +01:00
Lee Smet eb123e5c02 Add some logging to windows tunnel setup
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-02-15 15:43:45 +01:00
Lee Smet f81eb06999 Set windows tunnel type to "Mycelium"
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-02-15 14:28:08 +01:00
Lee Smet 8468a4f48a Log node overlay IP on startup
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-02-15 14:24:48 +01:00
Lee Smet 9db124c64f Implement support for windows tunnel
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-02-14 14:53:48 +01:00
Lee Smet a16f4e4e38 Reduce tokio feature scope
Instead of using "full", we now only use the features we need. This
removes a few downstream dependencies, shortening build times slightly.

This also means the "parking_lot" feature is no longer enabled. It is
generally accepted that the default std::sync::Mutex which is now used
again by tokio is faster for the general case than the parking_lot mutex
implementation.

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-02-09 11:41:37 +01:00
Lee Smet d8568616fc Update tokio dependency to latest version
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-02-09 11:07:47 +01:00
Lee Smet 27f81f2b31 Avoid some match complexity in peer_manager
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-02-09 10:59:20 +01:00
Lee Smet 534328b1bf Group CLI arguments for node itself
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-02-09 10:57:13 +01:00
Lee Smet 9582b1b2db Bump version to v0.3.2
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-02-01 14:27:15 +01:00
Lee Smet 1090db367b Always decrement hop count when routing
Previously hop count was not decremented in the ingress path, so the
sending node was omitted in traceroute results

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-01-31 17:29:34 +01:00
Lee Smet b6145e0f48 Close #117: Add basic systemd file
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-01-31 15:04:41 +01:00
Lee Smet 7041fc2b7f Fix trailing whitespace in CHANGELOG.md
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-01-31 14:07:11 +01:00
Lee Smet baff466287 Add route selection change to CHANGELOG.md
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-01-31 14:01:35 +01:00
Lee Smet 33251c4c52 Close #95: Account for link cost in route select
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-01-31 12:56:35 +01:00
Lee Smet 34f158fdf3 Use full path for log::error on windows
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-01-31 11:31:13 +01:00
Lee Smet c7b35e5762 Split CLI functions out of main.rs
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-01-31 11:12:05 +01:00
Lee Smet e446e63a48 Ignore router field on Stack
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-01-30 16:13:14 +01:00
Lee Smet efdcd14b75 Fix darwin import path in tun module
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-01-30 16:04:38 +01:00
Lee Smet e56ed5206b Close #111: Move node setup code to lib
This avoids any actual logic in the binary only section, and prepares to
clean up the CLI.

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-01-30 15:53:24 +01:00
Lee Smet 4c3c9da45b Fix #116: Join multicast disc group on all infaces
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-01-24 15:32:26 +01:00
Lee Smet 4ade07f9a7 Fix #114: Prevent zombie quic connections
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-01-23 15:32:54 +01:00
Lee Smet 09cff9ff35 Fix obsolete return value in peer::died
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-01-23 14:32:21 +01:00
Lee Smet f5159c1834 Close #116: Terminate connection of dead peer
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-01-23 12:44:21 +01:00
Lee Smet f4cef3d84c Remove obsolete comment on peer_manager::new_ref
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-01-23 12:02:31 +01:00