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