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 | c4fce14 | 2018-02-20 13:47:08 +0100 | [diff] [blame] | 28 | #include <osmocom/gsm/gsm23003.h> |
| 29 | |
Harald Welte | 20725b9 | 2017-05-15 12:50:04 +0200 | [diff] [blame] | 30 | struct sockaddr_storage; |
Holger Hans Peter Freyther | 280cd51 | 2010-04-15 10:10:39 +0200 | [diff] [blame] | 31 | |
| 32 | struct msgb; |
Stefan Sperling | 11a4d9d | 2018-02-15 18:28:04 +0100 | [diff] [blame] | 33 | struct gsm0808_cell_id_list2; |
Holger Hans Peter Freyther | 280cd51 | 2010-04-15 10:10:39 +0200 | [diff] [blame] | 34 | |
Philipp Maier | fa896ab | 2017-03-27 16:55:32 +0200 | [diff] [blame] | 35 | struct msgb *gsm0808_create_layer3(struct msgb *msg_l3, uint16_t nc, |
Neels Hofmeyr | bd6c8b5 | 2018-03-22 14:05:21 +0100 | [diff] [blame] | 36 | uint16_t cc, int lac, uint16_t _ci) |
| 37 | 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] | 38 | struct msgb *gsm0808_create_layer3_aoip(const struct msgb *msg_l3, uint16_t nc, |
| 39 | uint16_t cc, int lac, uint16_t _ci, |
Neels Hofmeyr | bd6c8b5 | 2018-03-22 14:05:21 +0100 | [diff] [blame] | 40 | const struct gsm0808_speech_codec_list *scl) |
| 41 | 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] | 42 | struct msgb *gsm0808_create_layer3_2(const struct msgb *msg_l3, const struct osmo_cell_global_id *cell, |
| 43 | const struct gsm0808_speech_codec_list *scl); |
Holger Hans Peter Freyther | 280cd51 | 2010-04-15 10:10:39 +0200 | [diff] [blame] | 44 | struct msgb *gsm0808_create_reset(void); |
Harald Welte | a62fe31 | 2013-06-19 15:14:37 +0200 | [diff] [blame] | 45 | struct msgb *gsm0808_create_reset_ack(void); |
Holger Hans Peter Freyther | a3f05d8 | 2010-10-27 11:49:24 +0200 | [diff] [blame] | 46 | struct msgb *gsm0808_create_clear_command(uint8_t reason); |
Holger Hans Peter Freyther | 280cd51 | 2010-04-15 10:10:39 +0200 | [diff] [blame] | 47 | struct msgb *gsm0808_create_clear_complete(void); |
Philipp Maier | b478dd3 | 2017-03-29 15:50:05 +0200 | [diff] [blame] | 48 | struct msgb *gsm0808_create_cipher(const struct gsm0808_encrypt_info *ei, |
| 49 | const uint8_t *cipher_response_mode); |
Holger Hans Peter Freyther | 81716d5 | 2010-04-17 06:16:35 +0200 | [diff] [blame] | 50 | struct msgb *gsm0808_create_cipher_complete(struct msgb *layer3, uint8_t alg_id); |
Holger Hans Peter Freyther | 280cd51 | 2010-04-15 10:10:39 +0200 | [diff] [blame] | 51 | struct msgb *gsm0808_create_cipher_reject(uint8_t cause); |
Harald Welte | 07b625d | 2012-01-23 10:02:58 +0100 | [diff] [blame] | 52 | struct msgb *gsm0808_create_classmark_update(const uint8_t *cm2, uint8_t cm2_len, |
| 53 | const uint8_t *cm3, uint8_t cm3_len); |
Holger Hans Peter Freyther | 280cd51 | 2010-04-15 10:10:39 +0200 | [diff] [blame] | 54 | struct msgb *gsm0808_create_sapi_reject(uint8_t link_id); |
Philipp Maier | c6144a2 | 2017-03-29 17:53:43 +0200 | [diff] [blame] | 55 | struct msgb *gsm0808_create_ass(const struct gsm0808_channel_type *ct, |
| 56 | const uint16_t *cic, |
| 57 | const struct sockaddr_storage *ss, |
| 58 | const struct gsm0808_speech_codec_list *scl, |
| 59 | const uint32_t *ci); |
Philipp Maier | fa896ab | 2017-03-27 16:55:32 +0200 | [diff] [blame] | 60 | struct msgb *gsm0808_create_ass_compl(uint8_t rr_cause, uint8_t chosen_channel, |
| 61 | uint8_t encr_alg_id, uint8_t speech_mode, |
| 62 | const struct sockaddr_storage *ss, |
| 63 | const struct gsm0808_speech_codec *sc, |
| 64 | const struct gsm0808_speech_codec_list |
| 65 | *scl); |
Holger Hans Peter Freyther | b60a4b3 | 2010-07-23 18:35:59 +0800 | [diff] [blame] | 66 | struct msgb *gsm0808_create_assignment_completed(uint8_t rr_cause, |
Philipp Maier | fa896ab | 2017-03-27 16:55:32 +0200 | [diff] [blame] | 67 | uint8_t chosen_channel, |
| 68 | uint8_t encr_alg_id, |
Holger Hans Peter Freyther | ba6172a | 2010-04-17 06:21:49 +0200 | [diff] [blame] | 69 | uint8_t speech_mode); |
Philipp Maier | fa896ab | 2017-03-27 16:55:32 +0200 | [diff] [blame] | 70 | struct msgb *gsm0808_create_ass_fail(uint8_t cause, const uint8_t *rr_cause, |
| 71 | const struct gsm0808_speech_codec_list |
| 72 | *scl); |
Holger Hans Peter Freyther | 280cd51 | 2010-04-15 10:10:39 +0200 | [diff] [blame] | 73 | 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] | 74 | struct msgb *gsm0808_create_clear_rqst(uint8_t cause); |
Stefan Sperling | 11a4d9d | 2018-02-15 18:28:04 +0100 | [diff] [blame] | 75 | struct msgb *gsm0808_create_paging2(const char *imsi, const uint32_t *tmsi, |
| 76 | const struct gsm0808_cell_id_list2 *cil, |
| 77 | const uint8_t *chan_needed); |
Philipp Maier | 3d48ec0 | 2017-03-29 17:37:55 +0200 | [diff] [blame] | 78 | struct msgb *gsm0808_create_paging(const char *imsi, const uint32_t *tmsi, |
| 79 | const struct gsm0808_cell_id_list *cil, |
Stefan Sperling | 11a4d9d | 2018-02-15 18:28:04 +0100 | [diff] [blame] | 80 | const uint8_t *chan_needed) |
| 81 | OSMO_DEPRECATED("use gsm0808_create_paging2 instead"); |
Holger Hans Peter Freyther | 280cd51 | 2010-04-15 10:10:39 +0200 | [diff] [blame] | 82 | |
Holger Hans Peter Freyther | c25c668 | 2010-11-04 12:26:06 +0100 | [diff] [blame] | 83 | 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] | 84 | void gsm0808_prepend_dtap_header(struct msgb *msg, uint8_t link_id); |
| 85 | |
Harald Welte | f4d45ab | 2011-07-16 12:13:00 +0200 | [diff] [blame] | 86 | const struct tlv_definition *gsm0808_att_tlvdef(void); |
Holger Hans Peter Freyther | 280cd51 | 2010-04-15 10:10:39 +0200 | [diff] [blame] | 87 | |
Harald Welte | 9b837e6 | 2011-07-11 17:43:19 +0200 | [diff] [blame] | 88 | const char *gsm0808_bssmap_name(uint8_t msg_type); |
| 89 | const char *gsm0808_bssap_name(uint8_t msg_type); |
Philipp Maier | dbb7659 | 2018-03-29 12:55:26 +0200 | [diff] [blame] | 90 | const char *gsm0808_cause_name(uint8_t cause); |
Harald Welte | 37b6165 | 2017-10-16 18:46:03 +0200 | [diff] [blame] | 91 | |
| 92 | /*! @} */ |