Syntax
#include <snmp_dpi.h> unsigned char *mkDPIclose(char reason_code);
Parameters
reason_code
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 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 sub-trees 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 */
Related Information