Commit ce07a11e authored by Raymond Knopp's avatar Raymond Knopp

Merge branch 'feature-127-protocol-split' of...

Merge branch 'feature-127-protocol-split' of https://gitlab.eurecom.fr/oai/openairinterface5g into feature-127-protocol-split
parents 3e987bc1 cdfca6c0
...@@ -323,7 +323,9 @@ set (RRC_FULL_DIR ${asn1_generated_dir}/RRC_${RRC_ASN1_VERSION}) ...@@ -323,7 +323,9 @@ set (RRC_FULL_DIR ${asn1_generated_dir}/RRC_${RRC_ASN1_VERSION})
message("calling asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example -D ${RRC_FULL_DIR} ${RRC_GRAMMAR}") message("calling asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example -D ${RRC_FULL_DIR} ${RRC_GRAMMAR}")
execute_process(COMMAND mkdir -p ${RRC_FULL_DIR} execute_process(COMMAND mkdir -p ${RRC_FULL_DIR}
COMMAND env asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example -D ${RRC_FULL_DIR} ${RRC_GRAMMAR} COMMAND env asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example -D ${RRC_FULL_DIR} ${RRC_GRAMMAR}
RESULT_VARIABLE ret) RESULT_VARIABLE ret
OUTPUT_QUIET
ERROR_QUIET)
if (NOT ${ret} STREQUAL 0) if (NOT ${ret} STREQUAL 0)
message(FATAL_ERROR "${ret}: error") message(FATAL_ERROR "${ret}: error")
endif (NOT ${ret} STREQUAL 0) endif (NOT ${ret} STREQUAL 0)
...@@ -384,7 +386,10 @@ set(S1AP_C_DIR ${asn1_generated_dir}/S1AP_${S1AP_RELEASE}) ...@@ -384,7 +386,10 @@ set(S1AP_C_DIR ${asn1_generated_dir}/S1AP_${S1AP_RELEASE})
message("calling ASN1C_PREFIX=S1AP_ asn1c -pdu=all -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${S1AP_C_DIR} ${S1AP_ASN_DIR}/${S1AP_ASN_FILES}") message("calling ASN1C_PREFIX=S1AP_ asn1c -pdu=all -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${S1AP_C_DIR} ${S1AP_ASN_DIR}/${S1AP_ASN_FILES}")
execute_process(COMMAND mkdir -p ${S1AP_C_DIR} execute_process(COMMAND mkdir -p ${S1AP_C_DIR}
COMMAND env "ASN1C_PREFIX=S1AP_" asn1c -pdu=all -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${S1AP_C_DIR} ${S1AP_ASN_DIR}/${S1AP_ASN_FILES} COMMAND env "ASN1C_PREFIX=S1AP_" asn1c -pdu=all -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${S1AP_C_DIR} ${S1AP_ASN_DIR}/${S1AP_ASN_FILES}
RESULT_VARIABLE ret) RESULT_VARIABLE ret
OUTPUT_QUIET
ERROR_QUIET)
if (NOT ${ret} STREQUAL 0) if (NOT ${ret} STREQUAL 0)
message(FATAL_ERROR "${ret}: error") message(FATAL_ERROR "${ret}: error")
endif (NOT ${ret} STREQUAL 0) endif (NOT ${ret} STREQUAL 0)
...@@ -451,7 +456,9 @@ set(X2AP_C_DIR ${asn1_generated_dir}/X2AP_${X2AP_RELEASE}) ...@@ -451,7 +456,9 @@ set(X2AP_C_DIR ${asn1_generated_dir}/X2AP_${X2AP_RELEASE})
message("calling ASN1C_PREFIX=X2AP_ asn1c -pdu=all -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${X2AP_C_DIR} ${X2AP_ASN_DIR}/${X2AP_ASN_FILES}") message("calling ASN1C_PREFIX=X2AP_ asn1c -pdu=all -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${X2AP_C_DIR} ${X2AP_ASN_DIR}/${X2AP_ASN_FILES}")
execute_process(COMMAND mkdir -p ${X2AP_C_DIR} execute_process(COMMAND mkdir -p ${X2AP_C_DIR}
COMMAND env "ASN1C_PREFIX=X2AP_" asn1c -pdu=all -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${X2AP_C_DIR} ${X2AP_ASN_DIR}/${X2AP_ASN_FILES} COMMAND env "ASN1C_PREFIX=X2AP_" asn1c -pdu=all -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${X2AP_C_DIR} ${X2AP_ASN_DIR}/${X2AP_ASN_FILES}
RESULT_VARIABLE ret) RESULT_VARIABLE ret
OUTPUT_QUIET
ERROR_QUIET)
if (NOT ${ret} STREQUAL 0) if (NOT ${ret} STREQUAL 0)
message(FATAL_ERROR "${ret}: error") message(FATAL_ERROR "${ret}: error")
endif (NOT ${ret} STREQUAL 0) endif (NOT ${ret} STREQUAL 0)
...@@ -498,10 +505,13 @@ set(F1AP_ASN_FILES ...@@ -498,10 +505,13 @@ set(F1AP_ASN_FILES
) )
set(F1AP_C_DIR ${asn1_generated_dir}/F1AP_${ASN1RELDIR}) set(F1AP_C_DIR ${asn1_generated_dir}/F1AP_${ASN1RELDIR})
set(ENV{ASN1C_PREFIX} F1AP_) message("calling ASN1C_PREFIX=F1AP_ asn1c -gen-PER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps -D ${F1AP_C_DIR} ${F1AP_ASN_FILES}")
execute_process(COMMAND ${asn1c_call} ${F1AP_C_DIR} ${F1AP_ASN_FILES} execute_process(COMMAND mkdir -p ${F1AP_C_DIR}
RESULT_VARIABLE reti) COMMAND env "ASN1C_PREFIX=F1AP_" asn1c -gen-PER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps -D ${F1AP_C_DIR} ${F1AP_ASN_FILES}
unset(ENV{ASN1C_PREFIX}) RESULT_VARIABLE ret
OUTPUT_QUIET
ERROR_QUIET)
if (NOT ${ret} STREQUAL 0) if (NOT ${ret} STREQUAL 0)
message(FATAL_ERROR "${asn1c_call}: error") message(FATAL_ERROR "${asn1c_call}: error")
endif (NOT ${ret} STREQUAL 0) endif (NOT ${ret} STREQUAL 0)
...@@ -533,6 +543,8 @@ add_library(F1AP ...@@ -533,6 +543,8 @@ add_library(F1AP
#${F1AP_DIR}/test.c #${F1AP_DIR}/test.c
${F1AP_DIR}/DU_F1AP.c ${F1AP_DIR}/DU_F1AP.c
${F1AP_DIR}/CU_F1AP.c ${F1AP_DIR}/CU_F1AP.c
${F1AP_DIR}/f1ap_decoder.c
${F1AP_DIR}/f1ap_handlers.c
${F1AP_DIR}/sctp_du.c ${F1AP_DIR}/sctp_du.c
${F1AP_DIR}/sctp_cu.c ${F1AP_DIR}/sctp_cu.c
) )
...@@ -540,21 +552,25 @@ add_library(F1AP ...@@ -540,21 +552,25 @@ add_library(F1AP
add_executable(test_f1ap_du add_executable(test_f1ap_du
${F1AP_DIR}/test_f1ap_du.c ${F1AP_DIR}/test_f1ap_du.c
${F1AP_DIR}/DU_F1AP.c ${F1AP_DIR}/DU_F1AP.c
${F1AP_DIR}/f1ap_decoder.c
${F1AP_DIR}/f1ap_handlers.c
${F1AP_DIR}/sctp_du.c ${F1AP_DIR}/sctp_du.c
) )
target_link_libraries(test_f1ap_du target_link_libraries(test_f1ap_du
-Wl,--start-group F1AP_LIB sctp pthread -Wl,--end-group -Wl,--start-group F1AP_LIB ${T_LIB} sctp pthread -Wl,--end-group
) )
add_executable(test_f1ap_cu add_executable(test_f1ap_cu
${F1AP_DIR}/test_f1ap_cu.c ${F1AP_DIR}/test_f1ap_cu.c
${F1AP_DIR}/CU_F1AP.c ${F1AP_DIR}/CU_F1AP.c
${F1AP_DIR}/f1ap_decoder.c
${F1AP_DIR}/f1ap_handlers.c
${F1AP_DIR}/sctp_cu.c ${F1AP_DIR}/sctp_cu.c
) )
target_link_libraries(test_f1ap_cu target_link_libraries(test_f1ap_cu
-Wl,--start-group F1AP_LIB sctp pthread -Wl,--end-group -Wl,--start-group F1AP_LIB ${T_LIB} sctp pthread -Wl,--end-group
) )
# Hardware dependant options # Hardware dependant options
......
...@@ -868,6 +868,21 @@ ID = LEGACY_F1U_ERROR ...@@ -868,6 +868,21 @@ ID = LEGACY_F1U_ERROR
GROUP = ALL:LEGACY_F1U:LEGACY_GROUP_ERROR:LEGACY GROUP = ALL:LEGACY_F1U:LEGACY_GROUP_ERROR:LEGACY
FORMAT = string,log FORMAT = string,log
ID = LEGACY_F1AP_DEBUG
DESC = F1AP DEBUG LEVEL
GROUP = ALL:LEGACY_F1AP:LEGACY_GROUP_DEBUG:LEGACY
FORMAT = string,log
ID = LEGACY_F1AP_INFO
DESC = F1AP INFO LEVEL
GROUP = ALL:LEGACY_F1AP:LEGACY_GROUP_INFO:LEGACY
FORMAT = string,log
ID = LEGACY_F1AP_ERROR
DESC = F1AP ERROR LEVEL
GROUP = ALL:LEGACY_F1AP:LEGACY_GROUP_ERROR:LEGACY
FORMAT = string,log
################# #################
#### UE LOGS #### #### UE LOGS ####
################# #################
......
...@@ -52,7 +52,7 @@ typedef struct f1ap_info { ...@@ -52,7 +52,7 @@ typedef struct f1ap_info {
/* This is the optional name provided by the MME */ /* This is the optional name provided by the MME */
char *GNB_CU_Name; char *GNB_CU_Name;
net_ip_address_t mme_net_ip_address; // useful for joining assoc_id and ip address of packets f1ap_net_ip_address_t mme_net_ip_address; // useful for joining assoc_id and ip address of packets
/* Number of input/ouput streams */ /* Number of input/ouput streams */
...@@ -87,25 +87,38 @@ uint8_t F1AP_get_next_transaction_identifier(module_id_t enb_mod_idP, module_id_ ...@@ -87,25 +87,38 @@ uint8_t F1AP_get_next_transaction_identifier(module_id_t enb_mod_idP, module_id_
void F1AP_CU_task() { void F1AP_CU_task() {
printf("Start F1AP CU task!\n"); printf("Start F1AP CU task!\n");
//sctp_cu_init(); sctp_cu_init();
// while (1) { // MessageDef *received_msg = NULL;
// int result;
// F1AP_DEBUG("Starting F1AP layer\n");
// switch () { // f1ap_eNB_prepare_internal_data();
//case F1AP_ProcedureCode_id_F1Setup: // itti_mark_task_ready(TASK_F1AP);
CU_send_F1_SETUP_RESPONSE();
//case F1AP_ProcedureCode_id_InitialULRRCMessageTransfer: // while (1) {
// CU_handle_UL_INITIAL_RRC_MESSAGE_TRANSFER (); // switch (ITTI_MSG_ID(received_msg)) {
//CU_send_DL_RRC_MESSAGE_TRANSFER(); // SRBID and RRCContainer get issue when decode. // case F1AP_SETUP_RESP:
//CU_send_UE_CONTEXT_SETUP_REQUEST(); // CU_send_F1_SETUP_RESPONSE();
//CU_send_UE_CONTEXT_MODIFICATION_REQUEST(); // break;
//CU_send_gNB_CU_CONFIGURATION_UPDATE((module_id_t)1, (module_id_t)2); // some problem found // case F1AP_INITIAL_UL_RRC_MESSAGE:
// break; // CU_handle_UL_INITIAL_RRC_MESSAGE_TRANSFER();
// break;
// case F1AP_DL_RRC_MESSAGE:
// CU_send_DL_RRC_MESSAGE_TRANSFER(); // SRBID and RRCContainer get issue when decode.
// break;
// //CU_send_UE_CONTEXT_SETUP_REQUEST();
// case F1AP_UE_CONTEXT_MODIFICATION_REQ:
// CU_send_UE_CONTEXT_MODIFICATION_REQUEST();
// break;
// //CU_send_gNB_CU_CONFIGURATION_UPDATE((module_id_t)1, (module_id_t)2); // some problem found
// break;
// default: // default:
// } // switch // } // switch
// } // while // } // while
...@@ -321,59 +334,59 @@ int f1ap_encode_pdu(F1AP_F1AP_PDU_t *pdu, uint8_t **buffer, uint32_t *length) { ...@@ -321,59 +334,59 @@ int f1ap_encode_pdu(F1AP_F1AP_PDU_t *pdu, uint8_t **buffer, uint32_t *length) {
} }
int f1ap_decode_pdu(F1AP_F1AP_PDU_t *message, uint8_t *buffer, uint32_t length) { // int f1ap_decode_pdu(F1AP_F1AP_PDU_t *message, uint8_t *buffer, uint32_t length) {
//LOG_I(F1AP,"Entering main loop of DU F1AP pdu receiver\n"); // //LOG_I(F1AP,"Entering main loop of DU F1AP pdu receiver\n");
F1AP_F1AP_PDU_t pdu; // F1AP_F1AP_PDU_t pdu;
F1AP_F1AP_PDU_t *pdu_p = &pdu; // F1AP_F1AP_PDU_t *pdu_p = &pdu;
asn_dec_rval_t dec_ret; // asn_dec_rval_t dec_ret;
DevAssert(buffer != NULL); // DevAssert(buffer != NULL);
printf("buffer = \n"); // printf("buffer = \n");
int i_ret; // int i_ret;
for (i_ret = 0; i_ret < length; i_ret++) { // for (i_ret = 0; i_ret < length; i_ret++) {
printf("%x ", *(buffer+i_ret)); // printf("%x ", *(buffer+i_ret));
} // }
printf("\n"); // printf("\n");
memset((void *)pdu_p, 0, sizeof(F1AP_F1AP_PDU_t)); // memset((void *)pdu_p, 0, sizeof(F1AP_F1AP_PDU_t));
dec_ret = aper_decode(NULL, // dec_ret = aper_decode(NULL,
&asn_DEF_F1AP_F1AP_PDU, // &asn_DEF_F1AP_F1AP_PDU,
(void **)&pdu_p, // (void **)&pdu_p,
buffer, // buffer,
length, // length,
0, // 0,
0); // 0);
xer_fprint(stdout, &asn_DEF_F1AP_F1AP_PDU, pdu_p); // xer_fprint(stdout, &asn_DEF_F1AP_F1AP_PDU, pdu_p);
printf("\n"); // printf("\n");
printf("dec_ret.code = %d \n", dec_ret.code); // printf("dec_ret.code = %d \n", dec_ret.code);
AssertFatal(dec_ret.code == RC_OK,"Failed to decode pdu\n"); // AssertFatal(dec_ret.code == RC_OK,"Failed to decode pdu\n");
// switch(pdu_p->present) { // // switch(pdu_p->present) {
// case F1AP_F1AP_PDU_PR_initiatingpdu: // // case F1AP_F1AP_PDU_PR_initiatingpdu:
// return F1AP_DU_decode_initiating_pdu(&pdu_p->choice.initiatingpdu); // // return F1AP_DU_decode_initiating_pdu(&pdu_p->choice.initiatingpdu);
// case F1AP_F1AP_PDU_PR_successfulOutcome: // // case F1AP_F1AP_PDU_PR_successfulOutcome:
// return F1AP_DU_decode_successful_outcome(&pdu_p->choice.successfulOutcome); // // return F1AP_DU_decode_successful_outcome(&pdu_p->choice.successfulOutcome);
// case F1AP_F1AP_PDU_PR_unsuccessfulOutcome: // // case F1AP_F1AP_PDU_PR_unsuccessfulOutcome:
// return F1AP_DU_decode_unsuccessful_outcome(&pdu_p->choice.unsuccessfulOutcome); // // return F1AP_DU_decode_unsuccessful_outcome(&pdu_p->choice.unsuccessfulOutcome);
// default: // // default:
// /*AssertFatal(1==0,"Unknown presence (%d) or not implemented\n", (int)pdu_p->present);*/ // // /*AssertFatal(1==0,"Unknown presence (%d) or not implemented\n", (int)pdu_p->present);*/
// break; // // break;
// } // // }
//AssertFatal(1==0,"Shouldn't get here\n"); // //AssertFatal(1==0,"Shouldn't get here\n");
return -1; // return -1;
} // }
void CU_send_F1_SETUP_FAILURE(F1AP_F1SetupFailure_t *F1SetupFailure) { void CU_send_F1_SETUP_FAILURE(F1AP_F1SetupFailure_t *F1SetupFailure) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
......
...@@ -53,7 +53,7 @@ typedef struct f1ap_info { ...@@ -53,7 +53,7 @@ typedef struct f1ap_info {
/* This is the optional name provided by the MME */ /* This is the optional name provided by the MME */
char *GNB_DU_Name; char *GNB_DU_Name;
net_ip_address_t mme_net_ip_address; // useful for joining assoc_id and ip address of packets f1ap_net_ip_address_t mme_net_ip_address; // useful for joining assoc_id and ip address of packets
/* Number of input/ouput streams */ /* Number of input/ouput streams */
...@@ -103,7 +103,7 @@ void F1AP_DU_task() { ...@@ -103,7 +103,7 @@ void F1AP_DU_task() {
// switch () { // switch () {
// case F1AP_ProcedureCode_id_F1Setup: // case F1AP_ProcedureCode_id_F1Setup:
//DU_send_F1_SETUP_REQUEST((module_id_t)1, (module_id_t)2); DU_send_F1_SETUP_REQUEST((module_id_t)1, (module_id_t)2);
// break; // break;
//DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(); //DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER();
//DU_send_UL_RRC_MESSAGE_TRANSFER(); // OK //DU_send_UL_RRC_MESSAGE_TRANSFER(); // OK
...@@ -422,59 +422,59 @@ int f1ap_encode_pdu(F1AP_F1AP_PDU_t *pdu, uint8_t **buffer, uint32_t *length) { ...@@ -422,59 +422,59 @@ int f1ap_encode_pdu(F1AP_F1AP_PDU_t *pdu, uint8_t **buffer, uint32_t *length) {
} }
int f1ap_decode_pdu(F1AP_F1AP_PDU_t *message, uint8_t *buffer, uint32_t length) { // int f1ap_decode_pdu(F1AP_F1AP_PDU_t *message, uint8_t *buffer, uint32_t length) {
//LOG_I(F1AP,"Entering main loop of DU F1AP pdu receiver\n"); // //LOG_I(F1AP,"Entering main loop of DU F1AP pdu receiver\n");
F1AP_F1AP_PDU_t pdu; // F1AP_F1AP_PDU_t pdu;
F1AP_F1AP_PDU_t *pdu_p = &pdu; // F1AP_F1AP_PDU_t *pdu_p = &pdu;
asn_dec_rval_t dec_ret; // asn_dec_rval_t dec_ret;
DevAssert(buffer != NULL); // DevAssert(buffer != NULL);
printf("buffer = \n"); // printf("buffer = \n");
int i_ret; // int i_ret;
for (i_ret = 0; i_ret < length; i_ret++) { // for (i_ret = 0; i_ret < length; i_ret++) {
printf("%x ", *(buffer+i_ret)); // printf("%x ", *(buffer+i_ret));
} // }
printf("\n"); // printf("\n");
memset((void *)pdu_p, 0, sizeof(F1AP_F1AP_PDU_t)); // memset((void *)pdu_p, 0, sizeof(F1AP_F1AP_PDU_t));
dec_ret = aper_decode(NULL, // dec_ret = aper_decode(NULL,
&asn_DEF_F1AP_F1AP_PDU, // &asn_DEF_F1AP_F1AP_PDU,
(void **)&pdu_p, // (void **)&pdu_p,
buffer, // buffer,
length, // length,
0, // 0,
0); // 0);
xer_fprint(stdout, &asn_DEF_F1AP_F1AP_PDU, pdu_p); // xer_fprint(stdout, &asn_DEF_F1AP_F1AP_PDU, pdu_p);
printf("\n"); // printf("\n");
printf("dec_ret.code = %d \n", dec_ret.code); // printf("dec_ret.code = %d \n", dec_ret.code);
AssertFatal(dec_ret.code == RC_OK,"Failed to decode pdu\n"); // AssertFatal(dec_ret.code == RC_OK,"Failed to decode pdu\n");
// switch(pdu_p->present) { // // switch(pdu_p->present) {
// case F1AP_F1AP_PDU_PR_initiatingpdu: // // case F1AP_F1AP_PDU_PR_initiatingpdu:
// return F1AP_DU_decode_initiating_pdu(&pdu_p->choice.initiatingpdu); // // return F1AP_DU_decode_initiating_pdu(&pdu_p->choice.initiatingpdu);
// case F1AP_F1AP_PDU_PR_successfulOutcome: // // case F1AP_F1AP_PDU_PR_successfulOutcome:
// return F1AP_DU_decode_successful_outcome(&pdu_p->choice.successfulOutcome); // // return F1AP_DU_decode_successful_outcome(&pdu_p->choice.successfulOutcome);
// case F1AP_F1AP_PDU_PR_unsuccessfulOutcome: // // case F1AP_F1AP_PDU_PR_unsuccessfulOutcome:
// return F1AP_DU_decode_unsuccessful_outcome(&pdu_p->choice.unsuccessfulOutcome); // // return F1AP_DU_decode_unsuccessful_outcome(&pdu_p->choice.unsuccessfulOutcome);
// default: // // default:
// /*AssertFatal(1==0,"Unknown presence (%d) or not implemented\n", (int)pdu_p->present);*/ // // /*AssertFatal(1==0,"Unknown presence (%d) or not implemented\n", (int)pdu_p->present);*/
// break; // // break;
// } // // }
//AssertFatal(1==0,"Shouldn't get here\n"); // //AssertFatal(1==0,"Shouldn't get here\n");
return -1; // return -1;
} // }
// ssize_t s1ap_generate_initiating_pdu( // ssize_t s1ap_generate_initiating_pdu(
......
...@@ -375,7 +375,7 @@ extern int asn1_xer_print; ...@@ -375,7 +375,7 @@ extern int asn1_xer_print;
#include "assertions.h" #include "assertions.h"
#if defined(ENB_MODE) #if defined(ENB_MODE)
# include "log.h" # include "common/utils/LOG/log.h"
# include "f1ap_default_values.h" # include "f1ap_default_values.h"
# define F1AP_ERROR(x, args...) LOG_E(F1AP, x, ##args) # define F1AP_ERROR(x, args...) LOG_E(F1AP, x, ##args)
# define F1AP_WARN(x, args...) LOG_W(F1AP, x, ##args) # define F1AP_WARN(x, args...) LOG_W(F1AP, x, ##args)
...@@ -394,30 +394,30 @@ extern int asn1_xer_print; ...@@ -394,30 +394,30 @@ extern int asn1_xer_print;
//Forward declaration //Forward declaration
//struct f1ap_message_s; //struct f1ap_message_s;
typedef struct net_ip_address_s { typedef struct f1ap_net_ip_address_s {
unsigned ipv4:1; unsigned ipv4:1;
unsigned ipv6:1; unsigned ipv6:1;
char ipv4_address[16]; char ipv4_address[16];
char ipv6_address[46]; char ipv6_address[46];
} net_ip_address_t; } f1ap_net_ip_address_t;
typedef struct f1ap_message_s { /*typedef struct f1ap_message_s {
F1AP_ProtocolIE_ID_t id; F1AP_ProtocolIE_ID_t id;
F1AP_Criticality_t criticality; F1AP_Criticality_t criticality;
uint8_t direction; uint8_t direction;
union { union {
F1AP_F1SetupRequestIEs_t f1ap_F1SetupRequestIEs; F1AP_F1SetupRequestIEs_t f1ap_F1SetupRequestIEs;
} msg; } msg;
} f1ap_message; } f1ap_message;*/
/** \brief Function callback prototype. /** \brief Function callback prototype.
**/ **/
/*typedef int (*f1ap_message_decoded_callback)( typedef int (*f1ap_message_decoded_callback)(
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
struct f1ap_message_s *message_p struct f1ap_message_s *message_p
);*/ );
/** \brief Encode a successfull outcome message /** \brief Encode a successfull outcome message
\param buffer pointer to buffer in which data will be encoded \param buffer pointer to buffer in which data will be encoded
......
This diff is collapsed.
...@@ -30,13 +30,10 @@ ...@@ -30,13 +30,10 @@
* \warning * \warning
*/ */
#include <stdint.h> #ifndef F1AP_ENB_ENCODER_H_
#include "f1ap_ies_defs.h" #define F1AP_ENB_ENCODER_H_
#ifndef F1AP_DECODER_H_ int f1ap_eNB_encode_pdu(F1AP_F1AP_PDU_t *pdu, uint8_t **buffer, uint32_t *len)
#define F1AP_DECODER_H_ __attribute__ ((warn_unused_result));
int f1ap_decode_pdu(f1ap_message *message, const uint8_t * const buffer, #endif /* F1AP_ENB_ENCODER_H_ */
const uint32_t length) __attribute__ ((warn_unused_result));
#endif /* F1AP_DECODER_H_ */
This diff is collapsed.
...@@ -33,8 +33,6 @@ ...@@ -33,8 +33,6 @@
#ifndef F1AP_HANDLERS_H_ #ifndef F1AP_HANDLERS_H_
#define F1AP_HANDLERS_H_ #define F1AP_HANDLERS_H_
void f1ap_handle_f1_setup_message(f1ap_eNB_mme_data_t *mme_desc_p, int sctp_shutdown);
int f1ap_handle_message(uint32_t assoc_id, int32_t stream, int f1ap_handle_message(uint32_t assoc_id, int32_t stream,
const uint8_t * const data, const uint32_t data_length); const uint8_t * const data, const uint32_t data_length);
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include <pthread.h> #include <pthread.h>
#include <unistd.h> // for close #include <unistd.h> // for close
#include <stdlib.h> #include <stdlib.h>
#include "f1ap_handlers.h"
#define MAX_BUFFER 1024 #define MAX_BUFFER 1024
...@@ -81,7 +82,10 @@ void *recv_func(void *cfd) { ...@@ -81,7 +82,10 @@ void *recv_func(void *cfd) {
printf("\n"); printf("\n");
f1ap_decode_pdu(NULL , buffer_recv, sizeof(buffer_recv)); f1ap_handle_message(1/*sctp_data_ind->assoc_id*/, 1/*sctp_data_ind->stream*/,
buffer_recv, sizeof(buffer_recv));
//f1ap_decode_pdu(NULL , buffer_recv, sizeof(buffer_recv));
} }
printf("ret = %d\n", ret); printf("ret = %d\n", ret);
close( *(int*)cfd ); close( *(int*)cfd );
......
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