From 9895b548037cb63de561594d517520c738b31943 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Thu, 25 Sep 2025 22:47:48 -0400 Subject: link: Introduce squeaking (peer discovery) A machine may decide to squeak at another machine, those who are listening shall squeak back to announce their presence on the wire. Signed-off-by: Ian Moffett --- src/dgram/dgram_subr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/dgram/dgram_subr.c') diff --git a/src/dgram/dgram_subr.c b/src/dgram/dgram_subr.c index fda8178..a4712d5 100644 --- a/src/dgram/dgram_subr.c +++ b/src/dgram/dgram_subr.c @@ -34,7 +34,7 @@ #include "crc.h" int -dgram_load(uint16_t length, uint8_t port, struct onet_dgram *res) +dgram_load(uint16_t length, uint8_t port, uint8_t type, struct onet_dgram *res) { if (res == NULL) { return -EINVAL; @@ -43,6 +43,7 @@ dgram_load(uint16_t length, uint8_t port, struct onet_dgram *res) memset(res, 0, sizeof(*res)); res->length = (length >> 8) & 0xFF; res->length |= (length & 0xFF) << 8; + res->type = type; res->port = port; res->crc32 = crc32(res, sizeof(*res) - sizeof(res->crc32)); return 0; -- cgit v1.2.3