\doxysection{src/gsm/oap\+\_\+client.c File Reference}
\label{oap__client_8c}\index{src/gsm/oap\_client.c@{src/gsm/oap\_client.c}}
{\ttfamily \#include $<$string.\+h$>$}\newline
{\ttfamily \#include $<$errno.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/utils.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/logging.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/crypt/auth.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/gsm/oap.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/gsm/oap\+\_\+client.\+h$>$}\newline
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \textbf{ osmo\+\_\+oap\+\_\+client\+\_\+init} (struct \textbf{ osmo\+\_\+oap\+\_\+client\+\_\+config} $\ast$\textbf{ config}, struct \textbf{ osmo\+\_\+oap\+\_\+client\+\_\+state} $\ast$state)
\item 
static int \textbf{ oap\+\_\+evaluate\+\_\+challenge} (const struct \textbf{ osmo\+\_\+oap\+\_\+client\+\_\+state} $\ast$state, const uint8\+\_\+t $\ast$rx\+\_\+random, const uint8\+\_\+t $\ast$rx\+\_\+autn, uint8\+\_\+t $\ast$tx\+\_\+xres)
\item 
struct \textbf{ msgb} $\ast$ \textbf{ osmo\+\_\+oap\+\_\+client\+\_\+encoded} (const struct \textbf{ osmo\+\_\+oap\+\_\+message} $\ast$oap\+\_\+msg)
\item 
static struct \textbf{ msgb} $\ast$ \textbf{ oap\+\_\+msg\+\_\+register} (uint16\+\_\+t client\+\_\+id)
\item 
int \textbf{ osmo\+\_\+oap\+\_\+client\+\_\+register} (struct \textbf{ osmo\+\_\+oap\+\_\+client\+\_\+state} $\ast$state, struct \textbf{ msgb} $\ast$$\ast$msg\+\_\+tx)
\item 
static struct \textbf{ msgb} $\ast$ \textbf{ oap\+\_\+msg\+\_\+challenge\+\_\+response} (uint8\+\_\+t $\ast$xres)
\item 
static int \textbf{ handle\+\_\+challenge} (struct \textbf{ osmo\+\_\+oap\+\_\+client\+\_\+state} $\ast$state, struct \textbf{ osmo\+\_\+oap\+\_\+message} $\ast$oap\+\_\+rx, struct \textbf{ msgb} $\ast$$\ast$msg\+\_\+tx)
\item 
int \textbf{ osmo\+\_\+oap\+\_\+client\+\_\+handle} (struct \textbf{ osmo\+\_\+oap\+\_\+client\+\_\+state} $\ast$state, const struct \textbf{ msgb} $\ast$msg\+\_\+rx, struct \textbf{ msgb} $\ast$$\ast$msg\+\_\+tx)
\end{DoxyCompactItemize}


\doxysubsection{Function Documentation}
\mbox{\label{oap__client_8c_ac12040f3f26687226647f4353ef04e27}} 
\index{oap\_client.c@{oap\_client.c}!handle\_challenge@{handle\_challenge}}
\index{handle\_challenge@{handle\_challenge}!oap\_client.c@{oap\_client.c}}
\doxysubsubsection{handle\_challenge()}
{\footnotesize\ttfamily static int handle\+\_\+challenge (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+oap\+\_\+client\+\_\+state} $\ast$}]{state,  }\item[{struct \textbf{ osmo\+\_\+oap\+\_\+message} $\ast$}]{oap\+\_\+rx,  }\item[{struct \textbf{ msgb} $\ast$$\ast$}]{msg\+\_\+tx }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ osmo\+\_\+oap\+\_\+message\+::autn}, \textbf{ osmo\+\_\+oap\+\_\+message\+::autn\+\_\+present}, \textbf{ DLOAP}, \textbf{ LOGL\+\_\+\+ERROR}, \textbf{ LOGP}, \textbf{ oap\+\_\+evaluate\+\_\+challenge()}, \textbf{ oap\+\_\+msg\+\_\+challenge\+\_\+response()}, \textbf{ OSMO\+\_\+\+ASSERT}, \textbf{ osmo\+\_\+oap\+\_\+message\+::rand}, \textbf{ osmo\+\_\+oap\+\_\+message\+::rand\+\_\+present}, \textbf{ osmo\+\_\+oap\+\_\+client\+\_\+state\+::state}, and \textbf{ osmo\+\_\+oap\+\_\+message\+::xres}.



