Create an SNMP Protocol Data Unit message structure
#include <sys/types.h> #include <netinet/in.h> #include <snmp/snmp.h> #include <snmp/asn1.h> #include <snmp/snmp_api.h> #include <snmp/snmp_client.h> extern int snmp_errno; struct snmp_pdu * snmp_pdu_create (int command );
as defined in <snmp/snmp.h>.
The snmp_pdu_create() function allocates memory for a Protocol Data Unit (PDU) structure for SNMP message passing. The PDU structure is initialized with default values; see the documentation for snmp_pdu.
Based on:
A pointer to the PDU structure created, or NULL if an error occurs (snmp_errno is set).
If an error occurs, this function sets snmp_errno to: