libosmogsm  1.3.0.107-6370
Osmocom GSM library
gsm48.h File Reference
#include <stdbool.h>
#include <osmocom/core/msgb.h>
#include <osmocom/gsm/tlv.h>
#include <osmocom/gsm/protocol/gsm_04_08.h>
#include <osmocom/gsm/gsm48_ie.h>
#include <osmocom/gsm/gsm23003.h>

Go to the source code of this file.

Data Structures

struct  gprs_ra_id
 

Macros

#define GSM_RESERVED_TMSI   0xFFFFFFFF
 
#define GSM_MCC_MNC_INVALID   0xFFFF
 
#define GSM48_MID_MAX_SIZE   11
 
#define gsm48_push_l3hdr_tid(msg, pdisc, tid, msg_type)   gsm48_push_l3hdr(msg, (pdisc & 0x0f) | (tid << 4), msg_type)
 

Functions

const char * gsm48_cc_state_name (uint8_t state)
 return string representation of CC State More...
 
const char * gsm48_cc_msg_name (uint8_t msgtype)
 return string representation of CC Message Type More...
 
const char * gsm48_rr_msg_name (uint8_t msgtype)
 return string representation of RR Message Type More...
 
const char * rr_cause_name (uint8_t cause)
 return string representation of RR Cause value More...
 
const char * osmo_rai_name (const struct gprs_ra_id *rai)
 Return MCC-MNC-LAC-RAC as string, in a static buffer. More...
 
char * osmo_rai_name_buf (char *buf, size_t buf_len, const struct gprs_ra_id *rai)
 Return MCC-MNC-LAC-RAC as string, in a caller-provided output buffer. More...
 
char * osmo_rai_name_c (const void *ctx, const struct gprs_ra_id *rai)
 Return MCC-MNC-LAC-RAC as string, in dynamically-allocated output buffer. More...
 
int gsm48_decode_lai (struct gsm48_loc_area_id *lai, uint16_t *mcc, uint16_t *mnc, uint16_t *lac) OSMO_DEPRECATED("Use gsm48_decode_lai2() instead
 
void gsm48_decode_lai2 (const struct gsm48_loc_area_id *lai, struct osmo_location_area_id *decoded)
 Decode TS 04.08 Location Area Identifier. More...
 
void gsm48_generate_lai (struct gsm48_loc_area_id *lai48, uint16_t mcc, uint16_t mnc, uint16_t lac) OSMO_DEPRECATED("Use gsm48_generate_lai2() instead
 
void gsm48_generate_lai2 (struct gsm48_loc_area_id *lai48, const struct osmo_location_area_id *lai)
 Encode TS 04.08 Location Area Identifier. More...
 
int gsm48_generate_mid_from_tmsi (uint8_t *buf, uint32_t tmsi)
 Generate TS 04.08 Mobile ID from TMSI. More...
 
int gsm48_generate_mid_from_imsi (uint8_t *buf, const char *imsi)
 Generate TS 04.08 Mobile ID from IMSI. More...
 
uint8_t gsm48_generate_mid (uint8_t *buf, const char *id, uint8_t mi_type)
 Generate TS 24.008 §10.5.1.4 Mobile ID of BCD type from ASCII string. More...
 
int gsm48_mi_to_string (char *string, int str_len, const uint8_t *mi, int mi_len)
 Convert TS 04.08 Mobile Identity (10.5.1.4) to string. More...
 
const char * gsm48_mi_type_name (uint8_t mi)
 return string representation of Mobile Identity Type More...
 
const char * osmo_mi_name (const uint8_t *mi, uint8_t mi_len)
 Return a human readable representation of a Mobile Identity in static buffer. More...
 
char * osmo_mi_name_buf (char *buf, size_t buf_len, const uint8_t *mi, uint8_t mi_len)
 Return a human readable representation of a Mobile Identity in caller-provided buffer. More...
 
char * osmo_mi_name_c (const void *ctx, const uint8_t *mi, uint8_t mi_len)
 Return a human readable representation of a Mobile Identity in dynamically-allocated buffer. More...
 
void gsm48_parse_ra (struct gprs_ra_id *raid, const uint8_t *buf)
 Parse TS 04.08 Routing Area Identifier. More...
 
void gsm48_encode_ra (struct gsm48_ra_id *out, const struct gprs_ra_id *raid)
 Encode a 3GPP TS 24.008 § 10.5.5.15 Routing area identification. More...
 
int gsm48_construct_ra (uint8_t *buf, const struct gprs_ra_id *raid) OSMO_DEPRECATED("Use gsm48_encode_ra() instead")
 Encode a TS 04.08 Routing Area Identifier. More...
 
int gsm48_number_of_paging_subchannels (struct gsm48_control_channel_descr *chan_desc)
 Determine number of paging sub-channels. More...
 
void gsm48_mcc_mnc_to_bcd (uint8_t *bcd_dst, uint16_t mcc, uint16_t mnc) OSMO_DEPRECATED("Use osmo_plmn_to_bcd() instead
 
void gsm48_mcc_mnc_from_bcd (uint8_t *bcd_src, uint16_t *mcc, uint16_t *mnc) OSMO_DEPRECATED("Use osmo_plmn_from_bcd() instead
 
struct gsm48_hdrgsm48_push_l3hdr (struct msgb *msg, uint8_t pdisc, uint8_t msg_type)
 Wrap a given msg with gsm48_hdr structure. More...
 

Variables

const struct tlv_definition gsm48_att_tlvdef
 TLV parser definitions for TS 04.08 CC. More...
 
const struct tlv_definition gsm48_rr_att_tlvdef
 TLV parser definitions for TS 04.08 RR. More...
 
const struct tlv_definition gsm48_mm_att_tlvdef
 TLV parser definitions for TS 04.08 MM. More...
 
int to not lose leading zeros in the MNC
 

Macro Definition Documentation

◆ GSM48_MID_MAX_SIZE

#define GSM48_MID_MAX_SIZE   11

◆ gsm48_push_l3hdr_tid

#define gsm48_push_l3hdr_tid (   msg,
  pdisc,
  tid,
  msg_type 
)    gsm48_push_l3hdr(msg, (pdisc & 0x0f) | (tid << 4), msg_type)

◆ GSM_MCC_MNC_INVALID

#define GSM_MCC_MNC_INVALID   0xFFFF

◆ GSM_RESERVED_TMSI

#define GSM_RESERVED_TMSI   0xFFFFFFFF

Function Documentation

◆ gsm48_decode_lai()

int gsm48_decode_lai ( struct gsm48_loc_area_id lai,
uint16_t *  mcc,
uint16_t *  mnc,
uint16_t *  lac 
)

◆ gsm48_generate_lai()

void gsm48_generate_lai ( struct gsm48_loc_area_id lai48,
uint16_t  mcc,
uint16_t  mnc,
uint16_t  lac 
)

◆ gsm48_mcc_mnc_from_bcd()

void gsm48_mcc_mnc_from_bcd ( uint8_t *  bcd_src,
uint16_t *  mcc,
uint16_t *  mnc 
)

◆ gsm48_mcc_mnc_to_bcd()

void gsm48_mcc_mnc_to_bcd ( uint8_t *  bcd_dst,
uint16_t  mcc,
uint16_t  mnc 
)

Variable Documentation

◆ MNC

void to not lose leading zeros in the MNC