summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2022-03-26 09:39:49 +0100
committerSander Vrijders <sander@ouroboros.rocks>2022-03-30 15:05:05 +0200
commit63dde087796bfcd730508b069ebae7c79b7cebe8 (patch)
treee5e338b9583d023c5895ed0d3a20b679fae76ddf /include
parent0b45e1e5363f61febc7033f1b9bda14689c88644 (diff)
downloadouroboros-63dde087796bfcd730508b069ebae7c79b7cebe8.tar.gz
ouroboros-63dde087796bfcd730508b069ebae7c79b7cebe8.zip
lib: Refactor reading packet from rbuff
Reading packets from the rbuff and checking their validity (non-zero size, pass crc check, pass decryption) is now extracted into a function. Also adds a function to get the length of an sdu_du_buff instead of subtracting the tail and head pointers. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'include')
-rw-r--r--include/ouroboros/shm_du_buff.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/ouroboros/shm_du_buff.h b/include/ouroboros/shm_du_buff.h
index da350055..0b83f913 100644
--- a/include/ouroboros/shm_du_buff.h
+++ b/include/ouroboros/shm_du_buff.h
@@ -34,6 +34,8 @@ uint8_t * shm_du_buff_head(struct shm_du_buff * sdb);
uint8_t * shm_du_buff_tail(struct shm_du_buff * sdb);
+size_t shm_du_buff_len(struct shm_du_buff * sdb);
+
uint8_t * shm_du_buff_head_alloc(struct shm_du_buff * sdb,
size_t size);