\doxysection{ss7\+\_\+route.\+h}
\label{ss7__route_8h_source}\index{src/ss7\_route.h@{src/ss7\_route.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 <stdbool.h>}}
\DoxyCodeLine{5 \textcolor{preprocessor}{\#include <osmocom/core/linuxlist.h>}}
\DoxyCodeLine{6 }
\DoxyCodeLine{7 \textcolor{comment}{/***********************************************************************}}
\DoxyCodeLine{8 \textcolor{comment}{ * SS7 Routes}}
\DoxyCodeLine{9 \textcolor{comment}{ ***********************************************************************/}}
\DoxyCodeLine{10 }
\DoxyCodeLine{11 \textcolor{keyword}{struct }osmo\_ss7\_instance;}
\DoxyCodeLine{12 \textcolor{keyword}{struct }osmo\_ss7\_route\_table;}
\DoxyCodeLine{13 \textcolor{keyword}{struct }osmo\_ss7\_linkset;}
\DoxyCodeLine{14 \textcolor{keyword}{struct }osmo\_ss7\_as;}
\DoxyCodeLine{15 }
\DoxyCodeLine{16 \textcolor{preprocessor}{\#define OSMO\_SS7\_ROUTE\_PRIO\_DEFAULT 5}}
\DoxyCodeLine{17 }
\DoxyCodeLine{18 \textcolor{comment}{/* ITU Q.704 3.4 Status of signalling routes */}}
\DoxyCodeLine{19 \textcolor{keyword}{enum} osmo\_ss7\_route\_status \{}
\DoxyCodeLine{20         OSMO\_SS7\_ROUTE\_STATUS\_UNAVAILABLE,}
\DoxyCodeLine{21         OSMO\_SS7\_ROUTE\_STATUS\_AVAILABLE,}
\DoxyCodeLine{22         OSMO\_SS7\_ROUTE\_STATUS\_RESTRICTED,}
\DoxyCodeLine{23 \};}
\DoxyCodeLine{24 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }value\_string ss7\_route\_status\_names[];}
\DoxyCodeLine{25 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *ss7\_route\_status\_name(\textcolor{keyword}{enum} osmo\_ss7\_route\_status val)}
\DoxyCodeLine{26 \{ \textcolor{keywordflow}{return} get\_value\_string(ss7\_route\_status\_names, val); \}}
\DoxyCodeLine{27 }
\DoxyCodeLine{28 \textcolor{keyword}{struct }osmo\_ss7\_route \{}
\DoxyCodeLine{30         \textcolor{keyword}{struct }llist\_head list;}
\DoxyCodeLine{32         \textcolor{keyword}{struct }osmo\_ss7\_route\_table *rtable;}
\DoxyCodeLine{33         \textcolor{comment}{/* Combined linkset this route is part of */}}
\DoxyCodeLine{34         \textcolor{keyword}{struct }osmo\_ss7\_combined\_linkset *clset;}
\DoxyCodeLine{35 }
\DoxyCodeLine{36         \textcolor{keyword}{enum} osmo\_ss7\_route\_status status;}
\DoxyCodeLine{37 }
\DoxyCodeLine{38         \textcolor{keyword}{struct }\{}
\DoxyCodeLine{40                 \textcolor{keyword}{struct }osmo\_ss7\_linkset *linkset;}
\DoxyCodeLine{42                 \textcolor{keyword}{struct }osmo\_ss7\_as *as;}
\DoxyCodeLine{43         \} dest;}
\DoxyCodeLine{44 }
\DoxyCodeLine{45         \textcolor{keyword}{struct }\{}
\DoxyCodeLine{46                 \textcolor{comment}{/* FIXME: presence? */}}
\DoxyCodeLine{47                 uint32\_t pc;}
\DoxyCodeLine{48                 uint32\_t mask;}
\DoxyCodeLine{50                 \textcolor{keywordtype}{char} *linkset\_name;}
\DoxyCodeLine{52                 uint32\_t priority;}
\DoxyCodeLine{53                 uint8\_t qos\_class;}
\DoxyCodeLine{54                 \textcolor{keywordtype}{bool} dyn\_allocated;}
\DoxyCodeLine{55         \} cfg;}
\DoxyCodeLine{56 \};}
\DoxyCodeLine{57 }
\DoxyCodeLine{58 \textcolor{keyword}{struct }osmo\_ss7\_route *}
\DoxyCodeLine{59 ss7\_route\_alloc(\textcolor{keyword}{struct} osmo\_ss7\_route\_table *rtbl, uint32\_t pc, uint32\_t mask, \textcolor{keywordtype}{bool} dynamic);}
\DoxyCodeLine{60 \textcolor{keyword}{struct }osmo\_ss7\_route *}
\DoxyCodeLine{61 ss7\_route\_create(\textcolor{keyword}{struct} osmo\_ss7\_route\_table *rtbl, uint32\_t dpc,}
\DoxyCodeLine{62                  uint32\_t mask, \textcolor{keywordtype}{bool} dynamic, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *linkset\_name);}
\DoxyCodeLine{63 \textcolor{keywordtype}{void} ss7\_route\_destroy(\textcolor{keyword}{struct} osmo\_ss7\_route *rt);}
\DoxyCodeLine{64 }
\DoxyCodeLine{65 \textcolor{keyword}{struct }osmo\_ss7\_route *}
\DoxyCodeLine{66 ss7\_route\_find\_dpc(\textcolor{keyword}{struct} osmo\_ss7\_route\_table *rtbl, uint32\_t dpc);}
\DoxyCodeLine{67 \textcolor{keyword}{struct }osmo\_ss7\_route *}
\DoxyCodeLine{68 ss7\_route\_find\_dpc\_mask(\textcolor{keyword}{struct} osmo\_ss7\_route\_table *rtbl, uint32\_t dpc,}
\DoxyCodeLine{69                              uint32\_t mask);}
\DoxyCodeLine{70 }
\DoxyCodeLine{71 \textcolor{keywordtype}{int} ss7\_route\_set\_linkset(\textcolor{keyword}{struct} osmo\_ss7\_route *rt, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *linkset\_name);}
\DoxyCodeLine{72 \textcolor{keywordtype}{int} ss7\_route\_insert(\textcolor{keyword}{struct} osmo\_ss7\_route *rt);}
\DoxyCodeLine{73 }
\DoxyCodeLine{74 \textcolor{keywordtype}{bool} ss7\_route\_dest\_is\_available(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_route *rt);}
\DoxyCodeLine{75 \textcolor{keywordtype}{bool} ss7\_route\_is\_available(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_route *rt);}
\DoxyCodeLine{76 }
\DoxyCodeLine{77 \textcolor{keywordtype}{bool} ss7\_route\_is\_fully\_qualified(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_route *rt);}
\DoxyCodeLine{78 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{bool} ss7\_route\_is\_summary(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_route *rt)}
\DoxyCodeLine{79 \{}
\DoxyCodeLine{80         \textcolor{keywordflow}{return} !ss7\_route\_is\_fully\_qualified(rt);}
\DoxyCodeLine{81 \}}
\DoxyCodeLine{82 }
\DoxyCodeLine{83 \textcolor{keywordtype}{void} ss7\_route\_update\_route\_status(\textcolor{keyword}{struct} osmo\_ss7\_route *rt, \textcolor{keyword}{enum} osmo\_ss7\_route\_status status);}
\DoxyCodeLine{84 }
\DoxyCodeLine{85 \textcolor{preprocessor}{\#define LOGPRT(rt, subsys, level, fmt, args ...) do \{ \(\backslash\)}}
\DoxyCodeLine{86 \textcolor{preprocessor}{        char \_pc\_str[MAX\_PC\_STR\_LEN]; \(\backslash\)}}
\DoxyCodeLine{87 \textcolor{preprocessor}{        char \_mask\_str[MAX\_PC\_STR\_LEN]; \(\backslash\)}}
\DoxyCodeLine{88 \textcolor{preprocessor}{        \_LOGSS7((rt)-\/>rtable-\/>inst, subsys, level, \(\backslash\)}}
\DoxyCodeLine{89 \textcolor{preprocessor}{                "{}RT(dpc=\%u=\%s,mask=0x\%x=\%s,prio=\%u,via=\%s,st=\%s) "{}} fmt, \(\backslash\)}
\DoxyCodeLine{90                 (rt)-\/>cfg.pc, osmo\_ss7\_pointcode\_print\_buf(\_pc\_str, MAX\_PC\_STR\_LEN, (rt)-\/>rtable-\/>inst, (rt)-\/>cfg.pc), \(\backslash\)}
\DoxyCodeLine{91                 (rt)-\/>cfg.mask, osmo\_ss7\_pointcode\_print\_buf(\_mask\_str, MAX\_PC\_STR\_LEN, (rt)-\/>rtable-\/>inst, (rt)-\/>cfg.mask), \(\backslash\)}
\DoxyCodeLine{92                 (rt)-\/>cfg.priority, \(\backslash\)}
\DoxyCodeLine{93                 (rt)-\/>cfg.linkset\_name ? (rt)-\/>cfg.linkset\_name : "{}"{}, \(\backslash\)}
\DoxyCodeLine{94                 ss7\_route\_status\_name((rt)-\/>status), \(\backslash\)}
\DoxyCodeLine{95                 \#\# args); \(\backslash\)}
\DoxyCodeLine{96         \} while (0)}

\end{DoxyCode}
