\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\_ctr \{} \DoxyCodeLine{23 SS7\_ASP\_CTR\_PKT\_RX\_TOTAL,} \DoxyCodeLine{24 SS7\_ASP\_CTR\_PKT\_RX\_UNKNOWN,} \DoxyCodeLine{25 SS7\_ASP\_CTR\_PKT\_TX\_TOTAL,} \DoxyCodeLine{26 \};} \DoxyCodeLine{27 } \DoxyCodeLine{28 \textcolor{keyword}{struct }osmo\_ss7\_asp \{} \DoxyCodeLine{30 \textcolor{keyword}{struct }llist\_head list;} \DoxyCodeLine{31 \textcolor{keyword}{struct }osmo\_ss7\_instance *inst;} \DoxyCodeLine{32 } \DoxyCodeLine{34 \textcolor{keyword}{struct }osmo\_fsm\_inst *fi;} \DoxyCodeLine{35 } \DoxyCodeLine{37 \textcolor{keyword}{struct }osmo\_xua\_server *xua\_server;} \DoxyCodeLine{38 \textcolor{keyword}{struct }llist\_head siblings;} \DoxyCodeLine{39 } \DoxyCodeLine{41 \textcolor{keyword}{struct }osmo\_stream\_cli *client;} \DoxyCodeLine{42 \textcolor{keyword}{struct }osmo\_stream\_srv *server;} \DoxyCodeLine{44 \textcolor{keywordtype}{char} *sock\_name;} \DoxyCodeLine{45 } \DoxyCodeLine{46 \textcolor{comment}{/* ASP Identifier for ASP-\/UP + NTFY, as received by the peer.}} \DoxyCodeLine{47 \textcolor{comment}{ * (In IPA ASPs it's used internally to hold 4-\/bit SLS).}} \DoxyCodeLine{48 \textcolor{comment}{ * FIXME: This should actually be stored in a AS-\/ASP relation, since it}} \DoxyCodeLine{49 \textcolor{comment}{ * can be different per AS, see RFC4666 3.5.1}} \DoxyCodeLine{50 \textcolor{comment}{ * "{}The optional ASP Identifier parameter contains a unique value that}} \DoxyCodeLine{51 \textcolor{comment}{ * is locally significant among the ASPs that support an AS"{}.}} \DoxyCodeLine{52 \textcolor{comment}{ */}} \DoxyCodeLine{53 uint32\_t remote\_asp\_id;} \DoxyCodeLine{54 \textcolor{keywordtype}{bool} remote\_asp\_id\_present;} \DoxyCodeLine{55 } \DoxyCodeLine{56 \textcolor{comment}{/* Layer Manager to which we talk */}} \DoxyCodeLine{57 \textcolor{keyword}{const} \textcolor{keyword}{struct }osmo\_xua\_layer\_manager *lm;} \DoxyCodeLine{58 \textcolor{keywordtype}{void} *lm\_priv;} \DoxyCodeLine{59 } \DoxyCodeLine{61 \textcolor{keywordtype}{bool} dyn\_allocated;} \DoxyCodeLine{62 } \DoxyCodeLine{64 \textcolor{keywordtype}{bool} simple\_client\_allocated;} \DoxyCodeLine{65 } \DoxyCodeLine{67 \textcolor{keyword}{struct }rate\_ctr\_group *ctrg;} \DoxyCodeLine{68 } \DoxyCodeLine{70 \textcolor{keyword}{struct }msgb *pending\_msg;} \DoxyCodeLine{71 } \DoxyCodeLine{72 \textcolor{comment}{/* IPA proto ASP specific fields. */}} \DoxyCodeLine{73 \textcolor{keyword}{struct }\{} \DoxyCodeLine{74 \textcolor{comment}{/* Incoming IPA PDUs have no SLS field, hence a potentially}} \DoxyCodeLine{75 \textcolor{comment}{ * unique one within AS is assigned to this ASP and applied}} \DoxyCodeLine{76 \textcolor{comment}{ * manually when received. */}} \DoxyCodeLine{77 uint8\_t sls:4;} \DoxyCodeLine{78 \textcolor{keywordtype}{bool} sls\_assigned;} \DoxyCodeLine{79 \} ipa;} \DoxyCodeLine{80 } \DoxyCodeLine{81 \textcolor{keyword}{struct }\{} \DoxyCodeLine{82 \textcolor{keywordtype}{char} *name;} \DoxyCodeLine{83 \textcolor{keywordtype}{char} *description;} \DoxyCodeLine{84 \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol proto;} \DoxyCodeLine{85 \textcolor{keyword}{enum} osmo\_ss7\_asp\_admin\_state adm\_state;} \DoxyCodeLine{86 \textcolor{keywordtype}{bool} is\_server;} \DoxyCodeLine{87 \textcolor{keyword}{enum} osmo\_ss7\_asp\_role role;} \DoxyCodeLine{88 \textcolor{keywordtype}{bool} role\_set\_by\_vty;} \DoxyCodeLine{89 \textcolor{keywordtype}{bool} trans\_role\_set\_by\_vty;} \DoxyCodeLine{90 } \DoxyCodeLine{91 \textcolor{keyword}{struct }osmo\_ss7\_asp\_peer local;} \DoxyCodeLine{92 \textcolor{keyword}{struct }osmo\_ss7\_asp\_peer remote;} \DoxyCodeLine{93 uint8\_t qos\_class;} \DoxyCodeLine{94 uint32\_t quirks;} \DoxyCodeLine{95 } \DoxyCodeLine{96 \textcolor{comment}{/* T\_defs used by the default\_lm: */}} \DoxyCodeLine{97 \textcolor{keyword}{struct }osmo\_tdef *T\_defs\_lm;} \DoxyCodeLine{98 } \DoxyCodeLine{99 \textcolor{keyword}{struct }\{} \DoxyCodeLine{100 \textcolor{keywordtype}{bool} num\_ostreams\_present;} \DoxyCodeLine{101 \textcolor{keywordtype}{bool} max\_instreams\_present;} \DoxyCodeLine{102 \textcolor{keywordtype}{bool} max\_attempts\_present;} \DoxyCodeLine{103 \textcolor{keywordtype}{bool} max\_init\_timeo\_present;} \DoxyCodeLine{104 uint16\_t num\_ostreams\_value;} \DoxyCodeLine{105 uint16\_t max\_instreams\_value;} \DoxyCodeLine{106 uint16\_t max\_attempts\_value;} \DoxyCodeLine{107 uint16\_t max\_init\_timeo\_value; \textcolor{comment}{/* ms */}} \DoxyCodeLine{108 \} sctp\_init;} \DoxyCodeLine{109 } \DoxyCodeLine{111 \textcolor{keywordtype}{int} trans\_proto;} \DoxyCodeLine{112 \} cfg;} \DoxyCodeLine{113 \};} \DoxyCodeLine{114 } \DoxyCodeLine{115 \textcolor{keyword}{struct }osmo\_ss7\_asp *ss7\_asp\_alloc(\textcolor{keyword}{struct} osmo\_ss7\_instance *inst, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name,} \DoxyCodeLine{116 uint16\_t remote\_port, uint16\_t local\_port,} \DoxyCodeLine{117 \textcolor{keywordtype}{int} trans\_proto, \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol proto);} \DoxyCodeLine{118 \textcolor{keywordtype}{bool} ss7\_asp\_set\_default\_peer\_hosts(\textcolor{keyword}{struct} osmo\_ss7\_asp *asp);} \DoxyCodeLine{119 \textcolor{keywordtype}{bool} ss7\_asp\_is\_started(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_asp *asp);} \DoxyCodeLine{120 \textcolor{keywordtype}{int} ss7\_asp\_get\_fd(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_asp *asp);} \DoxyCodeLine{121 \textcolor{keywordtype}{int} ss7\_asp\_disconnect\_stream(\textcolor{keyword}{struct} osmo\_ss7\_asp *asp);} \DoxyCodeLine{122 } \DoxyCodeLine{123 \textcolor{keywordtype}{int} ss7\_asp\_apply\_peer\_primary\_address(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_asp *asp);} \DoxyCodeLine{124 \textcolor{keywordtype}{int} ss7\_asp\_apply\_primary\_address(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_asp *asp);} \DoxyCodeLine{125 \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{126 \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{127 } \DoxyCodeLine{128 \textcolor{keywordtype}{void} ss7\_asp\_restart\_after\_reconfigure(\textcolor{keyword}{struct} osmo\_ss7\_asp *asp);} \DoxyCodeLine{129 \textcolor{keywordtype}{void} osmo\_ss7\_asp\_remove\_default\_lm(\textcolor{keyword}{struct} osmo\_ss7\_asp *asp);} \DoxyCodeLine{130 } \DoxyCodeLine{131 \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{132 \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_as *excl\_as);} \DoxyCodeLine{133 } \DoxyCodeLine{134 \textcolor{preprocessor}{\#define LOGPASP(asp, subsys, level, fmt, args ...) \(\backslash\)}} \DoxyCodeLine{135 \textcolor{preprocessor}{ \_LOGSS7((asp)-\/>inst, subsys, level, "{}ASP(\%s) "{}} fmt, (asp)-\/>cfg.name, \#\# args)} \end{DoxyCode}