Commit a66f8ee0 authored by yangjian's avatar yangjian

Merge branch 'dev-yj'

parents b841938a 044ed83d
......@@ -303,7 +303,7 @@ void amf_n1::handle_itti_message(itti_uplink_nas_data_ind &nas_data_ind) {
mac32_recv);
if (mac32 == mac32_recv) {
isMatched = true;
Logger::amf_n1().info("Integrity matched");
Logger::amf_n1().debug("Integrity matched");
// nc.get()->security_ctx->ul_count.seq_num ++;
}
if (!isMatched) {
......@@ -1521,7 +1521,7 @@ bool amf_n1::authentication_vectors_from_ausf(
iter = ueauthenticationctx.getLinks().find("5G_AKA");
if (iter != ueauthenticationctx.getLinks().end()) {
nc.get()->Href = iter->second.getHref();
Logger::amf_n1().info("Links is: ", nc.get()->Href);
Logger::amf_n1().debug("Links is: ", nc.get()->Href);
} else {
Logger::amf_n1().error("Not found 5G_AKA");
}
......@@ -1556,7 +1556,7 @@ bool amf_n1::_5g_aka_confirmation_from_ausf(std::shared_ptr<nas_context> &nc,
resStar_string = resStar_s;
print_buffer("amf_n1", "********** resStar ***********", resStar_value,
resStar_len);
Logger::amf_n1().info("********** resStar_s (%s) ***********", resStar_s);
Logger::amf_n1().debug("********** resStar_s (%s) ***********", resStar_s);
nlohmann::json confirmationdata_j;
ConfirmationData confirmationdata;
......@@ -1894,10 +1894,10 @@ bool amf_n1::start_authentication_procedure(std::shared_ptr<nas_context> nc,
if (rand)
authReq->setAuthentication_Parameter_RAND(rand);
Logger::amf_n1().debug("Sending Authentication request with rand");
printf("0x");
for (int i = 0; i < 16; i++)
printf("%x", rand[i]);
printf("\n");
// printf("0x");
// for (int i = 0; i < 16; i++)
// printf("%x", rand[i]);
// printf("\n");
uint8_t *autn = nc.get()->_5g_av[vindex].autn;
if (autn)
......@@ -2063,10 +2063,10 @@ void amf_n1::authentication_failure_handle(uint32_t ran_ue_ngap_id,
"IE Authentication Failure Parameter (auts) not received");
}
nc.get()->auts = auts;
printf("Received auts: 0x ");
for (int i = 0; i < blength(auts); i++)
printf("%x ", ((uint8_t *)bdata(auts))[i]);
printf("\n");
// printf("Received auts: 0x ");
// for (int i = 0; i < blength(auts); i++)
// printf("%x ", ((uint8_t *)bdata(auts))[i]);
// printf("\n");
if (auth_vectors_generator(nc)) { // all authentication in one(AMF)
handle_auth_vector_successful_result(nc);
} else {
......@@ -2181,14 +2181,14 @@ int amf_n1::security_select_algorithms(uint8_t nea, uint8_t nia,
for (int i = 0; i < 8; i++) {
if (nea & (0x80 >> amf_cfg.nas_cfg.prefered_ciphering_algorithm[i])) {
amf_nea = amf_cfg.nas_cfg.prefered_ciphering_algorithm[i];
printf("amf_nea: 0x%x\n", amf_nea);
// printf("amf_nea: 0x%x\n", amf_nea);
break;
}
}
for (int i = 0; i < 8; i++) {
if (nia & (0x80 >> amf_cfg.nas_cfg.prefered_integrity_algorithm[i])) {
amf_nia = amf_cfg.nas_cfg.prefered_integrity_algorithm[i];
printf("amf_nia: 0x%x\n", amf_nia);
// printf("amf_nia: 0x%x\n", amf_nia);
break;
}
}
......
......@@ -89,7 +89,7 @@ void octet_stream_2_hex_stream(uint8_t* buf, int len, std::string& out) {
}
tmp[2 * len] = '\0';
out = tmp;
printf("n1sm buffer: %s\n", out.c_str());
// printf("n1sm buffer: %s\n", out.c_str());
}
/****************************************************/
......
......@@ -111,7 +111,7 @@ void RegistrationAccept::set5G_GUTI(
int regionId = fromString<int>(amfRegionId);
int setId = fromString<int>(amfSetId);
int pointer = fromString<int>(amfPointer);
cout << "amfRegionID: " << amfRegionId.c_str() << endl;
// cout << "amfRegionID: " << amfRegionId.c_str() << endl;
ie_5g_guti->set5GGUTI(
mcc, mnc, (uint8_t) regionId, (uint16_t) setId, (uint8_t) pointer, tmsi);
ie_5g_guti->setIEI(0x77);
......
......@@ -410,7 +410,7 @@ asn_dec_rval_t OPEN_TYPE_aper_get(
}
selected = elm->type_selector(td, sptr);
printf("element selected %d \n", selected.presence_index);
// printf("element selected %d \n", selected.presence_index);
if (!selected.presence_index) {
ASN__DECODE_FAILED;
printf("element ASN DECODE FAILED");
......
......@@ -67,11 +67,11 @@ bool AMFSetID::encode2bitstring(Ngap_AMFSetID_t& amfsetid) {
//------------------------------------------------------------------------------
bool AMFSetID::decodefrombitstring(Ngap_AMFSetID_t& amfsetid) {
if (!amfsetid.buf) return false;
printf("test for amfsetid\n");
for (int i = 0; i < amfsetid.size; i++) {
printf("%x ", amfsetid.buf[i]);
}
printf("\n");
// printf("test for amfsetid\n");
// for (int i = 0; i < amfsetid.size; i++) {
// printf("%x ", amfsetid.buf[i]);
// }
// printf("\n");
uint16_t temp = 0;
temp |= amfsetid.buf[0] << 8;
temp |= amfsetid.buf[1];
......
......@@ -66,7 +66,7 @@ bool AllowedNSSAI::getAllowedNSSAI(S_NSSAI*& m_snssai, int& m_numofsnssai) {
//------------------------------------------------------------------------------
bool AllowedNSSAI::encode2AllowedNSSAI(Ngap_AllowedNSSAI_t* allowedNssaiList) {
cout << "AllowedNSSAI::numOfSnssai " << numofSnssai << endl;
// cout << "AllowedNSSAI::numOfSnssai " << numofSnssai << endl;
for (int i = 0; i < numofSnssai; i++) {
Ngap_AllowedNSSAI_Item_t* allowednssaiitem =
(Ngap_AllowedNSSAI_Item_t*) calloc(1, sizeof(Ngap_AllowedNSSAI_Item_t));
......
......@@ -85,7 +85,7 @@ int PDUSessionResourceHandoverCommandTransfer::
asn_enc_rval_t er = aper_encode_to_buffer(
&asn_DEF_Ngap_HandoverCommandTransfer, NULL, handovercommandtransferIE,
buf, buf_size);
cout << "er.encoded(" << er.encoded << ")" << endl;
// cout << "er.encoded(" << er.encoded << ")" << endl;
return er.encoded;
}
......
......@@ -38,7 +38,7 @@ int PDUSessionResourceHandoverRequiredTransfer::encode2buffer(
asn_enc_rval_t er = aper_encode_to_buffer(
&asn_DEF_Ngap_HandoverRequiredTransfer, NULL, handoverrquiredTransferIEs,
buf, buf_size);
cout << "er.encoded(" << er.encoded << ")" << endl;
// cout << "er.encoded(" << er.encoded << ")" << endl;
return er.encoded;
}
// Decapsulation
......
......@@ -134,7 +134,7 @@ int PDUSessionResourceReleaseCommandTransfer::encode2buffer(
asn_enc_rval_t er = aper_encode_to_buffer(
&asn_DEF_Ngap_PDUSessionResourceReleaseCommandTransfer, NULL,
pduSessionResourceReleaseCommandTransferIEs, buf, buf_size);
cout << "er.encoded(" << er.encoded << ")" << endl;
// cout << "er.encoded(" << er.encoded << ")" << endl;
return er.encoded;
}
// Decapsulation
......
......@@ -476,7 +476,7 @@ int PduSessionResourceSetupRequestTransferIE::encode2buffer(
asn_enc_rval_t er = aper_encode_to_buffer(
&asn_DEF_Ngap_PDUSessionResourceSetupRequestTransfer, NULL,
pduSessionResourceSetupRequestTransferIEs, buf, buf_size);
cout << "er.encoded(" << er.encoded << ")" << endl;
// cout << "er.encoded(" << er.encoded << ")" << endl;
// asn_fprint(stderr, er.failed_type, er.structure_ptr);
return er.encoded;
}
......
......@@ -181,7 +181,7 @@ int PduSessionResourceSetupResponseTransferIE::encode2buffer(
asn_enc_rval_t er = aper_encode_to_buffer(
&asn_DEF_Ngap_PDUSessionResourceSetupResponseTransfer, NULL,
pduSessionResourceSetupResponseTransferIEs, buf, buf_size);
cout << "er.encoded(" << er.encoded << ")" << endl;
// cout << "er.encoded(" << er.encoded << ")" << endl;
return er.encoded;
}
......
......@@ -143,7 +143,7 @@ int PduSessionResourceSetupUnSuccessfulTransferIE::encode2buffer(
asn_enc_rval_t er = aper_encode_to_buffer(
&asn_DEF_Ngap_PDUSessionResourceSetupUnsuccessfulTransfer, NULL,
pduSessionResourceSetupUnsuccessfulTransferIEs, buf, buf_size);
cout << "er.encoded(" << er.encoded << ")" << endl;
// cout << "er.encoded(" << er.encoded << ")" << endl;
return er.encoded;
}
......
......@@ -58,7 +58,7 @@ void PLMNSupportItem::setPlmnSliceSupportList(
bool PLMNSupportItem::encode2PLMNSupportItem(
Ngap_PLMNSupportItem_t* plmnsupportItem) {
if (!plmn->encode2octetstring(plmnsupportItem->pLMNIdentity)) return false;
cout << "PLMNSupportItem::numOfSnssai " << numOfSnssai << endl;
// cout << "PLMNSupportItem::numOfSnssai " << numOfSnssai << endl;
for (int i = 0; i < numOfSnssai; i++) {
Ngap_SliceSupportItem_t* slice =
(Ngap_SliceSupportItem_t*) calloc(1, sizeof(Ngap_SliceSupportItem_t));
......
......@@ -51,8 +51,8 @@ void PLMNSupportList::addPLMNSupportItems(
//------------------------------------------------------------------------------
bool PLMNSupportList::encode2PLMNSupportList(
Ngap_PLMNSupportList_t* plmnsupportList) {
cout << "PLMNSupportList::numberOfplmnsupportItemItem ("
<< numberOfplmnsupportItemItem << ")" << endl;
// cout << "PLMNSupportList::numberOfplmnsupportItemItem ("
// << numberOfplmnsupportItemItem << ")" << endl;
for (int i = 0; i < numberOfplmnsupportItemItem; i++) {
Ngap_PLMNSupportItem_t* supportItem =
(Ngap_PLMNSupportItem_t*) calloc(1, sizeof(Ngap_PLMNSupportItem_t));
......
......@@ -36,10 +36,10 @@ QosFlowItemWithDataForWarding::QosFlowItemWithDataForWarding() {
QosFlowItemWithDataForWarding::~QosFlowItemWithDataForWarding() {}
void QosFlowItemWithDataForWarding::getQosFlowItemWithDataForWarding(
Ngap_QosFlowIdentifier_t& m_QosFlowIdentifier) {
if (!qosFlowIdentifier)
printf("qosFlowIdentifier null\n");
else
printf("qosFlowIdentifier \n");
// if (!qosFlowIdentifier)
// printf("qosFlowIdentifier null\n");
// else
// printf("qosFlowIdentifier \n");
if (qosFlowIdentifier->getQosFlowIdentifier(value)) {
m_QosFlowIdentifier = (Ngap_QosFlowIdentifier_t) value;
}
......@@ -49,10 +49,10 @@ bool QosFlowItemWithDataForWarding::decodeformQosFlowItemWithDataForWarding(
qosFlowIdentifier = new QosFlowIdentifier();
if (!qosFlowIdentifier->decodefromQosFlowIdentifier(
&(qosFlowItemWithDataForWarding->qosFlowIdentifier))) {
printf("false\n");
// printf("false\n");
return false;
}
printf("true\n");
// printf("true\n");
return true;
}
} // namespace ngap
......@@ -60,7 +60,7 @@ bool RAN_UE_NGAP_ID::encode2RAN_UE_NGAP_ID(Ngap_RAN_UE_NGAP_ID_t& ranuengapid) {
bool RAN_UE_NGAP_ID::decodefromRAN_UE_NGAP_ID(
Ngap_RAN_UE_NGAP_ID_t& ranuengapid) {
ranUeNgapId = ranuengapid;
cout << "[LibNGAP]Received RanUeNgapId " << ranUeNgapId << endl;
// cout << "[LibNGAP]Received RanUeNgapId " << ranUeNgapId << endl;
return true;
}
} // namespace ngap
......@@ -51,8 +51,8 @@ void ServedGUAMIList::addServedGUAMIItems(
//------------------------------------------------------------------------------
bool ServedGUAMIList::encode2ServedGUAMIList(
Ngap_ServedGUAMIList_t* servedGUAMIList) {
cout << "ServedGUAMIList::numberOfservedGUAMIItem ("
<< numberOfservedGUAMIItem << ")" << endl;
// cout << "ServedGUAMIList::numberOfservedGUAMIItem ("
// << numberOfservedGUAMIItem << ")" << endl;
for (int i = 0; i < numberOfservedGUAMIItem; i++) {
Ngap_ServedGUAMIItem* guamiItem =
(Ngap_ServedGUAMIItem*) calloc(1, sizeof(Ngap_ServedGUAMIItem));
......
......@@ -59,7 +59,7 @@ bool TAC::decodefromoctetstring(Ngap_TAC_t& m_tac) {
for (int i = 0; i < m_tac.size; i++) {
tac |= m_tac.buf[i] << ((m_tac.size - 1 - i) * 8);
}
std::cout << "Received TAC: " << tac << std::endl;
// std::cout << "Received TAC: " << tac << std::endl;
return true;
}
......
......@@ -228,7 +228,7 @@ int DownLinkNasTransportMsg::encode2buffer(uint8_t* buf, int buf_size) {
asn_fprint(stderr, &asn_DEF_Ngap_NGAP_PDU, downLinkNasTransportPdu);
asn_enc_rval_t er = aper_encode_to_buffer(
&asn_DEF_Ngap_NGAP_PDU, NULL, downLinkNasTransportPdu, buf, buf_size);
cout << "er.encoded(" << er.encoded << ")" << endl;
// cout << "er.encoded(" << er.encoded << ")" << endl;
return er.encoded;
}
......
......@@ -132,7 +132,7 @@ int DownlinkRANStatusTransfer::encodetobuffer(uint8_t* buf, int buf_size) {
asn_enc_rval_t er = aper_encode_to_buffer(
&asn_DEF_Ngap_NGAP_PDU, NULL, DownlinkranstatustransferPDU, buf,
buf_size);
cout << "er.encoded(" << er.encoded << ")" << endl;
// cout << "er.encoded(" << er.encoded << ")" << endl;
return er.encoded;
}
} // namespace ngap
......@@ -165,7 +165,7 @@ int HandoverCommandMsg::encode2buffer(uint8_t* buf, int buf_size) {
asn_fprint(stderr, &asn_DEF_Ngap_NGAP_PDU, handoverCommandPdu);
asn_enc_rval_t er = aper_encode_to_buffer(
&asn_DEF_Ngap_NGAP_PDU, NULL, handoverCommandPdu, buf, buf_size);
cout << "er.encoded(" << er.encoded << ")" << endl;
// cout << "er.encoded(" << er.encoded << ")" << endl;
return er.encoded;
}
......
......@@ -53,7 +53,7 @@ int HandoverNotifyMsg::encode2buffer(uint8_t* buf, int buf_size) {
asn_fprint(stderr, &asn_DEF_Ngap_NGAP_PDU, handoverNotifyPdu);
asn_enc_rval_t er = aper_encode_to_buffer(
&asn_DEF_Ngap_NGAP_PDU, NULL, handoverNotifyPdu, buf, buf_size);
cout << "er.encoded(" << er.encoded << ")" << endl;
// cout << "er.encoded(" << er.encoded << ")" << endl;
return er.encoded;
}
bool HandoverNotifyMsg::decodefrompdu(Ngap_NGAP_PDU_t* ngap_msg_pdu) {
......
......@@ -197,7 +197,7 @@ int HandoverRequest::encode2buffer(uint8_t* buf, int buf_size) {
asn_fprint(stderr, &asn_DEF_Ngap_NGAP_PDU, handoverRequestPdu);
asn_enc_rval_t er = aper_encode_to_buffer(
&asn_DEF_Ngap_NGAP_PDU, NULL, handoverRequestPdu, buf, buf_size);
cout << "er.encoded(" << er.encoded << ")" << endl;
// cout << "er.encoded(" << er.encoded << ")" << endl;
return er.encoded;
}
......
......@@ -195,7 +195,7 @@ int HandoverRequestAck::encode2buffer(uint8_t* buf, int buf_size) {
asn_fprint(stderr, &asn_DEF_Ngap_NGAP_PDU, handoverRequestAckPdu);
asn_enc_rval_t er = aper_encode_to_buffer(
&asn_DEF_Ngap_NGAP_PDU, NULL, handoverRequestAckPdu, buf, buf_size);
cout << "er.encoded(" << er.encoded << ")" << endl;
// cout << "er.encoded(" << er.encoded << ")" << endl;
return er.encoded;
}
......
......@@ -246,7 +246,7 @@ int HandoverRequiredMsg::encode2buffer(uint8_t* buf, int buf_size) {
asn_fprint(stderr, &asn_DEF_Ngap_NGAP_PDU, handoverRequiredPdu);
asn_enc_rval_t er = aper_encode_to_buffer(
&asn_DEF_Ngap_NGAP_PDU, NULL, handoverRequiredPdu, buf, buf_size);
cout << "er.encoded(" << er.encoded << ")" << endl;
// cout << "er.encoded(" << er.encoded << ")" << endl;
return er.encoded;
}
......
......@@ -187,7 +187,7 @@ int InitialContextSetupFailureMsg::encode2buffer(uint8_t* buf, int buf_size) {
asn_enc_rval_t er = aper_encode_to_buffer(
&asn_DEF_Ngap_NGAP_PDU, NULL, initialContextSetupFailurePdu, buf,
buf_size);
cout << "er.encoded(" << er.encoded << ")" << endl;
// cout << "er.encoded(" << er.encoded << ")" << endl;
return er.encoded;
}
......
......@@ -516,7 +516,7 @@ int InitialContextSetupRequestMsg::encode2buffer(uint8_t* buf, int buf_size) {
asn_enc_rval_t er = aper_encode_to_buffer(
&asn_DEF_Ngap_NGAP_PDU, NULL, initialContextSetupRequestPdu, buf,
buf_size);
cout << "er.encoded(" << er.encoded << ")" << endl;
// cout << "er.encoded(" << er.encoded << ")" << endl;
return er.encoded;
}
......
......@@ -231,7 +231,7 @@ int InitialContextSetupResponseMsg::encode2buffer(uint8_t* buf, int buf_size) {
asn_enc_rval_t er = aper_encode_to_buffer(
&asn_DEF_Ngap_NGAP_PDU, NULL, initialContextSetupResponsePdu, buf,
buf_size);
std::cout << "er.encoded(" << er.encoded << ")" << std::endl;
// std::cout << "er.encoded(" << er.encoded << ")" << std::endl;
return er.encoded;
}
......
......@@ -228,7 +228,7 @@ int InitialUEMessageMsg::encode2buffer(uint8_t* buf, int buf_size) {
asn_fprint(stderr, &asn_DEF_Ngap_NGAP_PDU, initialUEMessagePdu);
asn_enc_rval_t er = aper_encode_to_buffer(
&asn_DEF_Ngap_NGAP_PDU, NULL, initialUEMessagePdu, buf, buf_size);
cout << "er.encoded(" << er.encoded << ")" << endl;
// cout << "er.encoded(" << er.encoded << ")" << endl;
return er.encoded;
}
......@@ -269,8 +269,8 @@ bool InitialUEMessageMsg::decodefrompdu(Ngap_NGAP_PDU_t* ngap_msg_pdu) {
cout << "Decoded NGAP RAN_UE_NGAP_ID IE error" << endl;
return false;
}
cout << "[InitialUeMessage] Received RanUeNgapId "
<< ranUeNgapId->getRanUeNgapId() << endl;
// cout << "[InitialUeMessage] Received RanUeNgapId "
// << ranUeNgapId->getRanUeNgapId() << endl;
} else {
cout << "Decoded NGAP RAN_UE_NGAP_ID IE error" << endl;
return false;
......
......@@ -219,7 +219,7 @@ int NGSetupFailureMsg::encode2buffer(uint8_t* buf, int buf_size) {
asn_fprint(stderr, &asn_DEF_Ngap_NGAP_PDU, ngSetupFailurePdu);
asn_enc_rval_t er = aper_encode_to_buffer(
&asn_DEF_Ngap_NGAP_PDU, NULL, ngSetupFailurePdu, buf, buf_size);
cout << "er.encoded(" << er.encoded << ")" << endl;
// cout << "er.encoded(" << er.encoded << ")" << endl;
return er.encoded;
}
......
......@@ -215,7 +215,7 @@ int NGSetupRequestMsg::encode2buffer(uint8_t* buf, int buf_size) {
asn_fprint(stderr, &asn_DEF_Ngap_NGAP_PDU, ngSetupRequestPdu);
asn_enc_rval_t er = aper_encode_to_buffer(
&asn_DEF_Ngap_NGAP_PDU, NULL, ngSetupRequestPdu, buf, buf_size);
printf("er.encoded(%ld)\n", er.encoded);
// printf("er.encoded(%ld)\n", er.encoded);
return er.encoded;
}
......
......@@ -168,7 +168,7 @@ void NGSetupResponseMsg::setPlmnSupportList(
for (int i = 0; i < list.size(); i++) {
PlmnId* plmn = new PlmnId();
plmn->setMccMnc(list[i].mcc, list[i].mnc);
cout << "mcc = " << list[i].mcc << " mnc = " << list[i].mnc << endl;
// cout << "mcc = " << list[i].mcc << " mnc = " << list[i].mnc << endl;
S_NSSAI* snssai = new S_NSSAI[list[i].slice_list.size()]();
for (int j = 0; j < list[i].slice_list.size(); j++) {
snssai[j].setSst(list[i].slice_list[j].sst);
......@@ -198,7 +198,7 @@ int NGSetupResponseMsg::encode2buffer(uint8_t* buf, int buf_size) {
asn_fprint(stderr, &asn_DEF_Ngap_NGAP_PDU, ngSetupResponsePdu);
asn_enc_rval_t er = aper_encode_to_buffer(
&asn_DEF_Ngap_NGAP_PDU, NULL, ngSetupResponsePdu, buf, buf_size);
cout << "er.encoded(" << er.encoded << ")" << endl;
// cout << "er.encoded(" << er.encoded << ")" << endl;
return er.encoded;
}
......
......@@ -54,7 +54,7 @@ int PagingMsg::encode2buffer(uint8_t* buf, int buf_size) {
asn_fprint(stderr, &asn_DEF_Ngap_NGAP_PDU, pagingPdu);
asn_enc_rval_t er = aper_encode_to_buffer(
&asn_DEF_Ngap_NGAP_PDU, NULL, pagingPdu, buf, buf_size);
cout << "er.encoded(" << er.encoded << ")" << endl;
// cout << "er.encoded(" << er.encoded << ")" << endl;
return er.encoded;
}
......
......@@ -245,7 +245,7 @@ int PduSessionResourceReleaseCommandMsg::encode2buffer(
asn_enc_rval_t er = aper_encode_to_buffer(
&asn_DEF_Ngap_NGAP_PDU, NULL, pduSessionResourceReleaseCommandPdu, buf,
buf_size);
Logger::nas_mm().debug("er.encoded( %d)", er.encoded);
// Logger::nas_mm().debug("er.encoded( %d)", er.encoded);
return er.encoded;
}
......
......@@ -233,7 +233,7 @@ int PduSessionResourceReleaseResponseMsg::encode2buffer(
asn_enc_rval_t er = aper_encode_to_buffer(
&asn_DEF_Ngap_NGAP_PDU, NULL, pduSessionResourceReleaseResponsePdu, buf,
buf_size);
Logger::nas_mm().debug("er.encoded( %d)", er.encoded);
// Logger::nas_mm().debug("er.encoded( %d)", er.encoded);
return er.encoded;
}
......
......@@ -288,7 +288,7 @@ int PduSessionResourceSetupRequestMsg::encode2buffer(
asn_enc_rval_t er = aper_encode_to_buffer(
&asn_DEF_Ngap_NGAP_PDU, NULL, pduSessionResourceSetupRequestPdu, buf,
buf_size);
cout << "er.encoded(" << er.encoded << ")" << endl;
// cout << "er.encoded(" << er.encoded << ")" << endl;
return er.encoded;
}
......@@ -301,7 +301,7 @@ void PduSessionResourceSetupRequestMsg::encode2buffer_new(
&asn_DEF_Ngap_NGAP_PDU, NULL, pduSessionResourceSetupRequestPdu,
(void**) &buffer);
cout << "er.encoded(" << encoded_size << ")" << endl;
// cout << "er.encoded(" << encoded_size << ")" << endl;
memcpy((void*) buf, (void*) buffer, encoded_size);
free(buffer);
}
......
......@@ -235,7 +235,7 @@ int PduSessionResourceSetupResponseMsg::encode2buffer(
asn_enc_rval_t er = aper_encode_to_buffer(
&asn_DEF_Ngap_NGAP_PDU, NULL, pduSessionResourceSetupResponsePdu, buf,
buf_size);
cout << "er.encoded(" << er.encoded << ")" << endl;
// cout << "er.encoded(" << er.encoded << ")" << endl;
return er.encoded;
}
......
......@@ -155,7 +155,7 @@ int UEContextReleaseCommandMsg::encode2buffer(uint8_t* buf, int buf_size) {
asn_fprint(stderr, &asn_DEF_Ngap_NGAP_PDU, pdu);
asn_enc_rval_t er =
aper_encode_to_buffer(&asn_DEF_Ngap_NGAP_PDU, NULL, pdu, buf, buf_size);
cout << "er.encoded(" << er.encoded << ")" << endl;
// cout << "er.encoded(" << er.encoded << ")" << endl;
return er.encoded;
}
......
......@@ -149,6 +149,6 @@ int UEContextReleaseCompleteMsg::encode2buffer(uint8_t* buf, int buf_size) {
asn_fprint(stderr, &asn_DEF_Ngap_NGAP_PDU, pdu);
asn_enc_rval_t er =
aper_encode_to_buffer(&asn_DEF_Ngap_NGAP_PDU, NULL, pdu, buf, buf_size);
cout << "er.encoded(" << er.encoded << ")" << endl;
// cout << "er.encoded(" << er.encoded << ")" << endl;
return er.encoded;
}
......@@ -126,7 +126,7 @@ int UEContextReleaseRequestMsg::encode2buffer(uint8_t* buf, int buf_size) {
asn_fprint(stderr, &asn_DEF_Ngap_NGAP_PDU, pdu);
asn_enc_rval_t er =
aper_encode_to_buffer(&asn_DEF_Ngap_NGAP_PDU, NULL, pdu, buf, buf_size);
cout << "er.encoded(" << er.encoded << ")" << endl;
// cout << "er.encoded(" << er.encoded << ")" << endl;
return er.encoded;
}
......
......@@ -213,7 +213,7 @@ int UeRadioCapabilityInfoIndicationMsg::encode2buffer(
asn_enc_rval_t er = aper_encode_to_buffer(
&asn_DEF_Ngap_NGAP_PDU, NULL, ueRadioCapabilityInfoIndicationPdu, buf,
buf_size);
cout << "er.encoded(" << er.encoded << ")" << endl;
// cout << "er.encoded(" << er.encoded << ")" << endl;
return er.encoded;
}
......
......@@ -196,7 +196,7 @@ int UplinkNASTransportMsg::encode2buffer(uint8_t* buf, int buf_size) {
asn_fprint(stderr, &asn_DEF_Ngap_NGAP_PDU, uplinkNASTransportPdu);
asn_enc_rval_t er = aper_encode_to_buffer(
&asn_DEF_Ngap_NGAP_PDU, NULL, uplinkNASTransportPdu, buf, buf_size);
std::cout << "er.encoded(" << er.encoded << ")" << std::endl;
// std::cout << "er.encoded(" << er.encoded << ")" << std::endl;
return er.encoded;
}
......
......@@ -77,9 +77,9 @@ void ngap_app::handle_receive(
"Decoded NGAP message, procedure code %d, present %d",
ngap_msg_pdu->choice.initiatingMessage->procedureCode,
ngap_msg_pdu->present);
printf("after decoding ...\n");
// printf("after decoding ...\n");
asn_fprint(stderr, &asn_DEF_Ngap_NGAP_PDU, ngap_msg_pdu);
printf("end decoding ...\n");
// printf("end decoding ...\n");
(*messages_callback[ngap_msg_pdu->choice.initiatingMessage->procedureCode]
[ngap_msg_pdu->present - 1])(
assoc_id, stream, ngap_msg_pdu);
......
......@@ -151,9 +151,8 @@ int ngap_amf_handle_initial_context_setup_response(
}
std::vector<PDUSessionResourceSetupResponseItem_t> list;
if (!initCtxResp->getPduSessionResourceSetupResponseList(list)) {
Logger::ngap().error(
"Decode PduSessionResourceSetupResponseList IE error or this IE is not "
"available");
Logger::ngap().info(
"Decode PduSessionResourceSetupResponseList IE failure");
return 0;
}
......
......@@ -48,9 +48,9 @@ void f5star(u8 k[16], u8 rand[16], u8 ak[6]);
*-----------------------------------------------------------------*/
void f1(u8 k[16], u8 rand[16], u8 sqn[6], u8 amf[2], u8 mac_a[8]) {
printf("opc: ");
for (int i = 0; i < 16; i++) printf("0x%x", op_c[i]);
printf("\n");
// printf("opc: ");
// for (int i = 0; i < 16; i++) printf("0x%x", op_c[i]);
// printf("\n");
// u8 op_c[16];
u8 temp[16];
u8 in1[16];
......
......@@ -194,8 +194,8 @@ void Authentication_5gaka::RijndaelEncrypt(
#if AUTH_ALG_ON
printf("end of round(%d)\n0x", 0);
#endif
for (int i = 0; i < 16; i++) printf("%x ", state[i & 0x3][i >> 2]);
printf("\n");
// for (int i = 0; i < 16; i++) printf("%x ", state[i & 0x3][i >> 2]);
// printf("\n");
for (r = 1; r <= 9; r++) {
ByteSub(state);
ShiftRow(state);
......
......@@ -13,10 +13,10 @@ void convert_string_2_hex(std::string& input_str, std::string& output_str) {
memset(data, 0, input_str.length() + 1);
memcpy((void*) data, (void*) input_str.c_str(), input_str.length());
for (int i = 0; i < input_str.length(); i++) {
printf("%02x ", data[i]);
}
printf("\n");
// for (int i = 0; i < input_str.length(); i++) {
// printf("%02x ", data[i]);
// }
// printf("\n");
char* datahex = (char*) malloc(input_str.length() * 2 + 1);
memset(datahex, 0, input_str.length() * 2 + 1);
......@@ -37,9 +37,9 @@ unsigned char* format_string_as_hex(std::string str) {
memcpy((void*) data, (void*) str.c_str(), str_len);
std::cout << "Data: " << data << " (" << str_len << " bytes)" << std::endl;
// std::cout << "Data: " << data << " (" << str_len << " bytes)" << std::endl;
std::cout << "Data (formatted): \n";
// std::cout << "Data (formatted): \n";
for (int i = 0; i < str_len; i++) {
char datatmp[3] = {0};
memcpy(datatmp, &data[i], 2);
......@@ -53,14 +53,14 @@ unsigned char* format_string_as_hex(std::string str) {
// Convert two hexadecimal characters into one character
unsigned int nAsciiCharacter;
sscanf(datatmp, "%x", &nAsciiCharacter);
printf("%x ", nAsciiCharacter);
// printf("%x ", nAsciiCharacter);
// Concatenate this character onto the output
datavalue[i / 2] = (unsigned char) nAsciiCharacter;
// Skip the next character
i++;
}
printf("\n");
// printf("\n");
free_wrapper((void**) &data);
return datavalue;
......@@ -78,12 +78,12 @@ char* bstring2charString(bstring b) {
void msg_str_2_msg_hex(std::string msg, bstring& b) {
std::string msg_hex_str;
convert_string_2_hex(msg, msg_hex_str);
printf("tmp string: %s\n", msg_hex_str.c_str());
// printf("tmp string: %s\n", msg_hex_str.c_str());
unsigned int msg_len = msg_hex_str.length();
char* data = (char*) malloc(msg_len + 1);
memset(data, 0, msg_len + 1);
memcpy((void*) data, (void*) msg_hex_str.c_str(), msg_len);
printf("data: %s\n", data);
// printf("data: %s\n", data);
uint8_t* msg_hex = (uint8_t*) malloc(msg_len / 2 + 1);
conv::ascii_to_hex(msg_hex, (const char*) data);
b = blk2bstr(msg_hex, (msg_len / 2));
......
......@@ -22,9 +22,10 @@ uint8_t multipart_parser(
bool is_ngap = false;
if (size > 2) {
n2sm = parts[2].body;
} else {
n2sm = "null";
}
}
// else {
// n2sm = "null";
// }
return size;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment