libosmogsm  1.3.1
Osmocom GSM library
Gsm0408

GSM Mobile Radion Interface L3 messages / TS 04.08. More...

Functions

const char * rr_cause_name (uint8_t cause)
 return string representation of RR Cause value 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...
 
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_c (const void *ctx, const struct gprs_ra_id *rai)
 Return MCC-MNC-LAC-RAC as string, in dynamically-allocated output buffer. More...
 
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 * gsm48_mi_type_name (uint8_t mi)
 return string representation of Mobile Identity Type 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...
 
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_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...
 
bool gsm48_hdr_gmm_cipherable (const struct gsm48_hdr *hdr)
 Checks is particular message is cipherable in A/Gb mode according to 3GPP TS 24.008 § 4.7.1.2. More...
 
void gsm48_mcc_mnc_to_bcd (uint8_t *bcd_dst, uint16_t mcc, uint16_t mnc)
 
void gsm48_mcc_mnc_from_bcd (uint8_t *bcd_src, uint16_t *mcc, uint16_t *mnc)
 
void gsm48_generate_lai (struct gsm48_loc_area_id *lai48, uint16_t mcc, uint16_t mnc, uint16_t lac)
 Encode TS 04.08 Location Area Identifier, legacy implementation. More...
 
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_decode_lai (struct gsm48_loc_area_id *lai, uint16_t *mcc, uint16_t *mnc, uint16_t *lac)
 Decode TS 04.08 Location Area Identifier, legacy implementation. More...
 
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_set_dtx (struct gsm48_cell_options *op, enum gsm48_dtx_mode full, enum gsm48_dtx_mode half, bool is_bcch)
 Set DTX mode in Cell Options IE (3GPP TS 44.018) More...
 
int gsm48_generate_mid_from_tmsi (uint8_t *buf, uint32_t tmsi)
 Generate TS 04.08 Mobile ID from TMSI. 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_generate_mid_from_imsi (uint8_t *buf, const char *imsi)
 Generate TS 04.08 Mobile ID from IMSI. 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...
 
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)
 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...
 
char * gsm48_pdisc_msgtype_name_buf (char *buf, size_t buf_len, uint8_t pdisc, uint8_t msg_type)
 Compose a string naming the message type for given protocol, in a caller-provided buffer. More...
 
const char * gsm48_pdisc_msgtype_name (uint8_t pdisc, uint8_t msg_type)
 Compose a string naming the message type for given protocol, in a static buffer. More...
 
char * gsm48_pdisc_msgtype_name_c (const void *ctx, uint8_t pdisc, uint8_t msg_type)
 Compose a string naming the message type for given protocol, in a dynamically-allocated buffer. More...
 
struct gsm48_hdrgsm48_push_l3hdr (struct msgb *msg, uint8_t pdisc, uint8_t msg_type)
 Wrap a given msg with gsm48_hdr structure. More...
 
bool osmo_gsm48_classmark1_is_r99 (const struct gsm48_classmark1 *cm1)
 
bool osmo_gsm48_classmark2_is_r99 (const struct gsm48_classmark2 *cm2, uint8_t cm2_len)
 
bool osmo_gsm48_classmark_is_r99 (const struct osmo_gsm48_classmark *cm)
 Return true if any of Classmark 1 or Classmark 2 are present and indicate R99 capability. More...
 
char * osmo_gsm48_classmark_a5_name_buf (char *buf, size_t buf_len, const struct osmo_gsm48_classmark *cm)
 Return a string representation of A5 cipher algorithms indicated by Classmark 1, 2 and 3. More...
 
const char * osmo_gsm48_classmark_a5_name (const struct osmo_gsm48_classmark *cm)
 Return a string representation of A5 cipher algorithms indicated by Classmark 1, 2 and 3. More...
 
char * osmo_gsm48_classmark_a5_name_c (const void *ctx, const struct osmo_gsm48_classmark *cm)
 Return a string representation of A5 cipher algorithms indicated by Classmark 1, 2 and 3. More...
 
void osmo_gsm48_classmark_update (struct osmo_gsm48_classmark *dst, const struct osmo_gsm48_classmark *src)
 Overwrite dst with the Classmark information present in src. More...
 
int osmo_gsm48_classmark_supports_a5 (const struct osmo_gsm48_classmark *cm, uint8_t a5)
 Determine if the given Classmark (1/2/3) value permits a given A5/n cipher. More...
 
int8_t osmo_gsm48_rfpowercap2powerclass (enum gsm_band band, uint8_t rf_power_cap)
 Decode power class from Classmark1/2 RF power capability field. More...
 
int gsm48_decode_bcd_number (char *output, int output_len, const uint8_t *bcd_lv, int h_len)
 Like gsm48_decode_bcd_number2() but with less airtight bounds checking. More...
 
int gsm48_decode_bcd_number2 (char *output, size_t output_len, const uint8_t *bcd_lv, size_t input_len, size_t h_len)
 Decode a 'called/calling/connect party BCD number' as in 10.5.4.7. More...
 
static int asc_to_bcd (const char asc)
 convert a single ASCII character to call-control BCD More...
 
int gsm48_encode_bcd_number (uint8_t *bcd_lv, uint8_t max_len, int h_len, const char *input)
 convert a ASCII phone number to 'called/calling/connect party BCD number' More...
 
int gsm48_decode_bearer_cap (struct gsm_mncc_bearer_cap *bcap, const uint8_t *lv)
 Decode TS 04.08 Bearer Capability IE (10.5.4.5) More...
 
int gsm48_encode_bearer_cap (struct msgb *msg, int lv_only, const struct gsm_mncc_bearer_cap *bcap)
 Encode TS 04.08 Bearer Capability IE (10.5.4.5) More...
 
int gsm48_decode_cccap (struct gsm_mncc_cccap *ccap, const uint8_t *lv)
 Decode TS 04.08 Call Control Capabilities IE (10.5.4.5a) More...
 
int gsm48_encode_cccap (struct msgb *msg, const struct gsm_mncc_cccap *ccap)
 Encodoe TS 04.08 Call Control Capabilities (10.5.4.5a) More...
 
int gsm48_decode_called (struct gsm_mncc_number *called, const uint8_t *lv)
 Decode TS 04.08 Called Party BCD Number IE (10.5.4.7) More...
 
int gsm48_encode_called (struct msgb *msg, const struct gsm_mncc_number *called)
 Encode TS 04.08 Called Party IE (10.5.4.7) More...
 
int gsm48_decode_callerid (struct gsm_mncc_number *callerid, const uint8_t *lv)
 Decode TS 04.08 Caller ID. More...
 
int gsm48_encode_callerid (struct msgb *msg, int ie, int max_len, const struct gsm_mncc_number *callerid)
 Encode TS 04.08 Caller ID IE. More...
 
int gsm48_decode_cause (struct gsm_mncc_cause *cause, const uint8_t *lv)
 Decode TS 04.08 Cause IE (10.5.4.11) More...
 
int gsm48_encode_cause (struct msgb *msg, int lv_only, const struct gsm_mncc_cause *cause)
 Encode TS 04.08 Cause IE (10.5.4.11) More...
 
int gsm48_decode_calling (struct gsm_mncc_number *calling, const uint8_t *lv)
 Decode TS 04.08 Calling Number IE (10.5.4.9) More...
 
int gsm48_encode_calling (struct msgb *msg, const struct gsm_mncc_number *calling)
 Encode TS 04.08 Calling Number IE (10.5.4.9) More...
 
int gsm48_decode_connected (struct gsm_mncc_number *connected, const uint8_t *lv)
 Decode TS 04.08 Connected Number IE (10.5.4.13) More...
 
int gsm48_encode_connected (struct msgb *msg, const struct gsm_mncc_number *connected)
 Encode TS 04.08 Connected Number IE (10.5.4.13) More...
 
int gsm48_decode_redirecting (struct gsm_mncc_number *redirecting, const uint8_t *lv)
 Decode TS 04.08 Redirecting Number IE (10.5.4.21b) More...
 
int gsm48_encode_redirecting (struct msgb *msg, const struct gsm_mncc_number *redirecting)
 Encode TS 04.08 Redirecting Number IE (10.5.4.21b) More...
 
int gsm48_decode_facility (struct gsm_mncc_facility *facility, const uint8_t *lv)
 Decode TS 04.08 Facility IE (10.5.4.15) More...
 
int gsm48_encode_facility (struct msgb *msg, int lv_only, const struct gsm_mncc_facility *facility)
 Encode TS 04.08 Facility IE (10.5.4.15) More...
 
int gsm48_decode_notify (int *notify, const uint8_t *v)
 Decode TS 04.08 Notify IE (10.5.4.20) More...
 
int gsm48_encode_notify (struct msgb *msg, int notify)
 Encode TS 04.08 Notify IE (10.5.4.20) More...
 
