uint64_t S1mmeSession::UpdateUserDataSTMSIChange(S1APNode* p_node, uint64_t stmsi) { if(!stmsi) return 0; uint64_t old_stmsi = 0; //如果stmsi没有改变, 则直接返回 SPUserInfo& sp_local_user_info = p_node->GetUserInfo(); if (sp_local_user_info->HasSTMSI() && sp_local_user_info->GetSTMSI() == stmsi) { return old_stmsi; } //删除 old stmsi if (sp_local_user_info->HasSTMSI()) { old_stmsi = sp_local_user_info->GetSTMSI(); STMSI_Iter iter = ue_stmsi_map_.find(old_stmsi); if (iter != ue_stmsi_map_.end()) { ue_stmsi_map_.erase(iter); } DeleteFromStmsiTimeoutMap(old_stmsi); } //删除可能的 paging 干扰 StmsiWithMmegi_T old_stmsi_key(old_stmsi); S1APNode** pp_paging = p_stmsi_paging_map_->GetData(old_stmsi_key); if (pp_paging != NULL) { if (handle_session_version_ == S1MME_SESSION_VERSION_CHINA_TELECOM) { CtOutputNode(*pp_paging, false); } else { (*pp_paging)->DeletePagingKqi(); } p_stmsi_paging_map_->DeleteData(old_stmsi_key, p_s1ap_node_allocator_); } StmsiWithMmegi_T new_stmsi_key(stmsi); pp_paging = p_stmsi_paging_map_->GetData(new_stmsi_key); if (pp_paging != NULL) { if(handle_session_version_ == S1MME_SESSION_VERSION_CHINA_TELECOM) { CtOutputNode(*pp_paging, false); } else { (*pp_paging)->DeletePagingKqi(); } p_stmsi_paging_map_->DeleteData(new_stmsi_key, p_s1ap_node_allocator_); } //删除可能的 new_stmsi 干扰 STMSI_Iter iter = ue_stmsi_map_.find(stmsi); if (iter != ue_stmsi_map_.end()) { iter->second->flag_.stmsi = false; iter->second->index_.stmsi =0; ue_stmsi_map_.erase(iter); } UpdateFromStmsiTimeoutMap(stmsi, current_time_.tv_sec, true); //插入 new_stmsi(local user info) ue_stmsi_map_.insert(std::make_pair(stmsi, sp_local_user_info)); sp_local_user_info->SetSTMSI(stmsi); return old_stmsi; }什么意思
时间: 2024-04-01 19:32:48 浏览: 119
C实现与 uint64_t 相同功能的类
这段代码是一个 C++ 函数,用于在 S1mmeSession 中更新用户数据的 STMSI 字段。STMSI 是一个标识用户的短期移动子系统标识,如果 STMSI 发生改变,则需要更新用户的信息。函数接受两个参数,一个是 S1APNode 指针,一个是 uint64_t 类型的新 STMSI 值。函数首先检查新 STMSI 是否为 0,如果是则直接返回。然后检查新 STMSI 是否与原来的 STMSI 相同,如果相同则也直接返回。如果新 STMSI 不同于原来的 STMSI,则需要进行一系列删除和插入操作,以更新用户信息。其中包括删除旧的 STMSI 并从超时映射表中删除,删除可能的 paging 干扰,删除可能的新 STMSI 干扰,更新超时映射表并插入新的 STMSI。最后函数返回旧的 STMSI 值。
阅读全文