Commit d6da3a03 authored by matzakos's avatar matzakos

ENDC path switch S1-U: Preliminary work to generate S1AP...

ENDC path switch S1-U: Preliminary work to generate S1AP E-RAB-Modification-Indication message that triggers the path switch procedure at the core network
parent 85176d72
...@@ -66,6 +66,7 @@ MESSAGE_DEF(S1AP_E_RAB_MODIFY_RESP , MESSAGE_PRIORITY_MED, s1ap_e_rab_m ...@@ -66,6 +66,7 @@ MESSAGE_DEF(S1AP_E_RAB_MODIFY_RESP , MESSAGE_PRIORITY_MED, s1ap_e_rab_m
MESSAGE_DEF(S1AP_E_RAB_RELEASE_RESPONSE , MESSAGE_PRIORITY_MED, s1ap_e_rab_release_resp_t , s1ap_e_rab_release_resp) MESSAGE_DEF(S1AP_E_RAB_RELEASE_RESPONSE , MESSAGE_PRIORITY_MED, s1ap_e_rab_release_resp_t , s1ap_e_rab_release_resp)
MESSAGE_DEF(S1AP_PATH_SWITCH_REQ , MESSAGE_PRIORITY_MED, s1ap_path_switch_req_t , s1ap_path_switch_req) MESSAGE_DEF(S1AP_PATH_SWITCH_REQ , MESSAGE_PRIORITY_MED, s1ap_path_switch_req_t , s1ap_path_switch_req)
MESSAGE_DEF(S1AP_PATH_SWITCH_REQ_ACK , MESSAGE_PRIORITY_MED, s1ap_path_switch_req_ack_t , s1ap_path_switch_req_ack) MESSAGE_DEF(S1AP_PATH_SWITCH_REQ_ACK , MESSAGE_PRIORITY_MED, s1ap_path_switch_req_ack_t , s1ap_path_switch_req_ack)
MESSAGE_DEF(S1AP_E_RAB_MODIFICATION_IND , MESSAGE_PRIORITY_MED, s1ap_e_rab_modification_ind_t , s1ap_e_rab_modification_ind)
/* S1AP -> RRC messages */ /* S1AP -> RRC messages */
MESSAGE_DEF(S1AP_DOWNLINK_NAS , MESSAGE_PRIORITY_MED, s1ap_downlink_nas_t , s1ap_downlink_nas ) MESSAGE_DEF(S1AP_DOWNLINK_NAS , MESSAGE_PRIORITY_MED, s1ap_downlink_nas_t , s1ap_downlink_nas )
......
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#define S1AP_E_RAB_MODIFY_RESP(mSGpTR) (mSGpTR)->ittiMsg.s1ap_e_rab_modify_resp #define S1AP_E_RAB_MODIFY_RESP(mSGpTR) (mSGpTR)->ittiMsg.s1ap_e_rab_modify_resp
#define S1AP_PATH_SWITCH_REQ(mSGpTR) (mSGpTR)->ittiMsg.s1ap_path_switch_req #define S1AP_PATH_SWITCH_REQ(mSGpTR) (mSGpTR)->ittiMsg.s1ap_path_switch_req
#define S1AP_PATH_SWITCH_REQ_ACK(mSGpTR) (mSGpTR)->ittiMsg.s1ap_path_switch_req_ack #define S1AP_PATH_SWITCH_REQ_ACK(mSGpTR) (mSGpTR)->ittiMsg.s1ap_path_switch_req_ack
#define S1AP_E_RAB_MODIFICATION_IND(mSGpTR) (mSGpTR)->ittiMsg.s1ap_e_rab_modification_ind
#define S1AP_DOWNLINK_NAS(mSGpTR) (mSGpTR)->ittiMsg.s1ap_downlink_nas #define S1AP_DOWNLINK_NAS(mSGpTR) (mSGpTR)->ittiMsg.s1ap_downlink_nas
#define S1AP_INITIAL_CONTEXT_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.s1ap_initial_context_setup_req #define S1AP_INITIAL_CONTEXT_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.s1ap_initial_context_setup_req
...@@ -646,6 +647,27 @@ typedef struct s1ap_path_switch_req_ack_s { ...@@ -646,6 +647,27 @@ typedef struct s1ap_path_switch_req_ack_s {
} s1ap_path_switch_req_ack_t; } s1ap_path_switch_req_ack_t;
typedef struct s1ap_e_rab_modification_ind_s {
unsigned eNB_ue_s1ap_id:24;
/* MME UE id */
uint32_t mme_ue_s1ap_id;
/* Number of e_rab setup-ed in the list */
uint8_t nb_of_e_rabs_tobemodified;
uint8_t nb_of_e_rabs_nottobemodified;
/* list of e_rab setup-ed by RRC layers */
e_rab_setup_t e_rabs_tobemodified[S1AP_MAX_E_RAB];
e_rab_setup_t e_rabs_nottobemodified[S1AP_MAX_E_RAB];
uint16_t ue_initial_id;
} s1ap_e_rab_modification_ind_t;
// S1AP --> RRC messages // S1AP --> RRC messages
typedef struct s1ap_ue_release_command_s { typedef struct s1ap_ue_release_command_s {
......
...@@ -382,6 +382,7 @@ typedef enum e_rab_satus_e { ...@@ -382,6 +382,7 @@ typedef enum e_rab_satus_e {
E_RAB_STATUS_DONE, // from the eNB perspective E_RAB_STATUS_DONE, // from the eNB perspective
E_RAB_STATUS_ESTABLISHED, // get the reconfigurationcomplete form UE E_RAB_STATUS_ESTABLISHED, // get the reconfigurationcomplete form UE
E_RAB_STATUS_REESTABLISHED, // after HO E_RAB_STATUS_REESTABLISHED, // after HO
E_RAB_STATUS_TOMODIFY, // ENDC NSA
E_RAB_STATUS_FAILED, E_RAB_STATUS_FAILED,
E_RAB_STATUS_TORELEASE // to release DRB between eNB and UE E_RAB_STATUS_TORELEASE // to release DRB between eNB and UE
} e_rab_status_t; } e_rab_status_t;
...@@ -613,6 +614,7 @@ typedef struct eNB_RRC_UE_s { ...@@ -613,6 +614,7 @@ typedef struct eNB_RRC_UE_s {
/* Number of e_rab to be modified in the list */ /* Number of e_rab to be modified in the list */
uint8_t nb_of_modify_e_rabs; uint8_t nb_of_modify_e_rabs;
uint8_t nb_of_failed_e_rabs; uint8_t nb_of_failed_e_rabs;
uint8_t nb_of_modify_endc_e_rabs;
e_rab_param_t modify_e_rab[NB_RB_MAX];//[S1AP_MAX_E_RAB]; e_rab_param_t modify_e_rab[NB_RB_MAX];//[S1AP_MAX_E_RAB];
/* list of e_rab to be setup by RRC layers */ /* list of e_rab to be setup by RRC layers */
e_rab_param_t e_rab[NB_RB_MAX];//[S1AP_MAX_E_RAB]; e_rab_param_t e_rab[NB_RB_MAX];//[S1AP_MAX_E_RAB];
...@@ -627,6 +629,10 @@ typedef struct eNB_RRC_UE_s { ...@@ -627,6 +629,10 @@ typedef struct eNB_RRC_UE_s {
uint32_t enb_gtp_teid[S1AP_MAX_E_RAB]; uint32_t enb_gtp_teid[S1AP_MAX_E_RAB];
transport_layer_addr_t enb_gtp_addrs[S1AP_MAX_E_RAB]; transport_layer_addr_t enb_gtp_addrs[S1AP_MAX_E_RAB];
rb_id_t enb_gtp_ebi[S1AP_MAX_E_RAB]; rb_id_t enb_gtp_ebi[S1AP_MAX_E_RAB];
// LG: For GTPV1 TUNNELS ENDC
uint32_t gnb_gtp_endc_teid[S1AP_MAX_E_RAB];
transport_layer_addr_t gnb_gtp_endc_addrs[S1AP_MAX_E_RAB];
rb_id_t gnb_gtp_endc_ebi[S1AP_MAX_E_RAB];
/* Total number of e_rab already setup in the list */ /* Total number of e_rab already setup in the list */
uint8_t nb_x2u_e_rabs; uint8_t nb_x2u_e_rabs;
// LG: For GTPV1 TUNNELS(X2U) // LG: For GTPV1 TUNNELS(X2U)
......
...@@ -7493,6 +7493,16 @@ rrc_eNB_decode_dcch( ...@@ -7493,6 +7493,16 @@ rrc_eNB_decode_dcch(
} }
ue_context_p->ue_context.reestablishment_xid = -1; ue_context_p->ue_context.reestablishment_xid = -1;
//Looking for a condition to trigger S1AP E-RAB-Modification-indication, based on the reception of RRCConnectionReconfigurationComplete
//including NR specific elements. Not sure if this is the correct one and the correct placement
if(ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.criticalExtensions.choice.rrcConnectionReconfigurationComplete_r8.
nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->
scg_ConfigResponseNR_r15->buf!=NULL){
/*Trigger E-RAB Modification Indication */
rrc_eNB_send_E_RAB_Modification_Indication(ctxt_pP, ue_context_p);
}
} else { } else {
dedicated_DRB = 1; dedicated_DRB = 1;
ue_context_p->ue_context.Status = RRC_RECONFIGURED; ue_context_p->ue_context.Status = RRC_RECONFIGURED;
...@@ -8527,6 +8537,27 @@ void rrc_eNB_process_AdditionResponseInformation(const module_id_t enb_mod_idP, ...@@ -8527,6 +8537,27 @@ void rrc_eNB_process_AdditionResponseInformation(const module_id_t enb_mod_idP,
ue_context = (rrc_eNB_ue_context_t *) get_first_ue_context(RC.rrc[enb_mod_idP]); ue_context = (rrc_eNB_ue_context_t *) get_first_ue_context(RC.rrc[enb_mod_idP]);
ue_context->ue_context.nb_of_modify_endc_e_rabs = m->nb_e_rabs_admitted_tobeadded;
int j=0;
while(j < m->nb_e_rabs_admitted_tobeadded){
for (int e_rab_idx=0; e_rab_idx<ue_context->ue_context.setup_e_rabs; e_rab_idx++){
//Update ue_context information with gNB's address and new GTP tunnel ID
if( ue_context->ue_context.e_rab[e_rab_idx].param.e_rab_id == m->e_rabs_admitted_tobeadded[j].drb_ID){
memcpy(ue_context->ue_context.gnb_gtp_endc_addrs[e_rab_idx].buffer,
m->e_rabs_admitted_tobeadded[j].eNB_addr.buffer,
m->e_rabs_admitted_tobeadded[j].eNB_addr.length);
ue_context->ue_context.gnb_gtp_endc_addrs[e_rab_idx].length = m->e_rabs_admitted_tobeadded[j].eNB_addr.length;
ue_context->ue_context.gnb_gtp_endc_teid[e_rab_idx] = m->e_rabs_admitted_tobeadded[j].gtp_teid;
ue_context->ue_context.e_rab[e_rab_idx].status = E_RAB_STATUS_TOMODIFY;
break;
}
}
j++;
}
PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt,
0, 0,
ENB_FLAG_YES, ENB_FLAG_YES,
......
...@@ -2283,3 +2283,75 @@ int s1ap_ue_context_release(instance_t instance, const uint32_t eNB_ue_s1ap_id) ...@@ -2283,3 +2283,75 @@ int s1ap_ue_context_release(instance_t instance, const uint32_t eNB_ue_s1ap_id)
}*/ }*/
return 0; return 0;
} }
int rrc_eNB_send_E_RAB_Modification_Indication(const protocol_ctxt_t *const ctxt_pP,
rrc_eNB_ue_context_t *const ue_context_pP) {
MessageDef *msg_p = NULL;
int e_rab = 0;
int e_rab_modify_index = 0;
int e_rab_notmodify_index = 0;
rrc_ue_s1ap_ids_t *rrc_ue_s1ap_ids_p = NULL;
hashtable_rc_t h_rc;
uint8_t inde_list[ue_context_pP->ue_context.nb_of_e_rabs];
memset(inde_list, 0, ue_context_pP->ue_context.nb_of_e_rabs*sizeof(uint8_t));
msg_p = itti_alloc_new_message (TASK_RRC_ENB, S1AP_E_RAB_MODIFICATION_IND);
S1AP_E_RAB_MODIFICATION_IND (msg_p).eNB_ue_s1ap_id = ue_context_pP->ue_context.eNB_ue_s1ap_id;
S1AP_E_RAB_MODIFICATION_IND (msg_p).mme_ue_s1ap_id = ue_context_pP->ue_context.mme_ue_s1ap_id;
LOG_I (RRC,"E-RAB modification indication: nb nb_of_e_rabs %u status %u\n",
ue_context_pP->ue_context.nb_of_e_rabs,
ue_context_pP->ue_context.e_rab[e_rab].status);
if (ue_context_pP->ue_context.nb_of_modify_endc_e_rabs > 0){
S1AP_E_RAB_MODIFICATION_IND (msg_p).nb_of_e_rabs_tobemodified = ue_context_pP->ue_context.nb_of_modify_endc_e_rabs;
for (e_rab = 0; e_rab < ue_context_pP->ue_context.setup_e_rabs ; e_rab++) {
//Add E-RAB in the list of E-RABs to be modified
if (ue_context_pP->ue_context.e_rab[e_rab].status == E_RAB_STATUS_TOMODIFY) {
memcpy(S1AP_E_RAB_MODIFICATION_IND (msg_p).e_rabs_tobemodified[e_rab_modify_index].eNB_addr.buffer,
ue_context_pP->ue_context.gnb_gtp_endc_addrs[e_rab].buffer,
ue_context_pP->ue_context.gnb_gtp_endc_addrs[e_rab].length);
S1AP_E_RAB_MODIFICATION_IND (msg_p).e_rabs_tobemodified[e_rab_modify_index].eNB_addr.length = ue_context_pP->ue_context.gnb_gtp_endc_addrs[e_rab].length;
S1AP_E_RAB_MODIFICATION_IND (msg_p).e_rabs_tobemodified[e_rab_modify_index].gtp_teid = ue_context_pP->ue_context.gnb_gtp_endc_teid[e_rab];
e_rab_modify_index++;
}
//Add E-RAB in the list of E-RABs NOT to be modified
else{
memcpy(S1AP_E_RAB_MODIFICATION_IND (msg_p).e_rabs_nottobemodified[e_rab_notmodify_index].eNB_addr.buffer,
ue_context_pP->ue_context.gnb_gtp_endc_addrs[e_rab].buffer,
ue_context_pP->ue_context.gnb_gtp_endc_addrs[e_rab].length);
S1AP_E_RAB_MODIFICATION_IND (msg_p).e_rabs_nottobemodified[e_rab_notmodify_index].eNB_addr.length = ue_context_pP->ue_context.gnb_gtp_endc_addrs[e_rab].length;
S1AP_E_RAB_MODIFICATION_IND (msg_p).e_rabs_nottobemodified[e_rab_notmodify_index].gtp_teid = ue_context_pP->ue_context.gnb_gtp_endc_teid[e_rab];
e_rab_notmodify_index++;
}
}
S1AP_E_RAB_MODIFICATION_IND (msg_p).nb_of_e_rabs_nottobemodified = e_rab_notmodify_index;
}
if (e_rab_modify_index > 0) {
LOG_I(RRC,"S1AP_E_RAB_MODIFICATION_IND: sending the message: nb_of_erabstobemodified %d, total e_rabs %d, index %d\n",
S1AP_E_RAB_MODIFICATION_IND (msg_p).nb_of_e_rabs_tobemodified, ue_context_pP->ue_context.setup_e_rabs, e_rab);
MSC_LOG_TX_MESSAGE(
MSC_RRC_ENB,
MSC_S1AP_ENB,
(const char *)&S1AP_E_RAB_MODIFICATION_IND (msg_p),
sizeof(s1ap_e_rab_modification_ind_t),
MSC_AS_TIME_FMT" E RAB MODIFICATION IND UE %X eNB_ue_s1ap_id %u e_rabs:%u succ",
MSC_AS_TIME_ARGS(ctxt_pP),
ue_context_pP->ue_id_rnti,
S1AP_E_RAB_MODIFICATION_IND (msg_p).eNB_ue_s1ap_id,
e_rab_modify_index);
itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, msg_p);
} else {
itti_free(ITTI_MSG_ORIGIN_ID(msg_p), msg_p);
}
return 0;
}
...@@ -69,7 +69,6 @@ s1ap_eNB_config_t s1ap_config; ...@@ -69,7 +69,6 @@ s1ap_eNB_config_t s1ap_config;
static int s1ap_eNB_generate_s1_setup_request( static int s1ap_eNB_generate_s1_setup_request(
s1ap_eNB_instance_t *instance_p, s1ap_eNB_mme_data_t *s1ap_mme_data_p); s1ap_eNB_instance_t *instance_p, s1ap_eNB_mme_data_t *s1ap_mme_data_p);
void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *s1ap_register_eNB); void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *s1ap_register_eNB);
void s1ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp); void s1ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp);
...@@ -361,6 +360,12 @@ void *s1ap_eNB_process_itti_msg(void *notUsed) { ...@@ -361,6 +360,12 @@ void *s1ap_eNB_process_itti_msg(void *notUsed) {
} }
break; break;
case S1AP_E_RAB_MODIFICATION_IND: {
s1ap_eNB_generate_E_RAB_Modification_Indication(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&S1AP_E_RAB_MODIFICATION_IND(received_msg));
}
break;
case S1AP_UE_CONTEXT_RELEASE_COMPLETE: { case S1AP_UE_CONTEXT_RELEASE_COMPLETE: {
s1ap_ue_context_release_complete(ITTI_MESSAGE_GET_INSTANCE(received_msg), s1ap_ue_context_release_complete(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&S1AP_UE_CONTEXT_RELEASE_COMPLETE(received_msg)); &S1AP_UE_CONTEXT_RELEASE_COMPLETE(received_msg));
...@@ -508,3 +513,7 @@ static int s1ap_eNB_generate_s1_setup_request( ...@@ -508,3 +513,7 @@ static int s1ap_eNB_generate_s1_setup_request(
s1ap_eNB_itti_send_sctp_data_req(instance_p->instance, s1ap_mme_data_p->assoc_id, buffer, len, 0); s1ap_eNB_itti_send_sctp_data_req(instance_p->instance, s1ap_mme_data_p->assoc_id, buffer, len, 0);
return ret; return ret;
} }
...@@ -1620,3 +1620,147 @@ int s1ap_eNB_path_switch_req(instance_t instance, ...@@ -1620,3 +1620,147 @@ int s1ap_eNB_path_switch_req(instance_t instance,
return ret; return ret;
} }
//-----------------------------------------------------------------------------
/*
* eNB generate a S1 E_RAB Modification Indication towards MME
*/
int s1ap_eNB_generate_E_RAB_Modification_Indication(
instance_t instance,
s1ap_e_rab_modification_ind_t *e_rab_modification_ind)
//-----------------------------------------------------------------------------
{
struct s1ap_eNB_ue_context_s *ue_context_p = NULL;
S1AP_S1AP_PDU_t pdu;
S1AP_E_RABModificationIndication_t *out = NULL;
S1AP_E_RABModificationIndicationIEs_t *ie = NULL;
S1AP_E_RABToBeModifiedItemBearerModInd_t *E_RAB_ToBeModifiedItem_BearerModInd = NULL;
S1AP_E_RABToBeModifiedItemBearerModIndIEs_t *E_RAB_ToBeModifiedItem_BearerModInd_IEs = NULL;
S1AP_E_RABNotToBeModifiedItemBearerModInd_t *E_RAB_NotToBeModifiedItem_BearerModInd = NULL;
S1AP_E_RABNotToBeModifiedItemBearerModIndIEs_t *E_RAB_NotToBeModifiedItem_BearerModInd_IEs = NULL;
s1ap_eNB_instance_t *s1ap_eNB_instance_p = NULL;
s1ap_eNB_instance_p = s1ap_eNB_get_instance(instance);
uint8_t *buffer = NULL;
uint32_t len = 0;
int ret = 0;
DevAssert(s1ap_eNB_instance_p != NULL);
DevAssert(e_rab_modification_ind != NULL);
// Currently hardcoded (dummy) values filling the fields of E_RAB_Modification_Indication message. To be substituted
int num_e_rabs_tobemodified = e_rab_modification_ind->nb_of_e_rabs_tobemodified;
int num_e_rabs_nottobemodified = e_rab_modification_ind->nb_of_e_rabs_nottobemodified;
uint32_t CSG_id = 0;
/* Prepare the S1AP message to encode */
memset(&pdu, 0, sizeof(pdu));
pdu.present = S1AP_S1AP_PDU_PR_initiatingMessage;
pdu.choice.initiatingMessage.procedureCode = S1AP_ProcedureCode_id_E_RABModificationIndication;
pdu.choice.initiatingMessage.criticality = S1AP_Criticality_reject;
pdu.choice.initiatingMessage.value.present = S1AP_InitiatingMessage__value_PR_E_RABModificationIndication;
out = &pdu.choice.initiatingMessage.value.choice.E_RABModificationIndication;
/* mandatory */
ie = (S1AP_E_RABModificationIndicationIEs_t *)calloc(1, sizeof(S1AP_E_RABModificationIndicationIEs_t));
ie->id = S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID;
ie->criticality = S1AP_Criticality_reject;
ie->value.present = S1AP_E_RABModificationIndicationIEs__value_PR_MME_UE_S1AP_ID;
ie->value.choice.MME_UE_S1AP_ID = e_rab_modification_ind->mme_ue_s1ap_id;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
ie = (S1AP_E_RABModificationIndicationIEs_t *)calloc(1, sizeof(S1AP_E_RABModificationIndicationIEs_t));
ie->id = S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID;
ie->criticality = S1AP_Criticality_reject;
ie->value.present = S1AP_E_RABModificationIndicationIEs__value_PR_ENB_UE_S1AP_ID;
ie->value.choice.ENB_UE_S1AP_ID = e_rab_modification_ind->eNB_ue_s1ap_id;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
//E-RABs to be modified list
ie = (S1AP_E_RABModificationIndicationIEs_t *)calloc(1, sizeof(S1AP_E_RABModificationIndicationIEs_t));
ie->id = S1AP_ProtocolIE_ID_id_E_RABToBeModifiedListBearerModInd;
ie->criticality = S1AP_Criticality_reject;
ie->value.present = S1AP_E_RABModificationIndicationIEs__value_PR_E_RABToBeModifiedListBearerModInd;
//The following two for-loops here will probably need to change. We should do a different type of search
for(int i=0; i<num_e_rabs_tobemodified; i++){
E_RAB_ToBeModifiedItem_BearerModInd_IEs = (S1AP_E_RABToBeModifiedItemBearerModIndIEs_t *)calloc(1,sizeof(S1AP_E_RABToBeModifiedItemBearerModIndIEs_t));
E_RAB_ToBeModifiedItem_BearerModInd_IEs->id = S1AP_ProtocolIE_ID_id_E_RABToBeModifiedItemBearerModInd;
E_RAB_ToBeModifiedItem_BearerModInd_IEs->criticality = S1AP_Criticality_reject;
E_RAB_ToBeModifiedItem_BearerModInd_IEs->value.present = S1AP_E_RABToBeModifiedItemBearerModIndIEs__value_PR_E_RABToBeModifiedItemBearerModInd;
E_RAB_ToBeModifiedItem_BearerModInd = &E_RAB_ToBeModifiedItem_BearerModInd_IEs->value.choice.E_RABToBeModifiedItemBearerModInd;
{
E_RAB_ToBeModifiedItem_BearerModInd->e_RAB_ID = e_rab_modification_ind->e_rabs_tobemodified[i].e_rab_id;
E_RAB_ToBeModifiedItem_BearerModInd->transportLayerAddress.size = e_rab_modification_ind->e_rabs_tobemodified[i].eNB_addr.length/8;
E_RAB_ToBeModifiedItem_BearerModInd->transportLayerAddress.bits_unused = e_rab_modification_ind->e_rabs_tobemodified[i].eNB_addr.length%8;
E_RAB_ToBeModifiedItem_BearerModInd->transportLayerAddress.buf = calloc(1, E_RAB_ToBeModifiedItem_BearerModInd->transportLayerAddress.size);
memcpy (E_RAB_ToBeModifiedItem_BearerModInd->transportLayerAddress.buf, e_rab_modification_ind->e_rabs_tobemodified[i].eNB_addr.buffer,
E_RAB_ToBeModifiedItem_BearerModInd->transportLayerAddress.size);
INT32_TO_OCTET_STRING(e_rab_modification_ind->e_rabs_tobemodified[i].gtp_teid, &E_RAB_ToBeModifiedItem_BearerModInd->dL_GTP_TEID);
}
ASN_SEQUENCE_ADD(&ie->value.choice.E_RABToBeModifiedListBearerModInd.list, E_RAB_ToBeModifiedItem_BearerModInd_IEs);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
//E-RABs NOT to be modified list
ie = (S1AP_E_RABModificationIndicationIEs_t *)calloc(1, sizeof(S1AP_E_RABModificationIndicationIEs_t));
ie->id = S1AP_ProtocolIE_ID_id_E_RABNotToBeModifiedListBearerModInd;
ie->criticality = S1AP_Criticality_reject;
if(num_e_rabs_nottobemodified > 0) {
ie->value.present = S1AP_E_RABModificationIndicationIEs__value_PR_E_RABNotToBeModifiedListBearerModInd;
for(int i=0; i<num_e_rabs_nottobemodified; i++){
E_RAB_NotToBeModifiedItem_BearerModInd_IEs = (S1AP_E_RABNotToBeModifiedItemBearerModIndIEs_t *)calloc(1,sizeof(S1AP_E_RABNotToBeModifiedItemBearerModIndIEs_t));
E_RAB_NotToBeModifiedItem_BearerModInd_IEs->id = S1AP_ProtocolIE_ID_id_E_RABNotToBeModifiedItemBearerModInd;
E_RAB_NotToBeModifiedItem_BearerModInd_IEs->criticality = S1AP_Criticality_reject;
E_RAB_NotToBeModifiedItem_BearerModInd_IEs->value.present = S1AP_E_RABNotToBeModifiedItemBearerModIndIEs__value_PR_E_RABNotToBeModifiedItemBearerModInd;
E_RAB_NotToBeModifiedItem_BearerModInd = &E_RAB_NotToBeModifiedItem_BearerModInd_IEs->value.choice.E_RABNotToBeModifiedItemBearerModInd;
{
E_RAB_NotToBeModifiedItem_BearerModInd->e_RAB_ID = e_rab_modification_ind->e_rabs_nottobemodified[i].e_rab_id;
E_RAB_NotToBeModifiedItem_BearerModInd->transportLayerAddress.size = e_rab_modification_ind->e_rabs_nottobemodified[i].eNB_addr.length/8;
E_RAB_NotToBeModifiedItem_BearerModInd->transportLayerAddress.bits_unused = e_rab_modification_ind->e_rabs_nottobemodified[i].eNB_addr.length%8;
E_RAB_NotToBeModifiedItem_BearerModInd->transportLayerAddress.buf =
calloc(1, E_RAB_NotToBeModifiedItem_BearerModInd->transportLayerAddress.size);
memcpy (E_RAB_NotToBeModifiedItem_BearerModInd->transportLayerAddress.buf, e_rab_modification_ind->e_rabs_nottobemodified[i].eNB_addr.buffer,
E_RAB_NotToBeModifiedItem_BearerModInd->transportLayerAddress.size);
INT32_TO_OCTET_STRING(e_rab_modification_ind->e_rabs_nottobemodified[i].gtp_teid, &E_RAB_NotToBeModifiedItem_BearerModInd->dL_GTP_TEID);
}
ASN_SEQUENCE_ADD(&ie->value.choice.E_RABNotToBeModifiedListBearerModInd.list, E_RAB_NotToBeModifiedItem_BearerModInd_IEs);
}
}
else
ie->value.present = S1AP_E_RABModificationIndicationIEs__value_PR_NOTHING;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
ie = (S1AP_E_RABModificationIndicationIEs_t *)calloc(1, sizeof(S1AP_E_RABModificationIndicationIEs_t));
ie->id = S1AP_ProtocolIE_ID_id_CSGMembershipInfo;
ie->criticality = S1AP_Criticality_reject;
ie->value.present = S1AP_E_RABModificationIndicationIEs__value_PR_CSGMembershipInfo;
ie->value.choice.CSGMembershipInfo.cSGMembershipStatus = S1AP_CSGMembershipStatus_member;
INT32_TO_BIT_STRING(CSG_id, &ie->value.choice.CSGMembershipInfo.cSG_Id);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
if (s1ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) {
S1AP_ERROR("Failed to encode S1 setup request\n");
return -1;
}
/* Non UE-Associated signalling -> stream = 0 */
s1ap_eNB_itti_send_sctp_data_req(s1ap_eNB_instance_p->instance, ue_context_p->mme_ref->assoc_id, buffer, len, 0);
return ret;
}
...@@ -52,4 +52,8 @@ int s1ap_eNB_e_rab_release_resp(instance_t instance, ...@@ -52,4 +52,8 @@ int s1ap_eNB_e_rab_release_resp(instance_t instance,
int s1ap_eNB_path_switch_req(instance_t instance, int s1ap_eNB_path_switch_req(instance_t instance,
s1ap_path_switch_req_t *path_switch_req_p); s1ap_path_switch_req_t *path_switch_req_p);
int s1ap_eNB_generate_E_RAB_Modification_Indication(
instance_t instance, s1ap_e_rab_modification_ind_t *e_rab_modification_ind);
#endif /* S1AP_ENB_NAS_PROCEDURES_H_ */ #endif /* S1AP_ENB_NAS_PROCEDURES_H_ */
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