OpenLTE 基站相关头文件:用户、定时器、基站接口、消息接口
Table of Contents
用户:LTE_fdd_enb_user.h
用户管理:LTE_fdd_enb_user_mgr.h
定时器:LTE_fdd_enb_timer.h
定时器管理:LTE_fdd_enb_timer_mgr.h
消息接口:LTE_fdd_enb_msgq.h
基站接口:LTE_fdd_enb_interface.h
用户:LTE_fdd_enb_user.h
/*******************************************************************************Copyright 2013-2017 Ben WojtowiczThis program is free software: you can redistribute it and/or modifyit under the terms of the GNU Affero General Public License as published bythe Free Software Foundation, either version 3 of the License, or(at your option) any later version.This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU Affero General Public License for more details.You should have received a copy of the GNU Affero General Public Licensealong with this program. If not, see <http://www.gnu.org/licenses/>.*******************************************************************************File: LTE_fdd_enb_user.hDescription: Contains all the definitions for the LTE FDD eNodeBuser class.Revision History---------- ------------- --------------------------------------------11/09/2013 Ben Wojtowicz Created file05/04/2014 Ben Wojtowicz Added radio bearer support.06/15/2014 Ben Wojtowicz Added initialize routine.08/03/2014 Ben Wojtowicz Refactored user identities.09/03/2014 Ben Wojtowicz Added ciphering and integrity algorithmstoring.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 releasetimer support.12/16/2014 Ben Wojtowicz Changed the delayed delete functionality.02/15/2015 Ben Wojtowicz Added clear_rbs and fixed copy_rbs.07/25/2015 Ben Wojtowicz Moved the QoS structure from the RB class tothe user class and got rid of the cachedcopy of pusch_mac_pdu.12/06/2015 Ben Wojtowicz Changed the deletion and C-RNTI releaseprocedures.02/13/2016 Ben Wojtowicz Added an inactivity timer.03/12/2016 Ben Wojtowicz Added H-ARQ support.07/29/2017 Ben Wojtowicz Remove QOS support and fixed UL scheduling.*******************************************************************************/#ifndef __LTE_FDD_ENB_USER_H__
#define __LTE_FDD_ENB_USER_H__/*******************************************************************************INCLUDES
*******************************************************************************/#include "LTE_fdd_enb_rb.h"
#include "liblte_phy.h"
#include "liblte_mac.h"
#include "liblte_mme.h"
#include "typedefs.h"
#include <string>/*******************************************************************************DEFINES
*******************************************************************************/#define LTE_FDD_ENB_USER_INACTIVITY_TIMER_VALUE_MS 10000/*******************************************************************************FORWARD DECLARATIONS
*******************************************************************************//*******************************************************************************TYPEDEFS
*******************************************************************************/typedef struct{uint64 imsi;uint64 imei;
}LTE_FDD_ENB_USER_ID_STRUCT;typedef struct{uint32 nas_count_ul;uint32 nas_count_dl;uint8 rand[16];uint8 res[8];uint8 ck[16];uint8 ik[16];uint8 autn[16];uint8 k_nas_enc[32];uint8 k_nas_int[32];uint8 k_rrc_enc[32];uint8 k_rrc_int[32];
}LTE_FDD_ENB_AUTHENTICATION_VECTOR_STRUCT;typedef struct{LIBLTE_MAC_PDU_STRUCT mac_pdu;LIBLTE_PHY_ALLOCATION_STRUCT alloc;
}LTE_FDD_ENB_HARQ_INFO_STRUCT;/*******************************************************************************CLASS DECLARATIONS
*******************************************************************************/class LTE_fdd_enb_user
{
public:// Constructor/DestructorLTE_fdd_enb_user();~LTE_fdd_enb_user();// Initializevoid init(void);// Identityvoid set_id(LTE_FDD_ENB_USER_ID_STRUCT *identity);LTE_FDD_ENB_USER_ID_STRUCT* get_id(void);bool is_id_set(void);void set_guti(LIBLTE_MME_EPS_MOBILE_ID_GUTI_STRUCT *_guti);LIBLTE_MME_EPS_MOBILE_ID_GUTI_STRUCT* get_guti(void);bool is_guti_set(void);void set_temp_id(uint64 id);uint64 get_temp_id(void);std::string get_imsi_str(void);uint64 get_imsi_num(void);std::string get_imei_str(void);uint64 get_imei_num(void);void set_c_rnti(uint16 _c_rnti);uint16 get_c_rnti(void);bool is_c_rnti_set(void);void set_ip_addr(uint32 addr);uint32 get_ip_addr(void);bool is_ip_addr_set(void);void prepare_for_deletion(void);// Securityvoid set_auth_vec(LTE_FDD_ENB_AUTHENTICATION_VECTOR_STRUCT *av);LTE_FDD_ENB_AUTHENTICATION_VECTOR_STRUCT* get_auth_vec(void);void increment_nas_count_dl(void);void increment_nas_count_ul(void);bool is_auth_vec_set(void);// Capabilitiesvoid set_eea_support(uint8 eea, bool support);bool get_eea_support(uint8 eea);void set_eia_support(uint8 eia, bool support);bool get_eia_support(uint8 eia);void set_uea_support(uint8 uea, bool support);bool get_uea_support(uint8 uea);bool is_uea_set(void);void set_uia_support(uint8 uia, bool support);bool get_uia_support(uint8 uia);bool is_uia_set(void);void set_gea_support(uint8 gea, bool support);bool get_gea_support(uint8 gea);bool is_gea_set(void);// Radio Bearersvoid get_srb0(LTE_fdd_enb_rb **rb);LTE_FDD_ENB_ERROR_ENUM setup_srb1(LTE_fdd_enb_rb **rb);LTE_FDD_ENB_ERROR_ENUM teardown_srb1(void);LTE_FDD_ENB_ERROR_ENUM get_srb1(LTE_fdd_enb_rb **rb);LTE_FDD_ENB_ERROR_ENUM setup_srb2(LTE_fdd_enb_rb **rb);LTE_FDD_ENB_ERROR_ENUM teardown_srb2(void);LTE_FDD_ENB_ERROR_ENUM get_srb2(LTE_fdd_enb_rb **rb);LTE_FDD_ENB_ERROR_ENUM setup_drb(LTE_FDD_ENB_RB_ENUM drb_id, LTE_fdd_enb_rb **rb);LTE_FDD_ENB_ERROR_ENUM teardown_drb(LTE_FDD_ENB_RB_ENUM drb_id);LTE_FDD_ENB_ERROR_ENUM get_drb(LTE_FDD_ENB_RB_ENUM drb_id, LTE_fdd_enb_rb **rb);void copy_rbs(LTE_fdd_enb_user *user);void clear_rbs(void);// MMEvoid set_emm_cause(uint8 cause);uint8 get_emm_cause(void);void set_attach_type(uint8 type);uint8 get_attach_type(void);void set_pdn_type(uint8 type);uint8 get_pdn_type(void);void set_eps_bearer_id(uint8 id);uint8 get_eps_bearer_id(void);void set_proc_transaction_id(uint8 id);uint8 get_proc_transaction_id(void);void set_esm_info_transfer(bool eit);bool get_esm_info_transfer(void);void set_protocol_cnfg_opts(LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT *pco);LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT* get_protocol_cnfg_opts(void);// MACbool get_dl_ndi(void);void flip_dl_ndi(void);bool get_ul_ndi(void);void flip_ul_ndi(void);void store_harq_info(uint32 pucch_tti, LIBLTE_MAC_PDU_STRUCT *mac_pdu, LIBLTE_PHY_ALLOCATION_STRUCT *alloc);void clear_harq_info(uint32 pucch_tti);LTE_FDD_ENB_ERROR_ENUM get_harq_info(uint32 pucch_tti, LIBLTE_MAC_PDU_STRUCT *mac_pdu, LIBLTE_PHY_ALLOCATION_STRUCT *alloc);void set_ul_buffer_size(uint32 N_bytes_in_buffer);void update_ul_buffer_size(uint32 N_bytes_received);uint32 get_ul_buffer_size(void);// Genericvoid set_N_del_ticks(uint32 N_ticks);uint32 get_N_del_ticks(void);uint32 get_max_ul_bytes_per_subfn(void);uint32 get_max_dl_bytes_per_subfn(void);void start_inactivity_timer(uint32 m_seconds);void reset_inactivity_timer(uint32 m_seconds);void stop_inactivity_timer(void);private:// IdentityLTE_FDD_ENB_USER_ID_STRUCT id;LIBLTE_MME_EPS_MOBILE_ID_GUTI_STRUCT guti;uint64 temp_id;uint32 c_rnti;uint32 ip_addr;bool id_set;bool guti_set;bool c_rnti_set;bool ip_addr_set;// SecurityLTE_FDD_ENB_AUTHENTICATION_VECTOR_STRUCT auth_vec;bool auth_vec_set;// Capabilitiesbool eea_support[8];bool eia_support[8];bool uea_support[8];bool uea_set;bool uia_support[8];bool uia_set;bool gea_support[8];bool gea_set;// Radio BearersLTE_fdd_enb_rb *srb0;LTE_fdd_enb_rb *srb1;LTE_fdd_enb_rb *srb2;LTE_fdd_enb_rb *drb[8];// MMELIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts;uint8 emm_cause;uint8 attach_type;uint8 pdn_type;uint8 eps_bearer_id;uint8 proc_transaction_id;bool eit_flag;// MACsem_t harq_buffer_sem;std::map<uint32, LTE_FDD_ENB_HARQ_INFO_STRUCT*> harq_buffer;uint32 ul_buffer_size;bool dl_ndi;bool ul_ndi;// Genericvoid handle_timer_expiry(uint32 timer_id);uint32 N_del_ticks;uint32 inactivity_timer_id;
};#endif /* __LTE_FDD_ENB_USER_H__ */
用户管理:LTE_fdd_enb_user_mgr.h
/*******************************************************************************Copyright 2013-2016 Ben WojtowiczThis program is free software: you can redistribute it and/or modifyit under the terms of the GNU Affero General Public License as published bythe Free Software Foundation, either version 3 of the License, or(at your option) any later version.This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU Affero General Public License for more details.You should have received a copy of the GNU Affero General Public Licensealong with this program. If not, see <http://www.gnu.org/licenses/>.*******************************************************************************File: LTE_fdd_enb_user_mgr.hDescription: Contains all the definitions for the LTE FDD eNodeBuser manager.Revision History---------- ------------- --------------------------------------------11/09/2013 Ben Wojtowicz Created file05/04/2014 Ben Wojtowicz Added C-RNTI timeout timers.08/03/2014 Ben Wojtowicz Refactored add_user.11/01/2014 Ben Wojtowicz Added M-TMSI assignment.11/29/2014 Ben Wojtowicz Refactored C-RNTI assign/release, addedC-RNTI transfer, added more ways to add,delete, and find users.12/16/2014 Ben Wojtowicz Added delayed user delete functionality.12/06/2015 Ben Wojtowicz Changed boost::mutex to sem_t and changed theuser deletion procedure.02/13/2016 Ben Wojtowicz Added ability to retrieve a string of allregistered users.*******************************************************************************/#ifndef __LTE_FDD_ENB_USER_MGR_H__
#define __LTE_FDD_ENB_USER_MGR_H__/*******************************************************************************INCLUDES
*******************************************************************************/#include "LTE_fdd_enb_interface.h"
#include "LTE_fdd_enb_user.h"
#include <string>/*******************************************************************************DEFINES
*******************************************************************************//*******************************************************************************FORWARD DECLARATIONS
*******************************************************************************//*******************************************************************************TYPEDEFS
*******************************************************************************//*******************************************************************************CLASS DECLARATIONS
*******************************************************************************/class LTE_fdd_enb_user_mgr
{
public:// Singletonstatic LTE_fdd_enb_user_mgr* get_instance(void);static void cleanup(void);// External interfaceLTE_FDD_ENB_ERROR_ENUM assign_c_rnti(LTE_fdd_enb_user *user, uint16 *c_rnti);LTE_FDD_ENB_ERROR_ENUM release_c_rnti(uint16 c_rnti);LTE_FDD_ENB_ERROR_ENUM transfer_c_rnti(LTE_fdd_enb_user *old_user, LTE_fdd_enb_user *new_user);LTE_FDD_ENB_ERROR_ENUM reset_c_rnti_timer(uint16 c_rnti);uint32 get_next_m_tmsi(void);LTE_FDD_ENB_ERROR_ENUM add_user(LTE_fdd_enb_user **user);LTE_FDD_ENB_ERROR_ENUM find_user(std::string imsi, LTE_fdd_enb_user **user);LTE_FDD_ENB_ERROR_ENUM find_user(uint16 c_rnti, LTE_fdd_enb_user **user);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);std::string print_all_users(void);private:// Singletonstatic LTE_fdd_enb_user_mgr *instance;LTE_fdd_enb_user_mgr();~LTE_fdd_enb_user_mgr();// C-RNTI Timervoid handle_c_rnti_timer_expiry(uint32 timer_id);// User storagestd::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;sem_t user_sem;sem_t c_rnti_sem;sem_t timer_id_sem;uint32 next_m_tmsi;uint16 next_c_rnti;
};#endif /* __LTE_FDD_ENB_USER_MGR_H__ */
定时器:LTE_fdd_enb_timer.h
/*******************************************************************************Copyright 2014 Ben WojtowiczThis program is free software: you can redistribute it and/or modifyit under the terms of the GNU Affero General Public License as published bythe Free Software Foundation, either version 3 of the License, or(at your option) any later version.This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU Affero General Public License for more details.You should have received a copy of the GNU Affero General Public Licensealong with this program. If not, see <http://www.gnu.org/licenses/>.*******************************************************************************File: LTE_fdd_enb_timer.hDescription: Contains all the definitions for the LTE FDD eNodeBtimer class.Revision History---------- ------------- --------------------------------------------05/04/2014 Ben Wojtowicz Created file06/15/2014 Ben Wojtowicz Added millisecond resolution and seperatedthe callback calling functionality.11/29/2014 Ben Wojtowicz Added timer reset support.*******************************************************************************/#ifndef __LTE_FDD_ENB_TIMER_H__
#define __LTE_FDD_ENB_TIMER_H__/*******************************************************************************INCLUDES
*******************************************************************************/#include "LTE_fdd_enb_interface.h"/*******************************************************************************DEFINES
*******************************************************************************//*******************************************************************************FORWARD DECLARATIONS
*******************************************************************************//*******************************************************************************TYPEDEFS
*******************************************************************************//*******************************************************************************CLASS DECLARATIONS
*******************************************************************************/// Timer callback
class LTE_fdd_enb_timer_cb
{
public:typedef void (*FuncType)(void*, uint32);LTE_fdd_enb_timer_cb();LTE_fdd_enb_timer_cb(FuncType f, void* o);void operator()(uint32 id);
private:FuncType func;void *obj;
};
template<class class_type, void (class_type::*Func)(uint32)>void LTE_fdd_enb_timer_cb_wrapper(void *o, uint32 id)
{return (static_cast<class_type*>(o)->*Func)(id);
}class LTE_fdd_enb_timer
{
public:// Constructor/DestructorLTE_fdd_enb_timer(uint32 m_seconds, uint32 _id, LTE_fdd_enb_timer_cb _cb);~LTE_fdd_enb_timer();// External interfacevoid reset(void);void increment(void);bool expired(void);void call_callback(void);private:// IdentityLTE_fdd_enb_timer_cb cb;uint32 id;uint32 expiry_m_seconds;uint32 current_m_seconds;
};#endif /* __LTE_FDD_ENB_TIMER_H__ */
定时器管理:LTE_fdd_enb_timer_mgr.h
/*******************************************************************************Copyright 2014-2015 Ben WojtowiczThis program is free software: you can redistribute it and/or modifyit under the terms of the GNU Affero General Public License as published bythe Free Software Foundation, either version 3 of the License, or(at your option) any later version.This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU Affero General Public License for more details.You should have received a copy of the GNU Affero General Public Licensealong with this program. If not, see <http://www.gnu.org/licenses/>.*******************************************************************************File: LTE_fdd_enb_timer_mgr.hDescription: Contains all the definitions for the LTE FDD eNodeBtimer manager.Revision History---------- ------------- --------------------------------------------05/04/2014 Ben Wojtowicz Created file06/15/2014 Ben Wojtowicz Added millisecond resolution.08/03/2014 Ben Wojtowicz Added an invalid timer id.11/29/2014 Ben Wojtowicz Added timer reset support.02/15/2015 Ben Wojtowicz Moved to new message queue for timer ticks.12/06/2015 Ben Wojtowicz Changed boost::mutex to sem_t.*******************************************************************************/#ifndef __LTE_FDD_ENB_TIMER_MGR_H__
#define __LTE_FDD_ENB_TIMER_MGR_H__/*******************************************************************************INCLUDES
*******************************************************************************/#include "LTE_fdd_enb_interface.h"
#include "LTE_fdd_enb_timer.h"
#include "LTE_fdd_enb_msgq.h"/*******************************************************************************DEFINES
*******************************************************************************/#define LTE_FDD_ENB_INVALID_TIMER_ID 0xFFFFFFFF/*******************************************************************************FORWARD DECLARATIONS
*******************************************************************************//*******************************************************************************TYPEDEFS
*******************************************************************************//*******************************************************************************CLASS DECLARATIONS
*******************************************************************************/class LTE_fdd_enb_timer_mgr
{
public:// Singletonstatic LTE_fdd_enb_timer_mgr* get_instance(void);static void cleanup(void);// Start/Stopvoid start(LTE_fdd_enb_msgq *from_mac, LTE_fdd_enb_interface *iface);void stop(void);// External InterfaceLTE_FDD_ENB_ERROR_ENUM start_timer(uint32 m_seconds, LTE_fdd_enb_timer_cb cb, uint32 *timer_id);LTE_FDD_ENB_ERROR_ENUM stop_timer(uint32 timer_id);LTE_FDD_ENB_ERROR_ENUM reset_timer(uint32 timer_id);private:// Singletonstatic LTE_fdd_enb_timer_mgr *instance;LTE_fdd_enb_timer_mgr();~LTE_fdd_enb_timer_mgr();// Start/StopLTE_fdd_enb_interface *interface;sem_t start_sem;bool started;// Communicationvoid handle_msg(LTE_FDD_ENB_MESSAGE_STRUCT &msg);void handle_tick(void);LTE_fdd_enb_msgq *msgq_from_mac;// Timer Storagesem_t timer_sem;std::map<uint32, LTE_fdd_enb_timer*> timer_map;uint32 next_timer_id;
};#endif /* __LTE_FDD_ENB_TIMER_MGR_H__ */
消息接口:LTE_fdd_enb_msgq.h
/*******************************************************************************Copyright 2013-2017 Ben WojtowiczThis program is free software: you can redistribute it and/or modifyit under the terms of the GNU Affero General Public License as published bythe Free Software Foundation, either version 3 of the License, or(at your option) any later version.This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU Affero General Public License for more details.You should have received a copy of the GNU Affero General Public Licensealong with this program. If not, see <http://www.gnu.org/licenses/>.*******************************************************************************File: LTE_fdd_enb_msgq.hDescription: Contains all the definitions for the LTE FDD eNodeBmessage queues.Revision History---------- ------------- --------------------------------------------11/09/2013 Ben Wojtowicz Created file01/18/2014 Ben Wojtowicz Added the ability to set priorities.03/26/2014 Ben Wojtowicz Added RNTI to PUSCH decode message.05/04/2014 Ben Wojtowicz Added messages for MAC, RLC, PDCP, and RRCcommunication.06/15/2014 Ben Wojtowicz Added MME<->RRC messages.08/03/2014 Ben Wojtowicz Added RRC command messages.11/01/2014 Ben Wojtowicz Added RRC security command, RRC SRB2 setupcommand, and RRC command response messages.11/29/2014 Ben Wojtowicz Added IP gateway communication messages.02/15/2015 Ben Wojtowicz Moving to new message queue with semaphoresand circular buffers and added a timer tickmessage.03/15/2015 Ben Wojtowicz Added a mutex to the circular buffer.07/25/2015 Ben Wojtowicz Combined the DL and UL schedule messages intoa single PHY schedule message.12/06/2015 Ben Wojtowicz Changed boost::mutex andboost::interprocess::interprocess_semaphoreto sem_t.03/12/2016 Ben Wojtowicz Added PUCCH support.07/29/2017 Ben Wojtowicz Added SR Support.*******************************************************************************/#ifndef __LTE_FDD_ENB_MSGQ_H__
#define __LTE_FDD_ENB_MSGQ_H__/*******************************************************************************INCLUDES
*******************************************************************************/#include "LTE_fdd_enb_user.h"
#include "liblte_rrc.h"
#include "liblte_phy.h"
#include <boost/circular_buffer.hpp>
#include <string>/*******************************************************************************DEFINES
*******************************************************************************/#define LTE_FDD_ENB_N_SIB_ALLOCS 7
#define LTE_FDD_ENB_N_PUCCH_PER_SUBFR 12/*******************************************************************************FORWARD DECLARATIONS
*******************************************************************************//*******************************************************************************TYPEDEFS
*******************************************************************************/typedef enum{// Generic MessagesLTE_FDD_ENB_MESSAGE_TYPE_KILL = 0,// MAC -> PHY MessagesLTE_FDD_ENB_MESSAGE_TYPE_PHY_SCHEDULE,// PHY -> MAC MessagesLTE_FDD_ENB_MESSAGE_TYPE_READY_TO_SEND,LTE_FDD_ENB_MESSAGE_TYPE_PRACH_DECODE,LTE_FDD_ENB_MESSAGE_TYPE_PUCCH_DECODE,LTE_FDD_ENB_MESSAGE_TYPE_PUSCH_DECODE,// RLC -> MAC MessagesLTE_FDD_ENB_MESSAGE_TYPE_MAC_SDU_READY,// MAC -> RLC MessagesLTE_FDD_ENB_MESSAGE_TYPE_RLC_PDU_READY,// MAC -> TIMER MessagesLTE_FDD_ENB_MESSAGE_TYPE_TIMER_TICK,// PDCP -> RLC MessagesLTE_FDD_ENB_MESSAGE_TYPE_RLC_SDU_READY,// RLC -> PDCP MessagesLTE_FDD_ENB_MESSAGE_TYPE_PDCP_PDU_READY,// RRC -> PDCP MessagesLTE_FDD_ENB_MESSAGE_TYPE_PDCP_SDU_READY,// PDCP -> RRC MessagesLTE_FDD_ENB_MESSAGE_TYPE_RRC_PDU_READY,// MME -> RRC MessagesLTE_FDD_ENB_MESSAGE_TYPE_RRC_NAS_MSG_READY,LTE_FDD_ENB_MESSAGE_TYPE_RRC_CMD_READY,// RRC -> MME MessagesLTE_FDD_ENB_MESSAGE_TYPE_MME_NAS_MSG_READY,LTE_FDD_ENB_MESSAGE_TYPE_MME_RRC_CMD_RESP,// GW -> PDCP MessagesLTE_FDD_ENB_MESSAGE_TYPE_PDCP_DATA_SDU_READY,// PDCP -> GW MessagesLTE_FDD_ENB_MESSAGE_TYPE_GW_DATA_READY,LTE_FDD_ENB_MESSAGE_TYPE_N_ITEMS,
}LTE_FDD_ENB_MESSAGE_TYPE_ENUM;
static const char LTE_fdd_enb_message_type_text[LTE_FDD_ENB_MESSAGE_TYPE_N_ITEMS][100] = {"Kill","PHY schedule","Ready to send","PRACH decode","PUCCH decode","PUSCH decode","MAC sdu ready","RLC pdu ready","Timer tick","RLC sdu ready","PDCP pdu ready","PDCP sdu ready","RRC pdu ready","RRC NAS message ready","RRC command ready","MME NAS message ready","MME RRC command response","PDCP data sdu ready","GW data ready"};typedef enum{LTE_FDD_ENB_DEST_LAYER_PHY = 0,LTE_FDD_ENB_DEST_LAYER_MAC,LTE_FDD_ENB_DEST_LAYER_RLC,LTE_FDD_ENB_DEST_LAYER_PDCP,LTE_FDD_ENB_DEST_LAYER_RRC,LTE_FDD_ENB_DEST_LAYER_MME,LTE_FDD_ENB_DEST_LAYER_GW,LTE_FDD_ENB_DEST_LAYER_TIMER_MGR,LTE_FDD_ENB_DEST_LAYER_ANY,LTE_FDD_ENB_DEST_LAYER_N_ITEMS,
}LTE_FDD_ENB_DEST_LAYER_ENUM;
static const char LTE_fdd_enb_dest_layer_text[LTE_FDD_ENB_DEST_LAYER_N_ITEMS][100] = {"PHY","MAC","RLC","PDCP","RRC","MME","GW","TIMER_MGR","ANY"};// Generic Messages// MAC -> PHY Messages
typedef struct{LIBLTE_PHY_PDCCH_STRUCT dl_allocations;LIBLTE_PHY_PDCCH_STRUCT ul_allocations;uint32 N_avail_prbs;uint32 N_sched_prbs;uint32 current_tti;
}LTE_FDD_ENB_DL_SCHEDULE_MSG_STRUCT;
typedef enum{LTE_FDD_ENB_PUCCH_TYPE_ACK_NACK = 0,LTE_FDD_ENB_PUCCH_TYPE_SR,LTE_FDD_ENB_PUCCH_TYPE_N_ITEMS,
}LTE_FDD_ENB_PUCCH_TYPE_ENUM;
static const char LTE_fdd_enb_pucch_type_text[LTE_FDD_ENB_PUCCH_TYPE_N_ITEMS][100] = {"ACK_NACK","SR"};
typedef struct{LTE_FDD_ENB_PUCCH_TYPE_ENUM type;uint32 n_1_p_pucch;uint16 rnti;bool decode;
}LTE_FDD_ENB_PUCCH_STRUCT;
typedef struct{LIBLTE_PHY_PDCCH_STRUCT decodes;LTE_FDD_ENB_PUCCH_STRUCT pucch[LTE_FDD_ENB_N_PUCCH_PER_SUBFR];uint32 N_avail_prbs;uint32 N_sched_prbs;uint32 current_tti;uint32 N_pucch;uint8 next_prb;
}LTE_FDD_ENB_UL_SCHEDULE_MSG_STRUCT;
typedef struct{LTE_FDD_ENB_DL_SCHEDULE_MSG_STRUCT dl_sched;LTE_FDD_ENB_UL_SCHEDULE_MSG_STRUCT ul_sched;
}LTE_FDD_ENB_PHY_SCHEDULE_MSG_STRUCT;// PHY -> MAC Messages
typedef struct{uint32 dl_current_tti;uint32 ul_current_tti;bool late;
}LTE_FDD_ENB_READY_TO_SEND_MSG_STRUCT;
typedef struct{uint32 current_tti;uint32 timing_adv[64];uint32 preamble[64];uint32 num_preambles;
}LTE_FDD_ENB_PRACH_DECODE_MSG_STRUCT;
typedef struct{LIBLTE_BIT_MSG_STRUCT msg;LTE_FDD_ENB_PUCCH_TYPE_ENUM type;uint32 current_tti;uint16 rnti;
}LTE_FDD_ENB_PUCCH_DECODE_MSG_STRUCT;
typedef struct{LIBLTE_BIT_MSG_STRUCT msg;uint32 current_tti;uint16 rnti;
}LTE_FDD_ENB_PUSCH_DECODE_MSG_STRUCT;// RLC -> MAC Messages
typedef struct{LTE_fdd_enb_user *user;LTE_fdd_enb_rb *rb;
}LTE_FDD_ENB_MAC_SDU_READY_MSG_STRUCT;// MAC -> RLC Messages
typedef struct{LTE_fdd_enb_user *user;LTE_fdd_enb_rb *rb;
}LTE_FDD_ENB_RLC_PDU_READY_MSG_STRUCT;// MAC -> TIMER Messages
typedef struct{uint32 tick;
}LTE_FDD_ENB_TIMER_TICK_MSG_STRUCT;// PDCP -> RLC Messages
typedef struct{LTE_fdd_enb_user *user;LTE_fdd_enb_rb *rb;
}LTE_FDD_ENB_RLC_SDU_READY_MSG_STRUCT;// RLC -> PDCP Messages
typedef struct{LTE_fdd_enb_user *user;LTE_fdd_enb_rb *rb;
}LTE_FDD_ENB_PDCP_PDU_READY_MSG_STRUCT;// RRC -> PDCP Messages
typedef struct{LTE_fdd_enb_user *user;LTE_fdd_enb_rb *rb;
}LTE_FDD_ENB_PDCP_SDU_READY_MSG_STRUCT;// PDCP -> RRC Messages
typedef struct{LTE_fdd_enb_user *user;LTE_fdd_enb_rb *rb;
}LTE_FDD_ENB_RRC_PDU_READY_MSG_STRUCT;// MME -> RRC Messages
typedef struct{LTE_fdd_enb_user *user;LTE_fdd_enb_rb *rb;
}LTE_FDD_ENB_RRC_NAS_MSG_READY_MSG_STRUCT;
typedef enum{LTE_FDD_ENB_RRC_CMD_RELEASE = 0,LTE_FDD_ENB_RRC_CMD_SECURITY,LTE_FDD_ENB_RRC_CMD_SETUP_DEF_DRB,LTE_FDD_ENB_RRC_CMD_SETUP_DED_DRB,LTE_FDD_ENB_RRC_CMD_N_ITEMS,
}LTE_FDD_ENB_RRC_CMD_ENUM;
static const char LTE_fdd_enb_rrc_cmd_text[LTE_FDD_ENB_RRC_CMD_N_ITEMS][20] = {"Release","Security","Setup Default DRB","Setup Dedicated DRB"};
typedef struct{LTE_fdd_enb_user *user;LTE_fdd_enb_rb *rb;LTE_FDD_ENB_RRC_CMD_ENUM cmd;
}LTE_FDD_ENB_RRC_CMD_READY_MSG_STRUCT;// RRC -> MME Messages
typedef struct{LTE_fdd_enb_user *user;LTE_fdd_enb_rb *rb;
}LTE_FDD_ENB_MME_NAS_MSG_READY_MSG_STRUCT;
typedef enum{LTE_FDD_ENB_MME_RRC_CMD_RESP_SECURITY = 0,LTE_FDD_ENB_MME_RRC_CMD_RESP_N_ITEMS,
}LTE_FDD_ENB_MME_RRC_CMD_RESP_ENUM;
static const char LTE_fdd_enb_mme_rrc_cmd_resp_text[LTE_FDD_ENB_MME_RRC_CMD_RESP_N_ITEMS][20] = {"Security"};
typedef struct{LTE_fdd_enb_user *user;LTE_fdd_enb_rb *rb;LTE_FDD_ENB_MME_RRC_CMD_RESP_ENUM cmd_resp;
}LTE_FDD_ENB_MME_RRC_CMD_RESP_MSG_STRUCT;// GW -> PDCP Messages
typedef struct{LTE_fdd_enb_user *user;LTE_fdd_enb_rb *rb;
}LTE_FDD_ENB_PDCP_DATA_SDU_READY_MSG_STRUCT;// PDCP -> GW Messages
typedef struct{LTE_fdd_enb_user *user;LTE_fdd_enb_rb *rb;
}LTE_FDD_ENB_GW_DATA_READY_MSG_STRUCT;typedef union{// Generic Messages// MAC -> PHY MessagesLTE_FDD_ENB_PHY_SCHEDULE_MSG_STRUCT phy_schedule;// PHY -> MAC MessagesLTE_FDD_ENB_READY_TO_SEND_MSG_STRUCT ready_to_send;LTE_FDD_ENB_PRACH_DECODE_MSG_STRUCT prach_decode;LTE_FDD_ENB_PUCCH_DECODE_MSG_STRUCT pucch_decode;LTE_FDD_ENB_PUSCH_DECODE_MSG_STRUCT pusch_decode;// RLC -> MAC MessagesLTE_FDD_ENB_MAC_SDU_READY_MSG_STRUCT mac_sdu_ready;// MAC -> RLC MessagesLTE_FDD_ENB_RLC_PDU_READY_MSG_STRUCT rlc_pdu_ready;// MAC -> TIMER MessagesLTE_FDD_ENB_TIMER_TICK_MSG_STRUCT timer_tick;// PDCP -> RLC MessagesLTE_FDD_ENB_RLC_SDU_READY_MSG_STRUCT rlc_sdu_ready;// RLC -> PDCP MessagesLTE_FDD_ENB_PDCP_PDU_READY_MSG_STRUCT pdcp_pdu_ready;// RRC -> PDCP MessagesLTE_FDD_ENB_PDCP_SDU_READY_MSG_STRUCT pdcp_sdu_ready;// PDCP -> RRC MessagesLTE_FDD_ENB_RRC_PDU_READY_MSG_STRUCT rrc_pdu_ready;// MME -> RRC MessagesLTE_FDD_ENB_RRC_NAS_MSG_READY_MSG_STRUCT rrc_nas_msg_ready;LTE_FDD_ENB_RRC_CMD_READY_MSG_STRUCT rrc_cmd_ready;// RRC -> MME MessagesLTE_FDD_ENB_MME_NAS_MSG_READY_MSG_STRUCT mme_nas_msg_ready;LTE_FDD_ENB_MME_RRC_CMD_RESP_MSG_STRUCT mme_rrc_cmd_resp;// GW -> PDCP MessagesLTE_FDD_ENB_PDCP_DATA_SDU_READY_MSG_STRUCT pdcp_data_sdu_ready;// PDCP -> GW MessagesLTE_FDD_ENB_GW_DATA_READY_MSG_STRUCT gw_data_ready;
}LTE_FDD_ENB_MESSAGE_UNION;typedef struct{LTE_FDD_ENB_MESSAGE_TYPE_ENUM type;LTE_FDD_ENB_DEST_LAYER_ENUM dest_layer;LTE_FDD_ENB_MESSAGE_UNION msg;
}LTE_FDD_ENB_MESSAGE_STRUCT;/*******************************************************************************CLASS DECLARATIONS
*******************************************************************************/// Message queue callback
class LTE_fdd_enb_msgq_cb
{
public:typedef void (*FuncType)(void*, LTE_FDD_ENB_MESSAGE_STRUCT&);LTE_fdd_enb_msgq_cb();LTE_fdd_enb_msgq_cb(FuncType f, void* o);void operator()(LTE_FDD_ENB_MESSAGE_STRUCT &msg);
private:FuncType func;void *obj;
};
template<class class_type, void (class_type::*Func)(LTE_FDD_ENB_MESSAGE_STRUCT&)>void LTE_fdd_enb_msgq_cb_wrapper(void *o, LTE_FDD_ENB_MESSAGE_STRUCT &msg)
{return (static_cast<class_type*>(o)->*Func)(msg);
}class LTE_fdd_enb_msgq
{
public:LTE_fdd_enb_msgq(std::string _msgq_name);~LTE_fdd_enb_msgq();// Setupvoid attach_rx(LTE_fdd_enb_msgq_cb cb);void attach_rx(LTE_fdd_enb_msgq_cb cb, uint32 _prio);// Send/Receivevoid send(LTE_FDD_ENB_MESSAGE_TYPE_ENUM type,LTE_FDD_ENB_DEST_LAYER_ENUM dest_layer,LTE_FDD_ENB_MESSAGE_UNION *msg_content,uint32 msg_content_size);void send(LTE_FDD_ENB_MESSAGE_TYPE_ENUM type,LTE_FDD_ENB_DL_SCHEDULE_MSG_STRUCT *dl_sched,LTE_FDD_ENB_UL_SCHEDULE_MSG_STRUCT *ul_sched);void send(LTE_FDD_ENB_MESSAGE_STRUCT &msg);private:// Send/Receivestatic void* receive_thread(void *inputs);// VariablesLTE_fdd_enb_msgq_cb callback;sem_t sync_sem;sem_t msg_sem;boost::circular_buffer<LTE_FDD_ENB_MESSAGE_STRUCT> *circ_buf;std::string msgq_name;pthread_t rx_thread;uint32 prio;bool rx_setup;
};#endif /* __LTE_FDD_ENB_MSGQ_H__ */
基站接口:LTE_fdd_enb_interface.h
/*******************************************************************************Copyright 2013-2017 Ben WojtowiczThis program is free software: you can redistribute it and/or modifyit under the terms of the GNU Affero General Public License as published bythe Free Software Foundation, either version 3 of the License, or(at your option) any later version.This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU Affero General Public License for more details.You should have received a copy of the GNU Affero General Public Licensealong with this program. If not, see <http://www.gnu.org/licenses/>.*******************************************************************************File: LTE_fdd_enb_interface.hDescription: Contains all the definitions for the LTE FDD eNodeB interface.Revision History---------- ------------- --------------------------------------------11/09/2013 Ben Wojtowicz Created file01/18/2014 Ben Wojtowicz Added dynamic variables and added level todebug prints.03/26/2014 Ben Wojtowicz Using the latest LTE library.04/12/2014 Ben Wojtowicz Pulled in a patch from Max Suraev for moredescriptive start failures.05/04/2014 Ben Wojtowicz Added PCAP support and more error types.06/15/2014 Ben Wojtowicz Added new error causes, ... support for infomessages, and using the latest LTE library.07/22/2014 Ben Wojtowicz Added clock source as a configurableparameter.08/03/2014 Ben Wojtowicz Added HSS support.09/03/2014 Ben Wojtowicz Added read only parameters for UL EARFCN,DL center frequency and UL center frequency.11/01/2014 Ben Wojtowicz Added parameters for IP address assignment,DNS address, config file, and user file.11/29/2014 Ben Wojtowicz Added support for the IP gateway.02/15/2015 Ben Wojtowicz Moved to new message queue, added IP pcapsupport, and put error enum into common hdr.03/11/2015 Ben Wojtowicz Made a common routine for formatting time.07/25/2015 Ben Wojtowicz Made tx_gain and rx_gain into config filetracked parameters.12/06/2015 Ben Wojtowicz Changed boost::mutex to sem_t.02/13/2016 Ben Wojtowicz Added a command to print all registeredusers.07/29/2017 Ben Wojtowicz Added input parameters for direct IPC to a UEand using the latest tools library.*******************************************************************************/#ifndef __LTE_FDD_ENB_INTERFACE_H__
#define __LTE_FDD_ENB_INTERFACE_H__/*******************************************************************************INCLUDES
*******************************************************************************/#include "LTE_fdd_enb_common.h"
#include "LTE_fdd_enb_msgq.h"
#include "liblte_common.h"
#include "libtools_socket_wrap.h"
#include <string>/*******************************************************************************DEFINES
*******************************************************************************/#define LTE_FDD_ENB_DEFAULT_CTRL_PORT 30000
#define LTE_FDD_ENB_DEBUG_PORT_OFFSET 1/*******************************************************************************FORWARD DECLARATIONS
*******************************************************************************/class LTE_fdd_enb_pdcp;
class LTE_fdd_enb_mme;
class LTE_fdd_enb_gw;/*******************************************************************************TYPEDEFS
*******************************************************************************/typedef enum{LTE_FDD_ENB_DEBUG_TYPE_ERROR = 0,LTE_FDD_ENB_DEBUG_TYPE_WARNING,LTE_FDD_ENB_DEBUG_TYPE_INFO,LTE_FDD_ENB_DEBUG_TYPE_DEBUG,LTE_FDD_ENB_DEBUG_TYPE_N_ITEMS,
}LTE_FDD_ENB_DEBUG_TYPE_ENUM;
static const char LTE_fdd_enb_debug_type_text[LTE_FDD_ENB_DEBUG_TYPE_N_ITEMS][100] = {"error","warning","info","debug"};typedef enum{LTE_FDD_ENB_DEBUG_LEVEL_RADIO = 0,LTE_FDD_ENB_DEBUG_LEVEL_PHY,LTE_FDD_ENB_DEBUG_LEVEL_MAC,LTE_FDD_ENB_DEBUG_LEVEL_RLC,LTE_FDD_ENB_DEBUG_LEVEL_PDCP,LTE_FDD_ENB_DEBUG_LEVEL_RRC,LTE_FDD_ENB_DEBUG_LEVEL_MME,LTE_FDD_ENB_DEBUG_LEVEL_GW,LTE_FDD_ENB_DEBUG_LEVEL_USER,LTE_FDD_ENB_DEBUG_LEVEL_RB,LTE_FDD_ENB_DEBUG_LEVEL_TIMER,LTE_FDD_ENB_DEBUG_LEVEL_IFACE,LTE_FDD_ENB_DEBUG_LEVEL_MSGQ,LTE_FDD_ENB_DEBUG_LEVEL_N_ITEMS,
}LTE_FDD_ENB_DEBUG_LEVEL_ENUM;
static const char LTE_fdd_enb_debug_level_text[LTE_FDD_ENB_DEBUG_LEVEL_N_ITEMS][100] = {"radio","phy","mac","rlc","pdcp","rrc","mme","gw","user","rb","timer","iface","msgq"};typedef enum{LTE_FDD_ENB_PCAP_DIRECTION_UL = 0,LTE_FDD_ENB_PCAP_DIRECTION_DL,LTE_FDD_ENB_PCAP_DIRECTION_N_ITEMS,
}LTE_FDD_ENB_PCAP_DIRECTION_ENUM;
static const char LTE_fdd_enb_pcap_direction_text[LTE_FDD_ENB_PCAP_DIRECTION_N_ITEMS][20] = {"UL","DL"};typedef enum{LTE_FDD_ENB_VAR_TYPE_DOUBLE = 0,LTE_FDD_ENB_VAR_TYPE_INT64,LTE_FDD_ENB_VAR_TYPE_HEX,LTE_FDD_ENB_VAR_TYPE_UINT32,
}LTE_FDD_ENB_VAR_TYPE_ENUM;typedef enum{// System parameters managed by LTE_fdd_enb_cnfg_dbLTE_FDD_ENB_PARAM_BANDWIDTH = 0,LTE_FDD_ENB_PARAM_FREQ_BAND,LTE_FDD_ENB_PARAM_DL_EARFCN,LTE_FDD_ENB_PARAM_UL_EARFCN,LTE_FDD_ENB_PARAM_DL_CENTER_FREQ,LTE_FDD_ENB_PARAM_UL_CENTER_FREQ,LTE_FDD_ENB_PARAM_N_RB_DL,LTE_FDD_ENB_PARAM_N_RB_UL,LTE_FDD_ENB_PARAM_DL_BW,LTE_FDD_ENB_PARAM_N_SC_RB_DL,LTE_FDD_ENB_PARAM_N_SC_RB_UL,LTE_FDD_ENB_PARAM_N_ANT,LTE_FDD_ENB_PARAM_N_ID_CELL,LTE_FDD_ENB_PARAM_N_ID_2,LTE_FDD_ENB_PARAM_N_ID_1,LTE_FDD_ENB_PARAM_MCC,LTE_FDD_ENB_PARAM_MNC,LTE_FDD_ENB_PARAM_CELL_ID,LTE_FDD_ENB_PARAM_TRACKING_AREA_CODE,LTE_FDD_ENB_PARAM_Q_RX_LEV_MIN,LTE_FDD_ENB_PARAM_P0_NOMINAL_PUSCH,LTE_FDD_ENB_PARAM_P0_NOMINAL_PUCCH,LTE_FDD_ENB_PARAM_SIB3_PRESENT,LTE_FDD_ENB_PARAM_Q_HYST,LTE_FDD_ENB_PARAM_SIB4_PRESENT,LTE_FDD_ENB_PARAM_SIB5_PRESENT,LTE_FDD_ENB_PARAM_SIB6_PRESENT,LTE_FDD_ENB_PARAM_SIB7_PRESENT,LTE_FDD_ENB_PARAM_SIB8_PRESENT,LTE_FDD_ENB_PARAM_SEARCH_WIN_SIZE,LTE_FDD_ENB_PARAM_SYSTEM_INFO_VALUE_TAG,LTE_FDD_ENB_PARAM_SYSTEM_INFO_WINDOW_LENGTH,LTE_FDD_ENB_PARAM_PHICH_RESOURCE,LTE_FDD_ENB_PARAM_N_SCHED_INFO,LTE_FDD_ENB_PARAM_SYSTEM_INFO_PERIODICITY,LTE_FDD_ENB_PARAM_MAC_DIRECT_TO_UE,LTE_FDD_ENB_PARAM_PHY_DIRECT_TO_UE,LTE_FDD_ENB_PARAM_DEBUG_TYPE,LTE_FDD_ENB_PARAM_DEBUG_LEVEL,LTE_FDD_ENB_PARAM_ENABLE_PCAP,LTE_FDD_ENB_PARAM_IP_ADDR_START,LTE_FDD_ENB_PARAM_DNS_ADDR,LTE_FDD_ENB_PARAM_USE_CNFG_FILE,LTE_FDD_ENB_PARAM_USE_USER_FILE,LTE_FDD_ENB_PARAM_TX_GAIN,LTE_FDD_ENB_PARAM_RX_GAIN,// Radio parameters managed by LTE_fdd_enb_radioLTE_FDD_ENB_PARAM_AVAILABLE_RADIOS,LTE_FDD_ENB_PARAM_SELECTED_RADIO_NAME,LTE_FDD_ENB_PARAM_SELECTED_RADIO_IDX,LTE_FDD_ENB_PARAM_CLOCK_SOURCE,LTE_FDD_ENB_PARAM_N_ITEMS,
}LTE_FDD_ENB_PARAM_ENUM;
static const char LTE_fdd_enb_param_text[LTE_FDD_ENB_PARAM_N_ITEMS][100] = {"bandwidth","band","dl_earfcn","ul_earfcn","dl_center_freq","ul_center_freq","n_rb_dl","n_rb_ul","dl_bw","n_sc_rb_dl","n_sc_rb_ul","n_ant","n_id_cell","n_id_2","n_id_1","mcc","mnc","cell_id","tracking_area_code","q_rx_lev_min","p0_nominal_pusch","p0_nominal_pucch","sib3_present","q_hyst","sib4_present","sib5_present","sib6_present","sib7_present","sib8_present","search_win_size","system_info_value_tag","system_info_window_length","phich_resource","n_sched_info","system_info_periodicity","mac_direct_to_ue","phy_direct_to_ue","debug_type","debug_level","enable_pcap","ip_addr_start","dns_addr","use_cnfg_file","use_user_file","tx_gain","rx_gain","available_radios","selected_radio_name","selected_radio_idx","clock_source"};typedef struct{LTE_FDD_ENB_VAR_TYPE_ENUM var_type;LTE_FDD_ENB_PARAM_ENUM param;double double_l_bound;double double_u_bound;int64 int64_l_bound;int64 int64_u_bound;bool special_bounds;bool dynamic;bool read_only;
}LTE_FDD_ENB_VAR_STRUCT;/*******************************************************************************CLASS DECLARATIONS
*******************************************************************************/class LTE_fdd_enb_interface
{
public:// Singletonstatic LTE_fdd_enb_interface* get_instance(void);static void cleanup(void);// Communicationvoid set_ctrl_port(int16 port);void start_ports(void);void stop_ports(void);void send_ctrl_msg(std::string msg);void send_ctrl_info_msg(std::string msg, ...);void send_ctrl_error_msg(LTE_FDD_ENB_ERROR_ENUM error, std::string msg);void send_debug_msg(LTE_FDD_ENB_DEBUG_TYPE_ENUM type, LTE_FDD_ENB_DEBUG_LEVEL_ENUM level, std::string file_name, int32 line, std::string msg, ...);void send_debug_msg(LTE_FDD_ENB_DEBUG_TYPE_ENUM type, LTE_FDD_ENB_DEBUG_LEVEL_ENUM level, std::string file_name, int32 line, LIBLTE_BIT_MSG_STRUCT *lte_msg, std::string msg, ...);void send_debug_msg(LTE_FDD_ENB_DEBUG_TYPE_ENUM type, LTE_FDD_ENB_DEBUG_LEVEL_ENUM level, std::string file_name, int32 line, LIBLTE_BYTE_MSG_STRUCT *lte_msg, std::string msg, ...);void open_lte_pcap_fd(void);void open_ip_pcap_fd(void);void send_lte_pcap_msg(LTE_FDD_ENB_PCAP_DIRECTION_ENUM dir, uint32 rnti, uint32 current_tti, uint8 *msg, uint32 N_bits);void send_ip_pcap_msg(uint8 *msg, uint32 N_bytes);static void handle_ctrl_msg(std::string msg);static void handle_ctrl_connect(void);static void handle_ctrl_disconnect(void);static void handle_ctrl_error(LIBTOOLS_SOCKET_WRAP_ERROR_ENUM err);static void handle_debug_msg(std::string msg);static void handle_debug_connect(void);static void handle_debug_disconnect(void);static void handle_debug_error(LIBTOOLS_SOCKET_WRAP_ERROR_ENUM err);sem_t ctrl_sem;sem_t debug_sem;FILE *lte_pcap_fd;FILE *ip_pcap_fd;libtools_socket_wrap *ctrl_socket;libtools_socket_wrap *debug_socket;int16 ctrl_port;int16 debug_port;static bool ctrl_connected;static bool debug_connected;// HandlersLTE_FDD_ENB_ERROR_ENUM handle_write(std::string msg);void handle_add_user(std::string msg);// Get/Setbool get_shutdown(void);bool app_is_started(void);private:// Singletonstatic LTE_fdd_enb_interface *instance;LTE_fdd_enb_interface();~LTE_fdd_enb_interface();// Handlersvoid handle_read(std::string msg);void handle_start(void);void handle_stop(void);void handle_help(void);void handle_del_user(std::string msg);void handle_print_users(void);void handle_print_registered_users(void);// Variablesstd::map<std::string, LTE_FDD_ENB_VAR_STRUCT> var_map;LTE_fdd_enb_pdcp *pdcp;LTE_fdd_enb_mme *mme;LTE_fdd_enb_gw *gw;sem_t start_sem;uint32 debug_type_mask;uint32 debug_level_mask;bool shutdown;bool started;// HelpersLTE_FDD_ENB_ERROR_ENUM write_value(LTE_FDD_ENB_VAR_STRUCT *var, double value);LTE_FDD_ENB_ERROR_ENUM write_value(LTE_FDD_ENB_VAR_STRUCT *var, int64 value);LTE_FDD_ENB_ERROR_ENUM write_value(LTE_FDD_ENB_VAR_STRUCT *var, std::string value);LTE_FDD_ENB_ERROR_ENUM write_value(LTE_FDD_ENB_VAR_STRUCT *var, uint32 value);// Inter-stack communicationLTE_fdd_enb_msgq *phy_to_mac_comm;LTE_fdd_enb_msgq *mac_to_phy_comm;LTE_fdd_enb_msgq *mac_to_rlc_comm;LTE_fdd_enb_msgq *mac_to_timer_comm;LTE_fdd_enb_msgq *rlc_to_mac_comm;LTE_fdd_enb_msgq *rlc_to_pdcp_comm;LTE_fdd_enb_msgq *pdcp_to_rlc_comm;LTE_fdd_enb_msgq *pdcp_to_rrc_comm;LTE_fdd_enb_msgq *rrc_to_pdcp_comm;LTE_fdd_enb_msgq *rrc_to_mme_comm;LTE_fdd_enb_msgq *mme_to_rrc_comm;LTE_fdd_enb_msgq *pdcp_to_gw_comm;LTE_fdd_enb_msgq *gw_to_pdcp_comm;
};#endif /* __LTE_FDD_ENB_INTERFACE_H__ */
OpenLTE 基站相关头文件:用户、定时器、基站接口、消息接口相关推荐
- OpenLTE 基站相关头文件:PHY、MAC、RLC、RRC、PDCP、RB、MME、HSS、GW
Table of Contents 物理层:LTE_fdd_enb_phy.h 多媒体层:LTE_fdd_enb_mac.h 无线链路控制层:LTE_fdd_enb_rlc.h 无线资源控制:LTE_ ...
- linux pid t 头文件_linux系统调用相关头文件
Linux C 一些函数 所属的头文件 2011-03-07 10:25:07 分类: LINUX 在编写程序时,有时总是不记得所使用的函数在哪个库函数中.现在先把自己以前经常用到的函数头文件总结一下 ...
- vscode不能支持ROS相关头文件(ros/ros.h)?
Ubuntu16.04下vscode编写ros kinetic代码,编写pakage源文件代码,#include<ros/ros.h>头文件时报错,无法运行智能提示. 解决步骤: vsco ...
- Linux下Socket相关头文件总结
一 三种类型的套接字: 1.流式套接字(SOCKET_STREAM) 提供面向连接的可靠的数据传输服务.数据被看作是字节流,无长度限制.例如FTP协议就采用这种. 2.数据报式套接字(SOCK ...
- Cellant:中文基站+google地图+轨迹记录+自制基站数据库
[资料名称]:Cellant:中文基站+google地图+轨迹记录+自制基站数据库 0[$a7Y6|/H$Z7e*^ | 国内领先的通信技术论坛MSCBSC 移动通信论坛6d(x0k2@/H(g4F ...
- IOS的pch文件,NSTimer定时器,运行消息循环,随机色使用
IOS的pch文件,NSTimer定时器,运行消息循环,随机颜色获取使用 xcode新创建一个项目命名pchTest 右键创建文件,选择other 下面的pch,名字不要管默认就好 选中项目 : Bu ...
- 文件用户如何将一个有界面的正常app和一个或多个越狱插件.deb同时安装到手机上...
每日一贴,今天的内容关键字为文件用户 如何将一个有界面的正常app和一个或多个越狱插件.deb同时安装到手机上,这样app可以正常表现界面,而插件可以停止后台监听 如:qq通讯录,看似只有一个程序,实 ...
- IO流读取文件用户信息根据年龄排序后,写到文件
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileReader; import java ...
- 文件用户Apache shiro学习笔记+ spring整合shiro (一)
改章节朋友在青岛游玩的时候突然想到的...这两天就有想写几篇关于文件用户的博客,所以回家到之后就奋笔疾书的写出来发表了 Apache Shiro官网:http://shiro.apache.org/ ...
最新文章
- Access应用日志一
- 中文详解phpmailer所有对象和属性
- pandas使用replace函数替换dataframe中的值:replace函数使用正则表达式对dataframe中的值进行替换
- 科研工作者的神器-zotero论文管理工具
- 开源 java CMS - FreeCMS2.4 菜单管理
- jquery通过ajax向后台发送(checkbox)数组,并在后台接收,(发送的数据是checkedbox)...
- dim private public static_PHP中const,static,public,private,protected的区别
- C++学习之路 | PTA乙级—— 1033 旧键盘打字 (20 分)(精简)
- 在Ubuntu上安装Sublime Text 3
- mysql启动失败“MySQL Daemon failed to start”
- Android Dialog的简单说明
- 在EF4.1的DBContext中实现事务处理(BeginTransaction)和直接执行SQL语句的示例
- layer normalization 缺点_优缺点并存的星越,用车感受还是不错的!
- 计算机二级excel试题练习网盘,计算机二级练习试题excel
- Java程序员怎么优雅迈过30K+这道坎?附超全教程文档
- 7-3 电话聊天狂人 (25 分)
- java交易撮合怎么实现_撮合交易系统服务边界与设计
- (转)Cognos Transformer IQD文件结构及规则
- Openface训练分类器
- 解决内联汇编64位Linux系统调用提示Bad Address