int gsm48_decode_signal (int *signal, const uint8_t *v)
 Decode TS 04.08 Signal IE (10.5.4.23) More...
 
int gsm48_encode_signal (struct msgb *msg, int signal)
 Encode TS 04.08 Signal IE (10.5.4.23) More...
 
int gsm48_decode_keypad (int *keypad, const uint8_t *lv)
 Decode TS 04.08 Keypad IE (10.5.4.17) More...
 
int gsm48_encode_keypad (struct msgb *msg, int keypad)
 Encode TS 04.08 Keypad IE (10.5.4.17) More...
 
int gsm48_decode_progress (struct gsm_mncc_progress *progress, const uint8_t *lv)
 Decode TS 04.08 Progress IE (10.5.4.21) More...
 
int gsm48_encode_progress (struct msgb *msg, int lv_only, const struct gsm_mncc_progress *p)
 Encode TS 04.08 Progress IE (10.5.4.21) More...
 
int gsm48_decode_useruser (struct gsm_mncc_useruser *uu, const uint8_t *lv)
 Decode TS 04.08 User-User IE (10.5.4.25) More...
 
int gsm48_encode_useruser (struct msgb *msg, int lv_only, const struct gsm_mncc_useruser *uu)
 Encode TS 04.08 User-User IE (10.5.4.25) More...
 
int gsm48_decode_ssversion (struct gsm_mncc_ssversion *ssv, const uint8_t *lv)
 Decode TS 04.08 SS Version IE (10.5.4.24) More...
 
int gsm48_encode_ssversion (struct msgb *msg, const struct gsm_mncc_ssversion *ssv)
 Encode TS 04.08 SS Version IE (10.5.4.24) More...
 
int gsm48_encode_more (struct msgb *msg)
 Encode TS 04.08 More Data IE (10.5.4.19) More...
 
static int32_t smod (int32_t n, int32_t m)
 
int gsm48_decode_freq_list (struct gsm_sysinfo_freq *f, uint8_t *cd, uint8_t len, uint8_t mask, uint8_t frqt)
 Decode TS 04.08 Cell Channel Description IE (10.5.2.1b) and other frequency lists. More...
 
bool gprs_ms_net_cap_gea_supported (const uint8_t *ms_net_cap, uint8_t cap_len, enum gprs_ciph_algo gea)
 Check if MS supports particular version of GEA by inspecting MS network capability IE specified in 3GPP TS 24.008. 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...
 
static const struct value_string rr_cause_names []
 
static const char * cc_state_names [32]
 
static const struct value_string cc_msg_names []
 
static const struct value_string rr_msg_names []
 
const struct value_string gsm48_chan_mode_names []
 
const struct value_string gsm_chan_t_names []
 
static const struct value_string mi_type_names []
 
const struct value_string gsm48_pdisc_names []
 TS 04.08 Protocol Descriptor names. More...
 
const struct value_string gsm48_rr_msgtype_names []
 TS 04.08 RR Message Type names. More...
 
const struct value_string gsm48_mm_msgtype_names []
 TS 04.08 MM Message Type names. More...
 
const struct value_string gsm48_cc_msgtype_names []
 TS 04.08 CC Message Type names. More...
 
const struct value_string gsm48_cc_cause_names []
 TS 04.08 10.5..4.11 Call Control Cause Values. More...
 
const struct value_string gsm48_nc_ss_msgtype_names []
 TS 04.80, section 3.4 Messages for supplementary services control. More...
 
const struct value_string gsm48_reject_value_names []
 
const struct value_string osmo_lu_type_names []
 
const struct value_string osmo_cm_service_type_names []
 
static const char bcd_num_digits []
 
const struct value_string gsm48_gmm_cause_names_ []
 10.5.5.14 GPRS MM Cause / Table 10.5.147 More...
 
const struct value_stringgsm48_gmm_cause_names = gsm48_gmm_cause_names_
 
const struct value_string gsm48_gsm_cause_names_ []
 10.5.6.6 SM Cause / Table 10.5.157 More...
 
const struct value_stringgsm48_gsm_cause_names = gsm48_gsm_cause_names_
 
const struct value_string gprs_msgt_gmm_names []
 String names of GMM message types. More...
 
const struct value_string gprs_att_t_strs_ []
 String names of GPRS Attach types according to 10.5.5.2. More...
 
const struct value_stringgprs_att_t_strs = gprs_att_t_strs_
 
const struct value_string gprs_upd_t_strs_ []
 String names of GPRS Location Update Types. More...
 
const struct value_stringgprs_upd_t_strs = gprs_upd_t_strs_
 
const struct value_string gprs_det_t_mo_strs_ []
 String names of GMM MO Detach Types according to 10.5.5.5. More...
 
const struct value_stringgprs_det_t_mo_strs = gprs_det_t_mo_strs_
 
const struct value_string gprs_det_t_mt_strs_ []
 String names of GMM MT Detach Types according to 10.5.5.5. More...
 
const struct value_stringgprs_det_t_mt_strs = gprs_det_t_mt_strs_
 
const struct value_string gprs_service_t_strs_ []
 String names of GMM Service Types. More...
 
const struct value_stringgprs_service_t_strs = gprs_service_t_strs_
 

Detailed Description

GSM Mobile Radion Interface L3 messages / TS 04.08.

Function Documentation

static int asc_to_bcd ( const char  asc)
static

convert a single ASCII character to call-control BCD

References ARRAY_SIZE, and bcd_num_digits.

Referenced by gsm48_encode_bcd_number().

bool gprs_ms_net_cap_gea_supported ( const uint8_t *  ms_net_cap,
uint8_t  cap_len,
enum gprs_ciph_algo  gea 
)

Check if MS supports particular version of GEA by inspecting MS network capability IE specified in 3GPP TS 24.008.

Parameters
[in]ms_net_capBuffer with raw MS network capability IE value, 3 - 10 bytes
[in]cap_lenLength of ms_net_cap, in bytes
[in]geaVersion of GEA to check
Returns
true if given version is supported by MS, false otherwise

References GPRS_ALGO_GEA0, GPRS_ALGO_GEA1, GPRS_ALGO_GEA2, GPRS_ALGO_GEA3, and GPRS_ALGO_GEA4.

const char* gsm48_cc_msg_name ( uint8_t  msgtype)

return string representation of CC Message Type

References get_value_string().

const char* gsm48_cc_state_name ( uint8_t  state)

return string representation of CC State

References ARRAY_SIZE, and cc_state_names.

int gsm48_construct_ra ( uint8_t *  buf,
const struct gprs_ra_id raid 
)

Encode a TS 04.08 Routing Area Identifier.

Parameters
[out]bufCaller-provided output buffer of 6 bytes
[in]raidRouting Area ID to be encoded
Returns
number of bytes used in buf

References gsm48_encode_ra().

int gsm48_decode_bcd_number ( char *  output,
int  output_len,
const uint8_t *  bcd_lv,
int  h_len 
)

Like gsm48_decode_bcd_number2() but with less airtight bounds checking.

Parameters
[out]Caller-providedoutput buffer
[in]bcd_lvLength-Value portion of to-be-decoded IE
[in]h_lenLength of an optional heder between L and V portion
Returns
- in case of success; negative on error

References gsm48_decode_bcd_number2().

Referenced by gsm48_decode_called(), and gsm48_decode_callerid().

int gsm48_decode_bcd_number2 ( char *  output,
size_t  output_len,
const uint8_t *  bcd_lv,
size_t  input_len,
size_t  h_len 
)

Decode a 'called/calling/connect party BCD number' as in 10.5.4.7.

Parameters
[out]outputCaller-provided output buffer.
[in]output_lensizeof(output).
[in]bcd_lvLength-Value part of to-be-decoded IE.
[in]input_lenSize of the bcd_lv buffer for bounds checking.
[in]h_lenLength of an optional header between L and V parts.
Returns
0 in case of success, negative on error.

Errors checked:

  • no or too little input data (-EIO),
  • IE length exceeds input data size (-EINVAL),
  • no or too little output buffer size (-ENOSPC),
  • decoded number exceeds size of the output buffer (-ENOSPC).

The output is guaranteed to be nul terminated iff output_len > 0.

References bcd_num_digits.

Referenced by gsm48_decode_bcd_number(), and osmo_gsup_decode().

int gsm48_decode_called ( struct gsm_mncc_number called,
const uint8_t *  lv 
)

Decode TS 04.08 Called Party BCD Number IE (10.5.4.7)

Parameters
[out]calledCaller-provided memory for decoded number
[in]lvLength-Value portion of IE
Returns
0 on success; negative on error

References gsm48_decode_bcd_number(), gsm_mncc_number::number, gsm_mncc_number::plan, and gsm_mncc_number::type.

