Holger Hans Peter Freyther | ebaed74 | 2010-04-15 03:14:51 +0200 | [diff] [blame] | 1 | /* From GSM08.08 */ |
| 2 | |
| 3 | #ifndef GSM_0808_H |
| 4 | #define GSM_0808_H |
| 5 | |
| 6 | #include <stdlib.h> |
| 7 | |
Holger Hans Peter Freyther | ebaed74 | 2010-04-15 03:14:51 +0200 | [diff] [blame] | 8 | /* |
| 9 | * this is from GSM 03.03 CGI but is copied in GSM 08.08 |
| 10 | * in § 3.2.2.27 for Cell Identifier List |
| 11 | */ |
| 12 | enum CELL_IDENT { |
| 13 | CELL_IDENT_WHOLE_GLOBAL = 0, |
| 14 | CELL_IDENT_LAC_AND_CI = 1, |
| 15 | CELL_IDENT_CI = 2, |
| 16 | CELL_IDENT_NO_CELL = 3, |
| 17 | CELL_IDENT_LAI_AND_LAC = 4, |
| 18 | CELL_IDENT_LAC = 5, |
| 19 | CELL_IDENT_BSS = 6, |
| 20 | CELL_IDENT_UTRAN_PLMN_LAC_RNC = 8, |
| 21 | CELL_IDENT_UTRAN_RNC = 9, |
| 22 | CELL_IDENT_UTRAN_LAC_RNC = 10, |
| 23 | }; |
| 24 | |
| 25 | |
| 26 | /* GSM 08.06 § 6.3 */ |
| 27 | enum BSSAP_MSG_TYPE { |
| 28 | BSSAP_MSG_BSS_MANAGEMENT = 0x0, |
| 29 | BSSAP_MSG_DTAP = 0x1, |
| 30 | }; |
| 31 | |
| 32 | struct bssmap_header { |
Sylvain Munaut | a074ec4 | 2010-04-28 10:05:29 +0200 | [diff] [blame^] | 33 | uint8_t type; |
| 34 | uint8_t length; |
Holger Hans Peter Freyther | ebaed74 | 2010-04-15 03:14:51 +0200 | [diff] [blame] | 35 | } __attribute__((packed)); |
| 36 | |
| 37 | struct dtap_header { |
Sylvain Munaut | a074ec4 | 2010-04-28 10:05:29 +0200 | [diff] [blame^] | 38 | uint8_t type; |
| 39 | uint8_t link_id; |
| 40 | uint8_t length; |
Holger Hans Peter Freyther | ebaed74 | 2010-04-15 03:14:51 +0200 | [diff] [blame] | 41 | } __attribute__((packed)); |
| 42 | |
| 43 | |
| 44 | enum BSS_MAP_MSG_TYPE { |
| 45 | BSS_MAP_MSG_RESERVED_0 = 0, |
| 46 | |
| 47 | /* ASSIGNMENT MESSAGES */ |
| 48 | BSS_MAP_MSG_ASSIGMENT_RQST = 1, |
| 49 | BSS_MAP_MSG_ASSIGMENT_COMPLETE = 2, |
| 50 | BSS_MAP_MSG_ASSIGMENT_FAILURE = 3, |
| 51 | |
| 52 | /* HANDOVER MESSAGES */ |
| 53 | BSS_MAP_MSG_HANDOVER_RQST = 16, |
| 54 | BSS_MAP_MSG_HANDOVER_REQUIRED = 17, |
| 55 | BSS_MAP_MSG_HANDOVER_RQST_ACKNOWLEDGE= 18, |
| 56 | BSS_MAP_MSG_HANDOVER_CMD = 19, |
| 57 | BSS_MAP_MSG_HANDOVER_COMPLETE = 20, |
| 58 | BSS_MAP_MSG_HANDOVER_SUCCEEDED = 21, |
| 59 | BSS_MAP_MSG_HANDOVER_FAILURE = 22, |
| 60 | BSS_MAP_MSG_HANDOVER_PERFORMED = 23, |
| 61 | BSS_MAP_MSG_HANDOVER_CANDIDATE_ENQUIRE = 24, |
| 62 | BSS_MAP_MSG_HANDOVER_CANDIDATE_RESPONSE = 25, |
| 63 | BSS_MAP_MSG_HANDOVER_REQUIRED_REJECT = 26, |
| 64 | BSS_MAP_MSG_HANDOVER_DETECT = 27, |
| 65 | |
| 66 | /* RELEASE MESSAGES */ |
| 67 | BSS_MAP_MSG_CLEAR_CMD = 32, |
| 68 | BSS_MAP_MSG_CLEAR_COMPLETE = 33, |
| 69 | BSS_MAP_MSG_CLEAR_RQST = 34, |
| 70 | BSS_MAP_MSG_RESERVED_1 = 35, |
| 71 | BSS_MAP_MSG_RESERVED_2 = 36, |
| 72 | BSS_MAP_MSG_SAPI_N_REJECT = 37, |
| 73 | BSS_MAP_MSG_CONFUSION = 38, |
| 74 | |
| 75 | /* OTHER CONNECTION RELATED MESSAGES */ |
| 76 | BSS_MAP_MSG_SUSPEND = 40, |
| 77 | BSS_MAP_MSG_RESUME = 41, |
| 78 | BSS_MAP_MSG_CONNECTION_ORIENTED_INFORMATION = 42, |
| 79 | BSS_MAP_MSG_PERFORM_LOCATION_RQST = 43, |
| 80 | BSS_MAP_MSG_LSA_INFORMATION = 44, |
| 81 | BSS_MAP_MSG_PERFORM_LOCATION_RESPONSE = 45, |
| 82 | BSS_MAP_MSG_PERFORM_LOCATION_ABORT = 46, |
| 83 | BSS_MAP_MSG_COMMON_ID = 47, |
| 84 | |
| 85 | /* GENERAL MESSAGES */ |
| 86 | BSS_MAP_MSG_RESET = 48, |
| 87 | BSS_MAP_MSG_RESET_ACKNOWLEDGE = 49, |
| 88 | BSS_MAP_MSG_OVERLOAD = 50, |
| 89 | BSS_MAP_MSG_RESERVED_3 = 51, |
| 90 | BSS_MAP_MSG_RESET_CIRCUIT = 52, |
| 91 | BSS_MAP_MSG_RESET_CIRCUIT_ACKNOWLEDGE = 53, |
| 92 | BSS_MAP_MSG_MSC_INVOKE_TRACE = 54, |
| 93 | BSS_MAP_MSG_BSS_INVOKE_TRACE = 55, |
| 94 | BSS_MAP_MSG_CONNECTIONLESS_INFORMATION = 58, |
| 95 | |
| 96 | /* TERRESTRIAL RESOURCE MESSAGES */ |
| 97 | BSS_MAP_MSG_BLOCK = 64, |
| 98 | BSS_MAP_MSG_BLOCKING_ACKNOWLEDGE = 65, |
| 99 | BSS_MAP_MSG_UNBLOCK = 66, |
| 100 | BSS_MAP_MSG_UNBLOCKING_ACKNOWLEDGE = 67, |
| 101 | BSS_MAP_MSG_CIRCUIT_GROUP_BLOCK = 68, |
| 102 | BSS_MAP_MSG_CIRCUIT_GROUP_BLOCKING_ACKNOWLEDGE = 69, |
| 103 | BSS_MAP_MSG_CIRCUIT_GROUP_UNBLOCK = 70, |
| 104 | BSS_MAP_MSG_CIRCUIT_GROUP_UNBLOCKING_ACKNOWLEDGE = 71, |
| 105 | BSS_MAP_MSG_UNEQUIPPED_CIRCUIT = 72, |
| 106 | BSS_MAP_MSG_CHANGE_CIRCUIT = 78, |
| 107 | BSS_MAP_MSG_CHANGE_CIRCUIT_ACKNOWLEDGE = 79, |
| 108 | |
| 109 | /* RADIO RESOURCE MESSAGES */ |
| 110 | BSS_MAP_MSG_RESOURCE_RQST = 80, |
| 111 | BSS_MAP_MSG_RESOURCE_INDICATION = 81, |
| 112 | BSS_MAP_MSG_PAGING = 82, |
| 113 | BSS_MAP_MSG_CIPHER_MODE_CMD = 83, |
| 114 | BSS_MAP_MSG_CLASSMARK_UPDATE = 84, |
| 115 | BSS_MAP_MSG_CIPHER_MODE_COMPLETE = 85, |
| 116 | BSS_MAP_MSG_QUEUING_INDICATION = 86, |
| 117 | BSS_MAP_MSG_COMPLETE_LAYER_3 = 87, |
| 118 | BSS_MAP_MSG_CLASSMARK_RQST = 88, |
| 119 | BSS_MAP_MSG_CIPHER_MODE_REJECT = 89, |
| 120 | BSS_MAP_MSG_LOAD_INDICATION = 90, |
| 121 | |
| 122 | /* VGCS/VBS */ |
| 123 | BSS_MAP_MSG_VGCS_VBS_SETUP = 4, |
| 124 | BSS_MAP_MSG_VGCS_VBS_SETUP_ACK = 5, |
| 125 | BSS_MAP_MSG_VGCS_VBS_SETUP_REFUSE = 6, |
| 126 | BSS_MAP_MSG_VGCS_VBS_ASSIGNMENT_RQST = 7, |
| 127 | BSS_MAP_MSG_VGCS_VBS_ASSIGNMENT_RESULT = 28, |
| 128 | BSS_MAP_MSG_VGCS_VBS_ASSIGNMENT_FAILURE = 29, |
| 129 | BSS_MAP_MSG_VGCS_VBS_QUEUING_INDICATION = 30, |
| 130 | BSS_MAP_MSG_UPLINK_RQST = 31, |
| 131 | BSS_MAP_MSG_UPLINK_RQST_ACKNOWLEDGE = 39, |
| 132 | BSS_MAP_MSG_UPLINK_RQST_CONFIRMATION = 73, |
| 133 | BSS_MAP_MSG_UPLINK_RELEASE_INDICATION = 74, |
| 134 | BSS_MAP_MSG_UPLINK_REJECT_CMD = 75, |
| 135 | BSS_MAP_MSG_UPLINK_RELEASE_CMD = 76, |
| 136 | BSS_MAP_MSG_UPLINK_SEIZED_CMD = 77, |
| 137 | }; |
| 138 | |
| 139 | enum GSM0808_IE_CODING { |
| 140 | GSM0808_IE_CIRCUIT_IDENTITY_CODE = 1, |
| 141 | GSM0808_IE_RESERVED_0 = 2, |
| 142 | GSM0808_IE_RESOURCE_AVAILABLE = 3, |
| 143 | GSM0808_IE_CAUSE = 4, |
| 144 | GSM0808_IE_CELL_IDENTIFIER = 5, |
| 145 | GSM0808_IE_PRIORITY = 6, |
| 146 | GSM0808_IE_LAYER_3_HEADER_INFORMATION = 7, |
| 147 | GSM0808_IE_IMSI = 8, |
| 148 | GSM0808_IE_TMSI = 9, |
| 149 | GSM0808_IE_ENCRYPTION_INFORMATION = 10, |
| 150 | GSM0808_IE_CHANNEL_TYPE = 11, |
| 151 | GSM0808_IE_PERIODICITY = 12, |
| 152 | GSM0808_IE_EXTENDED_RESOURCE_INDICATOR = 13, |
| 153 | GSM0808_IE_NUMBER_OF_MSS = 14, |
| 154 | GSM0808_IE_RESERVED_1 = 15, |
| 155 | GSM0808_IE_RESERVED_2 = 16, |
| 156 | GSM0808_IE_RESERVED_3 = 17, |
| 157 | GSM0808_IE_CLASSMARK_INFORMATION_T2 = 18, |
| 158 | GSM0808_IE_CLASSMARK_INFORMATION_T3 = 19, |
| 159 | GSM0808_IE_INTERFERENCE_BAND_TO_USE = 20, |
| 160 | GSM0808_IE_RR_CAUSE = 21, |
| 161 | GSM0808_IE_RESERVED_4 = 22, |
| 162 | GSM0808_IE_LAYER_3_INFORMATION = 23, |
| 163 | GSM0808_IE_DLCI = 24, |
| 164 | GSM0808_IE_DOWNLINK_DTX_FLAG = 25, |
| 165 | GSM0808_IE_CELL_IDENTIFIER_LIST = 26, |
| 166 | GSM0808_IE_RESPONSE_RQST = 27, |
| 167 | GSM0808_IE_RESOURCE_INDICATION_METHOD = 28, |
| 168 | GSM0808_IE_CLASSMARK_INFORMATION_TYPE_1 = 29, |
| 169 | GSM0808_IE_CIRCUIT_IDENTITY_CODE_LIST = 30, |
| 170 | GSM0808_IE_DIAGNOSTIC = 31, |
| 171 | GSM0808_IE_LAYER_3_MESSAGE_CONTENTS = 32, |
| 172 | GSM0808_IE_CHOSEN_CHANNEL = 33, |
| 173 | GSM0808_IE_TOTAL_RESOURCE_ACCESSIBLE = 34, |
| 174 | GSM0808_IE_CIPHER_RESPONSE_MODE = 35, |
| 175 | GSM0808_IE_CHANNEL_NEEDED = 36, |
| 176 | GSM0808_IE_TRACE_TYPE = 37, |
| 177 | GSM0808_IE_TRIGGERID = 38, |
| 178 | GSM0808_IE_TRACE_REFERENCE = 39, |
| 179 | GSM0808_IE_TRANSACTIONID = 40, |
| 180 | GSM0808_IE_MOBILE_IDENTITY = 41, |
| 181 | GSM0808_IE_OMCID = 42, |
| 182 | GSM0808_IE_FORWARD_INDICATOR = 43, |
| 183 | GSM0808_IE_CHOSEN_ENCR_ALG = 44, |
| 184 | GSM0808_IE_CIRCUIT_POOL = 45, |
| 185 | GSM0808_IE_CIRCUIT_POOL_LIST = 46, |
| 186 | GSM0808_IE_TIME_INDICATION = 47, |
| 187 | GSM0808_IE_RESOURCE_SITUATION = 48, |
| 188 | GSM0808_IE_CURRENT_CHANNEL_TYPE_1 = 49, |
| 189 | GSM0808_IE_QUEUEING_INDICATOR = 50, |
| 190 | GSM0808_IE_SPEECH_VERSION = 64, |
| 191 | GSM0808_IE_ASSIGNMENT_REQUIREMENT = 51, |
| 192 | GSM0808_IE_TALKER_FLAG = 53, |
| 193 | GSM0808_IE_CONNECTION_RELEASE_RQSTED = 54, |
| 194 | GSM0808_IE_GROUP_CALL_REFERENCE = 55, |
| 195 | GSM0808_IE_EMLPP_PRIORITY = 56, |
| 196 | GSM0808_IE_CONFIG_EVO_INDI = 57, |
| 197 | GSM0808_IE_OLD_BSS_TO_NEW_BSS_INFORMATION = 58, |
| 198 | GSM0808_IE_LSA_IDENTIFIER = 59, |
| 199 | GSM0808_IE_LSA_IDENTIFIER_LIST = 60, |
| 200 | GSM0808_IE_LSA_INFORMATION = 61, |
| 201 | GSM0808_IE_LCS_QOS = 62, |
| 202 | GSM0808_IE_LSA_ACCESS_CTRL_SUPPR = 63, |
| 203 | GSM0808_IE_LCS_PRIORITY = 67, |
| 204 | GSM0808_IE_LOCATION_TYPE = 68, |
| 205 | GSM0808_IE_LOCATION_ESTIMATE = 69, |
| 206 | GSM0808_IE_POSITIONING_DATA = 70, |
| 207 | GSM0808_IE_LCS_CAUSE = 71, |
| 208 | GSM0808_IE_LCS_CLIENT_TYPE = 72, |
| 209 | GSM0808_IE_APDU = 73, |
| 210 | GSM0808_IE_NETWORK_ELEMENT_IDENTITY = 74, |
| 211 | GSM0808_IE_GPS_ASSISTANCE_DATA = 75, |
| 212 | GSM0808_IE_DECIPHERING_KEYS = 76, |
| 213 | GSM0808_IE_RETURN_ERROR_RQST = 77, |
| 214 | GSM0808_IE_RETURN_ERROR_CAUSE = 78, |
| 215 | GSM0808_IE_SEGMENTATION = 79, |
| 216 | GSM0808_IE_SERVICE_HANDOVER = 80, |
| 217 | GSM0808_IE_SOURCE_RNC_TO_TARGET_RNC_TRANSPARENT_UMTS = 81, |
| 218 | GSM0808_IE_SOURCE_RNC_TO_TARGET_RNC_TRANSPARENT_CDMA2000= 82, |
| 219 | GSM0808_IE_RESERVED_5 = 65, |
| 220 | GSM0808_IE_RESERVED_6 = 66, |
| 221 | }; |
| 222 | |
| 223 | enum gsm0808_cause { |
| 224 | GSM0808_CAUSE_RADIO_INTERFACE_MESSAGE_FAILURE = 0, |
| 225 | GSM0808_CAUSE_RADIO_INTERFACE_FAILURE = 1, |
| 226 | GSM0808_CAUSE_UPLINK_QUALITY = 2, |
| 227 | GSM0808_CAUSE_UPLINK_STRENGTH = 3, |
| 228 | GSM0808_CAUSE_DOWNLINK_QUALITY = 4, |
| 229 | GSM0808_CAUSE_DOWNLINK_STRENGTH = 5, |
| 230 | GSM0808_CAUSE_DISTANCE = 6, |
| 231 | GSM0808_CAUSE_O_AND_M_INTERVENTION = 7, |
| 232 | GSM0808_CAUSE_RESPONSE_TO_MSC_INVOCATION = 8, |
| 233 | GSM0808_CAUSE_CALL_CONTROL = 9, |
| 234 | GSM0808_CAUSE_RADIO_INTERFACE_FAILURE_REVERSION = 10, |
| 235 | GSM0808_CAUSE_HANDOVER_SUCCESSFUL = 11, |
| 236 | GSM0808_CAUSE_BETTER_CELL = 12, |
| 237 | GSM0808_CAUSE_DIRECTED_RETRY = 13, |
| 238 | GSM0808_CAUSE_JOINED_GROUP_CALL_CHANNEL = 14, |
| 239 | GSM0808_CAUSE_TRAFFIC = 15, |
| 240 | GSM0808_CAUSE_EQUIPMENT_FAILURE = 32, |
| 241 | GSM0808_CAUSE_NO_RADIO_RESOURCE_AVAILABLE = 33, |
| 242 | GSM0808_CAUSE_RQSTED_TERRESTRIAL_RESOURCE_UNAVAILABLE = 34, |
| 243 | GSM0808_CAUSE_CCCH_OVERLOAD = 35, |
| 244 | GSM0808_CAUSE_PROCESSOR_OVERLOAD = 36, |
| 245 | GSM0808_CAUSE_BSS_NOT_EQUIPPED = 37, |
| 246 | GSM0808_CAUSE_MS_NOT_EQUIPPED = 38, |
| 247 | GSM0808_CAUSE_INVALID_CELL = 39, |
| 248 | GSM0808_CAUSE_TRAFFIC_LOAD = 40, |
| 249 | GSM0808_CAUSE_PREEMPTION = 41, |
| 250 | GSM0808_CAUSE_RQSTED_TRANSCODING_RATE_ADAPTION_UNAVAILABLE = 48, |
| 251 | GSM0808_CAUSE_CIRCUIT_POOL_MISMATCH = 49, |
| 252 | GSM0808_CAUSE_SWITCH_CIRCUIT_POOL = 50, |
| 253 | GSM0808_CAUSE_RQSTED_SPEECH_VERSION_UNAVAILABLE = 51, |
| 254 | GSM0808_CAUSE_LSA_NOT_ALLOWED = 52, |
| 255 | GSM0808_CAUSE_CIPHERING_ALGORITHM_NOT_SUPPORTED = 64, |
| 256 | GSM0808_CAUSE_TERRESTRIAL_CIRCUIT_ALREADY_ALLOCATED = 80, |
| 257 | GSM0808_CAUSE_INVALID_MESSAGE_CONTENTS = 81, |
| 258 | GSM0808_CAUSE_INFORMATION_ELEMENT_OR_FIELD_MISSING = 82, |
| 259 | GSM0808_CAUSE_INCORRECT_VALUE = 83, |
| 260 | GSM0808_CAUSE_UNKNOWN_MESSAGE_TYPE = 84, |
| 261 | GSM0808_CAUSE_UNKNOWN_INFORMATION_ELEMENT = 85, |
| 262 | GSM0808_CAUSE_PROTOCOL_ERROR_BETWEEN_BSS_AND_MSC = 96, |
| 263 | }; |
| 264 | |
| 265 | /* GSM 08.08 3.2.2.11 Channel Type */ |
| 266 | enum gsm0808_chan_indicator { |
| 267 | GSM0808_CHAN_SPEECH = 1, |
| 268 | GSM0808_CHAN_DATA = 2, |
| 269 | GSM0808_CHAN_SIGN = 3, |
| 270 | }; |
| 271 | |
| 272 | enum gsm0808_chan_rate_type_data { |
| 273 | GSM0808_DATA_FULL_BM = 0x8, |
| 274 | GSM0808_DATA_HALF_LM = 0x9, |
| 275 | GSM0808_DATA_FULL_RPREF = 0xa, |
| 276 | GSM0808_DATA_HALF_PREF = 0xb, |
| 277 | GSM0808_DATA_FULL_PREF_NO_CHANGE = 0x1a, |
| 278 | GSM0808_DATA_HALF_PREF_NO_CHANGE = 0x1b, |
| 279 | GSM0808_DATA_MULTI_MASK = 0x20, |
| 280 | GSM0808_DATA_MULTI_MASK_NO_CHANGE = 0x30, |
| 281 | }; |
| 282 | |
| 283 | enum gsm0808_chan_rate_type_speech { |
| 284 | GSM0808_SPEECH_FULL_BM = 0x8, |
| 285 | GSM0808_SPEECH_HALF_LM = 0x9, |
| 286 | GSM0808_SPEECH_FULL_PREF= 0xa, |
| 287 | GSM0808_SPEECH_HALF_PREF= 0xb, |
| 288 | GSM0808_SPEECH_FULL_PREF_NO_CHANGE = 0x1a, |
| 289 | GSM0808_SPEECH_HALF_PREF_NO_CHANGE = 0x1b, |
| 290 | GSM0808_SPEECH_PERM = 0xf, |
| 291 | GSM0808_SPEECH_PERM_NO_CHANGE = 0x1f, |
| 292 | }; |
| 293 | |
| 294 | enum gsm0808_permitted_speech { |
| 295 | GSM0808_PERM_FR1 = 0x01, |
| 296 | GSM0808_PERM_FR2 = 0x11, |
| 297 | GSM0808_PERM_FR3 = 0x21, |
| 298 | GSM0808_PERM_HR1 = GSM0808_PERM_FR1 | 0x4, |
| 299 | GSM0808_PERM_HR2 = GSM0808_PERM_FR2 | 0x4, |
| 300 | GSM0808_PERM_HR3 = GSM0808_PERM_FR3 | 0x4, |
| 301 | }; |
| 302 | |
| 303 | #endif |