Commit df867e53 authored by francescomani's avatar francescomani

formatting

parent 07c5cf3c
......@@ -237,15 +237,13 @@ static void nr_rrc_ue_process_rrcReconfiguration(NR_UE_RRC_INST_t *rrc,
void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type, void *message, int msg_len)
{
switch (nsa_message_type) {
case nr_SecondaryCellGroupConfig_r15:
{
case nr_SecondaryCellGroupConfig_r15: {
NR_RRCReconfiguration_t *RRCReconfiguration=NULL;
asn_dec_rval_t dec_rval = uper_decode_complete( NULL,
asn_dec_rval_t dec_rval = uper_decode_complete(NULL,
&asn_DEF_NR_RRCReconfiguration,
(void **)&RRCReconfiguration,
(uint8_t *)message,
msg_len);
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
LOG_E(NR_RRC, "NR_RRCReconfiguration decode error\n");
// free the memory
......@@ -257,15 +255,13 @@ void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type,
}
break;
case nr_RadioBearerConfigX_r15:
{
case nr_RadioBearerConfigX_r15: {
NR_RadioBearerConfig_t *RadioBearerConfig=NULL;
asn_dec_rval_t dec_rval = uper_decode_complete( NULL,
asn_dec_rval_t dec_rval = uper_decode_complete(NULL,
&asn_DEF_NR_RadioBearerConfig,
(void **)&RadioBearerConfig,
(uint8_t *)message,
msg_len);
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
LOG_E(NR_RRC, "NR_RadioBearerConfig decode error\n");
// free the memory
......@@ -1578,7 +1574,6 @@ static void nr_rrc_ue_process_ueCapabilityEnquiry(NR_UE_RRC_INST_t *rrc, NR_UECa
}
static void nr_rrc_ue_generate_rrcReestablishmentComplete(NR_RRCReestablishment_t *rrcReestablishment)
//-----------------------------------------------------------------------------
{
uint8_t buffer[RRC_BUFFER_SIZE] = {0};
int size = do_RRCReestablishmentComplete(buffer, RRC_BUFFER_SIZE,
......@@ -1590,18 +1585,14 @@ void *recv_msgs_from_lte_ue(void *args_p)
{
itti_mark_task_ready (TASK_RRC_NSA_NRUE);
int from_lte_ue_fd = get_from_lte_ue_fd();
for (;;)
{
for (;;) {
nsa_msg_t msg;
int recvLen = recvfrom(from_lte_ue_fd, &msg, sizeof(msg),
MSG_WAITALL | MSG_TRUNC, NULL, NULL);
if (recvLen == -1)
{
int recvLen = recvfrom(from_lte_ue_fd, &msg, sizeof(msg), MSG_WAITALL | MSG_TRUNC, NULL, NULL);
if (recvLen == -1) {
LOG_E(NR_RRC, "%s: recvfrom: %s\n", __func__, strerror(errno));
continue;
}
if (recvLen > sizeof(msg))
{
if (recvLen > sizeof(msg)) {
LOG_E(NR_RRC, "%s: Received truncated message %d\n", __func__, recvLen);
continue;
}
......@@ -1644,8 +1635,7 @@ static void nsa_rrc_ue_process_ueCapabilityEnquiry(NR_UE_RRC_INST_t *rrc)
static void process_lte_nsa_msg(NR_UE_RRC_INST_t *rrc, nsa_msg_t *msg, int msg_len)
{
if (msg_len < sizeof(msg->msg_type))
{
if (msg_len < sizeof(msg->msg_type)) {
LOG_E(RRC, "Msg_len = %d\n", msg_len);
return;
}
......@@ -1653,10 +1643,8 @@ static void process_lte_nsa_msg(NR_UE_RRC_INST_t *rrc, nsa_msg_t *msg, int msg_l
Rrc_Msg_Type_t msg_type = msg->msg_type;
uint8_t *const msg_buffer = msg->msg_buffer;
msg_len -= sizeof(msg->msg_type);
switch (msg_type)
{
case UE_CAPABILITY_ENQUIRY:
{
switch (msg_type) {
case UE_CAPABILITY_ENQUIRY: {
LOG_D(NR_RRC, "We are processing a %d message \n", msg_type);
NR_FreqBandList_t *nr_freq_band_list = NULL;
asn_dec_rval_t dec_rval = uper_decode_complete(NULL,
......@@ -1664,14 +1652,12 @@ static void process_lte_nsa_msg(NR_UE_RRC_INST_t *rrc, nsa_msg_t *msg, int msg_l
(void **)&nr_freq_band_list,
msg_buffer,
msg_len);
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0))
{
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
SEQUENCE_free(&asn_DEF_NR_FreqBandList, nr_freq_band_list, ASFM_FREE_EVERYTHING);
LOG_E(RRC, "Failed to decode UECapabilityInfo (%zu bits)\n", dec_rval.consumed);
break;
}
for (int i = 0; i < nr_freq_band_list->list.count; i++)
{
for (int i = 0; i < nr_freq_band_list->list.count; i++) {
LOG_D(NR_RRC, "Received NR band information: %ld.\n",
nr_freq_band_list->list.array[i]->choice.bandInformationNR->bandNR);
}
......@@ -1682,8 +1668,7 @@ static void process_lte_nsa_msg(NR_UE_RRC_INST_t *rrc, nsa_msg_t *msg, int msg_l
break;
}
case NRUE_CAPABILITY_ENQUIRY:
{
case NRUE_CAPABILITY_ENQUIRY: {
LOG_I(NR_RRC, "We are processing a %d message \n", msg_type);
NR_FreqBandList_t *nr_freq_band_list = NULL;
asn_dec_rval_t dec_rval = uper_decode_complete(NULL,
......@@ -1691,8 +1676,7 @@ static void process_lte_nsa_msg(NR_UE_RRC_INST_t *rrc, nsa_msg_t *msg, int msg_l
(void **)&nr_freq_band_list,
msg_buffer,
msg_len);
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0))
{
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
SEQUENCE_free(&asn_DEF_NR_FreqBandList, nr_freq_band_list, ASFM_FREE_EVERYTHING);
LOG_E(NR_RRC, "Failed to decode UECapabilityInfo (%zu bits)\n", dec_rval.consumed);
break;
......@@ -1702,8 +1686,7 @@ static void process_lte_nsa_msg(NR_UE_RRC_INST_t *rrc, nsa_msg_t *msg, int msg_l
break;
}
case RRC_MEASUREMENT_PROCEDURE:
{
case RRC_MEASUREMENT_PROCEDURE: {
LOG_I(NR_RRC, "We are processing a %d message \n", msg_type);
LTE_MeasObjectToAddMod_t *nr_meas_obj = NULL;
......@@ -1712,8 +1695,7 @@ static void process_lte_nsa_msg(NR_UE_RRC_INST_t *rrc, nsa_msg_t *msg, int msg_l
(void **)&nr_meas_obj,
msg_buffer,
msg_len);
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0))
{
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
SEQUENCE_free(&asn_DEF_NR_MeasObjectToAddMod, nr_meas_obj, ASFM_FREE_EVERYTHING);
LOG_E(RRC, "Failed to decode measurement object (%zu bits) %d\n", dec_rval.consumed, dec_rval.code);
break;
......@@ -1724,8 +1706,8 @@ static void process_lte_nsa_msg(NR_UE_RRC_INST_t *rrc, nsa_msg_t *msg, int msg_l
start_oai_nrue_threads();
break;
}
case RRC_CONFIG_COMPLETE_REQ:
{
case RRC_CONFIG_COMPLETE_REQ: {
struct msg {
uint32_t RadioBearer_size;
uint32_t SecondaryCellGroup_size;
......@@ -1742,7 +1724,8 @@ static void process_lte_nsa_msg(NR_UE_RRC_INST_t *rrc, nsa_msg_t *msg, int msg_l
"nr_RadioBearerConfig1_r15 size %u nr_SecondaryCellGroupConfig_r15 size %u sizeof(hdr) %zu, msg_len = %d\n",
nr_RadioBearer_size,
nr_SecondaryCellGroup_size,
sizeof(hdr), msg_len);
sizeof(hdr),
msg_len);
NR_RRC_TransactionIdentifier_t t_id = hdr.trans_id;
LOG_I(NR_RRC, "nr_RadioBearerConfig1_r15 size %d nr_SecondaryCellGroupConfig_r15 size %d t_id %ld\n",
nr_RadioBearer_size,
......@@ -1751,8 +1734,7 @@ static void process_lte_nsa_msg(NR_UE_RRC_INST_t *rrc, nsa_msg_t *msg, int msg_l
uint8_t *nr_RadioBearer_buffer = msg_buffer + offsetof(struct msg, buffer);
uint8_t *nr_SecondaryCellGroup_buffer = nr_RadioBearer_buffer + nr_RadioBearer_size;
process_nsa_message(NR_UE_rrc_inst, nr_SecondaryCellGroupConfig_r15, nr_SecondaryCellGroup_buffer,
nr_SecondaryCellGroup_size);
process_nsa_message(NR_UE_rrc_inst, nr_SecondaryCellGroupConfig_r15, nr_SecondaryCellGroup_buffer, nr_SecondaryCellGroup_size);
process_nsa_message(NR_UE_rrc_inst, nr_RadioBearerConfigX_r15, nr_RadioBearer_buffer, nr_RadioBearer_size);
LOG_I(NR_RRC, "Calling do_NR_RRCReconfigurationComplete. t_id %ld \n", t_id);
uint8_t buffer[RRC_BUF_SIZE];
......@@ -1761,16 +1743,13 @@ static void process_lte_nsa_msg(NR_UE_RRC_INST_t *rrc, nsa_msg_t *msg, int msg_l
break;
}
case OAI_TUN_IFACE_NSA:
{
case OAI_TUN_IFACE_NSA: {
LOG_I(NR_RRC, "We got an OAI_TUN_IFACE_NSA!!\n");
char cmd_line[RRC_BUF_SIZE];
memcpy(cmd_line, msg_buffer, sizeof(cmd_line));
LOG_D(NR_RRC, "Command line: %s\n", cmd_line);
if (background_system(cmd_line) != 0)
{
LOG_E(NR_RRC, "ESM-PROC - failed command '%s'", cmd_line);
}
break;
}
......
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