summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2014-03-06 07:43:42 +0000
committeradrian <adrian@FreeBSD.org>2014-03-06 07:43:42 +0000
commitc285b1679c5557c99def3670aa861ca147e8d5ef (patch)
tree165d86a2b2d4852e460d8a7b34468857aeeef922 /tools
parent8534e7cf720dfaa18392c07e69f09abf7ad308ad (diff)
downloadFreeBSD-src-c285b1679c5557c99def3670aa861ca147e8d5ef.zip
FreeBSD-src-c285b1679c5557c99def3670aa861ca147e8d5ef.tar.gz
Modify wlanstats to now use the copy of libbsdstat in /usr/lib/private.
Diffstat (limited to 'tools')
-rw-r--r--tools/tools/net80211/wlanstats/Makefile4
-rw-r--r--tools/tools/net80211/wlanstats/wlanstats.c16
-rw-r--r--tools/tools/net80211/wlanstats/wlanstats.h6
3 files changed, 14 insertions, 12 deletions
diff --git a/tools/tools/net80211/wlanstats/Makefile b/tools/tools/net80211/wlanstats/Makefile
index 30067ef..bbda2ec 100644
--- a/tools/tools/net80211/wlanstats/Makefile
+++ b/tools/tools/net80211/wlanstats/Makefile
@@ -5,8 +5,10 @@
PROG= wlanstats
BINDIR= /usr/local/bin
NO_MAN=
+USEPRIVATELIB=
-SRCS= statfoo.c wlanstats.c main.c
+SRCS= wlanstats.c main.c
+LDADD= -lbsdstat
CFLAGS.clang+= -fbracket-depth=512
.include <bsd.prog.mk>
diff --git a/tools/tools/net80211/wlanstats/wlanstats.c b/tools/tools/net80211/wlanstats/wlanstats.c
index 820fc9e..9cee61a 100644
--- a/tools/tools/net80211/wlanstats/wlanstats.c
+++ b/tools/tools/net80211/wlanstats/wlanstats.c
@@ -531,7 +531,7 @@ wlan_collect(struct wlanstatfoo_p *wf,
}
static void
-wlan_collect_cur(struct statfoo *sf)
+wlan_collect_cur(struct bsdstat *sf)
{
struct wlanstatfoo_p *wf = (struct wlanstatfoo_p *) sf;
@@ -539,7 +539,7 @@ wlan_collect_cur(struct statfoo *sf)
}
static void
-wlan_collect_tot(struct statfoo *sf)
+wlan_collect_tot(struct bsdstat *sf)
{
struct wlanstatfoo_p *wf = (struct wlanstatfoo_p *) sf;
@@ -547,7 +547,7 @@ wlan_collect_tot(struct statfoo *sf)
}
static void
-wlan_update_tot(struct statfoo *sf)
+wlan_update_tot(struct bsdstat *sf)
{
struct wlanstatfoo_p *wf = (struct wlanstatfoo_p *) sf;
@@ -669,7 +669,7 @@ wlan_getinfo(struct wlanstatfoo_p *wf, int s, char b[], size_t bs)
}
static int
-wlan_get_curstat(struct statfoo *sf, int s, char b[], size_t bs)
+wlan_get_curstat(struct bsdstat *sf, int s, char b[], size_t bs)
{
struct wlanstatfoo_p *wf = (struct wlanstatfoo_p *) sf;
#define STAT(x) \
@@ -833,7 +833,7 @@ wlan_get_curstat(struct statfoo *sf, int s, char b[], size_t bs)
}
static int
-wlan_get_totstat(struct statfoo *sf, int s, char b[], size_t bs)
+wlan_get_totstat(struct bsdstat *sf, int s, char b[], size_t bs)
{
struct wlanstatfoo_p *wf = (struct wlanstatfoo_p *) sf;
#define STAT(x) \
@@ -994,7 +994,7 @@ wlan_get_totstat(struct statfoo *sf, int s, char b[], size_t bs)
#undef STAT
}
-STATFOO_DEFINE_BOUNCE(wlanstatfoo)
+BSDSTAT_DEFINE_BOUNCE(wlanstatfoo)
struct wlanstatfoo *
wlanstats_new(const char *ifname, const char *fmtstring)
@@ -1004,7 +1004,7 @@ wlanstats_new(const char *ifname, const char *fmtstring)
wf = calloc(1, sizeof(struct wlanstatfoo_p));
if (wf != NULL) {
- statfoo_init(&wf->base.base, "wlanstats", wlanstats, N(wlanstats));
+ bsdstat_init(&wf->base.base, "wlanstats", wlanstats, N(wlanstats));
/* override base methods */
wf->base.base.collect_cur = wlan_collect_cur;
wf->base.base.collect_tot = wlan_collect_tot;
@@ -1013,7 +1013,7 @@ wlanstats_new(const char *ifname, const char *fmtstring)
wf->base.base.update_tot = wlan_update_tot;
/* setup bounce functions for public methods */
- STATFOO_BOUNCE(wf, wlanstatfoo);
+ BSDSTAT_BOUNCE(wf, wlanstatfoo);
/* setup our public methods */
wf->base.setifname = wlan_setifname;
diff --git a/tools/tools/net80211/wlanstats/wlanstats.h b/tools/tools/net80211/wlanstats/wlanstats.h
index 3543601..d6ee97e 100644
--- a/tools/tools/net80211/wlanstats/wlanstats.h
+++ b/tools/tools/net80211/wlanstats/wlanstats.h
@@ -32,15 +32,15 @@
#ifndef _WLANSTATS_H_
#define _WLANSTATS_H_
-#include "statfoo.h"
+#include "bsdstat.h"
/*
* wlan statistics class.
*/
struct wlanstatfoo {
- struct statfoo base;
+ struct bsdstat base;
- STATFOO_DECL_METHODS(struct wlanstatfoo *);
+ BSDSTAT_DECL_METHODS(struct wlanstatfoo *);
/* set the network interface name for collection */
void (*setifname)(struct wlanstatfoo *, const char *ifname);
OpenPOWER on IntegriCloud