int gsm48_decode_callerid ( struct gsm_mncc_number callerid,
const uint8_t *  lv 
)

Decode TS 04.08 Caller ID.

Parameters
[out]calledCaller-provided memory for decoded number
[in]lvLength-Value portion of IE
Returns
0 on success; negative on error

References gsm48_decode_bcd_number(), gsm_mncc_number::number, gsm_mncc_number::plan, gsm_mncc_number::present, gsm_mncc_number::screen, and gsm_mncc_number::type.

Referenced by gsm48_decode_calling(), gsm48_decode_connected(), and gsm48_decode_redirecting().

int gsm48_decode_calling ( struct gsm_mncc_number calling,
const uint8_t *  lv 
)

Decode TS 04.08 Calling Number IE (10.5.4.9)

References gsm48_decode_callerid().

int gsm48_decode_cause ( struct gsm_mncc_cause cause,
const uint8_t *  lv 
)

Decode TS 04.08 Cause IE (10.5.4.11)

Parameters
[out]causeCaller-provided memory for output
[in]lvLV portion of Cause IE
Returns
0 on success; negative on error

References gsm_mncc_cause::coding, gsm_mncc_cause::diag, gsm_mncc_cause::diag_len, gsm_mncc_cause::location, gsm_mncc_cause::rec, gsm_mncc_cause::rec_val, and gsm_mncc_cause::value.

int gsm48_decode_cccap ( struct gsm_mncc_cccap ccap,
const uint8_t *  lv 
)

Decode TS 04.08 Call Control Capabilities IE (10.5.4.5a)

Parameters
[out]Caller-providedmemory for decoded CC capabilities
[in]lvLength-Value of IE 0 on success; negative on error

References gsm_mncc_cccap::dtmf, and gsm_mncc_cccap::pcp.

int gsm48_decode_connected ( struct gsm_mncc_number connected,
const uint8_t *  lv 
)

Decode TS 04.08 Connected Number IE (10.5.4.13)

References gsm48_decode_callerid().

int gsm48_decode_facility ( struct gsm_mncc_facility facility,
const uint8_t *  lv 
)

Decode TS 04.08 Facility IE (10.5.4.15)

References gsm_mncc_facility::info, and gsm_mncc_facility::len.

int gsm48_decode_freq_list ( struct gsm_sysinfo_freq f,
uint8_t *  cd,
uint8_t  len,
uint8_t  mask,
uint8_t  frqt 
)

Decode TS 04.08 Cell Channel Description IE (10.5.2.1b) and other frequency lists.

Parameters
[out]fCaller-provided output memory, an array of 1024 elements
[in]cdCell Channel Description IE
[in]lenLength of cd in bytes
Returns
0 on success; negative on error

References if(), gsm_sysinfo_freq::mask, and smod().

int gsm48_decode_keypad ( int *  keypad,
const uint8_t *  lv 
)

Decode TS 04.08 Keypad IE (10.5.4.17)

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

Decode TS 04.08 Location Area Identifier, legacy implementation.

Instead use gsm48_decode_lai2(), which is capable of three-digit MNC with leading zeros.

Parameters
[in]LocationArea Identifier (encoded)
[out]mccMobile Country Code
[out]mncMobile Network Code
[out]lacLocation Area Code
Returns
0

Attention: this function returns true integers, not hex!

References gsm48_decode_lai2(), osmo_location_area_id::lac, osmo_plmn_id::mcc, osmo_plmn_id::mnc, and osmo_location_area_id::plmn.

void gsm48_decode_lai2 ( const struct gsm48_loc_area_id lai,
struct osmo_location_area_id decoded 
)

Decode TS 04.08 Location Area Identifier.

Parameters
[in]LocationArea Identifier (encoded).
[out]decodedTarget buffer to write decoded values of MCC-MNC-LAC.

Attention: this function returns true integers, not hex!

References gsm48_loc_area_id::digits, osmo_location_area_id::lac, gsm48_loc_area_id::lac, osmo_ntohs, osmo_plmn_from_bcd(), and osmo_location_area_id::plmn.

Referenced by decode_lai(), and gsm48_decode_lai().

int gsm48_decode_notify ( int *  notify,
const uint8_t *  v 
)

Decode TS 04.08 Notify IE (10.5.4.20)

int gsm48_decode_progress ( struct gsm_mncc_progress progress,
const uint8_t *  lv 
)

Decode TS 04.08 Progress IE (10.5.4.21)

References gsm_mncc_progress::coding, gsm_mncc_progress::descr, and gsm_mncc_progress::location.

int gsm48_decode_redirecting ( struct gsm_mncc_number redirecting,
const uint8_t *  lv 
)

Decode TS 04.08 Redirecting Number IE (10.5.4.21b)

References gsm48_decode_callerid().

int gsm48_decode_signal ( int *  signal,
const uint8_t *  v 
)

Decode TS 04.08 Signal IE (10.5.4.23)

int gsm48_decode_ssversion ( struct gsm_mncc_ssversion ssv,
const uint8_t *  lv 
)

Decode TS 04.08 SS Version IE (10.5.4.24)

References gsm_mncc_ssversion::info, and gsm_mncc_ssversion::len.

int gsm48_decode_useruser ( struct gsm_mncc_useruser uu,
const uint8_t *  lv 
)

Decode TS 04.08 User-User IE (10.5.4.25)

References gsm_mncc_useruser::info, and gsm_mncc_useruser::proto.

int gsm48_encode_bcd_number ( uint8_t *  bcd_lv,
uint8_t  max_len,
int  h_len,
const char *  input 
)

convert a ASCII phone number to 'called/calling/connect party BCD number'

Parameters
[out]bcd_lvCaller-provided output buffer
[in]max_lenMaximum Length of bcd_lv
[in]h_lenLength of an optional heder between L and V portion
[in]inputphone number as 0-terminated ASCII
Returns
number of bytes used in bcd_lv

Depending on a context (e.g. called or calling party BCD number), the optional header between L and V parts can contain TON (Type Of Number), NPI (Numbering Plan Indication), presentation or screening indicator. NOTE: it is up to the caller to initialize this header!

References asc_to_bcd().

Referenced by gsm340_gen_oa(), gsm48_encode_called(), gsm48_encode_callerid(), and osmo_gsup_encode().

int gsm48_encode_called ( struct msgb msg,
const struct gsm_mncc_number called 
)

Encode TS 04.08 Called Party IE (10.5.4.7)

Parameters
[out]msgMesage Buffer to which to append IE (as TLV)
[in]calledMNCC Number to encode/append
Returns
0 on success; negative on error

References gsm48_encode_bcd_number(), GSM48_IE_CALLED_BCD, msgb_tlv_put(), gsm_mncc_number::number, gsm_mncc_number::plan, and gsm_mncc_number::type.

int gsm48_encode_callerid ( struct msgb msg,
int  ie,
int  max_len,
const struct gsm_mncc_number callerid 
)

Encode TS 04.08 Caller ID IE.

Parameters
[out]msgMesage Buffer to which to append IE (as TLV)
[in]ieIE Identifier (tag)
[in]max_lenmaximum generated output in bytes
[in]calleridMNCC Number to encode/append
Returns
0 on success; negative on error

References gsm48_encode_bcd_number(), msgb_tlv_put(), gsm_mncc_number::number, gsm_mncc_number::plan, gsm_mncc_number::present, gsm_mncc_number::screen, and gsm_mncc_number::type.

Referenced by gsm48_encode_calling(), gsm48_encode_connected(), and gsm48_encode_redirecting().

int gsm48_encode_calling ( struct msgb msg,
const struct gsm_mncc_number calling 
)

Encode TS 04.08 Calling Number IE (10.5.4.9)

References gsm48_encode_callerid(), and GSM48_IE_CALLING_BCD.

int gsm48_encode_cause ( struct msgb msg,
int  lv_only,
const struct gsm_mncc_cause cause 
)

Encode TS 04.08 Cause IE (10.5.4.11)

Parameters
[out]msgMessage Buffer to which to append IE
[in]lv_onlyEncode as LV (1) or TLV (0)
[in]causeCause value to be encoded
Returns
0 on success; negative on error

References gsm_mncc_cause::coding, gsm_mncc_cause::diag, gsm_mncc_cause::diag_len, GSM48_IE_CAUSE, gsm_mncc_cause::location, msgb_lv_put(), msgb_tlv_put(), gsm_mncc_cause::rec, gsm_mncc_cause::rec_val, and gsm_mncc_cause::value.

int gsm48_encode_cccap ( struct msgb msg,
const struct gsm_mncc_cccap ccap 
)

Encodoe TS 04.08 Call Control Capabilities (10.5.4.5a)

Parameters
[out]msgMessage Buffer to which to append IE (as TLV)
[in]ccapDecoded CC Capabilities to be encoded
Returns
0 on success; negative on error

