\doxysection{src/ss7\+\_\+route.c File Reference}
\label{ss7__route_8c}\index{src/ss7\_route.c@{src/ss7\_route.c}}
{\ttfamily \#include $<$errno.\+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 \char`\"{}ss7\+\_\+combined\+\_\+linkset.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}ss7\+\_\+linkset.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}ss7\+\_\+as.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}ss7\+\_\+asp.\+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
\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \textbf{ APPEND}(fmt,  args ...)
\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ osmo\+\_\+ss7\+\_\+route} $\ast$ \textbf{ ss7\+\_\+route\+\_\+alloc} (struct \textbf{ osmo\+\_\+ss7\+\_\+route\+\_\+table} $\ast$rtbl, uint32\+\_\+t \textbf{ pc}, uint32\+\_\+t mask, bool dynamic)
\begin{DoxyCompactList}\small\item\em Allocate a route entry. \end{DoxyCompactList}\item 
static bool \textbf{ ss7\+\_\+route\+\_\+inserted} (const struct \textbf{ osmo\+\_\+ss7\+\_\+route} $\ast$rt)
\begin{DoxyCompactList}\small\item\em Check whether route has already been inserted into its routing table. \end{DoxyCompactList}\item 
int \textbf{ ss7\+\_\+route\+\_\+set\+\_\+linkset} (struct \textbf{ osmo\+\_\+ss7\+\_\+route} $\ast$rt, const char $\ast$linkset\+\_\+name)
\begin{DoxyCompactList}\small\item\em Set linkset on route entry. \end{DoxyCompactList}\item 
int \textbf{ ss7\+\_\+route\+\_\+insert} (struct \textbf{ osmo\+\_\+ss7\+\_\+route} $\ast$rt)
\begin{DoxyCompactList}\small\item\em Insert route into its routing table. \end{DoxyCompactList}\item 
struct \textbf{ osmo\+\_\+ss7\+\_\+route} $\ast$ \textbf{ ss7\+\_\+route\+\_\+create} (struct \textbf{ osmo\+\_\+ss7\+\_\+route\+\_\+table} $\ast$rtbl, uint32\+\_\+t \textbf{ pc}, uint32\+\_\+t mask, bool dynamic, const char $\ast$linkset\+\_\+name)
\begin{DoxyCompactList}\small\item\em Create a new route in the given routing table. \end{DoxyCompactList}\item 
void \textbf{ ss7\+\_\+route\+\_\+destroy} (struct \textbf{ osmo\+\_\+ss7\+\_\+route} $\ast$rt)
\begin{DoxyCompactList}\small\item\em Destroy a given SS7 route. \end{DoxyCompactList}\item 
static unsigned int \textbf{ count\+\_\+leading\+\_\+one\+\_\+bits} (uint32\+\_\+t inp, unsigned int nbits)
\item 
static int \textbf{ u32\+\_\+masklen} (uint32\+\_\+t mask, unsigned int nbits)
\item 
const char $\ast$ \textbf{ osmo\+\_\+ss7\+\_\+route\+\_\+print} (const struct \textbf{ osmo\+\_\+ss7\+\_\+route} $\ast$rt)
\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 
struct \textbf{ osmo\+\_\+ss7\+\_\+route} $\ast$ \textbf{ osmo\+\_\+ss7\+\_\+route\+\_\+lookup} (struct \textbf{ osmo\+\_\+ss7\+\_\+instance} $\ast$inst, uint32\+\_\+t \textbf{ dpc})
\begin{DoxyCompactList}\small\item\em Find a SS7 route for given destination point code in given SS7. \end{DoxyCompactList}\item 
struct \textbf{ osmo\+\_\+ss7\+\_\+as} $\ast$ \textbf{ osmo\+\_\+ss7\+\_\+route\+\_\+get\+\_\+dest\+\_\+as} (struct \textbf{ osmo\+\_\+ss7\+\_\+route} $\ast$rt)
\begin{DoxyCompactList}\small\item\em Get destination AS of route. \end{DoxyCompactList}\item 
bool \textbf{ ss7\+\_\+route\+\_\+is\+\_\+available} (const struct \textbf{ osmo\+\_\+ss7\+\_\+route} $\ast$rt)
\item 
bool \textbf{ ss7\+\_\+route\+\_\+dest\+\_\+is\+\_\+available} (const struct \textbf{ osmo\+\_\+ss7\+\_\+route} $\ast$rt)
\item 
bool \textbf{ ss7\+\_\+route\+\_\+is\+\_\+fully\+\_\+qualified} (const struct \textbf{ osmo\+\_\+ss7\+\_\+route} $\ast$rt)
\item 
void \textbf{ ss7\+\_\+route\+\_\+update\+\_\+route\+\_\+status} (struct \textbf{ osmo\+\_\+ss7\+\_\+route} $\ast$rt, enum \textbf{ osmo\+\_\+ss7\+\_\+route\+\_\+status} status)
\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
const struct value\+\_\+string \textbf{ ss7\+\_\+route\+\_\+status\+\_\+names} [$\,$]
\end{DoxyCompactItemize}


