void S1mmeSession::NASUpdateUserData(S1APNode* p_node, EMMInfo_T& emm_info) { uint16_t mmegi = emm_info.v.mmegi; #ifdef MMEGI_MERGE if (mmegi == 0 && open_mmeip_mmegi_) { uint16_t find_mmegi = MmeipToMmegi(p_node->GetCommonInfo().mme_ip); if (find_mmegi) mmegi = find_mmegi; } #endif uint64_t stmsi_with_mmegi = AddMmegiToStmsi(emm_info.v.stmsi, mmegi); switch (emm_info.v.msg_type) { case kAttachRequest: SetAttachIdentityType(emm_info.v.imsi != 0); if (emm_info.v.imsi != 0) { p_node->GetCommonInfo().not_associate |= 0x01; //UpdateUserDataIMSI(p_node, emm_info.v.imsi); } //no break here!!! case kDetachRequest: UpdateUserData(p_node, emm_info.flag.imsi, emm_info.v.imsi, emm_info.flag.stmsi, stmsi_with_mmegi, false, true); break; case kTrackingAreaUpdateAccept: case kAttachAccept: case kGUTIReallocationCommand:{ //stmsi 变更(如果确实有变更) uint64_t old_stmsi = 0; if (emm_info.flag.stmsi) { old_stmsi = UpdateUserData(p_node, emm_info.flag.imsi, emm_info.v.imsi, emm_info.flag.stmsi, stmsi_with_mmegi, true); } else { UpdateUserData(p_node, emm_info.flag.imsi, emm_info.v.imsi, emm_info.flag.stmsi, stmsi_with_mmegi); } if (old_stmsi != 0) { emm_info.SetOldSTMSI(old_stmsi); } break; } default://关联其他接口 GetImsiKasmeViaNas(p_node, emm_info); UpdateUserData(p_node, emm_info.flag.imsi, emm_info.v.imsi, emm_info.flag.stmsi, stmsi_with_mmegi); break; } }什么意思
时间: 2024-02-14 13:21:06 浏览: 83
这段代码是C++语言编写的,是一个函数S1mmeSession::NASUpdateUserData,用于更新用户数据。它接受两个参数,一个是S1APNode类型的指针p_node,另一个是EMMInfo_T类型的引用emm_info。在函数内部,根据emm_info中的信息,更新用户的状态。
具体来说,函数首先获取emm_info中的mmegi(Mobile Management Entity Group Identity)值,然后根据MMEGI_MERGE宏的定义,如果mmegi为0并且open_mmeip_mmegi_为真,则根据MME(Mobility Management Entity)的IP地址查找mmegi。接下来,函数将stmsi(S-Temporary Mobile Subscriber Identity)和mmegi合并成一个64位的值,以便后续使用。
接着,根据emm_info中的msg_type(消息类型),函数进行不同的操作。如果是kAttachRequest或kDetachRequest类型,则设置附加标识类型,如果有IMSI(International Mobile Subscriber Identity),则将not_associate标志设置为1,并调用UpdateUserData函数更新用户数据。如果是其他类型的消息,则调用GetImsiKasmeViaNas函数获取IMSI和KASME(Key Agreement Scheme for LTE/EPS)值,并调用UpdateUserData函数更新用户数据。如果emm_info中的stmsi有变化,则更新旧的stmsi值。
最后,函数执行完毕。
阅读全文