Commit 8470aa80 authored by winckel's avatar winckel

RRC:

- Reorganized ITTI messages definition by groups (MAC, PDCP and RRC).
- Added support for some NAS / S1AP messages.

S1AP:
- Corrected MME selection in handle NAS first request.
- Modified some messages definition.

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4429 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent eb10ef75
...@@ -76,24 +76,40 @@ int s1ap_eNB_handle_nas_first_req( ...@@ -76,24 +76,40 @@ int s1ap_eNB_handle_nas_first_req(
initial_ue_message_p = &message.msg.s1ap_InitialUEMessageIEs; initial_ue_message_p = &message.msg.s1ap_InitialUEMessageIEs;
/* Select the MME corresponding to the provided GUMMEI. /* Select the MME corresponding to the provided GUMMEI. */
* If no MME corresponds to the GUMMEI, the function selects the MME with the if (s1ap_nas_first_req_p->ue_identity.presenceMask & UE_IDENTITIES_gummei) {
* highest capacity.
* In case eNB has no MME associated, the eNB should inform RRC and discard
* this request.
*/
if (s1ap_nas_first_req_p->ue_identity.present == IDENTITY_PR_gummei) {
mme_desc_p = s1ap_eNB_nnsf_select_mme_by_gummei( mme_desc_p = s1ap_eNB_nnsf_select_mme_by_gummei(
instance_p, instance_p,
s1ap_nas_first_req_p->establishment_cause, s1ap_nas_first_req_p->establishment_cause,
s1ap_nas_first_req_p->ue_identity.choice.gummei); s1ap_nas_first_req_p->ue_identity.gummei);
} else {
mme_desc_p = s1ap_eNB_nnsf_select_mme_by_mme_code(
instance_p,
s1ap_nas_first_req_p->establishment_cause,
s1ap_nas_first_req_p->ue_identity.choice.s_tmsi.mme_code);
} }
if (mme_desc_p == NULL) { if (mme_desc_p == NULL) {
/* Select the MME corresponding to the provided s-TMSI. */
if (s1ap_nas_first_req_p->ue_identity.presenceMask & UE_IDENTITIES_s_tmsi) {
mme_desc_p = s1ap_eNB_nnsf_select_mme_by_mme_code(
instance_p,
s1ap_nas_first_req_p->establishment_cause,
s1ap_nas_first_req_p->ue_identity.s_tmsi.mme_code);
}
}
if (mme_desc_p == NULL) {
/*
* If no MME corresponds to the GUMMEI or the s-TMSI, selects the MME with the
* highest capacity.
*/
mme_desc_p = s1ap_eNB_nnsf_select_mme(
instance_p,
s1ap_nas_first_req_p->establishment_cause);
}
if (mme_desc_p == NULL) {
/*
* In case eNB has no MME associated, the eNB should inform RRC and discard
* this request.
*/
S1AP_WARN("No MME is associated to the eNB\n"); S1AP_WARN("No MME is associated to the eNB\n");
// TODO: Inform RRC // TODO: Inform RRC
return -1; return -1;
...@@ -133,22 +149,23 @@ int s1ap_eNB_handle_nas_first_req( ...@@ -133,22 +149,23 @@ int s1ap_eNB_handle_nas_first_req(
s1ap_nas_first_req_p->establishment_cause, RRC_CAUSE_LAST, 0); s1ap_nas_first_req_p->establishment_cause, RRC_CAUSE_LAST, 0);
initial_ue_message_p->rrC_Establishment_Cause = s1ap_nas_first_req_p->establishment_cause; initial_ue_message_p->rrC_Establishment_Cause = s1ap_nas_first_req_p->establishment_cause;
if (s1ap_nas_first_req_p->ue_identity.present == IDENTITY_PR_gummei) { if (s1ap_nas_first_req_p->ue_identity.presenceMask & UE_IDENTITIES_s_tmsi) {
initial_ue_message_p->presenceMask |= S1AP_INITIALUEMESSAGEIES_S_TMSI_PRESENT; initial_ue_message_p->presenceMask |= S1AP_INITIALUEMESSAGEIES_S_TMSI_PRESENT;
MME_CODE_TO_OCTET_STRING(s1ap_nas_first_req_p->ue_identity.choice.s_tmsi.mme_code, MME_CODE_TO_OCTET_STRING(s1ap_nas_first_req_p->ue_identity.s_tmsi.mme_code,
&initial_ue_message_p->s_tmsi.mMEC); &initial_ue_message_p->s_tmsi.mMEC);
M_TMSI_TO_OCTET_STRING(s1ap_nas_first_req_p->ue_identity.choice.s_tmsi.m_tmsi, M_TMSI_TO_OCTET_STRING(s1ap_nas_first_req_p->ue_identity.s_tmsi.m_tmsi,
&initial_ue_message_p->s_tmsi.m_TMSI); &initial_ue_message_p->s_tmsi.m_TMSI);
} else { }
if (s1ap_nas_first_req_p->ue_identity.presenceMask & UE_IDENTITIES_gummei) {
initial_ue_message_p->presenceMask |= S1AP_INITIALUEMESSAGEIES_GUMMEI_ID_PRESENT; initial_ue_message_p->presenceMask |= S1AP_INITIALUEMESSAGEIES_GUMMEI_ID_PRESENT;
MCC_MNC_TO_PLMNID(s1ap_nas_first_req_p->ue_identity.choice.gummei.mcc, MCC_MNC_TO_PLMNID(s1ap_nas_first_req_p->ue_identity.gummei.mcc,
s1ap_nas_first_req_p->ue_identity.choice.gummei.mnc, s1ap_nas_first_req_p->ue_identity.gummei.mnc,
&initial_ue_message_p->gummei_id.pLMN_Identity); &initial_ue_message_p->gummei_id.pLMN_Identity);
MME_GID_TO_OCTET_STRING(s1ap_nas_first_req_p->ue_identity.choice.gummei.mme_group_id, MME_GID_TO_OCTET_STRING(s1ap_nas_first_req_p->ue_identity.gummei.mme_group_id,
&initial_ue_message_p->gummei_id.mME_Group_ID); &initial_ue_message_p->gummei_id.mME_Group_ID);
MME_CODE_TO_OCTET_STRING(s1ap_nas_first_req_p->ue_identity.choice.gummei.mme_code, MME_CODE_TO_OCTET_STRING(s1ap_nas_first_req_p->ue_identity.gummei.mme_code,
&initial_ue_message_p->gummei_id.mME_Code); &initial_ue_message_p->gummei_id.mME_Code);
} }
...@@ -336,6 +353,9 @@ int s1ap_eNB_initial_ctxt_resp( ...@@ -336,6 +353,9 @@ int s1ap_eNB_initial_ctxt_resp(
int ret = -1; int ret = -1;
int i; int i;
/* Retrieve the S1AP eNB instance associated with Mod_id */
s1ap_eNB_instance_p = s1ap_eNB_get_instance(instance);
DevAssert(initial_ctxt_resp_p != NULL); DevAssert(initial_ctxt_resp_p != NULL);
DevAssert(s1ap_eNB_instance_p != NULL); DevAssert(s1ap_eNB_instance_p != NULL);
...@@ -415,6 +435,9 @@ int s1ap_eNB_ue_capabilities(instance_t instance, ...@@ -415,6 +435,9 @@ int s1ap_eNB_ue_capabilities(instance_t instance,
uint32_t length; uint32_t length;
int ret = -1; int ret = -1;
/* Retrieve the S1AP eNB instance associated with Mod_id */
s1ap_eNB_instance_p = s1ap_eNB_get_instance(instance);
DevAssert(ue_cap_info_ind_p != NULL); DevAssert(ue_cap_info_ind_p != NULL);
DevAssert(s1ap_eNB_instance_p != NULL); DevAssert(s1ap_eNB_instance_p != NULL);
......
...@@ -45,6 +45,57 @@ ...@@ -45,6 +45,57 @@
#include "s1ap_eNB_defs.h" #include "s1ap_eNB_defs.h"
#include "s1ap_eNB_nnsf.h" #include "s1ap_eNB_nnsf.h"
struct s1ap_eNB_mme_data_s *
s1ap_eNB_nnsf_select_mme(s1ap_eNB_instance_t *instance_p,
rrc_establishment_cause_t cause)
{
struct s1ap_eNB_mme_data_s *mme_data_p = NULL;
struct s1ap_eNB_mme_data_s *mme_highest_capacity_p = NULL;
uint8_t current_capacity = 0;
RB_FOREACH(mme_data_p, s1ap_mme_map, &instance_p->s1ap_mme_head) {
struct served_gummei_s *gummei_p = NULL;
if (mme_data_p->state != S1AP_ENB_STATE_CONNECTED) {
/* The association between MME and eNB is not ready for the moment,
* go to the next known MME.
*/
if (mme_data_p->state == S1AP_ENB_OVERLOAD) {
/* MME is overloaded. We have to check the RRC establishment
* cause and take decision to the select this MME depending on
* the overload state.
*/
if ((cause == RRC_CAUSE_MO_DATA)
&& (mme_data_p->overload_state == S1AP_OVERLOAD_REJECT_MO_DATA)) {
continue;
}
if ((mme_data_p->overload_state == S1AP_OVERLOAD_REJECT_ALL_SIGNALLING)
&& ((cause == RRC_CAUSE_MO_SIGNALLING) || (cause == RRC_CAUSE_MO_DATA))) {
continue;
}
if ((mme_data_p->overload_state == S1AP_OVERLOAD_ONLY_EMERGENCY_AND_MT)
&& ((cause == RRC_CAUSE_MO_SIGNALLING) || (cause == RRC_CAUSE_MO_DATA)
|| (cause == RRC_CAUSE_HIGH_PRIO_ACCESS))) {
continue;
}
/* At this point, the RRC establishment can be handled by the MME
* even if it is in overload state.
*/
} else {
/* The MME is not overloaded, association is simply not ready. */
continue;
}
}
if (current_capacity < mme_data_p->relative_mme_capacity) {
/* We find a better MME, keep a reference to it */
current_capacity = mme_data_p->relative_mme_capacity;
mme_highest_capacity_p = mme_data_p;
}
}
return mme_highest_capacity_p;
}
struct s1ap_eNB_mme_data_s * struct s1ap_eNB_mme_data_s *
s1ap_eNB_nnsf_select_mme_by_mme_code(s1ap_eNB_instance_t *instance_p, s1ap_eNB_nnsf_select_mme_by_mme_code(s1ap_eNB_instance_t *instance_p,
rrc_establishment_cause_t cause, rrc_establishment_cause_t cause,
...@@ -116,7 +167,7 @@ s1ap_eNB_nnsf_select_mme_by_mme_code(s1ap_eNB_instance_t *instance_p, ...@@ -116,7 +167,7 @@ s1ap_eNB_nnsf_select_mme_by_mme_code(s1ap_eNB_instance_t *instance_p,
struct s1ap_eNB_mme_data_s * struct s1ap_eNB_mme_data_s *
s1ap_eNB_nnsf_select_mme_by_gummei(s1ap_eNB_instance_t *instance_p, s1ap_eNB_nnsf_select_mme_by_gummei(s1ap_eNB_instance_t *instance_p,
rrc_establishment_cause_t cause, rrc_establishment_cause_t cause,
gummei_t gummei) s1ap_gummei_t gummei)
{ {
struct s1ap_eNB_mme_data_s *mme_data_p = NULL; struct s1ap_eNB_mme_data_s *mme_data_p = NULL;
struct s1ap_eNB_mme_data_s *mme_highest_capacity_p = NULL; struct s1ap_eNB_mme_data_s *mme_highest_capacity_p = NULL;
......
...@@ -31,6 +31,10 @@ ...@@ -31,6 +31,10 @@
#ifndef S1AP_ENB_NNSF_H_ #ifndef S1AP_ENB_NNSF_H_
#define S1AP_ENB_NNSF_H_ #define S1AP_ENB_NNSF_H_
struct s1ap_eNB_mme_data_s *
s1ap_eNB_nnsf_select_mme(s1ap_eNB_instance_t *instance_p,
rrc_establishment_cause_t cause);
struct s1ap_eNB_mme_data_s* struct s1ap_eNB_mme_data_s*
s1ap_eNB_nnsf_select_mme_by_mme_code(s1ap_eNB_instance_t *instance_p, s1ap_eNB_nnsf_select_mme_by_mme_code(s1ap_eNB_instance_t *instance_p,
rrc_establishment_cause_t cause, rrc_establishment_cause_t cause,
...@@ -39,6 +43,6 @@ s1ap_eNB_nnsf_select_mme_by_mme_code(s1ap_eNB_instance_t *instance_p, ...@@ -39,6 +43,6 @@ s1ap_eNB_nnsf_select_mme_by_mme_code(s1ap_eNB_instance_t *instance_p,
struct s1ap_eNB_mme_data_s* struct s1ap_eNB_mme_data_s*
s1ap_eNB_nnsf_select_mme_by_gummei(s1ap_eNB_instance_t *instance_p, s1ap_eNB_nnsf_select_mme_by_gummei(s1ap_eNB_instance_t *instance_p,
rrc_establishment_cause_t cause, rrc_establishment_cause_t cause,
gummei_t gummei); s1ap_gummei_t gummei);
#endif /* S1AP_ENB_NNSF_H_ */ #endif /* S1AP_ENB_NNSF_H_ */
/*
* mac_messages_def.h
*
* Created on: Oct 24, 2013
* Author: winckel
*/
//-------------------------------------------------------------------------------------------//
// Messages between RRC and MAC layers
MESSAGE_DEF(RRC_MAC_IN_SYNC_IND, MESSAGE_PRIORITY_MED_PLUS, RrcMacInSyncInd, rrc_mac_in_sync_ind)
MESSAGE_DEF(RRC_MAC_OUT_OF_SYNC_IND, MESSAGE_PRIORITY_MED_PLUS, RrcMacOutOfSyncInd, rrc_mac_out_of_sync_ind)
MESSAGE_DEF(RRC_MAC_BCCH_DATA_REQ, MESSAGE_PRIORITY_MED_PLUS, RrcMacBcchDataReq, rrc_mac_bcch_data_req)
MESSAGE_DEF(RRC_MAC_BCCH_DATA_IND, MESSAGE_PRIORITY_MED_PLUS, RrcMacBcchDataInd, rrc_mac_bcch_data_ind)
MESSAGE_DEF(RRC_MAC_CCCH_DATA_REQ, MESSAGE_PRIORITY_MED_PLUS, RrcMacCcchDataReq, rrc_mac_ccch_data_req)
MESSAGE_DEF(RRC_MAC_CCCH_DATA_CNF, MESSAGE_PRIORITY_MED_PLUS, RrcMacCcchDataCnf, rrc_mac_ccch_data_cnf)
MESSAGE_DEF(RRC_MAC_CCCH_DATA_IND, MESSAGE_PRIORITY_MED_PLUS, RrcMacCcchDataInd, rrc_mac_ccch_data_ind)
MESSAGE_DEF(RRC_MAC_MCCH_DATA_REQ, MESSAGE_PRIORITY_MED_PLUS, RrcMacMcchDataReq, rrc_mac_mcch_data_req)
MESSAGE_DEF(RRC_MAC_MCCH_DATA_IND, MESSAGE_PRIORITY_MED_PLUS, RrcMacMcchDataInd, rrc_mac_mcch_data_ind)
/*
* mac_messages_types.h
*
* Created on: Oct 24, 2013
* Author: winckel
*/
#ifndef MAC_MESSAGES_TYPES_H_
#define MAC_MESSAGES_TYPES_H_
//-------------------------------------------------------------------------------------------//
// Defines to access message fields.
#define RRC_MAC_IN_SYNC_IND(mSGpTR) (mSGpTR)->msg.rrc_mac_in_sync_ind
#define RRC_MAC_OUT_OF_SYNC_IND(mSGpTR) (mSGpTR)->msg.rrc_mac_out_of_sync_ind
#define RRC_MAC_BCCH_DATA_REQ(mSGpTR) (mSGpTR)->msg.rrc_mac_bcch_data_req
#define RRC_MAC_BCCH_DATA_IND(mSGpTR) (mSGpTR)->msg.rrc_mac_bcch_data_ind
#define RRC_MAC_CCCH_DATA_REQ(mSGpTR) (mSGpTR)->msg.rrc_mac_ccch_data_req
#define RRC_MAC_CCCH_DATA_CNF(mSGpTR) (mSGpTR)->msg.rrc_mac_ccch_data_cnf
#define RRC_MAC_CCCH_DATA_IND(mSGpTR) (mSGpTR)->msg.rrc_mac_ccch_data_ind
#define RRC_MAC_MCCH_DATA_REQ(mSGpTR) (mSGpTR)->msg.rrc_mac_mcch_data_req
#define RRC_MAC_MCCH_DATA_IND(mSGpTR) (mSGpTR)->msg.rrc_mac_mcch_data_ind
// Some constants from "LAYER2/MAC/defs.h"
#define BCCH_SDU_SIZE (128)
#define CCCH_SDU_SIZE (128)
#define MCCH_SDU_SIZE (128)
//-------------------------------------------------------------------------------------------//
// Messages between RRC and MAC layers
typedef struct {
uint32_t frame;
uint16_t enb_index;
} RrcMacInSyncInd;
typedef RrcMacInSyncInd RrcMacOutOfSyncInd;
typedef struct {
uint32_t frame;
uint32_t sdu_size;
uint8_t sdu[BCCH_SDU_SIZE];
uint8_t enb_index;
} RrcMacBcchDataReq;
typedef struct {
uint32_t frame;
uint32_t sdu_size;
uint8_t sdu[BCCH_SDU_SIZE];
uint8_t enb_index;
} RrcMacBcchDataInd;
typedef struct {
uint32_t frame;
uint32_t sdu_size;
uint8_t sdu[CCCH_SDU_SIZE];
uint8_t enb_index;
} RrcMacCcchDataReq;
typedef struct {
uint8_t enb_index;
} RrcMacCcchDataCnf;
typedef struct {
uint32_t frame;
uint32_t sdu_size;
uint8_t sdu[CCCH_SDU_SIZE];
uint8_t enb_index;
} RrcMacCcchDataInd;
typedef struct {
uint32_t frame;
uint32_t sdu_size;
uint8_t sdu[MCCH_SDU_SIZE];
uint8_t enb_index;
uint8_t mbsfn_sync_area;
} RrcMacMcchDataReq;
typedef struct {
uint32_t frame;
uint32_t sdu_size;
uint8_t sdu[MCCH_SDU_SIZE];
uint8_t enb_index;
uint8_t mbsfn_sync_area;
} RrcMacMcchDataInd;
#endif /* MAC_MESSAGES_TYPES_H_ */
...@@ -3,7 +3,9 @@ ...@@ -3,7 +3,9 @@
#include "timer_messages_def.h" #include "timer_messages_def.h"
// Messages files used between tasks // Messages files used between tasks
#include "mac_messages_def.h"
#include "pdcp_messages_def.h"
#include "rrc_messages_def.h" #include "rrc_messages_def.h"
#include "s1ap_messages_def.h" #include "s1ap_messages_def.h"
#include "sctp_messages_def.h" #include "sctp_messages_def.h"
#include "x2ap_messages_def.h" #include "x2ap_messages_def.h"
\ No newline at end of file
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
#include "timer_messages_types.h" #include "timer_messages_types.h"
#include "mac_messages_types.h"
#include "pdcp_messages_types.h"
#include "rrc_messages_types.h" #include "rrc_messages_types.h"
#include "s1ap_messages_types.h" #include "s1ap_messages_types.h"
#include "sctp_messages_types.h" #include "sctp_messages_types.h"
......
/*
* pdcp_messages_def.h
*
* Created on: Oct 24, 2013
* Author: winckel
*/
//-------------------------------------------------------------------------------------------//
// Messages between RRC and PDCP layers
MESSAGE_DEF(RRC_DCCH_DATA_REQ, MESSAGE_PRIORITY_MED_PLUS, RrcDcchDataReq, rrc_dcch_data_req)
MESSAGE_DEF(RRC_DCCH_DATA_IND, MESSAGE_PRIORITY_MED_PLUS, RrcDcchDataInd, rrc_dcch_data_ind)
/*
* pdcp_messages_types.h
*
* Created on: Oct 24, 2013
* Author: winckel
*/
#ifndef PDCP_MESSAGES_TYPES_H_
#define PDCP_MESSAGES_TYPES_H_
//-------------------------------------------------------------------------------------------//
// Defines to access message fields.
#define RRC_DCCH_DATA_REQ(mSGpTR) (mSGpTR)->msg.rrc_dcch_data_req
#define RRC_DCCH_DATA_IND(mSGpTR) (mSGpTR)->msg.rrc_dcch_data_ind
//-------------------------------------------------------------------------------------------//
// Messages between RRC and PDCP layers
typedef struct {
uint32_t frame;
uint8_t enb_flag;
uint32_t rb_id;
uint32_t muip;
uint32_t confirmp;
uint32_t sdu_size;
uint8_t *sdu_p;
uint8_t mode;
} RrcDcchDataReq;
typedef struct {
uint32_t frame;
uint8_t dcch_index;
uint32_t sdu_size;
uint8_t *sdu_p;
uint8_t ue_index;
} RrcDcchDataInd;
#endif /* PDCP_MESSAGES_TYPES_H_ */
...@@ -5,29 +5,21 @@ ...@@ -5,29 +5,21 @@
* Author: winckel * Author: winckel
*/ */
MESSAGE_DEF(RRC_DL_BCCH_MESSAGE, MESSAGE_PRIORITY_MED_PLUS, RrcDlBcchMessage, rrc_dl_bcch_message)
MESSAGE_DEF(RRC_DL_CCCH_MESSAGE, MESSAGE_PRIORITY_MED_PLUS, RrcDlCcchMessage, rrc_dl_ccch_message)
MESSAGE_DEF(RRC_DL_DCCH_MESSAGE, MESSAGE_PRIORITY_MED_PLUS, RrcDlDcchMessage, rrc_dl_dcch_message)
MESSAGE_DEF(RRC_UE_EUTRA_CAPABILITY, MESSAGE_PRIORITY_MED_PLUS, RrcUeEutraCapability, rrc_ue_eutra_capability)
MESSAGE_DEF(RRC_UL_CCCH_MESSAGE, MESSAGE_PRIORITY_MED_PLUS, RrcUlCcchMessage, rrc_ul_ccch_message)
MESSAGE_DEF(RRC_UL_DCCH_MESSAGE, MESSAGE_PRIORITY_MED_PLUS, RrcUlDcchMessage, rrc_ul_dcch_message)
//-------------------------------------------------------------------------------------------// //-------------------------------------------------------------------------------------------//
// Messages from MAC layer // Messages for RRC logging
MESSAGE_DEF(RRC_MAC_IN_SYNC_IND, MESSAGE_PRIORITY_MED_PLUS, RrcMacInSyncInd, rrc_mac_in_sync_ind) MESSAGE_DEF(RRC_DL_BCCH_MESSAGE, MESSAGE_PRIORITY_MED_PLUS, RrcDlBcchMessage, rrc_dl_bcch_message)
MESSAGE_DEF(RRC_MAC_OUT_OF_SYNC_IND, MESSAGE_PRIORITY_MED_PLUS, RrcMacOutOfSyncInd, rrc_mac_out_of_sync_ind) MESSAGE_DEF(RRC_DL_CCCH_MESSAGE, MESSAGE_PRIORITY_MED_PLUS, RrcDlCcchMessage, rrc_dl_ccch_message)
MESSAGE_DEF(RRC_DL_DCCH_MESSAGE, MESSAGE_PRIORITY_MED_PLUS, RrcDlDcchMessage, rrc_dl_dcch_message)
MESSAGE_DEF(RRC_MAC_BCCH_DATA_REQ, MESSAGE_PRIORITY_MED_PLUS, RrcMacBcchDataReq, rrc_mac_bcch_data_req)
MESSAGE_DEF(RRC_MAC_BCCH_DATA_IND, MESSAGE_PRIORITY_MED_PLUS, RrcMacBcchDataInd, rrc_mac_bcch_data_ind)
MESSAGE_DEF(RRC_MAC_CCCH_DATA_REQ, MESSAGE_PRIORITY_MED_PLUS, RrcMacCcchDataReq, rrc_mac_ccch_data_req) MESSAGE_DEF(RRC_UE_EUTRA_CAPABILITY, MESSAGE_PRIORITY_MED_PLUS, RrcUeEutraCapability, rrc_ue_eutra_capability)
MESSAGE_DEF(RRC_MAC_CCCH_DATA_CNF, MESSAGE_PRIORITY_MED_PLUS, RrcMacCcchDataCnf, rrc_mac_ccch_data_cnf)
MESSAGE_DEF(RRC_MAC_CCCH_DATA_IND, MESSAGE_PRIORITY_MED_PLUS, RrcMacCcchDataInd, rrc_mac_ccch_data_ind)
MESSAGE_DEF(RRC_MAC_MCCH_DATA_REQ, MESSAGE_PRIORITY_MED_PLUS, RrcMacMcchDataReq, rrc_mac_mcch_data_req) MESSAGE_DEF(RRC_UL_CCCH_MESSAGE, MESSAGE_PRIORITY_MED_PLUS, RrcUlCcchMessage, rrc_ul_ccch_message)
MESSAGE_DEF(RRC_MAC_MCCH_DATA_IND, MESSAGE_PRIORITY_MED_PLUS, RrcMacMcchDataInd, rrc_mac_mcch_data_ind) MESSAGE_DEF(RRC_UL_DCCH_MESSAGE, MESSAGE_PRIORITY_MED_PLUS, RrcUlDcchMessage, rrc_ul_dcch_message)
//-------------------------------------------------------------------------------------------// //-------------------------------------------------------------------------------------------//
// Messages from/to PDCP layer // Messages between NAS and RRC layers
MESSAGE_DEF(RRC_DCCH_DATA_REQ, MESSAGE_PRIORITY_MED_PLUS, RrcDcchDataReq, rrc_dcch_data_req) MESSAGE_DEF(NAS_DOWNLINK_DATA_IND, MESSAGE_PRIORITY_MED, NasDlDataInd, nas_dl_data_ind)
MESSAGE_DEF(RRC_DCCH_DATA_IND, MESSAGE_PRIORITY_MED_PLUS, RrcDcchDataInd, rrc_dcch_data_ind)
MESSAGE_DEF(NAS_UPLINK_DATA_REQ, MESSAGE_PRIORITY_MED, NasUlDataReq, nas_ul_data_req)
MESSAGE_DEF(NAS_UPLINK_DATA_CNF, MESSAGE_PRIORITY_MED, NasUlDataCnf, nas_ul_data_cnf)
MESSAGE_DEF(NAS_UPLINK_DATA_IND, MESSAGE_PRIORITY_MED, NasUlDataInd, nas_ul_data_ind)
...@@ -8,6 +8,10 @@ ...@@ -8,6 +8,10 @@
#ifndef RRC_MESSAGES_TYPES_H_ #ifndef RRC_MESSAGES_TYPES_H_
#define RRC_MESSAGES_TYPES_H_ #define RRC_MESSAGES_TYPES_H_
#include "as_message.h"
//-------------------------------------------------------------------------------------------//
// Messages for RRC logging
#include "BCCH-DL-SCH-Message.h" #include "BCCH-DL-SCH-Message.h"
#include "DL-CCCH-Message.h" #include "DL-CCCH-Message.h"
#include "DL-DCCH-Message.h" #include "DL-DCCH-Message.h"
...@@ -15,30 +19,6 @@ ...@@ -15,30 +19,6 @@
#include "UL-CCCH-Message.h" #include "UL-CCCH-Message.h"
#include "UL-DCCH-Message.h" #include "UL-DCCH-Message.h"
//-------------------------------------------------------------------------------------------//
// Defines to access message fields.
#define RRC_MAC_IN_SYNC_IND(mSGpTR) (mSGpTR)->msg.rrc_mac_in_sync_ind
#define RRC_MAC_OUT_OF_SYNC_IND(mSGpTR) (mSGpTR)->msg.rrc_mac_out_of_sync_ind
#define RRC_MAC_BCCH_DATA_REQ(mSGpTR) (mSGpTR)->msg.rrc_mac_bcch_data_req
#define RRC_MAC_BCCH_DATA_IND(mSGpTR) (mSGpTR)->msg.rrc_mac_bcch_data_ind
#define RRC_MAC_CCCH_DATA_REQ(mSGpTR) (mSGpTR)->msg.rrc_mac_ccch_data_req
#define RRC_MAC_CCCH_DATA_CNF(mSGpTR) (mSGpTR)->msg.rrc_mac_ccch_data_cnf
#define RRC_MAC_CCCH_DATA_IND(mSGpTR) (mSGpTR)->msg.rrc_mac_ccch_data_ind
#define RRC_MAC_MCCH_DATA_REQ(mSGpTR) (mSGpTR)->msg.rrc_mac_mcch_data_req
#define RRC_MAC_MCCH_DATA_IND(mSGpTR) (mSGpTR)->msg.rrc_mac_mcch_data_ind
#define RRC_DCCH_DATA_REQ(mSGpTR) (mSGpTR)->msg.rrc_dcch_data_req
#define RRC_DCCH_DATA_IND(mSGpTR) (mSGpTR)->msg.rrc_dcch_data_ind
// Some constants from "LAYER2/MAC/defs.h"
#define BCCH_SDU_SIZE (128)
#define CCCH_SDU_SIZE (128)
#define MCCH_SDU_SIZE (128)
typedef BCCH_DL_SCH_Message_t RrcDlBcchMessage; typedef BCCH_DL_SCH_Message_t RrcDlBcchMessage;
typedef DL_CCCH_Message_t RrcDlCcchMessage; typedef DL_CCCH_Message_t RrcDlCcchMessage;
typedef DL_DCCH_Message_t RrcDlDcchMessage; typedef DL_DCCH_Message_t RrcDlDcchMessage;
...@@ -47,83 +27,19 @@ typedef UL_CCCH_Message_t RrcUlCcchMessage; ...@@ -47,83 +27,19 @@ typedef UL_CCCH_Message_t RrcUlCcchMessage;
typedef UL_DCCH_Message_t RrcUlDcchMessage; typedef UL_DCCH_Message_t RrcUlDcchMessage;
//-------------------------------------------------------------------------------------------// //-------------------------------------------------------------------------------------------//
// Messages from MAC layer // Defines to access message fields.
#define NAS_DOWNLINK_DATA_IND(mSGpTR) (mSGpTR)->msg.nas_dl_data_ind
typedef struct {
uint32_t frame;
uint16_t enb_index;
} RrcMacInSyncInd;
typedef RrcMacInSyncInd RrcMacOutOfSyncInd;
typedef struct {
uint32_t frame;
uint32_t sdu_size;
uint8_t sdu[BCCH_SDU_SIZE];
uint8_t enb_index;
} RrcMacBcchDataReq;
typedef struct {
uint32_t frame;
uint32_t sdu_size;
uint8_t sdu[BCCH_SDU_SIZE];
uint8_t enb_index;
} RrcMacBcchDataInd;
typedef struct {
uint32_t frame;
uint32_t sdu_size;
uint8_t sdu[CCCH_SDU_SIZE];
uint8_t enb_index;
} RrcMacCcchDataReq;
typedef struct {
uint8_t enb_index;
} RrcMacCcchDataCnf;
typedef struct {
uint32_t frame;
uint32_t sdu_size;
uint8_t sdu[CCCH_SDU_SIZE];
uint8_t enb_index;
} RrcMacCcchDataInd;
typedef struct {
uint32_t frame;
uint32_t sdu_size;
uint8_t sdu[MCCH_SDU_SIZE];
uint8_t enb_index;
uint8_t mbsfn_sync_area;
} RrcMacMcchDataReq;
typedef struct { #define NAS_UPLINK_DATA_REQ(mSGpTR) (mSGpTR)->msg.nas_ul_data_req
uint32_t frame; #define NAS_UPLINK_DATA_CNF(mSGpTR) (mSGpTR)->msg.nas_ul_data_cnf
uint32_t sdu_size; #define NAS_UPLINK_DATA_IND(mSGpTR) (mSGpTR)->msg.nas_ul_data_ind
uint8_t sdu[MCCH_SDU_SIZE];
uint8_t enb_index;
uint8_t mbsfn_sync_area;
} RrcMacMcchDataInd;
//-------------------------------------------------------------------------------------------// //-------------------------------------------------------------------------------------------//
// Messages from/to PDCP layer // Messages between NAS and RRC layers
typedef dl_info_transfer_ind_t NasDlDataInd;
typedef struct {
uint32_t frame;
uint8_t enb_flag;
uint32_t rb_id;
uint32_t muip;
uint32_t confirmp;
uint32_t sdu_size;
uint8_t *sdu_p;
uint8_t mode;
} RrcDcchDataReq;
typedef struct { typedef ul_info_transfer_req_t NasUlDataReq;
uint32_t frame; typedef ul_info_transfer_cnf_t NasUlDataCnf;
uint8_t dcch_index; typedef ul_info_transfer_ind_t NasUlDataInd;
uint32_t sdu_size;
uint8_t *sdu_p;
uint8_t ue_index;
} RrcDcchDataInd;
#endif /* RRC_MESSAGES_TYPES_H_ */ #endif /* RRC_MESSAGES_TYPES_H_ */
...@@ -5,22 +5,28 @@ ...@@ -5,22 +5,28 @@
// Defines to access message fields. // Defines to access message fields.
#define S1AP_NAS_FIRST_REQ(mSGpTR) (mSGpTR)->msg.s1ap_nas_first_req #define S1AP_NAS_FIRST_REQ(mSGpTR) (mSGpTR)->msg.s1ap_nas_first_req
#define S1AP_UPLINK_NAS(mSGpTR) (mSGpTR)->msg.s1ap_uplink_nas
#define S1AP_UE_CAPABILITIES_IND(mSGpTR) (mSGpTR)->msg.s1ap_ue_cap_info_ind
#define S1AP_INITIAL_CONTEXT_SETUP_RESP(mSGpTR) (mSGpTR)->msg.s1ap_initial_context_setup_resp
#define S1AP_DOWNLINK_NAS(mSGpTR) (mSGpTR)->msg.s1ap_downlink_nas
#define S1AP_INITIAL_CONTEXT_SETUP_REQ(mSGpTR) (mSGpTR)->msg.s1ap_initial_context_setup_req
//-------------------------------------------------------------------------------------------// //-------------------------------------------------------------------------------------------//
enum cell_type_e { typedef enum cell_type_e {
CELL_MACRO_ENB, CELL_MACRO_ENB,
CELL_HOME_ENB CELL_HOME_ENB
}; } cell_type_t;
typedef enum { typedef enum paging_drx_e {
PAGING_DRX_32 = 0x0, PAGING_DRX_32 = 0x0,
PAGING_DRX_64 = 0x1, PAGING_DRX_64 = 0x1,
PAGING_DRX_128 = 0x2, PAGING_DRX_128 = 0x2,
PAGING_DRX_256 = 0x3, PAGING_DRX_256 = 0x3,
} paging_drx_t; } paging_drx_t;
typedef struct { typedef struct net_ip_address_s {
unsigned ipv4:1; unsigned ipv4:1;
unsigned ipv6:1; unsigned ipv6:1;
char ipv4_address[16]; char ipv4_address[16];
...@@ -44,7 +50,7 @@ typedef struct { ...@@ -44,7 +50,7 @@ typedef struct {
* concerns AC11..AC15, ‘mt’ stands for ‘Mobile Terminating’ and ‘mo’ for * concerns AC11..AC15, ‘mt’ stands for ‘Mobile Terminating’ and ‘mo’ for
* 'Mobile Originating'. Defined in TS 36.331. * 'Mobile Originating'. Defined in TS 36.331.
*/ */
typedef enum { typedef enum rrc_establishment_cause_e {
RRC_CAUSE_EMERGENCY = 0x0, RRC_CAUSE_EMERGENCY = 0x0,
RRC_CAUSE_HIGH_PRIO_ACCESS = 0x1, RRC_CAUSE_HIGH_PRIO_ACCESS = 0x1,
RRC_CAUSE_MT_ACCESS = 0x2, RRC_CAUSE_MT_ACCESS = 0x2,
...@@ -53,40 +59,38 @@ typedef enum { ...@@ -53,40 +59,38 @@ typedef enum {
RRC_CAUSE_LAST RRC_CAUSE_LAST
} rrc_establishment_cause_t; } rrc_establishment_cause_t;
typedef struct { typedef struct s1ap_gummei_s {
uint16_t mcc; uint16_t mcc;
uint16_t mnc; uint16_t mnc;
uint8_t mme_code; uint8_t mme_code;
uint16_t mme_group_id; uint16_t mme_group_id;
} gummei_t; } s1ap_gummei_t;
typedef struct { typedef struct s_tmsi_s {
uint8_t mme_code; uint8_t mme_code;
uint32_t m_tmsi; uint32_t m_tmsi;
} s_tmsi_t; } s_tmsi_t;
typedef enum { typedef enum ue_identities_presenceMask_e {
IDENTITY_PR_NOTHING, UE_IDENTITIES_NONE = 0,
IDENTITY_PR_s_tmsi, UE_IDENTITIES_s_tmsi = 1 << 1,
IDENTITY_PR_gummei, UE_IDENTITIES_gummei = 1 << 2,
} identity_t; } ue_identities_presenceMask_t;
typedef struct { typedef struct ue_identity_s {
identity_t present; ue_identities_presenceMask_t presenceMask;
union { s_tmsi_t s_tmsi;
s_tmsi_t s_tmsi; s1ap_gummei_t gummei;
gummei_t gummei;
} choice;
} ue_identity_t; } ue_identity_t;
typedef struct {