|
1 diff -ur net-snmp-5.4.1.org/agent/helpers/table_tdata.c net-snmp-5.4.1.container/agent/helpers/table_tdata.c |
|
2 --- net-snmp-5.4.1.org/agent/helpers/table_tdata.c 2012-04-02 01:31:08.387259100 -0700 |
|
3 +++ net-snmp-5.4.1.container/agent/helpers/table_tdata.c 2012-04-02 01:58:23.019636200 -0700 |
|
4 @@ -57,9 +57,18 @@ |
|
5 if ( !table ) |
|
6 return NULL; |
|
7 |
|
8 + table->flags = flags; |
|
9 if (name) |
|
10 table->name = strdup(name); |
|
11 - table->container = netsnmp_container_find( "table_container" ); |
|
12 + |
|
13 + if (!(table->flags & TDATA_FLAG_NO_CONTAINER)) { |
|
14 + table->container = netsnmp_container_find( name ); |
|
15 + if (!table->container) |
|
16 + table->container = netsnmp_container_find( "table_container" ); |
|
17 + if (table->container) |
|
18 + table->container->container_name = strdup(name); |
|
19 + } |
|
20 + |
|
21 return table; |
|
22 } |
|
23 |
|
24 diff -ur net-snmp-5.4.1.org/agent/mibgroup/ip-forward-mib/data_access/route_common.c net-snmp-5.4.1.container/agent/mibgroup/ip-forward-mib/data_access/route_common.c |
|
25 --- net-snmp-5.4.1.org/agent/mibgroup/ip-forward-mib/data_access/route_common.c 2012-04-02 01:31:08.334343300 -0700 |
|
26 +++ net-snmp-5.4.1.container/agent/mibgroup/ip-forward-mib/data_access/route_common.c 2012-04-02 02:00:46.671129800 -0700 |
|
27 @@ -47,8 +47,11 @@ |
|
28 |
|
29 DEBUGMSGTL(("access:route:container", "load\n")); |
|
30 |
|
31 - if (NULL == container) |
|
32 + if (NULL == container) { |
|
33 container = netsnmp_container_find("access:_route:table_container"); |
|
34 + if (container) |
|
35 + container->container_name = strdup("_route"); |
|
36 + } |
|
37 if (NULL == container) { |
|
38 snmp_log(LOG_ERR, "no container specified/found for access_route\n"); |
|
39 return NULL; |
|
40 diff -ur net-snmp-5.4.1.org/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c net-snmp-5.4.1.container/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c |
|
41 --- net-snmp-5.4.1.org/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c 2012-04-02 01:31:08.341048100 -0700 |
|
42 +++ net-snmp-5.4.1.container/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c 2012-04-02 02:05:22.940847300 -0700 |
|
43 @@ -2307,9 +2307,12 @@ |
|
44 if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET; |
|
45 |
|
46 inetCidrRouteTable_container_init(&if_ctx->container, if_ctx->cache); |
|
47 - if (NULL == if_ctx->container) |
|
48 + if (NULL == if_ctx->container) { |
|
49 if_ctx->container = |
|
50 netsnmp_container_find("inetCidrRouteTable:table_container"); |
|
51 + if (NULL != if_ctx->container) |
|
52 + if_ctx->container->container_name = strdup("inetCidrRouteTable"); |
|
53 + } |
|
54 if (NULL == if_ctx->container) { |
|
55 snmp_log(LOG_ERR, "error creating container in " |
|
56 "inetCidrRouteTable_container_init\n"); |
|
57 diff -ur net-snmp-5.4.1.org/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.c net-snmp-5.4.1.container/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.c |
|
58 --- net-snmp-5.4.1.org/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.c 2012-04-02 01:31:08.337647600 -0700 |
|
59 +++ net-snmp-5.4.1.container/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.c 2012-04-02 02:08:16.825508200 -0700 |
|
60 @@ -2259,9 +2259,12 @@ |
|
61 if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET; |
|
62 |
|
63 ipCidrRouteTable_container_init(&if_ctx->container, if_ctx->cache); |
|
64 - if (NULL == if_ctx->container) |
|
65 + if (NULL == if_ctx->container) { |
|
66 if_ctx->container = |
|
67 netsnmp_container_find("ipCidrRouteTable:table_container"); |
|
68 + if (NULL != if_ctx->container) |
|
69 + if_ctx->container->container_name = strdup("ipCidrRouteTable"); |
|
70 + } |
|
71 if (NULL == if_ctx->container) { |
|
72 snmp_log(LOG_ERR, "error creating container in " |
|
73 "ipCidrRouteTable_container_init\n"); |
|
74 diff -ur net-snmp-5.4.1.org/agent/mibgroup/ip-mib/data_access/arp_common.c net-snmp-5.4.1.container/agent/mibgroup/ip-mib/data_access/arp_common.c |
|
75 --- net-snmp-5.4.1.org/agent/mibgroup/ip-mib/data_access/arp_common.c 2012-04-02 01:31:08.353034100 -0700 |
|
76 +++ net-snmp-5.4.1.container/agent/mibgroup/ip-mib/data_access/arp_common.c 2012-04-02 02:10:39.120984300 -0700 |
|
77 @@ -62,8 +62,11 @@ |
|
78 |
|
79 DEBUGMSGTL(("access:arp:container", "load\n")); |
|
80 |
|
81 - if (NULL == container) |
|
82 + if (NULL == container) { |
|
83 container = netsnmp_container_find("access:arp:table_container"); |
|
84 + if (container) |
|
85 + container->container_name = strdup("arp"); |
|
86 + } |
|
87 if (NULL == container) { |
|
88 snmp_log(LOG_ERR, "no container specified/found for access_arp\n"); |
|
89 return NULL; |
|
90 diff -ur net-snmp-5.4.1.org/agent/mibgroup/ip-mib/data_access/systemstats_common.c net-snmp-5.4.1.container/agent/mibgroup/ip-mib/data_access/systemstats_common.c |
|
91 --- net-snmp-5.4.1.org/agent/mibgroup/ip-mib/data_access/systemstats_common.c 2012-04-02 01:31:08.353793700 -0700 |
|
92 +++ net-snmp-5.4.1.container/agent/mibgroup/ip-mib/data_access/systemstats_common.c 2012-04-02 02:12:30.680237000 -0700 |
|
93 @@ -96,8 +96,11 @@ |
|
94 |
|
95 DEBUGMSGTL(("access:systemstats:container", "load\n")); |
|
96 |
|
97 - if (NULL == container) |
|
98 + if (NULL == container) { |
|
99 container = netsnmp_access_systemstats_container_init(load_flags); |
|
100 + if (NULL != container) |
|
101 + container->container_name = strdup("systemstats_autocreate"); |
|
102 + } |
|
103 if (NULL == container) { |
|
104 snmp_log(LOG_ERR, "no container specified/found for access_systemstats\n"); |
|
105 return NULL; |
|
106 diff -ur net-snmp-5.4.1.org/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.c net-snmp-5.4.1.container/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.c |
|
107 --- net-snmp-5.4.1.org/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.c 2012-04-02 01:31:08.349583400 -0700 |
|
108 +++ net-snmp-5.4.1.container/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.c 2012-04-02 02:13:41.237688000 -0700 |
|
109 @@ -1935,9 +1935,12 @@ |
|
110 if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET; |
|
111 |
|
112 inetNetToMediaTable_container_init(&if_ctx->container, if_ctx->cache); |
|
113 - if (NULL == if_ctx->container) |
|
114 + if (NULL == if_ctx->container) { |
|
115 if_ctx->container = |
|
116 netsnmp_container_find("inetNetToMediaTable:table_container"); |
|
117 + if (if_ctx->container) |
|
118 + if_ctx->container->container_name = strdup("inetNetToMediaTable"); |
|
119 + } |
|
120 if (NULL == if_ctx->container) { |
|
121 snmp_log(LOG_ERR, "error creating container in " |
|
122 "inetNetToMediaTable_container_init\n"); |
|
123 diff -ur net-snmp-5.4.1.org/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.c net-snmp-5.4.1.container/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.c |
|
124 --- net-snmp-5.4.1.org/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.c 2012-04-02 01:31:08.365565600 -0700 |
|
125 +++ net-snmp-5.4.1.container/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.c 2012-04-02 03:44:15.669526200 -0700 |
|
126 @@ -1251,15 +1251,18 @@ |
|
127 * container init |
|
128 */ |
|
129 ipv4InterfaceTable_container_init(&if_ctx->container); |
|
130 - if (NULL == if_ctx->container) |
|
131 + if (NULL == if_ctx->container) |
|
132 if_ctx->container = |
|
133 netsnmp_container_find("ipv4InterfaceTable:table_container"); |
|
134 + |
|
135 if (NULL == if_ctx->container) { |
|
136 snmp_log(LOG_ERR, "error creating container in " |
|
137 "ipv4InterfaceTable_container_init\n"); |
|
138 return; |
|
139 } |
|
140 |
|
141 + if_ctx->container->container_name = strdup("ipv4InterfaceTable"); |
|
142 + |
|
143 } /* _ipv4InterfaceTable_container_init */ |
|
144 |
|
145 /** |
|
146 diff -ur net-snmp-5.4.1.org/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface.c net-snmp-5.4.1.container/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface.c |
|
147 --- net-snmp-5.4.1.org/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface.c 2012-04-02 01:31:08.363180800 -0700 |
|
148 +++ net-snmp-5.4.1.container/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface.c 2012-04-02 03:45:04.295800900 -0700 |
|
149 @@ -1341,6 +1341,7 @@ |
|
150 "ipv6InterfaceTable_container_init\n"); |
|
151 return; |
|
152 } |
|
153 + if_ctx->container->container_name = strdup("ipv6InterfaceTable"); |
|
154 |
|
155 } /* _ipv6InterfaceTable_container_init */ |
|
156 |
|
157 diff -ur net-snmp-5.4.1.org/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.c net-snmp-5.4.1.container/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.c |
|
158 --- net-snmp-5.4.1.org/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.c 2012-04-02 01:31:08.199286300 -0700 |
|
159 +++ net-snmp-5.4.1.container/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.c 2012-04-02 03:47:50.113861500 -0700 |
|
160 @@ -1731,9 +1731,12 @@ |
|
161 if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET; |
|
162 |
|
163 tcpConnectionTable_container_init(&if_ctx->container, if_ctx->cache); |
|
164 - if (NULL == if_ctx->container) |
|
165 + if (NULL == if_ctx->container) { |
|
166 if_ctx->container = |
|
167 netsnmp_container_find("tcpConnectionTable:table_container"); |
|
168 + if (if_ctx->container) |
|
169 + if_ctx->container->container_name = strdup("tcpConnectionTable"); |
|
170 + } |
|
171 if (NULL == if_ctx->container) { |
|
172 snmp_log(LOG_ERR, "error creating container in " |
|
173 "tcpConnectionTable_container_init\n"); |
|
174 diff -ur net-snmp-5.4.1.org/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.c net-snmp-5.4.1.container/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.c |
|
175 --- net-snmp-5.4.1.org/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.c 2012-04-02 01:31:08.201001900 -0700 |
|
176 +++ net-snmp-5.4.1.container/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.c 2012-04-02 03:48:52.542497400 -0700 |
|
177 @@ -922,9 +922,12 @@ |
|
178 if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET; |
|
179 |
|
180 tcpListenerTable_container_init(&if_ctx->container, if_ctx->cache); |
|
181 - if (NULL == if_ctx->container) |
|
182 + if (NULL == if_ctx->container) { |
|
183 if_ctx->container = |
|
184 netsnmp_container_find("tcpListenerTable:table_container"); |
|
185 + if (if_ctx->container) |
|
186 + if_ctx->container->container_name = strdup("tcpListenerTable"); |
|
187 + } |
|
188 if (NULL == if_ctx->container) { |
|
189 snmp_log(LOG_ERR, "error creating container in " |
|
190 "tcpListenerTable_container_init\n"); |
|
191 diff -ur net-snmp-5.4.1.org/include/net-snmp/agent/table_tdata.h net-snmp-5.4.1.container/include/net-snmp/agent/table_tdata.h |
|
192 --- net-snmp-5.4.1.org/include/net-snmp/agent/table_tdata.h 2012-04-02 01:31:08.444022500 -0700 |
|
193 +++ net-snmp-5.4.1.container/include/net-snmp/agent/table_tdata.h 2012-04-02 23:50:13.830827600 -0700 |
|
194 @@ -21,6 +21,7 @@ |
|
195 #define TABLE_TDATA_TABLE "table_tdata_table" |
|
196 |
|
197 #define TDATA_FLAG_NO_STORE_INDEXES 0x01 |
|
198 +#define TDATA_FLAG_NO_CONTAINER 0x02 /* user will provide container */ |
|
199 |
|
200 /* |
|
201 * The (table-independent) per-row data structure |
|
202 diff -ur net-snmp-5.4.1.org/include/net-snmp/library/container.h net-snmp-5.4.1.container/include/net-snmp/library/container.h |
|
203 --- net-snmp-5.4.1.orig/include/net-snmp/library/container.h 2012-09-13 03:44:03.378177029 -0700 |
|
204 +++ net-snmp-5.4.1.container/include/net-snmp/library/container.h 2012-09-05 12:05:44.822831595 -0700 |
|
205 @@ -373,31 +373,42 @@ |
|
206 */ |
|
207 int CONTAINER_FREE(netsnmp_container *x); |
|
208 #else |
|
209 - /*------------------------------------------------------------------ |
|
210 - * These functions should EXACTLY match the function version in |
|
211 - * container.c. If you change one, change them both. |
|
212 - */ |
|
213 - NETSNMP_STATIC_INLINE /* gcc docs recommend static w/inline */ |
|
214 - int CONTAINER_INSERT(netsnmp_container *x, const void *k) |
|
215 - { |
|
216 - int rc2, rc = 0; |
|
217 - |
|
218 - /** start at first container */ |
|
219 - while(x->prev) |
|
220 - x = x->prev; |
|
221 - for(; x; x = x->next) { |
|
222 - if ((NULL != x->insert_filter) && |
|
223 - (x->insert_filter(x,k) == 1)) |
|
224 - continue; |
|
225 - rc2 = x->insert(x,k); |
|
226 - if (rc2) { |
|
227 - snmp_log(LOG_DEBUG,"error on subcontainer '%s' insert (%d)\n", |
|
228 - x->container_name ? x->container_name : "", rc2); |
|
229 - rc = rc2; |
|
230 - } |
|
231 - } |
|
232 - return rc; |
|
233 - } |
|
234 + /*------------------------------------------------------------------ |
|
235 + * These functions should EXACTLY match the function version in |
|
236 + * container.c. If you change one, change them both. |
|
237 + */ |
|
238 + NETSNMP_STATIC_INLINE /* gcc docs recommend static w/inline */ |
|
239 + int CONTAINER_INSERT_HELPER(netsnmp_container* x, const void* k) |
|
240 + { |
|
241 + while(x && x->insert_filter && x->insert_filter(x,k) == 1) |
|
242 + x = x->next; |
|
243 + if(x) { |
|
244 + int rc = x->insert(x,k); |
|
245 + if(rc) |
|
246 + snmp_log(LOG_ERR,"error on subcontainer '%s' insert (%d)\n", |
|
247 + x->container_name ? x->container_name : "", rc); |
|
248 + else { |
|
249 + rc = CONTAINER_INSERT_HELPER(x->next, k); |
|
250 + if(rc) |
|
251 + x->remove(x,k); |
|
252 + } |
|
253 + return rc; |
|
254 + } |
|
255 + return 0; |
|
256 + } |
|
257 + |
|
258 + /*------------------------------------------------------------------ |
|
259 + * These functions should EXACTLY match the function version in |
|
260 + * container.c. If you change one, change them both. |
|
261 + */ |
|
262 + NETSNMP_STATIC_INLINE /* gcc docs recommend static w/inline */ |
|
263 + int CONTAINER_INSERT(netsnmp_container* x, const void* k) |
|
264 + { |
|
265 + /** start at first container */ |
|
266 + while(x->prev) |
|
267 + x = x->prev; |
|
268 + return CONTAINER_INSERT_HELPER(x, k); |
|
269 + } |
|
270 |
|
271 /*------------------------------------------------------------------ |
|
272 * These functions should EXACTLY match the function version in |
|
273 diff -ur net-snmp-5.4.1.org/snmplib/container.c net-snmp-5.4.1.container/snmplib/container.c |
|
274 --- net-snmp-5.4.1/snmplib/container.c 2012-09-13 03:44:03.380247622 -0700 |
|
275 +++ net-snmp-5.4.1.container/snmplib/container.c 2012-09-13 03:33:19.759881202 -0700 |
|
276 @@ -49,7 +49,8 @@ |
|
277 */ |
|
278 containers = netsnmp_container_get_binary_array(); |
|
279 containers->compare = netsnmp_compare_cstring; |
|
280 - |
|
281 + containers->container_name = strdup("container list"); |
|
282 + |
|
283 /* |
|
284 * register containers |
|
285 */ |
|
286 @@ -265,25 +266,34 @@ |
|
287 * These functions should EXACTLY match the inline version in |
|
288 * container.h. If you change one, change them both. |
|
289 */ |
|
290 -int CONTAINER_INSERT(netsnmp_container *x, const void *k) |
|
291 -{ |
|
292 - int rc2, rc = 0; |
|
293 - |
|
294 - /** start at first container */ |
|
295 +int CONTAINER_INSERT_HELPER(netsnmp_container* x, const void* k) |
|
296 +{ |
|
297 + while(x && x->insert_filter && x->insert_filter(x,k) == 1) |
|
298 + x = x->next; |
|
299 + if(x) { |
|
300 + int rc = x->insert(x,k); |
|
301 + if(rc) |
|
302 + snmp_log(LOG_DEBUG,"error on subcontainer '%s' insert (%d)\n", |
|
303 + x->container_name ? x->container_name : "", rc); |
|
304 + else { |
|
305 + rc = CONTAINER_INSERT_HELPER(x->next, k); |
|
306 + if(rc) |
|
307 + x->remove(x,k); |
|
308 + } |
|
309 + return rc; |
|
310 + } |
|
311 + return 0; |
|
312 + } |
|
313 + |
|
314 +/*------------------------------------------------------------------ |
|
315 + * These functions should EXACTLY match the inline version in |
|
316 + * container.h. If you change one, change them both. |
|
317 + */ |
|
318 +int CONTAINER_INSERT(netsnmp_container* x, const void* k) |
|
319 +{ |
|
320 while(x->prev) |
|
321 - x = x->prev; |
|
322 - for(; x; x = x->next) { |
|
323 - if ((NULL != x->insert_filter) && |
|
324 - (x->insert_filter(x,k) == 1)) |
|
325 - continue; |
|
326 - rc2 = x->insert(x,k); |
|
327 - if (rc2) { |
|
328 - snmp_log(LOG_DEBUG,"error on subcontainer '%s' insert (%d)\n", |
|
329 - x->container_name ? x->container_name : "", rc2); |
|
330 - rc = rc2; |
|
331 - } |
|
332 - } |
|
333 - return rc; |
|
334 + x = x->prev; |
|
335 + return CONTAINER_INSERT_HELPER(x, k); |
|
336 } |
|
337 |
|
338 /*------------------------------------------------------------------ |
|
339 diff -ur net-snmp-5.4.1.org/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c net-snmp-5.4.1.container/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c |
|
340 --- net-snmp-5.4.1.orig/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c 2007-05-17 14:53:28.000000000 -0700 |
|
341 +++ net-snmp-5.4.1.container/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c 2012-09-13 03:45:25.253102053 -0700 |
|
342 @@ -134,6 +134,7 @@ |
|
343 *container_ptr_ptr = |
|
344 netsnmp_container_find("ipAddressTable:table_container"); |
|
345 if (NULL != *container_ptr_ptr) { |
|
346 + (*container_ptr_ptr)->container_name = strdup("ipAddressTable"); |
|
347 ipAddressTable_container_load(*container_ptr_ptr); |
|
348 CONTAINER_FOR_EACH(*container_ptr_ptr, |
|
349 (netsnmp_container_obj_func *) _clear_times, |
|
350 @@ -344,56 +345,58 @@ |
|
351 * what we've already got, and make any adjustments, saving |
|
352 * missing addresses to be deleted. |
|
353 */ |
|
354 - tmp_ptr[0] = ipaddress_container->next; |
|
355 - tmp_ptr[1] = NULL; |
|
356 - CONTAINER_FOR_EACH(container, (netsnmp_container_obj_func *) |
|
357 - _check_entry_for_updates, tmp_ptr); |
|
358 - |
|
359 - /* |
|
360 - * now add any new interfaces |
|
361 - */ |
|
362 - CONTAINER_FOR_EACH(ipaddress_container, |
|
363 - (netsnmp_container_obj_func *) _add_new_entry, |
|
364 - container); |
|
365 - |
|
366 - /* |
|
367 - * free the container. we've either claimed each entry, or released it, |
|
368 - * so the access function doesn't need to clear the container. |
|
369 - */ |
|
370 - netsnmp_access_ipaddress_container_free(ipaddress_container, |
|
371 - NETSNMP_ACCESS_IPADDRESS_FREE_DONT_CLEAR); |
|
372 - |
|
373 - /* |
|
374 - * remove deleted addresses from table container |
|
375 - */ |
|
376 - if (NULL != tmp_ptr[1]) { |
|
377 - netsnmp_container *tmp_container = |
|
378 - (netsnmp_container *) tmp_ptr[1]; |
|
379 - ipAddressTable_rowreq_ctx *tmp_ctx; |
|
380 - |
|
381 - /* |
|
382 - * this works because the tmp_container is a linked list, |
|
383 - * which can be used like a stack... |
|
384 - */ |
|
385 - while (CONTAINER_SIZE(tmp_container)) { |
|
386 - /* |
|
387 - * get from delete list |
|
388 - */ |
|
389 - tmp_ctx = CONTAINER_FIRST(tmp_container); |
|
390 - |
|
391 - /* |
|
392 - * release context, delete from table container |
|
393 - */ |
|
394 - CONTAINER_REMOVE(container, tmp_ctx); |
|
395 - ipAddressTable_release_rowreq_ctx(tmp_ctx); |
|
396 - |
|
397 - /* |
|
398 - * pop off delete list |
|
399 - */ |
|
400 - CONTAINER_REMOVE(tmp_container, NULL); |
|
401 - } |
|
402 + if(ipaddress_container != NULL) |
|
403 + { |
|
404 + tmp_ptr[0] = ipaddress_container->next; |
|
405 + tmp_ptr[1] = NULL; |
|
406 + CONTAINER_FOR_EACH(container, (netsnmp_container_obj_func *) |
|
407 + _check_entry_for_updates, tmp_ptr); |
|
408 + |
|
409 + /* |
|
410 + * now add any new interfaces |
|
411 + */ |
|
412 + CONTAINER_FOR_EACH(ipaddress_container, |
|
413 + (netsnmp_container_obj_func *) _add_new_entry, |
|
414 + container); |
|
415 + |
|
416 + /* |
|
417 + * free the container. we've either claimed each entry, or released it, |
|
418 + * so the access function doesn't need to clear the container. |
|
419 + */ |
|
420 + netsnmp_access_ipaddress_container_free(ipaddress_container, |
|
421 + NETSNMP_ACCESS_IPADDRESS_FREE_DONT_CLEAR); |
|
422 + |
|
423 + /* |
|
424 + * remove deleted addresses from table container |
|
425 + */ |
|
426 + if (NULL != tmp_ptr[1]) { |
|
427 + netsnmp_container *tmp_container = |
|
428 + (netsnmp_container *) tmp_ptr[1]; |
|
429 + ipAddressTable_rowreq_ctx *tmp_ctx; |
|
430 + |
|
431 + /* |
|
432 + * this works because the tmp_container is a linked list, |
|
433 + * which can be used like a stack... |
|
434 + */ |
|
435 + while (CONTAINER_SIZE(tmp_container)) { |
|
436 + /* |
|
437 + * get from delete list |
|
438 + */ |
|
439 + tmp_ctx = CONTAINER_FIRST(tmp_container); |
|
440 + |
|
441 + /* |
|
442 + * release context, delete from table container |
|
443 + */ |
|
444 + CONTAINER_REMOVE(container, tmp_ctx); |
|
445 + ipAddressTable_release_rowreq_ctx(tmp_ctx); |
|
446 + |
|
447 + /* |
|
448 + * pop off delete list |
|
449 + */ |
|
450 + CONTAINER_REMOVE(tmp_container, NULL); |
|
451 + } |
|
452 + } |
|
453 } |
|
454 - |
|
455 DEBUGMSGT(("verbose:ipAddressTable:ipAddressTable_cache_load", |
|
456 "%d records\n", CONTAINER_SIZE(container))); |
|
457 |