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=6a921a2e24077727de299706bf23ceec317f1c5c;hp=d2e08b6b05439585e0460696df6f30314d6c2ab1;hpb=8660dd47a5ef27b62300fabf6b027852f1d5d026;p=o-du%2Fl2.git diff --git a/src/cu_stub/cu_stub_sctp.h b/src/cu_stub/cu_stub_sctp.h index d2e08b6b0..548c29a16 100644 --- a/src/cu_stub/cu_stub_sctp.h +++ b/src/cu_stub/cu_stub_sctp.h @@ -21,33 +21,22 @@ #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 DU_SCTP_DOWN 0 -#define DU_SCTP_UP 1 +#define MAX_IPV6_LEN 16 +#define MAX_DU_SUPPORTED 2 +#define MAX_ASSOC_SUPPORTED MAX_DU_SUPPORTED /* 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 */ - -SctpParamsCu sctpCfg; /* SCTP configurations at DU */ -Bool pollingState; +uint8_t socket_type; /* Socket type */ + typedef struct { - S16 numFds; - U16 port; - U32 flag; - Buffer *mBuf; - MsgLen bufLen; - CmInetNetAddr addr; + S16 numFd; + uint16_t port; + uint32_t flag; + Buffer *mBuf; + MsgLen bufLen; + CmInetNetAddr addr; CmInetFdSet readFd; CmInetSctpSndRcvInfo info; CmInetSctpNotification ntfy; @@ -55,28 +44,60 @@ typedef struct typedef struct { - U16 destPort; /* DU PORTS */ - U16 srcPort; + uint32_t duId; + uint16_t destPort; /* DU PORTS */ 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; /* 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; -EXTERN S16 sctpActvInit(); -EXTERN S16 sctpStartReq(); -EXTERN S16 sctpSend(Buffer *mBuf); -EXTERN S16 sctpCfgReq(); +uint8_t sctpActvInit(); +uint8_t sctpStartReq(); +uint8_t sctpSend(uint32_t duId, Buffer *mBuf); +uint8_t sctpCfgReq(); -S16 fillAddrLst(CmInetNetAddrLst *addrLstPtr, SctpIpAddr *ipAddr); -S16 fillDestNetAddr(CmInetNetAddr *destAddrPtr, SctpIpAddr *dstIpPtr); -S16 sctpSetSockOpts(CmInetFd *sock_Fd); -S16 sctpSockPoll(); -S16 sctpAccept(CmInetFd *lstnSock_Fd, CmInetAddr *peerAddr, CmInetFd *sock_Fd); -S16 processPolling(sctpSockPollParams *pollParams, CmInetFd *sockFd, U32 *timeoutPtr, CmInetMemInfo *memInfo); +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 /**********************************************************************