debian: Updates to fix lintian errors
[osmocom-bb.git] / src / msgb.c
index 60af373..f9841ed 100644 (file)
@@ -1,4 +1,5 @@
 /* (C) 2008 by Harald Welte <laforge@gnumonks.org>
+ * (C) 2010 by Holger Hans Peter Freyther <zecke@selfish.org>
  * All Rights Reserved
  *
  * This program is free software; you can redistribute it and/or modify
 #include <unistd.h>
 #include <string.h>
 #include <stdlib.h>
-#include <sys/types.h>
 
-#include <osmocore/msgb.h>
+#include <osmocom/core/msgb.h>
 //#include <openbsc/gsm_data.h>
-#include <osmocore/talloc.h>
+#include <osmocom/core/talloc.h>
 //#include <openbsc/debug.h>
 
 void *tall_msgb_ctx;
@@ -80,10 +80,26 @@ void msgb_reset(struct msgb *msg)
        msg->head = msg->_data;
        msg->tail = msg->_data;
 
-       msg->bts_link = NULL;
        msg->trx = NULL;
        msg->lchan = NULL;
        msg->l2h = NULL;
        msg->l3h = NULL;
-       msg->smsh = NULL;
+       msg->l4h = NULL;
+
+       memset(&msg->cb, 0, sizeof(msg->cb));
+}
+
+uint8_t *msgb_data(const struct msgb *msg)
+{
+       return msg->data;
+}
+
+uint16_t msgb_length(const struct msgb *msg)
+{
+       return msg->len;
+}
+
+void msgb_set_talloc_ctx(void *ctx)
+{
+       tall_msgb_ctx = ctx;
 }