\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{1 \textcolor{preprocessor}{\#pragma once}}
\DoxyCodeLine{2 \textcolor{preprocessor}{\#include <inttypes.h>}}
\DoxyCodeLine{3 }
\DoxyCodeLine{4 \textcolor{preprocessor}{\#include <osmocom/core/fsm.h>}}
\DoxyCodeLine{5 \textcolor{preprocessor}{\#include <osmocom/sigtran/sccp\_sap.h>}}
\DoxyCodeLine{6 }
\DoxyCodeLine{7 \textcolor{keyword}{struct }xua\_msg;}
\DoxyCodeLine{8 }
\DoxyCodeLine{9 \textcolor{comment}{/* a logical connection within the SCCP instance */}}
\DoxyCodeLine{10 \textcolor{keyword}{struct }sccp\_connection \{}
\DoxyCodeLine{11         \textcolor{comment}{/* entry in (struct sccp\_instance)-\/>connections */}}
\DoxyCodeLine{12         \textcolor{keyword}{struct }rb\_node node;}
\DoxyCodeLine{13         \textcolor{comment}{/* which instance are we part of? */}}
\DoxyCodeLine{14         \textcolor{keyword}{struct }osmo\_sccp\_instance *inst;}
\DoxyCodeLine{15         \textcolor{comment}{/* which user owns us? */}}
\DoxyCodeLine{16         \textcolor{keyword}{struct }osmo\_sccp\_user *user;}
\DoxyCodeLine{17 }
\DoxyCodeLine{18         \textcolor{comment}{/* remote point code */}}
\DoxyCodeLine{19         uint32\_t remote\_pc;}
\DoxyCodeLine{20 }
\DoxyCodeLine{21         \textcolor{comment}{/* local/remote addresses and identities */}}
\DoxyCodeLine{22         \textcolor{keyword}{struct }osmo\_sccp\_addr calling\_addr;}
\DoxyCodeLine{23         \textcolor{keyword}{struct }osmo\_sccp\_addr called\_addr;}
\DoxyCodeLine{24         \textcolor{comment}{/* SCCP connection identifier. Only relevant across the SCCP User SAP,}}
\DoxyCodeLine{25 \textcolor{comment}{         * i.e. between the local application using the SCCP stack provided by}}
\DoxyCodeLine{26 \textcolor{comment}{         * libosmo-\/sccp.  Never transmitted over the wire! */}}
\DoxyCodeLine{27         uint32\_t conn\_id;}
\DoxyCodeLine{28         \textcolor{comment}{/* SCCP Remote Connection Reference.  Allocated by the remote}}
\DoxyCodeLine{29 \textcolor{comment}{         * SCCP stack to uniquely identify a SCCP connection on its end.}}
\DoxyCodeLine{30 \textcolor{comment}{         * We don't interpret it, but simply cache it here so we can use}}
\DoxyCodeLine{31 \textcolor{comment}{         * it whenever sending data to the peer. Only relevant over the}}
\DoxyCodeLine{32 \textcolor{comment}{         * wire, not to be used across the SCCP user SAP */}}
\DoxyCodeLine{33         uint32\_t remote\_ref;}
\DoxyCodeLine{34 }
\DoxyCodeLine{35         uint32\_t importance;}
\DoxyCodeLine{36         uint32\_t sccp\_class;}
\DoxyCodeLine{37         uint32\_t release\_cause; \textcolor{comment}{/* WAIT\_CONN\_CONF */}}
\DoxyCodeLine{38 }
\DoxyCodeLine{39         \textcolor{comment}{/* SLS to be used to transmit all Connection-\/oriented messages}}
\DoxyCodeLine{40 \textcolor{comment}{         * (ITU-\/T Q.714 1.1.2.3 Protocol class 2).}}
\DoxyCodeLine{41 \textcolor{comment}{         * SLS is 4 bits, as described in ITU Q.704 Figure 3 */}}
\DoxyCodeLine{42         uint8\_t tx\_co\_mtp\_sls;}
\DoxyCodeLine{43 }
\DoxyCodeLine{44         \textcolor{keyword}{struct }msgb *opt\_data\_cache;}
\DoxyCodeLine{45 }
\DoxyCodeLine{46         \textcolor{comment}{/* incoming (true) or outgoing (false) */}}
\DoxyCodeLine{47         \textcolor{keywordtype}{bool} incoming;}
\DoxyCodeLine{48 }
\DoxyCodeLine{49         \textcolor{comment}{/* Osmo FSM Instance of sccp\_scoc\_fsm */}}
\DoxyCodeLine{50         \textcolor{keyword}{struct }osmo\_fsm\_inst *fi;}
\DoxyCodeLine{51 }
\DoxyCodeLine{52         \textcolor{comment}{/* Connect timer */}}
\DoxyCodeLine{53         \textcolor{keyword}{struct }osmo\_timer\_list t\_conn;}
\DoxyCodeLine{54 }
\DoxyCodeLine{55         \textcolor{comment}{/* inactivity timers */}}
\DoxyCodeLine{56         \textcolor{keyword}{struct }osmo\_timer\_list t\_ias;}
\DoxyCodeLine{57         \textcolor{keyword}{struct }osmo\_timer\_list t\_iar;}
\DoxyCodeLine{58 }
\DoxyCodeLine{59         \textcolor{comment}{/* release timers */}}
\DoxyCodeLine{60         \textcolor{keyword}{struct }osmo\_timer\_list t\_rel;}
\DoxyCodeLine{61         \textcolor{keyword}{struct }osmo\_timer\_list t\_int;}
\DoxyCodeLine{62         \textcolor{keyword}{struct }osmo\_timer\_list t\_rep\_rel;}
\DoxyCodeLine{63 \};}
\DoxyCodeLine{64 }
\DoxyCodeLine{65 \textcolor{keyword}{struct }sccp\_connection *sccp\_conn\_alloc(\textcolor{keyword}{struct} osmo\_sccp\_user *user, uint32\_t conn\_id);}
\DoxyCodeLine{66 \textcolor{keywordtype}{void} sccp\_conn\_free(\textcolor{keyword}{struct} sccp\_connection *conn);}
\DoxyCodeLine{67 }
\DoxyCodeLine{68 \textcolor{comment}{/* timer related: */}}
\DoxyCodeLine{69 \textcolor{keywordtype}{void} sccp\_conn\_restart\_tx\_inact\_timer(\textcolor{keyword}{struct} sccp\_connection *conn);}
\DoxyCodeLine{70 \textcolor{keywordtype}{void} sccp\_conn\_restart\_rx\_inact\_timer(\textcolor{keyword}{struct} sccp\_connection *conn);}
\DoxyCodeLine{71 \textcolor{keywordtype}{void} sccp\_conn\_start\_inact\_timers(\textcolor{keyword}{struct} sccp\_connection *conn);}
\DoxyCodeLine{72 \textcolor{keywordtype}{void} sccp\_conn\_stop\_inact\_timers(\textcolor{keyword}{struct} sccp\_connection *conn);}
\DoxyCodeLine{73 \textcolor{keywordtype}{void} sccp\_conn\_start\_rel\_timer(\textcolor{keyword}{struct} sccp\_connection *conn);}
\DoxyCodeLine{74 \textcolor{keywordtype}{void} sccp\_conn\_start\_rep\_rel\_timer(\textcolor{keyword}{struct} sccp\_connection *conn);}
\DoxyCodeLine{75 \textcolor{keywordtype}{void} sccp\_conn\_start\_int\_timer(\textcolor{keyword}{struct} sccp\_connection *conn);}
\DoxyCodeLine{76 \textcolor{keywordtype}{void} sccp\_conn\_stop\_release\_timers(\textcolor{keyword}{struct} sccp\_connection *conn);}
\DoxyCodeLine{77 \textcolor{keywordtype}{void} sccp\_conn\_start\_connect\_timer(\textcolor{keyword}{struct} sccp\_connection *conn);}
\DoxyCodeLine{78 \textcolor{keywordtype}{void} sccp\_conn\_stop\_connect\_timer(\textcolor{keyword}{struct} sccp\_connection *conn);}
\DoxyCodeLine{79 }
\DoxyCodeLine{80 \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{81 }
\DoxyCodeLine{82 \textcolor{keywordtype}{int} sccp\_conn\_xua\_gen\_encode\_and\_send(\textcolor{keyword}{struct} sccp\_connection *conn, uint32\_t event,}
\DoxyCodeLine{83                                       \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_scu\_prim *prim, \textcolor{keywordtype}{int} msg\_type);}
\DoxyCodeLine{84 \textcolor{keywordtype}{int} sccp\_conn\_xua\_gen\_relre\_and\_send(\textcolor{keyword}{struct} sccp\_connection *conn, uint32\_t cause,}
\DoxyCodeLine{85                                      \textcolor{keyword}{struct} osmo\_scu\_prim *prim);}
\DoxyCodeLine{86 \textcolor{keywordtype}{void} sccp\_conn\_scu\_gen\_encode\_and\_send(\textcolor{keyword}{struct} sccp\_connection *conn, uint32\_t event,}
\DoxyCodeLine{87                                        \textcolor{keyword}{struct} xua\_msg *xua, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} primitive,}
\DoxyCodeLine{88                                        \textcolor{keyword}{enum} osmo\_prim\_operation operation);}
\DoxyCodeLine{89 }
\DoxyCodeLine{90 }
\DoxyCodeLine{91 \textcolor{preprocessor}{\#define \_LOGPSCC(scc, subsys, level, fmt, args ...) \(\backslash\)}}
\DoxyCodeLine{92 \textcolor{preprocessor}{        \_LOGPSCU((scc)-\/>user, subsys, level, "{}CONN(\%d,remPC=\%u=\%s) "{}} fmt, \(\backslash\)}
\DoxyCodeLine{93                  (conn)-\/>conn\_id, (conn)-\/>remote\_pc, osmo\_ss7\_pointcode\_print((conn)-\/>inst-\/>ss7, (conn)-\/>remote\_pc), \#\# args)}
\DoxyCodeLine{94 \textcolor{preprocessor}{\#define LOGPSCC(scc, level, fmt, args ...) \(\backslash\)}}
\DoxyCodeLine{95 \textcolor{preprocessor}{        \_LOGPSCC(scc, DLSCCP, level, fmt, \#\# args)}}

\end{DoxyCode}
