\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{comment}{/* Maximum number of supported RCTXs present in RFC4666 Routing Context IE. */}}
\DoxyCodeLine{15 \textcolor{preprocessor}{\#define OSMO\_SS7\_MAX\_RCTX\_COUNT 128}}
\DoxyCodeLine{16 }
\DoxyCodeLine{17 \textcolor{keyword}{struct }osmo\_ss7\_instance;}
\DoxyCodeLine{18 }
\DoxyCodeLine{19 \textcolor{keyword}{extern} \textcolor{keyword}{struct }llist\_head osmo\_ss7\_instances;}
\DoxyCodeLine{20 \textcolor{comment}{/* Get an entry pointer from a list item in osmo\_ss7\_instances: */}}
\DoxyCodeLine{21 \textcolor{keyword}{struct }osmo\_ss7\_instance *osmo\_ss7\_instances\_llist\_entry(\textcolor{keyword}{struct} llist\_head *list);}
\DoxyCodeLine{22 }
\DoxyCodeLine{23 \textcolor{keywordtype}{int} osmo\_ss7\_init(\textcolor{keywordtype}{void});}
\DoxyCodeLine{24 }
\DoxyCodeLine{25 \textcolor{comment}{/* All known point-\/code formats have a length of or below 24 bit.}}
\DoxyCodeLine{26 \textcolor{comment}{ * A point-\/code value exceeding that is used to indicate an unset PC. */}}
\DoxyCodeLine{27 \textcolor{preprocessor}{\#define OSMO\_SS7\_PC\_INVALID 0xffffffff}}
\DoxyCodeLine{28 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{bool} osmo\_ss7\_pc\_is\_valid(uint32\_t pc)}
\DoxyCodeLine{29 \{}
\DoxyCodeLine{30         \textcolor{keywordflow}{return} pc <= 0x00ffffff;}
\DoxyCodeLine{31 \}}
\DoxyCodeLine{32 }
\DoxyCodeLine{33 \textcolor{comment}{/***********************************************************************}}
\DoxyCodeLine{34 \textcolor{comment}{ * xUA Servers}}
\DoxyCodeLine{35 \textcolor{comment}{ ***********************************************************************/}}
\DoxyCodeLine{36 }
\DoxyCodeLine{37 \textcolor{keyword}{struct }osmo\_xua\_layer\_manager;}
\DoxyCodeLine{38 }
\DoxyCodeLine{39 \textcolor{keyword}{struct }osmo\_xua\_server;}
\DoxyCodeLine{40 }
\DoxyCodeLine{41 \textcolor{comment}{/***********************************************************************}}
\DoxyCodeLine{42 \textcolor{comment}{ * SS7 Instances}}
\DoxyCodeLine{43 \textcolor{comment}{ ***********************************************************************/}}
\DoxyCodeLine{44 }
\DoxyCodeLine{45 \textcolor{keyword}{struct }osmo\_ss7\_pc\_fmt;}
\DoxyCodeLine{46 \textcolor{keyword}{struct }osmo\_ss7\_instance;}
\DoxyCodeLine{47 }
\DoxyCodeLine{48 \textcolor{keyword}{struct }osmo\_ss7\_instance *osmo\_ss7\_instance\_find(uint32\_t \textcolor{keywordtype}{id});}
\DoxyCodeLine{49 \textcolor{keyword}{struct }osmo\_ss7\_instance *}
\DoxyCodeLine{50 osmo\_ss7\_instance\_find\_or\_create(\textcolor{keywordtype}{void} *ctx, uint32\_t \textcolor{keywordtype}{id});}
\DoxyCodeLine{51 \textcolor{keywordtype}{void} osmo\_ss7\_instance\_destroy(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst);}
\DoxyCodeLine{52 }
\DoxyCodeLine{53 uint32\_t osmo\_ss7\_instance\_get\_id(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_instance *inst);}
\DoxyCodeLine{54 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_ss7\_instance\_get\_name(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_instance *inst);}
\DoxyCodeLine{55 }
\DoxyCodeLine{56 \textcolor{keywordtype}{int} osmo\_ss7\_instance\_set\_pc\_fmt(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst,}
\DoxyCodeLine{57                                 uint8\_t c0, uint8\_t c1, uint8\_t c2);}
\DoxyCodeLine{58 \textcolor{keyword}{const} \textcolor{keyword}{struct }osmo\_ss7\_pc\_fmt *}
\DoxyCodeLine{59 osmo\_ss7\_instance\_get\_pc\_fmt(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_instance *inst);}
\DoxyCodeLine{60 }
\DoxyCodeLine{61 uint32\_t osmo\_ss7\_instance\_get\_primary\_pc(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_instance *inst);}
\DoxyCodeLine{62 uint8\_t osmo\_ss7\_instance\_get\_network\_indicator(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_instance *inst);}
\DoxyCodeLine{63 }
\DoxyCodeLine{64 \textcolor{keyword}{struct }osmo\_sccp\_instance *osmo\_ss7\_ensure\_sccp(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst);}
\DoxyCodeLine{65 \textcolor{keyword}{struct }osmo\_sccp\_instance *osmo\_ss7\_get\_sccp(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_instance *inst);}
\DoxyCodeLine{66 }
\DoxyCodeLine{67 \textcolor{keywordtype}{int} osmo\_ss7\_find\_free\_rctx(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst);}
\DoxyCodeLine{68 }
\DoxyCodeLine{69 \textcolor{keywordtype}{bool} osmo\_ss7\_pc\_is\_local(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_instance *inst, uint32\_t pc);}
\DoxyCodeLine{70 \textcolor{keywordtype}{int} osmo\_ss7\_pointcode\_parse(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_instance *inst, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *str);}
\DoxyCodeLine{71 \textcolor{keywordtype}{int} osmo\_ss7\_pointcode\_parse\_mask\_or\_len(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_instance *inst, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *in);}
\DoxyCodeLine{72 \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{73 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_ss7\_pointcode\_print(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_instance *inst, uint32\_t pc);}
\DoxyCodeLine{74 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_ss7\_pointcode\_print2(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_instance *inst, uint32\_t pc);}
\DoxyCodeLine{75 }
\DoxyCodeLine{76 uint8\_t osmo\_ss7\_pc\_width(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_pc\_fmt *pc\_fmt);}
\DoxyCodeLine{77 uint32\_t osmo\_ss7\_pc\_normalize(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_pc\_fmt *pc\_fmt, uint32\_t pc);}
\DoxyCodeLine{78 }
\DoxyCodeLine{79 \textcolor{comment}{/***********************************************************************}}
\DoxyCodeLine{80 \textcolor{comment}{ * MTP Users (Users of MTP, such as SCCP or ISUP)}}
\DoxyCodeLine{81 \textcolor{comment}{ ***********************************************************************/}}
\DoxyCodeLine{82 }
\DoxyCodeLine{83 \textcolor{keyword}{struct }osmo\_ss7\_user;}
\DoxyCodeLine{84 \textcolor{keyword}{struct }osmo\_mtp\_prim;}
\DoxyCodeLine{85 }
\DoxyCodeLine{86 }
\DoxyCodeLine{87 \textcolor{keyword}{struct }osmo\_ss7\_user *osmo\_ss7\_user\_create(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name);}
\DoxyCodeLine{88 \textcolor{keywordtype}{void} osmo\_ss7\_user\_destroy(\textcolor{keyword}{struct} osmo\_ss7\_user *user);}
\DoxyCodeLine{89 }
\DoxyCodeLine{90 \textcolor{keyword}{struct }osmo\_ss7\_instance *osmo\_ss7\_user\_get\_instance(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_user *user);}
\DoxyCodeLine{91 \textcolor{keywordtype}{void} osmo\_ss7\_user\_set\_prim\_cb(\textcolor{keyword}{struct} osmo\_ss7\_user *user, osmo\_prim\_cb prim\_cb);}
\DoxyCodeLine{92 \textcolor{keywordtype}{void} osmo\_ss7\_user\_set\_priv(\textcolor{keyword}{struct} osmo\_ss7\_user *user, \textcolor{keywordtype}{void} *priv);}
\DoxyCodeLine{93 \textcolor{keywordtype}{void} *osmo\_ss7\_user\_get\_priv(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_user *user);}
\DoxyCodeLine{94 }
\DoxyCodeLine{95 \textcolor{keywordtype}{int} osmo\_ss7\_user\_register(\textcolor{keyword}{struct} osmo\_ss7\_user *user, uint8\_t service\_ind);}
\DoxyCodeLine{96 \textcolor{keywordtype}{int} osmo\_ss7\_user\_unregister(\textcolor{keyword}{struct} osmo\_ss7\_user *user, uint8\_t service\_ind);}
\DoxyCodeLine{97 }
\DoxyCodeLine{98 \textcolor{keyword}{struct }osmo\_ss7\_user *osmo\_ss7\_user\_find\_by\_si(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_instance *inst, uint8\_t service\_indicator);}
\DoxyCodeLine{99 }
\DoxyCodeLine{100 \textcolor{comment}{/* MTP User wants to submit a primitive down to MTP SAP */}}
\DoxyCodeLine{101 \textcolor{keywordtype}{int} osmo\_ss7\_user\_mtp\_sap\_prim\_down(\textcolor{keyword}{struct} osmo\_ss7\_user *user,}
\DoxyCodeLine{102                                     \textcolor{keyword}{struct} osmo\_mtp\_prim *omp);}
\DoxyCodeLine{103 }
\DoxyCodeLine{104 \textcolor{comment}{/***********************************************************************}}
\DoxyCodeLine{105 \textcolor{comment}{ * SCCP Instance}}
\DoxyCodeLine{106 \textcolor{comment}{ ***********************************************************************/}}
\DoxyCodeLine{107 }
\DoxyCodeLine{108 \textcolor{keyword}{struct }osmo\_sccp\_instance;}
\DoxyCodeLine{109 }
\DoxyCodeLine{110 \textcolor{keywordtype}{void} osmo\_sccp\_set\_max\_optional\_data(\textcolor{keyword}{struct} osmo\_sccp\_instance *inst, \textcolor{keywordtype}{int} val);}
\DoxyCodeLine{111 }
\DoxyCodeLine{112 \textcolor{comment}{/***********************************************************************}}
\DoxyCodeLine{113 \textcolor{comment}{ * SS7 Links}}
\DoxyCodeLine{114 \textcolor{comment}{ ***********************************************************************/}}
\DoxyCodeLine{115 }
\DoxyCodeLine{116 \textcolor{keyword}{struct }osmo\_ss7\_link;}
\DoxyCodeLine{117 }
\DoxyCodeLine{118 \textcolor{comment}{/***********************************************************************}}
\DoxyCodeLine{119 \textcolor{comment}{ * SS7 Linksets}}
\DoxyCodeLine{120 \textcolor{comment}{ ***********************************************************************/}}
\DoxyCodeLine{121 }
\DoxyCodeLine{122 \textcolor{keyword}{struct }osmo\_ss7\_linkset;}
\DoxyCodeLine{123 }
\DoxyCodeLine{124 \textcolor{comment}{/***********************************************************************}}
\DoxyCodeLine{125 \textcolor{comment}{ * SS7 Routes}}
\DoxyCodeLine{126 \textcolor{comment}{ ***********************************************************************/}}
\DoxyCodeLine{127 }
\DoxyCodeLine{128 \textcolor{keyword}{struct }osmo\_ss7\_route;}
\DoxyCodeLine{129 }
\DoxyCodeLine{130 \textcolor{keyword}{struct }osmo\_ss7\_route *}
\DoxyCodeLine{131 osmo\_ss7\_route\_lookup(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst, uint32\_t dpc)}
\DoxyCodeLine{132         OSMO\_DEPRECATED(\textcolor{stringliteral}{"{}Use internal ss7\_instance\_lookup\_route() instead"{}});}
\DoxyCodeLine{133 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_ss7\_route\_print(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_route *rt);}
\DoxyCodeLine{134 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_ss7\_route\_name(\textcolor{keyword}{struct} osmo\_ss7\_route *rt, \textcolor{keywordtype}{bool} list\_asps);}
\DoxyCodeLine{135 \textcolor{keyword}{struct }osmo\_ss7\_as *}
\DoxyCodeLine{136 osmo\_ss7\_route\_get\_dest\_as(\textcolor{keyword}{struct} osmo\_ss7\_route *rt);}
\DoxyCodeLine{137 }
\DoxyCodeLine{138 \textcolor{comment}{/***********************************************************************}}
\DoxyCodeLine{139 \textcolor{comment}{ * SS7 Routing key}}
\DoxyCodeLine{140 \textcolor{comment}{ ***********************************************************************/}}
\DoxyCodeLine{141 }
\DoxyCodeLine{142 \textcolor{keyword}{struct }osmo\_ss7\_routing\_key \{}
\DoxyCodeLine{143         uint32\_t context;}
\DoxyCodeLine{144         uint32\_t l\_rk\_id;}
\DoxyCodeLine{145 }
\DoxyCodeLine{146         uint32\_t pc;}
\DoxyCodeLine{147         uint8\_t si;}
\DoxyCodeLine{148         uint32\_t ssn;}
\DoxyCodeLine{149         \textcolor{comment}{/* FIXME: more complex routing keys */}}
\DoxyCodeLine{150 \};}
\DoxyCodeLine{151 }
\DoxyCodeLine{152 }
\DoxyCodeLine{153 \textcolor{comment}{/***********************************************************************}}
\DoxyCodeLine{154 \textcolor{comment}{ * SS7 ASP Protocols}}
\DoxyCodeLine{155 \textcolor{comment}{ ***********************************************************************/}}
\DoxyCodeLine{156 }
\DoxyCodeLine{157 \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol \{}
\DoxyCodeLine{158         OSMO\_SS7\_ASP\_PROT\_NONE,}
\DoxyCodeLine{159         OSMO\_SS7\_ASP\_PROT\_SUA,}
\DoxyCodeLine{160         OSMO\_SS7\_ASP\_PROT\_M3UA,}
\DoxyCodeLine{161         OSMO\_SS7\_ASP\_PROT\_IPA,}
\DoxyCodeLine{162         \_NUM\_OSMO\_SS7\_ASP\_PROT}
\DoxyCodeLine{163 \};}
\DoxyCodeLine{164 }
\DoxyCodeLine{165 \textcolor{keyword}{extern} \textcolor{keyword}{struct }value\_string osmo\_ss7\_asp\_protocol\_vals[];}
\DoxyCodeLine{166 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *}
\DoxyCodeLine{167 osmo\_ss7\_asp\_protocol\_name(\textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol mode)}
\DoxyCodeLine{168 \{}
\DoxyCodeLine{169         \textcolor{keywordflow}{return} get\_value\_string(osmo\_ss7\_asp\_protocol\_vals, mode);}
\DoxyCodeLine{170 \}}
\DoxyCodeLine{171 }
\DoxyCodeLine{172 \textcolor{keywordtype}{int} osmo\_ss7\_asp\_protocol\_port(\textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol prot);}
\DoxyCodeLine{173 }
\DoxyCodeLine{174 }
\DoxyCodeLine{175 \textcolor{comment}{/***********************************************************************}}
\DoxyCodeLine{176 \textcolor{comment}{ * SS7 AS Traffic Mode}}
\DoxyCodeLine{177 \textcolor{comment}{ ***********************************************************************/}}
\DoxyCodeLine{178 }
\DoxyCodeLine{179  \textcolor{comment}{/* Traffic mode implementations which can be configured on an AS, either by}}
\DoxyCodeLine{180 \textcolor{comment}{  * peer (eg. RFC4666 M3UA "{}Traffic Mode Type"{}) or locally through VTY.}}
\DoxyCodeLine{181 \textcolor{comment}{  * Note: This is related but not exactly RFC4666 M3UA "{}Traffic Mode Type"{} (enum}}
\DoxyCodeLine{182 \textcolor{comment}{  * m3ua\_traffic\_mode). */}}
\DoxyCodeLine{183 \textcolor{keyword}{enum} osmo\_ss7\_as\_traffic\_mode \{}
\DoxyCodeLine{184         \textcolor{comment}{/* RFC4666 M3UA "{}Traffic Mode Type"{} "{}Override"{}. Default traffic mode: */}}
\DoxyCodeLine{185         OSMO\_SS7\_AS\_TMOD\_OVERRIDE = 0,}
\DoxyCodeLine{186         \textcolor{comment}{/* RFC4666 M3UA "{}Traffic Mode Type"{} "{}Broadcast"{}: */}}
\DoxyCodeLine{187         OSMO\_SS7\_AS\_TMOD\_BCAST,}
\DoxyCodeLine{188         \textcolor{comment}{/* RFC4666 M3UA "{}Traffic Mode Type"{} "{}Loadshare"{},}}
\DoxyCodeLine{189 \textcolor{comment}{         * traffic distribution based on OPC+SLS: */}}
\DoxyCodeLine{190         OSMO\_SS7\_AS\_TMOD\_LOADSHARE,}
\DoxyCodeLine{191         \textcolor{comment}{/* RFC4666 M3UA "{}Traffic Mode Type"{} "{}Loadshare"{},}}
\DoxyCodeLine{192 \textcolor{comment}{         * traffic distribution implemented as round-\/robin: */}}
\DoxyCodeLine{193         OSMO\_SS7\_AS\_TMOD\_ROUNDROBIN,}
\DoxyCodeLine{194         \_NUM\_OSMO\_SS7\_ASP\_TMOD}
\DoxyCodeLine{195 \};}
\DoxyCodeLine{196 }
\DoxyCodeLine{197 \textcolor{keyword}{extern} \textcolor{keyword}{struct }value\_string osmo\_ss7\_as\_traffic\_mode\_vals[];}
\DoxyCodeLine{198 }
\DoxyCodeLine{199 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *}
\DoxyCodeLine{200 osmo\_ss7\_as\_traffic\_mode\_name(\textcolor{keyword}{enum} osmo\_ss7\_as\_traffic\_mode mode)}
\DoxyCodeLine{201 \{}
\DoxyCodeLine{202         \textcolor{keywordflow}{return} get\_value\_string(osmo\_ss7\_as\_traffic\_mode\_vals, mode);}
\DoxyCodeLine{203 \}}
\DoxyCodeLine{204 }
\DoxyCodeLine{205 \textcolor{keyword}{enum} osmo\_ss7\_as\_traffic\_mode osmo\_ss7\_tmode\_from\_xua(uint32\_t in);}
\DoxyCodeLine{206 \textcolor{keywordtype}{int} osmo\_ss7\_tmode\_to\_xua(\textcolor{keyword}{enum} osmo\_ss7\_as\_traffic\_mode tmod);}
\DoxyCodeLine{207 }
\DoxyCodeLine{208 }
\DoxyCodeLine{209 \textcolor{comment}{/***********************************************************************}}
\DoxyCodeLine{210 \textcolor{comment}{ * SS7 Application Servers}}
\DoxyCodeLine{211 \textcolor{comment}{ ***********************************************************************/}}
\DoxyCodeLine{212 }
\DoxyCodeLine{213 \textcolor{keyword}{struct }osmo\_ss7\_as;}
\DoxyCodeLine{214 \textcolor{keyword}{struct }osmo\_ss7\_asp;}
\DoxyCodeLine{215 }
\DoxyCodeLine{216 \textcolor{keyword}{struct }osmo\_ss7\_as *}
\DoxyCodeLine{217 osmo\_ss7\_as\_find\_by\_name(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name);}
\DoxyCodeLine{218 \textcolor{keyword}{struct }osmo\_ss7\_as *}
\DoxyCodeLine{219 osmo\_ss7\_as\_find\_by\_rctx(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst, uint32\_t rctx);}
\DoxyCodeLine{220 \textcolor{keyword}{struct }osmo\_ss7\_as *}
\DoxyCodeLine{221 osmo\_ss7\_as\_find\_by\_l\_rk\_id(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst, uint32\_t l\_rk\_id);}
\DoxyCodeLine{222 \textcolor{keyword}{struct }osmo\_ss7\_as *osmo\_ss7\_as\_find\_by\_proto(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst,}
\DoxyCodeLine{223                                               \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol proto);}
\DoxyCodeLine{224 \textcolor{keyword}{struct }osmo\_ss7\_as *}
\DoxyCodeLine{225 osmo\_ss7\_as\_find\_or\_create(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name,}
\DoxyCodeLine{226                           \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol proto);}
\DoxyCodeLine{227 \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol osmo\_ss7\_as\_get\_asp\_protocol(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_as *as);}
\DoxyCodeLine{228 \textcolor{keywordtype}{int} osmo\_ss7\_as\_add\_asp(\textcolor{keyword}{struct} osmo\_ss7\_as *as, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *asp\_name);}
\DoxyCodeLine{229 \textcolor{keywordtype}{int} osmo\_ss7\_as\_del\_asp(\textcolor{keyword}{struct} osmo\_ss7\_as *as, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *asp\_name);}
\DoxyCodeLine{230 \textcolor{keywordtype}{void} osmo\_ss7\_as\_destroy(\textcolor{keyword}{struct} osmo\_ss7\_as *as);}
\DoxyCodeLine{231 \textcolor{keywordtype}{bool} osmo\_ss7\_as\_has\_asp(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_as *as,}
\DoxyCodeLine{232                          \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_asp *asp);}
\DoxyCodeLine{233 \textcolor{keyword}{struct }osmo\_ss7\_asp *osmo\_ss7\_as\_select\_asp(\textcolor{keyword}{struct} osmo\_ss7\_as *as);}
\DoxyCodeLine{234 \textcolor{keywordtype}{bool} osmo\_ss7\_as\_down(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_as *as);}
\DoxyCodeLine{235 \textcolor{keywordtype}{bool} osmo\_ss7\_as\_active(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_as *as);}
\DoxyCodeLine{236 \textcolor{keywordtype}{bool} osmo\_ss7\_as\_tmode\_compatible\_xua(\textcolor{keyword}{struct} osmo\_ss7\_as *as, uint32\_t m3ua\_tmt);}
\DoxyCodeLine{237 }
\DoxyCodeLine{238 }
\DoxyCodeLine{239 \textcolor{comment}{/***********************************************************************}}
\DoxyCodeLine{240 \textcolor{comment}{ * SS7 Application Server Processes}}
\DoxyCodeLine{241 \textcolor{comment}{ ***********************************************************************/}}
\DoxyCodeLine{242 }
\DoxyCodeLine{243 \textcolor{keyword}{enum} osmo\_ss7\_asp\_admin\_state \{}
\DoxyCodeLine{245         OSMO\_SS7\_ASP\_ADM\_S\_SHUTDOWN,}
\DoxyCodeLine{247         OSMO\_SS7\_ASP\_ADM\_S\_BLOCKED,}
\DoxyCodeLine{249         OSMO\_SS7\_ASP\_ADM\_S\_ENABLED,}
\DoxyCodeLine{250 \};}
\DoxyCodeLine{251 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }value\_string osmo\_ss7\_asp\_admin\_state\_names[];}
\DoxyCodeLine{252 }
\DoxyCodeLine{253 \textcolor{keyword}{enum} osmo\_ss7\_asp\_role \{}
\DoxyCodeLine{254         OSMO\_SS7\_ASP\_ROLE\_ASP,}
\DoxyCodeLine{255         OSMO\_SS7\_ASP\_ROLE\_SG,}
\DoxyCodeLine{256         OSMO\_SS7\_ASP\_ROLE\_IPSP,}
\DoxyCodeLine{257 \};}
\DoxyCodeLine{258 }
\DoxyCodeLine{259 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }value\_string osmo\_ss7\_asp\_role\_names[];}
\DoxyCodeLine{260 }
\DoxyCodeLine{261 \textcolor{keyword}{struct }osmo\_ss7\_asp;}
\DoxyCodeLine{262 }
\DoxyCodeLine{264 \textcolor{preprocessor}{\#define OSMO\_SS7\_ASP\_QUIRK\_NO\_NOTIFY            0x00000001}}
\DoxyCodeLine{266 \textcolor{preprocessor}{\#define OSMO\_SS7\_ASP\_QUIRK\_DAUD\_IN\_ASP          0x00000002}}
\DoxyCodeLine{268 \textcolor{preprocessor}{\#define OSMO\_SS7\_ASP\_QUIRK\_SNM\_INACTIVE         0x00000004}}
\DoxyCodeLine{269 }
\DoxyCodeLine{270 }
\DoxyCodeLine{271 \textcolor{keyword}{struct }osmo\_ss7\_asp *}
\DoxyCodeLine{272 osmo\_ss7\_asp\_find\_by\_name(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name);}
\DoxyCodeLine{273 \textcolor{keyword}{struct }osmo\_ss7\_asp *}
\DoxyCodeLine{274 osmo\_ss7\_asp\_find\_by\_proto(\textcolor{keyword}{struct} osmo\_ss7\_as *as,}
\DoxyCodeLine{275                            \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol proto);}
\DoxyCodeLine{276 \textcolor{keyword}{struct }osmo\_ss7\_asp *}
\DoxyCodeLine{277 osmo\_ss7\_asp\_find(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name,}
\DoxyCodeLine{278                   uint16\_t remote\_port, uint16\_t local\_port,}
\DoxyCodeLine{279                   \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol proto)}
\DoxyCodeLine{280         OSMO\_DEPRECATED(\textcolor{stringliteral}{"{}Use osmo\_ss7\_asp\_find2() instead"{}});}
\DoxyCodeLine{281 \textcolor{keyword}{struct }osmo\_ss7\_asp *}
\DoxyCodeLine{282 osmo\_ss7\_asp\_find2(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name,}
\DoxyCodeLine{283                    uint16\_t remote\_port, uint16\_t local\_port,}
\DoxyCodeLine{284                    \textcolor{keywordtype}{int} trans\_proto, \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol proto);}
\DoxyCodeLine{285 \textcolor{keyword}{struct }osmo\_ss7\_asp *}
\DoxyCodeLine{286 osmo\_ss7\_asp\_find\_or\_create(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name,}
\DoxyCodeLine{287                             uint16\_t remote\_port, uint16\_t local\_port,}
\DoxyCodeLine{288                             \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol proto)}
\DoxyCodeLine{289         OSMO\_DEPRECATED(\textcolor{stringliteral}{"{}Use osmo\_ss7\_asp\_find\_or\_create2() instead"{}});}
\DoxyCodeLine{290 \textcolor{keyword}{struct }osmo\_ss7\_asp *}
\DoxyCodeLine{291 osmo\_ss7\_asp\_find\_or\_create2(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name,}
\DoxyCodeLine{292                              uint16\_t remote\_port, uint16\_t local\_port,}
\DoxyCodeLine{293                              \textcolor{keywordtype}{int} trans\_proto, \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol proto);}
\DoxyCodeLine{294 \textcolor{keywordtype}{void} osmo\_ss7\_asp\_disconnect(\textcolor{keyword}{struct} osmo\_ss7\_asp *asp);}
\DoxyCodeLine{295 \textcolor{keywordtype}{void} osmo\_ss7\_asp\_destroy(\textcolor{keyword}{struct} osmo\_ss7\_asp *asp);}
\DoxyCodeLine{296 \textcolor{keywordtype}{int} osmo\_ss7\_asp\_send(\textcolor{keyword}{struct} osmo\_ss7\_asp *asp, \textcolor{keyword}{struct} msgb *msg);}
\DoxyCodeLine{297 \textcolor{keywordtype}{int} osmo\_ss7\_asp\_restart(\textcolor{keyword}{struct} osmo\_ss7\_asp *asp);}
\DoxyCodeLine{298 \textcolor{keywordtype}{bool} osmo\_ss7\_asp\_active(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_asp *asp);}
\DoxyCodeLine{299 \textcolor{keywordtype}{int} osmo\_ss7\_asp\_get\_log\_subsys(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_asp *asp);}
\DoxyCodeLine{300 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_ss7\_asp\_get\_name(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_asp *asp);}
\DoxyCodeLine{301 \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol osmo\_ss7\_asp\_get\_proto(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_asp *asp);}
\DoxyCodeLine{302 \textcolor{keywordtype}{int} osmo\_ss7\_asp\_get\_trans\_proto(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_asp *asp);}
\DoxyCodeLine{303 }
\DoxyCodeLine{311 \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{312 }
\DoxyCodeLine{313 \textcolor{keywordtype}{void} osmo\_ss7\_register\_rx\_unknown\_cb(osmo\_ss7\_asp\_rx\_unknown\_cb *cb);}
\DoxyCodeLine{314 }
\DoxyCodeLine{315 }
\DoxyCodeLine{316 \textcolor{comment}{/***********************************************************************}}
\DoxyCodeLine{317 \textcolor{comment}{ * Simple Client}}
\DoxyCodeLine{318 \textcolor{comment}{ ***********************************************************************/}}
\DoxyCodeLine{319 }
\DoxyCodeLine{320 \textcolor{keyword}{struct }osmo\_sccp\_instance *}
\DoxyCodeLine{321 osmo\_sccp\_simple\_client(\textcolor{keywordtype}{void} *ctx, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name, uint32\_t default\_pc,}
\DoxyCodeLine{322                         \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol prot, \textcolor{keywordtype}{int} default\_local\_port,}
\DoxyCodeLine{323                         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *default\_local\_ip, \textcolor{keywordtype}{int} default\_remote\_port,}
\DoxyCodeLine{324                         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *default\_remote\_ip);}
\DoxyCodeLine{325 }
\DoxyCodeLine{326 \textcolor{keyword}{struct }osmo\_sccp\_instance *}
\DoxyCodeLine{327 osmo\_sccp\_simple\_client\_on\_ss7\_id(\textcolor{keywordtype}{void} *ctx, uint32\_t ss7\_id, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name,}
\DoxyCodeLine{328                                   uint32\_t default\_pc,}
\DoxyCodeLine{329                                   \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol prot,}
\DoxyCodeLine{330                                   \textcolor{keywordtype}{int} default\_local\_port,}
\DoxyCodeLine{331                                   \textcolor{keyword}{const} \textcolor{keywordtype}{char} *default\_local\_ip,}
\DoxyCodeLine{332                                   \textcolor{keywordtype}{int} default\_remote\_port,}
\DoxyCodeLine{333                                   \textcolor{keyword}{const} \textcolor{keywordtype}{char} *default\_remote\_ip);}
\DoxyCodeLine{334 }
\DoxyCodeLine{335 \textcolor{comment}{/***********************************************************************}}
\DoxyCodeLine{336 \textcolor{comment}{ * Simple Server}}
\DoxyCodeLine{337 \textcolor{comment}{ ***********************************************************************/}}
\DoxyCodeLine{338 }
\DoxyCodeLine{339 \textcolor{keyword}{struct }osmo\_sccp\_instance *}
\DoxyCodeLine{340 osmo\_sccp\_simple\_server(\textcolor{keywordtype}{void} *ctx, uint32\_t pc,}
\DoxyCodeLine{341                         \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol prot, \textcolor{keywordtype}{int} local\_port,}
\DoxyCodeLine{342                         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *local\_ip);}
\DoxyCodeLine{343 }
\DoxyCodeLine{344 \textcolor{keyword}{struct }osmo\_sccp\_instance *}
\DoxyCodeLine{345 osmo\_sccp\_simple\_server\_on\_ss7\_id(\textcolor{keywordtype}{void} *ctx, uint32\_t ss7\_id, uint32\_t pc,}
\DoxyCodeLine{346                                   \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol prot,}
\DoxyCodeLine{347                                   \textcolor{keywordtype}{int} local\_port, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *local\_ip);}
\DoxyCodeLine{348 }
\DoxyCodeLine{349 \textcolor{keyword}{struct }osmo\_sccp\_instance *}
\DoxyCodeLine{350 osmo\_sccp\_simple\_server\_add\_clnt(\textcolor{keyword}{struct} osmo\_sccp\_instance *inst,}
\DoxyCodeLine{351                                  \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol prot,}
\DoxyCodeLine{352                                  \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name, uint32\_t pc,}
\DoxyCodeLine{353                                  \textcolor{keywordtype}{int} local\_port, \textcolor{keywordtype}{int} remote\_port,}
\DoxyCodeLine{354                                  \textcolor{keyword}{const} \textcolor{keywordtype}{char} *remote\_ip);}
\DoxyCodeLine{355 }
\DoxyCodeLine{356 \textcolor{comment}{/* VTY related */}}
\DoxyCodeLine{357 \textcolor{keyword}{struct }vty;}
\DoxyCodeLine{358 \textcolor{keywordtype}{void} osmo\_ss7\_vty\_init\_asp(\textcolor{keywordtype}{void} *ctx);}
\DoxyCodeLine{359 \textcolor{keywordtype}{void} osmo\_ss7\_vty\_init\_sg(\textcolor{keywordtype}{void} *ctx);}
\DoxyCodeLine{360 \textcolor{keywordtype}{int} osmo\_ss7\_vty\_go\_parent(\textcolor{keyword}{struct} vty *vty);}
\DoxyCodeLine{361 \textcolor{keywordtype}{int} osmo\_ss7\_is\_config\_node(\textcolor{keyword}{struct} vty *vty, \textcolor{keywordtype}{int} node)}
\DoxyCodeLine{362         OSMO\_DEPRECATED(\textcolor{stringliteral}{"{}Implicit parent node tracking has replaced the use of this callback. "{}}}
\DoxyCodeLine{363                         \textcolor{stringliteral}{"{}This callback is no longer called, ever, and can be left NULL."{}});}

\end{DoxyCode}
