libosmogsm 1.13.1.1-afb4 Osmocom GSM library

Data Structures | Macros | Enumerations | Functions | Variables
gsm0808_utils.h File Reference
GSM 08.08 / 3GPP TS 48.008 A Interface
`#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>`
`#include <osmocom/gsm/gsm48.h>`
`#include <osmocom/core/endian.h>`

Go to the source code of this file.

## Data Structures
union | gsm0808_cell_id_u
| Instead of this, use either struct gsm0808_cell_id or gsm0808_cell_id_list2. More...
struct | gsm0808_cell_id
| Parsed representation of Cell Identifier IE (3GPP TS 48.008 3.2.2.17) More...
struct | gsm0808_cell_id_list2
| Parsed representation of a Cell Identifier List IE (3GPP TS 48.008 3.2.2.27). More...
struct | gsm0808_priority
| Packed representation of a Priority IE (GGPP TS 48.008 3.2.2.18) More...
struct | gsm0808_vgcs_feature_flags
| Packed representation of a VGCS Feature Flags IE (3GPP TS 48.008 3.2.2.88) More...
struct | gsm0808_group_callref
| Packed representation of a Group Call Reference IE (3GPP TS 48.008 3.2.2.55) More...
struct | gsm0808_cell_id_list_segment
| Parsed representation of a Cell Identifier List Segment IE (3GPP TS 48.008 3.2.2.27a) More...
struct | gsm0808_circuit_pool_list
struct | gsm0808_layer_3_information
struct | gsm0808_talker_identity
struct | gsm0808_sms_to_vgcs
struct | gsm0808_application_data
struct | gsm0808_data_identity
struct | osmo_lcls
| LCLS-related parameters from 3GPP TS 48.008. More...

## Macros
#define | GSM0808_CELL_ID_LIST2_MAXLEN 127
| (225-1)/2 is the maximum number of elements in a cell identifier list. More...
#define | CIRCUIT_POOL_LIST_MAXLEN 252
| Parsed representation of a Circuit Pool List IE (3GPP TS 48.008 3.2.2.26) More...
#define | LAYER_3_INFORMATION_MAXLEN 252
| Parsed representation of a Layer 3 Information IE (3GPP TS 48.008 3.2.2.24) More...
#define | TALKER_IDENTITY_MAXLEN 17
| Parsed representation of a Talker Identity IE (3GPP TS 48.008 3.2.2.91) More...
#define | SMS_TO_VGCS_MAXLEN 252
| Parsed representation of a SMS to VGCS IE (3GPP TS 48.008 3.2.2.92) More...
#define | APP_DATA_MAXLEN 9
| Parsed representation of a Application Data IE (3GPP TS 48.008 3.2.2.98) More...
#define | GSM0808_DP_MASK_TALKERS_LISTENERS 0x04
#define | GSM0808_DP_MASK_DISPATCHERS 0x02
#define | GSM0808_DP_MASK_NETWORK_APP 0x01
#define | MSISDN_MAXLEN 20
| Parsed representation of a MSISDN IE (3GPP TS 48.008 3.2.2.101) More...
#define | MODE_TYPE(mode, type) ((mode << 16) | type)

## Enumerations
enum | gsm0808_assignment_requirement { GSM0808_ASRQ_DELAY_ALLOWED = 0x00 , GSM0808_ASRQ_IMMEDIATE = 0x01 , GSM0808_ASRQ_IMMEDIATE_ON_DEMAND = 0x02 }
enum | gsm0808_service_flag { GSM0808_SF_VBS = 0 , GSM0808_SF_VGCS = 1 }
enum | gsm0808_call_priority { GSM0808_CALL_PRIORITY_NONE = 0x00 , GSM0808_CALL_PRIORITY_LEVEL_4 = 0x01 , GSM0808_CALL_PRIORITY_LEVEL_3 = 0x02 , GSM0808_CALL_PRIORITY_LEVEL_2 = 0x03 , GSM0808_CALL_PRIORITY_LEVEL_1 = 0x04 , GSM0808_CALL_PRIORITY_LEVEL_0 = 0x05 , GSM0808_CALL_PRIORITY_LEVEL_B = 0x06 , GSM0808_CALL_PRIORITY_LEVEL_A = 0x07 }
enum | gsm0808_downlink_dtx_flag { GSM0808_DTX_FLAG_ALLOW = 0 , GSM0808_DTX_FLAG_FORBID = 1 }
enum | gsm0808_talker_priority { GSM0808_TALKER_PRIORITY_NORMAL = 0x00 , GSM0808_TALKER_PRIORITY_PRIVILEGED = 0x01 , GSM0808_TALKER_PRIORITY_EMERGENCY = 0x02 }
enum | gsm0808_vgcs_vbs_cell_status { GSM0808_CSTAT_ESTABLISHED = 0x00 , GSM0808_CSTAT_NOT_ESTABLISHED1 = 0x01 , GSM0808_CSTAT_RELEASED_NO_USER = 0x02 , GSM0808_CSTAT_NOT_ESTABLISHED2 = 0x03 }
enum | gsm0808_application_idndicator { GSM0808_AI_APP_DATA = 0x00 , GSM0808_AI_CONFIRM_APP_DATA = 0x01 }
| Packed representation of a Data Identity IE (GGPP TS 48.008 3.2.2.99) More...