\doxysubsection{Macro Definition Documentation}
\mbox{\label{ss7__route_8c_a78d865d31aa82b7624caa11bfb02c913}} 
\index{ss7\_route.c@{ss7\_route.c}!APPEND@{APPEND}}
\index{APPEND@{APPEND}!ss7\_route.c@{ss7\_route.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{ss7__route_8c_a6f2fdcae0d3e5278f51ab44f674ab0eb}} 
\index{ss7\_route.c@{ss7\_route.c}!count\_leading\_one\_bits@{count\_leading\_one\_bits}}
\index{count\_leading\_one\_bits@{count\_leading\_one\_bits}!ss7\_route.c@{ss7\_route.c}}
\doxysubsubsection{count\_leading\_one\_bits()}
{\footnotesize\ttfamily static unsigned int count\+\_\+leading\+\_\+one\+\_\+bits (\begin{DoxyParamCaption}\item[{uint32\+\_\+t}]{inp,  }\item[{unsigned int}]{nbits }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Referenced by \textbf{ u32\+\_\+masklen()}.

\mbox{\label{ss7__route_8c_a00d4eeed253f86917689dd72043aaba7}} 
\index{ss7\_route.c@{ss7\_route.c}!osmo\_ss7\_route\_get\_dest\_as@{osmo\_ss7\_route\_get\_dest\_as}}
\index{osmo\_ss7\_route\_get\_dest\_as@{osmo\_ss7\_route\_get\_dest\_as}!ss7\_route.c@{ss7\_route.c}}
\doxysubsubsection{osmo\_ss7\_route\_get\_dest\_as()}
{\footnotesize\ttfamily struct \textbf{ osmo\+\_\+ss7\+\_\+as} $\ast$ osmo\+\_\+ss7\+\_\+route\+\_\+get\+\_\+dest\+\_\+as (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+ss7\+\_\+route} $\ast$}]{rt }\end{DoxyParamCaption})}



Get destination AS of route. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em rt} & Route entry holding the AS destination \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
pointer to Application Server on success; NULL if rt doesn\textquotesingle{}t route to an AS (i.\+e. routes to a linkset). 
\end{DoxyReturn}


References \textbf{ osmo\+\_\+ss7\+\_\+route\+::as}, and \textbf{ osmo\+\_\+ss7\+\_\+route\+::dest}.

\mbox{\label{ss7__route_8c_a75a8cf8f7186081400da51a00106e8da}} 
\index{ss7\_route.c@{ss7\_route.c}!osmo\_ss7\_route\_lookup@{osmo\_ss7\_route\_lookup}}
\index{osmo\_ss7\_route\_lookup@{osmo\_ss7\_route\_lookup}!ss7\_route.c@{ss7\_route.c}}
\doxysubsubsection{osmo\_ss7\_route\_lookup()}
{\footnotesize\ttfamily struct \textbf{ osmo\+\_\+ss7\+\_\+route} $\ast$ osmo\+\_\+ss7\+\_\+route\+\_\+lookup (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+ss7\+\_\+instance} $\ast$}]{inst,  }\item[{uint32\+\_\+t}]{dpc }\end{DoxyParamCaption})}



Find a SS7 route for given destination point code in given SS7. 

