\doxysection{gsm0411\+\_\+smc.\+h}
\label{gsm0411__smc_8h_source}\index{include/osmocom/gsm/gsm0411\_smc.h@{include/osmocom/gsm/gsm0411\_smc.h}}
\textbf{ Go to the documentation of this file.}
\begin{DoxyCode}{0}
\DoxyCodeLine{1 }
\DoxyCodeLine{5 \textcolor{preprocessor}{\#pragma once}}
\DoxyCodeLine{6 }
\DoxyCodeLine{7 \textcolor{preprocessor}{\#include <osmocom/core/timer.h>}}
\DoxyCodeLine{8 \textcolor{preprocessor}{\#include <osmocom/gsm/protocol/gsm\_04\_11.h>}}
\DoxyCodeLine{9 }
\DoxyCodeLine{10 \textcolor{preprocessor}{\#define GSM411\_MMSMS\_EST\_REQ            0x310}}
\DoxyCodeLine{11 \textcolor{preprocessor}{\#define GSM411\_MMSMS\_EST\_IND            0x312}}
\DoxyCodeLine{12 \textcolor{preprocessor}{\#define GSM411\_MMSMS\_EST\_CNF            0x311}}
\DoxyCodeLine{13 \textcolor{preprocessor}{\#define GSM411\_MMSMS\_REL\_REQ            0x320}}
\DoxyCodeLine{14 \textcolor{preprocessor}{\#define GSM411\_MMSMS\_REL\_IND            0x322}}
\DoxyCodeLine{15 \textcolor{preprocessor}{\#define GSM411\_MMSMS\_DATA\_REQ           0x330}}
\DoxyCodeLine{16 \textcolor{preprocessor}{\#define GSM411\_MMSMS\_DATA\_IND           0x332}}
\DoxyCodeLine{17 \textcolor{preprocessor}{\#define GSM411\_MMSMS\_UNIT\_DATA\_REQ      0x340}}
\DoxyCodeLine{18 \textcolor{preprocessor}{\#define GSM411\_MMSMS\_UNIT\_DATA\_IND      0x342}}
\DoxyCodeLine{19 \textcolor{preprocessor}{\#define GSM411\_MMSMS\_ERR\_IND            0x372}}
\DoxyCodeLine{20 }
\DoxyCodeLine{21 \textcolor{preprocessor}{\#define GSM411\_MNSMS\_ABORT\_REQ          0x101}}
\DoxyCodeLine{22 \textcolor{preprocessor}{\#define GSM411\_MNSMS\_DATA\_REQ           0x102}}
\DoxyCodeLine{23 \textcolor{preprocessor}{\#define GSM411\_MNSMS\_DATA\_IND           0x103}}
\DoxyCodeLine{24 \textcolor{preprocessor}{\#define GSM411\_MNSMS\_EST\_REQ            0x104}}
\DoxyCodeLine{25 \textcolor{preprocessor}{\#define GSM411\_MNSMS\_EST\_IND            0x105}}
\DoxyCodeLine{26 \textcolor{preprocessor}{\#define GSM411\_MNSMS\_ERROR\_IND          0x106}}
\DoxyCodeLine{27 \textcolor{preprocessor}{\#define GSM411\_MNSMS\_REL\_REQ            0x107}}
\DoxyCodeLine{28 }
\DoxyCodeLine{29 \textcolor{keyword}{struct }gsm411\_smc\_inst \{}
\DoxyCodeLine{30         uint64\_t id;          \textcolor{comment}{/* a unique id for the SMS */}}
\DoxyCodeLine{31         \textcolor{keywordtype}{int} network;             \textcolor{comment}{/* is this a MO (0) or MT (1) transfer */}}
\DoxyCodeLine{32         int (*mn\_recv) (\textcolor{keyword}{struct }gsm411\_smc\_inst *inst, \textcolor{keywordtype}{int} msg\_type,}
\DoxyCodeLine{33                         \textcolor{keyword}{struct }msgb *msg);}
\DoxyCodeLine{34         int (*mm\_send) (\textcolor{keyword}{struct }gsm411\_smc\_inst *inst, \textcolor{keywordtype}{int} msg\_type,}
\DoxyCodeLine{35                         \textcolor{keyword}{struct }msgb *msg, \textcolor{keywordtype}{int} cp\_msg\_type);}
\DoxyCodeLine{36 }
\DoxyCodeLine{37         \textcolor{keyword}{enum} gsm411\_cp\_state cp\_state;}
\DoxyCodeLine{38         \textcolor{keyword}{struct }osmo\_timer\_list cp\_timer;}
\DoxyCodeLine{39         \textcolor{keyword}{struct }msgb *cp\_msg;  \textcolor{comment}{/* store pending message */}}
\DoxyCodeLine{40         \textcolor{keywordtype}{int} cp\_rel;               \textcolor{comment}{/* store pending release */}}
\DoxyCodeLine{41         \textcolor{keywordtype}{int} cp\_retx;             \textcolor{comment}{/* retry counter */}}
\DoxyCodeLine{42         \textcolor{keywordtype}{int} cp\_max\_retr;     \textcolor{comment}{/* maximum retry */}}
\DoxyCodeLine{43         \textcolor{keywordtype}{int} cp\_tc1;               \textcolor{comment}{/* timer value TC1* */}}
\DoxyCodeLine{44 }
\DoxyCodeLine{45 \};}
\DoxyCodeLine{46 }
\DoxyCodeLine{47 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }value\_string gsm411\_cp\_cause\_strs[];}
\DoxyCodeLine{48 }
\DoxyCodeLine{49 \textcolor{comment}{/* init a new instance */}}
\DoxyCodeLine{50 \textcolor{keywordtype}{void} gsm411\_smc\_init(\textcolor{keyword}{struct} gsm411\_smc\_inst *inst, uint64\_t \textcolor{keywordtype}{id}, \textcolor{keywordtype}{int} network,}
\DoxyCodeLine{51         \textcolor{keywordtype}{int} (*mn\_recv) (\textcolor{keyword}{struct} gsm411\_smc\_inst *inst, \textcolor{keywordtype}{int} msg\_type,}
\DoxyCodeLine{52                         \textcolor{keyword}{struct} msgb *msg),}
\DoxyCodeLine{53         \textcolor{keywordtype}{int} (*mm\_send) (\textcolor{keyword}{struct} gsm411\_smc\_inst *inst, \textcolor{keywordtype}{int} msg\_type,}
\DoxyCodeLine{54                         \textcolor{keyword}{struct} msgb *msg, \textcolor{keywordtype}{int} cp\_msg\_type));}
\DoxyCodeLine{55 }
\DoxyCodeLine{56 \textcolor{comment}{/* clear instance */}}
\DoxyCodeLine{57 \textcolor{keywordtype}{void} gsm411\_smc\_clear(\textcolor{keyword}{struct} gsm411\_smc\_inst *inst);}
\DoxyCodeLine{58 }
\DoxyCodeLine{59 \textcolor{comment}{/* message from upper layer */}}
\DoxyCodeLine{60 \textcolor{keywordtype}{int} gsm411\_smc\_send(\textcolor{keyword}{struct} gsm411\_smc\_inst *inst, \textcolor{keywordtype}{int} msg\_type,}
\DoxyCodeLine{61         \textcolor{keyword}{struct} msgb *msg);}
\DoxyCodeLine{62 }
\DoxyCodeLine{63 \textcolor{comment}{/* message from lower layer */}}
\DoxyCodeLine{64 \textcolor{keywordtype}{int} gsm411\_smc\_recv(\textcolor{keyword}{struct} gsm411\_smc\_inst *inst, \textcolor{keywordtype}{int} msg\_type,}
\DoxyCodeLine{65         \textcolor{keyword}{struct} msgb *msg, \textcolor{keywordtype}{int} cp\_msg\_type);}
\DoxyCodeLine{66 }
\DoxyCodeLine{67 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }value\_string gsm411\_cp\_state\_names[];}
\DoxyCodeLine{68 }
\DoxyCodeLine{69 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *gsm411\_cp\_state\_name(\textcolor{keyword}{enum} gsm411\_cp\_state cp\_state) \{}
\DoxyCodeLine{70         \textcolor{keywordflow}{return} get\_value\_string(gsm411\_cp\_state\_names, cp\_state);}
\DoxyCodeLine{71 \}}

\end{DoxyCode}
