Table of Contents

物理层:LTE_fdd_enb_phy.h

多媒体层:LTE_fdd_enb_mac.h

无线链路控制层:LTE_fdd_enb_rlc.h

无线资源控制:LTE_fdd_enb_rrc.h

分组数据汇聚层:LTE_fdd_enb_pdcp.h

无线载波:LTE_fdd_enb_rb.h

移动管理实体层:LTE_fdd_enb_mme.h

数据库服务:LTE_fdd_enb_hss.h

网关:LTE_fdd_enb_gw.h (S-GW, P-GW)


物理层:LTE_fdd_enb_phy.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_phy.hDescription: Contains all the definitions for the LTE FDD eNodeBphysical layer.Revision History----------    -------------    --------------------------------------------11/09/2013    Ben Wojtowicz    Created file01/18/2014    Ben Wojtowicz    Cached a copy of the interface class andadded 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.02/15/2015    Ben Wojtowicz    Moved to new message queue.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 to sem_t.07/31/2016    Ben Wojtowicz    Added an external interface for getting thecurrent TTIs.07/29/2017    Ben Wojtowicz    Added IPC direct to a UE PHY.*******************************************************************************/#ifndef __LTE_FDD_ENB_PHY_H__
#define __LTE_FDD_ENB_PHY_H__/*******************************************************************************INCLUDES
*******************************************************************************/#include "LTE_fdd_enb_interface.h"
#include "LTE_fdd_enb_cnfg_db.h"
#include "LTE_fdd_enb_msgq.h"
#include "LTE_fdd_enb_radio.h"
#include "liblte_phy.h"/*******************************************************************************DEFINES
*******************************************************************************/#define LTE_FDD_ENB_CURRENT_TTI_MAX (LIBLTE_PHY_SFN_MAX*10 + 9)/*******************************************************************************FORWARD DECLARATIONS
*******************************************************************************//*******************************************************************************TYPEDEFS
*******************************************************************************//*******************************************************************************CLASS DECLARATIONS
*******************************************************************************/class LTE_fdd_enb_phy
{
public:// Singletonstatic LTE_fdd_enb_phy* get_instance(void);static void cleanup(void);// Start/Stopvoid start(LTE_fdd_enb_msgq *from_mac, LTE_fdd_enb_msgq *to_mac, bool direct_to_ue, LTE_fdd_enb_interface *iface);void stop(void);// External interfacevoid update_sys_info(void);uint32 get_n_cce(void);void get_current_ttis(uint32 *dl_tti, uint32 *ul_tti);// Radio interfacevoid radio_interface(LTE_FDD_ENB_RADIO_TX_BUF_STRUCT *tx_buf, LTE_FDD_ENB_RADIO_RX_BUF_STRUCT *rx_buf);void radio_interface(LTE_FDD_ENB_RADIO_TX_BUF_STRUCT *tx_buf);private:// Singletonstatic LTE_fdd_enb_phy *instance;LTE_fdd_enb_phy();~LTE_fdd_enb_phy();// Start/StopLTE_fdd_enb_interface *interface;bool                   started;// Communicationvoid handle_mac_msg(LTE_FDD_ENB_MESSAGE_STRUCT &msg);void handle_ue_msg(LIBTOOLS_IPC_MSGQ_MESSAGE_STRUCT *msg);LTE_fdd_enb_msgq  *msgq_from_mac;LTE_fdd_enb_msgq  *msgq_to_mac;libtools_ipc_msgq *msgq_to_ue;// Generic parametersLIBLTE_PHY_STRUCT *phy_struct;// Downlinkvoid handle_phy_schedule(LTE_FDD_ENB_PHY_SCHEDULE_MSG_STRUCT *phy_sched);void process_dl(LTE_FDD_ENB_RADIO_TX_BUF_STRUCT *tx_buf);sem_t                              sys_info_sem;sem_t                              dl_sched_sem;sem_t                              ul_sched_sem;LTE_FDD_ENB_SYS_INFO_STRUCT        sys_info;LTE_FDD_ENB_DL_SCHEDULE_MSG_STRUCT dl_schedule[10];LTE_FDD_ENB_UL_SCHEDULE_MSG_STRUCT ul_schedule[10];LIBLTE_PHY_PCFICH_STRUCT           pcfich;LIBLTE_PHY_PHICH_STRUCT            phich[10];LIBLTE_PHY_PDCCH_STRUCT            pdcch;LIBLTE_PHY_SUBFRAME_STRUCT         dl_subframe;LIBLTE_BIT_MSG_STRUCT              dl_rrc_msg;uint32                             dl_current_tti;uint32                             last_rts_current_tti;bool                               late_subfr;// Uplinkvoid process_ul(LTE_FDD_ENB_RADIO_RX_BUF_STRUCT *rx_buf);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;LIBLTE_PHY_SUBFRAME_STRUCT          ul_subframe;uint32                              ul_current_tti;uint32                              prach_sfn_mod;uint32                              prach_subfn_mod;uint32                              prach_subfn_check;bool                                prach_subfn_zero_allowed;
};#endif /* __LTE_FDD_ENB_PHY_H__ */

多媒体层:LTE_fdd_enb_mac.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_mac.hDescription: Contains all the definitions for the LTE FDD eNodeBmedium access control layer.Revision History----------    -------------    --------------------------------------------11/09/2013    Ben Wojtowicz    Created file01/18/2014    Ben Wojtowicz    Cached a copy of the interface class.05/04/2014    Ben Wojtowicz    Added ULSCH handling.06/15/2014    Ben Wojtowicz    Added uplink scheduling and changed fn_comboto 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.02/15/2015    Ben Wojtowicz    Moved to new message queue.12/06/2015    Ben Wojtowicz    Changed boost::mutex to sem_t and added somehelper functions.02/13/2016    Ben Wojtowicz    Removed boost message queue include.07/31/2016    Ben Wojtowicz    Added a define for max HARQ retransmissions.07/29/2017    Ben Wojtowicz    Added SR support and added IPC direct to a UEMAC.*******************************************************************************/#ifndef __LTE_FDD_ENB_MAC_H__
#define __LTE_FDD_ENB_MAC_H__/*******************************************************************************INCLUDES
*******************************************************************************/#include "LTE_fdd_enb_interface.h"
#include "LTE_fdd_enb_cnfg_db.h"
#include "LTE_fdd_enb_msgq.h"
#include "LTE_fdd_enb_user.h"
#include "liblte_mac.h"
#include "libtools_ipc_msgq.h"
#include <list>/*******************************************************************************DEFINES
*******************************************************************************/#define LTE_FDD_ENB_MAX_HARQ_RETX 5/*******************************************************************************FORWARD DECLARATIONS
*******************************************************************************//*******************************************************************************TYPEDEFS
*******************************************************************************/typedef struct{LIBLTE_PHY_ALLOCATION_STRUCT dl_alloc;LIBLTE_PHY_ALLOCATION_STRUCT ul_alloc;LIBLTE_MAC_RAR_STRUCT        rar;uint32                       current_tti;
}LTE_FDD_ENB_RAR_SCHED_QUEUE_STRUCT;typedef struct{LIBLTE_PHY_ALLOCATION_STRUCT alloc;LIBLTE_MAC_PDU_STRUCT        mac_pdu;uint32                       current_tti;
}LTE_FDD_ENB_DL_SCHED_QUEUE_STRUCT;typedef struct{LIBLTE_PHY_ALLOCATION_STRUCT alloc;uint32                       current_tti;
}LTE_FDD_ENB_UL_SCHED_QUEUE_STRUCT;typedef struct{uint32 i_sr;uint32 n_1_p_pucch;uint16 rnti;
}LTE_FDD_ENB_UL_SR_SCHED_QUEUE_STRUCT;/*******************************************************************************CLASS DECLARATIONS
*******************************************************************************/class LTE_fdd_enb_mac
{
public:// Singletonstatic LTE_fdd_enb_mac* get_instance(void);static void cleanup(void);// Start/Stopvoid start(LTE_fdd_enb_msgq *from_phy, LTE_fdd_enb_msgq *from_rlc, LTE_fdd_enb_msgq *to_phy, LTE_fdd_enb_msgq *to_rlc, LTE_fdd_enb_msgq *to_timer, bool direct_to_ue, LTE_fdd_enb_interface *iface);void stop(void);// External interfacevoid update_sys_info(void);void add_periodic_sr_pucch(uint16 rnti, uint32 i_sr, uint32 n_1_p_pucch);void remove_periodic_sr_pucch(uint16 rnti);private:// Singletonstatic LTE_fdd_enb_mac *instance;LTE_fdd_enb_mac();~LTE_fdd_enb_mac();// Start/Stopsem_t                  start_sem;LTE_fdd_enb_interface *interface;bool                   started;// Communicationvoid handle_phy_msg(LTE_FDD_ENB_MESSAGE_STRUCT &msg);void handle_rlc_msg(LTE_FDD_ENB_MESSAGE_STRUCT &msg);void handle_ue_msg(LIBTOOLS_IPC_MSGQ_MESSAGE_STRUCT *msg);LTE_fdd_enb_msgq  *msgq_from_phy;LTE_fdd_enb_msgq  *msgq_from_rlc;LTE_fdd_enb_msgq  *msgq_to_phy;LTE_fdd_enb_msgq  *msgq_to_rlc;LTE_fdd_enb_msgq  *msgq_to_timer;libtools_ipc_msgq *msgq_to_ue;// PHY Message Handlersvoid handle_ready_to_send(LTE_FDD_ENB_READY_TO_SEND_MSG_STRUCT *rts);void handle_prach_decode(LTE_FDD_ENB_PRACH_DECODE_MSG_STRUCT *prach_decode);void handle_pucch_decode(LTE_FDD_ENB_PUCCH_DECODE_MSG_STRUCT *pucch_decode);void handle_pucch_ack_nack(LTE_fdd_enb_user *user, uint32 current_tti, LIBLTE_BIT_MSG_STRUCT *msg);void handle_pucch_sr(LTE_fdd_enb_user *user, uint32 current_tti, LIBLTE_BIT_MSG_STRUCT *msg);void handle_pusch_decode(LTE_FDD_ENB_PUSCH_DECODE_MSG_STRUCT *pusch_decode);// RLC Message Handlersvoid handle_sdu_ready(LTE_FDD_ENB_MAC_SDU_READY_MSG_STRUCT *sdu_ready);// MAC PDU Handlersvoid handle_ulsch_ccch_sdu(LTE_fdd_enb_user *user, uint32 lcid, LIBLTE_BYTE_MSG_STRUCT *sdu);void handle_ulsch_dcch_sdu(LTE_fdd_enb_user *user, uint32 lcid, LIBLTE_BYTE_MSG_STRUCT *sdu);void handle_ulsch_ext_power_headroom_report(LTE_fdd_enb_user *user, LIBLTE_MAC_EXT_POWER_HEADROOM_CE_STRUCT *ext_power_headroom);void handle_ulsch_power_headroom_report(LTE_fdd_enb_user *user, LIBLTE_MAC_POWER_HEADROOM_CE_STRUCT *power_headroom);void handle_ulsch_c_rnti(LTE_fdd_enb_user **user, LIBLTE_MAC_C_RNTI_CE_STRUCT *c_rnti);void handle_ulsch_truncated_bsr(LTE_fdd_enb_user *user, LIBLTE_MAC_TRUNCATED_BSR_CE_STRUCT *truncated_bsr);void handle_ulsch_short_bsr(LTE_fdd_enb_user *user, LIBLTE_MAC_SHORT_BSR_CE_STRUCT *short_bsr);void handle_ulsch_long_bsr(LTE_fdd_enb_user *user, LIBLTE_MAC_LONG_BSR_CE_STRUCT *long_bsr);// Data Constructorsvoid construct_random_access_response(uint8 preamble, uint16 timing_adv, uint32 current_tti);// Schedulervoid sched_ul(LTE_fdd_enb_user *user, uint32 requested_tbs);void scheduler(void);LTE_FDD_ENB_ERROR_ENUM add_to_rar_sched_queue(uint32 current_tti, LIBLTE_PHY_ALLOCATION_STRUCT *dl_alloc, LIBLTE_PHY_ALLOCATION_STRUCT *ul_alloc, LIBLTE_MAC_RAR_STRUCT *rar);LTE_FDD_ENB_ERROR_ENUM add_to_dl_sched_queue(uint32 current_tti, LIBLTE_MAC_PDU_STRUCT *mac_pdu, LIBLTE_PHY_ALLOCATION_STRUCT *alloc);LTE_FDD_ENB_ERROR_ENUM add_to_ul_sched_queue(uint32 current_tti, LIBLTE_PHY_ALLOCATION_STRUCT *alloc);sem_t                                            rar_sched_queue_sem;sem_t                                            dl_sched_queue_sem;sem_t                                            ul_sched_queue_sem;sem_t                                            ul_sr_sched_queue_sem;std::list<LTE_FDD_ENB_RAR_SCHED_QUEUE_STRUCT*>   rar_sched_queue;std::list<LTE_FDD_ENB_DL_SCHED_QUEUE_STRUCT*>    dl_sched_queue;std::list<LTE_FDD_ENB_UL_SCHED_QUEUE_STRUCT*>    ul_sched_queue;std::list<LTE_FDD_ENB_UL_SR_SCHED_QUEUE_STRUCT*> ul_sr_sched_queue;LTE_FDD_ENB_DL_SCHEDULE_MSG_STRUCT               sched_dl_subfr[10];LTE_FDD_ENB_UL_SCHEDULE_MSG_STRUCT               sched_ul_subfr[10];uint8                                            sched_cur_dl_subfn;uint8                                            sched_cur_ul_subfn;// Parameterssem_t                       sys_info_sem;LTE_FDD_ENB_SYS_INFO_STRUCT sys_info;// Helpersuint32 get_n_reserved_prbs(uint32 current_tti);uint32 add_to_tti(uint32 tti, uint32 addition);bool is_tti_in_future(uint32 tti_to_check, uint32 current_tti);
};#endif /* __LTE_FDD_ENB_MAC_H__ */

无线链路控制层:LTE_fdd_enb_rlc.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_rlc.hDescription: Contains all the definitions for the LTE FDD eNodeBradio link control layer.Revision History----------    -------------    --------------------------------------------11/09/2013    Ben Wojtowicz    Created file05/04/2014    Ben Wojtowicz    Added communication to MAC and PDCP.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.02/15/2015    Ben Wojtowicz    Moved to new message queue.12/06/2015    Ben Wojtowicz    Changed boost::mutex to sem_t.02/13/2016    Ben Wojtowicz    Removed boost message queue include.12/18/2016    Ben Wojtowicz    Properly handling multiple AMD PDUs.*******************************************************************************/#ifndef __LTE_FDD_ENB_RLC_H__
#define __LTE_FDD_ENB_RLC_H__/*******************************************************************************INCLUDES
*******************************************************************************/#include "LTE_fdd_enb_cnfg_db.h"
#include "LTE_fdd_enb_msgq.h"/*******************************************************************************DEFINES
*******************************************************************************//*******************************************************************************FORWARD DECLARATIONS
*******************************************************************************//*******************************************************************************TYPEDEFS
*******************************************************************************//*******************************************************************************CLASS DECLARATIONS
*******************************************************************************/class LTE_fdd_enb_rlc
{
public:// Singletonstatic LTE_fdd_enb_rlc* get_instance(void);static void cleanup(void);// Start/Stopvoid start(LTE_fdd_enb_msgq *from_mac, LTE_fdd_enb_msgq *from_pdcp, LTE_fdd_enb_msgq *to_mac, LTE_fdd_enb_msgq *to_pdcp, LTE_fdd_enb_interface *iface);void stop(void);// External interfacevoid update_sys_info(void);void handle_retransmit(LIBLTE_RLC_SINGLE_AMD_PDU_STRUCT *amd, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);private:// Singletonstatic LTE_fdd_enb_rlc *instance;LTE_fdd_enb_rlc();~LTE_fdd_enb_rlc();// Start/StopLTE_fdd_enb_interface *interface;sem_t                  start_sem;bool                   started;// Communicationvoid handle_mac_msg(LTE_FDD_ENB_MESSAGE_STRUCT &msg);void handle_pdcp_msg(LTE_FDD_ENB_MESSAGE_STRUCT &msg);LTE_fdd_enb_msgq *msgq_from_mac;LTE_fdd_enb_msgq *msgq_from_pdcp;LTE_fdd_enb_msgq *msgq_to_mac;LTE_fdd_enb_msgq *msgq_to_pdcp;// MAC Message Handlersvoid handle_pdu_ready(LTE_FDD_ENB_RLC_PDU_READY_MSG_STRUCT *pdu_ready);void handle_tm_pdu(LIBLTE_BYTE_MSG_STRUCT *pdu, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);void handle_um_pdu(LIBLTE_BYTE_MSG_STRUCT *pdu, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);void handle_am_pdu(LIBLTE_BYTE_MSG_STRUCT *pdu, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);void handle_status_pdu(LIBLTE_BYTE_MSG_STRUCT *pdu, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);// PDCP Message Handlersvoid handle_sdu_ready(LTE_FDD_ENB_RLC_SDU_READY_MSG_STRUCT *sdu_ready);void handle_tm_sdu(LIBLTE_BYTE_MSG_STRUCT *sdu, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);void handle_um_sdu(LIBLTE_BYTE_MSG_STRUCT *sdu, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);void handle_am_sdu(LIBLTE_BYTE_MSG_STRUCT *sdu, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);// Message Constructorsvoid send_status_pdu(LIBLTE_RLC_STATUS_PDU_STRUCT *status_pdu, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);void send_amd_pdu(LIBLTE_RLC_SINGLE_AMD_PDU_STRUCT *amd, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);// Parameterssem_t                       sys_info_sem;LTE_FDD_ENB_SYS_INFO_STRUCT sys_info;
};#endif /* __LTE_FDD_ENB_RLC_H__ */

无线资源控制:LTE_fdd_enb_rrc.h

/*******************************************************************************Copyright 2013-2017 Ben WojtowiczCopyright 2016 Przemek Bereski (send_ue_capability_enquiry)This 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_rrc.hDescription: Contains all the definitions for the LTE FDD eNodeBradio resource control layer.Revision History----------    -------------    --------------------------------------------11/09/2013    Ben Wojtowicz    Created file05/04/2014    Ben Wojtowicz    Added PDCP communication and UL CCCH statemachine.06/15/2014    Ben Wojtowicz    Added UL DCCH message handling and MME NASmessage handling.08/03/2014    Ben Wojtowicz    Added downlink NAS message handling andconnection release.11/01/2014    Ben Wojtowicz    Added RRC connection reconfiguration andsecurity mode command messages.11/29/2014    Ben Wojtowicz    Added user and rb update toparse_ul_ccch_message.12/16/2014    Ben Wojtowicz    Added ol extension to message queues.02/15/2015    Ben Wojtowicz    Moved to new message queue.12/06/2015    Ben Wojtowicz    Changed boost::mutex to sem_t.02/13/2016    Ben Wojtowicz    Removed boost message queue include andadd support for connection reestablishmentand connection reestablishment reject.07/03/2016    Przemek Bereski  Added send_ue_capability_enquiry.07/29/2017    Ben Wojtowicz    Added SR support.*******************************************************************************/#ifndef __LTE_FDD_ENB_RRC_H__
#define __LTE_FDD_ENB_RRC_H__/*******************************************************************************INCLUDES
*******************************************************************************/#include "LTE_fdd_enb_cnfg_db.h"
#include "LTE_fdd_enb_user.h"
#include "LTE_fdd_enb_msgq.h"/*******************************************************************************DEFINES
*******************************************************************************//*******************************************************************************FORWARD DECLARATIONS
*******************************************************************************//*******************************************************************************TYPEDEFS
*******************************************************************************//*******************************************************************************CLASS DECLARATIONS
*******************************************************************************/class LTE_fdd_enb_rrc
{
public:// Singletonstatic LTE_fdd_enb_rrc* get_instance(void);static void cleanup(void);// Start/Stopvoid start(LTE_fdd_enb_msgq *from_pdcp, LTE_fdd_enb_msgq *from_mme, LTE_fdd_enb_msgq *to_pdcp, LTE_fdd_enb_msgq *to_mme, LTE_fdd_enb_interface *iface);void stop(void);// External interfacevoid update_sys_info(void);void handle_cmd(LTE_FDD_ENB_RRC_CMD_READY_MSG_STRUCT *cmd);private:// Singletonstatic LTE_fdd_enb_rrc *instance;LTE_fdd_enb_rrc();~LTE_fdd_enb_rrc();// Start/StopLTE_fdd_enb_interface *interface;sem_t                  start_sem;bool                   started;// Communicationvoid handle_pdcp_msg(LTE_FDD_ENB_MESSAGE_STRUCT &msg);void handle_mme_msg(LTE_FDD_ENB_MESSAGE_STRUCT &msg);LTE_fdd_enb_msgq *msgq_from_pdcp;LTE_fdd_enb_msgq *msgq_from_mme;LTE_fdd_enb_msgq *msgq_to_pdcp;LTE_fdd_enb_msgq *msgq_to_mme;// PDCP Message Handlersvoid handle_pdu_ready(LTE_FDD_ENB_RRC_PDU_READY_MSG_STRUCT *pdu_ready);// MME Message Handlersvoid handle_nas_msg(LTE_FDD_ENB_RRC_NAS_MSG_READY_MSG_STRUCT *nas_msg);// State Machinesvoid ccch_sm(LIBLTE_BIT_MSG_STRUCT *msg, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);void dcch_sm(LIBLTE_BIT_MSG_STRUCT *msg, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);// Message Parsersvoid parse_ul_ccch_message(LIBLTE_BIT_MSG_STRUCT *msg, LTE_fdd_enb_user **user, LTE_fdd_enb_rb **rb);void parse_ul_dcch_message(LIBLTE_BIT_MSG_STRUCT *msg, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);// Message Sendersvoid send_dl_info_transfer(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb, LIBLTE_BYTE_MSG_STRUCT *msg);void send_rrc_con_reconfig(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb, LIBLTE_BYTE_MSG_STRUCT *msg);void send_rrc_con_reest(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);void send_rrc_con_reest_reject(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);void send_rrc_con_release(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);void send_rrc_con_setup(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);void send_security_mode_command(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);void send_ue_capability_enquiry(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);// Helpersvoid increment_i_sr(void);// Parameterssem_t                       sys_info_sem;LTE_FDD_ENB_SYS_INFO_STRUCT sys_info;uint32                      i_sr;
};#endif /* __LTE_FDD_ENB_RRC_H__ */

