X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fdu_app%2Fdu_sctp.h;h=70a59bb7081ae04da994884b273a8779220bf552;hb=571b7d1991b8ea5cc64a76f38940d5ac9b4b84e2;hp=efdffc36bb7a3663f00aee3e5e546ac3f4f442ad;hpb=829bbd114f1c3dc00c1da47bca0a8207c049df3f;p=o-du%2Fl2.git diff --git a/src/du_app/du_sctp.h b/src/du_app/du_sctp.h index efdffc36b..70a59bb70 100644 --- a/src/du_app/du_sctp.h +++ b/src/du_app/du_sctp.h @@ -21,32 +21,74 @@ #ifndef __DU_SCTP_H__ #define __DU_SCTP_H__ -#include -#include +#include "du_cfg.h" #include "du_mgr.h" +#include "du_log.h" +#include "cm_inet.h" +#include "cm_tpt.h" -S16 sctpActvInit(Ent entity, Inst inst, Region region, Reason reason); -S16 sctpActvTsk(Pst *pst, Buffer *mBuf); +#include "cm_inet.x" +#include "cm_tpt.x" -#define REALLY_BIG 65536 +#define DU_SCTP_DOWN 0 +#define DU_SCTP_UP 1 +#define DU_SCTP_CONNECTING 2 +#define MAX_RETRY 5 -/* Convenience structure to determine space needed for cmsg. */ -typedef union -{ - struct sctp_initmsg init; - struct sctp_sndrcvinfo sndrcvinfo; -}_sctp_cmsg_data_t; +/* Global variable declaration */ +U8 socket_type; /* Socket type */ +Bool nonblocking; /* Blocking/Non-blocking socket */ +Bool connUp; /* Is connection up */ +Bool pollingState; +CmInetNetAddrLst localAddrLst; +CmInetNetAddrLst remoteAddrLst; -#define CMSG_SPACE_INITMSG (CMSG_SPACE(sizeof(struct sctp_initmsg))) -#define CMSG_SPACE_SNDRCV (CMSG_SPACE(sizeof(struct sctp_sndrcvinfo))) +typedef struct +{ + S16 numFds; /* Total count number of receivers socket Fd */ + U16 port; /* Filled by the InetSctpRecvMsg during polling */ + U32 flag; /* Refers to the notifyHandler Flag during successful InetSctpRecvMsg*/ + Buffer *mBuf; /* Buffer filled during Socket polling*/ + MsgLen bufLen; /* Determines the length of the Buffer filled during socket polling */ + CmInetNetAddr addr; /* Determines the destination port filled during socket polling */ + CmInetFdSet readFd; /* Refers to the Read Fd socket */ + CmInetSctpSndRcvInfo info; /* Refers to Send Receivers Info*/ + CmInetSctpNotification ntfy; /* Refers to the sctp Notification Message */ +}sctpSockPollParams; -typedef union +typedef struct { - struct sockaddr_storage ss; - struct sockaddr_in v4; - struct sockaddr_in6 v6; - struct sockaddr sa; -} sockaddr_storage_t; + U8 itfState; /* determines the interface State*/ + U16 destPort; /* Refers to the destination port of F1/E2 */ + U16 srcPort; /* Refers to respective src port of DU */ + U32 assocId; + Bool recvMsgSet; + F1IpAddr destIpAddr; /* Refers to te destination Ip Address */ + CmInetFd sockFd; /* Socket file descriptor */ + CmInetNetAddrLst destAddrLst; /* Refers to the destinaiton Addr Lst in CmInetNetAddrLst format */ + CmInetNetAddr destIpNetAddr; /* Refers to the destination Addr in CmInetNet Addr format */ +}DuSctpDestCb; + +/* Global variable declaration */ +DuSctpDestCb f1Params; /* SCTP configurations at DU */ +DuSctpDestCb ricParams; /* SCTP configurations at DU */ + + +S16 sctpActvInit(Ent entity, Inst inst, Region region, Reason reason); +S16 sctpActvTsk(Pst *pst, Buffer *mBuf); +void sctpAssocReq(); +void sendToDuApp(Buffer *mBuf, Event event); +S16 sctpSend(Buffer *mBuf, U8 itfType); +typedef S16 (*SctpNtfy) ARGS((Buffer *mBuf, CmInetSctpNotification *ntfy)); +S16 duSctpCfgReq(SctpParams sctpCfg); +S16 fillAddrLst(CmInetNetAddrLst *addrLstPtr, F1IpAddr *ipAddr); +S16 fillDestNetAddr(CmInetNetAddr *destAddrPtr, F1IpAddr *dstIpPtr); +S16 establishReq(DuSctpDestCb *paramPtr); +S16 duSctpAssocReq(U8 itfType); +S16 duFillSctpPst(Pst *pst, Event event); +S16 sctpSetSockOpts(CmInetFd *sock_Fd); +S16 processPolling(sctpSockPollParams *pollParams, CmInetFd *sockFd, U32 *timeoutPtr, CmInetMemInfo *memInfo, Bool recvMsgSet); +S16 sctpSockPoll(); #endif