summaryrefslogtreecommitdiffstats
path: root/sys/net/if_var.h
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2009-06-26 00:36:47 +0000
committerrwatson <rwatson@FreeBSD.org>2009-06-26 00:36:47 +0000
commitc4ac6ab020126b381316fa8dcb627571af2683c8 (patch)
treec6f326c31b77486b02c2c684052c2a2a25bf0cf6 /sys/net/if_var.h
parent6bcc6a84131914c0690ee04211ea2d70f7271ca8 (diff)
downloadFreeBSD-src-c4ac6ab020126b381316fa8dcb627571af2683c8.zip
FreeBSD-src-c4ac6ab020126b381316fa8dcb627571af2683c8.tar.gz
Define four wrapper functions for interface address locking,
if_addr_rlock() and if_addr_runlock() for regular address lists, and if_maddr_rlock() and if_maddr_runlock() for multicast address lists. We will use these in various kernel modules to avoid encoding specific type and locking strategy information into modules that currently use IF_ADDR_LOCK() and IF_ADDR_UNLOCK() directly. MFC after: 6 weeks
Diffstat (limited to 'sys/net/if_var.h')
-rw-r--r--sys/net/if_var.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/net/if_var.h b/sys/net/if_var.h
index 35e4232..df09035 100644
--- a/sys/net/if_var.h
+++ b/sys/net/if_var.h
@@ -253,6 +253,16 @@ typedef void if_init_f_t(void *);
#define IF_ADDR_LOCK_ASSERT(if) mtx_assert(&(if)->if_addr_mtx, MA_OWNED)
/*
+ * Function variations on locking macros intended to be used by loadable
+ * kernel modules in order to divorce them from the internals of address list
+ * locking.
+ */
+void if_addr_rlock(struct ifnet *ifp); /* if_addrhead */
+void if_addr_runlock(struct ifnet *ifp); /* if_addrhead */
+void if_maddr_rlock(struct ifnet *ifp); /* if_multiaddrs */
+void if_maddr_runlock(struct ifnet *ifp); /* if_multiaddrs */
+
+/*
* Output queues (ifp->if_snd) and slow device input queues (*ifp->if_slowq)
* are queues of messages stored on ifqueue structures
* (defined above). Entries are added to and deleted from these structures
OpenPOWER on IntegriCloud