aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-10-18 18:22:31 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-10-18 18:22:31 +0200
commitacffb60c1af6a30a99c969483ab46920d2fd966f (patch)
treedd5d085b421a98baf45e6ba833c276c40dccf419 /src
parentc64970ede515eb615d969bb5107b145f3f4d3a1f (diff)
msgb: Add non-inlined helper functions to ease with language bindings
It is easier from languages that dlopen libosmocore to have a function to access this data than to poke at the bytes of the struct directly. Add copyright for this method and the reset method I did earlier this year.
Diffstat (limited to 'src')
-rw-r--r--src/msgb.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/msgb.c b/src/msgb.c
index a60e2ffa..12a839a9 100644
--- a/src/msgb.c
+++ b/src/msgb.c
@@ -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
@@ -88,3 +89,13 @@ void msgb_reset(struct msgb *msg)
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;
+}