From 63a2fb0660a407daa262063abcb1a390cb7d7e4b Mon Sep 17 00:00:00 2001 From: Robert Schmidt <robert.schmidt@eurecom.fr> Date: Thu, 6 Sep 2018 10:03:55 +0200 Subject: [PATCH] Handle warnings regarding undeclared functions for dec, enc, sctp --- openair2/F1AP/CU_F1AP.c | 3 +++ openair2/F1AP/DU_F1AP.c | 3 +-- openair2/F1AP/f1ap_common.h | 2 +- openair2/F1AP/f1ap_decoder.c | 3 +-- openair2/F1AP/f1ap_decoder.h | 4 +++- openair2/F1AP/f1ap_encoder.h | 4 +++- openair2/F1AP/sctp_cu.c | 5 +++-- openair2/F1AP/sctp_cu.h | 40 ++++++++++++++++++++++++++++++++++ openair2/F1AP/sctp_du.h | 42 ++++++++++++++++++++++++++++++++++++ 9 files changed, 97 insertions(+), 9 deletions(-) create mode 100644 openair2/F1AP/sctp_cu.h create mode 100644 openair2/F1AP/sctp_du.h diff --git a/openair2/F1AP/CU_F1AP.c b/openair2/F1AP/CU_F1AP.c index 4b5f7b942c..72cc663731 100644 --- a/openair2/F1AP/CU_F1AP.c +++ b/openair2/F1AP/CU_F1AP.c @@ -33,6 +33,9 @@ #include "conversions.h" #include "f1ap_common.h" #include "f1ap_messages_types.h" +#include "f1ap_encoder.h" +#include "f1ap_decoder.h" +#include "sctp_cu.h" #include "platform_types.h" #include "log.h" diff --git a/openair2/F1AP/DU_F1AP.c b/openair2/F1AP/DU_F1AP.c index 35ae157691..d04312251d 100644 --- a/openair2/F1AP/DU_F1AP.c +++ b/openair2/F1AP/DU_F1AP.c @@ -35,8 +35,7 @@ #include "f1ap_messages_types.h" #include "platform_types.h" #include "common/utils/LOG/log.h" - - +#include "sctp_du.h" /* This structure describes association of a DU to a CU */ diff --git a/openair2/F1AP/f1ap_common.h b/openair2/F1AP/f1ap_common.h index fb33333a41..0bfc65bc4d 100644 --- a/openair2/F1AP/f1ap_common.h +++ b/openair2/F1AP/f1ap_common.h @@ -416,7 +416,7 @@ typedef struct f1ap_net_ip_address_s { typedef int (*f1ap_message_decoded_callback)( uint32_t assoc_id, uint32_t stream, - struct f1ap_message_s *message_p + F1AP_F1AP_PDU_t *message_p ); /** \brief Encode a successfull outcome message diff --git a/openair2/F1AP/f1ap_decoder.c b/openair2/F1AP/f1ap_decoder.c index fa861915f4..3be1013b41 100644 --- a/openair2/F1AP/f1ap_decoder.c +++ b/openair2/F1AP/f1ap_decoder.c @@ -134,8 +134,7 @@ static int f1ap_eNB_decode_unsuccessful_outcome(F1AP_F1AP_PDU_t *pdu) return 0; } -int f1ap_decode_pdu(F1AP_F1AP_PDU_t *pdu, const uint8_t *const buffer, - const uint32_t length) +int f1ap_decode_pdu(F1AP_F1AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t length) { asn_dec_rval_t dec_ret; diff --git a/openair2/F1AP/f1ap_decoder.h b/openair2/F1AP/f1ap_decoder.h index c16e880c33..c8522d6ca5 100644 --- a/openair2/F1AP/f1ap_decoder.h +++ b/openair2/F1AP/f1ap_decoder.h @@ -33,7 +33,9 @@ #ifndef F1AP_ENB_ENCODER_H_ #define F1AP_ENB_ENCODER_H_ -int f1ap_eNB_encode_pdu(F1AP_F1AP_PDU_t *pdu, uint8_t **buffer, uint32_t *len) +#include "f1ap_common.h" + +int f1ap_decode_pdu(F1AP_F1AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t length) __attribute__ ((warn_unused_result)); #endif /* F1AP_ENB_ENCODER_H_ */ diff --git a/openair2/F1AP/f1ap_encoder.h b/openair2/F1AP/f1ap_encoder.h index d926497aa5..682395890a 100644 --- a/openair2/F1AP/f1ap_encoder.h +++ b/openair2/F1AP/f1ap_encoder.h @@ -33,7 +33,9 @@ #ifndef F1AP_ENCODER_H_ #define F1AP_ENCODER_H_ -int f1ap_encode_pdu(f1ap_message *message, uint8_t **buffer, uint32_t *len) +#include "f1ap_common.h" + +int f1ap_encode_pdu(F1AP_F1AP_PDU_t *message, uint8_t **buffer, uint32_t *len) __attribute__ ((warn_unused_result)); #endif /* F1AP_ENCODER_H_ */ diff --git a/openair2/F1AP/sctp_cu.c b/openair2/F1AP/sctp_cu.c index 29f8e93c8c..4e9dd98a99 100644 --- a/openair2/F1AP/sctp_cu.c +++ b/openair2/F1AP/sctp_cu.c @@ -89,9 +89,10 @@ void *recv_func(void *cfd) { } printf("ret = %d\n", ret); close( *(int*)cfd ); + return NULL; } -int sctp_cu_init() { +int sctp_cu_init(void) { pthread_t threads; printf("S - Waiting for socket_accept\n"); @@ -124,4 +125,4 @@ int sctp_cu_init() { printf("S - close\n"); return 0; -} \ No newline at end of file +} diff --git a/openair2/F1AP/sctp_cu.h b/openair2/F1AP/sctp_cu.h new file mode 100644 index 0000000000..68db2864d5 --- /dev/null +++ b/openair2/F1AP/sctp_cu.h @@ -0,0 +1,40 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file sctp_cu.h + * \brief sctp server procedures for F1AP + * \author Robert Schmidt + * \date 2018 + * \version 0.1 + * \company Eurecom + * \email: robert.schmidt@eurecom.fr + * \note + * \warning + */ + +#ifndef SCTP_CU_H_ +#define SCTP_CU_H_ + +//void send_func(int cfd); +//void *recv_func(void *cfd); +int sctp_cu_init(void); + +#endif /* SCTP_CU_H_ */ diff --git a/openair2/F1AP/sctp_du.h b/openair2/F1AP/sctp_du.h new file mode 100644 index 0000000000..b8f2dc0635 --- /dev/null +++ b/openair2/F1AP/sctp_du.h @@ -0,0 +1,42 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file sctp_du.h + * \brief sctp server procedures for F1AP + * \author Robert Schmidt + * \date 2018 + * \version 0.1 + * \company Eurecom + * \email: robert.schmidt@eurecom.fr + * \note + * \warning + */ + +#ifndef SCTP_DU_H_ +#define SCTP_DU_H_ + +//void f1ap_du_send_message(uint8_t *buffer_send, uint32_t length); +//void *send_func(void *argument); +//void *recv_func(void *argument); +int sctp_du_init(void); + + +#endif /* SCTP_DU_H_ */ -- GitLab