Revert "Revert "and added files""
[bcm963xx.git] / userapps / opensource / net-snmp / snmplib / ucd_compat.c
1 /*
2  * For compatibility with applications built using
3  * previous versions of the UCD library only.
4  */
5
6 #include <net-snmp/net-snmp-config.h>
7
8 #include <net-snmp/types.h>
9 #include <net-snmp/session_api.h>
10 #include <net-snmp/config_api.h>
11 #include <net-snmp/library/mib.h>       /* for OID O/P format enums */
12
13 #ifdef BRCM_SNMP_NOT_USED
14 /*
15  * use <netsnmp_session *)->s_snmp_errno instead 
16  */
17 int
18 snmp_get_errno(void)
19 {
20     return SNMPERR_SUCCESS;
21 }
22
23 /*
24  * synch_reset and synch_setup are no longer used. 
25  */
26 void
27 snmp_synch_reset(netsnmp_session * notused)
28 {
29 }
30 void
31 snmp_synch_setup(netsnmp_session * notused)
32 {
33 }
34 #endif /* BRCM_SNMP_NOT_USED */
35
36 void
37 snmp_set_dump_packet(int x)
38 {
39     netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, 
40                            NETSNMP_DS_LIB_DUMP_PACKET, x);
41 }
42
43 #ifdef BRCM_SNMP_NOT_USED
44 int
45 snmp_get_dump_packet(void)
46 {
47     return netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, 
48                                   NETSNMP_DS_LIB_DUMP_PACKET);
49 }
50 #endif
51 void
52 snmp_set_quick_print(int x)
53 {
54     netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, 
55                            NETSNMP_DS_LIB_QUICK_PRINT, x);
56 }
57
58 #ifdef BRCM_SNMP_NOT_USED
59 int
60 snmp_get_quick_print(void)
61 {
62     return netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, 
63                                   NETSNMP_DS_LIB_QUICK_PRINT);
64 }
65
66
67 void
68 snmp_set_suffix_only(int x)
69 {
70     netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID,
71                        NETSNMP_DS_LIB_OID_OUTPUT_FORMAT, x);
72 }
73
74 int
75 snmp_get_suffix_only(void)
76 {
77     return netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID,
78                               NETSNMP_DS_LIB_OID_OUTPUT_FORMAT);
79 }
80
81 void
82 snmp_set_full_objid(int x)
83 {
84     netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
85                                               NETSNMP_OID_OUTPUT_FULL);
86 }
87
88 int
89 snmp_get_full_objid(void)
90 {
91     return (NETSNMP_OID_OUTPUT_FULL ==
92         netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT));
93 }
94
95 void
96 snmp_set_random_access(int x)
97 {
98     netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, 
99                            NETSNMP_DS_LIB_RANDOM_ACCESS, x);
100 }
101
102 int
103 snmp_get_random_access(void)
104 {
105     return netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, 
106                                   NETSNMP_DS_LIB_RANDOM_ACCESS);
107 }
108
109 void
110 snmp_set_mib_errors(int err)
111 {
112     netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, 
113                            NETSNMP_DS_LIB_MIB_ERRORS, err);
114 }
115
116 void
117 snmp_set_mib_warnings(int warn)
118 {
119     netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, 
120                        NETSNMP_DS_LIB_MIB_WARNINGS, warn);
121 }
122
123 void
124 snmp_set_save_descriptions(int save)
125 {
126     netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, 
127                            NETSNMP_DS_LIB_SAVE_MIB_DESCRS, save);
128 }
129
130 void
131 snmp_set_mib_comment_term(int save)
132 {
133     /*
134      * 0=strict, 1=EOL terminated 
135      */
136     netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, 
137                            NETSNMP_DS_LIB_MIB_COMMENT_TERM, save);
138 }
139
140 void
141 snmp_set_mib_parse_label(int save)
142 {
143     /*
144      * 0=strict, 1=underscore OK in label 
145      */
146     netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, 
147                            NETSNMP_DS_LIB_MIB_PARSE_LABEL, save);
148 }
149
150 int
151 ds_set_boolean          (int storeid, int which, int value)
152 {
153   return netsnmp_ds_set_boolean(storeid, which, value);
154 }
155
156 int
157 ds_get_boolean          (int storeid, int which)
158 {
159   return netsnmp_ds_get_boolean(storeid, which);
160 }
161
162 int
163 ds_toggle_boolean       (int storeid, int which)
164 {
165   return netsnmp_ds_toggle_boolean(storeid, which);
166 }
167
168 int
169 ds_set_int              (int storeid, int which, int value)
170 {
171   return netsnmp_ds_set_int(storeid, which, value);
172 }
173
174 int
175 ds_get_int              (int storeid, int which)
176 {
177   return netsnmp_ds_get_int(storeid, which);
178 }
179
180
181 int
182 ds_set_string           (int storeid, int which, const char *value)
183 {
184   return netsnmp_ds_set_string(storeid, which, value);
185 }
186
187 char *
188 ds_get_string           (int storeid, int which)
189 {
190   return netsnmp_ds_get_string(storeid, which);
191 }
192
193 int
194 ds_set_void             (int storeid, int which, void *value)
195 {
196   return netsnmp_ds_set_void(storeid, which, value);
197 }
198
199 void *
200 ds_get_void             (int storeid, int which)
201 {
202   return netsnmp_ds_get_void(storeid, which);
203 }
204
205 int
206 ds_register_config      (u_char type, const char *ftype,
207                          const char *token, int storeid, int which)
208 {
209   return netsnmp_ds_register_config(type, ftype, token, storeid, which);
210 }
211
212 int
213 ds_register_premib      (u_char type, const char *ftype,
214                          const char *token, int storeid, int which)
215 {
216   return netsnmp_ds_register_premib(type, ftype, token, storeid, which);
217 }
218
219 void
220 ds_shutdown             (void)
221 {
222   netsnmp_ds_shutdown();
223 }
224
225 #endif /* BRCM_SNMP_NOT_USED */