X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fdu_app%2Fdu_sctp.h;h=94e0c0c4fe1f2c5b383d968c49fb85dc6a8e093a;hb=49856df248fd976b4a9882ca4e650fc0bc3e4ee3;hp=45da7b5925ebf25d2b93c671c02b445220d27697;hpb=3235ecfc7414aa0b72d0ad50db63ae8b5626045b;p=o-du%2Fl2.git diff --git a/src/du_app/du_sctp.h b/src/du_app/du_sctp.h index 45da7b592..94e0c0c4f 100644 --- a/src/du_app/du_sctp.h +++ b/src/du_app/du_sctp.h @@ -21,35 +21,64 @@ #ifndef __DU_SCTP_H__ #define __DU_SCTP_H__ -#include "du_cfg_hdl.h" -#include "du_mgr.h" -#include "du_log.h" -#include "cm_inet.h" -#include "cm_tpt.h" +#define DU_SCTP_DOWN 0 +#define DU_SCTP_UP 1 +#define DU_SCTP_CONNECTING 2 +#define MAX_RETRY 5 + +/* Global variable declaration */ +extern uint8_t socket_type; /* Socket type */ +extern bool nonblocking; /* Blocking/Non-blocking socket */ +extern bool connUp; /* Is connection up */ +extern bool pollingState; +extern CmInetNetAddrLst localAddrLst; +extern CmInetNetAddrLst remoteAddrLst; + +typedef struct +{ + uint8_t numFd; /* Total count number of receivers socket Fd */ + uint16_t port; /* Filled by the InetSctpRecvMsg during polling */ + uint32_t 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; -#include "cm_inet.x" -#include "cm_tpt.x" +typedef struct +{ + uint8_t itfState; /* determines the interface State*/ + uint16_t destPort; /* Refers to the destination port of F1/E2 */ + uint16_t srcPort; /* Refers to respective src port of DU */ + uint32_t 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 */ -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; - -extern F1SctpParams sctpCfg; /* SCTP configurations at DU */ - -S16 sctpActvInit(Ent entity, Inst inst, Region region, Reason reason); -S16 sctpActvTsk(Pst *pst, Buffer *mBuf); +extern DuSctpDestCb f1Params; /* SCTP configurations at DU */ +extern DuSctpDestCb ricParams; /* SCTP configurations at DU */ + + +uint8_t sctpActvInit(Ent entity, Inst inst, Region region, Reason reason); +uint8_t sctpActvTsk(Pst *pst, Buffer *mBuf); void sctpAssocReq(); void sendToDuApp(Buffer *mBuf, Event event); -S16 sctpSend(Buffer *mBuf); -typedef S16 (*SctpNtfy) ARGS((Buffer *mBuf, CmInetSctpNotification *ntfy)); - -#define MAX_RETRY 5 +uint8_t sctpSend(Buffer *mBuf, uint8_t itfType); +uint8_t duSctpCfgReq(SctpParams sctpCfg); +uint8_t fillAddrLst(CmInetNetAddrLst *addrLstPtr, F1IpAddr *ipAddr); +uint8_t fillDestNetAddr(CmInetNetAddr *destAddrPtr, F1IpAddr *dstIpPtr); +uint8_t establishReq(DuSctpDestCb *paramPtr); +uint8_t duSctpAssocReq(uint8_t itfType); +uint8_t duFillSctpPst(Pst *pst, Event event); +uint8_t sctpSetSockOpts(CmInetFd *sock_Fd); +uint8_t processPolling(sctpSockPollParams *pollParams, CmInetFd *sockFd, uint32_t *timeoutPtr, CmInetMemInfo *memInfo, bool recvMsgSet); +uint8_t sctpSockPoll(); #endif