Commit ca9748ec authored by Raymond Knopp's avatar Raymond Knopp

corrections to RNTI coding/decoding in openair3/conversions.h

parent eedc4226
...@@ -87,31 +87,29 @@ int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance, ...@@ -87,31 +87,29 @@ int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
/* RNTI */ /* RNTI */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_InitialULRRCMessageTransferIEs_t, ie, container, F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_InitialULRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_C_RNTI, true); F1AP_ProtocolIE_ID_id_C_RNTI, true);
BIT_STRING_TO_CELL_IDENTITY(&ie->value.choice.C_RNTI, rnti); BUFFER_TO_INT16(ie->value.choice.C_RNTI.buf, rnti);
/* RRC Container */ /* RRC Container */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_InitialULRRCMessageTransferIEs_t, ie, container, F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_InitialULRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_RRCContainer, true); F1AP_ProtocolIE_ID_id_RRCContainer, true);
ccch_sdu = calloc(ie->value.choice.RRCContainer.size + 1, sizeof(char)); // create an ITTI message and copy SDU
memcpy(ccch_sdu, ie->value.choice.RRCContainer.buf,
ie->value.choice.RRCContainer.size);
/* Convert the mme name to a printable string */
ccch_sdu[ie->value.choice.RRCContainer.size] = '\0';
printf ("RRCContainer %s \n", ccch_sdu);
ccch_sdu_len = ie->value.choice.RRCContainer.size;
// create an ITTI message
message_p = itti_alloc_new_message (TASK_CU_F1, RRC_MAC_CCCH_DATA_IND); message_p = itti_alloc_new_message (TASK_CU_F1, RRC_MAC_CCCH_DATA_IND);
memset (RRC_MAC_CCCH_DATA_IND (message_p).sdu, 0, CCCH_SDU_SIZE); memset (RRC_MAC_CCCH_DATA_IND (message_p).sdu, 0, CCCH_SDU_SIZE);
memcpy (RRC_MAC_CCCH_DATA_IND (message_p).sdu, ccch_sdu, ccch_sdu_len); ccch_sdu_len = ie->value.choice.RRCContainer.size;
memcpy(RRC_MAC_CCCH_DATA_IND (message_p).sdu, ie->value.choice.RRCContainer.buf,
ccch_sdu_len);
printf ("RRCContainer(CCCH) :");
for (int i=0;i<ie->value.choice.RRCContainer.size;i++) printf("%2x ",RRC_MAC_CCCH_DATA_IND (message_p).sdu[i]);
RRC_MAC_CCCH_DATA_IND (message_p).frame = 0; RRC_MAC_CCCH_DATA_IND (message_p).frame = 0;
RRC_MAC_CCCH_DATA_IND (message_p).sub_frame = 0; RRC_MAC_CCCH_DATA_IND (message_p).sub_frame = 0;
RRC_MAC_CCCH_DATA_IND (message_p).sdu_size = ccch_sdu_len; RRC_MAC_CCCH_DATA_IND (message_p).sdu_size = ccch_sdu_len;
RRC_MAC_CCCH_DATA_IND (message_p).enb_index = instance; // CU instance RRC_MAC_CCCH_DATA_IND (message_p).enb_index = instance; // CU instance
RRC_MAC_CCCH_DATA_IND (message_p).rnti = rnti; RRC_MAC_CCCH_DATA_IND (message_p).rnti = rnti;
RRC_MAC_CCCH_DATA_IND (message_p).CC_id = CC_id; RRC_MAC_CCCH_DATA_IND (message_p).CC_id = CC_id;
printf("Sending ITTI message to instance %d, rnti %x\n",instance,rnti);
itti_send_msg_to_task (TASK_RRC_ENB, instance, message_p); itti_send_msg_to_task (TASK_RRC_ENB, instance, message_p);
......
...@@ -119,19 +119,19 @@ void *F1AP_CU_task(void *arg) { ...@@ -119,19 +119,19 @@ void *F1AP_CU_task(void *arg) {
switch (ITTI_MSG_ID(received_msg)) { switch (ITTI_MSG_ID(received_msg)) {
case SCTP_NEW_ASSOCIATION_IND: case SCTP_NEW_ASSOCIATION_IND:
LOG_I(CU_F1AP, "SCTP_NEW_ASSOCIATION_IND\n"); LOG_I(CU_F1AP, "SCTP_NEW_ASSOCIATION_IND for instance %d\n",ITTI_MESSAGE_GET_INSTANCE(received_msg));
cu_task_handle_sctp_association_ind(ITTI_MESSAGE_GET_INSTANCE(received_msg), cu_task_handle_sctp_association_ind(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&received_msg->ittiMsg.sctp_new_association_ind); &received_msg->ittiMsg.sctp_new_association_ind);
break; break;
case SCTP_NEW_ASSOCIATION_RESP: case SCTP_NEW_ASSOCIATION_RESP:
LOG_I(CU_F1AP, "SCTP_NEW_ASSOCIATION_RESP\n"); LOG_I(CU_F1AP, "SCTP_NEW_ASSOCIATION_RESP for instance %d\n",ITTI_MESSAGE_GET_INSTANCE(received_msg));
cu_task_handle_sctp_association_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg), cu_task_handle_sctp_association_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&received_msg->ittiMsg.sctp_new_association_resp); &received_msg->ittiMsg.sctp_new_association_resp);
break; break;
case SCTP_DATA_IND: case SCTP_DATA_IND:
LOG_I(CU_F1AP, "SCTP_DATA_IND\n"); LOG_I(CU_F1AP, "SCTP_DATA_IND for Instance %d\n",ITTI_MESSAGE_GET_INSTANCE(received_msg));
cu_task_handle_sctp_data_ind(ITTI_MESSAGE_GET_INSTANCE(received_msg), cu_task_handle_sctp_data_ind(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&received_msg->ittiMsg.sctp_data_ind); &received_msg->ittiMsg.sctp_data_ind);
break; break;
......
...@@ -46,6 +46,10 @@ static int f1ap_decode_initiating_message(F1AP_F1AP_PDU_t *pdu) ...@@ -46,6 +46,10 @@ static int f1ap_decode_initiating_message(F1AP_F1AP_PDU_t *pdu)
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu); res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu);
printf("f1ap_eNB_decode_initiating_message!\n"); printf("f1ap_eNB_decode_initiating_message!\n");
break; break;
case F1AP_ProcedureCode_id_InitialULRRCMessageTransfer:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu);
printf("f1ap_eNB_decode_initiating_message!\n");
break;
// case F1AP_ProcedureCode_id_InitialContextSetup: // case F1AP_ProcedureCode_id_InitialContextSetup:
// res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu); // res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu);
// message_id = F1AP_INITIAL_CONTEXT_SETUP_LOG; // message_id = F1AP_INITIAL_CONTEXT_SETUP_LOG;
......
...@@ -116,6 +116,7 @@ int f1ap_handle_message(instance_t instance, uint32_t assoc_id, int32_t stream, ...@@ -116,6 +116,7 @@ int f1ap_handle_message(instance_t instance, uint32_t assoc_id, int32_t stream,
} }
/* Calling the right handler */ /* Calling the right handler */
printf("Calling handler with instance %d\n",instance);
ret = (*f1ap_messages_callback[pdu.choice.initiatingMessage->procedureCode][pdu.present - 1]) ret = (*f1ap_messages_callback[pdu.choice.initiatingMessage->procedureCode][pdu.present - 1])
(instance, assoc_id, stream, &pdu); (instance, assoc_id, stream, &pdu);
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_F1AP_F1AP_PDU, &pdu); ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_F1AP_F1AP_PDU, &pdu);
......
...@@ -838,7 +838,6 @@ void *sctp_eNB_task(void *arg) ...@@ -838,7 +838,6 @@ void *sctp_eNB_task(void *arg)
break; break;
case SCTP_DATA_REQ: { case SCTP_DATA_REQ: {
printf("SCTP: Sending message via SCTP\n");
sctp_send_data(ITTI_MESSAGE_GET_INSTANCE(received_msg), sctp_send_data(ITTI_MESSAGE_GET_INSTANCE(received_msg),
ITTI_MSG_ORIGIN_ID(received_msg), ITTI_MSG_ORIGIN_ID(received_msg),
&received_msg->ittiMsg.sctp_data_req); &received_msg->ittiMsg.sctp_data_req);
......
...@@ -258,8 +258,8 @@ do { \ ...@@ -258,8 +258,8 @@ do { \
#define C_RNTI_TO_BIT_STRING(mACRO, bITsTRING) \ #define C_RNTI_TO_BIT_STRING(mACRO, bITsTRING) \
do { \ do { \
(bITsTRING)->buf = calloc(2, sizeof(uint8_t)); \ (bITsTRING)->buf = calloc(2, sizeof(uint8_t)); \
(bITsTRING)->buf[0] = (mACRO) >> 4; \ (bITsTRING)->buf[0] = (mACRO) >> 8; \
(bITsTRING)->buf[1] = ((mACRO) & 0x0f) << 4; \ (bITsTRING)->buf[1] = ((mACRO) & 0x0ff); \
(bITsTRING)->size = 2; \ (bITsTRING)->size = 2; \
(bITsTRING)->bits_unused = 0; \ (bITsTRING)->bits_unused = 0; \
} while(0) } while(0)
......
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