s1ap - simplified erab modify procedure

master
Francisco 4 years ago committed by Francisco Paisana
parent 76978f0d14
commit f401683960

@ -30,13 +30,20 @@ public:
virtual bool setup_ue_ctxt(uint16_t rnti, const asn1::s1ap::init_context_setup_request_s& msg) = 0; virtual bool setup_ue_ctxt(uint16_t rnti, const asn1::s1ap::init_context_setup_request_s& msg) = 0;
virtual bool modify_ue_ctxt(uint16_t rnti, const asn1::s1ap::ue_context_mod_request_s& msg) = 0; virtual bool modify_ue_ctxt(uint16_t rnti, const asn1::s1ap::ue_context_mod_request_s& msg) = 0;
virtual bool setup_ue_erabs(uint16_t rnti, const asn1::s1ap::erab_setup_request_s& msg) = 0; virtual bool setup_ue_erabs(uint16_t rnti, const asn1::s1ap::erab_setup_request_s& msg) = 0;
virtual void virtual bool has_erab(uint16_t rnti, uint32_t erab_id) const = 0;
modify_erabs(uint16_t rnti, virtual bool release_erabs(uint32_t rnti) = 0;
srsran::const_span<const asn1::s1ap::erab_to_be_modified_item_bearer_mod_req_s*> erabs_to_modify) = 0;
virtual bool has_erab(uint16_t rnti, uint32_t erab_id) const = 0; /**
virtual bool release_erabs(uint32_t rnti) = 0; * TS 36.413, 8.2.2 - Modify E-RAB
* @return if error, cause argument is updated with cause
*/
virtual int modify_erab(uint16_t rnti,
uint16_t erab_id,
const asn1::s1ap::erab_level_qos_params_s& qos_params,
const asn1::unbounded_octstring<true>* nas_pdu,
asn1::s1ap::cause_c& cause) = 0;
/** /**
* Release E-RAB id * TS 36.413, 8.2.3 - Release E-RAB id
* @return error if E-RAB id or rnti were not found * @return error if E-RAB id or rnti were not found
*/ */
virtual int release_erab(uint16_t rnti, uint16_t erab_id) = 0; virtual int release_erab(uint16_t rnti, uint16_t erab_id) = 0;

@ -29,5 +29,12 @@ uint32_t get_obj_id<protocol_ie_single_container_s<erab_to_be_setup_item_ctxt_su
return obj.value.erab_to_be_setup_item_ctxt_su_req().erab_id; return obj.value.erab_to_be_setup_item_ctxt_su_req().erab_id;
} }
template <>
uint32_t get_obj_id<protocol_ie_single_container_s<erab_to_be_modified_item_bearer_mod_req_ies_o> >(
const protocol_ie_single_container_s<erab_to_be_modified_item_bearer_mod_req_ies_o>& obj)
{
return obj.value.erab_to_be_modified_item_bearer_mod_req().erab_id;
}
} // namespace s1ap } // namespace s1ap
} // namespace asn1 } // namespace asn1

@ -77,19 +77,17 @@ public:
void max_retx_attempted(uint16_t rnti) override; void max_retx_attempted(uint16_t rnti) override;
// rrc_interface_s1ap // rrc_interface_s1ap
void write_dl_info(uint16_t rnti, srsran::unique_byte_buffer_t sdu) override; void write_dl_info(uint16_t rnti, srsran::unique_byte_buffer_t sdu) override;
void release_ue(uint16_t rnti) override; void release_ue(uint16_t rnti) override;
bool setup_ue_ctxt(uint16_t rnti, const asn1::s1ap::init_context_setup_request_s& msg) override; bool setup_ue_ctxt(uint16_t rnti, const asn1::s1ap::init_context_setup_request_s& msg) override;
bool modify_ue_ctxt(uint16_t rnti, const asn1::s1ap::ue_context_mod_request_s& msg) override; bool modify_ue_ctxt(uint16_t rnti, const asn1::s1ap::ue_context_mod_request_s& msg) override;
bool setup_ue_erabs(uint16_t rnti, const asn1::s1ap::erab_setup_request_s& msg) override; bool setup_ue_erabs(uint16_t rnti, const asn1::s1ap::erab_setup_request_s& msg) override;
bool has_erab(uint16_t rnti, uint32_t erab_id) const override; bool has_erab(uint16_t rnti, uint32_t erab_id) const override;
void modify_erabs( int modify_erab(uint16_t rnti,
uint16_t rnti, uint16_t erab_id,
srsran::const_span<const asn1::s1ap::erab_to_be_modified_item_bearer_mod_req_s*> erabs_to_modify) override; const asn1::s1ap::erab_level_qos_params_s& qos_params,
bool modify_ue_erab(uint16_t rnti, const asn1::unbounded_octstring<true>* nas_pdu,
uint8_t erab_id, asn1::s1ap::cause_c& cause) override;
const asn1::s1ap::erab_level_qos_params_s& qos_params,
const asn1::unbounded_octstring<true>* nas_pdu);
bool release_erabs(uint32_t rnti) override; bool release_erabs(uint32_t rnti) override;
int release_erab(uint16_t rnti, uint16_t erab_id) override; int release_erab(uint16_t rnti, uint16_t erab_id) override;
void add_paging_id(uint32_t ueid, const asn1::s1ap::ue_paging_id_c& UEPagingID) override; void add_paging_id(uint32_t ueid, const asn1::s1ap::ue_paging_id_c& UEPagingID) override;

@ -87,9 +87,10 @@ public:
asn1::s1ap::cause_c& cause); asn1::s1ap::cause_c& cause);
int release_erab(uint8_t erab_id); int release_erab(uint8_t erab_id);
void release_erabs(); void release_erabs();
bool modify_erab(uint8_t erab_id, int modify_erab(uint8_t erab_id,
const asn1::s1ap::erab_level_qos_params_s& qos, const asn1::s1ap::erab_level_qos_params_s& qos,
const asn1::unbounded_octstring<true>* nas_pdu); const asn1::unbounded_octstring<true>* nas_pdu,
asn1::s1ap::cause_c& cause);
// Methods to apply bearer updates // Methods to apply bearer updates
int add_gtpu_bearer(uint32_t erab_id); int add_gtpu_bearer(uint32_t erab_id);

@ -114,9 +114,10 @@ public:
bool setup_erabs(const asn1::s1ap::erab_to_be_setup_list_bearer_su_req_l& e); bool setup_erabs(const asn1::s1ap::erab_to_be_setup_list_bearer_su_req_l& e);
bool release_erabs(); bool release_erabs();
int release_erab(uint32_t erab_id); int release_erab(uint32_t erab_id);
bool modify_erab(uint16_t erab_id, int modify_erab(uint16_t erab_id,
const asn1::s1ap::erab_level_qos_params_s& qos_params, const asn1::s1ap::erab_level_qos_params_s& qos_params,
const asn1::unbounded_octstring<true>* nas_pdu); const asn1::unbounded_octstring<true>* nas_pdu,
asn1::s1ap::cause_c& cause);
void notify_s1ap_ue_ctxt_setup_complete(); void notify_s1ap_ue_ctxt_setup_complete();
void notify_s1ap_ue_erab_setup_response(const asn1::s1ap::erab_to_be_setup_list_bearer_su_req_l& e); void notify_s1ap_ue_erab_setup_response(const asn1::s1ap::erab_to_be_setup_list_bearer_su_req_l& e);

