no reasonable commit message possible. tons of changes of the last 2 days
diff --git a/src/msgb.c b/src/msgb.c
index ab356de..f5330c3 100644
--- a/src/msgb.c
+++ b/src/msgb.c
@@ -22,7 +22,7 @@
#include <stdlib.h>
#include <sys/types.h>
-#include "msgb.h"
+#include <openbsc/msgb.h>
struct msgb *msgb_alloc(u_int16_t size)
{
@@ -38,7 +38,7 @@
msg->head = msg->data;
msg->data = msg->data;
/* reset tail pointer */
- msg->tail = msg->data - msg->head;
+ msg->tail = msg->data;
//msg->end = msg->tail + size;
return msg;
@@ -48,3 +48,20 @@
{
free(m);
}
+
+void msgb_enqueue(struct llist_head *queue, struct msgb *msg)
+{
+ llist_add_tail(&msg->list, queue);
+}
+
+struct msgb *msgb_dequeue(struct llist_head *queue)
+{
+ struct llist_head *lh;
+
+ if (llist_empty(queue))
+ return NULL;
+
+ lh = queue->next;
+
+ return llist_entry(lh, struct msgb, list);
+}