diff options
Diffstat (limited to 'contrib/bsnmp/lib/snmpagent.h')
-rw-r--r-- | contrib/bsnmp/lib/snmpagent.h | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/contrib/bsnmp/lib/snmpagent.h b/contrib/bsnmp/lib/snmpagent.h index cd89456..1a26935 100644 --- a/contrib/bsnmp/lib/snmpagent.h +++ b/contrib/bsnmp/lib/snmpagent.h @@ -30,7 +30,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Begemot: bsnmp/lib/snmpagent.h,v 1.10 2003/12/03 09:55:58 hbb Exp $ + * $Begemot: bsnmp/lib/snmpagent.h,v 1.12 2004/04/13 15:18:15 novo Exp $ * * Header file for SNMP functions. This requires snmp.h to be included. */ @@ -39,12 +39,22 @@ struct snmp_dependency; +enum snmp_ret { + /* OK, generate a response */ + SNMP_RET_OK = 0, + /* Error, ignore packet (no response) */ + SNMP_RET_IGN = 1, + /* Error, generate response from original packet */ + SNMP_RET_ERR = 2 +}; + /* Semi-Opaque object for SET operations */ struct snmp_context { u_int var_index; struct snmp_scratch *scratch; struct snmp_dependency *dep; void *data; /* user data */ + enum snmp_ret code; /* return code */ }; struct snmp_scratch { @@ -56,7 +66,8 @@ struct snmp_scratch { enum snmp_depop { SNMP_DEPOP_COMMIT, - SNMP_DEPOP_ROLLBACK + SNMP_DEPOP_ROLLBACK, + SNMP_DEPOP_FINISH }; typedef int (*snmp_depop_t)(struct snmp_context *, struct snmp_dependency *, @@ -68,11 +79,6 @@ struct snmp_dependency { }; /* - * Functions to be called at the end of a SET operation. - */ -typedef void (*snmp_set_finish_t)(struct snmp_context *, int fail, void *); - -/* * The TREE */ enum snmp_node_type { @@ -88,15 +94,6 @@ enum snmp_op { SNMP_OP_ROLLBACK, }; -enum snmp_ret { - /* OK, generate a response */ - SNMP_RET_OK = 0, - /* Error, ignore packet (no response) */ - SNMP_RET_IGN = 1, - /* Error, generate response from original packet */ - SNMP_RET_ERR = 2 -}; - typedef int (*snmp_op_t)(struct snmp_context *, struct snmp_value *, u_int, u_int, enum snmp_op); @@ -109,6 +106,7 @@ struct snmp_node { u_int flags; u_int32_t index; /* index data */ void *data; /* application data */ + void *tree_data; /* application data */ }; extern struct snmp_node *tree; extern u_int tree_size; @@ -150,10 +148,9 @@ enum snmp_ret snmp_make_errresp(const struct snmp_pdu *, struct asn_buf *, struct snmp_dependency *snmp_dep_lookup(struct snmp_context *, const struct asn_oid *, const struct asn_oid *, size_t, snmp_depop_t); -int snmp_set_atfinish(struct snmp_context *, snmp_set_finish_t func, void *arg); - struct snmp_context *snmp_init_context(void); int snmp_dep_commit(struct snmp_context *); int snmp_dep_rollback(struct snmp_context *); +void snmp_dep_finish(struct snmp_context *); #endif |