Syntax
#include <snmp_dpi.h> int DPIconnect_to_agent_TCP( /* Connect to DPI TCP port */ char *hostname_p, /* target hostname/IP address */ char *community_p); /* community name */
Parameters
hostname_p
Return Values
If successful, a positive integer that represents the connection is returned. It is to be used as a handle in subsequent calls to DPI transport-related functions.
If failure, a negative integer is returned. It indicates the kind of error that occurred. See Return Codes from DPI Transport-Related Functions for a list of possible error codes.
Description
The DPIconnect_to_agent_TCP() function is used at the subagent side to setup a TCP connection to the DPI capable SNMP agent.
Examples
#include <snmp_dpi.h> int handle;
handle = DPIconnect_to_agent_TCP("localhost", "loopback");
if (handle < 0) {
printf("Error %d from connect\n",handle);
exit(1);
} /* endif */
Related Information