\section{src/osmo\+\_\+ss7\+\_\+hmrt.c File Reference}
\label{osmo__ss7__hmrt_8c}\index{src/osmo\+\_\+ss7\+\_\+hmrt.\+c@{src/osmo\+\_\+ss7\+\_\+hmrt.\+c}}
{\ttfamily \#include $<$stdbool.\+h$>$}\newline
{\ttfamily \#include $<$string.\+h$>$}\newline
{\ttfamily \#include $<$errno.\+h$>$}\newline
{\ttfamily \#include $<$arpa/inet.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/linuxlist.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/logging.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/sigtran/mtp\+\_\+sap.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/sigtran/osmo\+\_\+ss7.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/sigtran/protocol/m3ua.\+h$>$}\newline
{\ttfamily \#include \char`\"{}xua\+\_\+internal.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}ss7\+\_\+internal.\+h\char`\"{}}\newline
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \textbf{ A\+P\+P\+E\+ND}(fmt,  args ...)
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ osmo\+\_\+mtp\+\_\+prim} $\ast$ \textbf{ m3ua\+\_\+to\+\_\+xfer\+\_\+ind} (struct \textbf{ xua\+\_\+msg} $\ast$xua)
\item 
static struct \textbf{ xua\+\_\+msg} $\ast$ \textbf{ mtp\+\_\+prim\+\_\+to\+\_\+m3ua} (struct \textbf{ osmo\+\_\+mtp\+\_\+prim} $\ast$prim)
\item 
static int \textbf{ deliver\+\_\+to\+\_\+mtp\+\_\+user} (const struct \textbf{ osmo\+\_\+ss7\+\_\+user} $\ast$osu, struct \textbf{ xua\+\_\+msg} $\ast$xua)
\item 
static int \textbf{ hmdt\+\_\+message\+\_\+for\+\_\+distribution} (struct \textbf{ osmo\+\_\+ss7\+\_\+instance} $\ast$inst, struct \textbf{ xua\+\_\+msg} $\ast$xua)
\item 
const char $\ast$ \textbf{ osmo\+\_\+ss7\+\_\+route\+\_\+name} (struct \textbf{ osmo\+\_\+ss7\+\_\+route} $\ast$rt, bool list\+\_\+asps)
\begin{DoxyCompactList}\small\item\em Return human readable representation of the route, in a static buffer. \end{DoxyCompactList}\item 
static int \textbf{ hmrt\+\_\+message\+\_\+for\+\_\+routing} (struct \textbf{ osmo\+\_\+ss7\+\_\+instance} $\ast$inst, struct \textbf{ xua\+\_\+msg} $\ast$xua)
\item 
int \textbf{ m3ua\+\_\+hmdc\+\_\+rx\+\_\+from\+\_\+l2} (struct \textbf{ osmo\+\_\+ss7\+\_\+instance} $\ast$inst, struct \textbf{ xua\+\_\+msg} $\ast$xua)
\item 
int \textbf{ osmo\+\_\+ss7\+\_\+user\+\_\+mtp\+\_\+xfer\+\_\+req} (struct \textbf{ osmo\+\_\+ss7\+\_\+instance} $\ast$inst, struct \textbf{ osmo\+\_\+mtp\+\_\+prim} $\ast$omp)
\end{DoxyCompactItemize}


\subsection{Macro Definition Documentation}
\mbox{\label{osmo__ss7__hmrt_8c_a78d865d31aa82b7624caa11bfb02c913}} 
\index{osmo\+\_\+ss7\+\_\+hmrt.\+c@{osmo\+\_\+ss7\+\_\+hmrt.\+c}!A\+P\+P\+E\+ND@{A\+P\+P\+E\+ND}}
\index{A\+P\+P\+E\+ND@{A\+P\+P\+E\+ND}!osmo\+\_\+ss7\+\_\+hmrt.\+c@{osmo\+\_\+ss7\+\_\+hmrt.\+c}}
\subsubsection{A\+P\+P\+E\+ND}
{\footnotesize\ttfamily \#define A\+P\+P\+E\+ND(\begin{DoxyParamCaption}\item[{}]{fmt,  }\item[{}]{args ... }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}
\textcolor{keywordflow}{do} \{ \(\backslash\)
                l = snprintf(pos, \textcolor{keyword}{sizeof}(buf) - (pos - buf), fmt, ## args); \(\backslash\)
                pos += l; \(\backslash\)
                if (pos - buf >= \textcolor{keyword}{sizeof}(buf) ) \(\backslash\)
                        goto out; \(\backslash\)
        \} \textcolor{keywordflow}{while} (0)
\end{DoxyCode}


Referenced by osmo\+\_\+ss7\+\_\+route\+\_\+name().



\subsection{Function Documentation}
\mbox{\label{osmo__ss7__hmrt_8c_ab0f4b1309a8a2006635950c46ddd3b06}} 
\index{osmo\+\_\+ss7\+\_\+hmrt.\+c@{osmo\+\_\+ss7\+\_\+hmrt.\+c}!deliver\+\_\+to\+\_\+mtp\+\_\+user@{deliver\+\_\+to\+\_\+mtp\+\_\+user}}
\index{deliver\+\_\+to\+\_\+mtp\+\_\+user@{deliver\+\_\+to\+\_\+mtp\+\_\+user}!osmo\+\_\+ss7\+\_\+hmrt.\+c@{osmo\+\_\+ss7\+\_\+hmrt.\+c}}
\subsubsection{deliver\+\_\+to\+\_\+mtp\+\_\+user()}
{\footnotesize\ttfamily static int deliver\+\_\+to\+\_\+mtp\+\_\+user (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+ss7\+\_\+user} $\ast$}]{osu,  }\item[{struct \textbf{ xua\+\_\+msg} $\ast$}]{xua }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References m3ua\+\_\+to\+\_\+xfer\+\_\+ind(), xua\+\_\+msg\+::mtp, osmo\+\_\+mtp\+\_\+prim\+::oph, osmo\+\_\+ss7\+\_\+user\+::prim\+\_\+cb, osmo\+\_\+ss7\+\_\+user\+::priv, osmo\+\_\+mtp\+\_\+prim\+::transfer, and osmo\+\_\+mtp\+\_\+prim\+::u.



Referenced by hmdt\+\_\+message\+\_\+for\+\_\+distribution().

\mbox{\label{osmo__ss7__hmrt_8c_a3c2df3b0f156f7bd46317990d8136d97}} 
\index{osmo\+\_\+ss7\+\_\+hmrt.\+c@{osmo\+\_\+ss7\+\_\+hmrt.\+c}!hmdt\+\_\+message\+\_\+for\+\_\+distribution@{hmdt\+\_\+message\+\_\+for\+\_\+distribution}}
\index{hmdt\+\_\+message\+\_\+for\+\_\+distribution@{hmdt\+\_\+message\+\_\+for\+\_\+distribution}!osmo\+\_\+ss7\+\_\+hmrt.\+c@{osmo\+\_\+ss7\+\_\+hmrt.\+c}}
\subsubsection{hmdt\+\_\+message\+\_\+for\+\_\+distribution()}
{\footnotesize\ttfamily static int hmdt\+\_\+message\+\_\+for\+\_\+distribution (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+ss7\+\_\+instance} $\ast$}]{inst,  }\item[{struct \textbf{ xua\+\_\+msg} $\ast$}]{xua }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References data\+\_\+hdr\+\_\+from\+\_\+m3ua(), deliver\+\_\+to\+\_\+mtp\+\_\+user(), xua\+\_\+msg\+::hdr, M3\+U\+A\+\_\+\+M\+S\+G\+C\+\_\+\+S\+NM, M3\+U\+A\+\_\+\+M\+S\+G\+C\+\_\+\+X\+F\+ER, M3\+U\+A\+\_\+\+X\+F\+E\+R\+\_\+\+D\+A\+TA, xua\+\_\+common\+\_\+hdr\+::msg\+\_\+class, xua\+\_\+common\+\_\+hdr\+::msg\+\_\+type, m3ua\+\_\+data\+\_\+hdr\+::si, and osmo\+\_\+ss7\+\_\+instance\+::user.



Referenced by m3ua\+\_\+hmdc\+\_\+rx\+\_\+from\+\_\+l2().

\mbox{\label{osmo__ss7__hmrt_8c_a33ede64db537fe1d5a39e6d9c2f07c8b}} 
\index{osmo\+\_\+ss7\+\_\+hmrt.\+c@{osmo\+\_\+ss7\+\_\+hmrt.\+c}!hmrt\+\_\+message\+\_\+for\+\_\+routing@{hmrt\+\_\+message\+\_\+for\+\_\+routing}}
\index{hmrt\+\_\+message\+\_\+for\+\_\+routing@{hmrt\+\_\+message\+\_\+for\+\_\+routing}!osmo\+\_\+ss7\+\_\+hmrt.\+c@{osmo\+\_\+ss7\+\_\+hmrt.\+c}}
\subsubsection{hmrt\+\_\+message\+\_\+for\+\_\+routing()}
{\footnotesize\ttfamily static int hmrt\+\_\+message\+\_\+for\+\_\+routing (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+ss7\+\_\+instance} $\ast$}]{inst,  }\item[{struct \textbf{ xua\+\_\+msg} $\ast$}]{xua }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References osmo\+\_\+ss7\+\_\+route\+::as, osmo\+\_\+ss7\+\_\+as\+::cfg, osmo\+\_\+ss7\+\_\+as\+::ctrg, osmo\+\_\+ss7\+\_\+route\+::dest, osmo\+\_\+mtp\+\_\+transfer\+\_\+param\+::dpc, dpc, ipa\+\_\+tx\+\_\+xua\+\_\+as(), osmo\+\_\+ss7\+\_\+route\+::linkset, m3ua\+\_\+tx\+\_\+xua\+\_\+as(), xua\+\_\+msg\+::mtp, O\+S\+M\+O\+\_\+\+S\+S7\+\_\+\+A\+S\+P\+\_\+\+P\+R\+O\+T\+\_\+\+I\+PA, O\+S\+M\+O\+\_\+\+S\+S7\+\_\+\+A\+S\+P\+\_\+\+P\+R\+O\+T\+\_\+\+M3\+UA, osmo\+\_\+ss7\+\_\+pointcode\+\_\+print(), osmo\+\_\+ss7\+\_\+route\+\_\+lookup(), osmo\+\_\+ss7\+\_\+route\+\_\+name(), osmo\+\_\+ss7\+\_\+as\+::proto, and S\+S7\+\_\+\+A\+S\+\_\+\+C\+T\+R\+\_\+\+T\+X\+\_\+\+M\+S\+U\+\_\+\+T\+O\+T\+AL.



Referenced by m3ua\+\_\+hmdc\+\_\+rx\+\_\+from\+\_\+l2().

\mbox{\label{osmo__ss7__hmrt_8c_a8bc0dfc719354cd380bb206d25c33c6a}} 
\index{osmo\+\_\+ss7\+\_\+hmrt.\+c@{osmo\+\_\+ss7\+\_\+hmrt.\+c}!m3ua\+\_\+hmdc\+\_\+rx\+\_\+from\+\_\+l2@{m3ua\+\_\+hmdc\+\_\+rx\+\_\+from\+\_\+l2}}
\index{m3ua\+\_\+hmdc\+\_\+rx\+\_\+from\+\_\+l2@{m3ua\+\_\+hmdc\+\_\+rx\+\_\+from\+\_\+l2}!osmo\+\_\+ss7\+\_\+hmrt.\+c@{osmo\+\_\+ss7\+\_\+hmrt.\+c}}
\subsubsection{m3ua\+\_\+hmdc\+\_\+rx\+\_\+from\+\_\+l2()}
{\footnotesize\ttfamily int m3ua\+\_\+hmdc\+\_\+rx\+\_\+from\+\_\+l2 (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+ss7\+\_\+instance} $\ast$}]{inst,  }\item[{struct \textbf{ xua\+\_\+msg} $\ast$}]{xua }\end{DoxyParamCaption})}



