X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fric_stub%2Fric_stub_sctp.h;h=c0ba6d8b9c8b5d5defd2f0735189b609cf97b3d6;hb=2a310f38af13dafd243ef7b24d5a721ed34355b3;hp=fd72abbda25461e3aa3ba7ea9ea9fcb9d5238ae3;hpb=65443172dd60a6ea312bd3a15959dbf54ad7f045;p=o-du%2Fl2.git diff --git a/src/ric_stub/ric_stub_sctp.h b/src/ric_stub/ric_stub_sctp.h index fd72abbda..c0ba6d8b9 100644 --- a/src/ric_stub/ric_stub_sctp.h +++ b/src/ric_stub/ric_stub_sctp.h @@ -20,14 +20,23 @@ #ifndef __RIC_SCTP_H__ #define __RIC_SCTP_H__ + #define MAX_RETRY 5 +#define MAX_IPV6_LEN 16 +#define MAX_DU_SUPPORTED 2 +#define MAX_ASSOC_SUPPORTED MAX_DU_SUPPORTED /* Global variable declaration */ -uint8_t socket_type; /* Socket type */ -bool nonblocking; /* Blocking/Non-blocking socket */ -bool connUp; /* Is connection up */ -int assocId; /* Assoc Id of connected assoc */ - +extern uint8_t socket_type; /* Socket type */ + +/* O-RAN.WG3.E2AP-R003-v03.00 : Section 9.2.30 */ +typedef enum +{ + RIC_SERVICE, + SUPPORT_FUNCTIONS, + BOTH_FUNCTIONALITY +}AssocUsage; + typedef struct { uint16_t numFd; @@ -43,25 +52,60 @@ typedef struct typedef struct { + uint32_t duId; uint16_t destPort; /* DU PORTS */ - uint16_t srcPort; bool bReadFdSet; CmInetFd sockFd; /* Socket file descriptor */ CmInetAddr peerAddr; - CmInetFd lstnSockFd; /* Listening Socket file descriptor */ CmInetNetAddrLst destAddrLst; /* DU Ip address */ - CmInetNetAddrLst localAddrLst; CmInetNetAddr destIpNetAddr; /* DU Ip address */ -}CuSctpDestCb; + Bool connUp; +}RicSctpAssocCb; + +typedef struct ipAddr +{ + bool ipV4Pres; + uint32_t ipV4Addr; + bool ipV6Pres; + uint8_t ipV6Addr[MAX_IPV6_LEN]; +}SctpIpAddr; + +typedef struct sctpDestInfo +{ + SctpIpAddr destIpAddr; + uint16_t destPort; +}SctpDestInfo; + +typedef struct ricSctpParams +{ + SctpIpAddr localIpAddr; + uint16_t e2SctpPort; + uint8_t numDestNode; + SctpDestInfo destCb[MAX_DU_SUPPORTED]; + AssocUsage usage; +}RicSctpParams; + +typedef struct sctpGlobalCb +{ + RicSctpParams sctpCfg; + CmInetNetAddrLst localAddrLst; + CmInetFd e2LstnSockFd; /* Listening Socket file descriptor for E2 association */ + uint8_t numAssoc; + RicSctpAssocCb assocCb[MAX_ASSOC_SUPPORTED]; +}SctpGlobalCb; + +extern SctpGlobalCb sctpCb; -S16 sctpActvInit(); -S16 sctpSend(Buffer *mBuf); -S16 sctpCfgReq(); -S16 sctpStartReq(); -S16 sctpSetSockOpts(CmInetFd *sock_Fd); -S16 sctpAccept(CmInetFd *lstnSock_Fd, CmInetAddr *peerAddr, CmInetFd *sock_Fd); -S16 sctpSockPoll(); -S16 processPolling(sctpSockPollParams *pollParams, CmInetFd *sockFd, uint32_t *timeoutPtr, CmInetMemInfo *memInfo); +uint8_t sctpActvInit(); +uint8_t sctpSend(uint32_t duId, Buffer *mBuf); +uint8_t sctpCfgReq(); +uint8_t sctpStartReq(); +uint8_t sctpSetSockOpts(CmInetFd *sock_Fd); +uint8_t sctpAccept(RicSctpAssocCb *assocCb); +uint8_t sctpSockPoll(); +uint8_t processPolling(sctpSockPollParams *pollParams, RicSctpAssocCb *destCb, uint32_t *timeoutPtr, CmInetMemInfo *memInfo); +uint8_t fillAddrLst(CmInetNetAddrLst *addrLstPtr, SctpIpAddr *ipAddr); +uint8_t fillDestNetAddr(CmInetNetAddr *destAddrPtr, SctpIpAddr *dstIpPtr); #endif