snmp_open()

open an SNMP session

Synopsis:

#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 );

Description:

This 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.

Returns:

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 occurred (in which case snmp_errno is set).

Errors:

If an error occurred, snmp_errno could contain one of the following:

SNMPERR_BAD_ADDRESS
Unknown host.
SNMPERR_BAD_LOCPORT
Could not bind to the specified port.
SNMPERR_GENERR
Could not open the socket.

Classification:

SNMP

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

<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)