107 |
|
if (!strcmp(ksp->ks_class, "net")) { |
108 |
|
kstat_read(kc, ksp, NULL); |
109 |
|
|
110 |
< |
if((knp=kstat_data_lookup(ksp, "rbytes64"))==NULL){ |
110 |
> |
#ifdef SOL7 |
111 |
> |
#define RLOOKUP "rbytes" |
112 |
> |
#define WLOOKUP "obytes" |
113 |
> |
#define VALTYPE value.ui32 |
114 |
> |
#else |
115 |
> |
#define RLOOKUP "rbytes64" |
116 |
> |
#define WLOOKUP "obytes64" |
117 |
> |
#define VALTYPE value.ui64 |
118 |
> |
#endif |
119 |
> |
|
120 |
> |
if((knp=kstat_data_lookup(ksp, RLOOKUP))==NULL){ |
121 |
|
/* Not a network interface, so skip to the next entry */ |
122 |
|
continue; |
123 |
|
} |
127 |
|
return NULL; |
128 |
|
} |
129 |
|
network_stat_ptr=network_stats+interfaces; |
130 |
< |
network_stat_ptr->rx=knp->value.ui64; |
130 |
> |
network_stat_ptr->rx=knp->VALTYPE; |
131 |
|
|
132 |
< |
if((knp=kstat_data_lookup(ksp, "obytes64"))==NULL){ |
132 |
> |
if((knp=kstat_data_lookup(ksp, WLOOKUP))==NULL){ |
133 |
|
/* Not a network interface, so skip to the next entry */ |
134 |
|
continue; |
135 |
|
} |
136 |
< |
network_stat_ptr->tx=knp->value.ui64; |
136 |
> |
network_stat_ptr->tx=knp->VALTYPE; |
137 |
|
if(network_stat_ptr->interface_name!=NULL){ |
138 |
|
free(network_stat_ptr->interface_name); |
139 |
|
} |