\f
/* header include files (.h) */
-#include "envopt.h" /* environment options */
-#include "envdep.h" /* environment dependent */
-#include "envind.h" /* environment independent */
-
-#include "gen.h" /* general */
-#include "ssi.h" /* system services interface */
+#include "common_def.h"
#include "cm_inet.h" /* socket library file */
/*cm_inet_c_001.main_35 : Updated for C++ compilation */
#endif /* __cplusplus */
/* header/extern include files (.x) */
-#include "gen.x" /* general */
-#include "ssi.x" /* system services interface */
#include "cm_inet.x" /* socket library file */
-#include "cm_lib.x" /* lib library file */
#ifdef NTL_LIB
#include "ntl_lib.h"
#endif
-#include "du_log.h"
\f
/* local defines */
uint16_t port /* port number */
)
{
- S32 ret;
- uint32_t cnt;
+ int32_t tempErrorNo=0;
+ S32 ret =0;
+ uint32_t cnt=0;
/* cm_inet_c_001.main_46: Removed SS_LINUX flag */
- S32 idx;
+ S32 idx=0;
/* cm_inet_c_001.main_64: New variable used as an argument for sctp_connectx */
#ifdef SCTP_CONNECTX_NEW
#endif /* CMINET_SUN_CONNECTX */
#endif /* SS_LINUX */
-
+ tempErrorNo = INET_ERR_CODE;
if (ret == INET_ERR)
{
#ifdef CMINETDBG
/* cm_inet_c_001.main_54: CMINETLOGERROR added insted of SDisp */
/* cm_inet_c_001.main_62:Warning fix */
snprintf(prntBuf, CMINET_PRNT_BUF_SIZE, "CmInetSctpConnectx() Failed : error(%d), port(0x%1x),"
- " sockFd->fd(%ld)\n", INET_ERR_CODE, port, sockFd->fd);
+ " sockFd->fd(%ld)\n", tempErrorNo, port, sockFd->fd);
CMINETLOGERROR(ERRCLS_DEBUG, ECMINET010, 0, prntBuf);
#else
DU_LOG("\nCmInetSctpConnectx() Failed : error(%d), port(0x%1x),\
- sockFd->fd(%d)\n", INET_ERR_CODE, port, sockFd->fd);
+ sockFd->fd(%d)\n", tempErrorNo, port, sockFd->fd);
#endif /*ALIGN_64BIT*/
#endif /* CMINETDBG */
- switch (INET_ERR_CODE)
+ switch (tempErrorNo)
{
/* non-blocking: connection is in progress */
case ERR_INPROGRESS:
{
return RFAILED;
}
- ret = SGetSBuf(info->region, info->pool, &sendBuf, bufLen);
+ ret = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, &sendBuf, bufLen);
if (ret != ROK)
{
return (ROUTRES);
ret = SCpyMsgFix(mBuf, 0, bufLen, sendBuf, &msgLen);
if ((ret != ROK) || (msgLen != bufLen))
{
- SPutSBuf(info->region, info->pool, sendBuf, bufLen);
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, sendBuf, bufLen);
return RFAILED;
}
{
if (sockFd->protType == AF_INET)
{
- SPutSBuf(info->region, info->pool, sendBuf, bufLen);
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, sendBuf, bufLen);
#ifdef CMINETDBG
#ifndef ALIGN_64BIT
/* cm_inet_c_001.main_54: CMINETLOGERROR added insted of SDisp */
ppId, flags, strmId, ttl, context);
if (ret == INET_ERR)
{
- SPutSBuf(info->region, info->pool, sendBuf, bufLen);
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, sendBuf, bufLen);
#ifdef CMINETDBG
#ifndef ALIGN_64BIT
/* cm_inet_c_001.main_54: CMINETLOGERROR added insted of SDisp */
*len = (MsgLen)ret;
/* cleanup */
- SPutSBuf(info->region, info->pool, sendBuf, bufLen);
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, sendBuf, bufLen);
return ROK;
}
buflen = CM_INET_MAX_MSG_LEN;
/* allocate flat receive buffer */
- ret = SGetSBuf(meminfo->region, meminfo->pool, &recvbuf, buflen);
+ ret = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,meminfo->region, meminfo->pool, &recvbuf, buflen);
if (ret != ROK)
{
#ifdef CMINETDBG
if (ret == INET_ERR)
{
/* cleanup */
- SPutSBuf(meminfo->region, meminfo->pool, recvbuf, buflen);
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,meminfo->region, meminfo->pool, recvbuf, buflen);
#ifdef CMINETDBG
#ifndef ALIGN_64BIT
/* cm_inet_c_001.main_54: CMINETLOGERROR added insted of SDisp */
/* cm_inet_c_001.main_46: Allocate memory for data before copying */
datlen = cmStrlen(sctpNtfy->sn_remote_error.sre_data) + 1;
- ret = SGetSBuf( meminfo->region, meminfo->pool, \
+ ret = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__, meminfo->region, meminfo->pool, \
&ntfy->u.remoteErr.data, datlen );
if( ret != ROK )
{
/* cm_inet_c_001.main_46: Allocate memory for data before copying */
datlen = cmStrlen(sctpNtfy->sn_send_failed.ssf_data) + 1;
- ret = SGetSBuf( meminfo->region, meminfo->pool, \
+ ret = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__, meminfo->region, meminfo->pool, \
&ntfy->u.sndFailed.data, datlen );
if( ret != ROK )
{
ret = SGetMsg(meminfo->region, meminfo->pool, mBuf);
if (ret != ROK)
{
- SPutSBuf(meminfo->region, meminfo->pool, recvbuf, buflen);
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,meminfo->region, meminfo->pool, recvbuf, buflen);
return RFAILED;
}
if (ret != ROK)
{
SPutMsg(*mBuf);
- SPutSBuf(meminfo->region, meminfo->pool, recvbuf, buflen);
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,meminfo->region, meminfo->pool, recvbuf, buflen);
return RFAILED;
}
}
/* cleanup */
- SPutSBuf(meminfo->region, meminfo->pool, recvbuf, buflen);
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,meminfo->region, meminfo->pool, recvbuf, buflen);
return ROK;
}
{
return RFAILED;
}
- ret = SGetSBuf(info->region, info->pool, &sendBuf, bufLen);
+ ret = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, &sendBuf, bufLen);
if (ret != ROK)
{
return (ROUTRES);
if ((ret != ROK) || (msgLen != bufLen))
{
/* cleanup */
- SPutSBuf(info->region, info->pool, sendBuf, bufLen);
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, sendBuf, bufLen);
return RFAILED;
}
if (ret == INET_ERR)
{
/* cleanup */
- SPutSBuf(info->region, info->pool, sendBuf, bufLen);
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, sendBuf, bufLen);
if(INET_ERR_CODE == ERR_AGAIN)
{
if (ret < bufLen)
{
/* cleanup */
- SPutSBuf(info->region, info->pool, sendBuf, bufLen);
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, sendBuf, bufLen);
return (RWOULDBLOCK);
}
/* cleanup */
- SPutSBuf(info->region, info->pool, sendBuf, bufLen);
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, sendBuf, bufLen);
#else /* end of Win NT/flat buffer specific part */
ret = SFndLenMsg(mBuf, &msgLen);
{
return RFAILED;
}
- ret = SGetSBuf(info->region, info->pool, &sendBuf, bufLen);
+ ret = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, &sendBuf, bufLen);
if (ret != ROK)
{
return (ROUTRES);
if ((ret != ROK) || (msgLen != bufLen))
{
/* cleanup */
- SPutSBuf(info->region, info->pool, sendBuf, bufLen);
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, sendBuf, bufLen);
return RFAILED;
}
if (ret == INET_ERR)
{
/* cleanup */
- SPutSBuf(info->region, info->pool, sendBuf, bufLen);
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, sendBuf, bufLen);
if(INET_ERR_CODE == ERR_AGAIN)
{
if (ret < bufLen)
{
/* cleanup */
- SPutSBuf(info->region, info->pool, sendBuf, bufLen);
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, sendBuf, bufLen);
return (RWOULDBLOCK);
}
/* cleanup */
- SPutSBuf(info->region, info->pool, sendBuf, bufLen);
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, sendBuf, bufLen);
#else /* end of Win NT/flat buffer specific part */
ret = SFndLenMsg(mBuf, &msgLen);
}
/* allocate mem needed to hold all HBH/Dest options */
- ret = SGetSBuf(info->region, info->pool,
+ ret = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool,
(Data **)&hbhOptsArr->hbhOpts,
(Size)((sizeof(CmInetIpv6HBHHdr)) * numOpts));
if (ret != ROK)
{
/* take care of all other options having valid value field
* such as Router Alert, PADN >= 3 bytes and Jumbo */
- ret = SGetSBuf(info->region, info->pool,
+ ret = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool,
(Data **)&hbhOptsArr->hbhOpts[optsIdx].value,
(Size)hbhOptsArr->hbhOpts[optsIdx].length);
if (ret != ROK)
snprintf(prntBuf, CMINET_PRNT_BUF_SIZE, "SPutSBuf call 1 in BuildRecvHopOptsArr\n");
CMINETLOGERROR(ERRCLS_INT_PAR, ECMINET030, 0, prntBuf);
#endif /* CMINETDBG */
- SPutSBuf(info->region, info->pool,
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool,
(Data *)hbhOptsArr->hbhOpts[optsIdx - 1].value,
(Size)hbhOptsArr->hbhOpts[optsIdx - 1].length);
}
snprintf(prntBuf, CMINET_PRNT_BUF_SIZE, "SPutSBuf call 2 in BuildRecvHopOptsArr\n");
CMINETLOGERROR(ERRCLS_DEBUG, ECMINET031, 0, prntBuf);
#endif /* CMINETDBG */
- SPutSBuf(info->region, info->pool,
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool,
(Data *)hbhOptsArr->hbhOpts, numOpts * sizeof(CmInetIpv6HBHHdr));
hbhOptsArr->numHBHOpts = 0;
hbhOptsArr->hbhOpts = NULLP;
/* subtract 8 bytes for Next Hdr, Hdr Ext Len, .... + SL bit map */
rtOptsArr->numAddrs = (rtDataLen - 8)/16;
- ret = SGetSBuf(info->region, info->pool,
+ ret = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool,
(Data **)&rtOptsArr->ipv6Addrs,
(Size)rtOptsArr->numAddrs * 16);
if (ret != ROK)
}
/* allocate flat receive buffer */
- ret = SGetSBuf(info->region, info->pool, &recvBuf, bufLen);
+ ret = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, &recvBuf, bufLen);
if (ret != ROK)
{
return (ROUTRES);
{
/* cleanup */
/* moved cleanup here */
- SPutSBuf(info->region, info->pool, recvBuf, bufLen);
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, recvBuf, bufLen);
/* added check ERR_WOULDBLOCK */
if ((INET_ERR_CODE == ERR_AGAIN) ||
if ((sockFd->type == CM_INET_DGRAM) && (*len == 0))
#endif
{
- SPutSBuf(info->region, info->pool, recvBuf, bufLen);
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, recvBuf, bufLen);
return (ROKDNA);
}
CMINETLOGERROR(ERRCLS_INT_PAR, ECMINET068, 0, prntBuf);
#endif /*ALIGN_64BIT*/
#endif
- SPutSBuf(info->region, info->pool, recvBuf, bufLen);
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, recvBuf, bufLen);
return (ROKDNA);
}
if (ret != ROK)
{
/* cleanup */
- SPutSBuf(info->region, info->pool, recvBuf, bufLen);
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, recvBuf, bufLen);
return (ret);
}
if (ret != ROK)
{
- SPutSBuf(info->region, info->pool, recvBuf, bufLen);
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, recvBuf, bufLen);
SPutMsg(mBuf);
return (ret);
}
}
/* cleanup */
- SPutSBuf(info->region, info->pool, recvBuf, bufLen);
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, recvBuf, bufLen);
#else /* end of Win NT/flat buffer specific part */
/* allocate gather vector, it's a dynamic array */
numDBufs = CM_INET_MAX_DBUF;
- ret = SGetSBuf(info->region, info->pool, (Data**)&dBufs,
+ ret = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, (Data**)&dBufs,
numDBufs*sizeof(Buffer*));
if (ret != ROK)
{
for (i = 0; i < msg.msg_iovlen; i++)
SPutDBuf(info->region, info->pool, dBufs[i]);
- SPutSBuf(info->region, info->pool, (Data*)dBufs,
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, (Data*)dBufs,
numDBufs * sizeof(Buffer*));
/* allocate flat receive buffer */
- ret = SGetSBuf(info->region, info->pool, &recvBuf, bufLen);
+ ret = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, &recvBuf, bufLen);
if (ret != ROK)
return (ROUTRES);
}
else
{
- SPutSBuf(info->region, info->pool, (Data*)dBufs,
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, (Data*)dBufs,
numDBufs*sizeof(Buffer*));
return (ret);
}
/* Moved up the cleanup precedures here before returning */
/* Cleanup flat buffer if allocated */
if (allocFlatBuf)
- SPutSBuf(info->region, info->pool, recvBuf, bufLen);
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, recvBuf, bufLen);
else
{
/* cleanup */
SPutDBuf(info->region, info->pool, dBufs[i]);
}
- SPutSBuf(info->region, info->pool, (Data*)dBufs,
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, (Data*)dBufs,
numDBufs*sizeof(Buffer*));
}
if (ret != ROK)
{
/* cleanup */
- SPutSBuf(info->region, info->pool, recvBuf, bufLen);
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, recvBuf, bufLen);
return (ret);
}
ret = SAddPstMsgMult(recvBuf, recvLen, tempMsg);
if (ret != ROK)
{
- SPutSBuf(info->region, info->pool, recvBuf, bufLen);
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, recvBuf, bufLen);
SPutMsg(tempMsg);
return (ret);
}
*mPtr = tempMsg;
- SPutSBuf(info->region, info->pool, recvBuf, bufLen);
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, recvBuf, bufLen);
/* cm_inet_c_001.main_48 :flat buffers are allocated
* for non -TCP sockets. On these sockets we can receive
* only one message at a time
* mBuf */
if (*mPtr != NULLP)
SPutMsg(*mPtr);
- SPutSBuf(info->region, info->pool, (Data*)dBufs,
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, (Data*)dBufs,
numDBufs*sizeof(Buffer*));
return (ret);
}
/* cleanup */
SPutMsg(*mPtr);
SPutMsg(tempMsg);
- SPutSBuf(info->region, info->pool, (Data*)dBufs,
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, (Data*)dBufs,
numDBufs*sizeof(Buffer*));
return RFAILED;
}
SPutMsg(tempMsg);
}
- SPutSBuf(info->region, info->pool, (Data*)dBufs,
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, (Data*)dBufs,
numDBufs*sizeof(Buffer*));
/*
if ((MsgLen)pendLen >= bufLen)
{
/* allocate receive buffer (flat structure) */
- ret = SGetSBuf(info->region, info->pool, &recvBuf, bufLen);
+ ret = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, &recvBuf, bufLen);
if (ret != ROK)
{
return (ROUTRES);
{
/* cleanup */
/* moved cleanup here */
- SPutSBuf(info->region, info->pool, recvBuf, bufLen);
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, recvBuf, bufLen);
/* added check ERR_WOULDBLOCK */
if ((INET_ERR_CODE == ERR_AGAIN) ||
if (recvLen < (S32)bufLen) /* maybe happen */
{
/* cleanup */
- SPutSBuf(info->region, info->pool, recvBuf, bufLen);
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, recvBuf, bufLen);
return (ROKDNA);
}
}
/* cleanup */
- SPutSBuf(info->region, info->pool, recvBuf, bufLen);
+ SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, recvBuf, bufLen);
}
else
{