Referenced by \textbf{ osmo\+\_\+oap\+\_\+client\+\_\+handle()}.

\mbox{\label{oap__client_8c_abed59f1b8fb4ab2cead6c93a4741cc9b}} 
\index{oap\_client.c@{oap\_client.c}!oap\_evaluate\_challenge@{oap\_evaluate\_challenge}}
\index{oap\_evaluate\_challenge@{oap\_evaluate\_challenge}!oap\_client.c@{oap\_client.c}}
\doxysubsubsection{oap\_evaluate\_challenge()}
{\footnotesize\ttfamily static int oap\+\_\+evaluate\+\_\+challenge (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+oap\+\_\+client\+\_\+state} $\ast$}]{state,  }\item[{const uint8\+\_\+t $\ast$}]{rx\+\_\+random,  }\item[{const uint8\+\_\+t $\ast$}]{rx\+\_\+autn,  }\item[{uint8\+\_\+t $\ast$}]{tx\+\_\+xres }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ osmo\+\_\+sub\+\_\+auth\+\_\+data\+::amf}, \textbf{ osmo\+\_\+auth\+\_\+vector\+::autn}, \textbf{ DLOAP}, \textbf{ osmo\+\_\+sub\+\_\+auth\+\_\+data\+::k}, \textbf{ LOGL\+\_\+\+ERROR}, \textbf{ LOGL\+\_\+\+INFO}, \textbf{ LOGP}, \textbf{ osmo\+\_\+sub\+\_\+auth\+\_\+data\+::opc}, \textbf{ OSMO\+\_\+\+AUTH\+\_\+\+ALG\+\_\+\+MILENAGE}, \textbf{ osmo\+\_\+auth\+\_\+gen\+\_\+vec()}, \textbf{ OSMO\+\_\+\+AUTH\+\_\+\+TYPE\+\_\+\+UMTS}, \textbf{ osmo\+\_\+constant\+\_\+time\+\_\+cmp()}, \textbf{ osmo\+\_\+hexdump\+\_\+nospc()}, \textbf{ osmo\+\_\+static\+\_\+assert()}, \textbf{ osmo\+\_\+auth\+\_\+vector\+::res}, \textbf{ osmo\+\_\+auth\+\_\+vector\+::res\+\_\+len}, \textbf{ osmo\+\_\+oap\+\_\+client\+\_\+state\+::secret\+\_\+k}, \textbf{ osmo\+\_\+oap\+\_\+client\+\_\+state\+::secret\+\_\+opc}, \textbf{ osmo\+\_\+sub\+\_\+auth\+\_\+data\+::sqn}, \textbf{ osmo\+\_\+oap\+\_\+client\+\_\+state\+::state}, \textbf{ osmo\+\_\+sub\+\_\+auth\+\_\+data\+::type}, \textbf{ osmo\+\_\+sub\+\_\+auth\+\_\+data\+::u}, and \textbf{ osmo\+\_\+sub\+\_\+auth\+\_\+data\+::umts}.



Referenced by \textbf{ handle\+\_\+challenge()}.

