\section{src/ipa.c File Reference} \label{ipa_8c}\index{src/ipa.\+c@{src/ipa.\+c}} {\ttfamily \#include $<$stdint.\+h$>$}\newline {\ttfamily \#include $<$errno.\+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/write\+\_\+queue.\+h$>$}\newline {\ttfamily \#include $<$osmocom/core/logging.\+h$>$}\newline {\ttfamily \#include $<$osmocom/core/timer.\+h$>$}\newline {\ttfamily \#include $<$osmocom/core/socket.\+h$>$}\newline {\ttfamily \#include $<$osmocom/core/byteswap.\+h$>$}\newline {\ttfamily \#include $<$osmocom/gsm/ipa.\+h$>$}\newline {\ttfamily \#include $<$osmocom/gsm/protocol/ipaccess.\+h$>$}\newline {\ttfamily \#include $<$osmocom/netif/ipa.\+h$>$}\newline {\ttfamily \#include $<$osmocom/sigtran/xua\+\_\+msg.\+h$>$}\newline {\ttfamily \#include $<$osmocom/sigtran/mtp\+\_\+sap.\+h$>$}\newline {\ttfamily \#include $<$osmocom/sigtran/sccp\+\_\+sap.\+h$>$}\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 $<$osmocom/sigtran/protocol/mtp.\+h$>$}\newline {\ttfamily \#include \char`\"{}xua\+\_\+internal.\+h\char`\"{}}\newline {\ttfamily \#include \char`\"{}ss7\+\_\+internal.\+h\char`\"{}}\newline {\ttfamily \#include \char`\"{}xua\+\_\+asp\+\_\+fsm.\+h\char`\"{}}\newline \subsection*{Functions} \begin{DoxyCompactItemize} \item int \textbf{ ipa\+\_\+tx\+\_\+xua\+\_\+as} (struct \textbf{ osmo\+\_\+ss7\+\_\+as} $\ast$as, struct \textbf{ xua\+\_\+msg} $\ast$xua) \begin{DoxyCompactList}\small\item\em Send a given x\+UA message via a given I\+PA \char`\"{}\+Application Server\char`\"{}. \end{DoxyCompactList}\item static int \textbf{ ipa\+\_\+rx\+\_\+msg\+\_\+ccm} (struct \textbf{ osmo\+\_\+ss7\+\_\+asp} $\ast$asp, struct msgb $\ast$msg) \item struct \textbf{ osmo\+\_\+ss7\+\_\+as} $\ast$ \textbf{ ipa\+\_\+find\+\_\+as\+\_\+for\+\_\+asp} (struct \textbf{ osmo\+\_\+ss7\+\_\+asp} $\ast$asp) \item static struct msgb $\ast$ \textbf{ patch\+\_\+sccp\+\_\+with\+\_\+pc} (struct \textbf{ osmo\+\_\+ss7\+\_\+asp} $\ast$asp, struct msgb $\ast$sccp\+\_\+msg\+\_\+in, uint32\+\_\+t \textbf{ opc}, uint32\+\_\+t \textbf{ dpc}) \item static int \textbf{ ipa\+\_\+rx\+\_\+msg\+\_\+sccp} (struct \textbf{ osmo\+\_\+ss7\+\_\+asp} $\ast$asp, struct msgb $\ast$msg, uint8\+\_\+t \textbf{ sls}) \item int \textbf{ ipa\+\_\+rx\+\_\+msg} (struct \textbf{ osmo\+\_\+ss7\+\_\+asp} $\ast$asp, struct msgb $\ast$msg, uint8\+\_\+t \textbf{ sls}) \begin{DoxyCompactList}\small\item\em process M3\+UA message received from socket \end{DoxyCompactList}\end{DoxyCompactItemize} \subsection{Function Documentation} \mbox{\label{ipa_8c_a605df838f5e98c86b34aacc5fc0d20a3}} \index{ipa.\+c@{ipa.\+c}!ipa\+\_\+find\+\_\+as\+\_\+for\+\_\+asp@{ipa\+\_\+find\+\_\+as\+\_\+for\+\_\+asp}} \index{ipa\+\_\+find\+\_\+as\+\_\+for\+\_\+asp@{ipa\+\_\+find\+\_\+as\+\_\+for\+\_\+asp}!ipa.\+c@{ipa.\+c}} \subsubsection{ipa\+\_\+find\+\_\+as\+\_\+for\+\_\+asp()} {\footnotesize\ttfamily struct \textbf{ osmo\+\_\+ss7\+\_\+as}$\ast$ ipa\+\_\+find\+\_\+as\+\_\+for\+\_\+asp (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+ss7\+\_\+asp} $\ast$}]{asp }\end{DoxyParamCaption})} References osmo\+\_\+ss7\+\_\+instance\+::as\+\_\+list, osmo\+\_\+ss7\+\_\+asp\+::inst, osmo\+\_\+ss7\+\_\+as\+::list, and osmo\+\_\+ss7\+\_\+as\+\_\+has\+\_\+asp(). Referenced by ipa\+\_\+asp\+\_\+fsm\+\_\+start(), and ipa\+\_\+rx\+\_\+msg\+\_\+sccp(). \mbox{\label{ipa_8c_a1b8e22b504c31fbddfa6ddbdf1e5c9a3}} \index{ipa.\+c@{ipa.\+c}!ipa\+\_\+rx\+\_\+msg@{ipa\+\_\+rx\+\_\+msg}} \index{ipa\+\_\+rx\+\_\+msg@{ipa\+\_\+rx\+\_\+msg}!ipa.\+c@{ipa.\+c}} \subsubsection{ipa\+\_\+rx\+\_\+msg()} {\footnotesize\ttfamily int ipa\+\_\+rx\+\_\+msg (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+ss7\+\_\+asp} $\ast$}]{asp, }\item[{struct msgb $\ast$}]{msg, }\item[{uint8\+\_\+t}]{sls }\end{DoxyParamCaption})} process M3\+UA message received from socket \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em asp} & Application Server Process receiving {\itshape msg} \\ \hline \mbox{\tt in} & {\em msg} & received message buffer. Callee takes ownership! \\ \hline \mbox{\tt in} & {\em sls} & The S\+LS (signaling link selector) field to use in the generated M3\+UA header \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} 0 on success; negative on error \end{DoxyReturn} References osmo\+\_\+ss7\+\_\+asp\+::cfg, ipa\+\_\+rx\+\_\+msg\+\_\+ccm(), ipa\+\_\+rx\+\_\+msg\+\_\+sccp(), O\+S\+M\+O\+\_\+\+S\+S7\+\_\+\+A\+S\+P\+\_\+\+P\+R\+O\+T\+\_\+\+I\+PA, osmo\+\_\+ss7\+\_\+asp\+::proto, and ss7\+\_\+asp\+\_\+rx\+\_\+unknown(). Referenced by ipa\+\_\+cli\+\_\+read\+\_\+cb(), and ss7\+\_\+asp\+\_\+ipa\+\_\+srv\+\_\+conn\+\_\+rx\+\_\+cb(). \mbox{\label{ipa_8c_aaa9c94e32279253d3bcd5fedc14851b1}} \index{ipa.\+c@{ipa.\+c}!ipa\+\_\+rx\+\_\+msg\+\_\+ccm@{ipa\+\_\+rx\+\_\+msg\+\_\+ccm}} \index{ipa\+\_\+rx\+\_\+msg\+\_\+ccm@{ipa\+\_\+rx\+\_\+msg\+\_\+ccm}!ipa.\+c@{ipa.\+c}} \subsubsection{ipa\+\_\+rx\+\_\+msg\+\_\+ccm()} {\footnotesize\ttfamily static int ipa\+\_\+rx\+\_\+msg\+\_\+ccm (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+ss7\+\_\+asp} $\ast$}]{asp, }\item[{struct msgb $\ast$}]{msg }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}} References osmo\+\_\+ss7\+\_\+asp\+::fi, I\+P\+A\+\_\+\+A\+S\+P\+\_\+\+E\+\_\+\+I\+D\+\_\+\+A\+CK, I\+P\+A\+\_\+\+A\+S\+P\+\_\+\+E\+\_\+\+I\+D\+\_\+\+G\+ET, I\+P\+A\+\_\+\+A\+S\+P\+\_\+\+E\+\_\+\+I\+D\+\_\+\+R\+E\+SP, L\+O\+G\+P\+A\+SP, msg\+\_\+type, X\+U\+A\+\_\+\+A\+S\+P\+\_\+\+E\+\_\+\+A\+S\+P\+S\+M\+\_\+\+B\+E\+AT, and X\+U\+A\+\_\+\+A\+S\+P\+\_\+\+E\+\_\+\+A\+S\+P\+S\+M\+\_\+\+B\+E\+A\+T\+\_\+\+A\+CK. Referenced by ipa\+\_\+rx\+\_\+msg(). \mbox{\label{ipa_8c_a6b5dcc70e8c69ba3b57ab88e7f8c9f70}} \index{ipa.\+c@{ipa.\+c}!ipa\+\_\+rx\+\_\+msg\+\_\+sccp@{ipa\+\_\+rx\+\_\+msg\+\_\+sccp}} \index{ipa\+\_\+rx\+\_\+msg\+\_\+sccp@{ipa\+\_\+rx\+\_\+msg\+\_\+sccp}!ipa.\+c@{ipa.\+c}} \subsubsection{ipa\+\_\+rx\+\_\+msg\+\_\+sccp()} {\footnotesize\ttfamily static int ipa\+\_\+rx\+\_\+msg\+\_\+sccp (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+ss7\+\_\+asp} $\ast$}]{asp, }\item[{struct msgb $\ast$}]{msg, }\item[{uint8\+\_\+t}]{sls }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}} References osmo\+\_\+ss7\+\_\+instance\+::cfg, osmo\+\_\+ss7\+\_\+as\+::cfg, osmo\+\_\+ss7\+\_\+asp\+::cfg, osmo\+\_\+ss7\+\_\+as\+::ctrg, m3ua\+\_\+data\+\_\+hdr\+::dpc, dpc, osmo\+\_\+ss7\+\_\+as\+::inst, osmo\+\_\+ss7\+\_\+asp\+::inst, ipa\+\_\+find\+\_\+as\+\_\+for\+\_\+asp(), osmo\+\_\+ss7\+\_\+asp\+::is\+\_\+server, L\+O\+G\+P\+A\+SP, m3ua\+\_\+dh\+\_\+to\+\_\+xfer\+\_\+param(), m3ua\+\_\+hmdc\+\_\+rx\+\_\+from\+\_\+l2(), m3ua\+\_\+xfer\+\_\+from\+\_\+data(), xua\+\_\+msg\+::mtp, M\+T\+P\+\_\+\+S\+I\+\_\+\+S\+C\+CP, osmo\+\_\+ss7\+\_\+instance\+::network\+\_\+indicator, m3ua\+\_\+data\+\_\+hdr\+::ni, m3ua\+\_\+data\+\_\+hdr\+::opc, opc, O\+S\+M\+O\+\_\+\+S\+S7\+\_\+\+P\+A\+T\+C\+H\+\_\+\+B\+O\+TH, patch\+\_\+sccp\+\_\+with\+\_\+pc(), osmo\+\_\+ss7\+\_\+routing\+\_\+key\+::pc, osmo\+\_\+ss7\+\_\+as\+::pc\+\_\+override, osmo\+\_\+ss7\+\_\+as\+::routing\+\_\+key, m3ua\+\_\+data\+\_\+hdr\+::si, m3ua\+\_\+data\+\_\+hdr\+::sls, sls, S\+S7\+\_\+\+A\+S\+\_\+\+C\+T\+R\+\_\+\+R\+X\+\_\+\+M\+S\+U\+\_\+\+T\+O\+T\+AL, and xua\+\_\+msg\+\_\+free(). Referenced by ipa\+\_\+rx\+\_\+msg(). \mbox{\label{ipa_8c_a4473443b022e57cc48e07677c14650ae}} \index{ipa.\+c@{ipa.\+c}!ipa\+\_\+tx\+\_\+xua\+\_\+as@{ipa\+\_\+tx\+\_\+xua\+\_\+as}} \index{ipa\+\_\+tx\+\_\+xua\+\_\+as@{ipa\+\_\+tx\+\_\+xua\+\_\+as}!ipa.\+c@{ipa.\+c}} \subsubsection{ipa\+\_\+tx\+\_\+xua\+\_\+as()} {\footnotesize\ttfamily int ipa\+\_\+tx\+\_\+xua\+\_\+as (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+ss7\+\_\+as} $\ast$}]{as, }\item[{struct \textbf{ xua\+\_\+msg} $\ast$}]{xua }\end{DoxyParamCaption})} Send a given x\+UA message via a given I\+PA \char`\"{}\+Application Server\char`\"{}. \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em as} & Application Server through which to send {\itshape xua} \\ \hline \mbox{\tt in} & {\em xua} & x\+UA message to be sent \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} 0 on success; negative on error \end{DoxyReturn} References osmo\+\_\+ss7\+\_\+as\+::cfg, xua\+\_\+msg\+\_\+part\+::dat, xua\+\_\+msg\+\_\+part\+::len, L\+O\+G\+P\+AS, M3\+U\+A\+\_\+\+I\+E\+I\+\_\+\+P\+R\+O\+T\+\_\+\+D\+A\+TA, M\+T\+P\+\_\+\+S\+I\+\_\+\+S\+C\+CP, O\+S\+M\+O\+\_\+\+S\+S7\+\_\+\+A\+S\+P\+\_\+\+P\+R\+O\+T\+\_\+\+I\+PA, osmo\+\_\+ss7\+\_\+as\+::proto, m3ua\+\_\+data\+\_\+hdr\+::si, xua\+\_\+as\+\_\+transmit\+\_\+msg(), and xua\+\_\+msg\+\_\+find\+\_\+tag(). Referenced by hmrt\+\_\+message\+\_\+for\+\_\+routing(). \mbox{\label{ipa_8c_aedfece2960b57bc5f262f31b42caf866}} \index{ipa.\+c@{ipa.\+c}!patch\+\_\+sccp\+\_\+with\+\_\+pc@{patch\+\_\+sccp\+\_\+with\+\_\+pc}} \index{patch\+\_\+sccp\+\_\+with\+\_\+pc@{patch\+\_\+sccp\+\_\+with\+\_\+pc}!ipa.\+c@{ipa.\+c}} \subsubsection{patch\+\_\+sccp\+\_\+with\+\_\+pc()} {\footnotesize\ttfamily static struct msgb$\ast$ patch\+\_\+sccp\+\_\+with\+\_\+pc (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+ss7\+\_\+asp} $\ast$}]{asp, }\item[{struct msgb $\ast$}]{sccp\+\_\+msg\+\_\+in, }\item[{uint32\+\_\+t}]{opc, }\item[{uint32\+\_\+t}]{dpc }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}} References dpc, L\+O\+G\+P\+A\+SP, opc, O\+S\+M\+O\+\_\+\+S\+C\+C\+P\+\_\+\+A\+D\+D\+R\+\_\+\+T\+\_\+\+PC, osmo\+\_\+sccp\+\_\+to\+\_\+xua(), osmo\+\_\+sua\+\_\+to\+\_\+sccp(), osmo\+\_\+sccp\+\_\+addr\+::pc, osmo\+\_\+sccp\+\_\+addr\+::presence, sua\+\_\+addr\+\_\+parse(), S\+U\+A\+\_\+\+I\+E\+I\+\_\+\+D\+E\+S\+T\+\_\+\+A\+D\+DR, S\+U\+A\+\_\+\+I\+E\+I\+\_\+\+S\+R\+C\+\_\+\+A\+D\+DR, xua\+\_\+msg\+\_\+add\+\_\+sccp\+\_\+addr(), xua\+\_\+msg\+\_\+free(), and xua\+\_\+msg\+\_\+free\+\_\+tag(). Referenced by ipa\+\_\+rx\+\_\+msg\+\_\+sccp().