diff options
author | Ian Moffett <ian@osmora.org> | 2025-09-25 22:47:48 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-09-25 22:47:48 -0400 |
commit | 9895b548037cb63de561594d517520c738b31943 (patch) | |
tree | 067364b9d65c927d54a283c6af1d6b5b8d01f839 /src/dgram/dgram_subr.c | |
parent | 262f87964fbf2af6e7d085b5d1231254367a13ca (diff) |
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 <ian@osmora.org>
Diffstat (limited to 'src/dgram/dgram_subr.c')
-rw-r--r-- | src/dgram/dgram_subr.c | 3 |
1 files changed, 2 insertions, 1 deletions
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; |