Commit Graph

433 Commits

Author SHA1 Message Date
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
Lee Smet 69ae5648b0 Allow compilation on non linux platforms
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-02 18:21:30 +01:00
Lee Smet aac6081e6e Add reply methods to API spec
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-02 17:46:33 +01:00
Lee Smet 90a9f2781c Add message reply functions
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-02 17:30:04 +01:00
Lee Smet e2e4e93205 Improve printing of routes/sources
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-02 14:30:31 +01:00
Lee Smet c9b2a7672f Trunate node subnet
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-02 13:28:50 +01:00
Lee Smet bf76a1d702 Check for peer equality by checking Arc pointers
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-02 12:58:56 +01:00
Lee Smet c45ece2bf0 Rework peer to reduce size in memory
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-02 12:01:12 +01:00
Lee Smet 29a6e35cf1 Clean up peer manager
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-11-02 11:34:54 +01:00
Lee Smet fab8d02965 Specify --no-tun flag in README.md
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-30 10:16:34 +01:00
Lee Smet 7d4628a295 Fix api doc LICENSE link
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-27 16:12:07 +02:00
Lee Smet 7b65d6cf63 Expand README.md with new features
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-27 16:11:06 +02:00
Lee Smet b19dff33b7 Properly make TransmissionState lowercase in API
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-27 15:50:29 +02:00
Lee Smet d0c8a813d5 Allow long poll when reading new messages
Also unify the peek and pop handlers

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-27 15:45:51 +02:00
Lee Smet def11c5a6e Make status variable of message lowercase in API
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-27 13:08:06 +02:00
Lee Smet b01d7f0fb3 Allow sending messages to public keys as well
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-27 13:05:33 +02:00
Lee Smet c653c6be23 Add SRC and DST IP when peeking/popping message
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-27 11:37:37 +02:00
Lee Smet 0bb0ec740f Add warning log when starting without TUN
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-27 11:05:44 +02:00
Lee Smet 08db57a6a0 Update message API doc paths
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-27 11:05:33 +02:00
Lee Smet bf983cd847 Add /api/v1 route prefix to message routes
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-27 11:01:32 +02:00
Lee Smet 9a4e81d6e5 Allow starting the system without creating TUN
This means only the message subsystem is exposed

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-27 10:44:31 +02:00
Lee Smet 8bb067e921 Add .vscode to .gitignore
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-26 13:59:00 +02:00
Lee Smet e8cb8b425c Remove .vscode dir
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-26 13:58:29 +02:00
Lee Smet 94eb831227 Add initial API spec
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-26 13:54:36 +02:00
Lee Smet a417df8d5a Use NOT_FOUND for status when id doesn't exist
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-26 11:37:57 +02:00