1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2017-2019] [Radisys] #
5 # Licensed under the Apache License, Version 2.0 (the "License"); #
6 # you may not use this file except in compliance with the License. #
7 # You may obtain a copy of the License at #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
11 # Unless required by applicable law or agreed to in writing, software #
12 # distributed under the License is distributed on an "AS IS" BASIS, #
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
14 # See the License for the specific language governing permissions and #
15 # limitations under the License. #
16 ################################################################################
17 *******************************************************************************/
19 /* This file contains all SCTP related functionality */
33 #define DU_SCTP_DOWN 0
35 #define DU_SCTP_CONNECTING 2
38 /* Global variable declaration */
39 U8 socket_type; /* Socket type */
40 Bool nonblocking; /* Blocking/Non-blocking socket */
41 Bool connUp; /* Is connection up */
43 CmInetNetAddrLst localAddrLst;
44 CmInetNetAddrLst remoteAddrLst;
48 S16 numFds; /* Total count number of receivers socket Fd */
49 U16 port; /* Filled by the InetSctpRecvMsg during polling */
50 U32 flag; /* Refers to the notifyHandler Flag during successful InetSctpRecvMsg*/
51 Buffer *mBuf; /* Buffer filled during Socket polling*/
52 MsgLen bufLen; /* Determines the length of the Buffer filled during socket polling */
53 CmInetNetAddr addr; /* Determines the destination port filled during socket polling */
54 CmInetFdSet readFd; /* Refers to the Read Fd socket */
55 CmInetSctpSndRcvInfo info; /* Refers to Send Receivers Info*/
56 CmInetSctpNotification ntfy; /* Refers to the sctp Notification Message */
61 U8 itfState; /* determines the interface State*/
62 U16 destPort; /* Refers to the destination port of F1/E2 */
63 U16 srcPort; /* Refers to respective src port of DU */
66 F1IpAddr destIpAddr; /* Refers to te destination Ip Address */
67 CmInetFd sockFd; /* Socket file descriptor */
68 CmInetNetAddrLst destAddrLst; /* Refers to the destinaiton Addr Lst in CmInetNetAddrLst format */
69 CmInetNetAddr destIpNetAddr; /* Refers to the destination Addr in CmInetNet Addr format */
72 /* Global variable declaration */
73 DuSctpDestCb f1Params; /* SCTP configurations at DU */
74 DuSctpDestCb ricParams; /* SCTP configurations at DU */
77 S16 sctpActvInit(Ent entity, Inst inst, Region region, Reason reason);
78 S16 sctpActvTsk(Pst *pst, Buffer *mBuf);
80 void sendToDuApp(Buffer *mBuf, Event event);
81 S16 sctpSend(Buffer *mBuf, U8 itfType);
82 typedef S16 (*SctpNtfy) ARGS((Buffer *mBuf, CmInetSctpNotification *ntfy));
83 S16 duSctpCfgReq(SctpParams sctpCfg);
84 S16 fillAddrLst(CmInetNetAddrLst *addrLstPtr, F1IpAddr *ipAddr);
85 S16 fillDestNetAddr(CmInetNetAddr *destAddrPtr, F1IpAddr *dstIpPtr);
86 S16 establishReq(DuSctpDestCb *paramPtr);
87 S16 duSctpAssocReq(U8 itfType);
88 S16 duFillSctpPst(Pst *pst, Event event);
89 S16 sctpSetSockOpts(CmInetFd *sock_Fd);
90 S16 processPolling(sctpSockPollParams *pollParams, CmInetFd *sockFd, U32 *timeoutPtr, CmInetMemInfo *memInfo, Bool recvMsgSet);
95 /**********************************************************************
97 **********************************************************************/