Commit b2181288 authored by Xenofon Foukas's avatar Xenofon Foukas

Moved agent and protocol to flexran naming convention

parent 9ed966cf
......@@ -840,55 +840,55 @@ include_directories("${OPENAIR_DIR}")
################
if (ENB_AGENT_SB_IF)
# set the version of protobuf messages, V3 not supported yet
add_list1_option(PRPT_VERSION V2 "PRPT MSG protobuf grammar version" V2 V3)
if (${PRPT_VERSION} STREQUAL "V2")
set (PRPTDIR V2)
elseif (${PRPT_VERSION} STREQUAL "V3")
set (PRPTDIR V3)
endif(${PRPT_VERSION} STREQUAL "V2")
set(PRPT_MSG_DIR ${OPENAIR2_DIR}/ENB_APP/MESSAGES/${PRPTDIR} )
set(PRPT_MSG_FILES
${PRPT_MSG_DIR}/header.proto
${PRPT_MSG_DIR}/progran.proto
${PRPT_MSG_DIR}/stats_common.proto
${PRPT_MSG_DIR}/stats_messages.proto
${PRPT_MSG_DIR}/time_common.proto
${PRPT_MSG_DIR}/controller_commands.proto
${PRPT_MSG_DIR}/mac_primitives.proto
${PRPT_MSG_DIR}/config_messages.proto
${PRPT_MSG_DIR}/config_common.proto
${PRPT_MSG_DIR}/control_delegation.proto
add_list1_option(FLPT_VERSION V2 "FLPT MSG protobuf grammar version" V2 V3)
if (${FLPT_VERSION} STREQUAL "V2")
set (FLPTDIR V2)
elseif (${FLPT_VERSION} STREQUAL "V3")
set (FLPTDIR V3)
endif(${FLPT_VERSION} STREQUAL "V2")
set(FLPT_MSG_DIR ${OPENAIR2_DIR}/ENB_APP/MESSAGES/${FLPTDIR} )
set(FLPT_MSG_FILES
${FLPT_MSG_DIR}/header.proto
${FLPT_MSG_DIR}/flexran.proto
${FLPT_MSG_DIR}/stats_common.proto
${FLPT_MSG_DIR}/stats_messages.proto
${FLPT_MSG_DIR}/time_common.proto
${FLPT_MSG_DIR}/controller_commands.proto
${FLPT_MSG_DIR}/mac_primitives.proto
${FLPT_MSG_DIR}/config_messages.proto
${FLPT_MSG_DIR}/config_common.proto
${FLPT_MSG_DIR}/control_delegation.proto
)
set(PRPT_C_DIR ${protobuf_generated_dir}/${PRPTDIR})
#message("calling protoc_call=${protoc_call} PRPT_C_DIR=${PRPT_C_DIR} PRPT_MSG_FILES=${PRPT_MSG_FILES}")
execute_process(COMMAND ${protoc_call} ${PRPT_C_DIR} ${PRPT_MSG_DIR} ${PRPT_MSG_FILES})
file(GLOB PRPT_source ${PRPT_C_DIR}/*.c)
set(PRPT_OAI_generated
${PRPT_C_DIR}/header.pb-c.c
${PRPT_C_DIR}/progran.pb-c.c
${PRPT_C_DIR}/stats_common.pb-c.c
${PRPT_C_DIR}/stats_messages.pb-c.c
${PRPT_C_DIR}/time_common.pb-c.c
${PRPT_C_DIR}/controller_commands.pb-c.c
${PRPT_C_DIR}/mac_primitives.pb-c.c
${PRPT_C_DIR}/config_messages.pb-c.c
${PRPT_C_DIR}/config_common.pb-c.c
${PRPT_C_DIR}/control_delegation.pb-c.c
set(FLPT_C_DIR ${protobuf_generated_dir}/${FLPTDIR})
#message("calling protoc_call=${protoc_call} FLPT_C_DIR=${FLPT_C_DIR} FLPT_MSG_FILES=${FLPT_MSG_FILES}")
execute_process(COMMAND ${protoc_call} ${FLPT_C_DIR} ${FLPT_MSG_DIR} ${FLPT_MSG_FILES})
file(GLOB FLPT_source ${FLPT_C_DIR}/*.c)
set(FLPT_OAI_generated
${FLPT_C_DIR}/header.pb-c.c
${FLPT_C_DIR}/flexran.pb-c.c
${FLPT_C_DIR}/stats_common.pb-c.c
${FLPT_C_DIR}/stats_messages.pb-c.c
${FLPT_C_DIR}/time_common.pb-c.c
${FLPT_C_DIR}/controller_commands.pb-c.c
${FLPT_C_DIR}/mac_primitives.pb-c.c
${FLPT_C_DIR}/config_messages.pb-c.c
${FLPT_C_DIR}/config_common.pb-c.c
${FLPT_C_DIR}/control_delegation.pb-c.c
)
file(GLOB prpt_h ${PRPT_C_DIR}/*.h)
set(prpt_h ${prpt_h} )
file(GLOB flpt_h ${FLPT_C_DIR}/*.h)
set(flpt_h ${flpt_h} )
add_library(PRPT_MSG
${PRPT_OAI_generated}
${PRPT_source}
add_library(FLPT_MSG
${FLPT_OAI_generated}
${FLPT_source}
)
set(PRPT_MSG_LIB PRPT_MSG)
#message("prpt c dir is : ${PRPT_C_DIR}")
include_directories (${PRPT_C_DIR})
set(FLPT_MSG_LIB FLPT_MSG)
#message("prpt c dir is : ${FLPT_C_DIR}")
include_directories (${FLPT_C_DIR})
add_library(ASYNC_IF
${OPENAIR2_DIR}/UTIL/ASYNC_IF/socket_link.c
......@@ -1757,7 +1757,7 @@ add_executable(lte-softmodem
target_link_libraries (lte-softmodem -ldl
-Wl,--start-group
RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS L2 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${MIH_LIB} ${PRPT_MSG_LIB} ${ASYNC_IF_LIB} ${ENB_AGENT_LIB} LFDS7
RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS L2 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${ENB_AGENT_LIB} LFDS7
-Wl,--end-group )
target_link_libraries (lte-softmodem ${LIBXML2_LIBRARIES})
......@@ -1791,7 +1791,7 @@ add_executable(lte-softmodem-nos1
)
target_link_libraries (lte-softmodem-nos1
-Wl,--start-group
RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCHED_LIB PHY LFDS L2 ${MSC_LIB} ${RAL_LIB} ${ITTI_LIB} ${MIH_LIB} ${PRPT_MSG_LIB} ${ASYNC_IF_LIB} ${ENB_AGENT_LIB} LFDS7
RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCHED_LIB PHY LFDS L2 ${MSC_LIB} ${RAL_LIB} ${ITTI_LIB} ${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${ENB_AGENT_LIB} LFDS7
-Wl,--end-group )
target_link_libraries (lte-softmodem-nos1 ${LIBXML2_LIBRARIES})
......@@ -1936,7 +1936,7 @@ add_executable(oaisim_nos1
target_include_directories(oaisim_nos1 PUBLIC ${OPENAIR_TARGETS}/SIMU/USER)
target_link_libraries (oaisim_nos1
-Wl,--start-group
RRC_LIB X2AP_LIB SECU_CN UTIL HASHTABLE SCHED_LIB PHY LFDS ${MSC_LIB} L2 ${RAL_LIB} SIMU SIMU_ETH SECU_OSA ${ITTI_LIB} ${MIH_LIB} ${PRPT_MSG_LIB} ${ASYNC_IF_LIB} ${ENB_AGENT_LIB} LFDS7
RRC_LIB X2AP_LIB SECU_CN UTIL HASHTABLE SCHED_LIB PHY LFDS ${MSC_LIB} L2 ${RAL_LIB} SIMU SIMU_ETH SECU_OSA ${ITTI_LIB} ${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${ENB_AGENT_LIB} LFDS7
-Wl,--end-group )
target_link_libraries (oaisim_nos1 ${LIBXML2_LIBRARIES} ${LAPACK_LIBRARIES})
......
......@@ -5,64 +5,64 @@ package protocol;
// Cell config related structures and enums
//
message prp_si_config {
message flex_si_config {
optional uint32 sfn = 1;
optional uint32 sib1_length = 2; // The length of SIB1 in bytes
optional uint32 si_window_length = 3; // The scheduling window for all SIs in SF
repeated prp_si_message si_message = 4; // List of SI messages to be sent.
repeated flex_si_message si_message = 4; // List of SI messages to be sent.
// The index identifies the type of an SI message
// 0 - SIB1
// 1..31 - SIx
// 32..63 - PCCH
}
message prp_si_message {
message flex_si_message {
optional uint32 periodicity = 1; // Periodicity of SI msg in radio frames
optional uint32 length = 2; // The length of the SI message in bytes
}
enum prp_hopping_mode {
PRHM_INTER = 0;
PRHM_INTERINTRA = 1;
enum flex_hopping_mode {
FLHM_INTER = 0;
FLHM_INTERINTRA = 1;
}
enum prp_phich_resource {
PRPR_ONE_SIXTH = 0;
PRPR_HALF = 1;
PRPR_ONE = 2;
PRPR_TWO = 3;
enum flex_phich_resource {
FLPR_ONE_SIXTH = 0;
FLPR_HALF = 1;
FLPR_ONE = 2;
FLPR_TWO = 3;
}
enum prp_phich_duration {
PRPD_NORMAL = 0;
PRPD_EXTENDED = 1;
enum flex_phich_duration {
FLPD_NORMAL = 0;
FLPD_EXTENDED = 1;
}
enum prp_ul_cyclic_prefix_length {
PRUCPL_NORMAL = 0;
PRUCPL_EXTENDED = 1;
enum flex_ul_cyclic_prefix_length {
FLUCPL_NORMAL = 0;
FLUCPL_EXTENDED = 1;
}
enum prp_dl_cyclic_prefix_length {
PRDCPL_NORMAL = 0;
PRDCPL_EXTENDED = 1;
enum flex_dl_cyclic_prefix_length {
FLDCPL_NORMAL = 0;
FLDCPL_EXTENDED = 1;
}
enum prp_duplex_mode {
PRDM_TDD = 0;
PRDM_FDD = 1;
enum flex_duplex_mode {
FLDM_TDD = 0;
FLDM_FDD = 1;
}
enum prp_qam {
PREQ_MOD_16QAM = 0;
PREQ_MOD_64QAM = 1;
enum flex_qam {
FLEQ_MOD_16QAM = 0;
FLEQ_MOD_64QAM = 1;
}
//
// UE config related structures and enums
//
message prp_drx_config {
message flex_drx_config {
optional uint32 on_duration_timer = 1; // Timer in SF. See TS 36.321
optional uint32 drx_inactivity_timer = 2; // Timer in SF. See TS 36.321
optional uint32 drx_retransmission_timer = 3; // Timer in SF. See TS 36.321
......@@ -72,30 +72,30 @@ message prp_drx_config {
optional uint32 drx_short_cycle_timer = 7; // Timer in subframes. See TS 36.321
}
message prp_sps_config {
message flex_sps_config {
optional uint32 semi_persistent_sched_interval_UL = 1; // SPS UL scheduling interval in SF
optional uint32 semi_persistent_sched_interval_DL = 2; // SPS DL scheduling interval in SF
optional uint32 num_of_conf_sps_proc = 3; // Number of SPS HARQ processes. See TS 36.321
repeated uint32 n1_PUCCH_AN_persistent_element = 4;// See TS36.213. Ignored when config is used
// as part of PRPT_SET_UE_CONFIG
// as part of FLPT_SET_UE_CONFIG
optional uint32 implicit_release_after = 5; // number of empty transmissions before release of SPS
}
message prp_sr_config {
message flex_sr_config {
optional uint32 sr_action = 1; // Indicates if SR config should be changed or released
// One of the PRSRA_* enum values
// One of the FLSRA_* enum values
optional uint32 sched_interval = 2; // SR scheduling interval in SF
optional uint32 dsr_trans_max = 3; // See TS 36.213
}
message prp_cqi_config {
message flex_cqi_config {
optional uint32 cqi_action = 1; // Indicats if CQI changed or released.
// One of the PRSRA_* enum values
// One of the FLSRA_* enum values
optional uint32 cqi_sched_interval = 2; // CQI scheduling interval in SF
optional uint32 ri_sched_interval = 3; // RI scheduling interval in SF
}
message prp_ue_capabilities {
message flex_ue_capabilities {
optional uint32 half_duplex = 1; // Boolean value. Only half duplex support. FDD operation
optional uint32 intra_SF_hopping = 2; // Support for intra-subframe hopping. Boolean value
optional uint32 type2_sb_1 = 3; // Support for type 2 hopping with n_sb > 1
......@@ -103,7 +103,7 @@ message prp_ue_capabilities {
optional uint32 res_alloc_type1 = 5; // Boolean value. UE support for resource allocation type 1
}
message prp_scell_config {
message flex_scell_config {
optional uint32 carrier_index = 1; // Id of the carrier component
optional uint32 scell_index = 2; // Index of this Scell (RRC SCellIndex)
optional uint32 use_ccs = 3; // Boolean value. Indicates if cross-carrier scheduling
......@@ -113,46 +113,46 @@ message prp_scell_config {
optional uint32 pdsch_start = 5; // Starting OFDM symbol of PDSCH data region for this SCell
}
enum prp_meas_gap_config_pattern {
PRMGCP_GP1 = 0;
PRMGCP_GP2 = 1;
PRMGCP_OFF = 2;
enum flex_meas_gap_config_pattern {
FLMGCP_GP1 = 0;
FLMGCP_GP2 = 1;
FLMGCP_OFF = 2;
}
enum prp_setup_release_action {
PRSRA_SETUP = 0;
PRSRA_RELEASE = 1;
enum flex_setup_release_action {
FLSRA_SETUP = 0;
FLSRA_RELEASE = 1;
}
enum prp_ue_transmission_antenna {
PRUTA_NONE = 0;
PRUTA_OPEN_LOOP = 1;
PRUTA_CLOSED_LOOP = 2;
enum flex_ue_transmission_antenna {
FLUTA_NONE = 0;
FLUTA_OPEN_LOOP = 1;
FLUTA_CLOSED_LOOP = 2;
}
enum prp_aperiodic_cqi_report_mode {
PRACRM_RM12 = 0;
PRACRM_RM20 = 1;
PRACRM_RM22 = 2;
PRACRM_RM30 = 3;
PRACRM_RM31 = 4;
PRACRM_NONE = 5;
enum flex_aperiodic_cqi_report_mode {
FLACRM_RM12 = 0;
FLACRM_RM20 = 1;
FLACRM_RM22 = 2;
FLACRM_RM30 = 3;
FLACRM_RM31 = 4;
FLACRM_NONE = 5;
}
enum prp_tdd_ack_nack_feedback_mode {
PRTANFM_BUNDLING = 0;
PRTANFM_MULTIPLEXING = 1;
enum flex_tdd_ack_nack_feedback_mode {
FLTANFM_BUNDLING = 0;
FLTANFM_MULTIPLEXING = 1;
}
//
// Logical channel config related structures and enums
//
message prp_lc_config {
message flex_lc_config {
optional uint32 lcid = 1; // The logical channel id
optional uint32 lcg = 2; // The logical channel group (0..3) the LC is mapped to
optional uint32 direction = 3; // The LC direction. One of the PRLCD_* enum values
optional uint32 qos_bearer_type = 4;// GBR or NGBR bearer. One of the PRQBT_* enum values
optional uint32 direction = 3; // The LC direction. One of the FLLCD_* enum values
optional uint32 qos_bearer_type = 4;// GBR or NGBR bearer. One of the FLQBT_* enum values
optional uint32 qci = 5; // The QCI defined in TS 23.203, coded as defined in TS 36.413
// One less than the actual QCI value
optional uint64 e_RAB_max_bitrate_UL = 6; // In bps (GBR only)
......@@ -161,20 +161,20 @@ message prp_lc_config {
optional uint64 e_RAB_guaranteed_bitrate_DL = 9; // In bps (GBR only)
}
enum prp_lc_direction {
PRLCD_UL = 0;
PRLCD_DL = 1;
PRLCD_BOTH = 2;
enum flex_lc_direction {
FLLCD_UL = 0;
FLLCD_DL = 1;
FLLCD_BOTH = 2;
}
enum prp_qos_bearer_type {
PRQBT_NON_GBR = 0;
PRQBT_GBR = 1;
enum flex_qos_bearer_type {
FLQBT_NON_GBR = 0;
FLQBT_GBR = 1;
}
enum prp_ue_state_change_type {
PRUESC_UPDATED = 0;
PRUESC_ACTIVATED = 1;
PRUESC_DEACTIVATED = 2;
PRUESC_MOVED = 3;
enum flex_ue_state_change_type {
FLUESC_UPDATED = 0;
FLUESC_ACTIVATED = 1;
FLUESC_DEACTIVATED = 2;
FLUESC_MOVED = 3;
}
\ No newline at end of file
......@@ -3,23 +3,23 @@ package protocol;
import "config_common.proto";
message prp_cell_config {
message flex_cell_config {
optional uint32 phy_cell_id = 1; // The PCI of this cell
optional uint32 cell_id = 2; // The PLMN cell id of this cell
optional uint32 pusch_hopping_offset = 3; // PUSCH resources in RBs for hopping
optional uint32 hopping_mode = 4; // One of the PRHM_* enum values
optional uint32 hopping_mode = 4; // One of the FLHM_* enum values
optional uint32 n_sb = 5; // The number of subbands
optional uint32 phich_resource = 6; // The number of REGs used for PHICH
// One of the PRPR_* enum values
optional uint32 phich_duration = 7; // One of the PRPD_* enum values
// One of the FLPR_* enum values
optional uint32 phich_duration = 7; // One of the FLPD_* enum values
optional uint32 init_nr_PDCCH_OFDM_sym = 8; // See TS 36.211, section 6.9
optional prp_si_config si_config = 9; // The SI configuration
optional flex_si_config si_config = 9; // The SI configuration
optional uint32 dl_bandwidth = 10; // The DL transmission bandwidth in RBs
optional uint32 ul_bandwidth = 11; // The UL transmission bandwidth in RBs
optional uint32 ul_cyclic_prefix_length = 13; // One of the PRUCPL_* enum values
optional uint32 dl_cyclic_prefix_length = 14; // One of the PRDCPL_* enum values
optional uint32 ul_cyclic_prefix_length = 13; // One of the FLUCPL_* enum values
optional uint32 dl_cyclic_prefix_length = 14; // One of the FLDCPL_* enum values
optional uint32 antenna_ports_count = 15; // Number of cell specific antenna ports
optional uint32 duplex_mode = 16; // One of the PRDM_* enum values
optional uint32 duplex_mode = 16; // One of the FLDM_* enum values
optional uint32 subframe_assignment = 17; // DL/UL subframe assignment. TDD only
optional uint32 special_subframe_patterns = 18; // TDD only. See TS 36.211, table 4.2.1
repeated uint32 mbsfn_subframe_config_rfperiod = 19; // The MBSFN radio frame period (Optional)
......@@ -36,30 +36,30 @@ message prp_cell_config {
optional uint32 srs_subframe_config = 30; // See TS 36.211, table 5.5.3.3-1 and 2
optional uint32 srs_bw_config = 31; // See TS 36.211, section 5.5.3.2
optional uint32 srs_mac_up_pts = 32; // Boolean value. See TS 36.211, section 5.5.3.2. TDD only
optional uint32 enable_64QAM = 33; // One of the PREQ_* enum values
optional uint32 enable_64QAM = 33; // One of the FLEQ_* enum values
optional uint32 carrier_index = 34; // Carrier component index
}
message prp_ue_config {
message flex_ue_config {
optional uint32 rnti = 1;
optional prp_drx_config drx_config = 2; // The DRX configuration (Optional)
optional flex_drx_config drx_config = 2; // The DRX configuration (Optional)
optional uint32 time_alignment_timer = 3; // Timer in SF. Control the synchronization
// status of the UE, not the actual advance procedure
// See TS 36.321
optional uint32 meas_gap_config_pattern = 4; // Measurement gap configuration.
// One of the PRMGCP_* enum values
// One of the FLMGCP_* enum values
// See TS 36.133
optional uint32 meas_gap_config_sf_offset = 5; // Measurement gap offset if applicable
optional prp_sps_config sps_config = 6; // The SPS configuration (Optional)
optional prp_sr_config sr_config = 7; // The SR configuration (Optional)
optional prp_cqi_config cqi_config = 8; // The CQI configuration (Optional)
optional flex_sps_config sps_config = 6; // The SPS configuration (Optional)
optional flex_sr_config sr_config = 7; // The SR configuration (Optional)
optional flex_cqi_config cqi_config = 8; // The CQI configuration (Optional)
optional uint32 transmission_mode = 9; // The UE transmission mode
optional uint64 ue_aggregated_max_bitrate_UL = 10; // Aggregated bit-rate of non-gbr bearer
// per UE. See TS 36.413
optional uint64 ue_aggregated_max_bitrate_DL = 11; // Aggregated bit-rate of non-gbr bearer
// per UE. See TS 36.413
optional prp_ue_capabilities capabilities = 12;
optional uint32 ue_transmission_antenna = 13; // One of the PRUTA_* enum values
optional flex_ue_capabilities capabilities = 12;
optional uint32 ue_transmission_antenna = 13; // One of the FLUTA_* enum values
optional uint32 tti_bundling = 14; // Boolean value. See TS 36.321
optional uint32 max_HARQ_tx = 15; // The max HARQ retransmission for UL
optional uint32 beta_offset_ACK_index = 16; // See TS 36.213
......@@ -67,20 +67,20 @@ message prp_ue_config {
optional uint32 beta_offset_CQI_index = 18; // See TS 36.213
optional uint32 ack_nack_simultaneous_trans = 19;// Boolean. See TS 36.213
optional uint32 simultaneous_ack_nack_cqi = 20; // Boolean. See TS 36.213
optional uint32 aperiodic_cqi_rep_mode = 21; // One of the PRACRM_* enum values
optional uint32 tdd_ack_nack_feedback = 22; // One of the PRTANFM_* enum values
optional uint32 aperiodic_cqi_rep_mode = 21; // One of the FLACRM_* enum values
optional uint32 tdd_ack_nack_feedback = 22; // One of the FLTANFM_* enum values
optional uint32 ack_nack_repetition_factor = 23;// See TS 36.213, section 10.1
optional uint32 extended_bsr_size = 24; // Boolean for extended BSR size
optional uint32 ca_support = 25; // Boolean. Support for carrier aggregation
optional uint32 cross_carrier_sched_support = 26; // Boolean value
optional uint32 pcell_carrier_index = 27; // Index of primary cell
repeated prp_scell_config scell_config = 28; // Secondary cells configuration
repeated flex_scell_config scell_config = 28; // Secondary cells configuration
optional uint32 scell_deactivation_timer = 29;// Deactivation timer for secondary cell
}
message prp_lc_ue_config {
message flex_lc_ue_config {
optional uint32 rnti = 1;
repeated prp_lc_config lc_config = 2; // A list of LC configurations for the given UE
repeated flex_lc_config lc_config = 2; // A list of LC configurations for the given UE
}
......
//'syntax = "proto2";'
package protocol;
enum prp_control_delegation_type {
PRCDT_MAC_DL_UE_SCHEDULER = 1; // DL UE scheduler delegation
enum flex_control_delegation_type {
FLCDT_MAC_DL_UE_SCHEDULER = 1; // DL UE scheduler delegation
}
\ No newline at end of file
......@@ -6,11 +6,11 @@ import "mac_primitives.proto";
// Body of UE DL MAC scheduling configuration info
//
message prp_dl_data {
message flex_dl_data {
optional uint32 rnti = 1;
optional prp_dl_dci dl_dci = 2;
optional flex_dl_dci dl_dci = 2;
repeated uint32 ce_bitmap = 3; // list of 2 MAC CEs, one for each TB
repeated prp_rlc_pdu rlc_pdu = 4; // list of parameters for the creation of RLC PDUs. One for each lcid
repeated flex_rlc_pdu rlc_pdu = 4; // list of parameters for the creation of RLC PDUs. One for each lcid
optional uint32 serv_cell_index = 5;
optional uint32 act_deact_ce = 6; //Hex content of MAC CE for Activation/Deactivation in CA
}
......@@ -18,10 +18,10 @@ message prp_dl_data {
//
// Body of the RAR scheduler configuration
//
message prp_dl_rar {
message flex_dl_rar {
optional uint32 rnti = 1;
optional uint32 grant = 2; // The 20-bit UL grant. TS 36.213, sec 6.2
optional prp_dl_dci rar_dci = 3;
optional flex_dl_dci rar_dci = 3;
optional uint32 carrier_index = 4; // The carrier index for the RAR
}
......@@ -29,13 +29,13 @@ message prp_dl_rar {
// Body of the paging/broadcast configuration message
//
message prp_dl_broadcast {
optional uint32 type = 1; // The PRBT_* values
message flex_dl_broadcast {
optional uint32 type = 1; // The FLBT_* values
optional uint32 index = 2; // Index of the broadcast message:
// 0 - SIB1,
// 1..31 - Six,
// 32..63 - PCCH (PCCH index obtained from prp_paging_info)
optional prp_dl_dci broad_dci = 3;
// 32..63 - PCCH (PCCH index obtained from flex_paging_info)
optional flex_dl_dci broad_dci = 3;
optional uint32 carrier_index = 4; // Index of the carrier for broadcast
}
......@@ -43,7 +43,7 @@ message prp_dl_broadcast {
// Body of the OFDM symbol count message
//
message prp_pdcch_ofdm_sym_count {
message flex_pdcch_ofdm_sym_count {
optional uint32 carrier_index = 1;
optional uint32 num_pdcch_ofdm_symbols = 2;
}
......@@ -52,7 +52,7 @@ message prp_pdcch_ofdm_sym_count {
// Types of commands related enums
//
enum prp_broadcast_type {
PRBT_BCCH = 0;
PRBT_PCCH = 1;
enum flex_broadcast_type {
FLBT_BCCH = 0;
FLBT_PCCH = 1;
}
\ No newline at end of file
......@@ -8,30 +8,30 @@ import "config_messages.proto";
import "controller_commands.proto";
import "control_delegation.proto";
message progran_message {
optional progran_direction msg_dir = 100;
message flexran_message {
optional flexran_direction msg_dir = 100;
oneof msg {
prp_hello hello_msg = 1;
prp_echo_request echo_request_msg = 2;
prp_echo_reply echo_reply_msg = 3;
prp_stats_request stats_request_msg = 4;
prp_stats_reply stats_reply_msg = 5;
prp_sf_trigger sf_trigger_msg = 6;
prp_ul_sr_info ul_sr_info_msg = 7;
prp_enb_config_request enb_config_request_msg = 8;
prp_enb_config_reply enb_config_reply_msg = 9;
prp_ue_config_request ue_config_request_msg = 10;
prp_ue_config_reply ue_config_reply_msg = 11;
prp_lc_config_request lc_config_request_msg = 12;
prp_lc_config_reply lc_config_reply_msg = 13;
prp_dl_mac_config dl_mac_config_msg = 14;
prp_ue_state_change ue_state_change_msg = 15;
prp_control_delegation control_delegation_msg = 16;
prp_agent_reconfiguration agent_reconfiguration_msg = 17;
flex_hello hello_msg = 1;
flex_echo_request echo_request_msg = 2;
flex_echo_reply echo_reply_msg = 3;
flex_stats_request stats_request_msg = 4;
flex_stats_reply stats_reply_msg = 5;
flex_sf_trigger sf_trigger_msg = 6;
flex_ul_sr_info ul_sr_info_msg = 7;
flex_enb_config_request enb_config_request_msg = 8;
flex_enb_config_reply enb_config_reply_msg = 9;
flex_ue_config_request ue_config_request_msg = 10;
flex_ue_config_reply ue_config_reply_msg = 11;
flex_lc_config_request lc_config_request_msg = 12;
flex_lc_config_reply lc_config_reply_msg = 13;
flex_dl_mac_config dl_mac_config_msg = 14;
flex_ue_state_change ue_state_change_msg = 15;
flex_control_delegation control_delegation_msg = 16;
flex_agent_reconfiguration agent_reconfiguration_msg = 17;
}
}
enum progran_direction {
enum flexran_direction {
//option allow_alias = true;
NOT_SET = 0;
INITIATING_MESSAGE = 1;
......@@ -39,7 +39,7 @@ enum progran_direction {
UNSUCCESSFUL_OUTCOME=3;
}
enum progran_err {
enum flexran_err {
option allow_alias = true;
// message errors
NO_ERR = 0;
......@@ -62,18 +62,18 @@ enum progran_err {
// Maintenance and discovery messages
//
message prp_hello {
optional prp_header header = 1;
message flex_hello {
optional flex_header header = 1;
}
message prp_echo_request {
optional prp_header header = 1;
message flex_echo_request {
optional flex_header header = 1;
extensions 100 to 199;
}
message prp_echo_reply {
optional prp_header header = 1;
message flex_echo_reply {
optional flex_header header = 1;
extensions 100 to 199;
}
......@@ -82,39 +82,39 @@ message prp_echo_reply {
// Statistics request and reply message
//
message prp_stats_request {
optional prp_header header = 1;
optional prp_stats_type type = 2;
message flex_stats_request {
optional flex_header header = 1;
optional flex_stats_type type = 2;
oneof body {
prp_complete_stats_request complete_stats_request = 3;
prp_cell_stats_request cell_stats_request = 4;
prp_ue_stats_request ue_stats_request = 5;
flex_complete_stats_request complete_stats_request = 3;
flex_cell_stats_request cell_stats_request = 4;
flex_ue_stats_request ue_stats_request = 5;
}
}
message prp_stats_reply {
optional prp_header header = 1;
repeated prp_ue_stats_report ue_report = 2;
repeated prp_cell_stats_report cell_report = 3;
message flex_stats_reply {
optional flex_header header = 1;
repeated flex_ue_stats_report ue_report = 2;
repeated flex_cell_stats_report cell_report = 3;
}
//
// Time indication messages
//
message prp_sf_trigger {
optional prp_header header = 1;
message flex_sf_trigger {
optional flex_header header = 1;
optional uint32 sfn_sf = 2;
repeated prp_dl_info dl_info = 3;
repeated prp_ul_info ul_info = 4;
repeated flex_dl_info dl_info = 3;
repeated flex_ul_info ul_info = 4;
}
//
// Asynchronous messages
//
message prp_ul_sr_info {
optional prp_header header = 1;
message flex_ul_sr_info {
optional flex_header header = 1;
optional uint32 sfn_sf = 2;
repeated uint32 rnti = 3;
}
......@@ -122,64 +122,64 @@ message prp_ul_sr_info {
//
// eNB configuration messages
//
message prp_enb_config_request {
optional prp_header header = 1;
message flex_enb_config_request {
optional flex_header header = 1;
}
message prp_enb_config_reply {
optional prp_header header = 1;
message flex_enb_config_reply {
optional flex_header header = 1;
optional uint32 eNB_id = 2; // Unique id to distinguish the eNB
repeated prp_cell_config cell_config = 3;
repeated flex_cell_config cell_config = 3;
}
message prp_ue_config_request {
optional prp_header header = 1;
message flex_ue_config_request {
optional flex_header header = 1;
}
message prp_ue_config_reply {
optional prp_header header = 1;
repeated prp_ue_config ue_config = 2;
message flex_ue_config_reply {
optional flex_header header = 1;
repeated flex_ue_config ue_config = 2;
}
message prp_lc_config_request {
optional prp_header header = 1;
message flex_lc_config_request {
optional flex_header header = 1;
}
message prp_lc_config_reply {
optional prp_header header = 1;
repeated prp_lc_ue_config lc_ue_config = 2;
message flex_lc_config_reply {
optional flex_header header = 1;
repeated flex_lc_ue_config lc_ue_config = 2;
}
//
// Controller command messages
//
message prp_dl_mac_config {
optional prp_header header = 1;
message flex_dl_mac_config {
optional flex_header header = 1;
optional uint32 sfn_sf = 2;
repeated prp_dl_data dl_ue_data = 3;
repeated prp_dl_rar dl_rar = 4;
repeated prp_dl_broadcast dl_broadcast = 5;
repeated prp_pdcch_ofdm_sym_count ofdm_sym = 6; // OFDM symbol count for each CC
repeated flex_dl_data dl_ue_data = 3;
repeated flex_dl_rar dl_rar = 4;
repeated flex_dl_broadcast dl_broadcast = 5;
repeated flex_pdcch_ofdm_sym_count ofdm_sym = 6; // OFDM symbol count for each CC
}
//
// UE state change message
//
message prp_ue_state_change {
optional prp_header header = 1;
optional uint32 type = 2; // One of the PRUESC_* values
optional prp_ue_config config = 3; // Body of the message (based on type)
message flex_ue_state_change {
optional flex_header header = 1;
optional uint32 type = 2; // One of the FLUESC_* values
optional flex_ue_config config = 3; // Body of the message (based on type)
}
//
// Control delegation message
//
message prp_control_delegation {
optional prp_header header = 1;
optional uint32 delegation_type = 2; // Bitmap of PRCDT_* flags
message flex_control_delegation {
optional flex_header header = 1;
optional uint32 delegation_type = 2; // Bitmap of FLCDT_* flags
optional bytes payload = 3; // Byte array of shared lib containing the delegated functions
optional string name = 4; // The delegated functions names ordered based on bitmap flags
}
......@@ -188,21 +188,21 @@ message prp_control_delegation {
// Agent reconfiguration message
//
message prp_agent_reconfiguration {
optional prp_header header = 1;
message flex_agent_reconfiguration {
optional flex_header header = 1;
optional string policy = 2; // The policy changes using YAML syntax in string format
}
// Extensions of the echo request and reply
// messages for carrying a latency value in ms
message prp_echo_request_latency {
extend prp_echo_request {
message flex_echo_request_latency {
extend flex_echo_request {
optional uint32 latency = 100;
}
}
message prp_echo_reply_latency {
extend prp_echo_reply {
message flex_echo_reply_latency {
extend flex_echo_reply {
optional uint32 latency = 100;
}
}
......
package protocol;
message prp_header {
message flex_header {
optional uint32 version = 1;
optional uint32 type = 2;
optional uint32 xid = 4;
}
enum prp_type {
enum flex_type {
// Discovery and maintenance messages
PRPT_HELLO = 0;
PRPT_ECHO_REQUEST = 1;
PRPT_ECHO_REPLY = 2;
FLPT_HELLO = 0;
FLPT_ECHO_REQUEST = 1;
FLPT_ECHO_REPLY = 2;
// Statistics and measurement messages
PRPT_STATS_REQUEST = 3;
PRPT_STATS_REPLY = 4;
FLPT_STATS_REQUEST = 3;
FLPT_STATS_REPLY = 4;
// Time indication messages
PRPT_SF_TRIGGER = 5;
FLPT_SF_TRIGGER = 5;
// Asynchronous messages
PRPT_UL_SR_INFO = 6;
FLPT_UL_SR_INFO = 6;
// eNB configuration messages
PRPT_GET_ENB_CONFIG_REQUEST = 7;
PRPT_GET_ENB_CONFIG_REPLY = 8;
PRPT_GET_UE_CONFIG_REQUEST = 9;
PRPT_GET_UE_CONFIG_REPLY = 10;
PRPT_GET_LC_CONFIG_REQUEST = 11;
PRPT_GET_LC_CONFIG_REPLY = 12;
FLPT_GET_ENB_CONFIG_REQUEST = 7;
FLPT_GET_ENB_CONFIG_REPLY = 8;
FLPT_GET_UE_CONFIG_REQUEST = 9;
FLPT_GET_UE_CONFIG_REPLY = 10;
FLPT_GET_LC_CONFIG_REQUEST = 11;
FLPT_GET_LC_CONFIG_REPLY = 12;
//Controller command messages
PRPT_DL_MAC_CONFIG = 13;
FLPT_DL_MAC_CONFIG = 13;
// UE state change messages
PRPT_UE_STATE_CHANGE = 14;
FLPT_UE_STATE_CHANGE = 14;
// Control delegation messages
PRPT_DELEGATE_CONTROL = 15;
PRPT_RECONFIGURE_AGENT = 16;
FLPT_DELEGATE_CONTROL = 15;
FLPT_RECONFIGURE_AGENT = 16;
}
......@@ -4,7 +4,7 @@ package protocol;
// Message containing the DL DCI info
//
message prp_dl_dci {
message flex_dl_dci {
optional uint32 rnti = 1;
optional uint32 res_alloc = 2; // Type of resource allocation
optional uint32 rb_bitmap = 3; // Bitmap for RB allocation
......@@ -17,17 +17,17 @@ message prp_dl_dci {
optional uint32 aggr_level = 10;
optional uint32 precoding_info = 11; // 2 antenna ports:0..6,
// 4 antenna ports:0..50
optional uint32 format = 12; // DCI format. A PRDCIF_* value
optional uint32 format = 12; // DCI format. A FLDCIF_* value
optional uint32 tpc = 13; // TS 36.213, sec 5.1.1.1
optional uint32 harq_process = 14; // HARQ process ID
optional uint32 dai = 15; // TDD only
optional uint32 vrb_format = 16; // One of the PRVRBF_* values
optional uint32 vrb_format = 16; // One of the FLVRBF_* values
optional uint32 tb_swap = 17; // Boolean. TB to codeword swap flag
optional uint32 sps_release = 18; // Flag value
optional uint32 pdcch_order = 19;
optional uint32 preamble_index = 20; // Only valid if pdcch_order = 1
optional uint32 prach_mask_index = 21; // Only valid if pdcch_order = 1
optional uint32 n_gap = 22; // One of the PRNGV_* values
optional uint32 n_gap = 22; // One of the FLNGV_* values
optional uint32 tbs_idx = 23; // The TBS index for Format 1A
optional uint32 dl_power_offset = 24; // For format 1D
optional uint32 pdcch_power_offset = 25; // DL PDCCH power boosting in dB
......@@ -39,11 +39,11 @@ message prp_dl_dci {
// Messages related to the creation of RLC PDUs
//
message prp_rlc_pdu {
repeated prp_rlc_pdu_tb rlc_pdu_tb = 1; // list of parameters for the creation of RLC PDUs. One for each TB
message flex_rlc_pdu {
repeated flex_rlc_pdu_tb rlc_pdu_tb = 1; // list of parameters for the creation of RLC PDUs. One for each TB
}
message prp_rlc_pdu_tb {
message flex_rlc_pdu_tb {
optional uint32 logical_channel_id = 1;
optional uint32 size = 2; // Maximum RLC PDU to be created in bytes
}
......@@ -52,25 +52,25 @@ message prp_rlc_pdu_tb {
// MAC content types related enums
//
enum prp_dci_format {
PRDCIF_1 = 0;
PRDCIF_1A = 1;
PRDCIF_1B = 2;
PRDCIF_1C = 3;
PRDCIF_1D = 4;
PRDCIF_2 = 5;
PRDCIF_2A = 6;
PRDCIF_2B = 7;
PRDCIF_3 = 8;
PRDCIF_3A = 9;
enum flex_dci_format {
FLDCIF_1 = 0;
FLDCIF_1A = 1;
FLDCIF_1B = 2;
FLDCIF_1C = 3;
FLDCIF_1D = 4;
FLDCIF_2 = 5;
FLDCIF_2A = 6;
FLDCIF_2B = 7;
FLDCIF_3 = 8;
FLDCIF_3A = 9;
}
enum prp_vrb_format {
PRVRBF_LOCALIZED = 0;
PRVRBF_DISTRIBUTED = 1;
enum flex_vrb_format {
FLVRBF_LOCALIZED = 0;
FLVRBF_DISTRIBUTED = 1;
}
enum prp_ngap_val {
PRNGV_1 = 0;
PRNGV_2 = 1;
enum flex_ngap_val {
FLNGV_1 = 0;
FLNGV_2 = 1;
}
\ No newline at end of file
......@@ -5,7 +5,7 @@ package protocol;
//
// RLC buffer status for a specific logical channel of a UE
message prp_rlc_bsr {
message flex_rlc_bsr {
optional uint32 lc_id = 1;
optional uint32 tx_queue_size = 2;
optional uint32 tx_queue_hol_delay = 3;
......@@ -15,39 +15,39 @@ message prp_rlc_bsr {
}
// Flags for MAC Control Elements
enum prp_ce_type {
PRPCET_TA = 1;
PRPCET_DRX = 2;
PRPCET_CR = 4;
PRPCET_CA = 8;
enum flex_ce_type {
FLPCET_TA = 1;
FLPCET_DRX = 2;
FLPCET_CR = 4;
FLPCET_CA = 8;
}
// Types of DL CSI reports
enum prp_csi_type {
PRCSIT_P10 = 0;
PRCSIT_P11 = 1;
PRCSIT_P20 = 2;
PRCSIT_P21 = 3;
PRCSIT_A12 = 4;
PRCSIT_A22 = 5;
PRCSIT_A20 = 6;
PRCSIT_A30 = 7;
PRCSIT_A31 = 8;
enum flex_csi_type {
FLCSIT_P10 = 0;
FLCSIT_P11 = 1;
FLCSIT_P20 = 2;
FLCSIT_P21 = 3;
FLCSIT_A12 = 4;
FLCSIT_A22 = 5;
FLCSIT_A20 = 6;
FLCSIT_A30 = 7;
FLCSIT_A31 = 8;
}
// CSI type P10
message prp_csi_p10 {
message flex_csi_p10 {
optional uint32 wb_cqi = 1;
}
// CSI type P11
message prp_csi_p11 {
message flex_csi_p11 {
repeated uint32 wb_cqi = 1;
optional uint32 wb_pmi = 2;
}
// CSI type P20
message prp_csi_p20 {
message flex_csi_p20 {
optional uint32 wb_cqi = 1;
optional uint32 sb_cqi = 2;
optional uint32 bandwidth_part_index = 3;
......@@ -55,7 +55,7 @@ message prp_csi_p20 {
}
// CSI type P21
message prp_csi_p21 {
message flex_csi_p21 {
repeated uint32 wb_cqi = 1;
optional uint32 wb_pmi = 2;
repeated uint32 sb_cqi = 3;
......@@ -64,13 +64,13 @@ message prp_csi_p21 {
}
// CSI type A12
message prp_csi_a12 {
message flex_csi_a12 {
repeated uint32 wb_cqi = 1;
repeated uint32 sb_pmi = 2;
}
// CSI type A22
message prp_csi_a22 {
message flex_csi_a22 {
repeated uint32 wb_cqi = 1;
repeated uint32 sb_cqi = 2;
optional uint32 wb_pmi = 3;
......@@ -79,56 +79,56 @@ message prp_csi_a22 {
}
// CSI type A20
message prp_csi_a20 {
message flex_csi_a20 {
optional uint32 wb_cqi = 1;
optional uint32 sb_cqi = 2;
repeated uint32 sb_list = 3;
}
// CSI type A30
message prp_csi_a30 {
message flex_csi_a30 {
optional uint32 wb_cqi = 1;
repeated uint32 sb_cqi = 2;
}
// CSI type A31
message prp_csi_a31 {
message flex_csi_a31 {
repeated uint32 wb_cqi = 1;
repeated prp_msb_cqi sb_cqi = 2;
repeated flex_msb_cqi sb_cqi = 2;
optional uint32 wb_pmi = 3;
}
// The CQI for the M-preffered subband
message prp_msb_cqi {
message flex_msb_cqi {
repeated uint32 sb_cqi = 1;
}
// The CSI report of the UE for a specific servCellIndex
message prp_dl_csi {
message flex_dl_csi {
optional uint32 serv_cell_index = 1;
optional uint32 ri = 2;
optional prp_csi_type type = 3;
optional flex_csi_type type = 3;
oneof report {
prp_csi_p10 p10csi = 4;
prp_csi_p11 p11csi = 5;
prp_csi_p20 p20csi = 6;
prp_csi_p21 p21csi = 7;
prp_csi_a12 a12csi = 8;
prp_csi_a22 a22csi = 9;
prp_csi_a20 a20csi = 10;
prp_csi_a30 a30csi = 11;
prp_csi_a31 a31csi = 12;
flex_csi_p10 p10csi = 4;
flex_csi_p11 p11csi = 5;
flex_csi_p20 p20csi = 6;
flex_csi_p21 p21csi = 7;
flex_csi_a12 a12csi = 8;
flex_csi_a22 a22csi = 9;
flex_csi_a20 a20csi = 10;
flex_csi_a30 a30csi = 11;
flex_csi_a31 a31csi = 12;
}
}
// The full DL CQI report for all CC of a UE
message prp_dl_cqi_report {
message flex_dl_cqi_report {
optional uint32 sfn_sn = 1;
repeated prp_dl_csi csi_report = 2;
repeated flex_dl_csi csi_report = 2;
}
// Paging message info
message prp_paging_info {
message flex_paging_info {
optional uint32 paging_index = 1;
optional uint32 paging_message_size = 2;
optional uint32 paging_subframe = 3;
......@@ -136,34 +136,34 @@ message prp_paging_info {
}
// Report for the paging buffer status
message prp_paging_buffer_report {
repeated prp_paging_info paging_info = 1;
message flex_paging_buffer_report {
repeated flex_paging_info paging_info = 1;
}
// The type of UL CQI
enum prp_ul_cqi_type {
PRUCT_SRS = 0;
PRUCT_PUSCH = 1;
PRUCT_PUCCH_1 = 2;
PRUCT_PUCCH_2 = 3;
PRUCT_PRACH = 4;
enum flex_ul_cqi_type {
FLUCT_SRS = 0;
FLUCT_PUSCH = 1;
FLUCT_PUCCH_1 = 2;
FLUCT_PUCCH_2 = 3;
FLUCT_PRACH = 4;
}
// UL CQI report for a specific UE for a given report type
message prp_ul_cqi {
optional prp_ul_cqi_type type = 1;
message flex_ul_cqi {
optional flex_ul_cqi_type type = 1;
repeated uint32 sinr = 2;
optional uint32 serv_cell_index = 3;
}
// Full UL CQI report for a specific UE
message prp_ul_cqi_report {
message flex_ul_cqi_report {
optional uint32 sfn_sn = 1;
repeated prp_ul_cqi cqi_meas = 2;
repeated prp_pucch_dbm pucch_dbm = 3;
repeated flex_ul_cqi cqi_meas = 2;
repeated flex_pucch_dbm pucch_dbm = 3;
}
message prp_pucch_dbm {
message flex_pucch_dbm {
optional int32 p0_pucch_dbm = 1;
optional uint32 serv_cell_index = 2;
}
......@@ -173,7 +173,7 @@ message prp_pucch_dbm {
//
// The UL noise and interference report for a UE
message prp_noise_interference_report {
message flex_noise_interference_report {
optional uint32 sfn_sf = 1;
optional uint32 rip = 2;
optional uint32 tnp = 3;
......
......@@ -7,19 +7,19 @@ import "stats_common.proto";
// Bodies of statistics report requests
//
message prp_complete_stats_request {
optional prp_stats_report_freq report_frequency = 1;
message flex_complete_stats_request {
optional flex_stats_report_freq report_frequency = 1;
optional uint32 sf = 2;
optional uint32 cell_report_flags = 3;
optional uint32 ue_report_flags = 4;
}
message prp_cell_stats_request {
message flex_cell_stats_request {
repeated uint32 cell = 1;
optional uint32 flags = 2;
}
message prp_ue_stats_request {
message flex_ue_stats_request {
repeated uint32 rnti = 1;
optional uint32 flags = 2;
}
......@@ -29,23 +29,23 @@ message prp_ue_stats_request {
//
// The full statistics report for a specific cell
message prp_cell_stats_report {
message flex_cell_stats_report {
optional uint32 carrier_index = 1;
optional uint32 flags = 2;
optional prp_noise_interference_report noise_inter_report = 3;
optional flex_noise_interference_report noise_inter_report = 3;
}
// Statistics report for a specific UE
message prp_ue_stats_report {
message flex_ue_stats_report {
optional uint32 rnti = 1;
optional uint32 flags = 2;
repeated uint32 bsr = 3;
optional uint32 phr = 4;
repeated prp_rlc_bsr rlc_report = 5;
repeated flex_rlc_bsr rlc_report = 5;
optional uint32 pending_mac_ces = 6;
optional prp_dl_cqi_report dl_cqi_report = 7;
optional prp_paging_buffer_report pbr = 8;
optional prp_ul_cqi_report ul_cqi_report = 9;
optional flex_dl_cqi_report dl_cqi_report = 7;
optional flex_paging_buffer_report pbr = 8;
optional flex_ul_cqi_report ul_cqi_report = 9;
}
//
......@@ -54,33 +54,33 @@ message prp_ue_stats_report {
//Types of statistics requested by the controller
enum prp_stats_type {
PRST_COMPLETE_STATS = 0;
PRST_CELL_STATS = 1;
PRST_UE_STATS = 2;
enum flex_stats_type {
FLST_COMPLETE_STATS = 0;
FLST_CELL_STATS = 1;
FLST_UE_STATS = 2;
}
// Report frequency for the requested statistics
enum prp_stats_report_freq {
PRSRF_ONCE = 0;
PRSRF_PERIODICAL = 1;
PRSRF_CONTINUOUS = 2;
PRSRF_OFF = 3;
enum flex_stats_report_freq {
FLSRF_ONCE = 0;
FLSRF_PERIODICAL = 1;
FLSRF_CONTINUOUS = 2;
FLSRF_OFF = 3;
}
// Flags for cell statistics
enum prp_cell_stats_type {
PRCST_NOISE_INTERFERENCE = 1;
enum flex_cell_stats_type {
FLCST_NOISE_INTERFERENCE = 1;
}
// Flags for UE-related statistics
enum prp_ue_stats_type {
PRUST_BSR = 1;
PRUST_PRH = 2;
PRUST_RLC_BS = 4;
PRUST_MAC_CE_BS = 8;
PRUST_DL_CQI = 16;
PRUST_PBS = 32;
PRUST_UL_CQI = 64;
enum flex_ue_stats_type {
FLUST_BSR = 1;
FLUST_PRH = 2;
FLUST_RLC_BS = 4;
FLUST_MAC_CE_BS = 8;
FLUST_DL_CQI = 16;
FLUST_PBS = 32;
FLUST_UL_CQI = 64;
// To be extended with more types of stats
}
\ No newline at end of file
package protocol;
enum prp_harq_status {
PRHS_ACK = 0;
PRHS_NACK = 1;
PRHS_DTX = 2;
enum flex_harq_status {
FLHS_ACK = 0;
FLHS_NACK = 1;
FLHS_DTX = 2;
}
enum prp_reception_status {
PRRS_OK = 0;
PRRS_NOT_OK = 1;
PRRS_NOT_VALID = 2;
enum flex_reception_status {
FLRS_OK = 0;
FLRS_NOT_OK = 1;
FLRS_NOT_VALID = 2;
}
message prp_dl_info {
message flex_dl_info {
optional uint32 rnti = 1;
optional uint32 harq_process_id = 2;
repeated uint32 harq_status = 3;
optional uint32 serv_cell_index = 4;
}
message prp_ul_info {
message flex_ul_info {
optional uint32 rnti = 1;
repeated uint32 ul_reception = 2;
optional uint32 reception_status = 3;
......
......@@ -29,7 +29,7 @@
/*! \file enb_agent.h
* \brief top level enb agent receive thread and itti task
* \author Navid Nikaein and Xenofon Foukas
* \author Xenofon Foukas and Navid Nikaein
* \date 2016
* \version 0.1
*/
......@@ -57,7 +57,7 @@ char local_cache[40];
void *send_thread(void *args);
void *receive_thread(void *args);
pthread_t new_thread(void *(*f)(void *), void *b);
Protocol__ProgranMessage *enb_agent_timeout(void* args);
Protocol__FlexranMessage *enb_agent_timeout(void* args);
int agent_task_created = 0;
......@@ -68,7 +68,7 @@ int agent_task_created = 0;
void *enb_agent_task(void *args){
//enb_agent_instance_t *d = (enb_agent_instance_t *) args;
Protocol__ProgranMessage *msg;
Protocol__FlexranMessage *msg;
void *data;
int size;
err_code_t err_code;
......@@ -104,7 +104,7 @@ void *enb_agent_task(void *args){
data=enb_agent_pack_message(msg,&size);
elem = get_timer_entry(msg_p->ittiMsg.timer_has_expired.timer_id);
if (enb_agent_msg_send(elem->agent_id, ENB_AGENT_DEFAULT, data, size, priority)) {
err_code = PROTOCOL__PROGRAN_ERR__MSG_ENQUEUING;
err_code = PROTOCOL__FLEXRAN_ERR__MSG_ENQUEUING;
goto error;
}
......@@ -135,11 +135,11 @@ void *receive_thread(void *args) {
int priority;
err_code_t err_code;
Protocol__ProgranMessage *msg;
Protocol__FlexranMessage *msg;
while (1) {
//if (enb_agent_msg_recv(d->enb_id, ENB_AGENT_DEFAULT, &data, &size, &priority)) {
// err_code = PROTOCOL__PROGRAN_ERR__MSG_DEQUEUING;
// err_code = PROTOCOL__FLEXRAN_ERR__MSG_DEQUEUING;
// goto error;
//}
......@@ -157,7 +157,7 @@ void *receive_thread(void *args) {
data=enb_agent_pack_message(msg,&size);
if (enb_agent_msg_send(d->enb_id, ENB_AGENT_DEFAULT, data, size, priority)) {
err_code = PROTOCOL__PROGRAN_ERR__MSG_ENQUEUING;
err_code = PROTOCOL__FLEXRAN_ERR__MSG_ENQUEUING;
goto error;
}
......@@ -337,7 +337,7 @@ error:
Protocol__ProgranMessage *enb_agent_timeout(void* args){
Protocol__FlexranMessage *enb_agent_timeout(void* args){
// enb_agent_timer_args_t *timer_args = calloc(1, sizeof(*timer_args));
//memcpy (timer_args, args, sizeof(*timer_args));
......
......@@ -29,7 +29,7 @@
/*! \file enb_agent_common.c
* \brief common primitives for all agents
* \author Navid Nikaein and Xenofon Foukas
* \author Xenofon Foukas, Mohamed Kassem and Navid Nikaein
* \date 2016
* \version 0.1
*/
......@@ -55,15 +55,15 @@ void * enb_rrc[NUM_MAX_ENB];
* message primitives
*/
int enb_agent_serialize_message(Protocol__ProgranMessage *msg, void **buf, int *size) {
int enb_agent_serialize_message(Protocol__FlexranMessage *msg, void **buf, int *size) {
*size = protocol__progran_message__get_packed_size(msg);
*size = protocol__flexran_message__get_packed_size(msg);
*buf = malloc(*size);
if (buf == NULL)
goto error;
protocol__progran_message__pack(msg, *buf);
protocol__flexran_message__pack(msg, *buf);
return 0;
......@@ -76,8 +76,8 @@ int enb_agent_serialize_message(Protocol__ProgranMessage *msg, void **buf, int *
/* We assume that the buffer size is equal to the message size.
Should be chekced durint Tx/Rx */
int enb_agent_deserialize_message(void *data, int size, Protocol__ProgranMessage **msg) {
*msg = protocol__progran_message__unpack(NULL, size, data);
int enb_agent_deserialize_message(void *data, int size, Protocol__FlexranMessage **msg) {
*msg = protocol__flexran_message__unpack(NULL, size, data);
if (*msg == NULL)
goto error;
......@@ -90,14 +90,14 @@ int enb_agent_deserialize_message(void *data, int size, Protocol__ProgranMessage
int prp_create_header(xid_t xid, Protocol__PrpType type, Protocol__PrpHeader **header) {
int flex_create_header(xid_t xid, Protocol__FlexType type, Protocol__FlexHeader **header) {
*header = malloc(sizeof(Protocol__PrpHeader));
*header = malloc(sizeof(Protocol__FlexHeader));
if(*header == NULL)
goto error;
protocol__prp_header__init(*header);
(*header)->version = PROGRAN_VERSION;
protocol__flex_header__init(*header);
(*header)->version = FLEXRAN_VERSION;
(*header)->has_version = 1;
// check if the type is set
(*header)->type = type;
......@@ -112,28 +112,28 @@ int prp_create_header(xid_t xid, Protocol__PrpType type, Protocol__PrpHeader **
}
int enb_agent_hello(mid_t mod_id, const void *params, Protocol__ProgranMessage **msg) {
int enb_agent_hello(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg) {
Protocol__PrpHeader *header;
Protocol__FlexHeader *header;
/*TODO: Need to set random xid or xid from received hello message*/
xid_t xid = 1;
if (prp_create_header(xid, PROTOCOL__PRP_TYPE__PRPT_HELLO, &header) != 0)
if (flex_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_HELLO, &header) != 0)
goto error;
Protocol__PrpHello *hello_msg;
hello_msg = malloc(sizeof(Protocol__PrpHello));
Protocol__FlexHello *hello_msg;
hello_msg = malloc(sizeof(Protocol__FlexHello));
if(hello_msg == NULL)
goto error;
protocol__prp_hello__init(hello_msg);
protocol__flex_hello__init(hello_msg);
hello_msg->header = header;
*msg = malloc(sizeof(Protocol__ProgranMessage));
*msg = malloc(sizeof(Protocol__FlexranMessage));
if(*msg == NULL)
goto error;
protocol__progran_message__init(*msg);
(*msg)->msg_case = PROTOCOL__PROGRAN_MESSAGE__MSG_HELLO_MSG;
(*msg)->msg_dir = PROTOCOL__PROGRAN_DIRECTION__SUCCESSFUL_OUTCOME;
protocol__flexran_message__init(*msg);
(*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_HELLO_MSG;
(*msg)->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__SUCCESSFUL_OUTCOME;
(*msg)->has_msg_dir = 1;
(*msg)->hello_msg = hello_msg;
return 0;
......@@ -150,9 +150,9 @@ int enb_agent_hello(mid_t mod_id, const void *params, Protocol__ProgranMessage *
}
int enb_agent_destroy_hello(Protocol__ProgranMessage *msg) {
int enb_agent_destroy_hello(Protocol__FlexranMessage *msg) {
if(msg->msg_case != PROTOCOL__PROGRAN_MESSAGE__MSG_HELLO_MSG)
if(msg->msg_case != PROTOCOL__FLEXRAN_MESSAGE__MSG_HELLO_MSG)
goto error;
free(msg->hello_msg->header);
......@@ -166,26 +166,26 @@ int enb_agent_destroy_hello(Protocol__ProgranMessage *msg) {
}
int enb_agent_echo_request(mid_t mod_id, const void* params, Protocol__ProgranMessage **msg) {
Protocol__PrpHeader *header;
int enb_agent_echo_request(mid_t mod_id, const void* params, Protocol__FlexranMessage **msg) {
Protocol__FlexHeader *header;
/*TODO: Need to set a random xid*/
xid_t xid = 1;
if (prp_create_header(xid, PROTOCOL__PRP_TYPE__PRPT_ECHO_REQUEST, &header) != 0)
if (flex_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_ECHO_REQUEST, &header) != 0)
goto error;
Protocol__PrpEchoRequest *echo_request_msg;
echo_request_msg = malloc(sizeof(Protocol__PrpEchoRequest));
Protocol__FlexEchoRequest *echo_request_msg;
echo_request_msg = malloc(sizeof(Protocol__FlexEchoRequest));
if(echo_request_msg == NULL)
goto error;
protocol__prp_echo_request__init(echo_request_msg);
protocol__flex_echo_request__init(echo_request_msg);
echo_request_msg->header = header;
*msg = malloc(sizeof(Protocol__ProgranMessage));
*msg = malloc(sizeof(Protocol__FlexranMessage));
if(*msg == NULL)
goto error;
protocol__progran_message__init(*msg);
(*msg)->msg_case = PROTOCOL__PROGRAN_MESSAGE__MSG_ECHO_REQUEST_MSG;
(*msg)->msg_dir = PROTOCOL__PROGRAN_DIRECTION__INITIATING_MESSAGE;
protocol__flexran_message__init(*msg);
(*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_ECHO_REQUEST_MSG;
(*msg)->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__INITIATING_MESSAGE;
(*msg)->echo_request_msg = echo_request_msg;
return 0;
......@@ -201,8 +201,8 @@ int enb_agent_echo_request(mid_t mod_id, const void* params, Protocol__ProgranMe
}
int enb_agent_destroy_echo_request(Protocol__ProgranMessage *msg) {
if(msg->msg_case != PROTOCOL__PROGRAN_MESSAGE__MSG_ECHO_REQUEST_MSG)
int enb_agent_destroy_echo_request(Protocol__FlexranMessage *msg) {
if(msg->msg_case != PROTOCOL__FLEXRAN_MESSAGE__MSG_ECHO_REQUEST_MSG)
goto error;
free(msg->echo_request_msg->header);
......@@ -217,30 +217,30 @@ int enb_agent_destroy_echo_request(Protocol__ProgranMessage *msg) {
int enb_agent_echo_reply(mid_t mod_id, const void *params, Protocol__ProgranMessage **msg) {
int enb_agent_echo_reply(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg) {
xid_t xid;
Protocol__ProgranMessage *input = (Protocol__ProgranMessage *)params;
Protocol__PrpEchoRequest *echo_req = input->echo_request_msg;
Protocol__FlexranMessage *input = (Protocol__FlexranMessage *)params;
Protocol__FlexEchoRequest *echo_req = input->echo_request_msg;
xid = (echo_req->header)->xid;
Protocol__PrpHeader *header;
if (prp_create_header(xid, PROTOCOL__PRP_TYPE__PRPT_ECHO_REPLY, &header) != 0)
Protocol__FlexHeader *header;
if (flex_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_ECHO_REPLY, &header) != 0)
goto error;
Protocol__PrpEchoReply *echo_reply_msg;
echo_reply_msg = malloc(sizeof(Protocol__PrpEchoReply));
Protocol__FlexEchoReply *echo_reply_msg;
echo_reply_msg = malloc(sizeof(Protocol__FlexEchoReply));
if(echo_reply_msg == NULL)
goto error;
protocol__prp_echo_reply__init(echo_reply_msg);
protocol__flex_echo_reply__init(echo_reply_msg);
echo_reply_msg->header = header;
*msg = malloc(sizeof(Protocol__ProgranMessage));
*msg = malloc(sizeof(Protocol__FlexranMessage));
if(*msg == NULL)
goto error;
protocol__progran_message__init(*msg);
(*msg)->msg_case = PROTOCOL__PROGRAN_MESSAGE__MSG_ECHO_REPLY_MSG;
(*msg)->msg_dir = PROTOCOL__PROGRAN_DIRECTION__SUCCESSFUL_OUTCOME;
protocol__flexran_message__init(*msg);
(*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_ECHO_REPLY_MSG;
(*msg)->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__SUCCESSFUL_OUTCOME;
(*msg)->has_msg_dir = 1;
(*msg)->echo_reply_msg = echo_reply_msg;
return 0;
......@@ -257,8 +257,8 @@ int enb_agent_echo_reply(mid_t mod_id, const void *params, Protocol__ProgranMess
}
int enb_agent_destroy_echo_reply(Protocol__ProgranMessage *msg) {
if(msg->msg_case != PROTOCOL__PROGRAN_MESSAGE__MSG_ECHO_REPLY_MSG)
int enb_agent_destroy_echo_reply(Protocol__FlexranMessage *msg) {
if(msg->msg_case != PROTOCOL__FLEXRAN_MESSAGE__MSG_ECHO_REPLY_MSG)
goto error;
free(msg->echo_reply_msg->header);
......@@ -272,12 +272,12 @@ int enb_agent_destroy_echo_reply(Protocol__ProgranMessage *msg) {
}
int enb_agent_destroy_enb_config_reply(Protocol__ProgranMessage *msg) {
if(msg->msg_case != PROTOCOL__PROGRAN_MESSAGE__MSG_ENB_CONFIG_REPLY_MSG)
int enb_agent_destroy_enb_config_reply(Protocol__FlexranMessage *msg) {
if(msg->msg_case != PROTOCOL__FLEXRAN_MESSAGE__MSG_ENB_CONFIG_REPLY_MSG)
goto error;
free(msg->enb_config_reply_msg->header);
int i, j;
Protocol__PrpEnbConfigReply *reply = msg->enb_config_reply_msg;
Protocol__FlexEnbConfigReply *reply = msg->enb_config_reply_msg;
for(i = 0; i < reply->n_cell_config;i++){
free(reply->cell_config[i]->mbsfn_subframe_config_rfoffset);
......@@ -302,12 +302,12 @@ int enb_agent_destroy_enb_config_reply(Protocol__ProgranMessage *msg) {
return -1;
}
int enb_agent_destroy_ue_config_reply(Protocol__ProgranMessage *msg) {
if(msg->msg_case != PROTOCOL__PROGRAN_MESSAGE__MSG_UE_CONFIG_REPLY_MSG)
int enb_agent_destroy_ue_config_reply(Protocol__FlexranMessage *msg) {
if(msg->msg_case != PROTOCOL__FLEXRAN_MESSAGE__MSG_UE_CONFIG_REPLY_MSG)
goto error;
free(msg->ue_config_reply_msg->header);
int i, j;
Protocol__PrpUeConfigReply *reply = msg->ue_config_reply_msg;
Protocol__FlexUeConfigReply *reply = msg->ue_config_reply_msg;
for(i = 0; i < reply->n_ue_config;i++){
free(reply->ue_config[i]->capabilities);
......@@ -323,8 +323,8 @@ int enb_agent_destroy_ue_config_reply(Protocol__ProgranMessage *msg) {
return -1;
}
int enb_agent_destroy_lc_config_reply(Protocol__ProgranMessage *msg) {
if(msg->msg_case != PROTOCOL__PROGRAN_MESSAGE__MSG_LC_CONFIG_REPLY_MSG)
int enb_agent_destroy_lc_config_reply(Protocol__FlexranMessage *msg) {
if(msg->msg_case != PROTOCOL__FLEXRAN_MESSAGE__MSG_LC_CONFIG_REPLY_MSG)
goto error;
int i, j;
......@@ -345,8 +345,8 @@ int enb_agent_destroy_lc_config_reply(Protocol__ProgranMessage *msg) {
return -1;
}
int enb_agent_destroy_ue_state_change(Protocol__ProgranMessage *msg) {
if(msg->msg_case != PROTOCOL__PROGRAN_MESSAGE__MSG_UE_STATE_CHANGE_MSG)
int enb_agent_destroy_ue_state_change(Protocol__FlexranMessage *msg) {
if(msg->msg_case != PROTOCOL__FLEXRAN_MESSAGE__MSG_UE_STATE_CHANGE_MSG)
goto error;
free(msg->ue_state_change_msg->header);
//TODO: Free the contents of the UE config structure
......@@ -359,8 +359,8 @@ int enb_agent_destroy_ue_state_change(Protocol__ProgranMessage *msg) {
return -1;
}
int enb_agent_destroy_enb_config_request(Protocol__ProgranMessage *msg) {
if(msg->msg_case != PROTOCOL__PROGRAN_MESSAGE__MSG_ENB_CONFIG_REQUEST_MSG)
int enb_agent_destroy_enb_config_request(Protocol__FlexranMessage *msg) {
if(msg->msg_case != PROTOCOL__FLEXRAN_MESSAGE__MSG_ENB_CONFIG_REQUEST_MSG)
goto error;
free(msg->enb_config_request_msg->header);
free(msg->enb_config_request_msg);
......@@ -372,12 +372,12 @@ int enb_agent_destroy_enb_config_request(Protocol__ProgranMessage *msg) {
return -1;
}
int enb_agent_destroy_ue_config_request(Protocol__ProgranMessage *msg) {
int enb_agent_destroy_ue_config_request(Protocol__FlexranMessage *msg) {
/* TODO: Deallocate memory for a dynamically allocated UE config message */
return 0;
}
int enb_agent_destroy_lc_config_request(Protocol__ProgranMessage *msg) {
int enb_agent_destroy_lc_config_request(Protocol__FlexranMessage *msg) {
/* TODO: Deallocate memory for a dynamically allocated LC config message */
return 0;
}
......@@ -397,10 +397,10 @@ long timer_end(struct timespec start_time){
return diffInNanos;
}
int enb_agent_control_delegation(mid_t mod_id, const void *params, Protocol__ProgranMessage **msg) {
int enb_agent_control_delegation(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg) {
Protocol__ProgranMessage *input = (Protocol__ProgranMessage *)params;
Protocol__PrpControlDelegation *control_delegation_msg = input->control_delegation_msg;
Protocol__FlexranMessage *input = (Protocol__FlexranMessage *)params;
Protocol__FlexControlDelegation *control_delegation_msg = input->control_delegation_msg;
uint32_t delegation_type = control_delegation_msg->delegation_type;
......@@ -428,13 +428,13 @@ int enb_agent_control_delegation(mid_t mod_id, const void *params, Protocol__Pro
return -1;
}
int enb_agent_destroy_control_delegation(Protocol__ProgranMessage *msg) {
int enb_agent_destroy_control_delegation(Protocol__FlexranMessage *msg) {
/*TODO: Dealocate memory for a dynamically allocated control delegation message*/
}
int enb_agent_reconfiguration(mid_t mod_id, const void *params, Protocol__ProgranMessage **msg) {
Protocol__ProgranMessage *input = (Protocol__ProgranMessage *)params;
Protocol__PrpAgentReconfiguration *agent_reconfiguration_msg = input->agent_reconfiguration_msg;
int enb_agent_reconfiguration(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg) {
Protocol__FlexranMessage *input = (Protocol__FlexranMessage *)params;
Protocol__FlexAgentReconfiguration *agent_reconfiguration_msg = input->agent_reconfiguration_msg;
apply_reconfiguration_policy(mod_id, agent_reconfiguration_msg->policy, strlen(agent_reconfiguration_msg->policy));
......@@ -442,7 +442,7 @@ int enb_agent_reconfiguration(mid_t mod_id, const void *params, Protocol__Progra
return 0;
}
int enb_agent_destroy_agent_reconfiguration(Protocol__ProgranMessage *msg) {
int enb_agent_destroy_agent_reconfiguration(Protocol__FlexranMessage *msg) {
/*TODO: Dealocate memory for a dynamically allocated agent reconfiguration message*/
}
......@@ -949,11 +949,11 @@ int get_meas_gap_config(mid_t mod_id, mid_t ue_id) {
if(ue_context_p->ue_context.measGapConfig != NULL){
if(ue_context_p->ue_context.measGapConfig->present == MeasGapConfig_PR_setup) {
if (ue_context_p->ue_context.measGapConfig->choice.setup.gapOffset.present == MeasGapConfig__setup__gapOffset_PR_gp0) {
return PROTOCOL__PRP_MEAS_GAP_CONFIG_PATTERN__PRMGCP_GP1;
return PROTOCOL__FLEX_MEAS_GAP_CONFIG_PATTERN__FLMGCP_GP1;
} else if (ue_context_p->ue_context.measGapConfig->choice.setup.gapOffset.present == MeasGapConfig__setup__gapOffset_PR_gp1) {
return PROTOCOL__PRP_MEAS_GAP_CONFIG_PATTERN__PRMGCP_GP2;
return PROTOCOL__FLEX_MEAS_GAP_CONFIG_PATTERN__FLMGCP_GP2;
} else {
return PROTOCOL__PRP_MEAS_GAP_CONFIG_PATTERN__PRMGCP_OFF;
return PROTOCOL__FLEX_MEAS_GAP_CONFIG_PATTERN__FLMGCP_OFF;
}
}
}
......@@ -1258,38 +1258,38 @@ int get_direction(mid_t ue_id, mid_t lc_id)
int enb_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_change) {
int size;
Protocol__ProgranMessage *msg;
Protocol__PrpHeader *header;
Protocol__FlexranMessage *msg;
Protocol__FlexHeader *header;
void *data;
int priority;
err_code_t err_code;
int xid = 0;
if (prp_create_header(xid, PROTOCOL__PRP_TYPE__PRPT_UE_STATE_CHANGE, &header) != 0)
if (flex_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_UE_STATE_CHANGE, &header) != 0)
goto error;
Protocol__PrpUeStateChange *ue_state_change_msg;
ue_state_change_msg = malloc(sizeof(Protocol__PrpUeStateChange));
Protocol__FlexUeStateChange *ue_state_change_msg;
ue_state_change_msg = malloc(sizeof(Protocol__FlexUeStateChange));
if(ue_state_change_msg == NULL) {
goto error;
}
protocol__prp_ue_state_change__init(ue_state_change_msg);
protocol__flex_ue_state_change__init(ue_state_change_msg);
ue_state_change_msg->has_type = 1;
ue_state_change_msg->type = state_change;
Protocol__PrpUeConfig *config;
config = malloc(sizeof(Protocol__PrpUeConfig));
Protocol__FlexUeConfig *config;
config = malloc(sizeof(Protocol__FlexUeConfig));
if (config == NULL) {
goto error;
}
protocol__prp_ue_config__init(config);
if (state_change == PROTOCOL__PRP_UE_STATE_CHANGE_TYPE__PRUESC_DEACTIVATED) {
protocol__flex_ue_config__init(config);
if (state_change == PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_DEACTIVATED) {
// Simply set the rnti of the UE
config->has_rnti = 1;
config->rnti = rnti;
} else if (state_change == PROTOCOL__PRP_UE_STATE_CHANGE_TYPE__PRUESC_UPDATED
|| state_change == PROTOCOL__PRP_UE_STATE_CHANGE_TYPE__PRUESC_ACTIVATED) {
} else if (state_change == PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_UPDATED
|| state_change == PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_ACTIVATED) {
int i =find_UE_id(mod_id,rnti);
config->has_rnti = 1;
config->rnti = rnti;
......@@ -1305,7 +1305,7 @@ int enb_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_change)
}
//TODO: Set the measurement gap offset if applicable
if(config->has_meas_gap_config_pattern == 1 &&
config->meas_gap_config_pattern != PROTOCOL__PRP_MEAS_GAP_CONFIG_PATTERN__PRMGCP_OFF) {
config->meas_gap_config_pattern != PROTOCOL__FLEX_MEAS_GAP_CONFIG_PATTERN__FLMGCP_OFF) {
config->meas_gap_config_sf_offset = get_meas_gap_config_offset(mod_id,i);
config->has_meas_gap_config_sf_offset = 1;
}
......@@ -1333,9 +1333,9 @@ int enb_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_change)
config->has_ue_aggregated_max_bitrate_dl = 1;
//TODO: Set the UE capabilities
Protocol__PrpUeCapabilities *c_capabilities;
c_capabilities = malloc(sizeof(Protocol__PrpUeCapabilities));
protocol__prp_ue_capabilities__init(c_capabilities);
Protocol__FlexUeCapabilities *c_capabilities;
c_capabilities = malloc(sizeof(Protocol__FlexUeCapabilities));
protocol__flex_ue_capabilities__init(c_capabilities);
//TODO: Set half duplex (FDD operation)
c_capabilities->has_half_duplex = 1;
c_capabilities->half_duplex = 1;//get_half_duplex(i);
......@@ -1353,7 +1353,7 @@ int enb_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_change)
c_capabilities->res_alloc_type1 = 1;//get_res_alloc_type1(i);
//Set the capabilites to the message
config->capabilities = c_capabilities;
//TODO: Set UE transmission antenna. One of the PRUTA_* values
//TODO: Set UE transmission antenna. One of the FLUTA_* values
if(get_ue_transmission_antenna(mod_id,i) != -1){
config->has_ue_transmission_antenna = 1;
config->ue_transmission_antenna = get_ue_transmission_antenna(mod_id,i);
......@@ -1398,7 +1398,7 @@ int enb_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_change)
config->has_aperiodic_cqi_rep_mode = 1;
int mode = get_aperiodic_cqi_rep_mode(mod_id,i);
if (mode > 4) {
config->aperiodic_cqi_rep_mode = PROTOCOL__PRP_APERIODIC_CQI_REPORT_MODE__PRACRM_NONE;
config->aperiodic_cqi_rep_mode = PROTOCOL__FLEX_APERIODIC_CQI_REPORT_MODE__FLACRM_NONE;
} else {
config->aperiodic_cqi_rep_mode = mode;
}
......@@ -1435,24 +1435,24 @@ int enb_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_change)
config->has_scell_deactivation_timer = 1;
config->scell_deactivation_timer = 1;
}
} else if (state_change == PROTOCOL__PRP_UE_STATE_CHANGE_TYPE__PRUESC_MOVED) {
} else if (state_change == PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_MOVED) {
// TODO: Not supported for now. Leave blank
}
ue_state_change_msg->config = config;
msg = malloc(sizeof(Protocol__ProgranMessage));
msg = malloc(sizeof(Protocol__FlexranMessage));
if (msg == NULL) {
goto error;
}
protocol__progran_message__init(msg);
msg->msg_case = PROTOCOL__PROGRAN_MESSAGE__MSG_UE_STATE_CHANGE_MSG;
msg->msg_dir = PROTOCOL__PROGRAN_DIRECTION__INITIATING_MESSAGE;
protocol__flexran_message__init(msg);
msg->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_UE_STATE_CHANGE_MSG;
msg->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__INITIATING_MESSAGE;
msg->ue_state_change_msg = ue_state_change_msg;
data = enb_agent_pack_message(msg, &size);
/*Send sr info using the MAC channel of the eNB*/
if (enb_agent_msg_send(mod_id, ENB_AGENT_DEFAULT, data, size, priority)) {
err_code = PROTOCOL__PROGRAN_ERR__MSG_ENQUEUING;
err_code = PROTOCOL__FLEXRAN_ERR__MSG_ENQUEUING;
goto error;
}
......@@ -1466,38 +1466,38 @@ int enb_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_change)
* timer primitives
*/
int enb_agent_lc_config_reply(mid_t mod_id, const void *params, Protocol__ProgranMessage **msg) {
int enb_agent_lc_config_reply(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg) {
xid_t xid;
Protocol__ProgranMessage *input = (Protocol__ProgranMessage *)params;
Protocol__PrpLcConfigRequest *lc_config_request_msg = input->lc_config_request_msg;
Protocol__FlexranMessage *input = (Protocol__FlexranMessage *)params;
Protocol__FlexLcConfigRequest *lc_config_request_msg = input->lc_config_request_msg;
xid = (lc_config_request_msg->header)->xid;
int i, j;
Protocol__PrpHeader *header;
if(prp_create_header(xid, PROTOCOL__PRP_TYPE__PRPT_GET_LC_CONFIG_REPLY, &header) != 0)
Protocol__FlexHeader *header;
if(flex_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_GET_LC_CONFIG_REPLY, &header) != 0)
goto error;
Protocol__PrpLcConfigReply *lc_config_reply_msg;
lc_config_reply_msg = malloc(sizeof(Protocol__PrpLcConfigReply));
Protocol__FlexLcConfigReply *lc_config_reply_msg;
lc_config_reply_msg = malloc(sizeof(Protocol__FlexLcConfigReply));
if(lc_config_reply_msg == NULL)
goto error;
protocol__prp_lc_config_reply__init(lc_config_reply_msg);
protocol__flex_lc_config_reply__init(lc_config_reply_msg);
lc_config_reply_msg->header = header;
//TODO: Fill in the actual number of UEs that we are going to report LC configs about
lc_config_reply_msg->n_lc_ue_config = get_num_ues(mod_id);
Protocol__PrpLcUeConfig **lc_ue_config;
Protocol__FlexLcUeConfig **lc_ue_config;
if (lc_config_reply_msg->n_lc_ue_config > 0) {
lc_ue_config = malloc(sizeof(Protocol__PrpLcUeConfig *) * lc_config_reply_msg->n_lc_ue_config);
lc_ue_config = malloc(sizeof(Protocol__FlexLcUeConfig *) * lc_config_reply_msg->n_lc_ue_config);
if (lc_ue_config == NULL) {
goto error;
}
// Fill the config for each UE
for (i = 0; i < lc_config_reply_msg->n_lc_ue_config; i++) {
lc_ue_config[i] = malloc(sizeof(Protocol__PrpLcUeConfig));
protocol__prp_lc_ue_config__init(lc_ue_config[i]);
lc_ue_config[i] = malloc(sizeof(Protocol__FlexLcUeConfig));
protocol__flex_lc_ue_config__init(lc_ue_config[i]);
//TODO: Set the RNTI of the UE
lc_ue_config[i]->has_rnti = 1;
lc_ue_config[i]->rnti = get_ue_crnti(mod_id,i);
......@@ -1512,15 +1512,15 @@ int enb_agent_lc_config_reply(mid_t mod_id, const void *params, Protocol__Progra
} else {
lc_ue_config[i]->n_lc_config = 3;
}
Protocol__PrpLcConfig **lc_config;
Protocol__FlexLcConfig **lc_config;
if (lc_ue_config[i]->n_lc_config > 0) {
lc_config = malloc(sizeof(Protocol__PrpLcConfig *) * lc_ue_config[i]->n_lc_config);
lc_config = malloc(sizeof(Protocol__FlexLcConfig *) * lc_ue_config[i]->n_lc_config);
if (lc_config == NULL) {
goto error;
}
for (j = 0; j < lc_ue_config[i]->n_lc_config; j++) {
lc_config[j] = malloc(sizeof(Protocol__PrpLcConfig));
protocol__prp_lc_config__init(lc_config[j]);
lc_config[j] = malloc(sizeof(Protocol__FlexLcConfig));
protocol__flex_lc_config__init(lc_config[j]);
//TODO: Set the LC id
lc_config[j]->has_lcid = 1;
lc_config[j]->lcid = j+1;
......@@ -1533,14 +1533,14 @@ int enb_agent_lc_config_reply(mid_t mod_id, const void *params, Protocol__Progra
//TODO: Set the LC direction
lc_config[j]->has_direction = 1;
lc_config[j]->direction = get_direction(i,j+1);
//TODO: Bearer type. One of PRQBT_* values
//TODO: Bearer type. One of FLQBT_* values
lc_config[j]->has_qos_bearer_type = 1;
lc_config[j]->qos_bearer_type = PROTOCOL__PRP_QOS_BEARER_TYPE__PRQBT_NON_GBR;
lc_config[j]->qos_bearer_type = PROTOCOL__FLEX_QOS_BEARER_TYPE__FLQBT_NON_GBR;
//TODO: Set the QCI defined in TS 23.203, coded as defined in TS 36.413
// One less than the actual QCI value
lc_config[j]->has_qci = 1;
lc_config[j]->qci = 1;
if (lc_config[j]->direction == PROTOCOL__PRP_QOS_BEARER_TYPE__PRQBT_GBR) {
if (lc_config[j]->direction == PROTOCOL__FLEX_QOS_BEARER_TYPE__FLQBT_GBR) {
//TODO: Set the max bitrate (UL)
lc_config[j]->has_e_rab_max_bitrate_ul = 1;
lc_config[j]->e_rab_max_bitrate_ul = 1;
......@@ -1560,12 +1560,12 @@ int enb_agent_lc_config_reply(mid_t mod_id, const void *params, Protocol__Progra
} // end for UE
lc_config_reply_msg->lc_ue_config = lc_ue_config;
} // lc_config_reply_msg->n_lc_ue_config > 0
*msg = malloc(sizeof(Protocol__ProgranMessage));
*msg = malloc(sizeof(Protocol__FlexranMessage));
if (*msg == NULL)
goto error;
protocol__progran_message__init(*msg);
(*msg)->msg_case = PROTOCOL__PROGRAN_MESSAGE__MSG_LC_CONFIG_REPLY_MSG;
(*msg)->msg_dir = PROTOCOL__PROGRAN_DIRECTION__SUCCESSFUL_OUTCOME;
protocol__flexran_message__init(*msg);
(*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_LC_CONFIG_REPLY_MSG;
(*msg)->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__SUCCESSFUL_OUTCOME;
(*msg)->lc_config_reply_msg = lc_config_reply_msg;
return 0;
......@@ -1588,38 +1588,38 @@ int enb_agent_lc_config_reply(mid_t mod_id, const void *params, Protocol__Progra
* ************************************
*/
int enb_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__ProgranMessage **msg) {
int enb_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg) {
xid_t xid;
Protocol__ProgranMessage *input = (Protocol__ProgranMessage *)params;
Protocol__PrpUeConfigRequest *ue_config_request_msg = input->ue_config_request_msg;
Protocol__FlexranMessage *input = (Protocol__FlexranMessage *)params;
Protocol__FlexUeConfigRequest *ue_config_request_msg = input->ue_config_request_msg;
xid = (ue_config_request_msg->header)->xid;
int i;
Protocol__PrpHeader *header;
if(prp_create_header(xid, PROTOCOL__PRP_TYPE__PRPT_GET_UE_CONFIG_REPLY, &header) != 0)
Protocol__FlexHeader *header;
if(flex_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_GET_UE_CONFIG_REPLY, &header) != 0)
goto error;
Protocol__PrpUeConfigReply *ue_config_reply_msg;
ue_config_reply_msg = malloc(sizeof(Protocol__PrpUeConfigReply));
Protocol__FlexUeConfigReply *ue_config_reply_msg;
ue_config_reply_msg = malloc(sizeof(Protocol__FlexUeConfigReply));
if(ue_config_reply_msg == NULL)
goto error;
protocol__prp_ue_config_reply__init(ue_config_reply_msg);
protocol__flex_ue_config_reply__init(ue_config_reply_msg);
ue_config_reply_msg->header = header;
//TODO: Fill in the actual number of UEs that are currently connected
ue_config_reply_msg->n_ue_config = get_num_ues(mod_id);
Protocol__PrpUeConfig **ue_config;
Protocol__FlexUeConfig **ue_config;
if (ue_config_reply_msg->n_ue_config > 0) {
ue_config = malloc(sizeof(Protocol__PrpUeConfig *) * ue_config_reply_msg->n_ue_config);
ue_config = malloc(sizeof(Protocol__FlexUeConfig *) * ue_config_reply_msg->n_ue_config);
if (ue_config == NULL) {
goto error;
}
for (i = 0; i < ue_config_reply_msg->n_ue_config; i++) {
ue_config[i] = malloc(sizeof(Protocol__PrpUeConfig));
protocol__prp_ue_config__init(ue_config[i]);
ue_config[i] = malloc(sizeof(Protocol__FlexUeConfig));
protocol__flex_ue_config__init(ue_config[i]);
//TODO: Set the RNTI of the ue with id i
ue_config[i]->rnti = get_ue_crnti(mod_id,i);
ue_config[i]->has_rnti = 1;
......@@ -1638,7 +1638,7 @@ int enb_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__Progra
}
//TODO: Set the measurement gap offset if applicable
if(ue_config[i]->has_meas_gap_config_pattern == 1 &&
ue_config[i]->meas_gap_config_pattern != PROTOCOL__PRP_MEAS_GAP_CONFIG_PATTERN__PRMGCP_OFF) {
ue_config[i]->meas_gap_config_pattern != PROTOCOL__FLEX_MEAS_GAP_CONFIG_PATTERN__FLMGCP_OFF) {
ue_config[i]->meas_gap_config_sf_offset = get_meas_gap_config_offset(mod_id,i);
ue_config[i]->has_meas_gap_config_sf_offset = 1;
}
......@@ -1666,9 +1666,9 @@ int enb_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__Progra
ue_config[i]->has_ue_aggregated_max_bitrate_dl = 1;
//TODO: Set the UE capabilities
Protocol__PrpUeCapabilities *capabilities;
capabilities = malloc(sizeof(Protocol__PrpUeCapabilities));
protocol__prp_ue_capabilities__init(capabilities);
Protocol__FlexUeCapabilities *capabilities;
capabilities = malloc(sizeof(Protocol__FlexUeCapabilities));
protocol__flex_ue_capabilities__init(capabilities);
//TODO: Set half duplex (FDD operation)
capabilities->has_half_duplex = 1;
capabilities->half_duplex = 1;//get_half_duplex(i);
......@@ -1686,7 +1686,7 @@ int enb_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__Progra
capabilities->res_alloc_type1 = 1;//get_res_alloc_type1(i);
//Set the capabilites to the message
ue_config[i]->capabilities = capabilities;
//TODO: Set UE transmission antenna. One of the PRUTA_* values
//TODO: Set UE transmission antenna. One of the FLUTA_* values
if(get_ue_transmission_antenna(mod_id,i) != -1){
ue_config[i]->has_ue_transmission_antenna = 1;
ue_config[i]->ue_transmission_antenna = get_ue_transmission_antenna(mod_id,i);
......@@ -1726,12 +1726,12 @@ int enb_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__Progra
ue_config[i]->has_simultaneous_ack_nack_cqi = 1;
ue_config[i]->simultaneous_ack_nack_cqi = get_simultaneous_ack_nack_cqi(mod_id,i);
}
//TODO: Set PRACRM_* value regarding aperiodic cqi report mode
//TODO: Set FLACRM_* value regarding aperiodic cqi report mode
if(get_aperiodic_cqi_rep_mode(mod_id,i) != -1){
ue_config[i]->has_aperiodic_cqi_rep_mode = 1;
int mode = get_aperiodic_cqi_rep_mode(mod_id,i);
if (mode > 4) {
ue_config[i]->aperiodic_cqi_rep_mode = PROTOCOL__PRP_APERIODIC_CQI_REPORT_MODE__PRACRM_NONE;
ue_config[i]->aperiodic_cqi_rep_mode = PROTOCOL__FLEX_APERIODIC_CQI_REPORT_MODE__FLACRM_NONE;
} else {
ue_config[i]->aperiodic_cqi_rep_mode = mode;
}
......@@ -1770,12 +1770,12 @@ int enb_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__Progra
}
ue_config_reply_msg->ue_config = ue_config;
}
*msg = malloc(sizeof(Protocol__ProgranMessage));
*msg = malloc(sizeof(Protocol__FlexranMessage));
if (*msg == NULL)
goto error;
protocol__progran_message__init(*msg);
(*msg)->msg_case = PROTOCOL__PROGRAN_MESSAGE__MSG_UE_CONFIG_REPLY_MSG;
(*msg)->msg_dir = PROTOCOL__PROGRAN_DIRECTION__SUCCESSFUL_OUTCOME;
protocol__flexran_message__init(*msg);
(*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_UE_CONFIG_REPLY_MSG;
(*msg)->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__SUCCESSFUL_OUTCOME;
(*msg)->ue_config_reply_msg = ue_config_reply_msg;
return 0;
......@@ -1798,29 +1798,29 @@ int enb_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__Progra
* ************************************
*/
int enb_agent_enb_config_request(mid_t mod_id, const void* params, Protocol__ProgranMessage **msg) {
int enb_agent_enb_config_request(mid_t mod_id, const void* params, Protocol__FlexranMessage **msg) {
Protocol__PrpHeader *header;
Protocol__FlexHeader *header;
xid_t xid = 1;
if(prp_create_header(xid,PROTOCOL__PRP_TYPE__PRPT_GET_ENB_CONFIG_REQUEST, &header) != 0)
if(flex_create_header(xid,PROTOCOL__FLEX_TYPE__FLPT_GET_ENB_CONFIG_REQUEST, &header) != 0)
goto error;
Protocol__PrpEnbConfigRequest *enb_config_request_msg;
enb_config_request_msg = malloc(sizeof(Protocol__PrpEnbConfigRequest));
Protocol__FlexEnbConfigRequest *enb_config_request_msg;
enb_config_request_msg = malloc(sizeof(Protocol__FlexEnbConfigRequest));
if(enb_config_request_msg == NULL)
goto error;
protocol__prp_enb_config_request__init(enb_config_request_msg);
protocol__flex_enb_config_request__init(enb_config_request_msg);
enb_config_request_msg->header = header;
*msg = malloc(sizeof(Protocol__ProgranMessage));
*msg = malloc(sizeof(Protocol__FlexranMessage));
if(*msg == NULL)
goto error;
protocol__progran_message__init(*msg);
(*msg)->msg_case = PROTOCOL__PROGRAN_MESSAGE__MSG_ENB_CONFIG_REQUEST_MSG;
(*msg)->msg_dir = PROTOCOL__PROGRAN_DIRECTION__INITIATING_MESSAGE;
protocol__flexran_message__init(*msg);
(*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_ENB_CONFIG_REQUEST_MSG;
(*msg)->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__INITIATING_MESSAGE;
(*msg)->enb_config_request_msg = enb_config_request_msg;
return 0;
......@@ -1836,26 +1836,26 @@ int enb_agent_enb_config_request(mid_t mod_id, const void* params, Protocol__Pro
return -1;
}
int enb_agent_enb_config_reply(mid_t mod_id, const void *params, Protocol__ProgranMessage **msg) {
int enb_agent_enb_config_reply(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg) {
xid_t xid;
Protocol__ProgranMessage *input = (Protocol__ProgranMessage *)params;
Protocol__PrpEnbConfigRequest *enb_config_req_msg = input->enb_config_request_msg;
Protocol__FlexranMessage *input = (Protocol__FlexranMessage *)params;
Protocol__FlexEnbConfigRequest *enb_config_req_msg = input->enb_config_request_msg;
xid = (enb_config_req_msg->header)->xid;
int i, j, k;
int cc_id = 0;
int enb_id = mod_id;
Protocol__PrpHeader *header;
if(prp_create_header(xid, PROTOCOL__PRP_TYPE__PRPT_GET_ENB_CONFIG_REPLY, &header) != 0)
Protocol__FlexHeader *header;
if(flex_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_GET_ENB_CONFIG_REPLY, &header) != 0)
goto error;
Protocol__PrpEnbConfigReply *enb_config_reply_msg;
enb_config_reply_msg = malloc(sizeof(Protocol__PrpEnbConfigReply));
Protocol__FlexEnbConfigReply *enb_config_reply_msg;
enb_config_reply_msg = malloc(sizeof(Protocol__FlexEnbConfigReply));
if(enb_config_reply_msg == NULL)
goto error;
protocol__prp_enb_config_reply__init(enb_config_reply_msg);
protocol__flex_enb_config_reply__init(enb_config_reply_msg);
enb_config_reply_msg->header = header;
enb_config_reply_msg->enb_id = mod_id;
......@@ -1863,14 +1863,14 @@ int enb_agent_enb_config_reply(mid_t mod_id, const void *params, Protocol__Progr
enb_config_reply_msg->n_cell_config = MAX_NUM_CCs;
Protocol__PrpCellConfig **cell_conf;
Protocol__FlexCellConfig **cell_conf;
if(enb_config_reply_msg->n_cell_config > 0){
cell_conf = malloc(sizeof(Protocol__PrpCellConfig *) * enb_config_reply_msg->n_cell_config);
cell_conf = malloc(sizeof(Protocol__FlexCellConfig *) * enb_config_reply_msg->n_cell_config);
if(cell_conf == NULL)
goto error;
for(i = 0; i < enb_config_reply_msg->n_cell_config; i++){
cell_conf[i] = malloc(sizeof(Protocol__PrpCellConfig));
protocol__prp_cell_config__init(cell_conf[i]);
cell_conf[i] = malloc(sizeof(Protocol__FlexCellConfig));
protocol__flex_cell_config__init(cell_conf[i]);
//TODO: Fill in with actual value, the PCI of this cell
cell_conf[i]->phy_cell_id = 1;
cell_conf[i]->has_phy_cell_id = get_cell_id(enb_id,i);
......@@ -1882,41 +1882,41 @@ int enb_agent_enb_config_reply(mid_t mod_id, const void *params, Protocol__Progr
cell_conf[i]->has_pusch_hopping_offset = 1;
//TODO: Fill in with actual value
if(get_hopping_mode(enb_id,i) == 0){
cell_conf[i]->hopping_mode = PROTOCOL__PRP_HOPPING_MODE__PRHM_INTER;
cell_conf[i]->hopping_mode = PROTOCOL__FLEX_HOPPING_MODE__FLHM_INTER;
}else if(get_hopping_mode(enb_id,i) == 1){
cell_conf[i]->hopping_mode = PROTOCOL__PRP_HOPPING_MODE__PRHM_INTERINTRA;
cell_conf[i]->hopping_mode = PROTOCOL__FLEX_HOPPING_MODE__FLHM_INTERINTRA;
}
cell_conf[i]->has_hopping_mode = 1;
//TODO: Fill in with actual value, the number of subbands
cell_conf[i]->n_sb = get_n_SB(enb_id,i);
cell_conf[i]->has_n_sb = 1;
//TODO: Fill in with actual value, The number of resource element groups used for PHICH. One of PRPR_
//TODO: Fill in with actual value, The number of resource element groups used for PHICH. One of FLPR_
if(get_phich_resource(enb_id,i) == 0){
cell_conf[i]->phich_resource = PROTOCOL__PRP_PHICH_RESOURCE__PRPR_ONE_SIXTH; //0
cell_conf[i]->phich_resource = PROTOCOL__FLEX_PHICH_RESOURCE__FLPR_ONE_SIXTH; //0
}else if (get_phich_resource(enb_id,i) == 1){
cell_conf[i]->phich_resource = PROTOCOL__PRP_PHICH_RESOURCE__PRPR_HALF; //1
cell_conf[i]->phich_resource = PROTOCOL__FLEX_PHICH_RESOURCE__FLPR_HALF; //1
}else if (get_phich_resource(enb_id,i) == 2){
cell_conf[i]->phich_resource = PROTOCOL__PRP_PHICH_RESOURCE__PRPR_ONE; // 2
cell_conf[i]->phich_resource = PROTOCOL__FLEX_PHICH_RESOURCE__FLPR_ONE; // 2
}else if (get_phich_resource(enb_id,i) == 3){
cell_conf[i]->phich_resource = PROTOCOL__PRP_PHICH_RESOURCE__PRPR_TWO;//3
cell_conf[i]->phich_resource = PROTOCOL__FLEX_PHICH_RESOURCE__FLPR_TWO;//3
}
cell_conf[i]->has_phich_resource = 1;
//TODO: Fill in with actual value, one of the PRPD_ values
//TODO: Fill in with actual value, one of the FLPD_ values
if(get_phich_duration(enb_id,i) == 0){
cell_conf[i]->phich_duration = PROTOCOL__PRP_PHICH_DURATION__PRPD_NORMAL;
cell_conf[i]->phich_duration = PROTOCOL__FLEX_PHICH_DURATION__FLPD_NORMAL;
}else if(get_phich_duration(enb_id,i) == 1){
cell_conf[i]->phich_duration = PROTOCOL__PRP_PHICH_DURATION__PRPD_EXTENDED;
cell_conf[i]->phich_duration = PROTOCOL__FLEX_PHICH_DURATION__FLPD_EXTENDED;
}
cell_conf[i]->has_phich_duration = 1;
//TODO: Fill in with actual value, See TS 36.211, section 6.9
cell_conf[i]->init_nr_pdcch_ofdm_sym = get_num_pdcch_symb(enb_id,i);
cell_conf[i]->has_init_nr_pdcch_ofdm_sym = 1;
//TODO: Fill in with actual value
/* Protocol__PrpSiConfig *si_config; */
/* si_config = malloc(sizeof(Protocol__PrpSiConfig)); */
/* Protocol__FlexSiConfig *si_config; */
/* si_config = malloc(sizeof(Protocol__FlexSiConfig)); */
/* if(si_config == NULL) */
/* goto error; */
/* protocol__prp_si_config__init(si_config); */
/* protocol__flex_si_config__init(si_config); */
/* //TODO: Fill in with actual value, Frame number to apply the SI configuration */
/* si_config->sfn = 1; */
/* si_config->has_sfn = 1; */
......@@ -1928,15 +1928,15 @@ int enb_agent_enb_config_reply(mid_t mod_id, const void *params, Protocol__Progr
/* si_config->has_si_window_length = 1; */
/* //TODO: Fill in with actual value, the number of SI messages */
/* si_config->n_si_message=1; */
/* Protocol__PrpSiMessage **si_message; */
/* si_message = malloc(sizeof(Protocol__PrpSiMessage *) * si_config->n_si_message); */
/* Protocol__FlexSiMessage **si_message; */
/* si_message = malloc(sizeof(Protocol__FlexSiMessage *) * si_config->n_si_message); */
/* if(si_message == NULL) */
/* goto error; */
/* for(j = 0; j < si_config->n_si_message; j++){ */
/* si_message[j] = malloc(sizeof(Protocol__PrpSiMessage)); */
/* si_message[j] = malloc(sizeof(Protocol__FlexSiMessage)); */
/* if(si_message[j] == NULL) */
/* goto error; */
/* protocol__prp_si_message__init(si_message[j]); */
/* protocol__flex_si_message__init(si_message[j]); */
/* //TODO: Fill in with actual value, Periodicity of SI msg in radio frames */
/* si_message[j]->periodicity = 1; //SIPeriod */
/* si_message[j]->has_periodicity = 1; */
......@@ -1955,29 +1955,29 @@ int enb_agent_enb_config_reply(mid_t mod_id, const void *params, Protocol__Progr
//TODO: Fill in with actual value, the UL transmission bandwidth in RBs
cell_conf[i]->ul_bandwidth = get_N_RB_UL(enb_id,i);
cell_conf[i]->has_ul_bandwidth = 1;
//TODO: Fill in with actual value, one of PRUCPL values
//TODO: Fill in with actual value, one of FLUCPL values
if(get_ul_cyclic_prefix_length(enb_id,i) == 0){
cell_conf[i]->ul_cyclic_prefix_length = PROTOCOL__PRP_UL_CYCLIC_PREFIX_LENGTH__PRUCPL_NORMAL;
cell_conf[i]->ul_cyclic_prefix_length = PROTOCOL__FLEX_UL_CYCLIC_PREFIX_LENGTH__FLUCPL_NORMAL;
}else if(get_ul_cyclic_prefix_length(enb_id,i) == 1){
cell_conf[i]->ul_cyclic_prefix_length = PROTOCOL__PRP_UL_CYCLIC_PREFIX_LENGTH__PRUCPL_EXTENDED;
cell_conf[i]->ul_cyclic_prefix_length = PROTOCOL__FLEX_UL_CYCLIC_PREFIX_LENGTH__FLUCPL_EXTENDED;
}
cell_conf[i]->has_ul_cyclic_prefix_length = 1;
//TODO: Fill in with actual value, one of PRUCPL values
//TODO: Fill in with actual value, one of FLUCPL values
if(get_ul_cyclic_prefix_length(enb_id,i) == 0){
cell_conf[i]->ul_cyclic_prefix_length = PROTOCOL__PRP_DL_CYCLIC_PREFIX_LENGTH__PRDCPL_NORMAL;
cell_conf[i]->ul_cyclic_prefix_length = PROTOCOL__FLEX_DL_CYCLIC_PREFIX_LENGTH__FLDCPL_NORMAL;
}else if(get_ul_cyclic_prefix_length(enb_id,i) == 1){
cell_conf[i]->ul_cyclic_prefix_length = PROTOCOL__PRP_DL_CYCLIC_PREFIX_LENGTH__PRDCPL_EXTENDED;
cell_conf[i]->ul_cyclic_prefix_length = PROTOCOL__FLEX_DL_CYCLIC_PREFIX_LENGTH__FLDCPL_EXTENDED;
}
cell_conf[i]->has_dl_cyclic_prefix_length = 1;
//TODO: Fill in with actual value, number of cell specific antenna ports
cell_conf[i]->antenna_ports_count = 1;
cell_conf[i]->has_antenna_ports_count = 1;
//TODO: Fill in with actual value, one of PRDM values
//TODO: Fill in with actual value, one of FLDM values
if(get_duplex_mode(enb_id,i) == 1){
cell_conf[i]->duplex_mode = PROTOCOL__PRP_DUPLEX_MODE__PRDM_FDD;
cell_conf[i]->duplex_mode = PROTOCOL__FLEX_DUPLEX_MODE__FLDM_FDD;
}else if(get_duplex_mode(enb_id,i) == 0){
cell_conf[i]->duplex_mode = PROTOCOL__PRP_DUPLEX_MODE__PRDM_TDD;
cell_conf[i]->duplex_mode = PROTOCOL__FLEX_DUPLEX_MODE__FLDM_TDD;
}
cell_conf[i]->has_duplex_mode = 1;
//TODO: Fill in with actual value, DL/UL subframe assignment. TDD only
......@@ -2052,11 +2052,11 @@ int enb_agent_enb_config_reply(mid_t mod_id, const void *params, Protocol__Progr
//TODO: Fill in with actual value, Boolean value. See TS 36.211, section 5.5.3.2. TDD only
cell_conf[i]->srs_mac_up_pts = get_srs_MaxUpPts(enb_id,i);
cell_conf[i]->has_srs_mac_up_pts = 1;
//TODO: Fill in with actual value, One of the PREQ_ values
//TODO: Fill in with actual value, One of the FLEQ_ values
if(get_enable64QAM(enb_id,i) == 0){
cell_conf[i]->enable_64qam = PROTOCOL__PRP_QAM__PREQ_MOD_16QAM;
cell_conf[i]->enable_64qam = PROTOCOL__FLEX_QAM__FLEQ_MOD_16QAM;
}else if(get_enable64QAM(enb_id,i) == 1){
cell_conf[i]->enable_64qam = PROTOCOL__PRP_QAM__PREQ_MOD_64QAM;
cell_conf[i]->enable_64qam = PROTOCOL__FLEX_QAM__FLEQ_MOD_64QAM;
}
cell_conf[i]->has_enable_64qam = 1;
//TODO: Fill in with actual value, Carrier component index
......@@ -2065,12 +2065,12 @@ int enb_agent_enb_config_reply(mid_t mod_id, const void *params, Protocol__Progr
}
enb_config_reply_msg->cell_config=cell_conf;
}
*msg = malloc(sizeof(Protocol__ProgranMessage));
*msg = malloc(sizeof(Protocol__FlexranMessage));
if(*msg == NULL)
goto error;
protocol__progran_message__init(*msg);
(*msg)->msg_case = PROTOCOL__PROGRAN_MESSAGE__MSG_ENB_CONFIG_REPLY_MSG;
(*msg)->msg_dir = PROTOCOL__PROGRAN_DIRECTION__SUCCESSFUL_OUTCOME;
protocol__flexran_message__init(*msg);
(*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_ENB_CONFIG_REPLY_MSG;
(*msg)->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__SUCCESSFUL_OUTCOME;
(*msg)->enb_config_reply_msg = enb_config_reply_msg;
return 0;
......@@ -2104,7 +2104,7 @@ err_code_t enb_agent_init_timer(void){
memset(&e, 0, sizeof(enb_agent_timer_element_t));
RB_INSERT(enb_agent_map, &agent_map, &e);
*/
return PROTOCOL__PROGRAN_ERR__NO_ERR;
return PROTOCOL__FLEXRAN_ERR__NO_ERR;
}
RB_GENERATE(enb_agent_map,enb_agent_timer_element_s, entry, enb_agent_compare_timer);
......@@ -2190,7 +2190,7 @@ err_code_t enb_agent_destroy_timer(long timer_id){
if (e != NULL ) {
RB_REMOVE(enb_agent_map, &timer_instance.enb_agent_head, e);
enb_agent_destroy_progran_message(e->timer_args->msg);
enb_agent_destroy_flexran_message(e->timer_args->msg);
free(e);
}
......@@ -2211,7 +2211,7 @@ err_code_t enb_agent_destroy_timer_by_task_id(xid_t xid) {
if (e->xid == xid) {
timer_id = e->timer_id;
RB_REMOVE(enb_agent_map, &timer_instance.enb_agent_head, e);
enb_agent_destroy_progran_message(e->timer_args->msg);
enb_agent_destroy_flexran_message(e->timer_args->msg);
free(e);
if (timer_remove(timer_id) < 0 ) {
goto error;
......@@ -2232,7 +2232,7 @@ err_code_t enb_agent_destroy_timers(void){
RB_FOREACH(e, enb_agent_map, &timer_instance.enb_agent_head) {
RB_REMOVE(enb_agent_map, &timer_instance.enb_agent_head, e);
timer_remove(e->timer_id);
enb_agent_destroy_progran_message(e->timer_args->msg);
enb_agent_destroy_flexran_message(e->timer_args->msg);
free(e);
}
......@@ -2310,7 +2310,7 @@ err_code_t enb_agent_restart_timer(uint32_t *timer_id){
}
if (ret < 0 ) {
return PROTOCOL__PROGRAN_ERR__TIMER_SETUP_FAILED;
return PROTOCOL__FLEXRAN_ERR__TIMER_SETUP_FAILED;
}
return 0;
......
......@@ -29,7 +29,7 @@
/*! \file enb_agent_common.h
* \brief common message primitves and utilities
* \author Navid Nikaein and Xenofon Foukas
* \author Xenofon Foukas, Mohamed Kassem and Navid Nikaein
* \date 2016
* \version 0.1
*/
......@@ -42,7 +42,7 @@
#include <time.h>
#include "header.pb-c.h"
#include "progran.pb-c.h"
#include "flexran.pb-c.h"
#include "stats_messages.pb-c.h"
#include "stats_common.pb-c.h"
......@@ -56,72 +56,72 @@
# include "intertask_interface.h"
# include "timer.h"
#define PROGRAN_VERSION 0
#define FLEXRAN_VERSION 0
typedef int (*enb_agent_message_decoded_callback)(
mid_t mod_id,
const void *params,
Protocol__ProgranMessage **msg
Protocol__FlexranMessage **msg
);
typedef int (*enb_agent_message_destruction_callback)(
Protocol__ProgranMessage *msg
Protocol__FlexranMessage *msg
);
/**********************************
* progRAN protocol messages helper
* FlexRAN protocol messages helper
* functions and generic handlers
**********************************/
int enb_agent_serialize_message(Protocol__ProgranMessage *msg, void **buf, int *size);
int enb_agent_deserialize_message(void *data, int size, Protocol__ProgranMessage **msg);
int enb_agent_serialize_message(Protocol__FlexranMessage *msg, void **buf, int *size);
int enb_agent_deserialize_message(void *data, int size, Protocol__FlexranMessage **msg);
void * enb_agent_pack_message(Protocol__ProgranMessage *msg,
void * enb_agent_pack_message(Protocol__FlexranMessage *msg,
uint32_t * size);
err_code_t enb_agent_destroy_progran_message(Protocol__ProgranMessage *msg);
err_code_t enb_agent_destroy_flexran_message(Protocol__FlexranMessage *msg);
int prp_create_header(xid_t xid, Protocol__PrpType type, Protocol__PrpHeader **header);
int flex_create_header(xid_t xid, Protocol__FlexType type, Protocol__FlexHeader **header);
int enb_agent_hello(mid_t mod_id, const void *params, Protocol__ProgranMessage **msg);
int enb_agent_destroy_hello(Protocol__ProgranMessage *msg);
int enb_agent_hello(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
int enb_agent_destroy_hello(Protocol__FlexranMessage *msg);
int enb_agent_echo_request(mid_t mod_id, const void *params, Protocol__ProgranMessage **msg);
int enb_agent_destroy_echo_request(Protocol__ProgranMessage *msg);
int enb_agent_echo_request(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
int enb_agent_destroy_echo_request(Protocol__FlexranMessage *msg);
int enb_agent_echo_reply(mid_t mod_id, const void *params, Protocol__ProgranMessage **msg);
int enb_agent_destroy_echo_reply(Protocol__ProgranMessage *msg);
int enb_agent_echo_reply(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
int enb_agent_destroy_echo_reply(Protocol__FlexranMessage *msg);
int enb_agent_enb_config_reply(mid_t mod_id, const void *params, Protocol__ProgranMessage **msg);
int enb_agent_destroy_enb_config_reply(Protocol__ProgranMessage *msg);
int enb_agent_enb_config_reply(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
int enb_agent_destroy_enb_config_reply(Protocol__FlexranMessage *msg);
int enb_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__ProgranMessage **msg);
int enb_agent_destroy_ue_config_reply(Protocol__ProgranMessage *msg);
int enb_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
int enb_agent_destroy_ue_config_reply(Protocol__FlexranMessage *msg);
int enb_agent_lc_config_reply(mid_t mod_id, const void *params, Protocol__ProgranMessage **msg);
int enb_agent_destroy_lc_config_reply(Protocol__ProgranMessage *msg);
int enb_agent_lc_config_reply(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
int enb_agent_destroy_lc_config_reply(Protocol__FlexranMessage *msg);
int enb_agent_enb_config_request(mid_t mod_id, const void* params, Protocol__ProgranMessage **msg);
int enb_agent_destroy_enb_config_request(Protocol__ProgranMessage *msg);
int enb_agent_enb_config_request(mid_t mod_id, const void* params, Protocol__FlexranMessage **msg);
int enb_agent_destroy_enb_config_request(Protocol__FlexranMessage *msg);
int enb_agent_destroy_ue_config_request(Protocol__ProgranMessage *msg);
int enb_agent_destroy_ue_config_request(Protocol__FlexranMessage *msg);
int enb_agent_destroy_lc_config_request(Protocol__ProgranMessage *msg);
int enb_agent_destroy_lc_config_request(Protocol__FlexranMessage *msg);
int enb_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_change);
int enb_agent_destroy_ue_state_change(Protocol__ProgranMessage *msg);
int enb_agent_destroy_ue_state_change(Protocol__FlexranMessage *msg);
int enb_agent_control_delegation(mid_t mod_id, const void *params, Protocol__ProgranMessage **msg);
int enb_agent_destroy_control_delegation(Protocol__ProgranMessage *msg);
int enb_agent_control_delegation(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
int enb_agent_destroy_control_delegation(Protocol__FlexranMessage *msg);
int enb_agent_reconfiguration(mid_t mod_id, const void *params, Protocol__ProgranMessage **msg);
int enb_agent_destroy_agent_reconfiguration(Protocol__ProgranMessage *msg);
int enb_agent_reconfiguration(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
int enb_agent_destroy_agent_reconfiguration(Protocol__FlexranMessage *msg);
Protocol__ProgranMessage* enb_agent_handle_message (mid_t mod_id,
Protocol__FlexranMessage* enb_agent_handle_message (mid_t mod_id,
uint8_t *data,
uint32_t size);
Protocol__ProgranMessage *enb_agent_handle_timed_task(void *args);
Protocol__FlexranMessage *enb_agent_handle_timed_task(void *args);
......@@ -145,7 +145,7 @@ unsigned int get_current_system_frame_num(mid_t mod_id);
unsigned int get_current_subframe(mid_t mod_id);
/*Return the frame and subframe number in compact 16-bit format.
Bits 0-3 subframe, rest for frame. Required by progRAN protocol*/
Bits 0-3 subframe, rest for frame. Required by FlexRAN protocol*/
uint16_t get_sfn_sf (mid_t mod_id);
uint16_t get_future_sfn_sf(mid_t mod_id, int ahead_of_time);
......@@ -287,7 +287,7 @@ int get_direction(mid_t ue_id, mid_t lc_id);
/* Type of the callback executed when the timer expired */
typedef Protocol__ProgranMessage *(*enb_agent_timer_callback_t)(void*);
typedef Protocol__FlexranMessage *(*enb_agent_timer_callback_t)(void*);
typedef enum {
/* oneshot timer: */
......@@ -319,7 +319,7 @@ typedef enum {
typedef struct enb_agent_timer_args_s{
mid_t mod_id;
Protocol__ProgranMessage *msg;
Protocol__FlexranMessage *msg;
} enb_agent_timer_args_t;
......@@ -371,7 +371,7 @@ err_code_t enb_agent_restart_timer(long *timer_id);
struct enb_agent_timer_element_s * get_timer_entry(long timer_id);
Protocol__ProgranMessage * enb_agent_process_timeout(long timer_id, void* timer_args);
Protocol__FlexranMessage * enb_agent_process_timeout(long timer_id, void* timer_args);
int enb_agent_compare_timer(struct enb_agent_timer_element_s *a, struct enb_agent_timer_element_s *b);
......
......@@ -29,7 +29,7 @@
/*! \file enb_agent_handler.c
* \brief enb agent tx and rx message handler
* \author Navid Nikaein and Xenofon Foukas
* \author Xenofon Foukas and Navid Nikaein
* \date 2016
* \version 0.1
*/
......@@ -42,23 +42,23 @@
#include "assertions.h"
enb_agent_message_decoded_callback agent_messages_callback[][3] = {
{enb_agent_hello, 0, 0}, /*PROTOCOL__PROGRAN_MESSAGE__MSG_HELLO_MSG*/
{enb_agent_echo_reply, 0, 0}, /*PROTOCOL__PROGRAN_MESSAGE__MSG_ECHO_REQUEST_MSG*/
{0, 0, 0}, /*PROTOCOL__PROGRAN_MESSAGE__MSG_ECHO_REPLY_MSG*/ //Must add handler when receiving echo reply
{enb_agent_mac_handle_stats, 0, 0}, /*PROTOCOL__PROGRAN_MESSAGE__MSG_STATS_REQUEST_MSG*/
{0, 0, 0}, /*PROTOCOL__PROGRAN_MESSAGE__MSG_STATS_REPLY_MSG*/
{0, 0, 0}, /*PROTOCOK__PROGRAN_MESSAGE__MSG_SF_TRIGGER_MSG*/
{0, 0, 0}, /*PROTOCOL__PROGRAN_MESSAGE__MSG_UL_SR_INFO_MSG*/
{enb_agent_enb_config_reply, 0, 0}, /*PROTOCOL__PROGRAN_MESSAGE__MSG_ENB_CONFIG_REQUEST_MSG*/
{0, 0, 0}, /*PROTOCOL__PROGRAN_MESSAGE__MSG_ENB_CONFIG_REPLY_MSG*/
{enb_agent_ue_config_reply, 0, 0}, /*PROTOCOL__PROGRAN_MESSAGE__MSG_UE_CONFIG_REQUEST_MSG*/
{0, 0, 0}, /*PROTOCOL__PROGRAN_MESSAGE__MSG_UE_CONFIG_REPLY_MSG*/
{enb_agent_lc_config_reply, 0, 0}, /*PROTOCOL__PROGRAN_MESSAGE__MSG_LC_CONFIG_REQUEST_MSG*/
{0, 0, 0}, /*PROTOCOL__PROGRAN_MESSAGE__MSG_LC_CONFIG_REPLY_MSG*/
{enb_agent_mac_handle_dl_mac_config, 0, 0}, /*PROTOCOL__PROGRAN_MESSAGE__MSG_DL_MAC_CONFIG_MSG*/
{0, 0, 0}, /*PROTOCOL__PROGRAN_MESSAGE__MSG_UE_STATE_CHANGE_MSG*/
{enb_agent_control_delegation, 0, 0}, /*PROTOCOL__PROGRAN_MESSAGE__MSG_CONTROL_DELEGATION_MSG*/
{enb_agent_reconfiguration, 0, 0}, /*PROTOCOL__PROGRAN_MESSAGE__MSG_AGENT_RECONFIGURATION_MSG*/
{enb_agent_hello, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_HELLO_MSG*/
{enb_agent_echo_reply, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_ECHO_REQUEST_MSG*/
{0, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_ECHO_REPLY_MSG*/ //Must add handler when receiving echo reply
{enb_agent_mac_handle_stats, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_STATS_REQUEST_MSG*/
{0, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_STATS_REPLY_MSG*/
{0, 0, 0}, /*PROTOCOK__FLEXRAN_MESSAGE__MSG_SF_TRIGGER_MSG*/
{0, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_UL_SR_INFO_MSG*/
{enb_agent_enb_config_reply, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_ENB_CONFIG_REQUEST_MSG*/
{0, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_ENB_CONFIG_REPLY_MSG*/
{enb_agent_ue_config_reply, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_UE_CONFIG_REQUEST_MSG*/
{0, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_UE_CONFIG_REPLY_MSG*/
{enb_agent_lc_config_reply, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_LC_CONFIG_REQUEST_MSG*/
{0, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_LC_CONFIG_REPLY_MSG*/
{enb_agent_mac_handle_dl_mac_config, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_DL_MAC_CONFIG_MSG*/
{0, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_UE_STATE_CHANGE_MSG*/
{enb_agent_control_delegation, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_CONTROL_DELEGATION_MSG*/
{enb_agent_reconfiguration, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_AGENT_RECONFIGURATION_MSG*/
};
enb_agent_message_destruction_callback message_destruction_callback[] = {
......@@ -89,27 +89,27 @@ static const char *enb_agent_direction2String[] = {
};
Protocol__ProgranMessage* enb_agent_handle_message (mid_t mod_id,
Protocol__FlexranMessage* enb_agent_handle_message (mid_t mod_id,
uint8_t *data,
uint32_t size){
Protocol__ProgranMessage *decoded_message, *reply_message;
Protocol__FlexranMessage *decoded_message, *reply_message;
err_code_t err_code;
DevAssert(data != NULL);
if (enb_agent_deserialize_message(data, size, &decoded_message) < 0) {
err_code= PROTOCOL__PROGRAN_ERR__MSG_DECODING;
err_code= PROTOCOL__FLEXRAN_ERR__MSG_DECODING;
goto error;
}
if ((decoded_message->msg_case > sizeof(agent_messages_callback) / (3*sizeof(enb_agent_message_decoded_callback))) ||
(decoded_message->msg_dir > PROTOCOL__PROGRAN_DIRECTION__UNSUCCESSFUL_OUTCOME)){
err_code= PROTOCOL__PROGRAN_ERR__MSG_NOT_HANDLED;
(decoded_message->msg_dir > PROTOCOL__FLEXRAN_DIRECTION__UNSUCCESSFUL_OUTCOME)){
err_code= PROTOCOL__FLEXRAN_ERR__MSG_NOT_HANDLED;
goto error;
}
if (agent_messages_callback[decoded_message->msg_case-1][decoded_message->msg_dir-1] == NULL) {
err_code= PROTOCOL__PROGRAN_ERR__MSG_NOT_SUPPORTED;
err_code= PROTOCOL__FLEXRAN_ERR__MSG_NOT_SUPPORTED;
goto error;
}
......@@ -118,7 +118,7 @@ Protocol__ProgranMessage* enb_agent_handle_message (mid_t mod_id,
if ( err_code < 0 ){
goto error;
} else if (err_code == 1) { //If err_code > 1, we do not want to dispose the message yet
protocol__progran_message__free_unpacked(decoded_message, NULL);
protocol__flexran_message__free_unpacked(decoded_message, NULL);
}
return reply_message;
......@@ -130,14 +130,14 @@ error:
void * enb_agent_pack_message(Protocol__ProgranMessage *msg,
void * enb_agent_pack_message(Protocol__FlexranMessage *msg,
uint32_t * size){
void * buffer;
err_code_t err_code = PROTOCOL__PROGRAN_ERR__NO_ERR;
err_code_t err_code = PROTOCOL__FLEXRAN_ERR__NO_ERR;
if (enb_agent_serialize_message(msg, &buffer, size) < 0 ) {
err_code = PROTOCOL__PROGRAN_ERR__MSG_ENCODING;
err_code = PROTOCOL__FLEXRAN_ERR__MSG_ENCODING;
goto error;
}
......@@ -157,11 +157,11 @@ void * enb_agent_pack_message(Protocol__ProgranMessage *msg,
return NULL;
}
Protocol__ProgranMessage *enb_agent_handle_timed_task(void *args) {
Protocol__FlexranMessage *enb_agent_handle_timed_task(void *args) {
err_code_t err_code;
enb_agent_timer_args_t *timer_args = (enb_agent_timer_args_t *) args;
Protocol__ProgranMessage *timed_task, *reply_message;
Protocol__FlexranMessage *timed_task, *reply_message;
timed_task = timer_args->msg;
err_code = ((*agent_messages_callback[timed_task->msg_case-1][timed_task->msg_dir-1])(timer_args->mod_id, (void *) timed_task, &reply_message));
if ( err_code < 0 ){
......@@ -175,7 +175,7 @@ Protocol__ProgranMessage *enb_agent_handle_timed_task(void *args) {
return NULL;
}
Protocol__ProgranMessage* enb_agent_process_timeout(long timer_id, void* timer_args){
Protocol__FlexranMessage* enb_agent_process_timeout(long timer_id, void* timer_args){
struct enb_agent_timer_element_s *found = get_timer_entry(timer_id);
......@@ -192,6 +192,6 @@ Protocol__ProgranMessage* enb_agent_process_timeout(long timer_id, void* timer_a
return TIMER_ELEMENT_NOT_FOUND;
}
err_code_t enb_agent_destroy_progran_message(Protocol__ProgranMessage *msg) {
err_code_t enb_agent_destroy_flexran_message(Protocol__FlexranMessage *msg) {
return ((*message_destruction_callback[msg->msg_case-1])(msg));
}
......@@ -29,7 +29,7 @@
/*! \file enb_agent_mac.c
* \brief enb agent message handler for MAC layer
* \author Navid Nikaein and Xenofon Foukas
* \author Xenofon Foukas, Mohamed Kassem and Navid Nikaein
* \date 2016
* \version 0.1
*/
......@@ -61,7 +61,7 @@ struct lfds700_ringbuffer_element *dl_mac_config_array[NUM_MAX_ENB];
struct lfds700_ringbuffer_state ringbuffer_state[NUM_MAX_ENB];
int enb_agent_mac_handle_stats(mid_t mod_id, const void *params, Protocol__ProgranMessage **msg){
int enb_agent_mac_handle_stats(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg){
// TODO: Must deal with sanitization of input
// TODO: Must check if RNTIs and cell ids of the request actually exist
......@@ -86,16 +86,16 @@ int enb_agent_mac_handle_stats(mid_t mod_id, const void *params, Protocol__Progr
uint32_t ue_flags = 0;
uint32_t c_flags = 0;
Protocol__ProgranMessage *input = (Protocol__ProgranMessage *)params;
Protocol__FlexranMessage *input = (Protocol__FlexranMessage *)params;
Protocol__PrpStatsRequest *stats_req = input->stats_request_msg;
Protocol__FlexStatsRequest *stats_req = input->stats_request_msg;
xid = (stats_req->header)->xid;
// Check the type of request that is made
switch(stats_req->body_case) {
case PROTOCOL__PRP_STATS_REQUEST__BODY_COMPLETE_STATS_REQUEST: ;
Protocol__PrpCompleteStatsRequest *comp_req = stats_req->complete_stats_request;
if (comp_req->report_frequency == PROTOCOL__PRP_STATS_REPORT_FREQ__PRSRF_OFF) {
case PROTOCOL__FLEX_STATS_REQUEST__BODY_COMPLETE_STATS_REQUEST: ;
Protocol__FlexCompleteStatsRequest *comp_req = stats_req->complete_stats_request;
if (comp_req->report_frequency == PROTOCOL__FLEX_STATS_REPORT_FREQ__FLSRF_OFF) {
/*Disable both periodic and continuous updates*/
enb_agent_disable_cont_mac_stats_update(mod_id);
enb_agent_destroy_timer_by_task_id(xid);
......@@ -133,12 +133,12 @@ int enb_agent_mac_handle_stats(mid_t mod_id, const void *params, Protocol__Progr
report_config.cc_report_type[i].cc_report_flags = c_flags;
}
/* Check if request was periodical */
if (comp_req->report_frequency == PROTOCOL__PRP_STATS_REPORT_FREQ__PRSRF_PERIODICAL) {
/* Create a one off progran message as an argument for the periodical task */
Protocol__ProgranMessage *timer_msg;
if (comp_req->report_frequency == PROTOCOL__FLEX_STATS_REPORT_FREQ__FLSRF_PERIODICAL) {
/* Create a one off flexran message as an argument for the periodical task */
Protocol__FlexranMessage *timer_msg;
stats_request_config_t request_config;
request_config.report_type = PROTOCOL__PRP_STATS_TYPE__PRST_COMPLETE_STATS;
request_config.report_frequency = PROTOCOL__PRP_STATS_REPORT_FREQ__PRSRF_ONCE;
request_config.report_type = PROTOCOL__FLEX_STATS_TYPE__FLST_COMPLETE_STATS;
request_config.report_frequency = PROTOCOL__FLEX_STATS_REPORT_FREQ__FLSRF_ONCE;
request_config.period = 0;
/* Need to make sure that the ue flags are saved (Bug) */
if (report_config.nr_ue == 0) {
......@@ -170,13 +170,13 @@ int enb_agent_mac_handle_stats(mid_t mod_id, const void *params, Protocol__Progr
usec_interval = usec_interval%(1000*1000);
}
enb_agent_create_timer(sec_interval, usec_interval, ENB_AGENT_DEFAULT, enb_id, ENB_AGENT_TIMER_TYPE_PERIODIC, xid, enb_agent_handle_timed_task,(void*) timer_args, &timer_id);
} else if (comp_req->report_frequency == PROTOCOL__PRP_STATS_REPORT_FREQ__PRSRF_CONTINUOUS) {
} else if (comp_req->report_frequency == PROTOCOL__FLEX_STATS_REPORT_FREQ__FLSRF_CONTINUOUS) {
/*If request was for continuous updates, disable the previous configuration and
set up a new one*/
enb_agent_disable_cont_mac_stats_update(mod_id);
stats_request_config_t request_config;
request_config.report_type = PROTOCOL__PRP_STATS_TYPE__PRST_COMPLETE_STATS;
request_config.report_frequency = PROTOCOL__PRP_STATS_REPORT_FREQ__PRSRF_ONCE;
request_config.report_type = PROTOCOL__FLEX_STATS_TYPE__FLST_COMPLETE_STATS;
request_config.report_frequency = PROTOCOL__FLEX_STATS_REPORT_FREQ__FLSRF_ONCE;
request_config.period = 0;
/* Need to make sure that the ue flags are saved (Bug) */
if (report_config.nr_ue == 0) {
......@@ -195,8 +195,8 @@ int enb_agent_mac_handle_stats(mid_t mod_id, const void *params, Protocol__Progr
}
}
break;
case PROTOCOL__PRP_STATS_REQUEST__BODY_CELL_STATS_REQUEST:;
Protocol__PrpCellStatsRequest *cell_req = stats_req->cell_stats_request;
case PROTOCOL__FLEX_STATS_REQUEST__BODY_CELL_STATS_REQUEST:;
Protocol__FlexCellStatsRequest *cell_req = stats_req->cell_stats_request;
// UE report config will be blank
report_config.nr_ue = 0;
report_config.ue_report_type = NULL;
......@@ -213,8 +213,8 @@ int enb_agent_mac_handle_stats(mid_t mod_id, const void *params, Protocol__Progr
report_config.cc_report_type[i].cc_report_flags = cell_req->flags;
}
break;
case PROTOCOL__PRP_STATS_REQUEST__BODY_UE_STATS_REQUEST:;
Protocol__PrpUeStatsRequest *ue_req = stats_req->ue_stats_request;
case PROTOCOL__FLEX_STATS_REQUEST__BODY_UE_STATS_REQUEST:;
Protocol__FlexUeStatsRequest *ue_req = stats_req->ue_stats_request;
// Cell report config will be blank
report_config.nr_cc = 0;
report_config.cc_report_type = NULL;
......@@ -237,7 +237,7 @@ int enb_agent_mac_handle_stats(mid_t mod_id, const void *params, Protocol__Progr
}
if (enb_agent_mac_stats_reply(enb_id, xid, &report_config, msg) < 0 ){
err_code = PROTOCOL__PROGRAN_ERR__MSG_BUILD;
err_code = PROTOCOL__FLEXRAN_ERR__MSG_BUILD;
goto error;
}
......@@ -254,32 +254,32 @@ int enb_agent_mac_handle_stats(mid_t mod_id, const void *params, Protocol__Progr
int enb_agent_mac_stats_request(mid_t mod_id,
xid_t xid,
const stats_request_config_t *report_config,
Protocol__ProgranMessage **msg) {
Protocol__PrpHeader *header;
Protocol__FlexranMessage **msg) {
Protocol__FlexHeader *header;
int i;
if (prp_create_header(xid, PROTOCOL__PRP_TYPE__PRPT_STATS_REQUEST, &header) != 0)
if (flex_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_STATS_REQUEST, &header) != 0)
goto error;
Protocol__PrpStatsRequest *stats_request_msg;
stats_request_msg = malloc(sizeof(Protocol__PrpStatsRequest));
Protocol__FlexStatsRequest *stats_request_msg;
stats_request_msg = malloc(sizeof(Protocol__FlexStatsRequest));
if(stats_request_msg == NULL)
goto error;
protocol__prp_stats_request__init(stats_request_msg);
protocol__flex_stats_request__init(stats_request_msg);
stats_request_msg->header = header;
stats_request_msg->type = report_config->report_type;
stats_request_msg->has_type = 1;
switch (report_config->report_type) {
case PROTOCOL__PRP_STATS_TYPE__PRST_COMPLETE_STATS:
stats_request_msg->body_case = PROTOCOL__PRP_STATS_REQUEST__BODY_COMPLETE_STATS_REQUEST;
Protocol__PrpCompleteStatsRequest *complete_stats;
complete_stats = malloc(sizeof(Protocol__PrpCompleteStatsRequest));
case PROTOCOL__FLEX_STATS_TYPE__FLST_COMPLETE_STATS:
stats_request_msg->body_case = PROTOCOL__FLEX_STATS_REQUEST__BODY_COMPLETE_STATS_REQUEST;
Protocol__FlexCompleteStatsRequest *complete_stats;
complete_stats = malloc(sizeof(Protocol__FlexCompleteStatsRequest));
if(complete_stats == NULL)
goto error;
protocol__prp_complete_stats_request__init(complete_stats);
protocol__flex_complete_stats_request__init(complete_stats);
complete_stats->report_frequency = report_config->report_frequency;
complete_stats->has_report_frequency = 1;
complete_stats->sf = report_config->period;
......@@ -294,13 +294,13 @@ int enb_agent_mac_stats_request(mid_t mod_id,
}
stats_request_msg->complete_stats_request = complete_stats;
break;
case PROTOCOL__PRP_STATS_TYPE__PRST_CELL_STATS:
stats_request_msg->body_case = PROTOCOL__PRP_STATS_REQUEST__BODY_CELL_STATS_REQUEST;
Protocol__PrpCellStatsRequest *cell_stats;
cell_stats = malloc(sizeof(Protocol__PrpCellStatsRequest));
case PROTOCOL__FLEX_STATS_TYPE__FLST_CELL_STATS:
stats_request_msg->body_case = PROTOCOL__FLEX_STATS_REQUEST__BODY_CELL_STATS_REQUEST;
Protocol__FlexCellStatsRequest *cell_stats;
cell_stats = malloc(sizeof(Protocol__FlexCellStatsRequest));
if(cell_stats == NULL)
goto error;
protocol__prp_cell_stats_request__init(cell_stats);
protocol__flex_cell_stats_request__init(cell_stats);
cell_stats->n_cell = report_config->config->nr_cc;
cell_stats->has_flags = 1;
if (cell_stats->n_cell > 0) {
......@@ -314,13 +314,13 @@ int enb_agent_mac_stats_request(mid_t mod_id,
}
stats_request_msg->cell_stats_request = cell_stats;
break;
case PROTOCOL__PRP_STATS_TYPE__PRST_UE_STATS:
stats_request_msg->body_case = PROTOCOL__PRP_STATS_REQUEST__BODY_UE_STATS_REQUEST;
Protocol__PrpUeStatsRequest *ue_stats;
ue_stats = malloc(sizeof(Protocol__PrpUeStatsRequest));
case PROTOCOL__FLEX_STATS_TYPE__FLST_UE_STATS:
stats_request_msg->body_case = PROTOCOL__FLEX_STATS_REQUEST__BODY_UE_STATS_REQUEST;
Protocol__FlexUeStatsRequest *ue_stats;
ue_stats = malloc(sizeof(Protocol__FlexUeStatsRequest));
if(ue_stats == NULL)
goto error;
protocol__prp_ue_stats_request__init(ue_stats);
protocol__flex_ue_stats_request__init(ue_stats);
ue_stats->n_rnti = report_config->config->nr_ue;
ue_stats->has_flags = 1;
if (ue_stats->n_rnti > 0) {
......@@ -337,12 +337,12 @@ int enb_agent_mac_stats_request(mid_t mod_id,
default:
goto error;
}
*msg = malloc(sizeof(Protocol__ProgranMessage));
*msg = malloc(sizeof(Protocol__FlexranMessage));
if(*msg == NULL)
goto error;
protocol__progran_message__init(*msg);
(*msg)->msg_case = PROTOCOL__PROGRAN_MESSAGE__MSG_STATS_REQUEST_MSG;
(*msg)->msg_dir = PROTOCOL__PROGRAN_DIRECTION__INITIATING_MESSAGE;
protocol__flexran_message__init(*msg);
(*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_STATS_REQUEST_MSG;
(*msg)->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__INITIATING_MESSAGE;
(*msg)->stats_request_msg = stats_request_msg;
return 0;
......@@ -358,14 +358,14 @@ int enb_agent_mac_stats_request(mid_t mod_id,
return -1;
}
int enb_agent_mac_destroy_stats_request(Protocol__ProgranMessage *msg) {
if(msg->msg_case != PROTOCOL__PROGRAN_MESSAGE__MSG_STATS_REQUEST_MSG)
int enb_agent_mac_destroy_stats_request(Protocol__FlexranMessage *msg) {
if(msg->msg_case != PROTOCOL__FLEXRAN_MESSAGE__MSG_STATS_REQUEST_MSG)
goto error;
free(msg->stats_request_msg->header);
if (msg->stats_request_msg->body_case == PROTOCOL__PRP_STATS_REQUEST__BODY_CELL_STATS_REQUEST) {
if (msg->stats_request_msg->body_case == PROTOCOL__FLEX_STATS_REQUEST__BODY_CELL_STATS_REQUEST) {
free(msg->stats_request_msg->cell_stats_request->cell);
}
if (msg->stats_request_msg->body_case == PROTOCOL__PRP_STATS_REQUEST__BODY_UE_STATS_REQUEST) {
if (msg->stats_request_msg->body_case == PROTOCOL__FLEX_STATS_REQUEST__BODY_UE_STATS_REQUEST) {
free(msg->stats_request_msg->ue_stats_request->rnti);
}
free(msg->stats_request_msg);
......@@ -380,8 +380,8 @@ int enb_agent_mac_destroy_stats_request(Protocol__ProgranMessage *msg) {
int enb_agent_mac_stats_reply(mid_t mod_id,
xid_t xid,
const report_config_t *report_config,
Protocol__ProgranMessage **msg) {
Protocol__PrpHeader *header;
Protocol__FlexranMessage **msg) {
Protocol__FlexHeader *header;
int i, j, k;
int cc_id = 0;
int enb_id = mod_id;
......@@ -389,31 +389,31 @@ int enb_agent_mac_stats_reply(mid_t mod_id,
//UE_list_t *eNB_UE_list= &eNB->UE_list;
if (prp_create_header(xid, PROTOCOL__PRP_TYPE__PRPT_STATS_REPLY, &header) != 0)
if (flex_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_STATS_REPLY, &header) != 0)
goto error;
Protocol__PrpStatsReply *stats_reply_msg;
stats_reply_msg = malloc(sizeof(Protocol__PrpStatsReply));
Protocol__FlexStatsReply *stats_reply_msg;
stats_reply_msg = malloc(sizeof(Protocol__FlexStatsReply));
if (stats_reply_msg == NULL)
goto error;
protocol__prp_stats_reply__init(stats_reply_msg);
protocol__flex_stats_reply__init(stats_reply_msg);
stats_reply_msg->header = header;
stats_reply_msg->n_ue_report = report_config->nr_ue;
stats_reply_msg->n_cell_report = report_config->nr_cc;
Protocol__PrpUeStatsReport **ue_report;
Protocol__PrpCellStatsReport **cell_report;
Protocol__FlexUeStatsReport **ue_report;
Protocol__FlexCellStatsReport **cell_report;
/* Allocate memory for list of UE reports */
if (report_config->nr_ue > 0) {
ue_report = malloc(sizeof(Protocol__PrpUeStatsReport *) * report_config->nr_ue);
ue_report = malloc(sizeof(Protocol__FlexUeStatsReport *) * report_config->nr_ue);
if (ue_report == NULL)
goto error;
for (i = 0; i < report_config->nr_ue; i++) {
ue_report[i] = malloc(sizeof(Protocol__PrpUeStatsReport));
protocol__prp_ue_stats_report__init(ue_report[i]);
ue_report[i] = malloc(sizeof(Protocol__FlexUeStatsReport));
protocol__flex_ue_stats_report__init(ue_report[i]);
ue_report[i]->rnti = report_config->ue_report_type[i].ue_rnti;
ue_report[i]->has_rnti = 1;
ue_report[i]->flags = report_config->ue_report_type[i].ue_report_flags;
......@@ -421,9 +421,9 @@ int enb_agent_mac_stats_reply(mid_t mod_id,
/* Check the types of reports that need to be constructed based on flag values */
/* Check flag for creation of buffer status report */
if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__PRP_UE_STATS_TYPE__PRUST_BSR) {
//TODO: Create a report for each LCG (4 elements). See prp_ue_stats_report of
// progRAN specifications for more details
if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_BSR) {
//TODO: Create a report for each LCG (4 elements). See flex_ue_stats_report of
// FlexRAN specifications for more details
ue_report[i]->n_bsr = 4;
uint32_t *elem;
elem = (uint32_t *) malloc(sizeof(uint32_t)*ue_report[i]->n_bsr);
......@@ -438,28 +438,28 @@ int enb_agent_mac_stats_reply(mid_t mod_id,
}
/* Check flag for creation of PRH report */
if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__PRP_UE_STATS_TYPE__PRUST_PRH) {
if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_PRH) {
// TODO: Fill in the actual power headroom value for the RNTI
ue_report[i]->phr = get_ue_phr (enb_id, i); // eNB_UE_list->UE_template[UE_PCCID(enb_id,i)][i].phr_info;
ue_report[i]->has_phr = 1;
}
/* Check flag for creation of RLC buffer status report */
if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__PRP_UE_STATS_TYPE__PRUST_RLC_BS) {
if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_RLC_BS) {
// TODO: Fill in the actual RLC buffer status reports
ue_report[i]->n_rlc_report = 3; // Set this to the number of LCs for this UE
Protocol__PrpRlcBsr ** rlc_reports;
rlc_reports = malloc(sizeof(Protocol__PrpRlcBsr *) * ue_report[i]->n_rlc_report);
Protocol__FlexRlcBsr ** rlc_reports;
rlc_reports = malloc(sizeof(Protocol__FlexRlcBsr *) * ue_report[i]->n_rlc_report);
if (rlc_reports == NULL)
goto error;
// Fill the buffer status report for each logical channel of the UE
// NN: see LAYER2/openair2_proc.c for rlc status
for (j = 0; j < ue_report[i]->n_rlc_report; j++) {
rlc_reports[j] = malloc(sizeof(Protocol__PrpRlcBsr));
rlc_reports[j] = malloc(sizeof(Protocol__FlexRlcBsr));
if (rlc_reports[j] == NULL)
goto error;
protocol__prp_rlc_bsr__init(rlc_reports[j]);
protocol__flex_rlc_bsr__init(rlc_reports[j]);
//TODO:Set logical channel id
rlc_reports[j]->lc_id = j+1;
rlc_reports[j]->has_lc_id = 1;
......@@ -485,38 +485,38 @@ int enb_agent_mac_stats_reply(mid_t mod_id,
}
/* Check flag for creation of MAC CE buffer status report */
if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__PRP_UE_STATS_TYPE__PRUST_MAC_CE_BS) {
if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_MAC_CE_BS) {
// TODO: Fill in the actual MAC CE buffer status report
ue_report[i]->pending_mac_ces = (get_MAC_CE_bitmap_TA(enb_id,i,0) | (0 << 1) | (0 << 2) | (0 << 3)) & 15; /* Use as bitmap. Set one or more of the; /* Use as bitmap. Set one or more of the
PROTOCOL__PRP_CE_TYPE__PRPCET_ values
PROTOCOL__FLEX_CE_TYPE__FLPCET_ values
found in stats_common.pb-c.h. See
prp_ce_type in progRAN specification */
flex_ce_type in FlexRAN specification */
ue_report[i]->has_pending_mac_ces = 1;
}
/* Check flag for creation of DL CQI report */
if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__PRP_UE_STATS_TYPE__PRUST_DL_CQI) {
if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_DL_CQI) {
// TODO: Fill in the actual DL CQI report for the UE based on its configuration
Protocol__PrpDlCqiReport * dl_report;
dl_report = malloc(sizeof(Protocol__PrpDlCqiReport));
Protocol__FlexDlCqiReport * dl_report;
dl_report = malloc(sizeof(Protocol__FlexDlCqiReport));
if (dl_report == NULL)
goto error;
protocol__prp_dl_cqi_report__init(dl_report);
protocol__flex_dl_cqi_report__init(dl_report);
//TODO:Set the SFN and SF of the last report held in the agent.
dl_report->sfn_sn = get_sfn_sf(enb_id);
dl_report->has_sfn_sn = 1;
//TODO:Set the number of DL CQI reports for this UE. One for each CC
dl_report->n_csi_report = get_active_CC(enb_id,i);
//TODO:Create the actual CSI reports.
Protocol__PrpDlCsi **csi_reports;
csi_reports = malloc(sizeof(Protocol__PrpDlCsi *)*dl_report->n_csi_report);
Protocol__FlexDlCsi **csi_reports;
csi_reports = malloc(sizeof(Protocol__FlexDlCsi *)*dl_report->n_csi_report);
if (csi_reports == NULL)
goto error;
for (j = 0; j < dl_report->n_csi_report; j++) {
csi_reports[j] = malloc(sizeof(Protocol__PrpDlCsi));
csi_reports[j] = malloc(sizeof(Protocol__FlexDlCsi));
if (csi_reports[j] == NULL)
goto error;
protocol__prp_dl_csi__init(csi_reports[j]);
protocol__flex_dl_csi__init(csi_reports[j]);
//TODO: the servCellIndex for this report
csi_reports[j]->serv_cell_index = j;
csi_reports[j]->has_serv_cell_index = 1;
......@@ -526,16 +526,16 @@ int enb_agent_mac_stats_reply(mid_t mod_id,
//TODO: the type of CSI report based on the configuration of the UE
//For this example we use type P10, which only needs a wideband value
//The full set of types can be found in stats_common.pb-c.h and
//in the progRAN specifications
csi_reports[j]->type = PROTOCOL__PRP_CSI_TYPE__PRCSIT_P10;
//in the FlexRAN specifications
csi_reports[j]->type = PROTOCOL__FLEX_CSI_TYPE__FLCSIT_P10;
csi_reports[j]->has_type = 1;
csi_reports[j]->report_case = PROTOCOL__PRP_DL_CSI__REPORT_P10CSI;
if(csi_reports[j]->report_case == PROTOCOL__PRP_DL_CSI__REPORT_P10CSI){
Protocol__PrpCsiP10 *csi10;
csi10 = malloc(sizeof(Protocol__PrpCsiP10));
csi_reports[j]->report_case = PROTOCOL__FLEX_DL_CSI__REPORT_P10CSI;
if(csi_reports[j]->report_case == PROTOCOL__FLEX_DL_CSI__REPORT_P10CSI){
Protocol__FlexCsiP10 *csi10;
csi10 = malloc(sizeof(Protocol__FlexCsiP10));
if (csi10 == NULL)
goto error;
protocol__prp_csi_p10__init(csi10);
protocol__flex_csi_p10__init(csi10);
//TODO: set the wideband value
// NN: this is also depends on cc_id
csi10->wb_cqi = get_ue_wcqi (enb_id, i); //eNB_UE_list->eNB_UE_stats[UE_PCCID(enb_id,i)][i].dl_cqi;
......@@ -543,28 +543,28 @@ int enb_agent_mac_stats_reply(mid_t mod_id,
//Add the type of measurements to the csi report in the proper union type
csi_reports[j]->p10csi = csi10;
}
else if(csi_reports[j]->report_case == PROTOCOL__PRP_DL_CSI__REPORT_P11CSI){
else if(csi_reports[j]->report_case == PROTOCOL__FLEX_DL_CSI__REPORT_P11CSI){
}
else if(csi_reports[j]->report_case == PROTOCOL__PRP_DL_CSI__REPORT_P20CSI){
else if(csi_reports[j]->report_case == PROTOCOL__FLEX_DL_CSI__REPORT_P20CSI){
}
else if(csi_reports[j]->report_case == PROTOCOL__PRP_DL_CSI__REPORT_P21CSI){
else if(csi_reports[j]->report_case == PROTOCOL__FLEX_DL_CSI__REPORT_P21CSI){
}
else if(csi_reports[j]->report_case == PROTOCOL__PRP_DL_CSI__REPORT_A12CSI){
else if(csi_reports[j]->report_case == PROTOCOL__FLEX_DL_CSI__REPORT_A12CSI){
}
else if(csi_reports[j]->report_case == PROTOCOL__PRP_DL_CSI__REPORT_A22CSI){
else if(csi_reports[j]->report_case == PROTOCOL__FLEX_DL_CSI__REPORT_A22CSI){
}
else if(csi_reports[j]->report_case == PROTOCOL__PRP_DL_CSI__REPORT_A20CSI){
else if(csi_reports[j]->report_case == PROTOCOL__FLEX_DL_CSI__REPORT_A20CSI){
}
else if(csi_reports[j]->report_case == PROTOCOL__PRP_DL_CSI__REPORT_A30CSI){
else if(csi_reports[j]->report_case == PROTOCOL__FLEX_DL_CSI__REPORT_A30CSI){
}
else if(csi_reports[j]->report_case == PROTOCOL__PRP_DL_CSI__REPORT_A31CSI){
else if(csi_reports[j]->report_case == PROTOCOL__FLEX_DL_CSI__REPORT_A31CSI){
}
}
......@@ -575,26 +575,26 @@ int enb_agent_mac_stats_reply(mid_t mod_id,
}
/* Check flag for creation of paging buffer status report */
if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__PRP_UE_STATS_TYPE__PRUST_PBS) {
if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_PBS) {
//TODO: Fill in the actual paging buffer status report. For this field to be valid, the RNTI
//set in the report must be a P-RNTI
Protocol__PrpPagingBufferReport *paging_report;
paging_report = malloc(sizeof(Protocol__PrpPagingBufferReport));
Protocol__FlexPagingBufferReport *paging_report;
paging_report = malloc(sizeof(Protocol__FlexPagingBufferReport));
if (paging_report == NULL)
goto error;
protocol__prp_paging_buffer_report__init(paging_report);
protocol__flex_paging_buffer_report__init(paging_report);
//Set the number of pending paging messages
paging_report->n_paging_info = 1;
//Provide a report for each pending paging message
Protocol__PrpPagingInfo **p_info;
p_info = malloc(sizeof(Protocol__PrpPagingInfo *) * paging_report->n_paging_info);
Protocol__FlexPagingInfo **p_info;
p_info = malloc(sizeof(Protocol__FlexPagingInfo *) * paging_report->n_paging_info);
if (p_info == NULL)
goto error;
for (j = 0; j < paging_report->n_paging_info; j++) {
p_info[j] = malloc(sizeof(Protocol__PrpPagingInfo));
p_info[j] = malloc(sizeof(Protocol__FlexPagingInfo));
if(p_info[j] == NULL)
goto error;
protocol__prp_paging_info__init(p_info[j]);
protocol__flex_paging_info__init(p_info[j]);
//TODO: Set paging index. This index is the same that will be used for the scheduling of the
//paging message by the controller
p_info[j]->paging_index = 10;
......@@ -616,35 +616,35 @@ int enb_agent_mac_stats_reply(mid_t mod_id,
}
/* Check flag for creation of UL CQI report */
if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__PRP_UE_STATS_TYPE__PRUST_UL_CQI) {
if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_UL_CQI) {
//Fill in the full UL CQI report of the UE
Protocol__PrpUlCqiReport *full_ul_report;
full_ul_report = malloc(sizeof(Protocol__PrpUlCqiReport));
Protocol__FlexUlCqiReport *full_ul_report;
full_ul_report = malloc(sizeof(Protocol__FlexUlCqiReport));
if(full_ul_report == NULL)
goto error;
protocol__prp_ul_cqi_report__init(full_ul_report);
protocol__flex_ul_cqi_report__init(full_ul_report);
//TODO:Set the SFN and SF of the generated report
full_ul_report->sfn_sn = get_sfn_sf(enb_id);
full_ul_report->has_sfn_sn = 1;
//TODO:Set the number of UL measurement reports based on the types of measurements
//configured for this UE and on the servCellIndex
full_ul_report->n_cqi_meas = 1;
Protocol__PrpUlCqi **ul_report;
ul_report = malloc(sizeof(Protocol__PrpUlCqi *) * full_ul_report->n_cqi_meas);
Protocol__FlexUlCqi **ul_report;
ul_report = malloc(sizeof(Protocol__FlexUlCqi *) * full_ul_report->n_cqi_meas);
if(ul_report == NULL)
goto error;
//Fill each UL report of the UE for each of the configured report types
for(j = 0; j < full_ul_report->n_cqi_meas; j++) {
ul_report[j] = malloc(sizeof(Protocol__PrpUlCqi));
ul_report[j] = malloc(sizeof(Protocol__FlexUlCqi));
if(ul_report[j] == NULL)
goto error;
protocol__prp_ul_cqi__init(ul_report[j]);
protocol__flex_ul_cqi__init(ul_report[j]);
//TODO: Set the type of the UL report. As an example set it to SRS UL report
// See enum prp_ul_cqi_type in progRAN specification for more details
ul_report[j]->type = PROTOCOL__PRP_UL_CQI_TYPE__PRUCT_SRS;
// See enum flex_ul_cqi_type in FlexRAN specification for more details
ul_report[j]->type = PROTOCOL__FLEX_UL_CQI_TYPE__FLUCT_SRS;
ul_report[j]->has_type = 1;
//TODO:Set the number of SINR measurements based on the report type
//See struct prp_ul_cqi in progRAN specification for more details
//See struct flex_ul_cqi in FlexRAN specification for more details
ul_report[j]->n_sinr = 100;
uint32_t *sinr_meas;
sinr_meas = (uint32_t *) malloc(sizeof(uint32_t) * ul_report[j]->n_sinr);
......@@ -663,11 +663,11 @@ int enb_agent_mac_stats_reply(mid_t mod_id,
full_ul_report->cqi_meas = ul_report;
full_ul_report->n_pucch_dbm = MAX_NUM_CCs;
full_ul_report->pucch_dbm = malloc(sizeof(Protocol__PrpPucchDbm *) * full_ul_report->n_pucch_dbm);
full_ul_report->pucch_dbm = malloc(sizeof(Protocol__FlexPucchDbm *) * full_ul_report->n_pucch_dbm);
for (j = 0; j < MAX_NUM_CCs; j++) {
full_ul_report->pucch_dbm[j] = malloc(sizeof(Protocol__PrpPucchDbm));
protocol__prp_pucch_dbm__init(full_ul_report->pucch_dbm[j]);
full_ul_report->pucch_dbm[j] = malloc(sizeof(Protocol__FlexPucchDbm));
protocol__flex_pucch_dbm__init(full_ul_report->pucch_dbm[j]);
full_ul_report->pucch_dbm[j]->has_serv_cell_index = 1;
full_ul_report->pucch_dbm[j]->serv_cell_index = j;
if(get_p0_pucch_dbm(enb_id,i, j) != -1){
......@@ -687,28 +687,28 @@ int enb_agent_mac_stats_reply(mid_t mod_id,
/* Allocate memory for list of cell reports */
if (report_config->nr_cc > 0) {
cell_report = malloc(sizeof(Protocol__PrpCellStatsReport *) * report_config->nr_cc);
cell_report = malloc(sizeof(Protocol__FlexCellStatsReport *) * report_config->nr_cc);
if (cell_report == NULL)
goto error;
// Fill in the Cell reports
for (i = 0; i < report_config->nr_cc; i++) {
cell_report[i] = malloc(sizeof(Protocol__PrpCellStatsReport));
cell_report[i] = malloc(sizeof(Protocol__FlexCellStatsReport));
if(cell_report[i] == NULL)
goto error;
protocol__prp_cell_stats_report__init(cell_report[i]);
protocol__flex_cell_stats_report__init(cell_report[i]);
cell_report[i]->carrier_index = report_config->cc_report_type[i].cc_id;
cell_report[i]->has_carrier_index = 1;
cell_report[i]->flags = report_config->cc_report_type[i].cc_report_flags;
cell_report[i]->has_flags = 1;
/* Check flag for creation of noise and interference report */
if(report_config->cc_report_type[i].cc_report_flags & PROTOCOL__PRP_CELL_STATS_TYPE__PRCST_NOISE_INTERFERENCE) {
if(report_config->cc_report_type[i].cc_report_flags & PROTOCOL__FLEX_CELL_STATS_TYPE__FLCST_NOISE_INTERFERENCE) {
// TODO: Fill in the actual noise and interference report for this cell
Protocol__PrpNoiseInterferenceReport *ni_report;
ni_report = malloc(sizeof(Protocol__PrpNoiseInterferenceReport));
Protocol__FlexNoiseInterferenceReport *ni_report;
ni_report = malloc(sizeof(Protocol__FlexNoiseInterferenceReport));
if(ni_report == NULL)
goto error;
protocol__prp_noise_interference_report__init(ni_report);
protocol__flex_noise_interference_report__init(ni_report);
// Current frame and subframe number
ni_report->sfn_sf = get_sfn_sf(enb_id);
ni_report->has_sfn_sf = 1;
......@@ -728,12 +728,12 @@ int enb_agent_mac_stats_reply(mid_t mod_id,
stats_reply_msg->cell_report = cell_report;
}
*msg = malloc(sizeof(Protocol__ProgranMessage));
*msg = malloc(sizeof(Protocol__FlexranMessage));
if(*msg == NULL)
goto error;
protocol__progran_message__init(*msg);
(*msg)->msg_case = PROTOCOL__PROGRAN_MESSAGE__MSG_STATS_REPLY_MSG;
(*msg)->msg_dir = PROTOCOL__PROGRAN_DIRECTION__SUCCESSFUL_OUTCOME;
protocol__flexran_message__init(*msg);
(*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_STATS_REPLY_MSG;
(*msg)->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__SUCCESSFUL_OUTCOME;
(*msg)->stats_reply_msg = stats_reply_msg;
return 0;
......@@ -749,17 +749,17 @@ int enb_agent_mac_stats_reply(mid_t mod_id,
return -1;
}
int enb_agent_mac_destroy_stats_reply(Protocol__ProgranMessage *msg) {
int enb_agent_mac_destroy_stats_reply(Protocol__FlexranMessage *msg) {
//TODO: Need to deallocate memory for the stats reply message
if(msg->msg_case != PROTOCOL__PROGRAN_MESSAGE__MSG_STATS_REPLY_MSG)
if(msg->msg_case != PROTOCOL__FLEXRAN_MESSAGE__MSG_STATS_REPLY_MSG)
goto error;
free(msg->stats_reply_msg->header);
int i, j, k;
Protocol__PrpStatsReply *reply = msg->stats_reply_msg;
Protocol__PrpDlCqiReport *dl_report;
Protocol__PrpUlCqiReport *ul_report;
Protocol__PrpPagingBufferReport *paging_report;
Protocol__FlexStatsReply *reply = msg->stats_reply_msg;
Protocol__FlexDlCqiReport *dl_report;
Protocol__FlexUlCqiReport *ul_report;
Protocol__FlexPagingBufferReport *paging_report;
// Free the memory for the UE reports
for (i = 0; i < reply->n_ue_report; i++) {
......@@ -769,47 +769,47 @@ int enb_agent_mac_destroy_stats_reply(Protocol__ProgranMessage *msg) {
}
free(reply->ue_report[i]->rlc_report);
// If DL CQI report flag was set
if (reply->ue_report[i]->flags & PROTOCOL__PRP_UE_STATS_TYPE__PRUST_DL_CQI) {
if (reply->ue_report[i]->flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_DL_CQI) {
dl_report = reply->ue_report[i]->dl_cqi_report;
// Delete all CSI reports
for (j = 0; j < dl_report->n_csi_report; j++) {
//Must free memory based on the type of report
switch(dl_report->csi_report[j]->report_case) {
case PROTOCOL__PRP_DL_CSI__REPORT_P10CSI:
case PROTOCOL__FLEX_DL_CSI__REPORT_P10CSI:
free(dl_report->csi_report[j]->p10csi);
break;
case PROTOCOL__PRP_DL_CSI__REPORT_P11CSI:
case PROTOCOL__FLEX_DL_CSI__REPORT_P11CSI:
free(dl_report->csi_report[j]->p11csi->wb_cqi);
free(dl_report->csi_report[j]->p11csi);
break;
case PROTOCOL__PRP_DL_CSI__REPORT_P20CSI:
case PROTOCOL__FLEX_DL_CSI__REPORT_P20CSI:
free(dl_report->csi_report[j]->p20csi);
break;
case PROTOCOL__PRP_DL_CSI__REPORT_P21CSI:
case PROTOCOL__FLEX_DL_CSI__REPORT_P21CSI:
free(dl_report->csi_report[j]->p21csi->wb_cqi);
free(dl_report->csi_report[j]->p21csi->sb_cqi);
free(dl_report->csi_report[j]->p21csi);
break;
case PROTOCOL__PRP_DL_CSI__REPORT_A12CSI:
case PROTOCOL__FLEX_DL_CSI__REPORT_A12CSI:
free(dl_report->csi_report[j]->a12csi->wb_cqi);
free(dl_report->csi_report[j]->a12csi->sb_pmi);
free(dl_report->csi_report[j]->a12csi);
break;
case PROTOCOL__PRP_DL_CSI__REPORT_A22CSI:
case PROTOCOL__FLEX_DL_CSI__REPORT_A22CSI:
free(dl_report->csi_report[j]->a22csi->wb_cqi);
free(dl_report->csi_report[j]->a22csi->sb_cqi);
free(dl_report->csi_report[j]->a22csi->sb_list);
free(dl_report->csi_report[j]->a22csi);
break;
case PROTOCOL__PRP_DL_CSI__REPORT_A20CSI:
case PROTOCOL__FLEX_DL_CSI__REPORT_A20CSI:
free(dl_report->csi_report[j]->a20csi->sb_list);
free(dl_report->csi_report[j]->a20csi);
break;
case PROTOCOL__PRP_DL_CSI__REPORT_A30CSI:
case PROTOCOL__FLEX_DL_CSI__REPORT_A30CSI:
free(dl_report->csi_report[j]->a30csi->sb_cqi);
free(dl_report->csi_report[j]->a30csi);
break;
case PROTOCOL__PRP_DL_CSI__REPORT_A31CSI:
case PROTOCOL__FLEX_DL_CSI__REPORT_A31CSI:
free(dl_report->csi_report[j]->a31csi->wb_cqi);
for (k = 0; k < dl_report->csi_report[j]->a31csi->n_sb_cqi; k++) {
free(dl_report->csi_report[j]->a31csi->sb_cqi[k]);
......@@ -824,7 +824,7 @@ int enb_agent_mac_destroy_stats_reply(Protocol__ProgranMessage *msg) {
free(dl_report);
}
// If Paging buffer report flag was set
if (reply->ue_report[i]->flags & PROTOCOL__PRP_UE_STATS_TYPE__PRUST_PBS) {
if (reply->ue_report[i]->flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_PBS) {
paging_report = reply->ue_report[i]->pbr;
// Delete all paging buffer reports
for (j = 0; j < paging_report->n_paging_info; j++) {
......@@ -834,7 +834,7 @@ int enb_agent_mac_destroy_stats_reply(Protocol__ProgranMessage *msg) {
free(paging_report);
}
// If UL CQI report flag was set
if (reply->ue_report[i]->flags & PROTOCOL__PRP_UE_STATS_TYPE__PRUST_UL_CQI) {
if (reply->ue_report[i]->flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_UL_CQI) {
ul_report = reply->ue_report[i]->ul_cqi_report;
for (j = 0; j < ul_report->n_cqi_meas; j++) {
free(ul_report->cqi_meas[j]->sinr);
......@@ -866,19 +866,19 @@ int enb_agent_mac_destroy_stats_reply(Protocol__ProgranMessage *msg) {
return -1;
}
int enb_agent_mac_sr_info(mid_t mod_id, const void *params, Protocol__ProgranMessage **msg) {
Protocol__PrpHeader *header;
int enb_agent_mac_sr_info(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg) {
Protocol__FlexHeader *header;
int i;
const int xid = *((int *)params);
if (prp_create_header(xid, PROTOCOL__PRP_TYPE__PRPT_UL_SR_INFO, &header) != 0)
if (flex_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_UL_SR_INFO, &header) != 0)
goto error;
Protocol__PrpUlSrInfo *ul_sr_info_msg;
ul_sr_info_msg = malloc(sizeof(Protocol__PrpUlSrInfo));
Protocol__FlexUlSrInfo *ul_sr_info_msg;
ul_sr_info_msg = malloc(sizeof(Protocol__FlexUlSrInfo));
if (ul_sr_info_msg == NULL) {
goto error;
}
protocol__prp_ul_sr_info__init(ul_sr_info_msg);
protocol__flex_ul_sr_info__init(ul_sr_info_msg);
ul_sr_info_msg->header = header;
ul_sr_info_msg->has_sfn_sf = 1;
......@@ -895,12 +895,12 @@ int enb_agent_mac_sr_info(mid_t mod_id, const void *params, Protocol__ProgranMes
ul_sr_info_msg->rnti[i] = 1;
}
*msg = malloc(sizeof(Protocol__ProgranMessage));
*msg = malloc(sizeof(Protocol__FlexranMessage));
if(*msg == NULL)
goto error;
protocol__progran_message__init(*msg);
(*msg)->msg_case = PROTOCOL__PROGRAN_MESSAGE__MSG_UL_SR_INFO_MSG;
(*msg)->msg_dir = PROTOCOL__PROGRAN_DIRECTION__INITIATING_MESSAGE;
protocol__flexran_message__init(*msg);
(*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_UL_SR_INFO_MSG;
(*msg)->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__INITIATING_MESSAGE;
(*msg)->ul_sr_info_msg = ul_sr_info_msg;
return 0;
......@@ -918,8 +918,8 @@ int enb_agent_mac_sr_info(mid_t mod_id, const void *params, Protocol__ProgranMes
return -1;
}
int enb_agent_mac_destroy_sr_info(Protocol__ProgranMessage *msg) {
if(msg->msg_case != PROTOCOL__PROGRAN_MESSAGE__MSG_UL_SR_INFO_MSG)
int enb_agent_mac_destroy_sr_info(Protocol__FlexranMessage *msg) {
if(msg->msg_case != PROTOCOL__FLEXRAN_MESSAGE__MSG_UL_SR_INFO_MSG)
goto error;
free(msg->ul_sr_info_msg->header);
......@@ -933,19 +933,19 @@ int enb_agent_mac_destroy_sr_info(Protocol__ProgranMessage *msg) {
return -1;
}
int enb_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__ProgranMessage **msg) {
Protocol__PrpHeader *header;
int enb_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg) {
Protocol__FlexHeader *header;
int i,j;
const int xid = *((int *)params);
if (prp_create_header(xid, PROTOCOL__PRP_TYPE__PRPT_SF_TRIGGER, &header) != 0)
if (flex_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_SF_TRIGGER, &header) != 0)
goto error;
Protocol__PrpSfTrigger *sf_trigger_msg;
sf_trigger_msg = malloc(sizeof(Protocol__PrpSfTrigger));
Protocol__FlexSfTrigger *sf_trigger_msg;
sf_trigger_msg = malloc(sizeof(Protocol__FlexSfTrigger));
if (sf_trigger_msg == NULL) {
goto error;
}
protocol__prp_sf_trigger__init(sf_trigger_msg);
protocol__flex_sf_trigger__init(sf_trigger_msg);
frame_t frame;
sub_frame_t subframe;
......@@ -974,18 +974,18 @@ int enb_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Progran
*/
sf_trigger_msg->n_dl_info = get_num_ues(mod_id);
Protocol__PrpDlInfo **dl_info = NULL;
Protocol__FlexDlInfo **dl_info = NULL;
if (sf_trigger_msg->n_dl_info > 0) {
dl_info = malloc(sizeof(Protocol__PrpDlInfo *) * sf_trigger_msg->n_dl_info);
dl_info = malloc(sizeof(Protocol__FlexDlInfo *) * sf_trigger_msg->n_dl_info);
if(dl_info == NULL)
goto error;
//Fill the status of the current HARQ process for each UE
for(i = 0; i < sf_trigger_msg->n_dl_info; i++) {
dl_info[i] = malloc(sizeof(Protocol__PrpDlInfo));
dl_info[i] = malloc(sizeof(Protocol__FlexDlInfo));
if(dl_info[i] == NULL)
goto error;
protocol__prp_dl_info__init(dl_info[i]);
protocol__flex_dl_info__init(dl_info[i]);
dl_info[i]->rnti = get_ue_crnti(mod_id, i);
dl_info[i]->has_rnti = 1;
/*TODO: fill in the right id of this round's HARQ process for this UE*/
......@@ -1000,9 +1000,9 @@ int enb_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Progran
for (j = 0; j < dl_info[i]->n_harq_status; j++) {
// TODO: This should be different per TB
if(harq_status == 0)
dl_info[i]->harq_status[j] = PROTOCOL__PRP_HARQ_STATUS__PRHS_ACK;
dl_info[i]->harq_status[j] = PROTOCOL__FLEX_HARQ_STATUS__FLHS_ACK;
else if (harq_status == 1)
dl_info[i]->harq_status[j] = PROTOCOL__PRP_HARQ_STATUS__PRHS_NACK;
dl_info[i]->harq_status[j] = PROTOCOL__FLEX_HARQ_STATUS__FLHS_NACK;
}
/*TODO: fill in the serving cell index for this UE */
dl_info[i]->serv_cell_index = UE_PCCID(mod_id,i);
......@@ -1017,18 +1017,18 @@ int enb_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Progran
*/
sf_trigger_msg->n_ul_info = get_num_ues(mod_id);
Protocol__PrpUlInfo **ul_info = NULL;
Protocol__FlexUlInfo **ul_info = NULL;
if (sf_trigger_msg->n_ul_info > 0) {
ul_info = malloc(sizeof(Protocol__PrpUlInfo *) * sf_trigger_msg->n_ul_info);
ul_info = malloc(sizeof(Protocol__FlexUlInfo *) * sf_trigger_msg->n_ul_info);
if(ul_info == NULL)
goto error;
//Fill the reception info for each transmitting UE
for(i = 0; i < sf_trigger_msg->n_ul_info; i++) {
ul_info[i] = malloc(sizeof(Protocol__PrpUlInfo));
ul_info[i] = malloc(sizeof(Protocol__FlexUlInfo));
if(ul_info[i] == NULL)
goto error;
protocol__prp_ul_info__init(ul_info[i]);
protocol__flex_ul_info__init(ul_info[i]);
ul_info[i]->rnti = get_ue_crnti(mod_id, i);
ul_info[i]->has_rnti = 1;
/*TODO: fill in the Tx power control command for this UE (if available)*/
......@@ -1048,7 +1048,7 @@ int enb_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Progran
ul_info[i]->ul_reception[j] = 100;
}
/*TODO: Fill in the reception status for each UEs data*/
ul_info[i]->reception_status = PROTOCOL__PRP_RECEPTION_STATUS__PRRS_OK;
ul_info[i]->reception_status = PROTOCOL__FLEX_RECEPTION_STATUS__FLRS_OK;
ul_info[i]->has_reception_status = 1;
/*TODO: fill in the serving cell index for this UE */
ul_info[i]->serv_cell_index = UE_PCCID(mod_id,i);
......@@ -1058,12 +1058,12 @@ int enb_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Progran
sf_trigger_msg->ul_info = ul_info;
*msg = malloc(sizeof(Protocol__ProgranMessage));
*msg = malloc(sizeof(Protocol__FlexranMessage));
if(*msg == NULL)
goto error;
protocol__progran_message__init(*msg);
(*msg)->msg_case = PROTOCOL__PROGRAN_MESSAGE__MSG_SF_TRIGGER_MSG;
(*msg)->msg_dir = PROTOCOL__PROGRAN_DIRECTION__INITIATING_MESSAGE;
protocol__flexran_message__init(*msg);
(*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_SF_TRIGGER_MSG;
(*msg)->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__INITIATING_MESSAGE;
(*msg)->sf_trigger_msg = sf_trigger_msg;
return 0;
......@@ -1087,9 +1087,9 @@ int enb_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Progran
return -1;
}
int enb_agent_mac_destroy_sf_trigger(Protocol__ProgranMessage *msg) {
int enb_agent_mac_destroy_sf_trigger(Protocol__FlexranMessage *msg) {
int i;
if(msg->msg_case != PROTOCOL__PROGRAN_MESSAGE__MSG_SF_TRIGGER_MSG)
if(msg->msg_case != PROTOCOL__FLEXRAN_MESSAGE__MSG_SF_TRIGGER_MSG)
goto error;
free(msg->sf_trigger_msg->header);
......@@ -1113,30 +1113,30 @@ int enb_agent_mac_destroy_sf_trigger(Protocol__ProgranMessage *msg) {
return -1;
}
int enb_agent_mac_create_empty_dl_config(mid_t mod_id, Protocol__ProgranMessage **msg) {
int enb_agent_mac_create_empty_dl_config(mid_t mod_id, Protocol__FlexranMessage **msg) {
int xid = 0;
Protocol__PrpHeader *header;
if (prp_create_header(xid, PROTOCOL__PRP_TYPE__PRPT_DL_MAC_CONFIG, &header) != 0)
Protocol__FlexHeader *header;
if (flex_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_DL_MAC_CONFIG, &header) != 0)
goto error;
Protocol__PrpDlMacConfig *dl_mac_config_msg;
dl_mac_config_msg = malloc(sizeof(Protocol__PrpDlMacConfig));
Protocol__FlexDlMacConfig *dl_mac_config_msg;
dl_mac_config_msg = malloc(sizeof(Protocol__FlexDlMacConfig));
if (dl_mac_config_msg == NULL) {
goto error;
}
protocol__prp_dl_mac_config__init(dl_mac_config_msg);
protocol__flex_dl_mac_config__init(dl_mac_config_msg);
dl_mac_config_msg->header = header;
dl_mac_config_msg->has_sfn_sf = 1;
dl_mac_config_msg->sfn_sf = get_sfn_sf(mod_id);
*msg = malloc(sizeof(Protocol__ProgranMessage));
*msg = malloc(sizeof(Protocol__FlexranMessage));
if(*msg == NULL)
goto error;
protocol__progran_message__init(*msg);
(*msg)->msg_case = PROTOCOL__PROGRAN_MESSAGE__MSG_DL_MAC_CONFIG_MSG;
(*msg)->msg_dir = PROTOCOL__PROGRAN_DIRECTION__INITIATING_MESSAGE;
protocol__flexran_message__init(*msg);
(*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_DL_MAC_CONFIG_MSG;
(*msg)->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__INITIATING_MESSAGE;
(*msg)->dl_mac_config_msg = dl_mac_config_msg;
return 0;
......@@ -1145,12 +1145,12 @@ int enb_agent_mac_create_empty_dl_config(mid_t mod_id, Protocol__ProgranMessage
return -1;
}
int enb_agent_mac_destroy_dl_config(Protocol__ProgranMessage *msg) {
int enb_agent_mac_destroy_dl_config(Protocol__FlexranMessage *msg) {
int i,j, k;
if(msg->msg_case != PROTOCOL__PROGRAN_MESSAGE__MSG_DL_MAC_CONFIG_MSG)
if(msg->msg_case != PROTOCOL__FLEXRAN_MESSAGE__MSG_DL_MAC_CONFIG_MSG)
goto error;
Protocol__PrpDlDci *dl_dci;
Protocol__FlexDlDci *dl_dci;
free(msg->dl_mac_config_msg->header);
for (i = 0; i < msg->dl_mac_config_msg->n_dl_ue_data; i++) {
......@@ -1208,7 +1208,7 @@ int enb_agent_mac_destroy_dl_config(Protocol__ProgranMessage *msg) {
return -1;
}
void enb_agent_get_pending_dl_mac_config(mid_t mod_id, Protocol__ProgranMessage **msg) {
void enb_agent_get_pending_dl_mac_config(mid_t mod_id, Protocol__FlexranMessage **msg) {
struct lfds700_misc_prng_state ls;
......@@ -1220,11 +1220,11 @@ void enb_agent_get_pending_dl_mac_config(mid_t mod_id, Protocol__ProgranMessage
}
}
int enb_agent_mac_handle_dl_mac_config(mid_t mod_id, const void *params, Protocol__ProgranMessage **msg) {
int enb_agent_mac_handle_dl_mac_config(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg) {
struct lfds700_misc_prng_state ls;
enum lfds700_misc_flag overwrite_occurred_flag;
Protocol__ProgranMessage *overwritten_dl_config;
Protocol__FlexranMessage *overwritten_dl_config;
LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE;
lfds700_misc_prng_init(&ls);
......@@ -1264,7 +1264,7 @@ void enb_agent_init_mac_agent(mid_t mod_id) {
void enb_agent_send_sr_info(mid_t mod_id) {
int size;
Protocol__ProgranMessage *msg;
Protocol__FlexranMessage *msg;
void *data;
int priority;
err_code_t err_code;
......@@ -1281,7 +1281,7 @@ void enb_agent_send_sr_info(mid_t mod_id) {
data=enb_agent_pack_message(msg, &size);
/*Send sr info using the MAC channel of the eNB*/
if (enb_agent_msg_send(mod_id, ENB_AGENT_MAC, data, size, priority)) {
err_code = PROTOCOL__PROGRAN_ERR__MSG_ENQUEUING;
err_code = PROTOCOL__FLEXRAN_ERR__MSG_ENQUEUING;
goto error;
}
......@@ -1294,7 +1294,7 @@ void enb_agent_send_sr_info(mid_t mod_id) {
void enb_agent_send_sf_trigger(mid_t mod_id) {
int size;
Protocol__ProgranMessage *msg;
Protocol__FlexranMessage *msg;
void *data;
int priority;
err_code_t err_code;
......@@ -1311,7 +1311,7 @@ void enb_agent_send_sf_trigger(mid_t mod_id) {
data=enb_agent_pack_message(msg, &size);
/*Send sr info using the MAC channel of the eNB*/
if (enb_agent_msg_send(mod_id, ENB_AGENT_MAC, data, size, priority)) {
err_code = PROTOCOL__PROGRAN_ERR__MSG_ENQUEUING;
err_code = PROTOCOL__FLEXRAN_ERR__MSG_ENQUEUING;
goto error;
}
......@@ -1324,7 +1324,7 @@ void enb_agent_send_sf_trigger(mid_t mod_id) {
void enb_agent_send_update_mac_stats(mid_t mod_id) {
Protocol__ProgranMessage *current_report = NULL, *msg;
Protocol__FlexranMessage *current_report = NULL, *msg;
void *data;
int size;
err_code_t err_code;
......@@ -1352,7 +1352,7 @@ void enb_agent_send_update_mac_stats(mid_t mod_id) {
/* msg = enb_agent_generate_diff_mac_stats_report(current_report, mac_stats_context[mod_id].prev_stats_reply); */
/* /\*Destroy the old stats*\/ */
/* enb_agent_destroy_progran_message(mac_stats_context[mod_id].prev_stats_reply); */
/* enb_agent_destroy_flexran_message(mac_stats_context[mod_id].prev_stats_reply); */
/* } */
/* /\*Use the current report for future comparissons*\/ */
/* mac_stats_context[mod_id].prev_stats_reply = current_report; */
......@@ -1366,7 +1366,7 @@ void enb_agent_send_update_mac_stats(mid_t mod_id) {
data=enb_agent_pack_message(current_report, &size);
/*Send any stats updates using the MAC channel of the eNB*/
if (enb_agent_msg_send(mod_id, ENB_AGENT_MAC, data, size, priority)) {
err_code = PROTOCOL__PROGRAN_ERR__MSG_ENQUEUING;
err_code = PROTOCOL__FLEXRAN_ERR__MSG_ENQUEUING;
goto error;
}
......@@ -1447,8 +1447,8 @@ err_code_t enb_agent_destroy_cont_mac_stats_update(mid_t mod_id) {
/*Disable the continuous updates for the MAC*/
mac_stats_context[mod_id].cont_update = 0;
mac_stats_context[mod_id].is_initialized = 0;
enb_agent_destroy_progran_message(mac_stats_context[mod_id].stats_req);
enb_agent_destroy_progran_message(mac_stats_context[mod_id].prev_stats_reply);
enb_agent_destroy_flexran_message(mac_stats_context[mod_id].stats_req);
enb_agent_destroy_flexran_message(mac_stats_context[mod_id].prev_stats_reply);
free(mac_stats_context[mod_id].mutex);
mac_agent_registered[mod_id] = NULL;
......@@ -1463,7 +1463,7 @@ err_code_t enb_agent_enable_cont_mac_stats_update(mid_t mod_id,
goto error;
}
Protocol__ProgranMessage *req_msg;
Protocol__FlexranMessage *req_msg;
enb_agent_mac_stats_request(mod_id, xid, stats_req, &req_msg);
mac_stats_context[mod_id].stats_req = req_msg;
......@@ -1490,10 +1490,10 @@ err_code_t enb_agent_disable_cont_mac_stats_update(mid_t mod_id) {
mac_stats_context[mod_id].cont_update = 0;
mac_stats_context[mod_id].xid = 0;
if (mac_stats_context[mod_id].stats_req != NULL) {
enb_agent_destroy_progran_message(mac_stats_context[mod_id].stats_req);
enb_agent_destroy_flexran_message(mac_stats_context[mod_id].stats_req);
}
if (mac_stats_context[mod_id].prev_stats_reply != NULL) {
enb_agent_destroy_progran_message(mac_stats_context[mod_id].prev_stats_reply);
enb_agent_destroy_flexran_message(mac_stats_context[mod_id].prev_stats_reply);
}
if (pthread_mutex_unlock(mac_stats_context[mod_id].mutex)) {
goto error;
......
......@@ -29,7 +29,7 @@
/*! \file enb_agent_mac.h
* \brief enb agent message handler APIs for MAC layer
* \author Navid Nikaein and Xenofon Foukas
* \author Xenofon Foukas, Mohamed Kassem and Navid Nikaein
* \date 2016
* \version 0.1
*/
......@@ -38,7 +38,7 @@
#define ENB_AGENT_MAC_H_
#include "header.pb-c.h"
#include "progran.pb-c.h"
#include "flexran.pb-c.h"
#include "stats_messages.pb-c.h"
#include "stats_common.pb-c.h"
......@@ -52,14 +52,14 @@ typedef struct {
uint16_t ue_rnti;
uint32_t ue_report_flags; /* Indicates the report elements
required for this UE id. See
ProgRAN specification 1.2.4.2 */
FlexRAN specification 1.2.4.2 */
} ue_report_type_t;
typedef struct {
uint16_t cc_id;
uint32_t cc_report_flags; /* Indicates the report elements
required for this CC index. See
ProgRAN specification 1.2.4.3 */
FlexRAN specification 1.2.4.3 */
} cc_report_type_t;
typedef struct {
......@@ -79,29 +79,29 @@ typedef struct stats_request_config_s{
/* Initialization function for the agent structures etc */
void enb_agent_init_mac_agent(mid_t mod_id);
int enb_agent_mac_handle_stats(mid_t mod_id, const void *params, Protocol__ProgranMessage **msg);
int enb_agent_mac_handle_stats(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
int enb_agent_mac_stats_request(mid_t mod_id, xid_t xid, const stats_request_config_t *report_config, Protocol__ProgranMessage **msg);
int enb_agent_mac_stats_request(mid_t mod_id, xid_t xid, const stats_request_config_t *report_config, Protocol__FlexranMessage **msg);
int enb_agent_mac_destroy_stats_request(Protocol__ProgranMessage *msg);
int enb_agent_mac_destroy_stats_request(Protocol__FlexranMessage *msg);
int enb_agent_mac_stats_reply(mid_t mod_id, xid_t xid, const report_config_t *report_config, Protocol__ProgranMessage **msg);
int enb_agent_mac_stats_reply(mid_t mod_id, xid_t xid, const report_config_t *report_config, Protocol__FlexranMessage **msg);
int enb_agent_mac_destroy_stats_reply(Protocol__ProgranMessage *msg);
int enb_agent_mac_destroy_stats_reply(Protocol__FlexranMessage *msg);
int enb_agent_mac_sr_info(mid_t mod_id, const void *params, Protocol__ProgranMessage **msg);
int enb_agent_mac_sr_info(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
int enb_agent_mac_destroy_sr_info(Protocol__ProgranMessage *msg);
int enb_agent_mac_destroy_sr_info(Protocol__FlexranMessage *msg);
int enb_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__ProgranMessage **msg);
int enb_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
int enb_agent_mac_destroy_sf_trigger(Protocol__ProgranMessage *msg);
int enb_agent_mac_destroy_sf_trigger(Protocol__FlexranMessage *msg);
int enb_agent_mac_create_empty_dl_config(mid_t mod_id, Protocol__ProgranMessage **msg);
int enb_agent_mac_create_empty_dl_config(mid_t mod_id, Protocol__FlexranMessage **msg);
int enb_agent_mac_destroy_dl_config(Protocol__ProgranMessage *msg);
int enb_agent_mac_destroy_dl_config(Protocol__FlexranMessage *msg);
int enb_agent_mac_handle_dl_mac_config(mid_t mod_id, const void *params, Protocol__ProgranMessage **msg);
int enb_agent_mac_handle_dl_mac_config(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
/**********************************
......@@ -119,7 +119,7 @@ void enb_agent_send_sf_trigger(mid_t mod_id);
void enb_agent_send_update_mac_stats(mid_t mod_id);
/// Provide to the scheduler a pending dl_mac_config message
void enb_agent_get_pending_dl_mac_config(mid_t mod_id, Protocol__ProgranMessage **msg);
void enb_agent_get_pending_dl_mac_config(mid_t mod_id, Protocol__FlexranMessage **msg);
/*Register technology specific interface callbacks*/
int enb_agent_register_mac_xface(mid_t mod_id, AGENT_MAC_xface *xface);
......
......@@ -39,7 +39,7 @@
#define __ENB_AGENT_MAC_PRIMITIVES_H__
#include "enb_agent_defs.h"
#include "progran.pb-c.h"
#include "flexran.pb-c.h"
#include "header.pb-c.h"
#define RINGBUFFER_SIZE 100
......@@ -60,13 +60,13 @@ typedef struct {
/// Provide to the scheduler a pending dl_mac_config message
void (*enb_agent_get_pending_dl_mac_config)(mid_t mod_id,
Protocol__ProgranMessage **msg);
Protocol__FlexranMessage **msg);
/// Run the UE DL scheduler and fill the Protocol__ProgranMessage. Assumes that
/// dl_info is already initialized as prp_dl_mac_config and fills the
/// prp_dl_data part of it
/// Run the UE DL scheduler and fill the Protocol__FlexranMessage. Assumes that
/// dl_info is already initialized as flex_dl_mac_config and fills the
/// flex_dl_data part of it
void (*enb_agent_schedule_ue_spec)(mid_t mod_id, uint32_t frame, uint32_t subframe,
int *mbsfn_flag, Protocol__ProgranMessage **dl_info);
int *mbsfn_flag, Protocol__FlexranMessage **dl_info);
/// Notify the controller for a state change of a particular UE, by sending the proper
......
......@@ -39,20 +39,20 @@
#include "enb_agent_mac_internal.h"
Protocol__ProgranMessage * enb_agent_generate_diff_mac_stats_report(Protocol__ProgranMessage *new_message,
Protocol__ProgranMessage *old_message) {
Protocol__FlexranMessage * enb_agent_generate_diff_mac_stats_report(Protocol__FlexranMessage *new_message,
Protocol__FlexranMessage *old_message) {
int i, j;
Protocol__PrpStatsReply *old_report, *new_report;
Protocol__FlexStatsReply *old_report, *new_report;
Protocol__PrpStatsReply *stats_reply_msg = NULL;
Protocol__ProgranMessage *msg = NULL;
Protocol__FlexStatsReply *stats_reply_msg = NULL;
Protocol__FlexranMessage *msg = NULL;
Protocol__PrpUeStatsReport **ue_report;
Protocol__PrpUeStatsReport *tmp_ue_report[NUM_MAX_UE];
Protocol__PrpCellStatsReport **cell_report;
Protocol__PrpCellStatsReport *tmp_cell_report[NUM_MAX_UE];
Protocol__FlexUeStatsReport **ue_report;
Protocol__FlexUeStatsReport *tmp_ue_report[NUM_MAX_UE];
Protocol__FlexCellStatsReport **cell_report;
Protocol__FlexCellStatsReport *tmp_cell_report[NUM_MAX_UE];
old_report = old_message->stats_reply_msg;
new_report = new_message->stats_reply_msg;
......@@ -113,7 +113,7 @@ Protocol__ProgranMessage * enb_agent_generate_diff_mac_stats_report(Protocol__Pr
/*TODO: create the reply message based on the findings*/
/*Create ue report list*/
if (n_ue_report > 0) {
ue_report = malloc(sizeof(Protocol__PrpUeStatsReport *));
ue_report = malloc(sizeof(Protocol__FlexUeStatsReport *));
for (i = 0; i<n_ue_report; i++) {
ue_report[i] = tmp_ue_report[i];
}
......@@ -121,7 +121,7 @@ Protocol__ProgranMessage * enb_agent_generate_diff_mac_stats_report(Protocol__Pr
/*Create cell report list*/
if (n_cell_report > 0) {
cell_report = malloc(sizeof(Protocol__PrpCellStatsReport *));
cell_report = malloc(sizeof(Protocol__FlexCellStatsReport *));
for (i = 0; i<n_cell_report; i++) {
cell_report[i] = tmp_cell_report[i];
}
......@@ -130,23 +130,23 @@ Protocol__ProgranMessage * enb_agent_generate_diff_mac_stats_report(Protocol__Pr
if (n_cell_report > 0 || n_ue_report > 0) {
/*Create header*/
int xid = old_report->header->xid;
Protocol__PrpHeader *header;
if (prp_create_header(xid, PROTOCOL__PRP_TYPE__PRPT_STATS_REPLY, &header) != 0) {
Protocol__FlexHeader *header;
if (flex_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_STATS_REPLY, &header) != 0) {
goto error;
}
stats_reply_msg = malloc(sizeof(Protocol__PrpStatsReply));
protocol__prp_stats_reply__init(stats_reply_msg);
stats_reply_msg = malloc(sizeof(Protocol__FlexStatsReply));
protocol__flex_stats_reply__init(stats_reply_msg);
stats_reply_msg->header = header;
stats_reply_msg->n_ue_report = n_ue_report;
stats_reply_msg->ue_report = ue_report;
stats_reply_msg->n_cell_report = n_cell_report;
stats_reply_msg->cell_report = cell_report;
msg = malloc(sizeof(Protocol__ProgranMessage));
msg = malloc(sizeof(Protocol__FlexranMessage));
if(msg == NULL)
goto error;
protocol__progran_message__init(msg);
msg->msg_case = PROTOCOL__PROGRAN_MESSAGE__MSG_STATS_REPLY_MSG;
msg->msg_dir = PROTOCOL__PROGRAN_DIRECTION__SUCCESSFUL_OUTCOME;
protocol__flexran_message__init(msg);
msg->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_STATS_REPLY_MSG;
msg->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__SUCCESSFUL_OUTCOME;
msg->stats_reply_msg = stats_reply_msg;
}
return msg;
......@@ -155,28 +155,28 @@ Protocol__ProgranMessage * enb_agent_generate_diff_mac_stats_report(Protocol__Pr
return NULL;
}
int compare_ue_stats_reports(Protocol__PrpUeStatsReport *rep1,
Protocol__PrpUeStatsReport *rep2) {
int compare_ue_stats_reports(Protocol__FlexUeStatsReport *rep1,
Protocol__FlexUeStatsReport *rep2) {
return 1;
}
int compare_cell_stats_reports(Protocol__PrpCellStatsReport *rep1,
Protocol__PrpCellStatsReport *rep2) {
int compare_cell_stats_reports(Protocol__FlexCellStatsReport *rep1,
Protocol__FlexCellStatsReport *rep2) {
return 1;
}
Protocol__PrpUeStatsReport * copy_ue_stats_report(Protocol__PrpUeStatsReport * original) {
Protocol__FlexUeStatsReport * copy_ue_stats_report(Protocol__FlexUeStatsReport * original) {
int i;
Protocol__PrpUeStatsReport *copy = malloc(sizeof(Protocol__PrpUeStatsReport));
Protocol__FlexUeStatsReport *copy = malloc(sizeof(Protocol__FlexUeStatsReport));
if (copy == NULL)
goto error;
protocol__prp_ue_stats_report__init(copy);
protocol__flex_ue_stats_report__init(copy);
copy->rnti = original->rnti;
copy->has_rnti = original->has_rnti;
copy->flags = original->flags;
copy->has_flags = original->has_flags;
if (copy->flags & PROTOCOL__PRP_UE_STATS_TYPE__PRUST_BSR) {
if (copy->flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_BSR) {
copy->n_bsr = original->n_bsr;
if (copy->n_bsr > 0) {
uint32_t *elem;
......@@ -190,16 +190,16 @@ Protocol__PrpUeStatsReport * copy_ue_stats_report(Protocol__PrpUeStatsReport * o
}
}
if (copy->flags & PROTOCOL__PRP_UE_STATS_TYPE__PRUST_PRH) {
if (copy->flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_PRH) {
copy->has_phr = original->has_phr;
copy->phr = original->phr;
}
if (copy->flags & PROTOCOL__PRP_UE_STATS_TYPE__PRUST_RLC_BS) {
if (copy->flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_RLC_BS) {
copy->n_rlc_report = original->n_rlc_report;
if (copy->n_rlc_report > 0) {
Protocol__PrpRlcBsr ** rlc_reports;
rlc_reports = malloc(sizeof(Protocol__PrpRlcBsr) * copy->n_rlc_report);
Protocol__FlexRlcBsr ** rlc_reports;
rlc_reports = malloc(sizeof(Protocol__FlexRlcBsr) * copy->n_rlc_report);
if (rlc_reports == NULL)
goto error;
for (i = 0; i < copy->n_rlc_report; i++) {
......@@ -209,22 +209,22 @@ Protocol__PrpUeStatsReport * copy_ue_stats_report(Protocol__PrpUeStatsReport * o
}
}
if (copy->flags & PROTOCOL__PRP_UE_STATS_TYPE__PRUST_MAC_CE_BS) {
if (copy->flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_MAC_CE_BS) {
copy->has_pending_mac_ces = original->has_pending_mac_ces;
copy->pending_mac_ces = original->pending_mac_ces;
}
if (copy->flags & PROTOCOL__PRP_UE_STATS_TYPE__PRUST_DL_CQI) {
if (copy->flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_DL_CQI) {
copy->dl_cqi_report = copy_dl_cqi_report(original->dl_cqi_report);
}
if (copy->flags & PROTOCOL__PRP_UE_STATS_TYPE__PRUST_PBS) {
if (copy->flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_PBS) {
/*Copy the Paging Buffer report*/
copy->pbr = copy_paging_buffer_report(original->pbr);
}
if (copy->flags & PROTOCOL__PRP_UE_STATS_TYPE__PRUST_UL_CQI) {
if (copy->flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_UL_CQI) {
/*TODO: Copy the UL report*/
copy->ul_cqi_report = copy_ul_cqi_report(original->ul_cqi_report);
}
......@@ -235,11 +235,11 @@ Protocol__PrpUeStatsReport * copy_ue_stats_report(Protocol__PrpUeStatsReport * o
return NULL;
}
Protocol__PrpRlcBsr * copy_rlc_report(Protocol__PrpRlcBsr * original) {
Protocol__PrpRlcBsr * copy = malloc(sizeof(Protocol__PrpRlcBsr));
Protocol__FlexRlcBsr * copy_rlc_report(Protocol__FlexRlcBsr * original) {
Protocol__FlexRlcBsr * copy = malloc(sizeof(Protocol__FlexRlcBsr));
if (copy == NULL)
goto error;
protocol__prp_rlc_bsr__init(copy);
protocol__flex_rlc_bsr__init(copy);
copy->lc_id = original->lc_id;
copy->has_lc_id = original->has_lc_id;
copy->tx_queue_size = original->tx_queue_size;
......@@ -259,30 +259,30 @@ Protocol__PrpRlcBsr * copy_rlc_report(Protocol__PrpRlcBsr * original) {
return NULL;
}
Protocol__PrpUlCqiReport * copy_ul_cqi_report(Protocol__PrpUlCqiReport * original) {
Protocol__FlexUlCqiReport * copy_ul_cqi_report(Protocol__FlexUlCqiReport * original) {
int i, j;
//Fill in the full UL CQI report of the UE
Protocol__PrpUlCqiReport *full_ul_report;
full_ul_report = malloc(sizeof(Protocol__PrpUlCqiReport));
Protocol__FlexUlCqiReport *full_ul_report;
full_ul_report = malloc(sizeof(Protocol__FlexUlCqiReport));
if(full_ul_report == NULL) {
goto error;
}
protocol__prp_ul_cqi_report__init(full_ul_report);
protocol__flex_ul_cqi_report__init(full_ul_report);
//TODO:Set the SFN and SF of the generated report
full_ul_report->sfn_sn = original->sfn_sn;
full_ul_report->has_sfn_sn = original->has_sfn_sn;
full_ul_report->n_cqi_meas = original->n_cqi_meas;
Protocol__PrpUlCqi **ul_report;
ul_report = malloc(sizeof(Protocol__PrpUlCqi *) * full_ul_report->n_cqi_meas);
Protocol__FlexUlCqi **ul_report;
ul_report = malloc(sizeof(Protocol__FlexUlCqi *) * full_ul_report->n_cqi_meas);
if(ul_report == NULL)
goto error;
for(i = 0; i++; i < full_ul_report->n_cqi_meas) {
ul_report[i] = malloc(sizeof(Protocol__PrpUlCqi));
ul_report[i] = malloc(sizeof(Protocol__FlexUlCqi));
if(ul_report[i] == NULL)
goto error;
protocol__prp_ul_cqi__init(ul_report[i]);
protocol__flex_ul_cqi__init(ul_report[i]);
ul_report[i]->type = original->cqi_meas[i]->type;
ul_report[i]->has_type = original->cqi_meas[i]->has_type;
ul_report[i]->n_sinr = original->cqi_meas[i]->n_sinr;
......@@ -305,21 +305,21 @@ Protocol__PrpUlCqiReport * copy_ul_cqi_report(Protocol__PrpUlCqiReport * origina
return NULL;
}
Protocol__PrpDlCqiReport * copy_dl_cqi_report(Protocol__PrpDlCqiReport * original) {
Protocol__FlexDlCqiReport * copy_dl_cqi_report(Protocol__FlexDlCqiReport * original) {
int i;
/*Copy the DL report*/
Protocol__PrpDlCqiReport * dl_report;
dl_report = malloc(sizeof(Protocol__PrpDlCqiReport));
Protocol__FlexDlCqiReport * dl_report;
dl_report = malloc(sizeof(Protocol__FlexDlCqiReport));
if (dl_report == NULL)
goto error;
protocol__prp_dl_cqi_report__init(dl_report);
protocol__flex_dl_cqi_report__init(dl_report);
dl_report->sfn_sn = original->sfn_sn;
dl_report->has_sfn_sn = original->has_sfn_sn;
dl_report->n_csi_report = original->n_csi_report;
Protocol__PrpDlCsi **csi_reports;
csi_reports = malloc(sizeof(Protocol__PrpDlCsi *) * dl_report->n_csi_report);
Protocol__FlexDlCsi **csi_reports;
csi_reports = malloc(sizeof(Protocol__FlexDlCsi *) * dl_report->n_csi_report);
if (csi_reports == NULL)
goto error;
......@@ -334,26 +334,26 @@ Protocol__PrpDlCqiReport * copy_dl_cqi_report(Protocol__PrpDlCqiReport * origina
return NULL;
}
Protocol__PrpPagingBufferReport * copy_paging_buffer_report(Protocol__PrpPagingBufferReport *original) {
Protocol__FlexPagingBufferReport * copy_paging_buffer_report(Protocol__FlexPagingBufferReport *original) {
int i;
Protocol__PrpPagingBufferReport *copy;
copy = malloc(sizeof(Protocol__PrpPagingBufferReport));
Protocol__FlexPagingBufferReport *copy;
copy = malloc(sizeof(Protocol__FlexPagingBufferReport));
if (copy == NULL)
goto error;
protocol__prp_paging_buffer_report__init(copy);
protocol__flex_paging_buffer_report__init(copy);
copy->n_paging_info = original->n_paging_info;
Protocol__PrpPagingInfo **p_info;
p_info = malloc(sizeof(Protocol__PrpPagingInfo *) * copy->n_paging_info);
Protocol__FlexPagingInfo **p_info;
p_info = malloc(sizeof(Protocol__FlexPagingInfo *) * copy->n_paging_info);
if (p_info == NULL)
goto error;
for (i = 0; i < copy->n_paging_info; i++) {
p_info[i] = malloc(sizeof(Protocol__PrpPagingInfo));
p_info[i] = malloc(sizeof(Protocol__FlexPagingInfo));
if(p_info[i] == NULL)
goto error;
protocol__prp_paging_info__init(p_info[i]);
protocol__flex_paging_info__init(p_info[i]);
p_info[i]->paging_index = original->paging_info[i]->paging_index;
p_info[i]->has_paging_index = original->paging_info[i]->has_paging_index;;
p_info[i]->paging_message_size = original->paging_info[i]->paging_message_size;
......@@ -371,12 +371,12 @@ Protocol__PrpPagingBufferReport * copy_paging_buffer_report(Protocol__PrpPagingB
return NULL;
}
Protocol__PrpDlCsi * copy_csi_report(Protocol__PrpDlCsi * original) {
Protocol__FlexDlCsi * copy_csi_report(Protocol__FlexDlCsi * original) {
int i, j;
Protocol__PrpDlCsi *copy = malloc(sizeof(Protocol__PrpDlCsi));
Protocol__FlexDlCsi *copy = malloc(sizeof(Protocol__FlexDlCsi));
if (copy == NULL)
goto error;
protocol__prp_dl_csi__init(copy);
protocol__flex_dl_csi__init(copy);
copy->serv_cell_index = original->serv_cell_index;
copy->has_serv_cell_index = original->has_serv_cell_index;
copy->ri = original->ri;
......@@ -387,11 +387,11 @@ Protocol__PrpDlCsi * copy_csi_report(Protocol__PrpDlCsi * original) {
copy->report_case = original->report_case;
switch (copy->report_case) {
case PROTOCOL__PRP_DL_CSI__REPORT_P10CSI:
case PROTOCOL__FLEX_DL_CSI__REPORT_P10CSI:
copy->p10csi->wb_cqi = original->p10csi->wb_cqi;
copy->p10csi->has_wb_cqi = original->p10csi->has_wb_cqi;
break;
case PROTOCOL__PRP_DL_CSI__REPORT_P11CSI:
case PROTOCOL__FLEX_DL_CSI__REPORT_P11CSI:
copy->p11csi->n_wb_cqi = original->p11csi->n_wb_cqi;
copy->p11csi->wb_cqi = (uint32_t *) malloc(sizeof(uint32_t) * copy->p11csi->n_wb_cqi);
for (i = 0; i < copy->p11csi->n_wb_cqi; i++) {
......@@ -400,7 +400,7 @@ Protocol__PrpDlCsi * copy_csi_report(Protocol__PrpDlCsi * original) {
copy->p11csi->has_wb_pmi = original->p11csi->has_wb_pmi;
copy->p11csi->wb_pmi = original->p11csi->wb_pmi;
break;
case PROTOCOL__PRP_DL_CSI__REPORT_P20CSI:
case PROTOCOL__FLEX_DL_CSI__REPORT_P20CSI:
copy->p20csi->has_wb_cqi = original->p20csi->has_wb_cqi;
copy->p20csi->wb_cqi = original->p20csi->wb_cqi;
copy->p20csi->has_sb_cqi = original->p20csi->has_sb_cqi;
......@@ -410,7 +410,7 @@ Protocol__PrpDlCsi * copy_csi_report(Protocol__PrpDlCsi * original) {
copy->p20csi->has_sb_index = original->p20csi->has_sb_index;
copy->p20csi->sb_index = original->p20csi->sb_index;
break;
case PROTOCOL__PRP_DL_CSI__REPORT_P21CSI:
case PROTOCOL__FLEX_DL_CSI__REPORT_P21CSI:
copy->p21csi->n_wb_cqi = original->p21csi->n_wb_cqi;
copy->p21csi->wb_cqi = (uint32_t *) malloc(sizeof(uint32_t) * copy->p21csi->n_wb_cqi);
for (i = 0; i < copy->p21csi->n_wb_cqi; i++) {
......@@ -428,7 +428,7 @@ Protocol__PrpDlCsi * copy_csi_report(Protocol__PrpDlCsi * original) {
copy->p21csi->has_sb_index = original->p21csi->has_sb_index;
copy->p21csi->sb_index = original->p21csi->sb_index;
break;
case PROTOCOL__PRP_DL_CSI__REPORT_A12CSI:
case PROTOCOL__FLEX_DL_CSI__REPORT_A12CSI:
copy->a12csi->n_wb_cqi = original->a12csi->n_wb_cqi;
copy->a12csi->wb_cqi = (uint32_t *) malloc(sizeof(uint32_t) * copy->a12csi->n_wb_cqi);
for (i = 0; i < copy->a12csi->n_wb_cqi; i++) {
......@@ -440,7 +440,7 @@ Protocol__PrpDlCsi * copy_csi_report(Protocol__PrpDlCsi * original) {
copy->a12csi->sb_pmi[i] = original->a12csi->sb_pmi[i];
}
break;
case PROTOCOL__PRP_DL_CSI__REPORT_A22CSI:
case PROTOCOL__FLEX_DL_CSI__REPORT_A22CSI:
copy->a22csi->n_wb_cqi = original->a22csi->n_wb_cqi;
copy->a22csi->wb_cqi = (uint32_t *) malloc(sizeof(uint32_t) * copy->a22csi->n_wb_cqi);
for (i = 0; i < copy->a22csi->n_wb_cqi; i++) {
......@@ -461,7 +461,7 @@ Protocol__PrpDlCsi * copy_csi_report(Protocol__PrpDlCsi * original) {
copy->a22csi->sb_list[i] = original->a22csi->sb_list[i];
}
break;
case PROTOCOL__PRP_DL_CSI__REPORT_A20CSI:
case PROTOCOL__FLEX_DL_CSI__REPORT_A20CSI:
copy->a20csi->has_wb_cqi = original->a20csi->has_wb_cqi;
copy->a20csi->wb_cqi = original->a20csi->wb_cqi;
copy->a20csi->has_sb_cqi = original->a20csi->has_sb_cqi;
......@@ -472,7 +472,7 @@ Protocol__PrpDlCsi * copy_csi_report(Protocol__PrpDlCsi * original) {
copy->a20csi->sb_list[i] = original->a20csi->sb_list[i];
}
break;
case PROTOCOL__PRP_DL_CSI__REPORT_A30CSI:
case PROTOCOL__FLEX_DL_CSI__REPORT_A30CSI:
copy->a30csi->has_wb_cqi = original->a30csi->has_wb_cqi;
copy->a30csi->wb_cqi = original->a30csi->wb_cqi;
copy->a30csi->n_sb_cqi = original->a30csi->n_sb_cqi;
......@@ -481,7 +481,7 @@ Protocol__PrpDlCsi * copy_csi_report(Protocol__PrpDlCsi * original) {
copy->a30csi->sb_cqi[i] = original->a30csi->sb_cqi[i];
}
break;
case PROTOCOL__PRP_DL_CSI__REPORT_A31CSI:
case PROTOCOL__FLEX_DL_CSI__REPORT_A31CSI:
copy->a31csi->n_wb_cqi = original->a31csi->n_wb_cqi;
copy->a31csi->wb_cqi = (uint32_t *) malloc(sizeof(uint32_t) * copy->a31csi->n_wb_cqi);
for (i = 0; i < copy->a31csi->n_wb_cqi; i++) {
......@@ -490,16 +490,16 @@ Protocol__PrpDlCsi * copy_csi_report(Protocol__PrpDlCsi * original) {
copy->a31csi->has_wb_pmi = original->a31csi->has_wb_pmi;
copy->a31csi->wb_pmi = original->a31csi->wb_pmi;
copy->a31csi->n_sb_cqi = original->a31csi->n_sb_cqi;
copy->a31csi->sb_cqi = malloc(sizeof(Protocol__PrpMsbCqi *) * copy->a31csi->n_sb_cqi);
copy->a31csi->sb_cqi = malloc(sizeof(Protocol__FlexMsbCqi *) * copy->a31csi->n_sb_cqi);
if (copy->a31csi == NULL) {
goto error;
}
for (i = 0; i < copy->a31csi->n_sb_cqi; i++) {
copy->a31csi->sb_cqi[i] = malloc(sizeof(Protocol__PrpMsbCqi));
copy->a31csi->sb_cqi[i] = malloc(sizeof(Protocol__FlexMsbCqi));
if (copy->a31csi->sb_cqi[i] == NULL) {
goto error;
}
protocol__prp_msb_cqi__init(copy->a31csi->sb_cqi[i]);
protocol__flex_msb_cqi__init(copy->a31csi->sb_cqi[i]);
copy->a31csi->sb_cqi[i]->n_sb_cqi = original->a31csi->sb_cqi[i]->n_sb_cqi;
copy->a31csi->sb_cqi[i]->sb_cqi = (uint32_t *) malloc(sizeof(uint32_t) * copy->a31csi->sb_cqi[i]->n_sb_cqi);
for (j = 0; j < copy->a31csi->sb_cqi[i]->n_sb_cqi; j++) {
......@@ -516,20 +516,20 @@ Protocol__PrpDlCsi * copy_csi_report(Protocol__PrpDlCsi * original) {
return NULL;
}
Protocol__PrpCellStatsReport * copy_cell_stats_report(Protocol__PrpCellStatsReport *original) {
Protocol__FlexCellStatsReport * copy_cell_stats_report(Protocol__FlexCellStatsReport *original) {
Protocol__PrpCellStatsReport * copy = malloc(sizeof(Protocol__PrpCellStatsReport));
Protocol__FlexCellStatsReport * copy = malloc(sizeof(Protocol__FlexCellStatsReport));
if(copy == NULL) {
goto error;
}
protocol__prp_cell_stats_report__init(copy);
protocol__flex_cell_stats_report__init(copy);
copy->carrier_index = original->carrier_index;
copy->has_carrier_index = original->has_carrier_index;
copy->flags = original->flags;
copy->has_flags = original->has_flags;
if(copy->flags & PROTOCOL__PRP_CELL_STATS_TYPE__PRCST_NOISE_INTERFERENCE) {
if(copy->flags & PROTOCOL__FLEX_CELL_STATS_TYPE__FLCST_NOISE_INTERFERENCE) {
copy->noise_inter_report = copy_noise_inter_report(original->noise_inter_report);
}
......@@ -539,13 +539,13 @@ Protocol__PrpCellStatsReport * copy_cell_stats_report(Protocol__PrpCellStatsRepo
return NULL;
}
Protocol__PrpNoiseInterferenceReport * copy_noise_inter_report(Protocol__PrpNoiseInterferenceReport *original) {
Protocol__PrpNoiseInterferenceReport *ni_report;
ni_report = malloc(sizeof(Protocol__PrpNoiseInterferenceReport));
Protocol__FlexNoiseInterferenceReport * copy_noise_inter_report(Protocol__FlexNoiseInterferenceReport *original) {
Protocol__FlexNoiseInterferenceReport *ni_report;
ni_report = malloc(sizeof(Protocol__FlexNoiseInterferenceReport));
if(ni_report == NULL) {
goto error;
}
protocol__prp_noise_interference_report__init(ni_report);
protocol__flex_noise_interference_report__init(ni_report);
// Current frame and subframe number
ni_report->sfn_sf = original->sfn_sf;
ni_report->has_sfn_sf = original->sfn_sf;
......
......@@ -53,8 +53,8 @@ typedef struct {
uint8_t is_initialized;
volatile uint8_t cont_update;
xid_t xid;
Protocol__ProgranMessage *stats_req;
Protocol__ProgranMessage *prev_stats_reply;
Protocol__FlexranMessage *stats_req;
Protocol__FlexranMessage *prev_stats_reply;
pthread_mutex_t *mutex;
} mac_stats_updates_context_t;
......@@ -75,30 +75,30 @@ err_code_t enb_agent_enable_cont_mac_stats_update(mid_t mod_id, xid_t xid,
err_code_t enb_agent_disable_cont_mac_stats_update(mid_t mod_id);
Protocol__ProgranMessage * enb_agent_generate_diff_mac_stats_report(Protocol__ProgranMessage *new_report,
Protocol__ProgranMessage *old_report);
Protocol__FlexranMessage * enb_agent_generate_diff_mac_stats_report(Protocol__FlexranMessage *new_report,
Protocol__FlexranMessage *old_report);
Protocol__PrpUeStatsReport * copy_ue_stats_report(Protocol__PrpUeStatsReport * original);
Protocol__FlexUeStatsReport * copy_ue_stats_report(Protocol__FlexUeStatsReport * original);
Protocol__PrpCellStatsReport * copy_cell_stats_report(Protocol__PrpCellStatsReport *original);
Protocol__FlexCellStatsReport * copy_cell_stats_report(Protocol__FlexCellStatsReport *original);
Protocol__PrpRlcBsr * copy_rlc_report(Protocol__PrpRlcBsr * original);
Protocol__FlexRlcBsr * copy_rlc_report(Protocol__FlexRlcBsr * original);
Protocol__PrpUlCqiReport * copy_ul_cqi_report(Protocol__PrpUlCqiReport * original);
Protocol__FlexUlCqiReport * copy_ul_cqi_report(Protocol__FlexUlCqiReport * original);
Protocol__PrpDlCqiReport * copy_dl_cqi_report(Protocol__PrpDlCqiReport * original);
Protocol__FlexDlCqiReport * copy_dl_cqi_report(Protocol__FlexDlCqiReport * original);
Protocol__PrpPagingBufferReport * copy_paging_buffer_report(Protocol__PrpPagingBufferReport *original);
Protocol__FlexPagingBufferReport * copy_paging_buffer_report(Protocol__FlexPagingBufferReport *original);
Protocol__PrpDlCsi * copy_csi_report(Protocol__PrpDlCsi * original);
Protocol__FlexDlCsi * copy_csi_report(Protocol__FlexDlCsi * original);
Protocol__PrpNoiseInterferenceReport * copy_noise_inter_report(Protocol__PrpNoiseInterferenceReport *original);
Protocol__FlexNoiseInterferenceReport * copy_noise_inter_report(Protocol__FlexNoiseInterferenceReport *original);
int compare_ue_stats_reports(Protocol__PrpUeStatsReport *rep1,
Protocol__PrpUeStatsReport *rep2);
int compare_ue_stats_reports(Protocol__FlexUeStatsReport *rep1,
Protocol__FlexUeStatsReport *rep2);
int compare_cell_stats_reports(Protocol__PrpCellStatsReport *rep1,
Protocol__PrpCellStatsReport *rep2);
int compare_cell_stats_reports(Protocol__FlexCellStatsReport *rep1,
Protocol__FlexCellStatsReport *rep2);
/* Functions for parsing the MAC agent policy reconfiguration command */
......
......@@ -48,7 +48,7 @@
#define RIGHT(x) (2 * (x) + 2)
#define PARENT(x) ((x - 1) / 2)
enb_agent_task_t *enb_agent_task_create(Protocol__ProgranMessage *msg,
enb_agent_task_t *enb_agent_task_create(Protocol__FlexranMessage *msg,
uint16_t frame_num, uint8_t subframe_num) {
enb_agent_task_t *task = NULL;
task = malloc(sizeof(enb_agent_task_t));
......
......@@ -41,7 +41,7 @@
#include <stdint.h>
#include <pthread.h>
#include "progran.pb-c.h"
#include "flexran.pb-c.h"
#include "enb_agent_common.h"
......@@ -59,8 +59,8 @@ typedef struct enb_agent_task_s {
uint16_t frame_num;
/* The subframe in which the task needs to be executed */
uint8_t subframe_num;
/* The task to be executed in the form of a Protocol__ProgranMessage */
Protocol__ProgranMessage *task;
/* The task to be executed in the form of a Protocol__FlexranMessage */
Protocol__FlexranMessage *task;
} enb_agent_task_t;
/**
......@@ -95,7 +95,7 @@ typedef enum {
/**
* Allocate memory for a task in the queue
*/
enb_agent_task_t *enb_agent_task_create(Protocol__ProgranMessage *msg,
enb_agent_task_t *enb_agent_task_create(Protocol__FlexranMessage *msg,
uint16_t frame_num, uint8_t subframe_num);
/**
......
......@@ -48,7 +48,7 @@
#include "LAYER2/MAC/defs.h"
#include "LAYER2/MAC/proto.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/progran_dci_conversions.h"
#include "LAYER2/MAC/flexran_dci_conversions.h"
#include "UTIL/LOG/log.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
......@@ -60,7 +60,7 @@
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
#include "header.pb-c.h"
#include "progran.pb-c.h"
#include "flexran.pb-c.h"
#include "SIMULATION/TOOLS/defs.h" // for taus
......@@ -69,9 +69,9 @@ void apply_dl_scheduling_decisions(mid_t mod_id,
uint32_t frame,
uint32_t subframe,
int *mbsfn_flag,
const Protocol__ProgranMessage *dl_scheduling_info) {
const Protocol__FlexranMessage *dl_scheduling_info) {
Protocol__PrpDlMacConfig *mac_config = dl_scheduling_info->dl_mac_config_msg;
Protocol__FlexDlMacConfig *mac_config = dl_scheduling_info->dl_mac_config_msg;
// Check if there is anything to schedule for random access
if (mac_config->n_dl_rar > 0) {
......@@ -97,7 +97,7 @@ void apply_ue_spec_scheduling_decisions(mid_t mod_id,
uint32_t subframe,
int *mbsfn_flag,
uint32_t n_dl_ue_data,
const Protocol__PrpDlData **dl_ue_data) {
const Protocol__FlexDlData **dl_ue_data) {
uint8_t CC_id;
int UE_id;
......@@ -128,8 +128,8 @@ void apply_ue_spec_scheduling_decisions(mid_t mod_id,
int i;
Protocol__PrpDlData *dl_data;
Protocol__PrpDlDci *dl_dci;
Protocol__FlexDlData *dl_data;
Protocol__FlexDlDci *dl_dci;
uint32_t rlc_size, n_lc, lcid;
......@@ -161,7 +161,7 @@ void apply_ue_spec_scheduling_decisions(mid_t mod_id,
if (dl_data->n_ce_bitmap > 0) {
//Check if there is TA command and set the length appropriately
ta_len = (dl_data->ce_bitmap[0] & PROTOCOL__PRP_CE_TYPE__PRPCET_TA) ? 2 : 0;
ta_len = (dl_data->ce_bitmap[0] & PROTOCOL__FLEX_CE_TYPE__FLPCET_TA) ? 2 : 0;
}
if (ta_len > 0) {
......@@ -359,7 +359,7 @@ void apply_ue_spec_scheduling_decisions(mid_t mod_id,
}
void fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti,
const Protocol__PrpDlDci *dl_dci) {
const Protocol__FlexDlDci *dl_dci) {
void *DLSCH_dci = NULL;
DCI_PDU *DCI_pdu;
......@@ -397,92 +397,92 @@ void fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti,
switch (frame_parms[CC_id]->N_RB_DL) {
case 6:
if (frame_parms[CC_id]->frame_type == TDD) {
if (dl_dci->format == PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1) {
if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1) {
FILL_DCI_TDD_1(DCI1_1_5MHz_TDD_t, DLSCH_dci, dl_dci);
size_bytes = sizeof(DCI1_1_5MHz_TDD_t);
size_bits = sizeof_DCI1_1_5MHz_TDD_t;
} else if (dl_dci->format == PROTOCOL__PRP_DCI_FORMAT__PRDCIF_2A) {
} else if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_2A) {
//TODO
} else if (dl_dci->format == PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1D) {
} else if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1D) {
//TODO
}
} else {
if (dl_dci->format == PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1) {
if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1) {
FILL_DCI_FDD_1(DCI1_1_5MHz_FDD_t, DLSCH_dci, dl_dci);
size_bytes = sizeof(DCI1_1_5MHz_FDD_t);
size_bits = sizeof_DCI1_1_5MHz_FDD_t;
} else if (dl_dci->format == PROTOCOL__PRP_DCI_FORMAT__PRDCIF_2A) {
} else if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_2A) {
//TODO
} else if (dl_dci->format == PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1D) {
} else if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1D) {
//TODO
}
}
break;
case 25:
if (frame_parms[CC_id]->frame_type == TDD) {
if (dl_dci->format == PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1) {
if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1) {
FILL_DCI_TDD_1(DCI1_5MHz_TDD_t, DLSCH_dci, dl_dci);
size_bytes = sizeof(DCI1_5MHz_TDD_t);
size_bits = sizeof_DCI1_5MHz_TDD_t;
} else if (dl_dci->format == PROTOCOL__PRP_DCI_FORMAT__PRDCIF_2A) {
} else if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_2A) {
//TODO
} else if (dl_dci->format == PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1D) {
} else if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1D) {
//TODO
}
} else {
if (dl_dci->format == PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1) {
if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1) {
FILL_DCI_FDD_1(DCI1_5MHz_FDD_t, DLSCH_dci, dl_dci);
size_bytes = sizeof(DCI1_5MHz_FDD_t);
size_bits = sizeof_DCI1_5MHz_FDD_t;
} else if (dl_dci->format == PROTOCOL__PRP_DCI_FORMAT__PRDCIF_2A) {
} else if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_2A) {
//TODO
} else if (dl_dci->format == PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1D) {
} else if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1D) {
//TODO
}
}
break;
case 50:
if (frame_parms[CC_id]->frame_type == TDD) {
if (dl_dci->format == PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1) {
if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1) {
FILL_DCI_TDD_1(DCI1_10MHz_TDD_t, DLSCH_dci, dl_dci);
size_bytes = sizeof(DCI1_10MHz_TDD_t);
size_bits = sizeof_DCI1_10MHz_TDD_t;
} else if (dl_dci->format == PROTOCOL__PRP_DCI_FORMAT__PRDCIF_2A) {
} else if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_2A) {
//TODO
} else if (dl_dci->format == PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1D) {
} else if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1D) {
//TODO
}
} else {
if (dl_dci->format == PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1) {
if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1) {
FILL_DCI_FDD_1(DCI1_10MHz_FDD_t, DLSCH_dci, dl_dci);
size_bytes = sizeof(DCI1_10MHz_FDD_t);
size_bits = sizeof_DCI1_10MHz_FDD_t;
} else if (dl_dci->format == PROTOCOL__PRP_DCI_FORMAT__PRDCIF_2A) {
} else if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_2A) {
//TODO
} else if (dl_dci->format == PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1D) {
} else if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1D) {
//TODO
}
}
break;
case 100:
if (frame_parms[CC_id]->frame_type == TDD) {
if (dl_dci->format == PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1) {
if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1) {
FILL_DCI_TDD_1(DCI1_20MHz_TDD_t, DLSCH_dci, dl_dci);
size_bytes = sizeof(DCI1_20MHz_TDD_t);
size_bits = sizeof_DCI1_20MHz_TDD_t;
} else if (dl_dci->format == PROTOCOL__PRP_DCI_FORMAT__PRDCIF_2A) {
} else if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_2A) {
//TODO
} else if (dl_dci->format == PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1D) {
} else if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1D) {
//TODO
}
} else {
if (dl_dci->format == PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1) {
if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1) {
FILL_DCI_FDD_1(DCI1_20MHz_FDD_t, DLSCH_dci, dl_dci);
size_bytes = sizeof(DCI1_20MHz_FDD_t);
size_bits = sizeof_DCI1_20MHz_FDD_t;
} else if (dl_dci->format == PROTOCOL__PRP_DCI_FORMAT__PRDCIF_2A) {
} else if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_2A) {
//TODO
} else if (dl_dci->format == PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1D) {
} else if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1D) {
//TODO
}
}
......@@ -491,31 +491,31 @@ void fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti,
//Set format to the proper type
switch(dl_dci->format) {
case PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1:
case PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1:
format = format1;
break;
case PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1A:
case PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1A:
format = format1A;
break;
case PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1B:
case PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1B:
format = format1B;
break;
case PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1C:
case PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1C:
format = format1C;
break;
case PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1D:
case PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1D:
format = format1E_2A_M10PRB;
break;
case PROTOCOL__PRP_DCI_FORMAT__PRDCIF_2:
case PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_2:
format = format2;
break;
case PROTOCOL__PRP_DCI_FORMAT__PRDCIF_2A:
case PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_2A:
format = format2A;
break;
case PROTOCOL__PRP_DCI_FORMAT__PRDCIF_2B:
case PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_2B:
format = format2B;
break;
case PROTOCOL__PRP_DCI_FORMAT__PRDCIF_3:
case PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_3:
format = 3;
break;
default:
......
......@@ -63,7 +63,7 @@
#include "pdcp.h"
#include "header.pb-c.h"
#include "progran.pb-c.h"
#include "flexran.pb-c.h"
#include "enb_agent_mac.h"
#include "SIMULATION/TOOLS/defs.h" // for taus
......@@ -81,7 +81,7 @@ schedule_ue_spec_default(
uint32_t frame,
uint32_t subframe,
int *mbsfn_flag,
Protocol__ProgranMessage **dl_info
Protocol__FlexranMessage **dl_info
)
//------------------------------------------------------------------------------
{
......@@ -109,14 +109,14 @@ schedule_ue_spec_default(
static int32_t tpc_accumulated=0;
UE_sched_ctrl *ue_sched_ctl;
Protocol__PrpDlData *dl_data[NUM_MAX_UE];
Protocol__FlexDlData *dl_data[NUM_MAX_UE];
int num_ues_added = 0;
int channels_added = 0;
Protocol__PrpDlDci *dl_dci;
Protocol__PrpRlcPdu *rlc_pdus[11];
Protocol__FlexDlDci *dl_dci;
Protocol__FlexRlcPdu *rlc_pdus[11];
uint32_t *ce_bitmap;
Protocol__PrpRlcPdu **rlc_pdu;
Protocol__FlexRlcPdu **rlc_pdu;
int num_tb;
uint32_t ce_flags = 0;
......@@ -216,8 +216,8 @@ schedule_ue_spec_default(
channels_added = 0;
// After this point all the UEs will be scheduled
dl_data[num_ues_added] = (Protocol__PrpDlData *) malloc(sizeof(Protocol__PrpDlData));
protocol__prp_dl_data__init(dl_data[num_ues_added]);
dl_data[num_ues_added] = (Protocol__FlexDlData *) malloc(sizeof(Protocol__FlexDlData));
protocol__flex_dl_data__init(dl_data[num_ues_added]);
dl_data[num_ues_added]->has_rnti = 1;
dl_data[num_ues_added]->rnti = rnti;
dl_data[num_ues_added]->n_rlc_pdu = 0;
......@@ -258,8 +258,8 @@ schedule_ue_spec_default(
eNB_UE_stats->DL_cqi[0], mcs,
UE_list->eNB_UE_stats[CC_id][UE_id].rrc_status);
dl_dci = (Protocol__PrpDlDci*) malloc(sizeof(Protocol__PrpDlDci));
protocol__prp_dl_dci__init(dl_dci);
dl_dci = (Protocol__FlexDlDci*) malloc(sizeof(Protocol__FlexDlDci));
protocol__flex_dl_dci__init(dl_dci);
dl_data[num_ues_added]->dl_dci = dl_dci;
......@@ -353,12 +353,12 @@ schedule_ue_spec_default(
dl_data[num_ues_added]->ce_bitmap = (uint32_t *) malloc(sizeof(uint32_t) * 2);
if (ta_len > 0) {
ce_flags |= PROTOCOL__PRP_CE_TYPE__PRPCET_TA;
ce_flags |= PROTOCOL__FLEX_CE_TYPE__FLPCET_TA;
}
/*TODO: Add other flags if DRX and other CE are required*/
// Add the control element flags to the progran message
// Add the control element flags to the flexran message
dl_data[num_ues_added]->ce_bitmap[0] = ce_flags;
dl_data[num_ues_added]->ce_bitmap[1] = ce_flags;
......@@ -394,18 +394,18 @@ schedule_ue_spec_default(
data_to_request++; //It is not correct but fixes some RLC bug for DCCH
}
LOG_D(MAC, "[TEST]Will request %d from DCCH\n", data_to_request);
rlc_pdus[channels_added] = (Protocol__PrpRlcPdu *) malloc(sizeof(Protocol__PrpRlcPdu));
protocol__prp_rlc_pdu__init(rlc_pdus[channels_added]);
rlc_pdus[channels_added] = (Protocol__FlexRlcPdu *) malloc(sizeof(Protocol__FlexRlcPdu));
protocol__flex_rlc_pdu__init(rlc_pdus[channels_added]);
rlc_pdus[channels_added]->n_rlc_pdu_tb = 2;
rlc_pdus[channels_added]->rlc_pdu_tb = (Protocol__PrpRlcPduTb **) malloc(sizeof(Protocol__PrpRlcPduTb *) * 2);
rlc_pdus[channels_added]->rlc_pdu_tb[0] = (Protocol__PrpRlcPduTb *) malloc(sizeof(Protocol__PrpRlcPduTb));
protocol__prp_rlc_pdu_tb__init(rlc_pdus[channels_added]->rlc_pdu_tb[0]);
rlc_pdus[channels_added]->rlc_pdu_tb = (Protocol__FlexRlcPduTb **) malloc(sizeof(Protocol__FlexRlcPduTb *) * 2);
rlc_pdus[channels_added]->rlc_pdu_tb[0] = (Protocol__FlexRlcPduTb *) malloc(sizeof(Protocol__FlexRlcPduTb));
protocol__flex_rlc_pdu_tb__init(rlc_pdus[channels_added]->rlc_pdu_tb[0]);
rlc_pdus[channels_added]->rlc_pdu_tb[0]->has_logical_channel_id = 1;
rlc_pdus[channels_added]->rlc_pdu_tb[0]->logical_channel_id = j;
rlc_pdus[channels_added]->rlc_pdu_tb[0]->has_size = 1;
rlc_pdus[channels_added]->rlc_pdu_tb[0]->size = data_to_request;
rlc_pdus[channels_added]->rlc_pdu_tb[1] = (Protocol__PrpRlcPduTb *) malloc(sizeof(Protocol__PrpRlcPduTb));
protocol__prp_rlc_pdu_tb__init(rlc_pdus[channels_added]->rlc_pdu_tb[1]);
rlc_pdus[channels_added]->rlc_pdu_tb[1] = (Protocol__FlexRlcPduTb *) malloc(sizeof(Protocol__FlexRlcPduTb));
protocol__flex_rlc_pdu_tb__init(rlc_pdus[channels_added]->rlc_pdu_tb[1]);
rlc_pdus[channels_added]->rlc_pdu_tb[1]->has_logical_channel_id = 1;
rlc_pdus[channels_added]->rlc_pdu_tb[1]->logical_channel_id = j;
rlc_pdus[channels_added]->rlc_pdu_tb[1]->has_size = 1;
......@@ -422,7 +422,7 @@ schedule_ue_spec_default(
} // End of iterating the logical channels
// Add rlc_pdus to the dl_data message
dl_data[num_ues_added]->rlc_pdu = (Protocol__PrpRlcPdu **) malloc(sizeof(Protocol__PrpRlcPdu *) *
dl_data[num_ues_added]->rlc_pdu = (Protocol__FlexRlcPdu **) malloc(sizeof(Protocol__FlexRlcPdu *) *
dl_data[num_ues_added]->n_rlc_pdu);
for (i = 0; i < dl_data[num_ues_added]->n_rlc_pdu; i++) {
dl_data[num_ues_added]->rlc_pdu[i] = rlc_pdus[i];
......@@ -595,9 +595,9 @@ schedule_ue_spec_default(
dl_dci->has_res_alloc = 1;
dl_dci->res_alloc = 0;
dl_dci->has_vrb_format = 1;
dl_dci->vrb_format = PROTOCOL__PRP_VRB_FORMAT__PRVRBF_LOCALIZED;
dl_dci->vrb_format = PROTOCOL__FLEX_VRB_FORMAT__FLVRBF_LOCALIZED;
dl_dci->has_format = 1;
dl_dci->format = PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1;
dl_dci->format = PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1;
dl_dci->has_rb_bitmap = 1;
dl_dci->rb_bitmap = allocate_prbs_sub(nb_rb, rballoc_sub);
dl_dci->has_rb_shift = 1;
......@@ -625,9 +625,9 @@ schedule_ue_spec_default(
dl_dci->has_res_alloc = 1;
dl_dci->res_alloc = 0;
dl_dci->has_vrb_format = 1;
dl_dci->vrb_format = PROTOCOL__PRP_VRB_FORMAT__PRVRBF_LOCALIZED;
dl_dci->vrb_format = PROTOCOL__FLEX_VRB_FORMAT__FLVRBF_LOCALIZED;
dl_dci->has_format = 1;
dl_dci->format = PROTOCOL__PRP_DCI_FORMAT__PRDCIF_2A;
dl_dci->format = PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_2A;
dl_dci->has_rb_bitmap = 1;
dl_dci->rb_bitmap = allocate_prbs_sub(nb_rb, rballoc_sub);
dl_dci->has_rb_shift = 1;
......@@ -659,9 +659,9 @@ schedule_ue_spec_default(
dl_dci->has_res_alloc = 1;
dl_dci->res_alloc = 0;
dl_dci->has_vrb_format = 1;
dl_dci->vrb_format = PROTOCOL__PRP_VRB_FORMAT__PRVRBF_LOCALIZED;
dl_dci->vrb_format = PROTOCOL__FLEX_VRB_FORMAT__FLVRBF_LOCALIZED;
dl_dci->has_format = 1;
dl_dci->format = PROTOCOL__PRP_DCI_FORMAT__PRDCIF_2A;
dl_dci->format = PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_2A;
dl_dci->has_rb_bitmap = 1;
dl_dci->rb_bitmap = allocate_prbs_sub(nb_rb, rballoc_sub);
dl_dci->has_rb_shift = 1;
......@@ -693,9 +693,9 @@ schedule_ue_spec_default(
dl_dci->has_res_alloc = 1;
dl_dci->res_alloc = 0;
dl_dci->has_vrb_format = 1;
dl_dci->vrb_format = PROTOCOL__PRP_VRB_FORMAT__PRVRBF_LOCALIZED;
dl_dci->vrb_format = PROTOCOL__FLEX_VRB_FORMAT__FLVRBF_LOCALIZED;
dl_dci->has_format = 1;
dl_dci->format = PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1D;
dl_dci->format = PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1D;
dl_dci->has_rb_bitmap = 1;
dl_dci->rb_bitmap = allocate_prbs_sub(nb_rb, rballoc_sub);
dl_dci->has_rb_shift = 1;
......@@ -733,9 +733,9 @@ schedule_ue_spec_default(
dl_dci->has_res_alloc = 1;
dl_dci->res_alloc = 0;
dl_dci->has_vrb_format = 1;
dl_dci->vrb_format = PROTOCOL__PRP_VRB_FORMAT__PRVRBF_LOCALIZED;
dl_dci->vrb_format = PROTOCOL__FLEX_VRB_FORMAT__FLVRBF_LOCALIZED;
dl_dci->has_format = 1;
dl_dci->format = PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1D;
dl_dci->format = PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1D;
dl_dci->has_rb_bitmap = 1;
dl_dci->rb_bitmap = allocate_prbs_sub(nb_rb, rballoc_sub);
dl_dci->has_rb_shift = 1;
......@@ -770,9 +770,9 @@ schedule_ue_spec_default(
} // UE_id loop
} // CC_id loop
// Add all the dl_data elements to the progran message
// Add all the dl_data elements to the flexran message
(*dl_info)->dl_mac_config_msg->n_dl_ue_data = num_ues_added;
(*dl_info)->dl_mac_config_msg->dl_ue_data = (Protocol__PrpDlData **) malloc(sizeof(Protocol__PrpDlData *) * num_ues_added);
(*dl_info)->dl_mac_config_msg->dl_ue_data = (Protocol__FlexDlData **) malloc(sizeof(Protocol__FlexDlData *) * num_ues_added);
for (i = 0; i < num_ues_added; i++) {
(*dl_info)->dl_mac_config_msg->dl_ue_data[i] = dl_data[i];
}
......
......@@ -53,7 +53,7 @@ int queue_initialized = 0;
//uint32_t sched [] = {1, 2, 3};
void schedule_ue_spec_remote(mid_t mod_id, uint32_t frame, uint32_t subframe,
int *mbsfn_flag, Protocol__ProgranMessage **dl_info) {
int *mbsfn_flag, Protocol__FlexranMessage **dl_info) {
//if ((subframe == skip_subframe) && (frame % period == 0)) {
......
......@@ -40,7 +40,7 @@
#ifndef __LAYER2_MAC_ENB_AGENT_SCHEDULER_DLSCH_UE_REMOTE_H__
#define __LAYER2_MAC_ENB_AGENT_SCHEDULER_DLSCH_UE_REMOTE_H___
#include "progran.pb-c.h"
#include "flexran.pb-c.h"
#include "header.pb-c.h"
#include "ENB_APP/enb_agent_defs.h"
......@@ -54,7 +54,7 @@
#define SCHED_AHEAD_SUBFRAMES 20
typedef struct dl_mac_config_element_s {
Protocol__ProgranMessage *dl_info;
Protocol__FlexranMessage *dl_info;
TAILQ_ENTRY(dl_mac_config_element_s) configs;
} dl_mac_config_element_t;
......@@ -64,7 +64,7 @@ TAILQ_HEAD(DlMacConfigHead, dl_mac_config_element_s);
* Default scheduler used by the eNB agent
*/
void schedule_ue_spec_remote(mid_t mod_id, uint32_t frame, uint32_t subframe,
int *mbsfn_flag, Protocol__ProgranMessage **dl_info);
int *mbsfn_flag, Protocol__FlexranMessage **dl_info);
// Find the difference in subframes from the given subframe
......
......@@ -103,7 +103,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
void *DLSCH_dci=NULL;
int size_bits=0,size_bytes=0;
Protocol__ProgranMessage *msg;
Protocol__FlexranMessage *msg;
LOG_D(MAC,"[eNB %d] Frame %d, Subframe %d, entering MAC scheduler (UE_list->head %d)\n",module_idP, frameP, subframeP,UE_list->head);
......@@ -143,7 +143,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
if (mac_agent_registered[module_idP]) {
agent_mac_xface[module_idP]->enb_agent_notify_ue_state_change(module_idP,
rnti,
PROTOCOL__PRP_UE_STATE_CHANGE_TYPE__PRUESC_DEACTIVATED);
PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_DEACTIVATED);
}
}
else {
......
......@@ -42,29 +42,29 @@
#include "enb_agent_defs.h"
#include "header.pb-c.h"
#include "progran.pb-c.h"
#include "flexran.pb-c.h"
/*
* Default scheduler used by the eNB agent
*/
void schedule_ue_spec_default(mid_t mod_id, uint32_t frame, uint32_t subframe,
int *mbsfn_flag, Protocol__ProgranMessage **dl_info);
int *mbsfn_flag, Protocol__FlexranMessage **dl_info);
/*
* Data plane function for applying the DL decisions of the scheduler
*/
void apply_dl_scheduling_decisions(mid_t mod_id, uint32_t frame, uint32_t subframe, int *mbsfn_flag,
const Protocol__ProgranMessage *dl_scheduling_info);
const Protocol__FlexranMessage *dl_scheduling_info);
/*
* Data plane function for applying the UE specific DL decisions of the scheduler
*/
void apply_ue_spec_scheduling_decisions(mid_t mod_id, uint32_t frame, uint32_t subframe, int *mbsfn_flag,
uint32_t n_dl_ue_data, const Protocol__PrpDlData **dl_ue_data);
uint32_t n_dl_ue_data, const Protocol__FlexDlData **dl_ue_data);
/*
* Data plane function for filling the DCI structure
*/
void fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti, const Protocol__PrpDlDci *dl_dci);
void fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti, const Protocol__FlexDlDci *dl_dci);
#endif
......@@ -28,32 +28,32 @@
*******************************************************************************/
/*! \file dci_conversions.h
* \brief Conversion helpers from progran messages to OAI formats DCI
* \brief Conversion helpers from flexran messages to OAI formats DCI
* \author Xenofon Foukas
* \date 2016
* \version 0.1
*/
#ifndef LAYER2_MAC_PROGRAN_DCI_CONVERISIONS_H__
#define LAYER2_MAC_DCI_PROGRAN_CONVERISIONS_H__
#define FILL_DCI_FDD_1(TYPE, DCI, PROGRAN_DCI) \
((TYPE*)DCI)->harq_pid = PROGRAN_DCI->harq_process; \
((TYPE*)DCI)->rv = PROGRAN_DCI->rv[0]; \
((TYPE*)DCI)->rballoc = PROGRAN_DCI->rb_bitmap; \
((TYPE*)DCI)->rah = PROGRAN_DCI->res_alloc; \
((TYPE*)DCI)->mcs = PROGRAN_DCI->mcs[0]; \
((TYPE*)DCI)->TPC = PROGRAN_DCI->tpc; \
((TYPE*)DCI)->ndi = PROGRAN_DCI->ndi[0];
#define FILL_DCI_TDD_1(TYPE, DCI, PROGRAN_DCI) \
((TYPE*)DCI)->harq_pid = PROGRAN_DCI->harq_process; \
((TYPE*)DCI)->rv = PROGRAN_DCI->rv[0]; \
((TYPE*)DCI)->dai = PROGRAN_DCI->dai; \
((TYPE*)DCI)->rballoc = PROGRAN_DCI->rb_bitmap; \
((TYPE*)DCI)->rah = PROGRAN_DCI->res_alloc; \
((TYPE*)DCI)->mcs = PROGRAN_DCI->mcs[0]; \
((TYPE*)DCI)->TPC = PROGRAN_DCI->tpc; \
((TYPE*)DCI)->ndi = PROGRAN_DCI->ndi[0];
#ifndef LAYER2_MAC_FLEXRAN_DCI_CONVERISIONS_H__
#define LAYER2_MAC_DCI_FLEXRAN_CONVERISIONS_H__
#define FILL_DCI_FDD_1(TYPE, DCI, FLEXRAN_DCI) \
((TYPE*)DCI)->harq_pid = FLEXRAN_DCI->harq_process; \
((TYPE*)DCI)->rv = FLEXRAN_DCI->rv[0]; \
((TYPE*)DCI)->rballoc = FLEXRAN_DCI->rb_bitmap; \
((TYPE*)DCI)->rah = FLEXRAN_DCI->res_alloc; \
((TYPE*)DCI)->mcs = FLEXRAN_DCI->mcs[0]; \
((TYPE*)DCI)->TPC = FLEXRAN_DCI->tpc; \
((TYPE*)DCI)->ndi = FLEXRAN_DCI->ndi[0];
#define FILL_DCI_TDD_1(TYPE, DCI, FLEXRAN_DCI) \
((TYPE*)DCI)->harq_pid = FLEXRAN_DCI->harq_process; \
((TYPE*)DCI)->rv = FLEXRAN_DCI->rv[0]; \
((TYPE*)DCI)->dai = FLEXRAN_DCI->dai; \
((TYPE*)DCI)->rballoc = FLEXRAN_DCI->rb_bitmap; \
((TYPE*)DCI)->rah = FLEXRAN_DCI->res_alloc; \
((TYPE*)DCI)->mcs = FLEXRAN_DCI->mcs[0]; \
((TYPE*)DCI)->TPC = FLEXRAN_DCI->tpc; \
((TYPE*)DCI)->ndi = FLEXRAN_DCI->ndi[0];
#endif
......@@ -4545,7 +4545,7 @@ rrc_eNB_decode_dcch(
if (mac_agent_registered[ctxt_pP->module_id]) {
agent_mac_xface[ctxt_pP->eNB_index]->enb_agent_notify_ue_state_change(ctxt_pP->module_id,
ue_context_p->ue_id_rnti,
PROTOCOL__PRP_UE_STATE_CHANGE_TYPE__PRUESC_UPDATED);
PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_UPDATED);
}
}
#if defined(ENABLE_ITTI)
......@@ -4646,7 +4646,7 @@ rrc_eNB_decode_dcch(
if (mac_agent_registered[ctxt_pP->module_id]) {
agent_mac_xface[ctxt_pP->eNB_index]->enb_agent_notify_ue_state_change(ctxt_pP->module_id,
ue_context_p->ue_id_rnti,
PROTOCOL__PRP_UE_STATE_CHANGE_TYPE__PRUESC_ACTIVATED);
PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_ACTIVATED);
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment