\doxysection{osmo\+\_\+ss7.\+h}
\label{osmo__ss7_8h_source}\index{include/osmocom/sigtran/osmo\_ss7.h@{include/osmocom/sigtran/osmo\_ss7.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 }
\DoxyCodeLine{6 \textcolor{preprocessor}{\#include <osmocom/core/linuxlist.h>}}
\DoxyCodeLine{7 \textcolor{preprocessor}{\#include <osmocom/core/utils.h>}}
\DoxyCodeLine{8 \textcolor{preprocessor}{\#include <osmocom/core/fsm.h>}}
\DoxyCodeLine{9 \textcolor{preprocessor}{\#include <osmocom/core/msgb.h>}}
\DoxyCodeLine{10 \textcolor{preprocessor}{\#include <osmocom/core/prim.h>}}
\DoxyCodeLine{11 \textcolor{preprocessor}{\#include <osmocom/core/socket.h>}}
\DoxyCodeLine{12 \textcolor{preprocessor}{\#include <osmocom/core/rate\_ctr.h>}}
\DoxyCodeLine{13 }
\DoxyCodeLine{14 \textcolor{keyword}{extern} \textcolor{keyword}{struct }llist\_head osmo\_ss7\_instances;}
\DoxyCodeLine{15 }
\DoxyCodeLine{16 \textcolor{keyword}{struct }osmo\_ss7\_instance;}
\DoxyCodeLine{17 \textcolor{keyword}{struct }osmo\_ss7\_user;}
\DoxyCodeLine{18 \textcolor{keyword}{struct }osmo\_sccp\_instance;}
\DoxyCodeLine{19 \textcolor{keyword}{struct }osmo\_mtp\_prim;}
\DoxyCodeLine{20 \textcolor{keyword}{struct }osmo\_xua\_layer\_manager;}
\DoxyCodeLine{21 }
\DoxyCodeLine{22 \textcolor{keywordtype}{int} osmo\_ss7\_init(\textcolor{keywordtype}{void});}
\DoxyCodeLine{23 \textcolor{keywordtype}{int} osmo\_ss7\_find\_free\_rctx(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst);}
\DoxyCodeLine{24 }
\DoxyCodeLine{25 \textcolor{keywordtype}{bool} osmo\_ss7\_pc\_is\_local(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst, uint32\_t pc);}
\DoxyCodeLine{26 \textcolor{keywordtype}{int} osmo\_ss7\_pointcode\_parse(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *str);}
\DoxyCodeLine{27 \textcolor{keywordtype}{int} osmo\_ss7\_pointcode\_parse\_mask\_or\_len(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *in);}
\DoxyCodeLine{28 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_ss7\_pointcode\_print\_buf(\textcolor{keywordtype}{char} *buf, \textcolor{keywordtype}{size\_t} buf\_len, \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_instance *inst, uint32\_t pc);}
\DoxyCodeLine{29 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_ss7\_pointcode\_print(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_instance *inst, uint32\_t pc);}
\DoxyCodeLine{30 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_ss7\_pointcode\_print2(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_instance *inst, uint32\_t pc);}
\DoxyCodeLine{31 }
\DoxyCodeLine{32 \textcolor{comment}{/* All known point-\/code formats have a length of or below 24 bit.}}
\DoxyCodeLine{33 \textcolor{comment}{ * A point-\/code value exceeding that is used to indicate an unset PC. */}}
\DoxyCodeLine{34 \textcolor{preprocessor}{\#define OSMO\_SS7\_PC\_INVALID 0xffffffff}}
\DoxyCodeLine{35 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{bool} osmo\_ss7\_pc\_is\_valid(uint32\_t pc)}
\DoxyCodeLine{36 \{}
\DoxyCodeLine{37         \textcolor{keywordflow}{return} pc <= 0x00ffffff;}
\DoxyCodeLine{38 \}}
\DoxyCodeLine{39 }
\DoxyCodeLine{40 \textcolor{comment}{/***********************************************************************}}
\DoxyCodeLine{41 \textcolor{comment}{ * SS7 Routing Tables}}
\DoxyCodeLine{42 \textcolor{comment}{ ***********************************************************************/}}
\DoxyCodeLine{43 }
\DoxyCodeLine{44 \textcolor{keyword}{struct }osmo\_ss7\_route\_table \{}
\DoxyCodeLine{46         \textcolor{keyword}{struct }llist\_head list;}
\DoxyCodeLine{48         \textcolor{keyword}{struct }osmo\_ss7\_instance *inst;}
\DoxyCodeLine{50         \textcolor{keyword}{struct }llist\_head routes;}
\DoxyCodeLine{51 }
\DoxyCodeLine{52         \textcolor{keyword}{struct }\{}
\DoxyCodeLine{53                 \textcolor{keywordtype}{char} *name;}
\DoxyCodeLine{54                 \textcolor{keywordtype}{char} *description;}
\DoxyCodeLine{55         \} cfg;}
\DoxyCodeLine{56 \};}
\DoxyCodeLine{57 }
\DoxyCodeLine{58 \textcolor{keyword}{struct }osmo\_ss7\_route\_table *}
\DoxyCodeLine{59 osmo\_ss7\_route\_table\_find(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name);}
\DoxyCodeLine{60 \textcolor{keyword}{struct }osmo\_ss7\_route\_table *}
\DoxyCodeLine{61 osmo\_ss7\_route\_table\_find\_or\_create(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name);}
\DoxyCodeLine{62 \textcolor{keywordtype}{void} osmo\_ss7\_route\_table\_destroy(\textcolor{keyword}{struct} osmo\_ss7\_route\_table *rtbl);}
\DoxyCodeLine{63 }
\DoxyCodeLine{64 \textcolor{comment}{/***********************************************************************}}
\DoxyCodeLine{65 \textcolor{comment}{ * SS7 Instances}}
\DoxyCodeLine{66 \textcolor{comment}{ ***********************************************************************/}}
\DoxyCodeLine{67 }
\DoxyCodeLine{68 \textcolor{keyword}{struct }osmo\_ss7\_pc\_fmt \{}
\DoxyCodeLine{69         \textcolor{keywordtype}{char} delimiter;}
\DoxyCodeLine{70         uint8\_t component\_len[3];}
\DoxyCodeLine{71 \};}
\DoxyCodeLine{72 }
\DoxyCodeLine{73 \textcolor{keyword}{struct }osmo\_ss7\_instance \{}
\DoxyCodeLine{75         \textcolor{keyword}{struct }llist\_head list;}
\DoxyCodeLine{77         \textcolor{keyword}{struct }llist\_head linksets;}
\DoxyCodeLine{79         \textcolor{keyword}{struct }llist\_head as\_list;}
\DoxyCodeLine{81         \textcolor{keyword}{struct }llist\_head asp\_list;}
\DoxyCodeLine{83         \textcolor{keyword}{struct }llist\_head rtable\_list;}
\DoxyCodeLine{85         \textcolor{keyword}{struct }llist\_head xua\_servers;}
\DoxyCodeLine{86         \textcolor{comment}{/* array for faster lookup of user (indexed by service}}
\DoxyCodeLine{87 \textcolor{comment}{         * indicator) */}}
\DoxyCodeLine{88         \textcolor{keyword}{const} \textcolor{keyword}{struct }osmo\_ss7\_user *user[16];}
\DoxyCodeLine{89 }
\DoxyCodeLine{90         \textcolor{keyword}{struct }osmo\_ss7\_route\_table *rtable\_system;}
\DoxyCodeLine{91 }
\DoxyCodeLine{92         \textcolor{keyword}{struct }osmo\_sccp\_instance *sccp;}
\DoxyCodeLine{93 }
\DoxyCodeLine{94         \textcolor{keyword}{struct }\{}
\DoxyCodeLine{95                 uint32\_t id;}
\DoxyCodeLine{96                 \textcolor{keywordtype}{char} *name;}
\DoxyCodeLine{97                 \textcolor{keywordtype}{char} *description;}
\DoxyCodeLine{98                 uint32\_t primary\_pc;}
\DoxyCodeLine{99                 \textcolor{comment}{/* capability PCs */}}
\DoxyCodeLine{100                 uint8\_t network\_indicator;}
\DoxyCodeLine{101                 \textcolor{keyword}{struct }osmo\_ss7\_pc\_fmt pc\_fmt;}
\DoxyCodeLine{102                 \textcolor{keywordtype}{bool} permit\_dyn\_rkm\_alloc;}
\DoxyCodeLine{103                 \textcolor{keyword}{struct }llist\_head sccp\_address\_book;}
\DoxyCodeLine{104                 uint32\_t secondary\_pc;}
\DoxyCodeLine{105         \} cfg;}
\DoxyCodeLine{106 \};}
\DoxyCodeLine{107 }
\DoxyCodeLine{108 \textcolor{keyword}{struct }osmo\_ss7\_instance *osmo\_ss7\_instance\_find(uint32\_t \textcolor{keywordtype}{id});}
\DoxyCodeLine{109 \textcolor{keyword}{struct }osmo\_ss7\_instance *}
\DoxyCodeLine{110 osmo\_ss7\_instance\_find\_or\_create(\textcolor{keywordtype}{void} *ctx, uint32\_t \textcolor{keywordtype}{id});}
\DoxyCodeLine{111 \textcolor{keywordtype}{void} osmo\_ss7\_instance\_destroy(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst);}
\DoxyCodeLine{112 \textcolor{keywordtype}{int} osmo\_ss7\_instance\_set\_pc\_fmt(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst,}
\DoxyCodeLine{113                                 uint8\_t c0, uint8\_t c1, uint8\_t c2);}
\DoxyCodeLine{114 }
\DoxyCodeLine{115 \textcolor{keyword}{struct }osmo\_sccp\_instance *osmo\_ss7\_ensure\_sccp(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst);}
\DoxyCodeLine{116 }
\DoxyCodeLine{117 uint8\_t osmo\_ss7\_pc\_width(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_pc\_fmt *pc\_fmt);}
\DoxyCodeLine{118 uint32\_t osmo\_ss7\_pc\_normalize(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_pc\_fmt *pc\_fmt, uint32\_t pc);}
\DoxyCodeLine{119 }
\DoxyCodeLine{120 \textcolor{comment}{/***********************************************************************}}
\DoxyCodeLine{121 \textcolor{comment}{ * MTP Users (Users of MTP, such as SCCP or ISUP)}}
\DoxyCodeLine{122 \textcolor{comment}{ ***********************************************************************/}}
\DoxyCodeLine{123 }
\DoxyCodeLine{124 \textcolor{keyword}{struct }osmo\_ss7\_user \{}
\DoxyCodeLine{125         \textcolor{comment}{/* pointer back to SS7 instance */}}
\DoxyCodeLine{126         \textcolor{keyword}{struct }osmo\_ss7\_instance *inst;}
\DoxyCodeLine{127         \textcolor{comment}{/* name of the user */}}
\DoxyCodeLine{128         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name;}
\DoxyCodeLine{129         \textcolor{comment}{/* primitive call-\/back for incoming MTP primitives */}}
\DoxyCodeLine{130         osmo\_prim\_cb prim\_cb;}
\DoxyCodeLine{131         \textcolor{comment}{/* private data */}}
\DoxyCodeLine{132         \textcolor{keywordtype}{void} *priv;}
\DoxyCodeLine{133 \};}
\DoxyCodeLine{134 }
\DoxyCodeLine{135 \textcolor{keywordtype}{int} osmo\_ss7\_user\_register(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst, uint8\_t service\_ind,}
\DoxyCodeLine{136                            \textcolor{keyword}{struct} osmo\_ss7\_user *user);}
\DoxyCodeLine{137 }
\DoxyCodeLine{138 \textcolor{keywordtype}{int} osmo\_ss7\_user\_unregister(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst, uint8\_t service\_ind,}
\DoxyCodeLine{139                              \textcolor{keyword}{struct} osmo\_ss7\_user *user);}
\DoxyCodeLine{140 }
\DoxyCodeLine{141 \textcolor{keywordtype}{int} osmo\_ss7\_mtp\_to\_user(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst, \textcolor{keyword}{struct} osmo\_mtp\_prim *omp);}
\DoxyCodeLine{142 }
\DoxyCodeLine{143 \textcolor{comment}{/* SS7 User wants to issue MTP-\/TRANSFER.req */}}
\DoxyCodeLine{144 \textcolor{keywordtype}{int} osmo\_ss7\_user\_mtp\_xfer\_req(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst,}
\DoxyCodeLine{145                                 \textcolor{keyword}{struct} osmo\_mtp\_prim *omp);}
\DoxyCodeLine{146 }
\DoxyCodeLine{147 \textcolor{comment}{/***********************************************************************}}
\DoxyCodeLine{148 \textcolor{comment}{ * SS7 Links}}
\DoxyCodeLine{149 \textcolor{comment}{ ***********************************************************************/}}
\DoxyCodeLine{150 }
\DoxyCodeLine{151 \textcolor{keyword}{enum} osmo\_ss7\_link\_adm\_state \{}
\DoxyCodeLine{152         OSMO\_SS7\_LS\_SHUTDOWN,}
\DoxyCodeLine{153         OSMO\_SS7\_LS\_INHIBITED,}
\DoxyCodeLine{154         OSMO\_SS7\_LS\_ENABLED,}
\DoxyCodeLine{155         \_NUM\_OSMO\_SS7\_LS}
\DoxyCodeLine{156 \};}
\DoxyCodeLine{157 }
\DoxyCodeLine{158 \textcolor{keyword}{struct }osmo\_ss7\_linkset;}
\DoxyCodeLine{159 \textcolor{keyword}{struct }osmo\_ss7\_link;}
\DoxyCodeLine{160 }
\DoxyCodeLine{161 \textcolor{keyword}{struct }osmo\_ss7\_link \{}
\DoxyCodeLine{163         \textcolor{keyword}{struct }osmo\_ss7\_linkset *linkset;}
\DoxyCodeLine{164         \textcolor{keyword}{struct }\{}
\DoxyCodeLine{165                 \textcolor{keywordtype}{char} *name;}
\DoxyCodeLine{166                 \textcolor{keywordtype}{char} *description;}
\DoxyCodeLine{167                 uint32\_t id;}
\DoxyCodeLine{168 }
\DoxyCodeLine{169                 \textcolor{keyword}{enum} osmo\_ss7\_link\_adm\_state adm\_state;}
\DoxyCodeLine{170         \} cfg;}
\DoxyCodeLine{171 \};}
\DoxyCodeLine{172 }
\DoxyCodeLine{173 \textcolor{keywordtype}{void} osmo\_ss7\_link\_destroy(\textcolor{keyword}{struct} osmo\_ss7\_link *link);}
\DoxyCodeLine{174 \textcolor{keyword}{struct }osmo\_ss7\_link *}
\DoxyCodeLine{175 osmo\_ss7\_link\_find\_or\_create(\textcolor{keyword}{struct} osmo\_ss7\_linkset *lset, uint32\_t \textcolor{keywordtype}{id});}
\DoxyCodeLine{176 }
\DoxyCodeLine{177 \textcolor{comment}{/***********************************************************************}}
\DoxyCodeLine{178 \textcolor{comment}{ * SS7 Linksets}}
\DoxyCodeLine{179 \textcolor{comment}{ ***********************************************************************/}}
\DoxyCodeLine{180 }
\DoxyCodeLine{181 \textcolor{keyword}{struct }osmo\_ss7\_linkset \{}
\DoxyCodeLine{182         \textcolor{keyword}{struct }llist\_head list;}
\DoxyCodeLine{184         \textcolor{keyword}{struct }osmo\_ss7\_instance *inst;}
\DoxyCodeLine{186         \textcolor{keyword}{struct }osmo\_ss7\_link *links[16];}
\DoxyCodeLine{187 }
\DoxyCodeLine{188         \textcolor{keyword}{struct }\{}
\DoxyCodeLine{189                 \textcolor{keywordtype}{char} *name;}
\DoxyCodeLine{190                 \textcolor{keywordtype}{char} *description;}
\DoxyCodeLine{191                 uint32\_t adjacent\_pc;}
\DoxyCodeLine{192                 uint32\_t local\_pc;}
\DoxyCodeLine{193         \} cfg;}
\DoxyCodeLine{194 \};}
\DoxyCodeLine{195 }
\DoxyCodeLine{196 \textcolor{keywordtype}{void} osmo\_ss7\_linkset\_destroy(\textcolor{keyword}{struct} osmo\_ss7\_linkset *lset);}
\DoxyCodeLine{197 \textcolor{keyword}{struct }osmo\_ss7\_linkset *}
\DoxyCodeLine{198 osmo\_ss7\_linkset\_find\_by\_name(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name);}
\DoxyCodeLine{199 \textcolor{keyword}{struct }osmo\_ss7\_linkset *}
\DoxyCodeLine{200 osmo\_ss7\_linkset\_find\_or\_create(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name, uint32\_t pc);}
\DoxyCodeLine{201 }
\DoxyCodeLine{202 }
\DoxyCodeLine{203 \textcolor{comment}{/***********************************************************************}}
\DoxyCodeLine{204 \textcolor{comment}{ * SS7 Routes}}
\DoxyCodeLine{205 \textcolor{comment}{ ***********************************************************************/}}
\DoxyCodeLine{206 }
\DoxyCodeLine{207 \textcolor{keyword}{struct }osmo\_ss7\_route \{}
\DoxyCodeLine{209         \textcolor{keyword}{struct }llist\_head list;}
\DoxyCodeLine{211         \textcolor{keyword}{struct }osmo\_ss7\_route\_table *rtable;}
\DoxyCodeLine{212 }
\DoxyCodeLine{213         \textcolor{keyword}{struct }\{}
\DoxyCodeLine{215                 \textcolor{keyword}{struct }osmo\_ss7\_linkset *linkset;}
\DoxyCodeLine{217                 \textcolor{keyword}{struct }osmo\_ss7\_as *as;}
\DoxyCodeLine{218         \} dest;}
\DoxyCodeLine{219 }
\DoxyCodeLine{220         \textcolor{keyword}{struct }\{}
\DoxyCodeLine{221                 \textcolor{comment}{/* FIXME: presence? */}}
\DoxyCodeLine{222                 uint32\_t pc;}
\DoxyCodeLine{223                 uint32\_t mask;}
\DoxyCodeLine{225                 \textcolor{keywordtype}{char} *linkset\_name;}
\DoxyCodeLine{227                 uint32\_t priority;}
\DoxyCodeLine{228                 uint8\_t qos\_class;}
\DoxyCodeLine{229         \} cfg;}
\DoxyCodeLine{230 \};}
\DoxyCodeLine{231 }
\DoxyCodeLine{232 \textcolor{keyword}{struct }osmo\_ss7\_route *}
\DoxyCodeLine{233 osmo\_ss7\_route\_find\_dpc(\textcolor{keyword}{struct} osmo\_ss7\_route\_table *rtbl, uint32\_t dpc);}
\DoxyCodeLine{234 \textcolor{keyword}{struct }osmo\_ss7\_route *}
\DoxyCodeLine{235 osmo\_ss7\_route\_find\_dpc\_mask(\textcolor{keyword}{struct} osmo\_ss7\_route\_table *rtbl, uint32\_t dpc,}
\DoxyCodeLine{236                              uint32\_t mask);}
\DoxyCodeLine{237 \textcolor{keyword}{struct }osmo\_ss7\_route *}
\DoxyCodeLine{238 osmo\_ss7\_route\_lookup(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst, uint32\_t dpc);}
\DoxyCodeLine{239 \textcolor{keyword}{struct }osmo\_ss7\_route *}
\DoxyCodeLine{240 osmo\_ss7\_route\_create(\textcolor{keyword}{struct} osmo\_ss7\_route\_table *rtbl, uint32\_t dpc,}
\DoxyCodeLine{241                         uint32\_t mask, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *linkset\_name);}
\DoxyCodeLine{242 \textcolor{keywordtype}{void} osmo\_ss7\_route\_destroy(\textcolor{keyword}{struct} osmo\_ss7\_route *rt);}
\DoxyCodeLine{243 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_ss7\_route\_print(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_route *rt);}
\DoxyCodeLine{244 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_ss7\_route\_name(\textcolor{keyword}{struct} osmo\_ss7\_route *rt, \textcolor{keywordtype}{bool} list\_asps);}
\DoxyCodeLine{245 }
\DoxyCodeLine{246 }
\DoxyCodeLine{247 \textcolor{comment}{/***********************************************************************}}
\DoxyCodeLine{248 \textcolor{comment}{ * SS7 Application Servers}}
\DoxyCodeLine{249 \textcolor{comment}{ ***********************************************************************/}}
\DoxyCodeLine{250 }
\DoxyCodeLine{251 \textcolor{keyword}{struct }osmo\_ss7\_routing\_key \{}
\DoxyCodeLine{252         uint32\_t context;}
\DoxyCodeLine{253         uint32\_t l\_rk\_id;}
\DoxyCodeLine{254 }
\DoxyCodeLine{255         uint32\_t pc;}
\DoxyCodeLine{256         uint8\_t si;}
\DoxyCodeLine{257         uint32\_t ssn;}
\DoxyCodeLine{258         \textcolor{comment}{/* FIXME: more complex routing keys */}}
\DoxyCodeLine{259 \};}
\DoxyCodeLine{260 }
\DoxyCodeLine{261 \textcolor{keyword}{enum} osmo\_ss7\_as\_traffic\_mode \{}
\DoxyCodeLine{262         OSMO\_SS7\_AS\_TMOD\_OVERRIDE = 0, \textcolor{comment}{/* default */}}
\DoxyCodeLine{263         OSMO\_SS7\_AS\_TMOD\_BCAST,}
\DoxyCodeLine{264         OSMO\_SS7\_AS\_TMOD\_LOADSHARE,}
\DoxyCodeLine{265         OSMO\_SS7\_AS\_TMOD\_ROUNDROBIN,}
\DoxyCodeLine{266         \_NUM\_OSMO\_SS7\_ASP\_TMOD}
\DoxyCodeLine{267 \};}
\DoxyCodeLine{268 }
\DoxyCodeLine{269 \textcolor{keyword}{extern} \textcolor{keyword}{struct }value\_string osmo\_ss7\_as\_traffic\_mode\_vals[];}
\DoxyCodeLine{270 }
\DoxyCodeLine{271 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *}
\DoxyCodeLine{272 osmo\_ss7\_as\_traffic\_mode\_name(\textcolor{keyword}{enum} osmo\_ss7\_as\_traffic\_mode mode)}
\DoxyCodeLine{273 \{}
\DoxyCodeLine{274         \textcolor{keywordflow}{return} get\_value\_string(osmo\_ss7\_as\_traffic\_mode\_vals, mode);}
\DoxyCodeLine{275 \}}
\DoxyCodeLine{276 }
\DoxyCodeLine{277 \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol \{}
\DoxyCodeLine{278         OSMO\_SS7\_ASP\_PROT\_NONE,}
\DoxyCodeLine{279         OSMO\_SS7\_ASP\_PROT\_SUA,}
\DoxyCodeLine{280         OSMO\_SS7\_ASP\_PROT\_M3UA,}
\DoxyCodeLine{281         OSMO\_SS7\_ASP\_PROT\_IPA,}
\DoxyCodeLine{282         \_NUM\_OSMO\_SS7\_ASP\_PROT}
\DoxyCodeLine{283 \};}
\DoxyCodeLine{284 }
\DoxyCodeLine{285 \textcolor{keyword}{extern} \textcolor{keyword}{struct }value\_string osmo\_ss7\_asp\_protocol\_vals[];}
\DoxyCodeLine{286 }
\DoxyCodeLine{287 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *}
\DoxyCodeLine{288 osmo\_ss7\_asp\_protocol\_name(\textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol mode)}
\DoxyCodeLine{289 \{}
\DoxyCodeLine{290         \textcolor{keywordflow}{return} get\_value\_string(osmo\_ss7\_asp\_protocol\_vals, mode);}
\DoxyCodeLine{291 \}}
\DoxyCodeLine{292 }
\DoxyCodeLine{293 \textcolor{keywordtype}{int} osmo\_ss7\_asp\_protocol\_port(\textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol prot);}
\DoxyCodeLine{294 }
\DoxyCodeLine{295 \textcolor{keyword}{enum} osmo\_ss7\_as\_patch\_sccp\_mode \{}
\DoxyCodeLine{296         OSMO\_SS7\_PATCH\_NONE, \textcolor{comment}{/* no patching of SCCP */}}
\DoxyCodeLine{297         OSMO\_SS7\_PATCH\_BOTH, \textcolor{comment}{/* patch both OPC and DPC into SCCP addresses */}}
\DoxyCodeLine{298 \};}
\DoxyCodeLine{299 }
\DoxyCodeLine{300 \textcolor{keyword}{struct }osmo\_ss7\_as \{}
\DoxyCodeLine{302         \textcolor{keyword}{struct }llist\_head list;}
\DoxyCodeLine{303         \textcolor{keyword}{struct }osmo\_ss7\_instance *inst;}
\DoxyCodeLine{304 }
\DoxyCodeLine{306         \textcolor{keyword}{struct }osmo\_fsm\_inst *fi;}
\DoxyCodeLine{307 }
\DoxyCodeLine{309         \textcolor{keywordtype}{bool} rkm\_dyn\_allocated;}
\DoxyCodeLine{310 }
\DoxyCodeLine{312         \textcolor{keywordtype}{bool} simple\_client\_allocated;}
\DoxyCodeLine{313 }
\DoxyCodeLine{315         \textcolor{keyword}{struct }rate\_ctr\_group *ctrg;}
\DoxyCodeLine{316 }
\DoxyCodeLine{317         \textcolor{keyword}{struct }\{}
\DoxyCodeLine{318                 \textcolor{keywordtype}{char} *name;}
\DoxyCodeLine{319                 \textcolor{keywordtype}{char} *description;}
\DoxyCodeLine{320                 \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol proto;}
\DoxyCodeLine{321                 \textcolor{keyword}{struct }osmo\_ss7\_routing\_key routing\_key;}
\DoxyCodeLine{322                 \textcolor{keyword}{enum} osmo\_ss7\_as\_traffic\_mode mode;}
\DoxyCodeLine{323                 \textcolor{comment}{/* traffic mode was configured by VTY / config file */}}
\DoxyCodeLine{324                 \textcolor{keywordtype}{bool} mode\_set\_by\_vty;}
\DoxyCodeLine{325                 \textcolor{comment}{/* traffic mode was configured by RKM (routing key management) or first ASPAC */}}
\DoxyCodeLine{326                 \textcolor{keywordtype}{bool} mode\_set\_by\_peer;}
\DoxyCodeLine{327                 uint32\_t recovery\_timeout\_msec;}
\DoxyCodeLine{328                 uint8\_t qos\_class;}
\DoxyCodeLine{329                 \textcolor{keyword}{struct }\{}
\DoxyCodeLine{330                         uint32\_t dpc;}
\DoxyCodeLine{331                         \textcolor{keyword}{enum} osmo\_ss7\_as\_patch\_sccp\_mode sccp\_mode;}
\DoxyCodeLine{332                 \} pc\_override;}
\DoxyCodeLine{333 }
\DoxyCodeLine{334                 \textcolor{keyword}{struct }osmo\_ss7\_asp *asps[16];}
\DoxyCodeLine{335                 uint8\_t last\_asp\_idx\_sent; \textcolor{comment}{/* used for load-\/sharing traffic mode (round robin implementation) */}}
\DoxyCodeLine{336         \} cfg;}
\DoxyCodeLine{337 \};}
\DoxyCodeLine{338 }
\DoxyCodeLine{339 \textcolor{keyword}{struct }osmo\_ss7\_as *}
\DoxyCodeLine{340 osmo\_ss7\_as\_find\_by\_name(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name);}
\DoxyCodeLine{341 \textcolor{keyword}{struct }osmo\_ss7\_as *}
\DoxyCodeLine{342 osmo\_ss7\_as\_find\_by\_rctx(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst, uint32\_t rctx);}
\DoxyCodeLine{343 \textcolor{keyword}{struct }osmo\_ss7\_as *}
\DoxyCodeLine{344 osmo\_ss7\_as\_find\_by\_l\_rk\_id(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst, uint32\_t l\_rk\_id);}
\DoxyCodeLine{345 \textcolor{keyword}{struct }osmo\_ss7\_as *osmo\_ss7\_as\_find\_by\_proto(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst,}
\DoxyCodeLine{346                                               \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol proto);}
\DoxyCodeLine{347 \textcolor{keyword}{struct }osmo\_ss7\_as *}
\DoxyCodeLine{348 osmo\_ss7\_as\_find\_or\_create(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name,}
\DoxyCodeLine{349                           \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol proto);}
\DoxyCodeLine{350 \textcolor{keywordtype}{int} osmo\_ss7\_as\_add\_asp(\textcolor{keyword}{struct} osmo\_ss7\_as *as, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *asp\_name);}
\DoxyCodeLine{351 \textcolor{keywordtype}{int} osmo\_ss7\_as\_del\_asp(\textcolor{keyword}{struct} osmo\_ss7\_as *as, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *asp\_name);}
\DoxyCodeLine{352 \textcolor{keywordtype}{void} osmo\_ss7\_as\_destroy(\textcolor{keyword}{struct} osmo\_ss7\_as *as);}
\DoxyCodeLine{353 \textcolor{keywordtype}{bool} osmo\_ss7\_as\_has\_asp(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_as *as,}
\DoxyCodeLine{354                          \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_asp *asp);}
\DoxyCodeLine{355 \textcolor{keywordtype}{bool} osmo\_ss7\_as\_down(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_as *as);}
\DoxyCodeLine{356 \textcolor{keywordtype}{bool} osmo\_ss7\_as\_active(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_as *as);}
\DoxyCodeLine{357 \textcolor{keywordtype}{bool} osmo\_ss7\_as\_tmode\_compatible\_xua(\textcolor{keyword}{struct} osmo\_ss7\_as *as, uint32\_t m3ua\_tmt);}
\DoxyCodeLine{358 \textcolor{keywordtype}{void} osmo\_ss7\_asp\_disconnect(\textcolor{keyword}{struct} osmo\_ss7\_asp *asp);}
\DoxyCodeLine{359 }
\DoxyCodeLine{360 }
\DoxyCodeLine{361 \textcolor{comment}{/***********************************************************************}}
\DoxyCodeLine{362 \textcolor{comment}{ * SS7 Application Server Processes}}
\DoxyCodeLine{363 \textcolor{comment}{ ***********************************************************************/}}
\DoxyCodeLine{364 }
\DoxyCodeLine{365 \textcolor{keyword}{struct }osmo\_ss7\_asp\_peer \{}
\DoxyCodeLine{366         \textcolor{keywordtype}{char} *host[OSMO\_SOCK\_MAX\_ADDRS];}
\DoxyCodeLine{367         \textcolor{keywordtype}{size\_t} host\_cnt;}
\DoxyCodeLine{368         uint16\_t port;}
\DoxyCodeLine{369         \textcolor{comment}{/* index in "{}hosts"{} array marking the SCTP Primary Address, -\/1 if no explicit Primary Address set */}}
\DoxyCodeLine{370         \textcolor{keywordtype}{int} idx\_primary;}
\DoxyCodeLine{371 \};}
\DoxyCodeLine{372 }
\DoxyCodeLine{373 \textcolor{keyword}{enum} osmo\_ss7\_asp\_admin\_state \{}
\DoxyCodeLine{375         OSMO\_SS7\_ASP\_ADM\_S\_SHUTDOWN,}
\DoxyCodeLine{377         OSMO\_SS7\_ASP\_ADM\_S\_BLOCKED,}
\DoxyCodeLine{379         OSMO\_SS7\_ASP\_ADM\_S\_ENABLED,}
\DoxyCodeLine{380 \};}
\DoxyCodeLine{381 }
\DoxyCodeLine{382 \textcolor{keyword}{enum} osmo\_ss7\_asp\_role \{}
\DoxyCodeLine{383         OSMO\_SS7\_ASP\_ROLE\_ASP,}
\DoxyCodeLine{384         OSMO\_SS7\_ASP\_ROLE\_SG,}
\DoxyCodeLine{385         OSMO\_SS7\_ASP\_ROLE\_IPSP,}
\DoxyCodeLine{386 \};}
\DoxyCodeLine{387 }
\DoxyCodeLine{388 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }value\_string osmo\_ss7\_asp\_role\_names[];}
\DoxyCodeLine{389 }
\DoxyCodeLine{390 \textcolor{keyword}{struct }osmo\_ss7\_asp \{}
\DoxyCodeLine{392         \textcolor{keyword}{struct }llist\_head list;}
\DoxyCodeLine{393         \textcolor{keyword}{struct }osmo\_ss7\_instance *inst;}
\DoxyCodeLine{394 }
\DoxyCodeLine{396         \textcolor{keyword}{struct }osmo\_fsm\_inst *fi;}
\DoxyCodeLine{397 }
\DoxyCodeLine{399         \textcolor{keyword}{struct }osmo\_xua\_server *xua\_server;}
\DoxyCodeLine{400         \textcolor{keyword}{struct }llist\_head siblings;}
\DoxyCodeLine{401 }
\DoxyCodeLine{403         \textcolor{keyword}{struct }osmo\_stream\_cli *client;}
\DoxyCodeLine{404         \textcolor{keyword}{struct }osmo\_stream\_srv *server;}
\DoxyCodeLine{406         \textcolor{keywordtype}{char} *sock\_name;}
\DoxyCodeLine{407 }
\DoxyCodeLine{408         \textcolor{comment}{/* ASP Identifier for ASP-\/UP + NTFY */}}
\DoxyCodeLine{409         uint32\_t asp\_id;}
\DoxyCodeLine{410         \textcolor{keywordtype}{bool} asp\_id\_present;}
\DoxyCodeLine{411 }
\DoxyCodeLine{412         \textcolor{comment}{/* Layer Manager to which we talk */}}
\DoxyCodeLine{413         \textcolor{keyword}{const} \textcolor{keyword}{struct }osmo\_xua\_layer\_manager *lm;}
\DoxyCodeLine{414         \textcolor{keywordtype}{void} *lm\_priv;}
\DoxyCodeLine{415 }
\DoxyCodeLine{417         \textcolor{keywordtype}{bool} dyn\_allocated;}
\DoxyCodeLine{418 }
\DoxyCodeLine{420         \textcolor{keywordtype}{bool} simple\_client\_allocated;}
\DoxyCodeLine{421 }
\DoxyCodeLine{423         \textcolor{keyword}{struct }rate\_ctr\_group *ctrg;}
\DoxyCodeLine{424 }
\DoxyCodeLine{426         \textcolor{keyword}{struct }msgb *pending\_msg;}
\DoxyCodeLine{427 }
\DoxyCodeLine{428         \textcolor{keyword}{struct }\{}
\DoxyCodeLine{429                 \textcolor{keywordtype}{char} *name;}
\DoxyCodeLine{430                 \textcolor{keywordtype}{char} *description;}
\DoxyCodeLine{431                 \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol proto;}
\DoxyCodeLine{432                 \textcolor{keyword}{enum} osmo\_ss7\_asp\_admin\_state adm\_state;}
\DoxyCodeLine{433                 \textcolor{keywordtype}{bool} is\_server;}
\DoxyCodeLine{434                 \textcolor{keyword}{enum} osmo\_ss7\_asp\_role role;}
\DoxyCodeLine{435                 \textcolor{keywordtype}{bool} role\_set\_by\_vty;}
\DoxyCodeLine{436                 \textcolor{keywordtype}{bool} trans\_role\_set\_by\_vty;}
\DoxyCodeLine{437 }
\DoxyCodeLine{438                 \textcolor{keyword}{struct }osmo\_ss7\_asp\_peer local;}
\DoxyCodeLine{439                 \textcolor{keyword}{struct }osmo\_ss7\_asp\_peer remote;}
\DoxyCodeLine{440                 uint8\_t qos\_class;}
\DoxyCodeLine{441                 uint32\_t quirks;}
\DoxyCodeLine{442 }
\DoxyCodeLine{443                 \textcolor{comment}{/* T\_defs used by the default\_lm: */}}
\DoxyCodeLine{444                 \textcolor{keyword}{struct }osmo\_tdef *T\_defs\_lm;}
\DoxyCodeLine{445 }
\DoxyCodeLine{446                 \textcolor{keyword}{struct }\{}
\DoxyCodeLine{447                         \textcolor{keywordtype}{bool} num\_ostreams\_present;}
\DoxyCodeLine{448                         \textcolor{keywordtype}{bool} max\_instreams\_present;}
\DoxyCodeLine{449                         \textcolor{keywordtype}{bool} max\_attempts\_present;}
\DoxyCodeLine{450                         \textcolor{keywordtype}{bool} max\_init\_timeo\_present;}
\DoxyCodeLine{451                         uint16\_t num\_ostreams\_value;}
\DoxyCodeLine{452                         uint16\_t max\_instreams\_value;}
\DoxyCodeLine{453                         uint16\_t max\_attempts\_value;}
\DoxyCodeLine{454                         uint16\_t max\_init\_timeo\_value; \textcolor{comment}{/* ms */}}
\DoxyCodeLine{455                 \} sctp\_init;}
\DoxyCodeLine{456 }
\DoxyCodeLine{458                 \textcolor{keywordtype}{int} trans\_proto;}
\DoxyCodeLine{459         \} cfg;}
\DoxyCodeLine{460 \};}
\DoxyCodeLine{461 }
\DoxyCodeLine{463 \textcolor{preprocessor}{\#define OSMO\_SS7\_ASP\_QUIRK\_NO\_NOTIFY            0x00000001}}
\DoxyCodeLine{465 \textcolor{preprocessor}{\#define OSMO\_SS7\_ASP\_QUIRK\_DAUD\_IN\_ASP          0x00000002}}
\DoxyCodeLine{467 \textcolor{preprocessor}{\#define OSMO\_SS7\_ASP\_QUIRK\_SNM\_INACTIVE         0x00000004}}
\DoxyCodeLine{468 }
\DoxyCodeLine{469 \textcolor{keywordtype}{int} osmo\_ss7\_asp\_peer\_snprintf(\textcolor{keywordtype}{char}* buf, \textcolor{keywordtype}{size\_t} buf\_len, \textcolor{keyword}{struct} osmo\_ss7\_asp\_peer *peer);}
\DoxyCodeLine{470 \textcolor{keywordtype}{void} osmo\_ss7\_asp\_peer\_init(\textcolor{keyword}{struct} osmo\_ss7\_asp\_peer *peer);}
\DoxyCodeLine{471 \textcolor{keywordtype}{int} osmo\_ss7\_asp\_peer\_set\_hosts(\textcolor{keyword}{struct} osmo\_ss7\_asp\_peer *peer, \textcolor{keywordtype}{void} *talloc\_ctx,}
\DoxyCodeLine{472                                 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *\textcolor{keyword}{const}*hosts, \textcolor{keywordtype}{size\_t} host\_cnt);}
\DoxyCodeLine{473 \textcolor{keywordtype}{int} osmo\_ss7\_asp\_peer\_set\_hosts2(\textcolor{keyword}{struct} osmo\_ss7\_asp\_peer *peer, \textcolor{keywordtype}{void} *talloc\_ctx,}
\DoxyCodeLine{474                                 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *\textcolor{keyword}{const}*hosts, \textcolor{keywordtype}{size\_t} host\_cnt, \textcolor{keywordtype}{int} idx\_primary);}
\DoxyCodeLine{475 \textcolor{keywordtype}{int} osmo\_ss7\_asp\_peer\_add\_host(\textcolor{keyword}{struct} osmo\_ss7\_asp\_peer *peer, \textcolor{keywordtype}{void} *talloc\_ctx, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *host);}
\DoxyCodeLine{476 \textcolor{keywordtype}{int} osmo\_ss7\_asp\_peer\_add\_host2(\textcolor{keyword}{struct} osmo\_ss7\_asp\_peer *peer, \textcolor{keywordtype}{void} *talloc\_ctx, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *host, \textcolor{keywordtype}{bool} is\_primary\_addr);}
\DoxyCodeLine{477 \textcolor{keywordtype}{int} osmo\_ss7\_asp\_peer\_del\_host(\textcolor{keyword}{struct} osmo\_ss7\_asp\_peer *peer, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *host);}
\DoxyCodeLine{478 }
\DoxyCodeLine{479 }
\DoxyCodeLine{480 \textcolor{keyword}{struct }osmo\_ss7\_asp *}
\DoxyCodeLine{481 osmo\_ss7\_asp\_find\_by\_name(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name);}
\DoxyCodeLine{482 \textcolor{keyword}{struct }osmo\_ss7\_asp *}
\DoxyCodeLine{483 osmo\_ss7\_asp\_find\_by\_proto(\textcolor{keyword}{struct} osmo\_ss7\_as *as,}
\DoxyCodeLine{484                            \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol proto);}
\DoxyCodeLine{485 \textcolor{keyword}{struct }osmo\_ss7\_asp *}
\DoxyCodeLine{486 osmo\_ss7\_asp\_find(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name,}
\DoxyCodeLine{487                   uint16\_t remote\_port, uint16\_t local\_port,}
\DoxyCodeLine{488                   \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol proto)}
\DoxyCodeLine{489         OSMO\_DEPRECATED(\textcolor{stringliteral}{"{}Use osmo\_ss7\_asp\_find2() instead"{}});}
\DoxyCodeLine{490 \textcolor{keyword}{struct }osmo\_ss7\_asp *}
\DoxyCodeLine{491 osmo\_ss7\_asp\_find2(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name,}
\DoxyCodeLine{492                    uint16\_t remote\_port, uint16\_t local\_port,}
\DoxyCodeLine{493                    \textcolor{keywordtype}{int} trans\_proto, \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol proto);}
\DoxyCodeLine{494 \textcolor{keyword}{struct }osmo\_ss7\_asp *}
\DoxyCodeLine{495 osmo\_ss7\_asp\_find\_or\_create(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name,}
\DoxyCodeLine{496                             uint16\_t remote\_port, uint16\_t local\_port,}
\DoxyCodeLine{497                             \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol proto)}
\DoxyCodeLine{498         OSMO\_DEPRECATED(\textcolor{stringliteral}{"{}Use osmo\_ss7\_asp\_find\_or\_create2() instead"{}});}
\DoxyCodeLine{499 \textcolor{keyword}{struct }osmo\_ss7\_asp *}
\DoxyCodeLine{500 osmo\_ss7\_asp\_find\_or\_create2(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name,}
\DoxyCodeLine{501                              uint16\_t remote\_port, uint16\_t local\_port,}
\DoxyCodeLine{502                              \textcolor{keywordtype}{int} trans\_proto, \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol proto);}
\DoxyCodeLine{503 \textcolor{keywordtype}{void} osmo\_ss7\_asp\_destroy(\textcolor{keyword}{struct} osmo\_ss7\_asp *asp);}
\DoxyCodeLine{504 \textcolor{keywordtype}{int} osmo\_ss7\_asp\_send(\textcolor{keyword}{struct} osmo\_ss7\_asp *asp, \textcolor{keyword}{struct} msgb *msg);}
\DoxyCodeLine{505 \textcolor{keywordtype}{int} osmo\_ss7\_asp\_restart(\textcolor{keyword}{struct} osmo\_ss7\_asp *asp);}
\DoxyCodeLine{506 \textcolor{keywordtype}{int} osmo\_ss7\_asp\_use\_default\_lm(\textcolor{keyword}{struct} osmo\_ss7\_asp *asp, \textcolor{keywordtype}{int} log\_level);}
\DoxyCodeLine{507 \textcolor{keywordtype}{bool} osmo\_ss7\_asp\_active(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_asp *asp);}
\DoxyCodeLine{508 \textcolor{keywordtype}{int} osmo\_ss7\_asp\_get\_log\_subsys(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_asp *asp);}
\DoxyCodeLine{509 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_ss7\_asp\_get\_name(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_asp *asp);}
\DoxyCodeLine{510 \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol osmo\_ss7\_asp\_get\_proto(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_asp *asp);}
\DoxyCodeLine{511 \textcolor{keywordtype}{int} osmo\_ss7\_asp\_get\_trans\_proto(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_asp *asp);}
\DoxyCodeLine{512 }
\DoxyCodeLine{520 \textcolor{keyword}{typedef} \textcolor{keywordtype}{int} osmo\_ss7\_asp\_rx\_unknown\_cb(\textcolor{keyword}{struct} osmo\_ss7\_asp *asp, \textcolor{keywordtype}{int} ppid\_mux, \textcolor{keyword}{struct} msgb *msg);}
\DoxyCodeLine{521 }
\DoxyCodeLine{522 \textcolor{keywordtype}{void} osmo\_ss7\_register\_rx\_unknown\_cb(osmo\_ss7\_asp\_rx\_unknown\_cb *cb);}
\DoxyCodeLine{523 }
\DoxyCodeLine{524 \textcolor{preprocessor}{\#define \_LOGSS7(inst, subsys, level, fmt, args ...)      \(\backslash\)}}
\DoxyCodeLine{525 \textcolor{preprocessor}{        LOGP(subsys, level, "{}\%u: "{}} fmt, inst ? (inst)-\/>cfg.id : 0, \#\# args)}
\DoxyCodeLine{526 \textcolor{preprocessor}{\#define LOGSS7(inst, level, fmt, args ...)      \_LOGSS7(inst, DLSS7, level, fmt, \#\# args)}}
\DoxyCodeLine{527 }
\DoxyCodeLine{528 \textcolor{preprocessor}{\#define LOGPASP(asp, subsys, level, fmt, args ...)              \(\backslash\)}}
\DoxyCodeLine{529 \textcolor{preprocessor}{        \_LOGSS7((asp)-\/>inst, subsys, level, "{}asp-\/\%s: "{}} fmt, (asp)-\/>cfg.name, \#\# args)}
\DoxyCodeLine{530 \textcolor{preprocessor}{\#define LOGPAS(as, subsys, level, fmt, args ...)                \(\backslash\)}}
\DoxyCodeLine{531 \textcolor{preprocessor}{        \_LOGSS7((as)-\/>inst, subsys, level, "{}as-\/\%s: "{}} fmt, (as)-\/>cfg.name, \#\# args)}
\DoxyCodeLine{532 }
\DoxyCodeLine{533 \textcolor{comment}{/***********************************************************************}}
\DoxyCodeLine{534 \textcolor{comment}{ * xUA Servers}}
\DoxyCodeLine{535 \textcolor{comment}{ ***********************************************************************/}}
\DoxyCodeLine{536 }
\DoxyCodeLine{537 \textcolor{keyword}{struct }osmo\_xua\_layer\_manager \{}
\DoxyCodeLine{538         osmo\_prim\_cb prim\_cb;}
\DoxyCodeLine{539 \};}
\DoxyCodeLine{540 }
\DoxyCodeLine{541 \textcolor{keyword}{struct }osmo\_xua\_server \{}
\DoxyCodeLine{542         \textcolor{keyword}{struct }llist\_head list;}
\DoxyCodeLine{543         \textcolor{keyword}{struct }osmo\_ss7\_instance *inst;}
\DoxyCodeLine{544 }
\DoxyCodeLine{545         \textcolor{comment}{/* list of ASPs established via this server */}}
\DoxyCodeLine{546         \textcolor{keyword}{struct }llist\_head asp\_list;}
\DoxyCodeLine{547 }
\DoxyCodeLine{548         \textcolor{keyword}{struct }osmo\_stream\_srv\_link *server;}
\DoxyCodeLine{549 }
\DoxyCodeLine{550         \textcolor{keyword}{struct }\{}
\DoxyCodeLine{551                 \textcolor{keywordtype}{bool} accept\_dyn\_reg;}
\DoxyCodeLine{552                 \textcolor{keyword}{struct }osmo\_ss7\_asp\_peer local;}
\DoxyCodeLine{553                 \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol proto;}
\DoxyCodeLine{554                 \textcolor{keyword}{struct }\{}
\DoxyCodeLine{555                         \textcolor{keywordtype}{bool} num\_ostreams\_present;}
\DoxyCodeLine{556                         \textcolor{keywordtype}{bool} max\_instreams\_present;}
\DoxyCodeLine{557                         uint16\_t num\_ostreams\_value;}
\DoxyCodeLine{558                         uint16\_t max\_instreams\_value;}
\DoxyCodeLine{559                 \} sctp\_init;}
\DoxyCodeLine{560 }
\DoxyCodeLine{562                 \textcolor{keywordtype}{int} trans\_proto;}
\DoxyCodeLine{563         \} cfg;}
\DoxyCodeLine{564 \};}
\DoxyCodeLine{565 }
\DoxyCodeLine{566 \textcolor{keyword}{struct }osmo\_xua\_server *}
\DoxyCodeLine{567 osmo\_ss7\_xua\_server\_find(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst,}
\DoxyCodeLine{568                          \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol proto,}
\DoxyCodeLine{569                          uint16\_t local\_port)}
\DoxyCodeLine{570         OSMO\_DEPRECATED(\textcolor{stringliteral}{"{}Use osmo\_ss7\_xua\_server\_find2() instead"{}});}
\DoxyCodeLine{571 \textcolor{keyword}{struct }osmo\_xua\_server *}
\DoxyCodeLine{572 osmo\_ss7\_xua\_server\_find2(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst,}
\DoxyCodeLine{573                           \textcolor{keywordtype}{int} trans\_proto,}
\DoxyCodeLine{574                           \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol proto,}
\DoxyCodeLine{575                           uint16\_t local\_port);}
\DoxyCodeLine{576 }
\DoxyCodeLine{577 \textcolor{keyword}{struct }osmo\_xua\_server *}
\DoxyCodeLine{578 osmo\_ss7\_xua\_server\_create(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst,}
\DoxyCodeLine{579                            \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol proto,}
\DoxyCodeLine{580                            uint16\_t local\_port, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *local\_host)}
\DoxyCodeLine{581         OSMO\_DEPRECATED(\textcolor{stringliteral}{"{}Use osmo\_ss7\_xua\_server\_create2() instead"{}});}
\DoxyCodeLine{582 \textcolor{keyword}{struct }osmo\_xua\_server *}
\DoxyCodeLine{583 osmo\_ss7\_xua\_server\_create2(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst,}
\DoxyCodeLine{584                             \textcolor{keywordtype}{int} trans\_proto, \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol proto,}
\DoxyCodeLine{585                             uint16\_t local\_port, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *local\_host);}
\DoxyCodeLine{586 }
\DoxyCodeLine{587 \textcolor{keywordtype}{int}}
\DoxyCodeLine{588 osmo\_ss7\_xua\_server\_bind(\textcolor{keyword}{struct} osmo\_xua\_server *xs);}
\DoxyCodeLine{589 }
\DoxyCodeLine{590 \textcolor{keywordtype}{int}}
\DoxyCodeLine{591 osmo\_ss7\_xua\_server\_set\_local\_host(\textcolor{keyword}{struct} osmo\_xua\_server *xs, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *local\_host);}
\DoxyCodeLine{592 \textcolor{keywordtype}{int}}
\DoxyCodeLine{593 osmo\_ss7\_xua\_server\_set\_local\_hosts(\textcolor{keyword}{struct} osmo\_xua\_server *xs, \textcolor{keyword}{const} \textcolor{keywordtype}{char} **local\_hosts, \textcolor{keywordtype}{size\_t} local\_host\_cnt);}
\DoxyCodeLine{594 \textcolor{keywordtype}{int} osmo\_ss7\_xua\_server\_add\_local\_host(\textcolor{keyword}{struct} osmo\_xua\_server *xs, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *local\_host);}
\DoxyCodeLine{595 \textcolor{keywordtype}{int} osmo\_ss7\_xua\_server\_del\_local\_host(\textcolor{keyword}{struct} osmo\_xua\_server *xs, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *local\_host);}
\DoxyCodeLine{596 \textcolor{keywordtype}{void} osmo\_ss7\_xua\_server\_destroy(\textcolor{keyword}{struct} osmo\_xua\_server *xs);}
\DoxyCodeLine{597 }
\DoxyCodeLine{598 \textcolor{keyword}{struct }osmo\_sccp\_instance *}
\DoxyCodeLine{599 osmo\_sccp\_simple\_client(\textcolor{keywordtype}{void} *ctx, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name, uint32\_t default\_pc,}
\DoxyCodeLine{600                         \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol prot, \textcolor{keywordtype}{int} default\_local\_port,}
\DoxyCodeLine{601                         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *default\_local\_ip, \textcolor{keywordtype}{int} default\_remote\_port,}
\DoxyCodeLine{602                         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *default\_remote\_ip);}
\DoxyCodeLine{603 }
\DoxyCodeLine{604 \textcolor{keyword}{struct }osmo\_sccp\_instance *}
\DoxyCodeLine{605 osmo\_sccp\_simple\_client\_on\_ss7\_id(\textcolor{keywordtype}{void} *ctx, uint32\_t ss7\_id, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name,}
\DoxyCodeLine{606                                   uint32\_t default\_pc,}
\DoxyCodeLine{607                                   \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol prot,}
\DoxyCodeLine{608                                   \textcolor{keywordtype}{int} default\_local\_port,}
\DoxyCodeLine{609                                   \textcolor{keyword}{const} \textcolor{keywordtype}{char} *default\_local\_ip,}
\DoxyCodeLine{610                                   \textcolor{keywordtype}{int} default\_remote\_port,}
\DoxyCodeLine{611                                   \textcolor{keyword}{const} \textcolor{keywordtype}{char} *default\_remote\_ip);}
\DoxyCodeLine{612 }
\DoxyCodeLine{613 \textcolor{keyword}{struct }osmo\_sccp\_instance *}
\DoxyCodeLine{614 osmo\_sccp\_simple\_server(\textcolor{keywordtype}{void} *ctx, uint32\_t pc,}
\DoxyCodeLine{615                         \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol prot, \textcolor{keywordtype}{int} local\_port,}
\DoxyCodeLine{616                         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *local\_ip);}
\DoxyCodeLine{617 }
\DoxyCodeLine{618 \textcolor{keyword}{struct }osmo\_sccp\_instance *}
\DoxyCodeLine{619 osmo\_sccp\_simple\_server\_on\_ss7\_id(\textcolor{keywordtype}{void} *ctx, uint32\_t ss7\_id, uint32\_t pc,}
\DoxyCodeLine{620                                   \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol prot,}
\DoxyCodeLine{621                                   \textcolor{keywordtype}{int} local\_port, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *local\_ip);}
\DoxyCodeLine{622 }
\DoxyCodeLine{623 \textcolor{keyword}{struct }osmo\_sccp\_instance *}
\DoxyCodeLine{624 osmo\_sccp\_simple\_server\_add\_clnt(\textcolor{keyword}{struct} osmo\_sccp\_instance *inst,}
\DoxyCodeLine{625                                  \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol prot,}
\DoxyCodeLine{626                                  \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name, uint32\_t pc,}
\DoxyCodeLine{627                                  \textcolor{keywordtype}{int} local\_port, \textcolor{keywordtype}{int} remote\_port,}
\DoxyCodeLine{628                                  \textcolor{keyword}{const} \textcolor{keywordtype}{char} *remote\_ip);}
\DoxyCodeLine{629 }
\DoxyCodeLine{630 \textcolor{keywordtype}{void} osmo\_sccp\_set\_max\_optional\_data(\textcolor{keyword}{struct} osmo\_sccp\_instance *inst, \textcolor{keywordtype}{int} val);}
\DoxyCodeLine{631 }
\DoxyCodeLine{632 \textcolor{keyword}{enum} osmo\_ss7\_as\_traffic\_mode osmo\_ss7\_tmode\_from\_xua(uint32\_t in);}
\DoxyCodeLine{633 \textcolor{keywordtype}{int} osmo\_ss7\_tmode\_to\_xua(\textcolor{keyword}{enum} osmo\_ss7\_as\_traffic\_mode tmod);}
\DoxyCodeLine{634 }
\DoxyCodeLine{635 \textcolor{comment}{/* VTY related */}}
\DoxyCodeLine{636 \textcolor{keyword}{struct }vty;}
\DoxyCodeLine{637 \textcolor{keywordtype}{void} osmo\_ss7\_vty\_init\_asp(\textcolor{keywordtype}{void} *ctx);}
\DoxyCodeLine{638 \textcolor{keywordtype}{void} osmo\_ss7\_vty\_init\_sg(\textcolor{keywordtype}{void} *ctx);}
\DoxyCodeLine{639 \textcolor{keywordtype}{int} osmo\_ss7\_vty\_go\_parent(\textcolor{keyword}{struct} vty *vty);}
\DoxyCodeLine{640 \textcolor{keywordtype}{int} osmo\_ss7\_is\_config\_node(\textcolor{keyword}{struct} vty *vty, \textcolor{keywordtype}{int} node);}

\end{DoxyCode}
