make the establishment cause a paramter when sending a connection request

needed to signal a mo_sig establishment cause after a RLF
master
Andre Puschmann 5 years ago
parent c24b25f42e
commit 891a66a2e5

@ -213,7 +213,7 @@ public:
class nas_interface_ue class nas_interface_ue
{ {
public: public:
virtual void start_attach_request(srslte::proc_state_t* proc_result) = 0; virtual void start_attach_request(srslte::proc_state_t* proc_result, srslte::establishment_cause_t cause_) = 0;
virtual bool detach_request(const bool switch_off) = 0; virtual bool detach_request(const bool switch_off) = 0;
}; };

@ -60,7 +60,7 @@ public:
bool get_ipv6_addr(uint8_t* ipv6_addr); bool get_ipv6_addr(uint8_t* ipv6_addr);
// UE interface // UE interface
void start_attach_request(srslte::proc_state_t* result) final; void start_attach_request(srslte::proc_state_t* result, srslte::establishment_cause_t cause_) final;
bool detach_request(const bool switch_off) final; bool detach_request(const bool switch_off) final;
void plmn_search_completed(rrc_interface_nas::found_plmn_t found_plmns[rrc_interface_nas::MAX_FOUND_PLMNS], void plmn_search_completed(rrc_interface_nas::found_plmn_t found_plmns[rrc_interface_nas::MAX_FOUND_PLMNS],

@ -167,7 +167,9 @@ void ue_stack_lte::stop_impl()
bool ue_stack_lte::switch_on() bool ue_stack_lte::switch_on()
{ {
if (running) { if (running) {
pending_tasks.try_push(ue_queue_id, task_t{[this](task_t*) { nas.start_attach_request(nullptr); }}); pending_tasks.try_push(ue_queue_id, task_t{[this](task_t*) {
nas.start_attach_request(nullptr, srslte::establishment_cause_t::mo_data);
}});
return true; return true;
} }
return false; return false;

@ -307,7 +307,7 @@ void nas::timer_expired(uint32_t timeout_id)
timers->get(t3411)->run(); timers->get(t3411)->run();
} else if (timeout_id == t3411) { } else if (timeout_id == t3411) {
nas_log->info("Timer T3411 expired: trying to attach again\n"); nas_log->info("Timer T3411 expired: trying to attach again\n");
start_attach_request(nullptr); start_attach_request(nullptr, srslte::establishment_cause_t::mo_sig);
} else { } else {
nas_log->error("Timeout from unknown timer id %d\n", timeout_id); nas_log->error("Timeout from unknown timer id %d\n", timeout_id);
} }
@ -321,7 +321,7 @@ void nas::timer_expired(uint32_t timeout_id)
* The function returns true if the UE could attach correctly or false in case of error or timeout during attachment. * The function returns true if the UE could attach correctly or false in case of error or timeout during attachment.
* *
*/ */
void nas::start_attach_request(srslte::proc_state_t* result) void nas::start_attach_request(srslte::proc_state_t* result, srslte::establishment_cause_t cause_)
{ {
nas_log->info("Attach Request\n"); nas_log->info("Attach Request\n");
switch (state) { switch (state) {
@ -382,7 +382,7 @@ void nas::start_attach_request(srslte::proc_state_t* result)
} }
} else { } else {
nas_log->info("NAS is already registered but RRC disconnected. Connecting now...\n"); nas_log->info("NAS is already registered but RRC disconnected. Connecting now...\n");
if (not rrc_connector.launch(this, srslte::establishment_cause_t ::mo_data, nullptr)) { if (not rrc_connector.launch(this, cause_, nullptr)) {
nas_log->error("Cannot initiate concurrent rrc connection procedures\n"); nas_log->error("Cannot initiate concurrent rrc connection procedures\n");
if (result != nullptr) { if (result != nullptr) {
*result = proc_state_t::error; *result = proc_state_t::error;

@ -238,9 +238,7 @@ void usim::generate_as_keys(uint8_t *k_asme,
{ {
// Generate K_enb // Generate K_enb
security_generate_k_enb( k_asme, security_generate_k_enb(k_asme, count_ul, k_enb);
count_ul,
k_enb);
memcpy(this->k_asme, k_asme, 32); memcpy(this->k_asme, k_asme, 32);

@ -144,7 +144,7 @@ public:
bool switch_on() final bool switch_on() final
{ {
proc_state_t proc_result = proc_state_t::on_going; proc_state_t proc_result = proc_state_t::on_going;
nas->start_attach_request(&proc_result); nas->start_attach_request(&proc_result, srslte::establishment_cause_t::mo_data);
while (proc_result == proc_state_t::on_going) { while (proc_result == proc_state_t::on_going) {
usleep(1000); usleep(1000);
} }

Loading…
Cancel
Save