\doxysection{ss7\+\_\+combined\+\_\+linkset.\+h}
\label{ss7__combined__linkset_8h_source}\index{src/ss7\_combined\_linkset.h@{src/ss7\_combined\_linkset.h}}
\textbf{ Go to the documentation of this file.}
\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{preprocessor}{\#pragma\ once}}
\DoxyCodeLine{00002\ }
\DoxyCodeLine{00003\ \textcolor{preprocessor}{\#include\ <stdint.h>}}
\DoxyCodeLine{00004\ \textcolor{preprocessor}{\#include\ <osmocom/core/linuxlist.h>}}
\DoxyCodeLine{00005\ }
\DoxyCodeLine{00006\ \textcolor{comment}{/***********************************************************************}}
\DoxyCodeLine{00007\ \textcolor{comment}{\ *\ SS7\ Combined\ Linkset}}
\DoxyCodeLine{00008\ \textcolor{comment}{\ *\ Set\ of\ routes\ with\ same\ destination\ and\ priority.}}
\DoxyCodeLine{00009\ \textcolor{comment}{\ ***********************************************************************/}}
\DoxyCodeLine{00010\ }
\DoxyCodeLine{00011\ \textcolor{keyword}{struct\ }osmo\_ss7\_instance;}
\DoxyCodeLine{00012\ \textcolor{keyword}{struct\ }osmo\_ss7\_link;}
\DoxyCodeLine{00013\ \textcolor{keyword}{struct\ }osmo\_ss7\_route\_label;}
\DoxyCodeLine{00014\ }
\DoxyCodeLine{00015\ \textcolor{preprocessor}{\#define\ NUM\_EXT\_SLS\ 128}}
\DoxyCodeLine{00016\ \textcolor{keyword}{typedef}\ uint8\_t\ ext\_sls\_t;\ \textcolor{comment}{/*\ range:\ 0-\/127,\ 7\ bit\ */}}
\DoxyCodeLine{00017\ }
\DoxyCodeLine{00018\ \textcolor{keyword}{struct\ }osmo\_ss7\_esls\_entry\ \{}
\DoxyCodeLine{00019\ \ \ \ \ \ \ \ \ \textcolor{comment}{/*\ ITU\ Q.704\ 4.2.1:\ "{}normal\ link\ set\ (combined\ link\ set)"{}\ */}}
\DoxyCodeLine{00020\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }osmo\_ss7\_route\ *normal\_rt;}
\DoxyCodeLine{00021\ \ \ \ \ \ \ \ \ \textcolor{comment}{/*\ ITU\ Q.704\ 4.2.1:\ "{}alternative\ link\ set\ (combined\ link\ set)"{}\ */}}
\DoxyCodeLine{00022\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }osmo\_ss7\_route\ *alt\_rt;}
\DoxyCodeLine{00023\ \};}
\DoxyCodeLine{00024\ }
\DoxyCodeLine{00025\ \textcolor{keyword}{struct\ }osmo\_ss7\_combined\_linkset\ \{}
\DoxyCodeLine{00027\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }llist\_head\ list;}
\DoxyCodeLine{00028\ }
\DoxyCodeLine{00030\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }osmo\_ss7\_route\_table\ *rtable;}
\DoxyCodeLine{00031\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }osmo\_ss7\_esls\_entry\ esls\_table[NUM\_EXT\_SLS];}
\DoxyCodeLine{00032\ }
\DoxyCodeLine{00034\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }llist\_head\ routes;}
\DoxyCodeLine{00035\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ num\_routes;}
\DoxyCodeLine{00036\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{void}\ *last\_route\_roundrobin\_ass;}
\DoxyCodeLine{00037\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{void}\ *last\_route\_roundrobin\_tx;}
\DoxyCodeLine{00038\ }
\DoxyCodeLine{00039\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }\{}
\DoxyCodeLine{00040\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ uint32\_t\ pc;}
\DoxyCodeLine{00041\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ uint32\_t\ mask;}
\DoxyCodeLine{00043\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ uint32\_t\ priority;}
\DoxyCodeLine{00044\ \ \ \ \ \ \ \ \ \}\ cfg;}
\DoxyCodeLine{00045\ \};}
\DoxyCodeLine{00046\ }
\DoxyCodeLine{00047\ \textcolor{keyword}{struct\ }osmo\_ss7\_combined\_linkset\ *}
\DoxyCodeLine{00048\ ss7\_combined\_linkset\_alloc(\textcolor{keyword}{struct}\ osmo\_ss7\_route\_table\ *rtbl,\ uint32\_t\ pc,\ uint32\_t\ mask,\ uint32\_t\ prio);}
\DoxyCodeLine{00049\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{00050\ ss7\_combined\_linkset\_free(\textcolor{keyword}{struct}\ osmo\_ss7\_combined\_linkset\ *clset);}
\DoxyCodeLine{00051\ \textcolor{keyword}{struct\ }osmo\_ss7\_linkset\ *}
\DoxyCodeLine{00052\ ss7\_combined\_linkset\_find\_or\_create(\textcolor{keyword}{struct}\ osmo\_ss7\_route\_table\ *rtbl,\ uint32\_t\ pc,\ uint32\_t\ mask,\ uint32\_t\ prio);}
\DoxyCodeLine{00053\ }
\DoxyCodeLine{00054\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{00055\ ss7\_combined\_linkset\_add\_route(\textcolor{keyword}{struct}\ osmo\_ss7\_combined\_linkset\ *clset,\ \textcolor{keyword}{struct}\ osmo\_ss7\_route\ *rt);}
\DoxyCodeLine{00056\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{00057\ ss7\_combined\_linkset\_del\_route(\textcolor{keyword}{struct}\ osmo\_ss7\_route\ *rt);}
\DoxyCodeLine{00058\ \textcolor{keyword}{struct\ }osmo\_ss7\_route\ *}
\DoxyCodeLine{00059\ ss7\_combined\_linkset\_lookup\_route(\textcolor{keyword}{struct}\ osmo\_ss7\_combined\_linkset\ *clset,\ \textcolor{keyword}{const}\ \textcolor{keyword}{struct}\ osmo\_ss7\_route\_label\ *rtlabel);}
\DoxyCodeLine{00060\ \textcolor{keywordtype}{bool}\ ss7\_combined\_linkset\_is\_available(\textcolor{keyword}{const}\ \textcolor{keyword}{struct}\ osmo\_ss7\_combined\_linkset\ *clset);}
\DoxyCodeLine{00061\ }
\DoxyCodeLine{00062\ \textcolor{preprocessor}{\#define\ LOGPCLSET(clset,\ subsys,\ level,\ fmt,\ args\ ...)\ do\ \{\ \(\backslash\)}}
\DoxyCodeLine{00063\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ char\ \_pc\_str[MAX\_PC\_STR\_LEN];\ \(\backslash\)}}
\DoxyCodeLine{00064\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ char\ \_mask\_str[MAX\_PC\_STR\_LEN];\ \(\backslash\)}}
\DoxyCodeLine{00065\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \_LOGSS7((clset)-\/>rtable-\/>inst,\ subsys,\ level,\ \(\backslash\)}}
\DoxyCodeLine{00066\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "{}CombinedLinkset(dpc=\%u=\%s,mask=0x\%x=\%s,prio=\%u)\ "{}\ fmt,\ \(\backslash\)}}
\DoxyCodeLine{00067\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (clset)-\/>cfg.pc,\ osmo\_ss7\_pointcode\_print\_buf(\_pc\_str,\ MAX\_PC\_STR\_LEN,\ (clset)-\/>rtable-\/>inst,\ (clset)-\/>cfg.pc),\ \(\backslash\)}}
\DoxyCodeLine{00068\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (clset)-\/>cfg.mask,\ osmo\_ss7\_pointcode\_print\_buf(\_mask\_str,\ MAX\_PC\_STR\_LEN,\ (clset)-\/>rtable-\/>inst,\ (clset)-\/>cfg.mask),\ \(\backslash\)}}
\DoxyCodeLine{00069\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (clset)-\/>cfg.priority,\ \#\#\ args);\ \(\backslash\)}}
\DoxyCodeLine{00070\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \}\ while\ (0)}}

\end{DoxyCode}
