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);什么意思
时间: 2024-04-01 20:33:58 浏览: 68
SDCycleScrollView-master.zip_KQI_SDCycleScrollView_oc 轮播图框架_轮播图
这是一个函数的实现,函数名为S1mmeSession::CtEncodeKqi。该函数的作用是将S1MMEKQI结构体编码为TLV格式,并存储到缓冲区中。在函数中,先获取S1APNode的common和userInfo信息,然后获取TLV编码器和YdCDR_T类型的目标数据指针。接着,根据common和userInfo信息以及其他参数,设置目标数据指针的一些字段。然后,设置TLV编码器的头部信息,包括编码类型、KQI类型、时间戳和worker_id等。最后,通过TLV编码器将目标数据编码为TLV格式,并存储到缓冲区中。在函数的最后,出现了一行注释,但是没有具体说明该行代码的作用。
阅读全文