Add mbuf enqueue/dequeue functions

This commit is contained in:
Nils O. Selåsdal
2015-05-05 00:06:28 +02:00
parent e922e60849
commit 5e2b1e2d0d
3 changed files with 71 additions and 2 deletions
+13 -1
View File
@@ -181,7 +181,7 @@ uint8_t *uc_mbuf_put(struct MBuf *mbuf, uint32_t size);
* data in the buffer, retreating the head pointer by size butes
* You need to insert the size bytes in the returned pointer.
*
* @oaram size bytes to prepend to the buffer
w* @oaram size bytes to prepend to the buffer
* @return NULL if the mbuf does not have enough headroom
*/
uint8_t *uc_mbuf_push(struct MBuf *mbuf, uint32_t size);
@@ -214,4 +214,16 @@ static UC_INLINE uint8_t *uc_mbuf_head(struct MBuf* mbuf)
return mbuf->head;
}
/** Add the mbuf at the end of the tailq.
* This uses the tailQ entry member of the mbuf.
*/
void uc_mbuf_enqueue(struct MBuf *mbuf, struct TailQ *head);
/** Remove and return the mbuf at the start of the tailq.
* @return the first mbuf in the queue, or NULL if ti isempty.
*/
struct MBuf *uc_mbuf_dequeue(struct TailQ *head);
#endif