## Functions
struct gsm0808_priority | __attribute__ ((packed))
char * | osmo_lcls_dump (const struct osmo_lcls *lcls)
| Dump LCLS parameters (GCR excluded) into static string buffer for printing. More...
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. More...
char * | osmo_lcls_dump_c (void *ctx, const struct osmo_lcls *lcls)
char * | osmo_gcr_dump (const struct osmo_lcls *lcls)
| Dump GCR struct into static string buffer for printing. More...
char * | osmo_gcr_dump_buf (char *buf, size_t buf_len, const struct osmo_lcls *lcls)
| Dump GCR struct into string for printing. More...
static const char * | gsm0808_cell_id_discr_name (enum CELL_IDENT id_discr)
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". More...
const char * | gsm0808_cell_id_name2 (const struct gsm0808_cell_id *cid)
| Like gsm0808_cell_id_name() but uses a different static buffer. More...
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)
| Return a human-readable representation of cil in a static buffer. More...
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, 456}". More...
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)
| Print a human readable name of the cell identifier to the char buffer. More...
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. More...
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. More...
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. More...
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. More...
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)
| Decode a single GSM 08.08 Cell ID list element payload. More...
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)
| Add LCLS parameters to a given msgb, 3GPP TS 48.008 §3.2.2.115 - 3.2.2.120. More...
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. More...
uint8_t | gsm0808_enc_speech_codec (struct msgb *msg, const struct gsm0808_speech_codec *sc) OSMO_DEPRECATED("use gsm0808_enc_speech_codec2() instead")
| Deprecated: gsm0808_enc_speech_codec2() wrapper for backwards compatibility. More...
int | gsm0808_enc_speech_codec2 (struct msgb *msg, const struct gsm0808_speech_codec *sc)
| Encode TS 08.08 Speech Codec IE. More...
int | gsm0808_dec_speech_codec (struct gsm0808_speech_codec *sc, const uint8_t *elem, uint8_t len)
| Decode TS 08.08 Speech Codec IE. More...
uint8_t | gsm0808_enc_speech_codec_list (struct msgb *msg, const struct gsm0808_speech_codec_list *scl) OSMO_DEPRECATED("use gsm0808_enc_speech_codec_list2() instead")
| Deprecated: gsm0808_enc_speech_codec_list2() wrapper for backwards compatibility. More...
int | gsm0808_enc_speech_codec_list2 (struct msgb *msg, const struct gsm0808_speech_codec_list *scl)
| Encode TS 08.08 Speech Codec list. More...
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. More...
uint8_t | gsm0808_enc_channel_type (struct msgb *msg, const struct gsm0808_channel_type *ct)
| Encode TS 08.08 Channel Type IE. More...
int | gsm0808_dec_channel_type (struct gsm0808_channel_type *ct, const uint8_t *elem, uint8_t len)
| Decode TS 08.08 Channel Type IE. More...
uint8_t | gsm0808_enc_encrypt_info (struct msgb *msg, const struct gsm0808_encrypt_info *ei)
| Encode TS 08.08 Encryption Information IE. More...
int | gsm0808_dec_encrypt_info (struct gsm0808_encrypt_info *ei, const uint8_t *elem, uint8_t len)
| Decode TS 08.08 Encryption Information IE. More...
int | gsm0808_enc_kc128 (struct msgb *msg, const uint8_t *kc128)
| Encode TS 48.008 Kc128 IE. More...
int | gsm0808_dec_kc128 (uint8_t *kc128, const uint8_t *elem, uint8_t len)
| Decode TS 48.008 Kc128 IE. More...
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. More...
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. More...
int | gsm0808_dec_cell_id_list2 (struct gsm0808_cell_id_list2 *cil, const uint8_t *elem, uint8_t len)
| Decode Cell Identifier List IE. More...
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. More...
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. More...
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. More...
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). More...
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). More...
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_channel_type to the speech codec representation we use in struct gsm0808_speech_codec. More...
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). More...
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.08 AMR configuration struct. More...
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) More...
static enum gsm0808_cause_class | gsm0808_cause_class (enum gsm0808_cause cause)
static bool | gsm0808_cause_ext (enum gsm0808_cause cause)
int | gsm0808_get_cipher_reject_cause (const struct tlv_parsed *tp) OSMO_DEPRECATED("Use gsm0808_get_cause() instead")
static uint8_t | gsm0808_current_channel_type_1 (enum gsm_chan_t type)
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.2.2.11 Channel Type. More...
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. More...
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)
uint8_t | gsm0808_enc_group_callref (struct msgb *msg, const struct gsm0808_group_callref *gc)
| Encode Group Call Reference IE (3GPP TS 48.008 3.2.2.55). More...
int | gsm0808_dec_group_callref (struct gsm0808_group_callref *gc, const uint8_t *elem, uint8_t len)
| Decode Group Call Reference IE (3GPP TS 48.008 3.2.2.55). More...
uint8_t | gsm0808_enc_priority (struct msgb *msg, const struct gsm0808_priority *pri)
| Encode Priority IE (3GPP TS 48.008 3.2.2.18). More...
int | gsm0808_dec_priority (struct gsm0808_priority *pri, const uint8_t *elem, uint8_t len)
| Decode Priority IE (3GPP TS 48.008 3.2.2.18). More...
uint8_t | gsm0808_enc_vgcs_feature_flags (struct msgb *msg, const struct gsm0808_vgcs_feature_flags *ff)
| Encode VGCS Feature Flags IE (3GPP TS 48.008 3.2.2.88). More...
int | gsm0808_dec_vgcs_feature_flags (struct gsm0808_vgcs_feature_flags *ff, const uint8_t *elem, uint8_t len)
| Decode VGCS Feature Flags IE (3GPP TS 48.008 3.2.2.88). More...
uint8_t | gsm0808_enc_talker_identity (struct msgb *msg, const struct gsm0808_talker_identity *ti)
| Encode Talker Identity IE (3GPP TS 48.008 3.2.2.91). More...
int | gsm0808_dec_talker_identity (struct gsm0808_talker_identity *ti, const uint8_t *elem, uint8_t len)
| Decode Talker Identity IE (3GPP TS 48.008 3.2.2.91). More...
uint8_t | gsm0808_enc_data_identity (struct msgb *msg, const struct gsm0808_data_identity *ai)
| Encode Data Identity IE (3GPP TS 48.008 3.2.2.99). More...
int | gsm0808_dec_data_identity (struct gsm0808_data_identity *ai, const uint8_t *elem, uint8_t len)
| Decode Data Identity IE (3GPP TS 48.008 3.2.2.99). More...
uint8_t | gsm0808_enc_msisdn (struct msgb *msg, const char *msisdn)
| Encode MSISDN IE (3GPP TS 48.008 3.2.2.101). More...
int | gsm0808_dec_msisdn (char *msisdn, const char *elem, uint8_t len)
| Decode MSISDN IE (3GPP TS 48.008 3.2.2.101). More...
uint8_t | gsm0808_enc_assign_req (struct msgb *msg, const enum gsm0808_assignment_requirement ar)
| Encode Assignment Requirements IE (3GPP TS 48.008 3.2.2.52). More...
int | gsm0808_dec_assign_req (enum gsm0808_assignment_requirement *ar, const uint8_t *elem, uint8_t len)
| Decode Assignment Requirements IE (3GPP TS 48.008 3.2.2.52). More...
uint8_t | gsm0808_enc_cell_id_list_segment (struct msgb *msg, uint8_t ie_type, const struct gsm0808_cell_id_list_segment *ci)
| Encode Cell Identifier List Segment IE (3GPP TS 48.008 3.2.2.27a). More...
int | gsm0808_dec_cell_id_list_segment (struct gsm0808_cell_id_list_segment *ci, const uint8_t *elem, uint8_t len)
| Decode Cell Identifier List Segment IE (3GPP TS 48.008 3.2.2.27a). More...
int | gsm0808_dec_call_id (uint32_t *ci, const uint8_t *elem, uint8_t len)
| Decode Call Identifier IE (3GPP TS 48.008 3.2.2.105). More...

## Variables
enum gsm0808_assignment_requirement | __attribute__
const struct value_string | gsm0808_cell_id_discr_names []
| value_string[] for enum CELL_IDENT. More...

## Macro Definition Documentation

## ◆ MODE_TYPE

#define MODE_TYPE | ( |  | mode,
|  |  | type
| ) |  | ((mode << 16) | type)