Loading...
Searching...
No Matches
gsm48.h File Reference
`#include <stdbool.h>`
`#include <osmocom/core/defs.h>`
`#include <osmocom/core/msgb.h>`
`#include <osmocom/gsm/tlv.h>`
`#include <osmocom/gsm/protocol/gsm_04_08.h>`
`#include <osmocom/gsm/protocol/gsm_23_003.h>`
`#include <osmocom/gsm/gsm48_ie.h>`
`#include <osmocom/gsm/gsm23003.h>`

Go to the source code of this file.

## Data Structures

struct | gprs_ra_id

## Macros

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

## Functions

const char * | gsm48_cc_state_name (uint8_t state)
| return string representation of CC State
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_rr_short_pd_msg_name (uint8_t msgtype)
| return string representation of RR Message Type using the RR short protocol discriminator
const char * | rr_cause_name (uint8_t cause)
| return string representation of RR Cause value
const char * | osmo_rai_name (const struct gprs_ra_id *rai)
| Return MCC-MNC-LAC-RAC as string, in a static buffer.
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.
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.
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)
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)
int | gsm48_decode_lai (struct gsm48_loc_area_id *lai, uint16_t *mcc, uint16_t *mnc, uint16_t *lac) OSMO_DEPRECATED("Use gsm48_decode_lai2() instead
void | gsm48_decode_lai2 (const struct gsm48_loc_area_id *lai, struct osmo_location_area_id *decoded)
| Decode TS 04.08 Location Area Identifier.
void | gsm48_generate_lai (struct gsm48_loc_area_id *lai48, uint16_t mcc, uint16_t mnc, uint16_t lac) OSMO_DEPRECATED("Use gsm48_generate_lai2() instead
void | gsm48_generate_lai2 (struct gsm48_loc_area_id *lai48, const struct osmo_location_area_id *lai)
| Encode TS 04.08 Location Area Identifier.
void | gsm48_mcc_mnc_from_bcd (uint8_t *bcd_src, uint16_t *mcc, uint16_t *mnc) OSMO_DEPRECATED("Use osmo_plmn_from_bcd() instead
struct gsm48_hdr * | gsm48_push_l3hdr (struct msgb *msg, uint8_t pdisc, uint8_t msg_type)
| Wrap a given msg with gsm48_hdr structure.
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.
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.

## 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.
int to not lose leading zeros in the | MNC
int gsm48_generate_mid_from_tmsi *(uint8_t *buf, uint32_t tmsi) OSMO_DEPRECATED_OUTSIDE("Instead us | l )

## Macro Definition Documentation

## GSM48_MID_MAX_SIZE

#define GSM48_MID_MAX_SIZE 11

## gsm48_push_l3hdr_tid

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

## GSM_MCC_MNC_INVALID

#define GSM_MCC_MNC_INVALID 0xFFFF

## GSM_RESERVED_TMSI

#define GSM_RESERVED_TMSI 0xFFFFFFFF

## Function Documentation

## gsm48_decode_lai()

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

## gsm48_generate_lai()

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

## gsm48_mcc_mnc_from_bcd()

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

References OSMO_DEPRECATED.

## Variable Documentation

## l

* l

Initial value:
= osmo_mobile_identity_encode_msgb(...)");
int gsm48_generate_mid_from_imsi(uint8_t *buf, const char *imsi)
OSMO_DEPRECATED_OUTSIDE("Instead use: l = msgb_tl_put(msg, GSM48_IE_MOBILE_ID)
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.
Definition gsm48.c:882
msgb_tl_put
static uint8_t * msgb_tl_put(struct msgb *msg, uint8_t tag)
put (append) a TL fields to a Message buffers
Definition tlv.h:399
l
int gsm48_generate_mid_from_tmsi *(uint8_t *buf, uint32_t tmsi) OSMO_DEPRECATED_OUTSIDE("Instead us l)
Definition gsm48.h:60
GSM48_IE_MOBILE_ID
#define GSM48_IE_MOBILE_ID
Definition gsm_04_08.h:1774
len
uint8_t len
Definition gsm_04_11.h:0
msg
uint8_t msg[0]
Definition gsm_08_08.h:8

Referenced by gsm0808_create_perform_location_response(), gsm0808_enc_lcs_cause(), gsm_7bit_decode_n_hdr(), osmo_bssmap_le_enc_perform_loc_abort(), osmo_bssmap_le_enc_perform_loc_req(), osmo_bssmap_le_enc_perform_loc_resp(), osmo_bssmap_le_ie_enc_apdu(), and SHA1Transform().

## MNC

void to not lose leading zeros in the MNC