Changed with Cedric the collection initial ue id/enb s1ap id that did not work in rb tree -> 2 hashtables + misc types name change in openaircn (gtp types )
git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7661 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
@@ -412,12 +412,14 @@ typedef struct eNB_RRC_INST_s {
|
||||
rcc_eNB_carrier_data_t carrier[MAX_NUM_CCs];
|
||||
uid_allocator_t uid_allocator; // for rrc_ue_head
|
||||
RB_HEAD(rrc_ue_tree_s, rrc_eNB_ue_context_s) rrc_ue_head; // ue_context tree key search by rnti
|
||||
RB_HEAD(rrc_rnti_tree_s, rrc_ue_s1ap_ids_s) rrc_rnti_head; // ue-rnti tree key search by S1AP ids
|
||||
uint8_t HO_flag;
|
||||
uint8_t Nb_ue;
|
||||
#if defined(ENABLE_RAL)
|
||||
obj_hash_table_t *ral_meas_thresholds;
|
||||
#endif
|
||||
hash_table_t *initial_id2_s1ap_ids; // key is content is rrc_ue_s1ap_ids_t
|
||||
hash_table_t *s1ap_id2_s1ap_ids ; // key is content is rrc_ue_s1ap_ids_t
|
||||
|
||||
#ifdef LOCALIZATION
|
||||
/// localization type, 0: power based, 1: time based
|
||||
uint8_t loc_type;
|
||||
|
||||
@@ -3303,11 +3303,15 @@ openair_rrc_lite_eNB_init(
|
||||
|
||||
uid_linear_allocator_init(&eNB_rrc_inst[ctxt.module_id].uid_allocator);
|
||||
RB_INIT(&eNB_rrc_inst[ctxt.module_id].rrc_ue_head);
|
||||
RB_INIT(&eNB_rrc_inst[ctxt.module_id].rrc_rnti_head);
|
||||
// for (j = 0; j < (NUMBER_OF_UE_MAX + 1); j++) {
|
||||
// eNB_rrc_inst[enb_mod_idP].Srb2[j].Active = 0;
|
||||
// }
|
||||
|
||||
|
||||
eNB_rrc_inst[ctxt.module_id].initial_id2_s1ap_ids = hashtable_create (NUMBER_OF_UE_MAX * 2, NULL, NULL);
|
||||
eNB_rrc_inst[ctxt.module_id].s1ap_id2_s1ap_ids = hashtable_create (NUMBER_OF_UE_MAX * 2, NULL, NULL);
|
||||
|
||||
|
||||
/// System Information INIT
|
||||
|
||||
LOG_I(RRC, PROTOCOL_RRC_CTXT_FMT" Checking release \n",
|
||||
|
||||
@@ -80,49 +80,10 @@ static const uint16_t S1AP_INTEGRITY_EIA2_MASK = 0x4000;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
# if defined(ENABLE_ITTI)
|
||||
//------------------------------------------------------------------------------
|
||||
int
|
||||
rrc_eNB_S1AP_compare_ue_ids(
|
||||
struct rrc_ue_s1ap_ids_s* c1_pP,
|
||||
struct rrc_ue_s1ap_ids_s* c2_pP
|
||||
)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
LOG_T(RRC, "rrc_eNB_S1AP_compare_ue_ids() c1.ue_initial_id %x c2.ue_initial_id %x c1.eNB_ue_s1ap_id %x c2.eNB_ue_s1ap_id %x\n",
|
||||
c1_pP->ue_initial_id,
|
||||
c2_pP->ue_initial_id,
|
||||
c1_pP->eNB_ue_s1ap_id,
|
||||
c2_pP->eNB_ue_s1ap_id);
|
||||
|
||||
if ((c1_pP->eNB_ue_s1ap_id == 0) || (c2_pP->eNB_ue_s1ap_id == 0)) {
|
||||
if (c1_pP->ue_initial_id > c2_pP->ue_initial_id) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (c1_pP->ue_initial_id < c2_pP->ue_initial_id) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (c1_pP->eNB_ue_s1ap_id > c2_pP->eNB_ue_s1ap_id) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (c1_pP->eNB_ue_s1ap_id < c2_pP->eNB_ue_s1ap_id) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/* Generate the tree management functions */
|
||||
RB_GENERATE(rrc_rnti_tree_s, rrc_ue_s1ap_ids_s, entries, rrc_eNB_S1AP_compare_ue_ids);
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
struct rrc_ue_s1ap_ids_s*
|
||||
rrc_eNB_S1AP_get_ue_ids(
|
||||
@@ -132,12 +93,41 @@ rrc_eNB_S1AP_get_ue_ids(
|
||||
)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
rrc_ue_s1ap_ids_t temp;
|
||||
memset(&temp, 0, sizeof(struct rrc_ue_s1ap_ids_s));
|
||||
/* eNB ue rrc id = 24 bits wide */
|
||||
temp.ue_initial_id = ue_initial_id;
|
||||
temp.eNB_ue_s1ap_id = eNB_ue_s1ap_id;
|
||||
return RB_FIND(rrc_rnti_tree_s, &rrc_instance_pP->rrc_rnti_head, &temp);
|
||||
rrc_ue_s1ap_ids_t *result = NULL;
|
||||
rrc_ue_s1ap_ids_t *result2 = NULL;
|
||||
hashtable_rc_t h_rc;
|
||||
|
||||
// we assume that a rrc_ue_s1ap_ids_s is initially inserted in initial_id2_s1ap_ids
|
||||
if (eNB_ue_s1ap_id > 0) {
|
||||
h_rc = hashtable_get(rrc_instance_pP->s1ap_id2_s1ap_ids, (hash_key_t)eNB_ue_s1ap_id, (void**)&result);
|
||||
if (h_rc == HASH_TABLE_OK) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
if (ue_initial_id != UE_INITIAL_ID_INVALID) {
|
||||
h_rc = hashtable_get(rrc_instance_pP->initial_id2_s1ap_ids, (hash_key_t)ue_initial_id, (void**)&result);
|
||||
if (h_rc == HASH_TABLE_OK) {
|
||||
if (eNB_ue_s1ap_id != 0) {
|
||||
h_rc = hashtable_get(rrc_instance_pP->s1ap_id2_s1ap_ids, (hash_key_t)eNB_ue_s1ap_id, (void**)&result2);
|
||||
if (h_rc != HASH_TABLE_OK) {
|
||||
result2 = malloc(sizeof(*result2));
|
||||
if (NULL != result2) {
|
||||
*result2 = *result;
|
||||
result2->eNB_ue_s1ap_id = eNB_ue_s1ap_id;
|
||||
result->eNB_ue_s1ap_id = eNB_ue_s1ap_id;
|
||||
h_rc = hashtable_insert(rrc_instance_pP->s1ap_id2_s1ap_ids,
|
||||
(hash_key_t)eNB_ue_s1ap_id,
|
||||
result2);
|
||||
LOG_E(S1AP, "[eNB %u] Error while hashtable_insert in s1ap_id2_s1ap_ids eNB_ue_s1ap_id %u\n",
|
||||
rrc_instance_pP - eNB_rrc_inst, eNB_ue_s1ap_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
void
|
||||
@@ -147,6 +137,9 @@ rrc_eNB_S1AP_remove_ue_ids(
|
||||
)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
const uint16_t ue_initial_id = ue_ids_pP->ue_initial_id;
|
||||
const uint32_t eNB_ue_s1ap_id = ue_ids_pP->eNB_ue_s1ap_id;
|
||||
hashtable_rc_t h_rc;
|
||||
if (rrc_instance_pP == NULL) {
|
||||
LOG_E(RRC, "Bad RRC instance\n");
|
||||
return;
|
||||
@@ -157,8 +150,19 @@ rrc_eNB_S1AP_remove_ue_ids(
|
||||
return;
|
||||
}
|
||||
|
||||
RB_REMOVE(rrc_rnti_tree_s, &rrc_instance_pP->rrc_rnti_head, ue_ids_pP);
|
||||
free(ue_ids_pP);
|
||||
if (eNB_ue_s1ap_id > 0) {
|
||||
h_rc = hashtable_remove(rrc_instance_pP->s1ap_id2_s1ap_ids, (hash_key_t)eNB_ue_s1ap_id);
|
||||
if (h_rc != HASH_TABLE_OK) {
|
||||
LOG_W(RRC, "S1AP Did not find entry in hashtable s1ap_id2_s1ap_ids for eNB_ue_s1ap_id %u\n", eNB_ue_s1ap_id);
|
||||
}
|
||||
}
|
||||
|
||||
if (ue_initial_id != UE_INITIAL_ID_INVALID) {
|
||||
h_rc = hashtable_remove(rrc_instance_pP->initial_id2_s1ap_ids, (hash_key_t)ue_initial_id);
|
||||
if (h_rc != HASH_TABLE_OK) {
|
||||
LOG_W(RRC, "S1AP Did not find entry in hashtable initial_id2_s1ap_ids for ue_initial_id %u\n", ue_initial_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*! \fn uint16_t get_next_ue_initial_id(uint8_t mod_id)
|
||||
@@ -210,10 +214,6 @@ rrc_eNB_get_ue_context_from_s1ap_ids(
|
||||
eNB_ue_s1ap_idP);
|
||||
|
||||
if (temp) {
|
||||
// found by ue_initial_id, fill now eNB_ue_s1ap_idP
|
||||
if (temp->eNB_ue_s1ap_id != eNB_ue_s1ap_idP) {
|
||||
temp->eNB_ue_s1ap_id = eNB_ue_s1ap_idP;
|
||||
}
|
||||
|
||||
return rrc_eNB_get_ue_context(
|
||||
&eNB_rrc_inst[ENB_INSTANCE_TO_MODULE_ID(instanceP)],
|
||||
@@ -616,6 +616,7 @@ rrc_eNB_send_S1AP_NAS_FIRST_REQ(
|
||||
{
|
||||
MessageDef* message_p = NULL;
|
||||
rrc_ue_s1ap_ids_t* rrc_ue_s1ap_ids_p = NULL;
|
||||
hashtable_rc_t h_rc;
|
||||
|
||||
message_p = itti_alloc_new_message (TASK_RRC_ENB, S1AP_NAS_FIRST_REQ);
|
||||
memset(&message_p->ittiMsg.s1ap_nas_first_req, 0, sizeof(s1ap_nas_first_req_t));
|
||||
@@ -628,7 +629,12 @@ rrc_eNB_send_S1AP_NAS_FIRST_REQ(
|
||||
rrc_ue_s1ap_ids_p->eNB_ue_s1ap_id = UE_INITIAL_ID_INVALID;
|
||||
rrc_ue_s1ap_ids_p->ue_rnti = ctxt_pP->rnti;
|
||||
|
||||
RB_INSERT(rrc_rnti_tree_s, &eNB_rrc_inst[ctxt_pP->module_id].rrc_rnti_head, rrc_ue_s1ap_ids_p);
|
||||
h_rc = hashtable_insert(eNB_rrc_inst[ctxt_pP->module_id].initial_id2_s1ap_ids,
|
||||
(hash_key_t)ue_context_pP->ue_context.ue_initial_id,
|
||||
rrc_ue_s1ap_ids_p);
|
||||
|
||||
LOG_E(S1AP, "[eNB %d] Error while hashtable_insert in initial_id2_s1ap_ids ue_initial_id %u\n",
|
||||
ctxt_pP->module_id, ue_context_pP->ue_context.ue_initial_id);
|
||||
|
||||
/* Assume that cause is coded in the same way in RRC and S1ap, just check that the value is in S1ap range */
|
||||
AssertFatal(ue_context_pP->ue_context.establishment_cause < RRC_CAUSE_LAST,
|
||||
|
||||
Reference in New Issue
Block a user