void S1mmeSession::CtEncodeKqi(S1MMEKQI* kqi, S1APNode* p_node, uint8_t worker_id) { MsgCommonInfo& common = p_node->GetCommonInfo(); SPUserInfo& sp_user_info = p_node->GetUserInfo(); //获取 buf TlvEncoder* p_encoder_cur = g_p_encoder_[worker_id]; YdCDR_T* p_dst_data = (YdCDR_T*)malloc(sizeof(YdCDR_T)); if (p_dst_data == NULL) { return; } p_dst_data->not_associate = 0; if ((common.not_associate & 0x03) == 0x03) p_dst_data->not_associate = 1; p_encoder_cur->Set(p_dst_data->cdr_data,kMaxOneCdrBufLen); uint64_t imsi = sp_user_info->GetIMSI(); if(common.eci == 0) { common.eci = sp_user_info->GetEci(); } uint16_t tmp_enbid = common.tac;//>>8; //uint32_t tmp_enbid = (common.eci >> 8)&0xfffff; char xdrid_str[32]={0}; #ifdef OPEN_NEW_HUISU convert_xdrid_to_string(xdrid_str, kqi->xdrid, s_xdr_id_len); #else #ifdef OPENCTPR g4sigtran::pr::ProcBlock* p_blk = kqi->binary_block_in_xdr_.GetBlock(); p_blk->SerializeXid(xdrid_str, sizeof(xdrid_str)); #else uint64_t subcdrid = g_ct_xdr_id.GetXid(); //reverse subend; if(::is_open_reverse) { SetReverseSubend(p_node, subcdrid); } #ifdef ONE_THIRD_YUNNAN_MRO g_ct_xdr_id.Serialize((uint8_t*)xdrid_str, s_xdr_id_len, imsi); #else g_ct_xdr_id.Serialize((uint8_t*)xdrid_str, s_xdr_id_len); #endif #endif #endif struct timespec start_time = kqi->request_time_, end_time = kqi->response_time_; if (kqi->request_time_.tv_sec == 0) { if (!(kqi->response_time_.tv_sec == 0)) { start_time = kqi->response_time_; } else if (!(kqi->complete_time_.tv_sec == 0)) { start_time = kqi->complete_time_; } } if (!(kqi->complete_time_.tv_sec == 0)) { end_time = kqi->complete_time_; } if (end_time.tv_sec == 0) { end_time = start_time; } p_encoder_cur->SetHdr(kEncoderCdr, kqi->kqi_type_, current_time_.tv_sec, worker_id); //child_kqi //p_encoder_cur->Add("0", kExportTagChildKqi); //1 interface p_encoder_cur->Add(kInterfaceS1mme, kExportTagInterfaceId); //2 xdrid if (xdrid_str[0] != '\0') p_encoder_cur->Add((char*)(xdrid_str), s_xdr_id_len, kExportTagXdrid); //3 imsi if (imsi != 0) { p_encoder_cur->Add(imsi, kExportTagImsi);什么意思
时间: 2024-03-30 12:35:51 浏览: 140
SDCycleScrollView-master.zip_KQI_SDCycleScrollView_oc 轮播图框架_轮播图
这段代码是一个函数,函数名为 `CtEncodeKqi`。它的作用是编码一个 `S1MMEKQI` 结构体,将编码结果存储在一个 `TlvEncoder` 对象中。这段代码中,首先获取了一些节点的信息,并且根据这些信息填充了一个 `YdCDR_T` 结构体。然后,根据一些规则计算出了一些变量的值,如 `tmp_enbid` 和 `xdrid_str`。最后,使用 `TlvEncoder` 对象将编码结果添加到编码器中,包括接口ID、XDR ID、IMSI等信息。
阅读全文