\doxysection{sccp\+\_\+connection.\+h}
\label{sccp__connection_8h_source}\index{src/sccp\_connection.h@{src/sccp\_connection.h}}
\textbf{ Go to the documentation of this file.}
\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{preprocessor}{\#pragma\ once}}
\DoxyCodeLine{00002\ \textcolor{preprocessor}{\#include\ <inttypes.h>}}
\DoxyCodeLine{00003\ }
\DoxyCodeLine{00004\ \textcolor{preprocessor}{\#include\ <osmocom/core/fsm.h>}}
\DoxyCodeLine{00005\ \textcolor{preprocessor}{\#include\ <osmocom/sigtran/sccp\_sap.h>}}
\DoxyCodeLine{00006\ }
\DoxyCodeLine{00007\ \textcolor{keyword}{struct\ }xua\_msg;}
\DoxyCodeLine{00008\ }
\DoxyCodeLine{00009\ \textcolor{comment}{/*\ a\ logical\ connection\ within\ the\ SCCP\ instance\ */}}
\DoxyCodeLine{00010\ \textcolor{keyword}{struct\ }sccp\_connection\ \{}
\DoxyCodeLine{00011\ \ \ \ \ \ \ \ \ \textcolor{comment}{/*\ entry\ in\ (struct\ sccp\_instance)-\/>connections\ */}}
\DoxyCodeLine{00012\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }rb\_node\ node;}
\DoxyCodeLine{00013\ \ \ \ \ \ \ \ \ \textcolor{comment}{/*\ which\ instance\ are\ we\ part\ of?\ */}}
\DoxyCodeLine{00014\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }osmo\_sccp\_instance\ *inst;}
\DoxyCodeLine{00015\ \ \ \ \ \ \ \ \ \textcolor{comment}{/*\ which\ user\ owns\ us?\ */}}
\DoxyCodeLine{00016\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }osmo\_sccp\_user\ *user;}
\DoxyCodeLine{00017\ }
\DoxyCodeLine{00018\ \ \ \ \ \ \ \ \ \textcolor{comment}{/*\ remote\ point\ code\ */}}
\DoxyCodeLine{00019\ \ \ \ \ \ \ \ \ uint32\_t\ remote\_pc;}
\DoxyCodeLine{00020\ }
\DoxyCodeLine{00021\ \ \ \ \ \ \ \ \ \textcolor{comment}{/*\ local/remote\ addresses\ and\ identities\ */}}
\DoxyCodeLine{00022\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }osmo\_sccp\_addr\ calling\_addr;}
\DoxyCodeLine{00023\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }osmo\_sccp\_addr\ called\_addr;}
\DoxyCodeLine{00024\ \ \ \ \ \ \ \ \ \textcolor{comment}{/*\ SCCP\ connection\ identifier.\ Only\ relevant\ across\ the\ SCCP\ User\ SAP,}}
\DoxyCodeLine{00025\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ *\ i.e.\ between\ the\ local\ application\ using\ the\ SCCP\ stack\ provided\ by}}
\DoxyCodeLine{00026\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ *\ libosmo-\/sccp.\ \ Never\ transmitted\ over\ the\ wire!\ */}}
\DoxyCodeLine{00027\ \ \ \ \ \ \ \ \ uint32\_t\ conn\_id;}
\DoxyCodeLine{00028\ \ \ \ \ \ \ \ \ \textcolor{comment}{/*\ SCCP\ Remote\ Connection\ Reference.\ \ Allocated\ by\ the\ remote}}
\DoxyCodeLine{00029\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ *\ SCCP\ stack\ to\ uniquely\ identify\ a\ SCCP\ connection\ on\ its\ end.}}
\DoxyCodeLine{00030\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ *\ We\ don't\ interpret\ it,\ but\ simply\ cache\ it\ here\ so\ we\ can\ use}}
\DoxyCodeLine{00031\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ *\ it\ whenever\ sending\ data\ to\ the\ peer.\ Only\ relevant\ over\ the}}
\DoxyCodeLine{00032\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ *\ wire,\ not\ to\ be\ used\ across\ the\ SCCP\ user\ SAP\ */}}
\DoxyCodeLine{00033\ \ \ \ \ \ \ \ \ uint32\_t\ remote\_ref;}
\DoxyCodeLine{00034\ }
\DoxyCodeLine{00035\ \ \ \ \ \ \ \ \ uint32\_t\ importance;}
\DoxyCodeLine{00036\ \ \ \ \ \ \ \ \ uint32\_t\ sccp\_class;}
\DoxyCodeLine{00037\ \ \ \ \ \ \ \ \ uint32\_t\ release\_cause;\ \textcolor{comment}{/*\ WAIT\_CONN\_CONF\ */}}
\DoxyCodeLine{00038\ }
\DoxyCodeLine{00039\ \ \ \ \ \ \ \ \ \textcolor{comment}{/*\ SLS\ to\ be\ used\ to\ transmit\ all\ Connection-\/oriented\ messages}}
\DoxyCodeLine{00040\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ *\ (ITU-\/T\ Q.714\ 1.1.2.3\ Protocol\ class\ 2).}}
\DoxyCodeLine{00041\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ *\ SLS\ is\ 4\ bits,\ as\ described\ in\ ITU\ Q.704\ Figure\ 3\ */}}
\DoxyCodeLine{00042\ \ \ \ \ \ \ \ \ uint8\_t\ tx\_co\_mtp\_sls;}
\DoxyCodeLine{00043\ }
\DoxyCodeLine{00044\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }msgb\ *opt\_data\_cache;}
\DoxyCodeLine{00045\ }
\DoxyCodeLine{00046\ \ \ \ \ \ \ \ \ \textcolor{comment}{/*\ incoming\ (true)\ or\ outgoing\ (false)\ */}}
\DoxyCodeLine{00047\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{bool}\ incoming;}
\DoxyCodeLine{00048\ }
\DoxyCodeLine{00049\ \ \ \ \ \ \ \ \ \textcolor{comment}{/*\ Osmo\ FSM\ Instance\ of\ sccp\_scoc\_fsm\ */}}
\DoxyCodeLine{00050\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }osmo\_fsm\_inst\ *fi;}
\DoxyCodeLine{00051\ }
\DoxyCodeLine{00052\ \ \ \ \ \ \ \ \ \textcolor{comment}{/*\ Connect\ timer\ */}}
\DoxyCodeLine{00053\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }osmo\_timer\_list\ t\_conn;}
\DoxyCodeLine{00054\ }
\DoxyCodeLine{00055\ \ \ \ \ \ \ \ \ \textcolor{comment}{/*\ inactivity\ timers\ */}}
\DoxyCodeLine{00056\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }osmo\_timer\_list\ t\_ias;}
\DoxyCodeLine{00057\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }osmo\_timer\_list\ t\_iar;}
\DoxyCodeLine{00058\ }
\DoxyCodeLine{00059\ \ \ \ \ \ \ \ \ \textcolor{comment}{/*\ release\ timers\ */}}
\DoxyCodeLine{00060\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }osmo\_timer\_list\ t\_rel;}
\DoxyCodeLine{00061\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }osmo\_timer\_list\ t\_int;}
\DoxyCodeLine{00062\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }osmo\_timer\_list\ t\_rep\_rel;}
\DoxyCodeLine{00063\ \};}
\DoxyCodeLine{00064\ }
\DoxyCodeLine{00065\ \textcolor{keyword}{struct\ }sccp\_connection\ *sccp\_conn\_alloc(\textcolor{keyword}{struct}\ osmo\_sccp\_user\ *user,\ uint32\_t\ conn\_id);}
\DoxyCodeLine{00066\ \textcolor{keywordtype}{void}\ sccp\_conn\_free(\textcolor{keyword}{struct}\ sccp\_connection\ *conn);}
\DoxyCodeLine{00067\ }
\DoxyCodeLine{00068\ \textcolor{comment}{/*\ timer\ related:\ */}}
\DoxyCodeLine{00069\ \textcolor{keywordtype}{void}\ sccp\_conn\_restart\_tx\_inact\_timer(\textcolor{keyword}{struct}\ sccp\_connection\ *conn);}
\DoxyCodeLine{00070\ \textcolor{keywordtype}{void}\ sccp\_conn\_restart\_rx\_inact\_timer(\textcolor{keyword}{struct}\ sccp\_connection\ *conn);}
\DoxyCodeLine{00071\ \textcolor{keywordtype}{void}\ sccp\_conn\_start\_inact\_timers(\textcolor{keyword}{struct}\ sccp\_connection\ *conn);}
\DoxyCodeLine{00072\ \textcolor{keywordtype}{void}\ sccp\_conn\_stop\_inact\_timers(\textcolor{keyword}{struct}\ sccp\_connection\ *conn);}
\DoxyCodeLine{00073\ \textcolor{keywordtype}{void}\ sccp\_conn\_start\_rel\_timer(\textcolor{keyword}{struct}\ sccp\_connection\ *conn);}
\DoxyCodeLine{00074\ \textcolor{keywordtype}{void}\ sccp\_conn\_start\_rep\_rel\_timer(\textcolor{keyword}{struct}\ sccp\_connection\ *conn);}
\DoxyCodeLine{00075\ \textcolor{keywordtype}{void}\ sccp\_conn\_start\_int\_timer(\textcolor{keyword}{struct}\ sccp\_connection\ *conn);}
\DoxyCodeLine{00076\ \textcolor{keywordtype}{void}\ sccp\_conn\_stop\_release\_timers(\textcolor{keyword}{struct}\ sccp\_connection\ *conn);}
\DoxyCodeLine{00077\ \textcolor{keywordtype}{void}\ sccp\_conn\_start\_connect\_timer(\textcolor{keyword}{struct}\ sccp\_connection\ *conn);}
\DoxyCodeLine{00078\ \textcolor{keywordtype}{void}\ sccp\_conn\_stop\_connect\_timer(\textcolor{keyword}{struct}\ sccp\_connection\ *conn);}
\DoxyCodeLine{00079\ }
\DoxyCodeLine{00080\ \textcolor{keywordtype}{void}\ sccp\_conn\_opt\_data\_send\_cache(\textcolor{keyword}{struct}\ sccp\_connection\ *conn,\ \textcolor{keywordtype}{int}\ exp\_type,\ uint8\_t\ msg\_class);}
\DoxyCodeLine{00081\ }
\DoxyCodeLine{00082\ \textcolor{keywordtype}{int}\ sccp\_conn\_xua\_gen\_encode\_and\_send(\textcolor{keyword}{struct}\ sccp\_connection\ *conn,\ uint32\_t\ event,}
\DoxyCodeLine{00083\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keyword}{struct}\ osmo\_scu\_prim\ *prim,\ \textcolor{keywordtype}{int}\ msg\_type);}
\DoxyCodeLine{00084\ \textcolor{keywordtype}{int}\ sccp\_conn\_xua\_gen\_relre\_and\_send(\textcolor{keyword}{struct}\ sccp\_connection\ *conn,\ uint32\_t\ cause,}
\DoxyCodeLine{00085\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct}\ osmo\_scu\_prim\ *prim);}
\DoxyCodeLine{00086\ \textcolor{keywordtype}{void}\ sccp\_conn\_scu\_gen\_encode\_and\_send(\textcolor{keyword}{struct}\ sccp\_connection\ *conn,\ uint32\_t\ event,}
\DoxyCodeLine{00087\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct}\ xua\_msg\ *xua,\ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ primitive,}
\DoxyCodeLine{00088\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{enum}\ osmo\_prim\_operation\ operation);}
\DoxyCodeLine{00089\ }
\DoxyCodeLine{00090\ }
\DoxyCodeLine{00091\ \textcolor{preprocessor}{\#define\ \_LOGPSCC(scc,\ subsys,\ level,\ fmt,\ args\ ...)\ \(\backslash\)}}
\DoxyCodeLine{00092\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \_LOGPSCU((scc)-\/>user,\ subsys,\ level,\ "{}CONN(\%d,remPC=\%u=\%s)\ "{}\ fmt,\ \(\backslash\)}}
\DoxyCodeLine{00093\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (conn)-\/>conn\_id,\ (conn)-\/>remote\_pc,\ osmo\_ss7\_pointcode\_print((conn)-\/>inst-\/>ss7,\ (conn)-\/>remote\_pc),\ \#\#\ args)}}
\DoxyCodeLine{00094\ \textcolor{preprocessor}{\#define\ LOGPSCC(scc,\ level,\ fmt,\ args\ ...)\ \(\backslash\)}}
\DoxyCodeLine{00095\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \_LOGPSCC(scc,\ DLSCCP,\ level,\ fmt,\ \#\#\ args)}}

\end{DoxyCode}
