\doxysection{ss7\+\_\+as.\+h} \label{ss7__as_8h_source}\index{src/ss7\_as.h@{src/ss7\_as.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\_internal.h"{}}} \DoxyCodeLine{13 } \DoxyCodeLine{14 \textcolor{comment}{/***********************************************************************}} \DoxyCodeLine{15 \textcolor{comment}{ * SS7 Application Server}} \DoxyCodeLine{16 \textcolor{comment}{ ***********************************************************************/}} \DoxyCodeLine{17 } \DoxyCodeLine{18 \textcolor{keyword}{struct }osmo\_ss7\_instance;} \DoxyCodeLine{19 \textcolor{keyword}{struct }osmo\_ss7\_asp;} \DoxyCodeLine{20 \textcolor{keyword}{struct }osmo\_mtp\_transfer\_param;} \DoxyCodeLine{21 } \DoxyCodeLine{22 \textcolor{keyword}{enum} osmo\_ss7\_as\_patch\_sccp\_mode \{} \DoxyCodeLine{23 OSMO\_SS7\_PATCH\_NONE, \textcolor{comment}{/* no patching of SCCP */}} \DoxyCodeLine{24 OSMO\_SS7\_PATCH\_BOTH, \textcolor{comment}{/* patch both OPC and DPC into SCCP addresses */}} \DoxyCodeLine{25 \};} \DoxyCodeLine{26 } \DoxyCodeLine{27 \textcolor{keyword}{enum} ss7\_as\_ctr \{} \DoxyCodeLine{28 SS7\_AS\_CTR\_RX\_MSU\_TOTAL,} \DoxyCodeLine{29 SS7\_AS\_CTR\_RX\_MSU\_SLS\_0,} \DoxyCodeLine{30 SS7\_AS\_CTR\_RX\_MSU\_SLS\_1,} \DoxyCodeLine{31 SS7\_AS\_CTR\_RX\_MSU\_SLS\_2,} \DoxyCodeLine{32 SS7\_AS\_CTR\_RX\_MSU\_SLS\_3,} \DoxyCodeLine{33 SS7\_AS\_CTR\_RX\_MSU\_SLS\_4,} \DoxyCodeLine{34 SS7\_AS\_CTR\_RX\_MSU\_SLS\_5,} \DoxyCodeLine{35 SS7\_AS\_CTR\_RX\_MSU\_SLS\_6,} \DoxyCodeLine{36 SS7\_AS\_CTR\_RX\_MSU\_SLS\_7,} \DoxyCodeLine{37 SS7\_AS\_CTR\_RX\_MSU\_SLS\_8,} \DoxyCodeLine{38 SS7\_AS\_CTR\_RX\_MSU\_SLS\_9,} \DoxyCodeLine{39 SS7\_AS\_CTR\_RX\_MSU\_SLS\_10,} \DoxyCodeLine{40 SS7\_AS\_CTR\_RX\_MSU\_SLS\_11,} \DoxyCodeLine{41 SS7\_AS\_CTR\_RX\_MSU\_SLS\_12,} \DoxyCodeLine{42 SS7\_AS\_CTR\_RX\_MSU\_SLS\_13,} \DoxyCodeLine{43 SS7\_AS\_CTR\_RX\_MSU\_SLS\_14,} \DoxyCodeLine{44 SS7\_AS\_CTR\_RX\_MSU\_SLS\_15,} \DoxyCodeLine{45 SS7\_AS\_CTR\_TX\_MSU\_TOTAL,} \DoxyCodeLine{46 SS7\_AS\_CTR\_TX\_MSU\_SLS\_0,} \DoxyCodeLine{47 SS7\_AS\_CTR\_TX\_MSU\_SLS\_1,} \DoxyCodeLine{48 SS7\_AS\_CTR\_TX\_MSU\_SLS\_2,} \DoxyCodeLine{49 SS7\_AS\_CTR\_TX\_MSU\_SLS\_3,} \DoxyCodeLine{50 SS7\_AS\_CTR\_TX\_MSU\_SLS\_4,} \DoxyCodeLine{51 SS7\_AS\_CTR\_TX\_MSU\_SLS\_5,} \DoxyCodeLine{52 SS7\_AS\_CTR\_TX\_MSU\_SLS\_6,} \DoxyCodeLine{53 SS7\_AS\_CTR\_TX\_MSU\_SLS\_7,} \DoxyCodeLine{54 SS7\_AS\_CTR\_TX\_MSU\_SLS\_8,} \DoxyCodeLine{55 SS7\_AS\_CTR\_TX\_MSU\_SLS\_9,} \DoxyCodeLine{56 SS7\_AS\_CTR\_TX\_MSU\_SLS\_10,} \DoxyCodeLine{57 SS7\_AS\_CTR\_TX\_MSU\_SLS\_11,} \DoxyCodeLine{58 SS7\_AS\_CTR\_TX\_MSU\_SLS\_12,} \DoxyCodeLine{59 SS7\_AS\_CTR\_TX\_MSU\_SLS\_13,} \DoxyCodeLine{60 SS7\_AS\_CTR\_TX\_MSU\_SLS\_14,} \DoxyCodeLine{61 SS7\_AS\_CTR\_TX\_MSU\_SLS\_15,} \DoxyCodeLine{62 \};} \DoxyCodeLine{63 } \DoxyCodeLine{64 \textcolor{preprocessor}{\#define NUM\_AS\_EXT\_SLS 128}} \DoxyCodeLine{65 \textcolor{keyword}{typedef} uint8\_t as\_ext\_sls\_t; \textcolor{comment}{/* range: 0-\/127, 7 bit */}} \DoxyCodeLine{66 \textcolor{keyword}{struct }osmo\_ss7\_as\_esls\_entry \{} \DoxyCodeLine{67 \textcolor{comment}{/* ITU Q.704 4.2.1: "{}normal signallink link"{} */}} \DoxyCodeLine{68 \textcolor{keyword}{struct }osmo\_ss7\_asp *normal\_asp;} \DoxyCodeLine{69 \textcolor{comment}{/* ITU Q.704 4.2.1: "{}alternative signallink link"{} */}} \DoxyCodeLine{70 \textcolor{keyword}{struct }osmo\_ss7\_asp *alt\_asp;} \DoxyCodeLine{71 \};} \DoxyCodeLine{72 } \DoxyCodeLine{73 \textcolor{keyword}{struct }osmo\_ss7\_as \{} \DoxyCodeLine{75 \textcolor{keyword}{struct }llist\_head list;} \DoxyCodeLine{76 \textcolor{keyword}{struct }osmo\_ss7\_instance *inst;} \DoxyCodeLine{77 } \DoxyCodeLine{79 \textcolor{keyword}{struct }osmo\_fsm\_inst *fi;} \DoxyCodeLine{80 } \DoxyCodeLine{82 \textcolor{keywordtype}{bool} rkm\_dyn\_allocated;} \DoxyCodeLine{83 } \DoxyCodeLine{85 \textcolor{keywordtype}{bool} simple\_client\_allocated;} \DoxyCodeLine{86 } \DoxyCodeLine{88 \textcolor{keyword}{struct }rate\_ctr\_group *ctrg;} \DoxyCodeLine{89 } \DoxyCodeLine{90 \textcolor{comment}{/* ASP loadshare: */}} \DoxyCodeLine{91 \textcolor{keyword}{struct }osmo\_ss7\_as\_esls\_entry aesls\_table[NUM\_AS\_EXT\_SLS];} \DoxyCodeLine{92 } \DoxyCodeLine{93 \textcolor{keyword}{struct }\{} \DoxyCodeLine{94 \textcolor{keywordtype}{char} *name;} \DoxyCodeLine{95 \textcolor{keywordtype}{char} *description;} \DoxyCodeLine{96 \textcolor{keyword}{enum} osmo\_ss7\_asp\_protocol proto;} \DoxyCodeLine{97 \textcolor{keyword}{struct }osmo\_ss7\_routing\_key routing\_key;} \DoxyCodeLine{98 \textcolor{keyword}{enum} osmo\_ss7\_as\_traffic\_mode mode;} \DoxyCodeLine{99 \textcolor{comment}{/* traffic mode was configured by VTY / config file */}} \DoxyCodeLine{100 \textcolor{keywordtype}{bool} mode\_set\_by\_vty;} \DoxyCodeLine{101 \textcolor{comment}{/* traffic mode was configured by RKM (routing key management) or first ASPAC */}} \DoxyCodeLine{102 \textcolor{keywordtype}{bool} mode\_set\_by\_peer;} \DoxyCodeLine{103 uint32\_t recovery\_timeout\_msec;} \DoxyCodeLine{104 uint8\_t qos\_class;} \DoxyCodeLine{105 \textcolor{keyword}{struct }\{} \DoxyCodeLine{106 uint32\_t dpc;} \DoxyCodeLine{107 \textcolor{keyword}{enum} osmo\_ss7\_as\_patch\_sccp\_mode sccp\_mode;} \DoxyCodeLine{108 \} pc\_override;} \DoxyCodeLine{109 } \DoxyCodeLine{110 \textcolor{keyword}{struct }osmo\_ss7\_asp *asps[16];} \DoxyCodeLine{111 \textcolor{comment}{/* used for load-\/sharing traffic mode (round robin implementation) */}} \DoxyCodeLine{112 uint8\_t last\_asp\_idx\_assigned;} \DoxyCodeLine{113 uint8\_t last\_asp\_idx\_sent;} \DoxyCodeLine{114 } \DoxyCodeLine{115 \textcolor{keyword}{struct }\{} \DoxyCodeLine{116 \textcolor{comment}{/* How many bits from ITU SLS field (starting from least-\/significant-\/bit)}} \DoxyCodeLine{117 \textcolor{comment}{ * to skip for routing decisions.}} \DoxyCodeLine{118 \textcolor{comment}{ * range 0-\/3, defaults to 0, which means take all 4 bits. */}} \DoxyCodeLine{119 uint8\_t sls\_shift;} \DoxyCodeLine{120 \textcolor{comment}{/* Whether to generate a extended-\/SLS with OPC information, see opc\_shift below. */}} \DoxyCodeLine{121 \textcolor{keywordtype}{bool} opc\_sls;} \DoxyCodeLine{122 \textcolor{comment}{/* How many bits from ITU OPC field (starting from least-\/significant-\/bit)}} \DoxyCodeLine{123 \textcolor{comment}{ * to skip for routing decisions (always takes 12 bits).}} \DoxyCodeLine{124 \textcolor{comment}{ * range 0-\/2, defaults to 0, which means take least significant 12 bits. */}} \DoxyCodeLine{125 uint8\_t opc\_shift;} \DoxyCodeLine{126 \} loadshare;} \DoxyCodeLine{127 \} cfg;} \DoxyCodeLine{128 \};} \DoxyCodeLine{129 } \DoxyCodeLine{130 \textcolor{keyword}{struct }osmo\_ss7\_asp *ss7\_as\_select\_asp(\textcolor{keyword}{struct} osmo\_ss7\_as *as, \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_mtp\_transfer\_param *mtp);} \DoxyCodeLine{131 } \DoxyCodeLine{132 \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} osmo\_ss7\_as\_count\_asp(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_ss7\_as *as);} \DoxyCodeLine{133 \textcolor{keywordtype}{int} ss7\_as\_add\_asp(\textcolor{keyword}{struct} osmo\_ss7\_as *as, \textcolor{keyword}{struct} osmo\_ss7\_asp *asp);} \DoxyCodeLine{134 } \DoxyCodeLine{135 \textcolor{preprocessor}{\#define LOGPAS(as, subsys, level, fmt, args ...) \(\backslash\)}} \DoxyCodeLine{136 \textcolor{preprocessor}{ \_LOGSS7((as)-\/>inst, subsys, level, "{}AS(\%s) "{}} fmt, (as)-\/>cfg.name, \#\# args)} \end{DoxyCode}