Lines Matching full:cif

289 #define	CIF_LOCK_INIT(cif)	mtx_init(&(cif)->cif_mtx, "carp_if",   \  argument
291 #define CIF_LOCK_DESTROY(cif) mtx_destroy(&(cif)->cif_mtx) argument
292 #define CIF_LOCK_ASSERT(cif) mtx_assert(&(cif)->cif_mtx, MA_OWNED) argument
293 #define CIF_LOCK(cif) mtx_lock(&(cif)->cif_mtx) argument
294 #define CIF_UNLOCK(cif) mtx_unlock(&(cif)->cif_mtx) argument
295 #define CIF_FREE(cif) do { \ argument
296 CIF_LOCK(cif); \
297 if (TAILQ_EMPTY(&(cif)->cif_vrs)) \
298 carp_free_if(cif); \
300 CIF_UNLOCK(cif); \
1891 carp_multicast_setup(struct carp_if *cif, sa_family_t sa) in carp_multicast_setup() argument
1893 struct ifnet *ifp = cif->cif_ifp; in carp_multicast_setup()
1900 struct ip_moptions *imo = &cif->cif_imo; in carp_multicast_setup()
1928 struct ip6_moptions *im6o = &cif->cif_im6o; in carp_multicast_setup()
1991 carp_multicast_cleanup(struct carp_if *cif, sa_family_t sa) in carp_multicast_cleanup() argument
1994 struct ip_moptions *imo = &cif->cif_imo; in carp_multicast_cleanup()
1998 struct ip6_moptions *im6o = &cif->cif_im6o; in carp_multicast_cleanup()
2006 if (cif->cif_naddrs != 0) in carp_multicast_cleanup()
2018 if (cif->cif_naddrs6 != 0) in carp_multicast_cleanup()
2088 struct carp_if *cif; in carp_alloc() local
2092 if ((cif = ifp->if_carp) == NULL) in carp_alloc()
2093 cif = carp_alloc_if(ifp); in carp_alloc()
2130 CIF_LOCK(cif); in carp_alloc()
2131 TAILQ_INSERT_TAIL(&cif->cif_vrs, sc, sc_list); in carp_alloc()
2132 CIF_UNLOCK(cif); in carp_alloc()
2159 struct carp_if *cif = ifp->if_carp; in carp_destroy() local
2167 CIF_LOCK(cif); in carp_destroy()
2168 TAILQ_REMOVE(&cif->cif_vrs, sc, sc_list); in carp_destroy()
2169 CIF_UNLOCK(cif); in carp_destroy()
2191 struct carp_if *cif; in carp_alloc_if() local
2194 cif = malloc(sizeof(*cif), M_CARP, M_WAITOK|M_ZERO); in carp_alloc_if()
2200 cif->cif_flags |= CIF_PROMISC; in carp_alloc_if()
2202 CIF_LOCK_INIT(cif); in carp_alloc_if()
2203 cif->cif_ifp = ifp; in carp_alloc_if()
2204 TAILQ_INIT(&cif->cif_vrs); in carp_alloc_if()
2207 ifp->if_carp = cif; in carp_alloc_if()
2211 return (cif); in carp_alloc_if()
2215 carp_free_if(struct carp_if *cif) in carp_free_if() argument
2217 struct ifnet *ifp = cif->cif_ifp; in carp_free_if()
2219 CIF_LOCK_ASSERT(cif); in carp_free_if()
2220 KASSERT(TAILQ_EMPTY(&cif->cif_vrs), ("%s: softc list not empty", in carp_free_if()
2227 CIF_LOCK_DESTROY(cif); in carp_free_if()
2229 if (cif->cif_flags & CIF_PROMISC) in carp_free_if()
2233 free(cif, M_CARP); in carp_free_if()
2460 struct carp_if *cif = ifp->if_carp; in carp_attach() local
2492 error = carp_multicast_setup(cif, ifa->ifa_addr->sa_family); in carp_attach()
2494 CIF_FREE(cif); in carp_attach()
2506 cif->cif_naddrs++; in carp_attach()
2512 cif->cif_naddrs6++; in carp_attach()
2537 struct carp_if *cif = ifp->if_carp; in carp_detach() local
2559 cif->cif_naddrs--; in carp_detach()
2565 cif->cif_naddrs6--; in carp_detach()
2572 carp_multicast_cleanup(cif, ifa->ifa_addr->sa_family); in carp_detach()
2587 CIF_FREE(cif); in carp_detach()