diff options
author | Max <msuraev@sysmocom.de> | 2022-10-14 20:39:40 +0300 |
---|---|---|
committer | msuraev <msuraev@sysmocom.de> | 2022-10-25 08:51:22 +0000 |
commit | df5b1e17a543b3b72bf23f3dde63794a4fea6fe2 (patch) | |
tree | 7914c3dd158a52ce999efc677afb0b3ffdf0d784 /include/osmocom/core/msgb.h | |
parent | 73aa0e5219d096bbb9d3c935f8d6dfb28e3ba303 (diff) |
msgb: introduce extended copy functions
Those are similar to existing *msgb_alloc*() functions but allows
to change the size of destination msgb provided it fits the
data from source msgb.
Change-Id: I36d4c16241d19f0f73c325be4d0e0bdef6813615
Signed-off-by: Max <msuraev@sysmocom.de>
Diffstat (limited to 'include/osmocom/core/msgb.h')
-rw-r--r-- | include/osmocom/core/msgb.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/osmocom/core/msgb.h b/include/osmocom/core/msgb.h index 1e2b0237..3fdb189d 100644 --- a/include/osmocom/core/msgb.h +++ b/include/osmocom/core/msgb.h @@ -70,6 +70,8 @@ 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); extern struct msgb *msgb_copy_c(const void *ctx, const struct msgb *msg, const char *name); +extern struct msgb *msgb_copy_resize(const struct msgb *msg, uint16_t new_len, const char *name); +extern struct msgb *msgb_copy_resize_c(const void *ctx, const struct msgb *msg, uint16_t new_len, const char *name); static int msgb_test_invariant(const struct msgb *msg) __attribute__((pure)); /*! Free all msgbs from a queue built with msgb_enqueue(). |