Add send function pointers to VNF
This commit is contained in:
@@ -34,6 +34,8 @@
|
|||||||
#include "nfapi_nr_interface_scf.h"
|
#include "nfapi_nr_interface_scf.h"
|
||||||
#include "nfapi_vnf_interface.h"
|
#include "nfapi_vnf_interface.h"
|
||||||
#include "nfapi_vnf.h"
|
#include "nfapi_vnf.h"
|
||||||
|
#include <vnf.h>
|
||||||
|
#include <vnf_p7.h>
|
||||||
#include "nfapi.h"
|
#include "nfapi.h"
|
||||||
#include "vendor_ext.h"
|
#include "vendor_ext.h"
|
||||||
|
|
||||||
@@ -1448,6 +1450,7 @@ void *vnf_nr_p7_thread_start(void *ptr)
|
|||||||
p7_vnf->config->unpack_func = &nfapi_nr_p7_message_unpack;
|
p7_vnf->config->unpack_func = &nfapi_nr_p7_message_unpack;
|
||||||
p7_vnf->config->hdr_unpack_func = &nfapi_nr_p7_message_header_unpack;
|
p7_vnf->config->hdr_unpack_func = &nfapi_nr_p7_message_header_unpack;
|
||||||
p7_vnf->config->pack_func = &nfapi_nr_p7_message_pack;
|
p7_vnf->config->pack_func = &nfapi_nr_p7_message_pack;
|
||||||
|
p7_vnf->config->send_p7_msg = &vnf_nr_send_p7_msg;
|
||||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Creating VNF NFAPI P7 start thread %s\n", __FUNCTION__);
|
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Creating VNF NFAPI P7 start thread %s\n", __FUNCTION__);
|
||||||
pthread_create(&vnf_p7_start_pthread, NULL, &vnf_nr_p7_start_thread, p7_vnf->config);
|
pthread_create(&vnf_p7_start_pthread, NULL, &vnf_nr_p7_start_thread, p7_vnf->config);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -1868,6 +1871,7 @@ void configure_nr_nfapi_vnf(char *vnf_addr, int vnf_p5_port, char *pnf_ip_addr,
|
|||||||
config->unpack_func = &nfapi_nr_p5_message_unpack;
|
config->unpack_func = &nfapi_nr_p5_message_unpack;
|
||||||
config->hdr_unpack_func = &nfapi_nr_p5_message_header_unpack;
|
config->hdr_unpack_func = &nfapi_nr_p5_message_header_unpack;
|
||||||
config->pack_func = &nfapi_nr_p5_message_pack;
|
config->pack_func = &nfapi_nr_p5_message_pack;
|
||||||
|
config->send_p5_msg = &vnf_nr_send_p5_message;
|
||||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Creating VNF NFAPI start thread %s\n", __FUNCTION__);
|
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Creating VNF NFAPI start thread %s\n", __FUNCTION__);
|
||||||
pthread_create(&vnf_start_pthread, NULL, (void *)&vnf_nr_start_thread, config);
|
pthread_create(&vnf_start_pthread, NULL, (void *)&vnf_nr_start_thread, config);
|
||||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Created VNF NFAPI start thread %s\n", __FUNCTION__);
|
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Created VNF NFAPI start thread %s\n", __FUNCTION__);
|
||||||
@@ -1963,13 +1967,13 @@ int oai_nfapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req)
|
|||||||
dl_config_req->header.message_id= NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST;
|
dl_config_req->header.message_id= NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST;
|
||||||
dl_config_req->header.phy_id = 1; // HACK TODO FIXME - need to pass this around!!!!
|
dl_config_req->header.phy_id = 1; // HACK TODO FIXME - need to pass this around!!!!
|
||||||
|
|
||||||
int retval = nfapi_vnf_p7_nr_dl_config_req(p7_config, dl_config_req);
|
bool retval = nfapi_vnf_p7_nr_dl_config_req(p7_config, dl_config_req);
|
||||||
|
|
||||||
dl_config_req->dl_tti_request_body.nPDUs = 0;
|
dl_config_req->dl_tti_request_body.nPDUs = 0;
|
||||||
dl_config_req->dl_tti_request_body.nGroup = 0;
|
dl_config_req->dl_tti_request_body.nGroup = 0;
|
||||||
|
|
||||||
|
|
||||||
if (retval!=0) {
|
if (!retval) {
|
||||||
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
|
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
|
||||||
}
|
}
|
||||||
return retval;
|
return retval;
|
||||||
@@ -1982,9 +1986,9 @@ int oai_nfapi_tx_data_req(nfapi_nr_tx_data_request_t *tx_data_req)
|
|||||||
tx_data_req->header.phy_id = 1; // HACK TODO FIXME - need to pass this around!!!!
|
tx_data_req->header.phy_id = 1; // HACK TODO FIXME - need to pass this around!!!!
|
||||||
tx_data_req->header.message_id = NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST;
|
tx_data_req->header.message_id = NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST;
|
||||||
//LOG_D(PHY, "[VNF] %s() TX_REQ sfn_sf:%d number_of_pdus:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(tx_req->sfn_sf), tx_req->tx_request_body.number_of_pdus);
|
//LOG_D(PHY, "[VNF] %s() TX_REQ sfn_sf:%d number_of_pdus:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(tx_req->sfn_sf), tx_req->tx_request_body.number_of_pdus);
|
||||||
int retval = nfapi_vnf_p7_tx_data_req(p7_config, tx_data_req);
|
bool retval = nfapi_vnf_p7_tx_data_req(p7_config, tx_data_req);
|
||||||
|
|
||||||
if (retval!=0) {
|
if (!retval) {
|
||||||
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
|
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
|
||||||
} else {
|
} else {
|
||||||
tx_data_req->Number_of_PDUs = 0;
|
tx_data_req->Number_of_PDUs = 0;
|
||||||
@@ -2015,9 +2019,9 @@ int oai_nfapi_ul_dci_req(nfapi_nr_ul_dci_request_t *ul_dci_req) {
|
|||||||
ul_dci_req->header.phy_id = 1; // HACK TODO FIXME - need to pass this around!!!!
|
ul_dci_req->header.phy_id = 1; // HACK TODO FIXME - need to pass this around!!!!
|
||||||
ul_dci_req->header.message_id = NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST;
|
ul_dci_req->header.message_id = NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST;
|
||||||
//LOG_D(PHY, "[VNF] %s() HI_DCI0_REQ sfn_sf:%d dci:%d hi:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(hi_dci0_req->sfn_sf), hi_dci0_req->hi_dci0_request_body.number_of_dci, hi_dci0_req->hi_dci0_request_body.number_of_hi);
|
//LOG_D(PHY, "[VNF] %s() HI_DCI0_REQ sfn_sf:%d dci:%d hi:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(hi_dci0_req->sfn_sf), hi_dci0_req->hi_dci0_request_body.number_of_dci, hi_dci0_req->hi_dci0_request_body.number_of_hi);
|
||||||
int retval = nfapi_vnf_p7_ul_dci_req(p7_config, ul_dci_req);
|
bool retval = nfapi_vnf_p7_ul_dci_req(p7_config, ul_dci_req);
|
||||||
|
|
||||||
if (retval!=0) {
|
if (!retval) {
|
||||||
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
|
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
|
||||||
} else {
|
} else {
|
||||||
ul_dci_req->numPdus = 0;
|
ul_dci_req->numPdus = 0;
|
||||||
@@ -2068,9 +2072,9 @@ int oai_nfapi_ul_tti_req(nfapi_nr_ul_tti_request_t *ul_tti_req) {
|
|||||||
ul_tti_req->header.phy_id = 1; // HACK TODO FIXME - need to pass this around!!!!
|
ul_tti_req->header.phy_id = 1; // HACK TODO FIXME - need to pass this around!!!!
|
||||||
ul_tti_req->header.message_id = NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST;
|
ul_tti_req->header.message_id = NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST;
|
||||||
|
|
||||||
int retval = nfapi_vnf_p7_ul_tti_req(p7_config, ul_tti_req);
|
bool retval = nfapi_vnf_p7_ul_tti_req(p7_config, ul_tti_req);
|
||||||
|
|
||||||
if (retval!=0) {
|
if (!retval) {
|
||||||
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
|
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
|
||||||
} else {
|
} else {
|
||||||
// Reset number of PDUs so that it is not resent
|
// Reset number of PDUs so that it is not resent
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
#include "nfapi_vnf_interface.h"
|
#include "nfapi_vnf_interface.h"
|
||||||
|
|
||||||
typedef struct
|
struct vnf_t
|
||||||
{
|
{
|
||||||
|
|
||||||
nfapi_vnf_config_t _public;
|
nfapi_vnf_config_t _public;
|
||||||
@@ -31,11 +31,11 @@ typedef struct
|
|||||||
uint8_t tx_message_buffer[NFAPI_MAX_PACKED_MESSAGE_SIZE];
|
uint8_t tx_message_buffer[NFAPI_MAX_PACKED_MESSAGE_SIZE];
|
||||||
uint16_t next_phy_id;
|
uint16_t next_phy_id;
|
||||||
|
|
||||||
} vnf_t;
|
};
|
||||||
|
|
||||||
|
|
||||||
int vnf_pack_and_send_p5_message(vnf_t* vnf, uint16_t p5_idx, nfapi_p4_p5_message_header_t* msg, uint16_t msg_len);
|
int vnf_pack_and_send_p5_message(vnf_t* vnf, uint16_t p5_idx, nfapi_p4_p5_message_header_t* msg, uint16_t msg_len);
|
||||||
int vnf_nr_pack_and_send_p5_message(vnf_t* vnf, uint16_t p5_idx, nfapi_nr_p4_p5_message_header_t* msg, uint16_t msg_len);
|
bool vnf_nr_send_p5_message(vnf_t* vnf, uint16_t p5_idx, nfapi_nr_p4_p5_message_header_t* msg, uint32_t msg_len);
|
||||||
|
|
||||||
int vnf_pack_and_send_p4_message(vnf_t* vnf, uint16_t p5_idx, nfapi_p4_p5_message_header_t* msg, uint16_t msg_len);
|
int vnf_pack_and_send_p4_message(vnf_t* vnf, uint16_t p5_idx, nfapi_p4_p5_message_header_t* msg, uint16_t msg_len);
|
||||||
|
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ typedef struct nfapi_vnf_p7_connection_info {
|
|||||||
|
|
||||||
} nfapi_vnf_p7_connection_info_t;
|
} nfapi_vnf_p7_connection_info_t;
|
||||||
|
|
||||||
typedef struct {
|
struct vnf_p7_t{
|
||||||
|
|
||||||
nfapi_vnf_p7_config_t _public;
|
nfapi_vnf_p7_config_t _public;
|
||||||
|
|
||||||
@@ -121,7 +121,7 @@ typedef struct {
|
|||||||
uint8_t* rx_message_buffer; // would this be better put in the p7 conenction info?
|
uint8_t* rx_message_buffer; // would this be better put in the p7 conenction info?
|
||||||
uint16_t rx_message_buffer_size;
|
uint16_t rx_message_buffer_size;
|
||||||
|
|
||||||
} vnf_p7_t;
|
};
|
||||||
|
|
||||||
uint32_t vnf_get_current_time_hr(void);
|
uint32_t vnf_get_current_time_hr(void);
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ nfapi_vnf_p7_connection_info_t* vnf_p7_connection_info_list_find(vnf_p7_t* vnf_p
|
|||||||
nfapi_vnf_p7_connection_info_t* vnf_p7_connection_info_list_delete(vnf_p7_t* vnf_p7, uint16_t phy_id);
|
nfapi_vnf_p7_connection_info_t* vnf_p7_connection_info_list_delete(vnf_p7_t* vnf_p7, uint16_t phy_id);
|
||||||
|
|
||||||
int vnf_p7_pack_and_send_p7_msg(vnf_p7_t* vnf_p7, nfapi_p7_message_header_t* header);
|
int vnf_p7_pack_and_send_p7_msg(vnf_p7_t* vnf_p7, nfapi_p7_message_header_t* header);
|
||||||
int vnf_nr_p7_pack_and_send_p7_msg(vnf_p7_t* vnf_p7, nfapi_nr_p7_message_header_t* header);
|
bool vnf_nr_send_p7_msg(vnf_p7_t* vnf_p7, nfapi_nr_p7_message_header_t* header);
|
||||||
|
|
||||||
void vnf_p7_release_msg(vnf_p7_t* vnf_p7, nfapi_p7_message_header_t* header);
|
void vnf_p7_release_msg(vnf_p7_t* vnf_p7, nfapi_p7_message_header_t* header);
|
||||||
void vnf_p7_release_pdu(vnf_p7_t* vnf_p7, void* pdu);
|
void vnf_p7_release_pdu(vnf_p7_t* vnf_p7, void* pdu);
|
||||||
|
|||||||
@@ -30,6 +30,9 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
typedef struct vnf_t vnf_t;
|
||||||
|
typedef struct vnf_p7_t vnf_p7_t;
|
||||||
|
|
||||||
#define NFAPI_MAX_PACKED_MESSAGE_SIZE 32768
|
#define NFAPI_MAX_PACKED_MESSAGE_SIZE 32768
|
||||||
|
|
||||||
/*! The nfapi VNF phy configuration information
|
/*! The nfapi VNF phy configuration information
|
||||||
@@ -491,9 +494,19 @@ typedef struct nfapi_vnf_config
|
|||||||
uint32_t unpackedBufLen,
|
uint32_t unpackedBufLen,
|
||||||
nfapi_p4_p5_codec_config_t* config);
|
nfapi_p4_p5_codec_config_t* config);
|
||||||
|
|
||||||
|
/*! \brief Sends a (n)FAPI P5 message
|
||||||
|
*
|
||||||
|
* This function internally packs the given message into a buffer by calling the previously defined pack_func() function pointer
|
||||||
|
* Then, having the message buffer populated, sends it to the PNF
|
||||||
|
* \param vnf A pointer to a vnf_t*
|
||||||
|
* \param p5_idx The index of the P5 PNF intended to receive the message
|
||||||
|
* \param msg A pointer to the P5 message
|
||||||
|
* \param msg_len The size of the encoded P5 message header
|
||||||
|
* \return true on success, false on failure
|
||||||
|
*/
|
||||||
|
bool (*send_p5_msg)(vnf_t* vnf, uint16_t p5_idx, nfapi_nr_p4_p5_message_header_t* msg, uint32_t msg_len);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} nfapi_vnf_config_t;
|
} nfapi_vnf_config_t;
|
||||||
|
|
||||||
/*! Creates and initialise the vnf config structure before use
|
/*! Creates and initialise the vnf config structure before use
|
||||||
@@ -954,6 +967,16 @@ typedef struct nfapi_vnf_p7_config
|
|||||||
void* pUnpackedBuf,
|
void* pUnpackedBuf,
|
||||||
uint32_t unpackedBufLen,
|
uint32_t unpackedBufLen,
|
||||||
nfapi_p7_codec_config_t* config);
|
nfapi_p7_codec_config_t* config);
|
||||||
|
|
||||||
|
/*! \brief Sends a (n)FAPI P7 message
|
||||||
|
*
|
||||||
|
* This function internally packs the given message into a buffer by calling the previously defined pack_func() function pointer
|
||||||
|
* Then, having the message buffer populated, sends it to the PNF
|
||||||
|
* \param vnf_p7 A pointer to a vnf_p7_t struct
|
||||||
|
* \param header A pointer to the P7 message to pack & send
|
||||||
|
* \return true on success, false on failure
|
||||||
|
*/
|
||||||
|
bool (*send_p7_msg)(vnf_p7_t* vnf_p7, nfapi_nr_p7_message_header_t* header);
|
||||||
} nfapi_vnf_p7_config_t;
|
} nfapi_vnf_p7_config_t;
|
||||||
|
|
||||||
/*! Creates and initializes the nfapi_vnf_p7_config structure before use
|
/*! Creates and initializes the nfapi_vnf_p7_config structure before use
|
||||||
@@ -1034,7 +1057,7 @@ int nfapi_vnf_p7_del_pnf(nfapi_vnf_p7_config_t* config, int phy_id);
|
|||||||
* may be released after this function call has returned or at a later pointer
|
* may be released after this function call has returned or at a later pointer
|
||||||
*/
|
*/
|
||||||
int nfapi_vnf_p7_dl_config_req(nfapi_vnf_p7_config_t* config, nfapi_dl_config_request_t* req);
|
int nfapi_vnf_p7_dl_config_req(nfapi_vnf_p7_config_t* config, nfapi_dl_config_request_t* req);
|
||||||
int nfapi_vnf_p7_nr_dl_config_req(nfapi_vnf_p7_config_t* config, nfapi_nr_dl_tti_request_t* req);
|
bool nfapi_vnf_p7_nr_dl_config_req(nfapi_vnf_p7_config_t* config, nfapi_nr_dl_tti_request_t* req);
|
||||||
|
|
||||||
/*! Send the UL_CONFIG.request
|
/*! Send the UL_CONFIG.request
|
||||||
* \param config A pointer to the vnf p7 configuration
|
* \param config A pointer to the vnf p7 configuration
|
||||||
@@ -1045,7 +1068,7 @@ int nfapi_vnf_p7_nr_dl_config_req(nfapi_vnf_p7_config_t* config, nfapi_nr_dl_tti
|
|||||||
* may be released after this function call has returned or at a later pointer
|
* may be released after this function call has returned or at a later pointer
|
||||||
*/
|
*/
|
||||||
int nfapi_vnf_p7_ul_config_req(nfapi_vnf_p7_config_t* config, nfapi_ul_config_request_t* req);
|
int nfapi_vnf_p7_ul_config_req(nfapi_vnf_p7_config_t* config, nfapi_ul_config_request_t* req);
|
||||||
int nfapi_vnf_p7_ul_tti_req(nfapi_vnf_p7_config_t* config, nfapi_nr_ul_tti_request_t* req);
|
bool nfapi_vnf_p7_ul_tti_req(nfapi_vnf_p7_config_t* config, nfapi_nr_ul_tti_request_t* req);
|
||||||
/*! Send the HI_DCI0.request
|
/*! Send the HI_DCI0.request
|
||||||
* \param config A pointer to the vnf p7 configuration
|
* \param config A pointer to the vnf p7 configuration
|
||||||
* \param req A data structure for the decoded HI_DCI0.request.
|
* \param req A data structure for the decoded HI_DCI0.request.
|
||||||
@@ -1055,7 +1078,7 @@ int nfapi_vnf_p7_ul_tti_req(nfapi_vnf_p7_config_t* config, nfapi_nr_ul_tti_reque
|
|||||||
* may be released after this function call has returned or at a later pointer
|
* may be released after this function call has returned or at a later pointer
|
||||||
*/
|
*/
|
||||||
int nfapi_vnf_p7_hi_dci0_req(nfapi_vnf_p7_config_t* config, nfapi_hi_dci0_request_t* req);
|
int nfapi_vnf_p7_hi_dci0_req(nfapi_vnf_p7_config_t* config, nfapi_hi_dci0_request_t* req);
|
||||||
int nfapi_vnf_p7_ul_dci_req(nfapi_vnf_p7_config_t* config, nfapi_nr_ul_dci_request_t* req);
|
bool nfapi_vnf_p7_ul_dci_req(nfapi_vnf_p7_config_t* config, nfapi_nr_ul_dci_request_t* req);
|
||||||
/*! Send the TX.req
|
/*! Send the TX.req
|
||||||
* \param config A pointer to the vnf p7 configuration
|
* \param config A pointer to the vnf p7 configuration
|
||||||
* \param req A data structure for the decoded HI_DCI0.request.
|
* \param req A data structure for the decoded HI_DCI0.request.
|
||||||
@@ -1065,7 +1088,7 @@ int nfapi_vnf_p7_ul_dci_req(nfapi_vnf_p7_config_t* config, nfapi_nr_ul_dci_reque
|
|||||||
* may be released after this function call has returned or at a later pointer
|
* may be released after this function call has returned or at a later pointer
|
||||||
*/
|
*/
|
||||||
int nfapi_vnf_p7_tx_req(nfapi_vnf_p7_config_t* config, nfapi_tx_request_t* req);
|
int nfapi_vnf_p7_tx_req(nfapi_vnf_p7_config_t* config, nfapi_tx_request_t* req);
|
||||||
int nfapi_vnf_p7_tx_data_req(nfapi_vnf_p7_config_t* config, nfapi_nr_tx_data_request_t* req);
|
bool nfapi_vnf_p7_tx_data_req(nfapi_vnf_p7_config_t* config, nfapi_nr_tx_data_request_t* req);
|
||||||
/*! Send the LBT_DL_CONFIG.requst
|
/*! Send the LBT_DL_CONFIG.requst
|
||||||
* \param config A pointer to the vnf p7 configuration
|
* \param config A pointer to the vnf p7 configuration
|
||||||
* \param req A data structure for the decoded LBT_DL_CONFIG.request.
|
* \param req A data structure for the decoded LBT_DL_CONFIG.request.
|
||||||
|
|||||||
@@ -1537,7 +1537,7 @@ static int vnf_send_p5_msg(nfapi_vnf_pnf_info_t* pnf, const void *msg, int len,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int vnf_nr_pack_and_send_p5_message(vnf_t* vnf, uint16_t p5_idx, nfapi_nr_p4_p5_message_header_t* msg, uint16_t msg_len)
|
bool vnf_nr_send_p5_message(vnf_t* vnf, uint16_t p5_idx, nfapi_nr_p4_p5_message_header_t* msg, uint32_t msg_len)
|
||||||
{
|
{
|
||||||
nfapi_vnf_pnf_info_t* pnf = nfapi_vnf_pnf_list_find(&(vnf->_public), p5_idx);
|
nfapi_vnf_pnf_info_t* pnf = nfapi_vnf_pnf_list_find(&(vnf->_public), p5_idx);
|
||||||
|
|
||||||
@@ -1554,9 +1554,9 @@ int vnf_nr_pack_and_send_p5_message(vnf_t* vnf, uint16_t p5_idx, nfapi_nr_p4_p5_
|
|||||||
int packedMessageLengthFAPI = -1;
|
int packedMessageLengthFAPI = -1;
|
||||||
packedMessageLengthFAPI =
|
packedMessageLengthFAPI =
|
||||||
fapi_nr_p5_message_pack(msg, msg_len, tx_messagebufferFAPI, sizeof(tx_messagebufferFAPI), &vnf->_public.codec_config);
|
fapi_nr_p5_message_pack(msg, msg_len, tx_messagebufferFAPI, sizeof(tx_messagebufferFAPI), &vnf->_public.codec_config);
|
||||||
return aerial_send_P5_msg(tx_messagebufferFAPI, packedMessageLengthFAPI, msg);
|
return aerial_send_P5_msg(tx_messagebufferFAPI, packedMessageLengthFAPI, msg) == 0;
|
||||||
#else
|
#else
|
||||||
return 0;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
packedMessageLength = nfapi_nr_p5_message_pack(msg,
|
packedMessageLength = nfapi_nr_p5_message_pack(msg,
|
||||||
@@ -1567,7 +1567,7 @@ int vnf_nr_pack_and_send_p5_message(vnf_t* vnf, uint16_t p5_idx, nfapi_nr_p4_p5_
|
|||||||
|
|
||||||
if (packedMessageLength < 0) {
|
if (packedMessageLength < 0) {
|
||||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "nfapi_nr_p5_message_pack failed with return %d\n", packedMessageLength);
|
NFAPI_TRACE(NFAPI_TRACE_ERROR, "nfapi_nr_p5_message_pack failed with return %d\n", packedMessageLength);
|
||||||
return -1;
|
return false;
|
||||||
}
|
}
|
||||||
// printf("msg id = 0x%02x, entire message length: %d\n", msg->message_id, packedMessageLength);
|
// printf("msg id = 0x%02x, entire message length: %d\n", msg->message_id, packedMessageLength);
|
||||||
// for (int i = 0; i < packedMessageLength; i++) {
|
// for (int i = 0; i < packedMessageLength; i++) {
|
||||||
@@ -1578,7 +1578,7 @@ int vnf_nr_pack_and_send_p5_message(vnf_t* vnf, uint16_t p5_idx, nfapi_nr_p4_p5_
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() cannot find pnf info for p5_idx:%d\n", __FUNCTION__, p5_idx);
|
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() cannot find pnf info for p5_idx:%d\n", __FUNCTION__, p5_idx);
|
||||||
return -1;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2017 Cisco Systems, Inc.
|
* Copyright 2017 Cisco Systems, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
@@ -14,6 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "assertions.h"
|
||||||
|
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@@ -894,8 +895,8 @@ int nfapi_nr_vnf_pnf_param_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_nr_
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
vnf_t* _this = (vnf_t*)(config);
|
vnf_t* _this = (vnf_t*)(config);
|
||||||
|
AssertFatal(config->send_p5_msg, "Function pointer must be configured\n");
|
||||||
return vnf_nr_pack_and_send_p5_message(_this, p5_idx, &req->header, sizeof(nfapi_nr_pnf_param_request_t));
|
return config->send_p5_msg(_this, p5_idx, &req->header, sizeof(nfapi_nr_pnf_param_request_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
int nfapi_vnf_pnf_param_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_pnf_param_request_t* req)
|
int nfapi_vnf_pnf_param_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_pnf_param_request_t* req)
|
||||||
@@ -914,8 +915,8 @@ int nfapi_nr_vnf_pnf_config_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_nr
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
vnf_t* _this = (vnf_t*)(config);
|
vnf_t* _this = (vnf_t*)(config);
|
||||||
|
AssertFatal(config->send_p5_msg, "Function pointer must be configured\n");
|
||||||
return vnf_nr_pack_and_send_p5_message(_this, p5_idx, &req->header, sizeof(nfapi_nr_pnf_config_request_t));
|
return config->send_p5_msg(_this, p5_idx, &req->header, sizeof(nfapi_nr_pnf_config_request_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -945,8 +946,8 @@ int nfapi_nr_vnf_pnf_start_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_nr_
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
vnf_t* _this = (vnf_t*)(config);
|
vnf_t* _this = (vnf_t*)(config);
|
||||||
|
AssertFatal(config->send_p5_msg, "Function pointer must be configured\n");
|
||||||
return vnf_nr_pack_and_send_p5_message(_this, p5_idx, &req->header, sizeof(nfapi_nr_pnf_start_request_t));
|
return config->send_p5_msg(_this, p5_idx, &req->header, sizeof(nfapi_nr_pnf_start_request_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
int nfapi_vnf_pnf_stop_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_pnf_stop_request_t* req)
|
int nfapi_vnf_pnf_stop_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_pnf_stop_request_t* req)
|
||||||
@@ -965,8 +966,8 @@ int nfapi_nr_vnf_param_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_nr_para
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
vnf_t* _this = (vnf_t*)(config);
|
vnf_t* _this = (vnf_t*)(config);
|
||||||
|
AssertFatal(config->send_p5_msg, "Function pointer must be configured\n");
|
||||||
return vnf_nr_pack_and_send_p5_message(_this, p5_idx, &req->header, sizeof(nfapi_nr_param_request_scf_t));
|
return config->send_p5_msg(_this, p5_idx, &req->header, sizeof(nfapi_nr_param_request_scf_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
int nfapi_vnf_param_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_param_request_t* req)
|
int nfapi_vnf_param_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_param_request_t* req)
|
||||||
@@ -983,7 +984,7 @@ int nfapi_nr_vnf_config_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_nr_con
|
|||||||
{
|
{
|
||||||
if(config == 0 || req == 0)
|
if(config == 0 || req == 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
AssertFatal(config->send_p5_msg, "Function pointer must be configured\n");
|
||||||
vnf_t* _this = (vnf_t*)(config);
|
vnf_t* _this = (vnf_t*)(config);
|
||||||
|
|
||||||
nfapi_vnf_phy_info_t* phy = nfapi_vnf_phy_info_list_find(config, req->header.phy_id);
|
nfapi_vnf_phy_info_t* phy = nfapi_vnf_phy_info_list_find(config, req->header.phy_id);
|
||||||
@@ -1007,7 +1008,7 @@ int nfapi_nr_vnf_config_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_nr_con
|
|||||||
req->nfapi_config.timing_info_period.value = phy->timing_info_period;
|
req->nfapi_config.timing_info_period.value = phy->timing_info_period;
|
||||||
req->num_tlv++;
|
req->num_tlv++;
|
||||||
|
|
||||||
return vnf_nr_pack_and_send_p5_message(_this, p5_idx, &req->header, sizeof(nfapi_nr_config_request_scf_t));
|
return config->send_p5_msg(_this, p5_idx, &req->header, sizeof(nfapi_nr_config_request_scf_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
int nfapi_vnf_config_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_config_request_t* req)
|
int nfapi_vnf_config_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_config_request_t* req)
|
||||||
@@ -1057,8 +1058,8 @@ int nfapi_nr_vnf_start_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_nr_star
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
vnf_t* _this = (vnf_t*)(config);
|
vnf_t* _this = (vnf_t*)(config);
|
||||||
|
AssertFatal(config->send_p5_msg, "Function pointer must be configured\n");
|
||||||
return vnf_nr_pack_and_send_p5_message(_this, p5_idx, &req->header, sizeof(nfapi_nr_start_request_scf_t));
|
return config->send_p5_msg(_this, p5_idx, &req->header, sizeof(nfapi_nr_start_request_scf_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -473,9 +473,8 @@ int vnf_send_p7_msg(vnf_p7_t* vnf_p7, nfapi_vnf_p7_connection_info_t* p7_info, u
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int vnf_nr_p7_pack_and_send_p7_msg(vnf_p7_t* vnf_p7, nfapi_nr_p7_message_header_t* header)
|
bool vnf_nr_send_p7_msg(vnf_p7_t* vnf_p7, nfapi_nr_p7_message_header_t* header)
|
||||||
{
|
{
|
||||||
|
|
||||||
nfapi_vnf_p7_connection_info_t* p7_connection = vnf_p7_connection_info_list_find(vnf_p7, header->phy_id);
|
nfapi_vnf_p7_connection_info_t* p7_connection = vnf_p7_connection_info_list_find(vnf_p7, header->phy_id);
|
||||||
if(p7_connection)
|
if(p7_connection)
|
||||||
{
|
{
|
||||||
@@ -491,7 +490,7 @@ int vnf_nr_p7_pack_and_send_p7_msg(vnf_p7_t* vnf_p7, nfapi_nr_p7_message_header_
|
|||||||
if(len < 0)
|
if(len < 0)
|
||||||
{
|
{
|
||||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() failed to pack p7 message phy_id:%d\n", __FUNCTION__, header->phy_id);
|
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() failed to pack p7 message phy_id:%d\n", __FUNCTION__, header->phy_id);
|
||||||
return -1;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(len > vnf_p7->_public.segment_size)
|
if(len > vnf_p7->_public.segment_size)
|
||||||
@@ -560,12 +559,12 @@ int vnf_nr_p7_pack_and_send_p7_msg(vnf_p7_t* vnf_p7, nfapi_nr_p7_message_header_
|
|||||||
}
|
}
|
||||||
|
|
||||||
p7_connection->sequence_number++;
|
p7_connection->sequence_number++;
|
||||||
return send_result;
|
return send_result == 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() cannot find p7 connection info for phy_id:%d\n", __FUNCTION__, header->phy_id);
|
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() cannot find p7 connection info for phy_id:%d\n", __FUNCTION__, header->phy_id);
|
||||||
return -1;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -676,7 +675,8 @@ int vnf_build_send_dl_node_sync(vnf_p7_t* vnf_p7, nfapi_vnf_p7_connection_info_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
int vnf_nr_build_send_dl_node_sync(vnf_p7_t* vnf_p7, nfapi_vnf_p7_connection_info_t* p7_info)
|
int vnf_nr_build_send_dl_node_sync(vnf_p7_t* vnf_p7, nfapi_vnf_p7_connection_info_t* p7_info)
|
||||||
{
|
{
|
||||||
|
nfapi_vnf_p7_config_t* config = (nfapi_vnf_p7_config_t*)vnf_p7;
|
||||||
nfapi_nr_dl_node_sync_t dl_node_sync;
|
nfapi_nr_dl_node_sync_t dl_node_sync;
|
||||||
memset(&dl_node_sync, 0, sizeof(dl_node_sync));
|
memset(&dl_node_sync, 0, sizeof(dl_node_sync));
|
||||||
|
|
||||||
@@ -686,7 +686,7 @@ int vnf_nr_build_send_dl_node_sync(vnf_p7_t* vnf_p7, nfapi_vnf_p7_connection_inf
|
|||||||
dl_node_sync.t1 = calculate_nr_t1(p7_info->mu, p7_info->sfn,p7_info->slot, vnf_p7->slot_start_time_hr);
|
dl_node_sync.t1 = calculate_nr_t1(p7_info->mu, p7_info->sfn,p7_info->slot, vnf_p7->slot_start_time_hr);
|
||||||
dl_node_sync.delta_sfn_slot = 0;
|
dl_node_sync.delta_sfn_slot = 0;
|
||||||
|
|
||||||
return vnf_nr_p7_pack_and_send_p7_msg(vnf_p7, &dl_node_sync.header);
|
return config->send_p7_msg(vnf_p7, &dl_node_sync.header);
|
||||||
}
|
}
|
||||||
|
|
||||||
int vnf_nr_sync(vnf_p7_t* vnf_p7, nfapi_vnf_p7_connection_info_t* p7_info)
|
int vnf_nr_sync(vnf_p7_t* vnf_p7, nfapi_vnf_p7_connection_info_t* p7_info)
|
||||||
|
|||||||
@@ -600,7 +600,7 @@ int nfapi_vnf_p7_dl_config_req(nfapi_vnf_p7_config_t* config, nfapi_dl_config_re
|
|||||||
return vnf_p7_pack_and_send_p7_msg(vnf_p7, &req->header);
|
return vnf_p7_pack_and_send_p7_msg(vnf_p7, &req->header);
|
||||||
}
|
}
|
||||||
|
|
||||||
int nfapi_vnf_p7_nr_dl_config_req(nfapi_vnf_p7_config_t* config, nfapi_nr_dl_tti_request_t* req)
|
bool nfapi_vnf_p7_nr_dl_config_req(nfapi_vnf_p7_config_t* config, nfapi_nr_dl_tti_request_t* req)
|
||||||
{
|
{
|
||||||
//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s(config:%p req:%p)\n", __FUNCTION__, config, req);
|
//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s(config:%p req:%p)\n", __FUNCTION__, config, req);
|
||||||
|
|
||||||
@@ -608,15 +608,17 @@ int nfapi_vnf_p7_nr_dl_config_req(nfapi_vnf_p7_config_t* config, nfapi_nr_dl_tti
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
vnf_p7_t* vnf_p7 = (vnf_p7_t*)config;
|
vnf_p7_t* vnf_p7 = (vnf_p7_t*)config;
|
||||||
return vnf_nr_p7_pack_and_send_p7_msg(vnf_p7, &req->header);
|
AssertFatal(config->send_p7_msg, "Function pointer must be configured|");
|
||||||
|
return config->send_p7_msg(vnf_p7, &req->header);
|
||||||
}
|
}
|
||||||
|
|
||||||
int nfapi_vnf_p7_ul_tti_req(nfapi_vnf_p7_config_t* config, nfapi_nr_ul_tti_request_t* req)
|
bool nfapi_vnf_p7_ul_tti_req(nfapi_vnf_p7_config_t* config, nfapi_nr_ul_tti_request_t* req)
|
||||||
{
|
{
|
||||||
if(config == 0 || req == 0)
|
if(config == 0 || req == 0)
|
||||||
return -1;
|
return -1;
|
||||||
vnf_p7_t* vnf_p7 = (vnf_p7_t*)config;
|
vnf_p7_t* vnf_p7 = (vnf_p7_t*)config;
|
||||||
return vnf_nr_p7_pack_and_send_p7_msg(vnf_p7, &req->header);
|
AssertFatal(config->send_p7_msg, "Function pointer must be configured|");
|
||||||
|
return config->send_p7_msg(vnf_p7, &req->header);
|
||||||
}
|
}
|
||||||
|
|
||||||
int nfapi_vnf_p7_ul_config_req(nfapi_vnf_p7_config_t* config, nfapi_ul_config_request_t* req)
|
int nfapi_vnf_p7_ul_config_req(nfapi_vnf_p7_config_t* config, nfapi_ul_config_request_t* req)
|
||||||
@@ -627,13 +629,14 @@ int nfapi_vnf_p7_ul_config_req(nfapi_vnf_p7_config_t* config, nfapi_ul_config_re
|
|||||||
vnf_p7_t* vnf_p7 = (vnf_p7_t*)config;
|
vnf_p7_t* vnf_p7 = (vnf_p7_t*)config;
|
||||||
return vnf_p7_pack_and_send_p7_msg(vnf_p7, &req->header);
|
return vnf_p7_pack_and_send_p7_msg(vnf_p7, &req->header);
|
||||||
}
|
}
|
||||||
int nfapi_vnf_p7_ul_dci_req(nfapi_vnf_p7_config_t* config, nfapi_nr_ul_dci_request_t* req)
|
bool nfapi_vnf_p7_ul_dci_req(nfapi_vnf_p7_config_t* config, nfapi_nr_ul_dci_request_t* req)
|
||||||
{
|
{
|
||||||
if(config == 0 || req == 0)
|
if(config == 0 || req == 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
vnf_p7_t* vnf_p7 = (vnf_p7_t*)config;
|
vnf_p7_t* vnf_p7 = (vnf_p7_t*)config;
|
||||||
return vnf_nr_p7_pack_and_send_p7_msg(vnf_p7, &req->header);
|
AssertFatal(config->send_p7_msg, "Function pointer must be configured|");
|
||||||
|
return config->send_p7_msg(vnf_p7, &req->header);
|
||||||
}
|
}
|
||||||
int nfapi_vnf_p7_hi_dci0_req(nfapi_vnf_p7_config_t* config, nfapi_hi_dci0_request_t* req)
|
int nfapi_vnf_p7_hi_dci0_req(nfapi_vnf_p7_config_t* config, nfapi_hi_dci0_request_t* req)
|
||||||
{
|
{
|
||||||
@@ -643,13 +646,14 @@ int nfapi_vnf_p7_hi_dci0_req(nfapi_vnf_p7_config_t* config, nfapi_hi_dci0_reques
|
|||||||
vnf_p7_t* vnf_p7 = (vnf_p7_t*)config;
|
vnf_p7_t* vnf_p7 = (vnf_p7_t*)config;
|
||||||
return vnf_p7_pack_and_send_p7_msg(vnf_p7, &req->header);
|
return vnf_p7_pack_and_send_p7_msg(vnf_p7, &req->header);
|
||||||
}
|
}
|
||||||
int nfapi_vnf_p7_tx_data_req(nfapi_vnf_p7_config_t* config, nfapi_nr_tx_data_request_t* req)
|
bool nfapi_vnf_p7_tx_data_req(nfapi_vnf_p7_config_t* config, nfapi_nr_tx_data_request_t* req)
|
||||||
{
|
{
|
||||||
if(config == 0 || req == 0)
|
if(config == 0 || req == 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
vnf_p7_t* vnf_p7 = (vnf_p7_t*)config;
|
vnf_p7_t* vnf_p7 = (vnf_p7_t*)config;
|
||||||
return vnf_nr_p7_pack_and_send_p7_msg(vnf_p7, &req->header);
|
AssertFatal(config->send_p7_msg, "Function pointer must be configured|");
|
||||||
|
return config->send_p7_msg(vnf_p7, &req->header);
|
||||||
}
|
}
|
||||||
int nfapi_vnf_p7_tx_req(nfapi_vnf_p7_config_t* config, nfapi_tx_request_t* req)
|
int nfapi_vnf_p7_tx_req(nfapi_vnf_p7_config_t* config, nfapi_tx_request_t* req)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user