author | Huie-Ying Lee <huieying.lee@oracle.com> |
Wed, 20 May 2015 15:14:17 -0700 | |
branch | s11-update |
changeset 4329 | 771a6f41f496 |
parent 3018 | 9bcd8e039f5c |
permissions | -rw-r--r-- |
3018
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
1 |
--- net-snmp-5.4.1.old/snmplib/Makefile.in 2013-08-16 04:02:40.253396400 -0700 |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
2 |
+++ net-snmp-5.4.1/snmplib/Makefile.in 2013-08-01 03:20:45.668713600 -0700 |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
3 |
@@ -182,7 +182,7 @@ |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
4 |
TOBJS=$(LOBJS) |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
5 |
|
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
6 |
# To satisfy -zdefs |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
7 |
-LIB_LD_ADD =-lnsl -lsocket -L$(libdir) |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
8 |
+LIB_LD_ADD =-lnsl -lsocket -ldladm -L$(libdir) |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
9 |
|
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
10 |
# |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
11 |
CPPFLAGS = $(TOP_INCLUDES) -I. $(SNMPLIB_INCLUDES) @CPPFLAGS@ |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
12 |
--- net-snmp-5.4.1.old/agent/mibgroup/kernel_sunos5.c 2014-02-25 06:04:49.253524010 -0500 |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
13 |
+++ net-snmp-5.4.1/agent/mibgroup/kernel_sunos5.c 2014-02-26 05:32:10.697219080 -0500 |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
14 |
@@ -60,6 +60,8 @@ |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
15 |
#include <net/if.h> |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
16 |
#include <netinet/in.h> |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
17 |
|
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
18 |
+#include <libdladm.h> |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
19 |
+#include <libdllink.h> |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
20 |
/*- |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
21 |
* Includes of local application header files |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
22 |
*/ |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
23 |
@@ -172,7 +174,7 @@ |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
24 |
set_if_info(mib2_ifEntry_t *ifp, unsigned index, char *name, uint64_t flags, |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
25 |
boolean_t flags_unknown, int mtu); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
26 |
static int get_if_stats(mib2_ifEntry_t *ifp); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
27 |
- |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
28 |
+static int link_to_phydev(char *link, char *phy_devname); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
29 |
#if defined(HAVE_IF_NAMEINDEX) && defined(NETSNMP_INCLUDE_IFTABLE_REWRITES) |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
30 |
static int _dlpi_open(const char *devname); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
31 |
static int _dlpi_get_phys_address(int fd, char *paddr, int maxlen, |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
32 |
@@ -1724,11 +1726,155 @@ |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
33 |
} |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
34 |
#endif /*defined(HAVE_IF_NAMEINDEX)&&defined(NETSNMP_INCLUDE_IFTABLE_REWRITES)*/ |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
35 |
|
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
36 |
+int link_to_phydev(char *link, char *phy_devname) |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
37 |
+{ |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
38 |
+ char *key = NULL; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
39 |
+ datalink_id_t linkid; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
40 |
+ dladm_phys_attr_t dpa; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
41 |
+ dladm_handle_t handle; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
42 |
+ |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
43 |
+ if (dladm_open(&handle, NULL) != DLADM_STATUS_OK) { |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
44 |
+ DEBUGMSGTL(("kernel_sunos5","dladm_open failed " |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
45 |
+ "with errno=%d\n",errno)); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
46 |
+ return (-1); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
47 |
+ } |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
48 |
+ |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
49 |
+ if (dladm_name2info(handle, link, &linkid, NULL, NULL, NULL) != |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
50 |
+ DLADM_STATUS_OK) { |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
51 |
+ DEBUGMSGTL(("kernel_sunos5","dladm_name2info failed " |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
52 |
+ "with errno=%d\n",errno)); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
53 |
+ dladm_close(handle); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
54 |
+ return (-1); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
55 |
+ } |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
56 |
+ |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
57 |
+ /* |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
58 |
+ * Get the device name of the link, which will be used as the door |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
59 |
+ * file name used to communicate with the driver. |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
60 |
+ */ |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
61 |
+ if (dladm_phys_info(handle, linkid, &dpa, DLADM_OPT_ACTIVE) != |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
62 |
+ DLADM_STATUS_OK) { |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
63 |
+ DEBUGMSGTL(("kernel_sunos5","dladm_phys_info failed " |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
64 |
+ "with errno=%d\n",errno)); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
65 |
+ dladm_close(handle); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
66 |
+ return (-1); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
67 |
+ } |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
68 |
+ |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
69 |
+ if(dpa.dp_dev == NULL) { |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
70 |
+ DEBUGMSGTL(("kernel_sunos5","device name from " |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
71 |
+ "dladm_phys_info = NULL\n")); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
72 |
+ dladm_close(handle); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
73 |
+ return -1; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
74 |
+ |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
75 |
+ } |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
76 |
+ strcpy(phy_devname, dpa.dp_dev); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
77 |
+ dladm_close(handle); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
78 |
+ |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
79 |
+ return 0; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
80 |
+} |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
81 |
+ |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
82 |
+ |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
83 |
+static int getKstatIntInstance(const char *classname, int instance, |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
84 |
+ const char *statname, const char *varname, |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
85 |
+ int *value) |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
86 |
+{ |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
87 |
+ kstat_ctl_t *ksc; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
88 |
+ kstat_t *ks; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
89 |
+ kid_t kid; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
90 |
+ kstat_named_t *named; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
91 |
+ |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
92 |
+ int ret = -1; /* fail unless ... */ |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
93 |
+ int lookup_stat = 0; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
94 |
+ |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
95 |
+ DEBUGMSGTL(("kernel_sunos5","\n Inside getKstatIntInstance: variable = %s", |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
96 |
+ varname)); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
97 |
+ |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
98 |
+ if (kstat_fd == 0) { |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
99 |
+ kstat_fd = kstat_open(); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
100 |
+ if (kstat_fd == 0) { |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
101 |
+ snmp_log_perror("kstat_open"); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
102 |
+ } |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
103 |
+ } |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
104 |
+ if ((ksc = kstat_fd) == NULL) { |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
105 |
+ goto Return; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
106 |
+ } |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
107 |
+ |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
108 |
+ ks = kstat_lookup(ksc, classname, instance, statname); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
109 |
+ if (ks == NULL) { |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
110 |
+ DEBUGMSGTL(("kernel_sunos5","\nclass %s, stat %s not found\n", |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
111 |
+ classname ? classname : "NULL", |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
112 |
+ statname ? statname : "NULL")); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
113 |
+ goto Return; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
114 |
+ } |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
115 |
+ |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
116 |
+ kid = kstat_read(ksc, ks, NULL); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
117 |
+ if (kid == -1) { |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
118 |
+ DEBUGMSGTL(("kernel_sunos5","\ncannot read class %s stats %s\n", |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
119 |
+ classname ? classname : "NULL", |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
120 |
+ statname ? statname : "NULL")); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
121 |
+ goto Return; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
122 |
+ } |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
123 |
+ |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
124 |
+ named = kstat_data_lookup(ks, varname); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
125 |
+ if (named == NULL) { |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
126 |
+ DEBUGMSGTL(("kernel_sunos5","\nno var %s for class %s stat %s\n", |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
127 |
+ varname, classname ? classname : "NULL", |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
128 |
+ statname ? statname : "NULL")); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
129 |
+ goto Return; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
130 |
+ } |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
131 |
+ ret = 0; /* maybe successful */ |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
132 |
+ switch (named->data_type) { |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
133 |
+#ifdef KSTAT_DATA_INT32 /* Solaris 2.6 and up */ |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
134 |
+ case KSTAT_DATA_INT32: |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
135 |
+ DEBUGMSGTL(("kernel_sunos5"," value: %d\n", named->value.i32)); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
136 |
+ *value = named->value.i32; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
137 |
+ break; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
138 |
+ case KSTAT_DATA_UINT32: |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
139 |
+ DEBUGMSGTL(("kernel_sunos5"," value: %u\n", named->value.ui32)); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
140 |
+ *value = named->value.ui32; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
141 |
+ break; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
142 |
+ case KSTAT_DATA_INT64: |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
143 |
+ DEBUGMSGTL(("kernel_sunos5"," value: %ld\n", named->value.i64)); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
144 |
+ *value = named->value.i64; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
145 |
+ break; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
146 |
+ case KSTAT_DATA_UINT64: |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
147 |
+ DEBUGMSGTL(("kernel_sunos5"," value: %llu\n", named->value.ui64)); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
148 |
+ *value = named->value.ui64; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
149 |
+ break; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
150 |
+#else |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
151 |
+ case KSTAT_DATA_LONG: |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
152 |
+ DEBUGMSGTL(("kernel_sunos5"," value: %ld\n", named->value.l)); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
153 |
+ *value = named->value.l; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
154 |
+ break; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
155 |
+ case KSTAT_DATA_ULONG: |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
156 |
+ DEBUGMSGTL(("kernel_sunos5"," value: %lu\n", named->value.ul)); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
157 |
+ *value = named->value.ul; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
158 |
+ break; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
159 |
+ case KSTAT_DATA_LONGLONG: |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
160 |
+ DEBUGMSGTL(("kernel_sunos5"," value: %lld\n", (long) named->value.ll)); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
161 |
+ *value = (long)named->value.ll; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
162 |
+ break; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
163 |
+ case KSTAT_DATA_ULONGLONG: |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
164 |
+ DEBUGMSGTL(("kernel_sunos5"," value: %llu\n", |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
165 |
+ (unsigned long) named->value.ull)); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
166 |
+ *value = (unsigned long)named->value.ull; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
167 |
+ break; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
168 |
+#endif |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
169 |
+ default: |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
170 |
+ ret = -1; /* fail */ |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
171 |
+ break; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
172 |
+ } |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
173 |
+ Return: |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
174 |
+ return ret; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
175 |
+} |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
176 |
+ |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
177 |
static void |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
178 |
set_if_info(mib2_ifEntry_t *ifp, unsigned index, char *name, uint64_t flags, |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
179 |
boolean_t flags_unknown, int mtu) |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
180 |
{ |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
181 |
boolean_t havespeed = B_FALSE; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
182 |
+ char phydevname[100]; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
183 |
+ char devbasename[100]; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
184 |
+ int instance = -1; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
185 |
|
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
186 |
/* |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
187 |
* Set basic information |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
188 |
@@ -1770,6 +1916,16 @@ |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
189 |
/* only UPed interfaces get correct link status - if any */ |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
190 |
if (getKstatInt(NULL, name,"link_up",&i_tmp) == 0) { |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
191 |
ifp->ifOperStatus = i_tmp ? 1 : 2; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
192 |
+ } else if(link_to_phydev(name, phydevname) == 0) { |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
193 |
+ strcpy(devbasename, phydevname); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
194 |
+ DEBUGMSGTL(("kernel_sunos5","phydevname = %s\n", phydevname)); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
195 |
+ _dlpi_parse_devname(devbasename, &instance); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
196 |
+ DEBUGMSGTL(("kernel_sunos5","devbasename = %s, " |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
197 |
+ "instance= %d\n", devbasename, instance)); |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
198 |
+ if(getKstatIntInstance(devbasename, instance, "phys", |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
199 |
+ "link_up", &i_tmp) == 0) { |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
200 |
+ ifp->ifOperStatus = i_tmp ? 1 : 2; |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
201 |
+ } |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
202 |
#ifdef IFF_FAILED |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
203 |
} else if (flags & IFF_FAILED) { |
9bcd8e039f5c
16032482 Net-SNMP ifOperStatus on solaris11 VM guest domain is not correct.
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
204 |
/* |