Harald Welte | c8585cf | 2014-06-21 22:28:12 +0200 | [diff] [blame] | 1 | /* From GSM08.08 / 3GPP TS 48.008 version 11.7.0 Release 11 */ |
Holger Hans Peter Freyther | ebaed74 | 2010-04-15 03:14:51 +0200 | [diff] [blame] | 2 | |
Sylvain Munaut | 12ba778 | 2014-06-16 10:13:40 +0200 | [diff] [blame] | 3 | #pragma once |
Holger Hans Peter Freyther | ebaed74 | 2010-04-15 03:14:51 +0200 | [diff] [blame] | 4 | |
| 5 | #include <stdlib.h> |
Philipp Maier | 6f725d6 | 2017-03-24 18:03:17 +0100 | [diff] [blame] | 6 | #include <stdbool.h> |
| 7 | #include <stdint.h> |
| 8 | #include <osmocom/core/linuxlist.h> |
Neels Hofmeyr | ffad574 | 2018-01-12 05:34:03 +0100 | [diff] [blame] | 9 | #include <osmocom/core/utils.h> |
Holger Hans Peter Freyther | ebaed74 | 2010-04-15 03:14:51 +0200 | [diff] [blame] | 10 | |
Holger Hans Peter Freyther | ebaed74 | 2010-04-15 03:14:51 +0200 | [diff] [blame] | 11 | /* |
| 12 | * this is from GSM 03.03 CGI but is copied in GSM 08.08 |
Neels Hofmeyr | a4399c8 | 2018-04-17 02:26:10 +0200 | [diff] [blame] | 13 | * in § 3.2.2.27 for Cell Identifier List. |
| 14 | * See gsm0808_cell_id_discr_name() for a human readable representation. |
Holger Hans Peter Freyther | ebaed74 | 2010-04-15 03:14:51 +0200 | [diff] [blame] | 15 | */ |
| 16 | enum CELL_IDENT { |
| 17 | CELL_IDENT_WHOLE_GLOBAL = 0, |
| 18 | CELL_IDENT_LAC_AND_CI = 1, |
| 19 | CELL_IDENT_CI = 2, |
| 20 | CELL_IDENT_NO_CELL = 3, |
Stefan Sperling | 6cb8336 | 2018-12-19 19:29:20 +0100 | [diff] [blame] | 21 | CELL_IDENT_LAI = 4, |
Holger Hans Peter Freyther | ebaed74 | 2010-04-15 03:14:51 +0200 | [diff] [blame] | 22 | CELL_IDENT_LAC = 5, |
| 23 | CELL_IDENT_BSS = 6, |
| 24 | CELL_IDENT_UTRAN_PLMN_LAC_RNC = 8, |
| 25 | CELL_IDENT_UTRAN_RNC = 9, |
| 26 | CELL_IDENT_UTRAN_LAC_RNC = 10, |
| 27 | }; |
Stefan Sperling | 6cb8336 | 2018-12-19 19:29:20 +0100 | [diff] [blame] | 28 | /* Keep this misnamed CELL_IDENT for API backwards compatibility (see OS#3124). */ |
| 29 | #define CELL_IDENT_LAI_AND_LAC CELL_IDENT_LAI |
Holger Hans Peter Freyther | ebaed74 | 2010-04-15 03:14:51 +0200 | [diff] [blame] | 30 | |
| 31 | /* GSM 08.06 § 6.3 */ |
| 32 | enum BSSAP_MSG_TYPE { |
| 33 | BSSAP_MSG_BSS_MANAGEMENT = 0x0, |
| 34 | BSSAP_MSG_DTAP = 0x1, |
| 35 | }; |
| 36 | |
| 37 | struct bssmap_header { |
Sylvain Munaut | a074ec4 | 2010-04-28 10:05:29 +0200 | [diff] [blame] | 38 | uint8_t type; |
| 39 | uint8_t length; |
Holger Hans Peter Freyther | ebaed74 | 2010-04-15 03:14:51 +0200 | [diff] [blame] | 40 | } __attribute__((packed)); |
| 41 | |
| 42 | struct dtap_header { |
Sylvain Munaut | a074ec4 | 2010-04-28 10:05:29 +0200 | [diff] [blame] | 43 | uint8_t type; |
| 44 | uint8_t link_id; |
| 45 | uint8_t length; |
Holger Hans Peter Freyther | ebaed74 | 2010-04-15 03:14:51 +0200 | [diff] [blame] | 46 | } __attribute__((packed)); |
| 47 | |
| 48 | |
| 49 | enum BSS_MAP_MSG_TYPE { |
| 50 | BSS_MAP_MSG_RESERVED_0 = 0, |
| 51 | |
| 52 | /* ASSIGNMENT MESSAGES */ |
Neels Hofmeyr | 86a5aae | 2019-01-04 01:29:55 +0100 | [diff] [blame] | 53 | BSS_MAP_MSG_ASSIGNMENT_RQST = 1, |
| 54 | BSS_MAP_MSG_ASSIGNMENT_COMPLETE = 2, |
| 55 | BSS_MAP_MSG_ASSIGNMENT_FAILURE = 3, |
Harald Welte | c8585cf | 2014-06-21 22:28:12 +0200 | [diff] [blame] | 56 | BSS_MAP_MSG_CHAN_MOD_RQST = 8, |
Holger Hans Peter Freyther | ebaed74 | 2010-04-15 03:14:51 +0200 | [diff] [blame] | 57 | |
| 58 | /* HANDOVER MESSAGES */ |
| 59 | BSS_MAP_MSG_HANDOVER_RQST = 16, |
| 60 | BSS_MAP_MSG_HANDOVER_REQUIRED = 17, |
| 61 | BSS_MAP_MSG_HANDOVER_RQST_ACKNOWLEDGE= 18, |
| 62 | BSS_MAP_MSG_HANDOVER_CMD = 19, |
| 63 | BSS_MAP_MSG_HANDOVER_COMPLETE = 20, |
| 64 | BSS_MAP_MSG_HANDOVER_SUCCEEDED = 21, |
| 65 | BSS_MAP_MSG_HANDOVER_FAILURE = 22, |
| 66 | BSS_MAP_MSG_HANDOVER_PERFORMED = 23, |
| 67 | BSS_MAP_MSG_HANDOVER_CANDIDATE_ENQUIRE = 24, |
| 68 | BSS_MAP_MSG_HANDOVER_CANDIDATE_RESPONSE = 25, |
| 69 | BSS_MAP_MSG_HANDOVER_REQUIRED_REJECT = 26, |
| 70 | BSS_MAP_MSG_HANDOVER_DETECT = 27, |
Harald Welte | c8585cf | 2014-06-21 22:28:12 +0200 | [diff] [blame] | 71 | BSS_MAP_MSG_INT_HANDOVER_REQUIRED = 0x70, |
| 72 | BSS_MAP_MSG_INT_HANDOVER_REQUIRED_REJ = 0x71, |
| 73 | BSS_MAP_MSG_INT_HANDOVER_CMD = 0x72, |
| 74 | BSS_MAP_MSG_INT_HANDOVER_ENQUIRY = 0x73, |
Holger Hans Peter Freyther | ebaed74 | 2010-04-15 03:14:51 +0200 | [diff] [blame] | 75 | |
| 76 | /* RELEASE MESSAGES */ |
| 77 | BSS_MAP_MSG_CLEAR_CMD = 32, |
| 78 | BSS_MAP_MSG_CLEAR_COMPLETE = 33, |
| 79 | BSS_MAP_MSG_CLEAR_RQST = 34, |
| 80 | BSS_MAP_MSG_RESERVED_1 = 35, |
| 81 | BSS_MAP_MSG_RESERVED_2 = 36, |
| 82 | BSS_MAP_MSG_SAPI_N_REJECT = 37, |
| 83 | BSS_MAP_MSG_CONFUSION = 38, |
| 84 | |
| 85 | /* OTHER CONNECTION RELATED MESSAGES */ |
| 86 | BSS_MAP_MSG_SUSPEND = 40, |
| 87 | BSS_MAP_MSG_RESUME = 41, |
| 88 | BSS_MAP_MSG_CONNECTION_ORIENTED_INFORMATION = 42, |
| 89 | BSS_MAP_MSG_PERFORM_LOCATION_RQST = 43, |
| 90 | BSS_MAP_MSG_LSA_INFORMATION = 44, |
| 91 | BSS_MAP_MSG_PERFORM_LOCATION_RESPONSE = 45, |
| 92 | BSS_MAP_MSG_PERFORM_LOCATION_ABORT = 46, |
| 93 | BSS_MAP_MSG_COMMON_ID = 47, |
Harald Welte | c8585cf | 2014-06-21 22:28:12 +0200 | [diff] [blame] | 94 | BSS_MAP_MSG_REROUTE_CMD = 0x78, |
| 95 | BSS_MAP_MSG_REROUTE_COMPLETE = 0x79, |
Holger Hans Peter Freyther | ebaed74 | 2010-04-15 03:14:51 +0200 | [diff] [blame] | 96 | |
| 97 | /* GENERAL MESSAGES */ |
| 98 | BSS_MAP_MSG_RESET = 48, |
| 99 | BSS_MAP_MSG_RESET_ACKNOWLEDGE = 49, |
| 100 | BSS_MAP_MSG_OVERLOAD = 50, |
| 101 | BSS_MAP_MSG_RESERVED_3 = 51, |
| 102 | BSS_MAP_MSG_RESET_CIRCUIT = 52, |
| 103 | BSS_MAP_MSG_RESET_CIRCUIT_ACKNOWLEDGE = 53, |
| 104 | BSS_MAP_MSG_MSC_INVOKE_TRACE = 54, |
| 105 | BSS_MAP_MSG_BSS_INVOKE_TRACE = 55, |
| 106 | BSS_MAP_MSG_CONNECTIONLESS_INFORMATION = 58, |
Harald Welte | c8585cf | 2014-06-21 22:28:12 +0200 | [diff] [blame] | 107 | BSS_MAP_MSG_RESET_IP_RSRC = 0x3d, |
| 108 | BSS_MAP_MSG_RESET_IP_RSRC_ACK = 0x3e, |
Holger Hans Peter Freyther | ebaed74 | 2010-04-15 03:14:51 +0200 | [diff] [blame] | 109 | |
| 110 | /* TERRESTRIAL RESOURCE MESSAGES */ |
| 111 | BSS_MAP_MSG_BLOCK = 64, |
| 112 | BSS_MAP_MSG_BLOCKING_ACKNOWLEDGE = 65, |
| 113 | BSS_MAP_MSG_UNBLOCK = 66, |
| 114 | BSS_MAP_MSG_UNBLOCKING_ACKNOWLEDGE = 67, |
| 115 | BSS_MAP_MSG_CIRCUIT_GROUP_BLOCK = 68, |
| 116 | BSS_MAP_MSG_CIRCUIT_GROUP_BLOCKING_ACKNOWLEDGE = 69, |
| 117 | BSS_MAP_MSG_CIRCUIT_GROUP_UNBLOCK = 70, |
| 118 | BSS_MAP_MSG_CIRCUIT_GROUP_UNBLOCKING_ACKNOWLEDGE = 71, |
| 119 | BSS_MAP_MSG_UNEQUIPPED_CIRCUIT = 72, |
| 120 | BSS_MAP_MSG_CHANGE_CIRCUIT = 78, |
| 121 | BSS_MAP_MSG_CHANGE_CIRCUIT_ACKNOWLEDGE = 79, |
| 122 | |
| 123 | /* RADIO RESOURCE MESSAGES */ |
| 124 | BSS_MAP_MSG_RESOURCE_RQST = 80, |
| 125 | BSS_MAP_MSG_RESOURCE_INDICATION = 81, |
| 126 | BSS_MAP_MSG_PAGING = 82, |
| 127 | BSS_MAP_MSG_CIPHER_MODE_CMD = 83, |
| 128 | BSS_MAP_MSG_CLASSMARK_UPDATE = 84, |
| 129 | BSS_MAP_MSG_CIPHER_MODE_COMPLETE = 85, |
| 130 | BSS_MAP_MSG_QUEUING_INDICATION = 86, |
| 131 | BSS_MAP_MSG_COMPLETE_LAYER_3 = 87, |
| 132 | BSS_MAP_MSG_CLASSMARK_RQST = 88, |
| 133 | BSS_MAP_MSG_CIPHER_MODE_REJECT = 89, |
| 134 | BSS_MAP_MSG_LOAD_INDICATION = 90, |
| 135 | |
| 136 | /* VGCS/VBS */ |
| 137 | BSS_MAP_MSG_VGCS_VBS_SETUP = 4, |
| 138 | BSS_MAP_MSG_VGCS_VBS_SETUP_ACK = 5, |
| 139 | BSS_MAP_MSG_VGCS_VBS_SETUP_REFUSE = 6, |
| 140 | BSS_MAP_MSG_VGCS_VBS_ASSIGNMENT_RQST = 7, |
| 141 | BSS_MAP_MSG_VGCS_VBS_ASSIGNMENT_RESULT = 28, |
| 142 | BSS_MAP_MSG_VGCS_VBS_ASSIGNMENT_FAILURE = 29, |
| 143 | BSS_MAP_MSG_VGCS_VBS_QUEUING_INDICATION = 30, |
| 144 | BSS_MAP_MSG_UPLINK_RQST = 31, |
| 145 | BSS_MAP_MSG_UPLINK_RQST_ACKNOWLEDGE = 39, |
| 146 | BSS_MAP_MSG_UPLINK_RQST_CONFIRMATION = 73, |
| 147 | BSS_MAP_MSG_UPLINK_RELEASE_INDICATION = 74, |
| 148 | BSS_MAP_MSG_UPLINK_REJECT_CMD = 75, |
| 149 | BSS_MAP_MSG_UPLINK_RELEASE_CMD = 76, |
| 150 | BSS_MAP_MSG_UPLINK_SEIZED_CMD = 77, |
Harald Welte | c8585cf | 2014-06-21 22:28:12 +0200 | [diff] [blame] | 151 | BSS_MAP_MSG_VGCS_ADDL_INFO = 0x60, |
Harald Welte | c8585cf | 2014-06-21 22:28:12 +0200 | [diff] [blame] | 152 | BSS_MAP_MSG_NOTIFICATION_DATA = 0x62, |
| 153 | BSS_MAP_MSG_UPLINK_APP_DATA = 0x63, |
| 154 | |
| 155 | /* LOCAL SWITCHING */ |
| 156 | BSS_MAP_MSG_LCLS_CONNECT_CTRL = 0x74, |
| 157 | BSS_MAP_MSG_LCLS_CONNECT_CTRL_ACK = 0x75, |
| 158 | BSS_MAP_MSG_LCLS_NOTIFICATION = 0x76, |
Holger Hans Peter Freyther | ebaed74 | 2010-04-15 03:14:51 +0200 | [diff] [blame] | 159 | }; |
| 160 | |
Neels Hofmeyr | 86a5aae | 2019-01-04 01:29:55 +0100 | [diff] [blame] | 161 | #define BSS_MAP_MSG_ASSIGMENT_RQST BSS_MAP_MSG_ASSIGNMENT_RQST |
| 162 | #define BSS_MAP_MSG_ASSIGMENT_COMPLETE BSS_MAP_MSG_ASSIGNMENT_COMPLETE |
| 163 | #define BSS_MAP_MSG_ASSIGMENT_FAILURE BSS_MAP_MSG_ASSIGNMENT_FAILURE |
| 164 | |
Holger Hans Peter Freyther | ebaed74 | 2010-04-15 03:14:51 +0200 | [diff] [blame] | 165 | enum GSM0808_IE_CODING { |
| 166 | GSM0808_IE_CIRCUIT_IDENTITY_CODE = 1, |
| 167 | GSM0808_IE_RESERVED_0 = 2, |
| 168 | GSM0808_IE_RESOURCE_AVAILABLE = 3, |
| 169 | GSM0808_IE_CAUSE = 4, |
| 170 | GSM0808_IE_CELL_IDENTIFIER = 5, |
| 171 | GSM0808_IE_PRIORITY = 6, |
| 172 | GSM0808_IE_LAYER_3_HEADER_INFORMATION = 7, |
| 173 | GSM0808_IE_IMSI = 8, |
| 174 | GSM0808_IE_TMSI = 9, |
| 175 | GSM0808_IE_ENCRYPTION_INFORMATION = 10, |
| 176 | GSM0808_IE_CHANNEL_TYPE = 11, |
| 177 | GSM0808_IE_PERIODICITY = 12, |
| 178 | GSM0808_IE_EXTENDED_RESOURCE_INDICATOR = 13, |
| 179 | GSM0808_IE_NUMBER_OF_MSS = 14, |
| 180 | GSM0808_IE_RESERVED_1 = 15, |
| 181 | GSM0808_IE_RESERVED_2 = 16, |
| 182 | GSM0808_IE_RESERVED_3 = 17, |
| 183 | GSM0808_IE_CLASSMARK_INFORMATION_T2 = 18, |
| 184 | GSM0808_IE_CLASSMARK_INFORMATION_T3 = 19, |
| 185 | GSM0808_IE_INTERFERENCE_BAND_TO_USE = 20, |
| 186 | GSM0808_IE_RR_CAUSE = 21, |
| 187 | GSM0808_IE_RESERVED_4 = 22, |
| 188 | GSM0808_IE_LAYER_3_INFORMATION = 23, |
| 189 | GSM0808_IE_DLCI = 24, |
| 190 | GSM0808_IE_DOWNLINK_DTX_FLAG = 25, |
| 191 | GSM0808_IE_CELL_IDENTIFIER_LIST = 26, |
| 192 | GSM0808_IE_RESPONSE_RQST = 27, |
| 193 | GSM0808_IE_RESOURCE_INDICATION_METHOD = 28, |
| 194 | GSM0808_IE_CLASSMARK_INFORMATION_TYPE_1 = 29, |
| 195 | GSM0808_IE_CIRCUIT_IDENTITY_CODE_LIST = 30, |
| 196 | GSM0808_IE_DIAGNOSTIC = 31, |
| 197 | GSM0808_IE_LAYER_3_MESSAGE_CONTENTS = 32, |
| 198 | GSM0808_IE_CHOSEN_CHANNEL = 33, |
| 199 | GSM0808_IE_TOTAL_RESOURCE_ACCESSIBLE = 34, |
| 200 | GSM0808_IE_CIPHER_RESPONSE_MODE = 35, |
| 201 | GSM0808_IE_CHANNEL_NEEDED = 36, |
| 202 | GSM0808_IE_TRACE_TYPE = 37, |
| 203 | GSM0808_IE_TRIGGERID = 38, |
| 204 | GSM0808_IE_TRACE_REFERENCE = 39, |
| 205 | GSM0808_IE_TRANSACTIONID = 40, |
| 206 | GSM0808_IE_MOBILE_IDENTITY = 41, |
| 207 | GSM0808_IE_OMCID = 42, |
| 208 | GSM0808_IE_FORWARD_INDICATOR = 43, |
| 209 | GSM0808_IE_CHOSEN_ENCR_ALG = 44, |
| 210 | GSM0808_IE_CIRCUIT_POOL = 45, |
| 211 | GSM0808_IE_CIRCUIT_POOL_LIST = 46, |
| 212 | GSM0808_IE_TIME_INDICATION = 47, |
| 213 | GSM0808_IE_RESOURCE_SITUATION = 48, |
| 214 | GSM0808_IE_CURRENT_CHANNEL_TYPE_1 = 49, |
| 215 | GSM0808_IE_QUEUEING_INDICATOR = 50, |
| 216 | GSM0808_IE_SPEECH_VERSION = 64, |
| 217 | GSM0808_IE_ASSIGNMENT_REQUIREMENT = 51, |
| 218 | GSM0808_IE_TALKER_FLAG = 53, |
| 219 | GSM0808_IE_CONNECTION_RELEASE_RQSTED = 54, |
| 220 | GSM0808_IE_GROUP_CALL_REFERENCE = 55, |
| 221 | GSM0808_IE_EMLPP_PRIORITY = 56, |
| 222 | GSM0808_IE_CONFIG_EVO_INDI = 57, |
| 223 | GSM0808_IE_OLD_BSS_TO_NEW_BSS_INFORMATION = 58, |
| 224 | GSM0808_IE_LSA_IDENTIFIER = 59, |
| 225 | GSM0808_IE_LSA_IDENTIFIER_LIST = 60, |
| 226 | GSM0808_IE_LSA_INFORMATION = 61, |
| 227 | GSM0808_IE_LCS_QOS = 62, |
| 228 | GSM0808_IE_LSA_ACCESS_CTRL_SUPPR = 63, |
| 229 | GSM0808_IE_LCS_PRIORITY = 67, |
| 230 | GSM0808_IE_LOCATION_TYPE = 68, |
| 231 | GSM0808_IE_LOCATION_ESTIMATE = 69, |
| 232 | GSM0808_IE_POSITIONING_DATA = 70, |
| 233 | GSM0808_IE_LCS_CAUSE = 71, |
| 234 | GSM0808_IE_LCS_CLIENT_TYPE = 72, |
| 235 | GSM0808_IE_APDU = 73, |
| 236 | GSM0808_IE_NETWORK_ELEMENT_IDENTITY = 74, |
| 237 | GSM0808_IE_GPS_ASSISTANCE_DATA = 75, |
| 238 | GSM0808_IE_DECIPHERING_KEYS = 76, |
| 239 | GSM0808_IE_RETURN_ERROR_RQST = 77, |
| 240 | GSM0808_IE_RETURN_ERROR_CAUSE = 78, |
| 241 | GSM0808_IE_SEGMENTATION = 79, |
| 242 | GSM0808_IE_SERVICE_HANDOVER = 80, |
| 243 | GSM0808_IE_SOURCE_RNC_TO_TARGET_RNC_TRANSPARENT_UMTS = 81, |
| 244 | GSM0808_IE_SOURCE_RNC_TO_TARGET_RNC_TRANSPARENT_CDMA2000= 82, |
| 245 | GSM0808_IE_RESERVED_5 = 65, |
| 246 | GSM0808_IE_RESERVED_6 = 66, |
Harald Welte | c8585cf | 2014-06-21 22:28:12 +0200 | [diff] [blame] | 247 | GSM0808_IE_GERAN_CLASSMARK = 0x53, |
| 248 | GSM0808_IE_GERAN_BSC_CONTAINER = 0x54, |
| 249 | GSM0808_IE_NEW_BSS_TO_OLD_BSS_INFO = 0x61, |
| 250 | GSM0800_IE_INTER_SYSTEM_INFO = 0x63, |
| 251 | GSM0808_IE_SNA_ACCESS_INFO = 0x64, |
| 252 | GSM0808_IE_VSTK_RAND_INFO = 0x65, |
| 253 | GSM0808_IE_VSTK_INFO = 0x66, |
| 254 | GSM0808_IE_PAGING_INFO = 0x67, |
| 255 | GSM0808_IE_IMEI = 0x68, |
| 256 | GSM0808_IE_VELOCITY_ESTIMATE = 0x55, |
| 257 | GSM0808_IE_VGCS_FEATURE_FLAGS = 0x69, |
| 258 | GSM0808_IE_TALKER_PRIORITY = 0x6a, |
| 259 | GSM0808_IE_EMERGENCY_SET_INDICATION = 0x6b, |
| 260 | GSM0808_IE_TALKER_IDENTITY = 0x6c, |
| 261 | GSM0808_IE_CELL_ID_LIST_SEGMENT = 0x6d, |
Harald Welte | 92107df | 2014-06-21 23:16:20 +0200 | [diff] [blame] | 262 | GSM0808_IE_SMS_TO_VGCS = 0x6e, |
Harald Welte | c8585cf | 2014-06-21 22:28:12 +0200 | [diff] [blame] | 263 | GSM0808_IE_VGCS_TALKER_MODE = 0x6f, |
| 264 | GSM0808_IE_VGCS_VBS_CELL_STATUS = 0x70, |
| 265 | GSM0808_IE_CELL_ID_LIST_SEG_EST_CELLS = 0x71, |
| 266 | GSM0808_IE_CELL_ID_LIST_SEG_CELLS_TBE = 0x72, |
| 267 | GSM0808_IE_CELL_ID_LIST_SEG_REL_CELLS = 0x73, |
| 268 | GSM0808_IE_CELL_ID_LIST_SEG_NE_CELLS = 0x74, |
| 269 | GSM0808_IE_GANSS_ASSISTANCE_DATA = 0x75, |
| 270 | GSM0808_IE_GANSS_POSITIONING_DATA = 0x76, |
| 271 | GSM0808_IE_GANSS_LOCATION_TYPE = 0x77, |
| 272 | GSM0808_IE_APP_DATA = 0x78, |
| 273 | GSM0808_IE_DATA_IDENTITY = 0x79, |
| 274 | GSM0808_IE_APP_DATA_INFO = 0x7a, |
| 275 | GSM0808_IE_MSISDN = 0x7b, |
| 276 | GSM0808_IE_AOIP_TRASP_ADDR = 0x7c, |
| 277 | GSM0808_IE_SPEECH_CODEC_LIST = 0x7d, |
| 278 | GSM0808_IE_SPEECH_CODEC = 0x7e, |
| 279 | GSM0808_IE_CALL_ID = 0x7f, |
| 280 | GSM0808_IE_CALL_ID_LIST = 0x80, |
| 281 | GSM0808_IE_A_IF_SEL_FOR_RESET = 0x81, |
| 282 | GSM0808_IE_KC_128 = 0x83, |
| 283 | GSM0808_IE_CSG_IDENTIFIER = 0x84, |
| 284 | GSM0808_IE_REDIR_ATTEMPT_FLAG = 0x85, |
| 285 | GSM0808_IE_REROUTE_REJ_CAUSE = 0x86, |
| 286 | GSM0808_IE_SEND_SEQ_NUM = 0x87, |
| 287 | GSM0808_IE_REROUTE_COMPL_OUTCOME = 0x88, |
| 288 | GSM0808_IE_GLOBAL_CALL_REF = 0x89, |
| 289 | GSM0808_IE_LCLS_CONFIG = 0x8a, |
| 290 | GSM0808_IE_LCLS_CONN_STATUS_CTRL = 0x8b, |
Harald Welte | 92107df | 2014-06-21 23:16:20 +0200 | [diff] [blame] | 291 | GSM0808_IE_LCLS_CORR_NOT_NEEDED = 0x8c, |
Harald Welte | c8585cf | 2014-06-21 22:28:12 +0200 | [diff] [blame] | 292 | GSM0808_IE_LCLS_BSS_STATUS = 0x8d, |
| 293 | GSM0808_IE_LCLS_BREAK_REQ = 0x8e, |
| 294 | GSM0808_IE_CSFB_INDICATION = 0x8f, |
| 295 | GSM0808_IE_CS_TO_PS_SRVCC = 0x90, |
| 296 | GSM0808_IE_SRC_ENB_TO_TGT_ENB_TRANSP = 0x91, |
| 297 | GSM0808_IE_CS_TO_PS_SRVCC_IND = 0x92, |
| 298 | GSM0808_IE_CN_TO_MS_TRANSP_INFO = 0x93, |
| 299 | GSM0808_IE_SELECTED_PLMN_ID = 0x94, |
| 300 | GSM0808_IE_LAST_USED_EUTRAN_PLMN_ID = 0x95, |
Holger Hans Peter Freyther | ebaed74 | 2010-04-15 03:14:51 +0200 | [diff] [blame] | 301 | }; |
| 302 | |
Neels Hofmeyr | 70aba3f | 2018-03-13 03:40:53 +0100 | [diff] [blame] | 303 | /* 3GPP TS 48.008 3.2.3 Signalling Field Element Coding */ |
| 304 | enum GSM0808_SIGNALLING_FIELD_ELEMENT_CODING { |
| 305 | GSM0808_FE_IE_EXTRA_INFORMATION = 0x01, /*< 3.2.3.1 */ |
| 306 | GSM0808_FE_IE_CURRENT_CHANNEL_TYPE_2 = 0x02, /*< 3.2.3.2 */ |
| 307 | GSM0808_FE_IE_TARGET_CELL_RADIO_INFORMATION = 0x03, /*< 3.2.3.3 */ |
| 308 | GSM0808_FE_IE_GPRS_SUSPEND_INFORMATION = 0x04, /*< 3.2.3.4 */ |
| 309 | GSM0808_FE_IE_MULTIRATE_CONFIGURATION_INFORMATION = 0x05, /*< 3.2.3.5 */ |
| 310 | GSM0808_FE_IE_DUAL_TRANSFER_MODE_INFORMATION = 0x06, /*< 3.2.3.6 */ |
| 311 | GSM0808_FE_IE_INTER_RAT_HANDOVER_INFO = 0x07, /*< 3.2.3.7 */ |
| 312 | GSM0808_FE_IE_CDMA2000_CAPABILITY_INFORMATION = 0x08, /*< 3.2.3.8 */ |
| 313 | GSM0808_FE_IE_DOWNLINK_CELL_LOAD_INFORMATION = 0x09, /*< 3.2.3.9 */ |
| 314 | GSM0808_FE_IE_UPLINK_CELL_LOAD_INFORMATION = 0x0a, /*< 3.2.3.10 */ |
| 315 | GSM0808_FE_IE_CELL_LOAD_INFORMATION_GROUP = 0x0b, /*< 3.2.3.11 */ |
| 316 | GSM0808_FE_IE_CELL_LOAD_INFORMATION = 0x0c, /*< 3.2.3.12 */ |
| 317 | GSM0808_FE_IE_PS_INDICATION = 0x0d, /*< 3.2.3.13 */ |
| 318 | GSM0808_FE_IE_DTM_HANDOVER_COMMAND_INDICATION = 0x0e, /*< 3.2.3.14 */ |
| 319 | GSM0808_FE_IE_D_RNTI = 0xfe, /*< 3.2.3.15 */ |
| 320 | GSM0808_FE_IE_IRAT_MEASUREMENT_CONFIGURATION = 0x0f, /*< 3.2.3.16 */ |
| 321 | GSM0808_FE_IE_SOURCE_CELL_ID = 0x10, /*< 3.2.3.17 */ |
| 322 | GSM0808_FE_IE_IRAT_MEASUREMENT_CONFIGURATION_EXTENDED_E_ARFCNS = 0x11, /*< 3.2.3.18 */ |
| 323 | }; |
| 324 | |
Neels Hofmeyr | 6ad50aa | 2019-01-14 20:28:56 +0100 | [diff] [blame] | 325 | /* 3GPP TS 48.008 3.2.2.5 Cause */ |
Holger Hans Peter Freyther | ebaed74 | 2010-04-15 03:14:51 +0200 | [diff] [blame] | 326 | enum gsm0808_cause { |
| 327 | GSM0808_CAUSE_RADIO_INTERFACE_MESSAGE_FAILURE = 0, |
| 328 | GSM0808_CAUSE_RADIO_INTERFACE_FAILURE = 1, |
| 329 | GSM0808_CAUSE_UPLINK_QUALITY = 2, |
| 330 | GSM0808_CAUSE_UPLINK_STRENGTH = 3, |
| 331 | GSM0808_CAUSE_DOWNLINK_QUALITY = 4, |
| 332 | GSM0808_CAUSE_DOWNLINK_STRENGTH = 5, |
| 333 | GSM0808_CAUSE_DISTANCE = 6, |
| 334 | GSM0808_CAUSE_O_AND_M_INTERVENTION = 7, |
| 335 | GSM0808_CAUSE_RESPONSE_TO_MSC_INVOCATION = 8, |
| 336 | GSM0808_CAUSE_CALL_CONTROL = 9, |
| 337 | GSM0808_CAUSE_RADIO_INTERFACE_FAILURE_REVERSION = 10, |
| 338 | GSM0808_CAUSE_HANDOVER_SUCCESSFUL = 11, |
| 339 | GSM0808_CAUSE_BETTER_CELL = 12, |
| 340 | GSM0808_CAUSE_DIRECTED_RETRY = 13, |
| 341 | GSM0808_CAUSE_JOINED_GROUP_CALL_CHANNEL = 14, |
| 342 | GSM0808_CAUSE_TRAFFIC = 15, |
Harald Welte | c8585cf | 2014-06-21 22:28:12 +0200 | [diff] [blame] | 343 | GSM0808_CAUSE_REDUCE_LOAD_IN_SERVING_CELL = 0x10, |
| 344 | GSM0808_CAUSE_TRAFFIC_LOAD_IN_TGT_HIGHER_THAN_IN_SRC_CELL = 0x11, |
| 345 | GSM0808_CAUSE_RELOCATION_TRIGGERED = 0x12, |
Thorsten Alteholz | 0062a5f | 2018-05-15 15:28:55 +0200 | [diff] [blame] | 346 | GSM0808_CAUSE_REQUESTED_OPT_NOT_AUTHORISED = 0x14, |
Harald Welte | c8585cf | 2014-06-21 22:28:12 +0200 | [diff] [blame] | 347 | GSM0808_CAUSE_ALT_CHAN_CONFIG_REQUESTED = 0x15, |
| 348 | GSM0808_CAUSE_RESP_TO_INT_HO_ENQ_MSG = 0x16, |
| 349 | GSM0808_CAUSE_INT_HO_ENQUIRY_REJECT = 0x17, |
| 350 | GSM0808_CAUSE_REDUNDANCY_LEVEL_NOT_ADEQUATE = 0x18, |
Holger Hans Peter Freyther | ebaed74 | 2010-04-15 03:14:51 +0200 | [diff] [blame] | 351 | GSM0808_CAUSE_EQUIPMENT_FAILURE = 32, |
| 352 | GSM0808_CAUSE_NO_RADIO_RESOURCE_AVAILABLE = 33, |
| 353 | GSM0808_CAUSE_RQSTED_TERRESTRIAL_RESOURCE_UNAVAILABLE = 34, |
| 354 | GSM0808_CAUSE_CCCH_OVERLOAD = 35, |
| 355 | GSM0808_CAUSE_PROCESSOR_OVERLOAD = 36, |
| 356 | GSM0808_CAUSE_BSS_NOT_EQUIPPED = 37, |
| 357 | GSM0808_CAUSE_MS_NOT_EQUIPPED = 38, |
| 358 | GSM0808_CAUSE_INVALID_CELL = 39, |
| 359 | GSM0808_CAUSE_TRAFFIC_LOAD = 40, |
| 360 | GSM0808_CAUSE_PREEMPTION = 41, |
Harald Welte | c8585cf | 2014-06-21 22:28:12 +0200 | [diff] [blame] | 361 | GSM0808_CAUSE_DTM_HO_SGSN_FAILURE = 0x2a, |
| 362 | GSM0808_CAUSE_DTM_HO_PS_ALLOC_FAILURE = 0x2b, |
Holger Hans Peter Freyther | ebaed74 | 2010-04-15 03:14:51 +0200 | [diff] [blame] | 363 | GSM0808_CAUSE_RQSTED_TRANSCODING_RATE_ADAPTION_UNAVAILABLE = 48, |
| 364 | GSM0808_CAUSE_CIRCUIT_POOL_MISMATCH = 49, |
| 365 | GSM0808_CAUSE_SWITCH_CIRCUIT_POOL = 50, |
| 366 | GSM0808_CAUSE_RQSTED_SPEECH_VERSION_UNAVAILABLE = 51, |
| 367 | GSM0808_CAUSE_LSA_NOT_ALLOWED = 52, |
Harald Welte | c8585cf | 2014-06-21 22:28:12 +0200 | [diff] [blame] | 368 | GSM0808_CAUSE_REQ_CODEC_TYPE_OR_CONFIG_UNAVAIL = 0x35, |
| 369 | GSM0808_CAUSE_REQ_A_IF_TYPE_UNAVAIL = 0x36, |
| 370 | GSM0808_CAUSE_INVALID_CSG_CELL = 0x37, |
| 371 | GSM0808_CAUSE_REQ_REDUND_LEVEL_NOT_AVAIL = 0x3f, |
Holger Hans Peter Freyther | ebaed74 | 2010-04-15 03:14:51 +0200 | [diff] [blame] | 372 | GSM0808_CAUSE_CIPHERING_ALGORITHM_NOT_SUPPORTED = 64, |
Harald Welte | c8585cf | 2014-06-21 22:28:12 +0200 | [diff] [blame] | 373 | GSM0808_CAUSE_GERAN_IU_MODE_FAILURE = 0x41, |
| 374 | GSM0808_CAUSE_INC_RELOC_NOT_SUPP_DT_PUESBINE_FEATURE = 0x42, |
| 375 | GSM0808_CAUSE_ACCESS_RESTRICTED_DUE_TO_SHARED_NETWORKS = 0x43, |
| 376 | GSM0808_CAUSE_REQ_CODEC_TYPE_OR_CONFIG_NOT_SUPP = 0x44, |
| 377 | GSM0808_CAUSE_REQ_A_IF_TYPE_NOT_SUPP = 0x45, |
| 378 | GSM0808_CAUSE_REQ_REDUND_LVL_NOT_SUPP = 0x46, |
Holger Hans Peter Freyther | ebaed74 | 2010-04-15 03:14:51 +0200 | [diff] [blame] | 379 | GSM0808_CAUSE_TERRESTRIAL_CIRCUIT_ALREADY_ALLOCATED = 80, |
| 380 | GSM0808_CAUSE_INVALID_MESSAGE_CONTENTS = 81, |
| 381 | GSM0808_CAUSE_INFORMATION_ELEMENT_OR_FIELD_MISSING = 82, |
| 382 | GSM0808_CAUSE_INCORRECT_VALUE = 83, |
| 383 | GSM0808_CAUSE_UNKNOWN_MESSAGE_TYPE = 84, |
| 384 | GSM0808_CAUSE_UNKNOWN_INFORMATION_ELEMENT = 85, |
Harald Welte | c8585cf | 2014-06-21 22:28:12 +0200 | [diff] [blame] | 385 | GSM0808_CAUSE_DTM_HO_INVALID_PS_IND = 0x56, |
| 386 | GSM0808_CAUSE_CALL_ID_ALREADY_ALLOC = 0x57, |
Holger Hans Peter Freyther | ebaed74 | 2010-04-15 03:14:51 +0200 | [diff] [blame] | 387 | GSM0808_CAUSE_PROTOCOL_ERROR_BETWEEN_BSS_AND_MSC = 96, |
Thorsten Alteholz | 0062a5f | 2018-05-15 15:28:55 +0200 | [diff] [blame] | 388 | GSM0808_CAUSE_VGCS_VBS_CALL_NON_EXISTENT = 0x61, |
Harald Welte | c8585cf | 2014-06-21 22:28:12 +0200 | [diff] [blame] | 389 | GSM0808_CAUSE_DTM_HO_TIMER_EXPIRY = 0x62, |
Holger Hans Peter Freyther | ebaed74 | 2010-04-15 03:14:51 +0200 | [diff] [blame] | 390 | }; |
| 391 | |
Max | aa93463 | 2018-11-07 13:16:54 +0100 | [diff] [blame] | 392 | /* 3GPP TS 08.08 §3.2.2.5 Cause Class */ |
| 393 | enum gsm0808_cause_class { |
| 394 | GSM0808_CAUSE_CLASS_NORM0 = 0, |
| 395 | GSM0808_CAUSE_CLASS_NORM1 = 1, |
| 396 | GSM0808_CAUSE_CLASS_RES_UNAVAIL = 2, |
| 397 | GSM0808_CAUSE_CLASS_SRV_OPT_NA = 3, |
| 398 | GSM0808_CAUSE_CLASS_SRV_OPT_NIMPL = 4, |
| 399 | GSM0808_CAUSE_CLASS_INVAL = 5, |
| 400 | GSM0808_CAUSE_CLASS_PERR = 6, |
| 401 | GSM0808_CAUSE_CLASS_INTW = 7, |
| 402 | }; |
| 403 | |
Holger Hans Peter Freyther | ebaed74 | 2010-04-15 03:14:51 +0200 | [diff] [blame] | 404 | /* GSM 08.08 3.2.2.11 Channel Type */ |
| 405 | enum gsm0808_chan_indicator { |
| 406 | GSM0808_CHAN_SPEECH = 1, |
| 407 | GSM0808_CHAN_DATA = 2, |
| 408 | GSM0808_CHAN_SIGN = 3, |
| 409 | }; |
| 410 | |
Harald Welte | c8585cf | 2014-06-21 22:28:12 +0200 | [diff] [blame] | 411 | /* GSM 08.08 3.2.2.11 Channel Type */ |
Holger Hans Peter Freyther | ebaed74 | 2010-04-15 03:14:51 +0200 | [diff] [blame] | 412 | enum gsm0808_chan_rate_type_data { |
| 413 | GSM0808_DATA_FULL_BM = 0x8, |
| 414 | GSM0808_DATA_HALF_LM = 0x9, |
| 415 | GSM0808_DATA_FULL_RPREF = 0xa, |
| 416 | GSM0808_DATA_HALF_PREF = 0xb, |
| 417 | GSM0808_DATA_FULL_PREF_NO_CHANGE = 0x1a, |
| 418 | GSM0808_DATA_HALF_PREF_NO_CHANGE = 0x1b, |
| 419 | GSM0808_DATA_MULTI_MASK = 0x20, |
| 420 | GSM0808_DATA_MULTI_MASK_NO_CHANGE = 0x30, |
| 421 | }; |
| 422 | |
Harald Welte | c8585cf | 2014-06-21 22:28:12 +0200 | [diff] [blame] | 423 | /* GSM 08.08 3.2.2.11 Channel Type */ |
Holger Hans Peter Freyther | ebaed74 | 2010-04-15 03:14:51 +0200 | [diff] [blame] | 424 | enum gsm0808_chan_rate_type_speech { |
| 425 | GSM0808_SPEECH_FULL_BM = 0x8, |
| 426 | GSM0808_SPEECH_HALF_LM = 0x9, |
| 427 | GSM0808_SPEECH_FULL_PREF= 0xa, |
| 428 | GSM0808_SPEECH_HALF_PREF= 0xb, |
| 429 | GSM0808_SPEECH_FULL_PREF_NO_CHANGE = 0x1a, |
| 430 | GSM0808_SPEECH_HALF_PREF_NO_CHANGE = 0x1b, |
| 431 | GSM0808_SPEECH_PERM = 0xf, |
| 432 | GSM0808_SPEECH_PERM_NO_CHANGE = 0x1f, |
| 433 | }; |
| 434 | |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 435 | /*! GSM 08.08 3.2.2.11 Channel Type |
Philipp Maier | 890f1f5 | 2017-06-16 16:59:06 +0200 | [diff] [blame] | 436 | * (see also 3GPP TS 48.008, section 3.2.2.11) */ |
Holger Hans Peter Freyther | ebaed74 | 2010-04-15 03:14:51 +0200 | [diff] [blame] | 437 | enum gsm0808_permitted_speech { |
Philipp Maier | 890f1f5 | 2017-06-16 16:59:06 +0200 | [diff] [blame] | 438 | GSM0808_PERM_FR1 = 0x01, /*!< GSM FR */ |
| 439 | GSM0808_PERM_FR2 = 0x11, /*!< GSM EFR */ |
| 440 | GSM0808_PERM_FR3 = 0x21, /*!< FR AMR */ |
Philipp Maier | da38203 | 2017-06-01 12:11:56 +0200 | [diff] [blame] | 441 | GSM0808_PERM_FR4 = 0x41, /*!< OFR AMR-WB */ |
| 442 | GSM0808_PERM_FR5 = 0x42, /*!< FR AMR-WB */ |
Philipp Maier | 890f1f5 | 2017-06-16 16:59:06 +0200 | [diff] [blame] | 443 | GSM0808_PERM_HR1 = GSM0808_PERM_FR1 | 0x4, /*!< GSM HR */ |
| 444 | GSM0808_PERM_HR2 = GSM0808_PERM_FR2 | 0x4, /*!< (deprecated) */ |
| 445 | GSM0808_PERM_HR3 = GSM0808_PERM_FR3 | 0x4, /*!< HR AMR */ |
Philipp Maier | da38203 | 2017-06-01 12:11:56 +0200 | [diff] [blame] | 446 | GSM0808_PERM_HR4 = 0x46, /*!< OHR AMR-WB */ |
| 447 | GSM0808_PERM_HR6 = 0x45, /*!< OHR AMR */ |
| 448 | }; |
| 449 | |
Philipp Maier | cdd0581 | 2018-07-12 18:21:07 +0200 | [diff] [blame] | 450 | extern const struct value_string gsm0808_permitted_speech_names[]; |
| 451 | static inline const char *gsm0808_permitted_speech_name(enum gsm0808_permitted_speech val) |
| 452 | { return get_value_string(gsm0808_permitted_speech_names, val); } |
| 453 | |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 454 | /*! 3GPP TS 48.008, 3.2.2.103 Speech Codec Type */ |
Philipp Maier | da38203 | 2017-06-01 12:11:56 +0200 | [diff] [blame] | 455 | enum gsm0808_speech_codec_type { |
| 456 | GSM0808_SCT_FR1 = 0x0, /*!< GSM FR */ |
| 457 | GSM0808_SCT_FR2 = 0x2, /*!< GSM EFR */ |
| 458 | GSM0808_SCT_FR3 = 0x3, /*!< FR AMR */ |
| 459 | GSM0808_SCT_FR4 = 0xc, /*!< OFR AMR-WB */ |
| 460 | GSM0808_SCT_FR5 = 0x9, /*!< FR AMR-WB */ |
| 461 | GSM0808_SCT_HR1 = 0x1, /*!< GSM_HR */ |
| 462 | GSM0808_SCT_HR3 = 0x4, /*!< HR_AMR */ |
| 463 | GSM0808_SCT_HR4 = 0xd, /*!< OHR AMR-WB */ |
| 464 | GSM0808_SCT_HR6 = 0xb, /*!< OHR AMR */ |
| 465 | GSM0808_SCT_CSD = 0xfd, /*!< CSData (see also TS 26.103) */ |
Holger Hans Peter Freyther | ebaed74 | 2010-04-15 03:14:51 +0200 | [diff] [blame] | 466 | }; |
Harald Welte | c8585cf | 2014-06-21 22:28:12 +0200 | [diff] [blame] | 467 | |
Neels Hofmeyr | ffad574 | 2018-01-12 05:34:03 +0100 | [diff] [blame] | 468 | extern const struct value_string gsm0808_speech_codec_type_names[]; |
| 469 | static inline const char *gsm0808_speech_codec_type_name(enum gsm0808_speech_codec_type val) |
| 470 | { return get_value_string(gsm0808_speech_codec_type_names, val); } |
| 471 | |
Harald Welte | c8585cf | 2014-06-21 22:28:12 +0200 | [diff] [blame] | 472 | /* GSM 08.08 3.2.2.44 Chosen Encryption Algorithm */ |
| 473 | enum gsm0808_chosen_enc_alg { |
| 474 | GSM0808_ALG_ID_A5_0 = 0x01, |
| 475 | GSM0808_ALG_ID_A5_1 = 0x02, |
| 476 | GSM0808_ALG_ID_A5_2 = 0x03, |
| 477 | GSM0808_ALG_ID_A5_3 = 0x04, |
| 478 | GSM0808_ALG_ID_A5_4 = 0x05, |
| 479 | GSM0808_ALG_ID_A5_5 = 0x06, |
| 480 | GSM0808_ALG_ID_A5_6 = 0x07, |
| 481 | GSM0808_ALG_ID_A5_7 = 0x08, |
| 482 | }; |
Pau Espin Pedrol | f2cda62 | 2018-07-06 17:16:41 +0200 | [diff] [blame] | 483 | extern const struct value_string gsm0808_chosen_enc_alg_names[]; |
Harald Welte | c8585cf | 2014-06-21 22:28:12 +0200 | [diff] [blame] | 484 | |
| 485 | /* GSM 08.08 3.2.2.85 Paging Information */ |
| 486 | enum gsm0808_paging_info { |
| 487 | GSM0808_PAGINF_FOR_MT_CALL = 0x00, |
| 488 | GSM0808_PAGINF_FOR_SMS = 0x01, |
| 489 | GSM0808_PAGINF_FOR_USSD = 0x02, |
| 490 | }; |
Philipp Maier | 6f725d6 | 2017-03-24 18:03:17 +0100 | [diff] [blame] | 491 | |
| 492 | /* 3GPP TS 48.008 3.2.2.104 Speech Codec */ |
| 493 | struct gsm0808_speech_codec { |
| 494 | bool fi; |
| 495 | bool pi; |
| 496 | bool pt; |
| 497 | bool tf; |
| 498 | uint8_t type; |
| 499 | uint16_t cfg; |
Philipp Maier | 6f725d6 | 2017-03-24 18:03:17 +0100 | [diff] [blame] | 500 | }; |
| 501 | |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 502 | /*! Default speech codec configurations: Some codecs specified with |
Philipp Maier | a9b9276 | 2017-06-02 11:25:28 +0200 | [diff] [blame] | 503 | * struct gsm0808_speech_codec, require a configuration (cfg). The following |
| 504 | * default configuration will configure the codec (RTP) to match the |
| 505 | * configuration that is used on the air interface (Um). |
| 506 | * |
| 507 | * Default values for FR_AMR, HR_AMR and OHR_AMR: |
Philipp Maier | 7e27b14 | 2018-03-22 17:26:46 +0100 | [diff] [blame] | 508 | * See also: 3GPP TS 28.062, Table 7.11.3.1.3-2: Preferred Configurations for |
| 509 | * the Adaptive Multi-Rate Codec Types and 3GPP TS 48.008, Section 3.2.2.103. |
Philipp Maier | a9b9276 | 2017-06-02 11:25:28 +0200 | [diff] [blame] | 510 | * |
| 511 | * Default values for FR_AMR_WB, OFR_AMR_WB and OHR_AMR_WB: |
| 512 | * See also: 3GPP TS 26.103, Table 5.7-1: Allowed Configurations |
| 513 | * for the Adaptive Multi-Rate - Wideband Codec Types */ |
| 514 | enum gsm0808_speech_codec_defaults { |
Philipp Maier | 7e27b14 | 2018-03-22 17:26:46 +0100 | [diff] [blame] | 515 | GSM0808_SC_CFG_DEFAULT_FR_AMR = 0x57ff, |
Philipp Maier | a9b9276 | 2017-06-02 11:25:28 +0200 | [diff] [blame] | 516 | GSM0808_SC_CFG_DEFAULT_HR_AMR = 0x073f, |
Philipp Maier | 7e27b14 | 2018-03-22 17:26:46 +0100 | [diff] [blame] | 517 | GSM0808_SC_CFG_DEFAULT_OHR_AMR = 0x57ff, |
Philipp Maier | a9b9276 | 2017-06-02 11:25:28 +0200 | [diff] [blame] | 518 | GSM0808_SC_CFG_DEFAULT_FR_AMR_WB = 0x01, |
Philipp Maier | 4b081b1 | 2018-09-13 15:01:55 +0200 | [diff] [blame] | 519 | GSM0808_SC_CFG_DEFAULT_OFR_AMR_WB = 0x15, |
Philipp Maier | a9b9276 | 2017-06-02 11:25:28 +0200 | [diff] [blame] | 520 | GSM0808_SC_CFG_DEFAULT_OHR_AMR_WB = 0x01, |
| 521 | }; |
| 522 | |
Philipp Maier | 5f2eb15 | 2018-09-19 13:40:21 +0200 | [diff] [blame] | 523 | /*! Default speech codec configurations broken down by reate. |
| 524 | * See also: 3GPP TS 28.062, Table 7.11.3.1.3-2: Preferred Configurations for |
| 525 | * the Adaptive Multi-Rate Codec Types. */ |
| 526 | enum gsm0808_speech_codec_rate_defaults { |
| 527 | GSM0808_SC_CFG_DEFAULT_AMR_4_75 = 0xff03, |
| 528 | GSM0808_SC_CFG_DEFAULT_AMR_5_15 = 0x0000, |
| 529 | GSM0808_SC_CFG_DEFAULT_AMR_5_90 = 0xff06, |
| 530 | GSM0808_SC_CFG_DEFAULT_AMR_6_70 = 0x3e08, |
| 531 | GSM0808_SC_CFG_DEFAULT_AMR_7_40 = 0x0c12, |
| 532 | GSM0808_SC_CFG_DEFAULT_AMR_7_95 = 0xc020, |
| 533 | GSM0808_SC_CFG_DEFAULT_AMR_10_2 = 0x3040, |
| 534 | GSM0808_SC_CFG_DEFAULT_AMR_12_2 = 0xc082 |
| 535 | }; |
| 536 | |
Philipp Maier | 6f725d6 | 2017-03-24 18:03:17 +0100 | [diff] [blame] | 537 | /* 3GPP TS 48.008 3.2.2.103 Speech Codec List */ |
| 538 | #define SPEECH_CODEC_MAXLEN 255 |
| 539 | struct gsm0808_speech_codec_list { |
| 540 | struct gsm0808_speech_codec codec[SPEECH_CODEC_MAXLEN]; |
| 541 | uint8_t len; |
| 542 | }; |
Philipp Maier | e0c6530 | 2017-03-28 17:05:40 +0200 | [diff] [blame] | 543 | |
| 544 | /* 3GPP TS 48.008 3.2.2.11 Channel Type */ |
| 545 | #define CH_TYPE_PERM_SPCH_MAXLEN 9 |
| 546 | struct gsm0808_channel_type { |
| 547 | uint8_t ch_indctr; |
| 548 | uint8_t ch_rate_type; |
| 549 | uint8_t perm_spch[CH_TYPE_PERM_SPCH_MAXLEN]; |
| 550 | unsigned int perm_spch_len; |
| 551 | }; |
Philipp Maier | 14e76b9 | 2017-03-28 18:36:52 +0200 | [diff] [blame] | 552 | |
| 553 | /* 3GPP TS 48.008 3.2.2.10 Encryption Information */ |
| 554 | #define ENCRY_INFO_KEY_MAXLEN 252 |
| 555 | #define ENCRY_INFO_PERM_ALGO_MAXLEN 8 |
| 556 | struct gsm0808_encrypt_info { |
| 557 | uint8_t perm_algo[ENCRY_INFO_PERM_ALGO_MAXLEN]; |
| 558 | unsigned int perm_algo_len; |
| 559 | uint8_t key[ENCRY_INFO_KEY_MAXLEN]; |
| 560 | unsigned int key_len; |
| 561 | }; |
Philipp Maier | 783047e | 2017-03-29 11:35:50 +0200 | [diff] [blame] | 562 | |
Philipp Maier | 783047e | 2017-03-29 11:35:50 +0200 | [diff] [blame] | 563 | #define CELL_ID_LIST_LAC_MAXLEN 127 |
Stefan Sperling | 11a4d9d | 2018-02-15 18:28:04 +0100 | [diff] [blame] | 564 | /*! |
| 565 | * DEPRECATED: This definition of the cell identifier list is |
| 566 | * insufficient. It cannot support all types of cell identifiers. |
| 567 | * Use struct gsm0808_cell_id_list2 in gsm0808_utils.h instead. |
| 568 | * |
| 569 | * 3GPP TS 48.008 3.2.2.27 Cell Identifier List */ |
Philipp Maier | 783047e | 2017-03-29 11:35:50 +0200 | [diff] [blame] | 570 | struct gsm0808_cell_id_list { |
| 571 | uint8_t id_discr; |
| 572 | uint16_t id_list_lac[CELL_ID_LIST_LAC_MAXLEN]; |
| 573 | unsigned int id_list_len; |
| 574 | }; |
Harald Welte | 2f51684 | 2018-05-29 19:21:03 +0200 | [diff] [blame] | 575 | |
| 576 | /* TS 48.008 3.2.2.116 */ |
| 577 | enum gsm0808_lcls_config { |
| 578 | GSM0808_LCLS_CFG_BOTH_WAY = 0x00, |
| 579 | GSM0808_LCLS_CFG_BOTH_WAY_AND_BICAST_UL = 0x01, |
| 580 | GSM0808_LCLS_CFG_BOTH_WAY_AND_SEND_DL = 0x02, |
| 581 | GSM0808_LCLS_CFG_BOTH_WAY_AND_SEND_DL_BLOCK_LOCAL_DL = 0x03, |
| 582 | GSM0808_LCLS_CFG_BOTH_WAY_AND_BICAST_UL_SEND_DL = 0x04, |
| 583 | GSM0808_LCLS_CFG_BOTH_WAY_AND_BICAST_UL_SEND_DL_BLOCK_LOCAL_DL = 0x05, |
Max | 961db7c | 2018-11-08 11:40:23 +0100 | [diff] [blame] | 584 | GSM0808_LCLS_CFG_NA = 0xFF |
Harald Welte | 2f51684 | 2018-05-29 19:21:03 +0200 | [diff] [blame] | 585 | }; |
| 586 | |
| 587 | /* TS 48.008 3.2.2.117 */ |
| 588 | enum gsm0808_lcls_control { |
| 589 | GSM0808_LCLS_CSC_CONNECT = 0x00, |
| 590 | GSM0808_LCLS_CSC_DO_NOT_CONNECT = 0x01, |
| 591 | GSM0808_LCLS_CSC_RELEASE_LCLS = 0x02, |
| 592 | GSM0808_LCLS_CSC_BICAST_UL_AT_HANDOVER = 0x03, |
| 593 | GSM0808_LCLS_CSC_BICAST_UL_AND_RECV_DL_AT_HANDOVER = 0x04, |
Max | 961db7c | 2018-11-08 11:40:23 +0100 | [diff] [blame] | 594 | GSM0808_LCLS_CSC_NA = 0xFF |
Harald Welte | 2f51684 | 2018-05-29 19:21:03 +0200 | [diff] [blame] | 595 | }; |
| 596 | |
| 597 | /* TS 48.008 3.2.2.119 */ |
| 598 | enum gsm0808_lcls_status { |
| 599 | GSM0808_LCLS_STS_NOT_YET_LS = 0x00, |
| 600 | GSM0808_LCLS_STS_NOT_POSSIBLE_LS = 0x01, |
| 601 | GSM0808_LCLS_STS_NO_LONGER_LS = 0x02, |
| 602 | GSM0808_LCLS_STS_REQ_LCLS_NOT_SUPP = 0x03, |
| 603 | GSM0808_LCLS_STS_LOCALLY_SWITCHED = 0x04, |
Max | 961db7c | 2018-11-08 11:40:23 +0100 | [diff] [blame] | 604 | GSM0808_LCLS_STS_NA = 0xFF |
Harald Welte | 2f51684 | 2018-05-29 19:21:03 +0200 | [diff] [blame] | 605 | }; |