components/net-snmp/patches/030.7147779.kernel_sunos5.patch
author James Chang <james.c.chang@Oracle.COM>
Fri, 02 Oct 2015 10:50:45 -0700
changeset 4915 48f204cc245c
parent 1121 d7ac717f665d
permissions -rw-r--r--
PSARC/2015/333 EOL of grails 21494758 Removal of GRAILS from Solaris 21494777 Removal of GRAILS man page from Solaris
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1121
d7ac717f665d 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
d7ac717f665d 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
d7ac717f665d 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 @@
d7ac717f665d 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;
d7ac717f665d 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;
d7ac717f665d 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;
d7ac717f665d 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
+ 
d7ac717f665d 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 ... */
d7ac717f665d 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;	
d7ac717f665d 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
 
d7ac717f665d 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) {
d7ac717f665d 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();
d7ac717f665d 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 @@
d7ac717f665d 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) {
d7ac717f665d 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;
d7ac717f665d 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
     }
d7ac717f665d 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);
d7ac717f665d 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) {
d7ac717f665d 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",
d7ac717f665d 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",
d7ac717f665d 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"));
d7ac717f665d 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;
d7ac717f665d 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
-    }
d7ac717f665d 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);
d7ac717f665d 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) {
d7ac717f665d 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",
d7ac717f665d 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"));
d7ac717f665d 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;
d7ac717f665d 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
-    }
d7ac717f665d 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);
d7ac717f665d 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) {
d7ac717f665d 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",
d7ac717f665d 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",
d7ac717f665d 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"));
d7ac717f665d 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;
d7ac717f665d 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
+   
d7ac717f665d 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)
d7ac717f665d 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
+    {
d7ac717f665d 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);
d7ac717f665d 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) {
d7ac717f665d 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",
d7ac717f665d 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"));
d7ac717f665d 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
+        }
d7ac717f665d 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
d7ac717f665d 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
+        {
d7ac717f665d 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);
d7ac717f665d 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) {
d7ac717f665d 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",
d7ac717f665d 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"));
d7ac717f665d 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
+            }
d7ac717f665d 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 {
d7ac717f665d 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) {
d7ac717f665d 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 */
d7ac717f665d 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:
d7ac717f665d 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)
d7ac717f665d 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;
d7ac717f665d 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;
d7ac717f665d 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:
d7ac717f665d 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)
d7ac717f665d 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;
d7ac717f665d 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;
d7ac717f665d 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:
d7ac717f665d 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)
d7ac717f665d 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;
d7ac717f665d 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;
d7ac717f665d 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:
d7ac717f665d 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)
d7ac717f665d 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;
d7ac717f665d 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;
d7ac717f665d 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
d7ac717f665d 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:
d7ac717f665d 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)
d7ac717f665d 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;
d7ac717f665d 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;
d7ac717f665d 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:
d7ac717f665d 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)
d7ac717f665d 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;
d7ac717f665d 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;
d7ac717f665d 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:
d7ac717f665d 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)
d7ac717f665d 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;
d7ac717f665d 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;
d7ac717f665d 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:
d7ac717f665d 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)
d7ac717f665d 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;
d7ac717f665d 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;
d7ac717f665d 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
d7ac717f665d 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
+                    } 
d7ac717f665d 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
+            }
d7ac717f665d 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
+        }
d7ac717f665d 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
     }
d7ac717f665d 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
-
d7ac717f665d 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
+     
d7ac717f665d 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) 
d7ac717f665d 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
+    {
d7ac717f665d 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);
d7ac717f665d 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) {
d7ac717f665d 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",
d7ac717f665d 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",
d7ac717f665d 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"));
d7ac717f665d 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;
d7ac717f665d 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
+        }
d7ac717f665d 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
+        
d7ac717f665d 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);
d7ac717f665d 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) {
d7ac717f665d 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",
d7ac717f665d 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"));
d7ac717f665d 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;
d7ac717f665d 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
+        }
d7ac717f665d 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
+        
d7ac717f665d 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);
d7ac717f665d 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) {
d7ac717f665d 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",
d7ac717f665d 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",
d7ac717f665d 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"));
d7ac717f665d 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;
d7ac717f665d 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
+        }
d7ac717f665d 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
+    } 
d7ac717f665d 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 */
d7ac717f665d 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) {
d7ac717f665d 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 */
d7ac717f665d 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 @@
d7ac717f665d 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
     /*
d7ac717f665d 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 
d7ac717f665d 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
      */
d7ac717f665d 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) {
d7ac717f665d 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;
d7ac717f665d 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 */
d7ac717f665d 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
-    }
d7ac717f665d 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
 
d7ac717f665d 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)
d7ac717f665d 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
+    {
d7ac717f665d 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
+        /*
d7ac717f665d 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
d7ac717f665d 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".
d7ac717f665d 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
+         */
d7ac717f665d 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
+
d7ac717f665d 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) {
d7ac717f665d 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;
d7ac717f665d 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 */
d7ac717f665d 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
+        }
d7ac717f665d 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
+    }
d7ac717f665d 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
+   		
d7ac717f665d 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) {
d7ac717f665d 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;
d7ac717f665d 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 */