分组数据汇聚层:LTE_fdd_enb_pdcp.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_pdcp.hDescription: Contains all the definitions for the LTE FDD eNodeBpacket data convergence protocol layer.Revision History----------    -------------    --------------------------------------------11/09/2013    Ben Wojtowicz    Created file05/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.02/15/2015    Ben Wojtowicz    Moved to new message queue.12/06/2015    Ben Wojtowicz    Changed boost::mutex to sem_t.02/13/2016    Ben Wojtowicz    Removed boost message queue include.07/29/2017    Ben Wojtowicz    Moved away from singleton pattern.*******************************************************************************/#ifndef __LTE_FDD_ENB_PDCP_H__
#define __LTE_FDD_ENB_PDCP_H__/*******************************************************************************INCLUDES
*******************************************************************************/#include "LTE_fdd_enb_cnfg_db.h"
#include "LTE_fdd_enb_msgq.h"/*******************************************************************************DEFINES
*******************************************************************************//*******************************************************************************FORWARD DECLARATIONS
*******************************************************************************//*******************************************************************************TYPEDEFS
*******************************************************************************//*******************************************************************************CLASS DECLARATIONS
*******************************************************************************/class LTE_fdd_enb_pdcp
{
public:// Constructor/DestructorLTE_fdd_enb_pdcp();~LTE_fdd_enb_pdcp();// Start/Stopvoid start(LTE_fdd_enb_msgq *from_rlc, LTE_fdd_enb_msgq *from_rrc, LTE_fdd_enb_msgq *from_gw, LTE_fdd_enb_msgq *to_rlc, LTE_fdd_enb_msgq *to_rrc, LTE_fdd_enb_msgq *to_gw, LTE_fdd_enb_interface *iface);void stop(void);// External interfacevoid update_sys_info(void);private:// Start/StopLTE_fdd_enb_interface *interface;sem_t                  start_sem;bool                   started;// Communicationvoid handle_rlc_msg(LTE_FDD_ENB_MESSAGE_STRUCT &msg);void handle_rrc_msg(LTE_FDD_ENB_MESSAGE_STRUCT &msg);void handle_gw_msg(LTE_FDD_ENB_MESSAGE_STRUCT &msg);LTE_fdd_enb_msgq *msgq_from_rlc;LTE_fdd_enb_msgq *msgq_from_rrc;LTE_fdd_enb_msgq *msgq_from_gw;LTE_fdd_enb_msgq *msgq_to_rlc;LTE_fdd_enb_msgq *msgq_to_rrc;LTE_fdd_enb_msgq *msgq_to_gw;// RLC Message Handlersvoid handle_pdu_ready(LTE_FDD_ENB_PDCP_PDU_READY_MSG_STRUCT *pdu_ready);// RRC Message Handlersvoid handle_sdu_ready(LTE_FDD_ENB_PDCP_SDU_READY_MSG_STRUCT *sdu_ready);// GW Message Handlersvoid handle_data_sdu_ready(LTE_FDD_ENB_PDCP_DATA_SDU_READY_MSG_STRUCT *data_sdu_ready);// Parameterssem_t                       sys_info_sem;LTE_FDD_ENB_SYS_INFO_STRUCT sys_info;
};#endif /* __LTE_FDD_ENB_PDCP_H__ */

无线载波:LTE_fdd_enb_rb.h

