and added files
[bcm963xx.git] / userapps / opensource / net-snmp / include / net-snmp / library / snmp_client.h
1 /*
2  * snmp_client.h
3  */
4 /***********************************************************
5         Copyright 1988, 1989 by Carnegie Mellon University
6
7                       All Rights Reserved
8
9 Permission to use, copy, modify, and distribute this software and its 
10 documentation for any purpose and without fee is hereby granted, 
11 provided that the above copyright notice appear in all copies and that
12 both that copyright notice and this permission notice appear in 
13 supporting documentation, and that the name of CMU not be
14 used in advertising or publicity pertaining to distribution of the
15 software without specific, written prior permission.  
16
17 CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
18 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
19 CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
20 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
21 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
22 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
23 SOFTWARE.
24 ******************************************************************/
25
26 #ifndef SNMP_CLIENT_H
27 #define SNMP_CLIENT_H
28
29 #ifdef __cplusplus
30 extern          "C" {
31 #endif
32
33
34     struct snmp_pdu;
35     struct snmp_session;
36     struct variable_list;
37
38     struct synch_state {
39         int             waiting;
40         int             status;
41         /*
42          * status codes 
43          */
44 #define STAT_SUCCESS    0
45 #define STAT_ERROR      1
46 #define STAT_TIMEOUT 2
47         int             reqid;
48         netsnmp_pdu    *pdu;
49     };
50
51     int             snmp_set_var_value(netsnmp_variable_list *,
52                                        const u_char *, size_t);
53     int             snmp_set_var_objid(netsnmp_variable_list * vp,
54                                        const oid * objid,
55                                        size_t name_length);
56     int             snmp_set_var_typed_value(netsnmp_variable_list *
57                                              newvar, u_char type,
58                                              const u_char * val_str,
59                                              size_t val_len);
60     void            snmp_replace_var_types(netsnmp_variable_list * vbl,
61                                            u_char old_type,
62                                            u_char new_type);
63     void            snmp_reset_var_buffers(netsnmp_variable_list * var);
64     void            snmp_reset_var_types(netsnmp_variable_list * vbl,
65                                          u_char new_type);
66     int             count_varbinds(netsnmp_variable_list * var_ptr);
67     int             count_varbinds_of_type(netsnmp_variable_list * var_ptr,
68                                            u_char type);
69     netsnmp_variable_list *find_varbind_of_type(netsnmp_variable_list *
70                                                 var_ptr, u_char type);
71
72     netsnmp_variable_list *snmp_add_null_var(netsnmp_pdu *, oid *, size_t);
73     netsnmp_pdu    *snmp_pdu_create(int);
74     netsnmp_pdu    *snmp_fix_pdu(netsnmp_pdu *, int);
75     netsnmp_pdu    *snmp_clone_pdu(netsnmp_pdu *);
76     netsnmp_pdu    *snmp_split_pdu(netsnmp_pdu *, int skipCount,
77                                    int copyCount);
78
79     unsigned long   snmp_varbind_len(netsnmp_pdu *pdu);
80     int             snmp_clone_var(netsnmp_variable_list *,
81                                    netsnmp_variable_list *);
82     netsnmp_variable_list *snmp_clone_varbind(netsnmp_variable_list *);
83     const char     *snmp_errstring(int);
84     int             snmp_synch_response(netsnmp_session *, netsnmp_pdu *,
85                                         netsnmp_pdu **);
86     int             snmp_synch_response_cb(netsnmp_session *,
87                                            netsnmp_pdu *, netsnmp_pdu **,
88                                            snmp_callback);
89     int             snmp_clone_mem(void **, void *, unsigned);
90
91     /*
92      * single session API - see snmp_api.h for full details 
93      */
94     int             snmp_sess_synch_response(void *, netsnmp_pdu *,
95                                              netsnmp_pdu **);
96
97 #ifdef __cplusplus
98 }
99 #endif
100 #endif                          /* SNMP_CLIENT_H */