libosmogsm 1.10.0.57-8972
Osmocom GSM library
|
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... | |
void | osmo_rai_to_gprs (struct gprs_ra_id *dest, const struct osmo_routing_area_id *src) |
Convert osmo_routing_area_id (new) into gprs_ra_id (old) More... | |
void | gprs_rai_to_osmo (struct osmo_routing_area_id *dest, const struct gprs_ra_id *src) |
Convert gprs_ra_id (old) into osmo_routing_area_id (new) 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_rr_short_pd_msg_name (uint8_t msgtype) |
return string representation of RR Message Type using the RR short protocol discriminator More... | |
enum gsm48_chan_mode | gsm48_chan_mode_to_vamos (enum gsm48_chan_mode mode) |
Translate GSM48_CMODE_SPEECH_* to its corresponding GSM48_CMODE_SPEECH_*_VAMOS mode. More... | |
enum gsm48_chan_mode | gsm48_chan_mode_to_non_vamos (enum gsm48_chan_mode mode) |
Translate GSM48_CMODE_SPEECH_*_VAMOS to its corresponding GSM48_CMODE_SPEECH_* non-vamos mode. 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) |
Deprecated, see osmo_mobile_identity instead. More... | |
const char * | osmo_mi_name (const uint8_t *mi, uint8_t mi_len) |
Deprecated, see osmo_mobile_identity instead. More... | |
char * | osmo_mi_name_c (const void *ctx, const uint8_t *mi, uint8_t mi_len) |
Deprecated, see osmo_mobile_identity instead. More... | |
int | osmo_mobile_identity_decode (struct osmo_mobile_identity *mi, const uint8_t *mi_data, uint8_t mi_len, bool allow_hex) |
Extract Mobile Identity from encoded bytes (3GPP TS 24.008 10.5.1.4). More... | |
int | osmo_mobile_identity_encoded_len (const struct osmo_mobile_identity *mi, int *mi_digits) |
Return the number of encoded Mobile Identity octets, without actually encoding. More... | |
int | osmo_mobile_identity_encode_buf (uint8_t *buf, size_t buflen, const struct osmo_mobile_identity *mi, bool allow_hex) |
Encode Mobile Identity from uint32_t (TMSI) or digits string (all others) (3GPP TS 24.008 10.5.1.4). More... | |
int | osmo_mobile_identity_encode_msgb (struct msgb *msg, const struct osmo_mobile_identity *mi, bool allow_hex) |
Encode Mobile Identity type and BCD digits, appended to a msgb. More... | |
int | osmo_mobile_identity_decode_from_l3_buf (struct osmo_mobile_identity *mi, const uint8_t *l3_data, size_t l3_len, bool allow_hex) |
Extract Mobile Identity from a Complete Layer 3 message. More... | |
int | osmo_mobile_identity_decode_from_l3 (struct osmo_mobile_identity *mi, struct msgb *msg, bool allow_hex) |
Extract Mobile Identity from a Complete Layer 3 message. More... | |
int | osmo_mobile_identity_to_str_buf (char *buf, size_t buflen, const struct osmo_mobile_identity *mi) |
Return a human readable representation of a struct osmo_mobile_identity. More... | |
char * | osmo_mobile_identity_to_str_c (void *ctx, const struct osmo_mobile_identity *mi) |
Like osmo_mobile_identity_to_str_buf(), but return the string in a talloc buffer. More... | |
int | osmo_mobile_identity_cmp (const struct osmo_mobile_identity *a, const struct osmo_mobile_identity *b) |
Compare two osmo_mobile_identity structs, returning typical cmp() result. 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) |
Deprecated, see osmo_mobile_identity instead. More... | |
uint8_t | gsm48_generate_mid (uint8_t *buf, const char *id, uint8_t mi_type) |
Deprecated, see osmo_mobile_identity instead. More... | |
int | gsm48_generate_mid_from_imsi (uint8_t *buf, const char *imsi) |
Deprecated, see osmo_mobile_identity instead. More... | |
int | gsm48_mi_to_string (char *string, int str_len, const uint8_t *mi, int mi_len) |
Deprecated, see osmo_mobile_identity instead. More... | |
int | osmo_routing_area_id_decode (struct osmo_routing_area_id *dst, const uint8_t *ra_data, size_t ra_data_len) |
Decode to struct osmo_routing_area_id from a 3GPP TS 24.008 § 10.5.5.15 Routing area identification. More... | |
int | osmo_routing_area_id_encode_buf (uint8_t *buf, size_t buflen, const struct osmo_routing_area_id *src) |
Encode struct osmo_routing_area_id to a 3GPP TS 24.008 § 10.5.5.15 Routing area identification: write to a buffer. More... | |
int | osmo_routing_area_id_encode_msgb (struct msgb *msg, const struct osmo_routing_area_id *src) |
Encode struct osmo_routing_area_id to a 3GPP TS 24.008 § 10.5.5.15 Routing area identification: append to msgb. 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... | |
bool | gsm48_ra_equal (const struct gprs_ra_id *raid1, const struct gprs_ra_id *raid2) |
Compare a TS 04.08 Routing Area Identifier. More... | |
int | gsm48_number_of_paging_subchannels (const 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_hdr * | gsm48_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, const 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... | |
int | gsm48_decode_classmark3 (struct gsm48_classmark3 *classmark3_out, const uint8_t *classmark3, size_t classmark3_len) |
Decode 3GPP TS 24.008 Mobile Station Classmark 3 (10.5.1.7). 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 [] |
static const struct value_string | rr_msg_type_short_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_string * | gsm48_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_string * | gsm48_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_string * | gprs_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_string * | gprs_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_string * | gprs_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_string * | gprs_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_string * | gprs_service_t_strs = gprs_service_t_strs_ |
GSM Mobile Radion Interface L3 messages / TS 04.08.
|
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.
[in] | ms_net_cap | Buffer with raw MS network capability IE value, 3 - 10 bytes |
[in] | cap_len | Length of ms_net_cap, in bytes |
[in] | gea | Version of GEA to check |
References GPRS_ALGO_GEA0, GPRS_ALGO_GEA1, GPRS_ALGO_GEA2, GPRS_ALGO_GEA3, and GPRS_ALGO_GEA4.
void gprs_rai_to_osmo | ( | struct osmo_routing_area_id * | dest, |
const struct gprs_ra_id * | src | ||
) |
Convert gprs_ra_id (old) into osmo_routing_area_id (new)
References osmo_location_area_id::lac, osmo_routing_area_id::lac, gprs_ra_id::lac, osmo_plmn_id::mcc, gprs_ra_id::mcc, osmo_plmn_id::mnc, gprs_ra_id::mnc, osmo_plmn_id::mnc_3_digits, gprs_ra_id::mnc_3_digits, OSMO_ASSERT, osmo_location_area_id::plmn, osmo_routing_area_id::rac, and gprs_ra_id::rac.
const char * gsm48_cc_msg_name | ( | uint8_t | msgtype | ) |
return string representation of CC Message Type
References cc_msg_names, and 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.
enum gsm48_chan_mode gsm48_chan_mode_to_non_vamos | ( | enum gsm48_chan_mode | mode | ) |
Translate GSM48_CMODE_SPEECH_*_VAMOS to its corresponding GSM48_CMODE_SPEECH_* non-vamos mode.
If the mode is not a VAMOS mode, return the unchanged mode.
References GSM48_CMODE_SPEECH_AMR, GSM48_CMODE_SPEECH_EFR, GSM48_CMODE_SPEECH_V1, GSM48_CMODE_SPEECH_V1_VAMOS, GSM48_CMODE_SPEECH_V2_VAMOS, GSM48_CMODE_SPEECH_V3_VAMOS, GSM48_CMODE_SPEECH_V5, GSM48_CMODE_SPEECH_V5_VAMOS, and mode.
enum gsm48_chan_mode gsm48_chan_mode_to_vamos | ( | enum gsm48_chan_mode | mode | ) |
Translate GSM48_CMODE_SPEECH_* to its corresponding GSM48_CMODE_SPEECH_*_VAMOS mode.
If the mode has no equivalent VAMOS mode, return a negative value.
References GSM48_CMODE_SPEECH_AMR, GSM48_CMODE_SPEECH_EFR, GSM48_CMODE_SPEECH_V1, GSM48_CMODE_SPEECH_V1_VAMOS, GSM48_CMODE_SPEECH_V2_VAMOS, GSM48_CMODE_SPEECH_V3_VAMOS, GSM48_CMODE_SPEECH_V5_VAMOS, and mode.
int gsm48_construct_ra | ( | uint8_t * | buf, |
const struct gprs_ra_id * | raid | ||
) |
Encode a TS 04.08 Routing Area Identifier.
[out] | buf | Caller-provided output buffer of 6 bytes |
[in] | raid | Routing Area ID to be encoded |
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.
[out] | output | Caller-provided output buffer |
[in] | output_len | sizeof(output) |
[in] | bcd_lv | Length-Value portion of to-be-decoded IE |
[in] | h_len | Length of an optional heder between L and V portion |
References gsm48_decode_bcd_number2().
Referenced by gsm0808_dec_msisdn(), 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.
[out] | output | Caller-provided output buffer. |
[in] | output_len | sizeof(output). |
[in] | bcd_lv | Length-Value part of to-be-decoded IE. |
[in] | input_len | Size of the bcd_lv buffer for bounds checking. |
[in] | h_len | Length of an optional header between L and V parts. |
Errors checked:
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_bearer_cap | ( | struct gsm_mncc_bearer_cap * | bcap, |
const uint8_t * | lv | ||
) |
Decode TS 04.08 Bearer Capability IE (10.5.4.5)
[out] | bcap | Caller-provided memory for decoded output |
[in] | lv | LV portion of TS 04.08 Bearer Capability |
References gsm_mncc_bearer_cap::async, gsm_mncc_bearer_cap::coding, gsm_mncc_bearer_cap::data, GSM48_BCAP_RRQ_DUAL_FR, GSM48_BCAP_RRQ_DUAL_HR, GSM48_BCAP_RRQ_FR_ONLY, GSM48_BCAP_SV_FR, GSM48_BCAP_SV_HR, GSM_MNCC_BCAP_AUDIO, GSM_MNCC_BCAP_FAX_G3, GSM_MNCC_BCAP_SPEECH, GSM_MNCC_BCAP_UNR_DIG, gsm_mncc_bearer_cap::interm_rate, gsm_mncc_bearer_cap::mode, gsm_mncc_bearer_cap::modem_type, gsm_mncc_bearer_cap::nr_data_bits, gsm_mncc_bearer_cap::nr_stop_bits, gsm_mncc_bearer_cap::parity, gsm_mncc_bearer_cap::radio, gsm_mncc_bearer_cap::rate_adaption, gsm_mncc_bearer_cap::sig_access, gsm_mncc_bearer_cap::speech_ctm, gsm_mncc_bearer_cap::speech_ver, gsm_mncc_bearer_cap::transfer, gsm_mncc_bearer_cap::transp, and gsm_mncc_bearer_cap::user_rate.
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)
[out] | called | Caller-provided memory for decoded number |
[in] | lv | Length-Value portion of IE |
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.
[out] | callerid | Caller-provided memory for decoded number |
[in] | lv | Length-Value portion of IE |
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)
[out] | cause | Caller-provided memory for output |
[in] | lv | LV portion of Cause IE |
References cause.
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)
[out] | ccap | Caller-provided memory for decoded CC capabilities |
[in] | lv | Length-Value of IE |
References gsm_mncc_cccap::dtmf, and gsm_mncc_cccap::pcp.
int gsm48_decode_classmark3 | ( | struct gsm48_classmark3 * | classmark3_out, |
const uint8_t * | classmark3, | ||
size_t | classmark3_len | ||
) |
Decode 3GPP TS 24.008 Mobile Station Classmark 3 (10.5.1.7).
[out] | classmark3_out | user provided memory to store decoded classmark3. |
[in] | classmark3 | pointer to memory that contains the raw classmark bits. |
[in] | classmark3_len | length in bytes of the memory where classmark3 points to. |
References gsm48_classmark3::a5_bits, gsm48_classmark3::add_pos_cap, gsm48_classmark3::assoc_radio_cap, gsm48_classmark3::assoc_radio_cap_1, gsm48_classmark3::assoc_radio_cap_2, bitvec_get_uint(), gsm48_classmark3::cdma200_rat_cap, gsm48_classmark3::ciphering_mode_setting_cap, gsm48_classmark3::cs_ps_srvcc_geran_eutra, gsm48_classmark3::cs_ps_srvcc_geran_utra, bitvec::data, data, bitvec::data_len, gsm48_classmark3::dl_advanced_rx_perf, gsm48_classmark3::dtm_egprs_high_multislot_cap, gsm48_classmark3::dtm_egprs_multislot_cap, gsm48_classmark3::dtm_enhancements_cap, gsm48_classmark3::dtm_gprs_high_multislot_cap, gsm48_classmark3::dtm_gprs_multislot_cap, gsm48_classmark3::e_utra_fdd_supp, gsm48_classmark3::e_utra_meas_rep_supp, gsm48_classmark3::e_utra_mult_band_ind_supp, gsm48_classmark3::e_utra_tdd_supp, gsm48_classmark3::e_utra_wb_rsrq_meas_supp, gsm48_classmark3::ecsd_multislot_cap, gsm48_classmark3::er_band_support, gsm48_classmark3::extended_dtm_egprs_multislot_cap, gsm48_classmark3::extended_dtm_gprs_multislot_cap, gsm48_classmark3::extended_earfcn_val_range, gsm48_classmark3::extended_meas_cap, gsm48_classmark3::extended_tsc_set_cap_supp, gsm48_classmark3::geran_feature_package, gsm48_classmark3::geran_feature_package_2, gsm48_classmark3::geran_net_sharing, gsm48_classmark3::gmsk_multislot_power_prof, gsm48_classmark3::gsm_1900_assoc_radio_cap, gsm48_classmark3::gsm_400_bands_supp, gsm48_classmark3::gsm_710_assoc_radio_cap, gsm48_classmark3::gsm_750_assoc_radio_cap, gsm48_classmark3::gsm_850_assoc_radio_cap, gsm48_classmark3::high_multislot_cap, gsm48_classmark3::hscsd_mult_slot_cap, gsm48_classmark3::method, gsm48_classmark3::mod_cap, gsm48_classmark3::ms_meas_cap, gsm48_classmark3::ms_pos_method_cap, gsm48_classmark3::mslot_class, gsm48_classmark3::mult_band_supp, gsm48_classmark3::offset_required, gsm48_classmark3::present, gsm48_classmark3::prio_resel_supp, gsm48_classmark3::psk8_multislot_power_prof, gsm48_classmark3::psk8_struct, gsm48_classmark3::r_gsm_assoc_radio_cap, gsm48_classmark3::r_support, gsm48_classmark3::repeated_acch_capability, gsm48_classmark3::rf_pwr_cap_1, gsm48_classmark3::rf_pwr_cap_2, gsm48_classmark3::sel_ciph_dl_sacch, gsm48_classmark3::single_band_supp, gsm48_classmark3::single_slot_dtm, gsm48_classmark3::sm_value, gsm48_classmark3::sms_value, gsm48_classmark3::t_gsm_400_bands_supp, gsm48_classmark3::t_gsm_810_assoc_radio_cap, gsm48_classmark3::tighter_capability, gsm48_classmark3::ucs2_treatment, gsm48_classmark3::umts_1_28_mcps_tdd_rat_cap, gsm48_classmark3::umts_fdd_rat_cap, gsm48_classmark3::umts_tdd_rat_cap, gsm48_classmark3::utra_csg_cells_rep, gsm48_classmark3::utra_mult_band_ind_supp, gsm48_classmark3::value, and gsm48_classmark3::vamos_level.
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, |
const 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.
[out] | f | Caller-provided output memory, an array of 1024 elements |
[in] | cd | Cell Channel Description IE |
[in] | len | Length of cd in bytes |
References if(), len, 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.
[in] | Location | Area Identifier (encoded) |
[out] | mcc | Mobile Country Code |
[out] | mnc | Mobile Network Code |
[out] | lac | Location Area Code |
Attention: this function returns true integers, not hex!
References gsm48_decode_lai2(), osmo_location_area_id::lac, lac, lai, 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.
[in] | Location | Area Identifier (encoded). |
[out] | decoded | Target 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, lai, osmo_ntohs, osmo_plmn_from_bcd(), and osmo_location_area_id::plmn.
Referenced by decode_lai(), gsm48_decode_lai(), and osmo_routing_area_id_decode().
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'
[out] | bcd_lv | Caller-provided output buffer |
[in] | max_len | Maximum Length of bcd_lv |
[in] | h_len | Length of an optional heder between L and V portion |
[in] | input | phone number as 0-terminated ASCII |
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 gsm0808_enc_msisdn(), gsm340_gen_oa(), gsm48_encode_called(), gsm48_encode_callerid(), and osmo_gsup_encode().
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)
[out] | msg | Message Buffer to which IE is to be appended |
[in] | lv_only | Write only LV portion (1) or TLV (0) |
[in] | bcap | Decoded Bearer Capability to be encoded |
References gsm_mncc_bearer_cap::async, gsm_mncc_bearer_cap::coding, gsm_mncc_bearer_cap::data, GSM48_BCAP_ITCAP_3k1_AUDIO, GSM48_BCAP_ITCAP_FAX_G3, GSM48_BCAP_ITCAP_UNR_DIG_INF, GSM48_IE_BEARER_CAP, GSM_MNCC_BCAP_SPEECH, gsm_mncc_bearer_cap::interm_rate, gsm_mncc_bearer_cap::mode, gsm_mncc_bearer_cap::modem_type, msg, msgb_lv_put(), msgb_tlv_put(), gsm_mncc_bearer_cap::nr_data_bits, gsm_mncc_bearer_cap::nr_stop_bits, gsm_mncc_bearer_cap::parity, gsm_mncc_bearer_cap::radio, gsm_mncc_bearer_cap::rate_adaption, gsm_mncc_bearer_cap::sig_access, gsm_mncc_bearer_cap::speech_ctm, gsm_mncc_bearer_cap::speech_ver, gsm_mncc_bearer_cap::transfer, gsm_mncc_bearer_cap::transp, and gsm_mncc_bearer_cap::user_rate.
int gsm48_encode_called | ( | struct msgb * | msg, |
const struct gsm_mncc_number * | called | ||
) |
Encode TS 04.08 Called Party IE (10.5.4.7)
[out] | msg | Mesage Buffer to which to append IE (as TLV) |
[in] | called | MNCC Number to encode/append |
References gsm48_encode_bcd_number(), GSM48_IE_CALLED_BCD, msg, 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.
[out] | msg | Mesage Buffer to which to append IE (as TLV) |
[in] | ie | IE Identifier (tag) |
[in] | max_len | maximum generated output in bytes |
[in] | callerid | MNCC Number to encode/append |
References gsm48_encode_bcd_number(), msg, 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(), GSM48_IE_CALLING_BCD, and msg.
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)
[out] | msg | Message Buffer to which to append IE |
[in] | lv_only | Encode as LV (1) or TLV (0) |
[in] | cause | Cause value to be encoded |
References cause, GSM48_IE_CAUSE, msg, msgb_lv_put(), and msgb_tlv_put().
int gsm48_encode_cccap | ( | struct msgb * | msg, |
const struct gsm_mncc_cccap * | ccap | ||
) |
Encodoe TS 04.08 Call Control Capabilities (10.5.4.5a)
[out] | msg | Message Buffer to which to append IE (as TLV) |
[in] | ccap | Decoded CC Capabilities to be encoded |
References gsm_mncc_cccap::dtmf, GSM48_IE_CC_CAP, msg, 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(), GSM48_IE_CONN_BCD, and msg.
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)
References GSM48_IE_FACILITY, GSM_MAX_FACILITY, gsm_mncc_facility::info, gsm_mncc_facility::len, msg, msgb_lv_put(), and msgb_tlv_put().
int gsm48_encode_keypad | ( | struct msgb * | msg, |
int | keypad | ||
) |
Encode TS 04.08 Keypad IE (10.5.4.17)
References GSM48_IE_KPD_FACILITY, msg, 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, msg, and msgb_put().
int gsm48_encode_notify | ( | struct msgb * | msg, |
int | notify | ||
) |
Encode TS 04.08 Notify IE (10.5.4.20)
References msg, and msgb_v_put().
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)
References gsm_mncc_progress::coding, gsm_mncc_progress::descr, GSM48_IE_PROGR_IND, gsm_mncc_progress::location, msg, msgb_lv_put(), and msgb_tlv_put().
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.
[out] | out | Caller-provided packed struct |
[in] | raid | Routing 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(), GSM48_IE_REDIR_BCD, and msg.
int gsm48_encode_signal | ( | struct msgb * | msg, |
int | signal | ||
) |
Encode TS 04.08 Signal IE (10.5.4.23)
References GSM48_IE_SIGNAL, msg, 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, msg, and msgb_tlv_put().
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)
References GSM48_IE_USER_USER, GSM_MAX_USERUSER, gsm_mncc_useruser::info, msg, msgb_lv_put(), msgb_tlv_put(), and gsm_mncc_useruser::proto.
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.
[out] | lai48 | caller-provided memory for output |
[in] | mcc | Mobile Country Code |
[in] | mnc | Mobile Network Code |
[in] | lac | Location Area Code |
References gsm48_generate_lai2(), lac, gsm48_loc_area_id::lac, and lai.
void gsm48_generate_lai2 | ( | struct gsm48_loc_area_id * | lai48, |
const struct osmo_location_area_id * | lai | ||
) |
Encode TS 04.08 Location Area Identifier.
[out] | lai48 | caller-provided memory for output. |
[in] | lai | input of MCC-MNC-LAC. |
References gsm48_loc_area_id::digits, gsm48_loc_area_id::lac, lai, osmo_htons, and osmo_plmn_to_bcd().
Referenced by gsm0808_create_layer3_2(), gsm0808_msgb_put_cell_id_u(), gsm48_generate_lai(), msgb_sgsap_lai_put(), and osmo_routing_area_id_encode_buf().
uint8_t gsm48_generate_mid | ( | uint8_t * | buf, |
const char * | id, | ||
uint8_t | mi_type | ||
) |
Deprecated, see osmo_mobile_identity instead.
Generate TS 24.008 §10.5.1.4 Mobile ID of BCD type from ASCII string
[out] | buf | Caller-provided output buffer of at least GSM48_MID_MAX_SIZE bytes |
[in] | id | Identity to be encoded |
[in] | mi_type | Type of identity (e.g. GSM_MI_TYPE_IMSI, IMEI, IMEISV) |
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 | ||
) |
Deprecated, see osmo_mobile_identity instead.
Generate TS 04.08 Mobile ID from IMSI
[out] | buf | Caller-provided output buffer |
[in] | imsi | IMSI to be encoded |
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 | ||
) |
Deprecated, see osmo_mobile_identity instead.
Generate TS 04.08 Mobile ID from TMSI
[out] | buf | Caller-provided output buffer (7 bytes) |
[in] | tmsi | TMSI to be encoded |
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.
[in] | hdr | Message header |
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, hdr, and gsm48_hdr::msg_type.
void gsm48_mcc_mnc_from_bcd | ( | uint8_t * | bcd_src, |
uint16_t * | mcc, | ||
uint16_t * | mnc | ||
) |
References osmo_plmn_id::mcc, osmo_plmn_id::mnc, and osmo_plmn_from_bcd().
void gsm48_mcc_mnc_to_bcd | ( | uint8_t * | bcd_dst, |
uint16_t | mcc, | ||
uint16_t | mnc | ||
) |
References osmo_plmn_id::mcc, osmo_plmn_id::mnc, and osmo_plmn_to_bcd().
int gsm48_mi_to_string | ( | char * | string, |
int | str_len, | ||
const uint8_t * | mi, | ||
int | mi_len | ||
) |
Deprecated, see osmo_mobile_identity instead.
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'.
[out] | string | Caller-provided buffer for output |
[in] | str_len | Length of string in bytes |
[in] | mi | Mobile Identity to be stringified |
[in] | mi_len | Length of mi in bytes |
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, 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(), mi, and mi_type_names.
Referenced by osmo_mi_name_buf(), and osmo_mobile_identity_to_str_buf().
int gsm48_number_of_paging_subchannels | ( | const struct gsm48_control_channel_descr * | chan_desc | ) |
Determine number of paging sub-channels.
[in] | chan_desc | Control Channel Description |
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 chan_desc, 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.
Preferably use osmo_routing_area_id_decode() instead: struct osmo_routing_area_id is better integrated with other API like osmo_plmn_cmp().
[out] | Caller-provided | memory for decoded RA ID |
[in] | buf | Input 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>".
[in] | pdisc | protocol discriminator like GSM48_PDISC_MM |
[in] | msg_type | message type like GSM48_MT_MM_LOC_UPD_REQUEST |
References gsm48_pdisc_msgtype_name_buf(), msg_type, 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>".
[out] | buf | caller-allcated output string buffer |
[in] | buf_len | size of buf in bytes |
[in] | pdisc | protocol discriminator like GSM48_PDISC_MM |
[in] | msg_type | message type like GSM48_MT_MM_LOC_UPD_REQUEST |
References get_value_string(), gsm48_cc_msgtype_names, gsm48_mm_msgtype_names, gsm48_nc_ss_msgtype_names, GSM48_PDISC_BCAST_CC, GSM48_PDISC_CC, GSM48_PDISC_GROUP_CC, GSM48_PDISC_MM, gsm48_pdisc_name(), GSM48_PDISC_NC_SS, GSM48_PDISC_RR, gsm48_rr_msgtype_names, msg_type, and osmo_gsm44068_msg_type_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>".
[in] | ctx | talloc context from which to allocate output buffer |
[in] | pdisc | protocol discriminator like GSM48_PDISC_MM |
[in] | msg_type | message type like GSM48_MT_MM_LOC_UPD_REQUEST |
References gsm48_pdisc_msgtype_name_buf(), msg_type, and namebuf.
Wrap a given msg with gsm48_hdr structure.
[out] | msg | A message to be wrapped |
[in] | pdisc | GSM 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_type | GSM TS 04.08 message type |
References msg, 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().
bool gsm48_ra_equal | ( | const struct gprs_ra_id * | raid1, |
const struct gprs_ra_id * | raid2 | ||
) |
Compare a TS 04.08 Routing Area Identifier.
[in] | raid1 | first Routing Area ID to compare. |
[in] | raid2 | second Routing Area ID to compare. |
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_rr_msg_name | ( | uint8_t | msgtype | ) |
return string representation of RR Message Type
References get_value_string(), and rr_msg_names.
const char * gsm48_rr_short_pd_msg_name | ( | uint8_t | msgtype | ) |
return string representation of RR Message Type using the RR short protocol discriminator
References get_value_string(), and rr_msg_type_short_names.
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)
[in] | op | Cell Options structure in which DTX parameters will be set |
[in] | full | Mode for full-rate channels |
[in] | half | Mode for half-rate channels |
[in] | is_bcch | Indicates 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.
bool osmo_gsm48_classmark1_is_r99 | ( | const struct gsm48_classmark1 * | cm1 | ) |
Referenced by osmo_gsm48_classmark_is_r99().
bool osmo_gsm48_classmark2_is_r99 | ( | const struct gsm48_classmark2 * | cm2, |
uint8_t | cm2_len | ||
) |
Referenced by osmo_gsm48_classmark_is_r99().
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.
[in] | cm | Classmarks. |
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.
[in] | cm | Classmarks. |
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.
[in] | ctx | talloc context from which to allocate output buffer |
[in] | cm | Classmarks. |
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.
[in] | cm | Classmarks. |
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.
[in] | cm | Classmarks. |
[in] | a5 | The N in A5/N for which to query whether support is indicated. |
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.)
[out] | dst | The target Classmark storage to be updated. |
[in] | src | The 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.
[in] | rf_power_cap | The RF power capability field (3 bits). |
[in] | band | the band of the arfcn from where the classmark was received |
References GSM_BAND_1800, and GSM_BAND_1900.
const char * osmo_mi_name | ( | const uint8_t * | mi, |
uint8_t | mi_len | ||
) |
Deprecated, see osmo_mobile_identity instead.
Return a human readable representation of a Mobile Identity in static buffer.
[in] | mi | Mobile Identity buffer containing 3GPP TS 04.08 style MI type and data. |
[in] | mi_len | Length of mi. |
References GSM48_MI_SIZE, mi, mi_len, and osmo_mi_name_buf().
char * osmo_mi_name_buf | ( | char * | buf, |
size_t | buf_len, | ||
const uint8_t * | mi, | ||
uint8_t | mi_len | ||
) |
Deprecated, see osmo_mobile_identity instead.
Return a human readable representation of a Mobile Identity in caller-provided buffer.
[out] | buf | caller-provided output buffer |
[in] | buf_len | size of buf in bytes |
[in] | mi | Mobile Identity buffer containing 3GPP TS 04.08 style MI type and data. |
[in] | mi_len | Length of mi. |
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, 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 | ||
) |
Deprecated, see osmo_mobile_identity instead.
Return a human readable representation of a Mobile Identity in dynamically-allocated buffer.
[in] | ctx | talloc context from which to allocate output buffer |
[in] | mi | Mobile Identity buffer containing 3GPP TS 04.08 style MI type and data. |
[in] | mi_len | Length of mi. |
References GSM48_MI_SIZE, mi, mi_len, and osmo_mi_name_buf().
int osmo_mobile_identity_cmp | ( | const struct osmo_mobile_identity * | a, |
const struct osmo_mobile_identity * | b | ||
) |
Compare two osmo_mobile_identity structs, returning typical cmp() result.
[in] | a | Left side osmo_mobile_identity. |
[in] | b | Right side osmo_mobile_identity. |
References GSM_MI_TYPE_IMEI, GSM_MI_TYPE_IMEISV, GSM_MI_TYPE_IMSI, GSM_MI_TYPE_TMSI, and OSMO_CMP.
int osmo_mobile_identity_decode | ( | struct osmo_mobile_identity * | mi, |
const uint8_t * | mi_data, | ||
uint8_t | mi_len, | ||
bool | allow_hex | ||
) |
Extract Mobile Identity from encoded bytes (3GPP TS 24.008 10.5.1.4).
On failure (negative return value), mi->type == GSM_MI_TYPE_NONE, mi->string[] is all-zero and mi->tmsi == GSM_RESERVED_TMSI.
On success, mi->type reflects the decoded Mobile Identity type (GSM_MI_TYPE_IMSI, GSM_MI_TYPE_TMSI, GSM_MI_TYPE_IMEI or GSM_MI_TYPE_IMEISV).
On success, mi->string always contains a human readable representation of the Mobile Identity digits: IMSI, IMEI and IMEISV as digits like "12345678", and TMSI as "0x" and 8 hexadecimal digits like "0x1234abcd".
mi->tmsi contains the uint32_t TMSI value iff the extracted Mobile Identity was a TMSI, or GSM_RESERVED_TMSI otherwise.
[out] | mi | Return buffer for decoded Mobile Identity. |
[in] | mi_data | The encoded Mobile Identity octets. |
[in] | mi_len | Number of octets in mi_data. |
[in] | allow_hex | If false, hexadecimal digits (>9) result in an error return value. |
References GSM23003_IMEI_NUM_DIGITS, GSM23003_IMEI_NUM_DIGITS_NO_CHK, GSM23003_IMEISV_NUM_DIGITS, GSM23003_IMSI_MAX_DIGITS, GSM23003_TMSI_NUM_BYTES, 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, GSM_RESERVED_TMSI, mi, mi_len, osmo_bcd2str(), and value_string::str.
Referenced by osmo_bssmap_le_ie_dec_imei(), osmo_bssmap_le_ie_dec_imsi(), and osmo_mobile_identity_decode_from_l3_buf().
int osmo_mobile_identity_decode_from_l3 | ( | struct osmo_mobile_identity * | mi, |
struct msgb * | msg, | ||
bool | allow_hex | ||
) |
Extract Mobile Identity from a Complete Layer 3 message.
Determine the Mobile Identity data and call osmo_mobile_identity_decode() to return a decoded struct osmo_mobile_identity.
[out] | mi | Return buffer for decoded Mobile Identity. |
[in] | msg | The Complete Layer 3 message to extract from (LU, CM Service Req or Paging Resp). |
References mi, msg, msgb_l3, msgb_l3len(), and osmo_mobile_identity_decode_from_l3_buf().
int osmo_mobile_identity_decode_from_l3_buf | ( | struct osmo_mobile_identity * | mi, |
const uint8_t * | l3_data, | ||
size_t | l3_len, | ||
bool | allow_hex | ||
) |
Extract Mobile Identity from a Complete Layer 3 message.
Determine the Mobile Identity data and call osmo_mobile_identity_decode() to return a decoded struct osmo_mobile_identity.
[out] | mi | Return buffer for decoded Mobile Identity. |
[in] | l3_data | The Complete Layer 3 message to extract from (LU, CM Service Req or Paging Resp). |
[in] | l3_len | Length of l3_data in bytes. |
References cm2_len, gsm48_hdr::data, ENOTSUP, gsm48_hdr_msg_type, gsm48_hdr_pdisc(), GSM48_MT_MM_CM_REEST_REQ, GSM48_MT_MM_CM_SERV_REQ, GSM48_MT_MM_ID_RESP, GSM48_MT_MM_IMSI_DETACH_IND, GSM48_MT_MM_LOC_UPD_REQUEST, GSM48_MT_RR_PAG_RESP, GSM48_MT_RR_TALKER_IND, GSM48_PDISC_MM, GSM48_PDISC_RR, GSM_MI_TYPE_NONE, GSM_RESERVED_TMSI, if(), mi, gsm48_imsi_detach_ind::mi, mi_len, gsm48_imsi_detach_ind::mi_len, and osmo_mobile_identity_decode().
Referenced by osmo_mobile_identity_decode_from_l3().
int osmo_mobile_identity_encode_buf | ( | uint8_t * | buf, |
size_t | buflen, | ||
const struct osmo_mobile_identity * | mi, | ||
bool | allow_hex | ||
) |
Encode Mobile Identity from uint32_t (TMSI) or digits string (all others) (3GPP TS 24.008 10.5.1.4).
[out] | buf | Return buffer for encoded Mobile Identity. |
[in] | buflen | sizeof(buf). |
[in] | mi | Mobile identity to encode. |
[in] | allow_hex | If false, hexadecimal digits (>9) result in an error return value. |
References ENOTSUP, GSM_MI_ODD, GSM_MI_TYPE_IMEI, GSM_MI_TYPE_IMEISV, GSM_MI_TYPE_IMSI, GSM_MI_TYPE_MASK, GSM_MI_TYPE_TMSI, mi, osmo_mobile_identity_encoded_len(), and osmo_str2bcd().
Referenced by osmo_mobile_identity_encode_msgb().
int osmo_mobile_identity_encode_msgb | ( | struct msgb * | msg, |
const struct osmo_mobile_identity * | mi, | ||
bool | allow_hex | ||
) |
Encode Mobile Identity type and BCD digits, appended to a msgb.
Example to add a GSM48_IE_MOBILE_ID IEI with tag and length to a msgb:
struct osmo_mobile_identity mi = { .type = GSM_MI_TYPE_IMSI }; OSMO_STRLCPY_ARRAY(mi.imsi, "1234567890123456"); uint8_t *l = msgb_tl_put(msg, GSM48_IE_MOBILE_ID); int rc = osmo_mobile_identity_encode_msgb(msg, &mi, false); if (rc < 0) goto error; *l = rc;
Example to add a BSSGP_IE_IMSI with tag and variable-size length, where the length needs to be known at the time of writing the IE tag-length header:
struct osmo_mobile_identity mi = { .type = GSM_MI_TYPE_IMSI, }; OSMO_STRLCPY_ARRAY(mi.imsi, pinfo->imsi); msgb_tvl_put(msg, BSSGP_IE_IMSI, osmo_mobile_identity_encoded_len(&mi, NULL)); if (osmo_mobile_identity_encode_msgb(msg, &mi, false) < 0) goto error;
References mi, msg, msgb_put(), msgb_tailroom(), and osmo_mobile_identity_encode_buf().
Referenced by gsm0808_create_common_id(), gsm0808_create_perform_location_request(), gsm0808_create_uplink_request(), and osmo_bssmap_le_enc_perform_loc_req().
int osmo_mobile_identity_encoded_len | ( | const struct osmo_mobile_identity * | mi, |
int * | mi_digits | ||
) |
Return the number of encoded Mobile Identity octets, without actually encoding.
Useful to write tag-length header before encoding the MI.
[in] | mi | Mobile Identity. |
[out] | mi_digits | If not NULL, store the number of nibbles of used MI data (i.e. strlen(mi->string) or 8 for a TMSI). |
References ENOTSUP, GSM23003_IMEI_NUM_DIGITS, GSM23003_IMEI_NUM_DIGITS_NO_CHK, GSM23003_IMEISV_NUM_DIGITS, GSM23003_IMSI_MAX_DIGITS, GSM23003_IMSI_MIN_DIGITS, GSM23003_TMSI_NUM_BYTES, GSM_MI_TYPE_IMEI, GSM_MI_TYPE_IMEISV, GSM_MI_TYPE_IMSI, GSM_MI_TYPE_TMSI, and mi.
Referenced by osmo_mobile_identity_encode_buf().
int osmo_mobile_identity_to_str_buf | ( | char * | buf, |
size_t | buflen, | ||
const struct osmo_mobile_identity * | mi | ||
) |
Return a human readable representation of a struct osmo_mobile_identity.
Write a string like "IMSI-1234567", "TMSI-0x1234ABCD" or "NONE", "NULL".
[out] | buf | String buffer to write to. |
[in] | buflen | sizeof(buf). |
[in] | mi | Decoded Mobile Identity data. |
References osmo_strbuf::buf, osmo_strbuf::chars_needed, gsm48_mi_type_name(), GSM_MI_TYPE_IMEI, GSM_MI_TYPE_IMEISV, GSM_MI_TYPE_IMSI, GSM_MI_TYPE_TMSI, mi, and OSMO_STRBUF_PRINTF.
Referenced by osmo_mobile_identity_to_str_c().
char * osmo_mobile_identity_to_str_c | ( | void * | ctx, |
const struct osmo_mobile_identity * | mi | ||
) |
Like osmo_mobile_identity_to_str_buf(), but return the string in a talloc buffer.
[in] | ctx | Talloc context to allocate from. |
[in] | mi | Decoded Mobile Identity data. |
References mi, osmo_mobile_identity_to_str_buf(), and OSMO_NAME_C_IMPL.
const char * osmo_rai_name | ( | const struct gprs_ra_id * | rai | ) |
Return MCC-MNC-LAC-RAC as string, in a static buffer.
[in] | rai | RAI to encode. |
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.
[out] | buf | caller-provided output buffer |
[in] | buf_len | size of buf in bytes |
[in] | rai | RAI to encode. |
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.
[in] | ctx | talloc context from which to allocate output buffer |
[in] | rai | RAI to encode. |
References osmo_rai_name_buf().
void osmo_rai_to_gprs | ( | struct gprs_ra_id * | dest, |
const struct osmo_routing_area_id * | src | ||
) |
Convert osmo_routing_area_id (new) into gprs_ra_id (old)
References osmo_location_area_id::lac, osmo_routing_area_id::lac, gprs_ra_id::lac, osmo_plmn_id::mcc, gprs_ra_id::mcc, osmo_plmn_id::mnc, gprs_ra_id::mnc, osmo_plmn_id::mnc_3_digits, gprs_ra_id::mnc_3_digits, OSMO_ASSERT, osmo_location_area_id::plmn, osmo_routing_area_id::rac, and gprs_ra_id::rac.
int osmo_routing_area_id_decode | ( | struct osmo_routing_area_id * | dst, |
const uint8_t * | ra_data, | ||
size_t | ra_data_len | ||
) |
Decode to struct osmo_routing_area_id from a 3GPP TS 24.008 § 10.5.5.15 Routing area identification.
[out] | dst | Store the decoded result here. |
[in] | ra_data | The start of a Routing Area ID in encoded form, to be decoded. |
[in] | ra_data_len | Buffer size available to read from at *ra_data. |
References gsm48_decode_lai2(), osmo_routing_area_id::lac, ra_id, and osmo_routing_area_id::rac.
int osmo_routing_area_id_encode_buf | ( | uint8_t * | buf, |
size_t | buflen, | ||
const struct osmo_routing_area_id * | src | ||
) |
Encode struct osmo_routing_area_id to a 3GPP TS 24.008 § 10.5.5.15 Routing area identification: write to a buffer.
[out] | buf | Return buffer for encoded Mobile Identity. |
[in] | buflen | sizeof(buf). |
[in] | src | RA to encode. |
References gsm48_generate_lai2(), osmo_routing_area_id::lac, ra_id, and osmo_routing_area_id::rac.
Referenced by osmo_routing_area_id_encode_msgb().
int osmo_routing_area_id_encode_msgb | ( | struct msgb * | msg, |
const struct osmo_routing_area_id * | src | ||
) |
Encode struct osmo_routing_area_id to a 3GPP TS 24.008 § 10.5.5.15 Routing area identification: append to msgb.
To succeed, the msgb must have tailroom >= sizeof(struct gsm48_ra_id).
[out] | msg | Append to this msgb. |
[in] | src | Encode this Routing Area ID. |
References msg, msgb_put(), msgb_tailroom(), and osmo_routing_area_id_encode_buf().
const char * rr_cause_name | ( | uint8_t | cause | ) |
return string representation of RR Cause value
References cause, get_value_string(), and rr_cause_names.
|
static |
Referenced by gsm48_decode_freq_list().
|
static |
Referenced by asc_to_bcd(), and gsm48_decode_bcd_number2().
|
static |
Referenced by gsm48_cc_msg_name().
|
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_[] |
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_[] |
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_[] |
String names of GMM MT Detach Types according to 10.5.5.5.
const struct value_string gprs_msgt_gmm_names[] |
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_[] |
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_[] |
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[] |
Referenced by gsm48_chan_mode_name().
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 |
TLV parser definitions for TS 04.08 MM.
const struct value_string gsm48_mm_msgtype_names[] |
TS 04.08 MM Message Type names.
Referenced by gsm48_pdisc_msgtype_name_buf().
const struct value_string gsm48_nc_ss_msgtype_names[] |
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[] |
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[] |
Referenced by gsm_chan_t_name().
|
static |
Referenced by gsm48_mi_type_name().
const struct value_string osmo_cm_service_type_names[] |
Referenced by osmo_cm_service_type_name().
const struct value_string osmo_lu_type_names[] |
Referenced by osmo_lu_type_name().
|
static |
Referenced by rr_cause_name().
|
static |
Referenced by gsm48_rr_msg_name().
|
static |
Referenced by gsm48_rr_short_pd_msg_name().