projects
/
tinc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4a21aab
)
Use 64 bit counters to keep track of bytes sent/received from the virtual network...
author
Guus Sliepen
<guus@tinc-vpn.org>
Fri, 4 Jun 2010 13:04:08 +0000
(15:04 +0200)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Fri, 4 Jun 2010 13:04:08 +0000
(15:04 +0200)
src/bsd/device.c
patch
|
blob
|
history
src/cygwin/device.c
patch
|
blob
|
history
src/dummy/device.c
patch
|
blob
|
history
src/linux/device.c
patch
|
blob
|
history
src/mingw/device.c
patch
|
blob
|
history
src/raw_socket/device.c
patch
|
blob
|
history
src/solaris/device.c
patch
|
blob
|
history
src/uml_socket/device.c
patch
|
blob
|
history
diff --git
a/src/bsd/device.c
b/src/bsd/device.c
index
6674abd
..
e8fdc1b
100644
(file)
--- a/
src/bsd/device.c
+++ b/
src/bsd/device.c
@@
-47,8
+47,8
@@
int device_fd = -1;
char *device = NULL;
char *iface = NULL;
static char *device_info = NULL;
char *device = NULL;
char *iface = NULL;
static char *device_info = NULL;
-static
in
t device_total_in = 0;
-static
in
t device_total_out = 0;
+static
uint64_
t device_total_in = 0;
+static
uint64_
t device_total_out = 0;
#if defined(TUNEMU)
static device_type_t device_type = DEVICE_TYPE_TUNEMU;
#elif defined(HAVE_OPENBSD) || defined(HAVE_FREEBSD)
#if defined(TUNEMU)
static device_type_t device_type = DEVICE_TYPE_TUNEMU;
#elif defined(HAVE_OPENBSD) || defined(HAVE_FREEBSD)
@@
-353,6
+353,6
@@
bool write_packet(vpn_packet_t *packet) {
void dump_device_stats(void) {
logger(LOG_DEBUG, "Statistics for %s %s:", device_info, device);
void dump_device_stats(void) {
logger(LOG_DEBUG, "Statistics for %s %s:", device_info, device);
- logger(LOG_DEBUG, " total bytes in: %10
d"
, device_total_in);
- logger(LOG_DEBUG, " total bytes out: %10
d"
, device_total_out);
+ logger(LOG_DEBUG, " total bytes in: %10
"PRIu64
, device_total_in);
+ logger(LOG_DEBUG, " total bytes out: %10
"PRIu64
, device_total_out);
}
}
diff --git
a/src/cygwin/device.c
b/src/cygwin/device.c
index
958184b
..
90966cd
100644
(file)
--- a/
src/cygwin/device.c
+++ b/
src/cygwin/device.c
@@
-38,8
+38,8
@@
char *device = NULL;
char *iface = NULL;
static char *device_info = NULL;
char *iface = NULL;
static char *device_info = NULL;
-static
in
t device_total_in = 0;
-static
in
t device_total_out = 0;
+static
uint64_
t device_total_in = 0;
+static
uint64_
t device_total_out = 0;
static pid_t reader_pid;
static int sp[2];
static pid_t reader_pid;
static int sp[2];
@@
-261,6
+261,6
@@
bool write_packet(vpn_packet_t *packet) {
void dump_device_stats(void) {
logger(LOG_DEBUG, "Statistics for %s %s:", device_info, device);
void dump_device_stats(void) {
logger(LOG_DEBUG, "Statistics for %s %s:", device_info, device);
- logger(LOG_DEBUG, " total bytes in: %10
d"
, device_total_in);
- logger(LOG_DEBUG, " total bytes out: %10
d"
, device_total_out);
+ logger(LOG_DEBUG, " total bytes in: %10
"PRIu64
, device_total_in);
+ logger(LOG_DEBUG, " total bytes out: %10
"PRIu64
, device_total_out);
}
}
diff --git
a/src/dummy/device.c
b/src/dummy/device.c
index
a9600b2
..
c84e899
100644
(file)
--- a/
src/dummy/device.c
+++ b/
src/dummy/device.c
@@
-27,8
+27,8
@@
char *device = "dummy";
char *iface = "dummy";
static char *device_info = "dummy device";
char *iface = "dummy";
static char *device_info = "dummy device";
-static
in
t device_total_in = 0;
-static
in
t device_total_out = 0;
+static
uint64_
t device_total_in = 0;
+static
uint64_
t device_total_out = 0;
bool setup_device(void) {
logger(LOG_INFO, "%s (%s) is a %s", device, iface, device_info);
bool setup_device(void) {
logger(LOG_INFO, "%s (%s) is a %s", device, iface, device_info);
@@
-49,6
+49,6
@@
bool write_packet(vpn_packet_t *packet) {
void dump_device_stats(void) {
logger(LOG_DEBUG, "Statistics for %s %s:", device_info, device);
void dump_device_stats(void) {
logger(LOG_DEBUG, "Statistics for %s %s:", device_info, device);
- logger(LOG_DEBUG, " total bytes in: %10
d"
, device_total_in);
- logger(LOG_DEBUG, " total bytes out: %10
d"
, device_total_out);
+ logger(LOG_DEBUG, " total bytes in: %10
"PRIu64
, device_total_in);
+ logger(LOG_DEBUG, " total bytes out: %10
"PRIu64
, device_total_out);
}
}
diff --git
a/src/linux/device.c
b/src/linux/device.c
index
6363b12
..
6c828c0
100644
(file)
--- a/
src/linux/device.c
+++ b/
src/linux/device.c
@@
-47,8
+47,8
@@
char *iface = NULL;
static char ifrname[IFNAMSIZ];
static char *device_info;
static char ifrname[IFNAMSIZ];
static char *device_info;
-static
in
t device_total_in = 0;
-static
in
t device_total_out = 0;
+static
uint64_
t device_total_in = 0;
+static
uint64_
t device_total_out = 0;
bool setup_device(void) {
struct ifreq ifr;
bool setup_device(void) {
struct ifreq ifr;
@@
-205,6
+205,6
@@
bool write_packet(vpn_packet_t *packet) {
void dump_device_stats(void) {
logger(LOG_DEBUG, "Statistics for %s %s:", device_info, device);
void dump_device_stats(void) {
logger(LOG_DEBUG, "Statistics for %s %s:", device_info, device);
- logger(LOG_DEBUG, " total bytes in: %10
d"
, device_total_in);
- logger(LOG_DEBUG, " total bytes out: %10
d"
, device_total_out);
+ logger(LOG_DEBUG, " total bytes in: %10
"PRIu64
, device_total_in);
+ logger(LOG_DEBUG, " total bytes out: %10
"PRIu64
, device_total_out);
}
}
diff --git
a/src/mingw/device.c
b/src/mingw/device.c
index
c0f5d29
..
cbaa19e
100644
(file)
--- a/
src/mingw/device.c
+++ b/
src/mingw/device.c
@@
-38,8
+38,8
@@
char *device = NULL;
char *iface = NULL;
static char *device_info = NULL;
char *iface = NULL;
static char *device_info = NULL;
-static
in
t device_total_in = 0;
-static
in
t device_total_out = 0;
+static
uint64_
t device_total_in = 0;
+static
uint64_
t device_total_out = 0;
extern char *myport;
extern char *myport;
@@
-247,6
+247,6
@@
bool write_packet(vpn_packet_t *packet) {
void dump_device_stats(void) {
logger(LOG_DEBUG, "Statistics for %s %s:", device_info, device);
void dump_device_stats(void) {
logger(LOG_DEBUG, "Statistics for %s %s:", device_info, device);
- logger(LOG_DEBUG, " total bytes in: %10
d"
, device_total_in);
- logger(LOG_DEBUG, " total bytes out: %10
d"
, device_total_out);
+ logger(LOG_DEBUG, " total bytes in: %10
"PRIu64
, device_total_in);
+ logger(LOG_DEBUG, " total bytes out: %10
"PRIu64
, device_total_out);
}
}
diff --git
a/src/raw_socket/device.c
b/src/raw_socket/device.c
index
30bb184
..
f68e461
100644
(file)
--- a/
src/raw_socket/device.c
+++ b/
src/raw_socket/device.c
@@
-35,8
+35,8
@@
char *iface = NULL;
static char ifrname[IFNAMSIZ];
static char *device_info;
static char ifrname[IFNAMSIZ];
static char *device_info;
-static
in
t device_total_in = 0;
-static
in
t device_total_out = 0;
+static
uint64_
t device_total_in = 0;
+static
uint64_
t device_total_out = 0;
bool setup_device(void) {
struct ifreq ifr;
bool setup_device(void) {
struct ifreq ifr;
@@
-123,6
+123,6
@@
bool write_packet(vpn_packet_t *packet) {
void dump_device_stats(void) {
logger(LOG_DEBUG, "Statistics for %s %s:", device_info, device);
void dump_device_stats(void) {
logger(LOG_DEBUG, "Statistics for %s %s:", device_info, device);
- logger(LOG_DEBUG, " total bytes in: %10
d"
, device_total_in);
- logger(LOG_DEBUG, " total bytes out: %10
d"
, device_total_out);
+ logger(LOG_DEBUG, " total bytes in: %10
"PRIu64
, device_total_in);
+ logger(LOG_DEBUG, " total bytes out: %10
"PRIu64
, device_total_out);
}
}
diff --git
a/src/solaris/device.c
b/src/solaris/device.c
index
e26dc06
..
9018c31
100644
(file)
--- a/
src/solaris/device.c
+++ b/
src/solaris/device.c
@@
-38,8
+38,8
@@
char *device = NULL;
char *iface = NULL;
static char *device_info = NULL;
char *iface = NULL;
static char *device_info = NULL;
-static
in
t device_total_in = 0;
-static
in
t device_total_out = 0;
+static
uint64_
t device_total_in = 0;
+static
uint64_
t device_total_out = 0;
bool setup_device(void) {
int ip_fd = -1, if_fd = -1;
bool setup_device(void) {
int ip_fd = -1, if_fd = -1;
@@
-163,6
+163,6
@@
bool write_packet(vpn_packet_t *packet) {
void dump_device_stats(void) {
logger(LOG_DEBUG, "Statistics for %s %s:", device_info, device);
void dump_device_stats(void) {
logger(LOG_DEBUG, "Statistics for %s %s:", device_info, device);
- logger(LOG_DEBUG, " total bytes in: %10
d"
, device_total_in);
- logger(LOG_DEBUG, " total bytes out: %10
d"
, device_total_out);
+ logger(LOG_DEBUG, " total bytes in: %10
"PRIu64
, device_total_in);
+ logger(LOG_DEBUG, " total bytes out: %10
"PRIu64
, device_total_out);
}
}
diff --git
a/src/uml_socket/device.c
b/src/uml_socket/device.c
index
3523f64
..
59551b4
100644
(file)
--- a/
src/uml_socket/device.c
+++ b/
src/uml_socket/device.c
@@
-41,8
+41,8
@@
static char *device_info;
extern char *identname;
extern bool running;
extern char *identname;
extern bool running;
-static
in
t device_total_in = 0;
-static
in
t device_total_out = 0;
+static
uint64_
t device_total_in = 0;
+static
uint64_
t device_total_out = 0;
enum request_type { REQ_NEW_CONTROL };
enum request_type { REQ_NEW_CONTROL };
@@
-272,6
+272,6
@@
bool write_packet(vpn_packet_t *packet) {
void dump_device_stats(void) {
logger(LOG_DEBUG, "Statistics for %s %s:", device_info, device);
void dump_device_stats(void) {
logger(LOG_DEBUG, "Statistics for %s %s:", device_info, device);
- logger(LOG_DEBUG, " total bytes in: %10
d"
, device_total_in);
- logger(LOG_DEBUG, " total bytes out: %10
d"
, device_total_out);
+ logger(LOG_DEBUG, " total bytes in: %10
"PRIu64
, device_total_in);
+ logger(LOG_DEBUG, " total bytes out: %10
"PRIu64
, device_total_out);
}
}