summaryrefslogtreecommitdiffstats
path: root/src/msgb.c
Commit message (Collapse)AuthorAgeFilesLines
* msgb: add msgb_talloc_ctx_init(), deprecate msgb_set_talloc_ctx()Neels Hofmeyr2016-09-271-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | So far each and every main() scope creates a msgb talloc context and either passes it to msgb_set_talloc_ctx() or sets tall_msgb_ctx directly (by defining it extern first). Remove some code duplication: add one central function that creates the "msgb" talloc context for all. Most users of msgb employ a talloc_named_const(), but osmo-bts uses a talloc_pool() instead. Offer both ways by means of the pool_size argument, and for both ways make sure the context is called "msgb". Suggest that msgb users should move to this new function: deprecate msgb_set_talloc_ctx(). To be able to do so, include core/defs.h in msgb.h. There's a tradeoff between hiding the msgb talloc context behind API that tries to guess all use cases versus avoiding code dup. This patch opts against code dup and boldly assumes that all future use is covered. Also, the new function suggests to not access tall_msgb_ctx directly, which can be considered a style improvement. It seems that not all main scopes that use msgb actually initialize the msgb ctx. As a fallback for these, explicitly initialize tall_msgb_ctx to NULL. Change-Id: I747fbbf977c4d2c868c8dead64cfc5fd86eb8d4c
* Fix potential segfault in msg_dequeueMax2016-06-231-3/+6
| | | | Change-Id: I06e9c5ba3e00c73a4e52d2583ce3492f236275ce
* Update doxygen annotations in libosmocoreHarald Welte2016-05-051-0/+1
| | | | | This adds and improves doxygen API descriptions all over libosmocore, reducing the 'white spots' that don't have any documentation.
* Fix some recently added formats on 64bitNeels Hofmeyr2015-12-241-3/+5
| | | | | 86ec311896dd5d4 adds compiler warnings on 64bit. The build is clean otherwise, so let's keep it that way.
* msgb: Let msgb_hexdump be more tolerantJacob Erlbeck2015-12-211-7/+39
| | | | | | | This patch makes msgb_hexdump accept out of range lXh pointers and shows info about them instead of aborting the dump entirely. Sponsored-by: On-Waves ehf
* msgb: Add msgb_resize_area and msgb_copyJacob Erlbeck2015-12-211-0/+91
| | | | | | | | | | | | | | | 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
* msgb: Add msgb_hexdump() functionJacob Erlbeck2014-03-041-0/+49
| | | | | | | | | | | | This function works like osmo_hexdump() and returns a static buffer containing hex bytes along with markers for the layers. Note that it uses osmo_hexdump() internally, thus a call to msgb_hexdump() invalidates the buffer that has been returned by an earlier call to osmo_hexdump(). In short: don't mix them in a single call printf(). Sponsored-by: On-Waves ehf
* misc: Doxygen tweaks: fixed some typos and minor errorsKaterina Barone-Adesi2013-02-151-3/+3
| | | | | Doxygen generates quite a lot of warnings on libosmocore. Some of them are obvious typos - this patch aims to fix such low-hanging fruit.
* doc: Fix the Doxygen section endingsSylvain Munaut2012-04-181-1/+1
| | | | Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
* some more doxygen work (include the notion of modules)Harald Welte2011-08-171-0/+51
|
* add msgb_set_talloc_ctx() to set the talloc context for msgb allocationsHarald Welte2011-06-291-0/+5
|
* misc: Remove the sys/types.h include from various filesHolger Hans Peter Freyther2011-04-181-1/+0
| | | | | We used this include for the u_int{8,16,32}_t types but we do not need this anymore.
* include: reorganize headers file to include/osmocom/[gsm|core]Pablo Neira Ayuso2011-03-231-2/+2
| | | | | | | | | | | | This patch moves all GSM-specific definitions to include/osmocom/gsm. Moreover, the headers in include/osmocore/ have been moved to include/osmocom/core. This has been proposed by Harald Welte and Sylvain Munaunt. Tested with `make distcheck'. Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
* msgb: Add non-inlined helper functions to ease with language bindingsHolger Hans Peter Freyther2010-10-181-0/+11
| | | | | | 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.
* msgb: initialize cb[] to zero during msgb_reset()Harald Welte2010-05-011-0/+2
|
* msgb: remove smsh, llch, tlli and gmmhHarald Welte2010-04-301-1/+1
| | | | | This is a lot of GSM/GPRS specific stuff in struct msgb which we want to avoid. The 'control buffer' will replace them.
* remove the unneeded bts_link pointer from msgbHarald Welte2010-04-301-1/+0
|
* msgb.c: Style cleanup in initializationSylvain Munaut2010-02-241-13/+4
| | | | Don't assign the same var twice & init all from the same source.
* intial checkin of the libosmocore projectHarald Welte2010-02-201-0/+98