References osmo\+\_\+mtp\+\_\+transfer\+\_\+param\+::dpc, dpc, hmdt\+\_\+message\+\_\+for\+\_\+distribution(), hmrt\+\_\+message\+\_\+for\+\_\+routing(), xua\+\_\+msg\+::mtp, osmo\+\_\+ss7\+\_\+pc\+\_\+is\+\_\+local(), and osmo\+\_\+ss7\+\_\+pointcode\+\_\+print().



Referenced by ipa\+\_\+rx\+\_\+msg\+\_\+sccp(), m3ua\+\_\+rx\+\_\+xfer(), and osmo\+\_\+ss7\+\_\+user\+\_\+mtp\+\_\+xfer\+\_\+req().

\mbox{\label{osmo__ss7__hmrt_8c_af932d2ab56e706ac86fe0bd6f2c3a4d7}} 
\index{osmo\+\_\+ss7\+\_\+hmrt.\+c@{osmo\+\_\+ss7\+\_\+hmrt.\+c}!m3ua\+\_\+to\+\_\+xfer\+\_\+ind@{m3ua\+\_\+to\+\_\+xfer\+\_\+ind}}
\index{m3ua\+\_\+to\+\_\+xfer\+\_\+ind@{m3ua\+\_\+to\+\_\+xfer\+\_\+ind}!osmo\+\_\+ss7\+\_\+hmrt.\+c@{osmo\+\_\+ss7\+\_\+hmrt.\+c}}
\subsubsection{m3ua\+\_\+to\+\_\+xfer\+\_\+ind()}
{\footnotesize\ttfamily struct \textbf{ osmo\+\_\+mtp\+\_\+prim}$\ast$ m3ua\+\_\+to\+\_\+xfer\+\_\+ind (\begin{DoxyParamCaption}\item[{struct \textbf{ xua\+\_\+msg} $\ast$}]{xua }\end{DoxyParamCaption})}