References gsm_mncc_cccap::dtmf, GSM48_IE_CC_CAP, msgb_tlv_put(), and gsm_mncc_cccap::pcp.

int gsm48_encode_connected ( struct msgb msg,
const struct gsm_mncc_number connected 
)

Encode TS 04.08 Connected Number IE (10.5.4.13)

References gsm48_encode_callerid(), and GSM48_IE_CONN_BCD.

int gsm48_encode_facility ( struct msgb msg,
int  lv_only,
const struct gsm_mncc_facility facility 
)
int gsm48_encode_keypad ( struct msgb msg,
int  keypad 
)

Encode TS 04.08 Keypad IE (10.5.4.17)

References GSM48_IE_KPD_FACILITY, and msgb_tv_put().

int gsm48_encode_more ( struct msgb msg)

Encode TS 04.08 More Data IE (10.5.4.19)

References GSM48_IE_MORE_DATA, and msgb_put().

int gsm48_encode_notify ( struct msgb msg,
int  notify 
)

Encode TS 04.08 Notify IE (10.5.4.20)

References msgb_v_put().

int gsm48_encode_progress ( struct msgb msg,
int  lv_only,
const struct gsm_mncc_progress p 
)
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.

Parameters
[out]outCaller-provided packed struct
[in]raidRouting Area ID to be encoded

References gsm48_ra_id::digits, gprs_ra_id::lac, gsm48_ra_id::lac, gprs_ra_id::mcc, gprs_ra_id::mnc, gprs_ra_id::mnc_3_digits, osmo_htons, gprs_ra_id::rac, and gsm48_ra_id::rac.

Referenced by gsm48_construct_ra().

int gsm48_encode_redirecting ( struct msgb msg,
const struct gsm_mncc_number redirecting 
)

Encode TS 04.08 Redirecting Number IE (10.5.4.21b)

References gsm48_encode_callerid(), and GSM48_IE_REDIR_BCD.

int gsm48_encode_signal ( struct msgb msg,
int  signal 
)

Encode TS 04.08 Signal IE (10.5.4.23)

References GSM48_IE_SIGNAL, and msgb_tv_put().

int gsm48_encode_ssversion ( struct msgb msg,
const struct gsm_mncc_ssversion ssv 
)

Encode TS 04.08 SS Version IE (10.5.4.24)

References GSM48_IE_SS_VERS, GSM_MAX_SSVERSION, gsm_mncc_ssversion::info, gsm_mncc_ssversion::len, and msgb_tlv_put().

int gsm48_encode_useruser ( struct msgb msg,
int  lv_only,
const struct gsm_mncc_useruser uu 
)
void gsm48_generate_lai ( struct gsm48_loc_area_id lai48,
uint16_t  mcc,
uint16_t  mnc,
uint16_t  lac 
)

Encode TS 04.08 Location Area Identifier, legacy implementation.

Instead use gsm48_generate_lai2(), which is capable of three-digit MNC with leading zeros.

Parameters
[out]lai48caller-provided memory for output
[in]mccMobile Country Code
[in]mncMobile Network Code
[in]lacLocation Area Code

References gsm48_generate_lai2(), lac, osmo_plmn_id::mcc, and osmo_location_area_id::plmn.

void gsm48_generate_lai2 ( struct gsm48_loc_area_id lai48,
const struct osmo_location_area_id lai 
)

Encode TS 04.08 Location Area Identifier.

Parameters
[out]lai48caller-provided memory for output.
[in]laiinput of MCC-MNC-LAC.

References gsm48_loc_area_id::digits, osmo_location_area_id::lac, gsm48_loc_area_id::lac, osmo_htons, osmo_plmn_to_bcd(), and osmo_location_area_id::plmn.

Referenced by gsm0808_create_layer3_2(), gsm0808_msgb_put_cell_id_u(), gsm48_generate_lai(), and msgb_sgsap_lai_put().

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.

Parameters
[out]bufCaller-provided output buffer of at least GSM48_MID_MAX_SIZE bytes
[in]idIdentity to be encoded
[in]mi_typeType of identity (e.g. GSM_MI_TYPE_IMSI, IMEI, IMEISV)
Returns
number of bytes used in buf

References GSM48_IE_MOBILE_ID, GSM_MI_TYPE_MASK, length, OSMO_ASSERT, and osmo_char2bcd().

Referenced by gsm48_generate_mid_from_imsi().

int gsm48_generate_mid_from_imsi ( uint8_t *  buf,
const char *  imsi 
)

Generate TS 04.08 Mobile ID from IMSI.

Parameters
[out]bufCaller-provided output buffer
[in]imsiIMSI to be encoded
Returns
number of bytes used in buf

References gsm48_generate_mid(), and GSM_MI_TYPE_IMSI.

Referenced by gsm0808_create_handover_request(), gsm0808_create_paging2(), and msgb_sgsap_imsi_put().

int gsm48_generate_mid_from_tmsi ( uint8_t *  buf,
uint32_t  tmsi 
)

Generate TS 04.08 Mobile ID from TMSI.

Parameters
[out]bufCaller-provided output buffer (7 bytes)
[in]tmsiTMSI to be encoded
Returns
number of byes encoded (always 7)

References GSM48_IE_MOBILE_ID, GSM48_TMSI_LEN, GSM_MI_TYPE_TMSI, and osmo_htonl.

bool gsm48_hdr_gmm_cipherable ( const struct gsm48_hdr hdr)

Checks is particular message is cipherable in A/Gb mode according to 3GPP TS 24.008 § 4.7.1.2.

Parameters
[in]hdrMessage header
Returns
true if message can be encrypted, false otherwise

References GSM48_MT_GMM_ATTACH_REJ, GSM48_MT_GMM_ATTACH_REQ, GSM48_MT_GMM_AUTH_CIPH_FAIL, GSM48_MT_GMM_AUTH_CIPH_REJ, GSM48_MT_GMM_AUTH_CIPH_REQ, GSM48_MT_GMM_AUTH_CIPH_RESP, GSM48_MT_GMM_ID_REQ, GSM48_MT_GMM_ID_RESP, GSM48_MT_GMM_RA_UPD_REJ, GSM48_MT_GMM_RA_UPD_REQ, and gsm48_hdr::msg_type.

Referenced by gsm48_pdisc_name().

void gsm48_mcc_mnc_from_bcd ( uint8_t *  bcd_src,
uint16_t *  mcc,
uint16_t *  mnc 
)
void gsm48_mcc_mnc_to_bcd ( uint8_t *  bcd_dst,
uint16_t  mcc,
uint16_t  mnc 
)
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.

This function does not validate the Mobile Identity digits, i.e. digits > 9 are returned as 'A'-'F'.

Parameters
[out]stringCaller-provided buffer for output
[in]str_lenLength of string in bytes
[in]miMobile Identity to be stringified
[in]mi_lenLength of mi in bytes
Returns
WARNING: the return value of this function is not well implemented. Depending on the MI type and amount of output buffer, this may return the nr of written bytes, or the written strlen(), or the snprintf() style strlen()-if-the-buffer-were-large-enough.

References GSM48_TMSI_LEN, GSM_MI_ODD, GSM_MI_TYPE_IMEI, GSM_MI_TYPE_IMEISV, GSM_MI_TYPE_IMSI, GSM_MI_TYPE_MASK, GSM_MI_TYPE_NONE, GSM_MI_TYPE_TMSI, mi_len, and osmo_bcd2str().

const char* gsm48_mi_type_name ( uint8_t  mi)

return string representation of Mobile Identity Type

References get_value_string().

Referenced by osmo_mi_name_buf().

int gsm48_number_of_paging_subchannels ( struct gsm48_control_channel_descr chan_desc)

Determine number of paging sub-channels.

Parameters
[in]chan_descControl Channel Description
Returns
number of paging sub-channels

Uses From Table 10.5.33 of GSM 04.08 to determine the number of paging sub-channels in the given control channel configuration

References gsm0502_get_n_pag_blocks(), OSMO_MAX, and RSL_BCCH_CCCH_CONF_1_C.

Referenced by gsm0502_calc_paging_group().

void gsm48_parse_ra ( struct gprs_ra_id raid,
const uint8_t *  buf 
)

Parse TS 04.08 Routing Area Identifier.

Parameters
[out]Caller-providedmemory for decoded RA ID
[in]bufInput buffer pointing to RAI IE value

References gprs_ra_id::lac, gprs_ra_id::mcc, gprs_ra_id::mnc, gprs_ra_id::mnc_3_digits, and gprs_ra_id::rac.

const char* gsm48_pdisc_msgtype_name ( uint8_t  pdisc,
uint8_t  msg_type 
)

Compose a string naming the message type for given protocol, in a static buffer.

If the message type string is known, return the message type name, otherwise return "<protocol discriminator name>:<message type in hex>".

Parameters
[in]pdiscprotocol discriminator like GSM48_PDISC_MM
[in]msg_typemessage type like GSM48_MT_MM_LOC_UPD_REQUEST
Returns
statically allocated string or string constant.

References gsm48_pdisc_msgtype_name_buf(), and namebuf.

char* gsm48_pdisc_msgtype_name_buf ( char *  buf,
size_t  buf_len,
uint8_t  pdisc,
uint8_t  msg_type 
)

Compose a string naming the message type for given protocol, in a caller-provided buffer.

If the message type string is known, return the message type name, otherwise return "<protocol discriminator name>:<message type in hex>".

Parameters
[out]bufcaller-allcated output string buffer
[in]buf_lensize of buf in bytes
[in]pdiscprotocol discriminator like GSM48_PDISC_MM
[in]msg_typemessage type like GSM48_MT_MM_LOC_UPD_REQUEST
Returns
buf

References get_value_string(), gsm48_cc_msgtype_names, gsm48_mm_msgtype_names, gsm48_nc_ss_msgtype_names, GSM48_PDISC_CC, GSM48_PDISC_MM, gsm48_pdisc_name(), GSM48_PDISC_NC_SS, GSM48_PDISC_RR, and gsm48_rr_msgtype_names.

Referenced by gsm48_pdisc_msgtype_name(), and gsm48_pdisc_msgtype_name_c().

char* gsm48_pdisc_msgtype_name_c ( const void *  ctx,
uint8_t  pdisc,
uint8_t  msg_type 
)

Compose a string naming the message type for given protocol, in a dynamically-allocated buffer.

If the message type string is known, return the message type name, otherwise return "<protocol discriminator name>:<message type in hex>".

Parameters
[in]ctxtalloc context from which to allocate output buffer
[in]pdiscprotocol discriminator like GSM48_PDISC_MM
[in]msg_typemessage type like GSM48_MT_MM_LOC_UPD_REQUEST
Returns
string representation in dynamically allocated output buffer.

References gsm48_pdisc_msgtype_name_buf(), and namebuf.

struct gsm48_hdr* gsm48_push_l3hdr ( struct msgb msg,
uint8_t  pdisc,
uint8_t  msg_type 
)

Wrap a given msg with gsm48_hdr structure.

Parameters
[out]msgA message to be wrapped
[in]pdiscGSM TS 04.07 protocol discriminator 1/2, sub-pdisc, trans_id or skip_ind 1/2, see section 11.2.3.1 for details
[in]msg_typeGSM TS 04.08 message type
Returns
pointer to pushed header within msg

References msg_type, gsm48_hdr::msg_type, msgb_push(), and gsm48_hdr::proto_discr.

Referenced by gsm0480_create_ussd_notify(), and gsm0480_create_ussd_release_complete().

const char* gsm48_rr_msg_name ( uint8_t  msgtype)

return string representation of RR Message Type

References get_value_string().

void gsm48_set_dtx ( struct gsm48_cell_options op,
enum gsm48_dtx_mode  full,
enum gsm48_dtx_mode  half,
bool  is_bcch 
)

Set DTX mode in Cell Options IE (3GPP TS 44.018)

Parameters
[in]opCell Options structure in which DTX parameters will be set
[in]fullMode for full-rate channels
[in]halfMode for half-rate channels
[in]is_bcchIndicates if we should use 10.5.2.3.1 instead of 10.5.2.3a.2

There is no space for separate DTX settings for Full and Half rate channels in BCCH - in this case full setting is used for both and half parameter is ignored.

References GSM48_DTX_MAY_BE_USED, GSM48_DTX_SHALL_BE_USED, and GSM48_DTX_SHALL_NOT_BE_USED.

Referenced by gsm48_hdr_msg_type_r99().

bool osmo_gsm48_classmark1_is_r99 ( const struct gsm48_classmark1 cm1)
bool osmo_gsm48_classmark2_is_r99 ( const struct gsm48_classmark2 cm2,
uint8_t  cm2_len 
)
const char* osmo_gsm48_classmark_a5_name ( const struct osmo_gsm48_classmark cm)

Return a string representation of A5 cipher algorithms indicated by Classmark 1, 2 and 3.

Parameters
[in]cmClassmarks.
Returns
A statically allocated string like "cm1{a5/1=supported} cm2{0x23= A5/2 A5/3} no-cm3"

References osmo_gsm48_classmark_a5_name_buf().

char* osmo_gsm48_classmark_a5_name_buf ( char *  buf,
size_t  buf_len,
const struct osmo_gsm48_classmark cm 
)

Return a string representation of A5 cipher algorithms indicated by Classmark 1, 2 and 3.

Parameters
[in]cmClassmarks.
Returns
A statically allocated string like "cm1{a5/1=supported} cm2{0x23= A5/2 A5/3} no-cm3"

References osmo_gsm48_classmark::classmark1, osmo_gsm48_classmark::classmark1_set, osmo_gsm48_classmark::classmark2, osmo_gsm48_classmark::classmark2_len, osmo_gsm48_classmark::classmark3, osmo_gsm48_classmark::classmark3_len, and cm2.

Referenced by osmo_gsm48_classmark_a5_name(), and osmo_gsm48_classmark_a5_name_c().

char* osmo_gsm48_classmark_a5_name_c ( const void *  ctx,
const struct osmo_gsm48_classmark cm 
)

Return a string representation of A5 cipher algorithms indicated by Classmark 1, 2 and 3.

Parameters
[in]ctxtalloc context from which to allocate output buffer
[in]cmClassmarks.
Returns
string like "cm1{a5/1=supported} cm2{0x23= A5/2 A5/3} no-cm3" in dynamically-allocated output buffer.

References osmo_gsm48_classmark_a5_name_buf().

bool osmo_gsm48_classmark_is_r99 ( const struct osmo_gsm48_classmark cm)

Return true if any of Classmark 1 or Classmark 2 are present and indicate R99 capability.

Parameters
[in]cmClassmarks.
Returns
True if R99 or later, false if pre-R99 or no Classmarks are present.

References osmo_gsm48_classmark::classmark1, osmo_gsm48_classmark::classmark1_set, osmo_gsm48_classmark::classmark2, osmo_gsm48_classmark::classmark2_len, osmo_gsm48_classmark1_is_r99(), and osmo_gsm48_classmark2_is_r99().

int osmo_gsm48_classmark_supports_a5 ( const struct osmo_gsm48_classmark cm,
uint8_t  a5 
)

Determine if the given Classmark (1/2/3) value permits a given A5/n cipher.

Parameters
[in]cmClassmarks.
[in]a5The N in A5/N for which to query whether support is indicated.
Returns
1 when the given A5/n is permitted, 0 when not (or a5 > 7), and negative if the respective MS Classmark is not known, where the negative number indicates the classmark type: -2 means Classmark 2 is not available. The idea is that when e.g. A5/3 is requested and the corresponding Classmark 3 is not available, that the caller can react by obtaining Classmark 3 and calling again once it is available.

References osmo_gsm48_classmark::classmark1, osmo_gsm48_classmark::classmark1_set, osmo_gsm48_classmark::classmark2, osmo_gsm48_classmark::classmark2_len, osmo_gsm48_classmark::classmark3, and osmo_gsm48_classmark::classmark3_len.

void osmo_gsm48_classmark_update ( struct osmo_gsm48_classmark dst,
const struct osmo_gsm48_classmark src 
)

Overwrite dst with the Classmark information present in src.

Add an new Classmark and overwrite in dst what src has to offer, but where src has no Classmark information, leave dst unchanged. (For Classmark 2 and 3, dst will exactly match any non-zero Classmark length from src, hence may end up with a shorter Classmark after this call.)

Parameters
[out]dstThe target Classmark storage to be updated.
[in]srcThe new Classmark information to read from.

References osmo_gsm48_classmark::classmark1, osmo_gsm48_classmark::classmark1_set, osmo_gsm48_classmark::classmark2, osmo_gsm48_classmark::classmark2_len, osmo_gsm48_classmark::classmark3, osmo_gsm48_classmark::classmark3_len, and OSMO_MIN.

int8_t osmo_gsm48_rfpowercap2powerclass ( enum gsm_band  band,
uint8_t  rf_power_cap 
)

Decode power class from Classmark1/2 RF power capability field.

Parameters
[in]rf_power_capThe RF power capability field (3 bits).
[in]bandthe band of the arfcn from where the classmark was received
Returns
the MS power class on success, negative on error.

References GSM_BAND_1800, and GSM_BAND_1900.

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.

Parameters
[in]miMobile Identity buffer containing 3GPP TS 04.08 style MI type and data.
[in]mi_lenLength of mi.
Returns
A string like "IMSI-1234567", "TMSI-0x1234ABCD" or "unknown", "TMSI-invalid"...

