|
1 Index: net-snmp/include/net-snmp/system/solaris.h |
|
2 =================================================================== |
|
3 --- net-snmp/include/net-snmp/system/solaris.h (revision 16435) |
|
4 +++ net-snmp/include/net-snmp/system/solaris.h (revision 16436) |
|
5 @@ -38,3 +38,10 @@ |
|
6 |
|
7 /* Solaris 7+ */ |
|
8 #define NETSNMP_DONT_USE_NLIST 1 |
|
9 + |
|
10 +/* |
|
11 + * NEW_MIB_COMPLIANT is a define used in Solaris 10U4+ to enable additional |
|
12 + * MIB information (it affects the structs in <inet/mib2.h> |
|
13 + */ |
|
14 + |
|
15 +#define NEW_MIB_COMPLIANT |
|
16 Index: net-snmp/configure.in |
|
17 =================================================================== |
|
18 --- net-snmp/configure.in (revision 16435) |
|
19 +++ net-snmp/configure.in (revision 16436) |
|
20 @@ -1339,8 +1339,9 @@ |
|
21 AC_CHECK_TYPES([off64_t]) |
|
22 AC_CHECK_TYPES([uintptr_t, intptr_t]) |
|
23 |
|
24 -# solaris specific type |
|
25 +# solaris specific types |
|
26 AC_CHECK_TYPES([Counter64],,,[#include <inet/mib2.h>]) |
|
27 +AC_CHECK_TYPES([mib2_ipIfStatsEntry_t],,,[#include <inet/mib2.h>]) |
|
28 |
|
29 # guess IPv6 stack type. |
|
30 if test "x$enable_ipv6" = "xyes"; then |
|
31 Index: net-snmp/agent/mibgroup/kernel_sunos5.h |
|
32 =================================================================== |
|
33 --- net-snmp/agent/mibgroup/kernel_sunos5.h (revision 16435) |
|
34 +++ net-snmp/agent/mibgroup/kernel_sunos5.h (revision 16436) |
|
35 @@ -71,7 +71,11 @@ |
|
36 MIB_TRANSMISSION = 14, |
|
37 MIB_SNMP = 15, |
|
38 #ifdef SOLARIS_HAVE_IPV6_MIB_SUPPORT |
|
39 - MIB_IP6_ADDR = 16, |
|
40 +#ifdef SOLARIS_HAVE_RFC4293_SUPPORT |
|
41 + MIB_IP_TRAFFIC_STATS, |
|
42 +#endif |
|
43 + MIB_IP6, |
|
44 + MIB_IP6_ADDR, |
|
45 MIB_TCP6_CONN, |
|
46 MIB_UDP6_ENDPOINT, |
|
47 #endif |
|
48 Index: net-snmp/agent/mibgroup/if-mib/data_access/interface_solaris2.c |
|
49 =================================================================== |
|
50 --- net-snmp/agent/mibgroup/if-mib/data_access/interface_solaris2.c (revision 16435) |
|
51 +++ net-snmp/agent/mibgroup/if-mib/data_access/interface_solaris2.c (revision 16436) |
|
52 @@ -3,9 +3,9 @@ |
|
53 */ |
|
54 #include <net-snmp/net-snmp-config.h> |
|
55 #include <net-snmp/net-snmp-includes.h> |
|
56 -#include "mibII/mibII_common.h" |
|
57 #include "if-mib/ifTable/ifTable_constants.h" |
|
58 #include "kernel_sunos5.h" |
|
59 +#include "mibII/mibII_common.h" |
|
60 |
|
61 #include <net-snmp/agent/net-snmp-agent-includes.h> |
|
62 |
|
63 Index: net-snmp/agent/mibgroup/ip-mib/data_access/ipaddress.h |
|
64 =================================================================== |
|
65 --- net-snmp/agent/mibgroup/ip-mib/data_access/ipaddress.h (revision 16435) |
|
66 +++ net-snmp/agent/mibgroup/ip-mib/data_access/ipaddress.h (revision 16436) |
|
67 @@ -20,6 +20,8 @@ |
|
68 config_require(ip-mib/data_access/ipaddress_common) |
|
69 #if defined( linux ) |
|
70 config_require(ip-mib/data_access/ipaddress_linux) |
|
71 +#elif defined( solaris2 ) |
|
72 +config_require(ip-mib/data_access/ipaddress_solaris2) |
|
73 #else |
|
74 config_error(the ipaddress data access library is not available in this environment.) |
|
75 #endif |
|
76 Index: net-snmp/agent/mibgroup/ip-mib/data_access/systemstats.h |
|
77 =================================================================== |
|
78 --- net-snmp/agent/mibgroup/ip-mib/data_access/systemstats.h (revision 16435) |
|
79 +++ net-snmp/agent/mibgroup/ip-mib/data_access/systemstats.h (revision 16436) |
|
80 @@ -20,6 +20,8 @@ |
|
81 config_require(ip-mib/data_access/systemstats_common) |
|
82 #if defined( linux ) |
|
83 config_require(ip-mib/data_access/systemstats_linux) |
|
84 +#elif defined( solaris2 ) |
|
85 +config_require(ip-mib/data_access/systemstats_solaris2) |
|
86 #else |
|
87 config_error(the systemstats data access library is not available in this environment.) |
|
88 #endif |
|
89 Index: net-snmp/agent/mibgroup/mibII.h |
|
90 =================================================================== |
|
91 --- net-snmp/agent/mibgroup/mibII.h (revision 16435) |
|
92 +++ net-snmp/agent/mibgroup/mibII.h (revision 16436) |
|
93 @@ -30,3 +30,10 @@ |
|
94 #if defined( linux ) |
|
95 config_require(ip-mib ip-forward-mib tcp-mib udp-mib) |
|
96 #endif |
|
97 + |
|
98 +/* |
|
99 + * For Solaris, enable additional tables when it has extended MIB support. |
|
100 + */ |
|
101 +#if defined( solaris2 ) && defined( HAVE_MIB2_IPIFSTATSENTRY_T ) |
|
102 +config_require(ip-mib/ipSystemStatsTable ip-mib/ipAddressTable) |
|
103 +#endif |
|
104 Index: net-snmp/agent/mibgroup/kernel_sunos5.c |
|
105 =================================================================== |
|
106 --- net-snmp/agent/mibgroup/kernel_sunos5.c (revision 16435) |
|
107 +++ net-snmp/agent/mibgroup/kernel_sunos5.c (revision 16436) |
|
108 @@ -45,6 +45,7 @@ |
|
109 #include <kstat.h> |
|
110 #include <errno.h> |
|
111 #include <time.h> |
|
112 +#include <ctype.h> |
|
113 |
|
114 #include <sys/sockio.h> |
|
115 #include <sys/socket.h> |
|
116 @@ -103,6 +104,13 @@ |
|
117 {MIB_TRANSMISSION, 0, (void *) -1, 0, 0, 0, 0}, |
|
118 {MIB_SNMP, 0, (void *) -1, 0, 0, 0, 0}, |
|
119 #ifdef SOLARIS_HAVE_IPV6_MIB_SUPPORT |
|
120 +#ifdef SOLARIS_HAVE_RFC4293_SUPPORT |
|
121 + {MIB_IP_TRAFFIC_STATS, 20 * sizeof(mib2_ipIfStatsEntry_t), (void *)-1, 0, |
|
122 + 30, 0, 0}, |
|
123 + {MIB_IP6, 20 * sizeof(mib2_ipIfStatsEntry_t), (void *)-1, 0, 30, 0, 0}, |
|
124 +#else |
|
125 + {MIB_IP6, 20 * sizeof(mib2_ipv6IfStatsEntry_t), (void *)-1, 0, 30, 0, 0}, |
|
126 +#endif |
|
127 {MIB_IP6_ADDR, 20 * sizeof(mib2_ipv6AddrEntry_t), (void *)-1, 0, 30, 0, 0}, |
|
128 {MIB_TCP6_CONN, 1000 * sizeof(mib2_tcp6ConnEntry_t), (void *) -1, 0, 30, |
|
129 0, 0}, |
|
130 @@ -131,6 +139,10 @@ |
|
131 {MIB2_TRANSMISSION, 0,}, |
|
132 {MIB2_SNMP, 0,}, |
|
133 #ifdef SOLARIS_HAVE_IPV6_MIB_SUPPORT |
|
134 +#ifdef SOLARIS_HAVE_RFC4293_SUPPORT |
|
135 + {MIB2_IP, MIB2_IP_TRAFFIC_STATS}, |
|
136 +#endif |
|
137 + {MIB2_IP6, 0}, |
|
138 {MIB2_IP6, MIB2_IP6_ADDR}, |
|
139 {MIB2_TCP6, MIB2_TCP6_CONN}, |
|
140 {MIB2_UDP6, MIB2_UDP6_ENTRY}, |
|
141 @@ -343,7 +355,8 @@ |
|
142 kstat_ctl_t *ksc; |
|
143 kstat_t *ks, *kstat_data; |
|
144 kstat_named_t *d; |
|
145 - size_t i, instance; |
|
146 + uint_t i; |
|
147 + int instance; |
|
148 char module_name[64]; |
|
149 int ret; |
|
150 u_longlong_t val; /* The largest value */ |
|
151 @@ -900,7 +913,11 @@ |
|
152 req = (struct opthdr *)(tor + 1); |
|
153 req->level = groupname; |
|
154 req->name = subgroupname; |
|
155 +#if defined( SOLARIS_HAVE_RFC4293_SUPPORT ) |
|
156 + req->len = 1; /* Used as a flag for S10 to grab extra data */ |
|
157 +#else |
|
158 req->len = 0; |
|
159 +#endif |
|
160 strbuf.len = tor->OPT_length + tor->OPT_offset; |
|
161 flags = 0; |
|
162 if ((rc = putmsg(sd, &strbuf, NULL, flags))) { |