NOTE\+: DEPRECATED, use \doxyref{ss7\+\_\+instance\+\_\+lookup\+\_\+route()}{p.}{ss7__instance_8c_a154eb42c95d9d897d8abeb337c9200eb} instead 

References \textbf{ dpc}, \textbf{ osmo\+\_\+ss7\+\_\+route\+\_\+label\+::opc}, \textbf{ ss7\+\_\+initialized}, and \textbf{ ss7\+\_\+instance\+\_\+lookup\+\_\+route()}.

\mbox{\label{ss7__route_8c_a286e2d2dfc24375cf83db56c67fe0ea2}} 
\index{ss7\_route.c@{ss7\_route.c}!osmo\_ss7\_route\_name@{osmo\_ss7\_route\_name}}
\index{osmo\_ss7\_route\_name@{osmo\_ss7\_route\_name}!ss7\_route.c@{ss7\_route.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.}{ss7__route_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{ ss7\+\_\+as\+\_\+asp\+\_\+assoc\+::as}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::as}, \textbf{ ss7\+\_\+as\+\_\+asp\+\_\+assoc\+::as\+\_\+entry}, \textbf{ ss7\+\_\+as\+\_\+asp\+\_\+assoc\+::asp}, \textbf{ osmo\+\_\+ss7\+\_\+as\+::assoc\+\_\+asp\+\_\+list}, \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\+::dyn\+\_\+allocated}, \textbf{ osmo\+\_\+ss7\+\_\+route\+\_\+table\+::inst}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::linkset}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::mask}, \textbf{ MAX\+\_\+\+PC\+\_\+\+STR\+\_\+\+LEN}, \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\+\_\+buf()}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::pc}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::priority}, \textbf{ osmo\+\_\+ss7\+\_\+as\+::proto}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::rtable}, and \textbf{ osmo\+\_\+ss7\+\_\+asp\+::sock\+\_\+name}.



Referenced by \textbf{ DEFUN()}, \textbf{ mtp3\+\_\+hmrt\+\_\+message\+\_\+for\+\_\+routing()}, \textbf{ ss7\+\_\+route\+\_\+destroy()}, and \textbf{ ss7\+\_\+route\+\_\+set\+\_\+linkset()}.

\mbox{\label{ss7__route_8c_a57312ff6631501f256d1108b89ebf71a}} 
\index{ss7\_route.c@{ss7\_route.c}!osmo\_ss7\_route\_print@{osmo\_ss7\_route\_print}}
\index{osmo\_ss7\_route\_print@{osmo\_ss7\_route\_print}!ss7\_route.c@{ss7\_route.c}}
\doxysubsubsection{osmo\_ss7\_route\_print()}
{\footnotesize\ttfamily const char $\ast$ osmo\+\_\+ss7\+\_\+route\+\_\+print (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+ss7\+\_\+route} $\ast$}]{rt }\end{DoxyParamCaption})}



References \textbf{ osmo\+\_\+ss7\+\_\+instance\+::cfg}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::cfg}, \textbf{ osmo\+\_\+ss7\+\_\+route\+\_\+table\+::inst}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::mask}, \textbf{ MAX\+\_\+\+PC\+\_\+\+STR\+\_\+\+LEN}, \textbf{ osmo\+\_\+ss7\+\_\+pc\+\_\+width()}, \textbf{ osmo\+\_\+ss7\+\_\+pointcode\+\_\+print\+\_\+buf()}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::pc}, \textbf{ osmo\+\_\+ss7\+\_\+instance\+::pc\+\_\+fmt}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::rtable}, and \textbf{ u32\+\_\+masklen()}.



Referenced by \textbf{ vty\+\_\+dump\+\_\+rtable()}.

\mbox{\label{ss7__route_8c_a45861dcd35546b9e984494d449bef6c7}} 
\index{ss7\_route.c@{ss7\_route.c}!ss7\_route\_alloc@{ss7\_route\_alloc}}
\index{ss7\_route\_alloc@{ss7\_route\_alloc}!ss7\_route.c@{ss7\_route.c}}
\doxysubsubsection{ss7\_route\_alloc()}
{\footnotesize\ttfamily struct \textbf{ osmo\+\_\+ss7\+\_\+route} $\ast$ ss7\+\_\+route\+\_\+alloc (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+ss7\+\_\+route\+\_\+table} $\ast$}]{rtbl,  }\item[{uint32\+\_\+t}]{pc,  }\item[{uint32\+\_\+t}]{mask,  }\item[{bool}]{dynamic }\end{DoxyParamCaption})}



