Loading...
Searching...
No Matches
gsm0808.c File Reference
GSM 08.08 / 3GPP TS 48.008 A Interface

Helper functions regarding the TS 08.08 / 48.008 A interface, primarily message generation/encoding. More...

`#include "config.h"`
`#include <string.h>`
`#include <osmocom/core/byteswap.h>`
`#include <osmocom/core/endian.h>`
`#include <osmocom/gsm/gsm0808.h>`
`#include <osmocom/gsm/gsm0808_lcs.h>`
`#include <osmocom/gsm/gsm0808_utils.h>`
`#include <osmocom/gsm/protocol/gsm_08_08.h>`
`#include <osmocom/gsm/gsm48.h>`
`#include <osmocom/gsm/gad.h>`

## Macros

#define | B(X) (1 << (GSM0808_AMR_MODE_##X))

## Functions

struct msgb * | gsm0808_create_layer3_aoip (const struct msgb *msg_l3, uint16_t nc, uint16_t cc, int lac, uint16_t _ci, const struct gsm0808_speech_codec_list *scl)
| Create "Complete L3 Info" for AoIP, legacy implementation.
struct msgb * | gsm0808_create_layer3_2 (const struct msgb *msg_l3, const struct osmo_cell_global_id *cell, const struct gsm0808_speech_codec_list *scl)
| Create "Complete L3 Info" for AoIP.
struct msgb * | gsm0808_create_layer3 (struct msgb *msg_l3, uint16_t nc, uint16_t cc, int lac, uint16_t _ci)
| Create "Complete L3 Info" for A, legacy implementation.
struct msgb * | gsm0808_create_reset (void)
| Create BSSMAP RESET message.
struct msgb * | gsm0808_create_reset_ack (void)
| Create BSSMAP RESET ACK message.
struct msgb * | gsm0808_create_clear_complete (void)
| Create BSSMAP Clear Complete message.
struct msgb * | gsm0808_create_clear_command (uint8_t cause)
| Create BSSMAP Clear Command message with BSSAP header before l3h and BSSMAP in l3h.
struct msgb * | gsm0808_create_clear_command2 (uint8_t cause, bool csfb_ind)
| Create BSSMAP Clear Command message.
struct msgb * | gsm0808_create_cipher (const struct gsm0808_encrypt_info *ei, const uint8_t *cipher_response_mode)
| Superseded by gsm0808_create_cipher2() to include Kc128.
struct msgb * | gsm0808_create_cipher2 (const struct gsm0808_cipher_mode_command *cmc)
| Create BSSMAP Cipher Mode Command message.
struct msgb * | gsm0808_create_cipher_complete (struct msgb *layer3, uint8_t alg_id)
| Create BSSMAP Cipher Mode Complete message.
struct msgb * | gsm0808_create_cipher_reject (enum gsm0808_cause cause)
| Create BSSMAP Cipher Mode Reject message.
struct msgb * | gsm0808_create_cipher_reject_ext (enum gsm0808_cause_class class, uint8_t ext)
| Create BSSMAP Cipher Mode Reject message.
struct msgb * | gsm0808_create_lcls_conn_ctrl (enum gsm0808_lcls_config config, enum gsm0808_lcls_control control)
| Create BSSMAP LCLS CONNECT CONTROL message (TS 48.008 3.2.1.91).
struct msgb * | gsm0808_create_lcls_conn_ctrl_ack (enum gsm0808_lcls_status status)
| Create BSSMAP LCLS CONNECT CONTROL ACK message (TS 48.008 3.2.1.92).
struct msgb * | gsm0808_create_lcls_notification (enum gsm0808_lcls_status status, bool break_req)
| Create BSSMAP LCLS NOTIFICATION message (TS 48.008 3.2.1.93).
struct msgb * | gsm0808_create_classmark_request (void)
| Create BSSMAP Classmark Request message.
struct msgb * | gsm0808_create_classmark_update (const uint8_t *cm2, uint8_t cm2_len, const uint8_t *cm3, uint8_t cm3_len)
| Create BSSMAP Classmark Update message.
struct msgb * | gsm0808_create_sapi_reject_cause (uint8_t link_id, uint16_t cause)
| Create BSSMAP SAPI N Reject message.
struct msgb * | gsm0808_create_sapi_reject (uint8_t link_id)
| Create BSSMAP SAPI N Reject message (with hard-coded cause "BSS not equipped").
struct msgb * | gsm0808_create_ass2 (const struct gsm0808_channel_type *ct, const uint16_t *cic, const struct sockaddr_storage *ss, const struct gsm0808_speech_codec_list *scl, const uint32_t *ci, const uint8_t *kc, const struct osmo_lcls *lcls)
| Create BSSMAP Assignment Request message, 3GPP TS 48.008 §3.2.1.1.
struct msgb * | gsm0808_create_ass (const struct gsm0808_channel_type *ct, const uint16_t *cic, const struct sockaddr_storage *ss, const struct gsm0808_speech_codec_list *scl, const uint32_t *ci)
| Create BSSMAP Assignment Request message, 3GPP TS 48.008 §3.2.1.1.
struct msgb * | gsm0808_create_ass_compl2 (uint8_t rr_cause, uint8_t chosen_channel, uint8_t encr_alg_id, uint8_t speech_mode, const struct sockaddr_storage *ss, const struct gsm0808_speech_codec *sc, const struct gsm0808_speech_codec_list *scl, enum gsm0808_lcls_status lcls_bss_status)
| Create BSSMAP Assignment Completed message as per 3GPP TS 48.008 §3.2.1.2.
struct msgb * | gsm0808_create_ass_compl (uint8_t rr_cause, uint8_t chosen_channel, uint8_t encr_alg_id, uint8_t speech_mode, const struct sockaddr_storage *ss, const struct gsm0808_speech_codec *sc, const struct gsm0808_speech_codec_list *scl)
| Create BSSMAP Assignment Completed message.
struct msgb * | gsm0808_create_assignment_completed (uint8_t rr_cause, uint8_t chosen_channel, uint8_t encr_alg_id, uint8_t speech_mode)
| Create BSSMAP Assignment Completed message.
struct msgb * | gsm0808_create_ass_fail (uint8_t cause, const uint8_t *rr_cause, const struct gsm0808_speech_codec_list *scl)
| Create BSSMAP Assignment Failure message.
struct msgb * | gsm0808_create_assignment_failure (uint8_t cause, uint8_t *rr_cause)
| Create BSSMAP Assignment Failure message.
struct msgb * | gsm0808_create_clear_rqst (uint8_t cause)
| Create BSSMAP Clear Request message.
struct msgb * | gsm0808_create_paging2 (const char *imsi, const uint32_t *tmsi, const struct gsm0808_cell_id_list2 *cil, const uint8_t *chan_needed)
| Create BSSMAP PAGING message.
struct msgb * | gsm0808_create_paging (const char *imsi, const uint32_t *tmsi, const struct gsm0808_cell_id_list *cil, const uint8_t *chan_needed)
| DEPRECATED: Use gsm0808_create_paging2 instead.
static uint8_t | put_old_bss_to_new_bss_information (struct msgb *msg, const struct gsm0808_old_bss_to_new_bss_info *i)
struct msgb * | gsm0808_create_handover_required (const struct gsm0808_handover_required *params)
| Create BSSMAP HANDOVER REQUIRED message.
struct msgb * | gsm0808_create_handover_required_reject (const struct gsm0808_handover_required_reject *params)
| Create BSSMAP HANDOVER REQUIRED REJECT message.
struct msgb * | gsm0808_create_handover_request (const struct gsm0808_handover_request *params)
| Create BSSMAP HANDOVER REQUEST message, 3GPP TS 48.008 3.2.1.8.
struct msgb * | gsm0808_create_handover_request_ack2 (const struct gsm0808_handover_request_ack *params)
| Create BSSMAP HANDOVER REQUEST ACKNOWLEDGE message, 3GPP TS 48.008 3.2.1.10.
struct msgb * | gsm0808_create_handover_request_ack (const uint8_t *l3_info, uint8_t l3_info_len, uint8_t chosen_channel, uint8_t chosen_encr_alg, uint8_t chosen_speech_version)
| Same as gsm0808_create_handover_request_ack2() but with less parameters.
struct msgb * | gsm0808_create_handover_command (const struct gsm0808_handover_command *params)
| Create BSSMAP HANDOVER COMMAND message, 3GPP TS 48.008 3.2.1.11.
struct msgb * | gsm0808_create_handover_detect (void)
| Create BSSMAP HANDOVER DETECT message, 3GPP TS 48.008 3.2.1.40.
struct msgb * | gsm0808_create_handover_succeeded (void)
| Create BSSMAP HANDOVER SUCCEEDED message, 3GPP TS 48.008 3.2.1.13.
struct msgb * | gsm0808_create_handover_complete (const struct gsm0808_handover_complete *params)
| Create BSSMAP HANDOVER COMPLETE message, 3GPP TS 48.008 3.2.1.12.
struct msgb * | gsm0808_create_handover_failure (const struct gsm0808_handover_failure *params)
| Create BSSMAP HANDOVER FAILURE message, 3GPP TS 48.008 3.2.1.16.
struct msgb * | gsm0808_create_handover_performed (const struct gsm0808_handover_performed *params)
| Create BSSMAP HANDOVER PERFORMED message, 3GPP TS 48.008 3.2.1.25.
struct msgb * | gsm0808_create_common_id (const char *imsi, const struct osmo_plmn_id *selected_plmn_id, const struct osmo_plmn_id *last_used_eutran_plnm_id)
| Create BSSMAP COMMON ID message, 3GPP TS 48.008 3.2.1.68.
void | gsm0808_prepend_dtap_header (struct msgb *msg, uint8_t link_id)
| Prepend a DTAP header to given Message Buffer.
struct msgb * | gsm0808_create_dtap (struct msgb *msg_l3, uint8_t link_id)
| Create BSSMAP DTAP message.
struct msgb * | gsm0808_create_perform_location_request (const struct gsm0808_perform_location_request *params)
struct msgb * | gsm0808_create_perform_location_response (const struct gsm0808_perform_location_response *params)
int | gsm0808_enc_lcs_cause (struct msgb *msg, const struct lcs_cause_ie *lcs_cause)
struct msgb * | gsm0808_create_perform_location_abort (const struct lcs_cause_ie *lcs_cause)
struct msgb * | gsm0808_create_vgcs_vbs_setup (const struct gsm0808_vgcs_vbs_setup *params)
| Create BSSMAP VGCS/VBS SETUP message, 3GPP TS 48.008 3.2.1.50.
struct msgb * | gsm0808_create_vgcs_vbs_setup_ack (const struct gsm0808_vgcs_vbs_setup_ack *params)
| Create BSSMAP VGCS/VBS SETUP ACK message, 3GPP TS 48.008 3.2.1.51.
struct msgb * | gsm0808_create_vgcs_vbs_setup_refuse (enum gsm0808_cause cause)
| 3GPP TS 48.008 §3.2.1.52 VGCS/VBS SETUP REFUSE
struct msgb * | gsm0808_create_vgcs_vbs_assign_req (const struct gsm0808_vgcs_vbs_assign_req *params)
| Create BSSMAP VGCS/VBS ASSIGNMENT REQUEST message, 3GPP TS 48.008 3.2.1.53.
struct msgb * | gsm0808_create_vgcs_vbs_assign_res (const struct gsm0808_vgcs_vbs_assign_res *params)
| Create BSSMAP VGCS/VBS ASSIGNMENT RESULT message, 3GPP TS 48.008 3.2.1.54.
struct msgb * | gsm0808_create_vgcs_vbs_assign_fail (const struct gsm0808_vgcs_vbs_assign_fail *params)
| Create BSSMAP VGCS/VBS ASSIGNMENT FAILURE message, 3GPP TS 48.008 3.2.1.55.
struct msgb * | gsm0808_create_vgcs_queuing_ind (void)
| Create BSSMAP VGCS/VBS QUEUING INDICATION message, 3GPP TS 48.008 3.2.1.56.
struct msgb * | gsm0808_create_uplink_request (const struct gsm0808_uplink_request *params)
| Create BSSMAP (VGCS) UPLINK REQUEST message, 3GPP TS 48.008 3.2.1.57.
struct msgb * | gsm0808_create_uplink_request_ack (const struct gsm0808_uplink_request_ack *params)
| Create BSSMAP (VGCS) UPLINK REQUEST ACKNOWLEDGE message, 3GPP TS 48.008 3.2.1.58.
struct msgb * | gsm0808_create_uplink_request_cnf (const struct gsm0808_uplink_request_cnf *params)
| Create BSSMAP (VGCS) UPLINK CONFIRM message, 3GPP TS 48.008 3.2.1.59.
struct msgb * | gsm0808_create_uplink_app_data (const struct gsm0808_uplink_app_data *params)
| Create BSSMAP (VGCS) UPLINK APPLICATION DATA message, 3GPP TS 48.008 3.2.1.59a.
struct msgb * | gsm0808_create_uplink_release_ind (const struct gsm0808_uplink_release_ind *params)
| Create BSSMAP (VGCS) UPLINK RELEASE INDICATION message, 3GPP TS 48.008 3.2.1.60.
struct msgb * | gsm0808_create_uplink_reject_cmd (const struct gsm0808_uplink_reject_cmd *params)
| Create BSSMAP (VGCS) UPLINK REJECT COMMAND message, 3GPP TS 48.008 3.2.1.61.
struct msgb * | gsm0808_create_uplink_release_cmd (const enum gsm0808_cause cause)
| 3GPP TS 48.008 §3.2.1.62 (VGCS) UPLINK RELEASE COMMAND
struct msgb * | gsm0808_create_uplink_seized_cmd (const struct gsm0808_uplink_seized_cmd *params)
| Create BSSMAP (VGCS) UPLINK SEIZED COMMAND message, 3GPP TS 48.008 3.2.1.62.
struct msgb * | gsm0808_create_vgcs_additional_info (const struct gsm0808_talker_identity *ti)
| 3GPP TS 48.008 §3.2.1.78 VGCS ADDITIONAL INFORMATION
struct msgb * | gsm0808_create_vgcs_vbs_area_cell_info (const struct gsm0808_vgcs_vbs_area_cell_info *params)
| Create BSSMAP VGCS/VBS AREA CELL INFO message, 3GPP TS 48.008 3.2.1.79.
struct msgb * | gsm0808_create_vgcs_vbs_assign_stat (const struct gsm0808_vgcs_vbs_assign_stat *params)
| Create BSSMAP VGCS/VBS ASSIGNMENT STATUS message, 3GPP TS 48.008 3.2.1.80.
struct msgb * | gsm0808_create_vgcs_sms (const struct gsm0808_sms_to_vgcs *sms)
| 3GPP TS 48.008 §3.2.1.81 VGCS SMS
struct msgb * | gsm0808_create_notification_data (const struct gsm0808_notification_data *params)
| Create BSSMAP (VGCS/VBS) NOTIFICATION DATA message, 3GPP TS 48.008 3.2.1.82.
const struct tlv_definition * | gsm0808_att_tlvdef (void)
const char * | gsm0808_bssmap_name (uint8_t msg_type)
| Return string name of BSSMAP Message Type.
const char * | gsm0808_bssap_name (uint8_t msg_type)
| Return string name of BSSAP Message Type.
const char * | gsm0808_cause_class_name (enum gsm0808_cause_class class)
| Return string name of BSSMAP Cause Class name.
const char * | gsm0808_cause_name (enum gsm0808_cause cause)
| Return string name of BSSMAP Cause name.
enum gsm0808_cause | gsm0808_get_cause (const struct tlv_parsed *tp)
| Parse Cause TLV 3GPP TS 08.08 §3.2.2.5.
const char * | gsm0808_diagnostics_octet_location_str (uint8_t pointer)
const char * | gsm0808_diagnostics_bit_location_str (uint8_t bit_pointer)

## Variables

static __thread char | str_buff [512]
| Char buffer to return strings from functions.
static const struct tlv_definition | bss_att_tlvdef
const struct tlv_definition | gsm0808_old_bss_to_new_bss_info_att_tlvdef
const struct value_string | gsm0406_dlci_sapi_names []
static const struct value_string | gsm0808_msgt_names []
static const struct value_string | gsm0808_bssap_names []
const struct value_string | gsm0808_speech_codec_type_names []
const struct value_string | gsm0808_permitted_speech_names []
const struct value_string | gsm0808_chosen_enc_alg_names []
static const struct value_string | gsm0808_cause_names []
static const struct value_string | gsm0808_cause_class_names []
const struct value_string | gsm0808_lcls_config_names []
const struct value_string | gsm0808_lcls_control_names []
const struct value_string | gsm0808_lcls_status_names []
const uint8_t | gsm0808_amr_modes_from_cfg [2][16]
const struct value_string | gsm0808_amr_mode_names []

## Detailed Description

Helper functions regarding the TS 08.08 / 48.008 A interface, primarily message generation/encoding.

## Macro Definition Documentation

## B

#define B | ( |  | X | ) | (1 << (GSM0808_AMR_MODE_##X))