From: pborla Date: Tue, 21 May 2024 10:00:40 +0000 (+0530) Subject: [Epic-Id: ODUHIGH-576][Task-Id: ODUHIGH-600][SubTask-Id: ODUHIGH-601]|[NFAPI_Branch... X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F16%2F12916%2F3;p=o-du%2Fl2.git [Epic-Id: ODUHIGH-576][Task-Id: ODUHIGH-600][SubTask-Id: ODUHIGH-601]|[NFAPI_Branch]| PHY PARAM.Request Change-Id: I99bf857cec59c3bbcadbf5b59db23be51d641c9f Signed-off-by: pborla --- diff --git a/src/5gnrmac/lwr_mac_fsm.c b/src/5gnrmac/lwr_mac_fsm.c index bca67c557..d78540ec2 100644 --- a/src/5gnrmac/lwr_mac_fsm.c +++ b/src/5gnrmac/lwr_mac_fsm.c @@ -37,7 +37,11 @@ #include "lwr_mac_phy.h" #include "lwr_mac_utils.h" #include "mac_utils.h" +#ifdef NFAPI_ENABLED #include "nfapi_interface.h" +#include "lwr_mac_sctp_inf.h" +#include "nfapi_common.h" +#endif #define MIB_SFN_BITMASK 0xFC #define PDCCH_PDU_TYPE 0 @@ -1329,6 +1333,25 @@ void setMibPdu(uint8_t *mibPdu, uint32_t *val, uint16_t sfn) uint8_t lwr_mac_procParamReqEvt(void *msg) { + +#ifdef NFAPI_ENABLED + + Buffer *mBuf = NULLP; + Pst pst; + + DU_LOG("\nCall Flow: ENTMAC -> ENTLWRMAC : NFAPI P5 PARAM_REQ\n"); + if (ODU_GET_MSG_BUF(MAC_MEM_REGION, MAC_POOL, &mBuf) != ROK) + { + DU_LOG("\nERROR --> NFAPI_VNF : Memory allocation failed in packPnfParamReq"); + return RFAILED; + } + nfapiFillP5Hdr(mBuf); + nfapiFillMsgHdr(mBuf, NFAPI_P5_PHY_ID, FAPI_PARAM_REQUEST, 0); + + FILL_PST_LWR_MAC_TO_DUAPP(pst, EVENT_PNF_DATA); + return ODU_POST_TASK(&pst, mBuf); + +#else #ifdef INTEL_FAPI #ifdef CALL_FLOW_DEBUG_LOG DU_LOG("\nCall Flow: ENTMAC -> ENTLWRMAC : PARAM_REQ\n"); @@ -1371,6 +1394,7 @@ uint8_t lwr_mac_procParamReqEvt(void *msg) DU_LOG("\nERROR --> LWR_MAC: Failed to allocate memory for Param Request"); return RFAILED; } +#endif #endif return ROK; } diff --git a/src/5gnrmac/nfapi_vnf_fsm.c b/src/5gnrmac/nfapi_vnf_fsm.c index d63ed4b84..84b9ea674 100644 --- a/src/5gnrmac/nfapi_vnf_fsm.c +++ b/src/5gnrmac/nfapi_vnf_fsm.c @@ -27,6 +27,7 @@ #include "lwr_mac_utils.h" #include "lwr_mac_sctp_inf.h" #include "mac_utils.h" +#include "lwr_mac_fsm.h" /******************************************************************* * @@ -332,6 +333,7 @@ uint8_t nfapi_vnf_procPnfStartRespEvt(nFapi_p5_hdr *p5Hdr, nFapi_msg_header *msg { vnfDb.pnfToReconfigure = false; } + sendEventToLowerMacFsm(PARAM_REQUEST, 0, NULL); } else { diff --git a/src/pnf_stub/pnf_stub.c b/src/pnf_stub/pnf_stub.c index f56a4902a..40acea58d 100644 --- a/src/pnf_stub/pnf_stub.c +++ b/src/pnf_stub/pnf_stub.c @@ -32,9 +32,11 @@ /* This functions contains main() for pnf simulator */ #include "common_def.h" #include +#include "nfapi_interface.h" #include "pnf_stub_sctp.h" #include "pnf_stub.h" -#include "nfapi_interface.h" +#include "pnf_stub_p5_msg_hdl.h" + PnfGlobalCb pnfCb; @@ -259,243 +261,7 @@ void nFapiExtractMsgHdr(nFapi_msg_header *msgHdr, Buffer *mBuf) return; } -/********************************************************************************* - * - * @Function Name: buildAndSendPnfReadyInd - * - * - * @Functionality: - * Builds and Sends PNF_READY_IND(Ref: SCF 225, Sec 3.1.0) - * - * - * *******************************************************************************/ -uint8_t buildAndSendPnfReadyInd() -{ - uint8_t ret = ROK; - Buffer *mBuf = NULLP; - - if (ODU_GET_MSG_BUF(PNF_APP_MEM_REG, PNF_POOL, &mBuf) != ROK) - { - DU_LOG("\nERROR --> NFAPI_PNF : Memory allocation failed in pnf_readyInd"); - return RFAILED; - } - nfapiFillP5Hdr(mBuf); - nfapiFillMsgHdr(mBuf, 0, TAG_NFAPI_PNF_READY_IND, 0); - CMCHKPK(oduPackPostUInt32, 123, mBuf); //version - ret = pnfP5SctpSend(mBuf); - if(ret == RFAILED) - { - ODU_PUT_MSG_BUF(mBuf); - } - return ret; -} - -/********************************************************************************* - * - * @Function Name: buildAndSendPnfParamResp - * - * @Functionality: - * Build Pnf Param rsp as per 5G nFAPI Specification 3.1.2 PNF_PARAM.response - * And Send to VNF - * - * *******************************************************************************/ - -uint8_t buildAndSendPnfParamResp() -{ - uint8_t ret = ROK,idx=0, array_size=0; - Buffer *mBuf = NULLP; - nFapi_pnf_param_general paramGeneral; - - memset(¶mGeneral, 0, sizeof(nFapi_pnf_param_general)); - array_size = sizeof(paramGeneral.loc_coordinates) / sizeof(paramGeneral.loc_coordinates[0]); - paramGeneral.max_num_phy=1; - - if (ODU_GET_MSG_BUF(PNF_APP_MEM_REG, PNF_POOL, &mBuf) != ROK) - { - DU_LOG("\nERROR --> NFAPI_PNF : Memory allocation failed in pnf_readyInd"); - return RFAILED; - } - nfapiFillP5Hdr(mBuf); - nfapiFillMsgHdr(mBuf, 0, TAG_NFAPI_PNF_PARAM_RESP, 0); - CMCHKPK(oduPackPostUInt8, 0, mBuf); - CMCHKPK(oduPackPostUInt8, 1, mBuf); - CMCHKPK(oduPackPostUInt16, TAG_NFAPI_PNF_PARAM_GENERAL, mBuf); - CMCHKPK(oduPackPostUInt16, sizeof(nFapi_pnf_param_general), mBuf); - CMCHKPK(oduPackPostUInt8, paramGeneral.nFapi_sync_mode, mBuf); - CMCHKPK(oduPackPostUInt8, paramGeneral.loc_mode, mBuf); - CMCHKPK(oduPackPostUInt16, paramGeneral.max_num_phy, mBuf); - for(idx =0; idx < 3; idx++) - { - CMCHKPK(oduPackPostUInt8, paramGeneral.oui[idx], mBuf); - } - CMCHKPK(oduPackPostUInt16, paramGeneral.numRfInstances, mBuf); - CMCHKPK(oduPackPostUInt16, paramGeneral.numDfeInstances, mBuf); - - ret = pnfP5SctpSend(mBuf); - if(ret == RFAILED) - { - ODU_PUT_MSG_BUF(mBuf); - } - return ret; -} - -/********************************************************************************* - * - * @Function Name: buildAndSendPnfConfigResp - * - * - * @Functionality: - * Builds and Sends PNF_CONFIG_RSP(Ref: SCF 225, Sec 3.1.4) - * - * - * *******************************************************************************/ -uint8_t buildAndSendPnfConfigResp() -{ - uint8_t ret = ROK; - Buffer *mBuf = NULLP; - - DU_LOG("\nINFO --> NFAPI_PNF: Building PNF_CONFIG_RSP"); - pnfCb.pnfCfgParams.pnfState=PNF_CONFIGURED; - - if(ODU_GET_MSG_BUF(PNF_APP_MEM_REG, PNF_POOL, &mBuf) != ROK) - { - DU_LOG("\nERROR --> NFAPI_PNF : Memory allocation failed in pnf config rsp"); - return RFAILED; - } - nfapiFillP5Hdr(mBuf); - nfapiFillMsgHdr(mBuf, 0, TAG_NFAPI_PNF_CONFIG_RESP, 0); - CMCHKPK(oduPackPostUInt32, 0, mBuf); //Error Code - ret = pnfP5SctpSend(mBuf); - if(ret == RFAILED) - { - ODU_PUT_MSG_BUF(mBuf); - } - return ret; -} - -/********************************************************************************* - * - * @Function Name: buildAndSendPnfStartResp - * - * - * @Functionality: - * Builds and Sends PNF_START_RSP(Ref: SCF 225, Sec 3.1.6) - * - * - * *******************************************************************************/ -uint8_t buildAndSendPnfStartResp() -{ - uint8_t ret = ROK; - Buffer *mBuf = NULLP; - - DU_LOG("\nINFO --> NFAPI_PNF: Building PNF_START_RSP"); - pnfCb.pnfCfgParams.pnfState=PNF_RUNNING; - - if(ODU_GET_MSG_BUF(PNF_APP_MEM_REG, PNF_POOL, &mBuf) != ROK) - { - DU_LOG("\nERROR --> NFAPI_PNF : Memory allocation failed in pnf start rsp"); - return RFAILED; - } - nfapiFillP5Hdr(mBuf); - nfapiFillMsgHdr(mBuf, 0, TAG_NFAPI_PNF_START_RESP, 0); - CMCHKPK(oduPackPostUInt32, 0, mBuf); //Error Code - ret = pnfP5SctpSend(mBuf); - if(ret == RFAILED) - { - ODU_PUT_MSG_BUF(mBuf); - } - return ret; -} +/********************************************************************** +End of file +**********************************************************************/ -/********************************************************************************* - * - * @Function Name: buildAndSendPnfStopResp - * - * - * @Functionality: - * Builds and Sends PNF_STOP_RSP(Ref: SCF 225, Sec 3.1.8) - * - * - * *******************************************************************************/ -uint8_t buildAndSendPnfStopResp() -{ - uint8_t ret = ROK; - Buffer *mBuf = NULLP; - - DU_LOG("\nINFO --> NFAPI_PNF: Building PNF_STOP_RSP"); - pnfCb.pnfCfgParams.pnfState=PNF_CONFIGURED; - - if(ODU_GET_MSG_BUF(PNF_APP_MEM_REG, PNF_POOL, &mBuf) != ROK) - { - DU_LOG("\nERROR --> NFAPI_PNF : Memory allocation failed in pnf stop rsp"); - return RFAILED; - } - nfapiFillP5Hdr(mBuf); - nfapiFillMsgHdr(mBuf, 0, TAG_NFAPI_PNF_STOP_RESP, 0); - CMCHKPK(oduPackPostUInt32, 0, mBuf); //Error Code - ret = pnfP5SctpSend(mBuf); - if(ret == RFAILED) - { - ODU_PUT_MSG_BUF(mBuf); - } - return ret; -} - -/********************************************************************************* - * - * @Function Name: p5MsgHandlerAtPnf - * - * - * @Functionality: - * Handles the P5 MEssages at PNF SIM - * - * @Params [IN]: Message Buffer received at SCTP NFAPI P5 Interface - * - * *******************************************************************************/ -uint8_t p5MsgHandlerAtPnf(Buffer *mBuf) -{ - nFapi_p5_hdr p5Hdr; - nFapi_msg_header msgHdr; - uint8_t ret = ROK; - - nFapiExtractP5Hdr(&p5Hdr, mBuf); - nFapiExtractMsgHdr(&msgHdr, mBuf); - - switch(msgHdr.msg_id) - { - case TAG_NFAPI_PNF_PARAM_REQ: - { - DU_LOG("\nINFO --> NFAPI_PNF: PNF_PARAM_REQ recevied."); - ret = buildAndSendPnfParamResp(); - break; - } - case TAG_NFAPI_PNF_CONFIG_REQ: - { - DU_LOG("\nINFO --> NFAPI_PNF: PNF_CONFIG_REQ recevied."); - ret = buildAndSendPnfConfigResp(); - break; - } - case TAG_NFAPI_PNF_START_REQ: - { - DU_LOG("\nINFO --> NFAPI_PNF: PNF_START_REQ recevied."); - ret = buildAndSendPnfStartResp(); - break; - } - case TAG_NFAPI_PNF_STOP_REQ: - { - DU_LOG("\nINFO --> NFAPI_PNF: PNF_STOP_REQ recevied."); - ret = buildAndSendPnfStopResp(); - break; - } - default: - { - DU_LOG("\nERROR --> NFAPI_PNF: Wrong MSGID of NFAPI P5 Message:%d",msgHdr.msg_id); - } - } - - if(ret == RFAILED) - { - return RFAILED; - } - return ret; -} diff --git a/src/pnf_stub/pnf_stub.h b/src/pnf_stub/pnf_stub.h index e49d7d48d..2c6baba9a 100644 --- a/src/pnf_stub/pnf_stub.h +++ b/src/pnf_stub/pnf_stub.h @@ -55,7 +55,9 @@ typedef struct pnfGlobalCb }PnfGlobalCb; extern PnfGlobalCb pnfCb; -uint8_t buildAndSendPnfReadyInd(); -uint8_t buildAndSendPnfConfigRsp(); uint8_t p5MsgHandlerAtPnf(Buffer *mBuf); +void nfapiFillP5Hdr(Buffer *mBuf); +void nfapiFillMsgHdr(Buffer *mBuf, uint8_t phyId, uint16_t msgId, uint32_t msgLen); +void nFapiExtractP5Hdr(nFapi_p5_hdr *p5Hdr, Buffer *mBuf); +void nFapiExtractMsgHdr(nFapi_msg_header *msgHdr, Buffer *mBuf); #endif diff --git a/src/pnf_stub/pnf_stub_p5_msg_hdl.c b/src/pnf_stub/pnf_stub_p5_msg_hdl.c new file mode 100644 index 000000000..a2108d977 --- /dev/null +++ b/src/pnf_stub/pnf_stub_p5_msg_hdl.c @@ -0,0 +1,321 @@ + +/******************************************************************************* + * ################################################################################ + * # Copyright (c) [2017-2019] [Radisys] + * # + * # + * # + * # Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 + * # + * # + * # + * # 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. + * # + * ################################################################################ + * *******************************************************************************/ + +/* This functions contains main() for pnf simulator */ +#include "common_def.h" +#include +#include "pnf_stub_p5_msg_hdl.h" +#include "nfapi_interface.h" +#include "pnf_stub_sctp.h" +#include "pnf_stub.h" + +PnfGlobalCb pnfCb; +/********************************************************************************* + * + * @Function Name: buildAndSendPnfReadyInd + * + * + * @Functionality: + * Builds and Sends PNF_READY_IND(Ref: SCF 225, Sec 3.1.0) + * + * + * *******************************************************************************/ +uint8_t buildAndSendPnfReadyInd() +{ + uint8_t ret = ROK; + Buffer *mBuf = NULLP; + + if (ODU_GET_MSG_BUF(PNF_APP_MEM_REG, PNF_POOL, &mBuf) != ROK) + { + DU_LOG("\nERROR --> NFAPI_PNF : Memory allocation failed in pnf_readyInd"); + return RFAILED; + } + nfapiFillP5Hdr(mBuf); + nfapiFillMsgHdr(mBuf, 0, TAG_NFAPI_PNF_READY_IND, 0); + CMCHKPK(oduPackPostUInt32, 123, mBuf); //version + ret = pnfP5SctpSend(mBuf); + if(ret == RFAILED) + { + ODU_PUT_MSG_BUF(mBuf); + } + return ret; +} + +/********************************************************************************* + * + * @Function Name: buildAndSendPnfParamResp + * + * @Functionality: + * Build Pnf Param rsp as per 5G nFAPI Specification 3.1.2 PNF_PARAM.response + * And Send to VNF + * + * *******************************************************************************/ + +uint8_t buildAndSendPnfParamResp() +{ + uint8_t ret = ROK,idx=0; + Buffer *mBuf = NULLP; + nFapi_pnf_param_general paramGeneral; + + memset(¶mGeneral, 0, sizeof(nFapi_pnf_param_general)); + paramGeneral.max_num_phy=1; + + if (ODU_GET_MSG_BUF(PNF_APP_MEM_REG, PNF_POOL, &mBuf) != ROK) + { + DU_LOG("\nERROR --> NFAPI_PNF : Memory allocation failed in pnf_readyInd"); + return RFAILED; + } + nfapiFillP5Hdr(mBuf); + nfapiFillMsgHdr(mBuf, 0, TAG_NFAPI_PNF_PARAM_RESP, 0); + CMCHKPK(oduPackPostUInt8, 0, mBuf); + CMCHKPK(oduPackPostUInt8, 1, mBuf); + CMCHKPK(oduPackPostUInt16, TAG_NFAPI_PNF_PARAM_GENERAL, mBuf); + CMCHKPK(oduPackPostUInt16, sizeof(nFapi_pnf_param_general), mBuf); + CMCHKPK(oduPackPostUInt8, paramGeneral.nFapi_sync_mode, mBuf); + CMCHKPK(oduPackPostUInt8, paramGeneral.loc_mode, mBuf); + CMCHKPK(oduPackPostUInt16, paramGeneral.max_num_phy, mBuf); + for(idx =0; idx < 3; idx++) + { + CMCHKPK(oduPackPostUInt8, paramGeneral.oui[idx], mBuf); + } + CMCHKPK(oduPackPostUInt16, paramGeneral.numRfInstances, mBuf); + CMCHKPK(oduPackPostUInt16, paramGeneral.numDfeInstances, mBuf); + + ret = pnfP5SctpSend(mBuf); + if(ret == RFAILED) + { + ODU_PUT_MSG_BUF(mBuf); + } + return ret; +} + +/********************************************************************************* + * + * @Function Name: buildAndSendPnfConfigResp + * + * + * @Functionality: + * Builds and Sends PNF_CONFIG_RSP(Ref: SCF 225, Sec 3.1.4) + * + * + * *******************************************************************************/ +uint8_t buildAndSendPnfConfigResp() +{ + uint8_t ret = ROK; + Buffer *mBuf = NULLP; + + DU_LOG("\nINFO --> NFAPI_PNF: Building PNF_CONFIG_RSP"); + pnfCb.pnfCfgParams.pnfState=PNF_CONFIGURED; + + if(ODU_GET_MSG_BUF(PNF_APP_MEM_REG, PNF_POOL, &mBuf) != ROK) + { + DU_LOG("\nERROR --> NFAPI_PNF : Memory allocation failed in pnf config rsp"); + return RFAILED; + } + nfapiFillP5Hdr(mBuf); + nfapiFillMsgHdr(mBuf, 0, TAG_NFAPI_PNF_CONFIG_RESP, 0); + CMCHKPK(oduPackPostUInt32, 0, mBuf); //Error Code + ret = pnfP5SctpSend(mBuf); + if(ret == RFAILED) + { + ODU_PUT_MSG_BUF(mBuf); + } + return ret; +} + +/********************************************************************************* + * + * @Function Name: buildAndSendPnfStartResp + * + * + * @Functionality: + * Builds and Sends PNF_START_RSP(Ref: SCF 225, Sec 3.1.6) + * + * + * *******************************************************************************/ +uint8_t buildAndSendPnfStartResp() +{ + uint8_t ret = ROK; + Buffer *mBuf = NULLP; + + DU_LOG("\nINFO --> NFAPI_PNF: Building PNF_START_RSP"); + pnfCb.pnfCfgParams.pnfState=PNF_RUNNING; + + if(ODU_GET_MSG_BUF(PNF_APP_MEM_REG, PNF_POOL, &mBuf) != ROK) + { + DU_LOG("\nERROR --> NFAPI_PNF : Memory allocation failed in pnf start rsp"); + return RFAILED; + } + nfapiFillP5Hdr(mBuf); + nfapiFillMsgHdr(mBuf, 0, TAG_NFAPI_PNF_START_RESP, 0); + CMCHKPK(oduPackPostUInt32, 0, mBuf); //Error Code + ret = pnfP5SctpSend(mBuf); + if(ret == RFAILED) + { + ODU_PUT_MSG_BUF(mBuf); + } + return ret; +} + +/********************************************************************************* + * + * @Function Name: buildAndSendPnfStopResp + * + * + * @Functionality: + * Builds and Sends PNF_STOP_RSP(Ref: SCF 225, Sec 3.1.8) + * + * + * *******************************************************************************/ +uint8_t buildAndSendPnfStopResp() +{ + uint8_t ret = ROK; + Buffer *mBuf = NULLP; + + DU_LOG("\nINFO --> NFAPI_PNF: Building PNF_STOP_RSP"); + pnfCb.pnfCfgParams.pnfState=PNF_CONFIGURED; + + if(ODU_GET_MSG_BUF(PNF_APP_MEM_REG, PNF_POOL, &mBuf) != ROK) + { + DU_LOG("\nERROR --> NFAPI_PNF : Memory allocation failed in pnf stop rsp"); + return RFAILED; + } + nfapiFillP5Hdr(mBuf); + nfapiFillMsgHdr(mBuf, 0, TAG_NFAPI_PNF_STOP_RESP, 0); + CMCHKPK(oduPackPostUInt32, 0, mBuf); //Error Code + ret = pnfP5SctpSend(mBuf); + if(ret == RFAILED) + { + ODU_PUT_MSG_BUF(mBuf); + } + return ret; +} + +/********************************************************************************* + * + * @Function Name: buildAndSendParamResp + * + * @Functionality: + * Build Param rsp as per 5G nFAPI Specification 3.1.2 PARAM.response + * And Send to VNF + * + * *******************************************************************************/ + +uint8_t buildAndSendParamResp() +{ + uint8_t ret = ROK,idx=0; + Buffer *mBuf = NULLP; + fapi_param_resp_t *fapiParamRsp; + + if (ODU_GET_MSG_BUF(PNF_APP_MEM_REG, PNF_POOL, &mBuf) != ROK) + { + DU_LOG("\nERROR --> NFAPI_PNF : Memory allocation failed in pnf_readyInd"); + return RFAILED; + } + nfapiFillP5Hdr(mBuf); + nfapiFillMsgHdr(mBuf, 0, FAPI_PARAM_RESPONSE, 0); + CMCHKPK(oduPackPostUInt8, 0, mBuf); + CMCHKPK(oduPackPostUInt8, 1, mBuf); + //TODO-> + //Fill TLVs + + return ROK; +} + +/********************************************************************************* + * + * @Function Name: p5MsgHandlerAtPnf + * + * + * @Functionality: + * Handles the P5 MEssages at PNF SIM + * + * @Params [IN]: Message Buffer received at SCTP NFAPI P5 Interface + * + * *******************************************************************************/ +uint8_t p5MsgHandlerAtPnf(Buffer *mBuf) +{ + nFapi_p5_hdr p5Hdr; + nFapi_msg_header msgHdr; + uint8_t ret = ROK; + + nFapiExtractP5Hdr(&p5Hdr, mBuf); + nFapiExtractMsgHdr(&msgHdr, mBuf); + + switch(msgHdr.msg_id) + { + case TAG_NFAPI_PNF_PARAM_REQ: + { + DU_LOG("\nINFO --> NFAPI_PNF: PNF_PARAM_REQ recevied."); + ret = buildAndSendPnfParamResp(); + break; + } + case TAG_NFAPI_PNF_CONFIG_REQ: + { + DU_LOG("\nINFO --> NFAPI_PNF: PNF_CONFIG_REQ recevied."); + ret = buildAndSendPnfConfigResp(); + break; + } + case TAG_NFAPI_PNF_START_REQ: + { + DU_LOG("\nINFO --> NFAPI_PNF: PNF_START_REQ recevied."); + ret = buildAndSendPnfStartResp(); + break; + } + case TAG_NFAPI_PNF_STOP_REQ: + { + DU_LOG("\nINFO --> NFAPI_PNF: PNF_STOP_REQ recevied."); + ret = buildAndSendPnfStopResp(); + break; + } + case FAPI_PARAM_REQUEST: + { + DU_LOG("\nINFO --> NFAPI_PNF: PHY_PARAM_REQ recevied."); + ret = buildAndSendParamResp(); + break; + } + default: + { + DU_LOG("\nERROR --> NFAPI_PNF: Wrong MSGID of NFAPI P5 Message:%d",msgHdr.msg_id); + } + } + + if(ret == RFAILED) + { + return RFAILED; + } + return ret; +} + +/********************************************************************** +End of file +**********************************************************************/ diff --git a/src/pnf_stub/pnf_stub_p5_msg_hdl.h b/src/pnf_stub/pnf_stub_p5_msg_hdl.h new file mode 100644 index 000000000..906a7b7a7 --- /dev/null +++ b/src/pnf_stub/pnf_stub_p5_msg_hdl.h @@ -0,0 +1,25 @@ + +/******************************************************************************* +################################################################################ +# Copyright (c) [2017-2019] [Radisys] # +# # +# Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 # +# # +# 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. # +################################################################################ +*******************************************************************************/ + +uint8_t buildAndSendPnfReadyInd(); +uint8_t buildAndSendPnfConfigRsp(); + +/********************************************************************** +End of file +**********************************************************************/ diff --git a/src/pnf_stub/pnf_stub_sctp.c b/src/pnf_stub/pnf_stub_sctp.c index 27950e7a4..a6ea67b67 100644 --- a/src/pnf_stub/pnf_stub_sctp.c +++ b/src/pnf_stub/pnf_stub_sctp.c @@ -19,7 +19,9 @@ /* This file contains all SCTP related functionality */ #include "common_def.h" +#include "nfapi_interface.h" #include "pnf_stub_sctp.h" +#include "pnf_stub_p5_msg_hdl.h" #include "pnf_stub.h" uint8_t socket_type; /* Socket type */