/*******************************************************************************Copyright 2014-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_rb.hDescription: Contains all the definitions for the LTE FDD eNodeBradio bearer class.Revision History----------    -------------    --------------------------------------------05/04/2014    Ben Wojtowicz    Created file06/15/2014    Ben Wojtowicz    Added more states and procedures, QoS, MME,RLC, and uplink scheduling functionality.08/03/2014    Ben Wojtowicz    Added MME procedures/states, RRC NAS support,RRC transaction id, PDCP sequence numbers,and RLC transmit variables.09/03/2014    Ben Wojtowicz    Added more MME states and ability to storethe contention resolution identity.11/01/2014    Ben Wojtowicz    Added more MME states and PDCP security.11/29/2014    Ben Wojtowicz    Added more DRB support, MME states, MMEprocedures, and PDCP configs, moved almosteverything to byte messages structs, addedIP gateway and RLC UMD support.12/16/2014    Ben Wojtowicz    Added QoS for default data services.12/24/2014    Ben Wojtowicz    Added asymmetric QoS support.02/15/2015    Ben Wojtowicz    Split UL/DL QoS TTI frequency, added resetuser support, and added multiple UMD RLC datasupport.03/11/2015    Ben Wojtowicz    Added detach handling.07/25/2015    Ben Wojtowicz    Moved QoS structure to the user class andfixed RLC AM TX and RX buffers.12/06/2015    Ben Wojtowicz    Changed boost::mutex to sem_t.02/13/2016    Ben Wojtowicz    Added a wait for RRC connectionreestablishment complete RRC state.12/18/2016    Ben Wojtowicz    Properly handling multiple RLC AMD PDUs.07/29/2017    Ben Wojtowicz    Remove last TTI storage.*******************************************************************************/#ifndef __LTE_FDD_ENB_RB_H__
#define __LTE_FDD_ENB_RB_H__/*******************************************************************************INCLUDES
*******************************************************************************/#include "LTE_fdd_enb_common.h"
#include "liblte_rlc.h"
#include "liblte_rrc.h"
#include <list>
#include <map>
#include <semaphore.h>/*******************************************************************************DEFINES
*******************************************************************************//*******************************************************************************FORWARD DECLARATIONS
*******************************************************************************/class LTE_fdd_enb_user;/*******************************************************************************TYPEDEFS
*******************************************************************************/typedef enum{LTE_FDD_ENB_RB_SRB0 = 0,LTE_FDD_ENB_RB_SRB1,LTE_FDD_ENB_RB_SRB2,LTE_FDD_ENB_RB_DRB1,LTE_FDD_ENB_RB_DRB2,LTE_FDD_ENB_RB_N_ITEMS,
}LTE_FDD_ENB_RB_ENUM;
static const char LTE_fdd_enb_rb_text[LTE_FDD_ENB_RB_N_ITEMS][20] = {"SRB0","SRB1","SRB2","DRB1","DRB2"};typedef enum{LTE_FDD_ENB_MME_PROC_IDLE = 0,LTE_FDD_ENB_MME_PROC_ATTACH,LTE_FDD_ENB_MME_PROC_SERVICE_REQUEST,LTE_FDD_ENB_MME_PROC_DETACH,LTE_FDD_ENB_MME_PROC_N_ITEMS,
}LTE_FDD_ENB_MME_PROC_ENUM;
static const char LTE_fdd_enb_mme_proc_text[LTE_FDD_ENB_MME_PROC_N_ITEMS][100] = {"IDLE","ATTACH","SERVICE REQUEST","DETACH"};typedef enum{LTE_FDD_ENB_MME_STATE_IDLE = 0,LTE_FDD_ENB_MME_STATE_ID_REQUEST_IMSI,LTE_FDD_ENB_MME_STATE_REJECT,LTE_FDD_ENB_MME_STATE_AUTHENTICATE,LTE_FDD_ENB_MME_STATE_AUTH_REJECTED,LTE_FDD_ENB_MME_STATE_ENABLE_SECURITY,LTE_FDD_ENB_MME_STATE_RELEASE,LTE_FDD_ENB_MME_STATE_RRC_SECURITY,LTE_FDD_ENB_MME_STATE_ESM_INFO_TRANSFER,LTE_FDD_ENB_MME_STATE_ATTACH_ACCEPT,LTE_FDD_ENB_MME_STATE_ATTACHED,LTE_FDD_ENB_MME_STATE_SETUP_DRB,LTE_FDD_ENB_MME_STATE_SEND_DETACH_ACCEPT,LTE_FDD_ENB_MME_STATE_N_ITEMS,
}LTE_FDD_ENB_MME_STATE_ENUM;
static const char LTE_fdd_enb_mme_state_text[LTE_FDD_ENB_MME_STATE_N_ITEMS][100] = {"IDLE","ID REQUEST IMSI","REJECT","AUTHENTICATE","AUTH REJECTED","ENABLE SECURITY","RELEASE","RRC SECURITY","ESM INFO TRANSFER","ATTACH ACCEPT","ATTACHED","SETUP DRB","SEND DETACH ACCEPT"};typedef enum{LTE_FDD_ENB_RRC_PROC_IDLE = 0,LTE_FDD_ENB_RRC_PROC_RRC_CON_REQ,LTE_FDD_ENB_RRC_PROC_RRC_CON_REEST_REQ,LTE_FDD_ENB_RRC_PROC_N_ITEMS,
}LTE_FDD_ENB_RRC_PROC_ENUM;
static const char LTE_fdd_enb_rrc_proc_text[LTE_FDD_ENB_RRC_PROC_N_ITEMS][100] = {"IDLE","RRC CON REQ","RRC CON REEST REQ"};typedef enum{LTE_FDD_ENB_RRC_STATE_IDLE = 0,LTE_FDD_ENB_RRC_STATE_SRB1_SETUP,LTE_FDD_ENB_RRC_STATE_WAIT_FOR_CON_SETUP_COMPLETE,LTE_FDD_ENB_RRC_STATE_RRC_CONNECTED,LTE_FDD_ENB_RRC_STATE_WAIT_FOR_CON_REEST_COMPLETE,LTE_FDD_ENB_RRC_STATE_N_ITEMS,
}LTE_FDD_ENB_RRC_STATE_ENUM;
static const char LTE_fdd_enb_rrc_state_text[LTE_FDD_ENB_RRC_STATE_N_ITEMS][100] = {"IDLE","SRB1 SETUP","WAIT FOR CON SETUP COMPLETE","RRC CONNECTED","WAIT FOR CON REEST COMPLETE"};typedef enum{LTE_FDD_ENB_PDCP_CONFIG_N_A = 0,LTE_FDD_ENB_PDCP_CONFIG_SECURITY,LTE_FDD_ENB_PDCP_CONFIG_LONG_SN,LTE_FDD_ENB_PDCP_CONFIG_N_ITEMS,
}LTE_FDD_ENB_PDCP_CONFIG_ENUM;
static const char LTE_fdd_enb_pdcp_config_text[LTE_FDD_ENB_PDCP_CONFIG_N_ITEMS][20] = {"N/A","SECURITY","LONG SN"};typedef enum{LTE_FDD_ENB_RLC_CONFIG_TM = 0,LTE_FDD_ENB_RLC_CONFIG_UM,LTE_FDD_ENB_RLC_CONFIG_AM,LTE_FDD_ENB_RLC_CONFIG_N_ITEMS,
}LTE_FDD_ENB_RLC_CONFIG_ENUM;
static const char LTE_fdd_enb_rlc_config_text[LTE_FDD_ENB_RLC_CONFIG_N_ITEMS][20] = {"TM","UM","AM"};typedef enum{LTE_FDD_ENB_MAC_CONFIG_TM = 0,LTE_FDD_ENB_MAC_CONFIG_N_ITEMS,
}LTE_FDD_ENB_MAC_CONFIG_ENUM;
static const char LTE_fdd_enb_mac_config_text[LTE_FDD_ENB_MAC_CONFIG_N_ITEMS][20] = {"TM"};/*******************************************************************************CLASS DECLARATIONS
*******************************************************************************/class LTE_fdd_enb_rb
{
public:// Constructor/DestructorLTE_fdd_enb_rb(LTE_FDD_ENB_RB_ENUM _rb, LTE_fdd_enb_user *_user);~LTE_fdd_enb_rb();// IdentityLTE_FDD_ENB_RB_ENUM get_rb_id(void);LTE_fdd_enb_user* get_user(void);void reset_user(LTE_fdd_enb_user *_user);// GWvoid queue_gw_data_msg(LIBLTE_BYTE_MSG_STRUCT *gw_data);LTE_FDD_ENB_ERROR_ENUM get_next_gw_data_msg(LIBLTE_BYTE_MSG_STRUCT **gw_data);LTE_FDD_ENB_ERROR_ENUM delete_next_gw_data_msg(void);// MMEvoid queue_mme_nas_msg(LIBLTE_BYTE_MSG_STRUCT *nas_msg);LTE_FDD_ENB_ERROR_ENUM get_next_mme_nas_msg(LIBLTE_BYTE_MSG_STRUCT **nas_msg);LTE_FDD_ENB_ERROR_ENUM delete_next_mme_nas_msg(void);void set_mme_procedure(LTE_FDD_ENB_MME_PROC_ENUM procedure);LTE_FDD_ENB_MME_PROC_ENUM get_mme_procedure(void);void set_mme_state(LTE_FDD_ENB_MME_STATE_ENUM state);LTE_FDD_ENB_MME_STATE_ENUM get_mme_state(void);// RRCLIBLTE_RRC_UL_CCCH_MSG_STRUCT ul_ccch_msg;LIBLTE_RRC_UL_DCCH_MSG_STRUCT ul_dcch_msg;LIBLTE_RRC_DL_CCCH_MSG_STRUCT dl_ccch_msg;LIBLTE_RRC_DL_DCCH_MSG_STRUCT dl_dcch_msg;void queue_rrc_pdu(LIBLTE_BIT_MSG_STRUCT *pdu);LTE_FDD_ENB_ERROR_ENUM get_next_rrc_pdu(LIBLTE_BIT_MSG_STRUCT **pdu);LTE_FDD_ENB_ERROR_ENUM delete_next_rrc_pdu(void);void queue_rrc_nas_msg(LIBLTE_BYTE_MSG_STRUCT *nas_msg);LTE_FDD_ENB_ERROR_ENUM get_next_rrc_nas_msg(LIBLTE_BYTE_MSG_STRUCT **nas_msg);LTE_FDD_ENB_ERROR_ENUM delete_next_rrc_nas_msg(void);void set_rrc_procedure(LTE_FDD_ENB_RRC_PROC_ENUM procedure);LTE_FDD_ENB_RRC_PROC_ENUM get_rrc_procedure(void);void set_rrc_state(LTE_FDD_ENB_RRC_STATE_ENUM state);LTE_FDD_ENB_RRC_STATE_ENUM get_rrc_state(void);uint8 get_rrc_transaction_id(void);void set_rrc_transaction_id(uint8 transaction_id);// PDCPvoid queue_pdcp_pdu(LIBLTE_BYTE_MSG_STRUCT *pdu);LTE_FDD_ENB_ERROR_ENUM get_next_pdcp_pdu(LIBLTE_BYTE_MSG_STRUCT **pdu);LTE_FDD_ENB_ERROR_ENUM delete_next_pdcp_pdu(void);void queue_pdcp_sdu(LIBLTE_BIT_MSG_STRUCT *sdu);LTE_FDD_ENB_ERROR_ENUM get_next_pdcp_sdu(LIBLTE_BIT_MSG_STRUCT **sdu);LTE_FDD_ENB_ERROR_ENUM delete_next_pdcp_sdu(void);void queue_pdcp_data_sdu(LIBLTE_BYTE_MSG_STRUCT *sdu);LTE_FDD_ENB_ERROR_ENUM get_next_pdcp_data_sdu(LIBLTE_BYTE_MSG_STRUCT **sdu);LTE_FDD_ENB_ERROR_ENUM delete_next_pdcp_data_sdu(void);void set_pdcp_config(LTE_FDD_ENB_PDCP_CONFIG_ENUM config);LTE_FDD_ENB_PDCP_CONFIG_ENUM get_pdcp_config(void);uint32 get_pdcp_rx_count(void);void set_pdcp_rx_count(uint32 rx_count);uint32 get_pdcp_tx_count(void);void set_pdcp_tx_count(uint32 tx_count);// RLCvoid queue_rlc_pdu(LIBLTE_BYTE_MSG_STRUCT *pdu);LTE_FDD_ENB_ERROR_ENUM get_next_rlc_pdu(LIBLTE_BYTE_MSG_STRUCT **pdu);LTE_FDD_ENB_ERROR_ENUM delete_next_rlc_pdu(void);void queue_rlc_sdu(LIBLTE_BYTE_MSG_STRUCT *sdu);LTE_FDD_ENB_ERROR_ENUM get_next_rlc_sdu(LIBLTE_BYTE_MSG_STRUCT **sdu);LTE_FDD_ENB_ERROR_ENUM delete_next_rlc_sdu(void);LTE_FDD_ENB_RLC_CONFIG_ENUM get_rlc_config(void);uint16 get_rlc_vrr(void);void set_rlc_vrr(uint16 vrr);void update_rlc_vrr(void);uint16 get_rlc_vrmr(void);uint16 get_rlc_vrh(void);void set_rlc_vrh(uint16 vrh);void rlc_add_to_am_reception_buffer(LIBLTE_RLC_SINGLE_AMD_PDU_STRUCT *amd_pdu);void rlc_get_am_reception_buffer_status(LIBLTE_RLC_STATUS_PDU_STRUCT *status);LTE_FDD_ENB_ERROR_ENUM rlc_am_reassemble(LIBLTE_BYTE_MSG_STRUCT *sdu);uint16 get_rlc_vta(void);void set_rlc_vta(uint16 vta);uint16 get_rlc_vtms(void);uint16 get_rlc_vts(void);void set_rlc_vts(uint16 vts);void rlc_add_to_transmission_buffer(LIBLTE_RLC_SINGLE_AMD_PDU_STRUCT *amd_pdu);void rlc_update_transmission_buffer(LIBLTE_RLC_STATUS_PDU_STRUCT *status);void rlc_start_t_poll_retransmit(void);void rlc_stop_t_poll_retransmit(void);void handle_t_poll_retransmit_timer_expiry(uint32 timer_id);void set_rlc_vruh(uint16 vruh);uint16 get_rlc_vruh(void);void set_rlc_vrur(uint16 vrur);uint16 get_rlc_vrur(void);uint16 get_rlc_um_window_size(void);void rlc_add_to_um_reception_buffer(LIBLTE_RLC_UMD_PDU_STRUCT *umd_pdu, uint32 idx);LTE_FDD_ENB_ERROR_ENUM rlc_um_reassemble(LIBLTE_BYTE_MSG_STRUCT *sdu);void set_rlc_vtus(uint16 vtus);uint16 get_rlc_vtus(void);// MACvoid queue_mac_sdu(LIBLTE_BYTE_MSG_STRUCT *sdu);LTE_FDD_ENB_ERROR_ENUM get_next_mac_sdu(LIBLTE_BYTE_MSG_STRUCT **sdu);LTE_FDD_ENB_ERROR_ENUM delete_next_mac_sdu(void);LTE_FDD_ENB_MAC_CONFIG_ENUM get_mac_config(void);void set_con_res_id(uint64 con_res_id);uint64 get_con_res_id(void);void set_send_con_res_id(bool send_con_res_id);bool get_send_con_res_id(void);// DRBvoid set_eps_bearer_id(uint32 ebi);uint32 get_eps_bearer_id(void);void set_lc_id(uint32 _lc_id);uint32 get_lc_id(void);void set_drb_id(uint8 _drb_id);uint8 get_drb_id(void);void set_log_chan_group(uint8 lcg);uint8 get_log_chan_group(void);private:// IdentityLTE_FDD_ENB_RB_ENUM  rb;LTE_fdd_enb_user    *user;// GWsem_t                               gw_data_msg_queue_sem;std::list<LIBLTE_BYTE_MSG_STRUCT *> gw_data_msg_queue;// MMEsem_t                               mme_nas_msg_queue_sem;std::list<LIBLTE_BYTE_MSG_STRUCT *> mme_nas_msg_queue;LTE_FDD_ENB_MME_PROC_ENUM           mme_procedure;LTE_FDD_ENB_MME_STATE_ENUM          mme_state;// RRCsem_t                               rrc_pdu_queue_sem;sem_t                               rrc_nas_msg_queue_sem;std::list<LIBLTE_BIT_MSG_STRUCT *>  rrc_pdu_queue;std::list<LIBLTE_BYTE_MSG_STRUCT *> rrc_nas_msg_queue;LTE_FDD_ENB_RRC_PROC_ENUM           rrc_procedure;LTE_FDD_ENB_RRC_STATE_ENUM          rrc_state;uint8                               rrc_transaction_id;// PDCPsem_t                               pdcp_pdu_queue_sem;sem_t                               pdcp_sdu_queue_sem;sem_t                               pdcp_data_sdu_queue_sem;std::list<LIBLTE_BYTE_MSG_STRUCT *> pdcp_pdu_queue;std::list<LIBLTE_BIT_MSG_STRUCT *>  pdcp_sdu_queue;std::list<LIBLTE_BYTE_MSG_STRUCT *> pdcp_data_sdu_queue;LTE_FDD_ENB_PDCP_CONFIG_ENUM        pdcp_config;uint32                              pdcp_rx_count;uint32                              pdcp_tx_count;// RLCsem_t                                                rlc_pdu_queue_sem;sem_t                                                rlc_sdu_queue_sem;std::list<LIBLTE_BYTE_MSG_STRUCT *>                  rlc_pdu_queue;std::list<LIBLTE_BYTE_MSG_STRUCT *>                  rlc_sdu_queue;std::map<uint16, LIBLTE_RLC_SINGLE_AMD_PDU_STRUCT *> rlc_am_reception_buffer;std::map<uint16, LIBLTE_RLC_SINGLE_AMD_PDU_STRUCT *> rlc_am_transmission_buffer;std::map<uint16, LIBLTE_BYTE_MSG_STRUCT *>           rlc_um_reception_buffer;LTE_FDD_ENB_RLC_CONFIG_ENUM                          rlc_config;uint32                                               t_poll_retransmit_timer_id;uint16                                               rlc_vrr;uint16                                               rlc_vrmr;uint16                                               rlc_vrh;uint16                                               rlc_vta;uint16                                               rlc_vtms;uint16                                               rlc_vts;uint16                                               rlc_vruh;uint16                                               rlc_vrur;uint16                                               rlc_um_window_size;uint16                                               rlc_first_um_segment_sn;uint16                                               rlc_last_um_segment_sn;uint16                                               rlc_vtus;// MACsem_t                               mac_sdu_queue_sem;std::list<LIBLTE_BYTE_MSG_STRUCT *> mac_sdu_queue;LTE_FDD_ENB_MAC_CONFIG_ENUM         mac_config;uint64                              mac_con_res_id;bool                                mac_send_con_res_id;// DRBuint32 eps_bearer_id;uint32 lc_id;uint8  drb_id;uint8  log_chan_group;// Genericvoid queue_msg(LIBLTE_BIT_MSG_STRUCT *msg, sem_t *sem, std::list<LIBLTE_BIT_MSG_STRUCT *> *queue);void queue_msg(LIBLTE_BYTE_MSG_STRUCT *msg, sem_t *sem, std::list<LIBLTE_BYTE_MSG_STRUCT *> *queue);LTE_FDD_ENB_ERROR_ENUM get_next_msg(sem_t *sem, std::list<LIBLTE_BIT_MSG_STRUCT *> *queue, LIBLTE_BIT_MSG_STRUCT **msg);LTE_FDD_ENB_ERROR_ENUM get_next_msg(sem_t *sem, std::list<LIBLTE_BYTE_MSG_STRUCT *> *queue, LIBLTE_BYTE_MSG_STRUCT **msg);LTE_FDD_ENB_ERROR_ENUM delete_next_msg(sem_t *sem, std::list<LIBLTE_BIT_MSG_STRUCT *> *queue);LTE_FDD_ENB_ERROR_ENUM delete_next_msg(sem_t *sem, std::list<LIBLTE_BYTE_MSG_STRUCT *> *queue);
};#endif /* __LTE_FDD_ENB_RB_H__ */

