libosmogsm  0.9.6.311-c977
Osmocom GSM library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Gsm0808

Helper functions regarding the TS 08.08 / 48.008 A interface. More...

Macros

#define BSSMAP_MSG_SIZE   512
 
#define BSSMAP_MSG_HEADROOM   128
 

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. More...
 
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. More...
 
struct msgb * gsm0808_create_reset (void)
 Create BSSMAP RESET message. More...
 
struct msgb * gsm0808_create_reset_ack (void)
 Create BSSMAP RESET ACK message. More...
 
struct msgb * gsm0808_create_clear_complete (void)
 Create BSSMAP Clear Complete message. More...
 
struct msgb * gsm0808_create_clear_command (uint8_t reason)
 Create BSSMAP Clear Command message. More...
 
struct msgb * gsm0808_create_cipher (const struct gsm0808_encrypt_info *ei, const uint8_t *cipher_response_mode)
 Create BSSMAP Cipher Mode Command message. More...
 
struct msgb * gsm0808_create_cipher_complete (struct msgb *layer3, uint8_t alg_id)
 Create BSSMAP Cipher Mode Complete message. More...
 
struct msgb * gsm0808_create_cipher_reject (uint8_t cause)
 Create BSSMAP Cipher Mode Reject message. More...
 
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. More...
 
struct msgb * gsm0808_create_sapi_reject (uint8_t link_id)
 Create BSSMAP SAPI N Reject message. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
struct msgb * gsm0808_create_assignment_failure (uint8_t cause, uint8_t *rr_cause)
 Create BSSMAP Assignment Failure message. More...
 
struct msgb * gsm0808_create_clear_rqst (uint8_t cause)
 Create BSSMAP Clear Request message. More...
 
struct msgb * gsm0808_create_paging (const char *imsi, const uint32_t *tmsi, const struct gsm0808_cell_id_list *cil, const uint8_t *chan_needed)
 Create BSSMAP PAGING message. More...
 
void gsm0808_prepend_dtap_header (struct msgb *msg, uint8_t link_id)
 Prepend a DTAP header to given Message Buffer. More...
 
struct msgb * gsm0808_create_dtap (struct msgb *msg_l3, uint8_t link_id)
 Create BSSMAP DTAP message. More...
 
const struct tlv_definitiongsm0808_att_tlvdef (void)
 
const char * gsm0808_bssmap_name (uint8_t msg_type)
 Return string name of BSSMAP Message Type. More...
 
const char * gsm0808_bssap_name (uint8_t msg_type)
 Return string name of BSSAP Message Type. More...
 

Variables

static const struct tlv_definition bss_att_tlvdef
 
static const struct value_string gsm0808_msgt_names []
 
static const struct value_string gsm0808_bssap_names []
 

Detailed Description

Helper functions regarding the TS 08.08 / 48.008 A interface.

Macro Definition Documentation

Function Documentation

const struct tlv_definition* gsm0808_att_tlvdef ( void  )

References bss_att_tlvdef.

const char* gsm0808_bssap_name ( uint8_t  msg_type)

Return string name of BSSAP Message Type.

References gsm0808_bssap_names.

const char* gsm0808_bssmap_name ( uint8_t  msg_type)

Return string name of BSSMAP Message Type.

References gsm0808_msgt_names.

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.

Parameters
[in]ctChannel Type
[in]cicCircuit Identity Code (Classic A only)
[in]ssSocket Address of MSC-side RTP socket (AoIP only)
[in]sclSpeech Codec List (AoIP only)
[in]ciCall Identifier (Optional, LCLS)
Returns
callee-allocated msgb with BSSMAP Assignment Request message

References BSSMAP_MSG_HEADROOM, BSSMAP_MSG_SIZE, gsm0808_enc_aoip_trasp_addr(), gsm0808_enc_channel_type(), gsm0808_enc_speech_codec_list(), msgb_tv_fixed_put(), msgb_tv_push(), and msgb_v_put().

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.

Parameters
[in]rr_causeGSM 04.08 RR Cause value
[in]chosen_channelChosen Channel
[in]encr_alg_idEncryption Algorithm ID
[in]speech_modeSpeech Mode
[in]ssSocket Address of BSS-side RTP socket
[in]scSpeech Codec (current)
[in]sclSpeech Codec List (permitted)
Returns
callee-allocated msgb with BSSMAP Assignment Complete message

References BSSMAP_MSG_HEADROOM, BSSMAP_MSG_SIZE, gsm0808_enc_aoip_trasp_addr(), gsm0808_enc_speech_codec(), gsm0808_enc_speech_codec_list(), msgb_tv_push(), msgb_tv_put(), and msgb_v_put().

Referenced by gsm0808_create_assignment_completed().

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.

Parameters
[in]causeBSSMAP Cause value
[in]rr_causeGSM 04.08 RR Cause value
[in]sclOptional Speech Cdec List (AoIP)
Returns
callee-allocated msgb with BSSMAP Assignment Failure message

References BSSMAP_MSG_HEADROOM, BSSMAP_MSG_SIZE, gsm0808_enc_speech_codec_list(), msgb_tlv_put(), msgb_tv_push(), msgb_tv_put(), and msgb_v_put().

Referenced by gsm0808_create_assignment_failure().

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.

Parameters
[in]rr_causeGSM 04.08 RR Cause value
[in]chosen_channelChosen Channel
[in]encr_alg_idEncryption Algorithm ID
[in]speech_modeSpeech Mode
Returns
callee-allocated msgb with BSSMAP Assignment Complete message

References gsm0808_create_ass_compl().

struct msgb* gsm0808_create_assignment_failure ( uint8_t  cause,
uint8_t *  rr_cause 
)

Create BSSMAP Assignment Failure message.

Parameters
[in]causeBSSMAP Cause value
[in]rr_causeGSM 04.08 RR Cause value
Returns
callee-allocated msgb with BSSMAP Assignment Failure message

References gsm0808_create_ass_fail().

struct msgb* gsm0808_create_cipher ( const struct gsm0808_encrypt_info *  ei,
const uint8_t *  cipher_response_mode 
)

Create BSSMAP Cipher Mode Command message.

Parameters
[in]eiMandatory Encryption Information
[in]cipher_response_modeoptional 1-byte Cipher Response Mode
Returns
callee-allocated msgb with BSSMAP Cipher Mode Command message

References BSSMAP_MSG_HEADROOM, BSSMAP_MSG_SIZE, gsm0808_enc_encrypt_info(), msgb_tv_push(), msgb_tv_put(), and msgb_v_put().

struct msgb* gsm0808_create_cipher_complete ( struct msgb *  layer3,
uint8_t  alg_id 
)

Create BSSMAP Cipher Mode Complete message.

Parameters
[in]layer3L3 Message to be included
[in]alg_idChosen Encrpytion Algorithm
Returns
callee-allocated msgb with BSSMAP Cipher Mode Complete message

References BSSMAP_MSG_HEADROOM, BSSMAP_MSG_SIZE, msgb_tlv_put(), msgb_tv_push(), msgb_tv_put(), and msgb_v_put().

struct msgb* gsm0808_create_cipher_reject ( uint8_t  cause)

Create BSSMAP Cipher Mode Reject message.

Parameters
[in]reasonTS 08.08 cause value
Returns
callee-allocated msgb with BSSMAP Cipher Mode Reject message

References BSSMAP_MSG_HEADROOM, BSSMAP_MSG_SIZE, msgb_tv_push(), and msgb_tv_put().

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.

Parameters
[in]cm2Classmark 2
[in]cm2_lenlength (in octets) of cm2
[in]cm3Classmark 3
[in]cm3_lenlength (in octets) of cm3
Returns
callee-allocated msgb with BSSMAP Classmark Update message

References BSSMAP_MSG_HEADROOM, BSSMAP_MSG_SIZE, msgb_tlv_put(), msgb_tv_push(), and msgb_v_put().

struct msgb* gsm0808_create_clear_command ( uint8_t  reason)

Create BSSMAP Clear Command message.

Parameters
[in]reasonTS 08.08 cause value
Returns
callee-allocated msgb with BSSMAP Clear Command message

References BSSMAP_MSG_HEADROOM, BSSMAP_MSG_SIZE, msgb_tlv_put(), msgb_tv_put(), and msgb_v_put().

struct msgb* gsm0808_create_clear_complete ( void  )

Create BSSMAP Clear Complete message.

Returns
callee-allocated msgb with BSSMAP Clear Complete message

References BSSMAP_MSG_HEADROOM, BSSMAP_MSG_SIZE, and msgb_tlv_put().

