Change PNF to use functions pointers to pack/unpack messages.
Adds 3 new function pointers to the P5 and P7 PNF structures, allowing to configure which function to use to pack/unpack the messages, as well as unpack the message header, being then used seamlessly regardless of using the FAPI or nFAPI functions. Changes the header unpack and message unpack functions to return true on success and false on failure, instead of an int
This commit is contained in:
@@ -1747,6 +1747,9 @@ int nr_start_request(nfapi_pnf_config_t *config, nfapi_pnf_phy_config_t *phy, nf
|
||||
p7_config->codec_config.pack_p7_vendor_extension = &pnf_nr_phy_pack_p7_vendor_extension;
|
||||
p7_config->codec_config.unpack_vendor_extension_tlv = &pnf_nr_phy_unpack_vendor_extension_tlv;
|
||||
p7_config->codec_config.pack_vendor_extension_tlv = &pnf_nr_phy_pack_vendor_extention_tlv;
|
||||
p7_config->unpack_func = &nfapi_nr_p7_message_unpack;
|
||||
p7_config->hdr_unpack_func = &nfapi_nr_p7_message_header_unpack;
|
||||
p7_config->pack_func = &nfapi_nr_p7_message_pack;
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] Creating P7 thread %s\n", __FUNCTION__);
|
||||
pthread_t p7_thread;
|
||||
threadCreate(&p7_thread, &pnf_nr_p7_thread_start, p7_config, "pnf_p7_thread", -1, OAI_PRIORITY_RT);
|
||||
@@ -2188,6 +2191,9 @@ void configure_nr_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_add
|
||||
config->deallocate_p4_p5_vendor_ext = &pnf_nr_sim_deallocate_p4_p5_vendor_ext;
|
||||
config->codec_config.unpack_p4_p5_vendor_extension = &pnf_nr_sim_unpack_p4_p5_vendor_extension;
|
||||
config->codec_config.pack_p4_p5_vendor_extension = &pnf_nr_sim_pack_p4_p5_vendor_extension;
|
||||
config->unpack_func = &nfapi_nr_p5_message_unpack;
|
||||
config->hdr_unpack_func = &nfapi_nr_p5_message_header_unpack;
|
||||
config->pack_func = &nfapi_nr_p5_message_pack;
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] Creating PNF NFAPI start thread %s\n", __FUNCTION__);
|
||||
pthread_create(&pnf_start_pthread, NULL, &pnf_nr_start_thread, config);
|
||||
pthread_setname_np(pnf_start_pthread, "NFAPI_PNF");
|
||||
|
||||
Reference in New Issue
Block a user