Allocate a route entry. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em rtbl} & Routing Table where the route belongs \\
\hline
\mbox{\texttt{ in}}  & {\em pc} & Point Code of the destination of the route \\
\hline
\mbox{\texttt{ in}}  & {\em mask} & Mask of the destination Point Code \doxyref{pc}{p.}{tcap__as__loadshare_8c_afaa20335217fae16f0e22b466017dae1} \\
\hline
\mbox{\texttt{ in}}  & {\em dynamic} & Whether the route is dynamic \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Allocated route (not yet inserted into its rtbl), NULL on error
\end{DoxyReturn}
The returned route has no linkset associated yet, user {\itshape must} associate it using API \doxyref{ss7\+\_\+route\+\_\+set\+\_\+linkset()}{p.}{ss7__route_8c_a46ccd2320c3e917d0e9bef6b90e78601} before inserting the route into its routing table.

Fields priority and qos\+\_\+class may be set {\itshape before} inserting the route into its routing table\+:
\begin{DoxyItemize}
\item A default priority of 0 is configured on the route.
\item A default qos-\/class of 0 is configured on the route.
\end{DoxyItemize}

Use API \doxyref{ss7\+\_\+route\+\_\+insert()}{p.}{ss7__route_8c_acf75f3605c463d7c4cef4e73257194ab} to insert the route into its routing table.

The route entry allocated with this API can be destroyed/freed at any point using API \doxyref{ss7\+\_\+route\+\_\+destroy()}{p.}{ss7__route_8c_a6ce127d1c6de224f5a6297f68fba4cfc}, regardless of it being already inserted or not in its routing table.

Dynamic routes are not configured by the user (VTY), and hence cannot be removed by the user. Dynamic routes are not stored in the config and hence they don\textquotesingle{}t show up in eg \char`\"{}show running-\/config\char`\"{}; they can be listed using specific VTY commands like \char`\"{}show cs7 instance 0 route\char`\"{}. 

References \textbf{ osmo\+\_\+ss7\+\_\+instance\+::cfg}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::cfg}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::dyn\+\_\+allocated}, \textbf{ osmo\+\_\+ss7\+\_\+route\+\_\+table\+::inst}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::list}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::mask}, \textbf{ NULL}, \textbf{ osmo\+\_\+ss7\+\_\+pc\+\_\+normalize()}, \textbf{ OSMO\+\_\+\+SS7\+\_\+\+ROUTE\+\_\+\+PRIO\+\_\+\+DEFAULT}, \textbf{ OSMO\+\_\+\+SS7\+\_\+\+ROUTE\+\_\+\+STATUS\+\_\+\+AVAILABLE}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::pc}, \textbf{ pc}, \textbf{ osmo\+\_\+ss7\+\_\+instance\+::pc\+\_\+fmt}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::priority}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::rtable}, \textbf{ ss7\+\_\+initialized}, and \textbf{ osmo\+\_\+ss7\+\_\+route\+::status}.



Referenced by \textbf{ DEFUN\+\_\+\+ATTR()}, and \textbf{ ss7\+\_\+route\+\_\+create()}.

\mbox{\label{ss7__route_8c_a732f49b2633b9c90ba5324e6019e43fb}} 
\index{ss7\_route.c@{ss7\_route.c}!ss7\_route\_create@{ss7\_route\_create}}
\index{ss7\_route\_create@{ss7\_route\_create}!ss7\_route.c@{ss7\_route.c}}
\doxysubsubsection{ss7\_route\_create()}
{\footnotesize\ttfamily struct \textbf{ osmo\+\_\+ss7\+\_\+route} $\ast$ ss7\+\_\+route\+\_\+create (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+ss7\+\_\+route\+\_\+table} $\ast$}]{rtbl,  }\item[{uint32\+\_\+t}]{pc,  }\item[{uint32\+\_\+t}]{mask,  }\item[{bool}]{dynamic,  }\item[{const char $\ast$}]{linkset\+\_\+name }\end{DoxyParamCaption})}



