\doxysection{sccp\+\_\+internal.\+h}
\label{sccp__internal_8h_source}\index{src/sccp\_internal.h@{src/sccp\_internal.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 <osmocom/core/fsm.h>}}
\DoxyCodeLine{4 \textcolor{preprocessor}{\#include <osmocom/core/prim.h>}}
\DoxyCodeLine{5 \textcolor{preprocessor}{\#include <osmocom/core/linuxlist.h>}}
\DoxyCodeLine{6 \textcolor{preprocessor}{\#include <osmocom/core/linuxrbtree.h>}}
\DoxyCodeLine{7 \textcolor{preprocessor}{\#include <osmocom/core/tdef.h>}}
\DoxyCodeLine{8 \textcolor{preprocessor}{\#include <osmocom/sigtran/sccp\_sap.h>}}
\DoxyCodeLine{9 \textcolor{preprocessor}{\#include <osmocom/sigtran/osmo\_ss7.h>}}
\DoxyCodeLine{10 \textcolor{preprocessor}{\#include <osmocom/sigtran/protocol/mtp.h>}}
\DoxyCodeLine{11 }
\DoxyCodeLine{12 \textcolor{preprocessor}{\#define SCCP\_STR "{}Signalling Connection Control Part\(\backslash\)n"{}}}
\DoxyCodeLine{13 }
\DoxyCodeLine{14 \textcolor{comment}{/* Appendix C.4 of Q.714 */}}
\DoxyCodeLine{15 \textcolor{keyword}{enum} osmo\_sccp\_timer \{}
\DoxyCodeLine{16         \textcolor{comment}{/* 0 kept unused on purpose since it's handled specially by osmo\_fsm */}}
\DoxyCodeLine{17         OSMO\_SCCP\_TIMER\_CONN\_EST = 1,}
\DoxyCodeLine{18         OSMO\_SCCP\_TIMER\_IAS,}
\DoxyCodeLine{19         OSMO\_SCCP\_TIMER\_IAR,}
\DoxyCodeLine{20         OSMO\_SCCP\_TIMER\_REL,}
\DoxyCodeLine{21         OSMO\_SCCP\_TIMER\_REPEAT\_REL,}
\DoxyCodeLine{22         OSMO\_SCCP\_TIMER\_INT,}
\DoxyCodeLine{23         OSMO\_SCCP\_TIMER\_GUARD,}
\DoxyCodeLine{24         OSMO\_SCCP\_TIMER\_RESET,}
\DoxyCodeLine{25         OSMO\_SCCP\_TIMER\_REASSEMBLY,}
\DoxyCodeLine{26         \textcolor{comment}{/* This must remain the last item: */}}
\DoxyCodeLine{27         OSMO\_SCCP\_TIMERS\_LEN}
\DoxyCodeLine{28 \};}
\DoxyCodeLine{29 }
\DoxyCodeLine{30 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }osmo\_tdef osmo\_sccp\_timer\_defaults[OSMO\_SCCP\_TIMERS\_LEN];}
\DoxyCodeLine{31 }
\DoxyCodeLine{32 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }value\_string osmo\_sccp\_timer\_names[];}
\DoxyCodeLine{33 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_sccp\_timer\_name(\textcolor{keyword}{enum} osmo\_sccp\_timer val)}
\DoxyCodeLine{34 \{ \textcolor{keywordflow}{return} get\_value\_string(osmo\_sccp\_timer\_names, val); \}}
\DoxyCodeLine{35 }
\DoxyCodeLine{36 \textcolor{comment}{/* an instance of the SCCP stack */}}
\DoxyCodeLine{37 \textcolor{keyword}{struct }osmo\_sccp\_instance \{}
\DoxyCodeLine{38         \textcolor{comment}{/* entry in global list of ss7 instances */}}
\DoxyCodeLine{39         \textcolor{keyword}{struct }llist\_head list;}
\DoxyCodeLine{40         \textcolor{comment}{/* rbtree root of 'struct sccp\_connection' in this instance */}}
\DoxyCodeLine{41         \textcolor{keyword}{struct }rb\_root connections;}
\DoxyCodeLine{42         \textcolor{comment}{/* list of SCCP users in this instance */}}
\DoxyCodeLine{43         \textcolor{keyword}{struct }llist\_head users;}
\DoxyCodeLine{44         \textcolor{comment}{/* routing context to be used in all outbound messages */}}
\DoxyCodeLine{45         uint32\_t route\_ctx;}
\DoxyCodeLine{46         \textcolor{comment}{/* next connection ID to allocate */}}
\DoxyCodeLine{47         uint32\_t next\_id;}
\DoxyCodeLine{48         \textcolor{keyword}{struct }osmo\_ss7\_instance *ss7;}
\DoxyCodeLine{49         \textcolor{keywordtype}{void} *priv;}
\DoxyCodeLine{50 }
\DoxyCodeLine{51         \textcolor{keyword}{struct }osmo\_ss7\_user ss7\_user;}
\DoxyCodeLine{52 }
\DoxyCodeLine{53         \textcolor{keyword}{struct }osmo\_tdef *tdefs;}
\DoxyCodeLine{54 }
\DoxyCodeLine{55         uint32\_t max\_optional\_data;}
\DoxyCodeLine{56 \};}
\DoxyCodeLine{57 }
\DoxyCodeLine{58 \textcolor{keyword}{struct }osmo\_sccp\_user \{}
\DoxyCodeLine{60         \textcolor{keyword}{struct }llist\_head list;}
\DoxyCodeLine{62         \textcolor{keyword}{struct }osmo\_sccp\_instance *inst;}
\DoxyCodeLine{64         \textcolor{keywordtype}{char} *name;}
\DoxyCodeLine{65 }
\DoxyCodeLine{67         uint16\_t ssn;}
\DoxyCodeLine{68         uint32\_t pc;}
\DoxyCodeLine{69 }
\DoxyCodeLine{70         \textcolor{comment}{/* set if we are a server */}}
\DoxyCodeLine{71         \textcolor{keyword}{struct }llist\_head links;}
\DoxyCodeLine{72 }
\DoxyCodeLine{73         \textcolor{comment}{/* user call-\/back function in case of incoming primitives */}}
\DoxyCodeLine{74         osmo\_prim\_cb prim\_cb;}
\DoxyCodeLine{75         \textcolor{keywordtype}{void} *priv;}
\DoxyCodeLine{76 }
\DoxyCodeLine{77         \textcolor{comment}{/* Application Server FSM Instance */}}
\DoxyCodeLine{78         \textcolor{keyword}{struct }osmo\_fsm\_inst *as\_fi;}
\DoxyCodeLine{79 \};}
\DoxyCodeLine{80 }
\DoxyCodeLine{81 \textcolor{keyword}{extern} \textcolor{keywordtype}{int} DSCCP;}
\DoxyCodeLine{82 }
\DoxyCodeLine{83 \textcolor{keyword}{struct }xua\_msg;}
\DoxyCodeLine{84 }
\DoxyCodeLine{85 \textcolor{keyword}{struct }osmo\_sccp\_user *}
\DoxyCodeLine{86 sccp\_user\_find(\textcolor{keyword}{struct} osmo\_sccp\_instance *inst, uint16\_t ssn, uint32\_t pc);}
\DoxyCodeLine{87 }
\DoxyCodeLine{88 \textcolor{comment}{/* Message from SCOC -\/> SCRC */}}
\DoxyCodeLine{89 \textcolor{keywordtype}{int} sccp\_scrc\_rx\_scoc\_conn\_msg(\textcolor{keyword}{struct} osmo\_sccp\_instance *inst,}
\DoxyCodeLine{90                                 \textcolor{keyword}{struct} xua\_msg *xua);}
\DoxyCodeLine{91 }
\DoxyCodeLine{92 \textcolor{comment}{/* Message from SCLC -\/> SCRC */}}
\DoxyCodeLine{93 \textcolor{keywordtype}{int} sccp\_scrc\_rx\_sclc\_msg(\textcolor{keyword}{struct} osmo\_sccp\_instance *inst, \textcolor{keyword}{struct} xua\_msg *xua);}
\DoxyCodeLine{94 }
\DoxyCodeLine{95 \textcolor{comment}{/* Message from MTP (SUA) -\/> SCRC */}}
\DoxyCodeLine{96 \textcolor{keywordtype}{int} scrc\_rx\_mtp\_xfer\_ind\_xua(\textcolor{keyword}{struct} osmo\_sccp\_instance *inst,}
\DoxyCodeLine{97                              \textcolor{keyword}{struct} xua\_msg *xua);}
\DoxyCodeLine{98 }
\DoxyCodeLine{99 \textcolor{comment}{/* Message from SCRC -\/> SCOC */}}
\DoxyCodeLine{100 \textcolor{keywordtype}{void} sccp\_scoc\_rx\_from\_scrc(\textcolor{keyword}{struct} osmo\_sccp\_instance *inst,}
\DoxyCodeLine{101                             \textcolor{keyword}{struct} xua\_msg *xua);}
\DoxyCodeLine{102 \textcolor{keywordtype}{void} sccp\_scoc\_rx\_scrc\_rout\_fail(\textcolor{keyword}{struct} osmo\_sccp\_instance *inst,}
\DoxyCodeLine{103                                  \textcolor{keyword}{struct} xua\_msg *xua, uint32\_t cause);}
\DoxyCodeLine{104 }
\DoxyCodeLine{105 \textcolor{keywordtype}{void} sccp\_scoc\_flush\_connections(\textcolor{keyword}{struct} osmo\_sccp\_instance *inst);}
\DoxyCodeLine{106 }
\DoxyCodeLine{107 \textcolor{comment}{/* Message from SCRC -\/> SCLC */}}
\DoxyCodeLine{108 \textcolor{keywordtype}{int} sccp\_sclc\_rx\_from\_scrc(\textcolor{keyword}{struct} osmo\_sccp\_instance *inst,}
\DoxyCodeLine{109                            \textcolor{keyword}{struct} xua\_msg *xua);}
\DoxyCodeLine{110 \textcolor{keywordtype}{void} sccp\_sclc\_rx\_scrc\_rout\_fail(\textcolor{keyword}{struct} osmo\_sccp\_instance *inst,}
\DoxyCodeLine{111                                  \textcolor{keyword}{struct} xua\_msg *xua, uint32\_t cause);}
\DoxyCodeLine{112 }
\DoxyCodeLine{113 \textcolor{keywordtype}{int} sccp\_user\_prim\_up(\textcolor{keyword}{struct} osmo\_sccp\_user *scut, \textcolor{keyword}{struct} osmo\_scu\_prim *prim);}
\DoxyCodeLine{114 }
\DoxyCodeLine{115 \textcolor{comment}{/* SCU -\/> SCLC */}}
\DoxyCodeLine{116 \textcolor{keywordtype}{int} sccp\_sclc\_user\_sap\_down(\textcolor{keyword}{struct} osmo\_sccp\_user *scu, \textcolor{keyword}{struct} osmo\_prim\_hdr *oph);}
\DoxyCodeLine{117 \textcolor{keywordtype}{int} sccp\_sclc\_user\_sap\_down\_nofree(\textcolor{keyword}{struct} osmo\_sccp\_user *scu, \textcolor{keyword}{struct} osmo\_prim\_hdr *oph);}
\DoxyCodeLine{118 }
\DoxyCodeLine{119 \textcolor{keyword}{struct }msgb *sccp\_msgb\_alloc(\textcolor{keyword}{const} \textcolor{keywordtype}{char} *name);}
\DoxyCodeLine{120 }
\DoxyCodeLine{121 \textcolor{keyword}{extern} \textcolor{keyword}{struct }osmo\_fsm sccp\_scoc\_fsm;}
\DoxyCodeLine{122 }
\DoxyCodeLine{123 \textcolor{keywordtype}{void} sccp\_scoc\_show\_connections(\textcolor{keyword}{struct} vty *vty, \textcolor{keyword}{struct} osmo\_sccp\_instance *inst);}
\DoxyCodeLine{124 }
\DoxyCodeLine{125 \textcolor{keywordtype}{void} osmo\_sccp\_vty\_write\_cs7\_node(\textcolor{keyword}{struct} vty *vty, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *indent, \textcolor{keyword}{struct} osmo\_sccp\_instance *inst);}
\DoxyCodeLine{126 }
\DoxyCodeLine{127 \textcolor{comment}{/* Local Broadcast (LBCS) */}}
\DoxyCodeLine{128 \textcolor{keywordtype}{void} sccp\_lbcs\_local\_bcast\_pcstate(\textcolor{keyword}{struct} osmo\_sccp\_instance *inst,}
\DoxyCodeLine{129                                    \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_scu\_pcstate\_param *pcstate);}
\DoxyCodeLine{130 \textcolor{keywordtype}{void} sccp\_lbcs\_local\_bcast\_state(\textcolor{keyword}{struct} osmo\_sccp\_instance *inst,}
\DoxyCodeLine{131                                    \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_scu\_state\_param *state);}
\DoxyCodeLine{132 }
\DoxyCodeLine{133 \textcolor{comment}{/* SCCP Management (SCMG) */}}
\DoxyCodeLine{134 \textcolor{keywordtype}{void} sccp\_scmg\_rx\_ssn\_allowed(\textcolor{keyword}{struct} osmo\_sccp\_instance *inst, uint32\_t dpc, uint32\_t ssn, uint32\_t smi);}
\DoxyCodeLine{135 \textcolor{keywordtype}{void} sccp\_scmg\_rx\_ssn\_prohibited(\textcolor{keyword}{struct} osmo\_sccp\_instance *inst, uint32\_t dpc, uint32\_t ssn, uint32\_t smi);}
\DoxyCodeLine{136 \textcolor{keywordtype}{void} sccp\_scmg\_rx\_mtp\_pause(\textcolor{keyword}{struct} osmo\_sccp\_instance *inst, uint32\_t dpc);}
\DoxyCodeLine{137 \textcolor{keywordtype}{void} sccp\_scmg\_rx\_mtp\_resume(\textcolor{keyword}{struct} osmo\_sccp\_instance *inst, uint32\_t dpc);}
\DoxyCodeLine{138 \textcolor{keywordtype}{void} sccp\_scmg\_rx\_mtp\_status(\textcolor{keyword}{struct} osmo\_sccp\_instance *inst, uint32\_t dpc, \textcolor{keyword}{enum} mtp\_unavail\_cause cause);}
\DoxyCodeLine{139 \textcolor{keywordtype}{int} sccp\_scmg\_init(\textcolor{keyword}{struct} osmo\_sccp\_instance *inst);}

\end{DoxyCode}
