\doxysection{rlp.\+h}
\label{rlp_8h_source}\index{include/osmocom/gsm/rlp.h@{include/osmocom/gsm/rlp.h}}
\textbf{ Go to the documentation of this file.}
\begin{DoxyCode}{0}
\DoxyCodeLine{1 \textcolor{comment}{/*}}
\DoxyCodeLine{2 \textcolor{comment}{ * GSM RLP (Radio Link Protocol) as used in CSD (3GPP TS 44.022)}}
\DoxyCodeLine{3 \textcolor{comment}{ *}}
\DoxyCodeLine{4 \textcolor{comment}{ * Copyright (C) 2022-\/2023 Harald Welte <laforge@osmocom.org>}}
\DoxyCodeLine{5 \textcolor{comment}{ *}}
\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 }
\DoxyCodeLine{19 }
\DoxyCodeLine{20 }
\DoxyCodeLine{21 \textcolor{preprocessor}{\#pragma once}}
\DoxyCodeLine{22 \textcolor{preprocessor}{\#include <stdint.h>}}
\DoxyCodeLine{23 \textcolor{preprocessor}{\#include <stdbool.h>}}
\DoxyCodeLine{24 \textcolor{preprocessor}{\#include <osmocom/core/utils.h>}}
\DoxyCodeLine{25 }
\DoxyCodeLine{31 \textcolor{keyword}{enum} osmo\_rlp\_ftype \{}
\DoxyCodeLine{32         OSMO\_RLP\_FT\_U,}
\DoxyCodeLine{33         OSMO\_RLP\_FT\_S,}
\DoxyCodeLine{34         OSMO\_RLP\_FT\_IS,}
\DoxyCodeLine{35 \};}
\DoxyCodeLine{36 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }value\_string osmo\_rlp\_ftype\_vals[];}
\DoxyCodeLine{37 }
\DoxyCodeLine{39 \textcolor{keyword}{enum} osmo\_rlp\_u\_ftype \{}
\DoxyCodeLine{40         OSMO\_RLP\_U\_FT\_SABM    = 0x07,}
\DoxyCodeLine{41         OSMO\_RLP\_U\_FT\_UA        = 0x0c,}
\DoxyCodeLine{42         OSMO\_RLP\_U\_FT\_DISC    = 0x08,}
\DoxyCodeLine{43         OSMO\_RLP\_U\_FT\_DM        = 0x03,}
\DoxyCodeLine{44         OSMO\_RLP\_U\_FT\_NULL    = 0x0f,}
\DoxyCodeLine{45         OSMO\_RLP\_U\_FT\_UI        = 0x00,}
\DoxyCodeLine{46         OSMO\_RLP\_U\_FT\_XID      = 0x17,}
\DoxyCodeLine{47         OSMO\_RLP\_U\_FT\_TEST    = 0x1c,}
\DoxyCodeLine{48         OSMO\_RLP\_U\_FT\_REMAP  = 0x11,}
\DoxyCodeLine{49 \};}
\DoxyCodeLine{50 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }value\_string osmo\_rlp\_ftype\_u\_vals[];}
\DoxyCodeLine{51 }
\DoxyCodeLine{53 \textcolor{keyword}{enum} osmo\_rlp\_s\_ftype \{}
\DoxyCodeLine{54         OSMO\_RLP\_S\_FT\_RR        = 0,}
\DoxyCodeLine{55         OSMO\_RLP\_S\_FT\_REJ      = 2,}
\DoxyCodeLine{56         OSMO\_RLP\_S\_FT\_RNR      = 1,}
\DoxyCodeLine{57         OSMO\_RLP\_S\_FT\_SREJ    = 3,}
\DoxyCodeLine{58 \};}
\DoxyCodeLine{59 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }value\_string osmo\_rlp\_ftype\_s\_vals[];}
\DoxyCodeLine{60 }
\DoxyCodeLine{62 \textcolor{keyword}{struct }osmo\_rlp\_frame\_decoded \{}
\DoxyCodeLine{63         uint8\_t version;}
\DoxyCodeLine{64         \textcolor{keyword}{enum} osmo\_rlp\_ftype ftype;}
\DoxyCodeLine{65         \textcolor{keyword}{enum} osmo\_rlp\_u\_ftype u\_ftype;}
\DoxyCodeLine{66         \textcolor{keyword}{enum} osmo\_rlp\_s\_ftype s\_ftype;}
\DoxyCodeLine{67         \textcolor{keywordtype}{bool} c\_r;}
\DoxyCodeLine{68         \textcolor{keywordtype}{bool} p\_f;}
\DoxyCodeLine{69         uint8\_t s\_bits;}
\DoxyCodeLine{70         uint16\_t n\_s;}
\DoxyCodeLine{71         uint16\_t n\_r;}
\DoxyCodeLine{72         uint32\_t fcs;}
\DoxyCodeLine{73         uint8\_t info[536/8];}
\DoxyCodeLine{74         uint16\_t info\_len;}
\DoxyCodeLine{75 \};}
\DoxyCodeLine{76 }
\DoxyCodeLine{77 \textcolor{keywordtype}{int} osmo\_rlp\_decode(\textcolor{keyword}{struct} osmo\_rlp\_frame\_decoded *out, uint8\_t version, \textcolor{keyword}{const} uint8\_t *data, \textcolor{keywordtype}{size\_t} data\_len);}
\DoxyCodeLine{78 \textcolor{keywordtype}{int} osmo\_rlp\_encode(uint8\_t *out, \textcolor{keywordtype}{size\_t} out\_size, \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_rlp\_frame\_decoded *in);}
\DoxyCodeLine{79 uint32\_t osmo\_rlp\_fcs\_compute(\textcolor{keyword}{const} uint8\_t *in, \textcolor{keywordtype}{size\_t} in\_len);}
\DoxyCodeLine{80 }

\end{DoxyCode}
