From owner-svn-src-all@FreeBSD.ORG Thu Mar 6 07:50:55 2014 Return-Path: Delivered-To: svn-src-all@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 6376E7A1; Thu, 6 Mar 2014 07:50:55 +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 5057BB4B; Thu, 6 Mar 2014 07:50:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s267otqm065194; Thu, 6 Mar 2014 07:50:55 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s267osce065191; Thu, 6 Mar 2014 07:50:54 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403060750.s267osce065191@svn.freebsd.org> From: Adrian Chadd Date: Thu, 6 Mar 2014 07:50:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262832 - head/tools/tools/npe/npestats X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 07:50:55 -0000 Author: adrian Date: Thu Mar 6 07:50:54 2014 New Revision: 262832 URL: http://svnweb.freebsd.org/changeset/base/262832 Log: Migrate npestats to use bsdstat. Deleted: head/tools/tools/npe/npestats/statfoo.c head/tools/tools/npe/npestats/statfoo.h Modified: head/tools/tools/npe/npestats/Makefile head/tools/tools/npe/npestats/npestats.c head/tools/tools/npe/npestats/npestats.h Modified: head/tools/tools/npe/npestats/Makefile ============================================================================== --- head/tools/tools/npe/npestats/Makefile Thu Mar 6 07:49:12 2014 (r262831) +++ head/tools/tools/npe/npestats/Makefile Thu Mar 6 07:50:54 2014 (r262832) @@ -1,8 +1,10 @@ # $FreeBSD$ PROG= npestats -SRCS= main.c statfoo.c npestats.c +SRCS= main.c npestats.c BINDIR= /usr/local/bin NO_MAN= true +USEPRIVATELIB= +LDADD= -lbsdstat .include Modified: head/tools/tools/npe/npestats/npestats.c ============================================================================== --- head/tools/tools/npe/npestats/npestats.c Thu Mar 6 07:49:12 2014 (r262831) +++ head/tools/tools/npe/npestats/npestats.c Thu Mar 6 07:50:54 2014 (r262832) @@ -151,7 +151,7 @@ npe_collect(struct npestatfoo_p *wf, str } static void -npe_collect_cur(struct statfoo *sf) +npe_collect_cur(struct bsdstat *sf) { struct npestatfoo_p *wf = (struct npestatfoo_p *) sf; @@ -159,7 +159,7 @@ npe_collect_cur(struct statfoo *sf) } static void -npe_collect_tot(struct statfoo *sf) +npe_collect_tot(struct bsdstat *sf) { struct npestatfoo_p *wf = (struct npestatfoo_p *) sf; @@ -167,7 +167,7 @@ npe_collect_tot(struct statfoo *sf) } static void -npe_update_tot(struct statfoo *sf) +npe_update_tot(struct bsdstat *sf) { struct npestatfoo_p *wf = (struct npestatfoo_p *) sf; @@ -175,7 +175,7 @@ npe_update_tot(struct statfoo *sf) } static int -npe_get_curstat(struct statfoo *sf, int s, char b[], size_t bs) +npe_get_curstat(struct bsdstat *sf, int s, char b[], size_t bs) { struct npestatfoo_p *wf = (struct npestatfoo_p *) sf; #define STAT(x) \ @@ -211,7 +211,7 @@ npe_get_curstat(struct statfoo *sf, int } static int -npe_get_totstat(struct statfoo *sf, int s, char b[], size_t bs) +npe_get_totstat(struct bsdstat *sf, int s, char b[], size_t bs) { struct npestatfoo_p *wf = (struct npestatfoo_p *) sf; #define STAT(x) \ @@ -246,7 +246,7 @@ npe_get_totstat(struct statfoo *sf, int #undef STAT } -STATFOO_DEFINE_BOUNCE(npestatfoo) +BSDSTAT_DEFINE_BOUNCE(npestatfoo) struct npestatfoo * npestats_new(const char *ifname, const char *fmtstring) @@ -256,7 +256,7 @@ npestats_new(const char *ifname, const c wf = calloc(1, sizeof(struct npestatfoo_p)); if (wf != NULL) { - statfoo_init(&wf->base.base, "npestats", npestats, N(npestats)); + bsdstat_init(&wf->base.base, "npestats", npestats, N(npestats)); /* override base methods */ wf->base.base.collect_cur = npe_collect_cur; wf->base.base.collect_tot = npe_collect_tot; @@ -265,7 +265,7 @@ npestats_new(const char *ifname, const c wf->base.base.update_tot = npe_update_tot; /* setup bounce functions for public methods */ - STATFOO_BOUNCE(wf, npestatfoo); + BSDSTAT_BOUNCE(wf, npestatfoo); /* setup our public methods */ wf->base.setifname = npe_setifname; Modified: head/tools/tools/npe/npestats/npestats.h ============================================================================== --- head/tools/tools/npe/npestats/npestats.h Thu Mar 6 07:49:12 2014 (r262831) +++ head/tools/tools/npe/npestats/npestats.h Thu Mar 6 07:50:54 2014 (r262832) @@ -32,15 +32,15 @@ #ifndef _NPESTATS_H_ #define _NPESTATS_H_ -#include "statfoo.h" +#include "bsdstat.h" /* * npe statistics class. */ struct npestatfoo { - struct statfoo base; + struct bsdstat base; - STATFOO_DECL_METHODS(struct npestatfoo *); + BSDSTAT_DECL_METHODS(struct npestatfoo *); /* set the network interface name for collection */ void (*setifname)(struct npestatfoo *, const char *ifname);