\doxysection{gsm\+\_\+04\+\_\+11.\+h}
\label{gsm__04__11_8h_source}\index{include/osmocom/gsm/protocol/gsm\_04\_11.h@{include/osmocom/gsm/protocol/gsm\_04\_11.h}}
\textbf{ Go to the documentation of this file.}
\begin{DoxyCode}{0}
\DoxyCodeLine{1 }
\DoxyCodeLine{3 \textcolor{preprocessor}{\#pragma once}}
\DoxyCodeLine{4 }
\DoxyCodeLine{5 \textcolor{preprocessor}{\#include <stdint.h>}}
\DoxyCodeLine{6 }
\DoxyCodeLine{7 \textcolor{comment}{/* GSM TS 04.11  definitions */}}
\DoxyCodeLine{8 }
\DoxyCodeLine{9 \textcolor{comment}{/* Chapter 5.2.3: SMC-\/CS states at the user/network side */}}
\DoxyCodeLine{10 \textcolor{keyword}{enum} gsm411\_cp\_state \{}
\DoxyCodeLine{11         GSM411\_CPS\_IDLE          = 0,}
\DoxyCodeLine{12         GSM411\_CPS\_MM\_CONN\_PENDING    = 1,    \textcolor{comment}{/* only MT ! */}}
\DoxyCodeLine{13         GSM411\_CPS\_WAIT\_CP\_ACK            = 2,}
\DoxyCodeLine{14         GSM411\_CPS\_MM\_ESTABLISHED      = 3,}
\DoxyCodeLine{15 \};}
\DoxyCodeLine{16 }
\DoxyCodeLine{17 \textcolor{comment}{/* Chapter 6.2.2: SMR states at the user/network side */}}
\DoxyCodeLine{18 \textcolor{keyword}{enum} gsm411\_rp\_state \{}
\DoxyCodeLine{19         GSM411\_RPS\_IDLE                  = 0,}
\DoxyCodeLine{20         GSM411\_RPS\_WAIT\_FOR\_RP\_ACK    = 1,}
\DoxyCodeLine{21         GSM411\_RPS\_WAIT\_TO\_TX\_RP\_ACK        = 3,}
\DoxyCodeLine{22         GSM411\_RPS\_WAIT\_FOR\_RETRANS\_T      = 4,}
\DoxyCodeLine{23 \};}
\DoxyCodeLine{24 }
\DoxyCodeLine{25 \textcolor{comment}{/* Chapter 8.1.2 (refers to GSM 04.07 Chapter 11.2.3.1.1 */}}
\DoxyCodeLine{26 \textcolor{preprocessor}{\#define GSM411\_PDISC\_SMS        0x09}}
\DoxyCodeLine{27 }
\DoxyCodeLine{28 \textcolor{comment}{/* Chapter 8.1.3 */}}
\DoxyCodeLine{29 \textcolor{preprocessor}{\#define GSM411\_MT\_CP\_DATA       0x01}}
\DoxyCodeLine{30 \textcolor{preprocessor}{\#define GSM411\_MT\_CP\_ACK        0x04}}
\DoxyCodeLine{31 \textcolor{preprocessor}{\#define GSM411\_MT\_CP\_ERROR      0x10}}
\DoxyCodeLine{32 }
\DoxyCodeLine{33 \textcolor{keyword}{enum} gsm411\_cp\_ie \{}
\DoxyCodeLine{34         GSM411\_CP\_IE\_USER\_DATA            = 0x01, \textcolor{comment}{/* 8.1.4.1 */}}
\DoxyCodeLine{35         GSM411\_CP\_IE\_CAUSE            = 0x02, \textcolor{comment}{/* 8.1.4.2. */}}
\DoxyCodeLine{36 \};}
\DoxyCodeLine{37 }
\DoxyCodeLine{38 \textcolor{comment}{/* Section 8.1.4.2 / Table 8.2 */}}
\DoxyCodeLine{39 \textcolor{keyword}{enum} gsm411\_cp\_cause \{}
\DoxyCodeLine{40         GSM411\_CP\_CAUSE\_NET\_FAIL        = 17,}
\DoxyCodeLine{41         GSM411\_CP\_CAUSE\_CONGESTION    = 22,}
\DoxyCodeLine{42         GSM411\_CP\_CAUSE\_INV\_TRANS\_ID        = 81,}
\DoxyCodeLine{43         GSM411\_CP\_CAUSE\_SEMANT\_INC\_MSG    = 95,}
\DoxyCodeLine{44         GSM411\_CP\_CAUSE\_INV\_MAND\_INF        = 96,}
\DoxyCodeLine{45         GSM411\_CP\_CAUSE\_MSGTYPE\_NOTEXIST= 97,}
\DoxyCodeLine{46         GSM411\_CP\_CAUSE\_MSG\_INCOMP\_STATE= 98,}
\DoxyCodeLine{47         GSM411\_CP\_CAUSE\_IE\_NOTEXIST  = 99,}
\DoxyCodeLine{48         GSM411\_CP\_CAUSE\_PROTOCOL\_ERR        = 111,}
\DoxyCodeLine{49 \};}
\DoxyCodeLine{50 }
\DoxyCodeLine{51 \textcolor{comment}{/* Chapter 8.2.2 */}}
\DoxyCodeLine{52 \textcolor{preprocessor}{\#define GSM411\_MT\_RP\_DATA\_MO    0x00}}
\DoxyCodeLine{53 \textcolor{preprocessor}{\#define GSM411\_MT\_RP\_DATA\_MT    0x01}}
\DoxyCodeLine{54 \textcolor{preprocessor}{\#define GSM411\_MT\_RP\_ACK\_MO     0x02}}
\DoxyCodeLine{55 \textcolor{preprocessor}{\#define GSM411\_MT\_RP\_ACK\_MT     0x03}}
\DoxyCodeLine{56 \textcolor{preprocessor}{\#define GSM411\_MT\_RP\_ERROR\_MO   0x04}}
\DoxyCodeLine{57 \textcolor{preprocessor}{\#define GSM411\_MT\_RP\_ERROR\_MT   0x05}}
\DoxyCodeLine{58 \textcolor{preprocessor}{\#define GSM411\_MT\_RP\_SMMA\_MO    0x06}}
\DoxyCodeLine{59 }
\DoxyCodeLine{60 \textcolor{keyword}{enum} gsm411\_rp\_ie \{}
\DoxyCodeLine{61         GSM411\_IE\_RP\_USER\_DATA            = 0x41, \textcolor{comment}{/* 8.2.5.3 */}}
\DoxyCodeLine{62         GSM411\_IE\_RP\_CAUSE            = 0x42, \textcolor{comment}{/* 8.2.5.4 */}}
\DoxyCodeLine{63 \};}
\DoxyCodeLine{64 }
\DoxyCodeLine{65 \textcolor{comment}{/* Sections 8.2.5.1 and 8.2.5.2 set limits on the length of an SMSC-\/address.}}
\DoxyCodeLine{66 \textcolor{comment}{ * The spec states these limits in terms of min and max values of the length}}
\DoxyCodeLine{67 \textcolor{comment}{ * octet in type 4 IEs SM-\/RP-\/OA and SM-\/RP-\/DA; these IE length limits translate}}
\DoxyCodeLine{68 \textcolor{comment}{ * into a minimum of 1 digit and a maximum of 20 digits.}}
\DoxyCodeLine{69 \textcolor{comment}{ */}}
\DoxyCodeLine{70 \textcolor{preprocessor}{\#define GSM411\_SMSC\_ADDR\_MIN\_OCTETS     2}}
\DoxyCodeLine{71 \textcolor{preprocessor}{\#define GSM411\_SMSC\_ADDR\_MAX\_OCTETS     11}}
\DoxyCodeLine{72 \textcolor{preprocessor}{\#define GSM411\_SMSC\_ADDR\_MIN\_DIGITS     1}}
\DoxyCodeLine{73 \textcolor{preprocessor}{\#define GSM411\_SMSC\_ADDR\_MAX\_DIGITS     20}}
\DoxyCodeLine{74 }
\DoxyCodeLine{75 \textcolor{comment}{/* Chapter 8.2.5.4 Table 8.4 */}}
\DoxyCodeLine{76 \textcolor{keyword}{enum} gsm411\_rp\_cause \{}
\DoxyCodeLine{77         \textcolor{comment}{/* valid only for MO */}}
\DoxyCodeLine{78         GSM411\_RP\_CAUSE\_MO\_NUM\_UNASSIGNED      = 1,}
\DoxyCodeLine{79         GSM411\_RP\_CAUSE\_MO\_OP\_DET\_BARR            = 8,}
\DoxyCodeLine{80         GSM411\_RP\_CAUSE\_MO\_CALL\_BARRED            = 10,}
\DoxyCodeLine{81         GSM411\_RP\_CAUSE\_MO\_SMS\_REJECTED          = 21,}
\DoxyCodeLine{82         GSM411\_RP\_CAUSE\_MO\_DEST\_OUT\_OF\_ORDER        = 27,}
\DoxyCodeLine{83         GSM411\_RP\_CAUSE\_MO\_UNIDENTIFIED\_SUBSCR    = 28,}
\DoxyCodeLine{84         GSM411\_RP\_CAUSE\_MO\_FACILITY\_REJ          = 29,}
\DoxyCodeLine{85         GSM411\_RP\_CAUSE\_MO\_UNKNOWN\_SUBSCR      = 30,}
\DoxyCodeLine{86         GSM411\_RP\_CAUSE\_MO\_NET\_OUT\_OF\_ORDER  = 38,}
\DoxyCodeLine{87         GSM411\_RP\_CAUSE\_MO\_TEMP\_FAIL                = 41,}
\DoxyCodeLine{88         GSM411\_RP\_CAUSE\_MO\_CONGESTION              = 42,}
\DoxyCodeLine{89         GSM411\_RP\_CAUSE\_MO\_RES\_UNAVAIL            = 47,}
\DoxyCodeLine{90         GSM411\_RP\_CAUSE\_MO\_REQ\_FAC\_NOTSUBSCR        = 50,}
\DoxyCodeLine{91         GSM411\_RP\_CAUSE\_MO\_REQ\_FAC\_NOTIMPL    = 69,}
\DoxyCodeLine{92         GSM411\_RP\_CAUSE\_MO\_INTERWORKING          = 127,}
\DoxyCodeLine{93         \textcolor{comment}{/* valid only for MT */}}
\DoxyCodeLine{94         GSM411\_RP\_CAUSE\_MT\_MEM\_EXCEEDED          = 22,}
\DoxyCodeLine{95         \textcolor{comment}{/* valid for both directions */}}
\DoxyCodeLine{96         GSM411\_RP\_CAUSE\_INV\_TRANS\_REF              = 81,}
\DoxyCodeLine{97         GSM411\_RP\_CAUSE\_SEMANT\_INC\_MSG            = 95,}
\DoxyCodeLine{98         GSM411\_RP\_CAUSE\_INV\_MAND\_INF                = 96,}
\DoxyCodeLine{99         GSM411\_RP\_CAUSE\_MSGTYPE\_NOTEXIST        = 97,}
\DoxyCodeLine{100         GSM411\_RP\_CAUSE\_MSG\_INCOMP\_STATE        = 98,}
\DoxyCodeLine{101         GSM411\_RP\_CAUSE\_IE\_NOTEXIST          = 99,}
\DoxyCodeLine{102         GSM411\_RP\_CAUSE\_PROTOCOL\_ERR                = 111,}
\DoxyCodeLine{103 \};}
\DoxyCodeLine{104 }
\DoxyCodeLine{105 \textcolor{comment}{/* Chapter 10: Timers */}}
\DoxyCodeLine{106 \textcolor{preprocessor}{\#define GSM411\_TMR\_TR1M         40, 0   }\textcolor{comment}{/* 35 < x < 45 seconds */}\textcolor{preprocessor}{}}
\DoxyCodeLine{107 \textcolor{preprocessor}{\#define GSM411\_TMR\_TRAM         30, 0   }\textcolor{comment}{/* 25 < x < 35 seconds */}\textcolor{preprocessor}{}}
\DoxyCodeLine{108 \textcolor{preprocessor}{\#define GSM411\_TMR\_TR2M         15, 0   }\textcolor{comment}{/* 12 < x < 20 seconds */}\textcolor{preprocessor}{}}
\DoxyCodeLine{109 }
\DoxyCodeLine{110 \textcolor{preprocessor}{\#define GSM411\_TMR\_TC1A         30, 0   }\textcolor{comment}{/* TR1M -\/ 10 */}\textcolor{preprocessor}{}}
\DoxyCodeLine{111 \textcolor{preprocessor}{\#define GSM411\_TMR\_TC1A\_SEC     30      }\textcolor{comment}{/* TR1M -\/ 10 */}\textcolor{preprocessor}{}}
\DoxyCodeLine{112 }
\DoxyCodeLine{113 \textcolor{comment}{/* Chapter 8.2.1 */}}
\DoxyCodeLine{114 \textcolor{keyword}{struct }gsm411\_rp\_hdr \{}
\DoxyCodeLine{115         uint8\_t len;}
\DoxyCodeLine{116         uint8\_t msg\_type;}
\DoxyCodeLine{117         uint8\_t msg\_ref;}
\DoxyCodeLine{118         uint8\_t data[0];}
\DoxyCodeLine{119 \} \_\_attribute\_\_ ((packed));}
\DoxyCodeLine{120 }
\DoxyCodeLine{121 \textcolor{comment}{/* our own enum, not related to on-\/air protocol */}}
\DoxyCodeLine{122 \textcolor{keyword}{enum} sms\_alphabet \{}
\DoxyCodeLine{123         DCS\_NONE,}
\DoxyCodeLine{124         DCS\_7BIT\_DEFAULT,}
\DoxyCodeLine{125         DCS\_UCS2,}
\DoxyCodeLine{126         DCS\_8BIT\_DATA,}
\DoxyCodeLine{127 \};}
\DoxyCodeLine{128 }
\DoxyCodeLine{129 \textcolor{comment}{/* GSM 03.40 / Chapter 9.2.3.1: TP-\/Message-\/Type-\/Indicator */}}
\DoxyCodeLine{130 \textcolor{preprocessor}{\#define GSM340\_SMS\_DELIVER\_SC2MS        0x00}}
\DoxyCodeLine{131 \textcolor{preprocessor}{\#define GSM340\_SMS\_DELIVER\_REP\_MS2SC    0x00}}
\DoxyCodeLine{132 \textcolor{preprocessor}{\#define GSM340\_SMS\_STATUS\_REP\_SC2MS     0x02}}
\DoxyCodeLine{133 \textcolor{preprocessor}{\#define GSM340\_SMS\_COMMAND\_MS2SC        0x02}}
\DoxyCodeLine{134 \textcolor{preprocessor}{\#define GSM340\_SMS\_SUBMIT\_MS2SC         0x01}}
\DoxyCodeLine{135 \textcolor{preprocessor}{\#define GSM340\_SMS\_SUBMIT\_REP\_SC2MS     0x01}}
\DoxyCodeLine{136 \textcolor{preprocessor}{\#define GSM340\_SMS\_RESERVED             0x03}}
\DoxyCodeLine{137 }
\DoxyCodeLine{138 \textcolor{comment}{/* GSM 03.40 / Chapter 9.2.3.2: TP-\/More-\/Messages-\/to-\/Send */}}
\DoxyCodeLine{139 \textcolor{preprocessor}{\#define GSM340\_TP\_MMS\_MORE              0}}
\DoxyCodeLine{140 \textcolor{preprocessor}{\#define GSM340\_TP\_MMS\_NO\_MORE           1}}
\DoxyCodeLine{141 }
\DoxyCodeLine{142 \textcolor{comment}{/* GSM 03.40 / Chapter 9.2.3.3: TP-\/Validity-\/Period-\/Format */}}
\DoxyCodeLine{143 \textcolor{preprocessor}{\#define GSM340\_TP\_VPF\_NONE              0}}
\DoxyCodeLine{144 \textcolor{preprocessor}{\#define GSM340\_TP\_VPF\_RELATIVE          2}}
\DoxyCodeLine{145 \textcolor{preprocessor}{\#define GSM340\_TP\_VPF\_ENHANCED          1}}
\DoxyCodeLine{146 \textcolor{preprocessor}{\#define GSM340\_TP\_VPF\_ABSOLUTE          3}}
\DoxyCodeLine{147 }
\DoxyCodeLine{148 \textcolor{comment}{/* GSM 03.40 / Chapter 9.2.3.4: TP-\/Status-\/Report-\/Indication */}}
\DoxyCodeLine{149 \textcolor{preprocessor}{\#define GSM340\_TP\_SRI\_NONE              0}}
\DoxyCodeLine{150 \textcolor{preprocessor}{\#define GSM340\_TP\_SRI\_PRESENT           1}}
\DoxyCodeLine{151 }
\DoxyCodeLine{152 \textcolor{comment}{/* GSM 03.40 / Chapter 9.2.3.5: TP-\/Status-\/Report-\/Request */}}
\DoxyCodeLine{153 \textcolor{preprocessor}{\#define GSM340\_TP\_SRR\_NONE              0}}
\DoxyCodeLine{154 \textcolor{preprocessor}{\#define GSM340\_TP\_SRR\_REQUESTED         1}}
\DoxyCodeLine{155 }
\DoxyCodeLine{156 \textcolor{comment}{/* GSM 03.40 / Chapter 9.2.3.9: TP-\/Protocol-\/Identifier */}}
\DoxyCodeLine{157 \textcolor{comment}{/* telematic interworking (001 or 111 in bits 7-\/5) */}}
\DoxyCodeLine{158 \textcolor{preprocessor}{\#define GSM340\_TP\_PID\_IMPLICIT          0x00}}
\DoxyCodeLine{159 \textcolor{preprocessor}{\#define GSM340\_TP\_PID\_TELEX             0x01}}
\DoxyCodeLine{160 \textcolor{preprocessor}{\#define GSM340\_TP\_PID\_FAX\_G3            0x02}}
\DoxyCodeLine{161 \textcolor{preprocessor}{\#define GSM340\_TP\_PID\_FAX\_G4            0x03}}
\DoxyCodeLine{162 \textcolor{preprocessor}{\#define GSM340\_TP\_PID\_VOICE             0x04}}
\DoxyCodeLine{163 \textcolor{preprocessor}{\#define GSM430\_TP\_PID\_ERMES             0x05}}
\DoxyCodeLine{164 \textcolor{preprocessor}{\#define GSM430\_TP\_PID\_NATIONAL\_PAGING   0x06}}
\DoxyCodeLine{165 \textcolor{preprocessor}{\#define GSM430\_TP\_PID\_VIDEOTEX          0x07}}
\DoxyCodeLine{166 \textcolor{preprocessor}{\#define GSM430\_TP\_PID\_TELETEX\_UNSPEC    0x08}}
\DoxyCodeLine{167 \textcolor{preprocessor}{\#define GSM430\_TP\_PID\_TELETEX\_PSPDN     0x09}}
\DoxyCodeLine{168 \textcolor{preprocessor}{\#define GSM430\_TP\_PID\_TELETEX\_CSPDN     0x0a}}
\DoxyCodeLine{169 \textcolor{preprocessor}{\#define GSM430\_TP\_PID\_TELETEX\_PSTN      0x0b}}
\DoxyCodeLine{170 \textcolor{preprocessor}{\#define GSM430\_TP\_PID\_TELETEX\_ISDN      0x0c}}
\DoxyCodeLine{171 \textcolor{preprocessor}{\#define GSM430\_TP\_PID\_TELETEX\_UCI       0x0d}}
\DoxyCodeLine{172 \textcolor{preprocessor}{\#define GSM430\_TP\_PID\_MSG\_HANDLING      0x10}}
\DoxyCodeLine{173 \textcolor{preprocessor}{\#define GSM430\_TP\_PID\_MSG\_X400          0x11}}
\DoxyCodeLine{174 \textcolor{preprocessor}{\#define GSM430\_TP\_PID\_EMAIL             0x12}}
\DoxyCodeLine{175 \textcolor{preprocessor}{\#define GSM430\_TP\_PID\_GSM\_MS            0x1f}}
\DoxyCodeLine{176 \textcolor{comment}{/* if bit 7 = 0 and bit 6 = 1 */}}
\DoxyCodeLine{177 \textcolor{preprocessor}{\#define GSM430\_TP\_PID\_SMS\_TYPE\_0        0}}
\DoxyCodeLine{178 \textcolor{preprocessor}{\#define GSM430\_TP\_PID\_SMS\_TYPE\_1        1}}
\DoxyCodeLine{179 \textcolor{preprocessor}{\#define GSM430\_TP\_PID\_SMS\_TYPE\_2        2}}
\DoxyCodeLine{180 \textcolor{preprocessor}{\#define GSM430\_TP\_PID\_SMS\_TYPE\_3        3}}
\DoxyCodeLine{181 \textcolor{preprocessor}{\#define GSM430\_TP\_PID\_SMS\_TYPE\_4        4}}
\DoxyCodeLine{182 \textcolor{preprocessor}{\#define GSM430\_TP\_PID\_SMS\_TYPE\_5        5}}
\DoxyCodeLine{183 \textcolor{preprocessor}{\#define GSM430\_TP\_PID\_SMS\_TYPE\_6        6}}
\DoxyCodeLine{184 \textcolor{preprocessor}{\#define GSM430\_TP\_PID\_SMS\_TYPE\_7        7}}
\DoxyCodeLine{185 \textcolor{preprocessor}{\#define GSM430\_TP\_PID\_RETURN\_CALL\_MSG   0x1f}}
\DoxyCodeLine{186 \textcolor{preprocessor}{\#define GSM430\_TP\_PID\_ME\_DATA\_DNLOAD    0x3d}}
\DoxyCodeLine{187 \textcolor{preprocessor}{\#define GSM430\_TP\_PID\_ME\_DE\_PERSONAL    0x3e}}
\DoxyCodeLine{188 \textcolor{preprocessor}{\#define GSM430\_TP\_PID\_ME\_SIM\_DNLOAD     0x3f}}
\DoxyCodeLine{189 }
\DoxyCodeLine{190 \textcolor{comment}{/* GSM 03.38 Chapter 4: SMS Data Coding Scheme */}}
\DoxyCodeLine{191 \textcolor{preprocessor}{\#define GSM338\_DCS\_00\_}}
\DoxyCodeLine{192 }
\DoxyCodeLine{193 \textcolor{preprocessor}{\#define GSM338\_DCS\_1110\_7BIT            (0 << 2)}}
\DoxyCodeLine{194 \textcolor{preprocessor}{\#define GSM338\_DCS\_1111\_7BIT            (0 << 2)}}
\DoxyCodeLine{195 \textcolor{preprocessor}{\#define GSM338\_DCS\_1111\_8BIT\_DATA       (1 << 2)}}
\DoxyCodeLine{196 \textcolor{preprocessor}{\#define GSM338\_DCS\_1111\_CLASS0          0}}
\DoxyCodeLine{197 \textcolor{preprocessor}{\#define GSM338\_DCS\_1111\_CLASS1\_ME       1}}
\DoxyCodeLine{198 \textcolor{preprocessor}{\#define GSM338\_DCS\_1111\_CLASS2\_SIM      2}}
\DoxyCodeLine{199 \textcolor{preprocessor}{\#define GSM338\_DCS\_1111\_CLASS3\_TE       3       }\textcolor{comment}{/* See TS 07.05 */}\textcolor{preprocessor}{}}

\end{DoxyCode}