Create a new route in the given routing table. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em rtbl} & Routing Table in which the route is to be created \\
\hline
\mbox{\texttt{ in}}  & {\em pc} & Point Code of the destination of the route \\
\hline
\mbox{\texttt{ in}}  & {\em mask} & Mask of the destination Point Code \doxyref{pc}{p.}{tcap__as__loadshare_8c_afaa20335217fae16f0e22b466017dae1} \\
\hline
\mbox{\texttt{ in}}  & {\em dynamic} & Whether the route is dynamic \\
\hline
\mbox{\texttt{ in}}  & {\em linkset\+\_\+name} & string name of the linkset to be used \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
callee-\/allocated + initialized route, NULL on error
\end{DoxyReturn}
The route allocated and returned by this API is already inserted into the routing table, with priority and qos-\/class set to 0. If you plan to use different values for priority and qos-\/class, avoid using this API and use \doxyref{ss7\+\_\+route\+\_\+alloc()}{p.}{ss7__route_8c_a45861dcd35546b9e984494d449bef6c7} + \doxyref{ss7\+\_\+route\+\_\+set\+\_\+linkset()}{p.}{ss7__route_8c_a46ccd2320c3e917d0e9bef6b90e78601} + \doxyref{ss7\+\_\+route\+\_\+insert()}{p.}{ss7__route_8c_acf75f3605c463d7c4cef4e73257194ab} instead. 

References \textbf{ osmo\+\_\+ss7\+\_\+route\+::linkset\+\_\+name}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::mask}, \textbf{ NULL}, \textbf{ pc}, \textbf{ ss7\+\_\+route\+\_\+alloc()}, \textbf{ ss7\+\_\+route\+\_\+insert()}, \textbf{ ss7\+\_\+route\+\_\+set\+\_\+linkset()}, and \textbf{ ss7\+\_\+route\+\_\+table\+\_\+find\+\_\+route\+\_\+by\+\_\+dpc\+\_\+mask()}.



Referenced by \textbf{ handle\+\_\+rkey\+\_\+reg()}, \textbf{ osmo\+\_\+sccp\+\_\+simple\+\_\+client\+\_\+on\+\_\+ss7\+\_\+id()}, \textbf{ osmo\+\_\+sccp\+\_\+simple\+\_\+server\+\_\+add\+\_\+clnt()}, and \textbf{ xua\+\_\+snm\+\_\+srm\+\_\+pc\+\_\+available\+\_\+single()}.

\mbox{\label{ss7__route_8c_afe8797bdb0452bb1227f190f3132a8e6}} 
\index{ss7\_route.c@{ss7\_route.c}!ss7\_route\_dest\_is\_available@{ss7\_route\_dest\_is\_available}}
\index{ss7\_route\_dest\_is\_available@{ss7\_route\_dest\_is\_available}!ss7\_route.c@{ss7\_route.c}}
\doxysubsubsection{ss7\_route\_dest\_is\_available()}
{\footnotesize\ttfamily bool ss7\+\_\+route\+\_\+dest\+\_\+is\+\_\+available (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+ss7\+\_\+route} $\ast$}]{rt }\end{DoxyParamCaption})}



References \textbf{ osmo\+\_\+ss7\+\_\+route\+::as}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::dest}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::linkset}, \textbf{ osmo\+\_\+ss7\+\_\+as\+\_\+active()}, and \textbf{ ss7\+\_\+linkset\+\_\+is\+\_\+available()}.



Referenced by \textbf{ ss7\+\_\+route\+\_\+is\+\_\+available()}, and \textbf{ vty\+\_\+dump\+\_\+rtable()}.

\mbox{\label{ss7__route_8c_a6ce127d1c6de224f5a6297f68fba4cfc}} 
\index{ss7\_route.c@{ss7\_route.c}!ss7\_route\_destroy@{ss7\_route\_destroy}}
\index{ss7\_route\_destroy@{ss7\_route\_destroy}!ss7\_route.c@{ss7\_route.c}}
\doxysubsubsection{ss7\_route\_destroy()}
{\footnotesize\ttfamily void ss7\+\_\+route\+\_\+destroy (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+ss7\+\_\+route} $\ast$}]{rt }\end{DoxyParamCaption})}



