Commit 31274f6c authored by Cedric Roux's avatar Cedric Roux

bugfix/cleanup: remove uint8_t to encode size plus some cleanup

The starting point was the function do_NR_DLInformationTransfer() which
may deal with more than 256 bytes.

Then why not cleanup all the functions in the same file.
(And do a bit of formattting fixing while we're here.)

Then cleanup the callers of those functions.

Then, because of do_SIB23_NR() let's also cleanup in some
structures.

Not all the codebase was cleaned up, there surely remain some uint8_t
(and char/short/uint16_t) which are wrong.
parent 92491310
......@@ -182,7 +182,7 @@ typedef struct e_rab_param_NB_IoT_s {
typedef struct {
char Payload[RRC_BUFFER_SIZE_MAX];
char Header[RRC_HEADER_SIZE_MAX];
char payload_size;
int payload_size;
} RRC_BUFFER_NB_IoT;
#define RRC_BUFFER_SIZE_NB_IoT sizeof(RRC_BUFFER_NB_IoT)
......@@ -288,9 +288,9 @@ typedef struct eNB_RRC_UE_NB_IoT_s {
security_capabilities_t security_capabilities;
/* Total number of e_rab already setup in the list */ //NAS list?
uint8_t setup_e_rabs;
int setup_e_rabs;
/* Number of e_rab to be setup in the list */ //NAS list?
uint8_t nb_of_e_rabs;
int nb_of_e_rabs;
/* list of e_rab to be setup by RRC layers */
e_rab_param_NB_IoT_t e_rab[NB_RB_MAX_NB_IOT];//[S1AP_MAX_E_RAB];
......@@ -337,31 +337,31 @@ typedef struct {
// buffer that contains the encoded messages
uint8_t *MIB_NB_IoT;
uint8_t sizeof_MIB_NB_IoT;
int sizeof_MIB_NB_IoT;
uint8_t *SIB1_NB_IoT;
uint8_t sizeof_SIB1_NB_IoT;
int sizeof_SIB1_NB_IoT;
uint8_t *SIB23_NB_IoT;
uint8_t sizeof_SIB23_NB_IoT;
int sizeof_SIB23_NB_IoT;
//not actually implemented in OAI
uint8_t *SIB4_NB_IoT;
uint8_t sizeof_SIB4_NB_IoT;
int sizeof_SIB4_NB_IoT;
uint8_t *SIB5_NB_IoT;
uint8_t sizeof_SIB5_NB_IoT;
int sizeof_SIB5_NB_IoT;
uint8_t *SIB14_NB_IoT;
uint8_t sizeof_SIB14_NB_IoT;
int sizeof_SIB14_NB_IoT;
uint8_t *SIB16_NB_IoT;
uint8_t sizeof_SIB16_NB_IoT;
int sizeof_SIB16_NB_IoT;
//TS 36.331 V14.2.1
// uint8_t *SIB15_NB;
// uint8_t sizeof_SIB15_NB;
// int sizeof_SIB15_NB;
// uint8_t *SIB20_NB;
// uint8_t sizeof_SIB20_NB;
// int sizeof_SIB20_NB;
// uint8_t *SIB22_NB;
// uint8_t sizeof_SIB22_NB;
// int sizeof_SIB22_NB;
//implicit parameters needed
int Ncp; //cyclic prefix for DL
......@@ -391,7 +391,7 @@ typedef struct {
SRB_INFO_NB_IoT Srb0;
uint8_t **MCCH_MESSAGE; // probably not needed , but added to remove errors
uint8_t sizeof_MCCH_MESSAGE[8];// but added to remove errors
int sizeof_MCCH_MESSAGE[8];// but added to remove errors
SRB_INFO_NB_IoT MCCH_MESS[8];// MAX_MBSFN_AREA
/*future implementation TS 36.331 V14.2.1
SystemInformationBlockType15_NB_r14_t *sib15;
......@@ -399,7 +399,7 @@ typedef struct {
SystemInformationBlockType22_NB_r14_t *sib22;
uint8_t SCPTM_flag;
uint8_t sizeof_SC_MCHH_MESS[];
int sizeof_SC_MCHH_MESS[];
SC_MCCH_Message_NB_t scptm;*/
......@@ -448,7 +448,7 @@ typedef struct eNB_RRC_INST_NB_IoT_s {
//not needed for the moment
typedef struct OAI_UECapability_NB_IoT_s {
uint8_t sdu[MAX_UE_CAPABILITY_SIZE_NB_IoT];
uint8_t sdu_size;
int sdu_size;
////NB-IoT------
LTE_UE_Capability_NB_r13_t UE_Capability_NB_IoT; //replace the UE_EUTRA_Capability of LTE
} OAI_UECapability_NB_IoT_t;
......@@ -465,7 +465,7 @@ typedef struct UE_RRC_INST_NB_IoT_s {
as_nas_info_t initialNasMsg;
OAI_UECapability_NB_IoT_t *UECap;
uint8_t *UECapability;
uint8_t UECapability_size;
int UECapability_size;
UE_RRC_INFO_NB_IoT Info[NB_SIG_CNX_UE];
......
......@@ -608,20 +608,20 @@ typedef struct eNB_RRC_UE_s {
uint8_t next_security_key[SECURITY_KEY_LENGTH];
/* Total number of e_rab already setup in the list */
uint8_t setup_e_rabs;
int setup_e_rabs;
/* Number of e_rab to be setup in the list */
uint8_t nb_of_e_rabs;
int nb_of_e_rabs;
/* Number of e_rab to be modified in the list */
uint8_t nb_of_modify_e_rabs;
uint8_t nb_of_failed_e_rabs;
uint8_t nb_of_modify_endc_e_rabs;
int nb_of_modify_e_rabs;
int nb_of_failed_e_rabs;
int nb_of_modify_endc_e_rabs;
e_rab_param_t modify_e_rab[NB_RB_MAX];//[S1AP_MAX_E_RAB];
/* list of e_rab to be setup by RRC layers */
e_rab_param_t e_rab[NB_RB_MAX];//[S1AP_MAX_E_RAB];
/* UE aggregate maximum bitrate */
ambr_t ue_ambr;
//release e_rabs
uint8_t nb_release_of_e_rabs;
int nb_release_of_e_rabs;
/* list of e_rab to be released by RRC layers */
uint8_t e_rabs_tobereleased[NB_RB_MAX];
e_rab_failed_t e_rabs_release_failed[S1AP_MAX_E_RAB];
......@@ -634,7 +634,7 @@ typedef struct eNB_RRC_UE_s {
transport_layer_addr_t gnb_gtp_endc_addrs[S1AP_MAX_E_RAB];
rb_id_t gnb_gtp_endc_ebi[S1AP_MAX_E_RAB];
/* Total number of e_rab already setup in the list */
uint8_t nb_x2u_e_rabs;
int nb_x2u_e_rabs;
// LG: For GTPV1 TUNNELS(X2U)
uint32_t enb_gtp_x2u_teid[S1AP_MAX_E_RAB];
transport_layer_addr_t enb_gtp_x2u_addrs[S1AP_MAX_E_RAB];
......@@ -674,19 +674,19 @@ typedef struct rrc_eNB_ue_context_s {
typedef struct {
uint8_t *MIB;
uint8_t sizeof_MIB;
int sizeof_MIB;
uint8_t *SIB1;
uint8_t sizeof_SIB1;
int sizeof_SIB1;
uint8_t *SIB23;
uint8_t sizeof_SIB23;
int sizeof_SIB23;
uint8_t *SIB1_BR;
uint8_t sizeof_SIB1_BR;
int sizeof_SIB1_BR;
uint8_t *SIB23_BR;
uint8_t sizeof_SIB23_BR;
int sizeof_SIB23_BR;
uint8_t *MIB_FeMBMS;
uint8_t sizeof_MIB_FeMBMS;
int sizeof_MIB_FeMBMS;
uint8_t *SIB1_MBMS;
uint8_t sizeof_SIB1_MBMS;
int sizeof_SIB1_MBMS;
int physCellId;
int Ncp;
int p_eNB;
......@@ -716,14 +716,14 @@ typedef struct {
uint8_t FeMBMS_flag;
LTE_SystemInformationBlockType13_r9_t *sib13;
uint8_t MBMS_flag;
uint8_t num_mbsfn_sync_area;
int num_mbsfn_sync_area;
uint8_t **MCCH_MESSAGE; // MAX_MBSFN_AREA
uint8_t sizeof_MCCH_MESSAGE[8];// MAX_MBSFN_AREA
int sizeof_MCCH_MESSAGE[8];// MAX_MBSFN_AREA
LTE_MCCH_Message_t mcch;
LTE_MBSFNAreaConfiguration_r9_t *mcch_message;
SRB_INFO MCCH_MESS[8];// MAX_MBSFN_AREA
uint8_t **MCCH_MESSAGE_COUNTING; // MAX_MBSFN_AREA
uint8_t sizeof_MCCH_MESSAGE_COUNTING[8];// MAX_MBSFN_AREA
int sizeof_MCCH_MESSAGE_COUNTING[8];// MAX_MBSFN_AREA
LTE_MCCH_Message_t mcch_counting;
LTE_MBMSCountingRequest_r10_t *mcch_message_counting;
SRB_INFO MCCH_MESS_COUNTING[8];// MAX_MBSFN_AREA
......@@ -735,7 +735,7 @@ typedef struct {
// End - TTN
SRB_INFO SI;
uint8_t *paging[MAX_MOBILES_PER_ENB];
uint32_t sizeof_paging[MAX_MOBILES_PER_ENB];
int sizeof_paging[MAX_MOBILES_PER_ENB];
} rrc_eNB_carrier_data_t;
......@@ -748,7 +748,7 @@ typedef struct eNB_RRC_INST_s {
uid_allocator_t uid_allocator;
RB_HEAD(rrc_ue_tree_s, rrc_eNB_ue_context_s) rrc_ue_head; // ue_context tree key search by rnti
uint8_t HO_flag;
uint8_t Nb_ue;
int Nb_ue;
hash_table_t *initial_id2_s1ap_ids; // key is content is rrc_ue_s1ap_ids_t
hash_table_t *s1ap_id2_s1ap_ids ; // key is content is rrc_ue_s1ap_ids_t
......@@ -801,10 +801,10 @@ typedef struct eNB_RRC_INST_s {
} eNB_RRC_INST;
#define MAX_UE_CAPABILITY_SIZE 255
#define MAX_UE_CAPABILITY_SIZE 8192
typedef struct OAI_UECapability_s {
uint8_t sdu[MAX_UE_CAPABILITY_SIZE];
uint8_t sdu_size;
int sdu_size;
LTE_UE_EUTRA_Capability_t *UE_EUTRA_Capability;
} OAI_UECapability_t;
......@@ -817,22 +817,22 @@ typedef struct UE_RRC_INST_s {
as_nas_info_t initialNasMsg;
OAI_UECapability_t *UECap;
uint8_t *UECapability;
uint8_t UECapability_size;
int UECapability_size;
UE_RRC_INFO Info[NB_SIG_CNX_UE];
SRB_INFO Srb0[NB_SIG_CNX_UE];
SRB_INFO_TABLE_ENTRY Srb1[NB_CNX_UE];
SRB_INFO_TABLE_ENTRY Srb2[NB_CNX_UE];
HANDOVER_INFO_UE HandoverInfoUe;
uint8_t *SIB1[NB_CNX_UE];
uint8_t sizeof_SIB1[NB_CNX_UE];
int sizeof_SIB1[NB_CNX_UE];
uint8_t *SI[NB_CNX_UE];
uint8_t sizeof_SI[NB_CNX_UE];
int sizeof_SI[NB_CNX_UE];
uint8_t SIB1Status[NB_CNX_UE];
uint8_t SIStatus[NB_CNX_UE];
uint8_t *SIB1_MBMS[NB_CNX_UE];
uint8_t sizeof_SIB1_MBMS[NB_CNX_UE];
int sizeof_SIB1_MBMS[NB_CNX_UE];
uint8_t *SI_MBMS[NB_CNX_UE];
uint8_t sizeof_SI_MBMS[NB_CNX_UE];
int sizeof_SI_MBMS[NB_CNX_UE];
uint8_t SIB1Status_MBMS[NB_CNX_UE];
uint8_t SIStatus_MBMS[NB_CNX_UE];
LTE_SystemInformationBlockType1_t *sib1[NB_CNX_UE];
......@@ -870,14 +870,14 @@ typedef struct UE_RRC_INST_s {
SRB_INFO SL_Discovery[NB_CNX_UE];
uint8_t MBMS_flag;
uint8_t *MCCH_MESSAGE[NB_CNX_UE];
uint8_t sizeof_MCCH_MESSAGE[NB_CNX_UE];
int sizeof_MCCH_MESSAGE[NB_CNX_UE];
uint8_t MCCH_MESSAGEStatus[NB_CNX_UE];
LTE_MBSFNAreaConfiguration_r9_t *mcch_message[NB_CNX_UE];
LTE_SystemInformationBlockType12_r9_t *sib12[NB_CNX_UE];
LTE_SystemInformationBlockType13_r9_t *sib13[NB_CNX_UE];
LTE_SystemInformationBlockType13_r9_t *sib13_MBMS[NB_CNX_UE];
uint8_t FeMBMS_flag;
uint8_t num_srb;
int num_srb;
struct LTE_SRB_ToAddMod *SRB1_config[NB_CNX_UE];
struct LTE_SRB_ToAddMod *SRB2_config[NB_CNX_UE];
struct LTE_DRB_ToAddMod *DRB_config[NB_CNX_UE][8];
......
......@@ -157,7 +157,8 @@ extern RAN_CONTEXT_t RC;
* This is a helper function for xer_sprint, which directs all incoming data
* into the provided string.
*/
static int xer__nr_print2s (const void *buffer, size_t size, void *app_key) {
static int xer__nr_print2s(const void *buffer, size_t size, void *app_key)
{
xer_sprint_string_t *string_buffer = (xer_sprint_string_t *) app_key;
size_t string_remaining = string_buffer->string_size - string_buffer->string_index;
......@@ -173,7 +174,8 @@ static int xer__nr_print2s (const void *buffer, size_t size, void *app_key) {
return 0;
}
int xer_nr_sprint (char *string, size_t string_size, asn_TYPE_descriptor_t *td, void *sptr) {
int xer_nr_sprint(char *string, size_t string_size, asn_TYPE_descriptor_t *td, void *sptr)
{
asn_enc_rval_t er;
xer_sprint_string_t string_buffer;
string_buffer.string = string;
......@@ -196,7 +198,7 @@ int xer_nr_sprint (char *string, size_t string_size, asn_TYPE_descriptor_t *td,
//------------------------------------------------------------------------------
uint8_t do_SIB23_NR(rrc_gNB_carrier_data_t *carrier)
int do_SIB23_NR(rrc_gNB_carrier_data_t *carrier)
{
asn_enc_rval_t enc_rval;
SystemInformation_IEs__sib_TypeAndInfo__Member *sib2 = NULL;
......@@ -516,13 +518,12 @@ int do_RRCSetup(rrc_gNB_ue_context_t *const ue_context_pP,
return ((enc_rval.encoded + 7) / 8);
}
uint8_t do_NR_SecurityModeCommand(
int do_NR_SecurityModeCommand(
const protocol_ctxt_t *const ctxt_pP,
uint8_t *const buffer,
const uint8_t Transaction_id,
const uint8_t cipheringAlgorithm,
NR_IntegrityProtAlgorithm_t integrityProtAlgorithm
)
NR_IntegrityProtAlgorithm_t integrityProtAlgorithm)
//------------------------------------------------------------------------------
{
NR_DL_DCCH_Message_t dl_dcch_msg={0};
......@@ -562,9 +563,9 @@ uint8_t do_NR_SecurityModeCommand(
/*TODO*/
//------------------------------------------------------------------------------
uint8_t do_NR_SA_UECapabilityEnquiry( const protocol_ctxt_t *const ctxt_pP,
uint8_t *const buffer,
const uint8_t Transaction_id)
int do_NR_SA_UECapabilityEnquiry(const protocol_ctxt_t *const ctxt_pP,
uint8_t *const buffer,
const uint8_t Transaction_id)
//------------------------------------------------------------------------------
{
NR_UE_CapabilityRequestFilterNR_t *sa_band_filter;
......@@ -663,17 +664,17 @@ int do_NR_RRCRelease(uint8_t *buffer, size_t buffer_size, uint8_t Transaction_id
}
//------------------------------------------------------------------------------
int16_t do_RRCReconfiguration(const gNB_RRC_UE_t *UE,
uint8_t *buffer,
size_t buffer_size,
uint8_t Transaction_id,
NR_SRB_ToAddModList_t *SRB_configList,
NR_DRB_ToAddModList_t *DRB_configList,
NR_DRB_ToReleaseList_t *DRB_releaseList,
NR_SecurityConfig_t *security_config,
NR_MeasConfig_t *meas_config,
struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList *dedicatedNAS_MessageList,
NR_CellGroupConfig_t *cellGroupConfig)
int do_RRCReconfiguration(const gNB_RRC_UE_t *UE,
uint8_t *buffer,
size_t buffer_size,
uint8_t Transaction_id,
NR_SRB_ToAddModList_t *SRB_configList,
NR_DRB_ToAddModList_t *DRB_configList,
NR_DRB_ToReleaseList_t *DRB_releaseList,
NR_SecurityConfig_t *security_config,
NR_MeasConfig_t *meas_config,
struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList *dedicatedNAS_MessageList,
NR_CellGroupConfig_t *cellGroupConfig)
//------------------------------------------------------------------------------
{
NR_DL_DCCH_Message_t dl_dcch_msg={0};
......@@ -816,12 +817,10 @@ int do_RRCSetupRequest(uint8_t *buffer, size_t buffer_size, uint8_t *rv)
}
//------------------------------------------------------------------------------
uint8_t
do_NR_RRCReconfigurationComplete_for_nsa(
int do_NR_RRCReconfigurationComplete_for_nsa(
uint8_t *buffer,
size_t buffer_size,
NR_RRC_TransactionIdentifier_t Transaction_id
)
NR_RRC_TransactionIdentifier_t Transaction_id)
//------------------------------------------------------------------------------
{
NR_RRCReconfigurationComplete_t rrc_complete_msg;
......@@ -849,7 +848,7 @@ do_NR_RRCReconfigurationComplete_for_nsa(
}
//------------------------------------------------------------------------------
uint8_t do_NR_RRCReconfigurationComplete(uint8_t *buffer, size_t buffer_size, const uint8_t Transaction_id)
int do_NR_RRCReconfigurationComplete(uint8_t *buffer, size_t buffer_size, const uint8_t Transaction_id)
//------------------------------------------------------------------------------
{
NR_UL_DCCH_Message_t ul_dcch_msg = {0};
......@@ -874,12 +873,12 @@ uint8_t do_NR_RRCReconfigurationComplete(uint8_t *buffer, size_t buffer_size, co
return((enc_rval.encoded+7)/8);
}
uint8_t do_RRCSetupComplete(uint8_t *buffer,
size_t buffer_size,
const uint8_t Transaction_id,
uint8_t sel_plmn_id,
const int dedicatedInfoNASLength,
const char *dedicatedInfoNAS)
int do_RRCSetupComplete(uint8_t *buffer,
size_t buffer_size,
const uint8_t Transaction_id,
uint8_t sel_plmn_id,
const int dedicatedInfoNASLength,
const char *dedicatedInfoNAS)
{
NR_UL_DCCH_Message_t ul_dcch_msg = {0};
ul_dcch_msg.message.present = NR_UL_DCCH_MessageType_PR_c1;
......@@ -914,11 +913,11 @@ uint8_t do_RRCSetupComplete(uint8_t *buffer,
return((enc_rval.encoded+7)/8);
}
uint8_t do_NR_DLInformationTransfer(uint8_t *buffer,
size_t buffer_len,
uint8_t transaction_id,
uint32_t pdu_length,
uint8_t *pdu_buffer)
int do_NR_DLInformationTransfer(uint8_t *buffer,
size_t buffer_len,
uint8_t transaction_id,
uint32_t pdu_length,
uint8_t *pdu_buffer)
{
NR_DL_DCCH_Message_t dl_dcch_msg = {0};
dl_dcch_msg.message.present = NR_DL_DCCH_MessageType_PR_c1;
......@@ -944,7 +943,8 @@ uint8_t do_NR_DLInformationTransfer(uint8_t *buffer,
return (r.encoded + 7) / 8;
}
uint8_t do_NR_ULInformationTransfer(uint8_t **buffer, uint32_t pdu_length, uint8_t *pdu_buffer) {
int do_NR_ULInformationTransfer(uint8_t **buffer, uint32_t pdu_length, uint8_t *pdu_buffer)
{
ssize_t encoded;
NR_UL_DCCH_Message_t ul_dcch_msg;
memset(&ul_dcch_msg, 0, sizeof(NR_UL_DCCH_Message_t));
......@@ -967,10 +967,10 @@ uint8_t do_NR_ULInformationTransfer(uint8_t **buffer, uint32_t pdu_length, uint8
return encoded;
}
uint8_t do_RRCReestablishmentRequest(uint8_t *buffer,
NR_ReestablishmentCause_t cause,
uint32_t cell_id,
uint16_t c_rnti)
int do_RRCReestablishmentRequest(uint8_t *buffer,
NR_ReestablishmentCause_t cause,
uint32_t cell_id,
uint16_t c_rnti)
{
asn_enc_rval_t enc_rval;
NR_UL_CCCH_Message_t ul_ccch_msg;
......@@ -1182,7 +1182,7 @@ void free_defaultMeasConfig(NR_MeasConfig_t *mc)
ASN_STRUCT_FREE(asn_DEF_NR_MeasConfig, mc);
}
uint8_t do_NR_Paging(uint8_t Mod_id, uint8_t *buffer, uint32_t tmsi)
int do_NR_Paging(uint8_t Mod_id, uint8_t *buffer, uint32_t tmsi)
{
LOG_D(NR_RRC, "[gNB %d] do_NR_Paging start\n", Mod_id);
NR_PCCH_Message_t pcch_msg;
......
......@@ -53,7 +53,7 @@
*/
int xer_sprint_NR(char *string, size_t string_size, struct asn_TYPE_descriptor_s *td, void *sptr);
uint8_t do_SIB23_NR(rrc_gNB_carrier_data_t *carrier);
int do_SIB23_NR(rrc_gNB_carrier_data_t *carrier);
int do_RRCReject(uint8_t *const buffer);
......@@ -81,58 +81,58 @@ int do_RRCSetup(rrc_gNB_ue_context_t *const ue_context_pP,
const gNB_RrcConfigurationReq *configuration,
NR_SRB_ToAddModList_t *SRBs);
uint8_t do_NR_SecurityModeCommand(
int do_NR_SecurityModeCommand(
const protocol_ctxt_t *const ctxt_pP,
uint8_t *const buffer,
const uint8_t Transaction_id,
const uint8_t cipheringAlgorithm,
NR_IntegrityProtAlgorithm_t integrityProtAlgorithm);
uint8_t do_NR_SA_UECapabilityEnquiry( const protocol_ctxt_t *const ctxt_pP,
uint8_t *const buffer,
const uint8_t Transaction_id);
int do_NR_SA_UECapabilityEnquiry(const protocol_ctxt_t *const ctxt_pP,
uint8_t *const buffer,
const uint8_t Transaction_id);
int do_NR_RRCRelease(uint8_t *buffer, size_t buffer_size, uint8_t Transaction_id);
int16_t do_RRCReconfiguration(const gNB_RRC_UE_t *UE,
uint8_t *buffer,
size_t buffer_size,
uint8_t Transaction_id,
NR_SRB_ToAddModList_t *SRB_configList,
NR_DRB_ToAddModList_t *DRB_configList,
NR_DRB_ToReleaseList_t *DRB_releaseList,
NR_SecurityConfig_t *security_config,
NR_MeasConfig_t *meas_config,
struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList *dedicatedNAS_MessageList,
NR_CellGroupConfig_t *cellGroupConfig);
uint8_t do_RRCSetupComplete(uint8_t *buffer,
size_t buffer_size,
const uint8_t Transaction_id,
uint8_t sel_plmn_id,
const int dedicatedInfoNASLength,
const char *dedicatedInfoNAS);
int do_RRCReconfiguration(const gNB_RRC_UE_t *UE,
uint8_t *buffer,
size_t buffer_size,
uint8_t Transaction_id,
NR_SRB_ToAddModList_t *SRB_configList,
NR_DRB_ToAddModList_t *DRB_configList,
NR_DRB_ToReleaseList_t *DRB_releaseList,
NR_SecurityConfig_t *security_config,
NR_MeasConfig_t *meas_config,
struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList *dedicatedNAS_MessageList,
NR_CellGroupConfig_t *cellGroupConfig);
int do_RRCSetupComplete(uint8_t *buffer,
size_t buffer_size,
const uint8_t Transaction_id,
uint8_t sel_plmn_id,
const int dedicatedInfoNASLength,
const char *dedicatedInfoNAS);
int do_RRCSetupRequest(uint8_t *buffer, size_t buffer_size, uint8_t *rv);
uint8_t do_NR_RRCReconfigurationComplete_for_nsa(uint8_t *buffer, size_t buffer_size, NR_RRC_TransactionIdentifier_t Transaction_id);
int do_NR_RRCReconfigurationComplete_for_nsa(uint8_t *buffer, size_t buffer_size, NR_RRC_TransactionIdentifier_t Transaction_id);
uint8_t do_NR_RRCReconfigurationComplete(uint8_t *buffer, size_t buffer_size, const uint8_t Transaction_id);
int do_NR_RRCReconfigurationComplete(uint8_t *buffer, size_t buffer_size, const uint8_t Transaction_id);
uint8_t do_NR_DLInformationTransfer(uint8_t *buffer,
size_t buffer_len,
uint8_t transaction_id,
uint32_t pdu_length,
uint8_t *pdu_buffer);
int do_NR_DLInformationTransfer(uint8_t *buffer,
size_t buffer_len,
uint8_t transaction_id,
uint32_t pdu_length,
uint8_t *pdu_buffer);
uint8_t do_NR_ULInformationTransfer(uint8_t **buffer,
uint32_t pdu_length,
uint8_t *pdu_buffer);
int do_NR_ULInformationTransfer(uint8_t **buffer,
uint32_t pdu_length,
uint8_t *pdu_buffer);
uint8_t do_RRCReestablishmentRequest(uint8_t *buffer,
NR_ReestablishmentCause_t cause,
uint32_t cell_id,
uint16_t c_rnti);
int do_RRCReestablishmentRequest(uint8_t *buffer,
NR_ReestablishmentCause_t cause,
uint32_t cell_id,
uint16_t c_rnti);
int do_RRCReestablishment(rrc_gNB_ue_context_t *const ue_context_pP,
uint8_t *const buffer,
......@@ -145,6 +145,6 @@ int do_RRCReestablishmentComplete(uint8_t *buffer, size_t buffer_size, int64_t r
NR_MeasConfig_t *get_defaultMeasConfig(const NR_MeasTiming_t *mt, int band, int scs);
void free_defaultMeasConfig(NR_MeasConfig_t *mc);
uint8_t do_NR_Paging(uint8_t Mod_id, uint8_t *buffer, uint32_t tmsi);
int do_NR_Paging(uint8_t Mod_id, uint8_t *buffer, uint32_t tmsi);
#endif /* __RRC_NR_MESSAGES_ASN1_MSG__H__ */
......@@ -301,7 +301,7 @@ typedef struct gNB_RRC_UE_s {
ngap_security_capabilities_t security_capabilities;
//NSA block
/* Number of NSA e_rab */
uint8_t nb_of_e_rabs;
int nb_of_e_rabs;
/* list of pdu session to be setup by RRC layers */
nr_e_rab_param_t e_rab[NB_RB_MAX];//[S1AP_MAX_E_RAB];
uint32_t nsa_gtp_teid[S1AP_MAX_E_RAB];
......@@ -339,7 +339,7 @@ typedef struct rrc_gNB_ue_context_s {
typedef struct {
uint8_t *SIB23;
uint8_t sizeof_SIB23;
int sizeof_SIB23;
} rrc_gNB_carrier_data_t;
//---------------------------------------------------
......
......@@ -2366,7 +2366,6 @@ void rrc_gNB_generate_SecurityModeCommand(const protocol_ctxt_t *const ctxt_pP,
//-----------------------------------------------------------------------------
{
uint8_t buffer[100];
uint8_t size;
gNB_RRC_UE_t *ue_p = &ue_context_pP->ue_context;
AssertFatal(!ue_p->as_security_active, "logic error: security already active\n");
......@@ -2376,11 +2375,11 @@ void rrc_gNB_generate_SecurityModeCommand(const protocol_ctxt_t *const ctxt_pP,
T_INT(ctxt_pP->subframe),
T_INT(ctxt_pP->rntiMaybeUEid));
NR_IntegrityProtAlgorithm_t integrity_algorithm = (NR_IntegrityProtAlgorithm_t)ue_p->integrity_algorithm;
size = do_NR_SecurityModeCommand(ctxt_pP,
buffer,
rrc_gNB_get_next_transaction_identifier(ctxt_pP->module_id),
ue_p->ciphering_algorithm,
integrity_algorithm);
int size = do_NR_SecurityModeCommand(ctxt_pP,
buffer,
rrc_gNB_get_next_transaction_identifier(ctxt_pP->module_id),
ue_p->ciphering_algorithm,
integrity_algorithm);
LOG_DUMPMSG(NR_RRC, DEBUG_RRC, (char *)buffer, size, "[MSG] RRC Security Mode Command\n");
LOG_I(NR_RRC, "UE %u Logical Channel DL-DCCH, Generate SecurityModeCommand (bytes %d)\n", ue_p->rrc_ue_id, size);
......@@ -2395,14 +2394,13 @@ rrc_gNB_generate_UECapabilityEnquiry(
)
//-----------------------------------------------------------------------------
{
uint8_t buffer[100];
uint8_t size;
uint8_t buffer[100];
T(T_ENB_RRC_UE_CAPABILITY_ENQUIRY, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rntiMaybeUEid));
gNB_RRC_UE_t *ue = &ue_context_pP->ue_context;
uint8_t xid = rrc_gNB_get_next_transaction_identifier(ctxt_pP->module_id);
ue->xids[xid] = RRC_UECAPABILITY_ENQUIRY;
size = do_NR_SA_UECapabilityEnquiry(ctxt_pP, buffer, xid);
int size = do_NR_SA_UECapabilityEnquiry(ctxt_pP, buffer, xid);
LOG_I(NR_RRC, "UE %d: Logical Channel DL-DCCH, Generate NR UECapabilityEnquiry (bytes %d, xid %d)\n", ue->rrc_ue_id, size, xid);
gNB_RRC_INST *rrc = RC.nrrrc[ctxt_pP->module_id];
......@@ -2470,7 +2468,6 @@ int rrc_gNB_generate_pcch_msg(sctp_assoc_t assoc_id, const NR_SIB1_t *sib1, uint
uint32_t N; /* N: min(T,nB). total count of PF in one DRX cycle */
uint32_t Ns = 0; /* Ns: max(1,nB/T) */
uint32_t T; /* DRX cycle */
uint32_t length;
uint8_t buffer[RRC_BUF_SIZE];
/* get default DRX cycle from configuration */
......@@ -2535,9 +2532,7 @@ int rrc_gNB_generate_pcch_msg(sctp_assoc_t assoc_id, const NR_SIB1_t *sib1, uint
(void) pfoffset; /* not used, suppress warning */
/* Create message for PDCP (DLInformationTransfer_t) */
length = do_NR_Paging (instance,
buffer,
tmsi);
int length = do_NR_Paging(instance, buffer, tmsi);
if (length == -1) {
LOG_I(NR_RRC, "do_Paging error\n");
......
......@@ -891,7 +891,6 @@ static void nr_rrc_ue_process_masterCellGroup(NR_UE_RRC_INST_t *rrc,
static void rrc_ue_generate_RRCSetupComplete(const NR_UE_RRC_INST_t *rrc, const uint8_t Transaction_id)
{
uint8_t buffer[100];
uint8_t size;
const char *nas_msg;
int nas_msg_length;
......@@ -906,7 +905,7 @@ static void rrc_ue_generate_RRCSetupComplete(const NR_UE_RRC_INST_t *rrc, const
nas_msg_length = sizeof(nr_nas_attach_req_imsi_dummy_NSA_case);
}
size = do_RRCSetupComplete(buffer, sizeof(buffer), Transaction_id, rrc->selected_plmn_identity, nas_msg_length, nas_msg);
int size = do_RRCSetupComplete(buffer, sizeof(buffer), Transaction_id, rrc->selected_plmn_identity, nas_msg_length, nas_msg);
LOG_I(NR_RRC, "[UE %ld][RAPROC] Logical Channel UL-DCCH (SRB1), Generating RRCSetupComplete (bytes%d)\n", rrc->ue_id, size);
int srb_id = 1; // RRC setup complete on SRB1
LOG_D(NR_RRC, "[RRC_UE %ld] PDCP_DATA_REQ/%d Bytes RRCSetupComplete ---> %d\n", rrc->ue_id, size, srb_id);
......@@ -1522,8 +1521,8 @@ static void nr_rrc_ue_process_RadioBearerConfig(NR_UE_RRC_INST_t *ue_rrc,
static void nr_rrc_ue_generate_RRCReconfigurationComplete(NR_UE_RRC_INST_t *rrc, const int srb_id, const uint8_t Transaction_id)
{
uint8_t buffer[32], size;
size = do_NR_RRCReconfigurationComplete(buffer, sizeof(buffer), Transaction_id);
uint8_t buffer[32];
int size = do_NR_RRCReconfigurationComplete(buffer, sizeof(buffer), Transaction_id);
LOG_I(NR_RRC, " Logical Channel UL-DCCH (SRB1), Generating RRCReconfigurationComplete (bytes %d)\n", size);
AssertFatal(srb_id == 1 || srb_id == 3, "Invalid SRB ID %d\n", srb_id);
LOG_D(RLC,
......
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