Commit 31ab7287 authored by Navid Nikaein's avatar Navid Nikaein

* improve the management of two simultaneous E_RAB_SETUP_REQ.

parent c74ff9e3
......@@ -303,6 +303,7 @@ typedef struct eNB_RRC_UE_s {
#endif
SRB_ToAddModList_t* SRB_configList;
DRB_ToAddModList_t* DRB_configList;
DRB_ToAddModList_t* DRB_configList2[8];
uint8_t DRB_active[8];
struct PhysicalConfigDedicated* physicalConfigDedicated;
struct SPS_Config* sps_Config;
......
......@@ -1085,7 +1085,7 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t* co
DedicatedInfoNAS_t *dedicatedInfoNas = NULL;
long *logicalchannelgroup, *logicalchannelgroup_drb;
int drb_identity_index=0;
int drb_identity_index=0, nas_sequence_flag = 0;
// Configure DRB
//*DRB_configList = CALLOC(1, sizeof(*DRB_configList));
......@@ -1097,7 +1097,7 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t* co
i++){
// bypass the already configured erabs
if (ue_context_pP->ue_context.e_rab[i].status == E_RAB_STATUS_ESTABLISHED) {
if (ue_context_pP->ue_context.e_rab[i].status >= E_RAB_STATUS_DONE) {
drb_identity_index++;
continue;
}
......@@ -1107,7 +1107,7 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t* co
DRB_config->eps_BearerIdentity = CALLOC(1, sizeof(long));
*(DRB_config->eps_BearerIdentity) = ue_context_pP->ue_context.e_rab[i].param.e_rab_id;
DRB_config->drb_Identity = 1 + drb_identity_index;// (DRB_Identity_t) ue_context_pP->ue_context.e_rab[i].param.e_rab_id;
DRB_config->drb_Identity = 1 + drb_identity_index ;// + i ;// (DRB_Identity_t) ue_context_pP->ue_context.e_rab[i].param.e_rab_id;
// 1 + drb_identiy_index;
DRB_config->logicalChannelIdentity = CALLOC(1, sizeof(long));
......@@ -1181,6 +1181,7 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t* co
DRB_ul_SpecificParameters->logicalChannelGroup = logicalchannelgroup_drb;
ASN_SEQUENCE_ADD(&(*DRB_configList)->list, DRB_config);
//ue_context_pP->ue_context.DRB_configList2[drb_identity_index] = &(*DRB_configList);
LOG_I(RRC,"EPS ID %d, DRB ID %d (index %d), QCI %d, priority %d, LCID %d LCGID %d \n",
*DRB_config->eps_BearerIdentity,
......@@ -1188,9 +1189,11 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t* co
ue_context_pP->ue_context.e_rab[i].param.qos.qci,
DRB_ul_SpecificParameters->priority,
*(DRB_config->logicalChannelIdentity),
DRB_ul_SpecificParameters->logicalChannelGroup
*DRB_ul_SpecificParameters->logicalChannelGroup
);
//if (nas_sequence_flag == 0)
{
if (ue_context_pP->ue_context.e_rab[i].param.nas_pdu.buffer != NULL) {
dedicatedInfoNas = CALLOC(1, sizeof(DedicatedInfoNAS_t));
memset(dedicatedInfoNas, 0, sizeof(OCTET_STRING_t));
......@@ -1198,6 +1201,7 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t* co
(char*)ue_context_pP->ue_context.e_rab[i].param.nas_pdu.buffer,
ue_context_pP->ue_context.e_rab[i].param.nas_pdu.length);
ASN_SEQUENCE_ADD(&dedicatedInfoNASList->list, dedicatedInfoNas);
// nas_sequence_flag = 1;
}
/* TODO parameters yet to process ... */
{
......@@ -1211,6 +1215,7 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t* co
free(dedicatedInfoNASList);
dedicatedInfoNASList = NULL;
}
}
ue_context_pP->ue_context.e_rab[i].status = E_RAB_STATUS_DONE;
......@@ -1482,6 +1487,7 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t* cons
DRB_ul_SpecificParameters->logicalChannelGroup = logicalchannelgroup_drb;
ASN_SEQUENCE_ADD(&(*DRB_configList)->list, DRB_config);
//ue_context_pP->ue_context.DRB_configList2[0] = &(*DRB_configList);
mac_MainConfig = CALLOC(1, sizeof(*mac_MainConfig));
ue_context_pP->ue_context.mac_MainConfig = mac_MainConfig;
......@@ -3238,7 +3244,8 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
rrc_pdcp_config_asn1_req(
ctxt_pP,
NULL, //LG-RK 14/05/2014 SRB_configList,
DRB_configList, (DRB_ToReleaseList_t *) NULL,
DRB_configList,
(DRB_ToReleaseList_t *) NULL,
/*eNB_rrc_inst[ctxt_pP->module_id].ciphering_algorithm[ue_mod_idP] |
(eNB_rrc_inst[ctxt_pP->module_id].integrity_algorithm[ue_mod_idP] << 4),
*/
......
......@@ -1322,48 +1322,46 @@ rrc_eNB_send_S1AP_E_RAB_SETUP_RESP(const protocol_ctxt_t* const ctxt_pP,
int e_rab;
int e_rabs_done = 0;
int e_rabs_failed = 0;
int established_e_rab_index=0;
msg_p = itti_alloc_new_message (TASK_RRC_ENB, S1AP_E_RAB_SETUP_RESP);
S1AP_E_RAB_SETUP_RESP (msg_p).eNB_ue_s1ap_id = ue_context_pP->ue_context.eNB_ue_s1ap_id;
established_e_rab_index=ue_context_pP->ue_context.setup_e_rabs - ue_context_pP->ue_context.nb_of_e_rabs;
for (e_rab = 0; e_rab < ue_context_pP->ue_context.setup_e_rabs ; e_rab++) {
for (e_rab = 0; e_rab < ue_context_pP->ue_context.nb_of_e_rabs ; e_rab++) {
if (ue_context_pP->ue_context.e_rab[e_rab].status == E_RAB_STATUS_DONE) {
/* if (ue_context_pP->ue_context.e_rab[e_rab].status == E_RAB_STATUS_ESTABLISHED)
continue;
else
*/
if (ue_context_pP->ue_context.e_rab[e_rab+established_e_rab_index].status == E_RAB_STATUS_DONE) {
e_rabs_done++;
S1AP_E_RAB_SETUP_RESP (msg_p).e_rabs[e_rab].e_rab_id = ue_context_pP->ue_context.e_rab[e_rab+established_e_rab_index].param.e_rab_id;
S1AP_E_RAB_SETUP_RESP (msg_p).e_rabs[e_rabs_done].e_rab_id = ue_context_pP->ue_context.e_rab[e_rab].param.e_rab_id;
// TODO add other information from S1-U when it will be integrated
S1AP_E_RAB_SETUP_RESP (msg_p).e_rabs[e_rab].gtp_teid = ue_context_pP->ue_context.enb_gtp_teid[e_rab+established_e_rab_index];
S1AP_E_RAB_SETUP_RESP (msg_p).e_rabs[e_rab].eNB_addr = ue_context_pP->ue_context.enb_gtp_addrs[e_rab+established_e_rab_index];
S1AP_E_RAB_SETUP_RESP (msg_p).e_rabs[e_rabs_done].gtp_teid = ue_context_pP->ue_context.enb_gtp_teid[e_rab];
S1AP_E_RAB_SETUP_RESP (msg_p).e_rabs[e_rabs_done].eNB_addr = ue_context_pP->ue_context.enb_gtp_addrs[e_rab];
//S1AP_E_RAB_SETUP_RESP (msg_p).e_rabs[e_rab].eNB_addr.length += 4;
ue_context_pP->ue_context.e_rab[e_rab].status = E_RAB_STATUS_ESTABLISHED;
ue_context_pP->ue_context.e_rab[e_rabs_done].status = E_RAB_STATUS_ESTABLISHED;
LOG_I (RRC,"enb_gtp_addr (msg index %d, local index %d, status %d): nb_of_e_rabs %d, e_rab_id %d, teid: %u, addr: %d.%d.%d.%d \n ",
e_rab,established_e_rab_index, ue_context_pP->ue_context.e_rab[e_rab+established_e_rab_index].status,
LOG_I (RRC,"enb_gtp_addr (msg index %d, context index %d, status %d): nb_of_e_rabs %d, e_rab_id %d, teid: %u, addr: %d.%d.%d.%d \n ",
e_rabs_done, e_rab, ue_context_pP->ue_context.e_rab[e_rab].status,
ue_context_pP->ue_context.nb_of_e_rabs,
S1AP_E_RAB_SETUP_RESP (msg_p).e_rabs[e_rab].e_rab_id,
S1AP_E_RAB_SETUP_RESP (msg_p).e_rabs[e_rab].gtp_teid,
S1AP_E_RAB_SETUP_RESP (msg_p).e_rabs[e_rab].eNB_addr.buffer[0],
S1AP_E_RAB_SETUP_RESP (msg_p).e_rabs[e_rab].eNB_addr.buffer[1],
S1AP_E_RAB_SETUP_RESP (msg_p).e_rabs[e_rab].eNB_addr.buffer[2],
S1AP_E_RAB_SETUP_RESP (msg_p).e_rabs[e_rab].eNB_addr.buffer[3]);
} else {
S1AP_E_RAB_SETUP_RESP (msg_p).e_rabs[e_rabs_done].e_rab_id,
S1AP_E_RAB_SETUP_RESP (msg_p).e_rabs[e_rabs_done].gtp_teid,
S1AP_E_RAB_SETUP_RESP (msg_p).e_rabs[e_rabs_done].eNB_addr.buffer[0],
S1AP_E_RAB_SETUP_RESP (msg_p).e_rabs[e_rabs_done].eNB_addr.buffer[1],
S1AP_E_RAB_SETUP_RESP (msg_p).e_rabs[e_rabs_done].eNB_addr.buffer[2],
S1AP_E_RAB_SETUP_RESP (msg_p).e_rabs[e_rabs_done].eNB_addr.buffer[3]);
e_rabs_done++;
} else if ((ue_context_pP->ue_context.e_rab[e_rab].status == E_RAB_STATUS_NEW) ||
(ue_context_pP->ue_context.e_rab[e_rab].status == E_RAB_STATUS_ESTABLISHED)){
LOG_D (RRC,"E-RAB is NEW or already ESTABLISHED\n");
}else {
ue_context_pP->ue_context.e_rab[e_rabs_failed].status = E_RAB_STATUS_FAILED;
S1AP_E_RAB_SETUP_RESP (msg_p).e_rabs_failed[e_rabs_failed].e_rab_id = ue_context_pP->ue_context.e_rab[e_rab].param.e_rab_id;
e_rabs_failed++;
ue_context_pP->ue_context.e_rab[e_rab].status = E_RAB_STATUS_FAILED;
S1AP_E_RAB_SETUP_RESP (msg_p).e_rabs_failed[e_rab].e_rab_id = ue_context_pP->ue_context.e_rab[e_rab+established_e_rab_index].param.e_rab_id;
// TODO add cause when it will be integrated
}
}
LOG_I(RRC,"S1AP_E_RAB_SETUP_RESP: nb_of_erabs %d, total e_rabs %d, index %d, \n",
ue_context_pP->ue_context.nb_of_e_rabs, ue_context_pP->ue_context.setup_e_rabs, established_e_rab_index);
LOG_I(RRC,"S1AP_E_RAB_SETUP_RESP: nb_of_erabs %d, total e_rabs %d, index %d \n",
ue_context_pP->ue_context.nb_of_e_rabs, ue_context_pP->ue_context.setup_e_rabs, e_rab);
MSC_LOG_TX_MESSAGE(
MSC_RRC_ENB,
MSC_S1AP_ENB,
......@@ -1378,8 +1376,9 @@ rrc_eNB_send_S1AP_E_RAB_SETUP_RESP(const protocol_ctxt_t* const ctxt_pP,
S1AP_E_RAB_SETUP_RESP (msg_p).nb_of_e_rabs = e_rabs_done;
S1AP_E_RAB_SETUP_RESP (msg_p).nb_of_e_rabs_failed = e_rabs_failed;
if ((e_rabs_done > 0) )
itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, msg_p);
}
# endif /* defined(ENABLE_ITTI) */
......
......@@ -33,7 +33,6 @@
* \email: navid.nikaein@eurecom.fr
* \version 1.0
* @ingroup _s1ap
*/
#include <pthread.h>
......
......@@ -124,7 +124,7 @@ static int s1ap_eNB_decode_initiating_message(s1ap_message *message,
case S1ap_ProcedureCode_id_E_RABSetup:
ret = s1ap_decode_s1ap_e_rabsetuprequesties(
&message->msg.s1ap_E_RABSetupRequestIEs, &initiating_p->value);
s1ap_xer_print_s1ap_e_rabsetuprequest(s1ap_xer__print2sp, message_string, message);
//s1ap_xer_print_s1ap_e_rabsetuprequest(s1ap_xer__print2sp, message_string, message);
message_id = S1AP_E_RAB_SETUP_REQUEST_LOG;
message_string_size = strlen(message_string);
message_p = itti_alloc_new_message_sized(TASK_S1AP,
......@@ -139,7 +139,7 @@ static int s1ap_eNB_decode_initiating_message(s1ap_message *message,
case S1ap_ProcedureCode_id_E_RABRelease:
ret = s1ap_decode_s1ap_e_rabreleasecommandies(&message->msg.s1ap_E_RABReleaseCommandIEs,
&initiating_p->value);
s1ap_xer_print_s1ap_e_rabsetuprequest(s1ap_xer__print2sp, message_string, message);
//s1ap_xer_print_s1ap_e_rabsetuprequest(s1ap_xer__print2sp, message_string, message);
S1AP_ERROR("TODO E_RABReleas initiating message\n");
free(message_string);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment