\doxysection{TLV parser}
\label{group__tlv}\index{TLV parser@{TLV parser}}


Osmocom TLV Parser.  


\doxysubsection*{Files}
\begin{DoxyCompactItemize}
\item 
file \textbf{ tlv.\+h}
\item 
file \textbf{ tlv\+\_\+parser.\+c}
\end{DoxyCompactItemize}
\doxysubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ tlv\+\_\+p\+\_\+entry}
\begin{DoxyCompactList}\small\item\em Entry in a TLV parser array. \end{DoxyCompactList}\item 
struct \textbf{ tlv\+\_\+def}
\begin{DoxyCompactList}\small\item\em Definition of a single IE (Information Element) \end{DoxyCompactList}\item 
struct \textbf{ tlv\+\_\+definition}
\begin{DoxyCompactList}\small\item\em Definition of All 256 IE / TLV. \end{DoxyCompactList}\item 
struct \textbf{ tlv\+\_\+parsed}
\begin{DoxyCompactList}\small\item\em result of the TLV parser \end{DoxyCompactList}\item 
struct \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+msg\+\_\+def}
\item 
struct \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+ie\+\_\+def}
\item 
struct \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+def}
\begin{DoxyCompactList}\small\item\em Osmocom TLV protocol definition. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \textbf{ LV\+\_\+\+GROSS\+\_\+\+LEN}(\textbf{ x})~(\textbf{ x}+1)
\begin{DoxyCompactList}\small\item\em gross length of a LV type field \end{DoxyCompactList}\item 
\#define \textbf{ TLV\+\_\+\+GROSS\+\_\+\+LEN}(\textbf{ x})~(\textbf{ x}+2)
\begin{DoxyCompactList}\small\item\em gross length of a TLV type field \end{DoxyCompactList}\item 
\#define \textbf{ TLV16\+\_\+\+GROSS\+\_\+\+LEN}(\textbf{ x})~((2$\ast$\textbf{ x})+2)
\begin{DoxyCompactList}\small\item\em gross length of a TLV16 type field \end{DoxyCompactList}\item 
\#define \textbf{ TL16\+V\+\_\+\+GROSS\+\_\+\+LEN}(\textbf{ x})~(\textbf{ x}+3)
\begin{DoxyCompactList}\small\item\em gross length of a TL16V type field \end{DoxyCompactList}\item 
\#define \textbf{ L16\+TV\+\_\+\+GROSS\+\_\+\+LEN}(\textbf{ x})~(\textbf{ x}+3)
\begin{DoxyCompactList}\small\item\em gross length of a L16\+TV type field \end{DoxyCompactList}\item 
\#define \textbf{ T16\+LV\+\_\+\+GROSS\+\_\+\+LEN}(\textbf{ x})~(\textbf{ x}+3)
\begin{DoxyCompactList}\small\item\em gross length of a T16\+LV type field \end{DoxyCompactList}\item 
\#define \textbf{ TVLV\+\_\+\+MAX\+\_\+\+ONEBYTE}~0x7f
\begin{DoxyCompactList}\small\item\em maximum length of TLV of one byte length \end{DoxyCompactList}\item 
\#define \textbf{ TLVP\+\_\+\+PRESENT}(\textbf{ x},  y)~(!!((\textbf{ x})-\/$>$lv[y].val))
\item 
\#define \textbf{ TLVP\+\_\+\+LEN}(\textbf{ x},  y)~(\textbf{ x})-\/$>$lv[y].\textbf{ len}
\item 
\#define \textbf{ TLVP\+\_\+\+VAL}(\textbf{ x},  y)~(\textbf{ x})-\/$>$lv[y].val
\item 
\#define \textbf{ TLVP\+\_\+\+PRES\+\_\+\+LEN}(tp,  tag,  min\+\_\+len)~ (\textbf{ TLVP\+\_\+\+PRESENT}(tp, tag) \&\& \textbf{ TLVP\+\_\+\+LEN}(tp, tag) $>$= min\+\_\+len)
\item 
\#define \textbf{ TLVP\+\_\+\+GET}(\+\_\+tp,  tag)~(\textbf{ TLVP\+\_\+\+PRESENT}(\+\_\+tp, tag)? \&(\+\_\+tp)-\/$>$lv[tag] \+: NULL)
\begin{DoxyCompactList}\small\item\em Return pointer to a TLV element if it is present. \end{DoxyCompactList}\item 
\#define \textbf{ TLVP\+\_\+\+GET\+\_\+\+MINLEN}(\+\_\+tp,  tag,  min\+\_\+len)~ (\textbf{ TLVP\+\_\+\+PRES\+\_\+\+LEN}(\+\_\+tp, tag, min\+\_\+len)? \&(\+\_\+tp)-\/$>$lv[tag] \+: NULL)
\begin{DoxyCompactList}\small\item\em Like \doxyref{TLVP\+\_\+\+GET()}{p.}{group__tlv_ga0118f8b167ebc8b8bfebbde8c02f96b1}, but enforcing a minimum val length. \end{DoxyCompactList}\item 
\#define \textbf{ TLVP\+\_\+\+VAL\+\_\+\+MINLEN}(\+\_\+tp,  tag,  min\+\_\+len)~ (\textbf{ TLVP\+\_\+\+PRES\+\_\+\+LEN}(\+\_\+tp, tag, min\+\_\+len)? (\+\_\+tp)-\/$>$lv[tag].val \+: NULL)
\begin{DoxyCompactList}\small\item\em Like \doxyref{TLVP\+\_\+\+VAL()}{p.}{group__tlv_ga1363d366c59dea2d85013d3eb135067c}, but enforcing a minimum val length. \end{DoxyCompactList}\item 
\#define \textbf{ MSG\+\_\+\+DEF}(\textbf{ name},  mand\+\_\+ies,  \textbf{ flags})~\{ \textbf{ name}, mand\+\_\+ies, \textbf{ ARRAY\+\_\+\+SIZE}(mand\+\_\+ies), \textbf{ flags} \}
\end{DoxyCompactItemize}
\doxysubsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \textbf{ osmo\+\_\+tlv\+\_\+parser\+\_\+error} \{ \newline
\textbf{ OSMO\+\_\+\+TLVP\+\_\+\+ERR\+\_\+\+OFS\+\_\+\+BEYOND\+\_\+\+BUFFER} = -\/1
, \newline
\textbf{ OSMO\+\_\+\+TLVP\+\_\+\+ERR\+\_\+\+OFS\+\_\+\+LEN\+\_\+\+BEYOND\+\_\+\+BUFFER} = -\/2
, \newline
\textbf{ OSMO\+\_\+\+TLVP\+\_\+\+ERR\+\_\+\+UNKNOWN\+\_\+\+TLV\+\_\+\+TYPE} = -\/3
, \newline
\textbf{ OSMO\+\_\+\+TLVP\+\_\+\+ERR\+\_\+\+MAND\+\_\+\+IE\+\_\+\+MISSING} = -\/50
, \newline
\textbf{ OSMO\+\_\+\+TLVP\+\_\+\+ERR\+\_\+\+IE\+\_\+\+TOO\+\_\+\+SHORT} = -\/51
 \}
\begin{DoxyCompactList}\small\item\em error return codes of various TLV parser functions \end{DoxyCompactList}\item 
enum \textbf{ tlv\+\_\+type} \{ \newline
\textbf{ TLV\+\_\+\+TYPE\+\_\+\+NONE}
, \newline
\textbf{ TLV\+\_\+\+TYPE\+\_\+\+FIXED}
, \newline
\textbf{ TLV\+\_\+\+TYPE\+\_\+T}
, \newline
\textbf{ TLV\+\_\+\+TYPE\+\_\+\+TV}
, \newline
\textbf{ TLV\+\_\+\+TYPE\+\_\+\+TLV}
, \newline
\textbf{ TLV\+\_\+\+TYPE\+\_\+\+TL16V}
, \newline
\textbf{ TLV\+\_\+\+TYPE\+\_\+\+Tv\+LV}
, \newline
\textbf{ TLV\+\_\+\+TYPE\+\_\+\+SINGLE\+\_\+\+TV}
, \newline
\textbf{ TLV\+\_\+\+TYPE\+\_\+v\+Tv\+LV\+\_\+\+GAN}
 \}
\begin{DoxyCompactList}\small\item\em TLV type. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
static uint16\+\_\+t \textbf{ TVLV\+\_\+\+GROSS\+\_\+\+LEN} (uint16\+\_\+t \textbf{ len})
\begin{DoxyCompactList}\small\item\em gross length of a TVLV type field \end{DoxyCompactList}\item 
static uint16\+\_\+t \textbf{ VTVL\+\_\+\+GAN\+\_\+\+GROSS\+\_\+\+LEN} (uint16\+\_\+t tag, uint16\+\_\+t \textbf{ len})
\begin{DoxyCompactList}\small\item\em gross length of v\+TvL header (tag+len) \end{DoxyCompactList}\item 
static uint16\+\_\+t \textbf{ VTVLV\+\_\+\+GAN\+\_\+\+GROSS\+\_\+\+LEN} (uint16\+\_\+t tag, uint16\+\_\+t \textbf{ len})
\begin{DoxyCompactList}\small\item\em gross length of v\+Tv\+LV (tag+len+val) \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ lv\+\_\+put} (uint8\+\_\+t $\ast$buf, uint8\+\_\+t \textbf{ len}, const uint8\+\_\+t $\ast$val)
\begin{DoxyCompactList}\small\item\em put (append) a LV field \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ tlv\+\_\+put} (uint8\+\_\+t $\ast$buf, uint8\+\_\+t tag, uint8\+\_\+t \textbf{ len}, const uint8\+\_\+t $\ast$val)
\begin{DoxyCompactList}\small\item\em Append a TLV field, a Tag-\/\+Length-\/\+Value field. \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ tl\+\_\+put} (uint8\+\_\+t $\ast$buf, uint8\+\_\+t tag, uint8\+\_\+t \textbf{ len})
\begin{DoxyCompactList}\small\item\em put (append) a TL field (a TLV field but omitting the value part). \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ tlv16\+\_\+put} (uint8\+\_\+t $\ast$buf, uint8\+\_\+t tag, uint8\+\_\+t \textbf{ len}, const uint16\+\_\+t $\ast$val)
\begin{DoxyCompactList}\small\item\em put (append) a TLV16 field \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ tl16v\+\_\+put} (uint8\+\_\+t $\ast$buf, uint8\+\_\+t tag, uint16\+\_\+t \textbf{ len}, const uint8\+\_\+t $\ast$val)
\begin{DoxyCompactList}\small\item\em put (append) a TL16V field \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ tl16\+\_\+put} (uint8\+\_\+t $\ast$buf, uint8\+\_\+t tag, uint16\+\_\+t \textbf{ len})
\begin{DoxyCompactList}\small\item\em put (append) a TL16 field. \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ t16lv\+\_\+put} (uint8\+\_\+t $\ast$buf, uint16\+\_\+t tag, uint8\+\_\+t \textbf{ len}, const uint8\+\_\+t $\ast$val)
\begin{DoxyCompactList}\small\item\em put (append) a TL16V field \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ tvlv\+\_\+put} (uint8\+\_\+t $\ast$buf, uint8\+\_\+t tag, uint16\+\_\+t \textbf{ len}, const uint8\+\_\+t $\ast$val)
\begin{DoxyCompactList}\small\item\em put (append) a Tv\+LV field \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ tvl\+\_\+put} (uint8\+\_\+t $\ast$buf, uint8\+\_\+t tag, uint16\+\_\+t \textbf{ len})
\begin{DoxyCompactList}\small\item\em put (append) a TvL field (a Tv\+LV with variable-\/size length, where the value part\textquotesingle{}s length is already known, but will be put() later). \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ vt\+\_\+gan\+\_\+put} (uint8\+\_\+t $\ast$buf, uint16\+\_\+t tag)
\begin{DoxyCompactList}\small\item\em put (append) a variable-\/length tag or variable-\/length length $\ast$ \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ vtvl\+\_\+gan\+\_\+put} (uint8\+\_\+t $\ast$buf, uint16\+\_\+t tag, uint16\+\_\+t \textbf{ len})
\item 
static uint8\+\_\+t $\ast$ \textbf{ vtvlv\+\_\+gan\+\_\+put} (uint8\+\_\+t $\ast$buf, uint16\+\_\+t tag, uint16\+\_\+t \textbf{ len}, const uint8\+\_\+t $\ast$val)
\item 
static uint8\+\_\+t $\ast$ \textbf{ msgb\+\_\+tlv16\+\_\+put} (struct \textbf{ msgb} $\ast$\textbf{ msg}, uint8\+\_\+t tag, uint8\+\_\+t \textbf{ len}, const uint16\+\_\+t $\ast$val)
\begin{DoxyCompactList}\small\item\em put (append) a TLV16 field to \textbf{ Message buffers} \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ msgb\+\_\+tl16v\+\_\+put} (struct \textbf{ msgb} $\ast$\textbf{ msg}, uint8\+\_\+t tag, uint16\+\_\+t \textbf{ len}, const uint8\+\_\+t $\ast$val)
\begin{DoxyCompactList}\small\item\em put (append) a TL16V field to \textbf{ Message buffers} \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ msgb\+\_\+t16lv\+\_\+put} (struct \textbf{ msgb} $\ast$\textbf{ msg}, uint16\+\_\+t tag, uint8\+\_\+t \textbf{ len}, const uint8\+\_\+t $\ast$val)
\item 
static uint8\+\_\+t $\ast$ \textbf{ msgb\+\_\+tvl\+\_\+put} (struct \textbf{ msgb} $\ast$\textbf{ msg}, uint8\+\_\+t tag, uint16\+\_\+t \textbf{ len})
\begin{DoxyCompactList}\small\item\em put (append) a TvL field to \textbf{ Message buffers}, i.\+e. \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ msgb\+\_\+tvlv\+\_\+put} (struct \textbf{ msgb} $\ast$\textbf{ msg}, uint8\+\_\+t tag, uint16\+\_\+t \textbf{ len}, const uint8\+\_\+t $\ast$val)
\begin{DoxyCompactList}\small\item\em put (append) a Tv\+LV field to \textbf{ Message buffers} \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ msgb\+\_\+tvlv\+\_\+put\+\_\+16be} (struct \textbf{ msgb} $\ast$\textbf{ msg}, uint8\+\_\+t tag, uint16\+\_\+t val)
\begin{DoxyCompactList}\small\item\em put (append) a Tv\+LV field containing a big-\/endian 16bit value to msgb. \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ msgb\+\_\+tvlv\+\_\+put\+\_\+32be} (struct \textbf{ msgb} $\ast$\textbf{ msg}, uint8\+\_\+t tag, uint32\+\_\+t val)
\begin{DoxyCompactList}\small\item\em put (append) a Tv\+LV field containing a big-\/endian 16bit value to msgb. \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ msgb\+\_\+vtvlv\+\_\+gan\+\_\+put} (struct \textbf{ msgb} $\ast$\textbf{ msg}, uint16\+\_\+t tag, uint16\+\_\+t \textbf{ len}, const uint8\+\_\+t $\ast$val)
\begin{DoxyCompactList}\small\item\em put (append) a v\+Tv\+LV field to \textbf{ Message buffers} \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ msgb\+\_\+l16tv\+\_\+put} (struct \textbf{ msgb} $\ast$\textbf{ msg}, uint16\+\_\+t \textbf{ len}, uint8\+\_\+t tag, const uint8\+\_\+t $\ast$val)
\begin{DoxyCompactList}\small\item\em put (append) a L16\+TV field to \textbf{ Message buffers} \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ v\+\_\+put} (uint8\+\_\+t $\ast$buf, uint8\+\_\+t val)
\begin{DoxyCompactList}\small\item\em put (append) a V field \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ tv\+\_\+put} (uint8\+\_\+t $\ast$buf, uint8\+\_\+t tag, uint8\+\_\+t val)
\begin{DoxyCompactList}\small\item\em put (append) a TV field \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ tv\+\_\+fixed\+\_\+put} (uint8\+\_\+t $\ast$buf, uint8\+\_\+t tag, unsigned int \textbf{ len}, const uint8\+\_\+t $\ast$val)
\begin{DoxyCompactList}\small\item\em put (append) a TVfixed field \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ tv16\+\_\+put} (uint8\+\_\+t $\ast$buf, uint8\+\_\+t tag, uint16\+\_\+t val)
\begin{DoxyCompactList}\small\item\em put (append) a TV16 field \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ msgb\+\_\+lv\+\_\+put} (struct \textbf{ msgb} $\ast$\textbf{ msg}, uint8\+\_\+t \textbf{ len}, const uint8\+\_\+t $\ast$val)
\begin{DoxyCompactList}\small\item\em put (append) a LV field to a \textbf{ Message buffers} \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ msgb\+\_\+tlv\+\_\+put} (struct \textbf{ msgb} $\ast$\textbf{ msg}, uint8\+\_\+t tag, uint8\+\_\+t \textbf{ len}, const uint8\+\_\+t $\ast$val)
\begin{DoxyCompactList}\small\item\em put (append) a TLV field to a \textbf{ Message buffers} \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ msgb\+\_\+tv\+\_\+put} (struct \textbf{ msgb} $\ast$\textbf{ msg}, uint8\+\_\+t tag, uint8\+\_\+t val)
\begin{DoxyCompactList}\small\item\em put (append) a TV field to a \textbf{ Message buffers} \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ msgb\+\_\+tv\+\_\+fixed\+\_\+put} (struct \textbf{ msgb} $\ast$\textbf{ msg}, uint8\+\_\+t tag, unsigned int \textbf{ len}, const uint8\+\_\+t $\ast$val)
\begin{DoxyCompactList}\small\item\em put (append) a TVfixed field to a \textbf{ Message buffers} \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ msgb\+\_\+v\+\_\+put} (struct \textbf{ msgb} $\ast$\textbf{ msg}, uint8\+\_\+t val)
\begin{DoxyCompactList}\small\item\em put (append) a V field to a \textbf{ Message buffers} \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ msgb\+\_\+tl\+\_\+put} (struct \textbf{ msgb} $\ast$\textbf{ msg}, uint8\+\_\+t tag)
\begin{DoxyCompactList}\small\item\em put (append) a TL fields to a \textbf{ Message buffers} \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ msgb\+\_\+tv16\+\_\+put} (struct \textbf{ msgb} $\ast$\textbf{ msg}, uint8\+\_\+t tag, uint16\+\_\+t val)
\begin{DoxyCompactList}\small\item\em put (append) a TV16 field (network order) to the given msgb \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ msgb\+\_\+tv32\+\_\+put} (struct \textbf{ msgb} $\ast$\textbf{ msg}, uint8\+\_\+t tag, uint32\+\_\+t val)
\begin{DoxyCompactList}\small\item\em put (append) a TV32 field (network order) to the given msgb \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ msgb\+\_\+tlv\+\_\+push} (struct \textbf{ msgb} $\ast$\textbf{ msg}, uint8\+\_\+t tag, uint8\+\_\+t \textbf{ len}, const uint8\+\_\+t $\ast$val)
\begin{DoxyCompactList}\small\item\em push (prepend) a TLV field to a \textbf{ Message buffers} \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ msgb\+\_\+tlv1\+\_\+push} (struct \textbf{ msgb} $\ast$\textbf{ msg}, uint8\+\_\+t tag, uint8\+\_\+t val)
\begin{DoxyCompactList}\small\item\em push 1-\/byte tagged value \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ msgb\+\_\+tv\+\_\+push} (struct \textbf{ msgb} $\ast$\textbf{ msg}, uint8\+\_\+t tag, uint8\+\_\+t val)
\begin{DoxyCompactList}\small\item\em push (prepend) a TV field to a \textbf{ Message buffers} \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ msgb\+\_\+tv16\+\_\+push} (struct \textbf{ msgb} $\ast$\textbf{ msg}, uint8\+\_\+t tag, uint16\+\_\+t val)
\begin{DoxyCompactList}\small\item\em push (prepend) a TV16 field to a \textbf{ Message buffers} \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ msgb\+\_\+tv32\+\_\+push} (struct \textbf{ msgb} $\ast$\textbf{ msg}, uint8\+\_\+t tag, uint32\+\_\+t val)
\begin{DoxyCompactList}\small\item\em push (prepend) a TV32 field to a \textbf{ Message buffers} \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ msgb\+\_\+tvlv\+\_\+push} (struct \textbf{ msgb} $\ast$\textbf{ msg}, uint8\+\_\+t tag, uint16\+\_\+t \textbf{ len}, const uint8\+\_\+t $\ast$val)
\begin{DoxyCompactList}\small\item\em push (prepend) a Tv\+LV field to a \textbf{ Message buffers} \end{DoxyCompactList}\item 
static uint8\+\_\+t $\ast$ \textbf{ msgb\+\_\+vtvl\+\_\+gan\+\_\+push} (struct \textbf{ msgb} $\ast$\textbf{ msg}, uint16\+\_\+t tag, uint16\+\_\+t \textbf{ len})
\item 
static uint8\+\_\+t $\ast$ \textbf{ msgb\+\_\+vtvlv\+\_\+gan\+\_\+push} (struct \textbf{ msgb} $\ast$\textbf{ msg}, uint16\+\_\+t tag, uint16\+\_\+t \textbf{ len}, const uint8\+\_\+t $\ast$val)
\item 
int \textbf{ tlv\+\_\+parse\+\_\+one} (uint8\+\_\+t $\ast$o\+\_\+tag, uint16\+\_\+t $\ast$o\+\_\+len, const uint8\+\_\+t $\ast$$\ast$o\+\_\+val, const struct \textbf{ tlv\+\_\+definition} $\ast$def, const uint8\+\_\+t $\ast$buf, int buf\+\_\+len)
\begin{DoxyCompactList}\small\item\em Parse a single TLV encoded IE. \end{DoxyCompactList}\item 
int \textbf{ tlv\+\_\+parse} (struct \textbf{ tlv\+\_\+parsed} $\ast$dec, const struct \textbf{ tlv\+\_\+definition} $\ast$def, const uint8\+\_\+t $\ast$buf, int buf\+\_\+len, uint8\+\_\+t lv\+\_\+tag, uint8\+\_\+t lv\+\_\+tag2)
\begin{DoxyCompactList}\small\item\em Parse an entire buffer of TLV encoded Information Elements. \end{DoxyCompactList}\item 
int \textbf{ tlv\+\_\+parse2} (struct \textbf{ tlv\+\_\+parsed} $\ast$dec, int dec\+\_\+multiples, const struct \textbf{ tlv\+\_\+definition} $\ast$def, const uint8\+\_\+t $\ast$buf, int buf\+\_\+len, uint8\+\_\+t lv\+\_\+tag, uint8\+\_\+t lv\+\_\+tag2)
\begin{DoxyCompactList}\small\item\em Like \doxyref{tlv\+\_\+parse()}{p.}{group__tlv_gaa52227475e0050c2f0c78cb612e01d65}, but capable of decoding multiple occurences of the same IE. \end{DoxyCompactList}\item 
void \textbf{ tlv\+\_\+def\+\_\+patch} (struct \textbf{ tlv\+\_\+definition} $\ast$dst, const struct \textbf{ tlv\+\_\+definition} $\ast$src)
\begin{DoxyCompactList}\small\item\em take a master (src) \doxyref{tlv\+\_\+definition}{p.}{structtlv__definition} and fill up all empty slots in \textquotesingle{}dst\textquotesingle{} \end{DoxyCompactList}\item 
int \textbf{ tlv\+\_\+encode\+\_\+one} (struct \textbf{ msgb} $\ast$\textbf{ msg}, enum \textbf{ tlv\+\_\+type} \textbf{ type}, uint8\+\_\+t tag, unsigned int \textbf{ len}, const uint8\+\_\+t $\ast$val)
\begin{DoxyCompactList}\small\item\em Encode a single TLV into given message buffer. \end{DoxyCompactList}\item 
int \textbf{ tlv\+\_\+encode} (struct \textbf{ msgb} $\ast$\textbf{ msg}, const struct \textbf{ tlv\+\_\+definition} $\ast$def, const struct \textbf{ tlv\+\_\+parsed} $\ast$tp)
\begin{DoxyCompactList}\small\item\em Encode a set of decoded TLVs according to a given definition into a message buffer. \end{DoxyCompactList}\item 
int \textbf{ tlv\+\_\+encode\+\_\+ordered} (struct \textbf{ msgb} $\ast$\textbf{ msg}, const struct \textbf{ tlv\+\_\+definition} $\ast$def, const struct \textbf{ tlv\+\_\+parsed} $\ast$tp, const uint8\+\_\+t $\ast$tag\+\_\+order, unsigned int tag\+\_\+order\+\_\+len)
\begin{DoxyCompactList}\small\item\em Encode a set of decoded TLVs according to a given definition and IE order into a message buffer. \end{DoxyCompactList}\item 
static uint8\+\_\+t \textbf{ tlvp\+\_\+val8} (const struct \textbf{ tlv\+\_\+parsed} $\ast$tp, uint8\+\_\+t tag, uint8\+\_\+t default\+\_\+val)
\begin{DoxyCompactList}\small\item\em Obtain 1-\/byte TLV element. \end{DoxyCompactList}\item 
static uint16\+\_\+t \textbf{ tlvp\+\_\+val16\+\_\+unal} (const struct \textbf{ tlv\+\_\+parsed} $\ast$tp, int pos)
\begin{DoxyCompactList}\small\item\em Align given TLV element with 16 bit value to an even address. \end{DoxyCompactList}\item 
static uint32\+\_\+t \textbf{ tlvp\+\_\+val32\+\_\+unal} (const struct \textbf{ tlv\+\_\+parsed} $\ast$tp, int pos)
\begin{DoxyCompactList}\small\item\em Align given TLV element with 32 bit value to an address that is a multiple of 4. \end{DoxyCompactList}\item 
static uint16\+\_\+t \textbf{ tlvp\+\_\+val16be} (const struct \textbf{ tlv\+\_\+parsed} $\ast$tp, int pos)
\begin{DoxyCompactList}\small\item\em Retrieve (possibly unaligned) TLV element and convert to host byte order. \end{DoxyCompactList}\item 
static uint32\+\_\+t \textbf{ tlvp\+\_\+val32be} (const struct \textbf{ tlv\+\_\+parsed} $\ast$tp, int pos)
\begin{DoxyCompactList}\small\item\em Retrieve (possibly unaligned) TLV element and convert to host byte order. \end{DoxyCompactList}\item 
struct \textbf{ tlv\+\_\+parsed} $\ast$ \textbf{ osmo\+\_\+tlvp\+\_\+copy} (const struct \textbf{ tlv\+\_\+parsed} $\ast$tp\+\_\+orig, void $\ast$ctx)
\begin{DoxyCompactList}\small\item\em Copy \doxyref{tlv\+\_\+parsed}{p.}{structtlv__parsed} using given talloc context. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+tlvp\+\_\+merge} (struct \textbf{ tlv\+\_\+parsed} $\ast$dst, const struct \textbf{ tlv\+\_\+parsed} $\ast$src)
\begin{DoxyCompactList}\small\item\em Merge all \doxyref{tlv\+\_\+parsed}{p.}{structtlv__parsed} attributes of \textquotesingle{}src\textquotesingle{} into \textquotesingle{}dst\textquotesingle{}. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+shift\+\_\+v\+\_\+fixed} (uint8\+\_\+t $\ast$$\ast$\textbf{ data}, size\+\_\+t $\ast$data\+\_\+len, size\+\_\+t \textbf{ len}, uint8\+\_\+t $\ast$$\ast$value)
\begin{DoxyCompactList}\small\item\em Advance the data pointer, subtract length and assign value pointer. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+match\+\_\+shift\+\_\+tv\+\_\+fixed} (uint8\+\_\+t $\ast$$\ast$\textbf{ data}, size\+\_\+t $\ast$data\+\_\+len, uint8\+\_\+t tag, size\+\_\+t \textbf{ len}, uint8\+\_\+t $\ast$$\ast$value)
\begin{DoxyCompactList}\small\item\em Match tag, check length and assign value pointer. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+shift\+\_\+tlv} (uint8\+\_\+t $\ast$$\ast$\textbf{ data}, size\+\_\+t $\ast$data\+\_\+len, uint8\+\_\+t $\ast$tag, uint8\+\_\+t $\ast$$\ast$value, size\+\_\+t $\ast$value\+\_\+len)
\begin{DoxyCompactList}\small\item\em Extract TLV and advance data pointer + subtract length. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+match\+\_\+shift\+\_\+tlv} (uint8\+\_\+t $\ast$$\ast$\textbf{ data}, size\+\_\+t $\ast$data\+\_\+len, uint8\+\_\+t expected\+\_\+tag, uint8\+\_\+t $\ast$$\ast$value, size\+\_\+t $\ast$value\+\_\+len)
\begin{DoxyCompactList}\small\item\em Verify TLV header and advance data / subtract length. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+shift\+\_\+lv} (uint8\+\_\+t $\ast$$\ast$\textbf{ data}, size\+\_\+t $\ast$data\+\_\+len, uint8\+\_\+t $\ast$$\ast$value, size\+\_\+t $\ast$value\+\_\+len)
\begin{DoxyCompactList}\small\item\em Extract LV and advance data pointer + subtract length. \end{DoxyCompactList}\item 
const char $\ast$ \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+msg\+\_\+name} (const struct \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+def} $\ast$pdef, uint8\+\_\+t \textbf{ msg\+\_\+type})
\begin{DoxyCompactList}\small\item\em get the message name for given msg\+\_\+type in protocol pdef \end{DoxyCompactList}\item 
const char $\ast$ \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+ie\+\_\+name} (const struct \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+def} $\ast$pdef, uint8\+\_\+t \textbf{ iei})
\begin{DoxyCompactList}\small\item\em get the IE name for given IEI in protocol pdef \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+validate\+\_\+tp} (const struct \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+def} $\ast$pdef, uint8\+\_\+t \textbf{ msg\+\_\+type}, const struct \textbf{ tlv\+\_\+parsed} $\ast$tp, int log\+\_\+subsys, const char $\ast$log\+\_\+pfx)
\begin{DoxyCompactList}\small\item\em Validate an already TLV-\/decoded message against the protocol definition. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+parse} (const struct \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+def} $\ast$pdef, struct \textbf{ tlv\+\_\+parsed} $\ast$dec, unsigned int dec\+\_\+multiples, uint8\+\_\+t \textbf{ msg\+\_\+type}, const uint8\+\_\+t $\ast$buf, unsigned int buf\+\_\+len, uint8\+\_\+t lv\+\_\+tag, uint8\+\_\+t lv\+\_\+tag2, int log\+\_\+subsys, const char $\ast$log\+\_\+pfx)
\begin{DoxyCompactList}\small\item\em Parse + Validate a TLV-\/encoded message against the protocol definition. \end{DoxyCompactList}\item 
static uint32\+\_\+t \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+msgt\+\_\+flags} (const struct \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+def} $\ast$pdef, uint8\+\_\+t \textbf{ msg\+\_\+type})
\item 
int \textbf{ tlv\+\_\+dump} (struct \textbf{ tlv\+\_\+parsed} $\ast$dec)
\begin{DoxyCompactList}\small\item\em Dump parsed TLV structure to stdout. \end{DoxyCompactList}\item 
static \textbf{ \+\_\+\+\_\+attribute\+\_\+\+\_\+} ((constructor))
\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ tlv\+\_\+definition} \textbf{ tvlv\+\_\+att\+\_\+def}
\item 
struct \textbf{ tlv\+\_\+definition} \textbf{ vtvlv\+\_\+gan\+\_\+att\+\_\+def}
\item 
struct \textbf{ tlv\+\_\+definition} \textbf{ tvlv\+\_\+att\+\_\+def}
\item 
struct \textbf{ tlv\+\_\+definition} \textbf{ vtvlv\+\_\+gan\+\_\+att\+\_\+def}
\item 
static \+\_\+\+\_\+thread char \textbf{ ienamebuf} [32]
\item 
static \+\_\+\+\_\+thread char \textbf{ msgnamebuf} [32]
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Osmocom TLV Parser. 

