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.16 by pajs, Tue Aug 26 22:11:57 2003 UTC vs.
Revision 1.21 by ats, Sat Jan 10 16:25:51 2004 UTC

# Line 36 | Line 36
36   #include <regex.h>
37   #include "tools.h"
38   #endif
39 < #ifdef FREEBSD
39 > #ifdef ALLBSD
40   #include <sys/types.h>
41   #include <sys/socket.h>
42   #include <ifaddrs.h>
# Line 101 | Line 101 | network_stat_t *get_network_stats(int *entries){
101          regex_t regex;
102          regmatch_t line_match[4];
103   #endif
104 < #ifdef FREEBSD
104 > #ifdef ALLBSD
105          struct ifaddrs *net, *net_ptr;
106          struct if_data *net_data;
107   #endif
108  
109 < #ifdef FREEBSD
109 > #ifdef ALLBSD
110          if(getifaddrs(&net) != 0){
111                  return NULL;
112          }
# Line 224 | Line 224 | network_stat_t *get_network_stats(int *entries){
224          regfree(&regex);
225  
226   #endif
227 +
228 + #ifdef CYGWIN
229 +        return NULL;
230 + #endif
231 +
232          *entries=interfaces;
233  
234          return network_stats;  
235   }
236  
237   long long transfer_diff(long long new, long long old){
238 < #if defined(SOL7) || defined(LINUX)
239 < #define MAXVAL 4294967296
238 > #if defined(SOL7) || defined(LINUX) || defined(FREEBSD)
239 > #define MAXVAL 4294967296LL
240   #else
241 < #define MAXVAL 18446744073709551616
241 > #define MAXVAL 18446744073709551616LL
242   #endif
243          long long result;
244          if(new>=old){
# Line 279 | Line 284 | network_stat_t *get_network_stats_diff(int *entries){
284                  network_stats_diff_ptr++;
285          }
286          network_stats_ptr=get_network_stats(&ifaces);          
287 +        if (network_stats_ptr == NULL) {
288 +                return NULL;
289 +        }
290          network_stats_diff_ptr=network_stats_diff;
291  
292          for(x=0;x<sizeof_net_stats_diff;x++){

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines