#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 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 */
+uint8_t socket_type; /* Socket type */
-RicSctpParams sctpCfg; /* SCTP configurations at DU */
typedef struct
{
uint16_t numFd;
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];
+}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;
+
+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(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