Deleted Added
sdiff udiff text old ( 208483 ) new ( 216294 )
full compact
1.\"
2.\" Copyright (c) 2004-2005
3.\" Hartmut Brandt.
4.\" All rights reserved.
5.\" Copyright (c) 2001-2003
6.\" Fraunhofer Institute for Open Communication Systems (FhG Fokus).
7.\" All rights reserved.
8.\"

--- 17 unchanged lines hidden (view full) ---

26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" $Begemot: bsnmp/lib/bsnmpclient.3,v 1.12 2005/10/04 08:46:50 brandt_h Exp $
33.\"
34.Dd October 4, 2005
35.Dt BSNMPCLIENT 3
36.Os
37.Sh NAME
38.Nm snmp_client ,
39.Nm snmp_send_cb_f ,
40.Nm snmp_timeout_cb_f ,
41.Nm snmp_timeout_start_f ,
42.Nm snmp_timeout_stop_f ,

--- 4 unchanged lines hidden (view full) ---

47.Nm snmp_pdu_check ,
48.Nm snmp_pdu_send ,
49.Nm snmp_oid_append ,
50.Nm snmp_parse_server ,
51.Nm snmp_receive ,
52.Nm snmp_table_cb_f ,
53.Nm snmp_table_fetch ,
54.Nm snmp_table_fetch_async ,
55.Nm snmp_dialog
56.Nd "SNMP client library"
57.Sh LIBRARY
58Begemot SNMP library
59.Pq libbsnmp, -lbsnmp
60.Sh SYNOPSIS
61.In asn1.h
62.In snmp.h
63.In snmpclient.h

--- 33 unchanged lines hidden (view full) ---

97.Ft typedef void
98.Fn (*snmp_table_cb_f) "void *list" "void *arg" "int res"
99.Ft int
100.Fn snmp_table_fetch "const struct snmp_table *descr" "void *list"
101.Ft int
102.Fn snmp_table_fetch_async "const struct snmp_table *descr" "void *list" "snmp_table_cb_f callback" "void *uarg"
103.Ft int
104.Fn snmp_dialog "struct snmp_pdu *req" "struct snmp_pdu *resp"
105.Sh DESCRIPTION
106The SNMP library contains routines to easily build SNMP client applications
107that use SNMP versions 1 or 2.
108Most of the routines use a
109.Vt struct snmp_client :
110.Bd -literal -offset indent
111struct snmp_client {
112 enum snmp_version version;
113 int trans; /* transport type to use */
114
115 /* these two are read-only for the application */
116 char *cport; /* port number as string */
117 char *chost; /* host name or IP address as string */
118
119 char read_community[SNMP_COMMUNITY_MAXLEN + 1];
120 char write_community[SNMP_COMMUNITY_MAXLEN + 1];
121
122 struct timeval timeout;
123 u_int retries;
124
125 int dump_pdus;
126
127 size_t txbuflen;
128 size_t rxbuflen;
129
130 int fd;
131
132 int32_t next_reqid;
133 int32_t max_reqid;
134 int32_t min_reqid;
135
136 char error[SNMP_STRERROR_LEN];
137
138 snmp_timeout_start_f timeout_start;
139 snmp_timeout_stop_f timeout_stop;
140
141 /* private */
142 char local_path[sizeof(SNMP_LOCAL_PATH)];
143};
144.Ed
145.Pp
146The fields of this structure are described below.
147.Bl -tag -width "timeout_start"
148.It Va version
149This is the version of SNMP to use.
150See

--- 38 unchanged lines hidden (view full) ---

189.It Va read_community
190This is the community name to be used for all requests except SET requests.
191The default is
192.Sq public .
193.It Va write_community
194The community name to be used for SET requests.
195The default is
196.Sq private .
197.It Va timeout
198The maximum time to wait for responses to requests.
199If the time elapses, the request is resent up to
200.Va retries
201times.
202The default is 3 seconds.
203.It Va retries
204Number of times a request PDU is to be resent.

--- 407 unchanged lines hidden (view full) ---

612calls or table fetches may be called while in the function).
613The response PDU is returned in
614.Fa resp .
615If no response could be received after all timeouts and retries, the function
616returns -1.
617If a response was received 0 is returned.
618.Pp
619The function
620.Fn snmp_parse_server
621is used to parse an SNMP server specification string and fill in the
622fields of a
623.Vt struct snmp_client .
624The syntax of a server specification is
625.Pp
626.D1 [trans::][community@][server][:port]
627.Pp

--- 31 unchanged lines hidden ---