Lines Matching defs:ifp

159  * its ifp->if_carp pointer. Each softc represents one unique virtual
168 * through its ifp->if_addrhead queue to find all interface addresses
286 #define IFNET_FOREACH_IFA(ifp, ifa) \
287 IF_ADDR_LOCK_ASSERT(ifp); \
288 TAILQ_FOREACH((ifa), &(ifp)->if_addrhead, ifa_link) \
298 #define IFNET_FOREACH_CARP(ifp, sc) \
299 KASSERT(mtx_owned(&ifp->if_carp->cif_mtx) || \
301 TAILQ_FOREACH((sc), &(ifp)->if_carp->cif_vrs, sc_list)
598 struct ifnet *ifp = m->m_pkthdr.rcvif;
605 IF_ADDR_RLOCK(ifp);
606 IFNET_FOREACH_IFA(ifp, ifa)
612 IF_ADDR_RUNLOCK(ifp);
623 CARP_DEBUG("%s: invalid version %d\n", ifp->if_xname,
637 sc->sc_vhid, ifp->if_xname);
1075 carp_iamatch6(struct ifnet *ifp, struct in6_addr *taddr)
1080 IF_ADDR_RLOCK(ifp);
1081 TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
1092 IF_ADDR_RUNLOCK(ifp);
1098 carp_macmatch6(struct ifnet *ifp, struct mbuf *m, const struct in6_addr *taddr)
1102 IF_ADDR_RLOCK(ifp);
1103 IFNET_FOREACH_IFA(ifp, ifa)
1109 IF_ADDR_RUNLOCK(ifp);
1122 IF_ADDR_RUNLOCK(ifp);
1129 carp_forus(struct ifnet *ifp, u_char *dhost)
1137 CIF_LOCK(ifp->if_carp);
1138 IFNET_FOREACH_CARP(ifp, sc) {
1145 CIF_UNLOCK(ifp->if_carp);
1149 CIF_UNLOCK(ifp->if_carp);
1270 struct ifnet *ifp = cif->cif_ifp;
1291 if ((error = in_joingroup(ifp, &addr, NULL,
1297 imo->imo_multicast_ifp = ifp;
1319 im6o->im6o_multicast_ifp = ifp;
1325 if ((error = in6_setscope(&in6, ifp, NULL)) != 0) {
1330 if ((error = in6_mc_join(ifp, &in6, NULL, &in6m, 0)) != 0) {
1344 if ((error = in6_setscope(&in6, ifp, NULL)) != 0) {
1350 if ((error = in6_mc_join(ifp, &in6, NULL, &in6m, 0)) != 0) {
1407 carp_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *sa)
1435 switch (ifp->if_type) {
1475 ifp->if_xname, ifp->if_type);
1483 carp_alloc(struct ifnet *ifp)
1490 if ((cif = ifp->if_carp) == NULL)
1491 cif = carp_alloc_if(ifp);
1502 sc->sc_carpdev = ifp;
1541 struct ifnet *ifp = sc->sc_carpdev;
1542 struct carp_if *cif = ifp->if_carp;
1572 carp_alloc_if(struct ifnet *ifp)
1579 if ((error = ifpromisc(ifp, 1)) != 0)
1581 __func__, ifp->if_xname, error);
1586 cif->cif_ifp = ifp;
1589 IF_ADDR_WLOCK(ifp);
1590 ifp->if_carp = cif;
1591 if_ref(ifp);
1592 IF_ADDR_WUNLOCK(ifp);
1600 struct ifnet *ifp = cif->cif_ifp;
1606 IF_ADDR_WLOCK(ifp);
1607 ifp->if_carp = NULL;
1608 IF_ADDR_WUNLOCK(ifp);
1613 ifpromisc(ifp, 0);
1614 if_rele(ifp);
1639 struct ifnet *ifp;
1646 ifp = ifunit_ref(ifr->ifr_name);
1647 if (ifp == NULL)
1650 switch (ifp->if_type) {
1662 if ((ifp->if_flags & IFF_MULTICAST) == 0) {
1678 if (ifp->if_carp) {
1679 IFNET_FOREACH_CARP(ifp, sc)
1684 sc = carp_alloc(ifp);
1745 if (ifp->if_carp == NULL) {
1752 IFNET_FOREACH_CARP(ifp, sc)
1766 IFNET_FOREACH_CARP(ifp, sc)
1770 CIF_UNLOCK(ifp->if_carp);
1776 IFNET_FOREACH_CARP(ifp, sc) {
1783 CIF_UNLOCK(ifp->if_carp);
1799 if_rele(ifp);
1817 struct ifnet *ifp = ifa->ifa_ifp;
1818 struct carp_if *cif = ifp->if_carp;
1837 if (ifp->if_carp == NULL) {
1842 IFNET_FOREACH_CARP(ifp, sc)
1893 struct ifnet *ifp = ifa->ifa_ifp;
1894 struct carp_if *cif = ifp->if_carp;
1971 carp_linkstate(struct ifnet *ifp)
1975 CIF_LOCK(ifp->if_carp);
1976 IFNET_FOREACH_CARP(ifp, sc) {
1981 CIF_UNLOCK(ifp->if_carp);