Destroy a given SS7 route. 



References \textbf{ LOGPRT}, \textbf{ osmo\+\_\+ss7\+\_\+route\+\_\+name()}, \textbf{ ss7\+\_\+combined\+\_\+linkset\+\_\+del\+\_\+route()}, \textbf{ ss7\+\_\+initialized}, and \textbf{ ss7\+\_\+route\+\_\+inserted()}.



Referenced by \textbf{ DEFUN\+\_\+\+ATTR()}, \textbf{ handle\+\_\+rkey\+\_\+dereg()}, \textbf{ osmo\+\_\+sccp\+\_\+simple\+\_\+client\+\_\+on\+\_\+ss7\+\_\+id()}, \textbf{ osmo\+\_\+sccp\+\_\+simple\+\_\+server\+\_\+add\+\_\+clnt()}, \textbf{ ss7\+\_\+route\+\_\+table\+\_\+del\+\_\+routes\+\_\+by\+\_\+as()}, and \textbf{ ss7\+\_\+route\+\_\+table\+\_\+del\+\_\+routes\+\_\+by\+\_\+linkset()}.

\mbox{\label{ss7__route_8c_acf75f3605c463d7c4cef4e73257194ab}} 
\index{ss7\_route.c@{ss7\_route.c}!ss7\_route\_insert@{ss7\_route\_insert}}
\index{ss7\_route\_insert@{ss7\_route\_insert}!ss7\_route.c@{ss7\_route.c}}
\doxysubsubsection{ss7\_route\_insert()}
{\footnotesize\ttfamily int ss7\+\_\+route\+\_\+insert (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+ss7\+\_\+route} $\ast$}]{rt }\end{DoxyParamCaption})}



Insert route into its routing table. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em rt} & Route to be inserted into its routing table \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, negative on error
\end{DoxyReturn}
A route is only really used once it has been inserted into its routing table. 

References \textbf{ osmo\+\_\+ss7\+\_\+route\+::cfg}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::clset}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::dyn\+\_\+allocated}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::linkset\+\_\+name}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::list}, \textbf{ LOGPRT}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::mask}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::pc}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::priority}, \textbf{ osmo\+\_\+ss7\+\_\+combined\+\_\+linkset\+::routes}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::rtable}, \textbf{ ss7\+\_\+combined\+\_\+linkset\+\_\+add\+\_\+route()}, \textbf{ ss7\+\_\+combined\+\_\+linkset\+\_\+alloc()}, \textbf{ ss7\+\_\+route\+\_\+inserted()}, and \textbf{ ss7\+\_\+route\+\_\+table\+\_\+find\+\_\+combined\+\_\+linkset()}.



Referenced by \textbf{ DEFUN\+\_\+\+ATTR()}, and \textbf{ ss7\+\_\+route\+\_\+create()}.

\mbox{\label{ss7__route_8c_a0f69f1d1840acfa1f107e2d289289d9b}} 
\index{ss7\_route.c@{ss7\_route.c}!ss7\_route\_inserted@{ss7\_route\_inserted}}
\index{ss7\_route\_inserted@{ss7\_route\_inserted}!ss7\_route.c@{ss7\_route.c}}
\doxysubsubsection{ss7\_route\_inserted()}
{\footnotesize\ttfamily static bool ss7\+\_\+route\+\_\+inserted (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+ss7\+\_\+route} $\ast$}]{rt }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Check whether route has already been inserted into its routing table. 

\begin{DoxyReturn}{Returns}
true if already inserted, false if not. 
\end{DoxyReturn}


References \textbf{ osmo\+\_\+ss7\+\_\+route\+::list}.



Referenced by \textbf{ ss7\+\_\+route\+\_\+destroy()}, \textbf{ ss7\+\_\+route\+\_\+insert()}, and \textbf{ ss7\+\_\+route\+\_\+set\+\_\+linkset()}.