移动管理实体层:LTE_fdd_enb_mme.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_mme.hDescription: Contains all the definitions for the LTE FDD eNodeBmobility management entity layer.Revision History----------    -------------    --------------------------------------------11/09/2013    Ben Wojtowicz    Created file01/18/2014    Ben Wojtowicz    Added an explicit include for boost mutexes.06/15/2014    Ben Wojtowicz    Added RRC NAS message handler.08/03/2014    Ben Wojtowicz    Added message parsers, state machines, andmessage senders.09/03/2014    Ben Wojtowicz    Added authentication and security support.11/01/2014    Ben Wojtowicz    Added attach accept/complete, ESM infotransfer, and default bearer setup support.11/29/2014    Ben Wojtowicz    Added service request, service reject, andactivate dedicated EPS bearer contextrequest support.12/16/2014    Ben Wojtowicz    Added ol extension to message queue andsending of EMM information message.02/15/2015    Ben Wojtowicz    Moved to new message queue.03/11/2015    Ben Wojtowicz    Added detach handling.12/06/2015    Ben Wojtowicz    Changed boost::mutex to sem_t.02/13/2016    Ben Wojtowicz    Removed boost message queue include.07/29/2017    Ben Wojtowicz    Moved away from singleton pattern.*******************************************************************************/#ifndef __LTE_FDD_ENB_MME_H__
#define __LTE_FDD_ENB_MME_H__/*******************************************************************************INCLUDES
*******************************************************************************/#include "LTE_fdd_enb_cnfg_db.h"
#include "LTE_fdd_enb_msgq.h"/*******************************************************************************DEFINES
*******************************************************************************//*******************************************************************************FORWARD DECLARATIONS
*******************************************************************************//*******************************************************************************TYPEDEFS
*******************************************************************************//*******************************************************************************CLASS DECLARATIONS
*******************************************************************************/class LTE_fdd_enb_mme
{
public:// Constructor/DestructorLTE_fdd_enb_mme();~LTE_fdd_enb_mme();// Start/Stopvoid start(LTE_fdd_enb_msgq *from_rrc, LTE_fdd_enb_msgq *to_rrc, LTE_fdd_enb_interface *iface);void stop(void);// External interfacevoid update_sys_info(void);private:// Start/StopLTE_fdd_enb_interface *interface;sem_t                  start_sem;bool                   started;// Communicationvoid handle_rrc_msg(LTE_FDD_ENB_MESSAGE_STRUCT &msg);LTE_fdd_enb_msgq *msgq_from_rrc;LTE_fdd_enb_msgq *msgq_to_rrc;// RRC Message Handlersvoid handle_nas_msg(LTE_FDD_ENB_MME_NAS_MSG_READY_MSG_STRUCT *nas_msg);void handle_rrc_cmd_resp(LTE_FDD_ENB_MME_RRC_CMD_RESP_MSG_STRUCT *rrc_cmd_resp);// Message Parsersvoid parse_attach_complete(LIBLTE_BYTE_MSG_STRUCT *msg, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);void parse_attach_request(LIBLTE_BYTE_MSG_STRUCT *msg, LTE_fdd_enb_user **user, LTE_fdd_enb_rb **rb);void parse_authentication_failure(LIBLTE_BYTE_MSG_STRUCT *msg, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);void parse_authentication_response(LIBLTE_BYTE_MSG_STRUCT *msg, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);void parse_detach_request(LIBLTE_BYTE_MSG_STRUCT *msg, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);void parse_identity_response(LIBLTE_BYTE_MSG_STRUCT *msg, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);void parse_security_mode_complete(LIBLTE_BYTE_MSG_STRUCT *msg, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);void parse_security_mode_reject(LIBLTE_BYTE_MSG_STRUCT *msg, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);void parse_service_request(LIBLTE_BYTE_MSG_STRUCT *msg, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);void parse_activate_default_eps_bearer_context_accept(LIBLTE_BYTE_MSG_STRUCT *msg, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);void parse_esm_information_response(LIBLTE_BYTE_MSG_STRUCT *msg, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);void parse_pdn_connectivity_request(LIBLTE_BYTE_MSG_STRUCT *msg, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);// State Machinesvoid attach_sm(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);void service_req_sm(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);void detach_sm(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);// Message Sendersvoid send_attach_accept(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);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_detach_accept(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);void send_activate_dedicated_eps_bearer_context_request(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);void send_esm_information_request(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);void send_rrc_command(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb, LTE_FDD_ENB_RRC_CMD_ENUM cmd);// Parameterssem_t                       sys_info_sem;LTE_FDD_ENB_SYS_INFO_STRUCT sys_info;// Helpersuint32 get_next_ip_addr(void);uint32 next_ip_addr;uint32 dns_addr;
};#endif /* __LTE_FDD_ENB_MME_H__ */

数据库服务:LTE_fdd_enb_hss.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_hss.hDescription: Contains all the definitions for the LTE FDD eNodeBhome subscriber server.Revision History----------    -------------    --------------------------------------------06/15/2014    Ben Wojtowicz    Created file08/03/2014    Ben Wojtowicz    Added authentication vector support.09/03/2014    Ben Wojtowicz    Added sequence number resynch.11/01/2014    Ben Wojtowicz    Added user file support.11/29/2014    Ben Wojtowicz    Added support for regenerating eNodeBsecurity data.12/06/2015    Ben Wojtowicz    Changed boost::mutex to sem_t.*******************************************************************************/#ifndef __LTE_FDD_ENB_HSS_H__
#define __LTE_FDD_ENB_HSS_H__/*******************************************************************************INCLUDES
*******************************************************************************/#include "LTE_fdd_enb_interface.h"
#include "LTE_fdd_enb_user.h"
#include <list>/*******************************************************************************DEFINES
*******************************************************************************/#define LTE_FDD_ENB_IND_HE_N_BITS    5
#define LTE_FDD_ENB_IND_HE_MASK      0x1FUL
#define LTE_FDD_ENB_IND_HE_MAX_VALUE 31
#define LTE_FDD_ENB_SEQ_HE_MAX_VALUE 0x7FFFFFFFFFFFUL/*******************************************************************************FORWARD DECLARATIONS
*******************************************************************************//*******************************************************************************TYPEDEFS
*******************************************************************************/typedef struct{uint8 k[16];
}LTE_FDD_ENB_STORED_DATA_STRUCT;typedef struct{LTE_FDD_ENB_AUTHENTICATION_VECTOR_STRUCT auth_vec;uint64                                   sqn_he;uint64                                   seq_he;uint8                                    ak[6];uint8                                    mac[8];uint8                                    k_asme[32];uint8                                    k_enb[32];uint8                                    k_up_enc[32];uint8                                    k_up_int[32];uint8                                    ind_he;
}LTE_FDD_ENB_GENERATED_DATA_STRUCT;typedef struct{LTE_FDD_ENB_USER_ID_STRUCT        id;LTE_FDD_ENB_STORED_DATA_STRUCT    stored_data;LTE_FDD_ENB_GENERATED_DATA_STRUCT generated_data;
}LTE_FDD_ENB_HSS_USER_STRUCT;/*******************************************************************************CLASS DECLARATIONS
*******************************************************************************/class LTE_fdd_enb_hss
{
public:// Singletonstatic LTE_fdd_enb_hss* get_instance(void);static void cleanup(void);// External interfaceLTE_FDD_ENB_ERROR_ENUM add_user(std::string imsi, std::string imei, std::string k);LTE_FDD_ENB_ERROR_ENUM del_user(std::string imsi);std::string print_all_users(void);bool is_imsi_allowed(uint64 imsi);bool is_imei_allowed(uint64 imei);LTE_FDD_ENB_USER_ID_STRUCT* get_user_id_from_imsi(uint64 imsi);LTE_FDD_ENB_USER_ID_STRUCT* get_user_id_from_imei(uint64 imei);void generate_security_data(LTE_FDD_ENB_USER_ID_STRUCT *id, uint16 mcc, uint16 mnc);void security_resynch(LTE_FDD_ENB_USER_ID_STRUCT *id, uint16 mcc, uint16 mnc, uint8 *auts);LTE_FDD_ENB_AUTHENTICATION_VECTOR_STRUCT* regenerate_enb_security_data(LTE_FDD_ENB_USER_ID_STRUCT *id, uint32 nas_count_ul);LTE_FDD_ENB_AUTHENTICATION_VECTOR_STRUCT* get_auth_vec(LTE_FDD_ENB_USER_ID_STRUCT *id);// User Filevoid set_use_user_file(bool uuf);void read_user_file(void);private:// Singletonstatic LTE_fdd_enb_hss *instance;LTE_fdd_enb_hss();~LTE_fdd_enb_hss();// Allowed userssem_t                                    user_sem;std::list<LTE_FDD_ENB_HSS_USER_STRUCT *> user_list;// User Filevoid write_user_file(void);void delete_user_file(void);bool use_user_file;
};#endif /* __LTE_FDD_ENB_HSS_H__ */

