Syntax
#include <snmp_dpi.h> unsigned char *mkDPIunregister( /* Make DPI unregister packet */ char reason_code; /* unregister reason code */ char *group_p); /* ptr to group ID (sub-tree) */
Parameters
reason_code
See DPI UNREGISTER Reason Codes for a list of the currently defined reason codes.
Return Values
If successful, a pointer to a static DPI packet buffer is returned. The first two 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 failure, 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.
Description
The mkDPIunregister() function creates a serialized DPI UNREGISTER packet that can be sent to the DPI peer, which is a DPI capable SNMP agent or subagent.
Normally, the SNMP peer then sends a DPI RESPONSE packet back. This packet identifies if the unregister was successful or not.
Examples
#include <snmp_dpi.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 */
} /* endif */
Related Information