Commit 76945c80 authored by Ben Wojtowicz's avatar Ben Wojtowicz

Version 0.18.1: Added more MME encoding and decoding to the LTE library,...

Version 0.18.1: Added more MME encoding and decoding to the LTE library, pulled in a patch from Ruben Merz to add USRP X300 support for LTE_fdd_dl_scan and LTE_fdd_enodeb, added to enodeb_nat_script.sh, added delayed user deletion, ol extension to all message queues, ability to send EMM information message, and QoS for default data services to LTE_fdd_enodeb.
parent a1de57d1
......@@ -23,7 +23,7 @@
########################################################################
cmake_minimum_required(VERSION 2.6)
project(openLTE CXX C)
set(openLTE_version 0.18.0)
set(openLTE_version 0.18.1)
enable_testing()
#select the release build type by default to get optimization flags
......
......@@ -149,3 +149,9 @@ v00.18.00 Added IP packet support to LTE_fdd_enodeb. Specifically, added th
support in MME, timer reset, and IP gateway support, using the
latest LTE library, and refactored C-RNTI assignement and release
in LTE_fdd_enodeb.
v00.18.01 Added more MME encoding and decoding to the LTE library, pulled in
a patch from Ruben Merz to add USRP X300 support for LTE_fdd_dl_scan
and LTE_fdd_enodeb, added to enodeb_nat_script.sh, added delayed
user deletion, ol extension to all message queues, ability to send
EMM information message, and QoS for default data services to
LTE_fdd_enodeb.
......@@ -31,6 +31,8 @@
11/30/2013 Ben Wojtowicz Added support for bladeRF.
04/12/2014 Ben Wojtowicz Pulled in a patch from Jevgenij for
supporting non-B2X0 USRPs.
12/16/2014 Ben Wojtowicz Pulled in a patch from Ruben Merz to add
USRP X300 support.
*******************************************************************************/
......@@ -68,6 +70,7 @@ typedef enum{
LTE_FDD_DL_SCAN_HW_TYPE_HACKRF,
LTE_FDD_DL_SCAN_HW_TYPE_USRP_B,
LTE_FDD_DL_SCAN_HW_TYPE_USRP_N,
LTE_FDD_DL_SCAN_HW_TYPE_USRP_X,
LTE_FDD_DL_SCAN_HW_TYPE_BLADERF,
LTE_FDD_DL_SCAN_HW_TYPE_UNKNOWN,
}LTE_FDD_DL_SCAN_HW_TYPE_ENUM;
......
......@@ -34,6 +34,8 @@
supporting non-B2X0 USRPs.
07/22/2014 Ben Wojtowicz Pulled in a patch from Jeff Long to optimally
set the master clock rate for USRP B2X0.
12/16/2014 Ben Wojtowicz Pulled in a patch from Ruben Merz to add
USRP X300 support.
*******************************************************************************/
......@@ -151,25 +153,39 @@ LTE_FDD_DL_SCAN_STATUS_ENUM LTE_fdd_dl_scan_flowgraph::start(uint16 dl_earfcn)
hardware_type = LTE_FDD_DL_SCAN_HW_TYPE_USRP_N;
samp_src = tmp_src0;
}else{
osmosdr::source::sptr tmp_src1 = osmosdr::source::make("hackrf");
if(0 != tmp_src1->get_sample_rates().size())
tmp_src0.reset();
tmp_src0 = osmosdr::source::make("uhd,master_clock_rate=184320000");
BOOST_FOREACH(const uhd::device_addr_t &dev, uhd::device::find(hint))
{
hardware_type = LTE_FDD_DL_SCAN_HW_TYPE_HACKRF;
samp_src = tmp_src1;
}else{
osmosdr::source::sptr tmp_src2 = osmosdr::source::make("bladerf");
if(0 != tmp_src2->get_sample_rates().size())
if(dev["type"] == "x300")
{
hardware_type = LTE_FDD_DL_SCAN_HW_TYPE_BLADERF;
samp_src = tmp_src2;
hardware_type = LTE_FDD_DL_SCAN_HW_TYPE_USRP_X;
samp_src = tmp_src0;
break;
}
}
if(hardware_type == LTE_FDD_DL_SCAN_HW_TYPE_UNKNOWN)
{
osmosdr::source::sptr tmp_src1 = osmosdr::source::make("hackrf");
if(0 != tmp_src1->get_sample_rates().size())
{
hardware_type = LTE_FDD_DL_SCAN_HW_TYPE_HACKRF;
samp_src = tmp_src1;
}else{
osmosdr::source::sptr tmp_src3 = osmosdr::source::make("rtl=0");
if(0 != tmp_src3->get_sample_rates().size())
osmosdr::source::sptr tmp_src2 = osmosdr::source::make("bladerf");
if(0 != tmp_src2->get_sample_rates().size())
{
hardware_type = LTE_FDD_DL_SCAN_HW_TYPE_RTL_SDR;
samp_src = tmp_src3;
hardware_type = LTE_FDD_DL_SCAN_HW_TYPE_BLADERF;
samp_src = tmp_src2;
}else{
samp_src = osmosdr::source::make();
osmosdr::source::sptr tmp_src3 = osmosdr::source::make("rtl=0");
if(0 != tmp_src3->get_sample_rates().size())
{
hardware_type = LTE_FDD_DL_SCAN_HW_TYPE_RTL_SDR;
samp_src = tmp_src3;
}else{
samp_src = osmosdr::source::make();
}
}
}
}
......@@ -186,6 +202,9 @@ LTE_FDD_DL_SCAN_STATUS_ENUM LTE_fdd_dl_scan_flowgraph::start(uint16 dl_earfcn)
case LTE_FDD_DL_SCAN_HW_TYPE_USRP_N:
state_machine = LTE_fdd_dl_scan_make_state_machine(15360000);
break;
case LTE_FDD_DL_SCAN_HW_TYPE_USRP_X:
state_machine = LTE_fdd_dl_scan_make_state_machine(15360000);
break;
case LTE_FDD_DL_SCAN_HW_TYPE_HACKRF:
state_machine = LTE_fdd_dl_scan_make_state_machine(15360000);
break;
......@@ -221,6 +240,12 @@ LTE_FDD_DL_SCAN_STATUS_ENUM LTE_fdd_dl_scan_flowgraph::start(uint16 dl_earfcn)
samp_src->set_gain(35);
samp_src->set_bandwidth(10000000);
break;
case LTE_FDD_DL_SCAN_HW_TYPE_USRP_X:
samp_src->set_sample_rate(15360000);
samp_src->set_gain_mode(false);
samp_src->set_gain(25);
samp_src->set_bandwidth(10000000);
break;
case LTE_FDD_DL_SCAN_HW_TYPE_HACKRF:
samp_src->set_sample_rate(15360000);
samp_src->set_gain_mode(false);
......
......@@ -26,5 +26,5 @@ add_executable(LTE_fdd_enodeb
)
target_link_libraries(LTE_fdd_enodeb lte fftw3f tools pthread rt ${POLARSSL_LIBRARIES} ${UHD_LIBRARIES} ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_PMT_LIBRARIES})
install(TARGETS LTE_fdd_enodeb DESTINATION bin)
install(CODE "execute_process(COMMAND chmod +x ${CMAKE_SOURCE_DIR}/enodeb_nat_script.sh)")
install(CODE "execute_process(COMMAND ${CMAKE_SOURCE_DIR}/enodeb_nat_script.sh)")
\ No newline at end of file
install(CODE "execute_process(COMMAND chmod +x \"${CMAKE_SOURCE_DIR}/enodeb_nat_script.sh\")")
install(CODE "execute_process(COMMAND \"${CMAKE_SOURCE_DIR}/enodeb_nat_script.sh\")")
......@@ -25,6 +25,7 @@
Revision History
---------- ------------- --------------------------------------------
11/29/2014 Ben Wojtowicz Created file
12/16/2014 Ben Wojtowicz Added ol extension to message queue.
*******************************************************************************/
......@@ -82,7 +83,7 @@ private:
// Communication
void handle_pdcp_msg(LTE_FDD_ENB_MESSAGE_STRUCT *msg);
LTE_fdd_enb_msgq *pdcp_comm_msgq;
boost::interprocess::message_queue *gw_pdcp_mq;
boost::interprocess::message_queue *gw_pdcp_olmq;
// PDCP Message Handlers
void handle_gw_data(LTE_FDD_ENB_GW_DATA_READY_MSG_STRUCT *gw_data);
......
......@@ -30,6 +30,7 @@
06/15/2014 Ben Wojtowicz Added uplink scheduling and changed fn_combo
to current_tti.
11/29/2014 Ben Wojtowicz Using the byte message struct for SDUs.
12/16/2014 Ben Wojtowicz Added ol extension to message queues.
*******************************************************************************/
......@@ -116,8 +117,8 @@ private:
void handle_rlc_msg(LTE_FDD_ENB_MESSAGE_STRUCT *msg);
LTE_fdd_enb_msgq *phy_comm_msgq;
LTE_fdd_enb_msgq *rlc_comm_msgq;
boost::interprocess::message_queue *mac_phy_mq;
boost::interprocess::message_queue *mac_rlc_mq;
boost::interprocess::message_queue *mac_phy_olmq;
boost::interprocess::message_queue *mac_rlc_olmq;
// PHY Message Handlers
void handle_ready_to_send(LTE_FDD_ENB_READY_TO_SEND_MSG_STRUCT *rts);
......
......@@ -35,6 +35,8 @@
11/29/2014 Ben Wojtowicz Added service request, service reject, and
activate dedicated EPS bearer context
request support.
12/16/2014 Ben Wojtowicz Added ol extension to message queue and
sending of EMM information message.
*******************************************************************************/
......@@ -96,7 +98,7 @@ private:
// Communication
void handle_rrc_msg(LTE_FDD_ENB_MESSAGE_STRUCT *msg);
LTE_fdd_enb_msgq *rrc_comm_msgq;
boost::interprocess::message_queue *mme_rrc_mq;
boost::interprocess::message_queue *mme_rrc_olmq;
// RRC Message Handlers
void handle_nas_msg(LTE_FDD_ENB_MME_NAS_MSG_READY_MSG_STRUCT *nas_msg);
......@@ -124,6 +126,7 @@ private:
void send_attach_reject(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void send_authentication_reject(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void send_authentication_request(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void send_emm_information(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void send_identity_request(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb, uint8 id_type);
void send_security_mode_command(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void send_service_reject(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb, uint8 cause);
......
......@@ -27,6 +27,7 @@
11/09/2013 Ben Wojtowicz Created file
05/04/2014 Ben Wojtowicz Added communication to RLC and RRC.
11/29/2014 Ben Wojtowicz Added communication to IP gateway.
12/16/2014 Ben Wojtowicz Added ol extension to message queues.
*******************************************************************************/
......@@ -92,9 +93,9 @@ private:
LTE_fdd_enb_msgq *rlc_comm_msgq;
LTE_fdd_enb_msgq *rrc_comm_msgq;
LTE_fdd_enb_msgq *gw_comm_msgq;
boost::interprocess::message_queue *pdcp_rlc_mq;
boost::interprocess::message_queue *pdcp_rrc_mq;
boost::interprocess::message_queue *pdcp_gw_mq;
boost::interprocess::message_queue *pdcp_rlc_olmq;
boost::interprocess::message_queue *pdcp_rrc_olmq;
boost::interprocess::message_queue *pdcp_gw_olmq;
// RLC Message Handlers
void handle_pdu_ready(LTE_FDD_ENB_PDCP_PDU_READY_MSG_STRUCT *pdu_ready);
......
......@@ -29,6 +29,7 @@
added the ability to handle late subframes.
05/04/2014 Ben Wojtowicz Added PHICH support.
06/15/2014 Ben Wojtowicz Changed fn_combo to current_tti.
12/16/2014 Ben Wojtowicz Added ol extension to message queue.
*******************************************************************************/
......@@ -98,7 +99,7 @@ private:
// Communication
void handle_mac_msg(LTE_FDD_ENB_MESSAGE_STRUCT *msg);
LTE_fdd_enb_msgq *mac_comm_msgq;
boost::interprocess::message_queue *phy_mac_mq;
boost::interprocess::message_queue *phy_mac_olmq;
// Generic parameters
LIBLTE_PHY_STRUCT *phy_struct;
......
......@@ -37,6 +37,7 @@
procedures, and PDCP configs, moved almost
everything to byte messages structs, added
IP gateway and RLC UMD support.
12/16/2014 Ben Wojtowicz Added QoS for default data services.
*******************************************************************************/
......@@ -170,14 +171,17 @@ static const char LTE_fdd_enb_mac_config_text[LTE_FDD_ENB_MAC_CONFIG_N_ITEMS][20
typedef enum{
LTE_FDD_ENB_QOS_NONE = 0,
LTE_FDD_ENB_QOS_SIGNALLING,
LTE_FDD_ENB_QOS_DEFAULT_DATA,
LTE_FDD_ENB_QOS_N_ITEMS,
}LTE_FDD_ENB_QOS_ENUM;
static const char LTE_fdd_enb_qos_text[LTE_FDD_ENB_QOS_N_ITEMS][20] = {"None",
"Signalling"};
"Signalling",
"Default Data"};
typedef struct{
uint32 tti_frequency;
uint32 bytes_per_subfn;
LTE_FDD_ENB_QOS_ENUM qos;
uint32 tti_frequency;
uint32 bytes_per_subfn;
}LTE_FDD_ENB_QOS_STRUCT;
/*******************************************************************************
......
......@@ -29,6 +29,7 @@
06/15/2014 Ben Wojtowicz Using the latest LTE library.
08/03/2014 Ben Wojtowicz Added transmit functionality.
11/29/2014 Ben Wojtowicz Using the byte message structure.
12/16/2014 Ben Wojtowicz Added ol extension to message queues.
*******************************************************************************/
......@@ -93,8 +94,8 @@ private:
void handle_pdcp_msg(LTE_FDD_ENB_MESSAGE_STRUCT *msg);
LTE_fdd_enb_msgq *mac_comm_msgq;
LTE_fdd_enb_msgq *pdcp_comm_msgq;
boost::interprocess::message_queue *rlc_mac_mq;
boost::interprocess::message_queue *rlc_pdcp_mq;
boost::interprocess::message_queue *rlc_mac_olmq;
boost::interprocess::message_queue *rlc_pdcp_olmq;
// MAC Message Handlers
void handle_pdu_ready(LTE_FDD_ENB_RLC_PDU_READY_MSG_STRUCT *pdu_ready);
......
......@@ -35,6 +35,7 @@
security mode command messages.
11/29/2014 Ben Wojtowicz Added user and rb update to
parse_ul_ccch_message.
12/16/2014 Ben Wojtowicz Added ol extension to message queues.
*******************************************************************************/
......@@ -99,8 +100,8 @@ private:
void handle_mme_msg(LTE_FDD_ENB_MESSAGE_STRUCT *msg);
LTE_fdd_enb_msgq *pdcp_comm_msgq;
LTE_fdd_enb_msgq *mme_comm_msgq;
boost::interprocess::message_queue *rrc_pdcp_mq;
boost::interprocess::message_queue *rrc_mme_mq;
boost::interprocess::message_queue *rrc_pdcp_olmq;
boost::interprocess::message_queue *rrc_mme_olmq;
// PDCP Message Handlers
void handle_pdu_ready(LTE_FDD_ENB_RRC_PDU_READY_MSG_STRUCT *pdu_ready);
......
......@@ -33,6 +33,7 @@
11/01/2014 Ben Wojtowicz Added more MME support and RRC key storage.
11/29/2014 Ben Wojtowicz Added DRB setup/teardown and C-RNTI release
timer support.
12/16/2014 Ben Wojtowicz Changed the delayed delete functionality.
*******************************************************************************/
......@@ -177,8 +178,8 @@ public:
LIBLTE_MAC_PDU_STRUCT pusch_mac_pdu;
// Generic
void set_delete_at_idle(bool dai);
bool get_delete_at_idle(void);
void set_N_del_ticks(uint32 N_ticks);
uint32 get_N_del_ticks(void);
private:
// Identity
......@@ -211,7 +212,7 @@ private:
LTE_fdd_enb_rb *srb0;
LTE_fdd_enb_rb *srb1;
LTE_fdd_enb_rb *srb2;
LTE_fdd_enb_rb *drb[31];
LTE_fdd_enb_rb *drb[8];
// MME
LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts;
......@@ -228,7 +229,7 @@ private:
// Generic
void handle_timer_expiry(uint32 timer_id);
bool delete_at_idle;
uint32 N_del_ticks;
};
#endif /* __LTE_FDD_ENB_USER_H__ */
......@@ -31,6 +31,7 @@
11/29/2014 Ben Wojtowicz Refactored C-RNTI assign/release, added
C-RNTI transfer, added more ways to add,
delete, and find users.
12/16/2014 Ben Wojtowicz Added delayed user delete functionality.
*******************************************************************************/
......@@ -84,10 +85,11 @@ public:
LTE_FDD_ENB_ERROR_ENUM find_user(LIBLTE_MME_EPS_MOBILE_ID_GUTI_STRUCT *guti, LTE_fdd_enb_user **user);
LTE_FDD_ENB_ERROR_ENUM find_user(LIBLTE_RRC_S_TMSI_STRUCT *s_tmsi, LTE_fdd_enb_user **user);
LTE_FDD_ENB_ERROR_ENUM find_user(uint32 ip_addr, LTE_fdd_enb_user **user);
LTE_FDD_ENB_ERROR_ENUM del_user(LTE_fdd_enb_user *user);
LTE_FDD_ENB_ERROR_ENUM del_user(std::string imsi);
LTE_FDD_ENB_ERROR_ENUM del_user(uint16 c_rnti);
LTE_FDD_ENB_ERROR_ENUM del_user(LIBLTE_MME_EPS_MOBILE_ID_GUTI_STRUCT *guti);
LTE_FDD_ENB_ERROR_ENUM del_user(LTE_fdd_enb_user *user, bool delayed);
LTE_FDD_ENB_ERROR_ENUM del_user(std::string imsi, bool delayed);
LTE_FDD_ENB_ERROR_ENUM del_user(uint16 c_rnti, bool delayed);
LTE_FDD_ENB_ERROR_ENUM del_user(LIBLTE_MME_EPS_MOBILE_ID_GUTI_STRUCT *guti, bool delayed);
void handle_tick(void);
private:
// Singleton
......@@ -100,6 +102,7 @@ private:
// User storage
std::list<LTE_fdd_enb_user*> user_list;
std::list<LTE_fdd_enb_user*> delayed_del_user_list;
std::map<uint16, LTE_fdd_enb_user*> c_rnti_map;
std::map<uint32, uint16> timer_id_map_forward;
std::map<uint16, uint32> timer_id_map_reverse;
......
......@@ -26,6 +26,7 @@
Revision History
---------- ------------- --------------------------------------------
11/29/2014 Ben Wojtowicz Created file
12/16/2014 Ben Wojtowicz Added ol extension to message queue.
*******************************************************************************/
......@@ -185,10 +186,10 @@ LTE_FDD_ENB_ERROR_ENUM LTE_fdd_enb_gw::start(char *err_str)
}
// Setup PDCP communication
pdcp_comm_msgq = new LTE_fdd_enb_msgq("pdcp_gw_mq",
pdcp_comm_msgq = new LTE_fdd_enb_msgq("pdcp_gw_olmq",
pdcp_cb);
gw_pdcp_mq = new boost::interprocess::message_queue(boost::interprocess::open_only,
"gw_pdcp_mq");
gw_pdcp_olmq = new boost::interprocess::message_queue(boost::interprocess::open_only,
"gw_pdcp_olmq");
// Setup a thread to receive packets from the TUN device
pthread_create(&rx_thread, NULL, &receive_thread, this);
......@@ -312,7 +313,7 @@ void* LTE_fdd_enb_gw::receive_thread(void *inputs)
// Send message to PDCP
pdcp_data_sdu.rb->queue_pdcp_data_sdu(&msg);
LTE_fdd_enb_msgq::send(gw->gw_pdcp_mq,
LTE_fdd_enb_msgq::send(gw->gw_pdcp_olmq,
LTE_FDD_ENB_MESSAGE_TYPE_PDCP_DATA_SDU_READY,
LTE_FDD_ENB_DEST_LAYER_PDCP,
(LTE_FDD_ENB_MESSAGE_UNION *)&pdcp_data_sdu,
......
This diff is collapsed.
......@@ -41,6 +41,7 @@
the first downlink RLC message.
11/01/2014 Ben Wojtowicz Added NDI toggling.
11/29/2014 Ben Wojtowicz Using the byte message struct for SDUs.
12/16/2014 Ben Wojtowicz Added ol extension to message queues.
*******************************************************************************/
......@@ -127,15 +128,15 @@ void LTE_fdd_enb_mac::start(LTE_fdd_enb_interface *iface)
{
interface = iface;
started = true;
phy_comm_msgq = new LTE_fdd_enb_msgq("phy_mac_mq",
phy_comm_msgq = new LTE_fdd_enb_msgq("phy_mac_olmq",
phy_cb,
90);
rlc_comm_msgq = new LTE_fdd_enb_msgq("rlc_mac_mq",
rlc_comm_msgq = new LTE_fdd_enb_msgq("rlc_mac_olmq",
rlc_cb);
mac_phy_mq = new boost::interprocess::message_queue(boost::interprocess::open_only,
"mac_phy_mq");
mac_rlc_mq = new boost::interprocess::message_queue(boost::interprocess::open_only,
"mac_rlc_mq");
mac_phy_olmq = new boost::interprocess::message_queue(boost::interprocess::open_only,
"mac_phy_olmq");
mac_rlc_olmq = new boost::interprocess::message_queue(boost::interprocess::open_only,
"mac_rlc_olmq");
// Scheduler
cnfg_db->get_sys_info(sys_info);
......@@ -210,7 +211,7 @@ void LTE_fdd_enb_mac::handle_phy_msg(LTE_FDD_ENB_MESSAGE_STRUCT *msg)
}
}else{
// Forward message to RLC
mac_rlc_mq->send(&msg, sizeof(msg), 0);
mac_rlc_olmq->send(&msg, sizeof(msg), 0);
}
}
void LTE_fdd_enb_mac::handle_rlc_msg(LTE_FDD_ENB_MESSAGE_STRUCT *msg)
......@@ -236,7 +237,7 @@ void LTE_fdd_enb_mac::handle_rlc_msg(LTE_FDD_ENB_MESSAGE_STRUCT *msg)
}
}else{
// Forward message to PHY
mac_phy_mq->send(&msg, sizeof(msg), 0);
mac_phy_olmq->send(&msg, sizeof(msg), 0);
}
}
......@@ -356,12 +357,12 @@ void LTE_fdd_enb_mac::handle_ready_to_send(LTE_FDD_ENB_READY_TO_SEND_MSG_STRUCT
}
}
LTE_fdd_enb_msgq::send(mac_phy_mq,
LTE_fdd_enb_msgq::send(mac_phy_olmq,
LTE_FDD_ENB_MESSAGE_TYPE_DL_SCHEDULE,
LTE_FDD_ENB_DEST_LAYER_PHY,
(LTE_FDD_ENB_MESSAGE_UNION *)&sched_dl_subfr[sched_cur_dl_subfn],
sizeof(LTE_FDD_ENB_DL_SCHEDULE_MSG_STRUCT));
LTE_fdd_enb_msgq::send(mac_phy_mq,
LTE_fdd_enb_msgq::send(mac_phy_olmq,
LTE_FDD_ENB_MESSAGE_TYPE_UL_SCHEDULE,
LTE_FDD_ENB_DEST_LAYER_PHY,
(LTE_FDD_ENB_MESSAGE_UNION *)&sched_ul_subfr[sched_cur_ul_subfn],
......@@ -611,7 +612,7 @@ void LTE_fdd_enb_mac::handle_ulsch_ccch_sdu(LTE_fdd_enb_user *user,
// Signal RLC
rlc_pdu_ready.user = user;
rlc_pdu_ready.rb = rb;
LTE_fdd_enb_msgq::send(mac_rlc_mq,
LTE_fdd_enb_msgq::send(mac_rlc_olmq,
LTE_FDD_ENB_MESSAGE_TYPE_RLC_PDU_READY,
LTE_FDD_ENB_DEST_LAYER_RLC,
(LTE_FDD_ENB_MESSAGE_UNION *)&rlc_pdu_ready,
......@@ -670,7 +671,7 @@ void LTE_fdd_enb_mac::handle_ulsch_dcch_sdu(LTE_fdd_enb_user *user,
// Signal RLC
rlc_pdu_ready.user = user;
rlc_pdu_ready.rb = rb;
LTE_fdd_enb_msgq::send(mac_rlc_mq,
LTE_fdd_enb_msgq::send(mac_rlc_olmq,
LTE_FDD_ENB_MESSAGE_TYPE_RLC_PDU_READY,
LTE_FDD_ENB_DEST_LAYER_RLC,
(LTE_FDD_ENB_MESSAGE_UNION *)&rlc_pdu_ready,
......@@ -722,7 +723,7 @@ void LTE_fdd_enb_mac::handle_ulsch_c_rnti(LTE_fdd_enb_user **user,
if(c_rnti->c_rnti != (*user)->get_c_rnti())
{
user_mgr->find_user(c_rnti->c_rnti, user);
user_mgr->del_user(old_c_rnti);
user_mgr->del_user(old_c_rnti, false);
}
}
void LTE_fdd_enb_mac::handle_ulsch_truncated_bsr(LTE_fdd_enb_user *user,
......
......@@ -36,6 +36,8 @@
11/29/2014 Ben Wojtowicz Added service request, service reject, and
activate dedicated EPS bearer context
request support.
12/16/2014 Ben Wojtowicz Added ol extension to message queue and
sending of EMM information message.
*******************************************************************************/
......@@ -121,10 +123,10 @@ void LTE_fdd_enb_mme::start(void)
if(!started)
{
started = true;
rrc_comm_msgq = new LTE_fdd_enb_msgq("rrc_mme_mq",
rrc_comm_msgq = new LTE_fdd_enb_msgq("rrc_mme_olmq",
rrc_cb);
mme_rrc_mq = new boost::interprocess::message_queue(boost::interprocess::open_only,
"mme_rrc_mq");
mme_rrc_olmq = new boost::interprocess::message_queue(boost::interprocess::open_only,
"mme_rrc_olmq");
cnfg_db->get_param(LTE_FDD_ENB_PARAM_IP_ADDR_START, next_ip_addr);
cnfg_db->get_param(LTE_FDD_ENB_PARAM_DNS_ADDR, dns_addr);
......@@ -1046,6 +1048,7 @@ void LTE_fdd_enb_mme::attach_sm(LTE_fdd_enb_user *user,
{
LTE_fdd_enb_interface *interface = LTE_fdd_enb_interface::get_instance();
LTE_fdd_enb_hss *hss = LTE_fdd_enb_hss::get_instance();
LTE_fdd_enb_user_mgr *user_mgr = LTE_fdd_enb_user_mgr::get_instance();
switch(rb->get_mme_state())
{
......@@ -1053,7 +1056,7 @@ void LTE_fdd_enb_mme::attach_sm(LTE_fdd_enb_user *user,
send_identity_request(user, rb, LIBLTE_MME_ID_TYPE_2_IMSI);
break;
case LTE_FDD_ENB_MME_STATE_REJECT:
user->set_delete_at_idle(true);
user_mgr->del_user(user, true);
send_attach_reject(user, rb);
break;
case LTE_FDD_ENB_MME_STATE_AUTHENTICATE:
......@@ -1237,7 +1240,7 @@ void LTE_fdd_enb_mme::send_attach_accept(LTE_fdd_enb_user *user,
cmd_ready.user = user;
cmd_ready.rb = rb;
cmd_ready.cmd = LTE_FDD_ENB_RRC_CMD_SETUP_DEF_DRB;
LTE_fdd_enb_msgq::send(mme_rrc_mq,
LTE_fdd_enb_msgq::send(mme_rrc_olmq,
LTE_FDD_ENB_MESSAGE_TYPE_RRC_CMD_READY,
LTE_FDD_ENB_DEST_LAYER_RRC,
(LTE_FDD_ENB_MESSAGE_UNION *)&cmd_ready,
......@@ -1279,7 +1282,7 @@ void LTE_fdd_enb_mme::send_attach_reject(LTE_fdd_enb_user *user,
// Signal RRC for NAS message
nas_msg_ready.user = user;
nas_msg_ready.rb = rb;
LTE_fdd_enb_msgq::send(mme_rrc_mq,
LTE_fdd_enb_msgq::send(mme_rrc_olmq,
LTE_FDD_ENB_MESSAGE_TYPE_RRC_NAS_MSG_READY,
LTE_FDD_ENB_DEST_LAYER_RRC,
(LTE_FDD_ENB_MESSAGE_UNION *)&nas_msg_ready,
......@@ -1311,7 +1314,7 @@ void LTE_fdd_enb_mme::send_authentication_reject(LTE_fdd_enb_user *user,
// Signal RRC for NAS message
nas_msg_ready.user = user;
nas_msg_ready.rb = rb;
LTE_fdd_enb_msgq::send(mme_rrc_mq,
LTE_fdd_enb_msgq::send(mme_rrc_olmq,
LTE_FDD_ENB_MESSAGE_TYPE_RRC_NAS_MSG_READY,
LTE_FDD_ENB_DEST_LAYER_RRC,
(LTE_FDD_ENB_MESSAGE_UNION *)&nas_msg_ready,
......@@ -1359,13 +1362,66 @@ void LTE_fdd_enb_mme::send_authentication_request(LTE_fdd_enb_user *user,
// Signal RRC
nas_msg_ready.user = user;
nas_msg_ready.rb = rb;
LTE_fdd_enb_msgq::send(mme_rrc_mq,
LTE_fdd_enb_msgq::send(mme_rrc_olmq,
LTE_FDD_ENB_MESSAGE_TYPE_RRC_NAS_MSG_READY,
LTE_FDD_ENB_DEST_LAYER_RRC,
(LTE_FDD_ENB_MESSAGE_UNION *)&nas_msg_ready,
sizeof(LTE_FDD_ENB_RRC_NAS_MSG_READY_MSG_STRUCT));
}
}
void LTE_fdd_enb_mme::send_emm_information(LTE_fdd_enb_user *user,
LTE_fdd_enb_rb *rb)
{
LTE_fdd_enb_interface *interface = LTE_fdd_enb_interface::get_instance();
LTE_FDD_ENB_RRC_NAS_MSG_READY_MSG_STRUCT nas_msg_ready;
LIBLTE_MME_EMM_INFORMATION_MSG_STRUCT emm_info;
LIBLTE_BYTE_MSG_STRUCT msg;
struct tm *broken_down_time;
time_t tmp_time;
tmp_time = time(NULL);
broken_down_time = localtime(&tmp_time);
emm_info.full_net_name_present = false;
emm_info.short_net_name_present = false;
emm_info.local_time_zone_present = false;
emm_info.utc_and_local_time_zone_present = true;
emm_info.utc_and_local_time_zone.year = (((broken_down_time->tm_year % 100)/10) << 4) | (broken_down_time->tm_year % 10);
emm_info.utc_and_local_time_zone.month = ((broken_down_time->tm_mon/10) << 4) | (broken_down_time->tm_mon % 10);
emm_info.utc_and_local_time_zone.day = ((broken_down_time->tm_mday/10) << 4) | (broken_down_time->tm_mday % 10);
emm_info.utc_and_local_time_zone.hour = ((broken_down_time->tm_hour/10) << 4) | (broken_down_time->tm_hour % 10);
emm_info.utc_and_local_time_zone.minute = ((broken_down_time->tm_min/10) << 4) | (broken_down_time->tm_min % 10);
emm_info.utc_and_local_time_zone.second = ((broken_down_time->tm_sec/10) << 4) | (broken_down_time->tm_sec % 10);
emm_info.utc_and_local_time_zone.tz = 0; // FIXME
emm_info.net_dst_present = false;
liblte_mme_pack_emm_information_msg(&emm_info,
LIBLTE_MME_SECURITY_HDR_TYPE_INTEGRITY_AND_CIPHERED,
user->get_auth_vec()->k_nas_int,
user->get_auth_vec()->nas_count_dl,
LIBLTE_SECURITY_DIRECTION_DOWNLINK,
rb->get_rb_id()-1,
&msg);
interface->send_debug_msg(LTE_FDD_ENB_DEBUG_TYPE_INFO,
LTE_FDD_ENB_DEBUG_LEVEL_MME,
__FILE__,
__LINE__,
&msg,
"Sending EMM Information for RNTI=%u, RB=%s",
user->get_c_rnti(),
LTE_fdd_enb_rb_text[rb->get_rb_id()]);
// Queue the NAS message for RRC
rb->queue_rrc_nas_msg(&msg);
// Signal RRC
nas_msg_ready.user = user;
nas_msg_ready.rb = rb;
LTE_fdd_enb_msgq::send(mme_rrc_olmq,
LTE_FDD_ENB_MESSAGE_TYPE_RRC_NAS_MSG_READY,
LTE_FDD_ENB_DEST_LAYER_RRC,
(LTE_FDD_ENB_MESSAGE_UNION *)&nas_msg_ready,
sizeof(LTE_FDD_ENB_RRC_NAS_MSG_READY_MSG_STRUCT));
}
void LTE_fdd_enb_mme::send_identity_request(LTE_fdd_enb_user *user,
LTE_fdd_enb_rb *rb,
uint8 id_type)
......@@ -1392,7 +1448,7 @@ void LTE_fdd_enb_mme::send_identity_request(LTE_fdd_enb_user *user,
// Signal RRC
nas_msg_ready.user = user;
nas_msg_ready.rb = rb;
LTE_fdd_enb_msgq::send(mme_rrc_mq,
LTE_fdd_enb_msgq::send(mme_rrc_olmq,
LTE_FDD_ENB_MESSAGE_TYPE_RRC_NAS_MSG_READY,
LTE_FDD_ENB_DEST_LAYER_RRC,
(LTE_FDD_ENB_MESSAGE_UNION *)&nas_msg_ready,
......@@ -1464,7 +1520,7 @@ void LTE_fdd_enb_mme::send_security_mode_command(LTE_fdd_enb_user *user,
// Signal RRC
nas_msg_ready.user = user;
nas_msg_ready.rb = rb;
LTE_fdd_enb_msgq::send(mme_rrc_mq,
LTE_fdd_enb_msgq::send(mme_rrc_olmq,
LTE_FDD_ENB_MESSAGE_TYPE_RRC_NAS_MSG_READY,
LTE_FDD_ENB_DEST_LAYER_RRC,
(LTE_FDD_ENB_MESSAGE_UNION *)&nas_msg_ready,
......@@ -1503,7 +1559,7 @@ void LTE_fdd_enb_mme::send_service_reject(LTE_fdd_enb_user *user,
nas_msg_ready.user = user;
nas_msg_ready.rb = rb;
LTE_fdd_enb_msgq::send(mme_rrc_mq,
LTE_fdd_enb_msgq::send(mme_rrc_olmq,
LTE_FDD_ENB_MESSAGE_TYPE_RRC_NAS_MSG_READY,
LTE_FDD_ENB_DEST_LAYER_RRC,
(LTE_FDD_ENB_MESSAGE_UNION *)&nas_msg_ready,
......@@ -1584,7 +1640,7 @@ void LTE_fdd_enb_mme::send_activate_dedicated_eps_bearer_context_request(LTE_fdd
cmd_ready.user = user;
cmd_ready.rb = rb;
cmd_ready.cmd = LTE_FDD_ENB_RRC_CMD_SETUP_DED_DRB;
LTE_fdd_enb_msgq::send(mme_rrc_mq,
LTE_fdd_enb_msgq::send(mme_rrc_olmq,
LTE_FDD_ENB_MESSAGE_TYPE_RRC_CMD_READY,
LTE_FDD_ENB_DEST_LAYER_RRC,
(LTE_FDD_ENB_MESSAGE_UNION *)&cmd_ready,
......@@ -1630,7 +1686,7 @@ void LTE_fdd_enb_mme::send_esm_information_request(LTE_fdd_enb_user *user,
// Signal RRC
nas_msg_ready.user = user;
nas_msg_ready.rb = rb;
LTE_fdd_enb_msgq::send(mme_rrc_mq,
LTE_fdd_enb_msgq::send(mme_rrc_olmq,
LTE_FDD_ENB_MESSAGE_TYPE_RRC_NAS_MSG_READY,
LTE_FDD_ENB_DEST_LAYER_RRC,
(LTE_FDD_ENB_MESSAGE_UNION *)&nas_msg_ready,
......@@ -1646,7 +1702,7 @@ void LTE_fdd_enb_mme::send_rrc_command(LTE_fdd_enb_user *user,
cmd_ready.user = user;
cmd_ready.rb = rb;
cmd_ready.cmd = cmd;
LTE_fdd_enb_msgq::send(mme_rrc_mq,
LTE_fdd_enb_msgq::send(mme_rrc_olmq,
LTE_FDD_ENB_MESSAGE_TYPE_RRC_CMD_READY,
LTE_FDD_ENB_DEST_LAYER_RRC,
(LTE_FDD_ENB_MESSAGE_UNION *)&cmd_ready,
......
......@@ -32,6 +32,7 @@
08/03/2014 Ben Wojtowicz Added transmit functionality.
11/01/2014 Ben Wojtowicz Added SRB2 and security support.
11/29/2014 Ben Wojtowicz Added communication to IP gateway.
12/16/2014 Ben Wojtowicz Added ol extension to message queues.
*******************************************************************************/
......@@ -116,18 +117,18 @@ void LTE_fdd_enb_pdcp::start(void)
if(!started)
{
started = true;
rlc_comm_msgq = new LTE_fdd_enb_msgq("rlc_pdcp_mq",
rlc_comm_msgq = new LTE_fdd_enb_msgq("rlc_pdcp_olmq",
rlc_cb);
rrc_comm_msgq = new LTE_fdd_enb_msgq("rrc_pdcp_mq",
rrc_comm_msgq = new LTE_fdd_enb_msgq("rrc_pdcp_olmq",
rrc_cb);
gw_comm_msgq = new LTE_fdd_enb_msgq("gw_pdcp_mq",
gw_comm_msgq = new LTE_fdd_enb_msgq("gw_pdcp_olmq",
gw_cb);
pdcp_rlc_mq = new boost::interprocess::message_queue(boost::interprocess::open_only,
"pdcp_rlc_mq");
pdcp_rrc_mq = new boost::interprocess::message_queue(boost::interprocess::open_only,
"pdcp_rrc_mq");
pdcp_gw_mq = new boost::interprocess::message_queue(boost::interprocess::open_only,
"pdcp_gw_mq");
pdcp_rlc_olmq = new boost::interprocess::message_queue(boost::interprocess::open_only,
"pdcp_rlc_olmq");
pdcp_rrc_olmq = new boost::interprocess::message_queue(boost::interprocess::open_only,
"pdcp_rrc_olmq");
pdcp_gw_olmq = new boost::interprocess::message_queue(boost::interprocess::open_only,
"pdcp_gw_olmq");
}
}
void LTE_fdd_enb_pdcp::stop(void)
......@@ -170,7 +171,7 @@ void LTE_fdd_enb_pdcp::handle_rlc_msg(LTE_FDD_ENB_MESSAGE_STRUCT *msg)
}
}else{
// Forward message to RRC
pdcp_rrc_mq->send(&msg, sizeof(msg), 0);
pdcp_rrc_olmq->send(&msg, sizeof(msg), 0);
}