Adding DNS config options

master
Pedro Alvarez 7 years ago
parent fc280e082f
commit 01cf00700a

@ -90,6 +90,7 @@ typedef struct{
uint16_t mnc; // BCD-coded with 0xF filler uint16_t mnc; // BCD-coded with 0xF filler
std::string mme_bind_addr; std::string mme_bind_addr;
std::string mme_name; std::string mme_name;
std::string dns_addr;
} s1ap_args_t; } s1ap_args_t;
typedef struct{ typedef struct{

@ -52,7 +52,6 @@ typedef struct {
int spgw_hex_limit; int spgw_hex_limit;
std::string hss_level; std::string hss_level;
int hss_hex_limit; int hss_hex_limit;
std::string all_level; std::string all_level;
int all_hex_limit; int all_hex_limit;
std::string filename; std::string filename;
@ -83,6 +82,7 @@ parse_args(all_args_t *args, int argc, char* argv[]) {
string mme_bind_addr; string mme_bind_addr;
string spgw_bind_addr; string spgw_bind_addr;
string sgi_if_addr; string sgi_if_addr;
string dns_addr;
string hss_db_file; string hss_db_file;
string hss_auth_algo; string hss_auth_algo;
string log_filename; string log_filename;
@ -105,6 +105,7 @@ parse_args(all_args_t *args, int argc, char* argv[]) {
("mme.mcc", bpo::value<string>(&mcc)->default_value("001"), "Mobile Country Code") ("mme.mcc", bpo::value<string>(&mcc)->default_value("001"), "Mobile Country Code")
("mme.mnc", bpo::value<string>(&mnc)->default_value("01"), "Mobile Network Code") ("mme.mnc", bpo::value<string>(&mnc)->default_value("01"), "Mobile Network Code")
("mme.mme_bind_addr", bpo::value<string>(&mme_bind_addr)->default_value("127.0.0.1"),"IP address of MME for S1 connnection") ("mme.mme_bind_addr", bpo::value<string>(&mme_bind_addr)->default_value("127.0.0.1"),"IP address of MME for S1 connnection")
("mme.dns_addr", bpo::value<string>(&dns_addr)->default_value("8.8.8.8"),"IP address of the DNS server for the UEs")
("hss.db_file", bpo::value<string>(&hss_db_file)->default_value("ue_db.csv"),".csv file that stores UE's keys") ("hss.db_file", bpo::value<string>(&hss_db_file)->default_value("ue_db.csv"),".csv file that stores UE's keys")
("hss.auth_algo", bpo::value<string>(&hss_auth_algo)->default_value("milenage"),"HSS uthentication algorithm.") ("hss.auth_algo", bpo::value<string>(&hss_auth_algo)->default_value("milenage"),"HSS uthentication algorithm.")
("spgw.gtpu_bind_addr", bpo::value<string>(&spgw_bind_addr)->default_value("127.0.0.1"),"IP address of SP-GW for the S1-U connection") ("spgw.gtpu_bind_addr", bpo::value<string>(&spgw_bind_addr)->default_value("127.0.0.1"),"IP address of SP-GW for the S1-U connection")
@ -205,6 +206,7 @@ parse_args(all_args_t *args, int argc, char* argv[]) {
args->mme_args.s1ap_args.mme_bind_addr = mme_bind_addr; args->mme_args.s1ap_args.mme_bind_addr = mme_bind_addr;
args->mme_args.s1ap_args.mme_name = mme_name; args->mme_args.s1ap_args.mme_name = mme_name;
args->mme_args.s1ap_args.dns_addr = dns_addr;
args->spgw_args.gtpu_bind_addr = spgw_bind_addr; args->spgw_args.gtpu_bind_addr = spgw_bind_addr;
args->spgw_args.sgi_if_addr = sgi_if_addr; args->spgw_args.sgi_if_addr = sgi_if_addr;
args->hss_args.db_file = hss_db_file; args->hss_args.db_file = hss_db_file;

@ -650,7 +650,7 @@ s1ap_nas_transport::handle_nas_service_request(uint32_t m_tmsi,
//Delete eNB context and connect. //Delete eNB context and connect.
m_s1ap_log->console("Service Request -- User has ECM context already\n"); m_s1ap_log->console("Service Request -- User has ECM context already\n");
m_s1ap_log->info("Service Request -- User has ECM context already\n"); m_s1ap_log->info("Service Request -- User has ECM context already\n");
m_s1ap->m_s1ap_ctx_mngmt_proc->send_ue_context_release_command(ecm_ctx,reply_buffer); //m_s1ap->m_s1ap_ctx_mngmt_proc->send_ue_context_release_command(ecm_ctx,reply_buffer);
int default_bearer_id = 5; int default_bearer_id = 5;
m_s1ap->m_s1ap_ctx_mngmt_proc->send_initial_context_setup_request(ue_emm_ctx, ecm_ctx, &ecm_ctx->erabs_ctx[default_bearer_id],false); m_s1ap->m_s1ap_ctx_mngmt_proc->send_initial_context_setup_request(ue_emm_ctx, ecm_ctx, &ecm_ctx->erabs_ctx[default_bearer_id],false);
} }
@ -1622,10 +1622,15 @@ s1ap_nas_transport::pack_attach_accept(ue_emm_ctx_t *ue_emm_ctx, ue_ecm_ctx_t *u
act_def_eps_bearer_context_req.protocol_cnfg_opts.N_opts = 1; act_def_eps_bearer_context_req.protocol_cnfg_opts.N_opts = 1;
act_def_eps_bearer_context_req.protocol_cnfg_opts.opt[0].id = 0x0d; act_def_eps_bearer_context_req.protocol_cnfg_opts.opt[0].id = 0x0d;
act_def_eps_bearer_context_req.protocol_cnfg_opts.opt[0].len = 4; act_def_eps_bearer_context_req.protocol_cnfg_opts.opt[0].len = 4;
act_def_eps_bearer_context_req.protocol_cnfg_opts.opt[0].contents[0] = 8;
act_def_eps_bearer_context_req.protocol_cnfg_opts.opt[0].contents[1] = 8; struct sockaddr_in dns_addr;
act_def_eps_bearer_context_req.protocol_cnfg_opts.opt[0].contents[2] = 8; inet_pton(AF_INET, m_s1ap->m_s1ap_args.dns_addr.c_str(), &(dns_addr.sin_addr));
act_def_eps_bearer_context_req.protocol_cnfg_opts.opt[0].contents[3] = 8;
memcpy(act_def_eps_bearer_context_req.protocol_cnfg_opts.opt[0].contents,&dns_addr.sin_addr.s_addr, 4);
//act_def_eps_bearer_context_req.protocol_cnfg_opts.opt[0].contents[0] = 8;
//act_def_eps_bearer_context_req.protocol_cnfg_opts.opt[0].contents[1] = 8;
//act_def_eps_bearer_context_req.protocol_cnfg_opts.opt[0].contents[2] = 8;
//act_def_eps_bearer_context_req.protocol_cnfg_opts.opt[0].contents[3] = 8;
//Make sure all unused options are set to false //Make sure all unused options are set to false
act_def_eps_bearer_context_req.negotiated_qos_present = false; act_def_eps_bearer_context_req.negotiated_qos_present = false;

Loading…
Cancel
Save