ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/src/libstatgrab/network_stats.c
(Generate patch)

Comparing projects/libstatgrab/src/libstatgrab/network_stats.c (file contents):
Revision 1.6 by pajs, Fri Mar 7 11:56:44 2003 UTC vs.
Revision 1.7 by pajs, Tue Mar 11 14:30:39 2003 UTC

# Line 107 | Line 107 | network_stat_t *get_network_stats(int *entries){
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                          }
# Line 117 | Line 127 | network_stat_t *get_network_stats(int *entries){
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                          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines