blob: 9153d99f3fe7e346ccf398a7fcaa711eb4a28316 [file] [log] [blame]
Harald Welte37b61652017-10-16 18:46:03 +02001/*! \defgroup gsm0808 GSM 08.08 / 3GPP TS 48.008 A Interface
2 * @{
3 * \file gsm0808.h */
Neels Hofmeyr17518fe2017-06-20 04:35:06 +02004/*
5 * (C) 2009,2010 by Holger Hans Peter Freyther <zecke@selfish.org>
Holger Hans Peter Freyther280cd512010-04-15 10:10:39 +02006 * (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 Munaut12ba7782014-06-16 10:13:40 +020024#pragma once
Holger Hans Peter Freyther280cd512010-04-15 10:10:39 +020025
26#include "tlv.h"
Philipp Maierfa896ab2017-03-27 16:55:32 +020027#include <osmocom/gsm/protocol/gsm_08_08.h>
Neels Hofmeyrc4fce142018-02-20 13:47:08 +010028#include <osmocom/gsm/gsm23003.h>
29
Harald Welte20725b92017-05-15 12:50:04 +020030struct sockaddr_storage;
Holger Hans Peter Freyther280cd512010-04-15 10:10:39 +020031
32struct msgb;
Stefan Sperling11a4d9d2018-02-15 18:28:04 +010033struct gsm0808_cell_id_list2;
Holger Hans Peter Freyther280cd512010-04-15 10:10:39 +020034
Philipp Maierfa896ab2017-03-27 16:55:32 +020035struct msgb *gsm0808_create_layer3(struct msgb *msg_l3, uint16_t nc,
36 uint16_t cc, int lac, uint16_t _ci);
37struct msgb *gsm0808_create_layer3_aoip(const struct msgb *msg_l3, uint16_t nc,
38 uint16_t cc, int lac, uint16_t _ci,
39 const struct gsm0808_speech_codec_list
40 *scl);
Neels Hofmeyrc4fce142018-02-20 13:47:08 +010041struct msgb *gsm0808_create_layer3_2(const struct msgb *msg_l3, const struct osmo_cell_global_id *cell,
42 const struct gsm0808_speech_codec_list *scl);
Holger Hans Peter Freyther280cd512010-04-15 10:10:39 +020043struct msgb *gsm0808_create_reset(void);
Harald Weltea62fe312013-06-19 15:14:37 +020044struct msgb *gsm0808_create_reset_ack(void);
Holger Hans Peter Freythera3f05d82010-10-27 11:49:24 +020045struct msgb *gsm0808_create_clear_command(uint8_t reason);
Holger Hans Peter Freyther280cd512010-04-15 10:10:39 +020046struct msgb *gsm0808_create_clear_complete(void);
Philipp Maierb478dd32017-03-29 15:50:05 +020047struct msgb *gsm0808_create_cipher(const struct gsm0808_encrypt_info *ei,
48 const uint8_t *cipher_response_mode);
Holger Hans Peter Freyther81716d52010-04-17 06:16:35 +020049struct msgb *gsm0808_create_cipher_complete(struct msgb *layer3, uint8_t alg_id);
Holger Hans Peter Freyther280cd512010-04-15 10:10:39 +020050struct msgb *gsm0808_create_cipher_reject(uint8_t cause);
Harald Welte07b625d2012-01-23 10:02:58 +010051struct msgb *gsm0808_create_classmark_update(const uint8_t *cm2, uint8_t cm2_len,
52 const uint8_t *cm3, uint8_t cm3_len);
Holger Hans Peter Freyther280cd512010-04-15 10:10:39 +020053struct msgb *gsm0808_create_sapi_reject(uint8_t link_id);
Philipp Maierc6144a22017-03-29 17:53:43 +020054struct msgb *gsm0808_create_ass(const struct gsm0808_channel_type *ct,
55 const uint16_t *cic,
56 const struct sockaddr_storage *ss,
57 const struct gsm0808_speech_codec_list *scl,
58 const uint32_t *ci);
Philipp Maierfa896ab2017-03-27 16:55:32 +020059struct msgb *gsm0808_create_ass_compl(uint8_t rr_cause, uint8_t chosen_channel,
60 uint8_t encr_alg_id, uint8_t speech_mode,
61 const struct sockaddr_storage *ss,
62 const struct gsm0808_speech_codec *sc,
63 const struct gsm0808_speech_codec_list
64 *scl);
Holger Hans Peter Freytherb60a4b32010-07-23 18:35:59 +080065struct msgb *gsm0808_create_assignment_completed(uint8_t rr_cause,
Philipp Maierfa896ab2017-03-27 16:55:32 +020066 uint8_t chosen_channel,
67 uint8_t encr_alg_id,
Holger Hans Peter Freytherba6172a2010-04-17 06:21:49 +020068 uint8_t speech_mode);
Philipp Maierfa896ab2017-03-27 16:55:32 +020069struct msgb *gsm0808_create_ass_fail(uint8_t cause, const uint8_t *rr_cause,
70 const struct gsm0808_speech_codec_list
71 *scl);
Holger Hans Peter Freyther280cd512010-04-15 10:10:39 +020072struct msgb *gsm0808_create_assignment_failure(uint8_t cause, uint8_t *rr_cause);
Holger Hans Peter Freytheraf270a42010-11-04 12:42:50 +010073struct msgb *gsm0808_create_clear_rqst(uint8_t cause);
Stefan Sperling11a4d9d2018-02-15 18:28:04 +010074struct msgb *gsm0808_create_paging2(const char *imsi, const uint32_t *tmsi,
75 const struct gsm0808_cell_id_list2 *cil,
76 const uint8_t *chan_needed);
Philipp Maier3d48ec02017-03-29 17:37:55 +020077struct msgb *gsm0808_create_paging(const char *imsi, const uint32_t *tmsi,
78 const struct gsm0808_cell_id_list *cil,
Stefan Sperling11a4d9d2018-02-15 18:28:04 +010079 const uint8_t *chan_needed)
80 OSMO_DEPRECATED("use gsm0808_create_paging2 instead");
Holger Hans Peter Freyther280cd512010-04-15 10:10:39 +020081
Holger Hans Peter Freytherc25c6682010-11-04 12:26:06 +010082struct msgb *gsm0808_create_dtap(struct msgb *msg, uint8_t link_id);
Holger Hans Peter Freyther9a3dec02010-05-16 08:15:40 +080083void gsm0808_prepend_dtap_header(struct msgb *msg, uint8_t link_id);
84
Harald Weltef4d45ab2011-07-16 12:13:00 +020085const struct tlv_definition *gsm0808_att_tlvdef(void);
Holger Hans Peter Freyther280cd512010-04-15 10:10:39 +020086
Harald Welte9b837e62011-07-11 17:43:19 +020087const char *gsm0808_bssmap_name(uint8_t msg_type);
88const char *gsm0808_bssap_name(uint8_t msg_type);
Harald Welte37b61652017-10-16 18:46:03 +020089
90/*! @} */