libosmogsm  0.9.6.311-c977
Osmocom GSM library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
gsm0808_utils.h
Go to the documentation of this file.
1 
2 /*
3  * (C) 2016 by Sysmocom s.f.m.c. GmbH
4  * All Rights Reserved
5  *
6  * Author: Philipp Maier
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Affero General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU Affero General Public License for more details.
17  *
18  * You should have received a copy of the GNU Affero General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 #pragma once
23 
24 struct sockaddr_storage;
25 
26 #include <osmocom/gsm/protocol/gsm_08_08.h>
27 
28 uint8_t gsm0808_enc_aoip_trasp_addr(struct msgb *msg,
29  const struct sockaddr_storage *ss);
30 int gsm0808_dec_aoip_trasp_addr(struct sockaddr_storage *ss,
31  const uint8_t *elem, uint8_t len);
32 uint8_t gsm0808_enc_speech_codec(struct msgb *msg,
33  const struct gsm0808_speech_codec *sc);
34 int gsm0808_dec_speech_codec(struct gsm0808_speech_codec *sc,
35  const uint8_t *elem, uint8_t len);
36 uint8_t gsm0808_enc_speech_codec_list(struct msgb *msg,
37  const struct gsm0808_speech_codec_list
38  *scl);
39 int gsm0808_dec_speech_codec_list(struct gsm0808_speech_codec_list *scl,
40  const uint8_t *elem, uint8_t len);
41 uint8_t gsm0808_enc_channel_type(struct msgb *msg,
42  const struct gsm0808_channel_type *ct);
43 int gsm0808_dec_channel_type(struct gsm0808_channel_type *ct,
44  const uint8_t *elem, uint8_t len);
45 uint8_t gsm0808_enc_encrypt_info(struct msgb *msg,
46  const struct gsm0808_encrypt_info *ei);
47 int gsm0808_dec_encrypt_info(struct gsm0808_encrypt_info *ei,
48  const uint8_t *elem, uint8_t len);
49 uint8_t gsm0808_enc_cell_id_list(struct msgb *msg,
50  const struct gsm0808_cell_id_list *cil);
51 int gsm0808_dec_cell_id_list(struct gsm0808_cell_id_list *cil,
52  const uint8_t *elem, uint8_t len);
53 int gsm0808_chan_type_to_speech_codec(uint8_t perm_spch);
54 int gsm0808_speech_codec_from_chan_type(struct gsm0808_speech_codec *sc,
55  uint8_t perm_spch);
int gsm0808_chan_type_to_speech_codec(uint8_t perm_spch)
Convert the representation of the permitted speech codec identifier that is used in struct gsm0808_ch...
Definition: gsm0808_utils.c:660
int gsm0808_dec_aoip_trasp_addr(struct sockaddr_storage *ss, const uint8_t *elem, uint8_t len)
int gsm0808_dec_speech_codec_list(struct gsm0808_speech_codec_list *scl, const uint8_t *elem, uint8_t len)
Decode TS 08.08 Speech Codec list IE.
Definition: gsm0808_utils.c:373
uint8_t gsm0808_enc_cell_id_list(struct msgb *msg, const struct gsm0808_cell_id_list *cil)
Encode TS 08.08 Cell Identifier List IE.
Definition: gsm0808_utils.c:574
int gsm0808_dec_encrypt_info(struct gsm0808_encrypt_info *ei, const uint8_t *elem, uint8_t len)
Decode TS 08.08 Encryption Information IE.
Definition: gsm0808_utils.c:536
int gsm0808_dec_channel_type(struct gsm0808_channel_type *ct, const uint8_t *elem, uint8_t len)
Decode TS 08.08 Channel Type IE.
Definition: gsm0808_utils.c:460
uint8_t gsm0808_enc_speech_codec(struct msgb *msg, const struct gsm0808_speech_codec *sc)
Encode TS 08.08 Speech Codec IE.
Definition: gsm0808_utils.c:232
int gsm0808_dec_speech_codec(struct gsm0808_speech_codec *sc, const uint8_t *elem, uint8_t len)
Decode TS 08.08 Speech Codec IE.
Definition: gsm0808_utils.c:257
int gsm0808_dec_cell_id_list(struct gsm0808_cell_id_list *cil, const uint8_t *elem, uint8_t len)
Decode Cell Identifier List IE.
Definition: gsm0808_utils.c:614
uint8_t gsm0808_enc_aoip_trasp_addr(struct msgb *msg, const struct sockaddr_storage *ss)
int gsm0808_speech_codec_from_chan_type(struct gsm0808_speech_codec *sc, uint8_t perm_spch)
Extrapolate a speech codec field from a given permitted speech parameter (channel type)...
Definition: gsm0808_utils.c:698
uint8_t gsm0808_enc_speech_codec_list(struct msgb *msg, const struct gsm0808_speech_codec_list *scl)
Encode TS 08.08 Speech Codec list.
Definition: gsm0808_utils.c:337
uint8_t gsm0808_enc_encrypt_info(struct msgb *msg, const struct gsm0808_encrypt_info *ei)
Encode TS 08.08 Encryption Information IE.
Definition: gsm0808_utils.c:497
uint8_t gsm0808_enc_channel_type(struct msgb *msg, const struct gsm0808_channel_type *ct)
Encode TS 08.08 Channel Type IE.
Definition: gsm0808_utils.c:417