Syntax
#include <snmp_dpi.h>
unsigned char *mkDPItrap( /* Make a DPI trap packet */
long int generic, /* generic traptype (32 bit)*/
long int specific, /* specific traptype (32 bit)*/
snmp_dpi_set_packet *packet_p, /* ptr to varBinds, a chain */
/* of dpi_set_packets */
char *enterprise_p); /* ptr to enterprise OID */
Parameters
generic
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 mkDPItrap() function is used at the subagent side to prepare a DPI TRAP packet. The resulting packet can be sent to the DPI peer, which is normally a DPI capable SNMP agent.
Examples
#include <snmp_dpi.h> unsigned char *pack_p;
snmp_dpi_set_packet *set_p;
long int num;
set_p = mkDPIset(snmp_dpi_set_packet_NULL_p,
"1.3.6.1.2.3.4.5.", "1.0",
SNMP_TYPE_Integer32,
sizeof(num), &num);
if (set_p) {
pack_p = mkDPItrap(6,1,set_p, (char *)0);
if (pack_p) {
/* send packet to subagent */
} /* endif */
} /* endif */
Related Information