bsnmplib.3 (142810) | bsnmplib.3 (150920) |
---|---|
1.\" | 1.\" |
2.\" Copyright (c) 2004-2005 3.\" Hartmut Brandt. 4.\" All rights reserved. |
|
2.\" Copyright (c) 2001-2003 3.\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). 4.\" All rights reserved. 5.\" 6.\" Author: Harti Brandt <harti@freebsd.org> 7.\" 8.\" Redistribution and use in source and binary forms, with or without 9.\" modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 21.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27.\" SUCH DAMAGE. 28.\" | 5.\" Copyright (c) 2001-2003 6.\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). 7.\" All rights reserved. 8.\" 9.\" Author: Harti Brandt <harti@freebsd.org> 10.\" 11.\" Redistribution and use in source and binary forms, with or without 12.\" modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 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.\" |
29.\" $Begemot: bsnmp/lib/bsnmplib.3,v 1.6 2005/02/25 11:55:59 brandt_h Exp $ | 32.\" $Begemot: bsnmp/lib/bsnmplib.3,v 1.9 2005/10/04 08:46:51 brandt_h Exp $ |
30.\" | 33.\" |
31.Dd August 15, 2002 | 34.Dd October 4, 2005 |
32.Dt BSNMPLIB 3 33.Os 34.Sh NAME 35.Nm snmp_value_free , 36.Nm snmp_value_parse , 37.Nm snmp_value_copy , 38.Nm snmp_pdu_free , 39.Nm snmp_code snmp_pdu_decode , --- 39 unchanged lines hidden (view full) --- 79 union snmp_values { 80 int32_t integer;/* also integer32 */ 81 struct { 82 u_int len; 83 u_char *octets; 84 } octetstring; 85 struct asn_oid oid; 86 u_char ipaddress[4]; | 35.Dt BSNMPLIB 3 36.Os 37.Sh NAME 38.Nm snmp_value_free , 39.Nm snmp_value_parse , 40.Nm snmp_value_copy , 41.Nm snmp_pdu_free , 42.Nm snmp_code snmp_pdu_decode , --- 39 unchanged lines hidden (view full) --- 82 union snmp_values { 83 int32_t integer;/* also integer32 */ 84 struct { 85 u_int len; 86 u_char *octets; 87 } octetstring; 88 struct asn_oid oid; 89 u_char ipaddress[4]; |
87 u_int32_t uint32; /* also gauge32, counter32, | 90 uint32_t uint32; /* also gauge32, counter32, |
88 unsigned32, timeticks */ | 91 unsigned32, timeticks */ |
89 u_int64_t counter64; | 92 uint64_t counter64; |
90 } v; 91}; 92.Ed 93.Pp | 93 } v; 94}; 95.Ed 96.Pp |
94This structure represents one variable binding from an SNMP PDU. The 95field | 97This structure represents one variable binding from an SNMP PDU. 98The field |
96.Fa var 97is the ASN.1 of the variable that is bound. 98.Fa syntax 99contains either the syntax code of the value or an exception code for SNMPv2 100and may be one of: 101.Bd -literal -offset indent 102enum snmp_syntax { 103 SNMP_SYNTAX_NULL = 0, --- 69 unchanged lines hidden (view full) --- 173}; 174.Ed 175and 176.Fa type 177is the type of the PDU. 178.Pp 179The function 180.Fn snmp_value_free | 99.Fa var 100is the ASN.1 of the variable that is bound. 101.Fa syntax 102contains either the syntax code of the value or an exception code for SNMPv2 103and may be one of: 104.Bd -literal -offset indent 105enum snmp_syntax { 106 SNMP_SYNTAX_NULL = 0, --- 69 unchanged lines hidden (view full) --- 176}; 177.Ed 178and 179.Fa type 180is the type of the PDU. 181.Pp 182The function 183.Fn snmp_value_free |
181is used to free all the dynamic allocated contents of an SNMP value. It does 182not free the structure pointed to by | 184is used to free all the dynamic allocated contents of an SNMP value. 185It does not free the structure pointed to by |
183.Fa value 184itself. 185.Pp 186The function 187.Fn snmp_value_parse 188parses the ASCII representation of an SNMP value into its binary form. 189This function is mainly used by the configuration file reader of | 186.Fa value 187itself. 188.Pp 189The function 190.Fn snmp_value_parse 191parses the ASCII representation of an SNMP value into its binary form. 192This function is mainly used by the configuration file reader of |
190.Xr snmpd 1 . | 193.Xr bsnmpd 1 . |
191.Pp 192The function 193.Fn snmp_value_copy 194makes a deep copy of the value pointed to by 195.Fa from 196to the structure pointed to by 197.Fa to . 198It assumes that 199.Fa to | 194.Pp 195The function 196.Fn snmp_value_copy 197makes a deep copy of the value pointed to by 198.Fa from 199to the structure pointed to by 200.Fa to . 201It assumes that 202.Fa to |
200is uninitialized and will overwrite its previous contents. It does not itself 201allocate the structure pointed to by | 203is uninitialized and will overwrite its previous contents. 204It does not itself allocate the structure pointed to by |
202.Fa to . 203.Pp 204The function 205.Fn snmp_pdu_free | 205.Fa to . 206.Pp 207The function 208.Fn snmp_pdu_free |
206frees all the dynamically allocated components of the PDU. It does not itself 207free the structure pointed to by | 209frees all the dynamically allocated components of the PDU. 210It does not itself free the structure pointed to by |
208.Fa pdu . 209.Pp 210The function 211.Fn snmp_pdu_decode 212decodes the PDU pointed to by 213.Fa buf 214and stores the result into 215.Fa pdu . --- 18 unchanged lines hidden (view full) --- 234takes a C truth value (zero or non-zero) and makes an SNMP truth value (2 or 1). 235The function 236.Fn TRUTH_GET 237takes an SNMP truth value and makes a C truth value (0 or 1). 238The function 239.Fn TRUTH_OK 240checks, whether its argument is a legal SNMP truth value. 241.Sh DIAGNOSTICS | 211.Fa pdu . 212.Pp 213The function 214.Fn snmp_pdu_decode 215decodes the PDU pointed to by 216.Fa buf 217and stores the result into 218.Fa pdu . --- 18 unchanged lines hidden (view full) --- 237takes a C truth value (zero or non-zero) and makes an SNMP truth value (2 or 1). 238The function 239.Fn TRUTH_GET 240takes an SNMP truth value and makes a C truth value (0 or 1). 241The function 242.Fn TRUTH_OK 243checks, whether its argument is a legal SNMP truth value. 244.Sh DIAGNOSTICS |
242When an error occures in any of the function the function pointed to | 245When an error occurs in any of the function the function pointed to |
243by the global pointer 244.Bd -literal -offset indent 245extern void (*snmp_error)(const char *, ...); 246.Ed 247.Pp 248with a 249.Xr printf 3 250style format string. --- 35 unchanged lines hidden (view full) --- 286.Bl -tag -width Er 287.It Bq Er SNMP_CODE_OK 288Success. 289.It Bq Er SNMP_CODE_FAILED 290Encoding failed. 291.El 292.Sh SEE ALSO 293.Xr gensnmptree 1 , | 246by the global pointer 247.Bd -literal -offset indent 248extern void (*snmp_error)(const char *, ...); 249.Ed 250.Pp 251with a 252.Xr printf 3 253style format string. --- 35 unchanged lines hidden (view full) --- 289.Bl -tag -width Er 290.It Bq Er SNMP_CODE_OK 291Success. 292.It Bq Er SNMP_CODE_FAILED 293Encoding failed. 294.El 295.Sh SEE ALSO 296.Xr gensnmptree 1 , |
294.Xr snmpd 1 , | 297.Xr bsnmpd 1 , |
295.Xr bsnmpagent 3 , 296.Xr bsnmpclient 3 , 297.Xr bsnmplib 3 298.Sh STANDARDS 299This implementation conforms to the applicable IETF RFCs and ITU-T 300recommendations. 301.Sh AUTHORS 302.An Hartmut Brandt Aq harti@freebsd.org | 298.Xr bsnmpagent 3 , 299.Xr bsnmpclient 3 , 300.Xr bsnmplib 3 301.Sh STANDARDS 302This implementation conforms to the applicable IETF RFCs and ITU-T 303recommendations. 304.Sh AUTHORS 305.An Hartmut Brandt Aq harti@freebsd.org |