summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-09-25 00:27:21 -0400
committerIan Moffett <ian@osmora.org>2025-09-25 00:27:21 -0400
commitd3a028cf07f28204b5e7bee74beee3053def15fa (patch)
tree41670bff1e83f31712cbb9c5e5517001fca5d477 /src/include
parenta32ba9a351f7fa4de0d30e55cf122552bce2c015 (diff)
dgram: Add datagram send interface
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/dgram.h15
1 files changed, 15 insertions, 0 deletions
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 <stdint.h>
#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 */