\doxysection{mtp\+\_\+sap.\+h} \label{mtp__sap_8h_source}\index{include/osmocom/sigtran/mtp\_sap.h@{include/osmocom/sigtran/mtp\_sap.h}} \textbf{ Go to the documentation of this file.} \begin{DoxyCode}{0} \DoxyCodeLine{1 \textcolor{preprocessor}{\#pragma once}} \DoxyCodeLine{2 } \DoxyCodeLine{3 \textcolor{comment}{/* MTP User SAP description in accordance with ITU Q.701 */}} \DoxyCodeLine{4 } \DoxyCodeLine{5 \textcolor{comment}{/* (C) 2017 by Harald Welte }} \DoxyCodeLine{6 \textcolor{comment}{ * All Rights Reserved}} \DoxyCodeLine{7 \textcolor{comment}{ *}} \DoxyCodeLine{8 \textcolor{comment}{ * This program is free software; you can redistribute it and/or modify}} \DoxyCodeLine{9 \textcolor{comment}{ * it under the terms of the GNU General Public License as published by}} \DoxyCodeLine{10 \textcolor{comment}{ * the Free Software Foundation; either version 2 of the License, or}} \DoxyCodeLine{11 \textcolor{comment}{ * (at your option) any later version.}} \DoxyCodeLine{12 \textcolor{comment}{ *}} \DoxyCodeLine{13 \textcolor{comment}{ * This program is distributed in the hope that it will be useful,}} \DoxyCodeLine{14 \textcolor{comment}{ * but WITHOUT ANY WARRANTY; without even the implied warranty of}} \DoxyCodeLine{15 \textcolor{comment}{ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the}} \DoxyCodeLine{16 \textcolor{comment}{ * GNU General Public License for more details.}} \DoxyCodeLine{17 \textcolor{comment}{ *}} \DoxyCodeLine{18 \textcolor{comment}{ * You should have received a copy of the GNU General Public License}} \DoxyCodeLine{19 \textcolor{comment}{ * along with this program. If not, see .}} \DoxyCodeLine{20 \textcolor{comment}{ *}} \DoxyCodeLine{21 \textcolor{comment}{ */}} \DoxyCodeLine{22 } \DoxyCodeLine{23 \textcolor{preprocessor}{\#include }} \DoxyCodeLine{24 \textcolor{preprocessor}{\#include }} \DoxyCodeLine{25 \textcolor{preprocessor}{\#include }} \DoxyCodeLine{26 } \DoxyCodeLine{27 \textcolor{keyword}{enum} osmo\_mtp\_prim\_type \{} \DoxyCodeLine{28 OSMO\_MTP\_PRIM\_TRANSFER,} \DoxyCodeLine{29 OSMO\_MTP\_PRIM\_PAUSE,} \DoxyCodeLine{30 OSMO\_MTP\_PRIM\_RESUME,} \DoxyCodeLine{31 OSMO\_MTP\_PRIM\_STATUS,} \DoxyCodeLine{32 \};} \DoxyCodeLine{33 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }value\_string osmo\_mtp\_prim\_type\_names[];} \DoxyCodeLine{34 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_mtp\_prim\_type\_name(\textcolor{keyword}{enum} osmo\_mtp\_prim\_type val)} \DoxyCodeLine{35 \{} \DoxyCodeLine{36 \textcolor{keywordflow}{return} get\_value\_string(osmo\_mtp\_prim\_type\_names, val);} \DoxyCodeLine{37 \}} \DoxyCodeLine{38 } \DoxyCodeLine{39 \textcolor{comment}{/* ITU Q.704 14.2 Service information octet. See enum mtp\_si\_ni00 in mtp.h. */}} \DoxyCodeLine{40 \textcolor{preprocessor}{\#define MTP\_SIO(service, net\_ind) ((((net\_ind) \& 0x3) << 6) | ((service) \& 0xF))}} \DoxyCodeLine{41 } \DoxyCodeLine{42 \textcolor{keyword}{struct }osmo\_mtp\_transfer\_param \{} \DoxyCodeLine{43 uint32\_t opc;} \DoxyCodeLine{44 uint32\_t dpc;} \DoxyCodeLine{45 uint8\_t sls;} \DoxyCodeLine{46 uint8\_t sio;} \DoxyCodeLine{47 \};} \DoxyCodeLine{48 } \DoxyCodeLine{49 \textcolor{keyword}{struct }osmo\_mtp\_pause\_param \{} \DoxyCodeLine{50 uint32\_t affected\_dpc;} \DoxyCodeLine{51 \};} \DoxyCodeLine{52 } \DoxyCodeLine{53 \textcolor{keyword}{struct }osmo\_mtp\_resume\_param \{} \DoxyCodeLine{54 uint32\_t affected\_dpc;} \DoxyCodeLine{55 \};} \DoxyCodeLine{56 } \DoxyCodeLine{57 \textcolor{keyword}{struct }osmo\_mtp\_status\_param \{} \DoxyCodeLine{58 uint32\_t affected\_dpc;} \DoxyCodeLine{59 uint32\_t cause; \textcolor{comment}{/* enum mtp\_unavail\_cause */}} \DoxyCodeLine{60 \textcolor{keywordtype}{bool} congestion\_level\_present;} \DoxyCodeLine{61 uint8\_t congestion\_level;} \DoxyCodeLine{62 \};} \DoxyCodeLine{63 } \DoxyCodeLine{64 \textcolor{keyword}{struct }osmo\_mtp\_prim \{} \DoxyCodeLine{65 \textcolor{keyword}{struct }osmo\_prim\_hdr oph;} \DoxyCodeLine{66 \textcolor{keyword}{union }\{} \DoxyCodeLine{67 \textcolor{keyword}{struct }osmo\_mtp\_transfer\_param transfer;} \DoxyCodeLine{68 \textcolor{keyword}{struct }osmo\_mtp\_pause\_param pause;} \DoxyCodeLine{69 \textcolor{keyword}{struct }osmo\_mtp\_resume\_param resume;} \DoxyCodeLine{70 \textcolor{keyword}{struct }osmo\_mtp\_status\_param status;} \DoxyCodeLine{71 \} u;} \DoxyCodeLine{72 \};} \DoxyCodeLine{73 } \DoxyCodeLine{74 \textcolor{preprocessor}{\#define msgb\_mtp\_prim(msg) ((struct osmo\_mtp\_prim *)(msg)-\/>l1h)}} \DoxyCodeLine{75 } \DoxyCodeLine{76 \textcolor{keywordtype}{char} *osmo\_mtp\_prim\_name(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_prim\_hdr *oph);} \DoxyCodeLine{77 } \DoxyCodeLine{78 \textcolor{keyword}{struct }osmo\_mtp\_prim *osmo\_mtp\_prim\_xfer\_req\_prepend(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_mtp\_transfer\_param *param,} \DoxyCodeLine{79 \textcolor{keyword}{struct} msgb *msg);} \end{DoxyCode}