\doxysection{src/xua\+\_\+shared.c File Reference}
\label{xua__shared_8c}\index{src/xua\_shared.c@{src/xua\_shared.c}}
{\ttfamily \#include $<$stdint.\+h$>$}\newline
{\ttfamily \#include $<$unistd.\+h$>$}\newline
{\ttfamily \#include $<$string.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/utils.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/linuxlist.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/logging.\+h$>$}\newline
{\ttfamily \#include \char`\"{}xua\+\_\+msg.\+h\char`\"{}}\newline
{\ttfamily \#include $<$osmocom/sigtran/osmo\+\_\+ss7.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/sigtran/protocol/m3ua.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/sigtran/protocol/sua.\+h$>$}\newline
{\ttfamily \#include \char`\"{}ss7\+\_\+as.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}ss7\+\_\+asp.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}ss7\+\_\+internal.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}xua\+\_\+internal.\+h\char`\"{}}\newline
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
static struct \textbf{ osmo\+\_\+ss7\+\_\+as} $\ast$ \textbf{ find\+\_\+single\+\_\+as\+\_\+for\+\_\+asp} (const struct \textbf{ osmo\+\_\+ss7\+\_\+asp} $\ast$asp)
\item 
\textbf{ osmo\+\_\+static\+\_\+assert} (\textbf{ M3\+UA\+\_\+\+ERR\+\_\+\+INVAL\+\_\+\+ROUT\+\_\+\+CTX}==\textbf{ SUA\+\_\+\+ERR\+\_\+\+INVAL\+\_\+\+ROUT\+\_\+\+CTX}, \+\_\+err\+\_\+rctx)
\item 
\textbf{ osmo\+\_\+static\+\_\+assert} (\textbf{ M3\+UA\+\_\+\+ERR\+\_\+\+NO\+\_\+\+CONFGD\+\_\+\+AS\+\_\+\+FOR\+\_\+\+ASP}==\textbf{ SUA\+\_\+\+ERR\+\_\+\+NO\+\_\+\+CONFGD\+\_\+\+AS\+\_\+\+FOR\+\_\+\+ASP}, \+\_\+err\+\_\+as\+\_\+for\+\_\+asp)
\item 
int \textbf{ xua\+\_\+find\+\_\+as\+\_\+for\+\_\+asp} (struct \textbf{ osmo\+\_\+ss7\+\_\+as} $\ast$$\ast$as, const struct \textbf{ osmo\+\_\+ss7\+\_\+asp} $\ast$asp, const struct \textbf{ xua\+\_\+msg\+\_\+part} $\ast$rctx\+\_\+ie)
\begin{DoxyCompactList}\small\item\em Find the AS for given ASP + optional routing context IE. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Function Documentation}
\mbox{\label{xua__shared_8c_a2b178fbf6ba047cd95ebda81b308776c}} 
\index{xua\_shared.c@{xua\_shared.c}!find\_single\_as\_for\_asp@{find\_single\_as\_for\_asp}}
\index{find\_single\_as\_for\_asp@{find\_single\_as\_for\_asp}!xua\_shared.c@{xua\_shared.c}}
\doxysubsubsection{find\_single\_as\_for\_asp()}
{\footnotesize\ttfamily static struct \textbf{ osmo\+\_\+ss7\+\_\+as} $\ast$ find\+\_\+single\+\_\+as\+\_\+for\+\_\+asp (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+ss7\+\_\+asp} $\ast$}]{asp }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ osmo\+\_\+ss7\+\_\+instance\+::as\+\_\+list}, \textbf{ osmo\+\_\+ss7\+\_\+asp\+::inst}, \textbf{ osmo\+\_\+ss7\+\_\+as\+::list}, \textbf{ NULL}, and \textbf{ osmo\+\_\+ss7\+\_\+as\+\_\+has\+\_\+asp()}.



Referenced by \textbf{ xua\+\_\+find\+\_\+as\+\_\+for\+\_\+asp()}.

\mbox{\label{xua__shared_8c_aeddb692309141061f61857ca8ac3580a}} 
\index{xua\_shared.c@{xua\_shared.c}!osmo\_static\_assert@{osmo\_static\_assert}}
\index{osmo\_static\_assert@{osmo\_static\_assert}!xua\_shared.c@{xua\_shared.c}}
\doxysubsubsection{osmo\_static\_assert()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily osmo\+\_\+static\+\_\+assert (\begin{DoxyParamCaption}\item[{\textbf{ M3\+UA\+\_\+\+ERR\+\_\+\+INVAL\+\_\+\+ROUT\+\_\+\+CTX}}]{ = {\ttfamily =\textbf{ SUA\+\_\+\+ERR\+\_\+\+INVAL\+\_\+\+ROUT\+\_\+\+CTX}},  }\item[{\+\_\+err\+\_\+rctx}]{ }\end{DoxyParamCaption})}

\mbox{\label{xua__shared_8c_a55fcf4f40c115757780730933195cdcd}} 
\index{xua\_shared.c@{xua\_shared.c}!osmo\_static\_assert@{osmo\_static\_assert}}
\index{osmo\_static\_assert@{osmo\_static\_assert}!xua\_shared.c@{xua\_shared.c}}
\doxysubsubsection{osmo\_static\_assert()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily osmo\+\_\+static\+\_\+assert (\begin{DoxyParamCaption}\item[{\textbf{ M3\+UA\+\_\+\+ERR\+\_\+\+NO\+\_\+\+CONFGD\+\_\+\+AS\+\_\+\+FOR\+\_\+\+ASP}}]{ = {\ttfamily =\textbf{ SUA\+\_\+\+ERR\+\_\+\+NO\+\_\+\+CONFGD\+\_\+\+AS\+\_\+\+FOR\+\_\+\+ASP}},  }\item[{\+\_\+err\+\_\+as\+\_\+for\+\_\+asp}]{ }\end{DoxyParamCaption})}

\mbox{\label{xua__shared_8c_a1c94e3d373d31d7d27cd9e6784f25619}} 
\index{xua\_shared.c@{xua\_shared.c}!xua\_find\_as\_for\_asp@{xua\_find\_as\_for\_asp}}
\index{xua\_find\_as\_for\_asp@{xua\_find\_as\_for\_asp}!xua\_shared.c@{xua\_shared.c}}
\doxysubsubsection{xua\_find\_as\_for\_asp()}
{\footnotesize\ttfamily int xua\+\_\+find\+\_\+as\+\_\+for\+\_\+asp (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+ss7\+\_\+as} $\ast$$\ast$}]{as,  }\item[{const struct \textbf{ osmo\+\_\+ss7\+\_\+asp} $\ast$}]{asp,  }\item[{const struct \textbf{ xua\+\_\+msg\+\_\+part} $\ast$}]{rctx\+\_\+ie }\end{DoxyParamCaption})}



