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 */
32 #define DU_SCTP_DOWN 0
34 #define DU_SCTP_CONNECTING 2
37 /* Global variable declaration */
38 U8 socket_type; /* Socket type */
39 Bool nonblocking; /* Blocking/Non-blocking socket */
40 Bool connUp; /* Is connection up */
42 CmInetNetAddrLst localAddrLst;
43 CmInetNetAddrLst remoteAddrLst;
47 S16 numFds; /* Total count number of receivers socket Fd */
48 U16 port; /* Filled by the InetSctpRecvMsg during polling */
49 U32 flag; /* Refers to the notifyHandler Flag during successful InetSctpRecvMsg*/
50 Buffer *mBuf; /* Buffer filled during Socket polling*/
51 MsgLen bufLen; /* Determines the length of the Buffer filled during socket polling */
52 CmInetNetAddr addr; /* Determines the destination port filled during socket polling */
53 CmInetFdSet readFd; /* Refers to the Read Fd socket */
54 CmInetSctpSndRcvInfo info; /* Refers to Send Receivers Info*/
55 CmInetSctpNotification ntfy; /* Refers to the sctp Notification Message */
60 U8 itfState; /* determines the interface State*/
61 U16 destPort; /* Refers to the destination port of F1/E2 */
62 U16 srcPort; /* Refers to respective src port of DU */
65 F1IpAddr destIpAddr; /* Refers to te destination Ip Address */
66 CmInetFd sockFd; /* Socket file descriptor */
67 CmInetNetAddrLst destAddrLst; /* Refers to the destinaiton Addr Lst in CmInetNetAddrLst format */
68 CmInetNetAddr destIpNetAddr; /* Refers to the destination Addr in CmInetNet Addr format */
71 /* Global variable declaration */
72 DuSctpDestCb f1Params; /* SCTP configurations at DU */
73 DuSctpDestCb ricParams; /* SCTP configurations at DU */
76 S16 sctpActvInit(Ent entity, Inst inst, Region region, Reason reason);
77 S16 sctpActvTsk(Pst *pst, Buffer *mBuf);
79 void sendToDuApp(Buffer *mBuf, Event event);
80 S16 sctpSend(Buffer *mBuf, U8 itfType);
81 typedef S16 (*SctpNtfy) ARGS((Buffer *mBuf, CmInetSctpNotification *ntfy));
82 S16 duSctpCfgReq(SctpParams sctpCfg);
83 S16 fillAddrLst(CmInetNetAddrLst *addrLstPtr, F1IpAddr *ipAddr);
84 S16 fillDestNetAddr(CmInetNetAddr *destAddrPtr, F1IpAddr *dstIpPtr);
85 S16 establishReq(DuSctpDestCb *paramPtr);
86 S16 duSctpAssocReq(U8 itfType);
87 S16 duFillSctpPst(Pst *pst, Event event);
88 S16 sctpSetSockOpts(CmInetFd *sock_Fd);
89 S16 processPolling(sctpSockPollParams *pollParams, CmInetFd *sockFd, U32 *timeoutPtr, CmInetMemInfo *memInfo, Bool recvMsgSet);
94 /**********************************************************************
96 **********************************************************************/