\mbox{\label{oap__client_8c_a169377ed6c5033ac42d5eb69fa80ec7d}} 
\index{oap\_client.c@{oap\_client.c}!oap\_msg\_challenge\_response@{oap\_msg\_challenge\_response}}
\index{oap\_msg\_challenge\_response@{oap\_msg\_challenge\_response}!oap\_client.c@{oap\_client.c}}
\doxysubsubsection{oap\_msg\_challenge\_response()}
{\footnotesize\ttfamily static struct \textbf{ msgb} $\ast$ oap\+\_\+msg\+\_\+challenge\+\_\+response (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$}]{xres }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ osmo\+\_\+oap\+\_\+message\+::message\+\_\+type}, \textbf{ OAP\+\_\+\+MSGT\+\_\+\+CHALLENGE\+\_\+\+RESULT}, \textbf{ osmo\+\_\+oap\+\_\+client\+\_\+encoded()}, \textbf{ osmo\+\_\+oap\+\_\+message\+::xres}, and \textbf{ osmo\+\_\+oap\+\_\+message\+::xres\+\_\+present}.



Referenced by \textbf{ handle\+\_\+challenge()}.

\mbox{\label{oap__client_8c_a8f12b73d97ac4b4bda3c1c6bee1b8126}} 
\index{oap\_client.c@{oap\_client.c}!oap\_msg\_register@{oap\_msg\_register}}
\index{oap\_msg\_register@{oap\_msg\_register}!oap\_client.c@{oap\_client.c}}
\doxysubsubsection{oap\_msg\_register()}
{\footnotesize\ttfamily static struct \textbf{ msgb} $\ast$ oap\+\_\+msg\+\_\+register (\begin{DoxyParamCaption}\item[{uint16\+\_\+t}]{client\+\_\+id }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ osmo\+\_\+oap\+\_\+message\+::client\+\_\+id}, \textbf{ DLOAP}, \textbf{ LOGL\+\_\+\+ERROR}, \textbf{ LOGP}, \textbf{ osmo\+\_\+oap\+\_\+message\+::message\+\_\+type}, \textbf{ OAP\+\_\+\+MSGT\+\_\+\+REGISTER\+\_\+\+REQUEST}, and \textbf{ osmo\+\_\+oap\+\_\+client\+\_\+encoded()}.



Referenced by \textbf{ osmo\+\_\+oap\+\_\+client\+\_\+register()}.

\mbox{\label{oap__client_8c_a43d2df7ed630494c166eda511213d6ac}} 
\index{oap\_client.c@{oap\_client.c}!osmo\_oap\_client\_encoded@{osmo\_oap\_client\_encoded}}
\index{osmo\_oap\_client\_encoded@{osmo\_oap\_client\_encoded}!oap\_client.c@{oap\_client.c}}
\doxysubsubsection{osmo\_oap\_client\_encoded()}
{\footnotesize\ttfamily struct \textbf{ msgb} $\ast$ osmo\+\_\+oap\+\_\+client\+\_\+encoded (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+oap\+\_\+message} $\ast$}]{oap\+\_\+msg }\end{DoxyParamCaption})}



References \textbf{ msg}, \textbf{ msgb\+\_\+alloc\+\_\+headroom()}, \textbf{ OSMO\+\_\+\+ASSERT}, and \textbf{ osmo\+\_\+oap\+\_\+encode()}.



Referenced by \textbf{ oap\+\_\+msg\+\_\+challenge\+\_\+response()}, and \textbf{ oap\+\_\+msg\+\_\+register()}.

\mbox{\label{oap__client_8c_a76c2a4c3ad73e7d83a96115d72e88ca5}} 
\index{oap\_client.c@{oap\_client.c}!osmo\_oap\_client\_handle@{osmo\_oap\_client\_handle}}
\index{osmo\_oap\_client\_handle@{osmo\_oap\_client\_handle}!oap\_client.c@{oap\_client.c}}
\doxysubsubsection{osmo\_oap\_client\_handle()}
{\footnotesize\ttfamily int osmo\+\_\+oap\+\_\+client\+\_\+handle (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+oap\+\_\+client\+\_\+state} $\ast$}]{state,  }\item[{const struct \textbf{ msgb} $\ast$}]{msg\+\_\+rx,  }\item[{struct \textbf{ msgb} $\ast$$\ast$}]{msg\+\_\+tx }\end{DoxyParamCaption})}



