100 Commits
Author SHA1 Message Date
zambyte 4b09e13079 Release 0.2.2 2026-04-15 21:58:25 -04:00
zambyte 91fdb2c6f8 refactor: use packed struct for IpAddr
This is more intuitive than using u32 directly, and follows the same pattern as the new MAC addr handling
2026-04-16 04:56:23 +03:00
zambyte 7077aae9ce fix: convert MacAddr from vector to int
Still expose a vector / slice API with .fromSlice,
2026-04-16 04:56:23 +03:00
zambyte 1f500b9b0a Remove any possible exit paths from main loop. 2026-04-08 22:40:58 -04:00
zambyte cbbd710b9d Release 0.2.1 2026-02-04 20:39:59 -05:00
zambyte 974baf0274 Keep retrying if there is no interface 2026-02-05 01:38:24 +00:00
zambyte e744a44317 Remove test branch trigger 2026-02-04 12:18:45 -05:00
zambyte f202410f0d Include license and readme in build output
This is probably required for GPL compliance :-D
2026-02-03 23:06:30 -05:00
zambyte 9dcbc44aa1 ReleaseSmall by default 2026-02-03 22:50:24 -05:00
zambyte d1fdf0c1be Automatically publish binaries to nextcloud
Updated the releases directory to use a specific account for releases
2026-02-03 22:44:53 -05:00
zambyte f13221133d Set dev version to 0.0.0 2026-02-01 21:10:50 -05:00
zambyte d1ca448835 Release v0.2.0 2026-02-01 21:02:39 -05:00
zambyte 2c9e648c2c Clean API and add docs 2026-02-01 21:02:38 -05:00
zambyte 558f40213b Update to Saprus 0.2.1
Handle management messages instead of letting them bubble up through the
connection to the consumer.
Right now, this just means handling ping messages by sending a pong.

Also updated to follow the new handshake flow.
The sentinel will mirror the ports instead of matching them.

Now filters on the full source and dest ports, which are less likely to
have erroneous matches.
2026-02-01 19:16:22 -05:00
zambyte daf18d3552 Exec command directly if subshell fails
If execing the child fails, it might be because the shell doesn't exist.
Try running the command directly before giving up.
2026-01-31 21:43:27 -05:00
zambyte 4f721afcfd Add GPLv3 2026-01-31 20:27:55 -05:00
zambyte f554e7a3bb Kill process after 10 messages or 3 seconds 2026-01-25 23:49:09 -05:00
zambyte 19c2b78d1d Connection by default 2026-01-25 01:14:02 -05:00
zambyte 3c5f34d5c2 Set timeouts instead of sleeping 2026-01-24 21:14:40 -05:00
zambyte 09152377ed Fix reconnection
Was failing to reconnect due to trying to reuse the same socket that
already had a BPF filter on it.
2026-01-24 20:14:22 -05:00
zambyte c3b17f8267 Better error handling and debug logging 2026-01-24 19:17:43 -05:00
zambyte cf365673b5 Retry timing
Wait 2 minutes if trying for initial connect. Wait 10 minutes if
connection to sentinel has timed out
2026-01-24 18:54:01 -05:00
zambyte 16fd65e281 Add C API 2026-01-24 17:16:06 -05:00
zambyte 8965a4d5d4 Skip empty stdin 2026-01-24 14:42:37 -05:00
zambyte ba8a84c478 Don't create dangling references
Apparently things die at the end of blk scopes.
2026-01-24 14:34:19 -05:00
zambyte 19d4e88c33 Chunk stdin 2026-01-24 13:11:02 -05:00
zambyte 3577d538b8 Chunk relay input
This makes it possible to chunk connection command output to a relay
command to direct it somewhere like discord
2026-01-24 11:28:18 -05:00
zambyte fc9c5bcd5d Chunk messages to 1000 byte payloads 2026-01-24 11:28:18 -05:00
zambyte 157afa13b1 Fix checksum issue 2026-01-24 10:40:33 -05:00
zambyte a81c4b3175 Calculate IPv4 checksum header
This was causing an issue because virtual networks were dropping packets
without this being set
2026-01-23 23:05:20 -05:00
zambyte 43f7497424 Simplify tagged union 2026-01-23 22:17:21 -05:00
zambyte 213a01afc8 Implemented client and connection 2026-01-21 22:25:20 -05:00
zambyte 067a11ab23 Move RawSocket and clean it up 2026-01-20 23:21:35 -05:00
zambyte 6db4204bf0 Set don't fragment, and use random id 2026-01-20 22:08:10 -05:00
zambyte def8454012 Reconnect on timeout 2026-01-19 19:05:03 -05:00
zambyte 4106679262 things are SOOOO good.... 2026-01-19 17:55:54 -05:00
zambyte 01f44949f1 base64 encode payload and don't require connection playload 2026-01-19 17:16:29 -05:00
zambyte 19126f1203 Attach BPF filter to get all the saprus messages 2026-01-19 17:04:08 -05:00
zambyte fec468c508 Complete handshake badly 2026-01-19 15:06:25 -05:00
zambyte 9359fefdf7 Add real RawSocket deinit 2026-01-19 14:45:29 -05:00
zambyte f969d097ab Detect interface and use real mac 2026-01-19 14:43:44 -05:00
zambyte cc765dc91b Start adding connection message 2026-01-19 14:08:27 -05:00
zambyte abf2cfb366 use disc as default dest 2026-01-19 13:00:28 -05:00
zambyte c66b95bf89 Write relay message to the network 2026-01-19 12:59:21 -05:00
zambyte d7dedd243e construct full message 2026-01-19 12:30:08 -05:00
zambyte 9947c21b4c Arrange bytes for relay 2026-01-19 12:12:23 -05:00
zambyte 8a53c7366a 2026-01-18 17:20:44 -05:00
zambyte a33a96dafd start doing packet stuff 2026-01-17 21:38:23 -05:00
zambyte 1a817df18d Mostly done with parsing and serializing messages 2026-01-17 16:06:47 -05:00
zambyte 0d9c0c33fa 2026-01-14 19:34:35 -05:00
zambyte b3f1b00510 start porting to 0.16.0 2026-01-11 18:06:36 -05:00
zambyte 7a8874ea6a doing some shenanigans
trying to start writing my own function to do raw socket connections
2026-01-10 21:17:46 -05:00
zambyte b39603522f 2025-11-14 14:47:56 -05:00
zambyte fc329d1064 2025-10-13 13:28:41 -04:00
zambyte 3abe3095e6 Remove prints 2025-10-12 21:40:23 -04:00
zambyte d6da3cd31b IT'S RIGHT 2025-10-12 21:13:42 -04:00
zambyte fe166d2106 Start breaking out net logic to NetWriter 2025-10-12 18:05:34 -04:00
zambyte 439ee00444 Simplify RawSocketWriter
Does not need to use an allocator anymor.
Just uses the internal buffer properly.
2025-10-12 18:02:56 -04:00
zambyte 0da7bbda5b Cleanup and use random mac 2025-10-12 14:16:57 -04:00
zambyte b06cb6dada it works well! 2025-09-23 16:22:57 -04:00
zambyte b8313e4fa4 2025-09-23 15:01:12 -04:00
zambyte b5efbd6e16 Write ether headers properly 2025-09-23 14:16:55 -04:00
zambyte 30243db5c9 2025-09-23 13:33:17 -04:00
zambyte c673401c2a Use writer instead of RawSocket in Client 2025-09-09 22:30:31 -04:00
zambyte 74b0c9ef1f Use 0.15.1 for application 2025-09-09 20:19:48 -04:00
zambyte 0778889af5 Upgrade deps to 0.15.1 2025-09-09 17:32:59 -04:00
zambyte 56b6b8a386 Use Client as var type instead of singleton 2025-05-11 13:52:42 -04:00
zambyte 14ed0bc3f3 Fix issue returning stack pointer 2025-05-11 13:40:55 -04:00
zambyte c72503fce6 Fix extra bytes in connection message. 2025-05-11 13:40:23 -04:00
zambyte 373dbebc8c Add broadcast initial interest using raw sockets
Use this from the relay message
2025-05-11 11:40:15 -04:00
zambyte cde289d648 Update gatorcat dep and use bytes for broadcast message
The latter is helpful for the lifetime of the message.
2025-05-11 10:12:26 -04:00
zambyte 716fb466fa Remove allocation for messages 2025-05-10 21:46:53 -04:00
zambyte 583f9d8b8f Add comments and fix tests
Also added networkBytesAsValue and restored bytesAsValue.
These are useful for treating the bytes from the network directly as a Message.
Otherwise, the init function would overwrite the packet type and length to be correct.
I would like the message handling to fail if the message body is incorrect.
2025-05-10 21:46:53 -04:00
zambyte 56e72928c6 fix use after free 2025-05-10 21:46:53 -04:00
zambyte a80c9abfe7 Attempt to base64 encode the connection payload
For some reason I am still getting this:

2025/05/10 16:37:06 Error decoding message: SGVsbG8gZGFya25lc3MgbXkgb2xkIGZyaWVuZA==::53475673624738675a4746796132356c63334d6762586b676232786b49475a79615756755a413d3daaaa
2025-05-10 21:46:53 -04:00
zambyte 245dab4909 Use slice for init, and add better error sets.
The slice sets us avoid allocating within the init function.
This means init can't fail, and it also makes it easier to stack allocate messages (slice an array buffer, instead of creating a stack allocator).
2025-05-10 21:46:53 -04:00
zambyte cde5c3626c 2025-05-10 21:46:53 -04:00
zambyte e84d1a2300 2025-05-10 21:46:53 -04:00
zambyte 1b7d9bbb1a Remove bytesAsValueUnchecked
Callers can instead use std.mem.bytesAsValue directly.
2025-05-10 21:46:53 -04:00
zambyte 1512ec1a86 Cleanup asBytes and test it 2025-05-10 21:46:53 -04:00
zambyte f1dce257be Simplify init interface 2025-05-10 21:46:53 -04:00
zambyte bcab1e4d00 2025-05-10 21:46:53 -04:00
zambyte 0e8f016978 Align the bytes instead of the struct 2025-05-10 21:46:53 -04:00
zambyte fc53e87389 2025-05-10 21:46:53 -04:00
zambyte cbf554e853 2025-05-10 21:46:53 -04:00
zambyte 775212013f 2025-05-10 21:46:53 -04:00
zambyte 339ac5cfe5 2025-05-10 21:46:53 -04:00
zambyte eacfaffb6b 2025-05-10 21:46:53 -04:00
zambyte 1731b2e643 2025-05-10 21:46:53 -04:00
zambyte dae66a0039 Starting real connections 2025-05-10 21:46:53 -04:00
zambyte 683a2015b0 Use FAIL as the default dest if unable to parse 2025-04-27 18:03:06 -04:00
zambyte c34748dab3 Add CLI to specify dest for relay messages
The dest can be specified as a 4 char ASCII string, or as an IPv4 address.
2025-04-19 22:26:32 -04:00
zambyte 5b88f0df6a Rename Saprus to Client internally 2025-04-14 07:13:09 -04:00
zambyte 23f7ad8f94 Break out the impl to a lib
This will make it easier to make a C library.
2025-04-13 17:14:18 -04:00
zambyte 8779b29149 Do some things for invy 2025-04-13 16:41:20 -04:00
zambyte 0f4a7c9bcd Use dynamic array instead of arraylist
we know the size (assuming the len is correct) so we can preallocate the whole array
2025-04-06 21:33:00 -04:00
zambyte 2302e6930d Depend on clap the same way as network 2025-04-06 13:08:09 -04:00
zambyte 935e552a59 Don't print help after sending message 2025-04-06 13:08:09 -04:00
zambyte 3424217539 Add comment for cli example reference 2025-04-06 13:08:09 -04:00
zambyte dcb962593d Allow caller to specify what kind of message to send with arg 2025-04-06 13:08:09 -04:00