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(
initial_ue_message_p = &message.msg.s1ap_InitialUEMessageIEs;
/* Select the MME corresponding to the provided GUMMEI.
* If no MME corresponds to the GUMMEI, the function selects the MME with the
* 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) {
/* Select the MME corresponding to the provided GUMMEI. */
if (s1ap_nas_first_req_p->ue_identity.presenceMask & UE_IDENTITIES_gummei) {
mme_desc_p = s1ap_eNB_nnsf_select_mme_by_gummei(
instance_p,
s1ap_nas_first_req_p->establishment_cause,
s1ap_nas_first_req_p->ue_identity.choice.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);
s1ap_nas_first_req_p->ue_identity.gummei);
}
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");
// TODO: Inform RRC
return -1;
......@@ -133,22 +149,23 @@ int s1ap_eNB_handle_nas_first_req(
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;
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;
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);
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);
} else {
}
if (s1ap_nas_first_req_p->ue_identity.presenceMask & UE_IDENTITIES_gummei) {
initial_ue_message_p->presenceMask |= S1AP_INITIALUEMESSAGEIES_GUMMEI_ID_PRESENT;
MCC_MNC_TO_PLMNID(s1ap_nas_first_req_p->ue_identity.choice.gummei.mcc,
s1ap_nas_first_req_p->ue_identity.choice.gummei.mnc,
MCC_MNC_TO_PLMNID(s1ap_nas_first_req_p->ue_identity.gummei.mcc,
s1ap_nas_first_req_p->ue_identity.gummei.mnc,
&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);
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);
}
......@@ -336,6 +353,9 @@ int s1ap_eNB_initial_ctxt_resp(
int ret = -1;
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(s1ap_eNB_instance_p != NULL);
......@@ -415,6 +435,9 @@ int s1ap_eNB_ue_capabilities(instance_t instance,
uint32_t length;
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(s1ap_eNB_instance_p != NULL);
......
......@@ -45,6 +45,57 @@
#include "s1ap_eNB_defs.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 *
s1ap_eNB_nnsf_select_mme_by_mme_code(s1ap_eNB_instance_t *instance_p,
rrc_establishment_cause_t cause,
......@@ -116,7 +167,7 @@ s1ap_eNB_nnsf_select_mme_by_mme_code(s1ap_eNB_instance_t *instance_p,
struct s1ap_eNB_mme_data_s *
s1ap_eNB_nnsf_select_mme_by_gummei(s1ap_eNB_instance_t *instance_p,
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_highest_capacity_p = NULL;
......
......@@ -31,6 +31,10 @@
#ifndef 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*
s1ap_eNB_nnsf_select_mme_by_mme_code(s1ap_eNB_instance_t *instance_p,
rrc_establishment_cause_t cause,
......@@ -39,6 +43,6 @@ s1ap_eNB_nnsf_select_mme_by_mme_code(s1ap_eNB_instance_t *instance_p,
struct s1ap_eNB_mme_data_s*
s1ap_eNB_nnsf_select_mme_by_gummei(s1ap_eNB_instance_t *instance_p,
rrc_establishment_cause_t cause,
gummei_t gummei);
s1ap_gummei_t gummei);
#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 @@
#include "timer_messages_def.h"
// Messages files used between tasks
#include "mac_messages_def.h"
#include "pdcp_messages_def.h"
#include "rrc_messages_def.h"
#include "s1ap_messages_def.h"
#include "sctp_messages_def.h"
#include "x2ap_messages_def.h"
\ No newline at end of file
#include "x2ap_messages_def.h"
......@@ -10,6 +10,8 @@
#include "timer_messages_types.h"
#include "mac_messages_types.h"
#include "pdcp_messages_types.h"
#include "rrc_messages_types.h"
#include "s1ap_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 @@
* 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
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)
// Messages for RRC logging
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_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_UE_EUTRA_CAPABILITY, MESSAGE_PRIORITY_MED_PLUS, RrcUeEutraCapability, rrc_ue_eutra_capability)
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)
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/to PDCP layer
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)
// Messages between NAS and RRC layers
MESSAGE_DEF(NAS_DOWNLINK_DATA_IND, MESSAGE_PRIORITY_MED, NasDlDataInd, nas_dl_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 @@
#ifndef RRC_MESSAGES_TYPES_H_
#define RRC_MESSAGES_TYPES_H_
#include "as_message.h"
//-------------------------------------------------------------------------------------------//
// Messages for RRC logging
#include "BCCH-DL-SCH-Message.h"
#include "DL-CCCH-Message.h"
#include "DL-DCCH-Message.h"
......@@ -15,30 +19,6 @@
#include "UL-CCCH-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 DL_CCCH_Message_t RrcDlCcchMessage;
typedef DL_DCCH_Message_t RrcDlDcchMessage;
......@@ -47,83 +27,19 @@ typedef UL_CCCH_Message_t RrcUlCcchMessage;
typedef UL_DCCH_Message_t RrcUlDcchMessage;
//-------------------------------------------------------------------------------------------//
// Messages from MAC layer
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;
// Defines to access message fields.
#define NAS_DOWNLINK_DATA_IND(mSGpTR) (mSGpTR)->msg.nas_dl_data_ind
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;
#define NAS_UPLINK_DATA_REQ(mSGpTR) (mSGpTR)->msg.nas_ul_data_req
#define NAS_UPLINK_DATA_CNF(mSGpTR) (mSGpTR)->msg.nas_ul_data_cnf
#define NAS_UPLINK_DATA_IND(mSGpTR) (mSGpTR)->msg.nas_ul_data_ind
//-------------------------------------------------------------------------------------------//
// Messages from/to PDCP layer
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;
// Messages between NAS and RRC layers
typedef dl_info_transfer_ind_t NasDlDataInd;
typedef struct {
uint32_t frame;
uint8_t dcch_index;
uint32_t sdu_size;
uint8_t *sdu_p;
uint8_t ue_index;
} RrcDcchDataInd;
typedef ul_info_transfer_req_t NasUlDataReq;
typedef ul_info_transfer_cnf_t NasUlDataCnf;
typedef ul_info_transfer_ind_t NasUlDataInd;
#endif /* RRC_MESSAGES_TYPES_H_ */
......@@ -5,22 +5,28 @@
// Defines to access message fields.
#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_HOME_ENB
};
} cell_type_t;
typedef enum {
typedef enum paging_drx_e {
PAGING_DRX_32 = 0x0,
PAGING_DRX_64 = 0x1,
PAGING_DRX_128 = 0x2,
PAGING_DRX_256 = 0x3,
} paging_drx_t;
typedef struct {
typedef struct net_ip_address_s {
unsigned ipv4:1;
unsigned ipv6:1;
char ipv4_address[16];
......@@ -44,7 +50,7 @@ typedef struct {
* concerns AC11..AC15, ‘mt’ stands for ‘Mobile Terminating’ and ‘mo’ for
* 'Mobile Originating'. Defined in TS 36.331.
*/
typedef enum {
typedef enum rrc_establishment_cause_e {
RRC_CAUSE_EMERGENCY = 0x0,
RRC_CAUSE_HIGH_PRIO_ACCESS = 0x1,
RRC_CAUSE_MT_ACCESS = 0x2,
......@@ -53,40 +59,38 @@ typedef enum {
RRC_CAUSE_LAST
} rrc_establishment_cause_t;
typedef struct {
typedef struct s1ap_gummei_s {
uint16_t mcc;
uint16_t mnc;
uint8_t mme_code;
uint16_t mme_group_id;
} gummei_t;
} s1ap_gummei_t;
typedef struct {
typedef struct s_tmsi_s {
uint8_t mme_code;
uint32_t m_tmsi;
} s_tmsi_t;
typedef enum {
IDENTITY_PR_NOTHING,
IDENTITY_PR_s_tmsi,
IDENTITY_PR_gummei,
} identity_t;
typedef struct {
identity_t present;
union {
s_tmsi_t s_tmsi;
gummei_t gummei;
} choice;
typedef enum ue_identities_presenceMask_e {
UE_IDENTITIES_NONE = 0,
UE_IDENTITIES_s_tmsi = 1 << 1,
UE_IDENTITIES_gummei = 1 << 2,
} ue_identities_presenceMask_t;
typedef struct ue_identity_s {
ue_identities_presenceMask_t presenceMask;
s_tmsi_t s_tmsi;
s1ap_gummei_t gummei;
} ue_identity_t;
typedef struct {
typedef struct nas_pdu_s {
/* Octet string data */
uint8_t *buffer;
/* Length of the octet string */
uint32_t length;
} nas_pdu_t, ue_radio_cap_t;
typedef struct {
typedef struct transport_layer_addr_s {
/* Length of the transport layer address buffer. S1AP layer received a
* bit string<1..160> containing one of the following addresses: ipv4,
* ipv6, or ipv4 and ipv6. The layer doesn't interpret the buffer but
......@@ -96,12 +100,12 @@ typedef struct {
uint8_t buffer[20];
} transport_layer_addr_t;
typedef struct {
typedef struct e_rab_level_qos_parameter_s {
uint8_t qci;
} e_rab_level_qos_parameter_t;
typedef struct {
typedef struct e_rab_s {
/* Unique e_rab_id for the UE. */
uint8_t e_rab_id;
/* Quality of service for this e_rab */
......@@ -114,7 +118,7 @@ typedef struct {
uint32_t gtp_teid;
} e_rab_t;
typedef struct {
typedef struct e_rab_setup_s {
/* Unique e_rab_id for the UE. */
uint8_t e_rab_id;
......@@ -125,14 +129,14 @@ typedef struct {
uint32_t gtp_teid;
} e_rab_setup_t;
typedef struct {
typedef struct e_rab_failed_s {
/* Unique e_rab_id for the UE. */
uint8_t e_rab_id;
/* Cause of the failure */
// cause_t cause;
} e_rab_failed_t;
typedef struct {
typedef struct s1ap_register_eNB_s {
/* Unique eNB_id to identify the eNB within EPC.
* For macro eNB ids this field should be 20 bits long.
* For home eNB ids this field should be 28 bits long.
......@@ -173,7 +177,7 @@ typedef struct {
* The rnti uniquely identifies an UE within a cell. Later the enb_ue_s1ap_id
* will be the unique identifier used between RRC and S1AP.
*/
typedef struct {
typedef struct s1ap_nas_first_req_s {
/* RNTI of the mobile */
uint16_t rnti;
......@@ -189,7 +193,7 @@ typedef struct {
ue_identity_t ue_identity;
} s1ap_nas_first_req_t;
typedef struct {
typedef struct s1ap_uplink_nas_s {
/* Unique UE identifier within an eNB */
unsigned eNB_ue_s1ap_id:24;
......@@ -199,7 +203,7 @@ typedef struct {
typedef s1ap_uplink_nas_t s1ap_downlink_nas_t;
typedef struct {
typedef struct s1ap_initial_context_setup_req_s {
unsigned eNB_ue_s1ap_id:24;
/* Number of e_rab to be setup in the list */
......@@ -208,7 +212,7 @@ typedef struct {
e_rab_t e_rab_param[S1AP_MAX_E_RAB];
} s1ap_initial_context_setup_req_t;
typedef struct {
typedef struct s1ap_initial_context_setup_resp_s {
unsigned eNB_ue_s1ap_id:24;
/* Number of e_rab setup-ed in the list */
......@@ -222,7 +226,7 @@ typedef struct {
e_rab_failed_t e_rabs_failed[S1AP_MAX_E_RAB];
} s1ap_initial_context_setup_resp_t;
typedef struct {
typedef struct s1ap_ue_cap_info_ind_s {
unsigned eNB_ue_s1ap_id:24;
ue_radio_cap_t ue_radio_cap;
} s1ap_ue_cap_info_ind_t;
......
......@@ -119,8 +119,9 @@ uint16_t get_adjacent_cell_id(uint8_t Mod_id,uint8_t index) {
return(two_tier_hexagonal_adjacent_cellIds[Mod_id][index]);
}
/* This only works for the hexagonal topology...need a more general function for other topologies */