libosmogsm
0.9.6.277-11f2
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 | |
const char * | gsm48_cc_state_name (uint8_t state) |
return string representation of CC State | |
const char * | gsm48_cc_msg_name (uint8_t msgtype) |
return string representation of CC Message Type | |
const char * | gsm48_rr_msg_name (uint8_t msgtype) |
return string representation of RR Message Type | |
const char * | gsm48_mi_type_name (uint8_t mi) |
return string representation of Mobile Identity Type | |
static void | to_bcd (uint8_t *bcd, uint16_t val) |
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. 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. 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... | |
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, const int str_len, const uint8_t *mi, const 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... | |
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... | |
const char * | gsm48_pdisc_msgtype_name (uint8_t pdisc, uint8_t msg_type) |
Compose a string naming the message type for given protocol. If the message type string is known, return the message type name, otherwise return "<protocol discriminator name>:<message type in hex>". More... | |
int | gsm48_decode_bcd_number (char *output, int output_len, const uint8_t *bcd_lv, int 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 | |
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) | |
int | gsm48_encode_calling (struct msgb *msg, const struct gsm_mncc_number *calling) |
Encode TS 04.08 Calling Number IE (10.5.4.9) | |
int | gsm48_decode_connected (struct gsm_mncc_number *connected, const uint8_t *lv) |
Decode TS 04.08 Connected Number IE (10.5.4.13) | |
int | gsm48_encode_connected (struct msgb *msg, const struct gsm_mncc_number *connected) |
Encode TS 04.08 Connected Number IE (10.5.4.13) | |
int | gsm48_decode_redirecting (struct gsm_mncc_number *redirecting, const uint8_t *lv) |
Decode TS 04.08 Redirecting Number IE (10.5.4.21b) | |
int | gsm48_encode_redirecting (struct msgb *msg, const struct gsm_mncc_number *redirecting) |
Encode TS 04.08 Redirecting Number IE (10.5.4.21b) | |
int | gsm48_decode_facility (struct gsm_mncc_facility *facility, const uint8_t *lv) |
Decode TS 04.08 Facility IE (10.5.4.15) | |
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) | |
int | gsm48_decode_notify (int *notify, const uint8_t *v) |
Decode TS 04.08 Notify IE (10.5.4.20) | |
int | gsm48_encode_notify (struct msgb *msg, int notify) |
Encode TS 04.08 Notify IE (10.5.4.20) | |
int | gsm48_decode_signal (int *signal, const uint8_t *v) |
Decode TS 04.08 Signal IE (10.5.4.23) | |
int | gsm48_encode_signal (struct msgb *msg, int signal) |
Encode TS 04.08 Signal IE (10.5.4.23) | |
int | gsm48_decode_keypad (int *keypad, const uint8_t *lv) |
Decode TS 04.08 Keypad IE (10.5.4.17) | |
int | gsm48_encode_keypad (struct msgb *msg, int keypad) |
Encode TS 04.08 Keypad IE (10.5.4.17) | |
int | gsm48_decode_progress (struct gsm_mncc_progress *progress, const uint8_t *lv) |
Decode TS 04.08 Progress IE (10.5.4.21) | |
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) | |
int | gsm48_decode_useruser (struct gsm_mncc_useruser *uu, const uint8_t *lv) |
Decode TS 04.08 User-User IE (10.5.4.25) | |
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) | |
int | gsm48_decode_ssversion (struct gsm_mncc_ssversion *ssv, const uint8_t *lv) |
Decode TS 04.08 SS Version IE (10.5.4.24) | |
int | gsm48_encode_ssversion (struct msgb *msg, const struct gsm_mncc_ssversion *ssv) |
Encode TS 04.08 SS Version IE (10.5.4.24) | |
int | gsm48_encode_more (struct msgb *msg) |
Encode TS 04.08 More Data IE (10.5.4.19) | |
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. | |
const struct tlv_definition | gsm48_rr_att_tlvdef |
TLV parser definitions for TS 04.08 RR. | |
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. | |
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. | |
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 | |
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 | |
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.
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 |
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 |
int gsm48_decode_bcd_number | ( | char * | output, |
int | output_len, | ||
const uint8_t * | bcd_lv, | ||
int | h_len | ||
) |
decode a 'called/calling/connect party BCD number' as in 10.5.4.7
[out] | Caller-provided | output buffer |
[in] | bcd_lv | Length-Value portion of to-be-decoded IE |
[in] | h_len | Length of an optional heder between L and V portion |
Referenced by gsm48_decode_called(), gsm48_decode_callerid(), 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] | Caller-provided | memory for decoded output [aram[in] LV portion of TS 04.08 Bearer Capability |
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().
int gsm48_decode_callerid | ( | struct gsm_mncc_number * | callerid, |
const uint8_t * | lv | ||
) |
Decode TS 04.08 Caller ID.
[out] | called | Caller-provided memory for decoded number |
[in] | lv | Length-Value portion of IE |
References gsm48_decode_bcd_number().
Referenced by gsm48_decode_calling(), gsm48_decode_connected(), and gsm48_decode_redirecting().
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 |
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] | Caller-provided | memory for decoded CC capabilities |
[in] | lv | Length-Value of IE 0 on success; negative on error |
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.
[out] | f | Caller-provided output memory |
[in] | cd | Cell Channel Description IE |
[in] | len | Length of cd in bytes |
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.
[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!
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 |
References asc_to_bcd().
Referenced by 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 msgb_lv_put(), and msgb_tlv_put().
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(), and msgb_tlv_put().
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(), and msgb_tlv_put().
Referenced by gsm48_encode_calling(), gsm48_encode_connected(), and gsm48_encode_redirecting().
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 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 msgb_tlv_put().
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.
[out] | caller-provided | memory for output |
[in] | mcc | Mobile Country Code |
[in] | mnc | Mobile Network Code |
[in] | lac | Location Area Code |
Referenced by gsm0808_create_layer3_aoip().
int gsm48_generate_mid_from_imsi | ( | uint8_t * | buf, |
const char * | imsi | ||
) |
Generate TS 04.08 Mobile ID from IMSI.
[out] | buf | Caller-provided output buffer |
[in] | imsi | IMSI to be encoded |
Referenced by gsm0808_create_paging().
int gsm48_generate_mid_from_tmsi | ( | uint8_t * | buf, |
uint32_t | tmsi | ||
) |
Generate TS 04.08 Mobile ID from TMSI.
[out] | buf | Caller-provided output buffer (7 bytes) |
[in] | tmsi | TMSI to be encoded |
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 |
int gsm48_mi_to_string | ( | char * | string, |
const int | str_len, | ||
const uint8_t * | mi, | ||
const int | mi_len | ||
) |
Convert TS 04.08 Mobile Identity (10.5.1.4) to string.
[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 |
int gsm48_number_of_paging_subchannels | ( | 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
void gsm48_parse_ra | ( | struct gprs_ra_id * | raid, |
const uint8_t * | buf | ||
) |
Parse TS 04.08 Routing Area Identifier.
[out] | Caller-provided | memory for decoded RA ID |
[in] | buf | Input buffer pointing to RAI IE value |
const char* gsm48_pdisc_msgtype_name | ( | uint8_t | pdisc, |
uint8_t | msg_type | ||
) |
Compose a string naming the message type for given protocol. 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_cc_msgtype_names, gsm48_mm_msgtype_names, and gsm48_rr_msgtype_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.
|
static |
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_[] |
String names of GMM MO Detach Types according to 10.5.5.5.
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_[] |
String names of GMM Service Types.
const struct value_string gprs_upd_t_strs_[] |
String names of GPRS Location Update Types.
const struct value_string gsm48_chan_mode_names[] |
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().
const struct value_string gsm48_pdisc_names[] |
TS 04.08 Protocol Descriptor names.
const struct value_string gsm_chan_t_names[] |
|
static |
|
static |