From d3a028cf07f28204b5e7bee74beee3053def15fa Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Thu, 25 Sep 2025 00:27:21 -0400 Subject: dgram: Add datagram send interface Signed-off-by: Ian Moffett --- src/include/dgram.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/include') diff --git a/src/include/dgram.h b/src/include/dgram.h index 93b20e3..e67eee6 100644 --- a/src/include/dgram.h +++ b/src/include/dgram.h @@ -32,6 +32,9 @@ #include #include "if_ether.h" +#include "link.h" + +typedef int16_t tx_len_t; /* * Represents an ONET datagram @@ -84,4 +87,16 @@ struct onet_dgram { */ int dgram_load(uint16_t length, uint8_t port, struct onet_dgram *res); +/* + * Send a datagram through ONET + * + * @link: The ONET link to send data over + * @buf: The buffer containing data to send + * @len: Length of buffer to send + * + * Returns the number of bytes transmitted on success, otherwise + * a less than zero value on failure. + */ +tx_len_t dgram_send(struct onet_link *link, void *buf, uint16_t len); + #endif /* DGRAM_H */ -- cgit v1.2.3