-static int enough_space(size_t nbytes, size_t loaded)
-{
- return nbytes + loaded < UDP_RECV_CHUNK_SIZE;
-}
-
-static int add_rn_output(struct receiver_node *rn, char *buf, size_t len)
-{
- if (!len)
- return 1;
- if (!enough_space(len, rn->loaded))
- return -E_UDP_OVERRUN;
- memcpy(rn->buf + rn->loaded, buf, len);
- rn->loaded += len;
- return 1;
-}
-