X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fric_stub%2Fric_stub_sctp.h;h=37da87890a46f17385c50ff759f237d8f76e85b8;hb=d6a9e599366473a5cff5782859e4fd0dc94c62e6;hp=33355d8119a4af0f658ded18a154167ccf0b74f4;hpb=bb8df345963bb5ef2e035ead7731c1171e4cbbe0;p=o-du%2Fl2.git diff --git a/src/ric_stub/ric_stub_sctp.h b/src/ric_stub/ric_stub_sctp.h index 33355d811..37da87890 100644 --- a/src/ric_stub/ric_stub_sctp.h +++ b/src/ric_stub/ric_stub_sctp.h @@ -21,23 +21,13 @@ #ifndef __RIC_SCTP_H__ #define __RIC_SCTP_H__ -#include "stdbool.h" -#include "ric_stub.h" -#include "cm_inet.h" -#include "cm_tpt.h" - -#include "cm_inet.x" -#include "cm_tpt.x" - #define MAX_RETRY 5 +#define MAX_IPV6_LEN 16 +#define MAX_DU_SUPPORTED 1 /* Global variable declaration */ -U8 socket_type; /* Socket type */ -bool nonblocking; /* Blocking/Non-blocking socket */ -bool connUp; /* Is connection up */ -int assocId; /* Assoc Id of connected assoc */ +uint8_t socket_type; /* Socket type */ -RicSctpParams sctpCfg; /* SCTP configurations at DU */ typedef struct { uint16_t numFd; @@ -62,18 +52,50 @@ typedef struct CmInetNetAddrLst destAddrLst; /* DU Ip address */ CmInetNetAddrLst localAddrLst; CmInetNetAddr destIpNetAddr; /* DU Ip address */ -}CuSctpDestCb; + Bool connUp; +}RicSctpDestCb; + +typedef struct ipAddr +{ + bool ipV4Pres; + uint32_t ipV4Addr; + bool ipV6Pres; + uint8_t ipV6Addr[MAX_IPV6_LEN]; +}SctpIpAddr; + +typedef struct sctpAssocInfo +{ + SctpIpAddr duIpAddr; + uint16_t duPort; + SctpIpAddr ricIpAddr; + uint16_t ricPort; +}SctpAssocInfo; + +typedef struct ricSctpParams +{ + uint8_t numDu; + SctpAssocInfo sctpAssoc[MAX_DU_SUPPORTED]; +}RicSctpParams; + +typedef struct sctpGlobalCb +{ + RicSctpParams sctpCfg; + uint8_t numDu; + RicSctpDestCb destCb[MAX_DU_SUPPORTED]; +}SctpGlobalCb; + +SctpGlobalCb sctpCb; -EXTERN S16 sctpActvInit(); -EXTERN S16 sctpSend(Buffer *mBuf); -S16 sctpCfgReq(); -S16 sctpStartReq(); -S16 fillAddrLst(CmInetNetAddrLst *addrLstPtr, SctpIpAddr *ipAddr); -S16 fillDestNetAddr(CmInetNetAddr *destAddrPtr, SctpIpAddr *dstIpPtr); -S16 sctpSetSockOpts(CmInetFd *sock_Fd); -S16 sctpAccept(CmInetFd *lstnSock_Fd, CmInetAddr *peerAddr, CmInetFd *sock_Fd); -S16 sctpSockPoll(); -S16 processPolling(sctpSockPollParams *pollParams, CmInetFd *sockFd, U32 *timeoutPtr, CmInetMemInfo *memInfo); +uint8_t sctpActvInit(); +uint8_t sctpSend(Buffer *mBuf); +uint8_t sctpCfgReq(); +uint8_t sctpStartReq(); +uint8_t sctpSetSockOpts(CmInetFd *sock_Fd); +uint8_t sctpAccept(RicSctpDestCb *destCb); +uint8_t sctpSockPoll(); +uint8_t processPolling(sctpSockPollParams *pollParams, RicSctpDestCb *destCb, uint32_t *timeoutPtr, CmInetMemInfo *memInfo); +uint8_t fillAddrLst(CmInetNetAddrLst *addrLstPtr, SctpIpAddr *ipAddr); +uint8_t fillDestNetAddr(CmInetNetAddr *destAddrPtr, SctpIpAddr *dstIpPtr); #endif