send SNMP messages
#include <sys/types.h> #include <snmp/asn1.h> #include <netinet/in.h> #include <snmp/snmp_api.h> extern int snmp_errno int snmp_send( struct snmp_session *session, struct snmp_pdu *pdu)
This function sends the PDU on the session provided. If necessary, some of the snmp_pdu structure data is set from the session defaults. A request corresponding to this PDU is added to the list of outstanding requests on this session and then the packet is sent.
This function frees pdu unless an error occurs.
The request ID of the generated packet, if applicable. If not applicable, this function returns 1. If an error occurs, 0 is returned and snmp_errno is set.
If an error occurred, snmp_errno could contain one of the following:
SNMP
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | No |
<snmp_api.h>, snmp_close(), snmp_open(), snmp_pdu, snmp_read(), snmp_select_info(), snmp_send(), snmp_session, snmp_timeout()
select() in the C Library Reference
RFC 1157, FAQ in Internet newsgroup comp.protocols.snmp
Marshall T. Rose, The Simple Book: An Introduction to Internet Management, Revised 2nd ed. (Prentice-Hall, 1996, ISBN 0-13-451659-1)