Find the AS for given ASP + optional routing context IE. 

if rctx\+\_\+ie == NULL, we assume that this ASP is only part of a single AS; if rctx\+\_\+ie is given, then we look-\/up the ASP based on the routing context, and verify that this ASP is part of it. 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ out}}  & {\em as} & caller-\/provided address-\/of-\/pointer to store the found AS \\
\hline
\mbox{\texttt{ in}}  & {\em asp} & ASP for which we want to look-\/up the AS \\
\hline
\mbox{\texttt{ in}}  & {\em rctx\+\_\+ie} & routing context IE (may be NULL) to use for look-\/up \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 in case of success; \{M3\+UA,SUA\}\+\_\+\+ERR\+\_\+$\ast$ code in case of error. 
\end{DoxyReturn}


References \textbf{ osmo\+\_\+ss7\+\_\+asp\+::cfg}, \textbf{ find\+\_\+single\+\_\+as\+\_\+for\+\_\+asp()}, \textbf{ osmo\+\_\+ss7\+\_\+asp\+::inst}, \textbf{ LOGPASP}, \textbf{ M3\+UA\+\_\+\+ERR\+\_\+\+INVAL\+\_\+\+ROUT\+\_\+\+CTX}, \textbf{ M3\+UA\+\_\+\+ERR\+\_\+\+NO\+\_\+\+CONFGD\+\_\+\+AS\+\_\+\+FOR\+\_\+\+ASP}, \textbf{ osmo\+\_\+ss7\+\_\+asp\+::name}, \textbf{ NULL}, \textbf{ osmo\+\_\+ss7\+\_\+as\+\_\+find\+\_\+by\+\_\+rctx()}, \textbf{ osmo\+\_\+ss7\+\_\+as\+\_\+has\+\_\+asp()}, \textbf{ osmo\+\_\+ss7\+\_\+asp\+\_\+get\+\_\+log\+\_\+subsys()}, and \textbf{ xua\+\_\+msg\+\_\+part\+\_\+get\+\_\+u32()}.



Referenced by \textbf{ m3ua\+\_\+rx\+\_\+snm\+\_\+asp()}, \textbf{ m3ua\+\_\+rx\+\_\+snm\+\_\+sg()}, \textbf{ m3ua\+\_\+rx\+\_\+xfer()}, \textbf{ sua\+\_\+rx\+\_\+cl()}, \textbf{ sua\+\_\+rx\+\_\+co()}, and \textbf{ sua\+\_\+rx\+\_\+snm\+\_\+asp()}.

