sm: Forward forth and back the P-TMSI signature

Change-Id: Ia69b6f885d612c42ab015822031e4c7262f4714e
This commit is contained in:
Pau Espin 2023-05-19 18:38:10 +02:00
parent 104562737c
commit 7d7040976f
4 changed files with 7 additions and 0 deletions

View File

@ -65,6 +65,7 @@ struct osmo_gprs_sm_smreg_prim {
uint8_t pco_len;
struct {
uint32_t ptmsi;
uint32_t ptmsi_sig;
bool attach_with_imsi;
char imsi[OSMO_IMSI_BUF_SIZE];
char imei[GSM23003_IMEI_NUM_DIGITS + 1];
@ -89,6 +90,7 @@ struct osmo_gprs_sm_smreg_prim {
uint8_t qos_len;
struct {
uint32_t allocated_ptmsi;
uint32_t allocated_ptmsi_sig;
uint32_t allocated_tlli;
struct gprs_ra_id rai;
} gmm;

View File

@ -127,6 +127,7 @@ struct gprs_sm_ms {
struct {
uint32_t ptmsi;
uint32_t ptmsi_sig;
uint32_t tlli;
char imsi[OSMO_IMSI_BUF_SIZE];
char imei[GSM23003_IMEI_NUM_DIGITS + 1];

View File

@ -193,6 +193,7 @@ int gprs_sm_submit_gmmsm_assign_req(const struct gprs_sm_entity *sme)
gmm_prim_tx->gmmsm.establish_req.attach_type = OSMO_GPRS_GMM_ATTACH_TYPE_GPRS;
gmm_prim_tx->gmmsm.establish_req.attach_with_imsi = (ms->gmm.ptmsi == GSM_RESERVED_TMSI);
gmm_prim_tx->gmmsm.establish_req.ptmsi = ms->gmm.ptmsi;
gmm_prim_tx->gmmsm.establish_req.ptmsi_sig = ms->gmm.ptmsi_sig;
OSMO_STRLCPY_ARRAY(gmm_prim_tx->gmmsm.establish_req.imsi, ms->gmm.imsi);
OSMO_STRLCPY_ARRAY(gmm_prim_tx->gmmsm.establish_req.imei, ms->gmm.imei);
OSMO_STRLCPY_ARRAY(gmm_prim_tx->gmmsm.establish_req.imeisv, ms->gmm.imeisv);
@ -224,6 +225,7 @@ int gprs_sm_submit_smreg_pdp_act_cnf(const struct gprs_sm_entity *sme, enum gsm4
if (sme->qos_len)
memcpy(sm_prim_tx->smreg.pdp_act_cnf.acc.qos, &sme->qos, sme->qos_len);
sm_prim_tx->smreg.pdp_act_cnf.acc.gmm.allocated_ptmsi = sme->ms->gmm.ptmsi;
sm_prim_tx->smreg.pdp_act_cnf.acc.gmm.allocated_ptmsi_sig = sme->ms->gmm.ptmsi_sig;
sm_prim_tx->smreg.pdp_act_cnf.acc.gmm.allocated_tlli = sme->ms->gmm.tlli;
memcpy(&sm_prim_tx->smreg.pdp_act_cnf.acc.gmm.rai, &sme->ms->gmm.ra, sizeof(sme->ms->gmm.ra));
} else {

View File

@ -270,6 +270,7 @@ static int gprs_sm_prim_handle_smreg_pdp_act_req(struct osmo_gprs_sm_prim *sm_pr
/* Info required to establish GMM: */
ms->gmm.ptmsi = sm_prim->smreg.pdp_act_req.gmm.ptmsi;
ms->gmm.ptmsi_sig = sm_prim->smreg.pdp_act_req.gmm.ptmsi_sig;
if (sm_prim->smreg.pdp_act_req.gmm.imsi[0] != '\0')
OSMO_STRLCPY_ARRAY(ms->gmm.imsi, sm_prim->smreg.pdp_act_req.gmm.imsi);
if (sm_prim->smreg.pdp_act_req.gmm.imei[0] != '\0')
@ -479,6 +480,7 @@ static int gprs_sm_prim_handle_gmmsm_establish_cnf(struct osmo_gprs_gmm_prim *gm
/* Update allocated PTMSI: */
if (gmm_prim->gmmsm.establish_cnf.acc.allocated_ptmsi != GSM_RESERVED_TMSI)
sme->ms->gmm.ptmsi = gmm_prim->gmmsm.establish_cnf.acc.allocated_ptmsi;
sme->ms->gmm.ptmsi_sig = gmm_prim->gmmsm.establish_cnf.acc.allocated_ptmsi_sig;
/* Set allocated TLLI: */
sme->ms->gmm.tlli = gmm_prim->gmmsm.establish_cnf.acc.allocated_tlli;
/* Set the current RAI: */