17#define GSM_RESERVED_TMSI 0xFFFFFFFF
21#define GSM_MCC_MNC_INVALID 0xFFFF
49 uint16_t *mnc, uint16_t *
lac)
53 uint16_t mnc, uint16_t
lac)
57#define GSM48_MID_MAX_SIZE 11
60 " *l = osmo_mobile_identity_encode_msgb(...)");
63 " *l = osmo_mobile_identity_encode_msgb(...)");
66 " *l = osmo_mobile_identity_encode_msgb(...)");
81struct osmo_mobile_identity {
122 OSMO_DEPRECATED(
"Use osmo_plmn_to_bcd() instead, to not lose leading zeros in the MNC");
124 OSMO_DEPRECATED(
"Use osmo_plmn_from_bcd() instead, to not lose leading zeros in the MNC");
129#define gsm48_push_l3hdr_tid(msg, pdisc, tid, msg_type) \
130 gsm48_push_l3hdr(msg, (pdisc & 0x0f) | (tid << 4), msg_type)
const char * rr_cause_name(uint8_t cause)
return string representation of RR Cause value
Definition: gsm48.c:183
void gsm48_mcc_mnc_to_bcd(uint8_t *bcd_dst, uint16_t mcc, uint16_t mnc)
Definition: gsm48.c:1142
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)
Definition: gsm48.c:240
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.
Definition: gsm48.c:882
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.
Definition: gsm48.c:1048
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.
Definition: gsm48.c:582
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.
Definition: gsm48.c:1078
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: appen...
Definition: gsm48.c:1425
const char * gsm48_rr_msg_name(uint8_t msgtype)
return string representation of RR Message Type
Definition: gsm48.c:446
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.
Definition: gsm48.c:1088
const char * osmo_rai_name(const struct gprs_ra_id *rai)
Return MCC-MNC-LAC-RAC as string, in a static buffer.
Definition: gsm48.c:206
const char * osmo_mi_name(const uint8_t *mi, uint8_t mi_len)
Deprecated, see osmo_mobile_identity instead.
Definition: gsm48.c:620
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.
Definition: gsm48.c:217
const char * gsm48_mi_type_name(uint8_t mi)
return string representation of Mobile Identity Type
Definition: gsm48.c:569
int gsm48_generate_mid_from_imsi(uint8_t *buf, const char *imsi)
Deprecated, see osmo_mobile_identity instead.
Definition: gsm48.c:1322
int gsm48_generate_mid_from_tmsi(uint8_t *buf, uint32_t tmsi)
Deprecated, see osmo_mobile_identity instead.
Definition: gsm48.c:1272
void gsm48_parse_ra(struct gprs_ra_id *raid, const uint8_t *buf)
Parse TS 04.08 Routing Area Identifier.
Definition: gsm48.c:1439
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.
Definition: gsm48.c:1385
bool gsm48_ra_equal(const struct gprs_ra_id *raid1, const struct gprs_ra_id *raid2)
Compare a TS 04.08 Routing Area Identifier.
Definition: gsm48.c:1498
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.
Definition: gsm48.c:1466
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....
Definition: gsm48.c:820
const struct tlv_definition gsm48_rr_att_tlvdef
TLV parser definitions for TS 04.08 RR.
Definition: gsm48.c:95
void gsm48_generate_lai2(struct gsm48_loc_area_id *lai48, const struct osmo_location_area_id *lai)
Encode TS 04.08 Location Area Identifier.
Definition: gsm48.c:1186
void gsm48_decode_lai2(const struct gsm48_loc_area_id *lai, struct osmo_location_area_id *decoded)
Decode TS 04.08 Location Area Identifier.
Definition: gsm48.c:1217
const char * gsm48_rr_short_pd_msg_name(uint8_t msgtype)
return string representation of RR Message Type using the RR short protocol discriminator
Definition: gsm48.c:470
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.
Definition: gsm48.c:1036
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.
Definition: gsm48.c:902
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.
Definition: gsm48.c:509
const struct tlv_definition gsm48_mm_att_tlvdef
TLV parser definitions for TS 04.08 MM.
Definition: gsm48.c:141
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)
Definition: gsm48.c:226
const char * gsm48_cc_msg_name(uint8_t msgtype)
return string representation of CC Message Type
Definition: gsm48.c:338
char * osmo_mi_name_c(const void *ctx, const uint8_t *mi, uint8_t mi_len)
Deprecated, see osmo_mobile_identity instead.
Definition: gsm48.c:634
uint8_t gsm48_generate_mid(uint8_t *buf, const char *id, uint8_t mi_type)
Deprecated, see osmo_mobile_identity instead.
Definition: gsm48.c:1290
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.
Definition: gsm48.c:773
const char * gsm48_cc_state_name(uint8_t state)
return string representation of CC State
Definition: gsm48.c:290
struct gsm48_hdr * gsm48_push_l3hdr(struct msgb *msg, uint8_t pdisc, uint8_t msg_type)
Wrap a given msg with gsm48_hdr structure.
Definition: gsm48.c:1895
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).
Definition: gsm48.c:664
int gsm48_construct_ra(uint8_t *buf, const struct gprs_ra_id *raid)
Encode a TS 04.08 Routing Area Identifier.
Definition: gsm48.c:1487
int gsm48_number_of_paging_subchannels(const struct gsm48_control_channel_descr *chan_desc)
Determine number of paging sub-channels.
Definition: gsm48.c:1520
const struct tlv_definition gsm48_att_tlvdef
TLV parser definitions for TS 04.08 CC.
Definition: gsm48.c:53
int gsm48_mi_to_string(char *string, int str_len, const uint8_t *mi, int mi_len)
Deprecated, see osmo_mobile_identity instead.
Definition: gsm48.c:1340
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...
Definition: gsm48.c:1405
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.
Definition: gsm48.c:531
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.
Definition: gsm48.c:194
#define OSMO_DEPRECATED_OUTSIDE(text)
#define OSMO_DEPRECATED(text)
void gsm48_mcc_mnc_from_bcd(uint8_t *bcd_src, uint16_t *mcc, uint16_t *mnc) OSMO_DEPRECATED("Use osmo_plmn_from_bcd() instead
void gsm48_generate_lai(struct gsm48_loc_area_id *lai48, uint16_t mcc, uint16_t mnc, uint16_t lac) OSMO_DEPRECATED("Use gsm48_generate_lai2() instead
int gsm48_decode_lai(struct gsm48_loc_area_id *lai, uint16_t *mcc, uint16_t *mnc, uint16_t *lac) OSMO_DEPRECATED("Use gsm48_decode_lai2() instead
int to not lose leading zeros in the MNC
Definition: gsm48.h:50
GSM TS 04.08 definitions.
uint8_t cause
Definition: gsm_04_08.h:2
gsm48_chan_mode
10.5.2.6 Channel Mode value
Definition: gsm_04_08.h:750
uint8_t mode
Definition: gsm_04_08.h:1
uint16_t lac
Definition: gsm_04_08.h:1
uint8_t mi_len
Definition: gsm_04_08.h:1
struct gsm48_loc_area_id lai
Definition: gsm_04_08.h:2
struct gsm48_chan_desc chan_desc
Definition: gsm_04_08.h:0
uint8_t mi[0]
Definition: gsm_04_08.h:2
uint8_t msg_type
Definition: gsm_04_08.h:2
uint8_t type
Definition: gsm_04_08_gprs.h:7
uint8_t msg[0]
Definition: gsm_08_08.h:8
#define GSM23003_IMEI_NUM_DIGITS
Definition: gsm_23_003.h:30
#define GSM23003_IMEISV_NUM_DIGITS
Definition: gsm_23_003.h:32
#define GSM23003_IMSI_MAX_DIGITS
Definition: gsm_23_003.h:6
_parse instead
Definition: ipa.h:30
bool mnc_3_digits
Definition: gsm48.h:29
uint16_t mcc
Definition: gsm48.h:27
uint16_t lac
Definition: gsm48.h:30
uint8_t rac
Definition: gsm48.h:31
uint16_t mnc
Definition: gsm48.h:28
Definition: gsm_04_08.h:992
Definition: gsm_04_08.h:941
Definition: gsm_04_08.h:898
Definition: gsm_04_08.h:2261
Definition: gsm23003.h:17
Definition: gsm23003.h:23
Definition of All 256 IE / TLV.
Definition: tlv.h:527