References xua\+\_\+msg\+\_\+part\+::dat, xua\+\_\+msg\+\_\+part\+::len, m3ua\+\_\+dh\+\_\+to\+\_\+xfer\+\_\+param(), M3\+U\+A\+\_\+\+I\+E\+I\+\_\+\+P\+R\+O\+T\+\_\+\+D\+A\+TA, m3ua\+\_\+msgb\+\_\+alloc(), M\+T\+P\+\_\+\+S\+A\+P\+\_\+\+U\+S\+ER, osmo\+\_\+mtp\+\_\+prim\+::oph, O\+S\+M\+O\+\_\+\+M\+T\+P\+\_\+\+P\+R\+I\+M\+\_\+\+T\+R\+A\+N\+S\+F\+ER, osmo\+\_\+mtp\+\_\+prim\+::transfer, osmo\+\_\+mtp\+\_\+prim\+::u, and xua\+\_\+msg\+\_\+find\+\_\+tag().



Referenced by deliver\+\_\+to\+\_\+mtp\+\_\+user().

\mbox{\label{osmo__ss7__hmrt_8c_ad193b380beb0c625be71e8a3c2823d19}} 
\index{osmo\+\_\+ss7\+\_\+hmrt.\+c@{osmo\+\_\+ss7\+\_\+hmrt.\+c}!mtp\+\_\+prim\+\_\+to\+\_\+m3ua@{mtp\+\_\+prim\+\_\+to\+\_\+m3ua}}
\index{mtp\+\_\+prim\+\_\+to\+\_\+m3ua@{mtp\+\_\+prim\+\_\+to\+\_\+m3ua}!osmo\+\_\+ss7\+\_\+hmrt.\+c@{osmo\+\_\+ss7\+\_\+hmrt.\+c}}
\subsubsection{mtp\+\_\+prim\+\_\+to\+\_\+m3ua()}
{\footnotesize\ttfamily static struct \textbf{ xua\+\_\+msg}$\ast$ mtp\+\_\+prim\+\_\+to\+\_\+m3ua (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+mtp\+\_\+prim} $\ast$}]{prim }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References m3ua\+\_\+xfer\+\_\+from\+\_\+data(), mtp\+\_\+xfer\+\_\+param\+\_\+to\+\_\+m3ua\+\_\+dh(), osmo\+\_\+mtp\+\_\+prim\+::oph, osmo\+\_\+mtp\+\_\+prim\+::transfer, and osmo\+\_\+mtp\+\_\+prim\+::u.