The Osmocom TLV parser is intended to operate as a low-\/level C implementation without dynamic memory allocations. Basically, it iterates over the IE (Information Elements) of the message and fills an array of pointers, indexed by the IEI (IE Identifier). The parser output is thus an array of pointers to the start of the respective IE inside the message.

The TLV parser is configured by a TLV parser definition, which determines which if the IEIs for a given protocol are of which particular type. Types are e.\+g. TV (Tag + single byte value), Tag + fixed-\/length value, TLV with 8bit length, TLV with 16bit length, TLV with variable-\/length length field, etc. 

\doxysubsection{Macro Definition Documentation}
\mbox{\label{group__tlv_ga8d5fcbb9a9344b14835b83b4b7b25912}} 
\index{TLV parser@{TLV parser}!L16TV\_GROSS\_LEN@{L16TV\_GROSS\_LEN}}
\index{L16TV\_GROSS\_LEN@{L16TV\_GROSS\_LEN}!TLV parser@{TLV parser}}
\doxysubsubsection{L16TV\_GROSS\_LEN}
{\footnotesize\ttfamily \#define L16\+TV\+\_\+\+GROSS\+\_\+\+LEN(\begin{DoxyParamCaption}\item[{}]{\textbf{ x} }\end{DoxyParamCaption})~(\textbf{ x}+3)}



gross length of a L16\+TV type field 

\mbox{\label{group__tlv_ga39026bd6cf52e471406263a2410738be}} 
\index{TLV parser@{TLV parser}!LV\_GROSS\_LEN@{LV\_GROSS\_LEN}}
\index{LV\_GROSS\_LEN@{LV\_GROSS\_LEN}!TLV parser@{TLV parser}}
\doxysubsubsection{LV\_GROSS\_LEN}
{\footnotesize\ttfamily \#define LV\+\_\+\+GROSS\+\_\+\+LEN(\begin{DoxyParamCaption}\item[{}]{\textbf{ x} }\end{DoxyParamCaption})~(\textbf{ x}+1)}



gross length of a LV type field 

\mbox{\label{group__tlv_gaad614c604812132725a43b37c27ca339}} 
\index{TLV parser@{TLV parser}!MSG\_DEF@{MSG\_DEF}}
\index{MSG\_DEF@{MSG\_DEF}!TLV parser@{TLV parser}}
\doxysubsubsection{MSG\_DEF}
{\footnotesize\ttfamily \#define MSG\+\_\+\+DEF(\begin{DoxyParamCaption}\item[{}]{\textbf{ name},  }\item[{}]{mand\+\_\+ies,  }\item[{}]{\textbf{ flags} }\end{DoxyParamCaption})~\{ \textbf{ name}, mand\+\_\+ies, \textbf{ ARRAY\+\_\+\+SIZE}(mand\+\_\+ies), \textbf{ flags} \}}

\mbox{\label{group__tlv_gac8cd755f18ed6b5eba8d6ecdaf40141c}} 
\index{TLV parser@{TLV parser}!T16LV\_GROSS\_LEN@{T16LV\_GROSS\_LEN}}
\index{T16LV\_GROSS\_LEN@{T16LV\_GROSS\_LEN}!TLV parser@{TLV parser}}
\doxysubsubsection{T16LV\_GROSS\_LEN}
{\footnotesize\ttfamily \#define T16\+LV\+\_\+\+GROSS\+\_\+\+LEN(\begin{DoxyParamCaption}\item[{}]{\textbf{ x} }\end{DoxyParamCaption})~(\textbf{ x}+3)}



gross length of a T16\+LV type field 

\mbox{\label{group__tlv_ga0b7d74a14f434ce4e736e265bec606b9}} 
\index{TLV parser@{TLV parser}!TL16V\_GROSS\_LEN@{TL16V\_GROSS\_LEN}}
\index{TL16V\_GROSS\_LEN@{TL16V\_GROSS\_LEN}!TLV parser@{TLV parser}}
\doxysubsubsection{TL16V\_GROSS\_LEN}
{\footnotesize\ttfamily \#define TL16\+V\+\_\+\+GROSS\+\_\+\+LEN(\begin{DoxyParamCaption}\item[{}]{\textbf{ x} }\end{DoxyParamCaption})~(\textbf{ x}+3)}



gross length of a TL16V type field 

\mbox{\label{group__tlv_ga8acbd050c585044e4708d8dd0cb632f6}} 
\index{TLV parser@{TLV parser}!TLV16\_GROSS\_LEN@{TLV16\_GROSS\_LEN}}
\index{TLV16\_GROSS\_LEN@{TLV16\_GROSS\_LEN}!TLV parser@{TLV parser}}
\doxysubsubsection{TLV16\_GROSS\_LEN}
{\footnotesize\ttfamily \#define TLV16\+\_\+\+GROSS\+\_\+\+LEN(\begin{DoxyParamCaption}\item[{}]{\textbf{ x} }\end{DoxyParamCaption})~((2$\ast$\textbf{ x})+2)}



gross length of a TLV16 type field 

\mbox{\label{group__tlv_gad9d2f5dc9d0cebc1876e1f7981582583}} 
\index{TLV parser@{TLV parser}!TLV\_GROSS\_LEN@{TLV\_GROSS\_LEN}}
\index{TLV\_GROSS\_LEN@{TLV\_GROSS\_LEN}!TLV parser@{TLV parser}}
\doxysubsubsection{TLV\_GROSS\_LEN}
{\footnotesize\ttfamily \#define TLV\+\_\+\+GROSS\+\_\+\+LEN(\begin{DoxyParamCaption}\item[{}]{\textbf{ x} }\end{DoxyParamCaption})~(\textbf{ x}+2)}



gross length of a TLV type field 

\mbox{\label{group__tlv_ga0118f8b167ebc8b8bfebbde8c02f96b1}} 
\index{TLV parser@{TLV parser}!TLVP\_GET@{TLVP\_GET}}
\index{TLVP\_GET@{TLVP\_GET}!TLV parser@{TLV parser}}
\doxysubsubsection{TLVP\_GET}
{\footnotesize\ttfamily \#define TLVP\+\_\+\+GET(\begin{DoxyParamCaption}\item[{}]{\+\_\+tp,  }\item[{}]{tag }\end{DoxyParamCaption})~(\textbf{ TLVP\+\_\+\+PRESENT}(\+\_\+tp, tag)? \&(\+\_\+tp)-\/$>$lv[tag] \+: NULL)}



Return pointer to a TLV element if it is present. 

Usage\+: struct \doxyref{tlv\+\_\+p\+\_\+entry}{p.}{structtlv__p__entry} $\ast$e = TVLP\+\_\+\+GET(\&tp, TAG); if (!e) return -\/ENOENT; hexdump(e-\/$>$val, e-\/$>$len); 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em \+\_\+tp} & pointer to \doxyref{tlv\+\_\+parsed}{p.}{structtlv__parsed}. \\
\hline
\mbox{\texttt{ in}}  & {\em tag} & IE tag to return. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
struct \doxyref{tlv\+\_\+p\+\_\+entry}{p.}{structtlv__p__entry} pointer, or NULL if not present. 
\end{DoxyReturn}
\mbox{\label{group__tlv_gaa1f8015e27a4b96317471d66623f63c9}} 
\index{TLV parser@{TLV parser}!TLVP\_GET\_MINLEN@{TLVP\_GET\_MINLEN}}
\index{TLVP\_GET\_MINLEN@{TLVP\_GET\_MINLEN}!TLV parser@{TLV parser}}
\doxysubsubsection{TLVP\_GET\_MINLEN}
{\footnotesize\ttfamily \#define TLVP\+\_\+\+GET\+\_\+\+MINLEN(\begin{DoxyParamCaption}\item[{}]{\+\_\+tp,  }\item[{}]{tag,  }\item[{}]{min\+\_\+len }\end{DoxyParamCaption})~ (\textbf{ TLVP\+\_\+\+PRES\+\_\+\+LEN}(\+\_\+tp, tag, min\+\_\+len)? \&(\+\_\+tp)-\/$>$lv[tag] \+: NULL)}



Like \doxyref{TLVP\+\_\+\+GET()}{p.}{group__tlv_ga0118f8b167ebc8b8bfebbde8c02f96b1}, but enforcing a minimum val length. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em \+\_\+tp} & pointer to \doxyref{tlv\+\_\+parsed}{p.}{structtlv__parsed}. \\
\hline
\mbox{\texttt{ in}}  & {\em tag} & IE tag to return. \\
\hline
\mbox{\texttt{ in}}  & {\em min\+\_\+len} & Minimum value length in bytes. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
struct \doxyref{tlv\+\_\+p\+\_\+entry}{p.}{structtlv__p__entry} pointer, or NULL if not present or too short. 
\end{DoxyReturn}
\mbox{\label{group__tlv_ga20a66e023ec33193596458179a32c2d1}} 
\index{TLV parser@{TLV parser}!TLVP\_LEN@{TLVP\_LEN}}
\index{TLVP\_LEN@{TLVP\_LEN}!TLV parser@{TLV parser}}
\doxysubsubsection{TLVP\_LEN}
{\footnotesize\ttfamily \#define TLVP\+\_\+\+LEN(\begin{DoxyParamCaption}\item[{}]{\textbf{ x},  }\item[{}]{y }\end{DoxyParamCaption})~(\textbf{ x})-\/$>$lv[y].\textbf{ len}}

\mbox{\label{group__tlv_ga27c004f28295d4c78b5c00aa8a163760}} 
\index{TLV parser@{TLV parser}!TLVP\_PRES\_LEN@{TLVP\_PRES\_LEN}}
\index{TLVP\_PRES\_LEN@{TLVP\_PRES\_LEN}!TLV parser@{TLV parser}}
\doxysubsubsection{TLVP\_PRES\_LEN}
{\footnotesize\ttfamily \#define TLVP\+\_\+\+PRES\+\_\+\+LEN(\begin{DoxyParamCaption}\item[{}]{tp,  }\item[{}]{tag,  }\item[{}]{min\+\_\+len }\end{DoxyParamCaption})~ (\textbf{ TLVP\+\_\+\+PRESENT}(tp, tag) \&\& \textbf{ TLVP\+\_\+\+LEN}(tp, tag) $>$= min\+\_\+len)}

\mbox{\label{group__tlv_ga87373acb2458180804c79c3619861529}} 
\index{TLV parser@{TLV parser}!TLVP\_PRESENT@{TLVP\_PRESENT}}
\index{TLVP\_PRESENT@{TLVP\_PRESENT}!TLV parser@{TLV parser}}
\doxysubsubsection{TLVP\_PRESENT}
{\footnotesize\ttfamily \#define TLVP\+\_\+\+PRESENT(\begin{DoxyParamCaption}\item[{}]{\textbf{ x},  }\item[{}]{y }\end{DoxyParamCaption})~(!!((\textbf{ x})-\/$>$lv[y].val))}

\mbox{\label{group__tlv_ga1363d366c59dea2d85013d3eb135067c}} 
\index{TLV parser@{TLV parser}!TLVP\_VAL@{TLVP\_VAL}}
\index{TLVP\_VAL@{TLVP\_VAL}!TLV parser@{TLV parser}}
\doxysubsubsection{TLVP\_VAL}
{\footnotesize\ttfamily \#define TLVP\+\_\+\+VAL(\begin{DoxyParamCaption}\item[{}]{\textbf{ x},  }\item[{}]{y }\end{DoxyParamCaption})~(\textbf{ x})-\/$>$lv[y].val}

\mbox{\label{group__tlv_ga25407683731c3f5877790a56e1516d48}} 
\index{TLV parser@{TLV parser}!TLVP\_VAL\_MINLEN@{TLVP\_VAL\_MINLEN}}
\index{TLVP\_VAL\_MINLEN@{TLVP\_VAL\_MINLEN}!TLV parser@{TLV parser}}
\doxysubsubsection{TLVP\_VAL\_MINLEN}
{\footnotesize\ttfamily \#define TLVP\+\_\+\+VAL\+\_\+\+MINLEN(\begin{DoxyParamCaption}\item[{}]{\+\_\+tp,  }\item[{}]{tag,  }\item[{}]{min\+\_\+len }\end{DoxyParamCaption})~ (\textbf{ TLVP\+\_\+\+PRES\+\_\+\+LEN}(\+\_\+tp, tag, min\+\_\+len)? (\+\_\+tp)-\/$>$lv[tag].val \+: NULL)}



Like \doxyref{TLVP\+\_\+\+VAL()}{p.}{group__tlv_ga1363d366c59dea2d85013d3eb135067c}, but enforcing a minimum val length. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em \+\_\+tp} & pointer to \doxyref{tlv\+\_\+parsed}{p.}{structtlv__parsed}. \\
\hline
\mbox{\texttt{ in}}  & {\em tag} & IE tag to return. \\
\hline
\mbox{\texttt{ in}}  & {\em min\+\_\+len} & Minimum value length in bytes. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
const uint8\+\_\+t pointer to value, or NULL if not present or too short. 
\end{DoxyReturn}
\mbox{\label{group__tlv_ga1c4c12b5500aeaf70cb40f5aacdd3915}} 
\index{TLV parser@{TLV parser}!TVLV\_MAX\_ONEBYTE@{TVLV\_MAX\_ONEBYTE}}
\index{TVLV\_MAX\_ONEBYTE@{TVLV\_MAX\_ONEBYTE}!TLV parser@{TLV parser}}
\doxysubsubsection{TVLV\_MAX\_ONEBYTE}
{\footnotesize\ttfamily \#define TVLV\+\_\+\+MAX\+\_\+\+ONEBYTE~0x7f}



maximum length of TLV of one byte length 



\doxysubsection{Enumeration Type Documentation}
\mbox{\label{group__tlv_gac52a869a7ca04d56070304e97f751dff}} 
\index{TLV parser@{TLV parser}!osmo\_tlv\_parser\_error@{osmo\_tlv\_parser\_error}}
\index{osmo\_tlv\_parser\_error@{osmo\_tlv\_parser\_error}!TLV parser@{TLV parser}}
\doxysubsubsection{osmo\_tlv\_parser\_error}
{\footnotesize\ttfamily enum \textbf{ osmo\+\_\+tlv\+\_\+parser\+\_\+error}}



error return codes of various TLV parser functions 

\begin{DoxyEnumFields}{Enumerator}
\raisebox{\heightof{T}}[0pt][0pt]{\index{OSMO\_TLVP\_ERR\_OFS\_BEYOND\_BUFFER@{OSMO\_TLVP\_ERR\_OFS\_BEYOND\_BUFFER}!TLV parser@{TLV parser}}\index{TLV parser@{TLV parser}!OSMO\_TLVP\_ERR\_OFS\_BEYOND\_BUFFER@{OSMO\_TLVP\_ERR\_OFS\_BEYOND\_BUFFER}}}\mbox{\label{group__tlv_ggac52a869a7ca04d56070304e97f751dffa1c732bb83d6978e3a7a283491d943dbb}} 
OSMO\+\_\+\+TLVP\+\_\+\+ERR\+\_\+\+OFS\+\_\+\+BEYOND\+\_\+\+BUFFER&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{OSMO\_TLVP\_ERR\_OFS\_LEN\_BEYOND\_BUFFER@{OSMO\_TLVP\_ERR\_OFS\_LEN\_BEYOND\_BUFFER}!TLV parser@{TLV parser}}\index{TLV parser@{TLV parser}!OSMO\_TLVP\_ERR\_OFS\_LEN\_BEYOND\_BUFFER@{OSMO\_TLVP\_ERR\_OFS\_LEN\_BEYOND\_BUFFER}}}\mbox{\label{group__tlv_ggac52a869a7ca04d56070304e97f751dffae9b465f86ef43525dd3e69dc65a3a98c}} 
OSMO\+\_\+\+TLVP\+\_\+\+ERR\+\_\+\+OFS\+\_\+\+LEN\+\_\+\+BEYOND\+\_\+\+BUFFER&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{OSMO\_TLVP\_ERR\_UNKNOWN\_TLV\_TYPE@{OSMO\_TLVP\_ERR\_UNKNOWN\_TLV\_TYPE}!TLV parser@{TLV parser}}\index{TLV parser@{TLV parser}!OSMO\_TLVP\_ERR\_UNKNOWN\_TLV\_TYPE@{OSMO\_TLVP\_ERR\_UNKNOWN\_TLV\_TYPE}}}\mbox{\label{group__tlv_ggac52a869a7ca04d56070304e97f751dffa01408f7ddf897a14c6ab0ac42f675bf8}} 
OSMO\+\_\+\+TLVP\+\_\+\+ERR\+\_\+\+UNKNOWN\+\_\+\+TLV\+\_\+\+TYPE&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{OSMO\_TLVP\_ERR\_MAND\_IE\_MISSING@{OSMO\_TLVP\_ERR\_MAND\_IE\_MISSING}!TLV parser@{TLV parser}}\index{TLV parser@{TLV parser}!OSMO\_TLVP\_ERR\_MAND\_IE\_MISSING@{OSMO\_TLVP\_ERR\_MAND\_IE\_MISSING}}}\mbox{\label{group__tlv_ggac52a869a7ca04d56070304e97f751dffa005f94d4ee5236c60955045d7123834c}} 
OSMO\+\_\+\+TLVP\+\_\+\+ERR\+\_\+\+MAND\+\_\+\+IE\+\_\+\+MISSING&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{OSMO\_TLVP\_ERR\_IE\_TOO\_SHORT@{OSMO\_TLVP\_ERR\_IE\_TOO\_SHORT}!TLV parser@{TLV parser}}\index{TLV parser@{TLV parser}!OSMO\_TLVP\_ERR\_IE\_TOO\_SHORT@{OSMO\_TLVP\_ERR\_IE\_TOO\_SHORT}}}\mbox{\label{group__tlv_ggac52a869a7ca04d56070304e97f751dffa2b0b3ed31de272766e4f610d3e0ff913}} 
OSMO\+\_\+\+TLVP\+\_\+\+ERR\+\_\+\+IE\+\_\+\+TOO\+\_\+\+SHORT&\\
\hline

\end{DoxyEnumFields}
\mbox{\label{group__tlv_ga22c9aceefa3d83912aca8f3e8cfc27ae}} 
\index{TLV parser@{TLV parser}!tlv\_type@{tlv\_type}}
\index{tlv\_type@{tlv\_type}!TLV parser@{TLV parser}}
\doxysubsubsection{tlv\_type}
{\footnotesize\ttfamily enum \textbf{ tlv\+\_\+type}}



TLV type. 

\begin{DoxyEnumFields}{Enumerator}
\raisebox{\heightof{T}}[0pt][0pt]{\index{TLV\_TYPE\_NONE@{TLV\_TYPE\_NONE}!TLV parser@{TLV parser}}\index{TLV parser@{TLV parser}!TLV\_TYPE\_NONE@{TLV\_TYPE\_NONE}}}\mbox{\label{group__tlv_gga22c9aceefa3d83912aca8f3e8cfc27aea961722064b744b1920f5211b187d9810}} 
TLV\+\_\+\+TYPE\+\_\+\+NONE&no type \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{TLV\_TYPE\_FIXED@{TLV\_TYPE\_FIXED}!TLV parser@{TLV parser}}\index{TLV parser@{TLV parser}!TLV\_TYPE\_FIXED@{TLV\_TYPE\_FIXED}}}\mbox{\label{group__tlv_gga22c9aceefa3d83912aca8f3e8cfc27aea6a00d14d068fae81a1f2d87a617b06e0}} 
TLV\+\_\+\+TYPE\+\_\+\+FIXED&fixed-\/length value-\/only \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{TLV\_TYPE\_T@{TLV\_TYPE\_T}!TLV parser@{TLV parser}}\index{TLV parser@{TLV parser}!TLV\_TYPE\_T@{TLV\_TYPE\_T}}}\mbox{\label{group__tlv_gga22c9aceefa3d83912aca8f3e8cfc27aeaf3184afea11e5c1cf15bc61de7dfc383}} 
TLV\+\_\+\+TYPE\+\_\+T&tag-\/only \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{TLV\_TYPE\_TV@{TLV\_TYPE\_TV}!TLV parser@{TLV parser}}\index{TLV parser@{TLV parser}!TLV\_TYPE\_TV@{TLV\_TYPE\_TV}}}\mbox{\label{group__tlv_gga22c9aceefa3d83912aca8f3e8cfc27aea396bfeeaa7c36c0301ae48d8ffaa3218}} 
TLV\+\_\+\+TYPE\+\_\+\+TV&tag-\/value (8bit) \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{TLV\_TYPE\_TLV@{TLV\_TYPE\_TLV}!TLV parser@{TLV parser}}\index{TLV parser@{TLV parser}!TLV\_TYPE\_TLV@{TLV\_TYPE\_TLV}}}\mbox{\label{group__tlv_gga22c9aceefa3d83912aca8f3e8cfc27aea1b15d20b6a06bb4fa39a2f8e0058924a}} 
TLV\+\_\+\+TYPE\+\_\+\+TLV&tag-\/length-\/value \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{TLV\_TYPE\_TL16V@{TLV\_TYPE\_TL16V}!TLV parser@{TLV parser}}\index{TLV parser@{TLV parser}!TLV\_TYPE\_TL16V@{TLV\_TYPE\_TL16V}}}\mbox{\label{group__tlv_gga22c9aceefa3d83912aca8f3e8cfc27aeaa22af55fe9807c676c17c959e508af22}} 
TLV\+\_\+\+TYPE\+\_\+\+TL16V&tag, 16 bit length, value \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{TLV\_TYPE\_TvLV@{TLV\_TYPE\_TvLV}!TLV parser@{TLV parser}}\index{TLV parser@{TLV parser}!TLV\_TYPE\_TvLV@{TLV\_TYPE\_TvLV}}}\mbox{\label{group__tlv_gga22c9aceefa3d83912aca8f3e8cfc27aea8870632d3ad16328f4a96b9f464d0986}} 
TLV\+\_\+\+TYPE\+\_\+\+Tv\+LV&tag, variable length, value \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{TLV\_TYPE\_SINGLE\_TV@{TLV\_TYPE\_SINGLE\_TV}!TLV parser@{TLV parser}}\index{TLV parser@{TLV parser}!TLV\_TYPE\_SINGLE\_TV@{TLV\_TYPE\_SINGLE\_TV}}}\mbox{\label{group__tlv_gga22c9aceefa3d83912aca8f3e8cfc27aeadb1df6f7b917d026cf21a60c915a3c4f}} 
TLV\+\_\+\+TYPE\+\_\+\+SINGLE\+\_\+\+TV&tag and value (both 4 bit) in 1 byte \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{TLV\_TYPE\_vTvLV\_GAN@{TLV\_TYPE\_vTvLV\_GAN}!TLV parser@{TLV parser}}\index{TLV parser@{TLV parser}!TLV\_TYPE\_vTvLV\_GAN@{TLV\_TYPE\_vTvLV\_GAN}}}\mbox{\label{group__tlv_gga22c9aceefa3d83912aca8f3e8cfc27aeaf498535ccb4063a209bd4f9b428c44a8}} 
TLV\+\_\+\+TYPE\+\_\+v\+Tv\+LV\+\_\+\+GAN&variable-\/length tag, variable-\/length length \\
\hline

