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 */
24 #define DU_SCTP_DOWN 0
26 #define DU_SCTP_CONNECTING 2
29 /* Global variable declaration */
30 extern uint8_t socket_type; /* Socket type */
31 extern bool nonblocking; /* Blocking/Non-blocking socket */
32 extern bool connUp; /* Is connection up */
33 extern bool pollingState;
34 extern CmInetNetAddrLst localAddrLst;
35 extern CmInetNetAddrLst remoteAddrLst;
39 uint8_t numFd; /* Total count number of receivers socket Fd */
40 uint16_t port; /* Filled by the InetSctpRecvMsg during polling */
41 uint32_t flag; /* Refers to the notifyHandler Flag during successful InetSctpRecvMsg*/
42 Buffer *mBuf; /* Buffer filled during Socket polling*/
43 MsgLen bufLen; /* Determines the length of the Buffer filled during socket polling */
44 CmInetNetAddr addr; /* Determines the destination port filled during socket polling */
45 CmInetFdSet readFd; /* Refers to the Read Fd socket */
46 CmInetSctpSndRcvInfo info; /* Refers to Send Receivers Info*/
47 CmInetSctpNotification ntfy; /* Refers to the sctp Notification Message */
52 uint8_t itfState; /* determines the interface State*/
53 uint16_t destPort; /* Refers to the destination port of F1/E2 */
54 uint16_t srcPort; /* Refers to respective src port of DU */
57 F1IpAddr destIpAddr; /* Refers to te destination Ip Address */
58 CmInetFd sockFd; /* Socket file descriptor */
59 CmInetNetAddrLst destAddrLst; /* Refers to the destinaiton Addr Lst in CmInetNetAddrLst format */
60 CmInetNetAddr destIpNetAddr; /* Refers to the destination Addr in CmInetNet Addr format */
63 /* Global variable declaration */
64 extern DuSctpDestCb f1Params; /* SCTP configurations at DU */
65 extern DuSctpDestCb ricParams; /* SCTP configurations at DU */
68 uint8_t sctpActvInit(Ent entity, Inst inst, Region region, Reason reason);
69 uint8_t sctpActvTsk(Pst *pst, Buffer *mBuf);
71 void sendToDuApp(Buffer *mBuf, Event event);
72 uint8_t sctpSend(Buffer *mBuf, uint8_t itfType);
73 uint8_t duSctpCfgReq(SctpParams sctpCfg);
74 uint8_t fillAddrLst(CmInetNetAddrLst *addrLstPtr, F1IpAddr *ipAddr);
75 uint8_t fillDestNetAddr(CmInetNetAddr *destAddrPtr, F1IpAddr *dstIpPtr);
76 uint8_t establishReq(DuSctpDestCb *paramPtr);
77 uint8_t duSctpAssocReq(uint8_t itfType);
78 uint8_t duFillSctpPst(Pst *pst, Event event);
79 uint8_t sctpSetSockOpts(CmInetFd *sock_Fd);
80 uint8_t processPolling(sctpSockPollParams *pollParams, CmInetFd *sockFd, uint32_t *timeoutPtr, CmInetMemInfo *memInfo, bool recvMsgSet);
81 uint8_t sctpSockPoll();
85 /**********************************************************************
87 **********************************************************************/