1 |
|
/* |
2 |
|
* i-scream central monitoring system |
3 |
< |
* http://www.i-scream.org.uk |
4 |
< |
* Copyright (C) 2000-2002 i-scream |
3 |
> |
* http://www.i-scream.org |
4 |
> |
* Copyright (C) 2000-2003 i-scream |
5 |
|
* |
6 |
|
* This program is free software; you can redistribute it and/or |
7 |
|
* modify it under the terms of the GNU General Public License |
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> |
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 |
|
} |
230 |
|
} |
231 |
|
|
232 |
|
long long transfer_diff(long long new, long long old){ |
233 |
< |
#ifdef SOL7 |
234 |
< |
#define MAXVAL 4294967296 |
233 |
> |
#if defined(SOL7) || defined(LINUX) || defined(FREEBSD) |
234 |
> |
#define MAXVAL 4294967296LL |
235 |
|
#else |
236 |
< |
#define MAXVAL 18446744073709551616 |
236 |
> |
#define MAXVAL 18446744073709551616LL |
237 |
|
#endif |
238 |
|
long long result; |
239 |
|
if(new>=old){ |