Open an SNMP session
#include <sys/types.h> #include <snmp/asn1.h> #include <snmp/snmp_api.h> extern int snmp_errno; struct snmp_session * snmp_open( struct snmp_session * session );
The snmp_open() function sets up an SNMP session with the information supplied by the application in the snmp_session structure pointed to by session. Next, snmp_open() opens and binds the necessary UDP port.
Based on:
A pointer to a snmp_session structure for the created session (which is different from the pointer passed to the function), or NULL if an error occurs (snmp_errno is set).
If an error occurs, this function sets snmp_errno to one of:
Safety: | |
---|---|
Cancellation point | Yes |
Interrupt handler | No |
Signal handler | No |
Thread | No |