References GSM48_MI_SIZE, and osmo_mi_name_buf().

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.

Parameters
[out]bufcaller-provided output buffer
[in]buf_lensize of buf in bytes
[in]miMobile Identity buffer containing 3GPP TS 04.08 style MI type and data.
[in]mi_lenLength of mi.
Returns
buf

References GSM48_MI_SIZE, gsm48_mi_type_name(), GSM48_TMSI_LEN, GSM_MI_ODD, GSM_MI_TYPE_IMEI, GSM_MI_TYPE_IMEISV, GSM_MI_TYPE_IMSI, GSM_MI_TYPE_MASK, GSM_MI_TYPE_NONE, GSM_MI_TYPE_TMSI, mi_len, and osmo_bcd2str().

Referenced by osmo_mi_name(), and osmo_mi_name_c().

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.

Parameters
[in]ctxtalloc context from which to allocate output buffer
[in]miMobile Identity buffer containing 3GPP TS 04.08 style MI type and data.
[in]mi_lenLength of mi.
Returns
A string like "IMSI-1234567", "TMSI-0x1234ABCD" or "unknown", "TMSI-invalid" in a dynamically-allocated output buffer.

References GSM48_MI_SIZE, and osmo_mi_name_buf().

const char* osmo_rai_name ( const struct gprs_ra_id rai)

Return MCC-MNC-LAC-RAC as string, in a static buffer.

Parameters
[in]raiRAI to encode.
Returns
Static string buffer.

References osmo_rai_name_buf().

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.

Parameters
[out]bufcaller-provided output buffer
[in]buf_lensize of buf in bytes
[in]raiRAI to encode.
Returns
buf

References gprs_ra_id::lac, gprs_ra_id::mcc, gprs_ra_id::mnc, gprs_ra_id::mnc_3_digits, osmo_mcc_name(), osmo_mnc_name(), and gprs_ra_id::rac.

Referenced by osmo_rai_name(), and osmo_rai_name_c().

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.

Parameters
[in]ctxtalloc context from which to allocate output buffer
[in]raiRAI to encode.
Returns
string representation in dynamically-allocated output buffer.

References osmo_rai_name_buf().

const char* rr_cause_name ( uint8_t  cause)

return string representation of RR Cause value

References get_value_string().

static int32_t smod ( int32_t  n,
int32_t  m 
)
static

References res.

Referenced by gsm48_decode_freq_list().

Variable Documentation

const char bcd_num_digits[]
static
Initial value:
= {
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', '*', '#', 'a', 'b', 'c', '\0'
}

Referenced by asc_to_bcd(), and gsm48_decode_bcd_number2().

const struct value_string cc_msg_names[]
static
const char* cc_state_names[32]
static

Referenced by gsm48_cc_state_name().

const struct value_string* gprs_att_t_strs = gprs_att_t_strs_
const struct value_string gprs_att_t_strs_[]
Initial value:
= {
{ GPRS_ATT_T_ATTACH, "GPRS attach" },
{ GPRS_ATT_T_ATT_WHILE_IMSI, "GPRS attach while IMSI attached" },
{ GPRS_ATT_T_COMBINED, "Combined GPRS/IMSI attach" },
{ 0, NULL }
}
#define GPRS_ATT_T_ATTACH
Definition: gsm_04_08_gprs.h:52
#define GPRS_ATT_T_COMBINED
Definition: gsm_04_08_gprs.h:54
#define GPRS_ATT_T_ATT_WHILE_IMSI
Definition: gsm_04_08_gprs.h:53

String names of GPRS Attach types according to 10.5.5.2.

const struct value_string* gprs_det_t_mo_strs = gprs_det_t_mo_strs_
const struct value_string gprs_det_t_mo_strs_[]
Initial value:
= {
{ GPRS_DET_T_MO_GPRS, "GPRS detach" },
{ GPRS_DET_T_MO_IMSI, "IMSI detach" },
{ GPRS_DET_T_MO_COMBINED, "Combined GPRS/IMSI detach" },
{ 0, NULL }
}
#define GPRS_DET_T_MO_IMSI
Definition: gsm_04_08_gprs.h:61
#define GPRS_DET_T_MO_GPRS
Definition: gsm_04_08_gprs.h:60
#define GPRS_DET_T_MO_COMBINED
Definition: gsm_04_08_gprs.h:62

String names of GMM MO Detach Types according to 10.5.5.5.

const struct value_string* gprs_det_t_mt_strs = gprs_det_t_mt_strs_
const struct value_string gprs_det_t_mt_strs_[]
Initial value:
= {
{ GPRS_DET_T_MT_REATT_REQ, "re-attach required" },
{ GPRS_DET_T_MT_REATT_NOTREQ, "re-attach not required" },
{ GPRS_DET_T_MT_IMSI, "IMSI detach (after VLR failure)" },
{ 0, NULL }
}
#define GPRS_DET_T_MT_REATT_NOTREQ
Definition: gsm_04_08_gprs.h:65
#define GPRS_DET_T_MT_REATT_REQ
Definition: gsm_04_08_gprs.h:64
#define GPRS_DET_T_MT_IMSI
Definition: gsm_04_08_gprs.h:66

String names of GMM MT Detach Types according to 10.5.5.5.

const struct value_string gprs_msgt_gmm_names[]
Initial value:
= {
{ GSM48_MT_GMM_ATTACH_REQ, "ATTACH REQUEST" },
{ GSM48_MT_GMM_ATTACH_ACK, "ATTACH ACK" },
{ GSM48_MT_GMM_ATTACH_COMPL, "ATTACH COMPLETE" },
{ GSM48_MT_GMM_ATTACH_REJ, "ATTACH REJECT" },
{ GSM48_MT_GMM_DETACH_REQ, "DETACH REQUEST" },
{ GSM48_MT_GMM_DETACH_ACK, "DETACH ACK" },
{ GSM48_MT_GMM_RA_UPD_REQ, "RA UPDATE REQUEST" },
{ GSM48_MT_GMM_RA_UPD_ACK, "RA UPDATE ACK" },
{ GSM48_MT_GMM_RA_UPD_COMPL, "RA UPDATE COMPLETE" },
{ GSM48_MT_GMM_RA_UPD_REJ, "RA UPDATE REJECT" },
{ GSM48_MT_GMM_PTMSI_REALL_CMD, "PTMSI REALLOC CMD" },
{ GSM48_MT_GMM_PTMSI_REALL_COMPL, "PTMSI REALLOC COMPLETE" },
{ GSM48_MT_GMM_AUTH_CIPH_REQ, "AUTH & CIPHER REQUEST" },
{ GSM48_MT_GMM_AUTH_CIPH_RESP, "AUTH & CIPHER RESPONSE" },
{ GSM48_MT_GMM_AUTH_CIPH_REJ, "AUTH & CIPHER REJECT" },
{ GSM48_MT_GMM_AUTH_CIPH_FAIL, "AUTH & CIPHER FAILURE" },
{ GSM48_MT_GMM_ID_REQ, "IDENTITY REQUEST" },
{ GSM48_MT_GMM_ID_RESP, "IDENTITY RESPONSE" },
{ GSM48_MT_GMM_STATUS, "STATUS" },
{ GSM48_MT_GMM_INFO, "INFO" },
{ 0, NULL }
}
#define GSM48_MT_GMM_DETACH_ACK
Definition: gsm_04_08_gprs.h:18
#define GSM48_MT_GMM_ID_RESP
Definition: gsm_04_08_gprs.h:32
#define GSM48_MT_GMM_PTMSI_REALL_CMD
Definition: gsm_04_08_gprs.h:25
#define GSM48_MT_GMM_ATTACH_REJ
Definition: gsm_04_08_gprs.h:16
#define GSM48_MT_GMM_AUTH_CIPH_REQ
Definition: gsm_04_08_gprs.h:27
#define GSM48_MT_GMM_INFO
Definition: gsm_04_08_gprs.h:34
#define GSM48_MT_GMM_ATTACH_COMPL
Definition: gsm_04_08_gprs.h:15
#define GSM48_MT_GMM_PTMSI_REALL_COMPL
Definition: gsm_04_08_gprs.h:26
#define GSM48_MT_GMM_RA_UPD_ACK
Definition: gsm_04_08_gprs.h:21
#define GSM48_MT_GMM_ATTACH_ACK
Definition: gsm_04_08_gprs.h:14
#define GSM48_MT_GMM_RA_UPD_REQ
Definition: gsm_04_08_gprs.h:20
#define GSM48_MT_GMM_RA_UPD_COMPL
Definition: gsm_04_08_gprs.h:22
#define GSM48_MT_GMM_DETACH_REQ
Definition: gsm_04_08_gprs.h:17
#define GSM48_MT_GMM_AUTH_CIPH_REJ
Definition: gsm_04_08_gprs.h:29
#define GSM48_MT_GMM_STATUS
Definition: gsm_04_08_gprs.h:33
#define GSM48_MT_GMM_RA_UPD_REJ
Definition: gsm_04_08_gprs.h:23
#define GSM48_MT_GMM_AUTH_CIPH_RESP
Definition: gsm_04_08_gprs.h:28
#define GSM48_MT_GMM_ATTACH_REQ
Definition: gsm_04_08_gprs.h:13
#define GSM48_MT_GMM_AUTH_CIPH_FAIL
Definition: gsm_04_08_gprs.h:30
#define GSM48_MT_GMM_ID_REQ
Definition: gsm_04_08_gprs.h:31

