Close an SNMP session
Synopsis:
#include <sys/types.h>
#include <snmp/asn1.h>
#include <snmp/snmp_api.h>
extern int snmp_errno
int snmp_close( struct snmp_session * session );
Arguments:
- session
- A pointer to the
snmp_session
structure that identifies the SNMP session that you want to close.
This pointer was returned by a call to
snmp_open().
Library:
libsnmp
Use the -l snmp option to
qcc
to link against this library.
Description:
The snmp_close() function closes the input session, frees any data allocated for it,
dequeues any pending requests, and closes any sockets allocated for
the session.
Based on:
- 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)
Returns:
- 1
- Success.
- 0
- An error occurred (snmp_errno is set).
Errors:
If an error occurs, this function sets snmp_errno to:
- SNMPERR_BAD_SESSION
- The specified session wasn't open.
Classification:
SNMP
Safety: |
|
Cancellation point |
Yes |
Interrupt handler |
No |
Signal handler |
No |
Thread |
No |