bsnmpagent.3 (133211) | bsnmpagent.3 (142810) |
---|---|
1.\" 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 --- 12 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.\" | 1.\" 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 --- 12 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.\" |
29.\" $Begemot: bsnmp/lib/bsnmpagent.3,v 1.6 2004/08/06 08:46:51 brandt Exp $ | 29.\" $Begemot: bsnmp/lib/bsnmpagent.3,v 1.7 2005/02/25 11:55:58 brandt_h Exp $ |
30.\" 31.Dd August 16, 2002 | 30.\" 31.Dd August 16, 2002 |
32.Dt bsnmpagent 3 | 32.Dt BSNMPAGENT 3 |
33.Os 34.Sh NAME | 33.Os 34.Sh NAME |
35.Nm bsnmpagent | 35.Nm bsnmpagent , |
36.Nm snmp_depop_t , 37.Nm snmp_op_t , 38.Nm tree , 39.Nm tree_size , 40.Nm snmp_trace , 41.Nm snmp_debug , 42.Nm snmp_get , 43.Nm snmp_getnext , --- 151 unchanged lines hidden (view full) --- 195.El 196.Pp 197The easiest way to construct the node table is 198.Xr gensnmptree 1 . 199Note, that one must be careful when changing the tree while executing a SET 200operation. Consult the sources for 201.Xr snmpd 1 . 202.Pp | 36.Nm snmp_depop_t , 37.Nm snmp_op_t , 38.Nm tree , 39.Nm tree_size , 40.Nm snmp_trace , 41.Nm snmp_debug , 42.Nm snmp_get , 43.Nm snmp_getnext , --- 151 unchanged lines hidden (view full) --- 195.El 196.Pp 197The easiest way to construct the node table is 198.Xr gensnmptree 1 . 199Note, that one must be careful when changing the tree while executing a SET 200operation. Consult the sources for 201.Xr snmpd 1 . 202.Pp |
203The global variable | 203The global variable |
204.Va snmp_trace 205together with the function pointed to by 206.Va snmp_debug 207help in debugging the library and the agent. 208.Va snmp_trace is a bit mask with the following bits: 209.Bd -literal -offset indent 210enum { 211 SNMP_TRACE_GET, --- 92 unchanged lines hidden (view full) --- 304For each binding call the node's operation callback with function SNMP_OP_SET. 305The callback may create dependencies or finalizers (see below). For simple 306scalars the scratch area may be enough to handle commit and rollback, for 307interdependend table columns dependencies may be necessary. 308.It 309If the previous step fails at any point, the node's operation callback 310functions are called for all bindings for which SNMP_OP_SET was executed 311with SNMP_OP_ROLLBACK, in the opposite order. This allows all variables to | 204.Va snmp_trace 205together with the function pointed to by 206.Va snmp_debug 207help in debugging the library and the agent. 208.Va snmp_trace is a bit mask with the following bits: 209.Bd -literal -offset indent 210enum { 211 SNMP_TRACE_GET, --- 92 unchanged lines hidden (view full) --- 304For each binding call the node's operation callback with function SNMP_OP_SET. 305The callback may create dependencies or finalizers (see below). For simple 306scalars the scratch area may be enough to handle commit and rollback, for 307interdependend table columns dependencies may be necessary. 308.It 309If the previous step fails at any point, the node's operation callback 310functions are called for all bindings for which SNMP_OP_SET was executed 311with SNMP_OP_ROLLBACK, in the opposite order. This allows all variables to |
312undo the effect of the SET operation. After this all the dependencies | 312undo the effect of the SET operation. After this all the dependencies |
313are freed 314and the finalizers are executed with a fail flag of 1. Then the function 315returns to the caller with an appropriate error indication. 316.It 317If the SET step was successful for all bindings, the dependency callbacks 318are executed in the order in which the dependencies were created with an 319operation of SNMP_DEPOP_COMMIT. If any of the dependencies fails, all the 320committed dependencies are called again in the opposite order --- 19 unchanged lines hidden (view full) --- 340There are to mechanisms to help in complex SET operations: dependencies and 341finalizers. A dependency is used if several bindings depend on each other. 342A typical example is the creation of a conceptual row, which requires 343the setting of several columns to succeed. A dependency is identified by 344two OIDs. In the table case, the first oid is typically the table's base OID 345and the second one the index. Both of these can easily be generated from the 346variables OID with 347.Fn asn_slice_oid . | 313are freed 314and the finalizers are executed with a fail flag of 1. Then the function 315returns to the caller with an appropriate error indication. 316.It 317If the SET step was successful for all bindings, the dependency callbacks 318are executed in the order in which the dependencies were created with an 319operation of SNMP_DEPOP_COMMIT. If any of the dependencies fails, all the 320committed dependencies are called again in the opposite order --- 19 unchanged lines hidden (view full) --- 340There are to mechanisms to help in complex SET operations: dependencies and 341finalizers. A dependency is used if several bindings depend on each other. 342A typical example is the creation of a conceptual row, which requires 343the setting of several columns to succeed. A dependency is identified by 344two OIDs. In the table case, the first oid is typically the table's base OID 345and the second one the index. Both of these can easily be generated from the 346variables OID with 347.Fn asn_slice_oid . |
348The function | 348The function |
349.Fn snmp_dep_lookup 350tries to find a dependency based on these two OIDs and, if it cannot find one 351creates a new one. This means for the table example, that the function 352returns the same dependency for each of the columns of the same table row. 353This allows during the SNMP_OP_SET processing to collect all information 354about the row into the dependency. The arguments to 355.Fn snmp_dep_lookup 356are: the two OIDs to identify the dependency (they are copied into newly --- 37 unchanged lines hidden (view full) --- 394The function 395.Fn snmp_dep_finish 396executes SNMP_DEPOP_FINISH for all dependencies. 397.Sh DIAGNOSTICS 398If an error occures in any of the function an error indication as described 399above is returned. Additionally the functions may call snmp_error on unexected 400errors. 401.Sh SEE ALSO | 349.Fn snmp_dep_lookup 350tries to find a dependency based on these two OIDs and, if it cannot find one 351creates a new one. This means for the table example, that the function 352returns the same dependency for each of the columns of the same table row. 353This allows during the SNMP_OP_SET processing to collect all information 354about the row into the dependency. The arguments to 355.Fn snmp_dep_lookup 356are: the two OIDs to identify the dependency (they are copied into newly --- 37 unchanged lines hidden (view full) --- 394The function 395.Fn snmp_dep_finish 396executes SNMP_DEPOP_FINISH for all dependencies. 397.Sh DIAGNOSTICS 398If an error occures in any of the function an error indication as described 399above is returned. Additionally the functions may call snmp_error on unexected 400errors. 401.Sh SEE ALSO |
402.Xr snmpd 1 , | |
403.Xr gensnmptree 1 , | 402.Xr gensnmptree 1 , |
404.Xr bsnmplib 3 | 403.Xr snmpd 1 , |
405.Xr bsnmpclient 3 , | 404.Xr bsnmpclient 3 , |
405.Xr bsnmplib 3 , |
|
406.Xr snmpmod 3 407.Sh STANDARDS 408This implementation conforms to the applicable IETF RFCs and ITU-T 409recommendations. 410.Sh AUTHORS 411.An Hartmut Brandt Aq harti@freebsd.org | 406.Xr snmpmod 3 407.Sh STANDARDS 408This implementation conforms to the applicable IETF RFCs and ITU-T 409recommendations. 410.Sh AUTHORS 411.An Hartmut Brandt Aq harti@freebsd.org |