References \textbf{ data}, \textbf{ DLOAP}, \textbf{ get\+\_\+value\+\_\+string()}, \textbf{ gsm48\+\_\+gmm\+\_\+cause\+\_\+names}, \textbf{ handle\+\_\+challenge()}, \textbf{ LOGL\+\_\+\+ERROR}, \textbf{ LOGP}, \textbf{ osmo\+\_\+oap\+\_\+message\+::message\+\_\+type}, \textbf{ msgb\+\_\+l2}, \textbf{ msgb\+\_\+l2len()}, \textbf{ OAP\+\_\+\+MSGT\+\_\+\+CHALLENGE\+\_\+\+REQUEST}, \textbf{ OAP\+\_\+\+MSGT\+\_\+\+CHALLENGE\+\_\+\+RESULT}, \textbf{ OAP\+\_\+\+MSGT\+\_\+\+REGISTER\+\_\+\+ERROR}, \textbf{ OAP\+\_\+\+MSGT\+\_\+\+REGISTER\+\_\+\+REQUEST}, \textbf{ OAP\+\_\+\+MSGT\+\_\+\+REGISTER\+\_\+\+RESULT}, \textbf{ OSMO\+\_\+\+ASSERT}, \textbf{ osmo\+\_\+oap\+\_\+client\+\_\+register()}, \textbf{ osmo\+\_\+oap\+\_\+decode()}, \textbf{ osmo\+\_\+oap\+\_\+client\+\_\+state\+::registration\+\_\+failures}, and \textbf{ osmo\+\_\+oap\+\_\+client\+\_\+state\+::state}.

\mbox{\label{oap__client_8c_abd3bcd7cd68c725ba56c886d2fbb90d4}} 
\index{oap\_client.c@{oap\_client.c}!osmo\_oap\_client\_init@{osmo\_oap\_client\_init}}
\index{osmo\_oap\_client\_init@{osmo\_oap\_client\_init}!oap\_client.c@{oap\_client.c}}
\doxysubsubsection{osmo\_oap\_client\_init()}
{\footnotesize\ttfamily int osmo\+\_\+oap\+\_\+client\+\_\+init (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+oap\+\_\+client\+\_\+config} $\ast$}]{config,  }\item[{struct \textbf{ osmo\+\_\+oap\+\_\+client\+\_\+state} $\ast$}]{state }\end{DoxyParamCaption})}



References \textbf{ osmo\+\_\+oap\+\_\+client\+\_\+state\+::client\+\_\+id}, \textbf{ config}, \textbf{ DLOAP}, \textbf{ LOGL\+\_\+\+NOTICE}, \textbf{ LOGP}, \textbf{ OSMO\+\_\+\+ASSERT}, \textbf{ osmo\+\_\+oap\+\_\+client\+\_\+state\+::secret\+\_\+k}, \textbf{ osmo\+\_\+oap\+\_\+client\+\_\+state\+::secret\+\_\+opc}, and \textbf{ osmo\+\_\+oap\+\_\+client\+\_\+state\+::state}.

\mbox{\label{oap__client_8c_afebde9d8a1c470b3fa45e2920f46f831}} 
\index{oap\_client.c@{oap\_client.c}!osmo\_oap\_client\_register@{osmo\_oap\_client\_register}}
\index{osmo\_oap\_client\_register@{osmo\_oap\_client\_register}!oap\_client.c@{oap\_client.c}}
\doxysubsubsection{osmo\_oap\_client\_register()}
{\footnotesize\ttfamily int osmo\+\_\+oap\+\_\+client\+\_\+register (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+oap\+\_\+client\+\_\+state} $\ast$}]{state,  }\item[{struct \textbf{ msgb} $\ast$$\ast$}]{msg\+\_\+tx }\end{DoxyParamCaption})}



References \textbf{ osmo\+\_\+oap\+\_\+client\+\_\+state\+::client\+\_\+id}, \textbf{ oap\+\_\+msg\+\_\+register()}, and \textbf{ osmo\+\_\+oap\+\_\+client\+\_\+state\+::state}.



Referenced by \textbf{ osmo\+\_\+oap\+\_\+client\+\_\+handle()}.

