author | pkidd <patrick.kidd@oracle.com> |
Thu, 10 Mar 2016 08:37:16 -0800 | |
branch | s11u3-sru |
changeset 5572 | 9eae79cfd382 |
parent 252 | ee0fb1eabcbf |
permissions | -rw-r--r-- |
252
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
1 |
--- net-snmp/include/net-snmp/library/container.h Mon Dec 5 00:13:04 2005 |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
2 |
+++ net-snmp/include/net-snmp/library/container.h Fri Jan 14 17:35:37 2011 |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
3 |
@@ -31,8 +31,16 @@ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
4 |
struct netsnmp_container_s; /** forward declare */ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
5 |
|
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
6 |
/* |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
7 |
- * function returning an int for an operation on a container |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
8 |
+ * function for performing an operation on a container which |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
9 |
+ * returns (maybe the same) container. |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
10 |
*/ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
11 |
+ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
12 |
+ typedef struct netsnmp_container_s* (netsnmp_container_mod_op) |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
13 |
+ (struct netsnmp_container_s *, void *context, u_int flags); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
14 |
+ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
15 |
+ /* |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
16 |
+ * function for setting an option on a container |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
17 |
+ */ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
18 |
typedef int (netsnmp_container_option)(struct netsnmp_container_s *, |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
19 |
int set, u_int flags); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
20 |
|
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
21 |
@@ -192,6 +200,14 @@ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
22 |
netsnmp_container_op *insert_filter; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
23 |
|
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
24 |
/* |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
25 |
+ * OPTIONAL function to duplicate a container. Defaults to a shallow |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
26 |
+ * copy. Only the specified container is copied (i.e. sub-containers |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
27 |
+ * not included). |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
28 |
+ */ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
29 |
+ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
30 |
+ netsnmp_container_mod_op *duplicate; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
31 |
+ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
32 |
+ /* |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
33 |
* function to compare two object stored in the container. |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
34 |
* |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
35 |
* Returns: |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
36 |
@@ -219,11 +235,16 @@ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
37 |
|
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
38 |
/* |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
39 |
* sort count, for iterators to track (insert/delete |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
40 |
- * bumps coutner, invalidates iterator |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
41 |
+ * bumps counter, invalidates iterator) |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
42 |
*/ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
43 |
u_long sync; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
44 |
|
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
45 |
/* |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
46 |
+ * flags |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
47 |
+ */ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
48 |
+ u_int flags; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
49 |
+ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
50 |
+ /* |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
51 |
* containers can contain other containers (additional indexes) |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
52 |
*/ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
53 |
struct netsnmp_container_s *next, *prev; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
54 |
@@ -288,15 +309,15 @@ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
55 |
#define CONTAINER_SET_OPTIONS(x,o,rc) do { \ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
56 |
if (NULL==(x)->options) \ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
57 |
rc = -1; \ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
58 |
- else \ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
59 |
+ else { \ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
60 |
rc = (x)->options(x, 1, o); \ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
61 |
+ if (rc != -1 ) \ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
62 |
+ (x)->flags |= o; \ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
63 |
+ } \ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
64 |
} while(0) |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
65 |
|
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
66 |
#define CONTAINER_CHECK_OPTION(x,o,rc) do { \ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
67 |
- if (NULL==(x)->options) \ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
68 |
- rc = -1; \ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
69 |
- else \ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
70 |
- rc = (x)->options(x,0, o); \ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
71 |
+ rc = x->flags & 0; \ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
72 |
} while(0) |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
73 |
|
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
74 |
|
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
75 |
@@ -335,6 +356,12 @@ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
76 |
int CONTAINER_REMOVE(netsnmp_container *x, const void *k); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
77 |
|
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
78 |
/* |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
79 |
+ * duplicate container |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
80 |
+ */ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
81 |
+ netsnmp_container *CONTAINER_DUP(netsnmp_container *x, void *ctx, |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
82 |
+ u_int flags); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
83 |
+ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
84 |
+ /* |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
85 |
* clear all containers. When clearing the *first* container, and |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
86 |
* *only* the first container, call the function f for each item. |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
87 |
* After calling this function, all containers should be empty. |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
88 |
@@ -364,7 +391,7 @@ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
89 |
continue; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
90 |
rc2 = x->insert(x,k); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
91 |
if (rc2) { |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
92 |
- snmp_log(LOG_ERR,"error on subcontainer '%s' insert (%d)\n", |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
93 |
+ snmp_log(LOG_DEBUG,"error on subcontainer '%s' insert (%d)\n", |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
94 |
x->container_name ? x->container_name : "", rc2); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
95 |
rc = rc2; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
96 |
} |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
97 |
@@ -402,6 +429,22 @@ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
98 |
* container.c. If you change one, change them both. |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
99 |
*/ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
100 |
NETSNMP_STATIC_INLINE /* gcc docs recommend static w/inline */ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
101 |
+ netsnmp_container *CONTAINER_DUP(netsnmp_container *x, void *ctx, |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
102 |
+ u_int flags) |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
103 |
+ { |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
104 |
+ if (NULL == x->duplicate) { |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
105 |
+ snmp_log(LOG_ERR, "container '%s' does not support duplicate\n", |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
106 |
+ x->container_name ? x->container_name : ""); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
107 |
+ return NULL; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
108 |
+ } |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
109 |
+ return x->duplicate(x, ctx, flags); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
110 |
+ } |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
111 |
+ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
112 |
+ /*------------------------------------------------------------------ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
113 |
+ * These functions should EXACTLY match the function version in |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
114 |
+ * container.c. If you change one, change them both. |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
115 |
+ */ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
116 |
+ NETSNMP_STATIC_INLINE /* gcc docs recommend static w/inline */ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
117 |
int CONTAINER_FREE(netsnmp_container *x) |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
118 |
{ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
119 |
int rc2, rc = 0; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
120 |
@@ -474,6 +517,10 @@ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
121 |
} |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
122 |
|
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
123 |
#endif |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
124 |
+ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
125 |
+ /** Duplicate container meta-data. */ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
126 |
+ int netsnmp_container_data_dup(netsnmp_container *dup, |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
127 |
+ netsnmp_container *c); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
128 |
|
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
129 |
/************************************************************************* |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
130 |
* |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
131 |
--- net-snmp/snmplib/container_binary_array.c Wed Aug 23 21:23:22 2006 |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
132 |
+++ net-snmp/snmplib/container_binary_array.c Fri Jan 14 17:35:37 2011 |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
133 |
@@ -36,7 +36,6 @@ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
134 |
typedef struct binary_array_table_s { |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
135 |
size_t max_size; /* Size of the current data table */ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
136 |
size_t count; /* Index of the next free entry */ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
137 |
- u_int flags; /* flags */ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
138 |
int dirty; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
139 |
int data_size; /* Size of an individual entry */ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
140 |
void **data; /* The table itself */ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
141 |
@@ -99,7 +98,7 @@ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
142 |
netsnmp_assert(t!=NULL); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
143 |
netsnmp_assert(c->compare!=NULL); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
144 |
|
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
145 |
- if (t->flags & CONTAINER_KEY_UNSORTED) |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
146 |
+ if (c->flags & CONTAINER_KEY_UNSORTED) |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
147 |
return 0; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
148 |
|
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
149 |
if (t->dirty) { |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
150 |
@@ -204,11 +203,16 @@ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
151 |
int |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
152 |
netsnmp_binary_array_options_set(netsnmp_container *c, int set, u_int flags) |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
153 |
{ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
154 |
- binary_array_table *t = (binary_array_table*)c->container_data; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
155 |
- if (set) |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
156 |
- t->flags = flags; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
157 |
+#define BA_FLAGS (CONTAINER_KEY_ALLOW_DUPLICATES|CONTAINER_KEY_UNSORTED) |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
158 |
+ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
159 |
+ if (set) { |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
160 |
+ if ((flags & BA_FLAGS) == flags) |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
161 |
+ c->flags = flags; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
162 |
+ else |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
163 |
+ flags = (u_int)-1; /* unsupported flag */ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
164 |
+ } |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
165 |
else |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
166 |
- return ((t->flags & flags) == flags); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
167 |
+ return ((c->flags & flags) == flags); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
168 |
return flags; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
169 |
} |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
170 |
|
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
171 |
@@ -371,7 +375,7 @@ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
172 |
/* |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
173 |
* check for duplicates |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
174 |
*/ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
175 |
- if (! (t->flags & CONTAINER_KEY_ALLOW_DUPLICATES)) { |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
176 |
+ if (! (c->flags & CONTAINER_KEY_ALLOW_DUPLICATES)) { |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
177 |
new_data = netsnmp_binary_array_get(c, entry, 1); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
178 |
if (NULL != new_data) { |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
179 |
DEBUGMSGTL(("container","not inserting duplicate key\n")); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
180 |
@@ -579,6 +583,56 @@ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
181 |
return va; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
182 |
} |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
183 |
|
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
184 |
+static netsnmp_container * |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
185 |
+_ba_duplicate(netsnmp_container *c, void *ctx, u_int flags) |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
186 |
+{ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
187 |
+ netsnmp_container *dup; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
188 |
+ binary_array_table *dupt, *t; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
189 |
+ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
190 |
+ if (flags) { |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
191 |
+ snmp_log(LOG_ERR, "binary arry duplicate does not supprt flags yet\n"); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
192 |
+ return NULL; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
193 |
+ } |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
194 |
+ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
195 |
+ dup = netsnmp_container_get_binary_array(); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
196 |
+ if (NULL == dup) { |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
197 |
+ snmp_log(LOG_ERR," no memory for binary array duplicate\n"); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
198 |
+ return NULL; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
199 |
+ } |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
200 |
+ /* |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
201 |
+ * deal with container stuff |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
202 |
+ */ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
203 |
+ if (netsnmp_container_data_dup(dup, c) != 0) { |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
204 |
+ netsnmp_binary_array_release(dup); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
205 |
+ return NULL; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
206 |
+ } |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
207 |
+ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
208 |
+ /* |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
209 |
+ * deal with data |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
210 |
+ */ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
211 |
+ dupt = (binary_array_table*)dup->container_data; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
212 |
+ t = (binary_array_table*)c->container_data; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
213 |
+ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
214 |
+ dupt->max_size = t->max_size; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
215 |
+ dupt->count = t->count; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
216 |
+ dupt->dirty = t->dirty; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
217 |
+ dupt->data_size = t->data_size; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
218 |
+ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
219 |
+ /* |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
220 |
+ * shallow copy |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
221 |
+ */ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
222 |
+ dupt->data = (void**) calloc(dupt->max_size, dupt->data_size); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
223 |
+ if (NULL == dupt->data) { |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
224 |
+ snmp_log(LOG_ERR, "no memory for binary array duplicate\n"); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
225 |
+ netsnmp_binary_array_release(dup); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
226 |
+ return NULL; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
227 |
+ } |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
228 |
+ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
229 |
+ memcpy(dupt->data, t->data, dupt->max_size * dupt->data_size); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
230 |
+ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
231 |
+ return dup; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
232 |
+} |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
233 |
+ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
234 |
netsnmp_container * |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
235 |
netsnmp_container_get_binary_array(void) |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
236 |
{ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
237 |
@@ -592,7 +646,11 @@ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
238 |
} |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
239 |
|
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
240 |
c->container_data = netsnmp_binary_array_initialize(); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
241 |
- |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
242 |
+ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
243 |
+ /* |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
244 |
+ * NOTE: CHANGES HERE MUST BE DUPLICATED IN duplicate AS WELL!! |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
245 |
+ */ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
246 |
+ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
247 |
c->get_size = _ba_size; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
248 |
c->init = NULL; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
249 |
c->cfree = _ba_free; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
250 |
@@ -604,6 +662,7 @@ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
251 |
c->get_iterator = _ba_iterator_get; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
252 |
c->for_each = _ba_for_each; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
253 |
c->clear = _ba_clear; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
254 |
+ c->duplicate = _ba_duplicate; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
255 |
|
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
256 |
return c; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
257 |
} |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
258 |
--- net-snmp/snmplib/container.c Fri Aug 25 15:11:06 2006 |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
259 |
+++ net-snmp/snmplib/container.c Fri Jan 14 17:35:37 2011 |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
260 |
@@ -278,7 +278,7 @@ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
261 |
continue; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
262 |
rc2 = x->insert(x,k); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
263 |
if (rc2) { |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
264 |
- snmp_log(LOG_ERR,"error on subcontainer '%s' insert (%d)\n", |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
265 |
+ snmp_log(LOG_DEBUG,"error on subcontainer '%s' insert (%d)\n", |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
266 |
x->container_name ? x->container_name : "", rc2); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
267 |
rc = rc2; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
268 |
} |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
269 |
@@ -311,6 +311,20 @@ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
270 |
} |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
271 |
|
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
272 |
/*------------------------------------------------------------------ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
273 |
+ * These functions should EXACTLY match the function version in |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
274 |
+ * container.c. If you change one, change them both. |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
275 |
+ */ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
276 |
+netsnmp_container *CONTAINER_DUP(netsnmp_container *x, void *ctx, u_int flags) |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
277 |
+{ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
278 |
+ if (NULL == x->duplicate) { |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
279 |
+ snmp_log(LOG_ERR, "container '%s' does not support duplicate\n", |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
280 |
+ x->container_name ? x->container_name : ""); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
281 |
+ return NULL; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
282 |
+ } |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
283 |
+ return x->duplicate(x, ctx, flags); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
284 |
+} |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
285 |
+ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
286 |
+/*------------------------------------------------------------------ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
287 |
* These functions should EXACTLY match the inline version in |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
288 |
* container.h. If you change one, change them both. |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
289 |
*/ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
290 |
@@ -408,6 +422,24 @@ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
291 |
c->find = fnd; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
292 |
} |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
293 |
|
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
294 |
+int |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
295 |
+netsnmp_container_data_dup(netsnmp_container *dup, netsnmp_container *c) |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
296 |
+{ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
297 |
+ if (!dup || !c) |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
298 |
+ return -1; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
299 |
+ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
300 |
+ if (c->container_name) |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
301 |
+ dup->container_name = strdup(c->container_name); |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
302 |
+ dup->compare = c->compare; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
303 |
+ dup->ncompare = c->ncompare; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
304 |
+ dup->release = c->release; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
305 |
+ dup->insert_filter = c->insert_filter; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
306 |
+ dup->sync = c->sync; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
307 |
+ dup->flags = c->flags; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
308 |
+ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
309 |
+ return 0; |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
310 |
+} |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
311 |
+ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
312 |
/*------------------------------------------------------------------ |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
313 |
* |
ee0fb1eabcbf
7041085 move net-snmp to userland
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
diff
changeset
|
314 |
* simple comparison routines |