\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{1 \textcolor{preprocessor}{\#pragma once}}
\DoxyCodeLine{2 }
\DoxyCodeLine{3 \textcolor{preprocessor}{\#include <stdint.h>}}
\DoxyCodeLine{4 \textcolor{preprocessor}{\#include <osmocom/core/linuxlist.h>}}
\DoxyCodeLine{5 }
\DoxyCodeLine{6 \textcolor{comment}{/***********************************************************************}}
\DoxyCodeLine{7 \textcolor{comment}{ * SS7 Combined Linkset}}
\DoxyCodeLine{8 \textcolor{comment}{ * Set of routes with same destination and priority.}}
\DoxyCodeLine{9 \textcolor{comment}{ ***********************************************************************/}}
\DoxyCodeLine{10 }
\DoxyCodeLine{11 \textcolor{keyword}{struct }osmo\_ss7\_instance;}
\DoxyCodeLine{12 \textcolor{keyword}{struct }osmo\_ss7\_link;}
\DoxyCodeLine{13 \textcolor{keyword}{struct }osmo\_ss7\_route\_label;}
\DoxyCodeLine{14 }
\DoxyCodeLine{15 \textcolor{preprocessor}{\#define NUM\_EXT\_SLS 128}}
\DoxyCodeLine{16 \textcolor{keyword}{typedef} uint8\_t ext\_sls\_t; \textcolor{comment}{/* range: 0-\/127, 7 bit */}}
\DoxyCodeLine{17 }
\DoxyCodeLine{18 \textcolor{keyword}{struct }osmo\_ss7\_esls\_entry \{}
\DoxyCodeLine{19         \textcolor{comment}{/* ITU Q.704 4.2.1: "{}normal link set (combined link set)"{} */}}
\DoxyCodeLine{20         \textcolor{keyword}{struct }osmo\_ss7\_route *normal\_rt;}
\DoxyCodeLine{21         \textcolor{comment}{/* ITU Q.704 4.2.1: "{}alternative link set (combined link set)"{} */}}
\DoxyCodeLine{22         \textcolor{keyword}{struct }osmo\_ss7\_route *alt\_rt;}
\DoxyCodeLine{23 \};}
\DoxyCodeLine{24 }
\DoxyCodeLine{25 \textcolor{keyword}{struct }osmo\_ss7\_combined\_linkset \{}
\DoxyCodeLine{27         \textcolor{keyword}{struct }llist\_head list;}
\DoxyCodeLine{28 }
\DoxyCodeLine{30         \textcolor{keyword}{struct }osmo\_ss7\_route\_table *rtable;}
\DoxyCodeLine{31         \textcolor{keyword}{struct }osmo\_ss7\_esls\_entry esls\_table[NUM\_EXT\_SLS];}
\DoxyCodeLine{32 }
\DoxyCodeLine{34         \textcolor{keyword}{struct }llist\_head routes;}
\DoxyCodeLine{35         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} num\_routes;}
\DoxyCodeLine{36         \textcolor{keywordtype}{void} *last\_route\_roundrobin\_ass;}
\DoxyCodeLine{37         \textcolor{keywordtype}{void} *last\_route\_roundrobin\_tx;}
\DoxyCodeLine{38 }
\DoxyCodeLine{39         \textcolor{keyword}{struct }\{}
\DoxyCodeLine{40                 uint32\_t pc;}
\DoxyCodeLine{41                 uint32\_t mask;}
\DoxyCodeLine{43                 uint32\_t priority;}
\DoxyCodeLine{44         \} cfg;}
\DoxyCodeLine{45 \};}
\DoxyCodeLine{46 }
\DoxyCodeLine{47 \textcolor{keyword}{struct }osmo\_ss7\_combined\_linkset *}
\DoxyCodeLine{48 ss7\_combined\_linkset\_alloc(\textcolor{keyword}{struct} osmo\_ss7\_route\_table *rtbl, uint32\_t pc, uint32\_t mask, uint32\_t prio);}
\DoxyCodeLine{49 \textcolor{keywordtype}{void}}
\DoxyCodeLine{50 ss7\_combined\_linkset\_free(\textcolor{keyword}{struct} osmo\_ss7\_combined\_linkset *clset);}
\DoxyCodeLine{51 \textcolor{keyword}{struct }osmo\_ss7\_linkset *}
\DoxyCodeLine{52 ss7\_combined\_linkset\_find\_or\_create(\textcolor{keyword}{struct} osmo\_ss7\_route\_table *rtbl, uint32\_t pc, uint32\_t mask, uint32\_t prio);}
\DoxyCodeLine{53 }
\DoxyCodeLine{54 \textcolor{keywordtype}{void}}
\DoxyCodeLine{55 ss7\_combined\_linkset\_add\_route(\textcolor{keyword}{struct} osmo\_ss7\_combined\_linkset *clset, \textcolor{keyword}{struct} osmo\_ss7\_route *rt);}
\DoxyCodeLine{56 \textcolor{keywordtype}{void}}
\DoxyCodeLine{57 ss7\_combined\_linkset\_del\_route(\textcolor{keyword}{struct} osmo\_ss7\_route *rt);}
\DoxyCodeLine{58 \textcolor{keyword}{struct }osmo\_ss7\_route *}
\DoxyCodeLine{59 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{60 \textcolor{keywordtype}{bool} ss7\_combined\_linkset\_is\_available(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_combined\_linkset *clset);}
\DoxyCodeLine{61 }
\DoxyCodeLine{62 \textcolor{preprocessor}{\#define LOGPCLSET(clset, subsys, level, fmt, args ...) do \{ \(\backslash\)}}
\DoxyCodeLine{63 \textcolor{preprocessor}{        char \_pc\_str[MAX\_PC\_STR\_LEN]; \(\backslash\)}}
\DoxyCodeLine{64 \textcolor{preprocessor}{        char \_mask\_str[MAX\_PC\_STR\_LEN]; \(\backslash\)}}
\DoxyCodeLine{65 \textcolor{preprocessor}{        \_LOGSS7((clset)-\/>rtable-\/>inst, subsys, level, \(\backslash\)}}
\DoxyCodeLine{66 \textcolor{preprocessor}{                "{}CombinedLinkset(dpc=\%u=\%s,mask=0x\%x=\%s,prio=\%u) "{}} fmt, \(\backslash\)}
\DoxyCodeLine{67                 (clset)-\/>cfg.pc, osmo\_ss7\_pointcode\_print\_buf(\_pc\_str, MAX\_PC\_STR\_LEN, (clset)-\/>rtable-\/>inst, (clset)-\/>cfg.pc), \(\backslash\)}
\DoxyCodeLine{68                 (clset)-\/>cfg.mask, osmo\_ss7\_pointcode\_print\_buf(\_mask\_str, MAX\_PC\_STR\_LEN, (clset)-\/>rtable-\/>inst, (clset)-\/>cfg.mask), \(\backslash\)}
\DoxyCodeLine{69                 (clset)-\/>cfg.priority, \#\# args); \(\backslash\)}
\DoxyCodeLine{70         \} while (0)}

\end{DoxyCode}
