\doxysection{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\+\_\+as.\+h\char`\"{}}\newline {\ttfamily \#include \char`\"{}ss7\+\_\+asp.\+h\char`\"{}}\newline {\ttfamily \#include \char`\"{}ss7\+\_\+linkset.\+h\char`\"{}}\newline {\ttfamily \#include \char`\"{}ss7\+\_\+route.\+h\char`\"{}}\newline {\ttfamily \#include \char`\"{}ss7\+\_\+route\+\_\+table.\+h\char`\"{}}\newline {\ttfamily \#include \char`\"{}ss7\+\_\+internal.\+h\char`\"{}}\newline {\ttfamily \#include \char`\"{}ss7\+\_\+user.\+h\char`\"{}}\newline \doxysubsection*{Macros} \begin{DoxyCompactItemize} \item \#define \textbf{ APPEND}(fmt, args ...) \end{DoxyCompactItemize} \doxysubsection*{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} \doxysubsection{Macro Definition Documentation} \mbox{\label{osmo__ss7__hmrt_8c_a78d865d31aa82b7624caa11bfb02c913}} \index{osmo\_ss7\_hmrt.c@{osmo\_ss7\_hmrt.c}!APPEND@{APPEND}} \index{APPEND@{APPEND}!osmo\_ss7\_hmrt.c@{osmo\_ss7\_hmrt.c}} \doxysubsubsection{APPEND} {\footnotesize\ttfamily \#define APPEND(\begin{DoxyParamCaption}\item[{}]{fmt, }\item[{}]{args ... }\end{DoxyParamCaption})} {\bfseries Value\+:} \begin{DoxyCode}{0} \DoxyCodeLine{ \textcolor{keywordflow}{do} \{ \(\backslash\)} \DoxyCodeLine{ l = snprintf(pos, \textcolor{keyword}{sizeof}(buf) -\/ (pos -\/ buf), fmt, \#\# args); \(\backslash\)} \DoxyCodeLine{ pos += l; \(\backslash\)} \DoxyCodeLine{ if (pos -\/ buf >= \textcolor{keyword}{sizeof}(buf) ) \(\backslash\)} \DoxyCodeLine{ goto out; \(\backslash\)} \DoxyCodeLine{ \} \textcolor{keywordflow}{while} (0)} \end{DoxyCode} \doxysubsection{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}} \doxysubsubsection{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 \textbf{ m3ua\+\_\+to\+\_\+xfer\+\_\+ind()}, \textbf{ xua\+\_\+msg\+::mtp}, \textbf{ osmo\+\_\+mtp\+\_\+prim\+::oph}, \textbf{ osmo\+\_\+ss7\+\_\+user\+::prim\+\_\+cb}, \textbf{ osmo\+\_\+ss7\+\_\+user\+::priv}, \textbf{ osmo\+\_\+mtp\+\_\+prim\+::transfer}, and \textbf{ osmo\+\_\+mtp\+\_\+prim\+::u}. Referenced by \textbf{ 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}} \doxysubsubsection{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 \textbf{ data\+\_\+hdr\+\_\+from\+\_\+m3ua()}, \textbf{ deliver\+\_\+to\+\_\+mtp\+\_\+user()}, \textbf{ xua\+\_\+msg\+::hdr}, \textbf{ osmo\+\_\+ss7\+\_\+user\+::inst}, \textbf{ M3\+UA\+\_\+\+MSGC\+\_\+\+SNM}, \textbf{ M3\+UA\+\_\+\+MSGC\+\_\+\+XFER}, \textbf{ M3\+UA\+\_\+\+XFER\+\_\+\+DATA}, \textbf{ xua\+\_\+common\+\_\+hdr\+::msg\+\_\+class}, \textbf{ xua\+\_\+common\+\_\+hdr\+::msg\+\_\+type}, \textbf{ m3ua\+\_\+data\+\_\+hdr\+::si}, and \textbf{ osmo\+\_\+ss7\+\_\+instance\+::user}. Referenced by \textbf{ 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}} \doxysubsubsection{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 \textbf{ osmo\+\_\+ss7\+\_\+route\+::as}, \textbf{ osmo\+\_\+ss7\+\_\+as\+::cfg}, \textbf{ osmo\+\_\+ss7\+\_\+as\+::ctrg}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::dest}, \textbf{ osmo\+\_\+mtp\+\_\+transfer\+\_\+param\+::dpc}, \textbf{ dpc}, \textbf{ osmo\+\_\+ss7\+\_\+as\+::inst}, \textbf{ ipa\+\_\+tx\+\_\+xua\+\_\+as()}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::linkset}, \textbf{ m3ua\+\_\+tx\+\_\+xua\+\_\+as()}, \textbf{ xua\+\_\+msg\+::mtp}, \textbf{ osmo\+\_\+ss7\+\_\+as\+::name}, \textbf{ osmo\+\_\+ss7\+\_\+as\+\_\+down()}, \textbf{ OSMO\+\_\+\+SS7\+\_\+\+ASP\+\_\+\+PROT\+\_\+\+IPA}, \textbf{ OSMO\+\_\+\+SS7\+\_\+\+ASP\+\_\+\+PROT\+\_\+\+M3\+UA}, \textbf{ osmo\+\_\+ss7\+\_\+pointcode\+\_\+print()}, \textbf{ osmo\+\_\+ss7\+\_\+route\+\_\+lookup()}, \textbf{ osmo\+\_\+ss7\+\_\+route\+\_\+name()}, \textbf{ osmo\+\_\+ss7\+\_\+as\+::proto}, and \textbf{ SS7\+\_\+\+AS\+\_\+\+CTR\+\_\+\+TX\+\_\+\+MSU\+\_\+\+TOTAL}. Referenced by \textbf{ 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}} \doxysubsubsection{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 \textbf{ osmo\+\_\+mtp\+\_\+transfer\+\_\+param\+::dpc}, \textbf{ dpc}, \textbf{ hmdt\+\_\+message\+\_\+for\+\_\+distribution()}, \textbf{ hmrt\+\_\+message\+\_\+for\+\_\+routing()}, \textbf{ osmo\+\_\+ss7\+\_\+as\+::inst}, \textbf{ xua\+\_\+msg\+::mtp}, \textbf{ osmo\+\_\+ss7\+\_\+pc\+\_\+is\+\_\+local()}, and \textbf{ osmo\+\_\+ss7\+\_\+pointcode\+\_\+print()}. Referenced by \textbf{ ipa\+\_\+rx\+\_\+msg\+\_\+sccp()}, \textbf{ m3ua\+\_\+rx\+\_\+xfer()}, and \textbf{ osmo\+\_\+ss7\+\_\+user\+\_\+mtp\+\_\+xfer\+\_\+req()}. \mbox{\label{osmo__ss7__hmrt_8c_a24f194897e3f4c4afcb473a08c65b5a3}} \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}} \doxysubsubsection{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 \textbf{ xua\+\_\+msg\+\_\+part\+::dat}, \textbf{ xua\+\_\+msg\+\_\+part\+::len}, \textbf{ m3ua\+\_\+dh\+\_\+to\+\_\+xfer\+\_\+param()}, \textbf{ M3\+UA\+\_\+\+IEI\+\_\+\+PROT\+\_\+\+DATA}, \textbf{ m3ua\+\_\+msgb\+\_\+alloc()}, \textbf{ MTP\+\_\+\+SAP\+\_\+\+USER}, \textbf{ osmo\+\_\+mtp\+\_\+prim\+::oph}, \textbf{ OSMO\+\_\+\+MTP\+\_\+\+PRIM\+\_\+\+TRANSFER}, \textbf{ osmo\+\_\+mtp\+\_\+prim\+::transfer}, \textbf{ osmo\+\_\+mtp\+\_\+prim\+::u}, and \textbf{ xua\+\_\+msg\+\_\+find\+\_\+tag()}. Referenced by \textbf{ deliver\+\_\+to\+\_\+mtp\+\_\+user()}. \mbox{\label{osmo__ss7__hmrt_8c_ad6c17cf3ab5e476f72b42abb6329f257}} \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}} \doxysubsubsection{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 \textbf{ m3ua\+\_\+xfer\+\_\+from\+\_\+data()}, \textbf{ mtp\+\_\+xfer\+\_\+param\+\_\+to\+\_\+m3ua\+\_\+dh()}, \textbf{ osmo\+\_\+mtp\+\_\+prim\+::oph}, \textbf{ osmo\+\_\+mtp\+\_\+prim\+::transfer}, and \textbf{ osmo\+\_\+mtp\+\_\+prim\+::u}. Referenced by \textbf{ osmo\+\_\+ss7\+\_\+user\+\_\+mtp\+\_\+xfer\+\_\+req()}. \mbox{\label{osmo__ss7__hmrt_8c_a286e2d2dfc24375cf83db56c67fe0ea2}} \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}} \doxysubsubsection{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_accae8bcfd3577b2fcae21c55d97be313} and \doxyref{osmo\+\_\+ss7\+\_\+pointcode\+\_\+print2()}{p.}{osmo__ss7_8h_a9c9283afabd1e1566f511e66698ea44d}, so pairing \doxyref{osmo\+\_\+ss7\+\_\+route\+\_\+name()}{p.}{osmo__ss7__hmrt_8c_a286e2d2dfc24375cf83db56c67fe0ea2} with \doxyref{osmo\+\_\+ss7\+\_\+pointcode\+\_\+print()}{p.}{osmo__ss7_8h_accae8bcfd3577b2fcae21c55d97be313} in the same printf statement is likely to conflict. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em rt} & The route information to print, or NULL. \\ \hline \mbox{\texttt{ in}} & {\em list\+\_\+asps} & If true, append info for all ASPs for the route\textquotesingle{}s AS. \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} A string constant or static buffer. \end{DoxyReturn} References \textbf{ APPEND}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::as}, \textbf{ osmo\+\_\+ss7\+\_\+as\+::asps}, \textbf{ osmo\+\_\+ss7\+\_\+as\+::cfg}, \textbf{ osmo\+\_\+ss7\+\_\+asp\+::cfg}, \textbf{ osmo\+\_\+ss7\+\_\+linkset\+::cfg}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::cfg}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::dest}, \textbf{ osmo\+\_\+ss7\+\_\+route\+\_\+table\+::inst}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::linkset}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::mask}, \textbf{ osmo\+\_\+ss7\+\_\+as\+::name}, \textbf{ osmo\+\_\+ss7\+\_\+asp\+::name}, \textbf{ osmo\+\_\+ss7\+\_\+linkset\+::name}, \textbf{ osmo\+\_\+ss7\+\_\+asp\+\_\+protocol\+\_\+name()}, \textbf{ osmo\+\_\+ss7\+\_\+pointcode\+\_\+print()}, \textbf{ osmo\+\_\+ss7\+\_\+pointcode\+\_\+print2()}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::pc}, \textbf{ osmo\+\_\+ss7\+\_\+as\+::proto}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::rtable}, and \textbf{ osmo\+\_\+ss7\+\_\+asp\+::sock\+\_\+name}. Referenced by \textbf{ 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}} \doxysubsubsection{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 \textbf{ m3ua\+\_\+hmdc\+\_\+rx\+\_\+from\+\_\+l2()}, \textbf{ xua\+\_\+msg\+::mtp}, \textbf{ mtp\+\_\+prim\+\_\+to\+\_\+m3ua()}, \textbf{ MTP\+\_\+\+SAP\+\_\+\+USER}, \textbf{ osmo\+\_\+mtp\+\_\+prim\+::oph}, \textbf{ OSMO\+\_\+\+MTP\+\_\+\+PRIM\+\_\+\+TRANSFER}, \textbf{ osmo\+\_\+mtp\+\_\+prim\+::transfer}, \textbf{ osmo\+\_\+mtp\+\_\+prim\+::u}, and \textbf{ xua\+\_\+msg\+\_\+free()}. Referenced by \textbf{ sua2sccp\+\_\+tx\+\_\+m3ua()}.