Commit Graph
386 Commits
Author SHA1 Message Date
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
Lee Smet 4eb1f7f8ab Fix sending READ notification
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-25 17:19:04 +02:00
Lee Smet 8bcf7aa3a3 Add debug log when sending READ notification
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-25 17:05:11 +02:00
Lee Smet ef3318b0cf Add some more logs for messages
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-25 16:47:08 +02:00
Lee Smet 318896893f Fix calculation of last chunk idx in size check
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-25 15:37:31 +02:00
Lee Smet 7646160531 Improve debug msg on CHUNK drop for small size
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-25 15:23:53 +02:00
Lee Smet 99f6835db2 Fix PacketBuffer after decryption
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-25 15:14:59 +02:00
Lee Smet 2cf1f60890 Set proper size on PacketBuffer
When working with a MessagePacket, ensure the proper size of the used
part of the underlying PacketBuffer is set.

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-25 14:49:13 +02:00
Lee Smet e09bf2603c Use correct namespace to set p6 ip
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-25 10:57:08 +02:00
Lee Smet 6be6f3ce3e Remove useless formats
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-25 10:55:51 +02:00
Lee Smet d0e31c064d Use public keys to identify parties in message API
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-25 10:54:56 +02:00
Lee Smet fa33bac9f8 Use standard base64 alphabet
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-25 10:52:00 +02:00
Lee Smet 08c46b57a2 Add HTTP API to interact with messages
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-24 17:24:12 +02:00
Lee Smet 160e9ec021 Add base64 dependency
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-24 15:48:22 +02:00
Lee Smet a7b81d6d5c Fix module doc in subnet module.
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-24 13:46:20 +02:00
Lee Smet 236673be75 Update dependencies
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-24 10:49:23 +02:00
Lee Smet b945caf503 Add axum dependency
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-24 10:47:04 +02:00
Lee Smet a4d54faba8 Fix RouteKey PartialOrd implementation
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-23 15:59:18 +02:00
Lee Smet d397a1fa26 Clean up code in message.rs
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-23 15:57:05 +02:00
Lee Smet 4cf601b22e Finish sending messages
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-23 15:35:15 +02:00
Lee Smet 848c375251 Change completed message collection to VecDequeue
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-23 15:35:15 +02:00
Lee Smet 7de0cc0bf2 Set message ID when sending init packet
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-23 15:35:15 +02:00
Lee Smet 0167df4b5e Transform chunks
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-23 15:35:15 +02:00
Lee Smet 0a00985698 Generate replies for received message packets
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-23 15:35:15 +02:00
Lee Smet c8f53562ad Implement message reassembly and checksum
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-23 15:35:15 +02:00
Lee Smet 8f319439d9 Add Blake3 dependency
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-23 15:35:15 +02:00
Lee Smet de84528351 Implement message handling
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-23 15:35:15 +02:00
Lee Smet 139fb238ba Start message processing
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-23 15:35:15 +02:00
Lee Smet 492ac7ef80 Allow access to Flags field without mutable ref
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-23 15:35:15 +02:00
Lee Smet a02725120e Take proper type in Flags PhantomData marker
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-23 15:35:15 +02:00
Lee Smet a57b85303e Add tests to see if message constructors set flags
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-23 15:35:15 +02:00
Lee Smet 64fa8758b5 Expose Flags on (mutable) message header
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-23 15:35:15 +02:00
Lee Smet 37104e46fa Add into_inner methods for message types
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-23 15:35:15 +02:00
Lee Smet 25e61c4fac Set right flag on buffer when creating messages
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-23 15:35:15 +02:00
Lee Smet 71abca419a Move flags modifiers to FlagsMut struct
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-23 15:35:15 +02:00
Lee Smet 74b80a09a9 Flesh out individual message format
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-23 15:35:15 +02:00
Lee Smet d92587c5ea Add owned MessagePacket and MessageInit
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-23 15:35:15 +02:00
Lee Smet e22abebb11 Add submodules for message types
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-23 15:35:15 +02:00
Lee Smet 8fdc0d95da Add MessagePacketMut
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-23 15:35:15 +02:00
Lee Smet 72c6b331a9 Add flag setters to MessagePacketHeaderMut
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-23 15:35:15 +02:00
Lee Smet 8c57334394 Access message id through buffer
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-23 15:35:15 +02:00
Lee Smet 8f7ba1a813 Add header struct fo rmessage packet
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-23 15:35:15 +02:00
Lee Smet c4b3f4c3ea Initial message structure
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-10-23 15:35:15 +02:00
kristof de spiegeleer 4085037dd4 Update LICENSE
Signed-off-by: kristof de spiegeleer <kristof@incubaid.com>
2023-10-12 05:41:25 +03:00
Lee Smet 63cebcd47b Add missing constants
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-27 15:13:30 +02:00
Lee Smet 979ed476cb Remove etherparse dependency
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-27 15:04:51 +02:00
Lee Smet ad95fb2712 Improve src and dst ip extraction
Since we only care about these fields, don't parse the full header

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-27 15:02:08 +02:00
Lee Smet 39ac4ebd0d Correct typo on peer constant
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-27 11:22:49 +02:00