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


The mkDPIclose() function

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

Format

#include <snmp_dpi.h>
 
unsigned char *mkDPIclose(char reason_code);

Parameters

reason_code
The reason for closing the DPI connection. See DPI CLOSE reason codes for a list of valid reason codes.

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 mkDPIclose() function creates a serialized DPI CLOSE packet that can be sent to the DPI peer. As a result of sending the packet, the DPI connection will be closed.

Sending a DPI CLOSE packet to the agent implies an automatic DPI UNREGISTER for all registered subtrees on the connection being closed.

Examples

  #include <snmp_dpi.h>
  unsigned char *pack_p;
 
  pack_p = mkDPIclose(SNMP_CLOSE_goingDown);
  if (pack_p) {
     /* send the packet to the agent */
  } /* endif */

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014