Harald Welte | 37b6165 | 2017-10-16 18:46:03 +0200 | [diff] [blame] | 1 | /*! \defgroup gsm0808 GSM 08.08 / 3GPP TS 48.008 A Interface |
| 2 | * @{ |
| 3 | * \file gsm0808.h */ |
Neels Hofmeyr | 17518fe | 2017-06-20 04:35:06 +0200 | [diff] [blame] | 4 | /* |
| 5 | * (C) 2009,2010 by Holger Hans Peter Freyther <zecke@selfish.org> |
Holger Hans Peter Freyther | 280cd51 | 2010-04-15 10:10:39 +0200 | [diff] [blame] | 6 | * (C) 2009,2010 by On-Waves |
| 7 | * All Rights Reserved |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify |
| 10 | * it under the terms of the GNU General Public License as published by |
| 11 | * the Free Software Foundation; either version 2 of the License, or |
| 12 | * (at your option) any later version. |
| 13 | * |
| 14 | * This program is distributed in the hope that it will be useful, |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | * GNU General Public License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU General Public License along |
| 20 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 21 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 22 | * |
| 23 | */ |
Sylvain Munaut | 12ba778 | 2014-06-16 10:13:40 +0200 | [diff] [blame] | 24 | #pragma once |
Holger Hans Peter Freyther | 280cd51 | 2010-04-15 10:10:39 +0200 | [diff] [blame] | 25 | |
| 26 | #include "tlv.h" |
Philipp Maier | fa896ab | 2017-03-27 16:55:32 +0200 | [diff] [blame] | 27 | #include <osmocom/gsm/protocol/gsm_08_08.h> |
Neels Hofmeyr | 70aba3f | 2018-03-13 03:40:53 +0100 | [diff] [blame] | 28 | #include <osmocom/gsm/gsm0808_utils.h> |
Neels Hofmeyr | c4fce14 | 2018-02-20 13:47:08 +0100 | [diff] [blame] | 29 | #include <osmocom/gsm/gsm23003.h> |
Neels Hofmeyr | f7e9c51 | 2019-03-06 04:25:38 +0100 | [diff] [blame] | 30 | #include <osmocom/gsm/protocol/gsm_23_003.h> |
Harald Welte | ebd362d | 2018-06-02 14:11:19 +0200 | [diff] [blame] | 31 | #include <osmocom/core/utils.h> |
Neels Hofmeyr | c4fce14 | 2018-02-20 13:47:08 +0100 | [diff] [blame] | 32 | |
Neels Hofmeyr | 99273c7 | 2019-02-22 04:48:56 +0100 | [diff] [blame] | 33 | #define BSSMAP_MSG_SIZE 1024 |
| 34 | #define BSSMAP_MSG_HEADROOM 512 |
Max | f69aa9c | 2018-11-29 23:32:06 +0100 | [diff] [blame] | 35 | |
Harald Welte | 20725b9 | 2017-05-15 12:50:04 +0200 | [diff] [blame] | 36 | struct sockaddr_storage; |
Holger Hans Peter Freyther | 280cd51 | 2010-04-15 10:10:39 +0200 | [diff] [blame] | 37 | |
| 38 | struct msgb; |
Stefan Sperling | 11a4d9d | 2018-02-15 18:28:04 +0100 | [diff] [blame] | 39 | struct gsm0808_cell_id_list2; |
Holger Hans Peter Freyther | 280cd51 | 2010-04-15 10:10:39 +0200 | [diff] [blame] | 40 | |
Philipp Maier | fa896ab | 2017-03-27 16:55:32 +0200 | [diff] [blame] | 41 | struct msgb *gsm0808_create_layer3(struct msgb *msg_l3, uint16_t nc, |
Neels Hofmeyr | bd6c8b5 | 2018-03-22 14:05:21 +0100 | [diff] [blame] | 42 | uint16_t cc, int lac, uint16_t _ci) |
| 43 | OSMO_DEPRECATED("Use gsm0808_create_layer3_2() instead, to not lose leading zeros in the MNC"); |
Philipp Maier | fa896ab | 2017-03-27 16:55:32 +0200 | [diff] [blame] | 44 | struct msgb *gsm0808_create_layer3_aoip(const struct msgb *msg_l3, uint16_t nc, |
| 45 | uint16_t cc, int lac, uint16_t _ci, |
Neels Hofmeyr | bd6c8b5 | 2018-03-22 14:05:21 +0100 | [diff] [blame] | 46 | const struct gsm0808_speech_codec_list *scl) |
| 47 | OSMO_DEPRECATED("Use gsm0808_create_layer3_2() instead, to not lose leading zeros in the MNC"); |
Neels Hofmeyr | c4fce14 | 2018-02-20 13:47:08 +0100 | [diff] [blame] | 48 | struct msgb *gsm0808_create_layer3_2(const struct msgb *msg_l3, const struct osmo_cell_global_id *cell, |
| 49 | const struct gsm0808_speech_codec_list *scl); |
Holger Hans Peter Freyther | 280cd51 | 2010-04-15 10:10:39 +0200 | [diff] [blame] | 50 | struct msgb *gsm0808_create_reset(void); |
Harald Welte | a62fe31 | 2013-06-19 15:14:37 +0200 | [diff] [blame] | 51 | struct msgb *gsm0808_create_reset_ack(void); |
Philipp Maier | 1a146c8 | 2018-10-30 09:36:49 +0100 | [diff] [blame] | 52 | struct msgb *gsm0808_create_clear_command(uint8_t cause); |
Philipp Maier | 74c4c4e | 2019-02-04 16:42:28 +0100 | [diff] [blame] | 53 | struct msgb *gsm0808_create_clear_command2(uint8_t cause, bool csfb_ind); |
Holger Hans Peter Freyther | 280cd51 | 2010-04-15 10:10:39 +0200 | [diff] [blame] | 54 | struct msgb *gsm0808_create_clear_complete(void); |
Philipp Maier | b478dd3 | 2017-03-29 15:50:05 +0200 | [diff] [blame] | 55 | struct msgb *gsm0808_create_cipher(const struct gsm0808_encrypt_info *ei, |
| 56 | const uint8_t *cipher_response_mode); |
Holger Hans Peter Freyther | 81716d5 | 2010-04-17 06:16:35 +0200 | [diff] [blame] | 57 | struct msgb *gsm0808_create_cipher_complete(struct msgb *layer3, uint8_t alg_id); |
Max | aa93463 | 2018-11-07 13:16:54 +0100 | [diff] [blame] | 58 | struct msgb *gsm0808_create_cipher_reject(enum gsm0808_cause cause); |
Max | ed651d2 | 2018-11-07 15:25:05 +0100 | [diff] [blame] | 59 | struct msgb *gsm0808_create_cipher_reject_ext(enum gsm0808_cause_class class, uint8_t ext); |
Neels Hofmeyr | 2c79d55 | 2018-09-13 05:36:32 +0200 | [diff] [blame] | 60 | struct msgb *gsm0808_create_classmark_request(); |
Harald Welte | 07b625d | 2012-01-23 10:02:58 +0100 | [diff] [blame] | 61 | struct msgb *gsm0808_create_classmark_update(const uint8_t *cm2, uint8_t cm2_len, |
| 62 | const uint8_t *cm3, uint8_t cm3_len); |
Holger Hans Peter Freyther | 280cd51 | 2010-04-15 10:10:39 +0200 | [diff] [blame] | 63 | struct msgb *gsm0808_create_sapi_reject(uint8_t link_id); |
Philipp Maier | c6144a2 | 2017-03-29 17:53:43 +0200 | [diff] [blame] | 64 | struct msgb *gsm0808_create_ass(const struct gsm0808_channel_type *ct, |
| 65 | const uint16_t *cic, |
| 66 | const struct sockaddr_storage *ss, |
| 67 | const struct gsm0808_speech_codec_list *scl, |
| 68 | const uint32_t *ci); |
Max | 5207432 | 2018-11-30 10:44:07 +0100 | [diff] [blame] | 69 | struct msgb *gsm0808_create_ass2(const struct gsm0808_channel_type *ct, |
| 70 | const uint16_t *cic, |
| 71 | const struct sockaddr_storage *ss, |
| 72 | const struct gsm0808_speech_codec_list *scl, |
| 73 | const uint32_t *ci, |
| 74 | const uint8_t *kc, const struct osmo_lcls *lcls); |
Philipp Maier | fa896ab | 2017-03-27 16:55:32 +0200 | [diff] [blame] | 75 | struct msgb *gsm0808_create_ass_compl(uint8_t rr_cause, uint8_t chosen_channel, |
| 76 | uint8_t encr_alg_id, uint8_t speech_mode, |
| 77 | const struct sockaddr_storage *ss, |
| 78 | const struct gsm0808_speech_codec *sc, |
| 79 | const struct gsm0808_speech_codec_list |
| 80 | *scl); |
Max | 414c8f5 | 2019-01-08 14:44:24 +0100 | [diff] [blame] | 81 | struct msgb *gsm0808_create_ass_compl2(uint8_t rr_cause, uint8_t chosen_channel, |
| 82 | uint8_t encr_alg_id, uint8_t speech_mode, |
| 83 | const struct sockaddr_storage *ss, |
| 84 | const struct gsm0808_speech_codec *sc, |
| 85 | const struct gsm0808_speech_codec_list *scl, |
| 86 | enum gsm0808_lcls_status lcls_bss_status); |
Holger Hans Peter Freyther | b60a4b3 | 2010-07-23 18:35:59 +0800 | [diff] [blame] | 87 | struct msgb *gsm0808_create_assignment_completed(uint8_t rr_cause, |
Philipp Maier | fa896ab | 2017-03-27 16:55:32 +0200 | [diff] [blame] | 88 | uint8_t chosen_channel, |
| 89 | uint8_t encr_alg_id, |
Holger Hans Peter Freyther | ba6172a | 2010-04-17 06:21:49 +0200 | [diff] [blame] | 90 | uint8_t speech_mode); |
Philipp Maier | fa896ab | 2017-03-27 16:55:32 +0200 | [diff] [blame] | 91 | struct msgb *gsm0808_create_ass_fail(uint8_t cause, const uint8_t *rr_cause, |
| 92 | const struct gsm0808_speech_codec_list |
| 93 | *scl); |
Holger Hans Peter Freyther | 280cd51 | 2010-04-15 10:10:39 +0200 | [diff] [blame] | 94 | struct msgb *gsm0808_create_assignment_failure(uint8_t cause, uint8_t *rr_cause); |
Holger Hans Peter Freyther | af270a4 | 2010-11-04 12:42:50 +0100 | [diff] [blame] | 95 | struct msgb *gsm0808_create_clear_rqst(uint8_t cause); |
Stefan Sperling | 11a4d9d | 2018-02-15 18:28:04 +0100 | [diff] [blame] | 96 | struct msgb *gsm0808_create_paging2(const char *imsi, const uint32_t *tmsi, |
| 97 | const struct gsm0808_cell_id_list2 *cil, |
| 98 | const uint8_t *chan_needed); |
Philipp Maier | 3d48ec0 | 2017-03-29 17:37:55 +0200 | [diff] [blame] | 99 | struct msgb *gsm0808_create_paging(const char *imsi, const uint32_t *tmsi, |
| 100 | const struct gsm0808_cell_id_list *cil, |
Stefan Sperling | 11a4d9d | 2018-02-15 18:28:04 +0100 | [diff] [blame] | 101 | const uint8_t *chan_needed) |
| 102 | OSMO_DEPRECATED("use gsm0808_create_paging2 instead"); |
Max | 45f89c9 | 2018-12-19 19:35:26 +0100 | [diff] [blame] | 103 | struct msgb *gsm0808_create_lcls_conn_ctrl(enum gsm0808_lcls_config config, |
| 104 | enum gsm0808_lcls_control control); |
Harald Welte | 64e807c | 2018-05-29 21:00:56 +0200 | [diff] [blame] | 105 | struct msgb *gsm0808_create_lcls_conn_ctrl_ack(enum gsm0808_lcls_status status); |
| 106 | struct msgb *gsm0808_create_lcls_notification(enum gsm0808_lcls_status status, bool break_req); |
| 107 | |
Holger Hans Peter Freyther | 280cd51 | 2010-04-15 10:10:39 +0200 | [diff] [blame] | 108 | |
Neels Hofmeyr | 70aba3f | 2018-03-13 03:40:53 +0100 | [diff] [blame] | 109 | /*! 3GPP TS 48.008 §3.2.2.5.8 Old BSS to New BSS information */ |
| 110 | struct gsm0808_old_bss_to_new_bss_info { |
| 111 | bool extra_information_present; |
| 112 | struct { |
| 113 | bool prec; |
| 114 | bool lcs; |
| 115 | bool ue_prob; |
| 116 | } extra_information; |
| 117 | |
| 118 | bool current_channel_type_2_present; |
| 119 | struct { |
| 120 | uint8_t mode; |
| 121 | uint8_t field; |
| 122 | } current_channel_type_2; |
| 123 | |
| 124 | /* more items are defined in the spec and may be added later */ |
Neels Hofmeyr | 60f3153 | 2018-04-16 22:42:09 +0200 | [diff] [blame] | 125 | bool more_items; /*< always set this to false */ |
Neels Hofmeyr | 70aba3f | 2018-03-13 03:40:53 +0100 | [diff] [blame] | 126 | }; |
| 127 | |
| 128 | /*! 3GPP TS 48.008 §3.2.1.9 HANDOVER REQUIRED */ |
| 129 | struct gsm0808_handover_required { |
| 130 | uint16_t cause; |
| 131 | struct gsm0808_cell_id_list2 cil; |
| 132 | |
| 133 | bool current_channel_type_1_present; |
| 134 | uint8_t current_channel_type_1; |
| 135 | |
| 136 | bool speech_version_used_present; |
Neels Hofmeyr | 302aafc | 2019-04-10 19:23:45 +0200 | [diff] [blame] | 137 | enum gsm0808_permitted_speech speech_version_used; |
Neels Hofmeyr | 70aba3f | 2018-03-13 03:40:53 +0100 | [diff] [blame] | 138 | |
| 139 | bool old_bss_to_new_bss_info_present; |
| 140 | struct gsm0808_old_bss_to_new_bss_info old_bss_to_new_bss_info; |
| 141 | |
| 142 | /* more items are defined in the spec and may be added later */ |
Neels Hofmeyr | 60f3153 | 2018-04-16 22:42:09 +0200 | [diff] [blame] | 143 | bool more_items; /*< always set this to false */ |
Neels Hofmeyr | 70aba3f | 2018-03-13 03:40:53 +0100 | [diff] [blame] | 144 | }; |
| 145 | struct msgb *gsm0808_create_handover_required(const struct gsm0808_handover_required *params); |
| 146 | |
Neels Hofmeyr | f7e9c51 | 2019-03-06 04:25:38 +0100 | [diff] [blame] | 147 | /*! 3GPP TS 48.008 §3.2.1.37 HANDOVER REQUIRED REJECT */ |
| 148 | struct gsm0808_handover_required_reject { |
| 149 | uint16_t cause; |
| 150 | |
| 151 | /* more items are defined in the spec and may be added later */ |
| 152 | bool more_items; /*< always set this to false */ |
| 153 | }; |
| 154 | struct msgb *gsm0808_create_handover_required_reject(const struct gsm0808_handover_required_reject *params); |
| 155 | |
| 156 | /*! 3GPP TS 48.008 §3.2.1.8 HANDOVER REQUEST */ |
| 157 | struct gsm0808_handover_request { |
| 158 | struct gsm0808_channel_type channel_type; |
| 159 | struct gsm0808_encrypt_info encryption_information; |
| 160 | struct osmo_gsm48_classmark classmark_information; |
| 161 | struct gsm0808_cell_id cell_identifier_serving; |
| 162 | struct gsm0808_cell_id cell_identifier_target; |
| 163 | enum gsm0808_cause cause; |
| 164 | |
| 165 | bool current_channel_type_1_present; |
| 166 | uint8_t current_channel_type_1; |
| 167 | |
| 168 | enum gsm0808_permitted_speech speech_version_used; |
| 169 | |
| 170 | uint8_t chosen_encryption_algorithm_serving; |
| 171 | |
| 172 | /*! Pass either old_bss_to_new_bss_info or old_bss_to_new_bss_info_raw. */ |
| 173 | bool old_bss_to_new_bss_info_present; |
| 174 | struct gsm0808_old_bss_to_new_bss_info old_bss_to_new_bss_info; |
| 175 | /*! To feed the Old BSS to New BSS Information IE unchanged from the Handover Required message without having to |
| 176 | * decode it. Pass either old_bss_to_new_bss_info or old_bss_to_new_bss_info_raw. Omit the TL part. */ |
| 177 | const uint8_t *old_bss_to_new_bss_info_raw; |
| 178 | uint8_t old_bss_to_new_bss_info_raw_len; |
| 179 | |
| 180 | const char *imsi; |
| 181 | |
| 182 | const struct sockaddr_storage *aoip_transport_layer; |
| 183 | |
| 184 | const struct gsm0808_speech_codec_list *codec_list_msc_preferred; |
| 185 | |
| 186 | bool call_id_present; |
| 187 | uint32_t call_id; |
| 188 | |
| 189 | const uint8_t *global_call_reference; |
| 190 | uint8_t global_call_reference_len; |
| 191 | |
| 192 | /* more items are defined in the spec and may be added later */ |
| 193 | bool more_items; /*!< always set this to false */ |
| 194 | }; |
| 195 | struct msgb *gsm0808_create_handover_request(const struct gsm0808_handover_request *params); |
| 196 | |
Harald Welte | aa98c48 | 2019-05-06 10:31:35 +0200 | [diff] [blame] | 197 | struct msgb *gsm0808_create_handover_request_ack(const uint8_t *l3_info, uint8_t l3_info_len, |
| 198 | uint8_t chosen_channel, uint8_t chosen_encr_alg, |
| 199 | uint8_t chosen_speech_version); |
| 200 | |
Neels Hofmeyr | 73b943e | 2019-03-14 04:10:25 +0100 | [diff] [blame] | 201 | struct gsm0808_handover_request_ack { |
| 202 | const uint8_t *l3_info; |
| 203 | uint8_t l3_info_len; |
| 204 | |
| 205 | bool chosen_channel_present; |
| 206 | uint8_t chosen_channel; |
| 207 | |
| 208 | /*! For A5/N set chosen_encr_alg = N+1, e.g. chosen_encr_alg = 1 means A5/0 (no encryption), 2 means A5/1, 4 |
| 209 | * means A5/3. Set chosen_encr_alg = 0 to omit the Chosen Encryption Algorithm IE. */ |
| 210 | uint8_t chosen_encr_alg; |
| 211 | |
| 212 | /* chosen_speech_version == 0 omits the IE */ |
| 213 | enum gsm0808_permitted_speech chosen_speech_version; |
| 214 | |
| 215 | bool speech_codec_chosen_present; |
| 216 | struct gsm0808_speech_codec speech_codec_chosen; |
| 217 | |
| 218 | const struct sockaddr_storage *aoip_transport_layer; |
| 219 | |
| 220 | /* more items are defined in the spec and may be added later */ |
| 221 | bool more_items; /*!< always set this to false */ |
| 222 | }; |
| 223 | struct msgb *gsm0808_create_handover_request_ack2(const struct gsm0808_handover_request_ack *params); |
Neels Hofmeyr | b662b36 | 2018-04-16 22:31:15 +0200 | [diff] [blame] | 224 | |
Neels Hofmeyr | f7e9c51 | 2019-03-06 04:25:38 +0100 | [diff] [blame] | 225 | struct gsm0808_handover_command { |
| 226 | const uint8_t *l3_info; |
| 227 | uint8_t l3_info_len; |
| 228 | |
| 229 | struct gsm0808_cell_id cell_identifier; |
| 230 | |
| 231 | const uint8_t *new_bss_to_old_bss_info_raw; |
| 232 | size_t new_bss_to_old_bss_info_raw_len; |
| 233 | |
| 234 | /* more items are defined in the spec and may be added later */ |
| 235 | bool more_items; /*!< always set this to false */ |
| 236 | }; |
| 237 | struct msgb *gsm0808_create_handover_command(const struct gsm0808_handover_command *params); |
| 238 | |
Neels Hofmeyr | 60f3153 | 2018-04-16 22:42:09 +0200 | [diff] [blame] | 239 | struct msgb *gsm0808_create_handover_detect(); |
Neels Hofmeyr | f7e9c51 | 2019-03-06 04:25:38 +0100 | [diff] [blame] | 240 | struct msgb *gsm0808_create_handover_succeeded(); |
Neels Hofmeyr | 60f3153 | 2018-04-16 22:42:09 +0200 | [diff] [blame] | 241 | |
| 242 | struct gsm0808_handover_complete { |
| 243 | bool rr_cause_present; |
| 244 | uint8_t rr_cause; |
| 245 | |
| 246 | bool speech_codec_chosen_present; |
| 247 | struct gsm0808_speech_codec speech_codec_chosen; |
| 248 | |
| 249 | struct gsm0808_speech_codec_list codec_list_bss_supported; /*< omit when .len == 0 */ |
| 250 | |
| 251 | bool chosen_encr_alg_present; |
| 252 | uint8_t chosen_encr_alg; |
| 253 | |
| 254 | bool chosen_channel_present; |
| 255 | uint8_t chosen_channel; |
| 256 | |
| 257 | bool lcls_bss_status_present; |
| 258 | enum gsm0808_lcls_status lcls_bss_status; |
| 259 | |
| 260 | /* more items are defined in the spec and may be added later */ |
| 261 | bool more_items; /*< always set this to false */ |
| 262 | }; |
| 263 | struct msgb *gsm0808_create_handover_complete(const struct gsm0808_handover_complete *params); |
| 264 | |
| 265 | struct gsm0808_handover_failure { |
| 266 | uint16_t cause; |
| 267 | |
| 268 | bool rr_cause_present; |
| 269 | uint8_t rr_cause; |
| 270 | |
| 271 | struct gsm0808_speech_codec_list codec_list_bss_supported; /*< omit when .len == 0 */ |
| 272 | |
| 273 | /* more items are defined in the spec and may be added later */ |
| 274 | bool more_items; /*< always set this to false */ |
| 275 | }; |
| 276 | struct msgb *gsm0808_create_handover_failure(const struct gsm0808_handover_failure *params); |
| 277 | |
Philipp Maier | 225bdf4 | 2018-10-30 14:56:59 +0100 | [diff] [blame] | 278 | struct gsm0808_handover_performed { |
| 279 | uint16_t cause; |
| 280 | struct gsm0808_cell_id cell_id; |
| 281 | |
| 282 | bool chosen_channel_present; |
| 283 | uint8_t chosen_channel; |
| 284 | |
| 285 | bool chosen_encr_alg_present; |
| 286 | uint8_t chosen_encr_alg; |
| 287 | |
| 288 | bool speech_version_chosen_present; |
Neels Hofmeyr | 302aafc | 2019-04-10 19:23:45 +0200 | [diff] [blame] | 289 | enum gsm0808_permitted_speech speech_version_chosen; |
Philipp Maier | 225bdf4 | 2018-10-30 14:56:59 +0100 | [diff] [blame] | 290 | |
| 291 | bool speech_codec_chosen_present; |
| 292 | struct gsm0808_speech_codec speech_codec_chosen; |
| 293 | |
| 294 | bool lcls_bss_status_present; |
| 295 | enum gsm0808_lcls_status lcls_bss_status; |
| 296 | |
| 297 | /* more items are defined in the spec and may be added later */ |
| 298 | bool more_items; /*< always set this to false */ |
| 299 | }; |
| 300 | struct msgb *gsm0808_create_handover_performed(const struct gsm0808_handover_performed *params); |
| 301 | |
Holger Hans Peter Freyther | c25c668 | 2010-11-04 12:26:06 +0100 | [diff] [blame] | 302 | struct msgb *gsm0808_create_dtap(struct msgb *msg, uint8_t link_id); |
Holger Hans Peter Freyther | 9a3dec0 | 2010-05-16 08:15:40 +0800 | [diff] [blame] | 303 | void gsm0808_prepend_dtap_header(struct msgb *msg, uint8_t link_id); |
| 304 | |
Harald Welte | f4d45ab | 2011-07-16 12:13:00 +0200 | [diff] [blame] | 305 | const struct tlv_definition *gsm0808_att_tlvdef(void); |
Holger Hans Peter Freyther | 280cd51 | 2010-04-15 10:10:39 +0200 | [diff] [blame] | 306 | |
Max | c0d1de3 | 2018-11-07 15:24:11 +0100 | [diff] [blame] | 307 | /*! Parse BSSAP TLV structure using \ref tlv_parse */ |
| 308 | #define osmo_bssap_tlv_parse(dec, buf, len) tlv_parse(dec, gsm0808_att_tlvdef(), buf, len, 0, 0) |
Neels Hofmeyr | d791327 | 2019-04-03 18:07:27 +0200 | [diff] [blame] | 309 | /*! Parse BSSAP TLV structure using \ref tlv_parse2 */ |
| 310 | #define osmo_bssap_tlv_parse2(dec, dec_multiples, buf, len) \ |
| 311 | tlv_parse2(dec, dec_multiples, gsm0808_att_tlvdef(), buf, len, 0, 0) |
Max | c0d1de3 | 2018-11-07 15:24:11 +0100 | [diff] [blame] | 312 | |
Harald Welte | 9b837e6 | 2011-07-11 17:43:19 +0200 | [diff] [blame] | 313 | const char *gsm0808_bssmap_name(uint8_t msg_type); |
| 314 | const char *gsm0808_bssap_name(uint8_t msg_type); |
Max | aa93463 | 2018-11-07 13:16:54 +0100 | [diff] [blame] | 315 | const char *gsm0808_cause_name(enum gsm0808_cause cause); |
| 316 | const char *gsm0808_cause_class_name(enum gsm0808_cause_class class); |
Harald Welte | 37b6165 | 2017-10-16 18:46:03 +0200 | [diff] [blame] | 317 | |
Harald Welte | ebd362d | 2018-06-02 14:11:19 +0200 | [diff] [blame] | 318 | extern const struct value_string gsm0808_lcls_config_names[]; |
| 319 | extern const struct value_string gsm0808_lcls_control_names[]; |
| 320 | extern const struct value_string gsm0808_lcls_status_names[]; |
| 321 | |
Max | e118ed2 | 2018-12-19 17:05:37 +0100 | [diff] [blame] | 322 | static inline const char *gsm0808_lcls_config_name(enum gsm0808_lcls_config val) { |
Harald Welte | ebd362d | 2018-06-02 14:11:19 +0200 | [diff] [blame] | 323 | return get_value_string(gsm0808_lcls_config_names, val); |
| 324 | } |
Max | e118ed2 | 2018-12-19 17:05:37 +0100 | [diff] [blame] | 325 | static inline const char *gsm0808_lcls_control_name(enum gsm0808_lcls_control val) { |
Harald Welte | ebd362d | 2018-06-02 14:11:19 +0200 | [diff] [blame] | 326 | return get_value_string(gsm0808_lcls_control_names, val); |
| 327 | } |
Max | e118ed2 | 2018-12-19 17:05:37 +0100 | [diff] [blame] | 328 | static inline const char *gsm0808_lcls_status_name(enum gsm0808_lcls_status val) { |
Harald Welte | ebd362d | 2018-06-02 14:11:19 +0200 | [diff] [blame] | 329 | return get_value_string(gsm0808_lcls_status_names, val); |
| 330 | } |
| 331 | |
Harald Welte | 37b6165 | 2017-10-16 18:46:03 +0200 | [diff] [blame] | 332 | /*! @} */ |