Referenced by osmo\+\_\+ss7\+\_\+user\+\_\+mtp\+\_\+xfer\+\_\+req().

\mbox{\label{osmo__ss7__hmrt_8c_ac966231057ff7ab04224ffee73abfc4a}} 
\index{osmo\+\_\+ss7\+\_\+hmrt.\+c@{osmo\+\_\+ss7\+\_\+hmrt.\+c}!osmo\+\_\+ss7\+\_\+route\+\_\+name@{osmo\+\_\+ss7\+\_\+route\+\_\+name}}
\index{osmo\+\_\+ss7\+\_\+route\+\_\+name@{osmo\+\_\+ss7\+\_\+route\+\_\+name}!osmo\+\_\+ss7\+\_\+hmrt.\+c@{osmo\+\_\+ss7\+\_\+hmrt.\+c}}
\subsubsection{osmo\+\_\+ss7\+\_\+route\+\_\+name()}
{\footnotesize\ttfamily const char$\ast$ osmo\+\_\+ss7\+\_\+route\+\_\+name (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+ss7\+\_\+route} $\ast$}]{rt,  }\item[{bool}]{list\+\_\+asps }\end{DoxyParamCaption})}



Return human readable representation of the route, in a static buffer. 

This uses both \doxyref{osmo\+\_\+ss7\+\_\+pointcode\+\_\+print()}{p.}{osmo__ss7_8h_aced2f480635c40bdfbdc7b03687f0743} and \doxyref{osmo\+\_\+ss7\+\_\+pointcode\+\_\+print2()}{p.}{osmo__ss7_8h_a11f1c4d0b61f5445352c6adeb39b8e3b}, so pairing \doxyref{osmo\+\_\+ss7\+\_\+route\+\_\+name()}{p.}{osmo__ss7__hmrt_8c_ac966231057ff7ab04224ffee73abfc4a} with \doxyref{osmo\+\_\+ss7\+\_\+pointcode\+\_\+print()}{p.}{osmo__ss7_8h_aced2f480635c40bdfbdc7b03687f0743} in the same printf statement is likely to conflict. 
\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em rt} & The route information to print, or N\+U\+LL. \\
\hline
\mbox{\tt in}  & {\em list\+\_\+asps} & If true, append info for all A\+S\+Ps for the route\textquotesingle{}s AS. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A string constant or static buffer. 
\end{DoxyReturn}


