From ea85d05d021ba4facf9025e4c1cbd6b39c745081 Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Thu, 6 Mar 2014 07:43:42 +0000 Subject: [PATCH] Modify wlanstats to now use the copy of libbsdstat in /usr/lib/private. --- tools/tools/net80211/wlanstats/Makefile | 4 +++- tools/tools/net80211/wlanstats/wlanstats.c | 16 ++++++++-------- tools/tools/net80211/wlanstats/wlanstats.h | 6 +++--- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/tools/tools/net80211/wlanstats/Makefile b/tools/tools/net80211/wlanstats/Makefile index 30067ef0e19b..bbda2ec83218 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 diff --git a/tools/tools/net80211/wlanstats/wlanstats.c b/tools/tools/net80211/wlanstats/wlanstats.c index 820fc9e685f7..9cee61aee04a 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 3543601bbf3c..d6ee97e23abb 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);