\mbox{\label{ss7__route_8c_adea2871496432ff17d7e980d0011e952}} 
\index{ss7\_route.c@{ss7\_route.c}!ss7\_route\_is\_available@{ss7\_route\_is\_available}}
\index{ss7\_route\_is\_available@{ss7\_route\_is\_available}!ss7\_route.c@{ss7\_route.c}}
\doxysubsubsection{ss7\_route\_is\_available()}
{\footnotesize\ttfamily bool ss7\+\_\+route\+\_\+is\+\_\+available (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+ss7\+\_\+route} $\ast$}]{rt }\end{DoxyParamCaption})}



References \textbf{ OSMO\+\_\+\+SS7\+\_\+\+ROUTE\+\_\+\+STATUS\+\_\+\+AVAILABLE}, \textbf{ ss7\+\_\+route\+\_\+dest\+\_\+is\+\_\+available()}, and \textbf{ osmo\+\_\+ss7\+\_\+route\+::status}.



Referenced by \textbf{ current\+\_\+rt()}, \textbf{ DEFUN()}, \textbf{ ss7\+\_\+combined\+\_\+linkset\+\_\+is\+\_\+available()}, \textbf{ ss7\+\_\+combined\+\_\+linkset\+\_\+lookup\+\_\+route()}, \textbf{ ss7\+\_\+combined\+\_\+linkset\+\_\+select\+\_\+route\+\_\+roundrobin()}, \textbf{ ss7\+\_\+route\+\_\+table\+\_\+dpc\+\_\+is\+\_\+accessible\+\_\+skip\+\_\+as()}, and \textbf{ ss7\+\_\+route\+\_\+table\+\_\+dpc\+\_\+is\+\_\+accessible\+\_\+via\+\_\+as()}.

\mbox{\label{ss7__route_8c_a5a34ccb548bee6b07328d9c0daec8f81}} 
\index{ss7\_route.c@{ss7\_route.c}!ss7\_route\_is\_fully\_qualified@{ss7\_route\_is\_fully\_qualified}}
\index{ss7\_route\_is\_fully\_qualified@{ss7\_route\_is\_fully\_qualified}!ss7\_route.c@{ss7\_route.c}}
\doxysubsubsection{ss7\_route\_is\_fully\_qualified()}
{\footnotesize\ttfamily bool ss7\+\_\+route\+\_\+is\+\_\+fully\+\_\+qualified (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+ss7\+\_\+route} $\ast$}]{rt }\end{DoxyParamCaption})}



References \textbf{ osmo\+\_\+ss7\+\_\+instance\+::cfg}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::cfg}, \textbf{ osmo\+\_\+ss7\+\_\+route\+\_\+table\+::inst}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::mask}, \textbf{ osmo\+\_\+ss7\+\_\+instance\+::pc\+\_\+fmt}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::rtable}, and \textbf{ ss7\+\_\+pc\+\_\+full\+\_\+mask()}.



Referenced by \textbf{ ss7\+\_\+route\+\_\+is\+\_\+summary()}.

\mbox{\label{ss7__route_8c_a46ccd2320c3e917d0e9bef6b90e78601}} 
\index{ss7\_route.c@{ss7\_route.c}!ss7\_route\_set\_linkset@{ss7\_route\_set\_linkset}}
\index{ss7\_route\_set\_linkset@{ss7\_route\_set\_linkset}!ss7\_route.c@{ss7\_route.c}}
\doxysubsubsection{ss7\_route\_set\_linkset()}
{\footnotesize\ttfamily int ss7\+\_\+route\+\_\+set\+\_\+linkset (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+ss7\+\_\+route} $\ast$}]{rt,  }\item[{const char $\ast$}]{linkset\+\_\+name }\end{DoxyParamCaption})}



Set linkset on route entry. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em rt} & Route to be configured \\
\hline
\mbox{\texttt{ in}}  & {\em linkset\+\_\+name} & string name of the linkset to be used \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, negative on error. 
\end{DoxyReturn}


