\doxysection{include/osmocom/core/bit32gen.h File Reference}
\label{bit32gen_8h}\index{include/osmocom/core/bit32gen.h@{include/osmocom/core/bit32gen.h}}
{\ttfamily \#include $<$osmocom/core/utils.\+h$>$}\newline
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
static uint32\+\_\+t \textbf{ osmo\+\_\+load32le\+\_\+ext} (const void $\ast$p, uint8\+\_\+t \textbf{ n})
\begin{DoxyCompactList}\small\item\em load unaligned n-\/byte integer (little-\/endian encoding) into uint32\+\_\+t, into the least significant octets. \end{DoxyCompactList}\item 
static uint32\+\_\+t \textbf{ osmo\+\_\+load32be\+\_\+ext} (const void $\ast$p, uint8\+\_\+t \textbf{ n})
\begin{DoxyCompactList}\small\item\em load unaligned n-\/byte integer (big-\/endian encoding) into uint32\+\_\+t, into the MOST significant octets. \end{DoxyCompactList}\item 
static uint32\+\_\+t \textbf{ osmo\+\_\+load32be\+\_\+ext\+\_\+2} (const void $\ast$p, uint8\+\_\+t \textbf{ n})
\begin{DoxyCompactList}\small\item\em load unaligned n-\/byte integer (big-\/endian encoding) into uint32\+\_\+t, into the least significant octets. \end{DoxyCompactList}\item 
static void \textbf{ osmo\+\_\+store32le\+\_\+ext} (uint32\+\_\+t x, void $\ast$p, uint8\+\_\+t \textbf{ n})
\begin{DoxyCompactList}\small\item\em store unaligned n-\/byte integer (little-\/endian encoding) from uint32\+\_\+t \end{DoxyCompactList}\item 
static void \textbf{ osmo\+\_\+store32be\+\_\+ext} (uint32\+\_\+t x, void $\ast$p, uint8\+\_\+t \textbf{ n})
\begin{DoxyCompactList}\small\item\em store unaligned n-\/byte integer (big-\/endian encoding) from uint32\+\_\+t \end{DoxyCompactList}\item 
static uint32\+\_\+t \textbf{ osmo\+\_\+load32le} (const void $\ast$p)
\begin{DoxyCompactList}\small\item\em load unaligned 32-\/bit integer (little-\/endian encoding) \end{DoxyCompactList}\item 
static uint32\+\_\+t \textbf{ osmo\+\_\+load32be} (const void $\ast$p)
\begin{DoxyCompactList}\small\item\em load unaligned 32-\/bit integer (big-\/endian encoding) \end{DoxyCompactList}\item 
static void \textbf{ osmo\+\_\+store32le} (uint32\+\_\+t x, void $\ast$p)
\begin{DoxyCompactList}\small\item\em store unaligned 32-\/bit integer (little-\/endian encoding) \end{DoxyCompactList}\item 
static void \textbf{ osmo\+\_\+store32be} (uint32\+\_\+t x, void $\ast$p)
\begin{DoxyCompactList}\small\item\em store unaligned 32-\/bit integer (big-\/endian encoding) \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Function Documentation}
\mbox{\label{bit32gen_8h_a1b4573684c9e7f18463c6aff20b96e2b}} 
\index{bit32gen.h@{bit32gen.h}!osmo\_load32be@{osmo\_load32be}}
\index{osmo\_load32be@{osmo\_load32be}!bit32gen.h@{bit32gen.h}}
\doxysubsubsection{osmo\_load32be()}
{\footnotesize\ttfamily static uint32\+\_\+t osmo\+\_\+load32be (\begin{DoxyParamCaption}\item[{const void $\ast$}]{p }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



load unaligned 32-\/bit integer (big-\/endian encoding) 



References \textbf{ osmo\+\_\+load32be\+\_\+ext()}.



Referenced by \textbf{ msgb\+\_\+get\+\_\+u32()}, and \textbf{ msgb\+\_\+pull\+\_\+u32()}.

\mbox{\label{bit32gen_8h_aaaff71d90952b66d86511a79456a19d5}} 
\index{bit32gen.h@{bit32gen.h}!osmo\_load32be\_ext@{osmo\_load32be\_ext}}
\index{osmo\_load32be\_ext@{osmo\_load32be\_ext}!bit32gen.h@{bit32gen.h}}
\doxysubsubsection{osmo\_load32be\_ext()}
{\footnotesize\ttfamily static uint32\+\_\+t osmo\+\_\+load32be\+\_\+ext (\begin{DoxyParamCaption}\item[{const void $\ast$}]{p,  }\item[{uint8\+\_\+t}]{n }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



load unaligned n-\/byte integer (big-\/endian encoding) into uint32\+\_\+t, into the MOST significant octets. 

WARNING\+: for n $<$ sizeof(uint32\+\_\+t), the result is not returned in the least significant octets, as one might expect. To always return the same value as fed to \doxyref{osmo\+\_\+store32be\+\_\+ext()}{p.}{bit32gen_8h_ad136de8807ae98c8a109532cc0c4c66a} before, use \doxyref{osmo\+\_\+load32be\+\_\+ext\+\_\+2()}{p.}{bit32gen_8h_a0a71bca2d15d8d95a193cfaaafe18d45}. 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em p} & Buffer where integer is stored \\
\hline
\mbox{\texttt{ in}}  & {\em n} & Number of bytes stored in p \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
32 bit unsigned integer 
\end{DoxyReturn}


References \textbf{ n}, and \textbf{ OSMO\+\_\+\+ASSERT}.



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

\mbox{\label{bit32gen_8h_a0a71bca2d15d8d95a193cfaaafe18d45}} 
\index{bit32gen.h@{bit32gen.h}!osmo\_load32be\_ext\_2@{osmo\_load32be\_ext\_2}}
\index{osmo\_load32be\_ext\_2@{osmo\_load32be\_ext\_2}!bit32gen.h@{bit32gen.h}}
\doxysubsubsection{osmo\_load32be\_ext\_2()}
{\footnotesize\ttfamily static uint32\+\_\+t osmo\+\_\+load32be\+\_\+ext\+\_\+2 (\begin{DoxyParamCaption}\item[{const void $\ast$}]{p,  }\item[{uint8\+\_\+t}]{n }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



load unaligned n-\/byte integer (big-\/endian encoding) into uint32\+\_\+t, into the least significant octets. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em p} & Buffer where integer is stored \\
\hline
\mbox{\texttt{ in}}  & {\em n} & Number of bytes stored in p \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
32 bit unsigned integer 
\end{DoxyReturn}


References \textbf{ n}, and \textbf{ OSMO\+\_\+\+ASSERT}.

\mbox{\label{bit32gen_8h_a4ed4253e2f6ca52cace75eb588a00ad5}} 
\index{bit32gen.h@{bit32gen.h}!osmo\_load32le@{osmo\_load32le}}
\index{osmo\_load32le@{osmo\_load32le}!bit32gen.h@{bit32gen.h}}
\doxysubsubsection{osmo\_load32le()}
{\footnotesize\ttfamily static uint32\+\_\+t osmo\+\_\+load32le (\begin{DoxyParamCaption}\item[{const void $\ast$}]{p }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



load unaligned 32-\/bit integer (little-\/endian encoding) 



References \textbf{ osmo\+\_\+load32le\+\_\+ext()}.

\mbox{\label{bit32gen_8h_a45a1f2dd1bc797e867a0c72d86aaac26}} 
\index{bit32gen.h@{bit32gen.h}!osmo\_load32le\_ext@{osmo\_load32le\_ext}}
\index{osmo\_load32le\_ext@{osmo\_load32le\_ext}!bit32gen.h@{bit32gen.h}}
\doxysubsubsection{osmo\_load32le\_ext()}
{\footnotesize\ttfamily static uint32\+\_\+t osmo\+\_\+load32le\+\_\+ext (\begin{DoxyParamCaption}\item[{const void $\ast$}]{p,  }\item[{uint8\+\_\+t}]{n }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



load unaligned n-\/byte integer (little-\/endian encoding) into uint32\+\_\+t, into the least significant octets. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em p} & Buffer where integer is stored \\
\hline
\mbox{\texttt{ in}}  & {\em n} & Number of bytes stored in p \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
32 bit unsigned integer 
\end{DoxyReturn}


References \textbf{ n}, and \textbf{ OSMO\+\_\+\+ASSERT}.



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

\mbox{\label{bit32gen_8h_a0b58d24b8eedd60bd90cf0d82ab28372}} 
\index{bit32gen.h@{bit32gen.h}!osmo\_store32be@{osmo\_store32be}}
\index{osmo\_store32be@{osmo\_store32be}!bit32gen.h@{bit32gen.h}}
\doxysubsubsection{osmo\_store32be()}
{\footnotesize\ttfamily static void osmo\+\_\+store32be (\begin{DoxyParamCaption}\item[{uint32\+\_\+t}]{x,  }\item[{void $\ast$}]{p }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



store unaligned 32-\/bit integer (big-\/endian encoding) 



References \textbf{ osmo\+\_\+store32be\+\_\+ext()}.



Referenced by \textbf{ \+\_\+gsmtap\+\_\+raw\+\_\+output()}, \textbf{ msgb\+\_\+push\+\_\+u32()}, and \textbf{ msgb\+\_\+put\+\_\+u32()}.

\mbox{\label{bit32gen_8h_ad136de8807ae98c8a109532cc0c4c66a}} 
\index{bit32gen.h@{bit32gen.h}!osmo\_store32be\_ext@{osmo\_store32be\_ext}}
\index{osmo\_store32be\_ext@{osmo\_store32be\_ext}!bit32gen.h@{bit32gen.h}}
\doxysubsubsection{osmo\_store32be\_ext()}
{\footnotesize\ttfamily static void osmo\+\_\+store32be\+\_\+ext (\begin{DoxyParamCaption}\item[{uint32\+\_\+t}]{x,  }\item[{void $\ast$}]{p,  }\item[{uint8\+\_\+t}]{n }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



store unaligned n-\/byte integer (big-\/endian encoding) from uint32\+\_\+t 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em x} & unsigned 32 bit integer \\
\hline
\mbox{\texttt{ out}}  & {\em p} & Buffer to store integer \\
\hline
\mbox{\texttt{ in}}  & {\em n} & Number of bytes to store \\
\hline
\end{DoxyParams}


References \textbf{ n}, and \textbf{ OSMO\+\_\+\+ASSERT}.



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

\mbox{\label{bit32gen_8h_a1bb4e8a9fddab4ba628163eb609ec10d}} 
\index{bit32gen.h@{bit32gen.h}!osmo\_store32le@{osmo\_store32le}}
\index{osmo\_store32le@{osmo\_store32le}!bit32gen.h@{bit32gen.h}}
\doxysubsubsection{osmo\_store32le()}
{\footnotesize\ttfamily static void osmo\+\_\+store32le (\begin{DoxyParamCaption}\item[{uint32\+\_\+t}]{x,  }\item[{void $\ast$}]{p }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



store unaligned 32-\/bit integer (little-\/endian encoding) 



References \textbf{ osmo\+\_\+store32le\+\_\+ext()}.

\mbox{\label{bit32gen_8h_ae965d05b00bf271edbd1c5728f85606f}} 
\index{bit32gen.h@{bit32gen.h}!osmo\_store32le\_ext@{osmo\_store32le\_ext}}
\index{osmo\_store32le\_ext@{osmo\_store32le\_ext}!bit32gen.h@{bit32gen.h}}
\doxysubsubsection{osmo\_store32le\_ext()}
{\footnotesize\ttfamily static void osmo\+\_\+store32le\+\_\+ext (\begin{DoxyParamCaption}\item[{uint32\+\_\+t}]{x,  }\item[{void $\ast$}]{p,  }\item[{uint8\+\_\+t}]{n }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



store unaligned n-\/byte integer (little-\/endian encoding) from uint32\+\_\+t 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em x} & unsigned 32 bit integer \\
\hline
\mbox{\texttt{ out}}  & {\em p} & Buffer to store integer \\
\hline
\mbox{\texttt{ in}}  & {\em n} & Number of bytes to store \\
\hline
\end{DoxyParams}


References \textbf{ n}, and \textbf{ OSMO\+\_\+\+ASSERT}.



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

