gmm: Provide allocated PTMSI & TLLI to upper layers

Upper layers (SM or app) may need access to PTMSI or TLLI.

PTMSI:
- App may want to store it somewhere in order to reuse it next time
   it wants to GMM Attach.
TLLI:
- App will need the TLLI to identify the MS when sending/receiving
  primitives over SN SAP (app<->SNDCP).
- SM layer will need the TLLI to communicate over SNSM SAP (SM<->SNDCP),
  as well as relay the information to the app if the GMM Attach happens
  implicitly over SMREG-Act_Pdp_Ctx.req -> GMMSM-Establish-Req.

Change-Id: I552c43c55409773e2d13b72cba45a866165f203f
This commit is contained in:
Pau Espin 2023-05-05 14:40:27 +02:00
parent a76164cd6e
commit 6979b511fb
5 changed files with 14 additions and 8 deletions

View File

@ -117,6 +117,7 @@ struct osmo_gprs_gmm_gmmreg_prim {
struct {
/* PLMNs MT-caps, attach-type. */
uint32_t allocated_ptmsi;
uint32_t allocated_tlli;
} acc;
struct {
uint8_t cause; /* See enum gsm48_gsm_cause */
@ -219,6 +220,8 @@ struct osmo_gprs_gmm_gmmsm_prim {
union {
struct {
/* PLMNs MT-caps, attach-type. */
uint32_t allocated_ptmsi;
uint32_t allocated_tlli;
} acc;
struct {
uint8_t cause;

View File

@ -118,7 +118,7 @@ int gprs_gmm_tx_detach_req(struct gprs_gmm_entity *gmme,
int gprs_gmm_tx_ciph_auth_resp(const struct gprs_gmm_entity *gmme, const uint8_t *sres);
int gprs_gmm_submit_gmmreg_attach_cnf(struct gprs_gmm_entity *gmme, bool accepted, uint8_t cause);
int gprs_gmm_submit_gmmsm_establish_cnf(struct gprs_gmm_entity *gmme, uint32_t sess_id, bool accepted, uint8_t cause);
int gprs_gmm_submit_gmmsm_establish_cnf(struct gprs_gmm_entity *gmme, bool accepted, uint8_t cause);
int gprs_gmm_submit_llgmm_assing_req(const struct gprs_gmm_entity *gmme);
#define LOGGMME(gmme, level, fmt, args...) \

View File

@ -288,6 +288,7 @@ int gprs_gmm_submit_gmmreg_attach_cnf(struct gprs_gmm_entity *gmme, bool accepte
gmm_prim_tx->gmmreg.attach_cnf.accepted = accepted;
if (accepted) {
gmm_prim_tx->gmmreg.attach_cnf.acc.allocated_ptmsi = gmme->ptmsi;
gmm_prim_tx->gmmreg.attach_cnf.acc.allocated_tlli = gmme->tlli;
} else {
gmm_prim_tx->gmmreg.attach_cnf.rej.cause = cause;
}
@ -323,12 +324,16 @@ static int gprs_gmm_submit_gmmreg_sim_auth_ind(struct gprs_gmm_entity *gmme)
return rc;
}
int gprs_gmm_submit_gmmsm_establish_cnf(struct gprs_gmm_entity *gmme, uint32_t sess_id, bool accepted, uint8_t cause)
int gprs_gmm_submit_gmmsm_establish_cnf(struct gprs_gmm_entity *gmme, bool accepted, uint8_t cause)
{
struct osmo_gprs_gmm_prim *gmm_prim_tx;
int rc;
gmm_prim_tx = gprs_gmm_prim_alloc_gmmsm_establish_cnf(sess_id, cause);
gmm_prim_tx = gprs_gmm_prim_alloc_gmmsm_establish_cnf(gmme->sess_id, cause);
if (accepted) {
gmm_prim_tx->gmmsm.establish_cnf.acc.allocated_ptmsi = gmme->ptmsi;
gmm_prim_tx->gmmsm.establish_cnf.acc.allocated_tlli = gmme->tlli;
}
rc = gprs_gmm_prim_call_up_cb(gmm_prim_tx);
return rc;

View File

@ -129,9 +129,7 @@ static void st_gmm_ms_registered_initiated(struct osmo_fsm_inst *fi, uint32_t ev
if (att.implicit_att) {
/* Submit GMMSM-ESTABLISH-CNF as per TS 24.007 Annex C.3 */
rc = gprs_gmm_submit_gmmsm_establish_cnf(ctx->gmme,
ctx->gmme->sess_id,
false, cause);
rc = gprs_gmm_submit_gmmsm_establish_cnf(ctx->gmme, false, cause);
if (rc < 0)
return;
}
@ -147,7 +145,7 @@ static void st_gmm_ms_registered_initiated(struct osmo_fsm_inst *fi, uint32_t ev
}
if (ctx->attach.implicit_att) {
/* Submit GMMSM-ESTABLISH-CNF as per TS 24.007 Annex C.3 */
rc = gprs_gmm_submit_gmmsm_establish_cnf(ctx->gmme, ctx->gmme->sess_id, true, 0);
rc = gprs_gmm_submit_gmmsm_establish_cnf(ctx->gmme, true, 0);
if (rc < 0)
return;
}

View File

@ -489,7 +489,7 @@ static int gprs_gmm_prim_handle_gmmsm_establish_req(struct osmo_gprs_gmm_prim *g
gmme->sess_id = gmm_prim->gmmsm.sess_id;
if (gmme->ms_fsm.fi->state == GPRS_GMM_MS_ST_REGISTERED) {
rc = gprs_gmm_submit_gmmsm_establish_cnf(gmme, gmm_prim->gmmsm.sess_id, true, 0);
rc = gprs_gmm_submit_gmmsm_establish_cnf(gmme, true, 0);
return rc;
}