From a632b032c65390dbd9bb3e6f73e85cb819d72e77 Mon Sep 17 00:00:00 2001
From: Lionel Gauthier <lionel.gauthier@eurecom.fr>
Date: Tue, 10 Dec 2013 15:58:00 +0000
Subject: [PATCH] Add 802.21 in oaisim exe, work in progress.
git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4658 818b1a75-f10b-46b9-bf7c-635c3b92a50f
---
common/utils/Makefile.inc | 9 +-
openair2/COMMON/messages_def.h | 2 +
openair2/COMMON/messages_types.h | 1 +
openair2/COMMON/ral_messages_def.h | 20 ++
openair2/COMMON/ral_messages_types.h | 273 ++++++++++++++++++
openair2/COMMON/tasks_def.h | 4 +
openair2/LAYER2/PDCP_v10.1.0/pdcp.h | 18 +-
openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c | 21 +-
openair2/Makefile | 6 +
openair2/NAS/DRIVER/LITE/Makefile | 2 +-
openair2/NAS/DRIVER/LITE/classifier.c | 195 +++----------
openair2/NAS/DRIVER/LITE/common.c | 18 +-
openair2/NAS/DRIVER/LITE/constant.h | 14 +-
openair2/NAS/DRIVER/LITE/local.h | 10 +-
openair2/NAS/DRIVER/LITE/proto_extern.h | 7 +-
openair2/RRC/LITE/rrc_UE.c | 75 ++++-
openair2/RRM_4_RRC_LITE/Makefile | 37 ++-
openair2/RRM_4_RRC_LITE/src/com/Message.cpp | 4 +-
.../src/com/asn1/Makefile.am.sample | 2 +-
openair2/UTIL/LOG/log.c | 16 +
openair2/UTIL/LOG/log.h | 2 +
.../INTERFACE-802.21/INCLUDE/MIH_C_Types.h | 3 +
targets/PROJECTS/MEDIEVAL/Makefile | 2 +-
targets/PROJECTS/SPECTRA/start_enb.bash | 10 +-
targets/PROJECTS/SPECTRA/start_ue.bash | 5 +-
targets/SIMU/USER/Makefile | 19 +-
targets/SIMU/USER/oaisim_config.c | 46 +--
targets/SIMU/USER/oaisim_functions.c | 128 +++++++-
targets/SIMU/USER/oaisim_functions.h | 2 +
targets/SIMU/USER/oaisim_pad.c | 2 +
30 files changed, 728 insertions(+), 225 deletions(-)
create mode 100755 openair2/COMMON/ral_messages_def.h
create mode 100755 openair2/COMMON/ral_messages_types.h
diff --git a/common/utils/Makefile.inc b/common/utils/Makefile.inc
index 2cc4c690e6..9bf9f18970 100644
--- a/common/utils/Makefile.inc
+++ b/common/utils/Makefile.inc
@@ -6,7 +6,14 @@ ITTI_OBJS += $(ITTI_DIR)/backtrace.o
ITTI_OBJS += $(ITTI_DIR)/signals.o
ITTI_OBJS += $(ITTI_DIR)/timer.o
-UTILS_OBJS = $(ITTI_OBJS)
+
+HASHTABLE_DIR = $(COMMON_UTILS_DIR)/collection/hashtable
+
+HASHTABLE_OBJS = $(HASHTABLE_DIR)/hashtable.o
+HASHTABLE_OBJS += $(HASHTABLE_DIR)/obj_hashtable.o
+
+
+UTILS_OBJS = $(ITTI_OBJS) $(HASHTABLE_OBJS)
UTILS_incl = \
-I$(COMMON_UTILS_DIR) \
diff --git a/openair2/COMMON/messages_def.h b/openair2/COMMON/messages_def.h
index b3a338e603..8a31e6bd3e 100644
--- a/openair2/COMMON/messages_def.h
+++ b/openair2/COMMON/messages_def.h
@@ -9,3 +9,5 @@
#include "s1ap_messages_def.h"
#include "sctp_messages_def.h"
#include "x2ap_messages_def.h"
+#include "ral_messages_def.h"
+
diff --git a/openair2/COMMON/messages_types.h b/openair2/COMMON/messages_types.h
index 581bcab247..dd4b695277 100644
--- a/openair2/COMMON/messages_types.h
+++ b/openair2/COMMON/messages_types.h
@@ -16,5 +16,6 @@
#include "s1ap_messages_types.h"
#include "sctp_messages_types.h"
#include "x2ap_messages_types.h"
+#include "ral_messages_types.h"
#endif /* MESSAGES_TYPES_H_ */
diff --git a/openair2/COMMON/ral_messages_def.h b/openair2/COMMON/ral_messages_def.h
new file mode 100755
index 0000000000..da033b0c6f
--- /dev/null
+++ b/openair2/COMMON/ral_messages_def.h
@@ -0,0 +1,20 @@
+MESSAGE_DEF(RRC_RAL_SYSTEM_CONFIGURATION_IND, MESSAGE_PRIORITY_MED, rrc_ral_system_configuration_ind_t, rrc_ral_system_configuration_ind)
+MESSAGE_DEF(RRC_RAL_SYSTEM_INFORMATION_IND, MESSAGE_PRIORITY_MED, rrc_ral_system_information_ind_t, rrc_ral_system_information_ind)
+
+MESSAGE_DEF(RRC_RAL_SCAN_REQ, MESSAGE_PRIORITY_MED, rrc_ral_scan_req_t, rrc_ral_scan_req)
+MESSAGE_DEF(RRC_RAL_SCAN_CONF, MESSAGE_PRIORITY_MED, rrc_ral_scan_conf_t, rrc_ral_scan_conf)
+
+MESSAGE_DEF(RRC_RAL_CONFIGURE_THRESHOLD_REQ, MESSAGE_PRIORITY_MAX, rrc_ral_configure_threshold_req_t, rrc_ral_configure_threshold_req)
+MESSAGE_DEF(RRC_RAL_CONFIGURE_THRESHOLD_CONF, MESSAGE_PRIORITY_MED, rrc_ral_configure_threshold_conf_t, rrc_ral_configure_threshold_conf)
+MESSAGE_DEF(RRC_RAL_MEASUREMENT_REPORT_IND, MESSAGE_PRIORITY_MAX, rrc_ral_measurement_report_ind_t, rrc_ral_measurement_report_ind)
+
+MESSAGE_DEF(RRC_RAL_CONNECTION_ESTABLISHMENT_REQ, MESSAGE_PRIORITY_MED, rrc_ral_connection_establishment_req_t, rrc_ral_connection_establishment_req)
+MESSAGE_DEF(RRC_RAL_CONNECTION_ESTABLISHMENT_CONF, MESSAGE_PRIORITY_MED, rrc_ral_connection_establishment_conf_t, rrc_ral_connection_establishment_conf)
+MESSAGE_DEF(RRC_RAL_CONNECTION_ESTABLISHMENT_IND, MESSAGE_PRIORITY_MED, rrc_ral_connection_establishment_ind_t, rrc_ral_connection_establishment_ind)
+MESSAGE_DEF(RRC_RAL_CONNECTION_REESTABLISHMENT_IND, MESSAGE_PRIORITY_MED, rrc_ral_connection_reestablishment_ind_t, rrc_ral_connection_reestablishment_ind)
+MESSAGE_DEF(RRC_RAL_CONNECTION_RECONFIGURATION_IND, MESSAGE_PRIORITY_MAX, rrc_ral_connection_reconfiguration_ind_t, rrc_ral_connection_reconfiguration_ind)
+
+MESSAGE_DEF(RRC_RAL_CONNECTION_RELEASE_REQ, MESSAGE_PRIORITY_MED, rrc_ral_connection_release_req_t, rrc_ral_connection_release_req)
+MESSAGE_DEF(RRC_RAL_CONNECTION_RELEASE_CONF, MESSAGE_PRIORITY_MED, rrc_ral_connection_release_conf_t, rrc_ral_connection_release_conf)
+MESSAGE_DEF(RRC_RAL_CONNECTION_RELEASE_IND, MESSAGE_PRIORITY_MED, rrc_ral_connection_release_ind_t, rrc_ral_connection_release_ind)
+
diff --git a/openair2/COMMON/ral_messages_types.h b/openair2/COMMON/ral_messages_types.h
new file mode 100755
index 0000000000..9c040cdb49
--- /dev/null
+++ b/openair2/COMMON/ral_messages_types.h
@@ -0,0 +1,273 @@
+#ifndef RAL_MESSAGES_TYPES_H_
+#define RAL_MESSAGES_TYPES_H_
+#include "asn1_constants.h"
+#include "platform_types.h"
+/* 802.21 mappings with the RRC protocol :
+(Research Report RR-12-265 Mapping of IEEE 802.21 MIH primitives to EPS/LTE protocols March 13 th, 2012, Michelle WETTERWALD, Prof. Christian BONNET )
+LINK EVENTS:
+ Link_Detected System Information
+
+ Link_Up RRC Connection establishment
+ RRC Connection re-establishment
+ RRC Connection reconfiguration
+
+ Link_Down RRC Connection reconfiguration
+ RRC Connection Release
+
+ Link_Parameters_Report Measurement report
+ Link_Going_Down N/A
+ Link_Handover_Imminent N/A
+ Link_Handover_Complete RRC Connection reconfiguration
+ Link_PDU_Transmit_Status N/A
+
+
+LINK COMMANDS:
+ Link_Capability_Discover N/A
+ Link_Event_Subscribe Measurement configuration
+ Link_Event_Unsubscribe Measurement configuration
+ Link_Get_Parameters Measurement configuration
+ Link_Configure_Thresholds Measurement configuration
+ Link_Action / Disconnect RRC Connection Release
+ Link_Action / Low Power N/A
+ Link_Action / Power Down RRC Connection Release
+ Link_Action / Power Up RRC Connection establishment
+*/
+
+#define RRC_RAL_SYSTEM_CONFIGURATION_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_ral_system_configuration_ind
+#define RRC_RAL_SYSTEM_INFORMATION_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_ral_system_information_ind
+
+#define RRC_RAL_CONFIGURE_THRESHOLD_REQ(mSGpTR) (mSGpTR)->ittiMsg.rrc_ral_configure_threshold_req
+#define RRC_RAL_CONFIGURE_THRESHOLD_CONF(mSGpTR) (mSGpTR)->ittiMsg.rrc_ral_configure_threshold_conf
+#define RRC_RAL_MEASUREMENT_REPORT_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_ral_measurement_report_ind
+
+#define RRC_RAL_CONNECTION_ESTABLISHMENT_REQ(mSGpTR) (mSGpTR)->ittiMsg.rrc_ral_connection_establishment_req
+#define RRC_RAL_CONNECTION_ESTABLISHMENT_CONF(mSGpTR) (mSGpTR)->ittiMsg.rrc_ral_connection_establishment_conf
+#define RRC_RAL_CONNECTION_ESTABLISHMENT_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_ral_connection_establishment_ind
+#define RRC_RAL_CONNECTION_REESTABLISHMENT_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_ral_connection_reestablishment_ind
+#define RRC_RAL_CONNECTION_RECONFIGURATION_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_ral_connection_reconfiguration_ind
+
+#define RRC_RAL_CONNECTION_RELEASE_REQ(mSGpTR) (mSGpTR)->ittiMsg.rrc_ral_connection_release_req
+#define RRC_RAL_CONNECTION_RELEASE_CONF(mSGpTR) (mSGpTR)->ittiMsg.rrc_ral_connection_release_conf
+#define RRC_RAL_CONNECTION_RELEASE_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_ral_connection_release_ind
+
+#include "MIH_C_header_codec.h"
+
+typedef MIH_C_TRANSACTION_ID_T ral_transaction_id_t;
+typedef MIH_C_STATUS_T ral_status_t;
+typedef MIH_C_CHOICE_T ral_choice_t;
+typedef MIH_C_CONFIG_STATUS_T ral_config_status_t;
+typedef MIH_C_TH_ACTION_T ral_th_action_t;
+
+
+#define RAL_STATUS_SUCCESS MIH_C_STATUS_SUCCESS
+#define RAL_STATUS_UNSPECIFIED_FAILURE MIH_C_STATUS_UNSPECIFIED_FAILURE
+#define RAL_STATUS_REJECTED MIH_C_STATUS_REJECTED
+#define RAL_STATUS_AUTHORIZATION_FAILURE MIH_C_STATUS_AUTHORIZATION_FAILURE
+#define RAL_STATUS_NETWORK_ERROR MIH_C_STATUS_NETWORK_ERROR
+
+
+#define RAL_3GPP_ADDR_LENGTH MIH_C_3GPP_ADDR_LENGTH
+#define RAL_3GPP2_ADDR_LENGTH MIH_C_3GPP2_ADDR_LENGTH
+#define RAL_OTHER_L2_ADDR_LENGTH MIH_C_OTHER_L2_ADDR_LENGTH
+#define RAL_LINK_SCAN_RSP_LENGTH MIH_C_LINK_SCAN_RSP_LENGTH
+#define RAL_THRESHOLD_LIST_LENGTH MIH_C_THRESHOLD_LIST_LENGTH
+#define RAL_LINK_ADDR_LIST_LENGTH MIH_C_LINK_ADDR_LIST_LENGTH
+#define RAL_QOS_LIST_LENGTH MIH_C_QOS_LIST_LENGTH
+#define RAL_LINK_STATUS_REQ_LIST_LENGTH MIH_C_LINK_STATUS_REQ_LIST_LENGTH
+#define RAL_LINK_CFG_PARAM_LIST_LENGTH MIH_C_LINK_CFG_PARAM_LIST_LENGTH
+
+typedef struct ral_network_id_s { u_int16_t length; u_int8_t val[253];} ral_network_id_t;
+
+typedef struct ral_link_addr_s { u_int16_t length; u_int8_t val[RAL_LINK_ADDR_LIST_LENGTH];} ral_link_addr_t;
+
+typedef struct ral_sig_strength_s {
+ ral_choice_t choice;
+ union {
+ uint8_t dbm;
+ uint8_t percentage;
+ } _union;
+} ral_sig_strength_t;
+#define RAL_SIG_STRENGTH_CHOICE_DBM (ral_choice_t)0
+#define RAL_SIG_STRENGTH_CHOICE_PERCENTAGE (ral_choice_t)1
+
+
+// FOR ENB ONLY
+typedef struct rrc_ral_system_configuration_ind_s {
+ plmn_t plmn_id;
+ unsigned int cell_id:28;
+}rrc_ral_system_configuration_ind_t;
+
+// FOR UE ONLY
+typedef struct rrc_ral_system_information_ind_s {
+ plmn_t plmn_id;
+ unsigned int cell_id:28;
+ uint8_t dbm; // sig strength
+ uint16_t sinr;
+ uint32_t link_data_rate; //the maximum data rate in kb/s
+
+}rrc_ral_system_information_ind_t;
+
+typedef struct ral_link_scan_resp_s {
+ ral_link_addr_t link_addr;
+ ral_network_id_t network_id;
+ ral_sig_strength_t sig_strength;
+} ral_link_scan_resp_t;
+
+typedef struct rrc_ral_scan_req_s {
+ ral_transaction_id_t transaction_id;
+
+}rrc_ral_scan_req_t;
+
+typedef struct rrc_ral_scan_conf_s {
+ ral_transaction_id_t transaction_id;
+#define RAL_MAX_LINK_SCAN_RESP 16
+ uint8_t num_scan_resp;
+ ral_link_scan_resp_t ink_scan_resp[RAL_MAX_LINK_SCAN_RESP];
+}rrc_ral_scan_conf_t;
+
+typedef struct rrc_ral_connection_establishment_req_s{
+ ral_transaction_id_t transaction_id;
+
+}rrc_ral_connection_establishment_req_t;
+
+typedef struct rrc_ral_connection_establishment_conf_s{
+ ral_transaction_id_t transaction_id;
+
+}rrc_ral_connection_establishment_conf_t;
+
+typedef struct rrc_ral_connection_establishment_ind_s {
+ uint16_t ue_id; // may be c-rnti
+}rrc_ral_connection_establishment_ind_t;
+
+
+typedef struct rrc_ral_connection_reestablishment_ind_s {
+ uint16_t ue_id;
+ uint8_t num_drb;
+ rb_id_t drb_id[maxDRB];
+ uint8_t num_srb;
+}rrc_ral_connection_reestablishment_ind_t;
+
+
+typedef struct rrc_ral_connection_reconfiguration_ind_s {
+ uint16_t ue_id;
+}rrc_ral_connection_reconfiguration_ind_t;
+
+
+
+
+#define RAL_ABOVE_THRESHOLD MIH_C_ABOVE_THRESHOLD
+#define RAL_BELOW_THRESHOLD MIH_C_BELOW_THRESHOLD
+typedef struct ral_threshold_s {
+ uint16_t threshold_val;
+ uint8_t threshold_xdir;
+}ral_threshold_t;
+
+
+typedef MIH_C_LINK_PARAM_GEN_T ral_link_param_gen_t;
+#define RAL_LINK_PARAM_GEN_DATA_RATE MIH_C_LINK_PARAM_GEN_DATA_RATE
+#define RAL_LINK_PARAM_GEN_SIGNAL_STRENGTH MIH_C_LINK_PARAM_GEN_SIGNAL_STRENGTH
+#define RAL_LINK_PARAM_GEN_SINR MIH_C_LINK_PARAM_GEN_SINR
+#define RAL_LINK_PARAM_GEN_THROUGHPUT MIH_C_LINK_PARAM_GEN_THROUGHPUT
+#define RAL_LINK_PARAM_GEN_PACKET_ERROR_RATE MIH_C_LINK_PARAM_GEN_PACKET_ERROR_RATE
+
+typedef MIH_C_LINK_PARAM_QOS_T ral_link_param_qos_t;
+
+typedef MIH_C_LINK_PARAM_LTE_T ral_link_param_lte_t;
+#define RAL_LINK_PARAM_LTE_UE_RSRP MIH_C_LINK_PARAM_LTE_UE_RSRP
+#define RAL_LINK_PARAM_LTE_UE_RSRQ MIH_C_LINK_PARAM_LTE_UE_RSRQ
+#define RAL_LINK_PARAM_LTE_UE_CQI MIH_C_LINK_PARAM_LTE_UE_CQI
+#define RAL_LINK_PARAM_LTE_AVAILABLE_BW MIH_C_LINK_PARAM_LTE_AVAILABLE_BW
+#define RAL_LINK_PARAM_LTE_PACKET_DELAY MIH_C_LINK_PARAM_LTE_PACKET_DELAY
+#define RAL_LINK_PARAM_LTE_PACKET_LOSS_RATE MIH_C_LINK_PARAM_LTE_PACKET_LOSS_RATE
+#define RAL_LINK_PARAM_LTE_L2_BUFFER_STATUS MIH_C_LINK_PARAM_LTE_L2_BUFFER_STATUS
+#define RAL_LINK_PARAM_LTE_MOBILE_NODE_CAPABILITIES MIH_C_LINK_PARAM_LTE_MOBILE_NODE_CAPABILITIES
+#define RAL_LINK_PARAM_LTE_EMBMS_CAPABILITY MIH_C_LINK_PARAM_LTE_EMBMS_CAPABILITY
+#define RAL_LINK_PARAM_LTE_JUMBO_FEASIBILITY MIH_C_LINK_PARAM_LTE_JUMBO_FEASIBILITY
+#define RAL_LINK_PARAM_LTE_JUMBO_SETUP_STATUS MIH_C_LINK_PARAM_LTE_JUMBO_SETUP_STATUS
+#define RAL_LINK_PARAM_LTE_NUM_ACTIVE_EMBMS_RECEIVERS_PER_FLOW MIH_C_LINK_PARAM_LTE_NUM_ACTIVE_EMBMS_RECEIVERS_PER_FLOW
+
+#define RAL_LINK_PARAM_TYPE_CHOICE_GEN MIH_C_LINK_PARAM_TYPE_CHOICE_GEN
+#define RAL_LINK_PARAM_TYPE_CHOICE_QOS MIH_C_LINK_PARAM_TYPE_CHOICE_QOS
+#define RAL_LINK_PARAM_TYPE_CHOICE_LTE MIH_C_LINK_PARAM_TYPE_CHOICE_LTE
+
+typedef struct ral_link_param_type_s {
+ ral_choice_t choice;
+ union {
+ ral_link_param_gen_t link_param_gen;
+ ral_link_param_qos_t link_param_qos;
+ ral_link_param_lte_t link_param_lte;
+ } _union;
+} ral_link_param_type_t;
+
+
+typedef struct ral_link_cfg_param_s {
+ ral_link_param_type_t link_param_type;
+ #define RAL_LINK_CFG_PARAM_CHOICE_TIMER_NULL 0
+ #define RAL_LINK_CFG_PARAM_CHOICE_TIMER 1
+ uint8_t union_choice;
+ union {
+ uint8_t null_attr;
+ uint16_t timer_interval; // This timer value (ms) is used to set the interval between periodic reports.
+ } _union;
+ #define RAL_TH_ACTION_SET_NORMAL_THRESHOLD MIH_C_SET_NORMAL_THRESHOLD
+ #define RAL_TH_ACTION_SET_ONE_SHOT_THRESHOLD MIH_C_SET_ONE_SHOT_THRESHOLD
+ #define RAL_TH_ACTION_CANCEL_THRESHOLD MIH_C_CANCEL_THRESHOLD
+ ral_th_action_t th_action; // indicates what action to apply to the listed thresholds.
+ // When “Cancel threshold” is selected and no thresholds are specified, then
+ // all currently configured thresholds for the given LINK_PARAM_TYPE are can-
+ // celled.
+ // When “Cancel threshold” is selected and thresholds are specified only those
+ // configured thresholds for the given LINK_PARAM_TYPE and whose threshold
+ // value match what was specified are cancelled.
+ // With “Set one-shot threshold” the listed thresholds are first set and then
+ // each of the threshold is cancelled as soon as it is crossed for the first
+ // time.
+ uint8_t num_thresholds;
+ #define RAL_LINK_CFG_PARAM_MAX_THRESHOLDS 16
+ ral_threshold_t thresholds[RAL_LINK_CFG_PARAM_MAX_THRESHOLDS];
+} ral_link_cfg_param_t;
+
+
+typedef struct rrc_ral_configure_threshold_req_s {
+ ral_transaction_id_t transaction_id;
+ #define RAL_MAX_LINK_CFG_PARAMS 16
+ uint8_t num_link_cfg_params;
+ ral_link_cfg_param_t link_cfg_params[RAL_MAX_LINK_CFG_PARAMS];
+}rrc_ral_configure_threshold_req_t;
+
+typedef struct ral_link_cfg_status_s {
+ ral_link_param_type_t link_param_type;
+ ral_threshold_t threshold;
+ ral_config_status_t config_status;
+} ral_link_cfg_status_t;
+
+typedef struct rrc_ral_configure_threshold_conf_s {
+ ral_transaction_id_t transaction_id;
+ ral_status_t status;
+ uint8_t num_link_cfg_params;
+ ral_link_cfg_status_t cfg_status[RAL_MAX_LINK_CFG_PARAMS];
+}rrc_ral_configure_threshold_conf_t;
+
+typedef struct rrc_ral_measurement_report_ind_s{
+}rrc_ral_measurement_report_ind_t;
+
+
+typedef struct rrc_ral_connection_release_req_s{
+ ral_transaction_id_t transaction_id;
+ uint16_t ue_id;
+}rrc_ral_connection_release_req_t;
+
+typedef struct rrc_ral_connection_release_conf_s{
+ ral_transaction_id_t transaction_id;
+ uint16_t ue_id;
+}rrc_ral_connection_release_conf_t;
+
+
+typedef struct rrc_ral_connection_release_ind_s{
+ uint16_t ue_id;
+}rrc_ral_connection_release_ind_t;
+
+
+
+
+#endif /* RAL_MESSAGES_TYPES_H_ */
diff --git a/openair2/COMMON/tasks_def.h b/openair2/COMMON/tasks_def.h
index c2d1b29073..b30f91cedf 100644
--- a/openair2/COMMON/tasks_def.h
+++ b/openair2/COMMON/tasks_def.h
@@ -20,6 +20,9 @@ SUB_TASK_DEF(TASK_L2L1, TASK_PDCP_ENB, 200)
/// Radio Resource Control task
TASK_DEF(TASK_RRC_ENB, TASK_PRIORITY_MED, 200)
/// S1ap task
+/// RAL task for ENB
+TASK_DEF(TASK_RAL_ENB, TASK_PRIORITY_MED, 200)
+
TASK_DEF(TASK_S1AP, TASK_PRIORITY_MED, 200)
/// X2ap task, acts as both source and target
TASK_DEF(TASK_X2AP, TASK_PRIORITY_MED, 200)
@@ -39,4 +42,5 @@ SUB_TASK_DEF(TASK_L2L1, TASK_PDCP_UE, 200)
TASK_DEF(TASK_RRC_UE, TASK_PRIORITY_MED, 200)
/// Non Access Stratum task
TASK_DEF(TASK_NAS_UE, TASK_PRIORITY_MED, 200)
+ TASK_DEF(TASK_RAL_UE, TASK_PRIORITY_MED, 200)
diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.h b/openair2/LAYER2/PDCP_v10.1.0/pdcp.h
index d2db564871..2eba305817 100755
--- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.h
+++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.h
@@ -361,15 +361,21 @@ protected_pdcp_fifo(void pdcp_fifo_read_input_sdus_from_otg (u32_t frame, u8_t e
/*
* Following two types are utilized between NAS driver and PDCP
*/
-typedef struct pdcp_data_req_header_t {
+
+typedef int traffic_type_t;
+
+typedef struct pdcp_data_req_header_s {
rb_id_t rb_id;
- sdu_size_t data_size;
- int inst;
+ sdu_size_t data_size;
+ int inst;
+ traffic_type_t traffic_type;
} pdcp_data_req_header_t;
-typedef struct pdcp_data_ind_header_t {
+
+typedef struct pdcp_data_ind_header_s {
rb_id_t rb_id;
- sdu_size_t data_size;
- int inst;
+ sdu_size_t data_size;
+ int inst;
+ int dummy;
} pdcp_data_ind_header_t;
struct pdcp_netlink_element_s {
diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
index 6c5f01b5cd..f2679adc50 100755
--- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
+++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
@@ -60,6 +60,7 @@ extern int otg_enabled;
#include "../MAC/extern.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
+#include "NAS/DRIVER/LITE/constant.h"
#include "SIMULATION/ETH_TRANSPORT/extern.h"
#include "UTIL/OCG/OCG.h"
#include "UTIL/OCG/OCG_extern.h"
@@ -312,6 +313,22 @@ int
pdcp_input_sdu_buffer,
PDCP_DATA_PDU);
}
+
+ } else if ((pdcp_input_header.traffic_type == OAI_NW_DRV_IPV6_ADDR_TYPE_MULTICAST) || (pdcp_input_header.traffic_type == OAI_NW_DRV_IPV4_ADDR_TYPE_MULTICAST)) {
+ printf("[MSC_MSG][FRAME %05d][IP][MOD %02d][][--- PDCP_DATA_REQ on MBMS bearer/ %d Bytes --->][PDCP][MOD %02d][RB %02d]\n",
+ frame, pdcp_read_header.inst, pdcp_read_header.data_size, pdcp_read_header.inst, pdcp_read_header.rb_id);
+
+ if (pdcp_array[pdcp_read_header.inst][pdcp_read_header.rb_id%NB_RB_MAX].instanciated_instance) {
+ pdcp_data_req (pdcp_input_header.inst,
+ frame, eNB_flag,
+ pdcp_input_header.rb_id,
+ RLC_MUI_UNDEFINED,
+ RLC_SDU_CONFIRM_NO,
+ pdcp_input_header.data_size,
+ pdcp_input_sdu_buffer,
+ PDCP_TM);
+ }
+
} else if (eNB_flag) {
// is a broadcast packet, we have to send this packet on all default RABS of all connected UEs
LOG_D(PDCP, "Checking if could sent on default rabs\n");
@@ -537,12 +554,10 @@ int pdcp_fifo_read_input_sdus (u32_t frame, u8_t eNB_flag, u8_t UE_index, u8_t e
while (pdcp_netlink_dequeue_element(eNB_flag, UE_index, eNB_index, &data) != 0) {
if (data->pdcp_read_header.rb_id != 0) {
if (pdcp_array[data->pdcp_read_header.inst][data->pdcp_read_header.rb_id%NB_RB_MAX].instanciated_instance) {
-#ifdef PDCP_DEBUG
- LOG_D(PDCP, "[MSC_MSG][FRAME %05d][IP][MOD %02d][][--- PDCP_DATA_REQ "
+ LOG_D(PDCP, "[FRAME %05d][IP][MOD %02d][][--- PDCP_DATA_REQ "
"/ %d Bytes --->][PDCP][MOD %02d][RB %02d]\n",
frame, data->pdcp_read_header.inst, data->pdcp_read_header.data_size,
data->pdcp_read_header.inst, data->pdcp_read_header.rb_id);
-#endif
pdcp_data_req(data->pdcp_read_header.inst,
frame,
diff --git a/openair2/Makefile b/openair2/Makefile
index b771192d55..9a9529eca0 100755
--- a/openair2/Makefile
+++ b/openair2/Makefile
@@ -134,6 +134,12 @@ nasmesh_netlink.ko:
naslite_netlink_ether.ko:
(cd NAS/DRIVER/LITE && $(MAKE) -j$(NUM_CORES) $(SET_UM) OAI_NW_DRIVER_TYPE_ETHERNET=1 NAS_NETLINK=1 OAI_NW_DRIVER_USE_NETLINK=1 V=1 -C /usr/src/$(LINUX_KERNEL) M=`pwd` modules)
+oai_nw_ether.ko:
+ (cd NAS/DRIVER/LITE && $(MAKE) -j$(NUM_CORES) $(SET_UM) OAI_NW_DRIVER_TYPE_ETHERNET=1 NAS_NETLINK=1 OAI_NW_DRIVER_USE_NETLINK=1 V=1 -C /usr/src/$(LINUX_KERNEL) M=`pwd` modules)
+
+oai_nw_drv.ko:
+ (cd NAS/DRIVER/LITE && $(MAKE) -j$(NUM_CORES) $(SET_UM) OAI_NW_DRIVER_TYPE_ETHERNET=1 NAS_NETLINK=1 OAI_NW_DRIVER_USE_NETLINK=1 V=1 -C /usr/src/$(LINUX_KERNEL) M=`pwd` modules)
+
nasmesh_netlink_address_fix.ko:
(cd NAS/DRIVER/MESH && $(MAKE) -j$(NUM_CORES) $(SET_UM) NAS_NETLINK=1 ADDRESS_FIX=1 V=1 -C /usr/src/$(LINUX_KERNEL) M=`pwd` modules)
diff --git a/openair2/NAS/DRIVER/LITE/Makefile b/openair2/NAS/DRIVER/LITE/Makefile
index f9cdb226c9..fe8ed8c59a 100755
--- a/openair2/NAS/DRIVER/LITE/Makefile
+++ b/openair2/NAS/DRIVER/LITE/Makefile
@@ -92,7 +92,7 @@ obj-m += oai_nw_drv.o
oai_nw_drv-objs += device.o
oai_nw_drv-objs += common.o
oai_nw_drv-objs += ioctl.o
-#oai_nw_drv-objs += classifier.o
+oai_nw_drv-objs += classifier.o
oai_nw_drv-objs += tool.o
ifdef OAI_NW_DRIVER_USE_NETLINK
oai_nw_drv-objs += netlink.o
diff --git a/openair2/NAS/DRIVER/LITE/classifier.c b/openair2/NAS/DRIVER/LITE/classifier.c
index 937f593182..651f7f7f73 100755
--- a/openair2/NAS/DRIVER/LITE/classifier.c
+++ b/openair2/NAS/DRIVER/LITE/classifier.c
@@ -148,168 +148,59 @@
&& ((((__const uint8_t *) (a))[3] & (((__const uint8_t *) (m))[3])) == (((__const uint8_t *) (b))[3] & (((__const uint8_t *) (m))[3]))))
-//#define OAI_DRV_DEBUG_CLASS
-//#define OAI_DRV_DEBUG_SEND
//---------------------------------------------------------------------------
-void oai_nw_drv_create_mask_ipv6_addr(struct in6_addr *masked_addrP, int prefix_len){
+// Find the IP traffic type (UNICAST, MULTICAST, BROADCAST)
+traffic_type_t oai_nw_drv_find_traffic_type(struct sk_buff *skb) {
//---------------------------------------------------------------------------
- int u6_addr8_index;
- int u6_addr1_index;
- int index;
-
- masked_addrP->s6_addr32[0] = 0xFFFFFFFF;
- masked_addrP->s6_addr32[1] = 0xFFFFFFFF;
- masked_addrP->s6_addr32[2] = 0xFFFFFFFF;
- masked_addrP->s6_addr32[3] = 0xFFFFFFFF;
-
- switch (prefix_len) {
- case 128:
- return;
- case 112:
- masked_addrP->s6_addr32[3] = htonl(0xFFFF0000);
- return;
- case 96:
- masked_addrP->s6_addr32[3] = 0x00000000;
- return;
- case 80:
- masked_addrP->s6_addr32[2] = htonl(0xFFFF0000);
- masked_addrP->s6_addr32[3] = 0x00000000;
- return;
- case 64:
- masked_addrP->s6_addr32[2] = 0x00000000;
- masked_addrP->s6_addr32[3] = 0x00000000;
- return;
- case 48:
- masked_addrP->s6_addr32[1] = htonl(0xFFFF0000);
- masked_addrP->s6_addr32[2] = 0x00000000;
- masked_addrP->s6_addr32[3] = 0x00000000;
- return;
- case 32:
- masked_addrP->s6_addr32[1] = 0x00000000;
- masked_addrP->s6_addr32[2] = 0x00000000;
- masked_addrP->s6_addr32[3] = 0x00000000;
- return;
- case 16:
- masked_addrP->s6_addr32[0] = htonl(0xFFFF0000);
- masked_addrP->s6_addr32[1] = 0x00000000;
- masked_addrP->s6_addr32[2] = 0x00000000;
- masked_addrP->s6_addr32[3] = 0x00000000;
- return;
- default:
- u6_addr8_index = prefix_len >> 3;
- u6_addr1_index = prefix_len & 0x07;
-
- for (index = u6_addr8_index ; index < 16; index++) {
- masked_addrP->s6_addr[index] = 0;
- }
- if (u6_addr1_index > 0) {
- masked_addrP->s6_addr[u6_addr8_index+1] = htons(0xFF << (8-u6_addr1_index));
- }
- for (index = 0 ; index < 4; index++) {
- masked_addrP->s6_addr32[index] = htonl(masked_addrP->s6_addr32[index]);
- }
- }
-
-}
-//---------------------------------------------------------------------------
-void oai_nw_drv_create_mask_ipv4_addr(struct in_addr *masked_addrP, int prefix_len){
- //---------------------------------------------------------------------------
- if (prefix_len > 32) {
- prefix_len = 32;
- }
- masked_addrP->s_addr = htonl(0xFFFFFFFF << (32 - prefix_len));
- return;
-}
-
-
-//---------------------------------------------------------------------------
-// Search the entity with the IPv6 address 'addr'
-// Navid: the ipv6 classifier is not fully tested
-struct cx_entity *oai_nw_drv_find_cx6(struct sk_buff *skb,
- unsigned char dscp,
- struct oai_nw_drv_priv *gpriv,
- int inst,
- int *paddr_type,
- unsigned char *cx_searcher) {
- //---------------------------------------------------------------------------
- unsigned char cxi;
- struct cx_entity *cx = NULL;
- struct classifier_entity *sclassifier= NULL;
- u32 mc_addr_hdr;
- struct in6_addr masked_addr;
+ traffic_type_t traffic_type = OAI_NW_DRV_IPVX_ADDR_TYPE_UNKNOWN;
if (skb!=NULL) {
+ switch (ntohs(skb->protocol)) {
+ case ETH_P_IPV6:
+ traffic_type = OAI_NW_DRV_IPV6_ADDR_TYPE_UNKNOWN;
#ifdef OAI_DRV_DEBUG_CLASS
printk("SOURCE ADDR %X:%X:%X:%X:%X:%X:%X:%X",NIP6ADDR(&(ipv6_hdr(skb)->saddr)));
printk(" DEST ADDR %X:%X:%X:%X:%X:%X:%X:%X\n",NIP6ADDR(&(ipv6_hdr(skb)->daddr)));
#endif
- mc_addr_hdr = ntohl(ipv6_hdr(skb)->daddr.in6_u.u6_addr32[0]);
- //printk(" mc_addr_hdr %08X\n",mc_addr_hdr);
- // First check if multicast [1st octet is FF]
- if ((mc_addr_hdr & 0xFF000000) == 0xFF000000) {
- // packet type according to the scope of the multicast packet
- // we don't consider RPT bits in second octet [maybe done later if needed]
- switch(mc_addr_hdr & 0x000F0000) {
- case (0x00020000):
- *paddr_type = OAI_NW_DRV_IPV6_ADDR_TYPE_MC_SIGNALLING;
- #ifdef OAI_DRV_DEBUG_CLASS
- printk("nasrg_CLASS_cx6: multicast packet - signalling \n");
- #endif
- break;
- case (0x000E0000):
- *paddr_type = OAI_NW_DRV_IPV6_ADDR_TYPE_MC_MBMS;
- //*pmbms_ix = 0;
- //cx=gpriv->cx; // MBMS associate to Mobile 0
- #ifdef OAI_DRV_DEBUG_CLASS
- printk("nasrg_CLASS_cx6: multicast packet - MBMS data \n");
- #endif
- break;
- default:
- printk("nasrg_CLASS_cx6: default \n");
- *paddr_type = OAI_NW_DRV_IPV6_ADDR_TYPE_UNKNOWN;
- //*pmbms_ix = NASRG_MBMS_SVCES_MAX;
- }
+ if (IN6_IS_ADDR_MULTICAST(&ipv6_hdr(skb)->daddr.in6_u.u6_addr32[0])) {
+ traffic_type = OAI_NW_DRV_IPV6_ADDR_TYPE_MULTICAST;
+
} else {
- *paddr_type = OAI_NW_DRV_IPV6_ADDR_TYPE_UNICAST;
-
- for (cxi=*cx_searcher; cxi<OAI_NW_DRV_CX_MAX; cxi++) {
-
- (*cx_searcher)++;
- sclassifier = gpriv->cx[cxi].sclassifier[dscp];
-
- while (sclassifier!=NULL) {
- if ((sclassifier->ip_version == OAI_NW_DRV_IP_VERSION_6) || (sclassifier->ip_version == OAI_NW_DRV_IP_VERSION_ALL)) { // verify that this is an IPv6 rule
- /*LGif (IN6_IS_ADDR_UNSPECIFIED(&(sclassifier->daddr.ipv6))) {
- printk("oai_nw_drv_find_cx6: addr is null \n");
- sclassifier = sclassifier->next;
- continue;
- }*/
- #ifdef OAI_DRV_DEBUG_CLASS
- printk("cx %d : DSCP %d %X:%X:%X:%X:%X:%X:%X:%X\n",cxi, dscp, NIP6ADDR(&(sclassifier->daddr.ipv6)));
- #endif //OAI_DRV_DEBUG_CLASS
- //if ((dst = (unsigned int*)&(((struct rt6_info *)skbdst)->rt6i_gateway)) == 0){
- // LG: STRANGE
- if (IN6_IS_ADDR_UNSPECIFIED(&ipv6_hdr(skb)->daddr)) {
- printk("oai_nw_drv_find_cx6: dst addr is null \n");
- sclassifier = sclassifier->next;
- continue;
- }
-
- oai_nw_drv_create_mask_ipv6_addr(&masked_addr, sclassifier->dplen);
- if (IN6_ARE_ADDR_MASKED_EQUAL(&ipv6_hdr(skb)->daddr, &(sclassifier->daddr.ipv6), &masked_addr)) {
- #ifdef OAI_DRV_DEBUG_CLASS
- printk("oai_nw_drv_find_cx6: found cx %d: %X:%X:%X:%X:%X:%X:%X:%X\n",cxi, NIP6ADDR(&(sclassifier->daddr.ipv6)));
- #endif //OAI_DRV_DEBUG_CLASS
- return &gpriv->cx[cxi];
- }
- }
- // Go to next classifier entry for connection
- sclassifier = sclassifier->next;
- }
- }
+ traffic_type = OAI_NW_DRV_IPV6_ADDR_TYPE_UNICAST;
}
+
+ break;
+
+
+ case ETH_P_IP:
+ traffic_type = OAI_NW_DRV_IPV4_ADDR_TYPE_UNKNOWN;
+#ifdef KERNEL_VERSION_GREATER_THAN_2622
+ //print_TOOL_pk_ipv4((struct iphdr *)skb->network_header);
+ if (IN_MULTICAST(htonl(ip_hdr(skb)->daddr))) {
+ traffic_type = OAI_NW_DRV_IPV4_ADDR_TYPE_MULTICAST;
+ } else {
+ traffic_type = OAI_NW_DRV_IPV4_ADDR_TYPE_UNICAST;
+ }
+ // TO DO BROADCAST
+
+#else
+ //print_TOOL_pk_ipv4(skb->nh.iph);
+ if (IN_MULTICAST(htonl(ip_hdr(skb)->daddr))) {
+ traffic_type = OAI_NW_DRV_IPV4_ADDR_TYPE_MULTICAST;
+ } else {
+ traffic_type = OAI_NW_DRV_IPV4_ADDR_TYPE_UNICAST;
+ }
+ // TO DO BROADCAST
+#endif
+ break;
+
+ case ETH_P_ARP:
+ traffic_type = OAI_NW_DRV_IPV4_ADDR_TYPE_BROADCAST;
+ break;
+
+ default:;
+ }
}
- printk("oai_nw_drv_find_cx6 NOT FOUND: %X:%X:%X:%X:%X:%X:%X:%X\n",NIP6ADDR(&ipv6_hdr(skb)->daddr));
- return cx;
+ return traffic_type;
}
diff --git a/openair2/NAS/DRIVER/LITE/common.c b/openair2/NAS/DRIVER/LITE/common.c
index fa8113f974..555ca8e2d2 100755
--- a/openair2/NAS/DRIVER/LITE/common.c
+++ b/openair2/NAS/DRIVER/LITE/common.c
@@ -68,8 +68,8 @@
ntohs((addr)->s6_addr16[7])
-//#define OAI_DRV_DEBUG_SEND
-//#define OAI_DRV_DEBUG_RECEIVE
+#define OAI_DRV_DEBUG_SEND
+#define OAI_DRV_DEBUG_RECEIVE
void oai_nw_drv_common_class_wireless2ip(u16 dlen,
void *pdcp_sdu,
int inst,
@@ -329,7 +329,7 @@ void oai_nw_drv_common_ip2wireless_drop(struct sk_buff *skb, int inst){
// Request the transfer of data (QoS SAP)
void oai_nw_drv_common_ip2wireless(struct sk_buff *skb, int inst){
//---------------------------------------------------------------------------
- struct pdcp_data_req_header_t pdcph;
+ struct pdcp_data_req_header_s pdcph;
struct oai_nw_drv_priv *priv=netdev_priv(oai_nw_drv_dev[inst]);
#ifdef LOOPBACK_TEST
int i;
@@ -350,9 +350,11 @@ void oai_nw_drv_common_ip2wireless(struct sk_buff *skb, int inst){
return;
}
- pdcph.data_size = skb->len;
- pdcph.rb_id = skb->mark;
- pdcph.inst = inst;
+ pdcph.data_size = skb->len;
+ pdcph.rb_id = skb->mark;
+ pdcph.inst = inst;
+ pdcph.traffic_type = oai_nw_drv_find_traffic_type(skb);
+
bytes_wrote = oai_nw_drv_netlink_send((char *)&pdcph,OAI_NW_DRV_PDCPH_SIZE);
#ifdef OAI_DRV_DEBUG_SEND
@@ -386,7 +388,7 @@ void oai_nw_drv_common_ip2wireless(struct sk_buff *skb, int inst){
return;
}
#ifdef OAI_DRV_DEBUG_SEND
- printk("[OAI_IP_DRV][%s] Sending packet of size %d to PDCP \n",__FUNCTION__,skb->len);
+ printk("[OAI_IP_DRV][%s] Sending packet of size %d to PDCP traffic type %d\n",__FUNCTION__,skb->len, pdcph.traffic_type);
for (j=0;j<skb->len;j++)
printk("%2x ",((unsigned char *)(skb->data))[j]);
@@ -405,7 +407,7 @@ void oai_nw_drv_common_ip2wireless(struct sk_buff *skb, int inst){
void oai_nw_drv_common_wireless2ip(struct nlmsghdr *nlh) {
//---------------------------------------------------------------------------
- struct pdcp_data_ind_header_t *pdcph = (struct pdcp_data_ind_header_t *)NLMSG_DATA(nlh);
+ struct pdcp_data_ind_header_s *pdcph = (struct pdcp_data_ind_header_s *)NLMSG_DATA(nlh);
struct oai_nw_drv_priv *priv;
priv = netdev_priv(oai_nw_drv_dev[pdcph->inst]);
diff --git a/openair2/NAS/DRIVER/LITE/constant.h b/openair2/NAS/DRIVER/LITE/constant.h
index 5d0ccf8aef..1de4a1b700 100755
--- a/openair2/NAS/DRIVER/LITE/constant.h
+++ b/openair2/NAS/DRIVER/LITE/constant.h
@@ -36,8 +36,8 @@
//Debug flags
//#define OAI_NW_DRV_DEBUG_DC
-//#define OAI_NW_DRV_DEBUG_SEND
-//#define OAI_NW_DRV_DEBUG_RECEIVE
+#define OAI_NW_DRV_DEBUG_SEND
+#define OAI_NW_DRV_DEBUG_RECEIVE
//#define OAI_NW_DRV_DEBUG_CLASS
//#define OAI_NW_DRV_DEBUG_GC
//#define OAI_NW_DRV_DEBUG_DC_MEASURE
@@ -102,7 +102,7 @@
#define OAI_NW_DRV_TIMER_IDLE UINT_MAX
#define OAI_NW_DRV_TIMER_TICK HZ
-#define OAI_NW_DRV_PDCPH_SIZE sizeof(struct pdcp_data_req_header_t)
+#define OAI_NW_DRV_PDCPH_SIZE sizeof(struct pdcp_data_req_header_s)
#define OAI_NW_DRV_IPV4_SIZE 20
#define OAI_NW_DRV_IPV6_SIZE 40
@@ -174,13 +174,13 @@
#define OAI_NW_DRV_DEFAULT_IPV6_ADDR3 0
+#define OAI_NW_DRV_IPVX_ADDR_TYPE_UNKNOWN 0
#define OAI_NW_DRV_IPV6_ADDR_TYPE_UNICAST 1
-#define OAI_NW_DRV_IPV6_ADDR_TYPE_MC_SIGNALLING 2
-#define OAI_NW_DRV_IPV6_ADDR_TYPE_MC_MBMS 3
-#define OAI_NW_DRV_IPV6_ADDR_TYPE_UNKNOWN 4
+#define OAI_NW_DRV_IPV6_ADDR_TYPE_MULTICAST 2
+#define OAI_NW_DRV_IPV6_ADDR_TYPE_UNKNOWN 3
#define OAI_NW_DRV_IPV4_ADDR_TYPE_UNICAST 5
-#define OAI_NW_DRV_IPV4_ADDR_TYPE_MC_SIGNALLING 6
+#define OAI_NW_DRV_IPV4_ADDR_TYPE_MULTICAST 6
#define OAI_NW_DRV_IPV4_ADDR_TYPE_BROADCAST 7
#define OAI_NW_DRV_IPV4_ADDR_TYPE_UNKNOWN 8
diff --git a/openair2/NAS/DRIVER/LITE/local.h b/openair2/NAS/DRIVER/LITE/local.h
index 05c8aaec7a..860895aed2 100755
--- a/openair2/NAS/DRIVER/LITE/local.h
+++ b/openair2/NAS/DRIVER/LITE/local.h
@@ -65,6 +65,8 @@
#include "constant.h"
#include "sap.h"
+typedef int traffic_type_t;
+
struct cx_entity {
int sap[OAI_NW_DRV_SAPI_CX_MAX];
u8 state; // state of the connection
@@ -113,16 +115,18 @@ struct ipversion {
#endif
};
-typedef struct pdcp_data_req_header_t {
+typedef struct pdcp_data_req_header_s {
unsigned int rb_id;
unsigned int data_size;
int inst;
+ traffic_type_t traffic_type;
} pdcp_data_req_header_t;
-typedef struct pdcp_data_ind_header_t {
+typedef struct pdcp_data_ind_header_s {
unsigned int rb_id;
unsigned int data_size;
int inst;
+ int dummy;
} pdcp_data_ind_header_t;
@@ -133,4 +137,4 @@ extern u8 OAI_NW_DRV_NULL_IMEI[14];
-#endif
\ No newline at end of file
+#endif
diff --git a/openair2/NAS/DRIVER/LITE/proto_extern.h b/openair2/NAS/DRIVER/LITE/proto_extern.h
index 3a0eb2dd6e..f38d654e49 100755
--- a/openair2/NAS/DRIVER/LITE/proto_extern.h
+++ b/openair2/NAS/DRIVER/LITE/proto_extern.h
@@ -145,11 +145,10 @@ int oai_nw_drv_CTL_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
// classifier.c
/**
- \brief Send a socket received from IP to classifier for a particular instance ID.
+ \brief Find the IP traffic type (UNICAST, MULTICAST, BROADCAST) of the IP packet attached to sk_buff.
*/
-void oai_nw_drv_class_send(struct sk_buff *skb, //!< Pointer to socket buffer
- int inst //!< Instance ID
- );
+traffic_type_t oai_nw_drv_find_traffic_type(struct sk_buff *skb);
+
// tool.c
diff --git a/openair2/RRC/LITE/rrc_UE.c b/openair2/RRC/LITE/rrc_UE.c
index 1077cbf514..6463cf7a75 100644
--- a/openair2/RRC/LITE/rrc_UE.c
+++ b/openair2/RRC/LITE/rrc_UE.c
@@ -1218,6 +1218,37 @@ void rrc_ue_process_rrcConnectionReconfiguration(u8 Mod_id, u32 frame,
#endif
} // c1 present
} // critical extensions present
+#ifdef ENABLE_RAL
+ {
+ MessageDef *message_ral_p = NULL;
+ rrc_ral_connection_reestablishment_ind_t connection_reestablishment_ind;
+ int i;
+
+ message_ral_p = itti_alloc_new_message (TASK_RRC_UE, RRC_RAL_CONNECTION_REESTABLISHMENT_IND);
+ memset(&connection_reestablishment_ind, 0, sizeof(rrc_ral_connection_reestablishment_ind_t));
+ // TO DO ral_si_ind.plmn_id = 0;
+ connection_reestablishment_ind.ue_id = Mod_id;
+ if (rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToAddModList != NULL) {
+ connection_reestablishment_ind.num_drb = rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToAddModList->list.count;
+
+ for (i=0;(i<rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToAddModList->list.count) && (i < maxDRB);i++) {
+ // why minus 1 in RRC code for drb_identity ?
+ connection_reestablishment_ind.drb_id[i] = rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToAddModList->list.array[i]->drb_Identity;
+ }
+ } else {
+ connection_reestablishment_ind.num_drb = 0;
+ }
+ if (rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->srb_ToAddModList != NULL) {
+ connection_reestablishment_ind.num_srb = rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->srb_ToAddModList->list.count;
+ } else {
+ connection_reestablishment_ind.num_srb = 0;
+ }
+ memcpy (&message_ral_p->ittiMsg, (void *) &connection_reestablishment_ind, sizeof(rrc_ral_connection_reestablishment_ind_t));
+#warning "Mod_id ? for instance ?"
+ LOG_I(RRC, "Sending RRC_RAL_CONNECTION_REESTABLISHMENT_IND to mRAL\n");
+ itti_send_msg_to_task (TASK_RAL_UE, Mod_id, message_ral_p);
+ }
+#endif
}
/* 36.331, 5.3.5.4 Reception of an RRCConnectionReconfiguration including the mobilityControlInfo by the UE (handover) */
@@ -1907,12 +1938,29 @@ int decode_SI(u8 Mod_id,u32 frame,u8 eNB_index,u8 si_window) {
#ifdef Rel10
if (UE_rrc_inst[Mod_id].MBMS_flag < 3) // see -Q option
#endif
- rrc_ue_generate_RRCConnectionRequest(Mod_id,frame,eNB_index);
+ rrc_ue_generate_RRCConnectionRequest(Mod_id,frame,eNB_index);
LOG_I(RRC, "not sending connection request\n");
if (UE_rrc_inst[Mod_id].Info[eNB_index].State == RRC_IDLE) {
- LOG_I(RRC,"[UE %d] Received SIB1/SIB2/SIB3 Switching to RRC_SI_RECEIVED\n",Mod_id);
- UE_rrc_inst[Mod_id].Info[eNB_index].State = RRC_SI_RECEIVED;
+ LOG_I(RRC,"[UE %d] Received SIB1/SIB2/SIB3 Switching to RRC_SI_RECEIVED\n",Mod_id);
+ UE_rrc_inst[Mod_id].Info[eNB_index].State = RRC_SI_RECEIVED;
+#ifdef ENABLE_RAL
+ {
+ MessageDef *message_ral_p = NULL;
+ rrc_ral_system_information_ind_t ral_si_ind;
+
+ message_ral_p = itti_alloc_new_message (TASK_RRC_UE, RRC_RAL_SYSTEM_INFORMATION_IND);
+ memset(&ral_si_ind, 0, sizeof(rrc_ral_system_information_ind_t));
+ // TO DO ral_si_ind.plmn_id = 0;
+ ral_si_ind.cell_id = eNB_index;
+ ral_si_ind.dbm = 0;
+ ral_si_ind.sinr = 0;
+ ral_si_ind.link_data_rate = 0;
+ memcpy (&message_ral_p->ittiMsg, (void *) &ral_si_ind, sizeof(rrc_ral_system_information_ind_t));
+#warning "Mod_id ? for instance ?"
+ itti_send_msg_to_task (TASK_RAL_UE, Mod_id, message_ral_p);
+ }
+#endif
}
break;
case SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib3:
@@ -2481,6 +2529,27 @@ void *rrc_ue_task(void *args_p) {
break;
}
+ case RRC_RAL_SCAN_REQ:
+ {
+ // TO DO ASK PHY TO DO A SCAN
+ LOG_I(RRC, "[UE %d] Received %s\n", Mod_id, msg_name);
+ }
+
+ case RRC_RAL_CONFIGURE_THRESHOLD_REQ:
+ {
+ LOG_I(RRC, "[UE %d] Received %s\n", Mod_id, msg_name);
+ }
+
+ case RRC_RAL_CONNECTION_ESTABLISHMENT_REQ:
+ {
+ LOG_I(RRC, "[UE %d] Received %s\n", Mod_id, msg_name);
+ }
+
+ case RRC_RAL_CONNECTION_RELEASE_REQ:
+ {
+ LOG_I(RRC, "[UE %d] Received %s\n", Mod_id, msg_name);
+ }
+
default:
LOG_E(RRC, "[UE %d] Received unexpected message %s\n", Mod_id, msg_name);
break;
diff --git a/openair2/RRM_4_RRC_LITE/Makefile b/openair2/RRM_4_RRC_LITE/Makefile
index 7af07559c7..91a204cb73 100755
--- a/openair2/RRM_4_RRC_LITE/Makefile
+++ b/openair2/RRM_4_RRC_LITE/Makefile
@@ -72,7 +72,42 @@ LDFLAGS += -rdynamic
PROGS = rrm_exe test_exe
gen-c-from-asn1:
- cd $(RRC_RRM_ASN1_DIR);asn1c -gen-PER -fcompound-names -fnative-types -fskeletons-copy $(ASN1_RRC_SPEC_DIR)/EUTRA-RRC-Definitions.asn $(RRC_RRM_ASN1_DIR)/rrc-rrm.asn; cd -
+ #-fbless-SIZE
+ # Allow SIZE() constraint for INTEGER, ENUMERATED, and other types
+ # for which this constraint is normally prohibited by the stan-
+ # dard. This is a violation of ASN.1 standard, and the compiler
+ # may fail to produce a meaningful code.
+
+ #-fcompound-names
+ # Using this option prevents name collisions in the target source
+ # code by using complex names for target language structures.
+ # (Name collisions may occur if the ASN.1 module reuses the same
+ # identifiers in multiple contexts).
+
+ #-findirect-choice
+ # When generating code for a CHOICE type, compile the CHOICE mem-
+ # bers as indirect pointers instead of declaring them inline. Con-
+ # sider using this option together with -fno-include-deps to pre-
+ # vent circular references.
+
+ #-fknown-extern-type=<name>
+ # Pretend the specified type is known. The compiler will assume
+ # the target language source files for the given type have been
+ # provided manually.
+
+ #-fno-constraints
+ # Do not generate ASN.1 subtype constraint checking code. This may
+ # make a shorter executable.
+
+ #-fno-include-deps
+ # Do not generate courtesy #include lines for non-critical type
+ # dependencies. Helps prevent namespace collisions.
+
+ #-funnamed-unions
+ # Enable unnamed unions in the definitions of target language's
+ # structures.
+ #cd $(RRC_RRM_ASN1_DIR);asn1c -gen-PER -fcompound-names -fnative-types -fskeletons-copy $(ASN1_RRC_SPEC_DIR)/EUTRA-RRC-Definitions.asn $(RRC_RRM_ASN1_DIR)/rrc-rrm.asn; cd -
+ cd $(RRC_RRM_ASN1_DIR);asn1c -gen-PER -fno-include-deps -fcompound-names -fnative-types -fskeletons-copy $(ASN1_RRC_SPEC_DIR)/EUTRA-RRC-Definitions.asn $(RRC_RRM_ASN1_DIR)/rrc-rrm.asn; cd -
libs:
diff --git a/openair2/RRM_4_RRC_LITE/src/com/Message.cpp b/openair2/RRM_4_RRC_LITE/src/com/Message.cpp
index 662197e48c..922afea509 100755
--- a/openair2/RRM_4_RRC_LITE/src/com/Message.cpp
+++ b/openair2/RRM_4_RRC_LITE/src/com/Message.cpp
@@ -6,9 +6,9 @@
#include <string.h>
#include <arpa/inet.h>
//-----------------------------------------------------------------
+#include "Message.h"
#include "RRC-RRM-Message.h"
#include "RRM-RRC-Message.h"
-#include "Message.h"
#include "Utility.h"
#include "RRC2RRMMessageConnectionRequest.h"
#include "RRC2RRMMessageAddUserRequest.h"
@@ -589,6 +589,7 @@ std::string Message::StatusToString(msg_response_status_t statusP)
default:
result << "UNKNOWN STATUS " << statusP; return result.str();
}
+ return result.str();
}
//----------------------------------------------------------------------------
std::string Message::ReasonToString(msg_response_reason_t reasonP)
@@ -624,6 +625,7 @@ std::string Message::ReasonToString(msg_response_reason_t reasonP)
default:
result << "UNKNOWN REASON " << reasonP; return result.str();
}
+ return result.str();
}
//-----------------------------------------------------------------
Message::~Message()
diff --git a/openair2/RRM_4_RRC_LITE/src/com/asn1/Makefile.am.sample b/openair2/RRM_4_RRC_LITE/src/com/asn1/Makefile.am.sample
index 7a86a0f130..4ca04ff4c3 100755
--- a/openair2/RRM_4_RRC_LITE/src/com/asn1/Makefile.am.sample
+++ b/openair2/RRM_4_RRC_LITE/src/com/asn1/Makefile.am.sample
@@ -866,5 +866,5 @@ clean:
regen: regenerate-from-asn1-source
regenerate-from-asn1-source:
- asn1c -gen-PER -fcompound-names -fnative-types -fskeletons-copy /homes/gauthier/PROJETS/OPENAIR4G/openair2/RRM_4_RRC_LITE/src/foreign/generated_c_asn1_rrc/ASN1_files/EUTRA-RRC-Definitions.asn /homes/gauthier/PROJETS/OPENAIR4G/openair2/RRM_4_RRC_LITE/src/com/asn1/rrc-rrm.asn
+ asn1c -gen-PER -fno-include-deps -fcompound-names -fnative-types -fskeletons-copy /homes/gauthier/PROJETS/trunk/openair2/RRM_4_RRC_LITE/src/foreign/generated_c_asn1_rrc/ASN1_files/EUTRA-RRC-Definitions.asn /homes/gauthier/PROJETS/trunk/openair2/RRM_4_RRC_LITE/src/com/asn1/rrc-rrm.asn
diff --git a/openair2/UTIL/LOG/log.c b/openair2/UTIL/LOG/log.c
index 13a8879d23..f9052633a9 100755
--- a/openair2/UTIL/LOG/log.c
+++ b/openair2/UTIL/LOG/log.c
@@ -308,6 +308,22 @@ int logInit (void)
g_log->log_component[OSA].filelog = 0;
g_log->log_component[OSA].filelog_name = "";
+ g_log->log_component[RAL_ENB].name = "eRAL";
+ g_log->log_component[RAL_ENB].level = LOG_EMERG;
+ g_log->log_component[RAL_ENB].flag = LOG_MED;
+ g_log->log_component[RAL_ENB].interval = 1;
+ g_log->log_component[RAL_ENB].fd = 0;
+ g_log->log_component[RAL_ENB].filelog = 0;
+ g_log->log_component[RAL_ENB].filelog_name = "";
+
+ g_log->log_component[RAL_UE].name = "mRAL";
+ g_log->log_component[RAL_UE].level = LOG_EMERG;
+ g_log->log_component[RAL_UE].flag = LOG_MED;
+ g_log->log_component[RAL_UE].interval = 1;
+ g_log->log_component[RAL_UE].fd = 0;
+ g_log->log_component[RAL_UE].filelog = 0;
+ g_log->log_component[RAL_UE].filelog_name = "";
+
g_log->log_component[ENB_APP].name = "ENB_APP";
g_log->log_component[ENB_APP].level = LOG_EMERG;
g_log->log_component[ENB_APP].flag = LOG_MED;
diff --git a/openair2/UTIL/LOG/log.h b/openair2/UTIL/LOG/log.h
index 293e31baa7..f44d99e065 100755
--- a/openair2/UTIL/LOG/log.h
+++ b/openair2/UTIL/LOG/log.h
@@ -258,6 +258,8 @@ typedef enum {
SCTP,
HW,
OSA,
+ RAL_ENB,
+ RAL_UE,
ENB_APP,
TMR,
MAX_LOG_COMPONENTS,
diff --git a/openair3/RAL-LTE/INTERFACE-802.21/INCLUDE/MIH_C_Types.h b/openair3/RAL-LTE/INTERFACE-802.21/INCLUDE/MIH_C_Types.h
index ea38c80b24..8766eea66c 100755
--- a/openair3/RAL-LTE/INTERFACE-802.21/INCLUDE/MIH_C_Types.h
+++ b/openair3/RAL-LTE/INTERFACE-802.21/INCLUDE/MIH_C_Types.h
@@ -20,6 +20,9 @@ Type definition and structure for 802.21 interface
#define __MIH_C_LINK_TYPES_H__
#include <sys/types.h>
#include <linux/types.h>
+#warning " Hack USER_MODE"
+#define USER_MODE
+
//-----------------------------------------------------------------------------
#include "MIH_C_Link_Constants.h"
#include "MIH_C_bit_buffer.h"
diff --git a/targets/PROJECTS/MEDIEVAL/Makefile b/targets/PROJECTS/MEDIEVAL/Makefile
index a520eac90c..6225ab6ad5 100755
--- a/targets/PROJECTS/MEDIEVAL/Makefile
+++ b/targets/PROJECTS/MEDIEVAL/Makefile
@@ -3,7 +3,7 @@ all: oaisim naslite_netlink_ether
userclean: clean oaisim naslite_netlink_ether
oaisim:
- (cd $(OPENAIR_TARGETS)/SIMU/USER && $(MAKE) NAS=1 OAI_NW_DRIVER_TYPE_ETHERNET=1)
+ (cd $(OPENAIR_TARGETS)/SIMU/USER && $(MAKE) NAS=1 OAI_NW_DRIVER_TYPE_ETHERNET=1 Rel10=1)
naslite_netlink_ether:
(cd $(OPENAIR2_DIR) && $(MAKE) naslite_netlink_ether.ko)
diff --git a/targets/PROJECTS/SPECTRA/start_enb.bash b/targets/PROJECTS/SPECTRA/start_enb.bash
index 2d87280825..5b12107824 100755
--- a/targets/PROJECTS/SPECTRA/start_enb.bash
+++ b/targets/PROJECTS/SPECTRA/start_enb.bash
@@ -30,6 +30,7 @@ declare -x OPENAIR1_DIR=""
declare -x OPENAIR2_DIR=""
declare -x OPENAIR3_DIR=""
declare -x OPENAIR_TARGETS=""
+declare -x EMULATION_DEV_INTERFACE="eth2"
###########################################################
set_openair
@@ -91,13 +92,16 @@ bash_exec "ip route flush cache"
ip rule add fwmark 5 table lte
ip route add default dev $LTEIF table lte
+ip route add 239.0.0.160/28 dev $EMULATION_DEV_INTERFACE
+
+
# start MIH-F
-xterm -hold -e $ODTONE_ROOT/dist/odtone-mihf --log 4 --conf.file $ODTONE_ROOT/dist/odtone.conf &
+#xterm -hold -e $ODTONE_ROOT/dist/odtone-mihf --log 4 --conf.file $ODTONE_ROOT/dist/odtone.conf &
-wait_process_started odtone-mihf
+#wait_process_started odtone-mihf
-gdb --args $OPENAIR_TARGETS/SIMU/USER/oaisim -a -l7 -u0 -M0 -p2 -g1 -D eth2 \
+gdb --args $OPENAIR_TARGETS/SIMU/USER/oaisim -a -l9 -u0 -M0 -p2 -g1 -D $EMULATION_DEV_INTERFACE \
--enb-ral-listening-port 1234\
--enb-ral-link-id enb_lte_link\
--enb-ral-ip-address 127.0.0.1\
diff --git a/targets/PROJECTS/SPECTRA/start_ue.bash b/targets/PROJECTS/SPECTRA/start_ue.bash
index a455f963dc..a4bf2034c6 100755
--- a/targets/PROJECTS/SPECTRA/start_ue.bash
+++ b/targets/PROJECTS/SPECTRA/start_ue.bash
@@ -16,6 +16,7 @@ declare -x OPENAIR1_DIR=""
declare -x OPENAIR2_DIR=""
declare -x OPENAIR3_DIR=""
declare -x OPENAIR_TARGETS=""
+declare -x EMULATION_DEV_INTERFACE="eth1"
###########################################################
set_openair
@@ -78,12 +79,14 @@ ip rule add fwmark 5 table lte
ip -4 route add default dev $LTEIF table lte
ip -6 route add default dev $LTEIF table lte
+ip route add 239.0.0.160/28 dev $EMULATION_DEV_INTERFACE
+
# start MIH-F
xterm -hold -e $ODTONE_ROOT/dist/odtone-mihf --log 4 --conf.file $ODTONE_ROOT/dist/odtone.conf &
wait_process_started odtone-mihf
-gdb --args $OPENAIR_TARGETS/SIMU/USER/oaisim -a -l7 -u1 -b0 -M1 -p2 -g1 -D eth2 \
+gdb --args $OPENAIR_TARGETS/SIMU/USER/oaisim -a -l9 -u1 -b0 -M1 -p2 -g1 -D $EMULATION_DEV_INTERFACE \
--ue-ral-listening-port 1234\
--ue-ral-link-id ue_lte_link\
--ue-ral-ip-address 127.0.0.1\
diff --git a/targets/SIMU/USER/Makefile b/targets/SIMU/USER/Makefile
index 747e90a54e..c370518b8a 100644
--- a/targets/SIMU/USER/Makefile
+++ b/targets/SIMU/USER/Makefile
@@ -5,11 +5,11 @@ default: oaisim
include $(OPENAIR_TARGETS)/Makefile.common
-TOP_DIR = $(OPENAIR1_DIR)
-OPENAIR1_TOP = $(OPENAIR1_DIR)
-OPENAIR2_TOP = $(OPENAIR2_DIR)
-OPENAIR3_TOP = $(OPENAIR3_DIR)
-OPENAIR3 = $(OPENAIR3_DIR)
+TOP_DIR = $(OPENAIR1_DIR)
+OPENAIR1_TOP = $(OPENAIR1_DIR)
+OPENAIR2_TOP = $(OPENAIR2_DIR)
+OPENAIR3_TOP = $(OPENAIR3_DIR)
+OPENAIR3 = $(OPENAIR3_DIR)
CPUFLAGS = -mmmx -msse -msse2 -msse4.1 -march=native
# FORCE ssse3 for compilation of openair on User Mode Linux
@@ -131,6 +131,14 @@ CFLAGS += -DRel8
#endif
endif
+ifeq ($(ENABLE_RAL), 1)
+CFLAGS += -DENABLE_RAL
+endif
+
+ifeq ($(MIH_C_MEDIEVAL_EXTENSIONS), 1)
+CFLAGS += -DMIH_C_MEDIEVAL_EXTENSIONS
+endif
+
ifeq ($(NAS), 1)
CFLAGS += -DNAS_NETLINK -DLINUX
NAS_FLAG=1
@@ -185,6 +193,7 @@ include $(OPENAIR2_DIR)/LAYER2/Makefile.inc
include $(OPENAIR1_DIR)/SIMULATION/ETH_TRANSPORT/Makefile.inc
include $(OPENAIR2_DIR)/RRC/NAS/Makefile.inc
include $(OPENAIR2_DIR)/UTIL/Makefile.inc
+include $(OPENAIR3_DIR)/RAL-LTE/Makefile.inc
include $(OPENAIR2_DIR)/ENB_APP/Makefile.inc
INCLUDES += -I$(TOP_DIR)
diff --git a/targets/SIMU/USER/oaisim_config.c b/targets/SIMU/USER/oaisim_config.c
index eafabf0875..f443f344fb 100644
--- a/targets/SIMU/USER/oaisim_config.c
+++ b/targets/SIMU/USER/oaisim_config.c
@@ -13,6 +13,10 @@
#include "UTIL/OTG/otg.h"
#include "UTIL/OTG/otg_vars.h"
#include "oml.h"
+#ifdef ENABLE_RAL
+#include "lteRALenb.h"
+#include "lteRALue.h"
+#endif
#if defined(ENABLE_ITTI)
# include "intertask_interface_init.h"
@@ -400,7 +404,10 @@ void oaisim_config() {
}
}
// init other comps
-
+#ifdef ENABLE_RAL
+ mRAL_init_default_values();
+ eRAL_init_default_values();
+#endif
olg_config();
ocg_config_emu();
ocg_config_env();// mobility gen
@@ -444,27 +451,30 @@ int olg_config() {
oai_emulation.info.g_log_level,
oai_emulation.info.g_log_verbosity,
oai_emulation.emulation_config.log_emu.interval);
-/*
+
// if perf eval then reset the otg log level
- set_comp_log(PHY, LOG_NONE, 0x15,1);
- set_comp_log(EMU, LOG_FULL, 0x15,1);
- set_comp_log(OCG, LOG_NONE, 0x15,1);
- set_comp_log(OCM, LOG_NONE, 0x15,1);
- set_comp_log(OTG, LOG_NONE, 0x15,1);
- set_comp_log(MAC, LOG_NONE, 0x15,1);
- set_comp_log(OMG, LOG_NONE, 0x15,1);
- set_comp_log(OPT, LOG_ERR, 0x15,1); */
-/*
- set_log(OCG, LOG_DEBUG, 1);
- set_log(EMU, LOG_INFO, 20);
- set_log(MAC, LOG_DEBUG, 1);
+ set_comp_log(PHY, LOG_EMERG, 0x15,1);
+ set_comp_log(EMU, LOG_EMERG, 0x15,1);
+ set_comp_log(OCG, LOG_EMERG, 0x15,1);
+ set_comp_log(OCM, LOG_EMERG, 0x15,1);
+ set_comp_log(OTG, LOG_EMERG, 0x15,1);
+ set_comp_log(MAC, LOG_EMERG, 0x15,1);
+ set_comp_log(OMG, LOG_EMERG, 0x15,1);
+ set_comp_log(OPT, LOG_EMERG, 0x15,1);
+ set_comp_log(PDCP, LOG_TRACE, LOG_MED,1);
+ set_comp_log(RLC, LOG_TRACE, LOG_MED,1);
+ set_comp_log(RRC, LOG_TRACE, LOG_MED,1);
+
+ //set_log(OCG, LOG_DEBUG, 1);
+ //set_log(EMU, LOG_INFO, 20);
+ //set_log(MAC, LOG_DEBUG, 1);
set_log(RLC, LOG_TRACE, 1);
- set_log(PHY, LOG_DEBUG, 1);
+ //set_log(PHY, LOG_DEBUG, 1);
set_log(PDCP, LOG_TRACE, 1);
set_log(RRC, LOG_DEBUG, 1);
- set_log(OCM, LOG_INFO, 20);
- set_log(OTG, LOG_INFO, 1);
- set_comp_log(OCG, LOG_ERR, 0x15,1);
+ //set_log(OCM, LOG_INFO, 20);
+ //set_log(OTG, LOG_INFO, 1);
+/* set_comp_log(OCG, LOG_ERR, 0x15,1);
set_comp_log(EMU, LOG_ERR, 0x15,20);
set_comp_log(MAC, LOG_ERR, 0x15,1);
set_comp_log(RLC, LOG_INFO, 0x15,1);
diff --git a/targets/SIMU/USER/oaisim_functions.c b/targets/SIMU/USER/oaisim_functions.c
index ed89fde0cf..6d1c3bae2b 100644
--- a/targets/SIMU/USER/oaisim_functions.c
+++ b/targets/SIMU/USER/oaisim_functions.c
@@ -25,6 +25,8 @@
#include "UTIL/OPT/opt.h"
#include "UTIL/OTG/otg_config.h"
#include "UTIL/OTG/otg_tx.h"
+#include "lteRALenb.h"
+#include "lteRALue.h"
#include "cor_SF_sim.h"
@@ -74,6 +76,7 @@ Node_list ue_node_list = NULL;
Node_list enb_node_list = NULL;
int pdcp_period, omg_period;
+
// time calibration for soft realtime mode
struct timespec time_spec;
unsigned long time_last, time_now;
@@ -114,8 +117,22 @@ void get_simulation_options(int argc, char *argv[]) {
char c;
int option_index;
static struct option long_options[] = {
- {"pdcp_period", 1, 0, 0},
- {"omg_period", 1, 0, 0},
+ {"pdcp_period", 1, 0, 0},
+ {"omg_period", 1, 0, 0},
+ {"enb-ral-listening-port", required_argument, 0, 0},
+ {"enb-ral-ip-address", required_argument, 0, 0},
+ {"enb-ral-link-id", required_argument, 0, 0},
+ {"enb-ral-link-address", required_argument, 0, 0},
+ {"enb-mihf-remote-port", required_argument, 0, 0},
+ {"enb-mihf-ip-address", required_argument, 0, 0},
+ {"enb-mihf-id", required_argument, 0, 0},
+ {"ue-ral-listening-port", required_argument, 0, 0},
+ {"ue-ral-ip-address", required_argument, 0, 0},
+ {"ue-ral-link-id", required_argument, 0, 0},
+ {"ue-ral-link-address", required_argument, 0, 0},
+ {"ue-mihf-remote-port", required_argument, 0, 0},
+ {"ue-mihf-ip-address", required_argument, 0, 0},
+ {"ue-mihf-id", required_argument, 0, 0},
{NULL, 0, NULL, 0}
};
@@ -128,10 +145,80 @@ void get_simulation_options(int argc, char *argv[]) {
printf("PDCP period is %d\n", pdcp_period);
}
} else if (! strcmp(long_options[option_index].name, "omg_period")) {
- if (optarg) {
- omg_period = atoi(optarg);
- printf("OMG period is %d\n", omg_period);
- }
+ if (optarg) {
+ omg_period = atoi(optarg);
+ printf("OMG period is %d\n", omg_period);
+ }
+ } else if (! strcmp(long_options[option_index].name, "enb-ral-listening-port")) {
+ if (optarg) {
+ g_conf_enb_ral_listening_port = strdup(optarg);
+ printf("eNB RAL listening port is %s\n", g_conf_enb_ral_listening_port);
+ }
+ } else if (! strcmp(long_options[option_index].name, "enb-ral-ip-address")) {
+ if (optarg) {
+ g_conf_enb_ral_ip_address = strdup(optarg);
+ printf("eNB RAL IP address is %s\n", g_conf_enb_ral_ip_address);
+ }
+ } else if (! strcmp(long_options[option_index].name, "enb-ral-link-address")) {
+ if (optarg) {
+ g_conf_enb_ral_link_address = strdup(optarg);
+ printf("eNB RAL link address is %s\n", g_conf_enb_ral_link_address);
+ }
+ } else if (! strcmp(long_options[option_index].name, "enb-mihf-remote-port")) {
+ if (optarg) {
+ g_conf_enb_mihf_remote_port = strdup(optarg);
+ printf("eNB MIH-F remote port is %s\n", g_conf_enb_mihf_remote_port);
+ }
+ } else if (! strcmp(long_options[option_index].name, "enb-mihf-ip-address")) {
+ if (optarg) {
+ g_conf_enb_mihf_ip_address = strdup(optarg);
+ printf("eNB MIH-F IP address is %s\n", g_conf_enb_mihf_ip_address);
+ }
+ } else if (! strcmp(long_options[option_index].name, "enb-ral-link-id")) {
+ if (optarg) {
+ g_conf_enb_ral_link_id = strdup(optarg);
+ printf("eNB RAL link id is %s\n", g_conf_enb_ral_link_id);
+ }
+ } else if (! strcmp(long_options[option_index].name, "enb-mihf-id")) {
+ if (optarg) {
+ g_conf_enb_mihf_id = strdup(optarg);
+ printf("eNB MIH-F id is %s\n", g_conf_enb_mihf_id);
+ }
+ } else if (! strcmp(long_options[option_index].name, "ue-ral-listening-port")) {
+ if (optarg) {
+ g_conf_ue_ral_listening_port = strdup(optarg);
+ printf("UE RAL listening port is %s\n", g_conf_ue_ral_listening_port);
+ }
+ } else if (! strcmp(long_options[option_index].name, "ue-ral-ip-address")) {
+ if (optarg) {
+ g_conf_ue_ral_ip_address = strdup(optarg);
+ printf("UE RAL IP address is %s\n", g_conf_ue_ral_ip_address);
+ }
+ } else if (! strcmp(long_options[option_index].name, "ue-ral-link-address")) {
+ if (optarg) {
+ g_conf_ue_ral_link_address = strdup(optarg);
+ printf("UE RAL link address is %s\n", g_conf_ue_ral_link_address);
+ }
+ } else if (! strcmp(long_options[option_index].name, "ue-mihf-remote-port")) {
+ if (optarg) {
+ g_conf_ue_mihf_remote_port = strdup(optarg);
+ printf("UE MIH-F remote port is %s\n", g_conf_ue_mihf_remote_port);
+ }
+ } else if (! strcmp(long_options[option_index].name, "ue-mihf-ip-address")) {
+ if (optarg) {
+ g_conf_ue_mihf_ip_address = strdup(optarg);
+ printf("UE MIH-F IP address is %s\n", g_conf_ue_mihf_ip_address);
+ }
+ } else if (! strcmp(long_options[option_index].name, "ue-ral-link-id")) {
+ if (optarg) {
+ g_conf_ue_ral_link_id = strdup(optarg);
+ printf("UE RAL link id is %s\n", g_conf_ue_ral_link_id);
+ }
+ } else if (! strcmp(long_options[option_index].name, "ue-mihf-id")) {
+ if (optarg) {
+ g_conf_ue_mihf_id = strdup(optarg);
+ printf("UE MIH-F id is %s\n", g_conf_ue_mihf_id);
+ }
}
break;
case 'L': // set FDD
@@ -603,9 +690,38 @@ void init_openair2() {
}
mac_xface->macphy_exit = exit_fun;
+
+#ifdef ENABLE_RAL
+ init_802_21_link_saps();
+#endif
+#endif
+}
+
+void init_802_21_link_saps() {
+#ifdef ENABLE_RAL
+#ifdef OPENAIR2
+#if defined(ENABLE_ITTI)
+ if (NB_eNB_INST > 0) {
+ if (itti_create_task (TASK_RAL_ENB, eRAL_task, NULL) < 0) {
+ LOG_E(EMU, "Create task failed");
+ LOG_D(EMU, "Initializing RAL eNB task interface: FAILED\n");
+ exit (-1);
+ }
+ }
+
+ if (NB_UE_INST > 0) {
+ if (itti_create_task (TASK_RAL_UE, mRAL_task, NULL) < 0) {
+ LOG_E(EMU, "Create task failed");
+ LOG_D(EMU, "Initializing RAL UE task interface: FAILED\n");
+ exit (-1);
+ }
+ }
+#endif
+#endif
#endif
}
+
void init_ocm() {
s32 UE_id, eNB_id;
/* Added for PHY abstraction */
diff --git a/targets/SIMU/USER/oaisim_functions.h b/targets/SIMU/USER/oaisim_functions.h
index f12b64d590..560dc44cef 100644
--- a/targets/SIMU/USER/oaisim_functions.h
+++ b/targets/SIMU/USER/oaisim_functions.h
@@ -20,6 +20,8 @@ void init_openair1();
void init_openair2();
+void init_802_21_link_saps();
+
void init_ocm();
void init_otg_pdcp_buffer();
diff --git a/targets/SIMU/USER/oaisim_pad.c b/targets/SIMU/USER/oaisim_pad.c
index fb0800a0df..471e7232a2 100644
--- a/targets/SIMU/USER/oaisim_pad.c
+++ b/targets/SIMU/USER/oaisim_pad.c
@@ -437,6 +437,8 @@ void run(int argc, char *argv[]) {
pdcp_period = 1;
omg_period = 10;
+ mRAL_init_default_values(); //Default values
+ eRAL_init_default_values(); //Default values
init_oai_emulation(); //Default values
--
GitLab