\end{DoxyEnumFields}


\doxysubsection{Function Documentation}
\mbox{\label{group__tlv_ga9ed16867a9394d9ccf1132194edae298}} 
\index{TLV parser@{TLV parser}!\_\_attribute\_\_@{\_\_attribute\_\_}}
\index{\_\_attribute\_\_@{\_\_attribute\_\_}!TLV parser@{TLV parser}}
\doxysubsubsection{\_\_attribute\_\_()}
{\footnotesize\ttfamily static \+\_\+\+\_\+attribute\+\_\+\+\_\+ (\begin{DoxyParamCaption}\item[{(constructor)}]{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ ARRAY\+\_\+\+SIZE}, \textbf{ tlv\+\_\+definition\+::def}, \textbf{ for()}, \textbf{ TLV\+\_\+\+TYPE\+\_\+\+Tv\+LV}, \textbf{ TLV\+\_\+\+TYPE\+\_\+v\+Tv\+LV\+\_\+\+GAN}, \textbf{ tvlv\+\_\+att\+\_\+def}, \textbf{ tlv\+\_\+def\+::type}, and \textbf{ vtvlv\+\_\+gan\+\_\+att\+\_\+def}.

\mbox{\label{group__tlv_ga2528e2e576bb5da450701343eb0f8a68}} 
\index{TLV parser@{TLV parser}!lv\_put@{lv\_put}}
\index{lv\_put@{lv\_put}!TLV parser@{TLV parser}}
\doxysubsubsection{lv\_put()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ lv\+\_\+put (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$}]{buf,  }\item[{uint8\+\_\+t}]{len,  }\item[{const uint8\+\_\+t $\ast$}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



put (append) a LV field 



References \textbf{ len}.



Referenced by \textbf{ msgb\+\_\+lv\+\_\+put()}.

\mbox{\label{group__tlv_gac3bbc02d9c475823c85be4cd1cfbd780}} 
\index{TLV parser@{TLV parser}!msgb\_l16tv\_put@{msgb\_l16tv\_put}}
\index{msgb\_l16tv\_put@{msgb\_l16tv\_put}!TLV parser@{TLV parser}}
\doxysubsubsection{msgb\_l16tv\_put()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ msgb\+\_\+l16tv\+\_\+put (\begin{DoxyParamCaption}\item[{struct \textbf{ msgb} $\ast$}]{msg,  }\item[{uint16\+\_\+t}]{len,  }\item[{uint8\+\_\+t}]{tag,  }\item[{const uint8\+\_\+t $\ast$}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



put (append) a L16\+TV field to \textbf{ Message buffers} 



References \textbf{ L16\+TV\+\_\+\+GROSS\+\_\+\+LEN}, \textbf{ len}, \textbf{ msg}, and \textbf{ msgb\+\_\+put()}.

\mbox{\label{group__tlv_ga54a3775dd7feab6b24df1be6440c8eb3}} 
\index{TLV parser@{TLV parser}!msgb\_lv\_put@{msgb\_lv\_put}}
\index{msgb\_lv\_put@{msgb\_lv\_put}!TLV parser@{TLV parser}}
\doxysubsubsection{msgb\_lv\_put()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ msgb\+\_\+lv\+\_\+put (\begin{DoxyParamCaption}\item[{struct \textbf{ msgb} $\ast$}]{msg,  }\item[{uint8\+\_\+t}]{len,  }\item[{const uint8\+\_\+t $\ast$}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



put (append) a LV field to a \textbf{ Message buffers} 

\begin{DoxyReturn}{Returns}
pointer to first byte after newly-\/put information 
\end{DoxyReturn}


References \textbf{ len}, \textbf{ LV\+\_\+\+GROSS\+\_\+\+LEN}, \textbf{ lv\+\_\+put()}, \textbf{ msg}, and \textbf{ msgb\+\_\+put()}.



Referenced by \textbf{ gsm48\+\_\+encode\+\_\+bearer\+\_\+cap()}, \textbf{ gsm48\+\_\+encode\+\_\+cause()}, \textbf{ gsm48\+\_\+encode\+\_\+facility()}, \textbf{ gsm48\+\_\+encode\+\_\+progress()}, \textbf{ gsm48\+\_\+encode\+\_\+useruser()}, and \textbf{ osmo\+\_\+enc\+\_\+gcr()}.

\mbox{\label{group__tlv_gafa1031013031e7fe9845fea6e95736c2}} 
\index{TLV parser@{TLV parser}!msgb\_t16lv\_put@{msgb\_t16lv\_put}}
\index{msgb\_t16lv\_put@{msgb\_t16lv\_put}!TLV parser@{TLV parser}}
\doxysubsubsection{msgb\_t16lv\_put()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ msgb\+\_\+t16lv\+\_\+put (\begin{DoxyParamCaption}\item[{struct \textbf{ msgb} $\ast$}]{msg,  }\item[{uint16\+\_\+t}]{tag,  }\item[{uint8\+\_\+t}]{len,  }\item[{const uint8\+\_\+t $\ast$}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



References \textbf{ len}, \textbf{ msg}, \textbf{ msgb\+\_\+put()}, \textbf{ T16\+LV\+\_\+\+GROSS\+\_\+\+LEN}, and \textbf{ t16lv\+\_\+put()}.

\mbox{\label{group__tlv_gae9313a1b2778a9f518ef4b0668d1a76f}} 
\index{TLV parser@{TLV parser}!msgb\_tl16v\_put@{msgb\_tl16v\_put}}
\index{msgb\_tl16v\_put@{msgb\_tl16v\_put}!TLV parser@{TLV parser}}
\doxysubsubsection{msgb\_tl16v\_put()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ msgb\+\_\+tl16v\+\_\+put (\begin{DoxyParamCaption}\item[{struct \textbf{ msgb} $\ast$}]{msg,  }\item[{uint8\+\_\+t}]{tag,  }\item[{uint16\+\_\+t}]{len,  }\item[{const uint8\+\_\+t $\ast$}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



put (append) a TL16V field to \textbf{ Message buffers} 



References \textbf{ len}, \textbf{ msg}, \textbf{ msgb\+\_\+put()}, \textbf{ TL16\+V\+\_\+\+GROSS\+\_\+\+LEN}, and \textbf{ tl16v\+\_\+put()}.



Referenced by \textbf{ abis\+\_\+nm\+\_\+fail\+\_\+evt\+\_\+vrep()}, \textbf{ abis\+\_\+nm\+\_\+put\+\_\+sw\+\_\+desc()}, and \textbf{ tlv\+\_\+encode\+\_\+one()}.

\mbox{\label{group__tlv_gaff1a9b97f7a38784fb430324879ccfaf}} 
\index{TLV parser@{TLV parser}!msgb\_tl\_put@{msgb\_tl\_put}}
\index{msgb\_tl\_put@{msgb\_tl\_put}!TLV parser@{TLV parser}}
\doxysubsubsection{msgb\_tl\_put()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ msgb\+\_\+tl\+\_\+put (\begin{DoxyParamCaption}\item[{struct \textbf{ msgb} $\ast$}]{msg,  }\item[{uint8\+\_\+t}]{tag }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



put (append) a TL fields to a \textbf{ Message buffers} 

\begin{DoxyReturn}{Returns}
pointer to the length field so it can be updated after adding new information under specified tag 
\end{DoxyReturn}


References \textbf{ len}, \textbf{ msg}, and \textbf{ msgb\+\_\+v\+\_\+put()}.



Referenced by \textbf{ gsm0808\+\_\+create\+\_\+common\+\_\+id()}, \textbf{ gsm0808\+\_\+create\+\_\+perform\+\_\+location\+\_\+request()}, \textbf{ gsm0808\+\_\+create\+\_\+perform\+\_\+location\+\_\+response()}, \textbf{ gsm0808\+\_\+enc\+\_\+gcr()}, \textbf{ gsm0808\+\_\+enc\+\_\+lcs\+\_\+cause()}, \textbf{ osmo\+\_\+bssmap\+\_\+le\+\_\+enc\+\_\+perform\+\_\+loc\+\_\+abort()}, \textbf{ osmo\+\_\+bssmap\+\_\+le\+\_\+enc\+\_\+perform\+\_\+loc\+\_\+req()}, \textbf{ osmo\+\_\+bssmap\+\_\+le\+\_\+enc\+\_\+perform\+\_\+loc\+\_\+resp()}, and \textbf{ osmo\+\_\+gsup\+\_\+encode()}.

\mbox{\label{group__tlv_ga8778266f192cfe323c1eb846d443c649}} 
\index{TLV parser@{TLV parser}!msgb\_tlv16\_put@{msgb\_tlv16\_put}}
\index{msgb\_tlv16\_put@{msgb\_tlv16\_put}!TLV parser@{TLV parser}}
\doxysubsubsection{msgb\_tlv16\_put()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ msgb\+\_\+tlv16\+\_\+put (\begin{DoxyParamCaption}\item[{struct \textbf{ msgb} $\ast$}]{msg,  }\item[{uint8\+\_\+t}]{tag,  }\item[{uint8\+\_\+t}]{len,  }\item[{const uint16\+\_\+t $\ast$}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



put (append) a TLV16 field to \textbf{ Message buffers} 



References \textbf{ len}, \textbf{ msg}, \textbf{ msgb\+\_\+put()}, \textbf{ TLV16\+\_\+\+GROSS\+\_\+\+LEN}, and \textbf{ tlv16\+\_\+put()}.

\mbox{\label{group__tlv_ga8fd973e1e49ac26d69ff7daa53f8fb0c}} 
\index{TLV parser@{TLV parser}!msgb\_tlv1\_push@{msgb\_tlv1\_push}}
\index{msgb\_tlv1\_push@{msgb\_tlv1\_push}!TLV parser@{TLV parser}}
\doxysubsubsection{msgb\_tlv1\_push()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ msgb\+\_\+tlv1\+\_\+push (\begin{DoxyParamCaption}\item[{struct \textbf{ msgb} $\ast$}]{msg,  }\item[{uint8\+\_\+t}]{tag,  }\item[{uint8\+\_\+t}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



push 1-\/byte tagged value 



References \textbf{ msg}, and \textbf{ msgb\+\_\+tlv\+\_\+push()}.



Referenced by \textbf{ gsm0480\+\_\+gen\+\_\+reject()}, \textbf{ gsm0480\+\_\+gen\+\_\+return\+\_\+error()}, \textbf{ gsm0480\+\_\+gen\+\_\+ussd\+\_\+resp\+\_\+7bit()}, and \textbf{ gsm0480\+\_\+wrap\+\_\+invoke()}.

\mbox{\label{group__tlv_gabcd599bb57bb6b355f4e075b863b69b7}} 
\index{TLV parser@{TLV parser}!msgb\_tlv\_push@{msgb\_tlv\_push}}
\index{msgb\_tlv\_push@{msgb\_tlv\_push}!TLV parser@{TLV parser}}
\doxysubsubsection{msgb\_tlv\_push()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ msgb\+\_\+tlv\+\_\+push (\begin{DoxyParamCaption}\item[{struct \textbf{ msgb} $\ast$}]{msg,  }\item[{uint8\+\_\+t}]{tag,  }\item[{uint8\+\_\+t}]{len,  }\item[{const uint8\+\_\+t $\ast$}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



push (prepend) a TLV field to a \textbf{ Message buffers} 

\begin{DoxyReturn}{Returns}
pointer to first byte of newly-\/pushed information 
\end{DoxyReturn}


References \textbf{ len}, \textbf{ msg}, \textbf{ msgb\+\_\+push()}, \textbf{ TLV\+\_\+\+GROSS\+\_\+\+LEN}, and \textbf{ tlv\+\_\+put()}.



Referenced by \textbf{ msgb\+\_\+tlv1\+\_\+push()}.

\mbox{\label{group__tlv_gaab0beac4c52b7aa00cb9bf1fda1a5a44}} 
\index{TLV parser@{TLV parser}!msgb\_tlv\_put@{msgb\_tlv\_put}}
\index{msgb\_tlv\_put@{msgb\_tlv\_put}!TLV parser@{TLV parser}}
\doxysubsubsection{msgb\_tlv\_put()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ msgb\+\_\+tlv\+\_\+put (\begin{DoxyParamCaption}\item[{struct \textbf{ msgb} $\ast$}]{msg,  }\item[{uint8\+\_\+t}]{tag,  }\item[{uint8\+\_\+t}]{len,  }\item[{const uint8\+\_\+t $\ast$}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



put (append) a TLV field to a \textbf{ Message buffers} 

\begin{DoxyReturn}{Returns}
pointer to first byte after newly-\/put information 
\end{DoxyReturn}


References \textbf{ len}, \textbf{ msg}, \textbf{ msgb\+\_\+put()}, \textbf{ TLV\+\_\+\+GROSS\+\_\+\+LEN}, and \textbf{ tlv\+\_\+put()}.



Referenced by \textbf{ encode\+\_\+auth\+\_\+info()}, \textbf{ encode\+\_\+pdp\+\_\+info()}, \textbf{ gsm0808\+\_\+create\+\_\+cipher\+\_\+complete()}, \textbf{ gsm0808\+\_\+create\+\_\+classmark\+\_\+update()}, \textbf{ gsm0808\+\_\+create\+\_\+clear\+\_\+complete()}, \textbf{ gsm0808\+\_\+create\+\_\+handover\+\_\+command()}, \textbf{ gsm0808\+\_\+create\+\_\+handover\+\_\+complete()}, \textbf{ gsm0808\+\_\+create\+\_\+handover\+\_\+failure()}, \textbf{ gsm0808\+\_\+create\+\_\+handover\+\_\+request()}, \textbf{ gsm0808\+\_\+create\+\_\+handover\+\_\+request\+\_\+ack2()}, \textbf{ gsm0808\+\_\+create\+\_\+layer3\+\_\+2()}, \textbf{ gsm0808\+\_\+create\+\_\+notification\+\_\+data()}, \textbf{ gsm0808\+\_\+create\+\_\+paging2()}, \textbf{ gsm0808\+\_\+create\+\_\+uplink\+\_\+app\+\_\+data()}, \textbf{ gsm0808\+\_\+create\+\_\+uplink\+\_\+request()}, \textbf{ gsm0808\+\_\+create\+\_\+uplink\+\_\+request\+\_\+cnf()}, \textbf{ gsm0808\+\_\+create\+\_\+vgcs\+\_\+queuing\+\_\+ind()}, \textbf{ gsm0808\+\_\+create\+\_\+vgcs\+\_\+sms()}, \textbf{ gsm0808\+\_\+create\+\_\+vgcs\+\_\+vbs\+\_\+assign\+\_\+fail()}, \textbf{ gsm0808\+\_\+create\+\_\+vgcs\+\_\+vbs\+\_\+assign\+\_\+req()}, \textbf{ gsm0808\+\_\+create\+\_\+vgcs\+\_\+vbs\+\_\+assign\+\_\+stat()}, \textbf{ gsm29118\+\_\+create\+\_\+dl\+\_\+ud()}, \textbf{ gsm29118\+\_\+create\+\_\+lu\+\_\+ack()}, \textbf{ gsm29118\+\_\+create\+\_\+lu\+\_\+rej()}, \textbf{ gsm29118\+\_\+create\+\_\+mm\+\_\+info\+\_\+req()}, \textbf{ gsm29118\+\_\+create\+\_\+paging\+\_\+req()}, \textbf{ gsm29118\+\_\+create\+\_\+release\+\_\+req()}, \textbf{ gsm29118\+\_\+create\+\_\+status()}, \textbf{ gsm48\+\_\+encode\+\_\+bearer\+\_\+cap()}, \textbf{ gsm48\+\_\+encode\+\_\+called()}, \textbf{ gsm48\+\_\+encode\+\_\+callerid()}, \textbf{ gsm48\+\_\+encode\+\_\+cause()}, \textbf{ gsm48\+\_\+encode\+\_\+cccap()}, \textbf{ gsm48\+\_\+encode\+\_\+facility()}, \textbf{ gsm48\+\_\+encode\+\_\+progress()}, \textbf{ gsm48\+\_\+encode\+\_\+ssversion()}, \textbf{ gsm48\+\_\+encode\+\_\+useruser()}, \textbf{ msgb\+\_\+sgsap\+\_\+imsi\+\_\+put()}, \textbf{ msgb\+\_\+sgsap\+\_\+lai\+\_\+put()}, \textbf{ msgb\+\_\+sgsap\+\_\+name\+\_\+put()}, \textbf{ osmo\+\_\+bssmap\+\_\+le\+\_\+ie\+\_\+enc\+\_\+lcs\+\_\+qos()}, \textbf{ osmo\+\_\+gsup\+\_\+encode()}, \textbf{ osmo\+\_\+oap\+\_\+encode()}, \textbf{ put\+\_\+old\+\_\+bss\+\_\+to\+\_\+new\+\_\+bss\+\_\+information()}, \textbf{ rsl\+\_\+rll\+\_\+error()}, and \textbf{ tlv\+\_\+encode\+\_\+one()}.

\mbox{\label{group__tlv_gafc1cac67e531ab3dc0ac1b515a315c47}} 
\index{TLV parser@{TLV parser}!msgb\_tv16\_push@{msgb\_tv16\_push}}
\index{msgb\_tv16\_push@{msgb\_tv16\_push}!TLV parser@{TLV parser}}
\doxysubsubsection{msgb\_tv16\_push()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ msgb\+\_\+tv16\+\_\+push (\begin{DoxyParamCaption}\item[{struct \textbf{ msgb} $\ast$}]{msg,  }\item[{uint8\+\_\+t}]{tag,  }\item[{uint16\+\_\+t}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



push (prepend) a TV16 field to a \textbf{ Message buffers} 

\begin{DoxyReturn}{Returns}
pointer to first byte of newly-\/pushed information 
\end{DoxyReturn}


References \textbf{ msg}, \textbf{ msgb\+\_\+push()}, and \textbf{ tv16\+\_\+put()}.



Referenced by \textbf{ rsl\+\_\+rll\+\_\+push\+\_\+l3()}, and \textbf{ send\+\_\+rslms\+\_\+rll\+\_\+l3\+\_\+ui()}.

\mbox{\label{group__tlv_gaaa4f740f9d690017866e727b719a2fd9}} 
\index{TLV parser@{TLV parser}!msgb\_tv16\_put@{msgb\_tv16\_put}}
\index{msgb\_tv16\_put@{msgb\_tv16\_put}!TLV parser@{TLV parser}}
\doxysubsubsection{msgb\_tv16\_put()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ msgb\+\_\+tv16\+\_\+put (\begin{DoxyParamCaption}\item[{struct \textbf{ msgb} $\ast$}]{msg,  }\item[{uint8\+\_\+t}]{tag,  }\item[{uint16\+\_\+t}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



put (append) a TV16 field (network order) to the given msgb 

\begin{DoxyReturn}{Returns}
pointer to first byte after newly-\/put information 
\end{DoxyReturn}


References \textbf{ msg}, \textbf{ msgb\+\_\+put()}, and \textbf{ tv16\+\_\+put()}.



Referenced by \textbf{ cbsp\+\_\+enc\+\_\+error\+\_\+ind()}, \textbf{ cbsp\+\_\+enc\+\_\+kill()}, \textbf{ cbsp\+\_\+enc\+\_\+kill\+\_\+compl()}, \textbf{ cbsp\+\_\+enc\+\_\+kill\+\_\+fail()}, \textbf{ cbsp\+\_\+enc\+\_\+msg\+\_\+status\+\_\+query()}, \textbf{ cbsp\+\_\+enc\+\_\+msg\+\_\+status\+\_\+query\+\_\+compl()}, \textbf{ cbsp\+\_\+enc\+\_\+msg\+\_\+status\+\_\+query\+\_\+fail()}, \textbf{ cbsp\+\_\+enc\+\_\+write\+\_\+repl()}, \textbf{ cbsp\+\_\+enc\+\_\+write\+\_\+repl\+\_\+compl()}, \textbf{ cbsp\+\_\+enc\+\_\+write\+\_\+repl\+\_\+fail()}, \textbf{ gsm0808\+\_\+create\+\_\+ass2()}, \textbf{ gsm0808\+\_\+create\+\_\+vgcs\+\_\+vbs\+\_\+assign\+\_\+req()}, and \textbf{ gsm0808\+\_\+create\+\_\+vgcs\+\_\+vbs\+\_\+assign\+\_\+res()}.

\mbox{\label{group__tlv_gabc5f69558d96fe560a0f7342f7b9c840}} 
\index{TLV parser@{TLV parser}!msgb\_tv32\_push@{msgb\_tv32\_push}}
\index{msgb\_tv32\_push@{msgb\_tv32\_push}!TLV parser@{TLV parser}}
\doxysubsubsection{msgb\_tv32\_push()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ msgb\+\_\+tv32\+\_\+push (\begin{DoxyParamCaption}\item[{struct \textbf{ msgb} $\ast$}]{msg,  }\item[{uint8\+\_\+t}]{tag,  }\item[{uint32\+\_\+t}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



push (prepend) a TV32 field to a \textbf{ Message buffers} 

\begin{DoxyReturn}{Returns}
pointer to first byte of newly-\/pushed information 
\end{DoxyReturn}


References \textbf{ msg}, and \textbf{ msgb\+\_\+push()}.

\mbox{\label{group__tlv_gab375a2f95cb1850e5a7eb917670cad15}} 
\index{TLV parser@{TLV parser}!msgb\_tv32\_put@{msgb\_tv32\_put}}
\index{msgb\_tv32\_put@{msgb\_tv32\_put}!TLV parser@{TLV parser}}
\doxysubsubsection{msgb\_tv32\_put()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ msgb\+\_\+tv32\+\_\+put (\begin{DoxyParamCaption}\item[{struct \textbf{ msgb} $\ast$}]{msg,  }\item[{uint8\+\_\+t}]{tag,  }\item[{uint32\+\_\+t}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



put (append) a TV32 field (network order) to the given msgb 

\begin{DoxyReturn}{Returns}
pointer to first byte after newly-\/put information 
\end{DoxyReturn}


References \textbf{ msg}, and \textbf{ msgb\+\_\+put()}.

\mbox{\label{group__tlv_ga375ad309358f7242ea73c39d0b3d65c3}} 
\index{TLV parser@{TLV parser}!msgb\_tv\_fixed\_put@{msgb\_tv\_fixed\_put}}
\index{msgb\_tv\_fixed\_put@{msgb\_tv\_fixed\_put}!TLV parser@{TLV parser}}
\doxysubsubsection{msgb\_tv\_fixed\_put()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ msgb\+\_\+tv\+\_\+fixed\+\_\+put (\begin{DoxyParamCaption}\item[{struct \textbf{ msgb} $\ast$}]{msg,  }\item[{uint8\+\_\+t}]{tag,  }\item[{unsigned int}]{len,  }\item[{const uint8\+\_\+t $\ast$}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



put (append) a TVfixed field to a \textbf{ Message buffers} 

\begin{DoxyReturn}{Returns}
pointer to first byte after newly-\/put information 
\end{DoxyReturn}


References \textbf{ len}, \textbf{ msg}, \textbf{ msgb\+\_\+put()}, and \textbf{ tv\+\_\+fixed\+\_\+put()}.



Referenced by \textbf{ abis\+\_\+nm\+\_\+fail\+\_\+evt\+\_\+vrep()}, \textbf{ gsm0808\+\_\+create\+\_\+ass2()}, \textbf{ gsm0808\+\_\+create\+\_\+handover\+\_\+request()}, \textbf{ gsm0808\+\_\+create\+\_\+handover\+\_\+required()}, \textbf{ gsm0808\+\_\+enc\+\_\+kc128()}, \textbf{ l2\+\_\+ph\+\_\+rach\+\_\+ind()}, and \textbf{ tlv\+\_\+encode\+\_\+one()}.

\mbox{\label{group__tlv_gabc75738a56fe22f2e4dc453d1176003d}} 
\index{TLV parser@{TLV parser}!msgb\_tv\_push@{msgb\_tv\_push}}
\index{msgb\_tv\_push@{msgb\_tv\_push}!TLV parser@{TLV parser}}
\doxysubsubsection{msgb\_tv\_push()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ msgb\+\_\+tv\+\_\+push (\begin{DoxyParamCaption}\item[{struct \textbf{ msgb} $\ast$}]{msg,  }\item[{uint8\+\_\+t}]{tag,  }\item[{uint8\+\_\+t}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



push (prepend) a TV field to a \textbf{ Message buffers} 

\begin{DoxyReturn}{Returns}
pointer to first byte of newly-\/pushed information 
\end{DoxyReturn}


References \textbf{ msg}, \textbf{ msgb\+\_\+push()}, and \textbf{ tv\+\_\+put()}.



Referenced by \textbf{ gsm0480\+\_\+gen\+\_\+reject()}, \textbf{ gsm0808\+\_\+create\+\_\+ass2()}, \textbf{ gsm0808\+\_\+create\+\_\+ass\+\_\+compl2()}, \textbf{ gsm0808\+\_\+create\+\_\+ass\+\_\+fail()}, \textbf{ gsm0808\+\_\+create\+\_\+cipher2()}, \textbf{ gsm0808\+\_\+create\+\_\+cipher\+\_\+complete()}, \textbf{ gsm0808\+\_\+create\+\_\+cipher\+\_\+reject()}, \textbf{ gsm0808\+\_\+create\+\_\+cipher\+\_\+reject\+\_\+ext()}, \textbf{ gsm0808\+\_\+create\+\_\+classmark\+\_\+request()}, \textbf{ gsm0808\+\_\+create\+\_\+classmark\+\_\+update()}, \textbf{ gsm0808\+\_\+create\+\_\+clear\+\_\+command2()}, \textbf{ gsm0808\+\_\+create\+\_\+clear\+\_\+rqst()}, \textbf{ gsm0808\+\_\+create\+\_\+common\+\_\+id()}, \textbf{ gsm0808\+\_\+create\+\_\+handover\+\_\+command()}, \textbf{ gsm0808\+\_\+create\+\_\+handover\+\_\+complete()}, \textbf{ gsm0808\+\_\+create\+\_\+handover\+\_\+detect()}, \textbf{ gsm0808\+\_\+create\+\_\+handover\+\_\+failure()}, \textbf{ gsm0808\+\_\+create\+\_\+handover\+\_\+performed()}, \textbf{ gsm0808\+\_\+create\+\_\+handover\+\_\+request()}, \textbf{ gsm0808\+\_\+create\+\_\+handover\+\_\+request\+\_\+ack2()}, \textbf{ gsm0808\+\_\+create\+\_\+handover\+\_\+required()}, \textbf{ gsm0808\+\_\+create\+\_\+handover\+\_\+required\+\_\+reject()}, \textbf{ gsm0808\+\_\+create\+\_\+handover\+\_\+succeeded()}, \textbf{ gsm0808\+\_\+create\+\_\+layer3\+\_\+2()}, \textbf{ gsm0808\+\_\+create\+\_\+lcls\+\_\+conn\+\_\+ctrl()}, \textbf{ gsm0808\+\_\+create\+\_\+lcls\+\_\+conn\+\_\+ctrl\+\_\+ack()}, \textbf{ gsm0808\+\_\+create\+\_\+lcls\+\_\+notification()}, \textbf{ gsm0808\+\_\+create\+\_\+notification\+\_\+data()}, \textbf{ gsm0808\+\_\+create\+\_\+paging2()}, \textbf{ gsm0808\+\_\+create\+\_\+perform\+\_\+location\+\_\+abort()}, \textbf{ gsm0808\+\_\+create\+\_\+perform\+\_\+location\+\_\+request()}, \textbf{ gsm0808\+\_\+create\+\_\+perform\+\_\+location\+\_\+response()}, \textbf{ gsm0808\+\_\+create\+\_\+reset()}, \textbf{ gsm0808\+\_\+create\+\_\+reset\+\_\+ack()}, \textbf{ gsm0808\+\_\+create\+\_\+sapi\+\_\+reject\+\_\+cause()}, \textbf{ gsm0808\+\_\+create\+\_\+uplink\+\_\+app\+\_\+data()}, \textbf{ gsm0808\+\_\+create\+\_\+uplink\+\_\+reject\+\_\+cmd()}, \textbf{ gsm0808\+\_\+create\+\_\+uplink\+\_\+release\+\_\+cmd()}, \textbf{ gsm0808\+\_\+create\+\_\+uplink\+\_\+release\+\_\+ind()}, \textbf{ gsm0808\+\_\+create\+\_\+uplink\+\_\+request()}, \textbf{ gsm0808\+\_\+create\+\_\+uplink\+\_\+request\+\_\+ack()}, \textbf{ gsm0808\+\_\+create\+\_\+uplink\+\_\+request\+\_\+cnf()}, \textbf{ gsm0808\+\_\+create\+\_\+uplink\+\_\+seized\+\_\+cmd()}, \textbf{ gsm0808\+\_\+create\+\_\+vgcs\+\_\+additional\+\_\+info()}, \textbf{ gsm0808\+\_\+create\+\_\+vgcs\+\_\+sms()}, \textbf{ gsm0808\+\_\+create\+\_\+vgcs\+\_\+vbs\+\_\+area\+\_\+cell\+\_\+info()}, \textbf{ gsm0808\+\_\+create\+\_\+vgcs\+\_\+vbs\+\_\+assign\+\_\+fail()}, \textbf{ gsm0808\+\_\+create\+\_\+vgcs\+\_\+vbs\+\_\+assign\+\_\+req()}, \textbf{ gsm0808\+\_\+create\+\_\+vgcs\+\_\+vbs\+\_\+assign\+\_\+res()}, \textbf{ gsm0808\+\_\+create\+\_\+vgcs\+\_\+vbs\+\_\+assign\+\_\+stat()}, \textbf{ gsm0808\+\_\+create\+\_\+vgcs\+\_\+vbs\+\_\+setup()}, \textbf{ gsm0808\+\_\+create\+\_\+vgcs\+\_\+vbs\+\_\+setup\+\_\+ack()}, \textbf{ gsm0808\+\_\+create\+\_\+vgcs\+\_\+vbs\+\_\+setup\+\_\+refuse()}, \textbf{ osmo\+\_\+bssap\+\_\+le\+\_\+enc()}, and \textbf{ send\+\_\+rslms\+\_\+rll\+\_\+l3\+\_\+ui()}.

\mbox{\label{group__tlv_ga68b9f5e6dda073a62dff0323fc1536fa}} 
\index{TLV parser@{TLV parser}!msgb\_tv\_put@{msgb\_tv\_put}}
\index{msgb\_tv\_put@{msgb\_tv\_put}!TLV parser@{TLV parser}}
\doxysubsubsection{msgb\_tv\_put()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ msgb\+\_\+tv\+\_\+put (\begin{DoxyParamCaption}\item[{struct \textbf{ msgb} $\ast$}]{msg,  }\item[{uint8\+\_\+t}]{tag,  }\item[{uint8\+\_\+t}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



put (append) a TV field to a \textbf{ Message buffers} 

\begin{DoxyReturn}{Returns}
pointer to first byte after newly-\/put information 
\end{DoxyReturn}


References \textbf{ msg}, \textbf{ msgb\+\_\+put()}, and \textbf{ tv\+\_\+put()}.



Referenced by \textbf{ abis\+\_\+nm\+\_\+fail\+\_\+evt\+\_\+vrep()}, \textbf{ cbsp\+\_\+enc\+\_\+error\+\_\+ind()}, \textbf{ cbsp\+\_\+enc\+\_\+failure()}, \textbf{ cbsp\+\_\+enc\+\_\+keep\+\_\+alive()}, \textbf{ cbsp\+\_\+enc\+\_\+kill()}, \textbf{ cbsp\+\_\+enc\+\_\+kill\+\_\+compl()}, \textbf{ cbsp\+\_\+enc\+\_\+kill\+\_\+fail()}, \textbf{ cbsp\+\_\+enc\+\_\+load\+\_\+query()}, \textbf{ cbsp\+\_\+enc\+\_\+load\+\_\+query\+\_\+compl()}, \textbf{ cbsp\+\_\+enc\+\_\+load\+\_\+query\+\_\+fail()}, \textbf{ cbsp\+\_\+enc\+\_\+msg\+\_\+status\+\_\+query()}, \textbf{ cbsp\+\_\+enc\+\_\+msg\+\_\+status\+\_\+query\+\_\+compl()}, \textbf{ cbsp\+\_\+enc\+\_\+msg\+\_\+status\+\_\+query\+\_\+fail()}, \textbf{ cbsp\+\_\+enc\+\_\+restart()}, \textbf{ cbsp\+\_\+enc\+\_\+write\+\_\+repl()}, \textbf{ cbsp\+\_\+enc\+\_\+write\+\_\+repl\+\_\+compl()}, \textbf{ cbsp\+\_\+enc\+\_\+write\+\_\+repl\+\_\+fail()}, \textbf{ gsm0808\+\_\+create\+\_\+ass\+\_\+compl2()}, \textbf{ gsm0808\+\_\+create\+\_\+ass\+\_\+fail()}, \textbf{ gsm0808\+\_\+create\+\_\+cipher2()}, \textbf{ gsm0808\+\_\+create\+\_\+cipher\+\_\+complete()}, \textbf{ gsm0808\+\_\+create\+\_\+clear\+\_\+command()}, \textbf{ gsm0808\+\_\+create\+\_\+handover\+\_\+complete()}, \textbf{ gsm0808\+\_\+create\+\_\+handover\+\_\+performed()}, \textbf{ gsm0808\+\_\+create\+\_\+handover\+\_\+request()}, \textbf{ gsm0808\+\_\+create\+\_\+handover\+\_\+request\+\_\+ack2()}, \textbf{ gsm0808\+\_\+create\+\_\+handover\+\_\+required()}, \textbf{ gsm0808\+\_\+create\+\_\+lcls\+\_\+conn\+\_\+ctrl()}, \textbf{ gsm0808\+\_\+create\+\_\+lcls\+\_\+conn\+\_\+ctrl\+\_\+ack()}, \textbf{ gsm0808\+\_\+create\+\_\+lcls\+\_\+notification()}, \textbf{ gsm0808\+\_\+create\+\_\+paging2()}, \textbf{ gsm0808\+\_\+create\+\_\+sapi\+\_\+reject\+\_\+cause()}, \textbf{ gsm0808\+\_\+create\+\_\+uplink\+\_\+reject\+\_\+cmd()}, \textbf{ gsm0808\+\_\+create\+\_\+uplink\+\_\+release\+\_\+ind()}, \textbf{ gsm0808\+\_\+create\+\_\+uplink\+\_\+request()}, \textbf{ gsm0808\+\_\+create\+\_\+uplink\+\_\+request\+\_\+ack()}, \textbf{ gsm0808\+\_\+create\+\_\+uplink\+\_\+seized\+\_\+cmd()}, \textbf{ gsm0808\+\_\+create\+\_\+vgcs\+\_\+vbs\+\_\+assign\+\_\+fail()}, \textbf{ gsm0808\+\_\+create\+\_\+vgcs\+\_\+vbs\+\_\+assign\+\_\+req()}, \textbf{ gsm0808\+\_\+create\+\_\+vgcs\+\_\+vbs\+\_\+assign\+\_\+res()}, \textbf{ gsm0808\+\_\+enc\+\_\+lcls()}, \textbf{ gsm411\+\_\+send\+\_\+abort()}, \textbf{ gsm411\+\_\+send\+\_\+rp\+\_\+error()}, \textbf{ gsm48\+\_\+encode\+\_\+keypad()}, \textbf{ gsm48\+\_\+encode\+\_\+signal()}, \textbf{ l2\+\_\+ph\+\_\+rach\+\_\+ind()}, \textbf{ osmo\+\_\+gsup\+\_\+encode\+\_\+an\+\_\+apdu()}, \textbf{ osmo\+\_\+gsup\+\_\+sms\+\_\+encode\+\_\+sm\+\_\+rp\+\_\+da()}, \textbf{ osmo\+\_\+gsup\+\_\+sms\+\_\+encode\+\_\+sm\+\_\+rp\+\_\+oa()}, and \textbf{ tlv\+\_\+encode\+\_\+one()}.

\mbox{\label{group__tlv_gaa5a7f4afcb29692942886e738f3aa472}} 
\index{TLV parser@{TLV parser}!msgb\_tvl\_put@{msgb\_tvl\_put}}
\index{msgb\_tvl\_put@{msgb\_tvl\_put}!TLV parser@{TLV parser}}
\doxysubsubsection{msgb\_tvl\_put()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ msgb\+\_\+tvl\+\_\+put (\begin{DoxyParamCaption}\item[{struct \textbf{ msgb} $\ast$}]{msg,  }\item[{uint8\+\_\+t}]{tag,  }\item[{uint16\+\_\+t}]{len }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



put (append) a TvL field to \textbf{ Message buffers}, i.\+e. 

a Tv\+LV with variable-\/size length, where the value\textquotesingle{}s length is already known, but will be put() later. The value section is not yet reserved, only tag and variable-\/length are put in the msgb. \begin{DoxyReturn}{Returns}
pointer to the value\textquotesingle{}s start position and end of the msgb. 
\end{DoxyReturn}


References \textbf{ len}, \textbf{ msg}, \textbf{ msgb\+\_\+put()}, \textbf{ tvl\+\_\+put()}, and \textbf{ TVLV\+\_\+\+GROSS\+\_\+\+LEN()}.

\mbox{\label{group__tlv_ga00c6f0ff4c7ad62d0e510d0282ee9956}} 
\index{TLV parser@{TLV parser}!msgb\_tvlv\_push@{msgb\_tvlv\_push}}
\index{msgb\_tvlv\_push@{msgb\_tvlv\_push}!TLV parser@{TLV parser}}
\doxysubsubsection{msgb\_tvlv\_push()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ msgb\+\_\+tvlv\+\_\+push (\begin{DoxyParamCaption}\item[{struct \textbf{ msgb} $\ast$}]{msg,  }\item[{uint8\+\_\+t}]{tag,  }\item[{uint16\+\_\+t}]{len,  }\item[{const uint8\+\_\+t $\ast$}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



push (prepend) a Tv\+LV field to a \textbf{ Message buffers} 

\begin{DoxyReturn}{Returns}
pointer to first byte of newly-\/pushed information 
\end{DoxyReturn}


References \textbf{ len}, \textbf{ msg}, \textbf{ msgb\+\_\+push()}, \textbf{ TVLV\+\_\+\+GROSS\+\_\+\+LEN()}, and \textbf{ tvlv\+\_\+put()}.

\mbox{\label{group__tlv_gade97d1078fc6e57b75c2d8f323b0186b}} 
\index{TLV parser@{TLV parser}!msgb\_tvlv\_put@{msgb\_tvlv\_put}}
\index{msgb\_tvlv\_put@{msgb\_tvlv\_put}!TLV parser@{TLV parser}}
\doxysubsubsection{msgb\_tvlv\_put()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ msgb\+\_\+tvlv\+\_\+put (\begin{DoxyParamCaption}\item[{struct \textbf{ msgb} $\ast$}]{msg,  }\item[{uint8\+\_\+t}]{tag,  }\item[{uint16\+\_\+t}]{len,  }\item[{const uint8\+\_\+t $\ast$}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



put (append) a Tv\+LV field to \textbf{ Message buffers} 



References \textbf{ len}, \textbf{ msg}, \textbf{ msgb\+\_\+put()}, \textbf{ TVLV\+\_\+\+GROSS\+\_\+\+LEN()}, and \textbf{ tvlv\+\_\+put()}.



Referenced by \textbf{ msgb\+\_\+tvlv\+\_\+put\+\_\+16be()}, \textbf{ msgb\+\_\+tvlv\+\_\+put\+\_\+32be()}, and \textbf{ tlv\+\_\+encode\+\_\+one()}.

\mbox{\label{group__tlv_gac134da978129c9c924f274909c914119}} 
\index{TLV parser@{TLV parser}!msgb\_tvlv\_put\_16be@{msgb\_tvlv\_put\_16be}}
\index{msgb\_tvlv\_put\_16be@{msgb\_tvlv\_put\_16be}!TLV parser@{TLV parser}}
\doxysubsubsection{msgb\_tvlv\_put\_16be()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ msgb\+\_\+tvlv\+\_\+put\+\_\+16be (\begin{DoxyParamCaption}\item[{struct \textbf{ msgb} $\ast$}]{msg,  }\item[{uint8\+\_\+t}]{tag,  }\item[{uint16\+\_\+t}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



put (append) a Tv\+LV field containing a big-\/endian 16bit value to msgb. 



References \textbf{ msg}, \textbf{ msgb\+\_\+tvlv\+\_\+put()}, and \textbf{ osmo\+\_\+htons}.

\mbox{\label{group__tlv_gab33bd2a3d0024547520c1d7ac59bc877}} 
\index{TLV parser@{TLV parser}!msgb\_tvlv\_put\_32be@{msgb\_tvlv\_put\_32be}}
\index{msgb\_tvlv\_put\_32be@{msgb\_tvlv\_put\_32be}!TLV parser@{TLV parser}}
\doxysubsubsection{msgb\_tvlv\_put\_32be()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ msgb\+\_\+tvlv\+\_\+put\+\_\+32be (\begin{DoxyParamCaption}\item[{struct \textbf{ msgb} $\ast$}]{msg,  }\item[{uint8\+\_\+t}]{tag,  }\item[{uint32\+\_\+t}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



put (append) a Tv\+LV field containing a big-\/endian 16bit value to msgb. 



References \textbf{ msg}, \textbf{ msgb\+\_\+tvlv\+\_\+put()}, and \textbf{ osmo\+\_\+htonl}.

\mbox{\label{group__tlv_ga7dc244ae7eec20f6e9b4622cb34cbcee}} 
\index{TLV parser@{TLV parser}!msgb\_v\_put@{msgb\_v\_put}}
\index{msgb\_v\_put@{msgb\_v\_put}!TLV parser@{TLV parser}}
\doxysubsubsection{msgb\_v\_put()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ msgb\+\_\+v\+\_\+put (\begin{DoxyParamCaption}\item[{struct \textbf{ msgb} $\ast$}]{msg,  }\item[{uint8\+\_\+t}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



put (append) a V field to a \textbf{ Message buffers} 

\begin{DoxyReturn}{Returns}
pointer to first byte after newly-\/put information 
\end{DoxyReturn}


References \textbf{ msg}, \textbf{ msgb\+\_\+put()}, and \textbf{ v\+\_\+put()}.



Referenced by \textbf{ abis\+\_\+nm\+\_\+put\+\_\+sw\+\_\+desc()}, \textbf{ gsm0808\+\_\+create\+\_\+ass2()}, \textbf{ gsm0808\+\_\+create\+\_\+ass\+\_\+compl2()}, \textbf{ gsm0808\+\_\+create\+\_\+ass\+\_\+fail()}, \textbf{ gsm0808\+\_\+create\+\_\+cipher2()}, \textbf{ gsm0808\+\_\+create\+\_\+cipher\+\_\+complete()}, \textbf{ gsm0808\+\_\+create\+\_\+cipher\+\_\+reject()}, \textbf{ gsm0808\+\_\+create\+\_\+cipher\+\_\+reject\+\_\+ext()}, \textbf{ gsm0808\+\_\+create\+\_\+classmark\+\_\+request()}, \textbf{ gsm0808\+\_\+create\+\_\+classmark\+\_\+update()}, \textbf{ gsm0808\+\_\+create\+\_\+clear\+\_\+command()}, \textbf{ gsm0808\+\_\+create\+\_\+clear\+\_\+command2()}, \textbf{ gsm0808\+\_\+create\+\_\+clear\+\_\+rqst()}, \textbf{ gsm0808\+\_\+create\+\_\+common\+\_\+id()}, \textbf{ gsm0808\+\_\+create\+\_\+handover\+\_\+command()}, \textbf{ gsm0808\+\_\+create\+\_\+handover\+\_\+complete()}, \textbf{ gsm0808\+\_\+create\+\_\+handover\+\_\+detect()}, \textbf{ gsm0808\+\_\+create\+\_\+handover\+\_\+failure()}, \textbf{ gsm0808\+\_\+create\+\_\+handover\+\_\+performed()}, \textbf{ gsm0808\+\_\+create\+\_\+handover\+\_\+request()}, \textbf{ gsm0808\+\_\+create\+\_\+handover\+\_\+request\+\_\+ack2()}, \textbf{ gsm0808\+\_\+create\+\_\+handover\+\_\+required()}, \textbf{ gsm0808\+\_\+create\+\_\+handover\+\_\+required\+\_\+reject()}, \textbf{ gsm0808\+\_\+create\+\_\+handover\+\_\+succeeded()}, \textbf{ gsm0808\+\_\+create\+\_\+layer3\+\_\+2()}, \textbf{ gsm0808\+\_\+create\+\_\+lcls\+\_\+conn\+\_\+ctrl()}, \textbf{ gsm0808\+\_\+create\+\_\+lcls\+\_\+conn\+\_\+ctrl\+\_\+ack()}, \textbf{ gsm0808\+\_\+create\+\_\+lcls\+\_\+notification()}, \textbf{ gsm0808\+\_\+create\+\_\+notification\+\_\+data()}, \textbf{ gsm0808\+\_\+create\+\_\+paging2()}, \textbf{ gsm0808\+\_\+create\+\_\+perform\+\_\+location\+\_\+abort()}, \textbf{ gsm0808\+\_\+create\+\_\+perform\+\_\+location\+\_\+request()}, \textbf{ gsm0808\+\_\+create\+\_\+perform\+\_\+location\+\_\+response()}, \textbf{ gsm0808\+\_\+create\+\_\+reset()}, \textbf{ gsm0808\+\_\+create\+\_\+reset\+\_\+ack()}, \textbf{ gsm0808\+\_\+create\+\_\+sapi\+\_\+reject\+\_\+cause()}, \textbf{ gsm0808\+\_\+create\+\_\+uplink\+\_\+app\+\_\+data()}, \textbf{ gsm0808\+\_\+create\+\_\+uplink\+\_\+reject\+\_\+cmd()}, \textbf{ gsm0808\+\_\+create\+\_\+uplink\+\_\+release\+\_\+cmd()}, \textbf{ gsm0808\+\_\+create\+\_\+uplink\+\_\+release\+\_\+ind()}, \textbf{ gsm0808\+\_\+create\+\_\+uplink\+\_\+request()}, \textbf{ gsm0808\+\_\+create\+\_\+uplink\+\_\+request\+\_\+ack()}, \textbf{ gsm0808\+\_\+create\+\_\+uplink\+\_\+request\+\_\+cnf()}, \textbf{ gsm0808\+\_\+create\+\_\+uplink\+\_\+seized\+\_\+cmd()}, \textbf{ gsm0808\+\_\+create\+\_\+vgcs\+\_\+additional\+\_\+info()}, \textbf{ gsm0808\+\_\+create\+\_\+vgcs\+\_\+vbs\+\_\+area\+\_\+cell\+\_\+info()}, \textbf{ gsm0808\+\_\+create\+\_\+vgcs\+\_\+vbs\+\_\+assign\+\_\+fail()}, \textbf{ gsm0808\+\_\+create\+\_\+vgcs\+\_\+vbs\+\_\+assign\+\_\+req()}, \textbf{ gsm0808\+\_\+create\+\_\+vgcs\+\_\+vbs\+\_\+assign\+\_\+res()}, \textbf{ gsm0808\+\_\+create\+\_\+vgcs\+\_\+vbs\+\_\+assign\+\_\+stat()}, \textbf{ gsm0808\+\_\+create\+\_\+vgcs\+\_\+vbs\+\_\+setup()}, \textbf{ gsm0808\+\_\+create\+\_\+vgcs\+\_\+vbs\+\_\+setup\+\_\+ack()}, \textbf{ gsm0808\+\_\+create\+\_\+vgcs\+\_\+vbs\+\_\+setup\+\_\+refuse()}, \textbf{ gsm0808\+\_\+enc\+\_\+lcls()}, \textbf{ gsm48\+\_\+encode\+\_\+notify()}, \textbf{ msgb\+\_\+tl\+\_\+put()}, \textbf{ osmo\+\_\+bssmap\+\_\+le\+\_\+enc()}, \textbf{ osmo\+\_\+gsup\+\_\+encode()}, \textbf{ osmo\+\_\+gsup\+\_\+encode\+\_\+an\+\_\+apdu()}, \textbf{ osmo\+\_\+gsup\+\_\+sms\+\_\+encode\+\_\+sm\+\_\+rp\+\_\+da()}, \textbf{ osmo\+\_\+gsup\+\_\+sms\+\_\+encode\+\_\+sm\+\_\+rp\+\_\+oa()}, \textbf{ osmo\+\_\+oap\+\_\+encode()}, and \textbf{ tlv\+\_\+encode\+\_\+one()}.

\mbox{\label{group__tlv_ga87145ee3e50144a03b1669b7751f0029}} 
\index{TLV parser@{TLV parser}!msgb\_vtvl\_gan\_push@{msgb\_vtvl\_gan\_push}}
\index{msgb\_vtvl\_gan\_push@{msgb\_vtvl\_gan\_push}!TLV parser@{TLV parser}}
\doxysubsubsection{msgb\_vtvl\_gan\_push()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ msgb\+\_\+vtvl\+\_\+gan\+\_\+push (\begin{DoxyParamCaption}\item[{struct \textbf{ msgb} $\ast$}]{msg,  }\item[{uint16\+\_\+t}]{tag,  }\item[{uint16\+\_\+t}]{len }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



References \textbf{ len}, \textbf{ msg}, \textbf{ msgb\+\_\+push()}, \textbf{ VTVL\+\_\+\+GAN\+\_\+\+GROSS\+\_\+\+LEN()}, and \textbf{ vtvl\+\_\+gan\+\_\+put()}.

\mbox{\label{group__tlv_ga99ee0ba90f123cbe6b899112015a0ed6}} 
\index{TLV parser@{TLV parser}!msgb\_vtvlv\_gan\_push@{msgb\_vtvlv\_gan\_push}}
\index{msgb\_vtvlv\_gan\_push@{msgb\_vtvlv\_gan\_push}!TLV parser@{TLV parser}}
\doxysubsubsection{msgb\_vtvlv\_gan\_push()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ msgb\+\_\+vtvlv\+\_\+gan\+\_\+push (\begin{DoxyParamCaption}\item[{struct \textbf{ msgb} $\ast$}]{msg,  }\item[{uint16\+\_\+t}]{tag,  }\item[{uint16\+\_\+t}]{len,  }\item[{const uint8\+\_\+t $\ast$}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



References \textbf{ len}, \textbf{ msg}, \textbf{ msgb\+\_\+push()}, \textbf{ VTVLV\+\_\+\+GAN\+\_\+\+GROSS\+\_\+\+LEN()}, and \textbf{ vtvlv\+\_\+gan\+\_\+put()}.

\mbox{\label{group__tlv_ga35a63b78d1ede821a8d486c7f032c20b}} 
\index{TLV parser@{TLV parser}!msgb\_vtvlv\_gan\_put@{msgb\_vtvlv\_gan\_put}}
\index{msgb\_vtvlv\_gan\_put@{msgb\_vtvlv\_gan\_put}!TLV parser@{TLV parser}}
\doxysubsubsection{msgb\_vtvlv\_gan\_put()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ msgb\+\_\+vtvlv\+\_\+gan\+\_\+put (\begin{DoxyParamCaption}\item[{struct \textbf{ msgb} $\ast$}]{msg,  }\item[{uint16\+\_\+t}]{tag,  }\item[{uint16\+\_\+t}]{len,  }\item[{const uint8\+\_\+t $\ast$}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



put (append) a v\+Tv\+LV field to \textbf{ Message buffers} 



References \textbf{ len}, \textbf{ msg}, \textbf{ msgb\+\_\+put()}, \textbf{ VTVLV\+\_\+\+GAN\+\_\+\+GROSS\+\_\+\+LEN()}, and \textbf{ vtvlv\+\_\+gan\+\_\+put()}.



Referenced by \textbf{ tlv\+\_\+encode\+\_\+one()}.

\mbox{\label{group__tlv_gac8abccc3b4bb687f171cbbaec34eaa44}} 
\index{TLV parser@{TLV parser}!osmo\_match\_shift\_tlv@{osmo\_match\_shift\_tlv}}
\index{osmo\_match\_shift\_tlv@{osmo\_match\_shift\_tlv}!TLV parser@{TLV parser}}
\doxysubsubsection{osmo\_match\_shift\_tlv()}
{\footnotesize\ttfamily int osmo\+\_\+match\+\_\+shift\+\_\+tlv (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$$\ast$}]{data,  }\item[{size\+\_\+t $\ast$}]{data\+\_\+len,  }\item[{uint8\+\_\+t}]{expected\+\_\+tag,  }\item[{uint8\+\_\+t $\ast$$\ast$}]{value,  }\item[{size\+\_\+t $\ast$}]{value\+\_\+len }\end{DoxyParamCaption})}



Verify TLV header and advance data / subtract length. 


\begin{DoxyParams}[1]{Parameters}
 & {\em data} & pointer to the pointer to data \\
\hline
 & {\em data\+\_\+len} & pointer to size\+\_\+t containing \begin{DoxyItemize}
\item data length \end{DoxyItemize}
\\
\hline
\mbox{\texttt{ in}}  & {\em expected\+\_\+tag} & the tag (IEI) that we expect at \begin{DoxyItemize}
\item data \end{DoxyItemize}
\\
\hline
\mbox{\texttt{ out}}  & {\em value} & pointer to pointer of value part of IE \\
\hline
\mbox{\texttt{ out}}  & {\em value\+\_\+len} & pointer to length of \begin{DoxyItemize}
\item value \end{DoxyItemize}
\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
length of IE value; negative in case of error 
\end{DoxyReturn}


References \textbf{ data}, and \textbf{ osmo\+\_\+shift\+\_\+tlv()}.



Referenced by \textbf{ osmo\+\_\+gsup\+\_\+decode()}.

\mbox{\label{group__tlv_ga24c0487d8d58e42a732a96db1fc30d81}} 
\index{TLV parser@{TLV parser}!osmo\_match\_shift\_tv\_fixed@{osmo\_match\_shift\_tv\_fixed}}
\index{osmo\_match\_shift\_tv\_fixed@{osmo\_match\_shift\_tv\_fixed}!TLV parser@{TLV parser}}
\doxysubsubsection{osmo\_match\_shift\_tv\_fixed()}
{\footnotesize\ttfamily int osmo\+\_\+match\+\_\+shift\+\_\+tv\+\_\+fixed (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$$\ast$}]{data,  }\item[{size\+\_\+t $\ast$}]{data\+\_\+len,  }\item[{uint8\+\_\+t}]{tag,  }\item[{size\+\_\+t}]{len,  }\item[{uint8\+\_\+t $\ast$$\ast$}]{value }\end{DoxyParamCaption})}



Match tag, check length and assign value pointer. 


\begin{DoxyParams}[1]{Parameters}
 & {\em data} & pointer to the pointer to data \\
\hline
 & {\em data\+\_\+len} & pointer to size\+\_\+t containing \begin{DoxyItemize}
\item data length \end{DoxyItemize}
\\
\hline
\mbox{\texttt{ in}}  & {\em tag} & the tag (IEI) that we expect at \begin{DoxyItemize}
\item data \end{DoxyItemize}
\\
\hline
\mbox{\texttt{ in}}  & {\em len} & the length that we expect the fixed IE to have \\
\hline
\mbox{\texttt{ out}}  & {\em value} & pointer to pointer of value part of IE \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
length of IE value; negative in case of error 
\end{DoxyReturn}


References \textbf{ data}, and \textbf{ len}.

\mbox{\label{group__tlv_ga43d92f84ee184bde0b9a2d12b202ec3a}} 
\index{TLV parser@{TLV parser}!osmo\_shift\_lv@{osmo\_shift\_lv}}
\index{osmo\_shift\_lv@{osmo\_shift\_lv}!TLV parser@{TLV parser}}
\doxysubsubsection{osmo\_shift\_lv()}
{\footnotesize\ttfamily int osmo\+\_\+shift\+\_\+lv (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$$\ast$}]{data,  }\item[{size\+\_\+t $\ast$}]{data\+\_\+len,  }\item[{uint8\+\_\+t $\ast$$\ast$}]{value,  }\item[{size\+\_\+t $\ast$}]{value\+\_\+len }\end{DoxyParamCaption})}



Extract LV and advance data pointer + subtract length. 


\begin{DoxyParams}[1]{Parameters}
 & {\em data} & pointer to the pointer to data \\
\hline
 & {\em data\+\_\+len} & pointer to size\+\_\+t containing \begin{DoxyItemize}
\item data lengt \end{DoxyItemize}
\\
\hline
\mbox{\texttt{ out}}  & {\em value} & extracted pointer to value part of TLV \\
\hline
\mbox{\texttt{ out}}  & {\em value\+\_\+len} & extracted length of \begin{DoxyItemize}
\item value \end{DoxyItemize}
\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
number of bytes subtracted 
\end{DoxyReturn}


References \textbf{ data}, and \textbf{ len}.

\mbox{\label{group__tlv_gaa7e624ed464f13b7ad9f2d4059f890b7}} 
\index{TLV parser@{TLV parser}!osmo\_shift\_tlv@{osmo\_shift\_tlv}}
\index{osmo\_shift\_tlv@{osmo\_shift\_tlv}!TLV parser@{TLV parser}}
\doxysubsubsection{osmo\_shift\_tlv()}
{\footnotesize\ttfamily int osmo\+\_\+shift\+\_\+tlv (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$$\ast$}]{data,  }\item[{size\+\_\+t $\ast$}]{data\+\_\+len,  }\item[{uint8\+\_\+t $\ast$}]{tag,  }\item[{uint8\+\_\+t $\ast$$\ast$}]{value,  }\item[{size\+\_\+t $\ast$}]{value\+\_\+len }\end{DoxyParamCaption})}



Extract TLV and advance data pointer + subtract length. 


\begin{DoxyParams}[1]{Parameters}
 & {\em data} & pointer to the pointer to data \\
\hline
 & {\em data\+\_\+len} & pointer to size\+\_\+t containing \begin{DoxyItemize}
\item data lengt \end{DoxyItemize}
\\
\hline
\mbox{\texttt{ out}}  & {\em tag} & extract the tag (IEI) at start of \begin{DoxyItemize}
\item data \end{DoxyItemize}
\\
\hline
\mbox{\texttt{ out}}  & {\em value} & extracted pointer to value part of TLV \\
\hline
\mbox{\texttt{ out}}  & {\em value\+\_\+len} & extracted length of \begin{DoxyItemize}
\item value \end{DoxyItemize}
\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
number of bytes subtracted 
\end{DoxyReturn}


References \textbf{ data}, and \textbf{ len}.



Referenced by \textbf{ decode\+\_\+auth\+\_\+info()}, \textbf{ decode\+\_\+pdp\+\_\+info()}, \textbf{ osmo\+\_\+gsup\+\_\+decode()}, \textbf{ osmo\+\_\+match\+\_\+shift\+\_\+tlv()}, and \textbf{ osmo\+\_\+oap\+\_\+decode()}.

\mbox{\label{group__tlv_ga024e9efae87c59a89cae1b86ebc8a46e}} 
\index{TLV parser@{TLV parser}!osmo\_shift\_v\_fixed@{osmo\_shift\_v\_fixed}}
\index{osmo\_shift\_v\_fixed@{osmo\_shift\_v\_fixed}!TLV parser@{TLV parser}}
\doxysubsubsection{osmo\_shift\_v\_fixed()}
{\footnotesize\ttfamily int osmo\+\_\+shift\+\_\+v\+\_\+fixed (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$$\ast$}]{data,  }\item[{size\+\_\+t $\ast$}]{data\+\_\+len,  }\item[{size\+\_\+t}]{len,  }\item[{uint8\+\_\+t $\ast$$\ast$}]{value }\end{DoxyParamCaption})}



Advance the data pointer, subtract length and assign value pointer. 


\begin{DoxyParams}[1]{Parameters}
 & {\em data} & pointer to the pointer to data \\
\hline
 & {\em data\+\_\+len} & pointer to size\+\_\+t containing \begin{DoxyItemize}
\item data length \end{DoxyItemize}
\\
\hline
\mbox{\texttt{ in}}  & {\em len} & the length that we expect the fixed IE to hav \\
\hline
\mbox{\texttt{ out}}  & {\em value} & pointer to pointer of value part of IE \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
length of IE value; negative in case of error 
\end{DoxyReturn}


References \textbf{ data}, and \textbf{ len}.



Referenced by \textbf{ osmo\+\_\+gsup\+\_\+decode()}, and \textbf{ osmo\+\_\+oap\+\_\+decode()}.

\mbox{\label{group__tlv_ga4bb69ba3a19cb37c2dfa31355ce16c18}} 
\index{TLV parser@{TLV parser}!osmo\_tlv\_prot\_ie\_name@{osmo\_tlv\_prot\_ie\_name}}
\index{osmo\_tlv\_prot\_ie\_name@{osmo\_tlv\_prot\_ie\_name}!TLV parser@{TLV parser}}
\doxysubsubsection{osmo\_tlv\_prot\_ie\_name()}
{\footnotesize\ttfamily const char $\ast$ osmo\+\_\+tlv\+\_\+prot\+\_\+ie\+\_\+name (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+def} $\ast$}]{pdef,  }\item[{uint8\+\_\+t}]{iei }\end{DoxyParamCaption})}



get the IE name for given IEI in protocol pdef 



References \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+def\+::ie\+\_\+def}, \textbf{ iei}, \textbf{ ienamebuf}, and \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+ie\+\_\+def\+::name}.



Referenced by \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+validate\+\_\+tp()}.

\mbox{\label{group__tlv_gaca464d5f2d7b95412daf9637d757397a}} 
\index{TLV parser@{TLV parser}!osmo\_tlv\_prot\_msg\_name@{osmo\_tlv\_prot\_msg\_name}}
\index{osmo\_tlv\_prot\_msg\_name@{osmo\_tlv\_prot\_msg\_name}!TLV parser@{TLV parser}}
\doxysubsubsection{osmo\_tlv\_prot\_msg\_name()}
{\footnotesize\ttfamily const char $\ast$ osmo\+\_\+tlv\+\_\+prot\+\_\+msg\+\_\+name (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+def} $\ast$}]{pdef,  }\item[{uint8\+\_\+t}]{msg\+\_\+type }\end{DoxyParamCaption})}



get the message name for given msg\+\_\+type in protocol pdef 



References \textbf{ get\+\_\+value\+\_\+string()}, \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+def\+::msg\+\_\+def}, \textbf{ msg\+\_\+type}, \textbf{ msgnamebuf}, \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+def\+::msgt\+\_\+names}, and \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+msg\+\_\+def\+::name}.



Referenced by \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+parse()}, and \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+validate\+\_\+tp()}.

\mbox{\label{group__tlv_gaededb41bb4de811d99d2817c8f8f7734}} 
\index{TLV parser@{TLV parser}!osmo\_tlv\_prot\_msgt\_flags@{osmo\_tlv\_prot\_msgt\_flags}}
\index{osmo\_tlv\_prot\_msgt\_flags@{osmo\_tlv\_prot\_msgt\_flags}!TLV parser@{TLV parser}}
\doxysubsubsection{osmo\_tlv\_prot\_msgt\_flags()}
{\footnotesize\ttfamily static uint32\+\_\+t osmo\+\_\+tlv\+\_\+prot\+\_\+msgt\+\_\+flags (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+def} $\ast$}]{pdef,  }\item[{uint8\+\_\+t}]{msg\+\_\+type }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



References \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+msg\+\_\+def\+::flags}, \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+def\+::msg\+\_\+def}, and \textbf{ msg\+\_\+type}.

\mbox{\label{group__tlv_ga5a88f00e4f2ec8fe5ff7123a47335b75}} 
\index{TLV parser@{TLV parser}!osmo\_tlv\_prot\_parse@{osmo\_tlv\_prot\_parse}}
\index{osmo\_tlv\_prot\_parse@{osmo\_tlv\_prot\_parse}!TLV parser@{TLV parser}}
\doxysubsubsection{osmo\_tlv\_prot\_parse()}
{\footnotesize\ttfamily int osmo\+\_\+tlv\+\_\+prot\+\_\+parse (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+def} $\ast$}]{pdef,  }\item[{struct \textbf{ tlv\+\_\+parsed} $\ast$}]{dec,  }\item[{unsigned int}]{dec\+\_\+multiples,  }\item[{uint8\+\_\+t}]{msg\+\_\+type,  }\item[{const uint8\+\_\+t $\ast$}]{buf,  }\item[{unsigned int}]{buf\+\_\+len,  }\item[{uint8\+\_\+t}]{lv\+\_\+tag,  }\item[{uint8\+\_\+t}]{lv\+\_\+tag2,  }\item[{int}]{log\+\_\+subsys,  }\item[{const char $\ast$}]{log\+\_\+pfx }\end{DoxyParamCaption})}



Parse + Validate a TLV-\/encoded message against the protocol definition. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em pdef} & protocol definition of given protocol \\
\hline
\mbox{\texttt{ out}}  & {\em dec} & caller-\/allocated pointer to \doxyref{tlv\+\_\+parsed}{p.}{structtlv__parsed} \\
\hline
\mbox{\texttt{ in}}  & {\em dec\+\_\+multiples} & length of the \doxyref{tlv\+\_\+parsed}{p.}{structtlv__parsed}[] in {\itshape dec}. \\
\hline
\mbox{\texttt{ in}}  & {\em msg\+\_\+type} & message type of the parsed message \\
\hline
\mbox{\texttt{ in}}  & {\em buf} & the input data buffer to be parsed \\
\hline
\mbox{\texttt{ in}}  & {\em buf\+\_\+len} & length of the input data buffer \\
\hline
\mbox{\texttt{ in}}  & {\em lv\+\_\+tag} & an initial LV tag at the start of the buffer \\
\hline
\mbox{\texttt{ in}}  & {\em lv\+\_\+tag2} & a second initial LV tag following the {\itshape lv\+\_\+tag} \\
\hline
\mbox{\texttt{ in}}  & {\em log\+\_\+subsys} & logging sub-\/system for log messages \\
\hline
\mbox{\texttt{ in}}  & {\em log\+\_\+pfx} & prefix for log messages \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 in case of success; negative osmo\+\_\+tlv\+\_\+parser\+\_\+error in case of error 
\end{DoxyReturn}


References \textbf{ LOGL\+\_\+\+ERROR}, \textbf{ LOGP}, \textbf{ msg\+\_\+type}, \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+def\+::name}, \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+msg\+\_\+name()}, \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+validate\+\_\+tp()}, \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+def\+::tlv\+\_\+def}, and \textbf{ tlv\+\_\+parse2()}.

\mbox{\label{group__tlv_gab764e82e640b95485b010c13bf619b60}} 
\index{TLV parser@{TLV parser}!osmo\_tlv\_prot\_validate\_tp@{osmo\_tlv\_prot\_validate\_tp}}
\index{osmo\_tlv\_prot\_validate\_tp@{osmo\_tlv\_prot\_validate\_tp}!TLV parser@{TLV parser}}
\doxysubsubsection{osmo\_tlv\_prot\_validate\_tp()}
{\footnotesize\ttfamily int osmo\+\_\+tlv\+\_\+prot\+\_\+validate\+\_\+tp (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+def} $\ast$}]{pdef,  }\item[{uint8\+\_\+t}]{msg\+\_\+type,  }\item[{const struct \textbf{ tlv\+\_\+parsed} $\ast$}]{tp,  }\item[{int}]{log\+\_\+subsys,  }\item[{const char $\ast$}]{log\+\_\+pfx }\end{DoxyParamCaption})}



Validate an already TLV-\/decoded message against the protocol definition. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em pdef} & protocol definition of given protocol \\
\hline
\mbox{\texttt{ in}}  & {\em msg\+\_\+type} & message type of the parsed message \\
\hline
\mbox{\texttt{ in}}  & {\em tp} & TLV parser result \\
\hline
\mbox{\texttt{ in}}  & {\em log\+\_\+subsys} & logging sub-\/system for log messages \\
\hline
\mbox{\texttt{ in}}  & {\em log\+\_\+pfx} & prefix for log messages \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 in case of success; negative osmo\+\_\+tlv\+\_\+parser\+\_\+error in case of error 
\end{DoxyReturn}


References \textbf{ ARRAY\+\_\+\+SIZE}, \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+def\+::ie\+\_\+def}, \textbf{ iei}, \textbf{ LOGL\+\_\+\+ERROR}, \textbf{ LOGP}, \textbf{ tlv\+\_\+parsed\+::lv}, \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+msg\+\_\+def\+::mand\+\_\+count}, \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+msg\+\_\+def\+::mand\+\_\+ies}, \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+ie\+\_\+def\+::min\+\_\+len}, \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+def\+::msg\+\_\+def}, \textbf{ msg\+\_\+type}, \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+def\+::name}, \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+ie\+\_\+name()}, \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+msg\+\_\+name()}, \textbf{ OSMO\+\_\+\+TLVP\+\_\+\+ERR\+\_\+\+IE\+\_\+\+TOO\+\_\+\+SHORT}, \textbf{ OSMO\+\_\+\+TLVP\+\_\+\+ERR\+\_\+\+MAND\+\_\+\+IE\+\_\+\+MISSING}, \textbf{ TLVP\+\_\+\+LEN}, and \textbf{ TLVP\+\_\+\+PRESENT}.



Referenced by \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+parse()}.

\mbox{\label{group__tlv_gae1dd71750fc28e2d236c4b44cf31d1bd}} 
\index{TLV parser@{TLV parser}!osmo\_tlvp\_copy@{osmo\_tlvp\_copy}}
\index{osmo\_tlvp\_copy@{osmo\_tlvp\_copy}!TLV parser@{TLV parser}}
\doxysubsubsection{osmo\_tlvp\_copy()}
{\footnotesize\ttfamily struct \textbf{ tlv\+\_\+parsed} $\ast$ osmo\+\_\+tlvp\+\_\+copy (\begin{DoxyParamCaption}\item[{const struct \textbf{ tlv\+\_\+parsed} $\ast$}]{tp\+\_\+orig,  }\item[{void $\ast$}]{ctx }\end{DoxyParamCaption})}



Copy \doxyref{tlv\+\_\+parsed}{p.}{structtlv__parsed} using given talloc context. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em tp\+\_\+orig} & Parsed TLV structure \\
\hline
\mbox{\texttt{ in}}  & {\em ctx} & Talloc context for allocations \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
NULL on errors, \doxyref{tlv\+\_\+parsed}{p.}{structtlv__parsed} pointer otherwise 
\end{DoxyReturn}


References \textbf{ ARRAY\+\_\+\+SIZE}, \textbf{ len}, \textbf{ tlv\+\_\+p\+\_\+entry\+::len}, \textbf{ tlv\+\_\+parsed\+::lv}, and \textbf{ tlv\+\_\+p\+\_\+entry\+::val}.

\mbox{\label{group__tlv_ga962dc1242cbc6d5850f9ee2e3d5638bf}} 
\index{TLV parser@{TLV parser}!osmo\_tlvp\_merge@{osmo\_tlvp\_merge}}
\index{osmo\_tlvp\_merge@{osmo\_tlvp\_merge}!TLV parser@{TLV parser}}
\doxysubsubsection{osmo\_tlvp\_merge()}
{\footnotesize\ttfamily int osmo\+\_\+tlvp\+\_\+merge (\begin{DoxyParamCaption}\item[{struct \textbf{ tlv\+\_\+parsed} $\ast$}]{dst,  }\item[{const struct \textbf{ tlv\+\_\+parsed} $\ast$}]{src }\end{DoxyParamCaption})}



Merge all \doxyref{tlv\+\_\+parsed}{p.}{structtlv__parsed} attributes of \textquotesingle{}src\textquotesingle{} into \textquotesingle{}dst\textquotesingle{}. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em dst} & Parsed TLV structure to merge into \\
\hline
\mbox{\texttt{ in}}  & {\em src} & Parsed TLV structure to merge from \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, negative on error 
\end{DoxyReturn}


References \textbf{ ARRAY\+\_\+\+SIZE}, \textbf{ len}, \textbf{ tlv\+\_\+p\+\_\+entry\+::len}, \textbf{ tlv\+\_\+parsed\+::lv}, and \textbf{ tlv\+\_\+p\+\_\+entry\+::val}.

\mbox{\label{group__tlv_ga655f3d0cb0d47fcf41d8c80d028d5405}} 
\index{TLV parser@{TLV parser}!t16lv\_put@{t16lv\_put}}
\index{t16lv\_put@{t16lv\_put}!TLV parser@{TLV parser}}
\doxysubsubsection{t16lv\_put()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ t16lv\+\_\+put (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$}]{buf,  }\item[{uint16\+\_\+t}]{tag,  }\item[{uint8\+\_\+t}]{len,  }\item[{const uint8\+\_\+t $\ast$}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



put (append) a TL16V field 



References \textbf{ len}.



Referenced by \textbf{ msgb\+\_\+t16lv\+\_\+put()}.

\mbox{\label{group__tlv_gaaa8c19718f1caf7d4cbd9b31bbb6e9b8}} 
\index{TLV parser@{TLV parser}!tl16\_put@{tl16\_put}}
\index{tl16\_put@{tl16\_put}!TLV parser@{TLV parser}}
\doxysubsubsection{tl16\_put()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ tl16\+\_\+put (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$}]{buf,  }\item[{uint8\+\_\+t}]{tag,  }\item[{uint16\+\_\+t}]{len }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



put (append) a TL16 field. 



References \textbf{ len}.



Referenced by \textbf{ tvl\+\_\+put()}.

\mbox{\label{group__tlv_ga8478296905b4cd8e4b400e646c4a21c2}} 
\index{TLV parser@{TLV parser}!tl16v\_put@{tl16v\_put}}
\index{tl16v\_put@{tl16v\_put}!TLV parser@{TLV parser}}
\doxysubsubsection{tl16v\_put()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ tl16v\+\_\+put (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$}]{buf,  }\item[{uint8\+\_\+t}]{tag,  }\item[{uint16\+\_\+t}]{len,  }\item[{const uint8\+\_\+t $\ast$}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



put (append) a TL16V field 



References \textbf{ len}.



Referenced by \textbf{ msgb\+\_\+tl16v\+\_\+put()}, and \textbf{ tvlv\+\_\+put()}.

\mbox{\label{group__tlv_ga8eddada175a965fc11913bc11852d4b4}} 
\index{TLV parser@{TLV parser}!tl\_put@{tl\_put}}
\index{tl\_put@{tl\_put}!TLV parser@{TLV parser}}
\doxysubsubsection{tl\_put()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ tl\+\_\+put (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$}]{buf,  }\item[{uint8\+\_\+t}]{tag,  }\item[{uint8\+\_\+t}]{len }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



put (append) a TL field (a TLV field but omitting the value part). 



References \textbf{ len}.



Referenced by \textbf{ tvl\+\_\+put()}.

\mbox{\label{group__tlv_ga15bd8918d50b81255c4a68d3fa5775b3}} 
\index{TLV parser@{TLV parser}!tlv16\_put@{tlv16\_put}}
\index{tlv16\_put@{tlv16\_put}!TLV parser@{TLV parser}}
\doxysubsubsection{tlv16\_put()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ tlv16\+\_\+put (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$}]{buf,  }\item[{uint8\+\_\+t}]{tag,  }\item[{uint8\+\_\+t}]{len,  }\item[{const uint16\+\_\+t $\ast$}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



put (append) a TLV16 field 



References \textbf{ len}.



Referenced by \textbf{ msgb\+\_\+tlv16\+\_\+put()}.

\mbox{\label{group__tlv_ga67ac98db71684543356f05883207b8e4}} 
\index{TLV parser@{TLV parser}!tlv\_def\_patch@{tlv\_def\_patch}}
\index{tlv\_def\_patch@{tlv\_def\_patch}!TLV parser@{TLV parser}}
\doxysubsubsection{tlv\_def\_patch()}
{\footnotesize\ttfamily void tlv\+\_\+def\+\_\+patch (\begin{DoxyParamCaption}\item[{struct \textbf{ tlv\+\_\+definition} $\ast$}]{dst,  }\item[{const struct \textbf{ tlv\+\_\+definition} $\ast$}]{src }\end{DoxyParamCaption})}



take a master (src) \doxyref{tlv\+\_\+definition}{p.}{structtlv__definition} and fill up all empty slots in \textquotesingle{}dst\textquotesingle{} 


\begin{DoxyParams}[1]{Parameters}
 & {\em dst} & TLV parser definition that is to be patched \\
\hline
\mbox{\texttt{ in}}  & {\em src} & TLV parser definition whose content is patched into {\itshape dst} \\
\hline
\end{DoxyParams}


References \textbf{ ARRAY\+\_\+\+SIZE}, \textbf{ tlv\+\_\+definition\+::def}, \textbf{ TLV\+\_\+\+TYPE\+\_\+\+NONE}, and \textbf{ tlv\+\_\+def\+::type}.

\mbox{\label{group__tlv_gaa4fa7bf663cb703be82e5ffe35f741f7}} 
\index{TLV parser@{TLV parser}!tlv\_dump@{tlv\_dump}}
\index{tlv\_dump@{tlv\_dump}!TLV parser@{TLV parser}}
\doxysubsubsection{tlv\_dump()}
{\footnotesize\ttfamily int tlv\+\_\+dump (\begin{DoxyParamCaption}\item[{struct \textbf{ tlv\+\_\+parsed} $\ast$}]{dec }\end{DoxyParamCaption})}



Dump parsed TLV structure to stdout. 



References \textbf{ tlv\+\_\+p\+\_\+entry\+::len}, \textbf{ tlv\+\_\+parsed\+::lv}, and \textbf{ tlv\+\_\+p\+\_\+entry\+::val}.

\mbox{\label{group__tlv_ga33856498e87a107d862c17d292c30560}} 
\index{TLV parser@{TLV parser}!tlv\_encode@{tlv\_encode}}
\index{tlv\_encode@{tlv\_encode}!TLV parser@{TLV parser}}
\doxysubsubsection{tlv\_encode()}
{\footnotesize\ttfamily int tlv\+\_\+encode (\begin{DoxyParamCaption}\item[{struct \textbf{ msgb} $\ast$}]{msg,  }\item[{const struct \textbf{ tlv\+\_\+definition} $\ast$}]{def,  }\item[{const struct \textbf{ tlv\+\_\+parsed} $\ast$}]{tp }\end{DoxyParamCaption})}



Encode a set of decoded TLVs according to a given definition into a message buffer. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em msg} & Caller-\/allocated message buffer with sufficient tailroom \\
\hline
\mbox{\texttt{ in}}  & {\em def} & structure defining the valid TLV tags / configurations \\
\hline
\mbox{\texttt{ in}}  & {\em tp} & decoded values to be encoded \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
number of bytes consumed in msg; negative in case of error 
\end{DoxyReturn}


References \textbf{ ARRAY\+\_\+\+SIZE}, \textbf{ tlv\+\_\+definition\+::def}, \textbf{ tlv\+\_\+parsed\+::lv}, \textbf{ msg}, \textbf{ msgb\+\_\+tailroom()}, \textbf{ tlv\+\_\+encode\+\_\+one()}, \textbf{ TLVP\+\_\+\+LEN}, \textbf{ TLVP\+\_\+\+PRESENT}, \textbf{ TLVP\+\_\+\+VAL}, and \textbf{ tlv\+\_\+def\+::type}.

\mbox{\label{group__tlv_gae901e6ba5e84290c91625f854302020d}} 
\index{TLV parser@{TLV parser}!tlv\_encode\_one@{tlv\_encode\_one}}
\index{tlv\_encode\_one@{tlv\_encode\_one}!TLV parser@{TLV parser}}
\doxysubsubsection{tlv\_encode\_one()}
{\footnotesize\ttfamily int tlv\+\_\+encode\+\_\+one (\begin{DoxyParamCaption}\item[{struct \textbf{ msgb} $\ast$}]{msg,  }\item[{enum \textbf{ tlv\+\_\+type}}]{type,  }\item[{uint8\+\_\+t}]{tag,  }\item[{unsigned int}]{len,  }\item[{const uint8\+\_\+t $\ast$}]{val }\end{DoxyParamCaption})}



Encode a single TLV into given message buffer. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em msg} & Caller-\/allocated message buffer with sufficient tailroom \\
\hline
\mbox{\texttt{ in}}  & {\em type} & TLV type/format to use during encode \\
\hline
\mbox{\texttt{ in}}  & {\em tag} & Tag of TLV to be encoded \\
\hline
\mbox{\texttt{ in}}  & {\em len} & Length of TLV to be encoded \\
\hline
\mbox{\texttt{ in}}  & {\em val} & Value part of TLV to be encoded \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success; negative in case of error 
\end{DoxyReturn}


References \textbf{ len}, \textbf{ msg}, \textbf{ msgb\+\_\+tl16v\+\_\+put()}, \textbf{ msgb\+\_\+tlv\+\_\+put()}, \textbf{ msgb\+\_\+tv\+\_\+fixed\+\_\+put()}, \textbf{ msgb\+\_\+tv\+\_\+put()}, \textbf{ msgb\+\_\+tvlv\+\_\+put()}, \textbf{ msgb\+\_\+v\+\_\+put()}, \textbf{ msgb\+\_\+vtvlv\+\_\+gan\+\_\+put()}, \textbf{ TLV\+\_\+\+TYPE\+\_\+\+FIXED}, \textbf{ TLV\+\_\+\+TYPE\+\_\+\+NONE}, \textbf{ TLV\+\_\+\+TYPE\+\_\+\+SINGLE\+\_\+\+TV}, \textbf{ TLV\+\_\+\+TYPE\+\_\+T}, \textbf{ TLV\+\_\+\+TYPE\+\_\+\+TL16V}, \textbf{ TLV\+\_\+\+TYPE\+\_\+\+TLV}, \textbf{ TLV\+\_\+\+TYPE\+\_\+\+TV}, \textbf{ TLV\+\_\+\+TYPE\+\_\+\+Tv\+LV}, \textbf{ TLV\+\_\+\+TYPE\+\_\+v\+Tv\+LV\+\_\+\+GAN}, and \textbf{ type}.



Referenced by \textbf{ tlv\+\_\+encode()}, and \textbf{ tlv\+\_\+encode\+\_\+ordered()}.

\mbox{\label{group__tlv_ga1e8928009f824515308339f867563d76}} 
\index{TLV parser@{TLV parser}!tlv\_encode\_ordered@{tlv\_encode\_ordered}}
\index{tlv\_encode\_ordered@{tlv\_encode\_ordered}!TLV parser@{TLV parser}}
\doxysubsubsection{tlv\_encode\_ordered()}
{\footnotesize\ttfamily int tlv\+\_\+encode\+\_\+ordered (\begin{DoxyParamCaption}\item[{struct \textbf{ msgb} $\ast$}]{msg,  }\item[{const struct \textbf{ tlv\+\_\+definition} $\ast$}]{def,  }\item[{const struct \textbf{ tlv\+\_\+parsed} $\ast$}]{tp,  }\item[{const uint8\+\_\+t $\ast$}]{tag\+\_\+order,  }\item[{unsigned int}]{tag\+\_\+order\+\_\+len }\end{DoxyParamCaption})}



Encode a set of decoded TLVs according to a given definition and IE order into a message buffer. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em msg} & Caller-\/allocated message buffer with sufficient tailroom \\
\hline
\mbox{\texttt{ in}}  & {\em def} & structure defining the valid TLV tags / configurations \\
\hline
\mbox{\texttt{ in}}  & {\em tp} & decoded values to be encoded \\
\hline
\mbox{\texttt{ in}}  & {\em tag\+\_\+order} & array of tags determining the IE encoding order \\
\hline
\mbox{\texttt{ in}}  & {\em tag\+\_\+order\+\_\+len} & length of tag\+\_\+order \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
number of bytes consumed in msg; negative in case of error 
\end{DoxyReturn}


References \textbf{ tlv\+\_\+definition\+::def}, \textbf{ msg}, \textbf{ msgb\+\_\+tailroom()}, \textbf{ tlv\+\_\+encode\+\_\+one()}, \textbf{ TLVP\+\_\+\+LEN}, \textbf{ TLVP\+\_\+\+PRESENT}, \textbf{ TLVP\+\_\+\+VAL}, and \textbf{ tlv\+\_\+def\+::type}.

\mbox{\label{group__tlv_gaa52227475e0050c2f0c78cb612e01d65}} 
\index{TLV parser@{TLV parser}!tlv\_parse@{tlv\_parse}}
\index{tlv\_parse@{tlv\_parse}!TLV parser@{TLV parser}}
\doxysubsubsection{tlv\_parse()}
{\footnotesize\ttfamily int tlv\+\_\+parse (\begin{DoxyParamCaption}\item[{struct \textbf{ tlv\+\_\+parsed} $\ast$}]{dec,  }\item[{const struct \textbf{ tlv\+\_\+definition} $\ast$}]{def,  }\item[{const uint8\+\_\+t $\ast$}]{buf,  }\item[{int}]{buf\+\_\+len,  }\item[{uint8\+\_\+t}]{lv\+\_\+tag,  }\item[{uint8\+\_\+t}]{lv\+\_\+tag2 }\end{DoxyParamCaption})}



Parse an entire buffer of TLV encoded Information Elements. 

In case of multiple occurences of an IE, keep only the first occurence. Most GSM related protocols clearly indicate that in case of duplicate IEs, only the first occurrence shall be used, while any further occurrences shall be ignored. See e.\+g. 3GPP TS 24.\+008 Section 8.\+6.\+3. For multiple occurences, use \doxyref{tlv\+\_\+parse2()}{p.}{group__tlv_ga4859a889693eec53ecb79f361e1884a7}. 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ out}}  & {\em dec} & caller-\/allocated pointer to \doxyref{tlv\+\_\+parsed}{p.}{structtlv__parsed} \\
\hline
\mbox{\texttt{ in}}  & {\em def} & structure defining the valid TLV tags / configurations \\
\hline
\mbox{\texttt{ in}}  & {\em buf} & the input data buffer to be parsed \\
\hline
\mbox{\texttt{ in}}  & {\em buf\+\_\+len} & length of the input data buffer \\
\hline
\mbox{\texttt{ in}}  & {\em lv\+\_\+tag} & an initial LV tag at the start of the buffer \\
\hline
\mbox{\texttt{ in}}  & {\em lv\+\_\+tag2} & a second initial LV tag following the {\itshape lv\+\_\+tag} \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
number of TLV entries parsed; negative in case of error 
\end{DoxyReturn}


References \textbf{ tlv\+\_\+parse2()}.



Referenced by \textbf{ abis\+\_\+nm\+\_\+get\+\_\+sw\+\_\+desc()}, and \textbf{ osmo\+\_\+bssmap\+\_\+le\+\_\+dec()}.

\mbox{\label{group__tlv_ga4859a889693eec53ecb79f361e1884a7}} 
\index{TLV parser@{TLV parser}!tlv\_parse2@{tlv\_parse2}}
\index{tlv\_parse2@{tlv\_parse2}!TLV parser@{TLV parser}}
\doxysubsubsection{tlv\_parse2()}
{\footnotesize\ttfamily int tlv\+\_\+parse2 (\begin{DoxyParamCaption}\item[{struct \textbf{ tlv\+\_\+parsed} $\ast$}]{dec,  }\item[{int}]{dec\+\_\+multiples,  }\item[{const struct \textbf{ tlv\+\_\+definition} $\ast$}]{def,  }\item[{const uint8\+\_\+t $\ast$}]{buf,  }\item[{int}]{buf\+\_\+len,  }\item[{uint8\+\_\+t}]{lv\+\_\+tag,  }\item[{uint8\+\_\+t}]{lv\+\_\+tag2 }\end{DoxyParamCaption})}



Like \doxyref{tlv\+\_\+parse()}{p.}{group__tlv_gaa52227475e0050c2f0c78cb612e01d65}, but capable of decoding multiple occurences of the same IE. 

Parse an entire buffer of TLV encoded Information Elements. To decode multiple occurences of IEs, provide in dec an {\itshape array} of \doxyref{tlv\+\_\+parsed}{p.}{structtlv__parsed}, and pass the size of that array in dec\+\_\+multiples. The first occurence of each IE is stored in dec[0], the second in dec[1] and so forth. If there are more occurences than the array length given in dec\+\_\+multiples, the remaining occurences are dropped. 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ out}}  & {\em dec} & caller-\/allocated pointer to \doxyref{tlv\+\_\+parsed}{p.}{structtlv__parsed} \\
\hline
\mbox{\texttt{ in}}  & {\em dec\+\_\+multiples} & length of the \doxyref{tlv\+\_\+parsed}{p.}{structtlv__parsed}[] in {\itshape dec}. \\
\hline
\mbox{\texttt{ in}}  & {\em def} & structure defining the valid TLV tags / configurations \\
\hline
\mbox{\texttt{ in}}  & {\em buf} & the input data buffer to be parsed \\
\hline
\mbox{\texttt{ in}}  & {\em buf\+\_\+len} & length of the input data buffer \\
\hline
\mbox{\texttt{ in}}  & {\em lv\+\_\+tag} & an initial LV tag at the start of the buffer \\
\hline
\mbox{\texttt{ in}}  & {\em lv\+\_\+tag2} & a second initial LV tag following the {\itshape lv\+\_\+tag} \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
number of TLV entries parsed; negative in case of error 
\end{DoxyReturn}


References \textbf{ len}, \textbf{ tlv\+\_\+p\+\_\+entry\+::len}, \textbf{ tlv\+\_\+parsed\+::lv}, \textbf{ OSMO\+\_\+\+TLVP\+\_\+\+ERR\+\_\+\+OFS\+\_\+\+BEYOND\+\_\+\+BUFFER}, \textbf{ OSMO\+\_\+\+TLVP\+\_\+\+ERR\+\_\+\+OFS\+\_\+\+LEN\+\_\+\+BEYOND\+\_\+\+BUFFER}, \textbf{ tlv\+\_\+parse\+\_\+one()}, and \textbf{ tlv\+\_\+p\+\_\+entry\+::val}.



Referenced by \textbf{ osmo\+\_\+bsslap\+\_\+dec()}, \textbf{ osmo\+\_\+cbsp\+\_\+decode()}, \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+parse()}, and \textbf{ tlv\+\_\+parse()}.

\mbox{\label{group__tlv_ga1e435a3b2fc612198cebd788ff25af14}} 
\index{TLV parser@{TLV parser}!tlv\_parse\_one@{tlv\_parse\_one}}
\index{tlv\_parse\_one@{tlv\_parse\_one}!TLV parser@{TLV parser}}
\doxysubsubsection{tlv\_parse\_one()}
{\footnotesize\ttfamily int tlv\+\_\+parse\+\_\+one (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$}]{o\+\_\+tag,  }\item[{uint16\+\_\+t $\ast$}]{o\+\_\+len,  }\item[{const uint8\+\_\+t $\ast$$\ast$}]{o\+\_\+val,  }\item[{const struct \textbf{ tlv\+\_\+definition} $\ast$}]{def,  }\item[{const uint8\+\_\+t $\ast$}]{buf,  }\item[{int}]{buf\+\_\+len }\end{DoxyParamCaption})}



Parse a single TLV encoded IE. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ out}}  & {\em o\+\_\+tag} & the tag of the IE that was found \\
\hline
\mbox{\texttt{ out}}  & {\em o\+\_\+len} & length of the IE that was found \\
\hline
\mbox{\texttt{ out}}  & {\em o\+\_\+val} & pointer to the data of the IE that was found \\
\hline
\mbox{\texttt{ in}}  & {\em def} & structure defining the valid TLV tags / configurations \\
\hline
\mbox{\texttt{ in}}  & {\em buf} & the input data buffer to be parsed \\
\hline
\mbox{\texttt{ in}}  & {\em buf\+\_\+len} & length of the input data buffer \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
number of bytes consumed by the TLV entry / IE parsed; negative in case of error.
\end{DoxyReturn}
In IEs of type TLV\+\_\+\+TYPE\+\_\+\+SINGLE\+\_\+\+TV, the data pointer o\+\_\+val will point to the byte shared by both the Tag and te Value, hence the tag is to be trimmed by the caller. 

References \textbf{ tlv\+\_\+definition\+::def}, \textbf{ tlv\+\_\+def\+::fixed\+\_\+len}, \textbf{ len}, \textbf{ OSMO\+\_\+\+TLVP\+\_\+\+ERR\+\_\+\+OFS\+\_\+\+BEYOND\+\_\+\+BUFFER}, \textbf{ OSMO\+\_\+\+TLVP\+\_\+\+ERR\+\_\+\+OFS\+\_\+\+LEN\+\_\+\+BEYOND\+\_\+\+BUFFER}, \textbf{ OSMO\+\_\+\+TLVP\+\_\+\+ERR\+\_\+\+UNKNOWN\+\_\+\+TLV\+\_\+\+TYPE}, \textbf{ TLV\+\_\+\+TYPE\+\_\+\+FIXED}, \textbf{ TLV\+\_\+\+TYPE\+\_\+\+SINGLE\+\_\+\+TV}, \textbf{ TLV\+\_\+\+TYPE\+\_\+T}, \textbf{ TLV\+\_\+\+TYPE\+\_\+\+TL16V}, \textbf{ TLV\+\_\+\+TYPE\+\_\+\+TLV}, \textbf{ TLV\+\_\+\+TYPE\+\_\+\+TV}, \textbf{ TLV\+\_\+\+TYPE\+\_\+\+Tv\+LV}, \textbf{ TLV\+\_\+\+TYPE\+\_\+v\+Tv\+LV\+\_\+\+GAN}, and \textbf{ tlv\+\_\+def\+::type}.



Referenced by \textbf{ tlv\+\_\+parse2()}.

\mbox{\label{group__tlv_ga7cab4840156919b480ff414df80c9676}} 
\index{TLV parser@{TLV parser}!tlv\_put@{tlv\_put}}
\index{tlv\_put@{tlv\_put}!TLV parser@{TLV parser}}
\doxysubsubsection{tlv\_put()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ tlv\+\_\+put (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$}]{buf,  }\item[{uint8\+\_\+t}]{tag,  }\item[{uint8\+\_\+t}]{len,  }\item[{const uint8\+\_\+t $\ast$}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Append a TLV field, a Tag-\/\+Length-\/\+Value field. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ out}}  & {\em buf} & Location in a buffer to append TLV at. \\
\hline
\mbox{\texttt{ in}}  & {\em tag} & Tag id to write. \\
\hline
\mbox{\texttt{ in}}  & {\em len} & Length field to write and amount of bytes to append. \\
\hline
\mbox{\texttt{ in}}  & {\em val} & Pointer to data to append, or NULL to append zero data. Always append tag and length. Append {\itshape len} bytes read from {\itshape val}. If val is NULL, append {\itshape len} zero bytes instead. If {\itshape len} is zero, do not append any data apart from tag and length. \\
\hline
\end{DoxyParams}


References \textbf{ len}.



Referenced by \textbf{ msgb\+\_\+tlv\+\_\+push()}, \textbf{ msgb\+\_\+tlv\+\_\+put()}, and \textbf{ tvlv\+\_\+put()}.

\mbox{\label{group__tlv_ga38a5fb00d63d2a2fc010ea84f9fd8d14}} 
\index{TLV parser@{TLV parser}!tlvp\_val16\_unal@{tlvp\_val16\_unal}}
\index{tlvp\_val16\_unal@{tlvp\_val16\_unal}!TLV parser@{TLV parser}}
\doxysubsubsection{tlvp\_val16\_unal()}
{\footnotesize\ttfamily static uint16\+\_\+t tlvp\+\_\+val16\+\_\+unal (\begin{DoxyParamCaption}\item[{const struct \textbf{ tlv\+\_\+parsed} $\ast$}]{tp,  }\item[{int}]{pos }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Align given TLV element with 16 bit value to an even address. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em tp} & pointer to \doxyref{tlv\+\_\+parsed}{p.}{structtlv__parsed} \\
\hline
\mbox{\texttt{ in}}  & {\em pos} & element to return \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
aligned 16 bit value 
\end{DoxyReturn}


References \textbf{ res}, and \textbf{ TLVP\+\_\+\+VAL}.

\mbox{\label{group__tlv_ga0def6d7d59d8ce4488da1fc85cf0882c}} 
\index{TLV parser@{TLV parser}!tlvp\_val16be@{tlvp\_val16be}}
\index{tlvp\_val16be@{tlvp\_val16be}!TLV parser@{TLV parser}}
\doxysubsubsection{tlvp\_val16be()}
{\footnotesize\ttfamily static uint16\+\_\+t tlvp\+\_\+val16be (\begin{DoxyParamCaption}\item[{const struct \textbf{ tlv\+\_\+parsed} $\ast$}]{tp,  }\item[{int}]{pos }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Retrieve (possibly unaligned) TLV element and convert to host byte order. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em tp} & pointer to \doxyref{tlv\+\_\+parsed}{p.}{structtlv__parsed} \\
\hline
\mbox{\texttt{ in}}  & {\em pos} & element to return \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
aligned 16 bit value in host byte order 
\end{DoxyReturn}


References \textbf{ TLVP\+\_\+\+VAL}.



Referenced by \textbf{ cbsp\+\_\+dec\+\_\+error\+\_\+ind()}, \textbf{ cbsp\+\_\+dec\+\_\+kill()}, \textbf{ cbsp\+\_\+dec\+\_\+kill\+\_\+compl()}, \textbf{ cbsp\+\_\+dec\+\_\+kill\+\_\+fail()}, \textbf{ cbsp\+\_\+dec\+\_\+msg\+\_\+status\+\_\+query()}, \textbf{ cbsp\+\_\+dec\+\_\+msg\+\_\+status\+\_\+query\+\_\+compl()}, \textbf{ cbsp\+\_\+dec\+\_\+msg\+\_\+status\+\_\+query\+\_\+fail()}, \textbf{ cbsp\+\_\+dec\+\_\+write\+\_\+repl()}, \textbf{ cbsp\+\_\+dec\+\_\+write\+\_\+repl\+\_\+compl()}, and \textbf{ cbsp\+\_\+dec\+\_\+write\+\_\+repl\+\_\+fail()}.

\mbox{\label{group__tlv_ga3901464d2c041f21b5255257190a8770}} 
\index{TLV parser@{TLV parser}!tlvp\_val32\_unal@{tlvp\_val32\_unal}}
\index{tlvp\_val32\_unal@{tlvp\_val32\_unal}!TLV parser@{TLV parser}}
\doxysubsubsection{tlvp\_val32\_unal()}
{\footnotesize\ttfamily static uint32\+\_\+t tlvp\+\_\+val32\+\_\+unal (\begin{DoxyParamCaption}\item[{const struct \textbf{ tlv\+\_\+parsed} $\ast$}]{tp,  }\item[{int}]{pos }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Align given TLV element with 32 bit value to an address that is a multiple of 4. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em tp} & pointer to \doxyref{tlv\+\_\+parsed}{p.}{structtlv__parsed} \\
\hline
\mbox{\texttt{ in}}  & {\em pos} & element to return \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
aligned 32 bit value 
\end{DoxyReturn}


References \textbf{ res}, and \textbf{ TLVP\+\_\+\+VAL}.

\mbox{\label{group__tlv_ga4b9d6c9e7baf8805fa6411f370d2d685}} 
\index{TLV parser@{TLV parser}!tlvp\_val32be@{tlvp\_val32be}}
\index{tlvp\_val32be@{tlvp\_val32be}!TLV parser@{TLV parser}}
\doxysubsubsection{tlvp\_val32be()}
{\footnotesize\ttfamily static uint32\+\_\+t tlvp\+\_\+val32be (\begin{DoxyParamCaption}\item[{const struct \textbf{ tlv\+\_\+parsed} $\ast$}]{tp,  }\item[{int}]{pos }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Retrieve (possibly unaligned) TLV element and convert to host byte order. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em tp} & pointer to \doxyref{tlv\+\_\+parsed}{p.}{structtlv__parsed} \\
\hline
\mbox{\texttt{ in}}  & {\em pos} & element to return \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
aligned 32 bit value in host byte order 
\end{DoxyReturn}


References \textbf{ TLVP\+\_\+\+VAL}.

\mbox{\label{group__tlv_ga4ae4b57cdeacfe7dd832ebf235ff212c}} 
\index{TLV parser@{TLV parser}!tlvp\_val8@{tlvp\_val8}}
\index{tlvp\_val8@{tlvp\_val8}!TLV parser@{TLV parser}}
\doxysubsubsection{tlvp\_val8()}
{\footnotesize\ttfamily static uint8\+\_\+t tlvp\+\_\+val8 (\begin{DoxyParamCaption}\item[{const struct \textbf{ tlv\+\_\+parsed} $\ast$}]{tp,  }\item[{uint8\+\_\+t}]{tag,  }\item[{uint8\+\_\+t}]{default\+\_\+val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Obtain 1-\/byte TLV element. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em tp} & pointer to \doxyref{tlv\+\_\+parsed}{p.}{structtlv__parsed} \\
\hline
\mbox{\texttt{ in}}  & {\em tag} & the Tag to look for \\
\hline
\mbox{\texttt{ in}}  & {\em default\+\_\+val} & default value to use if tag not available \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the 1st byte of value with a given tag or default\+\_\+val if tag was not found 
\end{DoxyReturn}


References \textbf{ res}, and \textbf{ TLVP\+\_\+\+VAL\+\_\+\+MINLEN}.



Referenced by \textbf{ gsm0808\+\_\+dec\+\_\+lcls()}.

\mbox{\label{group__tlv_gace685dc8714272d80dd31840089e7eba}} 
\index{TLV parser@{TLV parser}!tv16\_put@{tv16\_put}}
\index{tv16\_put@{tv16\_put}!TLV parser@{TLV parser}}
\doxysubsubsection{tv16\_put()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ tv16\+\_\+put (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$}]{buf,  }\item[{uint8\+\_\+t}]{tag,  }\item[{uint16\+\_\+t}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



put (append) a TV16 field 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em buf} & data buffer \\
\hline
\mbox{\texttt{ in}}  & {\em tag} & Tag value \\
\hline
\mbox{\texttt{ in}}  & {\em val} & Value (in host byte order!) \\
\hline
\end{DoxyParams}


Referenced by \textbf{ msgb\+\_\+tv16\+\_\+push()}, and \textbf{ msgb\+\_\+tv16\+\_\+put()}.

\mbox{\label{group__tlv_ga1d4df96a15f4e4d617b75856945dec7c}} 
\index{TLV parser@{TLV parser}!tv\_fixed\_put@{tv\_fixed\_put}}
\index{tv\_fixed\_put@{tv\_fixed\_put}!TLV parser@{TLV parser}}
\doxysubsubsection{tv\_fixed\_put()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ tv\+\_\+fixed\+\_\+put (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$}]{buf,  }\item[{uint8\+\_\+t}]{tag,  }\item[{unsigned int}]{len,  }\item[{const uint8\+\_\+t $\ast$}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



put (append) a TVfixed field 



References \textbf{ len}.



Referenced by \textbf{ msgb\+\_\+tv\+\_\+fixed\+\_\+put()}.

\mbox{\label{group__tlv_ga30d03e5b5ebee2604e4ec621fe67312c}} 
\index{TLV parser@{TLV parser}!tv\_put@{tv\_put}}
\index{tv\_put@{tv\_put}!TLV parser@{TLV parser}}
\doxysubsubsection{tv\_put()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ tv\+\_\+put (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$}]{buf,  }\item[{uint8\+\_\+t}]{tag,  }\item[{uint8\+\_\+t}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



put (append) a TV field 



Referenced by \textbf{ msgb\+\_\+tv\+\_\+push()}, and \textbf{ msgb\+\_\+tv\+\_\+put()}.

\mbox{\label{group__tlv_gacd6c83b8eb030cb3b22eb3a127ceb09d}} 
\index{TLV parser@{TLV parser}!tvl\_put@{tvl\_put}}
\index{tvl\_put@{tvl\_put}!TLV parser@{TLV parser}}
\doxysubsubsection{tvl\_put()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ tvl\+\_\+put (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$}]{buf,  }\item[{uint8\+\_\+t}]{tag,  }\item[{uint16\+\_\+t}]{len }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



put (append) a TvL field (a Tv\+LV with variable-\/size length, where the value part\textquotesingle{}s length is already known, but will be put() later). 

\begin{DoxyReturn}{Returns}
pointer to the value\textquotesingle{}s start position. 
\end{DoxyReturn}


References \textbf{ len}, \textbf{ tl16\+\_\+put()}, \textbf{ tl\+\_\+put()}, and \textbf{ TVLV\+\_\+\+MAX\+\_\+\+ONEBYTE}.



Referenced by \textbf{ msgb\+\_\+tvl\+\_\+put()}.

\mbox{\label{group__tlv_ga658a5dca1430fa2cc0504e17e24fac43}} 
\index{TLV parser@{TLV parser}!TVLV\_GROSS\_LEN@{TVLV\_GROSS\_LEN}}
\index{TVLV\_GROSS\_LEN@{TVLV\_GROSS\_LEN}!TLV parser@{TLV parser}}
\doxysubsubsection{TVLV\_GROSS\_LEN()}
{\footnotesize\ttfamily static uint16\+\_\+t TVLV\+\_\+\+GROSS\+\_\+\+LEN (\begin{DoxyParamCaption}\item[{uint16\+\_\+t}]{len }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



gross length of a TVLV type field 



References \textbf{ len}, \textbf{ TL16\+V\+\_\+\+GROSS\+\_\+\+LEN}, \textbf{ TLV\+\_\+\+GROSS\+\_\+\+LEN}, and \textbf{ TVLV\+\_\+\+MAX\+\_\+\+ONEBYTE}.



Referenced by \textbf{ msgb\+\_\+tvl\+\_\+put()}, \textbf{ msgb\+\_\+tvlv\+\_\+push()}, and \textbf{ msgb\+\_\+tvlv\+\_\+put()}.

\mbox{\label{group__tlv_gaec511a2345c4456e46acb9c1ab66a010}} 
\index{TLV parser@{TLV parser}!tvlv\_put@{tvlv\_put}}
\index{tvlv\_put@{tvlv\_put}!TLV parser@{TLV parser}}
\doxysubsubsection{tvlv\_put()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ tvlv\+\_\+put (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$}]{buf,  }\item[{uint8\+\_\+t}]{tag,  }\item[{uint16\+\_\+t}]{len,  }\item[{const uint8\+\_\+t $\ast$}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



put (append) a Tv\+LV field 



References \textbf{ len}, \textbf{ tl16v\+\_\+put()}, \textbf{ tlv\+\_\+put()}, and \textbf{ TVLV\+\_\+\+MAX\+\_\+\+ONEBYTE}.



Referenced by \textbf{ msgb\+\_\+tvlv\+\_\+push()}, and \textbf{ msgb\+\_\+tvlv\+\_\+put()}.

\mbox{\label{group__tlv_gacfddecb675d3f26add7590fff19a0b27}} 
\index{TLV parser@{TLV parser}!v\_put@{v\_put}}
\index{v\_put@{v\_put}!TLV parser@{TLV parser}}
\doxysubsubsection{v\_put()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ v\+\_\+put (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$}]{buf,  }\item[{uint8\+\_\+t}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



put (append) a V field 



Referenced by \textbf{ msgb\+\_\+v\+\_\+put()}.

\mbox{\label{group__tlv_gae96ccb06dbadc0ff1582b2b372e5fa2d}} 
\index{TLV parser@{TLV parser}!vt\_gan\_put@{vt\_gan\_put}}
\index{vt\_gan\_put@{vt\_gan\_put}!TLV parser@{TLV parser}}
\doxysubsubsection{vt\_gan\_put()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ vt\+\_\+gan\+\_\+put (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$}]{buf,  }\item[{uint16\+\_\+t}]{tag }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



put (append) a variable-\/length tag or variable-\/length length $\ast$ 



References \textbf{ TVLV\+\_\+\+MAX\+\_\+\+ONEBYTE}.



Referenced by \textbf{ vtvl\+\_\+gan\+\_\+put()}.

\mbox{\label{group__tlv_ga5e3ab8f3b5182187bf8fccef06dbbb3c}} 
\index{TLV parser@{TLV parser}!VTVL\_GAN\_GROSS\_LEN@{VTVL\_GAN\_GROSS\_LEN}}
\index{VTVL\_GAN\_GROSS\_LEN@{VTVL\_GAN\_GROSS\_LEN}!TLV parser@{TLV parser}}
\doxysubsubsection{VTVL\_GAN\_GROSS\_LEN()}
{\footnotesize\ttfamily static uint16\+\_\+t VTVL\+\_\+\+GAN\+\_\+\+GROSS\+\_\+\+LEN (\begin{DoxyParamCaption}\item[{uint16\+\_\+t}]{tag,  }\item[{uint16\+\_\+t}]{len }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



gross length of v\+TvL header (tag+len) 



References \textbf{ len}, and \textbf{ TVLV\+\_\+\+MAX\+\_\+\+ONEBYTE}.



Referenced by \textbf{ msgb\+\_\+vtvl\+\_\+gan\+\_\+push()}.

\mbox{\label{group__tlv_ga05c0da0b1acfcbfd5cc3b95e037105af}} 
\index{TLV parser@{TLV parser}!vtvl\_gan\_put@{vtvl\_gan\_put}}
\index{vtvl\_gan\_put@{vtvl\_gan\_put}!TLV parser@{TLV parser}}
\doxysubsubsection{vtvl\_gan\_put()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ vtvl\+\_\+gan\+\_\+put (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$}]{buf,  }\item[{uint16\+\_\+t}]{tag,  }\item[{uint16\+\_\+t}]{len }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



References \textbf{ len}, and \textbf{ vt\+\_\+gan\+\_\+put()}.



Referenced by \textbf{ msgb\+\_\+vtvl\+\_\+gan\+\_\+push()}, and \textbf{ vtvlv\+\_\+gan\+\_\+put()}.

\mbox{\label{group__tlv_ga423a9beeae38d915ceeaa31009f226bf}} 
\index{TLV parser@{TLV parser}!VTVLV\_GAN\_GROSS\_LEN@{VTVLV\_GAN\_GROSS\_LEN}}
\index{VTVLV\_GAN\_GROSS\_LEN@{VTVLV\_GAN\_GROSS\_LEN}!TLV parser@{TLV parser}}
\doxysubsubsection{VTVLV\_GAN\_GROSS\_LEN()}
{\footnotesize\ttfamily static uint16\+\_\+t VTVLV\+\_\+\+GAN\+\_\+\+GROSS\+\_\+\+LEN (\begin{DoxyParamCaption}\item[{uint16\+\_\+t}]{tag,  }\item[{uint16\+\_\+t}]{len }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



gross length of v\+Tv\+LV (tag+len+val) 



References \textbf{ len}, \textbf{ TL16\+V\+\_\+\+GROSS\+\_\+\+LEN}, \textbf{ TLV\+\_\+\+GROSS\+\_\+\+LEN}, and \textbf{ TVLV\+\_\+\+MAX\+\_\+\+ONEBYTE}.



Referenced by \textbf{ msgb\+\_\+vtvlv\+\_\+gan\+\_\+push()}, and \textbf{ msgb\+\_\+vtvlv\+\_\+gan\+\_\+put()}.

\mbox{\label{group__tlv_ga31f79a9d508f2701c699efe3553f994f}} 
\index{TLV parser@{TLV parser}!vtvlv\_gan\_put@{vtvlv\_gan\_put}}
\index{vtvlv\_gan\_put@{vtvlv\_gan\_put}!TLV parser@{TLV parser}}
\doxysubsubsection{vtvlv\_gan\_put()}
{\footnotesize\ttfamily static uint8\+\_\+t $\ast$ vtvlv\+\_\+gan\+\_\+put (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$}]{buf,  }\item[{uint16\+\_\+t}]{tag,  }\item[{uint16\+\_\+t}]{len,  }\item[{const uint8\+\_\+t $\ast$}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



References \textbf{ len}, and \textbf{ vtvl\+\_\+gan\+\_\+put()}.



Referenced by \textbf{ msgb\+\_\+vtvlv\+\_\+gan\+\_\+push()}, and \textbf{ msgb\+\_\+vtvlv\+\_\+gan\+\_\+put()}.



\doxysubsection{Variable Documentation}
\mbox{\label{group__tlv_gaf12475bbfcf233eedcc432048eef908e}} 
\index{TLV parser@{TLV parser}!ienamebuf@{ienamebuf}}
\index{ienamebuf@{ienamebuf}!TLV parser@{TLV parser}}
\doxysubsubsection{ienamebuf}
{\footnotesize\ttfamily \+\_\+\+\_\+thread char ienamebuf[32]\hspace{0.3cm}{\ttfamily [static]}}



Referenced by \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+ie\+\_\+name()}.

\mbox{\label{group__tlv_ga4fbe1df62a55f1c984d126cee5cccaae}} 
\index{TLV parser@{TLV parser}!msgnamebuf@{msgnamebuf}}
\index{msgnamebuf@{msgnamebuf}!TLV parser@{TLV parser}}
\doxysubsubsection{msgnamebuf}
{\footnotesize\ttfamily \+\_\+\+\_\+thread char msgnamebuf[32]\hspace{0.3cm}{\ttfamily [static]}}



Referenced by \textbf{ osmo\+\_\+tlv\+\_\+prot\+\_\+msg\+\_\+name()}.

\mbox{\label{group__tlv_gaa89a058c5844f0a9cf7a511d9f027d64}} 
\index{TLV parser@{TLV parser}!tvlv\_att\_def@{tvlv\_att\_def}}
\index{tvlv\_att\_def@{tvlv\_att\_def}!TLV parser@{TLV parser}}
\doxysubsubsection{tvlv\_att\_def\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily struct \textbf{ tlv\+\_\+definition} tvlv\+\_\+att\+\_\+def\hspace{0.3cm}{\ttfamily [extern]}}



Referenced by \textbf{ \+\_\+\+\_\+attribute\+\_\+\+\_\+()}.

\mbox{\label{group__tlv_gaa89a058c5844f0a9cf7a511d9f027d64}} 
\index{TLV parser@{TLV parser}!tvlv\_att\_def@{tvlv\_att\_def}}
\index{tvlv\_att\_def@{tvlv\_att\_def}!TLV parser@{TLV parser}}
\doxysubsubsection{tvlv\_att\_def\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily struct \textbf{ tlv\+\_\+definition} tvlv\+\_\+att\+\_\+def}



Referenced by \textbf{ \+\_\+\+\_\+attribute\+\_\+\+\_\+()}.

\mbox{\label{group__tlv_ga2c96a12ce5df50b77591b20dd1d69047}} 
\index{TLV parser@{TLV parser}!vtvlv\_gan\_att\_def@{vtvlv\_gan\_att\_def}}
\index{vtvlv\_gan\_att\_def@{vtvlv\_gan\_att\_def}!TLV parser@{TLV parser}}
\doxysubsubsection{vtvlv\_gan\_att\_def\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily struct \textbf{ tlv\+\_\+definition} vtvlv\+\_\+gan\+\_\+att\+\_\+def\hspace{0.3cm}{\ttfamily [extern]}}



Referenced by \textbf{ \+\_\+\+\_\+attribute\+\_\+\+\_\+()}.

\mbox{\label{group__tlv_ga2c96a12ce5df50b77591b20dd1d69047}} 
\index{TLV parser@{TLV parser}!vtvlv\_gan\_att\_def@{vtvlv\_gan\_att\_def}}
\index{vtvlv\_gan\_att\_def@{vtvlv\_gan\_att\_def}!TLV parser@{TLV parser}}
\doxysubsubsection{vtvlv\_gan\_att\_def\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily struct \textbf{ tlv\+\_\+definition} vtvlv\+\_\+gan\+\_\+att\+\_\+def}



Referenced by \textbf{ \+\_\+\+\_\+attribute\+\_\+\+\_\+()}.

