mkDPIunregister()--Make a DPI Unregister Packet


  Syntax
 #include <qtossapi.h>

 unsigned char     *mkDPIunregister(
     char               reason_code,   
     char               *group_p);


  Service Program Name: QTOSSAPI

  Default Public Authority: *USE

  Threadsafe: No

The mkDPIunregister() function makes a DPI® unregister packet and returns a pointer to the packet.

Authorities and Locks

None.


Parameters

reason_code
(Input) The reason for the unregister operation. See the <qtossapi.h> file for a list of defined reason codes.

group_p
(Input) A pointer to a NULL-terminated character string that represents the subtree to be unregistered. The subtree must have a trailing dot.

Return Value

pointer value The mkDPIunregister() function was successful. 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 The mkDPIunregister() function was not successful.

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 mkDPIunregister() function creates a serialized DPI UNREGISTER packet that can then be sent to the SNMP agent. Normally, the SNMP peer then sends a DPI RESPONSE packet back, which details if the unregister was successful or not.


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 = mkDPIunregister(
                SNMP_UNREGISTER_goingDown,
                "1.3.6.1.2.3.4.5.");
  if (pack_p) {
     /* Send packet to agent or subagent and await response. */
  }


API introduced: V3R6

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