struct msgb* gsm0808_create_clear_rqst ( uint8_t  cause)

Create BSSMAP Clear Request message.

Parameters
[in]causeBSSMAP Cause value
Returns
callee-allocated msgb with BSSMAP Clear Request message

References BSSMAP_MSG_HEADROOM, BSSMAP_MSG_SIZE, msgb_tlv_put(), msgb_tv_push(), and msgb_v_put().

struct msgb* gsm0808_create_dtap ( struct msgb *  msg_l3,
uint8_t  link_id 
)

Create BSSMAP DTAP message.

Parameters
[in]msg_l3Messge Buffer containing Layer3 message
[in]link_idLink Identifier
Returns
callee-allocated msgb with BSSMAP DTAP message

References BSSMAP_MSG_HEADROOM, and BSSMAP_MSG_SIZE.

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.

Parameters
[in]msg_l3msgb containing Layer 3 Message
[in]ncMobile Network Code
[in]ccMobile Country Code
[in]lacLocation Area Code
[in]_ciCell Identity
Returns
callee-allocated msgb with Complete L3 Info message

References gsm0808_create_layer3_aoip().

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.

Parameters
[in]msg_l3msgb containing Layer 3 Message
[in]ncMobile Network Code
[in]ccMobile Country Code
[in]lacLocation Area Code
[in]_ciCell Identity
[in]sclSpeech Codec List
Returns
callee-allocated msgb with Complete L3 Info message

References __attribute__(), BSSMAP_MSG_HEADROOM, BSSMAP_MSG_SIZE, gsm0808_enc_speech_codec_list(), gsm48_generate_lai(), msgb_tlv_put(), msgb_tv_push(), and msgb_v_put().

Referenced by gsm0808_create_layer3().

struct msgb* gsm0808_create_paging ( const char *  imsi,
const uint32_t *  tmsi,
const struct gsm0808_cell_id_list *  cil,
const uint8_t *  chan_needed 
)

Create BSSMAP PAGING message.

Parameters
[in]imsiMandatory paged IMSI in string representation
[in]tmsiOptional paged TMSI
[in]cilCell Identity List (where to page)
[in]chan_neededChannel Type needed
Returns
callee-allocated msgb with BSSMAP PAGING message

References BSSMAP_MSG_HEADROOM, BSSMAP_MSG_SIZE, gsm0808_enc_cell_id_list(), gsm48_generate_mid_from_imsi(), msgb_tlv_put(), msgb_tv_push(), msgb_tv_put(), and msgb_v_put().

struct msgb* gsm0808_create_reset ( void  )

Create BSSMAP RESET message.

Returns
callee-allocated msgb with BSSMAP Reset message

References BSSMAP_MSG_HEADROOM, BSSMAP_MSG_SIZE, msgb_tlv_put(), msgb_tv_push(), and msgb_v_put().

struct msgb* gsm0808_create_reset_ack ( void  )

Create BSSMAP RESET ACK message.

Returns
callee-allocated msgb with BSSMAP Reset ACK message

References BSSMAP_MSG_HEADROOM, BSSMAP_MSG_SIZE, msgb_tv_push(), and msgb_v_put().

struct msgb* gsm0808_create_sapi_reject ( uint8_t  link_id)

Create BSSMAP SAPI N Reject message.

Parameters
[in]link_idLink Identifier
Returns
callee-allocated msgb with BSSMAP SAPI N Reject message

References BSSMAP_MSG_HEADROOM, BSSMAP_MSG_SIZE, msgb_tv_push(), and msgb_v_put().

void gsm0808_prepend_dtap_header ( struct msgb *  msg,
uint8_t  link_id 
)

Prepend a DTAP header to given Message Buffer.

Parameters
[in]msgbMessage Buffer
[in]link_idLink Identifier

Variable Documentation

const struct tlv_definition bss_att_tlvdef
static

Referenced by gsm0808_att_tlvdef().

const struct value_string gsm0808_bssap_names[]
static
Initial value:
= {
{ BSSAP_MSG_BSS_MANAGEMENT, "MANAGEMENT" },
{ BSSAP_MSG_DTAP, "DTAP" },
{ 0, NULL }
}

Referenced by gsm0808_bssap_name().

const struct value_string gsm0808_msgt_names[]
static

Referenced by gsm0808_bssmap_name().