diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2015-11-27 13:26:13 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2015-12-21 16:14:23 +0100 |
commit | cdd05f0ed439787d79ff7a0e04c3fc6e2516a64c (patch) | |
tree | 09f86fdd620d68154ffe91797095858d42a1effb /include/osmocom/core/msgb.h | |
parent | 9e57a5a6974e92a2df73f9009f793c1a1f6206d9 (diff) |
msgb: Add msgb_resize_area and msgb_copy
These functions originate from openbsc/src/gprs but are generic
msgb helper functions.
msgb_copy: This function allocates a new msgb, copies the data
buffer of msg, and adjusts the pointers (incl. l1h-l4h)
accordingly.
msgb_resize_area:
This resizes a sub area of the msgb data and adjusts the
pointers (incl. l1h-l4h) accordingly.
Sponsored-by: On-Waves ehf
Diffstat (limited to 'include/osmocom/core/msgb.h')
-rw-r--r-- | include/osmocom/core/msgb.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/osmocom/core/msgb.h b/include/osmocom/core/msgb.h index 644a6391..9ffc64ef 100644 --- a/include/osmocom/core/msgb.h +++ b/include/osmocom/core/msgb.h @@ -74,6 +74,9 @@ extern struct msgb *msgb_dequeue(struct llist_head *queue); extern void msgb_reset(struct msgb *m); uint16_t msgb_length(const struct msgb *msg); extern const char *msgb_hexdump(const struct msgb *msg); +extern int msgb_resize_area(struct msgb *msg, uint8_t *area, + int old_size, int new_size); +extern struct msgb *msgb_copy(const struct msgb *msg, const char *name); #ifdef MSGB_DEBUG #include <osmocom/core/panic.h> |