X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fcu_stub%2Fcu_stub_sctp.h;h=ed09e27691cb1497480d76cef0bdb41704a6e5ff;hb=2a743dfffc577ac90819776af7e0d86cb00fca57;hp=8cb745615495a435027e1e36a56a96cb73bdacfd;hpb=65443172dd60a6ea312bd3a15959dbf54ad7f045;p=o-du%2Fl2.git diff --git a/src/cu_stub/cu_stub_sctp.h b/src/cu_stub/cu_stub_sctp.h index 8cb745615..ed09e2769 100644 --- a/src/cu_stub/cu_stub_sctp.h +++ b/src/cu_stub/cu_stub_sctp.h @@ -21,22 +21,12 @@ #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 1 /* 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 */ - -CuSctpParams sctpCfg; /* SCTP configurations at DU */ typedef struct { @@ -53,6 +43,7 @@ typedef struct typedef struct { + uint32_t duId; uint16_t destPort; /* DU PORTS */ uint16_t srcPort; Bool bReadFdSet; @@ -62,19 +53,51 @@ typedef struct CmInetNetAddrLst destAddrLst; /* DU Ip address */ CmInetNetAddrLst localAddrLst; CmInetNetAddr destIpNetAddr; /* DU Ip address */ + Bool connUp; /* Is connection up */ }CuSctpDestCb; -S16 sctpActvInit(); -S16 sctpStartReq(); -S16 sctpSend(Buffer *mBuf); -S16 sctpCfgReq(); +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 cuIpAddr; + uint16_t cuPort; +}SctpAssocInfo; + +typedef struct cuSctpParams +{ + uint8_t numDu; + SctpAssocInfo sctpAssoc[MAX_DU_SUPPORTED]; +}CuSctpParams; + +typedef struct +{ + CuSctpParams sctpCfg; + uint8_t numDu; + CuSctpDestCb destCb[MAX_DU_SUPPORTED]; +}SctpGlobalCb; + +SctpGlobalCb sctpCb; + +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, uint32_t *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(CuSctpDestCb *destCb); +uint8_t processPolling(sctpSockPollParams *pollParams, CuSctpDestCb *destCb, uint32_t *timeoutPtr, CmInetMemInfo *memInfo); #endif /**********************************************************************