网关:LTE_fdd_enb_gw.h (S-GW, P-GW)

/*******************************************************************************Copyright 2014-2015, 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_gw.hDescription: Contains all the definitions for the LTE FDD eNodeBIP gateway.Revision History----------    -------------    --------------------------------------------11/29/2014    Ben Wojtowicz    Created file12/16/2014    Ben Wojtowicz    Added ol extension to message queue.02/15/2015    Ben Wojtowicz    Moved to new message queue.12/06/2015    Ben Wojtowicz    Changed boost::mutex to sem_t.07/29/2017    Ben Wojtowicz    Moved away from singleton pattern.*******************************************************************************/#ifndef __LTE_FDD_ENB_GW_H__
#define __LTE_FDD_ENB_GW_H__/*******************************************************************************INCLUDES
*******************************************************************************/#include "LTE_fdd_enb_interface.h"
#include "LTE_fdd_enb_msgq.h"/*******************************************************************************DEFINES
*******************************************************************************//*******************************************************************************FORWARD DECLARATIONS
*******************************************************************************//*******************************************************************************TYPEDEFS
*******************************************************************************//*******************************************************************************CLASS DECLARATIONS
*******************************************************************************/class LTE_fdd_enb_gw
{
public:// Constructor/DestructorLTE_fdd_enb_gw();~LTE_fdd_enb_gw();// Start/Stopbool is_started(void);LTE_FDD_ENB_ERROR_ENUM start(LTE_fdd_enb_msgq *from_pdcp, LTE_fdd_enb_msgq *to_pdcp, char *err_str, LTE_fdd_enb_interface *iface);void stop(void);private:// Start/StopLTE_fdd_enb_interface *interface;sem_t                  start_sem;bool                   started;// Communicationvoid handle_pdcp_msg(LTE_FDD_ENB_MESSAGE_STRUCT &msg);LTE_fdd_enb_msgq *msgq_from_pdcp;LTE_fdd_enb_msgq *msgq_to_pdcp;// PDCP Message Handlersvoid handle_gw_data(LTE_FDD_ENB_GW_DATA_READY_MSG_STRUCT *gw_data);// GW Receivestatic void* receive_thread(void *inputs);pthread_t rx_thread;// TUN deviceint32 tun_fd;
};#endif /* __LTE_FDD_ENB_GW_H__ */

开源项目:https://github.com/mgp25/OpenLTE

感谢:Ben Wojtowicz

OpenLTE 基站相关头文件:PHY、MAC、RLC、RRC、PDCP、RB、MME、HSS、GW相关推荐

  1. OpenLTE 基站相关头文件:用户、定时器、基站接口、消息接口

    Table of Contents 用户:LTE_fdd_enb_user.h 用户管理:LTE_fdd_enb_user_mgr.h 定时器:LTE_fdd_enb_timer.h 定时器管理:LT ...

  2. Linux下Socket相关头文件总结

    一 三种类型的套接字: 1.流式套接字(SOCKET_STREAM)     提供面向连接的可靠的数据传输服务.数据被看作是字节流,无长度限制.例如FTP协议就采用这种. 2.数据报式套接字(SOCK ...

  3. linux pid t 头文件_linux系统调用相关头文件

    Linux C 一些函数 所属的头文件 2011-03-07 10:25:07 分类: LINUX 在编写程序时,有时总是不记得所使用的函数在哪个库函数中.现在先把自己以前经常用到的函数头文件总结一下 ...

  4. vscode不能支持ROS相关头文件(ros/ros.h)?

    Ubuntu16.04下vscode编写ros kinetic代码,编写pakage源文件代码,#include<ros/ros.h>头文件时报错,无法运行智能提示. 解决步骤: vsco ...

  5. 5G(7)---5G NR协议栈及功能2 - MAC RLC PDCP SDAP

    5G NR协议栈及功能2 - MAC RLC PDCP SDAP 备注:本文所有图片均来自3GPP标准,包括3GPP TS 38.300 V15.0.0 (2017-12)和3GPP TS 38.20 ...

  6. 5G(3)---5G NR协议栈及功能2 - MAC RLC PDCP SDAP

    备注:本文所有图片均来自3GPP标准,包括3GPP TS 38.300 V15.0.0 (2017-12)和3GPP TS 38.202 V15.0.0 (2017-12)等.本文主要介绍截止目前(2 ...

  7. 5G NR协议栈及功能2 - MAC RLC PDCP SDAP

    备注:本文所有图片均来自3GPP标准,包括3GPP TS 38.300 V15.0.0 (2017-12)和3GPP TS 38.202 V15.0.0 (2017-12)等.本文主要介绍截止目前(2 ...

  8. linux日志文件存放目录,Log4j 日志文件Linux/Mac/Windows通用存放位置设置方法

    log4j1/log4j2中category的配置以及log的输出位置(windows和linux通用的log输出位置) 一.场景和需求 假设我现在有3个独立的用project(暂时用maven关联起 ...

  9. mac 命令行 解压7z文件_如何在Mac上快速压缩和解压文件?Mac上解压和压缩文件的方法...

    苹果mac电脑怎么压缩和解压文件?Mac电脑仅默认支持把文件压缩成zip格式,解压成zip.tar.gz,bz2等格式,有些操作需要安装第三方软件来完成,这篇文章为大家带来几种关于在Mac上解压和压缩 ...

最新文章

  1. 补充cpusim图片
  2. oracle各种字符集修改
  3. 【OkHttp】Android 项目导入 OkHttp ( 配置依赖 | 配置 networkSecurityConfig | 配置 ViewBinding | 代码示例 )
  4. 计算机中丢失sense3.dll,sense3.dll
  5. 从玉谋定农业大健康-国情讲坛·林裕豪 :粤港澳大湾区菜篮子
  6. 几款强大的 Pandas 数据探索工具,推荐收藏使用
  7. 阿里云贾扬清:大数据+AI工程化,让数据从「成本」变为「资产」
  8. 听我的!美国科技公司这样做Code Review
  9. nedc工况_东南DX3 EV续航升级 NEDC综合工况续航451公里
  10. pycharm python 模板配置_pycharm设置python脚本模板
  11. 五年从P5到P8,在阿里学做个靠谱的人
  12. 三步彻底清除电脑的mysql
  13. 安装Harbor1.4.0开源docker镜像仓库(含letsencrypt证书)
  14. python-socket作业
  15. Google GMS认证问题
  16. java后台报错cant found font [times New Roman] installed on the system
  17. “宏观经济学”练习题1
  18. SCT2650STER、SCT2450STER、SCT2630ASTER 北京冠宇铭通
  19. 2021-2027全球与中国自然对流烤炉市场现状及未来发展趋势
  20. python的and和or优先级

热门文章

  1. 计算机网络 多个站点共享信道的方式图
  2. C#实现文件下载的几种方式
  3. Spring学习总结(1)- IOC
  4. STM32 使用片外外扩内存调试
  5. MySQL Connector/C++入门教程(上)
  6. 如何weak link一个framework (高版本兼容低版本)
  7. 防盗链IHttpHandler
  8. HttpServletRequest应用-获取请求参数及解决中文乱码
  9. 配置classpath,引入jar包
  10. 重写equals()时为什么也得重写hashCode()之深度解读equals方法与hashCode方法渊源