mkDPIclose()--Make a DPI Close Packet


  Syntax
 #include <qtossapi.h>

 unsigned char     *mkDPIclose( char reason_code );   


  Service Program Name: QTOSSAPI

  Default Public Authority: *USE

  Threadsafe: No

The mkDPIclose() function makes a DPI® close packet and returns a pointer to the packet.


Authorities and Locks

None.


Parameters

reason_code
(Input) The reason for the close. See the <qtossapi.h> file in the QSYSINC library for the list of defined reason codes.

Return Value

value The value returned is a pointer to the DPI packet.

If successful, then 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 DPI_PACKET_LEN() function can be used to calculate the total length of the DPI packet.

NULL If unsuccessful, then a NULL pointer is returned.

Be aware that the static buffer for the DPI packet is shared by other mkDPIxxxx() functions that create a serialized DPI packet.

For more information, see the Simple Network Management Protocol (SNMP) SupportLink to PDF manual.


Usage Notes

The mkDPIclose() function creates a serialized DPI CLOSE packet that can then 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.


Related Information


Example

Note: By using the code examples, you agree to the terms of the Code license and disclaimer information.

 #include <qtossapi.h>
  unsigned char *pack_p;

  pack_p = mkDPIclose(SNMP_CLOSE_goingDown);
  if (pack_p) {
     /* Send the packet to the agent. */
  }



API introduced: V3R6

[ Back to top | UNIX-Type APIs | APIs by category ]