mirror of https://github.com/PentHertz/srsLTE.git
Added configuration options to UE for IPv6 PDN. Starting to send PDN connectivity requesting IPv6.
This commit is contained in:
parent
23836a8ab3
commit
25108e2e2b
|
@ -38,9 +38,10 @@ namespace srslte {
|
|||
class srslte_nas_config_t
|
||||
{
|
||||
public:
|
||||
srslte_nas_config_t(uint32_t lcid_ = 0, std::string apn_ = "", std::string user_ = "", std::string pass_ = "", bool force_imsi_attach_ = false)
|
||||
srslte_nas_config_t(uint32_t lcid_ = 0, std::string apn_ = "", std::string apn_protocol_ = "", std::string user_ = "", std::string pass_ = "", bool force_imsi_attach_ = false)
|
||||
:lcid(lcid_),
|
||||
apn(apn_),
|
||||
apn_protocol(apn_protocol_),
|
||||
user(user_),
|
||||
pass(pass_),
|
||||
force_imsi_attach(force_imsi_attach_)
|
||||
|
@ -48,6 +49,7 @@ public:
|
|||
|
||||
uint32_t lcid;
|
||||
std::string apn;
|
||||
std::string apn_protocol;
|
||||
std::string user;
|
||||
std::string pass;
|
||||
bool force_imsi_attach;
|
||||
|
|
|
@ -41,6 +41,7 @@ namespace srsue {
|
|||
|
||||
typedef struct {
|
||||
std::string apn_name;
|
||||
std::string apn_protocol;
|
||||
std::string apn_user;
|
||||
std::string apn_pass;
|
||||
bool force_imsi_attach;
|
||||
|
|
|
@ -85,7 +85,8 @@ void parse_args(all_args_t *args, int argc, char *argv[]) {
|
|||
"UECapabilityInformation message. Default 0xe6041000")
|
||||
("rrc.ue_category", bpo::value<string>(&args->ue_category_str)->default_value("4"), "UE Category (1 to 5)")
|
||||
|
||||
("nas.apn", bpo::value<string>(&args->nas.apn_name)->default_value(""), "Set Access Point Name (APN) for data services")
|
||||
("nas.apn", bpo::value<string>(&args->nas.apn_name)->default_value(""), "Set Access Point Name (APN) for data services")
|
||||
("nas.apn_protocol", bpo::value<string>(&args->nas.apn_protocol)->default_value("ipv4"), "Set Access Point Name (APN) protocol for data services")
|
||||
("nas.user", bpo::value<string>(&args->nas.apn_user)->default_value(""), "Username for CHAP authentication")
|
||||
("nas.pass", bpo::value<string>(&args->nas.apn_pass)->default_value(""), "Password for CHAP authentication")
|
||||
("nas.force_imsi_attach", bpo::value<bool>(&args->nas.force_imsi_attach)->default_value(false), "Whether to always perform an IMSI attach")
|
||||
|
|
|
@ -221,7 +221,7 @@ bool ue::init(all_args_t *args_) {
|
|||
rlc.init(&pdcp, &rrc, this, &rlc_log, &mac, 0 /* RB_ID_SRB0 */);
|
||||
pdcp.init(&rlc, &rrc, &gw, &pdcp_log, 0 /* RB_ID_SRB0 */, SECURITY_DIRECTION_UPLINK);
|
||||
|
||||
srslte_nas_config_t nas_cfg(1, args->nas.apn_name, args->nas.apn_user, args->nas.apn_pass, args->nas.force_imsi_attach); /* RB_ID_SRB1 */
|
||||
srslte_nas_config_t nas_cfg(1, args->nas.apn_name, args->nas.apn_protocol, args->nas.apn_user, args->nas.apn_pass, args->nas.force_imsi_attach); /* RB_ID_SRB1 */
|
||||
nas.init(usim, &rrc, &gw, &nas_log, nas_cfg);
|
||||
gw.init(&pdcp, &nas, &gw_log, 3 /* RB_ID_DRB1 */);
|
||||
gw.set_netmask(args->expert.ip_netmask);
|
||||
|
|
|
@ -1124,10 +1124,21 @@ void nas::gen_pdn_connectivity_request(LIBLTE_BYTE_MSG_STRUCT *msg) {
|
|||
// Set the PDN con req parameters
|
||||
pdn_con_req.eps_bearer_id = 0x00; // Unassigned bearer ID
|
||||
pdn_con_req.proc_transaction_id = 0x01; // First transaction ID
|
||||
pdn_con_req.pdn_type = LIBLTE_MME_PDN_TYPE_IPV4;
|
||||
pdn_con_req.request_type = LIBLTE_MME_REQUEST_TYPE_INITIAL_REQUEST;
|
||||
pdn_con_req.apn_present = false;
|
||||
|
||||
//Set PDN protocol type
|
||||
if (cfg.apn_protocol == "ipv4"){
|
||||
nas_log->console("Setting PDN protocol to IPv4\n");
|
||||
pdn_con_req.pdn_type = LIBLTE_MME_PDN_TYPE_IPV4;
|
||||
} else if (cfg.apn_protocol == "ipv6") {
|
||||
nas_log->console("Setting PDN protocol to IPv6\n");
|
||||
pdn_con_req.pdn_type = LIBLTE_MME_PDN_TYPE_IPV6;
|
||||
} else {
|
||||
nas_log->warning("Unsupported PDN prtocol. Defaulting to IPv4\n");
|
||||
pdn_con_req.pdn_type = LIBLTE_MME_PDN_TYPE_IPV4;
|
||||
}
|
||||
|
||||
// Set the optional flags
|
||||
if (cfg.apn == "") {
|
||||
pdn_con_req.esm_info_transfer_flag_present = false;
|
||||
|
|
|
@ -120,12 +120,14 @@ imei = 353490069873319
|
|||
# NAS configuration
|
||||
#
|
||||
# apn: Set Access Point Name (APN)
|
||||
# apn_protocol: Set APN protocol (IPv4 or IPv6.)
|
||||
# user: Username for CHAP authentication
|
||||
# pass: Password for CHAP authentication
|
||||
# force_imsi_attach: Whether to always perform an IMSI attach
|
||||
#####################################################################
|
||||
[nas]
|
||||
#apn = internetinternet
|
||||
apn = srsapn
|
||||
apn_protocol = ipv6
|
||||
#user = srsuser
|
||||
#pass = srspass
|
||||
#force_imsi_attach = false
|
||||
|
|
Loading…
Reference in New Issue