/* added !(defined(CMINETFLATBUF) */
#if (!(defined(WIN32)) && !(defined(CMINETFLATBUF)))
/* Added another function parameter */
-PRIVATE S16 buildRecvBuf ARGS((CmInetMemInfo *info, MsgLen len,
+static S16 buildRecvBuf ARGS((CmInetMemInfo *info, MsgLen len,
CmInetIovec rxArr[], Buffer *dBuf[], uint16_t maxSize,
struct msghdr *msg, Bool isStrmMsg));
-PRIVATE S16 buildRecvMsg ARGS((CmInetMemInfo *info, CmInetIovec rxArr[],
+static S16 buildRecvMsg ARGS((CmInetMemInfo *info, CmInetIovec rxArr[],
S16 numBduf, MsgLen msgLen, Buffer *dBufs[],
Buffer **mPtr));
/* cm_inet_c_001.main_50 - Added parameter to get length of dbufs packed for partial
* send handling
*/
-PRIVATE S16 buildSendIovec ARGS((Buffer *mBuf, MsgLen msgLen,
+static S16 buildSendIovec ARGS((Buffer *mBuf, MsgLen msgLen,
CmInetIovec txArr[], S16 numDBuf,
S16 *numIovElems, uint32_t *strtEndDBufNum,
MsgLen *ioLen));
#ifdef IPV6_SUPPORTED
#ifdef IPV6_OPTS_SUPPORTED
-PRIVATE S16 cmInet6BuildSendHBHOpts ARGS((CmInetIpv6HBHHdrArr *hbhOptsArr,
+static S16 cmInet6BuildSendHBHOpts ARGS((CmInetIpv6HBHHdrArr *hbhOptsArr,
uint8_t *cmsgBuf, uint32_t *curMsgIdx,
uint8_t hdrId));
-PRIVATE S16 cmInet6BuildSendRouteOpts ARGS((CmInetIpv6RtHdr *rtOptsArr,
+static S16 cmInet6BuildSendRouteOpts ARGS((CmInetIpv6RtHdr *rtOptsArr,
uint8_t *cmsgBuf, uint32_t *curMsgIdx));
-PRIVATE S16 cmInet6BuildRecvRtHdr ARGS((uint8_t *cmsgData, uint32_t rtDataLen,
+static S16 cmInet6BuildRecvRtHdr ARGS((uint8_t *cmsgData, uint32_t rtDataLen,
CmInetIpv6RtHdr0 *rtHdr0,
CmInetIpv6RtHdr *rtOptsArr,
CmInetMemInfo *info));
-PRIVATE S16 cmInet6BuildRecvHopOptsArr ARGS((uint8_t *cmsgData, uint32_t hbhDataLen,
+static S16 cmInet6BuildRecvHopOptsArr ARGS((uint8_t *cmsgData, uint32_t hbhDataLen,
CmInetIpv6HBHHdrArr *hbhOptsArr,
uint8_t hdrId, CmInetMemInfo *info));
-PRIVATE S16 cmInet6GetHopLimitValue ARGS((uint8_t *cmsgData, uint32_t hopLimitDataLen,
+static S16 cmInet6GetHopLimitValue ARGS((uint8_t *cmsgData, uint32_t hopLimitDataLen,
CmInetIpv6HdrParm *ipv6HdrParam));
#ifdef SS_LINUX
-PRIVATE S16 cmInetBuildSendHoplimit ARGS((uint32_t hoplimit, uint8_t *cmsgBuf,
+static S16 cmInetBuildSendHoplimit ARGS((uint32_t hoplimit, uint8_t *cmsgBuf,
uint32_t *curMsgIdx));
#endif /* SS_LINUX */
#ifdef LOCAL_INTF
-PRIVATE S16 cmInet6BuildSendPktinfo ARGS((CmInetIpAddr6 *srcAddr,
+static S16 cmInet6BuildSendPktinfo ARGS((CmInetIpAddr6 *srcAddr,
uint8_t *cmsgBuf, uint32_t *curMsgIdx,
uint8_t protType));
#endif /* LOCAL_INTF */
*
*/
-#ifdef ANSI
S16 cmInetPoll
(
CmInetPollFd *pollFdArr, /* poll FD Array */
S16 *numRdyFds, /* number of ready descriptors */
uint32_t timeout /* timeout value for Poll */
)
-#else
-S16 cmInetPoll(pollFdArr,numFds,numRdyFds,timeout)
-CmInetPollFd *pollFdArr; /* poll FD Array */
-uint32_t numFds; /* Number of Fds to be monitored */
-S16 *numRdyFds; /* number of ready descriptors */
-uint32_t timeout; /* timeout value for Poll */
-#endif
{
S32 ret;
*
*/
-#ifdef ANSI
S16 cmInetPollSetFd
(
CmInetFd *sockFd, /* socket file descriptor */
S16 idx, /* poll Fd Array Index */
uint16_t eventMask /* Event Mask to be set */
)
-#else
-S16 cmInetPollSetFd(sockFd,pollFdArr,idx,eventMask)
-CmInetFd *sockFd; /* socket file descriptor */
-CmInetPollFd *pollFdArr; /* poll FD Array */
-S16 idx; /* poll Fd Array Index */
-uint16_t eventMask; /* Event Mask to be set */
-#endif
{
*
*/
-#ifdef ANSI
S16 cmInetPollFdIsSet
(
CmInetPollFd *pollFdArr, /* poll FD Array */
S16 idx, /* poll Fd Array Index */
uint16_t eventMask /* Event Mask to be set */
)
-#else
-S16 cmInetPollFdIsSet(pollFdArr,idx,eventMask)
-CmInetPollFd *pollFdArr; /* poll FD Array */
-S16 idx; /* poll Fd Array Index */
-uint16_t eventMask; /* Event Mask to be set */
-#endif
{
S16 ret;
*
*/
-#ifdef ANSI
S16 cmInetPollClearFdREvent
(
CmInetPollFd *pollFdArr, /* poll FD Array */
S16 idx, /* poll Fd Array Index */
uint16_t eventMask /* Event Mask to be set */
)
-#else
-S16 cmInetPollClearFdREvent(sockFd,pollFdArr,eventMask)
-CmInetPollFd *pollFdArr; /* poll FD Array */
-S16 idx; /* poll Fd Array Index */
-uint16_t eventMask; /* Event Mask to be set */
-#endif
{
*
*/
-#ifdef ANSI
S16 cmInetPollClearFdEvent
(
CmInetPollFd *pollFdArr, /* poll FD Array */
S16 idx, /* poll Fd Array Index */
uint16_t eventMask /* Event Mask to be set */
)
-#else
-S16 cmInetPollClearFdEvent(sockFd,pollFdArr,eventMask)
-CmInetPollFd *pollFdArr; /* poll FD Array */
-S16 idx; /* poll Fd Array Index */
-uint16_t eventMask; /* Event Mask to be set */
-#endif
{
*
*/
-#ifdef ANSI
S16 cmInetPollDelFd
(
CmInetPollFd *pollFdArr, /* poll FD Array */
S16 delIdx, /* poll Fd Array Index for which fd has to be deleted*/
S16 lastIdx /* Last index of poll Fd Array */
)
-#else
-S16 cmInetPollDelFd(pollFdArr, delIdx, lastIdx)
-CmInetPollFd *pollFdArr; /* poll FD Array */
-S16 delIdx; /* poll Fd Array Index for which fd has to be deleted*/
-S16 lastIdx; /* Last index of poll Fd Array */
-#endif
{
*
*/
-#ifdef ANSI
S16 cmInetPollInitFdArr
(
CmInetPollFd *pollFdArr /* poll FD Array */
)
-#else
-S16 cmInetPollInitFdArr(pollFdArr)
-CmInetPollFd *pollFdArr; /* poll FD Array */
-#endif
{
S16 idx;
*
*/
-#ifdef ANSI
-PRIVATE S16 buildRecvBuf
+static S16 buildRecvBuf
(
CmInetMemInfo *info, /* buffer allocation info */
MsgLen len, /* message length */
CmInetIovec rxArr[], /* gather array */
Buffer *dBuf[], /* allocated dBufs */
-uint16_t maxSize, /* size of rxArr/dBuf array */
+uint16_t maxSize, /* size of rxArr/dBuf array */
struct msghdr *msg, /* message header for recvmsg() */
Bool isStrmMsg /* Is a TCP message */
)
-#else
-PRIVATE S16 buildRecvBuf(info, len, rxArr, dBuf, maxSize, msg, isStrmMsg)
- CmInetMemInfo *info; /* buffer allocation info */
- MsgLen len; /* message length */
- CmInetIovec rxArr[]; /* gather array */
- Buffer *dBuf[]; /* allocated dBufs */
- uint16_t maxSize; /* size of rxArr/dBuf array */
- struct msghdr *msg; /* message header for recvmsg() */
- Bool isStrmMsg; /* Is a TCP message */
-#endif
{
S16 ret; /* temporary return value */
- uint16_t numBuf; /* number of dBufs */
- uint16_t i; /* dBuf index counter */
+ uint16_t numBuf; /* number of dBufs */
+ uint16_t i; /* dBuf index counter */
Data *dPtr; /* data pointer */
/* cm_inet_c_001.main_47: 102069 Changed from S32 to MsgLen for bufLen*/
MsgLen bufLen; /* entire receive buffer length, if S16
*
*/
-#ifdef ANSI
-PRIVATE S16 buildRecvMsg
+static S16 buildRecvMsg
(
CmInetMemInfo *info, /* buffer allocation info */
CmInetIovec rxArr[], /* scatter array */
Buffer *dBufs[], /* dBufs */
Buffer **mPtr /* message built from dBufs */
)
-#else
-PRIVATE S16 buildRecvMsg(info, rxArr, numBuf, msgLen, dBufs, mPtr)
-CmInetMemInfo *info; /* buffer allocation info */
-CmInetIovec rxArr[]; /* scatter array */
-S16 numBuf; /* number of allocated dBufs */
-MsgLen msgLen; /* length of one particular dBuf */
-Buffer *dBufs[]; /* dBufs */
-Buffer **mPtr; /* message built from dBufs */
-#endif
{
S16 ret; /* return value */
S16 i; /* dBuf index counter */
* File: cm_inet.c
*
*/
-#ifdef ANSI
-PRIVATE S16 buildSendIovec
+static S16 buildSendIovec
(
Buffer *mBuf, /* Message buffer */
MsgLen msgLen, /* Length of mBuf */
CmInetIovec txArr[], /* transmit scatter vector array */
S16 numDBufs, /* Maximum number of dBufs to use */
S16 *numIovElems, /* Number of iov elements in array */
-uint32_t *strtEndDBufNum, /* dBuf number to start and end */
+uint32_t *strtEndDBufNum, /* dBuf number to start and end */
MsgLen *ioLen /* cm_inet_c_001.main_50 - Len of dbuf packed into IO-vector */
)
-#else
-PRIVATE S16 buildSendIovec(mBuf, msgLen, txArr, numDBufs, numIovElems,
- strtEndDBufNum,ioLen)
-Buffer *mBuf; /* Message buffer */
-MsgLen msgLen; /* Length of mBuf */
-CmInetIovec txArr[]; /* transmit scatter vector array */
-S16 numDBufs; /* Maximum number of dBufs to use */
-S16 *numIovElems; /* Number of iov elements in array */
-uint32_t *strtEndDBufNum; /* dBuf number to start and end */
-MsgLen *ioLen; /* cm_inet_c_001.main_50 - Len of dbuf packed into IO-vector */
-#endif
{
S16 ret;
MsgLen dLen;
* File: cm_inet.c
*
*/
-#ifdef ANSI
#ifdef CM_INET2
#ifdef IPV6_SUPPORTED
S16 cmInetSocket
CmInetFd *sockFd /* socket file descriptor */
)
#endif /* CM_INET2 */
-#else
-#ifdef CM_INET2
-#ifdef IPV6_SUPPORTED
-S16 cmInetSocket(type, sockFd, protocol, domain)
-uint8_t type; /* socket type */
-CmInetFd *sockFd; /* socket file descriptor */
-uint8_t protocol; /* protocol value */
-uint8_t domain; /* domain */
-#else
-S16 cmInetSocket(type, sockFd, protocol)
-uint8_t type; /* socket type */
-CmInetFd *sockFd; /* socket file descriptor */
-uint8_t protocol; /* protocol value */
-#endif /* IPV6_SUPPORTED */
-#else /* CM_INET2 */
-S16 cmInetSocket(type, sockFd)
-uint8_t type; /* socket type */
-CmInetFd *sockFd; /* socket file descriptor */
-#endif /* CM_INET2 */
-#endif /* ANSI */
{
S32 ret; /* temporary return value */
*
*/
-#ifdef ANSI
S16 cmInetBind
(
CmInetFd *sockFd, /* socket file descriptor */
CmInetAddr *myAddr /* locale Internet address/port */
)
-#else
-S16 cmInetBind(sockFd, myAddr)
-CmInetFd *sockFd; /* socket file descriptor */
-CmInetAddr *myAddr; /* locale Internet address/port */
-#endif
{
S32 ret; /* temporary return value */
struct sockaddr_in srcAddr; /* local Internet address/port */
* File: cm_inet.c
*
*/
-#ifdef ANSI
S16 cmInetSctpBindx
(
CmInetFd *sockFd, /* socket file descriptor */
CmInetNetAddrLst *addrLst, /* local Internet address list */
uint16_t port /* port number */
)
-#else
-S16 cmInetSctpBindx(sockFd, addrLst, port)
-CmInetFd *sockFd; /* socket file descriptor */
-CmInetNetAddrLst *addrLst; /* locale Internet address list */
-uint16_t port; /* port number */
-#endif
{
S32 ret; /* temporary return value */
S32 idx;
* File: cm_inet.c
*
*/
-#ifdef ANSI
S16 cmInetSctpConnectx
(
CmInetFd *sockFd, /* socket file descriptor */
CmInetNetAddr *primAddr, /* primary destination Internet address */
CmInetNetAddrLst *addrLst, /* destination Internet address list */
-uint16_t port /* port number */
+uint16_t port /* port number */
)
-#else
-S16 cmInetSctpConnectx(sockFd, primAddr, addrLst, port)
-CmInetFd *sockFd; /* socket file descriptor */
-CmInetNetAddr *primAddr; /* primary destination Internet address */
-CmInetNetAddrLst *addrLst; /* destination Internet address list */
-uint16_t port; /* port number */
-#endif
{
S32 ret;
uint32_t cnt;
* File: cm_inet.c
*
*/
-#ifdef ANSI
S16 cmInetSctpPeelOff
(
CmInetFd *sockFd, /* socket file descriptor */
-uint32_t assocId, /* association id */
+uint32_t assocId, /* association id */
CmInetFdType *assocFd /* association fd */
)
-#else
-S16 cmInetSctpPeelOff(sockFd, assocId, assocFd)
-CmInetFd *sockFd; /* socket file descriptor */
-uint32_t assocId; /* association id */
-CmInetFdType *assocFd; /* association fd */
-#endif
{
S32 ret;
* File: cm_inet.c
*
*/
-#ifdef ANSI
S16 cmInetSctpSendMsg
(
CmInetFd *sockFd, /* socket file descriptor */
CmInetNetAddr *dstAddr, /* destination Internet address/port */
-uint16_t port, /* destination port no. */
+uint16_t port, /* destination port no. */
CmInetMemInfo *info, /* buffer allocation info */
Buffer *mBuf, /* buffer structure to send */
MsgLen *len, /* number of actually sent octets */
-uint16_t strmId, /* sctp stream identifier */
-Bool unorderFlg, /* flag to enable the unordered delivery */
-uint16_t ttl, /* time to live */
-uint32_t ppId, /* opaque value passed along with the message */
-uint32_t context /* value to be passed back, if error occurs */
+uint16_t strmId, /* sctp stream identifier */
+Bool unorderFlg, /* flag to enable the unordered delivery */
+uint16_t ttl, /* time to live */
+uint32_t ppId, /* opaque value passed along with the message */
+uint32_t context /* value to be passed back, if error occurs */
)
-#else
-S16 cmInetSctpSendMsg(sockFd, dstAddr, port, info, mBuf, len, strmId,
- unorderFlg, ttl, ppId, context)
-CmInetFd *sockFd; /* socket file descriptor */
-CmInetNetAddr *dstAddr; /* destination Internet address/port */
-uint16_t port; /* destination port no. */
-CmInetMemInfo *info; /* buffer allocation info */
-Buffer *mBuf; /* buffer structure to send */
-MsgLen *len; /* number of actually sent octets */
-uint16_t strmId; /* sctp stream identifier */
-Bool unorderFlg; /* flag to enable the unordered delivery */
-uint16_t ttl; /* time to live */
-uint32_t ppId; /* opaque value passed along with the message */
-uint32_t context; /* value to be passed back, if error occurs */
-#endif
{
S32 ret;
/* cm_inet_c_001.main_58 : Fix for klockwork issue */
MsgLen msgLen = 0; /* message length */
MsgLen bufLen = 0; /* send buffer length */
Data *sendBuf = NULLP; /* plain send buffer */
- uint32_t flags;
+ uint32_t flags =0;
CmInetSockAddr *sockAddrPtr = NULLP;
/* cm_inet_c_001.main_58 : Fix for klockwork issue */
MsgLen sockAddrLen = 0;
- struct sockaddr_in addr;
+ struct sockaddr_in addr ={0};
#ifdef IPV6_SUPPORTED
#ifdef SUN_KSCTP
S8 *addrString = NULLP;
uint32_t addrLen = 0;
S8 ipv4Format[23] = "::ffff:";
- CmInetIpAddr ipv4NetAddr;
+ CmInetIpAddr ipv4NetAddr = {0};
#endif /* SUN_KSCTP */
- struct sockaddr_in6 addr6;
+ struct sockaddr_in6 addr6 ={0};
#endif /* IPV6_SUPPORTED */
-
#if (ERRCLASS & ERRCLS_INT_PAR)
/* error check on parameters */
if ((sockFd == NULLP) || CM_INET_INV_SOCK_FD(sockFd)
* File: cm_inet.c
*
*/
-#ifdef ANSI
S16 cmInetSctpRecvMsg
(
CmInetFd *sockFd, /* socket file descriptor */
CmInetNetAddr *srcAddr, /* source Internet address/port */
-uint16_t *port, /* source port no. */
+uint16_t *port, /* source port no. */
CmInetMemInfo *meminfo, /* buffer allocation info */
Buffer **mBuf, /* buffer structure received */
MsgLen *len, /* number of octets received */
CmInetSctpSndRcvInfo *sinfo, /* sctp send-receive info */
-uint32_t *flag, /* flags */
+uint32_t *flag, /* flags */
CmInetSctpNotification *ntfy /* notification parameters */
)
-#else
-S16 cmInetSctpRecvMsg(sockFd, srcAddr, port, meminfo, mBuf, len,
- sinfo, flag, ntfy)
-CmInetFd *sockFd; /* socket file descriptor */
-CmInetNetAddr *srcAddr; /* source Internet address/port */
-uint16_t *port; /* source port no. */
-CmInetMemInfo *meminfo; /* buffer allocation info */
-Buffer **mBuf; /* buffer structure received */
-MsgLen *len; /* number of octets received */
-CmInetSctpSndRcvInfo *sinfo; /* sctp send-receive info */
-uint32_t *flag; /* flags */
-CmInetSctpNotification *ntfy; /* notification parameters */
-#endif
{
S32 ret;
S32 msgFlags;
* File: cm_inet.c
*
*/
-#ifdef ANSI
S16 cmInetSctpGetPAddrs
(
CmInetFd *sockFd, /* socket file descriptor */
-uint32_t assocId, /* association id */
+uint32_t assocId, /* association id */
CmInetNetAddrLst *addrlst /* peer address list */
)
-#else
-S16 cmInetSctpGetPAddrs(sockFd, assocId, addrlst)
-CmInetFd *sockFd; /* socket file descriptor */
-uint32_t assocId; /* association id */
-CmInetNetAddrLst *addrlst; /* peer address list */
-#endif
{
/* cm_inet_c_001.main_58 : Fix for Klockwork issue */
S32 cnt;
* File: cm_inet.c
*
*/
-#ifdef ANSI
S16 cmInetGetOpt
(
CmInetFd *sockFd, /* socket file descriptor */
-uint32_t level, /* option level */
-uint32_t type, /* option type */
-Ptr value /* option value */
+uint32_t level, /* option level */
+uint32_t type, /* option type */
+Ptr value /* option value */
)
-#else
-S16 cmInetGetOpt(sockFd, level, type, value)
-CmInetFd *sockFd; /* socket file descriptor */
-uint32_t level; /* option level */
-uint32_t type; /* option type */
-Ptr value; /* option value */
-#endif
{
socklen_t len;
struct sctp_status status;
* File: cm_inet.c
*
*/
-#ifdef ANSI
S16 cmInetShutDownSctp
(
- CmInetFd *sockFd /* socket file descriptor */
- )
-#else
-S16 cmInetShutDownSctp(sockFd)
- CmInetFd *sockFd; /* socket file descriptor */
-#endif
+CmInetFd *sockFd /* socket file descriptor */
+)
{
/*cm_inet_c_001.main_58 : fix for klockwork issue */
S32 ret;
* File: cm_inet.c
*
*/
-#ifdef ANSI
S16 cmInetAbortSctpAssoc
(
- CmInetFd *sockFd, /* socket file descriptor */
- UConnId assocId /* Association ID */
- )
-#else
-S16 cmInetAbortSctpAssoc(sockFd, assocId)
- CmInetFd *sockFd; /* socket file descriptor */
- UConnId assocId; /* Association ID */
-#endif
+CmInetFd *sockFd, /* socket file descriptor */
+UConnId assocId /* Association ID */
+)
{
- S32 ret;
+ S32 ret;
struct sctp_sndrcvinfo sndRcvInfo;
*
*/
-#ifdef ANSI
S16 cmInetConnect
(
CmInetFd *sockFd, /* socket file descriptor */
CmInetAddr *servAddr /* foreign Internet address/port */
)
-#else
-S16 cmInetConnect(sockFd, servAddr)
- CmInetFd *sockFd; /* socket file descriptor */
- CmInetAddr *servAddr; /* foreign Internet address/port */
-#endif
{
S32 ret; /* temporary return value */
struct sockaddr_in dstAddr; /* foreign Internet address/port */
*
*/
-#ifdef ANSI
S16 cmInetListen
(
CmInetFd *sockFd, /* socket file descriptor */
S16 backLog /* max. number of outstandig connections 0..5 */
)
-#else
-S16 cmInetListen(sockFd, backLog)
-CmInetFd *sockFd; /* socket file descriptor */
-S16 backLog; /* max. number of outstandig connections 0..5 */
-#endif
{
S32 ret; /* temporary return value */
*
*/
-#ifdef ANSI
S16 cmInetAccept
(
CmInetFd *sockFd, /* socket file descriptor */
CmInetAddr *fromAddr, /* calling Internet address/port */
CmInetFd *newSockFd /* socket file descriptor for new connection*/
)
-#else
-S16 cmInetAccept(sockFd, fromAddr, newSockFd)
-CmInetFd *sockFd; /* socket file descriptor */
-CmInetAddr *fromAddr; /* calling Internet address/port */
-CmInetFd *newSockFd; /* socket file descriptor for new connection*/
-#endif
{
S32 ret; /* temporary return value */
S32 addrLen; /* address structure length */
*
*/
-#ifdef ANSI
-PRIVATE S16 cmInet4FillTos
+static S16 cmInet4FillTos
(
uint8_t tos, /* tos value to be filled in ipheader */
uint8_t *cmsgBuf, /* flat buffer where to build ext hdrs */
uint32_t *curMsgIdx /* idx in cmsgBuf where HBH/Dest ext hdr ends */
)
-#else
-PRIVATE S16 cmInet4FillTos(tos, cmsgBuf, curMsgIdx, protType)
-uint8_t tos; /* tos value to be filled in ipheader */
-uint8_t *cmsgBuf; /* flat buffer where to build ext hdrs */
-uint32_t *curMsgIdx; /* idx in cmsgBuf where HBH/Dest ext hdr ends */
-#endif /* ANSI */
{
struct cmsghdr *tempHdr;
uint8_t len;
*
*/
-#ifdef ANSI
S16 cmInetSendDscpMsg
(
CmInetFd *sockFd, /* socket file descriptor */
CmInetIpHdrParm *ipHdrParams, /* IPv6 extensions headers */
S16 flags /* additional control flags, unused */
)
-#else
-/* added for IPv6 ext hdr */
-S16 cmInetSendDscpMsg(sockFd, dstAddr, info, mBuf, len, ipHdrParams, flags)
-CmInetFd *sockFd; /* socket file descriptor */
-CmInetAddr *dstAddr; /* destination Internet address/port */
-CmInetMemInfo *info; /* buffer allocation info */
-Buffer *mBuf; /* buffer structure to send */
-MsgLen *len; /* number of actually sent octets */
-CmInetIpHdrParm *ipHdrParams; /* IPv6 extensions headers */
-S16 flags; /* additional control flags, unused */
-#endif /* ANSI */
{
#if (defined(WIN32) || defined(CMINETFLATBUF))
- S32 ret; /* temporary return value */
- MsgLen msgLen; /* message length */
- MsgLen bufLen; /* send buffer length */
- Data *sendBuf; /* plain send buffer */
-#else
- S32 ret; /* temporary return value */
- S32 retVal; /* temporary return value */
- S16 i; /* loop index */
- CmInetIovec txArr[CM_INET_MAX_DBUF]; /* scatter vector */
- S16 numDBufs; /* number of dBufs in message */
- struct msghdr msg; /* sendmsg() message header */
- MsgLen msgLen; /* message length */
- uint32_t strtEndDBufNum; /* starting/ending DBuf number */
- MsgLen unSentLen; /* sent len */
+ S32 ret =0; /* temporary return value */
+ MsgLen msgLen =0; /* message length */
+ MsgLen bufLen =0; /* send buffer length */
+ Data *sendBuf =0; /* plain send buffer */
+#else
+ S32 ret =0; /* temporary return value */
+ S32 retVal =0; /* temporary return value */
+ S16 i =0; /* loop index */
+ CmInetIovec txArr[CM_INET_MAX_DBUF] = {{0}}; /* scatter vector */
+ S16 numDBufs =0; /* number of dBufs in message */
+ struct msghdr msg ={0}; /* sendmsg() message header */
+ MsgLen msgLen =0; /* message length */
+ uint32_t strtEndDBufNum =0; /* starting/ending DBuf number */
+ MsgLen unSentLen =0; /* sent len */
#ifdef IPV6_SUPPORTED
- uint32_t curMsgIdx; /* indx in cmsgData where to write an ext hdr */
+ uint32_t curMsgIdx =0; /* indx in cmsgData where to write an ext hdr */
/* added for IPv6 ext hdr */
#if (defined(SS_LINUX) || defined(_XPG4_2))
/* alloc from stack for IPv6 ancill data */
- uint8_t cmsgData[CM_INET_IPV6_ANCIL_DATA];
+ uint8_t cmsgData[CM_INET_IPV6_ANCIL_DATA]= {0};
#endif /* SS_LINUX || _XPG4_2 */
#else
- uint32_t curMsgIdx; /* indx in cmsgData where to write an ext hdr */
+ uint32_t curMsgIdx =0; /* indx in cmsgData where to write an ext hdr */
#if (defined(SS_LINUX) || defined(_XPG4_2))
/* alloc from stack for IPv4 ancill data */
- uint8_t cmsgData[CM_INET_IPV4_ANCIL_DATA];
+ uint8_t cmsgData[CM_INET_IPV4_ANCIL_DATA]={0};
#endif /* SS_LINUX || _XPG4_2 */
#endif /* IPV6_SUPPORTED */
#endif /* WIN32 | CMINETFLATBUF */
- struct sockaddr_in remAddr; /* remote Internet address */
+ struct sockaddr_in remAddr ={0}; /* remote Internet address */
#ifdef IPV6_SUPPORTED
- struct sockaddr_in6 remAddr6; /* remote Internet address */
+ struct sockaddr_in6 remAddr6 = {0}; /* remote Internet address */
#endif /* IPV8_SUPPORTED */
- CmInetSockAddr *sockAddrPtr;
+ CmInetSockAddr *sockAddrPtr = NULLP;
/* cm_inet_c_001.main_58 : Fix for klockwork issue */
- uint32_t sizeOfAddr;
+ uint32_t sizeOfAddr =0;
/* cm_inet_c_001.main_50 - Added for partial send handling */
/* cm_inet_c_001.main_59: Protected under if not defined WIN32*/
#if (!defined(WIN32))
- MsgLen ioLen;
+ MsgLen ioLen =0;
#endif
#ifdef NTL_LIB
{
- extern int ntl_hLib;
+ int ntl_hLib;
if ( sockFd->fd >= 0xD001)
ret = ntl_sendmsg(ntl_hLib, sockFd->fd, &msg, 0);
else
*
*/
-#ifdef ANSI
S16 cmInetSendMsg
(
CmInetFd *sockFd, /* socket file descriptor */
#endif /* IPV6_OPTS_SUPPORTED */
S16 flags /* additional control flags, unused */
)
-#else
-/* added for IPv6 ext hdr */
-#ifdef IPV6_OPTS_SUPPORTED
-S16 cmInetSendMsg(sockFd, dstAddr, info, mBuf, len, ipHdrParams, flags)
-CmInetFd *sockFd; /* socket file descriptor */
-CmInetAddr *dstAddr; /* destination Internet address/port */
-CmInetMemInfo *info; /* buffer allocation info */
-Buffer *mBuf; /* buffer structure to send */
-MsgLen *len; /* number of actually sent octets */
-CmInetIpHdrParm *ipHdrParams; /* IPv6 extensions headers */
-S16 flags; /* additional control flags, unused */
-#else
-S16 cmInetSendMsg(sockFd, dstAddr, info, mBuf, len, flags)
-CmInetFd *sockFd; /* socket file descriptor */
-CmInetAddr *dstAddr; /* destination Internet address/port */
-CmInetMemInfo *info; /* buffer allocation info */
-Buffer *mBuf; /* buffer structure to send */
-MsgLen *len; /* number of actually sent octets */
-S16 flags; /* additional control flags, unused */
-#endif /* IPV6_OPTS_SUPPORTED */
-#endif /* ANSI */
{
#if (defined(WIN32) || defined(CMINETFLATBUF))
S32 ret; /* temporary return value */
S32 ret; /* temporary return value */
S32 retVal; /* temporary return value */
S16 i; /* loop index */
- CmInetIovec txArr[CM_INET_MAX_DBUF]; /* scatter vector */
+ CmInetIovec txArr[CM_INET_MAX_DBUF] ={{0}}; /* scatter vector */
S16 numDBufs; /* number of dBufs in message */
struct msghdr msg; /* sendmsg() message header */
MsgLen msgLen; /* message length */
#ifdef NTL_LIB
{
- extern int ntl_hLib;
+ int ntl_hLib;
if ( sockFd->fd >= 0xD001)
ret = ntl_sendmsg(ntl_hLib, sockFd->fd, &msg, 0);
else
*
*/
-#ifdef ANSI
-PRIVATE S16 cmInet6BuildSendPktinfo
+static S16 cmInet6BuildSendPktinfo
(
CmInetIpAddr6 *srcAddr, /* src ip addr to set on outgoing packet */
uint8_t *cmsgBuf, /* flat buffer where to build ext hdrs */
uint32_t *curMsgIdx, /* idx in cmsgBuf where HBH/Dest ext hdr ends */
uint8_t protType /* whether IPv4/IPv6 socket */
)
-#else
-PRIVATE S16 cmInet6BuildSendPktinfo(srcAddr, cmsgBuf, curMsgIdx, protType)
-CmInetIpAddr6 *srcAddr; /* src ip addr to set on outgoing packet */
-uint8_t *cmsgBuf; /* flat buffer where to build ext hdrs */
-uint32_t *curMsgIdx; /* idx in cmsgBuf where HBH/Dest ext hdr ends */
-uint8_t protType; /* whether IPv4/IPv6 socket */
-#endif /* ANSI */
{
struct cmsghdr *tempHdr;
struct in6_pktinfo *ipv6Pktinfo;
*
*/
-#ifdef ANSI
-PRIVATE S16 cmInetBuildSendHoplimit
+static S16 cmInetBuildSendHoplimit
(
uint32_t hoplimit, /* the hoplimit value to be set on outgoing packet */
uint8_t *cmsgBuf, /* flat buffer where to build ext hdrs */
uint32_t *curMsgIdx /* idx in cmsgBuf where HBH/Dest ext hdr ends */
)
-#else
-PRIVATE S16 cmInetBuildSendHoplimit(hoplimit, cmsgBuf, curMsgIdx)
-uint32_t hoplimit; /* the hoplimit value to be sent on outgoing packet */
-uint8_t *cmsgBuf; /* flat buffer where to build ext hdrs */
-uint32_t *curMsgIdx; /* idx in cmsgBuf where HBH/Dest ext hdr ends */
-#endif /* ANSI */
{
struct cmsghdr *tempHdr;
uint8_t len;
*
*/
-#ifdef ANSI
-PRIVATE S16 cmInet6BuildSendHBHOpts
+static S16 cmInet6BuildSendHBHOpts
(
CmInetIpv6HBHHdrArr *hbhOptsArr,/* IPv6 extensions headers HBH/Dest opts */
uint8_t *cmsgBuf, /* flat buffer where to build ext hdrs */
uint32_t *curMsgIdx, /* idx in cmsgBuf where HBH/Dest ext hdr ends */
uint8_t hdrId /* 0: HBH hdr, 1:Dest Hdr */
)
-#else
-PRIVATE S16 cmInet6BuildSendHBHOpts(hbhOptsArr, cmsgBuf, curMsgIdx, hdrId)
-CmInetIpv6HBHHdrArr *hbhOptsArr;/* IPv6 extensions headers HBH/Dest opts */
-uint8_t *cmsgBuf; /* flat buffer where to build ext hdrs */
-uint32_t *curMsgIdx; /* idx in cmsgBuf where HBH/Dest ext hdr ends */
-uint8_t hdrId; /* 0: HBH hdr, 1:Dest Hdr */
-#endif
{
struct cmsghdr *tempHdr;
uint8_t len;
*
*/
-#ifdef ANSI
-PRIVATE S16 cmInet6BuildSendRouteOpts
+static S16 cmInet6BuildSendRouteOpts
(
CmInetIpv6RtHdr *rtOptsArr, /* IPv6 destination options array */
uint8_t *cmsgBuf, /* flat buffer where to build ext hdrs */
uint32_t *curMsgIdx /* idx in cmsgBuf where to start building RT hdr */
)
-#else
-PRIVATE S16 cmInet6BuildSendRouteOpts(rtOptsArr, cmsgBuf, curMsgIdx)
-CmInetIpv6RtHdr *rtOptsArr; /* IPv6 destination options array */
-uint8_t *cmsgBuf; /* flat buffer where to build ext hdrs */
-uint32_t *curMsgIdx; /* idx in cmsgBuf where to start building RT hd */
-#endif /* ANSI */
{
struct cmsghdr *tempHdr;
CmInetIpv6RtHdr0 *tempRtHdr;
*
*/
-#ifdef ANSI
-PRIVATE S16 cmInet6BuildRecvHopOptsArr
+static S16 cmInet6BuildRecvHopOptsArr
(
uint8_t *cmsgData, /* flat buffer where to build ext hdrs */
uint32_t hbhDataLen, /* byte len of cmsghdr + hbh ancil data */
uint8_t hdrId, /* 0: HBH, 1: DEST */
CmInetMemInfo *info /* Memory information */
)
-#else
-PRIVATE S16 cmInet6BuildRecvHopOptsArr(cmsgData, hbhDataLen, hbhOptsArr, hdrId,
- info)
-uint8_t *cmsgData; /* flat buffer where to build ext hdrs */
-uint32_t hbhDataLen; /* byte len of cmsghdr + hbh ancil data */
-CmInetIpv6HBHHdrArr *hbhOptsArr; /* IPv6 extensions headers */
-uint8_t hdrId; /* 0: HBH, 1: DEST */
-CmInetMemInfo *info; /* Memory information */
-#endif /* ANSI */
{
uint32_t curDataIdx; /* to keep track where we are in the hbh Data */
uint8_t optsIdx; /* how many hbh opts present in data */
*
*/
-#ifdef ANSI
-PRIVATE S16 cmInet6BuildRecvRtHdr
+static S16 cmInet6BuildRecvRtHdr
(
uint8_t *cmsgData, /* flat buffer where to build Route hdr */
uint32_t rtDataLen, /* byte len of cmsghdr struc+rtHdr ancil data */
CmInetIpv6RtHdr *rtOptsArr,/* IPv6 extensions headers */
CmInetMemInfo *info /* Memory information */
)
-#else
-PRIVATE S16 cmInet6BuildRecvRtHdr(cmsgData, rtDataLen, rtHdr0, rtOptsArr, info)
-uint8_t *cmsgData; /* flat buffer where to build Route hdr */
-uint32_t rtDataLen; /* byte len of cmsghdr struc+rtHdr ancil data */
-CmInetIpv6RtHdr0 *rtHdr0; /* rtHeader0 struct that precedes IPV6 addrss */
-CmInetIpv6RtHdr *rtOptsArr;/* IPv6 extensions headers */
-CmInetMemInfo *info; /* Memory information */
-#endif /* ANSI */
{
uint32_t curDataIdx; /* to keep track where we are in hbh Data */
uint8_t i; /* loop counter */
*
*/
-#ifdef ANSI
-PRIVATE S16 cmInet6GetHopLimitValue
+static S16 cmInet6GetHopLimitValue
(
uint8_t *cmsgData, /* flat buffer where to build ext hdrs */
uint32_t hopLimitDataLen, /* byte len of cmsghdr + hbh ancil data */
CmInetIpv6HdrParm *ipv6HdrParam /* ipv6 header parameters */
)
-#else
-PRIVATE S16 cmInet6GetHopLimitValue(cmsgData, hopLimitDataLen, ipv6HdrParam)
-uint8_t *cmsgData; /* flat buffer where to build ext hdrs */
-uint32_t hopLimitDataLen; /* byte len of cmsghdr + hbh ancil data */
-CmInetIpv6HdrParm *ipv6HdrParam; /* ipv6 header parameters */
-#endif /* ANSI */
{
uint16_t curDataIdx; /* to keep track where we are in the ancillary Data */
uint32_t *hopLimitValue; /* ttl/hoplimit value */
* File: cm_inet.c
*
*/
-#ifdef ANSI
S16 cmInetRecvMsg
(
CmInetFd *sockFd, /* socket file descriptor */
#endif /* LOCAL_INTF */
S32 flags /* additional control flags */
)
-#else
-/* added for IPv6 */
-#ifdef IPV6_OPTS_SUPPORTED
-#ifdef LOCAL_INTF
-S16 cmInetRecvMsg(sockFd, fromAddr, info, mPtr, len,
- ipHdrParams, localIf, flags)
-CmInetFd *sockFd; /* socket file descriptor */
-CmInetAddr *fromAddr; /* sender Internet address/port */
-CmInetMemInfo *info; /* buffer allocation info */
-Buffer **mPtr; /* received buffer structure */
-MsgLen *len; /* number of octets to read */
-CmInetIpHdrParm *ipHdrParams; /* IPv6 extensions headers */
-CmInetLocalInf *localIf; /* local interface on which pkt was recvd */
-S32 flags; /* additional control flags */
-#else
-S16 cmInetRecvMsg(sockFd, fromAddr, info, mPtr, len, ipHdrParams, flags)
-CmInetFd *sockFd; /* socket file descriptor */
-CmInetAddr *fromAddr; /* sender Internet address/port */
-CmInetMemInfo *info; /* buffer allocation info */
-Buffer **mPtr; /* received buffer structure */
-MsgLen *len; /* number of octets to read */
-CmInetIpHdrParm *ipHdrParams; /* IPv6 extensions headers */
-S32 flags; /* additional control flags */
-#endif /* LOCAL_INTF */
-#else
-#ifdef LOCAL_INTF
-S16 cmInetRecvMsg(sockFd, fromAddr, info, mPtr, len, localIf, flags)
-CmInetFd *sockFd; /* socket file descriptor */
-CmInetAddr *fromAddr; /* sender Internet address/port */
-CmInetMemInfo *info; /* buffer allocation info */
-Buffer **mPtr; /* received buffer structure */
-MsgLen *len; /* number of octets to read */
-CmInetLocalInf *localIf; /* local interface on which pkt was recvd */
-S32 flags; /* additional control flags */
-#else
-S16 cmInetRecvMsg(sockFd, fromAddr, info, mPtr, len, flags)
-CmInetFd *sockFd; /* socket file descriptor */
-CmInetAddr *fromAddr; /* sender Internet address/port */
-CmInetMemInfo *info; /* buffer allocation info */
-Buffer **mPtr; /* received buffer structure */
-MsgLen *len; /* number of octets to read */
-S32 flags; /* additional control flags */
-#endif /* LOCAL_INTF */
-#endif /* IPV6_OPTS_SUPPORTED */
-#endif /* ANSI */
{
#if (defined(WIN32) || defined(CMINETFLATBUF))
- S32 ret; /* temporary return value */
- uint32_t pendLen; /* pending data length */
- S32 recvLen; /* number of received octets by recvmsg() */
- MsgLen bufLen; /* entire number of received octets */
- MsgLen curLen; /* current number of octets in buffer */
- Data *recvBuf; /* receive buffer */
- Data *bufPtr; /* current buffer position */
- Buffer *mBuf; /* received message */
- uint32_t remAddrLen; /* length of remote address */
- struct sockaddr_in *remAddr; /* remote Internet address */
+ S32 ret = 0; /* temporary return value */
+ uint32_t pendLen =0; /* pending data length */
+ S32 recvLen =0; /* number of received octets by recvmsg() */
+ MsgLen bufLen =0; /* entire number of received octets */
+ MsgLen curLen =0; /* current number of octets in buffer */
+ Data *recvBuf =NULLP; /* receive buffer */
+ Data *bufPtr =NULLP; /* current buffer position */
+ Buffer *mBuf = NULLP; /* received message */
+ uint32_t remAddrLen =0; /* length of remote address */
+ struct sockaddr_in *remAddr = {0}; /* remote Internet address */
#ifdef IPV6_SUPPORTED
- struct sockaddr_in6 *remAddr6; /* remote Internet address */
- struct sockaddr_in6 remSockAddr; /* to get packet's source IP address */
+ struct sockaddr_in6 *remAddr6 = {0}; /* remote Internet address */
+ struct sockaddr_in6 remSockAddr ={0}; /* to get packet's source IP address */
#else
- CmInetSockAddr remSockAddr; /* to get packet's source IP address */
+ CmInetSockAddr remSockAddr ={0}; /* to get packet's source IP address */
#endif /* IPV6_SUPPORTED */
#else
- S32 ret; /* temporary return value */
+ S32 ret =0; /* temporary return value */
/* cm_inet_c_001.main_58: Fix for g++ compilation warning */
- uint16_t i; /* index */
- uint32_t pendLen; /* pending data length */
- S32 numBuf; /* number of allocated dBufs */
- S32 recvLen; /* number of received octets by recvmsg() */
- MsgLen bufLen; /* entire number of received octets */
- struct msghdr msg; /* message header */
+ uint16_t i =0; /* index */
+ uint32_t pendLen =0; /* pending data length */
+ S32 numBuf =0; /* number of allocated dBufs */
+ S32 recvLen =0; /* number of received octets by recvmsg() */
+ MsgLen bufLen =0; /* entire number of received octets */
+ struct msghdr msg = {0}; /* message header */
/* cm_inet_c_001.main_54: Fix for Klockworks issue */
Buffer *tempMsg = NULLP; /* temporary message */
- CmInetIovec rxArr[CM_INET_MAX_DBUF]; /* dynamic gather array */
+ CmInetIovec rxArr[CM_INET_MAX_DBUF]= {{0}}; /* dynamic gather array */
Buffer **dBufs = NULLP; /* dynamic array with allocated dBufs */
- S16 numDBufs; /* number of allocated dBufs */
+ S16 numDBufs =0; /* number of allocated dBufs */
/* cm_inet_c_001.main_55: As remAddrLen is only being used when
* WIN32 or CMINETFLATBUF is defined, then Removed variable
* in else part*/
- struct sockaddr_in *remAddr; /* remote Internet address */
+ struct sockaddr_in *remAddr = {0}; /* remote Internet address */
#ifdef IPV6_SUPPORTED
- struct sockaddr_in6 *remAddr6; /* remote Internet address */
- struct sockaddr_in6 remSockAddr;/* to get packet's source IP address */
+ struct sockaddr_in6 *remAddr6 ={0}; /* remote Internet address */
+ struct sockaddr_in6 remSockAddr ={0};/* to get packet's source IP address */
/* added for IPv6 ext headers support */
#ifdef IPV6_OPTS_SUPPORTED
- CmInetIpv6RtHdr0 rtHdr0; /* type 0 route header */
+ CmInetIpv6RtHdr0 rtHdr0 ={0}; /* type 0 route header */
#endif /* IPV6_OPTS_SUPPORTED */
#ifdef LOCAL_INTF
- struct in6_pktinfo *pkt6Info; /* IPv6 IP_PKTINFO */
+ struct in6_pktinfo *pkt6Info = {0}; /* IPv6 IP_PKTINFO */
#endif /* LOCAL_INTF */
#if (defined(SS_LINUX) || defined(_XPG4_2))
/* from stack for IPv6 ancill data */
#endif
#else
- CmInetSockAddr remSockAddr; /* to get packet's src IP address */
+ CmInetSockAddr remSockAddr ={0}; /* to get packet's src IP address */
#if (defined(SS_LINUX) || defined(_XPG4_2))
uint8_t ancillData[CM_INET_IPV4_ANCIL_DATA];
/* from stack for IPv4 ancill data */
* File: cm_inet.c
*/
-#ifdef ANSI
S16 cmInetPeekNew
(
- CmInetFd *sockFd, /* socket file descriptor */
- CmInetAddr *fromAddr, /* sender Internet address/port */
- CmInetMemInfo *info, /* buffer allocation info */
- MsgLen dataPos, /* position of data */
- MsgLen dataLen, /* length of read data */
- Data *data /* read data */
- )
-#else
-S16 cmInetPeekNew(sockFd, fromAddr, info, dataPos, dataLen, data)
- CmInetFd *sockFd; /* socket file descriptor */
- CmInetAddr *fromAddr; /* sender Internet address/port */
- CmInetMemInfo *info; /* buffer allocation info */
- MsgLen dataPos; /* position of data */
- MsgLen dataLen; /* length of read data */
- Data *data; /* read data */
-#endif
+CmInetFd *sockFd, /* socket file descriptor */
+CmInetAddr *fromAddr, /* sender Internet address/port */
+CmInetMemInfo *info, /* buffer allocation info */
+MsgLen dataPos, /* position of data */
+MsgLen dataLen, /* length of read data */
+Data *data /* read data */
+)
{
/* cm_inet_c_001.main_57 - Fix for validation and compilation warning */
S32 recvLen; /* number of received octets */
*
*/
-#ifdef ANSI
S16 cmInetPeek
(
CmInetFd *sockFd, /* socket file descriptor */
MsgLen dataLen, /* length of read data */
Data *data /* read data */
)
-#else
-S16 cmInetPeek(sockFd, fromAddr, info, dataPos, dataLen, data)
-CmInetFd *sockFd; /* socket file descriptor */
-CmInetAddr *fromAddr; /* sender Internet address/port */
-CmInetMemInfo *info; /* buffer allocation info */
-MsgLen dataPos; /* position of data */
-MsgLen dataLen; /* length of read data */
-Data *data; /* read data */
-#endif
{
/* cm_inet_c_001.main_54: Fix for Klockworks issue */
Data *recvBuf = NULLP; /* plain receive buffer */
*
*/
-#ifdef ANSI
S16 cmInetClose
(
CmInetFd *sockFd /* socket file descriptor */
)
-#else
-S16 cmInetClose(sockFd)
-CmInetFd *sockFd; /* socket file descriptor */
-#endif
{
S32 ret; /* temporary return value */
*
*/
-#ifdef ANSI
S16 cmInetShutdown
(
CmInetFd *sockFd, /* socket file descriptor */
S32 howTo /* operation flag */
)
-#else
-S16 cmInetShutdown(sockFd, howTo)
-CmInetFd *sockFd; /* socket file descriptor */
-S32 howTo; /* operation flag */
-#endif
{
S32 ret; /* temporary return value */
*
*/
-#ifdef ANSI
S16 cmInetSelect
(
CmInetFdSet *readFdS, /* read socket descriptor file set */
CmInetFdSet *writeFdS, /* write socket descriptor file set */
-uint32_t *mSecTimeout, /* timeout in msecs */
+uint32_t *mSecTimeout, /* timeout in msecs */
S16 *numFdS /* number of ready descriptors */
)
-#else
-S16 cmInetSelect(readFdS, writeFdS, mSecTimeout, numFdS)
-CmInetFdSet *readFdS; /* read socket descriptor file set */
-CmInetFdSet *writeFdS; /* write socket descriptor file set */
-uint32_t *mSecTimeout; /* timeout in msecs */
-S16 *numFdS; /* number of ready descriptors */
-#endif
{
S32 ret; /* temporary return value */
struct timeval timeout; /* timeout structure */
* File: cm_inet.c
*
*/
-#ifdef ANSI
S16 cmInetSetOpt
(
CmInetFd *sockFd, /* socket file descriptor */
-uint32_t level, /* option level */
-uint32_t type, /* option type */
-Ptr value /* option value */
+uint32_t level, /* option level */
+uint32_t type, /* option type */
+Ptr value /* option value */
)
-#else
-S16 cmInetSetOpt(sockFd, level, type, value)
-CmInetFd *sockFd; /* socket file descriptor */
-uint32_t level; /* option level */
-uint32_t type; /* option type */
-Ptr value; /* option value */
-#endif
{
S32 ret = ROK; /* temporary return value */
uint32_t disable = 0; /* disable option */
/* disable the IP_OPTIONS for Router Alert. */
#ifdef WIN32
ret = setsockopt(sockFd->fd, level, IP_OPTIONS,
- (CONSTANT char *)&disableOpt, sizeof(int));
+ (const char *)&disableOpt, sizeof(int));
#else
ret = setsockopt(sockFd->fd, level, IP_OPTIONS, NULL, 0);
#endif /* WIN32 */
(char *)&lpEnable, sizeof(lpEnable));
#else
ret = setsockopt(sockFd->fd, level, IP_MULTICAST_LOOP,
- (CONSTANT char *)&lpEnable, sizeof(lpEnable));
+ (const char *)&lpEnable, sizeof(lpEnable));
#endif /* SS_VW */
}
else
(char *)&lpDisable, sizeof(lpDisable));
#else
ret = setsockopt(sockFd->fd, level, IP_MULTICAST_LOOP,
- (CONSTANT char *)&lpDisable, sizeof(lpDisable));
+ (const char *)&lpDisable, sizeof(lpDisable));
#endif /* SS_VW */
}
break;
case CM_INET_OPT_MCAST_TTL:
optVal = (uint32_t*)value;
- /* remove CONSTANT in setsockopt for VW */
+ /* remove const in setsockopt for VW */
#ifdef SS_VW
ret = setsockopt(sockFd->fd, level, IP_MULTICAST_TTL,
(char *)optVal, sizeof(uint8_t));
#else
ret = setsockopt(sockFd->fd, level, IP_MULTICAST_TTL,
- (CONSTANT char *)optVal, sizeof(uint8_t));
+ (const char *)optVal, sizeof(uint8_t));
#endif /* SS_VW */
break;
#endif /* SUNOS || WIN32 || SS_PS || SS_VW_MCAST || HPOS */
*
*/
-#ifdef ANSI
S16 cmInetGetNumRead
(
CmInetFd *sockFd, /* socket file descriptor */
uint32_t *dataLen /* number of pending octets */
/* removed 3rd argument memInfo */
)
-#else
-S16 cmInetGetNumRead(sockFd, dataLen)
-CmInetFd *sockFd; /* socket file descriptor */
-uint32_t *dataLen; /* number of pending octets */
-/* removed 3rd argument memInfo */
-#endif
{
S32 ret; /* temporary return value */
*
*/
-#ifdef ANSI
S16 cmInetGetHostByName
(
S8 *hostName, /* host name */
CmInetIpAddrTbl *addrTbl /* Address Table of IPV4 Addresses */
)
-#else
-S16 cmInetGetHostByName (hostName, addrTbl)
-S8 *hostName; /* host name */
-CmInetIpAddrTbl *addrTbl; /* Address Table of IPV4 Addresses */
-#endif
{
#ifndef SS_VW
uint8_t numAddrs; /* Number of Addresses */
* File: cm_inet.c
*
*/
-#ifdef ANSI
S16 cmInetGetIpNodeByName
(
S8 *hostName, /* host name */
CmInetIpAddrArr *addrArr /* Array of addressed filled in */
)
-#else
-S16 cmInetGetIpNodeByName(hostName, addrArr)
-S8 *hostName; /* host name */
-CmInetIpAddrArr *addrArr; /* Array of addressed filled in */
-#endif
{
/* for return value from cmInetGetHostByName */
#ifndef IPV6_SUPPORTED
*
*/
-#ifdef ANSI
S16 cmInetAddr(
S8 *asciiAddr, /* ascii address representation */
CmInetIpAddr *address /* 4 byte interent address */
)
-#else
-S16 cmInetAddr(asciiAddr, address)
-S8 *asciiAddr; /* ascii address representation */
-CmInetIpAddr *address; /* 4 byte interent address */
-#endif
{
#if (ERRCLASS & ERRCLS_INT_PAR)
*
*/
-#ifdef ANSI
S16 cmInetNtoa(
CmInetIpAddr address, /* 4 byte interent address */
S8 **asciiAddr /* ascii address representation */
)
-#else
-S16 cmInetNtoa(address, asciiAddr)
-CmInetIpAddr address; /* 4 byte interent address */
-S8 **asciiAddr; /* ascii address representation */
-#endif
{
struct in_addr inetAddr; /* internet address structure */
*
*/
-#ifdef ANSI
S16 cmInetNtop(
uint8_t type, /* ip address type */
Void *address, /* 4/16 byte interent address */
S8 *asciiAddr, /* ascii adress representation */
uint32_t len
)
-#else
-S16 cmInetNtop(type,address, asciiAddr,len)
-uint8_t type; /* ip address type */
-Void *address; /* 4/16 byte interent address */
-S8 *asciiAddr; /* ascii adress representation */
-uint32_t len;
-#endif
{
S32 domain = 0;
*
*/
-#ifdef ANSI
S16 cmInetPton(
CmInetIpAddr *address, /* 4 byte interent address */
S8 *asciiAddr /* ascii address representation */
)
-#else
-S16 cmInetPton(address, asciiAddr)
-CmInetIpAddr *address; /* 4 byte interent address */
-S8 *asciiAddr; /* ascii address representation */
-#endif
{
S16 ret;
* File: cm_inet.c
*
*/
-#ifdef ANSI
S16 cmInetPton6(
CmInetIpAddr6 *address6, /* 16 byte interent address */
S8 *asciiAddr /* ascii address representation */
)
-#else
-S16 cmInetPton6(address6, asciiAddr)
-CmInetIpAddr6 *address6; /* 16 byte interent address */
-S8 *asciiAddr; /* ascii address representation */
-#endif
{
S16 ret;
*
*/
-#ifdef ANSI
S16 cmInetGetMemSize(
S32 *size /* max used memory size */
)
-#else
-S16 cmInetGetMemSize(size)
-S32 *size; /* max used memory size */
-#endif
{
#ifdef WIN32
/* max static memory size depends on max flat buffer size */
*
*/
-#ifdef ANSI
-S16 cmInetInit(
-Void
-)
-#else
S16 cmInetInit(Void)
-#endif
{
#ifdef WIN32
uint16_t version;
*
*/
-#ifdef ANSI
-S16 cmInetDeInit(
-Void
-)
-#else
S16 cmInetDeInit(Void)
-#endif
{
#ifdef WIN32
S32 err;
*
*/
\f
-#ifdef ANSI
S16 cmInetGetSockName
(
CmInetFd *sockFd, /* socket file descriptor */
CmInetAddr *locAddr
)
-#else
-S16 cmInetGetSockName(sockFd, locAddr)
-CmInetFd *sockFd; /* socket file descriptor */
-CmInetAddr *locAddr;
-#endif
{
struct sockaddr_in *sockAddr;
#ifdef IPV6_SUPPORTED
*
*/
\f
-#ifdef ANSI
S16 cmInetFdSetInfoInit
(
CmInetFdSetInfo *fdSetInfo
)
-#else
-S16 cmInetFdSetInfoInit(fdSetInfo)
-CmInetFdSetInfo *fdSetInfo;
-#endif
{
#if (defined(SUNOS) || defined(SS_LINUX) || defined(SS_VW) || defined(HPOS))
uint16_t arIdx;
*
*/
\f
-#ifdef ANSI
S16 cmInetGetFd
(
CmInetFdSetInfo *fdSetInfo,
CmInetFdSet *fdSet,
CmInetFdType *sockFd
)
-#else
-S16 cmInetGetFd(fdSetInfo, fdSet, sockFd)
-CmInetFdSetInfo *fdSetInfo;
-CmInetFdSet *fdSet;
-CmInetFdType *sockFd;
-#endif
{
/*cm_inet_c_001.main_58 : Fix for klockwork issue */
#if (!defined (WIN32))
*
*/
-#ifdef ANSI
S16 cmInetConvertStrToIpAddr
(
uint16_t len, /* Length of IP address */
uint8_t *val, /* Domain Name String */
CmInetNetAddr *address /* IP Address */
)
-#else
-S16 cmInetConvertStrToIpAddr(len, val, address)
-uint16_t len; /* Length of IP address */
-uint8_t *val; /* Domain Name String */
-CmInetNetAddr *address; /* IP Address */
-#endif
{
uint8_t idx; /* Index for string*/
uint8_t ipv4[CM_INET_IPV4ADDR_SIZE]; /* IPV4 Address bytes */
* File: cm_inet.c
*
*/
-#ifdef ANSI
S16 cmInetAsciiToIpv4
(
-uint8_t numBytes, /* number of Byte to convert */
-uint8_t *ipv4Addr, /* IPV4 Address */
-uint16_t len, /* Length of IP address */
-uint8_t *val /* Domain Name String */
+uint8_t numBytes, /* number of Byte to convert */
+uint8_t *ipv4Addr, /* IPV4 Address */
+uint16_t len, /* Length of IP address */
+uint8_t *val /* Domain Name String */
)
-#else
-S16 cmInetAsciiToIpv4(numBytes, ipv4Addr, len, val)
-uint8_t numBytes; /* number of Byte to convert */
-uint8_t *ipv4Addr; /* IPV4 Address */
-uint16_t len; /* Length of IP address */
-uint8_t *val; /* Domain Name String */
-#endif
{
- uint8_t byteCount; /* Byte Count */
- uint8_t idx; /* Index for string*/
+ uint8_t byteCount; /* Byte Count */
+ uint8_t idx; /* Index for string*/
idx = 0;
*
*/
-#ifdef ANSI
S32 cmInetGetAddrInfo
(
-CONSTANT S8 *node, /* Network addr which has to be resolved */
-CONSTANT S8 *service, /* Sets the port number in network addr */
-CONSTANT CmInetAddrInfo *hints, /* Specifies preferred socket type or protocol */
+const S8 *node, /* Network addr which has to be resolved */
+const S8 *service, /* Sets the port number in network addr */
+const CmInetAddrInfo *hints, /* Specifies preferred socket type or protocol */
CmInetAddrInfo **res /* Link list of addrInfo structure */
)
-#else
-S32 cmInetGetAddrInfo(node,service,hints,res)
-CONSTANT S8 *node; /* Network addr which has to be resolved */
-CONSTANT S8 *service; /* Sets the port number in network addr */
-CONSTANT CmInetAddrInfo *hints; /* Specifies preferred socket type or protocol */
-CmInetAddrInfo **res; /* Link list of addrInfo structure */
-#endif
{
S32 ret;
ret = ROK;
*
*/
-#ifdef ANSI
Void cmInetFreeAddrInfo
(
-CmInetAddrInfo *res /* Link list of addrInfo structure */
+CmInetAddrInfo *res /* Link list of addrInfo structure */
)
-#else
-Void cmInetFreeAddrInfo(res)
-CmInetAddrInfo *res; /* Link list of addrInfo structure */
-#endif
{
#if (ERRCLASS & ERRCLS_INT_PAR)
* File: cm_inet.c
*
*/
-#ifdef ANSI
S16 cmInetFlushRecvBuf
(
CmInetFd *sockFd, /* socket file descriptor */
MsgLen *len, /* number of octects to be flushed */
S32 flags /* additional control flags */
)
-#else
-S16 cmInetFlushRecvBuf(sockFd, len, flags)
-CmInetFd *sockFd; /* socket file descriptor */
-MsgLen *len; /* number of octects to be flushed */
-S32 flags; /* additional control flags */
-#endif /* ANSI */
{
Data recvTempBuf[CM_INET_MAX_BYTES_READ];