author | pkidd <patrick.kidd@oracle.com> |
Thu, 10 Mar 2016 08:37:16 -0800 | |
branch | s11u3-sru |
changeset 5572 | 9eae79cfd382 |
parent 2503 | 6b4484a2388e |
permissions | -rw-r--r-- |
2503
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
1 |
--- net-snmp-5.4.1.orig/agent/mibgroup/kernel_sunos5.c 2013-01-11 11:46:28.795419820 -0800 |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
2 |
+++ net-snmp-5.4.1/agent/mibgroup/kernel_sunos5.c 2013-01-11 11:45:51.611042099 -0800 |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
3 |
@@ -280,7 +280,9 @@ |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
4 |
kstat_t *ks; |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
5 |
kid_t kid; |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
6 |
kstat_named_t *named; |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
7 |
+ |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
8 |
int ret = -1; /* fail unless ... */ |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
9 |
+ int lookup_stat = 0; |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
10 |
|
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
11 |
if (kstat_fd == 0) { |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
12 |
kstat_fd = kstat_open(); |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
13 |
@@ -291,27 +293,88 @@ |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
14 |
if ((ksc = kstat_fd) == NULL) { |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
15 |
goto Return; |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
16 |
} |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
17 |
- ks = kstat_lookup(ksc, classname, -1, statname); |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
18 |
- if (ks == NULL) { |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
19 |
- DEBUGMSGTL(("kernel_sunos5", "class %s, stat %s not found\n", |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
20 |
- classname ? classname : "NULL", |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
21 |
- statname ? statname : "NULL")); |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
22 |
- goto Return; |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
23 |
- } |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
24 |
- kid = kstat_read(ksc, ks, NULL); |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
25 |
- if (kid == -1) { |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
26 |
- DEBUGMSGTL(("kernel_sunos5", "cannot read class %s stats %s\n", |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
27 |
- classname ? classname : "NULL", statname ? statname : "NULL")); |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
28 |
- goto Return; |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
29 |
- } |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
30 |
- named = kstat_data_lookup(ks, varname); |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
31 |
- if (named == NULL) { |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
32 |
- DEBUGMSGTL(("kernel_sunos5", "no var %s for class %s stat %s\n", |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
33 |
- varname, classname ? classname : "NULL", |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
34 |
- statname ? statname : "NULL")); |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
35 |
- goto Return; |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
36 |
+ |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
37 |
+ if ((ks = kstat_lookup(ksc, statname, 0, "link")) != NULL) |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
38 |
+ { |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
39 |
+ kid = kstat_read(ksc, ks, NULL); |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
40 |
+ if (kid == -1) { |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
41 |
+ DEBUGMSGTL(("kernel_sunos5", "cannot read class %s stats %s\n", |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
42 |
+ statname ? statname : "NULL", "link")); |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
43 |
+ } |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
44 |
+ else |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
45 |
+ { |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
46 |
+ named = kstat_data_lookup(ks, varname); |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
47 |
+ if (named == NULL) { |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
48 |
+ DEBUGMSGTL(("kernel_sunos5", "no var %s for class %s stat %s\n", |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
49 |
+ varname, statname ? statname : "NULL", "link")); |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
50 |
+ } |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
51 |
+ else { |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
52 |
+ switch (named->data_type) { |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
53 |
+#ifdef KSTAT_DATA_INT32 /* Solaris 2.6 and up */ |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
54 |
+ case KSTAT_DATA_INT32: |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
55 |
+ if(named->value.i32) |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
56 |
+ lookup_stat = 1; |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
57 |
+ break; |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
58 |
+ case KSTAT_DATA_UINT32: |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
59 |
+ if(named->value.ui32) |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
60 |
+ lookup_stat = 1; |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
61 |
+ break; |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
62 |
+ case KSTAT_DATA_INT64: |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
63 |
+ if(named->value.i64) |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
64 |
+ lookup_stat = 1; |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
65 |
+ break; |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
66 |
+ case KSTAT_DATA_UINT64: |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
67 |
+ if(named->value.ui64) |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
68 |
+ lookup_stat = 1; |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
69 |
+ break; |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
70 |
+#else |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
71 |
+ case KSTAT_DATA_LONG: |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
72 |
+ if(named->value.l) |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
73 |
+ lookup_stat = 1; |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
74 |
+ break; |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
75 |
+ case KSTAT_DATA_ULONG: |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
76 |
+ if(named->value.ul) |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
77 |
+ lookup_stat = 1; |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
78 |
+ break; |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
79 |
+ case KSTAT_DATA_LONGLONG: |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
80 |
+ if(named->value.ll) |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
81 |
+ lookup_stat = 1; |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
82 |
+ break; |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
83 |
+ case KSTAT_DATA_ULONGLONG: |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
84 |
+ if(named->value.ull) |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
85 |
+ lookup_stat = 1; |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
86 |
+ break; |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
87 |
+#endif |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
88 |
+ } |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
89 |
+ } |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
90 |
+ } |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
91 |
} |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
92 |
- |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
93 |
+ |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
94 |
+ if(!lookup_stat) |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
95 |
+ { |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
96 |
+ ks = kstat_lookup(ksc, classname, -1, statname); |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
97 |
+ if (ks == NULL) { |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
98 |
+ DEBUGMSGTL(("kernel_sunos5", "class %s, stat %s not found\n", |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
99 |
+ classname ? classname : "NULL", |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
100 |
+ statname ? statname : "NULL")); |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
101 |
+ goto Return; |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
102 |
+ } |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
103 |
+ |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
104 |
+ kid = kstat_read(ksc, ks, NULL); |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
105 |
+ if (kid == -1) { |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
106 |
+ DEBUGMSGTL(("kernel_sunos5", "cannot read class %s stats %s\n", |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
107 |
+ classname ? classname : "NULL", statname ? statname : "NULL")); |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
108 |
+ goto Return; |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
109 |
+ } |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
110 |
+ |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
111 |
+ named = kstat_data_lookup(ks, varname); |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
112 |
+ if (named == NULL) { |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
113 |
+ DEBUGMSGTL(("kernel_sunos5", "no var %s for class %s stat %s\n", |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
114 |
+ varname, classname ? classname : "NULL", |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
115 |
+ statname ? statname : "NULL")); |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
116 |
+ goto Return; |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
117 |
+ } |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
118 |
+ } |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
119 |
ret = 0; /* maybe successful */ |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
120 |
switch (named->data_type) { |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
121 |
#ifdef KSTAT_DATA_INT32 /* Solaris 2.6 and up */ |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
122 |
@@ -428,11 +491,20 @@ |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
123 |
/* |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
124 |
* Get the named statistics |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
125 |
*/ |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
126 |
- if ((ks = kstat_lookup(ksc, module_name, instance, statname)) == NULL) { |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
127 |
- ret = -10; |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
128 |
- goto Return; /* kstat errors */ |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
129 |
- } |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
130 |
|
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
131 |
+ if ((ks = kstat_lookup(ksc, module_name, instance, statname)) == NULL) |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
132 |
+ { |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
133 |
+ /* |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
134 |
+ * Try to lookup the kstat module with |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
135 |
+ * modulename = linkname and statname = "link". |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
136 |
+ */ |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
137 |
+ |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
138 |
+ if ((ks = kstat_lookup(ksc, statname, 0, "link")) == NULL) { |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
139 |
+ ret = -10; |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
140 |
+ goto Return; /* kstat errors */ |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
141 |
+ } |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
142 |
+ } |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
143 |
+ |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
144 |
if (kstat_read(ksc, ks, NULL) <= 0) { |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
145 |
ret = -10; |
6b4484a2388e
15774567 SUNBT7147779 net-snmp does not show all ifTable values for vlan interfaces
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
146 |
goto Return; /* kstat errors */ |