OverView Index Help                                                                WebNMS Agent Toolkit C Edition 6 

sysutils.c
It contains GetHostIpAddress() function. In general this file will contain utilss function related to system.
Return Type Method Summary
INT16 CheckFileModifiedSince(CHAR *fName, struct tm *IfModifiedSince, CHAR *resultFlag)
             Checks whether the file is a directory and it is a regular file.
SOCKET EstablishTcpConnection(IpInfo *ipInfoPtr) or INT32 EstablishTcpConnection(IpInfo *ipInfoPtr)
             It will establish the tcp connection to the listening port.
CHAR GetHostIpAddress(CHAR **hostAddress)
             It will get the ip address of the local machine.
INT16 IfFileAvailable(CHAR *fName )
             Checks whether the requested URL or the file is a directory or a regular file.
INT32 PollSockets(IpInfo **ipInfoPtr, INT32 ipInfoLen, U_INT32 delayVal)
             It will check each socket whether data is available to read.
CHAR RcvCompleteTcpMsgForSnmp(SOCKET sockFd, U_CHAR *pkt, INT32 *pktLen) or CHAR RcvCompleteTcpMsgForSnmp(INT32 sockFd, U_CHAR *pkt, INT32 *pktLen)
             It will parse the header length of the snmp packet.
void SetSockFds(fd_set *readFdSet, IpInfo **ipInfoPtr, INT32 ipInfoLen)
             Set each sockFd into readFdSet variable.
void UpdateMaxSockFd(IpInfo **ipInfoPtr, INT32 ipInfoLen, SOCKET *maxSockFd) or void UpdateMaxSockFd(IpInfo **ipInfoPtr, INT32 ipInfoLen, INT32 *maxSockFd)
             It will find out the max sockFd of the given transport domain info.
CHAR WaitForResponseOnIp(Vector *vect)
             It will wait for the response from the specified proxy agent, once data is available, it will will retun the function to read the message.
CHAR WaitForTdInfoOnIp(IpInfo *ipInfoPtr, LONG delayVal)
             This method will wait for the response for the specified IpInfo.
   
Method Details

CheckFileModifiedSince()

INT16 CheckFileModifiedSince( CHAR *fName, struct tm *IfModifiedSince, CHAR *resultFlag)

Checks whether the file is a directory and it is a regular file. If so, finds whether the file has been modified recently so that it can be sent to the client upon the next request.

Arguments:
1. Character Pointer (IN)
2. struct tm Pointer (IN)
3. Character Pointer (OUT)
Return type:
returns an integer
Bugs:
null

EstablishTcpConnection()

SOCKET EstablishTcpConnection(IpInfo *ipInfoPtr) or INT32 EstablishTcpConnection(IpInfo *ipInfoPtr)

It will establish the tcp connection to the listening port.

Arguments:
1. Ip Info (IN).
Return type:
Socket for connection establishment.
Bugs:
null

GetHostIpAddress()

CHAR GetHostIpAddress(CHAR **hostAddress)

It will get the ip address of the local machine. After calling this function input argument should freed as it is allocated inside the fumction.

Arguments:
1.Reference to the hostAddress.
Return type:
SUCCESS or FAILURE according to the memeory allocation.
Bugs:
null

IfFileAvailable()

INT16 IfFileAvailable( CHAR *fName )

Checks whether the requested URL or the file is a directory or a regular file.

Arguments:
1. Character Pointer (IN)
Return type:
returns an integer
Bugs:
null

PollSockets()

INT32 PollSockets(IpInfo **ipInfoPtr, INT32 ipInfoLen, U_INT32 delayVal)

It will check each socket whether data is available to read. If it is available then it will return the corresponding IpInfo refernce.

Arguments:
1. Array of IpInfo (IN/OUT).
2. Length of the Ipinfo (IN).
3. Delay value for select system call (IN).
Return type:
Index of Ipinfo.
Bugs:
null

RcvCompleteTcpMsgForSnmp()

CHAR RcvCompleteTcpMsgForSnmp(SOCKET sockFd, U_CHAR *pkt, INT32 *pktLen) or CHAR RcvCompleteTcpMsgForSnmp(INT32 sockFd, U_CHAR *pkt, INT32 *pktLen)

It will parse the header length of the snmp packet.

Arguments:
1. Socket (IN).
2. Buffer to receive SNMP message (OUT).
3. Buffer length (OUT).
Return type:
Reference to the packet after parsing length.
Bugs:
null

SetSockFds()

void SetSockFds(fd_set *readFdSet, IpInfo **ipInfoPtr, INT32 ipInfoLen)

Set each sockFd into readFdSet variable.

Arguments:
1. Fd set to store socket descriptor (OUT).
2. Array of IpInfo (IN).
3. Length of the IpInfo (IN).
Return type:
Nothing.
Bugs:
null

UpdateMaxSockFd()

void UpdateMaxSockFd(IpInfo **ipInfoPtr, INT32 ipInfoLen, SOCKET *maxSockFd) or void UpdateMaxSockFd(IpInfo **ipInfoPtr, INT32 ipInfoLen, INT32 *maxSockFd)

It will find out the max sockFd of the given transport domain info.

Arguments:
1. Ip info (IN).
2. Length of the Ip info (IN).
3. Reference of the maxSockFd (IN/OUT).
Return type:
Nothing.
Bugs:
null

WaitForResponseOnIp()

CHAR WaitForResponseOnIp(Vector *vect)

It will wait for the response from the specified proxy agent, once data is available, it will will retun the function to read the message.

Arguments:
1. Reference to the Vector(IN/OUT).
Return type:
If the data is available then it will return SUCCESS, otherwise FAILURE.
Bugs:
null

WaitForTdInfoOnIp()

CHAR WaitForTdInfoOnIp(IpInfo *ipInfoPtr, LONG delayVal)

This method will wait for the response for the specified IpInfo.

Arguments:
1. Reference to the IpInfo (IN).
2. Delay time value (IN).
Return type:
SUCCESS or FAILURE
Bugs:
null


OverView Index Help                                                                WebNMS Agent Toolkit C Edition 6 

Copyright (c) 2009 ZOHO Corp. All Rights Reserved.