@ -163,8 +163,8 @@ private:
bool handle_uectxtreleasecommand(const asn1::s1ap::ue_context_release_cmd_s& msg); bool handle_uectxtreleasecommand(const asn1::s1ap::ue_context_release_cmd_s& msg);
bool handle_s1setupfailure(const asn1::s1ap::s1_setup_fail_s& msg); bool handle_s1setupfailure(const asn1::s1ap::s1_setup_fail_s& msg);
bool handle_erabsetuprequest(const asn1::s1ap::erab_setup_request_s& msg); bool handle_erabsetuprequest(const asn1::s1ap::erab_setup_request_s& msg);
bool handle_erabreleasecommand(const asn1::s1ap::erab_release_cmd_s& msg);
bool handle_erabmodifyrequest(const asn1::s1ap::erab_modify_request_s& msg); bool handle_erabmodifyrequest(const asn1::s1ap::erab_modify_request_s& msg);
bool handle_erabreleasecommand(const asn1::s1ap::erab_release_cmd_s& msg);
bool handle_uecontextmodifyrequest(const asn1::s1ap::ue_context_mod_request_s& msg); bool handle_uecontextmodifyrequest(const asn1::s1ap::ue_context_mod_request_s& msg);
// handover // handover
@ -249,9 +249,8 @@ private:
bool send_erab_setup_response(const asn1::s1ap::erab_setup_resp_s& res_); bool send_erab_setup_response(const asn1::s1ap::erab_setup_resp_s& res_);
bool send_erab_release_response(srsran::const_span<uint16_t> erabs_released, bool send_erab_release_response(srsran::const_span<uint16_t> erabs_released,
srsran::const_span<asn1::s1ap::erab_item_s> erabs_failed); srsran::const_span<asn1::s1ap::erab_item_s> erabs_failed);
bool send_erab_modify_response( bool send_erab_modify_response(srsran::const_span<uint16_t> erabs_modified,
srsran::const_span<const asn1::s1ap::erab_to_be_modified_item_bearer_mod_req_s*> erabs_modified, srsran::const_span<asn1::s1ap::erab_item_s> erabs_failed_to_modify);
srsran::const_span<std::pair<uint16_t, asn1::s1ap::cause_c> > erabs_failed_to_modify);
bool send_erab_release_indication(const std::vector<uint16_t>& erabs_successfully_released); bool send_erab_release_indication(const std::vector<uint16_t>& erabs_successfully_released);
bool send_ue_cap_info_indication(srsran::unique_byte_buffer_t ue_radio_cap); bool send_ue_cap_info_indication(srsran::unique_byte_buffer_t ue_radio_cap);

