Code Review
/
o-du
/
l2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
EGTP receiver thread creation
[o-du/l2.git]
/
src
/
cu_stub
/
cu_stub_sctp.c
diff --git
a/src/cu_stub/cu_stub_sctp.c
b/src/cu_stub/cu_stub_sctp.c
index
8c36c12
..
e4c2669
100644
(file)
--- a/
src/cu_stub/cu_stub_sctp.c
+++ b/
src/cu_stub/cu_stub_sctp.c
@@
-18,10
+18,11
@@
/* This file contains all SCTP related functionality */
/* This file contains all SCTP related functionality */
-#include
<stdio.h>
+#include
"common_def.h"
#include "cu_f1ap_msg_hdl.h"
#include "cu_stub_sctp.h"
#include "cu_stub_egtp.h"
#include "cu_f1ap_msg_hdl.h"
#include "cu_stub_sctp.h"
#include "cu_stub_egtp.h"
+#include "du_log.h"
CuSctpDestCb f1Params;
/**************************************************************************
CuSctpDestCb f1Params;
/**************************************************************************
@@
-103,14
+104,11
@@
S16 sctpCfgReq()
f1Params.destPort = sctpCfg.duPort;
f1Params.srcPort = sctpCfg.cuPort;
f1Params.bReadFdSet = ROK;
f1Params.destPort = sctpCfg.duPort;
f1Params.srcPort = sctpCfg.cuPort;
f1Params.bReadFdSet = ROK;
-
cmMemset ((U8 *)
&f1Params.sockFd, -1, sizeof(CmInetFd));
-
cmMemset ((U8 *)
&f1Params.lstnSockFd, -1, sizeof(CmInetFd));
+
memset(
&f1Params.sockFd, -1, sizeof(CmInetFd));
+
memset(
&f1Params.lstnSockFd, -1, sizeof(CmInetFd));
fillDestNetAddr(&f1Params.destIpNetAddr, &sctpCfg.duIpAddr);
fillDestNetAddr(&f1Params.destIpNetAddr, &sctpCfg.duIpAddr);
-/* Set polling to FALSE */
- pollingState = FALSE;
-
- RETVALUE(ROK);
+ return ROK;
}
}
@@
-136,9
+134,9
@@
S16 fillAddrLst(CmInetNetAddrLst *addrLstPtr, SctpIpAddr *ipAddr)
{
addrLstPtr->count++;
addrLstPtr->addrs[(addrLstPtr->count - 1)].type = CM_INET_IPV4ADDR_TYPE;
{
addrLstPtr->count++;
addrLstPtr->addrs[(addrLstPtr->count - 1)].type = CM_INET_IPV4ADDR_TYPE;
- addrLstPtr->addrs[(addrLstPtr->count - 1)].u.ipv4NetAddr = CM_INET_NTOH_U32(ipAddr->ipV4Addr);
+ addrLstPtr->addrs[(addrLstPtr->count - 1)].u.ipv4NetAddr = CM_INET_NTOH_U
INT
32(ipAddr->ipV4Addr);
-
RETVALUE(ROK)
;
+
return ROK
;
}
/******************************************************************************
}
/******************************************************************************
@@
-162,8
+160,8
@@
S16 fillDestNetAddr(CmInetNetAddr *destAddrPtr, SctpIpAddr *dstIpPtr)
{
/* Filling destination address */
destAddrPtr->type = CM_INET_IPV4ADDR_TYPE;
{
/* Filling destination address */
destAddrPtr->type = CM_INET_IPV4ADDR_TYPE;
- destAddrPtr->u.ipv4NetAddr = CM_INET_NTOH_U32(dstIpPtr->ipV4Addr);
-
RETVALUE(ROK)
;
+ destAddrPtr->u.ipv4NetAddr = CM_INET_NTOH_U
INT
32(dstIpPtr->ipV4Addr);
+
return ROK
;
}
/******************************************************************************
}
/******************************************************************************
@@
-205,7
+203,7
@@
S16 sctpStartReq()
{
DU_LOG("\nSCTP: Polling failed to start at CU");
}
{
DU_LOG("\nSCTP: Polling failed to start at CU");
}
-
RETVALUE
(ret);
+
return
(ret);
}
/*******************************************************************
*
}
/*******************************************************************
*
@@
-225,7
+223,7
@@
S16 sctpStartReq()
* ****************************************************************/
S16 sctpSetSockOpts(CmInetFd *sock_Fd)
{
* ****************************************************************/
S16 sctpSetSockOpts(CmInetFd *sock_Fd)
{
- S16
ret = ROK;
+ S16 ret = ROK;
CmSctpEvent sctpEvent;
sctpEvent.dataIoEvent = TRUE;
CmSctpEvent sctpEvent;
sctpEvent.dataIoEvent = TRUE;
@@
-242,7
+240,7
@@
S16 sctpSetSockOpts(CmInetFd *sock_Fd)
ret = RFAILED;
}
ret = RFAILED;
}
-
RETVALUE
(ret);
+
return
(ret);
}
/*******************************************************************
}
/*******************************************************************
@@
-264,13
+262,14
@@
S16 sctpSetSockOpts(CmInetFd *sock_Fd)
* ****************************************************************/
S16 sctpAccept(CmInetFd *lstnSock_Fd, CmInetAddr *peerAddr, CmInetFd *sock_Fd)
{
* ****************************************************************/
S16 sctpAccept(CmInetFd *lstnSock_Fd, CmInetAddr *peerAddr, CmInetFd *sock_Fd)
{
- U8 ret;
+ uint8_t ret;
+
ret = cmInetListen(lstnSock_Fd, 1);
if (ret != ROK)
{
DU_LOG("\nSCTP : Listening on socket failed");
cmInetClose(lstnSock_Fd);
ret = cmInetListen(lstnSock_Fd, 1);
if (ret != ROK)
{
DU_LOG("\nSCTP : Listening on socket failed");
cmInetClose(lstnSock_Fd);
-
RETVALUE(RFAILED)
;
+
return RFAILED
;
}
DU_LOG("\nSCTP : Connecting");
}
DU_LOG("\nSCTP : Connecting");
@@
-285,7
+284,7
@@
S16 sctpAccept(CmInetFd *lstnSock_Fd, CmInetAddr *peerAddr, CmInetFd *sock_Fd)
else if(ret != ROK)
{
DU_LOG("\nSCTP : Failed to accept connection");
else if(ret != ROK)
{
DU_LOG("\nSCTP : Failed to accept connection");
-
RETVALUE(RFAILED)
;
+
return RFAILED
;
}
else
{
}
else
{
@@
-296,7
+295,7
@@
S16 sctpAccept(CmInetFd *lstnSock_Fd, CmInetAddr *peerAddr, CmInetFd *sock_Fd)
}
DU_LOG("\nSCTP : Connection established");
}
DU_LOG("\nSCTP : Connection established");
-
RETVALUE(ROK)
;
+
return ROK
;
}
/*******************************************************************
}
/*******************************************************************
@@
-376,7
+375,7
@@
S16 sctpNtfyHdlr(CmInetSctpNotification *ntfy)
}
sctpNtfyInd(ntfy);
}
sctpNtfyInd(ntfy);
-
RETVALUE(ROK)
;
+
return ROK
;
}/* End of sctpNtfyHdlr */
/*******************************************************************
}/* End of sctpNtfyHdlr */
/*******************************************************************
@@
-397,9
+396,9
@@
S16 sctpNtfyHdlr(CmInetSctpNotification *ntfy)
* ****************************************************************/
S16 sctpSockPoll()
{
* ****************************************************************/
S16 sctpSockPoll()
{
-
U16
ret = ROK;
-
U32
timeout;
-
U32
*timeoutPtr;
+
uint16_t
ret = ROK;
+
uint32_t
timeout;
+
uint32_t
*timeoutPtr;
Buffer *egtpBuf;
MsgLen egtpBufLen;
CmInetAddr egtpFromAddr;
Buffer *egtpBuf;
MsgLen egtpBufLen;
CmInetAddr egtpFromAddr;
@@
-440,12
+439,12
@@
S16 sctpSockPoll()
if(ret == ROK && egtpBuf != NULLP)
{
DU_LOG("\nEGTP : Received message \n");
if(ret == ROK && egtpBuf != NULLP)
{
DU_LOG("\nEGTP : Received message \n");
-
SPrntMsg
(egtpBuf, 0 ,0);
+
ODU_PRINT_MSG
(egtpBuf, 0 ,0);
cuEgtpHdlRecvMsg(egtpBuf);
}
};
cuEgtpHdlRecvMsg(egtpBuf);
}
};
-
RETVALUE
(ret);
+
return
(ret);
}/* End of sctpSockPoll() */
/*******************************************************************
}/* End of sctpSockPoll() */
/*******************************************************************
@@
-470,12
+469,12
@@
S16 sctpSockPoll()
* RFAILED - failure
*
* ****************************************************************/
* RFAILED - failure
*
* ****************************************************************/
-
-S16 processPolling(sctpSockPollParams *pollParams, CmInetFd *sockFd,
U32
*timeoutPtr, CmInetMemInfo *memInfo)
+
+S16 processPolling(sctpSockPollParams *pollParams, CmInetFd *sockFd,
uint32_t
*timeoutPtr, CmInetMemInfo *memInfo)
{
{
-
U16
ret = ROK;
+
uint16_t
ret = ROK;
CM_INET_FD_SET(sockFd, &pollParams->readFd);
CM_INET_FD_SET(sockFd, &pollParams->readFd);
- ret = cmInetSelect(&pollParams->readFd, NULLP, timeoutPtr, &pollParams->numFd
s
);
+ ret = cmInetSelect(&pollParams->readFd, NULLP, timeoutPtr, &pollParams->numFd);
if(CM_INET_FD_ISSET(sockFd, &pollParams->readFd))
{
CM_INET_FD_CLR(sockFd, &pollParams->readFd);
if(CM_INET_FD_ISSET(sockFd, &pollParams->readFd))
{
CM_INET_FD_CLR(sockFd, &pollParams->readFd);
@@
-497,15
+496,15
@@
S16 processPolling(sctpSockPollParams *pollParams, CmInetFd *sockFd, U32 *timeou
else if(connUp & (pollParams->port == f1Params.destPort))
{
F1APMsgHdlr(pollParams->mBuf);
else if(connUp & (pollParams->port == f1Params.destPort))
{
F1APMsgHdlr(pollParams->mBuf);
-
SPutMsg
(pollParams->mBuf);
+
ODU_PUT_MSG_BUF
(pollParams->mBuf);
}
else
{
}
else
{
-
SPutMsg
(pollParams->mBuf);
+
ODU_PUT_MSG_BUF
(pollParams->mBuf);
}
}
}
}
}
}
-
RETVALUE(ROK)
;
+
return ROK
;
}/* End of sctpSockPoll() */
/*******************************************************************
}/* End of sctpSockPoll() */
/*******************************************************************
@@
-526,7
+525,7
@@
S16 processPolling(sctpSockPollParams *pollParams, CmInetFd *sockFd, U32 *timeou
* ****************************************************************/
S16 sctpSend(Buffer *mBuf)
{
* ****************************************************************/
S16 sctpSend(Buffer *mBuf)
{
-
U8
ret;
+
uint8_t
ret;
MsgLen len; /* number of actually sent octets */
CmInetMemInfo memInfo;
MsgLen len; /* number of actually sent octets */
CmInetMemInfo memInfo;
@@
-538,10
+537,10
@@
S16 sctpSend(Buffer *mBuf)
if(ret != ROK && ret != RWOULDBLOCK)
{
DU_LOG("\nSCTP : Send message failed");
if(ret != ROK && ret != RWOULDBLOCK)
{
DU_LOG("\nSCTP : Send message failed");
-
RETVALUE(RFAILED)
;
+
return RFAILED
;
}
}
-
RETVALUE(ROK)
;
+
return ROK
;
} /* End of sctpSend */
/**********************************************************************
} /* End of sctpSend */
/**********************************************************************