Date: Thu, 18 Sep 2014 16:17:21 +0000 (UTC) From: Gleb Smirnoff <glebius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271783 - head/sys/net Message-ID: <201409181617.s8IGHLWr023605@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: glebius Date: Thu Sep 18 16:17:20 2014 New Revision: 271783 URL: http://svnweb.freebsd.org/changeset/base/271783 Log: Remove a bunch of methods that are superseded by if_inc_counter(). Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/net/if.c head/sys/net/if_var.h Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Thu Sep 18 15:56:14 2014 (r271782) +++ head/sys/net/if.c Thu Sep 18 16:17:20 2014 (r271783) @@ -3773,139 +3773,12 @@ if_getvtag(struct mbuf *m) return (m->m_pkthdr.ether_vtag); } -/* Statistics */ -int -if_incipackets(if_t ifp, int pkts) -{ - ((struct ifnet *)ifp)->if_ipackets += pkts; - return (0); -} - -int -if_incopackets(if_t ifp, int pkts) -{ - ((struct ifnet *)ifp)->if_opackets += pkts; - return (0); -} - -int -if_incierrors(if_t ifp, int ierrors) -{ - ((struct ifnet *)ifp)->if_ierrors += ierrors; - return (0); -} - - -int -if_setierrors(if_t ifp, int ierrors) -{ - ((struct ifnet *)ifp)->if_ierrors = ierrors; - return (0); -} - -int -if_setoerrors(if_t ifp, int oerrors) -{ - ((struct ifnet *)ifp)->if_oerrors = oerrors; - return (0); -} - -int if_incoerrors(if_t ifp, int oerrors) -{ - ((struct ifnet *)ifp)->if_oerrors += oerrors; - return (0); -} - -int if_inciqdrops(if_t ifp, int val) -{ - ((struct ifnet *)ifp)->if_iqdrops += val; - return (0); -} - -int -if_setcollisions(if_t ifp, int collisions) -{ - ((struct ifnet *)ifp)->if_collisions = collisions; - return (0); -} - -int -if_inccollisions(if_t ifp, int collisions) -{ - ((struct ifnet *)ifp)->if_collisions += collisions; - return (0); -} - -int -if_setipackets(if_t ifp, int pkts) -{ - ((struct ifnet *)ifp)->if_ipackets = pkts; - return (0); -} - -int -if_setopackets(if_t ifp, int pkts) -{ - ((struct ifnet *)ifp)->if_opackets = pkts; - return (0); -} - -int -if_incobytes(if_t ifp, int bytes) -{ - ((struct ifnet *)ifp)->if_obytes += bytes; - return (0); -} - -int -if_setibytes(if_t ifp, int bytes) -{ - ((struct ifnet *)ifp)->if_ibytes = bytes; - return (0); -} - -int -if_setobytes(if_t ifp, int bytes) -{ - ((struct ifnet *)ifp)->if_obytes = bytes; - return (0); -} - - int if_sendq_empty(if_t ifp) { return IFQ_DRV_IS_EMPTY(&((struct ifnet *)ifp)->if_snd); } -int if_getiqdrops(if_t ifp) -{ - return ((struct ifnet *)ifp)->if_iqdrops; -} - -int -if_incimcasts(if_t ifp, int mcast) -{ - ((struct ifnet *)ifp)->if_imcasts += mcast; - return (0); -} - - -int -if_incomcasts(if_t ifp, int mcast) -{ - ((struct ifnet *)ifp)->if_omcasts += mcast; - return (0); -} - -int -if_setimcasts(if_t ifp, int mcast) -{ - ((struct ifnet *)ifp)->if_imcasts = mcast; - return (0); -} - - struct ifaddr * if_getifaddr(if_t ifp) { Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Thu Sep 18 15:56:14 2014 (r271782) +++ head/sys/net/if_var.h Thu Sep 18 16:17:20 2014 (r271783) @@ -582,27 +582,6 @@ int if_multiaddr_count(if_t ifp, int max int if_getamcount(if_t ifp); struct ifaddr * if_getifaddr(if_t ifp); -/* Statistics */ - -int if_incipackets(if_t ifp, int pkt); -int if_incopackets(if_t ifp, int pkts); -int if_incierrors(if_t ifp, int ierrors); -int if_incoerrors(if_t ifp, int oerrors); -int if_inciqdrops(if_t ifp, int val); -int if_setierrors(if_t ifp, int ierrors); -int if_setoerrors(if_t ifp, int oerrors); -int if_setcollisions(if_t ifp, int collisions); -int if_inccollisions(if_t ifp, int collisions); -int if_incobytes(if_t ifp, int bytes); -int if_getiqdrops(if_t ifp); -int if_incimcasts(if_t ifp, int imcasts); -int if_incomcasts(if_t ifp, int imcasts); -int if_setipackets(if_t ifp, int pkts); -int if_setopackets(if_t ifp, int pkts); -int if_setibytes(if_t ifp, int bytes); -int if_setobytes(if_t ifp, int bytes); -int if_setimcasts(if_t ifp, int pkts); - /* Functions */ void if_setinitfn(if_t ifp, void (*)(void *)); void if_setioctlfn(if_t ifp, int (*)(if_t, u_long, caddr_t));
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409181617.s8IGHLWr023605>