X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fcu_stub%2Fcu_stub_sctp.h;h=548c29a1678f30d7c6928cd35307d5c9a85ce6a1;hb=6636207100c598cd70537d177670ef131e263931;hp=03f273a67a108d744ec1e7c1b0b62e5d183acb08;hpb=3235ecfc7414aa0b72d0ad50db63ae8b5626045b;p=o-du%2Fl2.git diff --git a/src/cu_stub/cu_stub_sctp.h b/src/cu_stub/cu_stub_sctp.h index 03f273a67..548c29a16 100644 --- a/src/cu_stub/cu_stub_sctp.h +++ b/src/cu_stub/cu_stub_sctp.h @@ -21,32 +21,83 @@ #ifndef __CU_SCTP_H__ #define __CU_SCTP_H__ -#include "cu_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 2 +#define MAX_ASSOC_SUPPORTED MAX_DU_SUPPORTED /* Global variable declaration */ -CmInetFd lstnSockFd; /* Listening Socket file descriptor */ -CmInetFd sockFd; /* Socket File descriptor */ -U8 socket_type; /* Socket type */ -Bool nonblocking; /* Blocking/Non-blocking socket */ -Bool connUp; /* Is connection up */ -int assocId; /* Assoc Id of connected assoc */ - -CmInetNetAddrLst localAddrLst; -CmInetNetAddrLst remoteAddrLst; - -SctpParams *sctpCfg; /* SCTP configurations at DU */ - -EXTERN S16 sctpActvInit(); -EXTERN void sctpStartReq(); -EXTERN S16 sctpSend(Buffer *mBuf); +uint8_t socket_type; /* Socket type */ + +typedef struct +{ + S16 numFd; + uint16_t port; + uint32_t flag; + Buffer *mBuf; + MsgLen bufLen; + CmInetNetAddr addr; + CmInetFdSet readFd; + CmInetSctpSndRcvInfo info; + CmInetSctpNotification ntfy; +}sctpSockPollParams; + +typedef struct +{ + uint32_t duId; + uint16_t destPort; /* DU PORTS */ + Bool bReadFdSet; + CmInetFd sockFd; /* Socket file descriptor */ + CmInetAddr peerAddr; + CmInetNetAddrLst destAddrLst; /* DU Ip address */ + CmInetNetAddr destIpNetAddr; /* DU Ip address */ + Bool connUp; /* Is connection up */ +}CuSctpAssocCb; + +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 cuSctpParams +{ + SctpIpAddr localIpAddr; + uint16_t f1SctpPort; + uint8_t numDestNode; + SctpDestInfo destCb[MAX_DU_SUPPORTED]; +}CuSctpParams; + +typedef struct +{ + CuSctpParams sctpCfg; + CmInetNetAddrLst localAddrLst; + CmInetFd f1LstnSockFd; /* Listening Socket file descriptor for F1 association */ + uint8_t numAssoc; + CuSctpAssocCb assocCb[MAX_ASSOC_SUPPORTED]; +}SctpGlobalCb; + +SctpGlobalCb sctpCb; + +uint8_t sctpActvInit(); +uint8_t sctpStartReq(); +uint8_t sctpSend(uint32_t duId, Buffer *mBuf); +uint8_t sctpCfgReq(); +uint8_t fillAddrLst(CmInetNetAddrLst *addrLstPtr, SctpIpAddr *ipAddr); +uint8_t fillDestNetAddr(CmInetNetAddr *destAddrPtr, SctpIpAddr *dstIpPtr); +uint8_t sctpSetSockOpts(CmInetFd *sock_Fd); +uint8_t sctpSockPoll(); +uint8_t sctpAccept(CuSctpAssocCb *assocCb); +uint8_t processPolling(sctpSockPollParams *pollParams, CuSctpAssocCb *assocCb, uint32_t *timeoutPtr, CmInetMemInfo *memInfo); #endif /**********************************************************************