\doxysection{ss7\+\_\+asp.\+h} \label{ss7__asp_8h_source}\index{src/ss7\_asp.h@{src/ss7\_asp.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 }} \DoxyCodeLine{4 \textcolor{preprocessor}{\#include }} \DoxyCodeLine{5 \textcolor{preprocessor}{\#include }} \DoxyCodeLine{6 \textcolor{preprocessor}{\#include }} \DoxyCodeLine{7 \textcolor{preprocessor}{\#include }} \DoxyCodeLine{8 \textcolor{preprocessor}{\#include }} \DoxyCodeLine{9 } \DoxyCodeLine{10 \textcolor{preprocessor}{\#include }} \DoxyCodeLine{11 } \DoxyCodeLine{12 \textcolor{preprocessor}{\#include "{}ss7\_asp\_peer.h"{}}} \DoxyCodeLine{13 \textcolor{preprocessor}{\#include "{}ss7\_internal.h"{}}} \DoxyCodeLine{14 } \DoxyCodeLine{15 \textcolor{comment}{/***********************************************************************}} \DoxyCodeLine{16 \textcolor{comment}{ * SS7 Application Server Processes}} \DoxyCodeLine{17 \textcolor{comment}{ ***********************************************************************/}} \DoxyCodeLine{18 } \DoxyCodeLine{19 \textcolor{keyword}{struct }osmo\_ss7\_instance;} \DoxyCodeLine{20 \textcolor{keyword}{struct }osmo\_xua\_layer\_manager;} \DoxyCodeLine{21 } \DoxyCodeLine{22 \textcolor{keyword}{enum} ss7\_asp\_xua\_timer \{} \DoxyCodeLine{23 \textcolor{comment}{/* 0 kept unused on purpose since it's handled specially by osmo\_fsm */}} \DoxyCodeLine{24 SS7\_ASP\_XUA\_T\_ACK = 1, \textcolor{comment}{/* RFC3868 \& RFC4666 timer T(ack) */}} \DoxyCodeLine{25 SS7\_ASP\_XUA\_T\_BEAT, \textcolor{comment}{/* RFC3868 \& RFC4666 timer T(beat) */}} \DoxyCodeLine{26 \textcolor{comment}{/* This must remain the last item: */}} \DoxyCodeLine{27 SS7\_ASP\_XUA\_TIMERS\_LEN} \DoxyCodeLine{28 \};} \DoxyCodeLine{29 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }value\_string ss7\_asp\_xua\_timer\_names[];} \DoxyCodeLine{30 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }osmo\_tdef ss7\_asp\_xua\_timer\_defaults[SS7\_ASP\_XUA\_TIMERS\_LEN];} \DoxyCodeLine{31 \textcolor{comment}{/* According to SUA RFC3868 Section 8, M3UA RFC4666 Section 4.3.4.1 */}} \DoxyCodeLine{32 \textcolor{preprocessor}{\#define SS7\_ASP\_XUA\_DEFAULT\_T\_ACK\_SEC 2}} \DoxyCodeLine{33 \textcolor{comment}{/* According to SUA RFC3868 Section 8 */}} \DoxyCodeLine{34 \textcolor{preprocessor}{\#define SS7\_ASP\_XUA\_DEFAULT\_T\_BEAT\_SEC 30}} \DoxyCodeLine{35 } \DoxyCodeLine{36 \textcolor{keyword}{enum} ss7\_asp\_ctr \{} \DoxyCodeLine{37 SS7\_ASP\_CTR\_PKT\_RX\_TOTAL,} \DoxyCodeLine{38 SS7\_ASP\_CTR\_PKT\_RX\_UNKNOWN,} \DoxyCodeLine{39 SS7\_ASP\_CTR\_PKT\_TX\_TOTAL,} \DoxyCodeLine{40 \};} \DoxyCodeLine{41 } \DoxyCodeLine{42 \textcolor{keyword}{struct }osmo\_ss7\_asp \{} \DoxyCodeLine{44 \textcolor{keyword}{struct }llist\_head list;} \DoxyCodeLine{45 \textcolor{keyword}{struct }osmo\_ss7\_instance *inst;} \DoxyCodeLine{46 } \DoxyCodeLine{48 \textcolor{keyword}{struct }osmo\_fsm\_inst *fi;} \DoxyCodeLine{49 } \DoxyCodeLine{51 \textcolor{keyword}{struct }osmo\_xua\_server *xua\_server;} \DoxyCodeLine{52 \textcolor{keyword}{struct }llist\_head siblings;} \DoxyCodeLine{53 } \DoxyCodeLine{55 \textcolor{keyword}{struct }osmo\_stream\_cli *client;} \DoxyCodeLine{56 \textcolor{keyword}{struct }osmo\_stream\_srv *server;} \DoxyCodeLine{58 \textcolor{keywordtype}{char} *sock\_name;} \DoxyCodeLine{59 } \DoxyCodeLine{60 \textcolor{comment}{/* ASP Identifier for ASP-\/UP + NTFY, as received by the peer.}} \DoxyCodeLine{61 \textcolor{comment}{ * (In IPA ASPs it's used internally to hold 4-\/bit SLS).}} \DoxyCodeLine{62 \textcolor{comment}{ * FIXME: This should actually be stored in a AS-\/ASP relation, since it}} \DoxyCodeLine{63 \textcolor{comment}{ * can be different per AS, see RFC4666 3.5.1}} \DoxyCodeLine{64 \textcolor{comment}{ * "{}The optional ASP Identifier parameter contains a unique value that}} \DoxyCodeLine{65 \textcolor{comment}{ * is locally significant among the ASPs that support an AS"{}.}} \DoxyCodeLine{66 \textcolor{comment}{ */}} \DoxyCodeLine{67 uint32\_t remote\_asp\_id;} \DoxyCodeLine{68 \textcolor{keywordtype}{bool} remote\_asp\_id\_present;} \DoxyCodeLine{69 } \DoxyCodeLine{70 \textcolor{comment}{/* Layer Manager to which we talk */}} \DoxyCodeLine{71 \textcolor{keyword}{const} \textcolor{keyword}{struct }osmo\_xua\_layer\_manager *lm;} \DoxyCodeLine{72 \textcolor{keywordtype}{void} *lm\_priv;} \DoxyCodeLine{73 } \DoxyCodeLine{75 \textcolor{keywordtype}{bool} dyn\_allocated;} \DoxyCodeLine{76 } \DoxyCodeLine{78 \textcolor{keywordtype}{bool} simple\_client\_allocated;} \DoxyCodeLine{79 } \DoxyCodeLine{81 \textcolor{keyword}{struct }rate\_ctr\_group *ctrg;} \DoxyCodeLine{82 } \DoxyCodeLine{84 \textcolor{keyword}{struct }msgb *pending\_msg;} \DoxyCodeLine{85 } \DoxyCodeLine{86 \textcolor{comment}{/* IPA proto ASP specific fields. */}} \DoxyCodeLine{87 \textcolor{keyword}{struct }\{} \DoxyCodeLine{88 \textcolor{comment}{/* Incoming IPA PDUs have no SLS field, hence a potentially}} \DoxyCodeLine{89 \textcolor{comment}{ * unique one within AS is assigned to this ASP and applied}} \DoxyCodeLine{90 \textcolor{comment}{ * manually when received. */}} \DoxyCodeLine{91 uint8\_t sls:4;} \DoxyCodeLine{92 \textcolor{keywordtype}{bool} sls\_assigned;} \DoxyCodeLine{93 \} ipa;} \DoxyCodeLine{94 } \DoxyCodeLine{95 \textcolor{keyword}{struct }\{} \DoxyCodeLine{96 \textcolor{keywordtype}{char} *name;} \DoxyCodeLine{97 \textcolor{keywordtype}{char} *description;} \DoxyCodeLine{98 \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol proto;} \DoxyCodeLine{99 \textcolor{keyword}{enum} osmo\_ss7\_asp\_admin\_state adm\_state;} \DoxyCodeLine{100 \textcolor{keywordtype}{bool} is\_server;} \DoxyCodeLine{101 \textcolor{keyword}{enum} osmo\_ss7\_asp\_role role;} \DoxyCodeLine{102 \textcolor{keywordtype}{bool} role\_set\_by\_vty;} \DoxyCodeLine{103 \textcolor{keywordtype}{bool} trans\_role\_set\_by\_vty;} \DoxyCodeLine{104 \textcolor{comment}{/* Used internally by "{}asp"{} node to figure out if "{}no shutdown"{}}} \DoxyCodeLine{105 \textcolor{comment}{ * was done explicitly, in order to avoid automatic asp}} \DoxyCodeLine{106 \textcolor{comment}{ * reconfiguring/restart at go\_parent().}} \DoxyCodeLine{107 \textcolor{comment}{ * Can be dropped in the future once we make sure everybody uses}} \DoxyCodeLine{108 \textcolor{comment}{ * "{}[no] shutdown"{} explicitly in cfg files. */}} \DoxyCodeLine{109 \textcolor{keywordtype}{bool} explicit\_shutdown\_state\_by\_vty\_since\_node\_enter;} \DoxyCodeLine{110 } \DoxyCodeLine{111 \textcolor{keyword}{struct }osmo\_ss7\_asp\_peer local;} \DoxyCodeLine{112 \textcolor{keyword}{struct }osmo\_ss7\_asp\_peer remote;} \DoxyCodeLine{113 uint8\_t qos\_class;} \DoxyCodeLine{114 uint32\_t quirks;} \DoxyCodeLine{115 } \DoxyCodeLine{116 \textcolor{comment}{/* Whether to Tx xUA DAUD during ASP activation when in ASP role. */}} \DoxyCodeLine{117 \textcolor{keywordtype}{bool} daud\_act;} \DoxyCodeLine{118 } \DoxyCodeLine{119 \textcolor{comment}{/* T\_defs used by the default\_lm: */}} \DoxyCodeLine{120 \textcolor{keyword}{struct }osmo\_tdef *T\_defs\_xua;} \DoxyCodeLine{121 } \DoxyCodeLine{122 \textcolor{comment}{/* T\_defs used by the default\_lm: */}} \DoxyCodeLine{123 \textcolor{keyword}{struct }osmo\_tdef *T\_defs\_lm;} \DoxyCodeLine{124 } \DoxyCodeLine{125 \textcolor{keyword}{struct }\{} \DoxyCodeLine{126 \textcolor{keywordtype}{bool} num\_ostreams\_present;} \DoxyCodeLine{127 \textcolor{keywordtype}{bool} max\_instreams\_present;} \DoxyCodeLine{128 \textcolor{keywordtype}{bool} max\_attempts\_present;} \DoxyCodeLine{129 \textcolor{keywordtype}{bool} max\_init\_timeo\_present;} \DoxyCodeLine{130 uint16\_t num\_ostreams\_value;} \DoxyCodeLine{131 uint16\_t max\_instreams\_value;} \DoxyCodeLine{132 uint16\_t max\_attempts\_value;} \DoxyCodeLine{133 uint16\_t max\_init\_timeo\_value; \textcolor{comment}{/* ms */}} \DoxyCodeLine{134 \} sctp\_init;} \DoxyCodeLine{135 } \DoxyCodeLine{136 \textcolor{keyword}{struct }\{} \DoxyCodeLine{137 \textcolor{keywordtype}{bool} keepalive\_enable;} \DoxyCodeLine{138 \textcolor{keywordtype}{bool} keepalive\_time\_present;} \DoxyCodeLine{139 \textcolor{keywordtype}{bool} keepalive\_intvl\_present;} \DoxyCodeLine{140 \textcolor{keywordtype}{bool} keepalive\_probes\_present;} \DoxyCodeLine{141 \textcolor{keywordtype}{bool} user\_timeout\_present;} \DoxyCodeLine{142 \textcolor{keywordtype}{int} keepalive\_time\_value; \textcolor{comment}{/* seconds */}} \DoxyCodeLine{143 \textcolor{keywordtype}{int} keepalive\_intvl\_value; \textcolor{comment}{/* seconds */}} \DoxyCodeLine{144 \textcolor{keywordtype}{int} keepalive\_probes\_value;} \DoxyCodeLine{145 \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} user\_timeout\_value; \textcolor{comment}{/* milliseconds */}} \DoxyCodeLine{146 \} tcp;} \DoxyCodeLine{147 } \DoxyCodeLine{149 \textcolor{keywordtype}{int} trans\_proto;} \DoxyCodeLine{150 \} cfg;} \DoxyCodeLine{151 \};} \DoxyCodeLine{152 } \DoxyCodeLine{153 \textcolor{keyword}{struct }osmo\_ss7\_asp *ss7\_asp\_alloc(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name,} \DoxyCodeLine{154 uint16\_t remote\_port, uint16\_t local\_port,} \DoxyCodeLine{155 \textcolor{keywordtype}{int} trans\_proto, \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol proto);} \DoxyCodeLine{156 \textcolor{keywordtype}{bool} ss7\_asp\_set\_default\_peer\_hosts(\textcolor{keyword}{struct} osmo\_ss7\_asp *asp);} \DoxyCodeLine{157 \textcolor{keywordtype}{bool} ss7\_asp\_is\_started(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_asp *asp);} \DoxyCodeLine{158 \textcolor{keywordtype}{int} ss7\_asp\_get\_fd(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_asp *asp);} \DoxyCodeLine{159 \textcolor{keywordtype}{int} ss7\_asp\_disconnect\_stream(\textcolor{keyword}{struct} osmo\_ss7\_asp *asp);} \DoxyCodeLine{160 } \DoxyCodeLine{161 \textcolor{keywordtype}{int} ss7\_asp\_apply\_tcp\_pars(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_asp *asp);} \DoxyCodeLine{162 \textcolor{keywordtype}{int} ss7\_asp\_apply\_peer\_primary\_address(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_asp *asp);} \DoxyCodeLine{163 \textcolor{keywordtype}{int} ss7\_asp\_apply\_primary\_address(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_asp *asp);} \DoxyCodeLine{164 \textcolor{keywordtype}{int} ss7\_asp\_apply\_new\_local\_address(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_asp *asp, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} loc\_idx);} \DoxyCodeLine{165 \textcolor{keywordtype}{int} ss7\_asp\_apply\_drop\_local\_address(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_asp *asp, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} loc\_idx);} \DoxyCodeLine{166 } \DoxyCodeLine{167 \textcolor{keywordtype}{void} ss7\_asp\_restart\_after\_reconfigure(\textcolor{keyword}{struct} osmo\_ss7\_asp *asp);} \DoxyCodeLine{168 \textcolor{keywordtype}{void} osmo\_ss7\_asp\_remove\_default\_lm(\textcolor{keyword}{struct} osmo\_ss7\_asp *asp);} \DoxyCodeLine{169 } \DoxyCodeLine{170 \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} ss7\_asp\_get\_all\_rctx(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_asp *asp, uint32\_t *rctx, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} rctx\_size,} \DoxyCodeLine{171 \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_as *excl\_as);} \DoxyCodeLine{172 \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} ss7\_asp\_get\_all\_rctx\_be(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_asp *asp, uint32\_t *rctx, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} rctx\_size,} \DoxyCodeLine{173 \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_as *excl\_as);} \DoxyCodeLine{174 } \DoxyCodeLine{175 \textcolor{keywordtype}{int} ss7\_asp\_determine\_traf\_mode(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_asp *asp);} \DoxyCodeLine{176 } \DoxyCodeLine{177 \textcolor{preprocessor}{\#define LOGPASP(asp, subsys, level, fmt, args ...) \(\backslash\)}} \DoxyCodeLine{178 \textcolor{preprocessor}{ \_LOGSS7((asp)-\/>inst, subsys, level, "{}ASP(\%s) "{}} fmt, (asp)-\/>cfg.name, \#\# args)} \end{DoxyCode}