Commit ad101763 authored by luhan Wang's avatar luhan Wang

support 5G Phone

parent 62847c81
...@@ -37,17 +37,17 @@ AMF = ...@@ -37,17 +37,17 @@ AMF =
GUAMI: GUAMI:
{ {
MCC = "110"; MNC = "11"; RegionID = "128"; AMFSetID = "1"; AMFPointer = "1" # YOUR GUAMI CONFIG HERE MCC = "460"; MNC = "11"; RegionID = "128"; AMFSetID = "1"; AMFPointer = "1" # YOUR GUAMI CONFIG HERE
} }
SERVED_GUAMI_LIST = ( SERVED_GUAMI_LIST = (
{MCC = "110"; MNC = "11"; RegionID = "128"; AMFSetID = "1"; AMFPointer = "0"} #48bits <MCC><MNC><RegionID><AMFSetID><AMFPointer> {MCC = "460"; MNC = "11"; RegionID = "128"; AMFSetID = "1"; AMFPointer = "0"} #48bits <MCC><MNC><RegionID><AMFSetID><AMFPointer>
#{MCC = "110"; MNC = "11"; RegionID = "10"; AMFSetID = "1"; AMFPointer = "1"} #48bits <MCC><MNC><RegionID><AMFSetID><AMFPointer> #{MCC = "110"; MNC = "11"; RegionID = "10"; AMFSetID = "1"; AMFPointer = "1"} #48bits <MCC><MNC><RegionID><AMFSetID><AMFPointer>
); );
PLMN_SUPPORT_LIST = ( PLMN_SUPPORT_LIST = (
{ {
MCC = "110"; MNC = "11"; TAC = 100; # YOUR PLMN CONFIG HERE MCC = "460"; MNC = "11"; TAC = 100; # YOUR PLMN CONFIG HERE
SLICE_SUPPORT_LIST = ( SLICE_SUPPORT_LIST = (
{SST = "1"; SD = "none"}, # YOUR NSSAI CONFIG HERE {SST = "1"; SD = "none"}, # YOUR NSSAI CONFIG HERE
{SST = "1"; SD = "12"} # YOUR NSSAI CONFIG HERE {SST = "1"; SD = "12"} # YOUR NSSAI CONFIG HERE
...@@ -87,7 +87,7 @@ AMF = ...@@ -87,7 +87,7 @@ AMF =
MYSQL_server = "127.0.0.1"; # MySQL Server address MYSQL_server = "127.0.0.1"; # MySQL Server address
MYSQL_user = "root"; # Database server login MYSQL_user = "root"; # Database server login
MYSQL_pass = "linux"; # Database server password MYSQL_pass = "linux"; # Database server password
MYSQL_db = "OPEXNG_DB"; # Your database name MYSQL_db = "OPENXG_DB"; # Your database name
## OP ## OP
OPERATOR_key = "63bfa50ee6523365ff14c1f45f88737d"; # OP key matching your database OPERATOR_key = "63bfa50ee6523365ff14c1f45f88737d"; # OP key matching your database
......
...@@ -675,8 +675,9 @@ void amf_n1::service_request_handle( ...@@ -675,8 +675,9 @@ void amf_n1::service_request_handle(
if(pdu_session_status == 0x00){ if(pdu_session_status == 0x00){
serApt->setPDU_session_status(0x0000); serApt->setPDU_session_status(0x0000);
}else{ }else{
//serApt->setPDU_session_status(pdu_session_status); serApt->setPDU_session_status(htonl(pdu_session_status));
serApt->setPDU_session_status(0x2000); Logger::amf_n1().debug("setting pdu session status 0x%x",htonl(pdu_session_status));
//serApt->setPDU_session_status(0x2000);
} }
serApt->setPDU_session_reactivation_result(0x0000); serApt->setPDU_session_reactivation_result(0x0000);
uint8_t buffer[BUFFER_SIZE_256]; uint8_t buffer[BUFFER_SIZE_256];
...@@ -2022,7 +2023,7 @@ void amf_n1::security_mode_complete_handle( ...@@ -2022,7 +2023,7 @@ void amf_n1::security_mode_complete_handle(
Logger::amf_n1().debug("Allocated GUTI %s", guti.c_str()); Logger::amf_n1().debug("Allocated GUTI %s", guti.c_str());
// TODO: remove hardcoded values // TODO: remove hardcoded values
regAccept->set_5GS_Network_Feature_Support(0x00, 0x00); regAccept->set_5GS_Network_Feature_Support(0x01, 0x00);
regAccept->setT3512_Value(0x5, 0x1e); regAccept->setT3512_Value(0x5, 0x1e);
uint8_t buffer[BUFFER_SIZE_1024] = {0}; uint8_t buffer[BUFFER_SIZE_1024] = {0};
int encoded_size = regAccept->encode2buffer(buffer, BUFFER_SIZE_1024); int encoded_size = regAccept->encode2buffer(buffer, BUFFER_SIZE_1024);
......
...@@ -261,6 +261,10 @@ void amf_n11::handle_itti_message(itti_smf_services_consumer& smf) { ...@@ -261,6 +261,10 @@ void amf_n11::handle_itti_message(itti_smf_services_consumer& smf) {
uint8_t pti = sm_msg[2]; uint8_t pti = sm_msg[2];
Logger::amf_n11().debug( Logger::amf_n11().debug(
"Decoded PTI for PDUSessionEstablishmentRequest(0x%x)", pti); "Decoded PTI for PDUSessionEstablishmentRequest(0x%x)", pti);
psc.get()->isn2sm_avaliable = false;
handle_pdu_session_initial_request(
supi, psc, smf_addr, smf.sm_msg, dnn);
/*
if (psc.get()->isn1sm_avaliable && psc.get()->isn2sm_avaliable) { if (psc.get()->isn1sm_avaliable && psc.get()->isn2sm_avaliable) {
itti_n1n2_message_transfer_request* itti_msg = itti_n1n2_message_transfer_request* itti_msg =
new itti_n1n2_message_transfer_request(TASK_AMF_N11, TASK_AMF_APP); new itti_n1n2_message_transfer_request(TASK_AMF_N11, TASK_AMF_APP);
...@@ -289,6 +293,7 @@ void amf_n11::handle_itti_message(itti_smf_services_consumer& smf) { ...@@ -289,6 +293,7 @@ void amf_n11::handle_itti_message(itti_smf_services_consumer& smf) {
handle_pdu_session_initial_request( handle_pdu_session_initial_request(
supi, psc, smf_addr, smf.sm_msg, dnn); supi, psc, smf_addr, smf.sm_msg, dnn);
} }
*/
} break; } break;
case EXISTING_PDU_SESSION: { case EXISTING_PDU_SESSION: {
// TODO: // TODO:
......
...@@ -636,7 +636,7 @@ void amf_n2::handle_itti_message(itti_initial_context_setup_request& itti_msg) { ...@@ -636,7 +636,7 @@ void amf_n2::handle_itti_message(itti_initial_context_setup_request& itti_msg) {
} }
} }
uint8_t buffer[10000]; uint8_t buffer[20000];
int encoded_size = msg->encode2buffer(buffer, 10000); int encoded_size = msg->encode2buffer(buffer, 10000);
bstring b = blk2bstr(buffer, encoded_size); bstring b = blk2bstr(buffer, encoded_size);
sctp_s_38412.sctp_send_msg( sctp_s_38412.sctp_send_msg(
...@@ -675,7 +675,7 @@ void amf_n2::handle_itti_message( ...@@ -675,7 +675,7 @@ void amf_n2::handle_itti_message(
item.pduSessionNAS_PDU = nas_pdu; item.pduSessionNAS_PDU = nas_pdu;
item.sizeofpduSessionNAS_PDU = blength(itti_msg.nas); item.sizeofpduSessionNAS_PDU = blength(itti_msg.nas);
item.s_nssai.sst = "01"; // TODO: get from N1N2msgTranferMsg item.s_nssai.sst = "01"; // TODO: get from N1N2msgTranferMsg
item.s_nssai.sd = "None"; // TODO: get from N1N2msgTranferMsg item.s_nssai.sd = "none"; // TODO: get from N1N2msgTranferMsg
// Get NSSAI from PDU Session Context // Get NSSAI from PDU Session Context
std::shared_ptr<nas_context> nc; std::shared_ptr<nas_context> nc;
......
...@@ -112,7 +112,9 @@ int UESecurityCapability::decodefrombuffer( ...@@ -112,7 +112,9 @@ int UESecurityCapability::decodefrombuffer(
_5g_EASel = *(buf + decoded_size); _5g_EASel = *(buf + decoded_size);
decoded_size++; decoded_size++;
_5g_IASel = *(buf + decoded_size); _5g_IASel = *(buf + decoded_size);
decoded_size++; decoded_size ++;
if(length == 4)
decoded_size += 2;//to do: decoding EEA EIA
Logger::nas_mm().debug( Logger::nas_mm().debug(
"UESecurityCapability EA 0x%d,IA 0x%d", _5g_EASel, _5g_IASel); "UESecurityCapability EA 0x%d,IA 0x%d", _5g_EASel, _5g_IASel);
return decoded_size; return decoded_size;
......
...@@ -89,7 +89,10 @@ void S_NSSAI::getSst(std::string& charSst) { ...@@ -89,7 +89,10 @@ void S_NSSAI::getSst(std::string& charSst) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void S_NSSAI::setSd(const std::string charSd) { void S_NSSAI::setSd(const std::string charSd) {
sdIsSet = true; if(charSd.compare("none"))
sdIsSet = true;
else
sdIsSet = false;
sd = fromString<int>(charSd); sd = fromString<int>(charSd);
} }
......
...@@ -71,6 +71,9 @@ void ngap_app::handle_receive( ...@@ -71,6 +71,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");
asn_fprint(stderr, &asn_DEF_Ngap_NGAP_PDU, ngap_msg_pdu);
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);
......
...@@ -86,7 +86,7 @@ void N1N2MessageCollectionDocumentApiImpl::n1_n2_message_transfer( ...@@ -86,7 +86,7 @@ void N1N2MessageCollectionDocumentApiImpl::n1_n2_message_transfer(
bstring n1sm; bstring n1sm;
msg_str_2_msg_hex( msg_str_2_msg_hex(
n1sm_str.substr(0, n1sm_str.length() - 2), n1sm_str.substr(0, n1sm_str.length()),
n1sm); // TODO: verify n1sm_length n1sm); // TODO: verify n1sm_length
bstring n2sm; bstring n2sm;
......
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