aboutsummaryrefslogtreecommitdiff
path: root/sys/net/if.c
diff options
context:
space:
mode:
authorScott Long <scottl@FreeBSD.org>2016-05-18 04:35:58 +0000
committerScott Long <scottl@FreeBSD.org>2016-05-18 04:35:58 +0000
commit4c7070db251a6f2153f9e4783717151b07449ae3 (patch)
treec4ee95073f62d2e14fe35a639e6ee91bf1583c2f /sys/net/if.c
parent679afe0d7898fb740c5a21a290d0e15985635d77 (diff)
downloadsrc-4c7070db251a6f2153f9e4783717151b07449ae3.tar.gz
src-4c7070db251a6f2153f9e4783717151b07449ae3.zip
Import the 'iflib' API library for network drivers. From the author:
"iflib is a library to eliminate the need for frequently duplicated device independent logic propagated (poorly) across many network drivers." Participation is purely optional. The IFLIB kernel config option is provided for drivers that want to transition between legacy and iflib modes of operation. ixl and ixgbe driver conversions will be committed shortly. We hope to see participation from the Broadcom and maybe Chelsio drivers in the near future. Submitted by: mmacy@nextbsd.org Reviewed by: gallatin Differential Revision: D5211
Notes
Notes: svn path=/head/; revision=300113
Diffstat (limited to 'sys/net/if.c')
-rw-r--r--sys/net/if.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 800cb7051529..063da496a2f4 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -3900,6 +3900,19 @@ if_multiaddr_count(if_t ifp, int max)
return (count);
}
+int
+if_multi_apply(struct ifnet *ifp, int (*filter)(void *, struct ifmultiaddr *, int), void *arg)
+{
+ struct ifmultiaddr *ifma;
+ int cnt = 0;
+
+ if_maddr_rlock(ifp);
+ TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link)
+ cnt += filter(arg, ifma, cnt);
+ if_maddr_runlock(ifp);
+ return (cnt);
+}
+
struct mbuf *
if_dequeue(if_t ifp)
{