References \textbf{ osmo\+\_\+ss7\+\_\+route\+::as}, \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\+::linkset\+\_\+name}, \textbf{ LOGPRT}, \textbf{ NULL}, \textbf{ osmo\+\_\+ss7\+\_\+as\+\_\+find\+\_\+by\+\_\+name()}, \textbf{ osmo\+\_\+ss7\+\_\+route\+\_\+name()}, \textbf{ osmo\+\_\+ss7\+\_\+route\+::rtable}, \textbf{ ss7\+\_\+linkset\+\_\+find\+\_\+by\+\_\+name()}, and \textbf{ ss7\+\_\+route\+\_\+inserted()}.



Referenced by \textbf{ DEFUN\+\_\+\+ATTR()}, and \textbf{ ss7\+\_\+route\+\_\+create()}.

\mbox{\label{ss7__route_8c_ab65be259b79426bd174e0a0638c80be0}} 
\index{ss7\_route.c@{ss7\_route.c}!ss7\_route\_update\_route\_status@{ss7\_route\_update\_route\_status}}
\index{ss7\_route\_update\_route\_status@{ss7\_route\_update\_route\_status}!ss7\_route.c@{ss7\_route.c}}
\doxysubsubsection{ss7\_route\_update\_route\_status()}
{\footnotesize\ttfamily void ss7\+\_\+route\+\_\+update\+\_\+route\+\_\+status (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+ss7\+\_\+route} $\ast$}]{rt,  }\item[{enum \textbf{ osmo\+\_\+ss7\+\_\+route\+\_\+status}}]{status }\end{DoxyParamCaption})}



References \textbf{ LOGPRT}, \textbf{ ss7\+\_\+route\+\_\+status\+\_\+name()}, and \textbf{ osmo\+\_\+ss7\+\_\+route\+::status}.



Referenced by \textbf{ ss7\+\_\+route\+\_\+table\+\_\+update\+\_\+route\+\_\+status\+\_\+by\+\_\+as()}, and \textbf{ xua\+\_\+snm\+\_\+srm\+\_\+pc\+\_\+available\+\_\+single()}.

\mbox{\label{ss7__route_8c_a70c376cdc3ffe5d124ae90fd86f9c491}} 
\index{ss7\_route.c@{ss7\_route.c}!u32\_masklen@{u32\_masklen}}
\index{u32\_masklen@{u32\_masklen}!ss7\_route.c@{ss7\_route.c}}
\doxysubsubsection{u32\_masklen()}
{\footnotesize\ttfamily static int u32\+\_\+masklen (\begin{DoxyParamCaption}\item[{uint32\+\_\+t}]{mask,  }\item[{unsigned int}]{nbits }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ count\+\_\+leading\+\_\+one\+\_\+bits()}, and \textbf{ osmo\+\_\+ss7\+\_\+route\+::mask}.



Referenced by \textbf{ osmo\+\_\+ss7\+\_\+route\+\_\+print()}.



\doxysubsection{Variable Documentation}
\mbox{\label{ss7__route_8c_a56393b318d5954b30e21a540c407886a}} 
\index{ss7\_route.c@{ss7\_route.c}!ss7\_route\_status\_names@{ss7\_route\_status\_names}}
\index{ss7\_route\_status\_names@{ss7\_route\_status\_names}!ss7\_route.c@{ss7\_route.c}}
\doxysubsubsection{ss7\_route\_status\_names}
{\footnotesize\ttfamily const struct value\+\_\+string ss7\+\_\+route\+\_\+status\+\_\+names[$\,$]}

{\bfseries Initial value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{= \{}
\DoxyCodeLine{        \{ OSMO\_SS7\_ROUTE\_STATUS\_UNAVAILABLE, \textcolor{stringliteral}{"{}unavailable"{}} \},}
\DoxyCodeLine{        \{ OSMO\_SS7\_ROUTE\_STATUS\_AVAILABLE, \textcolor{stringliteral}{"{}available"{}} \},}
\DoxyCodeLine{        \{ OSMO\_SS7\_ROUTE\_STATUS\_RESTRICTED, \textcolor{stringliteral}{"{}restricted"{}} \},}
\DoxyCodeLine{        \{\}}
\DoxyCodeLine{\}}

\end{DoxyCode}


Referenced by \textbf{ ss7\+\_\+route\+\_\+status\+\_\+name()}.

