Commit Graph

37 Commits

Author SHA1 Message Date
de1c34608a Receive and print the response from the sentinel 2025-04-05 23:23:42 -04:00
dc805e4f31 Initial awaiting for handshake response
seems like i might be getting my own initial connection?
I get a response even without the sentinal running.
2025-04-05 22:38:39 -04:00
34b7305d13 Start proper connection handshake 2025-04-05 21:24:02 -04:00
ba20aab4c8 Move binary back to zaprus
Also clean up the args for the aux functions by computing the type instead of passing it
2025-04-05 17:49:24 -04:00
293195246c Correctly handle the endiness and packedness of the the header reading and writing 2025-04-05 16:27:34 -04:00
a8e633bd45 Write the header as a packed int
this seems like the best way to do it.
2025-04-05 13:09:42 -04:00
5bd92f7e81 Not using writer
Use direct mem copying into the buf instead of writing to it with the writer interface.
Probably better to use the writer actually, since this suffers from the same issue with the extra two null bytes.
2025-04-05 01:24:35 -04:00
77e3399a49 Initial testing of connection message 2025-04-04 23:59:44 -04:00
9d38320897 Move sendRelay logic to Saprus struct 2025-04-04 22:54:06 -04:00
2965f9aaf7 Break relay into a specific program 2025-04-04 22:41:29 -04:00
20816ab571 Move types to their own file
Make it so I can specify the payload message
2025-04-04 21:54:05 -04:00
3584f3480d GREATLY improve clarity 2025-04-04 21:15:12 -04:00
b9a6febd71 Move dba to top level scope
This makes it so references to it are lazily compiled, so I can throw a compileError if it is referenced in the wrong mode.
2025-04-03 21:16:49 -04:00
e402970ab2 add comments!!!!! 2025-04-03 17:09:46 -04:00
797624377a move aux funcs back into the union
also move the body of the base64 handling back to the only place it is used now
2025-04-03 16:21:33 -04:00
3d8fa5e33c Remove redundant comptime
Move edge together at the end of the switch
2025-04-03 16:08:05 -04:00
0a441d2bce Properly initialize the SaprusMessage fromBytes
Will actually use the provided packet type inline.
2025-04-03 16:02:31 -04:00
748991d35b dedup some
Still need to clean up fromBytesAux
2025-04-03 16:02:31 -04:00
f1fa898299 Break out encoding and decoding into its own functions 2025-04-03 16:02:31 -04:00
62c0b1aab0 Add decoding connection messages 2025-04-03 16:02:31 -04:00
6e61e353e5 Add packet decoding
Big bug where I was setting the payload length do be the pre-encoded size rather than the encoded size.
2025-04-03 16:02:31 -04:00
8dc3e5d949 Small cleanup
Rename allocator to gpa (general purpose allocator) and move DebugAllocator type out of main
2025-04-03 11:29:44 -04:00
0d8155f0af Remove unnecessary explicit cast
Remove unnecessary Self declaration.
2025-04-03 11:02:55 -04:00
50859a22dc Specify endianness when writing the header struct 2025-04-03 10:33:07 -04:00
5f939c37af Explicitly specify the size of connection options
This makes it so specifying the wrong number of options would actually throw a compile time error.
2025-04-03 10:28:48 -04:00
322d0b3a52 Clean up string handling 2025-04-03 10:23:15 -04:00
4fc8ec4087 Make header always a packed struct
This lets us easily use the same writeStructe(header) pattern to write the header for each message type.
2025-04-03 10:16:16 -04:00
6a6c3c8519 Base64 encode relay message
write the packed connection struct directly instead of each of the fields.
2025-04-02 23:43:35 -04:00
fc06420746 Add connection message type 2025-04-02 23:26:57 -04:00
62e6fbbff6 Remove tests 2025-04-02 23:00:25 -04:00
e07de8564c Working with nice union
This let's us easily use a single type for all Saprus messages, and unwrap the specific type with a switch.
2025-04-02 22:59:18 -04:00
6a9a57a690 it works! 2025-04-02 22:05:10 -04:00
ab8792efce Getting some data but malformed
This is what the data shows up in the sentinal looking like:

2025/04/02 22:36:32 Error decoding message: Hello darkness my old friend::48656c6c6f206461726b6e657373206d79206f6c6420667269656e64aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
2025/04/02 22:36:32 INFO: Relay message received: Hello darkness my old friend
2025-04-02 18:36:45 -04:00
7b7c466690 Add msgs with toBytes functions 2025-04-02 18:09:24 -04:00
18763983e2 Added network dep 2025-04-02 18:08:22 -04:00
3354a85c1a Remove lib 2025-04-02 18:08:22 -04:00
6cecaecf39 Initial commit 2025-04-02 17:26:16 -04:00