summaryrefslogtreecommitdiffstats
path: root/ax25ipd
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2017-07-25 20:31:29 +0200
committerRalf Baechle <ralf@linux-mips.org>2017-07-25 20:31:29 +0200
commit7112fa905807b22cc5c22617fd221df8a2e7c48c (patch)
treeb75e1c9701f571b5580a4934fd98914674c25a25 /ax25ipd
parent120396d633fbec44a2b9fd6bc2b0850d2d595028 (diff)
ax25ipd: Fix stats.
The stats structure was defined in the ax25ipd.h header as a static variable resulting in each compilation unit having its own stats variable. The sole reader, the do_stats() function would thus only see and print all-zero stats. This also fixes the following warnings: make[2]: Entering directory '/home/ralf/src/ax25/ax25-apps/ax25ipd' gcc -DHAVE_CONFIG_H -I. -I.. -DAX25_SYSCONFDIR=\""/usr/local/etc/ax25"\" -DAX25_LOCALSTATEDIR=\""/usr/local/var/ax25"\" -DUSE_TERMIO -g -O2 -Wall -MT crc.o -MD -MP -MF .deps/crc.Tpo -c -o crc.o crc.c In file included from crc.c:3:0: ax25ipd.h:108:3: warning: ‘stats’ defined but not used [-Wunused-variable] } stats; ^~~~~ [...] gcc -DHAVE_CONFIG_H -I. -I.. -DAX25_SYSCONFDIR=\""/usr/local/etc/ax25"\" -DAX25_LOCALSTATEDIR=\""/usr/local/var/ax25"\" -DUSE_TERMIO -g -O2 -Wall -MT routing.o -MD -MP -MF .deps/routing.Tpo -c -o routing.o routing.c In file included from routing.c:10:0: ax25ipd.h:108:3: warning: ‘stats’ defined but not used [-Wunused-variable] } stats; ^~~~~ [...] gcc -DHAVE_CONFIG_H -I. -I.. -DAX25_SYSCONFDIR=\""/usr/local/etc/ax25"\" -DAX25_LOCALSTATEDIR=\""/usr/local/var/ax25"\" -DUSE_TERMIO -g -O2 -Wall -MT syslog.o -MD -MP -MF .deps/syslog.Tpo -c -o syslog.o syslog.c In file included from syslog.c:4:0: ax25ipd.h:108:3: warning: ‘stats’ defined but not used [-Wunused-variable] } stats; ^~~~~ [...] gcc -DHAVE_CONFIG_H -I. -I.. -DAX25_SYSCONFDIR=\""/usr/local/etc/ax25"\" -DAX25_LOCALSTATEDIR=\""/usr/local/var/ax25"\" -DUSE_TERMIO -g -O2 -Wall -MT bpqether.o -MD -MP -MF .deps/bpqether.Tpo -c -o bpqether.o bpqether.c In file included from bpqether.c:39:0: ax25ipd.h:108:3: warning: ‘stats’ defined but not used [-Wunused-variable] } stats; ^~~~~ [...] make[2]: Leaving directory '/home/ralf/src/ax25/ax25-apps/ax25ipd' Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'ax25ipd')
-rw-r--r--ax25ipd/ax25ipd.c1
-rw-r--r--ax25ipd/ax25ipd.h6
2 files changed, 5 insertions, 2 deletions
diff --git a/ax25ipd/ax25ipd.c b/ax25ipd/ax25ipd.c
index 66bd47f..f2653ab 100644
--- a/ax25ipd/ax25ipd.c
+++ b/ax25ipd/ax25ipd.c
@@ -37,6 +37,7 @@ int bc_interval; /* The interval, in seconds, between beacons */
int bc_every; /* true=every, false=after */
int digi; /* True if we are connected to a TNC */
int loglevel; /* Verbosity level */
+struct ax25ipd_stats stats; /* Usage statistics */
int dual_port; /* addition for dual port flag */
diff --git a/ax25ipd/ax25ipd.h b/ax25ipd/ax25ipd.h
index 37e3a7a..8f52067 100644
--- a/ax25ipd/ax25ipd.h
+++ b/ax25ipd/ax25ipd.h
@@ -87,7 +87,7 @@ extern int loglevel; /* Verbosity level */
/* addition for dual port flag */
extern int dual_port;
-static struct {
+struct ax25ipd_stats {
int kiss_in; /* # packets received */
int kiss_toobig; /* packet too large */
int kiss_badtype; /* control byte non-zero */
@@ -105,7 +105,9 @@ static struct {
int ip_tooshort; /* packet too short to be a valid frame */
int ip_not_for_me; /* packet not for me (in digi mode) */
int ip_i_am_dest; /* I am destination (in digi mode) */
-} stats;
+};
+
+extern struct ax25ipd_stats stats;
#define MAX_FRAME 2048