z/OS Communications Server: IP Programmer's Guide and Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


The mkDPIAreYouThere() function

z/OS Communications Server: IP Programmer's Guide and Reference
SC27-3659-02

Format

#include <snmp_dpi.h>
 
unsigned char *mkDPIAreYouThere(void);

Parameters

None

Return codes

  • If successful, a pointer to a static DPI packet buffer is returned. The first 2 bytes of the buffer in network byte order contain the length of the remaining packet. The macro DPI_PACKET_LEN can be used to calculate the total length of the DPI packet.
  • If not successful, a NULL pointer is returned.
Note: The static buffer for the DPI packet is shared by other mkDPIxxxx() functions that create a serialized DPI packet.

Usage

The mkDPIAreYouThere() function creates a serialized DPI ARE_YOU_THERE packet that can be sent to the DPI peer, which is normally the agent.

A subagent connected through TCP or UNIXstream probably does not need this function because, normally when the agent breaks the connection, you will receive an EOF on the file descriptor.

If your connection to the agent is still healthy, the agent will send a DPI RESPONSE with SNMP_ERROR_DPI_noError in the error code field and 0 in the error index field. The RESPONSE will have no varBind data. If your connection is not healthy, the agent might send a response with an error indication, or might not send a response at all.

Examples

  #include <snmp_dpi.h>
  unsigned char *pack_p;
 
  pack_p = mkDPIAreYouThere();
  if (pack_p) {
     /* send the packet to the agent */
  } /* endif */
  /* wait for response with DPIawait_packet_from_agent() */
  /* normally the response should come back pretty quickly, */
  /* but it depends on the load of the agent */

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014