String names of GMM message types.

const struct value_string* gprs_service_t_strs = gprs_service_t_strs_
const struct value_string gprs_service_t_strs_[]
Initial value:
= {
{ GPRS_SERVICE_T_SIGNALLING, "signalling" },
{ GPRS_SERVICE_T_DATA, "data" },
{ GPRS_SERVICE_T_PAGING_RESP, "paging response" },
{ GPRS_SERVICE_T_MBMS_MC_SERV, "MBMS multicast service" },
{ GPRS_SERVICE_T_MBMS_BC_SERV, "MBMS broadcast service" },
{ 0, NULL }
}
Definition: gsm_04_08_gprs.h:416
Definition: gsm_04_08_gprs.h:413
Definition: gsm_04_08_gprs.h:415
Definition: gsm_04_08_gprs.h:414
Definition: gsm_04_08_gprs.h:412

String names of GMM Service Types.

const struct value_string* gprs_upd_t_strs = gprs_upd_t_strs_
const struct value_string gprs_upd_t_strs_[]
Initial value:
= {
{ GPRS_UPD_T_RA, "RA updating" },
{ GPRS_UPD_T_RA_LA, "combined RA/LA updating" },
{ GPRS_UPD_T_RA_LA_IMSI_ATT, "combined RA/LA updating + IMSI attach" },
{ GPRS_UPD_T_PERIODIC, "periodic updating" },
{ 0, NULL }
}
#define GPRS_UPD_T_PERIODIC
Definition: gsm_04_08_gprs.h:75
#define GPRS_UPD_T_RA_LA_IMSI_ATT
Definition: gsm_04_08_gprs.h:74
#define GPRS_UPD_T_RA_LA
Definition: gsm_04_08_gprs.h:73
#define GPRS_UPD_T_RA
Definition: gsm_04_08_gprs.h:72

String names of GPRS Location Update Types.

const struct tlv_definition gsm48_att_tlvdef

TLV parser definitions for TS 04.08 CC.

const struct value_string gsm48_cc_cause_names[]

TS 04.08 10.5..4.11 Call Control Cause Values.

Referenced by gsm48_cc_cause_name().

const struct value_string gsm48_cc_msgtype_names[]

TS 04.08 CC Message Type names.

Referenced by gsm48_pdisc_msgtype_name_buf().

const struct value_string gsm48_chan_mode_names[]
Initial value:
= {
{ GSM48_CMODE_SIGN, "SIGNALLING" },
{ GSM48_CMODE_SPEECH_V1, "SPEECH_V1" },
{ GSM48_CMODE_SPEECH_EFR, "SPEECH_EFR" },
{ GSM48_CMODE_SPEECH_AMR, "SPEECH_AMR" },
{ GSM48_CMODE_DATA_14k5, "DATA_14k5" },
{ GSM48_CMODE_DATA_12k0, "DATA_12k0" },
{ GSM48_CMODE_DATA_6k0, "DATA_6k0" },
{ GSM48_CMODE_DATA_3k6, "DATA_3k6" },
{ 0, NULL },
}
Definition: gsm_04_08.h:814
Definition: gsm_04_08.h:820
Definition: gsm_04_08.h:813
Definition: gsm_04_08.h:818
Definition: gsm_04_08.h:819
Definition: gsm_04_08.h:817
Definition: gsm_04_08.h:816
Definition: gsm_04_08.h:815
const struct value_string* gsm48_gmm_cause_names = gsm48_gmm_cause_names_

Referenced by osmo_oap_client_handle().

const struct value_string gsm48_gmm_cause_names_[]

10.5.5.14 GPRS MM Cause / Table 10.5.147

const struct value_string* gsm48_gsm_cause_names = gsm48_gsm_cause_names_
const struct value_string gsm48_gsm_cause_names_[]

10.5.6.6 SM Cause / Table 10.5.157

const struct tlv_definition gsm48_mm_att_tlvdef
Initial value:
= {
.def = {
},
}
#define GSM48_IE_NAME_SHORT
Definition: gsm_04_08.h:1722
#define GSM48_IE_MOBILE_ID
Definition: gsm_04_08.h:1720
#define GSM48_IE_NAME_LONG
Definition: gsm_04_08.h:1721
#define GSM48_IE_LOCATION_AREA
Definition: gsm_04_08.h:1816
tag-value (8bit)
Definition: tlv.h:422
#define GSM48_IE_NET_TIME_TZ
Definition: gsm_04_08.h:1724
#define GSM48_IE_NET_DST
Definition: gsm_04_08.h:1726
tag-length-value
Definition: tlv.h:423
#define GSM48_IE_PRIORITY_LEV
Definition: gsm_04_08.h:1820
#define GSM48_IE_UTC
Definition: gsm_04_08.h:1723
fixed-length value-only
Definition: tlv.h:420
#define GSM48_IE_LSA_IDENT
Definition: gsm_04_08.h:1725
#define GSM48_IE_CTS_PERMISSION
Definition: gsm_04_08.h:1822
tag-only
Definition: tlv.h:421
tag and value (both 4 bit) in 1 byte
Definition: tlv.h:426
#define GSM48_IE_FOLLOW_ON_PROC
Definition: gsm_04_08.h:1821

TLV parser definitions for TS 04.08 MM.

const struct value_string gsm48_mm_msgtype_names[]
Initial value:
= {
{ 0, NULL }
}
#define GSM48_MT_MM_CM_SERV_REJ
Definition: gsm_04_08.h:1618
#define GSM48_MT_MM_CM_SERV_ACC
Definition: gsm_04_08.h:1617
#define GSM48_MT_MM_ID_RESP
Definition: gsm_04_08.h:1613
#define GSM48_MT_MM_LOC_UPD_REJECT
Definition: gsm_04_08.h:1605
#define GSM48_MT_MM_LOC_UPD_ACCEPT
Definition: gsm_04_08.h:1604
#define GSM48_MT_MM_STATUS
Definition: gsm_04_08.h:1626
#define GSM48_MT_MM_CM_REEST_REQ
Definition: gsm_04_08.h:1622
#define GSM48_MT_MM_LOC_UPD_REQUEST
Definition: gsm_04_08.h:1606
#define OSMO_VALUE_STRING(x)
#define GSM48_MT_MM_AUTH_REQ
Definition: gsm_04_08.h:1609
#define GSM48_MT_MM_CM_SERV_ABORT
Definition: gsm_04_08.h:1619
#define GSM48_MT_MM_INFO
Definition: gsm_04_08.h:1627
#define GSM48_MT_MM_TMSI_REALL_CMD
Definition: gsm_04_08.h:1614
#define GSM48_MT_MM_ID_REQ
Definition: gsm_04_08.h:1612
#define GSM48_MT_MM_IMSI_DETACH_IND
Definition: gsm_04_08.h:1603
#define GSM48_MT_MM_NULL
Definition: gsm_04_08.h:1625
#define GSM48_MT_MM_CM_SERV_REQ
Definition: gsm_04_08.h:1620
#define GSM48_MT_MM_AUTH_RESP
Definition: gsm_04_08.h:1610
#define GSM48_MT_MM_AUTH_REJ
Definition: gsm_04_08.h:1608
#define GSM48_MT_MM_CM_SERV_PROMPT
Definition: gsm_04_08.h:1621
#define GSM48_MT_MM_ABORT
Definition: gsm_04_08.h:1623
#define GSM48_MT_MM_AUTH_FAIL
Definition: gsm_04_08.h:1611
#define GSM48_MT_MM_TMSI_REALL_COMPL
Definition: gsm_04_08.h:1615

TS 04.08 MM Message Type names.

Referenced by gsm48_pdisc_msgtype_name_buf().

const struct value_string gsm48_nc_ss_msgtype_names[]
Initial value:
= {
{ 0, NULL }
}
#define OSMO_VALUE_STRING(x)
#define GSM0480_MTYPE_RELEASE_COMPLETE
Definition: gsm_04_80.h:7
#define GSM0480_MTYPE_FACILITY
Definition: gsm_04_80.h:8
#define GSM0480_MTYPE_REGISTER
Definition: gsm_04_80.h:9

TS 04.80, section 3.4 Messages for supplementary services control.

