gsm0808_utils.h
Go to the documentation of this file.
/*
* (C) 2016 by sysmocom - s.f.m.c. GmbH, Author: Philipp Maier
* All Rights Reserved
*
* SPDX-License-Identifier: GPL-2.0+
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
struct sockaddr_storage;
#include <osmocom/gsm/protocol/gsm_08_08.h>
#include <osmocom/gsm/protocol/gsm_04_08.h>
#include <osmocom/gsm/gsm29205.h>
#include <osmocom/gsm/gsm23003.h>
#include <osmocom/gsm/gsm_utils.h>
#include <osmocom/gsm/tlv.h>
#define GSM0808_CELL_ID_LIST2_MAXLEN 127
union gsm0808_cell_id_u {
struct osmo_cell_global_id global;
struct osmo_lac_and_ci_id lac_and_ci;
uint16_t ci;
struct osmo_location_area_id lai_and_lac;
uint16_t lac;
struct osmo_cell_global_id_ps global_ps;
};
struct gsm0808_cell_id {
enum CELL_IDENT id_discr;
union gsm0808_cell_id_u id;
};
struct gsm0808_cell_id_list2 {
enum CELL_IDENT id_discr;
union gsm0808_cell_id_u id_list[GSM0808_CELL_ID_LIST2_MAXLEN];
unsigned int id_list_len;
};
struct osmo_lcls {
enum gsm0808_lcls_config config;
enum gsm0808_lcls_control control;
struct osmo_gcr_parsed gcr;
bool gcr_available;
bool corr_needed;
};
char *osmo_lcls_dump(const struct osmo_lcls *lcls);
char *osmo_lcls_dump_buf(char *buf, size_t buf_len, const struct osmo_lcls *lcls);
char *osmo_lcls_dump_c(void *ctx, const struct osmo_lcls *lcls);
char *osmo_gcr_dump(const struct osmo_lcls *lcls);
char *osmo_gcr_dump_buf(char *buf, size_t buf_len, const struct osmo_lcls *lcls);
extern const struct value_string gsm0808_cell_id_discr_names[];
static inline const char *gsm0808_cell_id_discr_name(enum CELL_IDENT id_discr)
{ return get_value_string(gsm0808_cell_id_discr_names, id_discr); }
const char *gsm0808_cell_id_name(const struct gsm0808_cell_id *cid);
const char *gsm0808_cell_id_name2(const struct gsm0808_cell_id *cid);
char *gsm0808_cell_id_name_buf(char *buf, size_t buflen, const struct gsm0808_cell_id *cid);
char *gsm0808_cell_id_name_c(const void *ctx, const struct gsm0808_cell_id *cid);
const char *gsm0808_cell_id_list_name(const struct gsm0808_cell_id_list2 *cil);
int gsm0808_cell_id_list_name_buf(char *buf, size_t buflen, const struct gsm0808_cell_id_list2 *cil);
char *gsm0808_cell_id_list_name_c(const void *ctx, const struct gsm0808_cell_id_list2 *cil);
int gsm0808_cell_id_u_name(char *buf, size_t buflen,
enum CELL_IDENT id_discr, const union gsm0808_cell_id_u *u);
bool gsm0808_cell_ids_match(const struct gsm0808_cell_id *id1, const struct gsm0808_cell_id *id2, bool exact_match);
int gsm0808_cell_id_matches_list(const struct gsm0808_cell_id *id, const struct gsm0808_cell_id_list2 *list,
unsigned int match_nr, bool exact_match);
void gsm0808_cell_id_from_cgi(struct gsm0808_cell_id *cid, enum CELL_IDENT id_discr,
const struct osmo_cell_global_id *cgi);
int gsm0808_cell_id_to_cgi(struct osmo_cell_global_id *cgi, const struct gsm0808_cell_id *cid);
void gsm0808_msgb_put_cell_id_u(struct msgb *msg, enum CELL_IDENT id_discr, const union gsm0808_cell_id_u *u);
int gsm0808_decode_cell_id_u(union gsm0808_cell_id_u *out, enum CELL_IDENT discr, const uint8_t *buf, unsigned int len);
int gsm0808_cell_id_size(enum CELL_IDENT discr);
uint8_t gsm0808_enc_cause(struct msgb *msg, uint16_t cause);
uint8_t gsm0808_enc_aoip_trasp_addr(struct msgb *msg,
const struct sockaddr_storage *ss);
int gsm0808_dec_aoip_trasp_addr(struct sockaddr_storage *ss,
const uint8_t *elem, uint8_t len);
int gsm0808_dec_osmux_cid(uint8_t *cid, const uint8_t *elem, uint8_t len);
uint8_t gsm0808_enc_lcls(struct msgb *msg, const struct osmo_lcls *lcls);
int gsm0808_dec_lcls(struct osmo_lcls *lcls, const struct tlv_parsed *tp);
uint8_t gsm0808_enc_speech_codec(struct msgb *msg,
const struct gsm0808_speech_codec *sc);
int gsm0808_dec_speech_codec(struct gsm0808_speech_codec *sc,
const uint8_t *elem, uint8_t len);
uint8_t gsm0808_enc_speech_codec_list(struct msgb *msg,
const struct gsm0808_speech_codec_list
*scl);
int gsm0808_dec_speech_codec_list(struct gsm0808_speech_codec_list *scl,
const uint8_t *elem, uint8_t len);
uint8_t gsm0808_enc_channel_type(struct msgb *msg,
const struct gsm0808_channel_type *ct);
int gsm0808_dec_channel_type(struct gsm0808_channel_type *ct,
const uint8_t *elem, uint8_t len);
uint8_t gsm0808_enc_encrypt_info(struct msgb *msg,
const struct gsm0808_encrypt_info *ei);
int gsm0808_dec_encrypt_info(struct gsm0808_encrypt_info *ei,
const uint8_t *elem, uint8_t len);
int gsm0808_enc_kc128(struct msgb *msg, const uint8_t *kc128);
int gsm0808_dec_kc128(uint8_t *kc128, const uint8_t *elem, uint8_t len);
uint8_t gsm0808_enc_cell_id_list2(struct msgb *msg, const struct gsm0808_cell_id_list2 *cil);
uint8_t gsm0808_enc_cell_id_list(struct msgb *msg,
const struct gsm0808_cell_id_list *cil)
OSMO_DEPRECATED("use gsm0808_enc_cell_id_list2 instead");
int gsm0808_dec_cell_id_list2(struct gsm0808_cell_id_list2 *cil, const uint8_t *elem, uint8_t len);
int gsm0808_dec_cell_id_list(struct gsm0808_cell_id_list *cil,
const uint8_t *elem, uint8_t len)
OSMO_DEPRECATED("use gsm0808_dec_cell_id_list2 instead");
int gsm0808_cell_id_list_add(struct gsm0808_cell_id_list2 *dst, const struct gsm0808_cell_id_list2 *src);
void gsm0808_cell_id_to_list(struct gsm0808_cell_id_list2 *dst, const struct gsm0808_cell_id *src);
uint8_t gsm0808_enc_cell_id(struct msgb *msg, const struct gsm0808_cell_id *ci);
int gsm0808_dec_cell_id(struct gsm0808_cell_id *ci, const uint8_t *elem, uint8_t len);
int gsm0808_chan_type_to_speech_codec(uint8_t perm_spch);
int gsm0808_speech_codec_from_chan_type(struct gsm0808_speech_codec *sc,
uint8_t perm_spch);
uint16_t gsm0808_sc_cfg_from_gsm48_mr_cfg(const struct gsm48_multi_rate_conf *cfg, bool fr);
int gsm48_mr_cfg_from_gsm0808_sc_cfg(struct gsm48_multi_rate_conf *cfg, uint16_t s15_s0);
static inline enum gsm0808_cause_class gsm0808_cause_class(enum gsm0808_cause cause)
{
return (cause >> 4) & 0x7;
}
static inline bool gsm0808_cause_ext(enum gsm0808_cause cause)
{
/* check that cause looks like 1XXX0000 where XXX represent class */
return (cause & 0x80) && !(cause & 0x0F);
}
int gsm0808_get_cipher_reject_cause(const struct tlv_parsed *tp)
OSMO_DEPRECATED("Use gsm0808_get_cause() instead");
static inline uint8_t gsm0808_current_channel_type_1(enum gsm_chan_t type)
{
switch (type) {
default:
return 0;
case GSM_LCHAN_SDCCH:
return 0x01;
case GSM_LCHAN_TCH_F:
return 0x18;
case GSM_LCHAN_TCH_H:
return 0x19;
}
}
static inline enum gsm0808_permitted_speech gsm0808_permitted_speech(enum gsm_chan_t type,
enum gsm48_chan_mode mode)
{
switch (mode) {
case GSM48_CMODE_SPEECH_V1:
switch (type) {
case GSM_LCHAN_TCH_F:
return GSM0808_PERM_FR1;
case GSM_LCHAN_TCH_H:
return GSM0808_PERM_HR1;
default:
return 0;
}
case GSM48_CMODE_SPEECH_EFR:
switch (type) {
case GSM_LCHAN_TCH_F:
return GSM0808_PERM_FR2;
case GSM_LCHAN_TCH_H:
return GSM0808_PERM_HR2;
default:
return 0;
}
case GSM48_CMODE_SPEECH_AMR:
switch (type) {
case GSM_LCHAN_TCH_F:
return GSM0808_PERM_FR3;
case GSM_LCHAN_TCH_H:
return GSM0808_PERM_HR3;
default:
return 0;
}
default:
return 0;
}
}
static inline uint8_t gsm0808_chosen_channel(enum gsm_chan_t type, enum gsm48_chan_mode mode)
{
uint8_t channel_mode = 0, channel = 0;
switch (mode) {
case GSM48_CMODE_SPEECH_V1:
case GSM48_CMODE_SPEECH_EFR:
case GSM48_CMODE_SPEECH_AMR:
channel_mode = 0x9;
break;
case GSM48_CMODE_SIGN:
channel_mode = 0x8;
break;
case GSM48_CMODE_DATA_14k5:
channel_mode = 0xe;
break;
case GSM48_CMODE_DATA_12k0:
channel_mode = 0xb;
break;
case GSM48_CMODE_DATA_6k0:
channel_mode = 0xc;
break;
case GSM48_CMODE_DATA_3k6:
channel_mode = 0xd;
break;
default:
return 0;
}
switch (type) {
case GSM_LCHAN_NONE:
channel = 0x0;
break;
case GSM_LCHAN_SDCCH:
channel = 0x1;
break;
case GSM_LCHAN_TCH_F:
channel = 0x8;
break;
case GSM_LCHAN_TCH_H:
channel = 0x9;
break;
default:
return 0;
}
return channel_mode << 4 | channel;
}
const char *gsm0808_channel_type_name(const struct gsm0808_channel_type *ct);
char *gsm0808_channel_type_name_buf(char *buf, size_t buf_len, const struct gsm0808_channel_type *ct);
char *gsm0808_channel_type_name_c(const void *ctx, const struct gsm0808_channel_type *ct);
gsm0808_dec_speech_codec_list
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:429
gsm0808_dec_cell_id_list
int gsm0808_dec_cell_id_list(struct gsm0808_cell_id_list *cil, const uint8_t *elem, uint8_t len) OSMO_DEPRECATED("use gsm0808_dec_cell_id_list2 instead")
DEPRECATED: Use gsm0808_dec_cell_id_list2 instead.
Definition: gsm0808_utils.c:1236
gsm0808_enc_cause
uint8_t gsm0808_enc_cause(struct msgb *msg, uint16_t cause)
gsm0808_dec_channel_type
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:509
gsm0808_msgb_put_cell_id_u
void gsm0808_msgb_put_cell_id_u(struct msgb *msg, enum CELL_IDENT id_discr, const union gsm0808_cell_id_u *u)
Definition: gsm0808_utils.c:922
gsm0808_cell_id_name
const char * gsm0808_cell_id_name(const struct gsm0808_cell_id *cid)
Return a human readable representation of a Cell Identifier, like "LAC:123" or "CGI:001-01-42-23".
Definition: gsm0808_utils.c:1961
gsm0808_sc_cfg_from_gsm48_mr_cfg
uint16_t gsm0808_sc_cfg_from_gsm48_mr_cfg(const struct gsm48_multi_rate_conf *cfg, bool fr)
Determine a set of AMR speech codec configuration bits (S0-S15) from a given GSM 04....
Definition: gsm0808_utils.c:1534
gsm0808_chan_type_to_speech_codec
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:1443
gsm0808_get_cipher_reject_cause
int gsm0808_get_cipher_reject_cause(const struct tlv_parsed *tp) OSMO_DEPRECATED("Use gsm0808_get_cause() instead")
Definition: gsm0808_utils.c:1675
gsm0808_dec_cell_id_list2
int gsm0808_dec_cell_id_list2(struct gsm0808_cell_id_list2 *cil, const uint8_t *elem, uint8_t len)
Decode Cell Identifier List IE.
Definition: gsm0808_utils.c:1174
gsm0808_cause_ext
static bool gsm0808_cause_ext(enum gsm0808_cause cause)
Definition: gsm0808_utils.h:155
gsm0808_enc_cell_id
uint8_t gsm0808_enc_cell_id(struct msgb *msg, const struct gsm0808_cell_id *ci)
Encode Cell Identifier IE (3GPP TS 48.008 3.2.2.17).
Definition: gsm0808_utils.c:1391
gsm0808_channel_type_name_c
char * gsm0808_channel_type_name_c(const void *ctx, const struct gsm0808_channel_type *ct)
Definition: gsm0808_utils.c:2061
osmo_lcls_dump_buf
char * osmo_lcls_dump_buf(char *buf, size_t buf_len, const struct osmo_lcls *lcls)
Dump LCLS parameters (GCR excluded) into string for printing.
Definition: gsm0808_utils.c:632
gsm48_mr_cfg_from_gsm0808_sc_cfg
int gsm48_mr_cfg_from_gsm0808_sc_cfg(struct gsm48_multi_rate_conf *cfg, uint16_t s15_s0)
Determine a GSM 04.08 AMR configuration struct from a set of speech codec configuration bits (S0-S15)
Definition: gsm0808_utils.c:1587
gsm0808_channel_type_name_buf
char * gsm0808_channel_type_name_buf(char *buf, size_t buf_len, const struct gsm0808_channel_type *ct)
Definition: gsm0808_utils.c:2047
gsm0808_cell_id_list_name
const char * gsm0808_cell_id_list_name(const struct gsm0808_cell_id_list2 *cil)
Return a human-readable representation of cil in a static buffer.
Definition: gsm0808_utils.c:2028
gsm0808_enc_speech_codec_list
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:396
gsm0808_cell_id_u_name
int gsm0808_cell_id_u_name(char *buf, size_t buflen, enum CELL_IDENT id_discr, const union gsm0808_cell_id_u *u)
Print a human readable name of the cell identifier to the char buffer.
Definition: gsm0808_utils.c:1690
gsm0808_cell_id_matches_list
int gsm0808_cell_id_matches_list(const struct gsm0808_cell_id *id, const struct gsm0808_cell_id_list2 *list, unsigned int match_nr, bool exact_match)
Find an index in a Cell Identifier list that matches a given single Cell Identifer.
Definition: gsm0808_utils.c:1803
gsm0808_cause_class
static enum gsm0808_cause_class gsm0808_cause_class(enum gsm0808_cause cause)
Definition: gsm0808_utils.h:149
gsm0808_cell_ids_match
bool gsm0808_cell_ids_match(const struct gsm0808_cell_id *id1, const struct gsm0808_cell_id *id2, bool exact_match)
Return true if the common information between the two Cell Identifiers match.
Definition: gsm0808_utils.c:1786
gsm0808_dec_kc128
int gsm0808_dec_kc128(uint8_t *kc128, const uint8_t *elem, uint8_t len)
Decode TS 48.008 Kc128 IE.
Definition: gsm0808_utils.c:790
gsm0808_decode_cell_id_u
int gsm0808_decode_cell_id_u(union gsm0808_cell_id_u *out, enum CELL_IDENT discr, const uint8_t *buf, unsigned int len)
Decode a single GSM 08.08 Cell ID list element payload.
Definition: gsm0808_utils.c:873
gsm0808_enc_cell_id_list
uint8_t gsm0808_enc_cell_id_list(struct msgb *msg, const struct gsm0808_cell_id_list *cil) OSMO_DEPRECATED("use gsm0808_enc_cell_id_list2 instead")
DEPRECATED: Use gsm0808_enc_cell_id_list2 instead.
Definition: gsm0808_utils.c:1021
gsm0808_cell_id_name_buf
char * gsm0808_cell_id_name_buf(char *buf, size_t buflen, const struct gsm0808_cell_id *cid)
Definition: gsm0808_utils.c:1947
gsm0808_cell_id_list_name_c
char * gsm0808_cell_id_list_name_c(const void *ctx, const struct gsm0808_cell_id_list2 *cil)
Definition: gsm0808_utils.c:2035
gsm0808_enc_lcls
uint8_t gsm0808_enc_lcls(struct msgb *msg, const struct osmo_lcls *lcls)
Add LCLS parameters to a given msgb, 3GPP TS 48.008 §3.2.2.115 - 3.2.2.120.
Definition: gsm0808_utils.c:580
gsm0808_current_channel_type_1
static uint8_t gsm0808_current_channel_type_1(enum gsm_chan_t type)
Definition: gsm0808_utils.h:165
gsm0808_dec_encrypt_info
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:738
gsm0808_cell_id_to_list
void gsm0808_cell_id_to_list(struct gsm0808_cell_id_list2 *dst, const struct gsm0808_cell_id *src)
Convert a single Cell Identifier to a Cell Identifier List with one entry.
Definition: gsm0808_utils.c:1360
GSM0808_CELL_ID_LIST2_MAXLEN
#define GSM0808_CELL_ID_LIST2_MAXLEN
(225-1)/2 is the maximum number of elements in a cell identifier list.
Definition: gsm0808_utils.h:36
gsm0808_dec_lcls
int gsm0808_dec_lcls(struct osmo_lcls *lcls, const struct tlv_parsed *tp)
Decode LCLS parameters to a given msgb, 3GPP TS 48.008 §3.2.2.115 - 3.2.2.120.
Definition: gsm0808_utils.c:613
gsm0808_dec_osmux_cid
int gsm0808_dec_osmux_cid(uint8_t *cid, const uint8_t *elem, uint8_t len)
gsm0808_enc_encrypt_info
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:697
gsm0808_enc_aoip_trasp_addr
uint8_t gsm0808_enc_aoip_trasp_addr(struct msgb *msg, const struct sockaddr_storage *ss)
gsm0808_dec_aoip_trasp_addr
int gsm0808_dec_aoip_trasp_addr(struct sockaddr_storage *ss, const uint8_t *elem, uint8_t len)
gsm0808_enc_cell_id_list2
uint8_t gsm0808_enc_cell_id_list2(struct msgb *msg, const struct gsm0808_cell_id_list2 *cil)
Encode TS 08.08 Cell Identifier List IE.
Definition: gsm0808_utils.c:976
osmo_lcls_dump_c
char * osmo_lcls_dump_c(void *ctx, const struct osmo_lcls *lcls)
Definition: gsm0808_utils.c:655
gsm0808_cell_id_list_add
int gsm0808_cell_id_list_add(struct gsm0808_cell_id_list2 *dst, const struct gsm0808_cell_id_list2 *src)
Append entries from one Cell Identifier List to another.
Definition: gsm0808_utils.c:1323
gsm0808_channel_type_name
const char * gsm0808_channel_type_name(const struct gsm0808_channel_type *ct)
Definition: gsm0808_utils.c:2055
gsm0808_cell_id_size
int gsm0808_cell_id_size(enum CELL_IDENT discr)
Definition: gsm0808_utils.c:845
gsm0808_permitted_speech
static enum gsm0808_permitted_speech gsm0808_permitted_speech(enum gsm_chan_t type, enum gsm48_chan_mode mode)
Return 3GPP TS 48.008 3.2.2.51 Speech Version aka permitted speech version indication in 3....
Definition: gsm0808_utils.h:181
gsm0808_enc_speech_codec
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:291
gsm0808_cell_id_list_name_buf
int gsm0808_cell_id_list_name_buf(char *buf, size_t buflen, const struct gsm0808_cell_id_list2 *cil)
Return a human readable representation of the Cell Identifier List, like "LAC[2]:{123,...
Definition: gsm0808_utils.c:1997
gsm0808_dec_cell_id
int gsm0808_dec_cell_id(struct gsm0808_cell_id *ci, const uint8_t *elem, uint8_t len)
Decode Cell Identifier IE (3GPP TS 48.008 3.2.2.17).
Definition: gsm0808_utils.c:1419
osmo_gcr_dump
char * osmo_gcr_dump(const struct osmo_lcls *lcls)
Dump GCR struct into static string buffer for printing.
Definition: gsm0808_utils.c:687
gsm0808_speech_codec_from_chan_type
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:1481
gsm0808_cell_id_discr_names
const struct value_string gsm0808_cell_id_discr_names[]
value_string[] for enum CELL_IDENT.
Definition: gsm0808_utils.c:1919
gsm0808_dec_speech_codec
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:316
osmo_gcr_dump_buf
char * osmo_gcr_dump_buf(char *buf, size_t buf_len, const struct osmo_lcls *lcls)
Dump GCR struct into string for printing.
Definition: gsm0808_utils.c:668
gsm0808_cell_id_discr_name
static const char * gsm0808_cell_id_discr_name(enum CELL_IDENT id_discr)
Definition: gsm0808_utils.h:79
gsm0808_cell_id_name_c
char * gsm0808_cell_id_name_c(const void *ctx, const struct gsm0808_cell_id *cid)
Definition: gsm0808_utils.c:1977
osmo_lcls_dump
char * osmo_lcls_dump(const struct osmo_lcls *lcls)
Dump LCLS parameters (GCR excluded) into static string buffer for printing.
Definition: gsm0808_utils.c:650
gsm0808_chosen_channel
static uint8_t gsm0808_chosen_channel(enum gsm_chan_t type, enum gsm48_chan_mode mode)
Return 3GPP TS 48.008 3.2.2.33 Chosen Channel.
Definition: gsm0808_utils.h:218
gsm0808_cell_id_to_cgi
int gsm0808_cell_id_to_cgi(struct osmo_cell_global_id *cgi, const struct gsm0808_cell_id *cid)
Overwrite parts of cgi with values from a Cell Identifier.
Definition: gsm0808_utils.c:1879
gsm0808_cell_id_name2
const char * gsm0808_cell_id_name2(const struct gsm0808_cell_id *cid)
Like gsm0808_cell_id_name() but uses a different static buffer.
Definition: gsm0808_utils.c:1971
gsm0808_cell_id_from_cgi
void gsm0808_cell_id_from_cgi(struct gsm0808_cell_id *cid, enum CELL_IDENT id_discr, const struct osmo_cell_global_id *cgi)
Copy information from a CGI to form a Cell Identifier of the specified kind.
Definition: gsm0808_utils.c:1823
gsm0808_enc_kc128
int gsm0808_enc_kc128(struct msgb *msg, const uint8_t *kc128)
Encode TS 48.008 Kc128 IE.
Definition: gsm0808_utils.c:778
gsm0808_enc_channel_type
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:466
OSMO_DEPRECATED
#define OSMO_DEPRECATED(text)
get_value_string
const char * get_value_string(const struct value_string *vs, uint32_t val)
gsm23003.h
gsm29205.h
gsm_04_08.h
GSM TS 04.08 definitions.
cause
uint8_t cause
Definition: gsm_04_08.h:2
gsm48_chan_mode
gsm48_chan_mode
Definition: gsm_04_08.h:749
GSM48_CMODE_DATA_6k0
@ GSM48_CMODE_DATA_6k0
Definition: gsm_04_08.h:756
GSM48_CMODE_SPEECH_V1
@ GSM48_CMODE_SPEECH_V1
Definition: gsm_04_08.h:751
GSM48_CMODE_DATA_3k6
@ GSM48_CMODE_DATA_3k6
Definition: gsm_04_08.h:757
GSM48_CMODE_SIGN
@ GSM48_CMODE_SIGN
Definition: gsm_04_08.h:750
GSM48_CMODE_DATA_12k0
@ GSM48_CMODE_DATA_12k0
Definition: gsm_04_08.h:755
GSM48_CMODE_SPEECH_AMR
@ GSM48_CMODE_SPEECH_AMR
Definition: gsm_04_08.h:753
GSM48_CMODE_SPEECH_EFR
@ GSM48_CMODE_SPEECH_EFR
Definition: gsm_04_08.h:752
GSM48_CMODE_DATA_14k5
@ GSM48_CMODE_DATA_14k5
Definition: gsm_04_08.h:754
mode
uint8_t mode
Definition: gsm_04_08.h:1
len
uint8_t len
Definition: gsm_04_11.h:0
gsm_08_08.h
gsm0808_cause
gsm0808_cause
Definition: gsm_08_08.h:362
type
uint8_t type
Definition: gsm_08_08.h:0
msg
uint8_t msg[0]
Definition: gsm_08_08.h:8
gsm0808_cause_class
gsm0808_cause_class
Definition: gsm_08_08.h:429
gsm0808_lcls_control
gsm0808_lcls_control
Definition: gsm_08_08.h:654
gsm0808_lcls_config
gsm0808_lcls_config
Definition: gsm_08_08.h:643
gsm0808_permitted_speech
gsm0808_permitted_speech
GSM 08.08 3.2.2.11 Channel Type (see also 3GPP TS 48.008, section 3.2.2.11)
Definition: gsm_08_08.h:487
GSM0808_PERM_FR2
@ GSM0808_PERM_FR2
GSM EFR.
Definition: gsm_08_08.h:489
GSM0808_PERM_FR1
@ GSM0808_PERM_FR1
GSM FR.
Definition: gsm_08_08.h:488
GSM0808_PERM_HR1
@ GSM0808_PERM_HR1
GSM HR.
Definition: gsm_08_08.h:493
GSM0808_PERM_HR3
@ GSM0808_PERM_HR3
HR AMR.
Definition: gsm_08_08.h:495
GSM0808_PERM_HR2
@ GSM0808_PERM_HR2
(deprecated)
Definition: gsm_08_08.h:494
GSM0808_PERM_FR3
@ GSM0808_PERM_FR3
FR AMR.
Definition: gsm_08_08.h:490
CELL_IDENT
CELL_IDENT
Definition: gsm_08_08.h:17
gsm_utils.h
GSM utility functions, e.g.
gsm_chan_t
gsm_chan_t
Definition: gsm_utils.h:223
GSM_LCHAN_TCH_H
@ GSM_LCHAN_TCH_H
Definition: gsm_utils.h:227
GSM_LCHAN_SDCCH
@ GSM_LCHAN_SDCCH
Definition: gsm_utils.h:225
GSM_LCHAN_TCH_F
@ GSM_LCHAN_TCH_F
Definition: gsm_utils.h:226
GSM_LCHAN_NONE
@ GSM_LCHAN_NONE
Definition: gsm_utils.h:224
gsm0808_cell_id_list2
Parsed representation of a Cell Identifier List IE (3GPP TS 48.008 3.2.2.27).
Definition: gsm0808_utils.h:57
gsm0808_cell_id_list2::id_discr
enum CELL_IDENT id_discr
Definition: gsm0808_utils.h:58
gsm0808_cell_id_list2::id_list
union gsm0808_cell_id_u id_list[GSM0808_CELL_ID_LIST2_MAXLEN]
Definition: gsm0808_utils.h:59
gsm0808_cell_id_list2::id_list_len
unsigned int id_list_len
Definition: gsm0808_utils.h:60
gsm0808_cell_id_list
DEPRECATED: This definition of the cell identifier list is insufficient.
Definition: gsm_08_08.h:636
gsm0808_cell_id
Parsed representation of Cell Identifier IE (3GPP TS 48.008 3.2.2.17)
Definition: gsm0808_utils.h:51
gsm0808_cell_id::id
union gsm0808_cell_id_u id
Definition: gsm0808_utils.h:53
gsm0808_cell_id::id_discr
enum CELL_IDENT id_discr
Definition: gsm0808_utils.h:52
gsm0808_channel_type
Definition: gsm_08_08.h:612
gsm0808_encrypt_info
Definition: gsm_08_08.h:622
gsm0808_speech_codec_list
Definition: gsm_08_08.h:605
gsm0808_speech_codec
3GPP TS 48.008 3.2.2.104 Speech Codec
Definition: gsm_08_08.h:543
gsm48_multi_rate_conf
Definition: gsm_04_08.h:603
msgb
osmo_cell_global_id_ps
Definition: gsm23003.h:33
osmo_cell_global_id
Definition: gsm23003.h:28
osmo_gcr_parsed
Parsed representation of Global Call Reference, 3GPP TS 29.205 Table B 2.1.9.1.
Definition: gsm29205.h:33
osmo_lac_and_ci_id
Definition: gsm23003.h:50
osmo_lcls
LCLS-related parameters from 3GPP TS 48.008.
Definition: gsm0808_utils.h:64
osmo_lcls::control
enum gsm0808_lcls_control control
§3.2.2.117 Connection Status Control.
Definition: gsm0808_utils.h:66
osmo_lcls::gcr_available
bool gcr_available
Definition: gsm0808_utils.h:68
osmo_lcls::gcr
struct osmo_gcr_parsed gcr
§3.2.2.115 Global Call Reference.
Definition: gsm0808_utils.h:67
osmo_lcls::config
enum gsm0808_lcls_config config
§3.2.2.116 Configuration.
Definition: gsm0808_utils.h:65
osmo_lcls::corr_needed
bool corr_needed
§3.2.2.118 Correlation-Not-Needed.
Definition: gsm0808_utils.h:69
osmo_location_area_id
Definition: gsm23003.h:16
tlv_parsed
result of the TLV parser
Definition: tlv.h:522
value_string
tlv.h
gsm0808_cell_id_u
Instead of this, use either struct gsm0808_cell_id or gsm0808_cell_id_list2.
Definition: gsm0808_utils.h:41
gsm0808_cell_id_u::lac
uint16_t lac
Definition: gsm0808_utils.h:46
gsm0808_cell_id_u::global_ps
struct osmo_cell_global_id_ps global_ps
Definition: gsm0808_utils.h:47
gsm0808_cell_id_u::ci
uint16_t ci
Definition: gsm0808_utils.h:44
gsm0808_cell_id_u::global
struct osmo_cell_global_id global
Definition: gsm0808_utils.h:42
gsm0808_cell_id_u::lai_and_lac
struct osmo_location_area_id lai_and_lac
Definition: gsm0808_utils.h:45
gsm0808_cell_id_u::lac_and_ci
struct osmo_lac_and_ci_id lac_and_ci
Definition: gsm0808_utils.h:43