From owner-svn-src-head@FreeBSD.ORG Thu Mar 6 07:48:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 07D983F8; Thu, 6 Mar 2014 07:48:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E8590B29; Thu, 6 Mar 2014 07:48:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s267mh2g064510; Thu, 6 Mar 2014 07:48:43 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s267mh7j064507; Thu, 6 Mar 2014 07:48:43 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403060748.s267mh7j064507@svn.freebsd.org> From: Adrian Chadd Date: Thu, 6 Mar 2014 07:48:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262830 - head/tools/tools/mwl/mwlstats X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 07:48:44 -0000 Author: adrian Date: Thu Mar 6 07:48:43 2014 New Revision: 262830 URL: http://svnweb.freebsd.org/changeset/base/262830 Log: Migrate mwlstats to use bsdstat. Deleted: head/tools/tools/mwl/mwlstats/statfoo.c head/tools/tools/mwl/mwlstats/statfoo.h Modified: head/tools/tools/mwl/mwlstats/Makefile head/tools/tools/mwl/mwlstats/mwlstats.c head/tools/tools/mwl/mwlstats/mwlstats.h Modified: head/tools/tools/mwl/mwlstats/Makefile ============================================================================== --- head/tools/tools/mwl/mwlstats/Makefile Thu Mar 6 07:47:19 2014 (r262829) +++ head/tools/tools/mwl/mwlstats/Makefile Thu Mar 6 07:48:43 2014 (r262830) @@ -4,7 +4,9 @@ PROG= mwlstats BINDIR= /usr/local/bin NO_MAN= -SRCS= main.c statfoo.c mwlstats.c +SRCS= main.c mwlstats.c +USEPRIVATELIB= +LDADD=-lbsdstat .include Modified: head/tools/tools/mwl/mwlstats/mwlstats.c ============================================================================== --- head/tools/tools/mwl/mwlstats/mwlstats.c Thu Mar 6 07:47:19 2014 (r262829) +++ head/tools/tools/mwl/mwlstats/mwlstats.c Thu Mar 6 07:48:43 2014 (r262830) @@ -265,7 +265,7 @@ mwl_collect(struct mwlstatfoo_p *wf, str } static void -mwl_collect_cur(struct statfoo *sf) +mwl_collect_cur(struct bsdstat *sf) { struct mwlstatfoo_p *wf = (struct mwlstatfoo_p *) sf; @@ -273,7 +273,7 @@ mwl_collect_cur(struct statfoo *sf) } static void -mwl_collect_tot(struct statfoo *sf) +mwl_collect_tot(struct bsdstat *sf) { struct mwlstatfoo_p *wf = (struct mwlstatfoo_p *) sf; @@ -281,7 +281,7 @@ mwl_collect_tot(struct statfoo *sf) } static void -mwl_update_tot(struct statfoo *sf) +mwl_update_tot(struct bsdstat *sf) { struct mwlstatfoo_p *wf = (struct mwlstatfoo_p *) sf; @@ -300,7 +300,7 @@ setrate(char b[], size_t bs, uint8_t rat } static int -mwl_get_curstat(struct statfoo *sf, int s, char b[], size_t bs) +mwl_get_curstat(struct bsdstat *sf, int s, char b[], size_t bs) { struct mwlstatfoo_p *wf = (struct mwlstatfoo_p *) sf; #define STAT(x) \ @@ -406,7 +406,7 @@ mwl_get_curstat(struct statfoo *sf, int } static int -mwl_get_totstat(struct statfoo *sf, int s, char b[], size_t bs) +mwl_get_totstat(struct bsdstat *sf, int s, char b[], size_t bs) { struct mwlstatfoo_p *wf = (struct mwlstatfoo_p *) sf; #define STAT(x) \ @@ -510,7 +510,7 @@ mwl_get_totstat(struct statfoo *sf, int } static void -mwl_print_verbose(struct statfoo *sf, FILE *fd) +mwl_print_verbose(struct bsdstat *sf, FILE *fd) { struct mwlstatfoo_p *wf = (struct mwlstatfoo_p *) sf; const struct fmt *f; @@ -539,7 +539,7 @@ mwl_print_verbose(struct statfoo *sf, FI wf->total.mst_ant_rx[i]); } -STATFOO_DEFINE_BOUNCE(mwlstatfoo) +BSDSTAT_DEFINE_BOUNCE(mwlstatfoo) struct mwlstatfoo * mwlstats_new(const char *ifname, const char *fmtstring) @@ -549,7 +549,7 @@ mwlstats_new(const char *ifname, const c wf = calloc(1, sizeof(struct mwlstatfoo_p)); if (wf != NULL) { - statfoo_init(&wf->base.base, "mwlstats", mwlstats, N(mwlstats)); + bsdstat_init(&wf->base.base, "mwlstats", mwlstats, N(mwlstats)); /* override base methods */ wf->base.base.collect_cur = mwl_collect_cur; wf->base.base.collect_tot = mwl_collect_tot; @@ -559,7 +559,7 @@ mwlstats_new(const char *ifname, const c wf->base.base.print_verbose = mwl_print_verbose; /* setup bounce functions for public methods */ - STATFOO_BOUNCE(wf, mwlstatfoo); + BSDSTAT_BOUNCE(wf, mwlstatfoo); /* setup our public methods */ wf->base.setifname = mwl_setifname; Modified: head/tools/tools/mwl/mwlstats/mwlstats.h ============================================================================== --- head/tools/tools/mwl/mwlstats/mwlstats.h Thu Mar 6 07:47:19 2014 (r262829) +++ head/tools/tools/mwl/mwlstats/mwlstats.h Thu Mar 6 07:48:43 2014 (r262830) @@ -32,15 +32,15 @@ #ifndef _MWLSTATS_H_ #define _MWLSTATS_H_ -#include "statfoo.h" +#include "bsdstat.h" /* * mv statistics class. */ struct mwlstatfoo { - struct statfoo base; + struct bsdstat base; - STATFOO_DECL_METHODS(struct mwlstatfoo *); + BSDSTAT_DECL_METHODS(struct mwlstatfoo *); /* set the network interface name for collection */ void (*setifname)(struct mwlstatfoo *, const char *ifname);