References A\+P\+P\+E\+ND, osmo\+\_\+ss7\+\_\+route\+::as, osmo\+\_\+ss7\+\_\+as\+::asps, osmo\+\_\+ss7\+\_\+linkset\+::cfg, osmo\+\_\+ss7\+\_\+route\+::cfg, osmo\+\_\+ss7\+\_\+as\+::cfg, osmo\+\_\+ss7\+\_\+asp\+::cfg, osmo\+\_\+ss7\+\_\+route\+::dest, osmo\+\_\+ss7\+\_\+route\+\_\+table\+::inst, osmo\+\_\+ss7\+\_\+route\+::linkset, osmo\+\_\+ss7\+\_\+route\+::mask, osmo\+\_\+ss7\+\_\+linkset\+::name, osmo\+\_\+ss7\+\_\+as\+::name, osmo\+\_\+ss7\+\_\+asp\+::name, osmo\+\_\+ss7\+\_\+asp\+\_\+protocol\+\_\+name(), osmo\+\_\+ss7\+\_\+pointcode\+\_\+print(), osmo\+\_\+ss7\+\_\+pointcode\+\_\+print2(), osmo\+\_\+ss7\+\_\+route\+::pc, osmo\+\_\+ss7\+\_\+as\+::proto, osmo\+\_\+ss7\+\_\+route\+::rtable, and osmo\+\_\+ss7\+\_\+asp\+::sock\+\_\+name.



Referenced by hmrt\+\_\+message\+\_\+for\+\_\+routing().

\mbox{\label{osmo__ss7__hmrt_8c_a6e0fa32ebbd3aeba25b800146a76bbc7}} 
\index{osmo\+\_\+ss7\+\_\+hmrt.\+c@{osmo\+\_\+ss7\+\_\+hmrt.\+c}!osmo\+\_\+ss7\+\_\+user\+\_\+mtp\+\_\+xfer\+\_\+req@{osmo\+\_\+ss7\+\_\+user\+\_\+mtp\+\_\+xfer\+\_\+req}}
\index{osmo\+\_\+ss7\+\_\+user\+\_\+mtp\+\_\+xfer\+\_\+req@{osmo\+\_\+ss7\+\_\+user\+\_\+mtp\+\_\+xfer\+\_\+req}!osmo\+\_\+ss7\+\_\+hmrt.\+c@{osmo\+\_\+ss7\+\_\+hmrt.\+c}}
\subsubsection{osmo\+\_\+ss7\+\_\+user\+\_\+mtp\+\_\+xfer\+\_\+req()}
{\footnotesize\ttfamily int osmo\+\_\+ss7\+\_\+user\+\_\+mtp\+\_\+xfer\+\_\+req (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+ss7\+\_\+instance} $\ast$}]{inst,  }\item[{struct \textbf{ osmo\+\_\+mtp\+\_\+prim} $\ast$}]{omp }\end{DoxyParamCaption})}



References m3ua\+\_\+hmdc\+\_\+rx\+\_\+from\+\_\+l2(), xua\+\_\+msg\+::mtp, mtp\+\_\+prim\+\_\+to\+\_\+m3ua(), M\+T\+P\+\_\+\+S\+A\+P\+\_\+\+U\+S\+ER, osmo\+\_\+mtp\+\_\+prim\+::oph, O\+S\+M\+O\+\_\+\+M\+T\+P\+\_\+\+P\+R\+I\+M\+\_\+\+T\+R\+A\+N\+S\+F\+ER, osmo\+\_\+mtp\+\_\+prim\+::transfer, osmo\+\_\+mtp\+\_\+prim\+::u, and xua\+\_\+msg\+\_\+free().



Referenced by sua2sccp\+\_\+tx\+\_\+m3ua().