Referenced by gsm48_pdisc_msgtype_name_buf().

const struct value_string gsm48_pdisc_names[]
Initial value:
= {
{ GSM48_PDISC_GROUP_CC, "VGCC" },
{ GSM48_PDISC_BCAST_CC, "VBCC" },
{ GSM48_PDISC_PDSS1, "PDSS1" },
{ GSM48_PDISC_CC, "CC" },
{ GSM48_PDISC_PDSS2, "PDSS2" },
{ GSM48_PDISC_MM, "MM" },
{ GSM48_PDISC_RR, "RR" },
{ GSM48_PDISC_MM_GPRS, "GMM" },
{ GSM48_PDISC_SMS, "SMS" },
{ GSM48_PDISC_NC_SS, "NCSS" },
{ GSM48_PDISC_LOC, "LCS" },
{ GSM48_PDISC_EXTEND, "EXTD" },
{ GSM48_PDISC_MASK, "MASK" },
{ 0, NULL }
}
#define GSM48_PDISC_SM_GPRS
Definition: gsm_04_08.h:1408
#define GSM48_PDISC_BCAST_CC
Definition: gsm_04_08.h:1399
#define GSM48_PDISC_CC
Definition: gsm_04_08.h:1401
#define GSM48_PDISC_NC_SS
Definition: gsm_04_08.h:1409
#define GSM48_PDISC_SMS
Definition: gsm_04_08.h:1407
#define GSM48_PDISC_MM
Definition: gsm_04_08.h:1404
#define GSM48_PDISC_RR
Definition: gsm_04_08.h:1405
#define GSM48_PDISC_LOC
Definition: gsm_04_08.h:1410
#define GSM48_PDISC_MASK
Definition: gsm_04_08.h:1413
#define GSM48_PDISC_PDSS2
Definition: gsm_04_08.h:1402
#define GSM48_PDISC_EXTEND
Definition: gsm_04_08.h:1411
#define GSM48_PDISC_PDSS1
Definition: gsm_04_08.h:1400
#define GSM48_PDISC_GROUP_CC
Definition: gsm_04_08.h:1398
#define GSM48_PDISC_MM_GPRS
Definition: gsm_04_08.h:1406

TS 04.08 Protocol Descriptor names.

Referenced by gsm48_pdisc_name().

const struct value_string gsm48_reject_value_names[]

Referenced by gsm48_reject_value_name().

const struct tlv_definition gsm48_rr_att_tlvdef

TLV parser definitions for TS 04.08 RR.

const struct value_string gsm48_rr_msgtype_names[]

TS 04.08 RR Message Type names.

Referenced by gsm48_pdisc_msgtype_name_buf().

const struct value_string gsm_chan_t_names[]
Initial value:
= {
{ GSM_LCHAN_NONE, "NONE" },
{ GSM_LCHAN_SDCCH, "SDCCH" },
{ GSM_LCHAN_TCH_F, "TCH_F" },
{ GSM_LCHAN_TCH_H, "TCH_H" },
{ GSM_LCHAN_UNKNOWN, "UNKNOWN" },
{ GSM_LCHAN_CCCH, "CCCH" },
{ GSM_LCHAN_PDTCH, "PDTCH" },
{ GSM_LCHAN_CBCH, "CBCH" },
{ 0, NULL },
}
Definition: gsm_utils.h:226
Definition: gsm_utils.h:221
Definition: gsm_utils.h:222
Definition: gsm_utils.h:220
Definition: gsm_utils.h:225
Definition: gsm_utils.h:224
Definition: gsm_utils.h:219
Definition: gsm_utils.h:223

Referenced by gsm_chan_t_name().

const struct value_string mi_type_names[]
static
Initial value:
= {
{ GSM_MI_TYPE_NONE, "NONE" },
{ GSM_MI_TYPE_IMSI, "IMSI" },
{ GSM_MI_TYPE_IMEI, "IMEI" },
{ GSM_MI_TYPE_IMEISV, "IMEI-SV" },
{ GSM_MI_TYPE_TMSI, "TMSI" },
{ 0, NULL }
}
#define GSM_MI_TYPE_IMSI
Definition: gsm_04_08.h:1714
#define GSM_MI_TYPE_TMSI
Definition: gsm_04_08.h:1717
#define GSM_MI_TYPE_NONE
Definition: gsm_04_08.h:1713
#define GSM_MI_TYPE_IMEISV
Definition: gsm_04_08.h:1716
#define GSM_MI_TYPE_IMEI
Definition: gsm_04_08.h:1715
const struct value_string osmo_cm_service_type_names[]
Initial value:
= {
{ GSM48_CMSERV_EMERGENCY, "Emergency-Call" },
{ GSM48_CMSERV_SMS, "Short-Messaging-Service" },
{ GSM48_CMSERV_SUP_SERV, "Supplementary-Service" },
{ GSM48_CMSERV_VGCS, "Voice-Group-Call" },
{ GSM48_CMSERV_VBS, "Voice-Broadcast-Call" },
{ GSM48_CMSERV_LOC_SERV, "Location-Service" },
{}
}
Definition: gsm_04_08.h:1680
Definition: gsm_04_08.h:1685
Definition: gsm_04_08.h:1684
Definition: gsm_04_08.h:1681
Definition: gsm_04_08.h:1682
Definition: gsm_04_08.h:1686
Definition: gsm_04_08.h:1683

Referenced by osmo_cm_service_type_name().

const struct value_string osmo_lu_type_names[]
Initial value:
= {
{ GSM48_LUPD_NORMAL, "NORMAL" },
{ GSM48_LUPD_PERIODIC, "PERIODIC" },
{ GSM48_LUPD_IMSI_ATT, "IMSI-ATTACH" },
{ GSM48_LUPD_RESERVED, "RESERVED" },
{}
}
#define GSM48_LUPD_IMSI_ATT
Definition: gsm_04_08.h:1704
#define GSM48_LUPD_RESERVED
Definition: gsm_04_08.h:1705
#define GSM48_LUPD_NORMAL
Definition: gsm_04_08.h:1702
#define GSM48_LUPD_PERIODIC
Definition: gsm_04_08.h:1703

Referenced by osmo_lu_type_name().

const struct value_string rr_cause_names[]
static
Initial value:
= {
{ GSM48_RR_CAUSE_NORMAL, "Normal event" },
{ GSM48_RR_CAUSE_ABNORMAL_UNSPEC, "Abnormal release, unspecified" },
{ GSM48_RR_CAUSE_ABNORMAL_UNACCT, "Abnormal release, channel unacceptable" },
{ GSM48_RR_CAUSE_ABNORMAL_TIMER, "Abnormal release, timer expired" },
{ GSM48_RR_CAUSE_ABNORMAL_NOACT, "Abnormal release, no activity on radio path" },
{ GSM48_RR_CAUSE_PREMPTIVE_REL, "Preemptive release" },
{ GSM48_RR_CAUSE_HNDOVER_IMP, "Handover impossible, timing advance out of range" },
{ GSM48_RR_CAUSE_CHAN_MODE_UNACCT, "Channel mode unacceptable" },
{ GSM48_RR_CAUSE_FREQ_NOT_IMPL, "Frequency not implemented" },
{ GSM48_RR_CAUSE_CALL_CLEARED, "Call already cleared" },
{ GSM48_RR_CAUSE_SEMANT_INCORR, "Semantically incorrect message" },
{ GSM48_RR_CAUSE_INVALID_MAND_INF, "Invalid mandatory information" },
{ GSM48_RR_CAUSE_MSG_TYPE_N, "Message type non-existant or not implemented" },
{ GSM48_RR_CAUSE_MSG_TYPE_N_COMPAT, "Message type not compatible with protocol state" },
{ GSM48_RR_CAUSE_COND_IE_ERROR, "Conditional IE error" },
{ GSM48_RR_CAUSE_NO_CELL_ALLOC_A, "No cell allocation available" },
{ GSM48_RR_CAUSE_PROT_ERROR_UNSPC, "Protocol error unspecified" },
{ 0, NULL },
}
Definition: gsm_04_08.h:1878
Definition: gsm_04_08.h:1882
Definition: gsm_04_08.h:1875
Definition: gsm_04_08.h:1873
Definition: gsm_04_08.h:1888
Definition: gsm_04_08.h:1886
Definition: gsm_04_08.h:1889
Definition: gsm_04_08.h:1885
Definition: gsm_04_08.h:1884
Definition: gsm_04_08.h:1883
Definition: gsm_04_08.h:1874
Definition: gsm_04_08.h:1880
Definition: gsm_04_08.h:1881
Definition: gsm_04_08.h:1877
Definition: gsm_04_08.h:1887
Definition: gsm_04_08.h:1876
Definition: gsm_04_08.h:1879
const struct value_string rr_msg_names[]
static