Commit 8b872ed6 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Code cleanup

parent 3f94d8e0
......@@ -174,32 +174,6 @@ bool util::string_to_dotted(const std::string& str, std::string& dotted) {
};
void util::string_to_dnn(const std::string& str, bstring bstr) {
uint8_t tmp[str.length() + 1];
tmp[0] = str.length();
memcpy((void*) &tmp[1], (void*) str.c_str(), str.length());
bstr->slen = str.length() + 1;
memcpy((void*) bstr->data, (void*) tmp, str.length() + 1);
/*
printf("\n");
for (int i = 0; i < str.length() + 1; i++) {
printf(" %02x", tmp[i]);
}
uint8_t tmp[str.length() + 1];
tmp[0] = str.length();
memcpy((void*) &tmp[1], (void*) str.c_str(), tmp.length());
bstr->slen = tmp.length() + 1;
memcpy((void*) bstr->data, (void*) tmp, tmp.length()+1);
*/
/*
// 19 05 63 74 6e 65
uint8_t strB[6] = {0};
strB[0] = str.length();
memcpy(strB + 1, str.c_str(), str.length());
bstr->slen = str.length() + 20;
uint8_t dnn[19] = {0x06, 0x6d, 0x6e, 0x63, 0x30, 0x31, 0x31, 0x06, 0x6d, 0x63,
0x63, 0x34, 0x36, 0x30, 0x04, 0x67, 0x70, 0x72, 0x73};
memcpy((void*) (bstr->data), (void*) strB, str.length() + 1);
memcpy((void*) (bstr->data + str.length() + 1), (void*) dnn, 19);*/
bstr->slen = str.length();
memcpy((void*) bstr->data, (void*) str.c_str(), str.length());
}
......@@ -266,15 +266,6 @@ bool smf_n1::create_n1_pdu_session_establishment_accept(
bfromcstralloc(dotted.length() + 1, "\0");
util::string_to_dnn(dotted, sm_msg->pdu_session_establishment_accept.dnn);
/*
sm_msg->pdu_session_establishment_accept.dnn = bfromcstralloc(
sm_context_res.get_dnn().length() + 1 + 2 + sizeof(".mnc011.mcc110.gprs"),
"\0");
util::string_to_dnn(
sm_context_res.get_dnn(), sm_msg->pdu_session_establishment_accept.dnn);
Logger::smf_n1().debug("DNN %s", sm_context_res.get_dnn().c_str());
*/
Logger::smf_n1().info("Encode PDU Session Establishment Accept");
// Encode NAS message
bytes = nas_message_encode(
......
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