\doxysection{src/core/msgb.c File Reference}
\label{msgb_8c}\index{src/core/msgb.c@{src/core/msgb.c}}
{\ttfamily \#include $<$unistd.\+h$>$}\newline
{\ttfamily \#include $<$string.\+h$>$}\newline
{\ttfamily \#include $<$stdlib.\+h$>$}\newline
{\ttfamily \#include $<$inttypes.\+h$>$}\newline
{\ttfamily \#include $<$stdarg.\+h$>$}\newline
{\ttfamily \#include $<$errno.\+h$>$}\newline
{\ttfamily \#include \char`\"{}config.\+h\char`\"{}}\newline
{\ttfamily \#include $<$osmocom/core/msgb.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/talloc.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/logging.\+h$>$}\newline
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ msgb} $\ast$ \textbf{ msgb\+\_\+alloc\+\_\+c} (const void $\ast$ctx, uint16\+\_\+t size, const char $\ast$\textbf{ name})
\begin{DoxyCompactList}\small\item\em Allocate a new message buffer from given talloc context. \end{DoxyCompactList}\item 
struct \textbf{ msgb} $\ast$ \textbf{ msgb\+\_\+alloc} (uint16\+\_\+t size, const char $\ast$\textbf{ name})
\begin{DoxyCompactList}\small\item\em Allocate a new message buffer from tall\+\_\+msgb\+\_\+ctx. \end{DoxyCompactList}\item 
void \textbf{ msgb\+\_\+free} (struct \textbf{ msgb} $\ast$m)
\begin{DoxyCompactList}\small\item\em Release given message buffer. \end{DoxyCompactList}\item 
void \textbf{ msgb\+\_\+enqueue} (struct \textbf{ llist\+\_\+head} $\ast$queue, struct \textbf{ msgb} $\ast$\textbf{ msg})
\begin{DoxyCompactList}\small\item\em Enqueue message buffer to tail of a queue. \end{DoxyCompactList}\item 
struct \textbf{ msgb} $\ast$ \textbf{ msgb\+\_\+dequeue} (struct \textbf{ llist\+\_\+head} $\ast$queue)
\begin{DoxyCompactList}\small\item\em Dequeue message buffer from head of queue. \end{DoxyCompactList}\item 
void \textbf{ msgb\+\_\+reset} (struct \textbf{ msgb} $\ast$\textbf{ msg})
\begin{DoxyCompactList}\small\item\em Re-\/set all message buffer pointers. \end{DoxyCompactList}\item 
uint8\+\_\+t $\ast$ \textbf{ msgb\+\_\+data} (const struct \textbf{ msgb} $\ast$\textbf{ msg})
\begin{DoxyCompactList}\small\item\em get pointer to data section of message buffer \end{DoxyCompactList}\item 
bool \textbf{ \+\_\+msgb\+\_\+eq} (const char $\ast$\textbf{ file}, size\+\_\+t line, const char $\ast$func, uint8\+\_\+t \textbf{ level}, const struct \textbf{ msgb} $\ast$\textbf{ msg}, const uint8\+\_\+t $\ast$\textbf{ data}, size\+\_\+t \textbf{ len}, bool print)
\begin{DoxyCompactList}\small\item\em Compare and print\+: check data in msgb against given data and print errors if any. \end{DoxyCompactList}\item 
uint16\+\_\+t \textbf{ msgb\+\_\+length} (const struct \textbf{ msgb} $\ast$\textbf{ msg})
\begin{DoxyCompactList}\small\item\em get length of message buffer \end{DoxyCompactList}\item 
void \textbf{ msgb\+\_\+set\+\_\+talloc\+\_\+ctx} (void $\ast$ctx)
\begin{DoxyCompactList}\small\item\em Set the talloc context for \doxyref{msgb\+\_\+alloc}{p.}{group__msgb_ga25906d049cbad1bf2d5a785319268ea8} Deprecated, use \doxyref{msgb\+\_\+talloc\+\_\+ctx\+\_\+init()}{p.}{group__msgb_ga66fd1ee6b6667bf707fcef99ee2fb7db} instead. \end{DoxyCompactList}\item 
void $\ast$ \textbf{ msgb\+\_\+talloc\+\_\+ctx\+\_\+init} (void $\ast$root\+\_\+ctx, unsigned int pool\+\_\+size)
\begin{DoxyCompactList}\small\item\em Initialize a msgb talloc context for \doxyref{msgb\+\_\+alloc}{p.}{group__msgb_ga25906d049cbad1bf2d5a785319268ea8}. \end{DoxyCompactList}\item 
struct \textbf{ msgb} $\ast$ \textbf{ msgb\+\_\+copy\+\_\+resize\+\_\+c} (const void $\ast$ctx, const struct \textbf{ msgb} $\ast$\textbf{ msg}, uint16\+\_\+t new\+\_\+len, const char $\ast$\textbf{ name})
\begin{DoxyCompactList}\small\item\em Copy an msgb with memory reallocation. \end{DoxyCompactList}\item 
struct \textbf{ msgb} $\ast$ \textbf{ msgb\+\_\+copy\+\_\+resize} (const struct \textbf{ msgb} $\ast$\textbf{ msg}, uint16\+\_\+t new\+\_\+len, const char $\ast$\textbf{ name})
\begin{DoxyCompactList}\small\item\em Copy an msgb with memory reallocation. \end{DoxyCompactList}\item 
struct \textbf{ msgb} $\ast$ \textbf{ msgb\+\_\+copy\+\_\+c} (const void $\ast$ctx, const struct \textbf{ msgb} $\ast$\textbf{ msg}, const char $\ast$\textbf{ name})
\begin{DoxyCompactList}\small\item\em Copy an msgb. \end{DoxyCompactList}\item 
struct \textbf{ msgb} $\ast$ \textbf{ msgb\+\_\+copy} (const struct \textbf{ msgb} $\ast$\textbf{ msg}, const char $\ast$\textbf{ name})
\begin{DoxyCompactList}\small\item\em Copy an msgb. \end{DoxyCompactList}\item 
int \textbf{ msgb\+\_\+resize\+\_\+area} (struct \textbf{ msgb} $\ast$\textbf{ msg}, uint8\+\_\+t $\ast$area, int old\+\_\+size, int new\+\_\+size)
\begin{DoxyCompactList}\small\item\em Resize an area within an msgb. \end{DoxyCompactList}\item 
char $\ast$ \textbf{ msgb\+\_\+hexdump\+\_\+buf} (char $\ast$buf, size\+\_\+t buf\+\_\+len, const struct \textbf{ msgb} $\ast$\textbf{ msg})
\begin{DoxyCompactList}\small\item\em fill user-\/provided buffer with hexdump of the msg. \end{DoxyCompactList}\item 
const char $\ast$ \textbf{ msgb\+\_\+hexdump} (const struct \textbf{ msgb} $\ast$\textbf{ msg})
\begin{DoxyCompactList}\small\item\em Return a (static) buffer containing a hexdump of the msg. \end{DoxyCompactList}\item 
char $\ast$ \textbf{ msgb\+\_\+hexdump\+\_\+c} (const void $\ast$ctx, const struct \textbf{ msgb} $\ast$\textbf{ msg})
\begin{DoxyCompactList}\small\item\em Return a dynamically allocated buffer containing a hexdump of the msg. \end{DoxyCompactList}\item 
int \textbf{ msgb\+\_\+printf} (struct \textbf{ msgb} $\ast$\textbf{ msgb}, const char $\ast$format,...)
\begin{DoxyCompactList}\small\item\em Print a string to the end of message buffer. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
void $\ast$ \textbf{ tall\+\_\+msgb\+\_\+ctx} = NULL
\end{DoxyCompactItemize}
