\doxysection{gsm\+\_\+25\+\_\+415.\+h}
\label{gsm__25__415_8h_source}\index{include/osmocom/gsm/protocol/gsm\_25\_415.h@{include/osmocom/gsm/protocol/gsm\_25\_415.h}}
\textbf{ Go to the documentation of this file.}
\begin{DoxyCode}{0}
\DoxyCodeLine{1 \textcolor{preprocessor}{\#pragma once}}
\DoxyCodeLine{2 \textcolor{comment}{/* Iu User Plane (IuUP) Definitions as per 3GPP TS 25.415 */}}
\DoxyCodeLine{3 \textcolor{comment}{/* (C) 2017 by Harald Welte <laforge@gnumonks.org>}}
\DoxyCodeLine{4 \textcolor{comment}{ * All Rights Reserved.}}
\DoxyCodeLine{5 \textcolor{comment}{ *}}
\DoxyCodeLine{6 \textcolor{comment}{ * SPDX-\/License-\/Identifier: GPL-\/2.0+}}
\DoxyCodeLine{7 \textcolor{comment}{ */}}
\DoxyCodeLine{8 }
\DoxyCodeLine{9 \textcolor{preprocessor}{\#include <stdint.h>}}
\DoxyCodeLine{10 \textcolor{preprocessor}{\#include <osmocom/core/endian.h>}}
\DoxyCodeLine{11 }
\DoxyCodeLine{12 \textcolor{comment}{/* 3GPP TS 25.415 Section 6.6.2.1 */}}
\DoxyCodeLine{13 \textcolor{keyword}{struct }iuup\_pdutype0\_hdr \{}
\DoxyCodeLine{14 \textcolor{preprocessor}{\#if OSMO\_IS\_LITTLE\_ENDIAN}}
\DoxyCodeLine{15         \textcolor{comment}{/* control part */}}
\DoxyCodeLine{16         uint8\_t frame\_nr:4,}
\DoxyCodeLine{17                 pdu\_type:4;}
\DoxyCodeLine{18         uint8\_t rfci:6,}
\DoxyCodeLine{19                 fqc:2;}
\DoxyCodeLine{20         \textcolor{comment}{/* checksum part */}}
\DoxyCodeLine{21         uint8\_t payload\_crc\_hi:2, header\_crc:6;}
\DoxyCodeLine{22         uint8\_t payload\_crc\_lo;}
\DoxyCodeLine{23 }
\DoxyCodeLine{24         \textcolor{comment}{/* payload part */}}
\DoxyCodeLine{25         uint8\_t payload[0];}
\DoxyCodeLine{26 \textcolor{preprocessor}{\#elif OSMO\_IS\_BIG\_ENDIAN}}
\DoxyCodeLine{27 \textcolor{comment}{/* auto-\/generated from the little endian part above (libosmocore/contrib/struct\_endianness.py) */}}
\DoxyCodeLine{28         uint8\_t pdu\_type:4, frame\_nr:4;}
\DoxyCodeLine{29         uint8\_t fqc:2, rfci:6;}
\DoxyCodeLine{30         uint8\_t header\_crc:6, payload\_crc\_hi:2;}
\DoxyCodeLine{31         uint8\_t payload\_crc\_lo;}
\DoxyCodeLine{32         uint8\_t payload[0];}
\DoxyCodeLine{33 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{34 \} \_\_attribute\_\_((packed));}
\DoxyCodeLine{35 }
\DoxyCodeLine{36 \textcolor{comment}{/* 3GPP TS 25.415 Section 6.6.2.2 */}}
\DoxyCodeLine{37 \textcolor{keyword}{struct }iuup\_pdutype1\_hdr \{}
\DoxyCodeLine{38 \textcolor{preprocessor}{\#if OSMO\_IS\_LITTLE\_ENDIAN}}
\DoxyCodeLine{39         \textcolor{comment}{/* control part */}}
\DoxyCodeLine{40         uint8\_t frame\_nr:4,}
\DoxyCodeLine{41                 pdu\_type:4;}
\DoxyCodeLine{42         uint8\_t rfci:6,}
\DoxyCodeLine{43                 fqc:2;}
\DoxyCodeLine{44         \textcolor{comment}{/* checksum part */}}
\DoxyCodeLine{45         uint8\_t spare:2,}
\DoxyCodeLine{46                 header\_crc:6;}
\DoxyCodeLine{47         \textcolor{comment}{/* payload part */}}
\DoxyCodeLine{48         uint8\_t payload[0];}
\DoxyCodeLine{49 \textcolor{preprocessor}{\#elif OSMO\_IS\_BIG\_ENDIAN}}
\DoxyCodeLine{50 \textcolor{comment}{/* auto-\/generated from the little endian part above (libosmocore/contrib/struct\_endianness.py) */}}
\DoxyCodeLine{51         uint8\_t pdu\_type:4, frame\_nr:4;}
\DoxyCodeLine{52         uint8\_t fqc:2, rfci:6;}
\DoxyCodeLine{53         uint8\_t header\_crc:6, spare:2;}
\DoxyCodeLine{54         uint8\_t payload[0];}
\DoxyCodeLine{55 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{56 \} \_\_attribute\_\_((packed));}
\DoxyCodeLine{57 }
\DoxyCodeLine{58 \textcolor{comment}{/* 3GPP TS 25.415 Section 6.6.2.3 */}}
\DoxyCodeLine{59 \textcolor{keyword}{struct }iuup\_pdutype14\_hdr \{}
\DoxyCodeLine{60 \textcolor{preprocessor}{\#if OSMO\_IS\_LITTLE\_ENDIAN}}
\DoxyCodeLine{61         \textcolor{comment}{/* control part */}}
\DoxyCodeLine{62         uint8\_t frame\_nr:2,}
\DoxyCodeLine{63                 ack\_nack:2,}
\DoxyCodeLine{64                 pdu\_type:4;}
\DoxyCodeLine{65         uint8\_t proc\_ind:4,}
\DoxyCodeLine{66                 mode\_version:4;}
\DoxyCodeLine{67         \textcolor{comment}{/* checksum part */}}
\DoxyCodeLine{68         uint8\_t payload\_crc\_hi:2, header\_crc:6;}
\DoxyCodeLine{69         uint8\_t payload\_crc\_lo;}
\DoxyCodeLine{70         \textcolor{comment}{/* payload part */}}
\DoxyCodeLine{71         uint8\_t payload[0];}
\DoxyCodeLine{72 \textcolor{preprocessor}{\#elif OSMO\_IS\_BIG\_ENDIAN}}
\DoxyCodeLine{73 \textcolor{comment}{/* auto-\/generated from the little endian part above (libosmocore/contrib/struct\_endianness.py) */}}
\DoxyCodeLine{74         uint8\_t pdu\_type:4, ack\_nack:2, frame\_nr:2;}
\DoxyCodeLine{75         uint8\_t mode\_version:4, proc\_ind:4;}
\DoxyCodeLine{76         uint8\_t header\_crc:6, payload\_crc\_hi:2;}
\DoxyCodeLine{77         uint8\_t payload\_crc\_lo;}
\DoxyCodeLine{78         uint8\_t payload[0];}
\DoxyCodeLine{79 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{80 \} \_\_attribute\_\_((packed));}
\DoxyCodeLine{81 }
\DoxyCodeLine{82 \textcolor{comment}{/* 3GPP TS 25.415 Section 6.6.2.3.4.1 */}}
\DoxyCodeLine{83 \textcolor{keyword}{struct }iuup\_ctrl\_init\_rfci\_hdr \{}
\DoxyCodeLine{84 \textcolor{preprocessor}{\#if OSMO\_IS\_LITTLE\_ENDIAN}}
\DoxyCodeLine{85         uint8\_t rfci:6,}
\DoxyCodeLine{86                 li:1,}
\DoxyCodeLine{87                 lri:1;}
\DoxyCodeLine{88         uint8\_t subflow\_length[0]; \textcolor{comment}{/* 1 or 2 bytes depending on li */}}
\DoxyCodeLine{89 \textcolor{preprocessor}{\#elif OSMO\_IS\_BIG\_ENDIAN}}
\DoxyCodeLine{90 \textcolor{comment}{/* auto-\/generated from the little endian part above (libosmocore/contrib/struct\_endianness.py) */}}
\DoxyCodeLine{91         uint8\_t lri:1, li:1, rfci:6;}
\DoxyCodeLine{92         uint8\_t subflow\_length[0];}
\DoxyCodeLine{93 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{94 \} \_\_attribute\_\_((packed));}
\DoxyCodeLine{95 \textcolor{keyword}{struct }iuup\_ctrl\_init\_hdr \{}
\DoxyCodeLine{96 \textcolor{preprocessor}{\#if OSMO\_IS\_LITTLE\_ENDIAN}}
\DoxyCodeLine{97         uint8\_t chain\_ind:1,}
\DoxyCodeLine{98                 num\_subflows\_per\_rfci:3,}
\DoxyCodeLine{99                 ti:1,}
\DoxyCodeLine{100                 spare:3;}
\DoxyCodeLine{101         uint8\_t rfci\_data[0]; \textcolor{comment}{/* struct iuup\_ctrl\_init\_rfci\_hdr* */}}
\DoxyCodeLine{102 \textcolor{preprocessor}{\#elif OSMO\_IS\_BIG\_ENDIAN}}
\DoxyCodeLine{103 \textcolor{comment}{/* auto-\/generated from the little endian part above (libosmocore/contrib/struct\_endianness.py) */}}
\DoxyCodeLine{104         uint8\_t spare:3, ti:1, num\_subflows\_per\_rfci:3, chain\_ind:1;}
\DoxyCodeLine{105         uint8\_t rfci\_data[0]; \textcolor{comment}{/* struct iuup\_ctrl\_init\_rfci\_hdr* */}}
\DoxyCodeLine{106 ;}
\DoxyCodeLine{107 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{108 \} \_\_attribute\_\_((packed));}
\DoxyCodeLine{109 \textcolor{keyword}{struct }iuup\_ctrl\_init\_tail \{}
\DoxyCodeLine{110 \textcolor{preprocessor}{\#if OSMO\_IS\_LITTLE\_ENDIAN}}
\DoxyCodeLine{111         uint16\_t versions\_supported;}
\DoxyCodeLine{112         uint8\_t spare:4,}
\DoxyCodeLine{113                 data\_pdu\_type:4;}
\DoxyCodeLine{114         uint8\_t spare\_extension[0];}
\DoxyCodeLine{115 \textcolor{preprocessor}{\#elif OSMO\_IS\_BIG\_ENDIAN}}
\DoxyCodeLine{116 \textcolor{comment}{/* auto-\/generated from the little endian part above (libosmocore/contrib/struct\_endianness.py) */}}
\DoxyCodeLine{117         uint16\_t versions\_supported;}
\DoxyCodeLine{118         uint8\_t data\_pdu\_type:4, spare:4;}
\DoxyCodeLine{119         uint8\_t spare\_extension[0];}
\DoxyCodeLine{120 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{121 \} \_\_attribute\_\_((packed));}
\DoxyCodeLine{122 }
\DoxyCodeLine{123 \textcolor{comment}{/* 3GPP TS 25.415 Section 6.6.2.3.4.4 */}}
\DoxyCodeLine{124 \textcolor{keyword}{struct }iuup\_ctrl\_error\_event \{}
\DoxyCodeLine{125 \textcolor{preprocessor}{\#if OSMO\_IS\_LITTLE\_ENDIAN}}
\DoxyCodeLine{126         \textcolor{keyword}{struct }iuup\_pdutype14\_hdr hdr;}
\DoxyCodeLine{127         uint8\_t error\_cause:6,}
\DoxyCodeLine{128                 error\_distance:2;}
\DoxyCodeLine{129         uint8\_t spare\_extension[0];}
\DoxyCodeLine{130 \textcolor{preprocessor}{\#elif OSMO\_IS\_BIG\_ENDIAN}}
\DoxyCodeLine{131 \textcolor{comment}{/* auto-\/generated from the little endian part above (libosmocore/contrib/struct\_endianness.py) */}}
\DoxyCodeLine{132         \textcolor{keyword}{struct }iuup\_pdutype14\_hdr hdr;}
\DoxyCodeLine{133         uint8\_t error\_distance:2, error\_cause:6;}
\DoxyCodeLine{134         uint8\_t spare\_extension[0];}
\DoxyCodeLine{135 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{136 \} \_\_attribute\_\_((packed));}
\DoxyCodeLine{137 }
\DoxyCodeLine{138 \textcolor{comment}{/* 3GPP TS 25.415 Section 6.6.2.3.2 */}}
\DoxyCodeLine{139 \textcolor{keyword}{struct }iuup\_ctrl\_ack \{}
\DoxyCodeLine{140         \textcolor{keyword}{struct }iuup\_pdutype14\_hdr hdr;}
\DoxyCodeLine{141         uint8\_t spare\_extension[0];}
\DoxyCodeLine{142 \} \_\_attribute\_\_((packed));}
\DoxyCodeLine{143 }
\DoxyCodeLine{144 \textcolor{comment}{/* 3GPP TS 25.415 Section 6.6.2.3.3 */}}
\DoxyCodeLine{145 \textcolor{keyword}{struct }iuup\_ctrl\_nack \{}
\DoxyCodeLine{146 \textcolor{preprocessor}{\#if OSMO\_IS\_LITTLE\_ENDIAN}}
\DoxyCodeLine{147         \textcolor{keyword}{struct }iuup\_pdutype14\_hdr hdr;}
\DoxyCodeLine{148         uint8\_t spare:2,}
\DoxyCodeLine{149                 error\_cause:6;}
\DoxyCodeLine{150         uint8\_t spare\_extension[0];}
\DoxyCodeLine{151 \textcolor{preprocessor}{\#elif OSMO\_IS\_BIG\_ENDIAN}}
\DoxyCodeLine{152 \textcolor{comment}{/* auto-\/generated from the little endian part above (libosmocore/contrib/struct\_endianness.py) */}}
\DoxyCodeLine{153         \textcolor{keyword}{struct }iuup\_pdutype14\_hdr hdr;}
\DoxyCodeLine{154         uint8\_t error\_cause:6, spare:2;}
\DoxyCodeLine{155         uint8\_t spare\_extension[0];}
\DoxyCodeLine{156 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{157 \} \_\_attribute\_\_((packed));}
\DoxyCodeLine{158 }
\DoxyCodeLine{159 \textcolor{comment}{/* 3GPP TS 25.415 Section 6.6.2 + 6.6.3.1 */}}
\DoxyCodeLine{160 \textcolor{keyword}{enum} iuup\_pdu\_type \{}
\DoxyCodeLine{161         IUUP\_PDU\_T\_DATA\_CRC  = 0,}
\DoxyCodeLine{162         IUUP\_PDU\_T\_DATA\_NOCRC      = 1,}
\DoxyCodeLine{163         IUUP\_PDU\_T\_CONTROL    = 14,}
\DoxyCodeLine{164 \};}
\DoxyCodeLine{165 }
\DoxyCodeLine{166 \textcolor{comment}{/* 3GPP TS 25.415 Section 6.6.3.2 */}}
\DoxyCodeLine{167 \textcolor{keyword}{enum} iuup\_ack\_nack \{}
\DoxyCodeLine{168         IUUP\_AN\_PROCEDURE      = 0,}
\DoxyCodeLine{169         IUUP\_AN\_ACK          = 1,}
\DoxyCodeLine{170         IUUP\_AN\_NACK                = 2,}
\DoxyCodeLine{171 \};}
\DoxyCodeLine{172 }
\DoxyCodeLine{173 \textcolor{comment}{/* 3GPP TS 25.415 Section 6.6.3.5 */}}
\DoxyCodeLine{174 \textcolor{keyword}{enum} iuup\_fqc \{}
\DoxyCodeLine{175         IUUP\_FQC\_FRAME\_GOOD  = 0,}
\DoxyCodeLine{176         IUUP\_FQC\_FRAME\_BAD    = 1,}
\DoxyCodeLine{177         IUUP\_FQC\_FRAME\_BAD\_RADIO = 2,}
\DoxyCodeLine{178 \};}
\DoxyCodeLine{179 }
\DoxyCodeLine{180 \textcolor{comment}{/* 3GPP TS 25.415 Section 6.6.3.7 */}}
\DoxyCodeLine{181 \textcolor{keyword}{enum} iuup\_procedure \{}
\DoxyCodeLine{182         IUUP\_PROC\_INIT            = 0,}
\DoxyCodeLine{183         IUUP\_PROC\_RATE\_CTRL  = 1,}
\DoxyCodeLine{184         IUUP\_PROC\_TIME\_ALIGN        = 2,}
\DoxyCodeLine{185         IUUP\_PROC\_ERR\_EVENT  = 3,}
\DoxyCodeLine{186 \};}
\DoxyCodeLine{187 }
\DoxyCodeLine{188 }
\DoxyCodeLine{189 \textcolor{comment}{/* 3GPP TS 25.415 Section 6.6.3.15 */}}
\DoxyCodeLine{190 \textcolor{keyword}{enum} iuup\_error\_distance \{}
\DoxyCodeLine{191         IUUP\_ERR\_DIST\_LOCAL          = 0,}
\DoxyCodeLine{192         IUUP\_ERR\_DIST\_FIRST\_FWD          = 1,}
\DoxyCodeLine{193         IUUP\_ERR\_DIST\_SECOND\_FWD        = 2,}
\DoxyCodeLine{194         IUUP\_ERR\_DIST\_RESERVED            = 3,}
\DoxyCodeLine{195 \};}
\DoxyCodeLine{196 }
\DoxyCodeLine{197 }
\DoxyCodeLine{198 \textcolor{comment}{/* 3GPP TS 25.415 Section 6.6.3.16 */}}
\DoxyCodeLine{199 \textcolor{keyword}{enum} iuup\_error\_cause \{}
\DoxyCodeLine{200         IUUP\_ERR\_CAUSE\_CRC\_ERR\_HDR    = 0,}
\DoxyCodeLine{201         IUUP\_ERR\_CAUSE\_CRC\_ERR\_DATA  = 1,}
\DoxyCodeLine{202         IUUP\_ERR\_CAUSE\_UNEXPECTED\_FN        = 2,}
\DoxyCodeLine{203         IUUP\_ERR\_CAUSE\_FRAME\_LOSS      = 3,}
\DoxyCodeLine{204         IUUP\_ERR\_CAUSE\_UNKNOWN\_PDUTYPE    = 4,}
\DoxyCodeLine{205         IUUP\_ERR\_CAUSE\_UNKNOWN\_PROC  = 5,}
\DoxyCodeLine{206         IUUP\_ERR\_CAUSE\_UNKNNOWN\_RES\_VAL  = 6,}
\DoxyCodeLine{207         IUUP\_ERR\_CAUSE\_UNKNNOWN\_FIELD      = 7,}
\DoxyCodeLine{208         IUUP\_ERR\_CAUSE\_FRAME\_TOO\_SHORT    = 8,}
\DoxyCodeLine{209         IUUP\_ERR\_CAUSE\_MISSING\_FIELDS      = 9,}
\DoxyCodeLine{210         IUUP\_ERR\_CAUSE\_UNEXPECTED\_PDU\_T  = 16,}
\DoxyCodeLine{211         IUUP\_ERR\_CAUSE\_UNEXPECTED\_PROC    = 18,}
\DoxyCodeLine{212         IUUP\_ERR\_CAUSE\_UNEXPECTED\_RFCI    = 19,}
\DoxyCodeLine{213         IUUP\_ERR\_CAUSE\_UNEXPECTED\_VALUE  = 20,}
\DoxyCodeLine{214         IUUP\_ERR\_CAUSE\_INIT\_FAILURE  = 42,}
\DoxyCodeLine{215         IUUP\_ERR\_CAUSE\_INIT\_FAILURE\_NET\_TMR = 43,}
\DoxyCodeLine{216         IUUP\_ERR\_CAUSE\_INIT\_FAILURE\_REP\_NACK = 44,}
\DoxyCodeLine{217         IUUP\_ERR\_CAUSE\_RATE\_CTRL\_FAILURE = 45,}
\DoxyCodeLine{218         IUUP\_ERR\_CAUSE\_ERR\_EVENT\_FAIL      = 46,}
\DoxyCodeLine{219         IUUP\_ERR\_CAUSE\_TIME\_ALIGN\_NOTSUPP = 47,}
\DoxyCodeLine{220         IUUP\_ERR\_CAUSE\_REQ\_TIME\_ALIGN\_NOTPOSS = 48,}
\DoxyCodeLine{221         IUUP\_ERR\_CAUSE\_MODE\_VERSION\_NOT\_SUPPORTED = 49,}
\DoxyCodeLine{222 \};}

\end{DoxyCode}