@ -392,39 +392,21 @@ bool rrc::has_erab(uint16_t rnti, uint32_t erab_id) const
return user_it->second->has_erab(erab_id); return user_it->second->has_erab(erab_id);
} }
void rrc::modify_erabs(uint16_t rnti, int rrc::modify_erab(uint16_t rnti,
srsran::const_span<const asn1::s1ap::erab_to_be_modified_item_bearer_mod_req_s*> erabs_to_modify) uint16_t erab_id,
{ const asn1::s1ap::erab_level_qos_params_s& qos_params,
logger.info("Modifying E-RABs for 0x%x", rnti); const asn1::unbounded_octstring<true>* nas_pdu,
auto user_it = users.find(rnti); asn1::s1ap::cause_c& cause)
if (user_it == users.end()) {
logger.warning("Unrecognised rnti: 0x%x", rnti);
return;
}
for (const auto* erab_ptr : erabs_to_modify) {
// Attempt to modify E-RAB
bool ret = modify_ue_erab(rnti, erab_ptr->erab_id, erab_ptr->erab_level_qos_params, &erab_ptr->nas_pdu);
srsran_expect(ret, "modify_erabs should not called for valid E-RAB Ids");
}
}
bool rrc::modify_ue_erab(uint16_t rnti,
uint8_t erab_id,
const asn1::s1ap::erab_level_qos_params_s& qos_params,
const asn1::unbounded_octstring<true>* nas_pdu)
{ {
logger.info("Modifying E-RAB for 0x%x. E-RAB Id %d", rnti, erab_id); logger.info("Modifying E-RAB for 0x%x. E-RAB Id %d", rnti, erab_id);
auto user_it = users.find(rnti); auto user_it = users.find(rnti);
if (user_it == users.end()) { if (user_it == users.end()) {
logger.warning("Unrecognised rnti: 0x%x", rnti); logger.warning("Unrecognised rnti: 0x%x", rnti);
return false; cause.set_radio_network().value = asn1::s1ap::cause_radio_network_opts::unknown_erab_id;
return SRSRAN_ERROR;
} }
bool ret = user_it->second->modify_erab(erab_id, qos_params, nas_pdu); return user_it->second->modify_erab(erab_id, qos_params, nas_pdu, cause);
return ret;
} }
/******************************************************************************* /*******************************************************************************

@ -317,21 +317,22 @@ void bearer_cfg_handler::release_erabs()
} }
} }
bool bearer_cfg_handler::modify_erab(uint8_t erab_id, int bearer_cfg_handler::modify_erab(uint8_t erab_id,
const asn1::s1ap::erab_level_qos_params_s& qos, const asn1::s1ap::erab_level_qos_params_s& qos,
const asn1::unbounded_octstring<true>* nas_pdu) const asn1::unbounded_octstring<true>* nas_pdu,
asn1::s1ap::cause_c& cause)
{ {
logger->info("Modifying E-RAB %d", erab_id); logger->info("Modifying E-RAB %d", erab_id);
std::map<uint8_t, erab_t>::iterator erab_it = erabs.find(erab_id); std::map<uint8_t, erab_t>::iterator erab_it = erabs.find(erab_id);
if (erab_it == erabs.end()) { if (erab_it == erabs.end()) {
logger->error("Could not find E-RAB to modify"); logger->error("Could not find E-RAB to modify");
return false; cause.set_radio_network().value = asn1::s1ap::cause_radio_network_opts::unknown_erab_id;
return SRSRAN_ERROR;
} }
auto address = erab_it->second.address; auto address = erab_it->second.address;
uint32_t teid_out = erab_it->second.teid_out; uint32_t teid_out = erab_it->second.teid_out;
release_erab(erab_id); release_erab(erab_id);
asn1::s1ap::cause_c cause; return add_erab(erab_id, qos, address, teid_out, nas_pdu, cause);
return add_erab(erab_id, qos, address, teid_out, nas_pdu, cause) == SRSRAN_SUCCESS;
} }
int bearer_cfg_handler::add_gtpu_bearer(uint32_t erab_id) int bearer_cfg_handler::add_gtpu_bearer(uint32_t erab_id)

@ -1055,15 +1055,12 @@ int rrc::ue::release_erab(uint32_t erab_id)
return bearer_list.release_erab(erab_id); return bearer_list.release_erab(erab_id);
} }
bool rrc::ue::modify_erab(uint16_t erab_id, int rrc::ue::modify_erab(uint16_t erab_id,
const asn1::s1ap::erab_level_qos_params_s& qos_params, const asn1::s1ap::erab_level_qos_params_s& qos_params,
const asn1::unbounded_octstring<true>* nas_pdu) const asn1::unbounded_octstring<true>* nas_pdu,
asn1::s1ap::cause_c& cause)
{ {
bool ret = bearer_list.modify_erab(erab_id, qos_params, nas_pdu); return bearer_list.modify_erab(erab_id, qos_params, nas_pdu, cause);
if (ret) {
send_connection_reconf(nullptr, false);
}
return ret;
} }
void rrc::ue::notify_s1ap_ue_erab_setup_response(const asn1::s1ap::erab_to_be_setup_list_bearer_su_req_l& e) void rrc::ue::notify_s1ap_ue_erab_setup_response(const asn1::s1ap::erab_to_be_setup_list_bearer_su_req_l& e)

@ -74,6 +74,20 @@ void add_repeated_erab_ids(const List&
} }
} }
} }
// Sort and remove duplications
std::sort(failed_cfg_erabs.begin(), failed_cfg_erabs.end(), &lower_obj_id<erab_item_s>);
failed_cfg_erabs.erase(std::unique(failed_cfg_erabs.begin(), failed_cfg_erabs.end(), &equal_obj_id<erab_item_s>),
failed_cfg_erabs.end());
}
bool contains_erab_id(srsran::bounded_vector<erab_item_s, ASN1_S1AP_MAXNOOF_ERABS>& failed_cfg_erabs, uint16_t erab_id)
{
erab_item_s dummy;
dummy.erab_id = erab_id;
return std::find_if(failed_cfg_erabs.begin(), failed_cfg_erabs.end(), [erab_id](const erab_item_s& e) {
return e.erab_id == erab_id;
}) != failed_cfg_erabs.end();
} }
/********************************************************* /*********************************************************
@ -760,73 +774,48 @@ bool s1ap::handle_erabsetuprequest(const erab_setup_request_s& msg)
bool s1ap::handle_erabmodifyrequest(const erab_modify_request_s& msg) bool s1ap::handle_erabmodifyrequest(const erab_modify_request_s& msg)
{ {
if (msg.ext) { WarnUnsupportFeature(msg.ext, "S1AP message extension");
logger.warning("Not handling S1AP message extension");
}
ue* u = ue* u =
handle_s1apmsg_ue_id(msg.protocol_ies.enb_ue_s1ap_id.value.value, msg.protocol_ies.mme_ue_s1ap_id.value.value); handle_s1apmsg_ue_id(msg.protocol_ies.enb_ue_s1ap_id.value.value, msg.protocol_ies.mme_ue_s1ap_id.value.value);
if (u == nullptr) { if (u == nullptr) {
return false; return false;
} }
using erab_t = erab_to_be_modified_item_bearer_mod_req_s; failed_cfg_erabs.clear();
using failed_erab_t = std::pair<uint16_t, cause_c>; updated_erabs.clear();
srsran::bounded_vector<const erab_t*, MAX_ERAB_ID + 1> erab_mod_list; add_repeated_erab_ids(msg.protocol_ies.erab_to_be_modified_list_bearer_mod_req.value, failed_cfg_erabs);
srsran::bounded_vector<failed_erab_t, MAX_ERAB_ID + 1> erabs_failed_to_modify;
const auto& msg_erabs = msg.protocol_ies.erab_to_be_modified_list_bearer_mod_req.value;
if (msg_erabs.size() > erab_mod_list.capacity()) {
logger.warning("Not handling more than %d E-RABs per modify request message.", erab_mod_list.capacity());
}
for (size_t i = 0; i < SRSRAN_MIN(msg_erabs.size(), erab_mod_list.capacity()); ++i) {
const erab_t& e = msg_erabs[i].value.erab_to_be_modified_item_bearer_mod_req();
// Check if E-RAB exists. If not, add to "erabs_failed_to_modify" with "unknown_erab_id" cause for (const auto& item : msg.protocol_ies.erab_to_be_modified_list_bearer_mod_req.value) {
if (not rrc->has_erab(u->ctxt.rnti, e.erab_id)) { const auto& erab = item.value.erab_to_be_modified_item_bearer_mod_req();
cause_c cause; if (contains_erab_id(failed_cfg_erabs, erab.erab_id)) {
cause.set_radio_network().value = cause_radio_network_opts::unknown_erab_id; // E-RAB is duplicate
erabs_failed_to_modify.emplace_back(e.erab_id, cause);
continue; continue;
} }
// Check Repeated E-RABs in the modification list. If repeated, add to the list of "erabs_failed_to_modify" cause_c cause;
// with cause "multiple_erab_id_instances" if (rrc->modify_erab(u->ctxt.rnti, erab.erab_id, erab.erab_level_qos_params, &erab.nas_pdu, cause) ==
for (const auto& msg_erab2 : msg_erabs) { SRSRAN_SUCCESS) {
const erab_t& e2 = msg_erab2.value.erab_to_be_modified_item_bearer_mod_req(); updated_erabs.push_back(erab.erab_id);
if (&e2 != &e and e2.erab_id == e.erab_id) { } else {
cause_c cause; failed_cfg_erabs.push_back(erab_item_s());
cause.set_radio_network().value = cause_radio_network_opts::multiple_erab_id_instances; failed_cfg_erabs.back().erab_id = erab.erab_id;
erabs_failed_to_modify.emplace_back(e.erab_id, cause); failed_cfg_erabs.back().cause = cause;
break;
}
}
if (not erabs_failed_to_modify.empty() and erabs_failed_to_modify.back().first == e.erab_id) {
continue;
} }
// Add to the list to modify
erab_mod_list.push_back(&e);
} }
// Modify E-RABs from RRC // Notify UE of updates
rrc->modify_erabs(u->ctxt.rnti, erab_mod_list); if (not updated_erabs.empty()) {
rrc->notify_ue_erab_updates(u->ctxt.rnti, nullptr);
// Sort by E-RAB id, and remove duplicates }
auto lower_erab = [](const erab_t* lhs, const erab_t* rhs) { return lhs->erab_id < rhs->erab_id; };
std::sort(erab_mod_list.begin(), erab_mod_list.end(), lower_erab);
auto lower_erab2 = [](const failed_erab_t& lhs, const failed_erab_t& rhs) { return lhs.first < rhs.first; };
auto equal_erab2 = [](const failed_erab_t& lhs, const failed_erab_t& rhs) { return lhs.first == rhs.first; };
std::sort(erabs_failed_to_modify.begin(), erabs_failed_to_modify.end(), lower_erab2);
erabs_failed_to_modify.erase(std::unique(erabs_failed_to_modify.begin(), erabs_failed_to_modify.end(), equal_erab2),
erabs_failed_to_modify.end());
// Send E-RAB modify response back to the MME // send E-RAB modify response back to the mme
if (not u->send_erab_modify_response(erab_mod_list, erabs_failed_to_modify)) { std::sort(updated_erabs.begin(), updated_erabs.end());
logger.info("Failed to send ERABReleaseResponse"); std::sort(failed_cfg_erabs.begin(), failed_cfg_erabs.end(), &lower_obj_id<erab_item_s>);
if (not u->send_erab_modify_response(updated_erabs, failed_cfg_erabs)) {
logger.info("failed to send erabreleaseresponse");
return false; return false;
} }
return true; return true;
} }
@ -873,15 +862,15 @@ bool s1ap::handle_erabreleasecommand(const erab_release_cmd_s& msg)
} }
} }
// Sort E-RABs to be sent
std::sort(failed_cfg_erabs.begin(), failed_cfg_erabs.end(), &lower_obj_id<erab_item_s>);
std::sort(updated_erabs.begin(), updated_erabs.end());
// Notify RRC of E-RAB update. (RRC reconf message is going to be sent. // Notify RRC of E-RAB update. (RRC reconf message is going to be sent.
if (not updated_erabs.empty()) { if (not updated_erabs.empty()) {
rrc->notify_ue_erab_updates(u->ctxt.rnti, nullptr); rrc->notify_ue_erab_updates(u->ctxt.rnti, nullptr);
} }
// Sort E-RABs to be sent
std::sort(failed_cfg_erabs.begin(), failed_cfg_erabs.end(), &lower_obj_id<erab_item_s>);
std::sort(updated_erabs.begin(), updated_erabs.end());
// Send E-RAB release response back to the MME // Send E-RAB release response back to the MME
if (not u->send_erab_release_response(updated_erabs, failed_cfg_erabs)) { if (not u->send_erab_release_response(updated_erabs, failed_cfg_erabs)) {
logger.info("Failed to send ERABReleaseResponse"); logger.info("Failed to send ERABReleaseResponse");
@ -1516,14 +1505,9 @@ bool s1ap::ue::send_erab_release_response(srsran::const_span<uint16_t>
return s1ap_ptr->sctp_send_s1ap_pdu(tx_pdu, ctxt.rnti, "E-RABReleaseResponse"); return s1ap_ptr->sctp_send_s1ap_pdu(tx_pdu, ctxt.rnti, "E-RABReleaseResponse");
} }
bool s1ap::ue::send_erab_modify_response( bool s1ap::ue::send_erab_modify_response(srsran::const_span<uint16_t> erabs_modified,
srsran::const_span<const erab_to_be_modified_item_bearer_mod_req_s*> erabs_modified, srsran::const_span<erab_item_s> erabs_failed_to_modify)
srsran::const_span<std::pair<uint16_t, cause_c> > erabs_failed_to_modify)
{ {
if (not s1ap_ptr->mme_connected) {
return false;
}
asn1::s1ap::s1ap_pdu_c tx_pdu; asn1::s1ap::s1ap_pdu_c tx_pdu;
tx_pdu.set_successful_outcome().load_info_obj(ASN1_S1AP_ID_ERAB_MODIFY); tx_pdu.set_successful_outcome().load_info_obj(ASN1_S1AP_ID_ERAB_MODIFY);
@ -1538,7 +1522,7 @@ bool s1ap::ue::send_erab_modify_response(
for (uint32_t i = 0; i < container.erab_modify_list_bearer_mod_res.value.size(); i++) { for (uint32_t i = 0; i < container.erab_modify_list_bearer_mod_res.value.size(); i++) {
container.erab_modify_list_bearer_mod_res.value[i].load_info_obj(ASN1_S1AP_ID_ERAB_MODIFY_ITEM_BEARER_MOD_RES); container.erab_modify_list_bearer_mod_res.value[i].load_info_obj(ASN1_S1AP_ID_ERAB_MODIFY_ITEM_BEARER_MOD_RES);
container.erab_modify_list_bearer_mod_res.value[i].value.erab_modify_item_bearer_mod_res().erab_id = container.erab_modify_list_bearer_mod_res.value[i].value.erab_modify_item_bearer_mod_res().erab_id =
erabs_modified[i]->erab_id; erabs_modified[i];
} }
} }
@ -1548,8 +1532,7 @@ bool s1ap::ue::send_erab_modify_response(
container.erab_failed_to_modify_list.value.resize(erabs_failed_to_modify.size()); container.erab_failed_to_modify_list.value.resize(erabs_failed_to_modify.size());
for (uint32_t i = 0; i < container.erab_failed_to_modify_list.value.size(); i++) { for (uint32_t i = 0; i < container.erab_failed_to_modify_list.value.size(); i++) {
container.erab_failed_to_modify_list.value[i].load_info_obj(ASN1_S1AP_ID_ERAB_ITEM); container.erab_failed_to_modify_list.value[i].load_info_obj(ASN1_S1AP_ID_ERAB_ITEM);
container.erab_failed_to_modify_list.value[i].value.erab_item().erab_id = erabs_failed_to_modify[i].first; container.erab_failed_to_modify_list.value[i].value.erab_item() = erabs_failed_to_modify[i];
container.erab_failed_to_modify_list.value[i].value.erab_item().cause = erabs_failed_to_modify[i].second;
} }
} }
@ -1558,9 +1541,6 @@ bool s1ap::ue::send_erab_modify_response(
bool s1ap::ue::send_erab_release_indication(const std::vector<uint16_t>& erabs_successfully_released) bool s1ap::ue::send_erab_release_indication(const std::vector<uint16_t>& erabs_successfully_released)
{ {
if (not s1ap_ptr->mme_connected) {
return false;
}
if (not erabs_successfully_released.empty()) { if (not erabs_successfully_released.empty()) {
logger.error("Failed to initiate E-RAB RELEASE INDICATION procedure for user rnti=0x%x", ctxt.rnti); logger.error("Failed to initiate E-RAB RELEASE INDICATION procedure for user rnti=0x%x", ctxt.rnti);
return false; return false;
@ -1585,10 +1565,6 @@ bool s1ap::ue::send_erab_release_indication(const std::vector<uint16_t>& erabs_s
bool s1ap::ue::send_ue_cap_info_indication(srsran::unique_byte_buffer_t ue_radio_cap) bool s1ap::ue::send_ue_cap_info_indication(srsran::unique_byte_buffer_t ue_radio_cap)
{ {
if (not s1ap_ptr->mme_connected) {
return false;
}
asn1::s1ap::s1ap_pdu_c tx_pdu; asn1::s1ap::s1ap_pdu_c tx_pdu;
tx_pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_UE_CAP_INFO_IND); tx_pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_UE_CAP_INFO_IND);
ue_cap_info_ind_ies_container& container = tx_pdu.init_msg().value.ue_cap_info_ind().protocol_ies; ue_cap_info_ind_ies_container& container = tx_pdu.init_msg().value.ue_cap_info_ind().protocol_ies;
@ -1711,6 +1687,11 @@ void s1ap::user_list::erase(ue* ue_ptr)
bool s1ap::sctp_send_s1ap_pdu(const asn1::s1ap::s1ap_pdu_c& tx_pdu, uint32_t rnti, const char* procedure_name) bool s1ap::sctp_send_s1ap_pdu(const asn1::s1ap::s1ap_pdu_c& tx_pdu, uint32_t rnti, const char* procedure_name)
{ {
if (not mme_connected and rnti != SRSRAN_INVALID_RNTI) {
logger.error("Aborting %s for rnti=0x%x. Cause: MME is not connected.", procedure_name, rnti);
return false;
}
srsran::unique_byte_buffer_t buf = srsran::make_byte_buffer(); srsran::unique_byte_buffer_t buf = srsran::make_byte_buffer();
if (buf == nullptr) { if (buf == nullptr) {
logger.error("Fatal Error: Couldn't allocate buffer for %s.", procedure_name); logger.error("Fatal Error: Couldn't allocate buffer for %s.", procedure_name);

@ -169,10 +169,14 @@ public:
bool setup_ue_ctxt(uint16_t rnti, const asn1::s1ap::init_context_setup_request_s& msg) override { return true; } bool setup_ue_ctxt(uint16_t rnti, const asn1::s1ap::init_context_setup_request_s& msg) override { return true; }
bool modify_ue_ctxt(uint16_t rnti, const asn1::s1ap::ue_context_mod_request_s& msg) override { return true; } bool modify_ue_ctxt(uint16_t rnti, const asn1::s1ap::ue_context_mod_request_s& msg) override { return true; }
bool setup_ue_erabs(uint16_t rnti, const asn1::s1ap::erab_setup_request_s& msg) override { return true; } bool setup_ue_erabs(uint16_t rnti, const asn1::s1ap::erab_setup_request_s& msg) override { return true; }
void modify_erabs( int modify_erab(uint16_t rnti,
uint16_t rnti, uint16_t erab_id,
srsran::const_span<const asn1::s1ap::erab_to_be_modified_item_bearer_mod_req_s*> erabs_to_modify) override const asn1::s1ap::erab_level_qos_params_s& qos_params,
{} const asn1::unbounded_octstring<true>* nas_pdu,
asn1::s1ap::cause_c& cause) override
{
return SRSRAN_SUCCESS;
}
bool has_erab(uint16_t rnti, uint32_t erab_id) const override { return true; } bool has_erab(uint16_t rnti, uint32_t erab_id) const override { return true; }
bool release_erabs(uint32_t rnti) override { return true; } bool release_erabs(uint32_t rnti) override { return true; }
int release_erab(uint16_t rnti, uint16_t erab_id) override { return SRSRAN_SUCCESS; } int release_erab(uint16_t rnti, uint16_t erab_id) override { return SRSRAN_SUCCESS; }

@ -91,14 +91,18 @@ struct dummy_socket_manager : public srsran::socket_manager_itf {
}; };
struct rrc_tester : public rrc_dummy { struct rrc_tester : public rrc_dummy {
void modify_erabs( int modify_erab(uint16_t rnti,
uint16_t rnti, uint16_t erab_id,
srsran::const_span<const asn1::s1ap::erab_to_be_modified_item_bearer_mod_req_s*> erabs_to_modify) override const asn1::s1ap::erab_level_qos_params_s& qos_params,
const asn1::unbounded_octstring<true>* nas_pdu,
asn1::s1ap::cause_c& cause) override
{ {
last_erabs_modified.clear(); if (std::count(next_erabs_failed_to_modify.begin(), next_erabs_failed_to_modify.end(), erab_id) > 0) {
for (auto& erab : erabs_to_modify) { cause.set_radio_network().value = asn1::s1ap::cause_radio_network_opts::unknown_erab_id;
last_erabs_modified.push_back(erab->erab_id); return SRSRAN_ERROR;
} }
last_erabs_modified.push_back(erab_id);
return SRSRAN_SUCCESS;
} }
bool has_erab(uint16_t rnti, uint32_t erab_id) const override bool has_erab(uint16_t rnti, uint32_t erab_id) const override
{ {

Loading…
Cancel
Save