Add CLI to specify dest for relay messages

The dest can be specified as a 4 char ASCII string, or as an IPv4 address.
This commit is contained in:
2025-04-19 22:25:52 -04:00
parent 5b88f0df6a
commit c34748dab3
2 changed files with 23 additions and 3 deletions

View File

@@ -39,10 +39,10 @@ fn broadcastSaprusMessage(msg: SaprusMessage, udp_port: u16, allocator: Allocato
_ = try sock.sendTo(dest_addr, msg_bytes);
}
pub fn sendRelay(payload: []const u8, allocator: Allocator) !void {
pub fn sendRelay(payload: []const u8, dest: [4]u8, allocator: Allocator) !void {
const msg = SaprusMessage{
.relay = .{
.header = .{ .dest = .{ 70, 70, 70, 70 } },
.header = .{ .dest = dest },
.payload = payload,
},
};