X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fric_stub%2Fric_stub_sctp.c;h=53e4d0caaed6a9a1183c3640ef5e4d131ae350f6;hb=8bd856d0debe02bb5cc741a00c51cefcec982a15;hp=a32a9b35ffc1f554502e7a3bd98f65b23ba87663;hpb=bb8df345963bb5ef2e035ead7731c1171e4cbbe0;p=o-du%2Fl2.git diff --git a/src/ric_stub/ric_stub_sctp.c b/src/ric_stub/ric_stub_sctp.c index a32a9b35f..53e4d0caa 100644 --- a/src/ric_stub/ric_stub_sctp.c +++ b/src/ric_stub/ric_stub_sctp.c @@ -18,13 +18,17 @@ /* This file contains all SCTP related functionality */ -#include +#include "common_def.h" #include "ric_e2ap_msg_hdl.h" #include "ric_stub_sctp.h" +#include "ric_stub.h" +#include "E2AP-PDU.h" +#include "du_log.h" CuSctpDestCb ricParams; - - +RicSctpParams sctpCfg; +S16 fillAddrLst(CmInetNetAddrLst *addrLstPtr, SctpIpAddr *ipAddr); +S16 fillDestNetAddr(CmInetNetAddr *destAddrPtr, SctpIpAddr *dstIpPtr); /************************************************************************** * @brief Function to configure the Sctp Params during config Request * @@ -78,7 +82,7 @@ S16 fillAddrLst(CmInetNetAddrLst *addrLstPtr, SctpIpAddr *ipAddr) { addrLstPtr->count++; addrLstPtr->addrs[(addrLstPtr->count - 1)].type = CM_INET_IPV4ADDR_TYPE; - addrLstPtr->addrs[(addrLstPtr->count - 1)].u.ipv4NetAddr = CM_INET_NTOH_U32(ipAddr->ipV4Addr); + addrLstPtr->addrs[(addrLstPtr->count - 1)].u.ipv4NetAddr = CM_INET_NTOH_UINT32(ipAddr->ipV4Addr); return ROK; } @@ -104,7 +108,7 @@ S16 fillDestNetAddr(CmInetNetAddr *destAddrPtr, SctpIpAddr *dstIpPtr) { /* Filling destination address */ destAddrPtr->type = CM_INET_IPV4ADDR_TYPE; - destAddrPtr->u.ipv4NetAddr = CM_INET_NTOH_U32(dstIpPtr->ipV4Addr); + destAddrPtr->u.ipv4NetAddr = CM_INET_NTOH_UINT32(dstIpPtr->ipV4Addr); return ROK; } @@ -147,7 +151,7 @@ S16 sctpStartReq() { DU_LOG("\nSCTP: Polling failed to start at RIC"); } - RETVALUE(ret); + return (ret); } /******************************************************************* * @@ -184,7 +188,7 @@ S16 sctpSetSockOpts(CmInetFd *sock_Fd) ret = RFAILED; } - RETVALUE(ret); + return (ret); } /******************************************************************* @@ -206,7 +210,7 @@ S16 sctpSetSockOpts(CmInetFd *sock_Fd) * ****************************************************************/ S16 sctpAccept(CmInetFd *lstnSock_Fd, CmInetAddr *peerAddr, CmInetFd *sock_Fd) { - U8 ret; + uint8_t ret; ret = cmInetListen(lstnSock_Fd, 1); if (ret != ROK) @@ -340,10 +344,10 @@ S16 sctpNtfyHdlr(CmInetSctpNotification *ntfy) * ****************************************************************/ S16 sctpSockPoll() { - U16 ret = ROK; - U32 timeout; - U32 *timeoutPtr; - CmInetMemInfo memInfo; + uint16_t ret = ROK; + uint32_t timeout; + uint32_t *timeoutPtr; + CmInetMemInfo memInfo; sctpSockPollParams e2PollParams; memset(&e2PollParams, 0, sizeof(sctpSockPollParams)); @@ -373,7 +377,7 @@ S16 sctpSockPoll() DU_LOG("\nSCTP : Failed to RecvMsg for E2 at RIC \n"); } }; - RETVALUE(ret); + return (ret); }/* End of sctpSockPoll() */ /******************************************************************* @@ -400,9 +404,9 @@ S16 sctpSockPoll() * ****************************************************************/ -S16 processPolling(sctpSockPollParams *pollParams, CmInetFd *sockFd, U32 *timeoutPtr, CmInetMemInfo *memInfo) +S16 processPolling(sctpSockPollParams *pollParams, CmInetFd *sockFd, uint32_t *timeoutPtr, CmInetMemInfo *memInfo) { - U16 ret = ROK; + uint16_t ret = ROK; CM_INET_FD_SET(sockFd, &pollParams->readFd); ret = cmInetSelect(&pollParams->readFd, NULLP, timeoutPtr, &pollParams->numFd); if(CM_INET_FD_ISSET(sockFd, &pollParams->readFd)) @@ -426,11 +430,11 @@ S16 processPolling(sctpSockPollParams *pollParams, CmInetFd *sockFd, U32 *timeou else if(connUp & (pollParams->port == ricParams.destPort)) { E2APMsgHdlr(pollParams->mBuf); - SPutMsg(pollParams->mBuf); + ODU_PUT_MSG_BUF(pollParams->mBuf); } else { - SPutMsg(pollParams->mBuf); + ODU_PUT_MSG_BUF(pollParams->mBuf); } } } @@ -455,7 +459,7 @@ S16 processPolling(sctpSockPollParams *pollParams, CmInetFd *sockFd, U32 *timeou * ****************************************************************/ S16 sctpSend(Buffer *mBuf) { - U8 ret; + uint8_t ret; MsgLen len; /* number of actually sent octets */ CmInetMemInfo memInfo;