Commit c0872533 authored by gauthier's avatar gauthier

test nas non delivery indication

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7290 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent bfc6e0c5
......@@ -54,7 +54,7 @@ MESSAGE_DEF(NAS_CONNECTION_RELEASE_IND, MESSAGE_PRIORITY_MED, nas_conn
MESSAGE_DEF(NAS_UPLINK_DATA_IND, MESSAGE_PRIORITY_MED, nas_ul_data_ind_t, nas_ul_data_ind)
MESSAGE_DEF(NAS_DOWNLINK_DATA_REQ, MESSAGE_PRIORITY_MED, nas_dl_data_req_t, nas_dl_data_req)
MESSAGE_DEF(NAS_DOWNLINK_DATA_CNF, MESSAGE_PRIORITY_MED, nas_dl_data_cnf_t, nas_dl_data_cnf)
MESSAGE_DEF(NAS_NON_DELIVERY_IND, MESSAGE_PRIORITY_MED, nas_non_del_ind_t, nas_non_del_ind)
MESSAGE_DEF(NAS_DOWNLINK_DATA_REJ, MESSAGE_PRIORITY_MED, nas_dl_data_rej_t, nas_dl_data_rej)
MESSAGE_DEF(NAS_RAB_ESTABLISHMENT_REQ, MESSAGE_PRIORITY_MED, nas_rab_est_req_t, nas_rab_est_req)
MESSAGE_DEF(NAS_RAB_ESTABLISHMENT_RESP, MESSAGE_PRIORITY_MED, nas_rab_est_rsp_t, nas_rab_est_rsp)
MESSAGE_DEF(NAS_RAB_RELEASE_REQ, MESSAGE_PRIORITY_MED, nas_rab_rel_req_t, nas_rab_rel_req)
......
......@@ -51,7 +51,7 @@
#define NAS_UL_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.nas_ul_data_ind
#define NAS_DL_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.nas_dl_data_req
#define NAS_DL_DATA_CNF(mSGpTR) (mSGpTR)->ittiMsg.nas_dl_data_cnf
#define NAS_DL_DATA_REJ(mSGpTR) (mSGpTR)->ittiMsg.nas_non_del_ind
#define NAS_DL_DATA_REJ(mSGpTR) (mSGpTR)->ittiMsg.nas_dl_data_rej
#define NAS_PDN_CONNECTIVITY_REQ(mSGpTR) (mSGpTR)->ittiMsg.nas_pdn_connectivity_req
#define NAS_PDN_CONNECTIVITY_RSP(mSGpTR) (mSGpTR)->ittiMsg.nas_pdn_connectivity_rsp
#define NAS_PDN_CONNECTIVITY_FAIL(mSGpTR) (mSGpTR)->ittiMsg.nas_pdn_connectivity_fail
......@@ -260,9 +260,10 @@ typedef dl_info_transfer_req_t nas_dl_data_req_t;
typedef dl_info_transfer_cnf_t nas_dl_data_cnf_t;
typedef struct nas_non_del_ind_s {
uint32_t UEid; /* UE lower layer identifier */
} nas_non_del_ind_t;
typedef struct nas_dl_data_rej_s {
uint32_t UEid; /* UE lower layer identifier */
as_nas_info_t nasMsg; /* Uplink NAS message */
} nas_dl_data_rej_t;
typedef struct nas_rab_est_req_s {
......
......@@ -129,7 +129,7 @@ next_message:
nas_proc_dl_transfer_cnf(NAS_DL_DATA_CNF(received_message_p).UEid);
} break;
case NAS_NON_DELIVERY_IND: {
case NAS_DOWNLINK_DATA_REJ: {
nas_proc_dl_transfer_rej(NAS_DL_DATA_REJ(received_message_p).UEid);
} break;
......
......@@ -118,4 +118,33 @@ static inline void s1ap_mme_itti_nas_establish_ind(
itti_send_msg_to_task(TASK_NAS_MME, INSTANCE_DEFAULT, message_p);
}
static inline void s1ap_mme_itti_nas_non_delivery_ind(
const uint32_t ue_id, uint8_t * const nas_msg, const uint32_t nas_msg_length)
{
MessageDef *message_p;
message_p = itti_alloc_new_message(TASK_S1AP, NAS_DOWNLINK_DATA_REJ);
NAS_DL_DATA_REJ(message_p).UEid = ue_id;
/* Mapping between asn1 definition and NAS definition */
//NAS_NON_DELIVERY_IND(message_p).asCause = cause + 1;
NAS_DL_DATA_REJ(message_p).nasMsg.length = nas_msg_length;
NAS_DL_DATA_REJ(message_p).nasMsg.data = malloc(sizeof(uint8_t) * nas_msg_length);
memcpy(NAS_DL_DATA_REJ(message_p).nasMsg.data, nas_msg, nas_msg_length);
MSC_LOG_TX_MESSAGE(
MSC_S1AP_MME,
MSC_NAS_MME,
NULL,0,
"0 NAS_DOWNLINK_DATA_REJ ue_id %u len %u",
ue_id,
NAS_DL_DATA_REJ(message_p).nasMsg.length);
// should be sent to MME_APP, but this one would forward it to NAS_MME, so send it directly to NAS_MME
// but let's see
itti_send_msg_to_task(TASK_NAS_MME, INSTANCE_DEFAULT, message_p);
}
#endif /* S1AP_MME_ITTI_MESSAGING_H_ */
......@@ -200,14 +200,49 @@ int s1ap_mme_handle_uplink_nas_transport(uint32_t assoc_id, uint32_t stream,
int s1ap_mme_handle_nas_non_delivery(uint32_t assoc_id, uint32_t stream,
struct s1ap_message_s *message)
{
S1ap_NASNonDeliveryIndication_IEs_t *nasNonDeliveryIndication_p = NULL;
ue_description_t *ue_ref = NULL;
/* UE associated signalling on stream == 0 is not valid. */
if (stream == 0) {
S1AP_DEBUG("Received new nas non delivery on stream == 0\n");
return -1;
}
nasNonDeliveryIndication_p = &message->msg.s1ap_NASNonDeliveryIndication_IEs;
/*
* S1ap_MME_UE_S1AP_ID_t mme_ue_s1ap_id;
S1ap_ENB_UE_S1AP_ID_t eNB_UE_S1AP_ID;
S1ap_NAS_PDU_t nas_pdu;
S1ap_Cause_t cause;
*/
MSC_LOG_RX_MESSAGE(
MSC_S1AP_MME,
MSC_S1AP_ENB,
NULL,0,
"0 UPLINK_NAS_TRANSPORT mme_ue_s1ap_id %u eNB_ue_s1ap_id %u cause %u nas len %u",
nasNonDeliveryIndication_p->mme_ue_s1ap_id,
nasNonDeliveryIndication_p->eNB_UE_S1AP_ID,
nasNonDeliveryIndication_p->cause,
nasNonDeliveryIndication_p->nas_pdu.size);
if ((ue_ref = s1ap_is_ue_mme_id_in_list(nasNonDeliveryIndication_p->mme_ue_s1ap_id))
== NULL) {
S1AP_DEBUG("No UE is attached to this mme UE s1ap id: %d\n",
(int)nasNonDeliveryIndication_p->mme_ue_s1ap_id);
return -1;
}
if (ue_ref->s1_ue_state != S1AP_UE_CONNECTED) {
S1AP_DEBUG("Received uplink NASNonDeliveryIndication while UE in state != S1AP_UE_CONNECTED\n");
return -1;
}
//TODO: forward NAS PDU to NAS
DevMessage("TODO: forward NAS PDU to NAS\n");
s1ap_mme_itti_nas_non_delivery_ind(
nasNonDeliveryIndication_p->mme_ue_s1ap_id,
nasNonDeliveryIndication_p->nas_pdu.buf,
nasNonDeliveryIndication_p->nas_pdu.size);
return 0;
}
......
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