Lines Matching defs:ifp
337 in_domifattach(struct ifnet *ifp)
341 if ((error = proto_plumb(PF_INET, ifp)) && error != EEXIST)
343 __func__, error, ifp->if_name, ifp->if_unit);
370 in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp,
393 if (ifp == NULL)
397 error = in_lifaddr_ioctl(so, cmd, &iflr, ifp, p);
409 if (ifp != NULL) {
419 if (iap->ia_ifp != ifp)
450 if (ifp == NULL) {
460 if (ifp == NULL) {
483 if (ia->ia_ifp == ifp &&
495 if ((ifp->if_flags & IFF_POINTOPOINT) &&
537 if (ifp == NULL) {
551 ifnet_lock_exclusive(ifp);
561 if (ifp->if_flags & IFF_BROADCAST) {
565 ia->ia_ifp = ifp;
566 if (!(ifp->if_flags & IFF_LOOPBACK))
569 if_attach_ifa(ifp, ifa);
579 ifnet_lock_done(ifp);
586 (void) in_domifattach(ifp);
597 if (ifp == NULL) {
624 VERIFY(ifp != NULL);
628 ifnet_lock_exclusive(ifp);
636 if (ifp->if_eflags & IFEF_IPV4_ROUTER) {
640 ifp->if_eflags |= IFEF_AUTOCONFIGURING;
644 ifp->if_eflags &= ~IFEF_AUTOCONFIGURING;
645 ifnet_lock_done(ifp);
652 VERIFY(ifp != NULL);
657 ifnet_lock_exclusive(ifp);
665 if (ifp->if_eflags & IFEF_IPV4_ROUTER) {
669 ifp->if_eflags |= IFEF_ARPLL;
673 ifp->if_eflags &= ~IFEF_ARPLL;
674 ifnet_lock_done(ifp);
688 if ((ifp->if_flags & IFF_BROADCAST) == 0) {
701 if ((ifp->if_flags & IFF_POINTOPOINT) == 0) {
722 VERIFY(ifp != NULL && ia != NULL);
723 if ((ifp->if_flags & IFF_POINTOPOINT) == 0) {
740 error = ifnet_ioctl(ifp, PF_INET, SIOCSIFDSTADDR, ia);
773 ifp->if_name, IFNAMSIZ);
774 in_event_data.link_data.if_family = ifp->if_family;
775 in_event_data.link_data.if_unit = (u_int32_t) ifp->if_unit;
803 if ((ifp->if_flags & IFF_BROADCAST) == 0) {
831 ifp->if_name, IFNAMSIZ);
832 in_event_data.link_data.if_family = ifp->if_family;
833 in_event_data.link_data.if_unit = (u_int32_t) ifp->if_unit;
845 VERIFY(ifp != NULL && ia != NULL);
852 error = in_ifinit(ifp, ia, &addr, 1);
855 (void) pf_ifaddr_hook(ifp, cmd);
861 VERIFY(ifp != NULL);
862 error = in_domifattach(ifp);
866 VERIFY(ifp != NULL);
870 ifnet_lock_shared(ifp);
871 TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
879 ifnet_lock_done(ifp);
885 error = proto_unplumb(PF_INET, ifp);
891 VERIFY(ifp != NULL);
895 error = in_setrouter(ifp, intval);
903 VERIFY(ifp != NULL && ia != NULL);
930 ifp->if_name, IFNAMSIZ);
931 in_event_data.link_data.if_family = ifp->if_family;
932 in_event_data.link_data.if_unit = (u_int32_t) ifp->if_unit;
945 VERIFY(ifp != NULL && ia != NULL);
969 in_ifscrub(ifp, ia, 0);
976 if ((ifp->if_flags & IFF_POINTOPOINT) &&
979 in_ifscrub(ifp, ia, 0);
987 error = in_ifinit(ifp, ia, &addr, 0);
993 (void) pf_ifaddr_hook(ifp, cmd);
996 if ((ifp->if_flags & IFF_BROADCAST) &&
1028 ifp->if_name, IFNAMSIZ);
1029 in_event_data.link_data.if_family = ifp->if_family;
1030 in_event_data.link_data.if_unit = ifp->if_unit;
1044 VERIFY(ifp != NULL && ia != NULL);
1045 error = ifnet_ioctl(ifp, PF_INET, SIOCDIFADDR, ia);
1074 ifp->if_name, IFNAMSIZ);
1075 in_event_data.link_data.if_family = ifp->if_family;
1076 in_event_data.link_data.if_unit = (u_int32_t) ifp->if_unit;
1096 in_ifscrub(ifp, ia, 0);
1097 ifnet_lock_exclusive(ifp);
1100 if_detach_ifa(ifp, ifa);
1108 if ((ifp->if_flags & IFF_MULTICAST) != 0 ||
1109 ifp->if_allhostsinm != NULL ) {
1111 TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
1119 ifnet_lock_done(ifp);
1121 lck_mtx_lock(&ifp->if_addrconfig_lock);
1122 if (ifa == NULL && ifp->if_allhostsinm != NULL) {
1123 struct in_multi *inm = ifp->if_allhostsinm;
1124 ifp->if_allhostsinm = NULL;
1130 lck_mtx_unlock(&ifp->if_addrconfig_lock);
1132 ifnet_lock_done(ifp);
1142 ifa = ifa_ifpgetprimary(ifp, AF_INET);
1150 error = ifnet_ioctl(ifp, PF_INET, SIOCSIFADDR, ifa);
1158 (void) pf_ifaddr_hook(ifp, cmd);
1246 struct ifnet *ifp, struct proc *p)
1250 VERIFY(ifp != NULL);
1303 return in_control(so, SIOCAIFADDR, (caddr_t)&ifra, ifp, p);
1342 ifnet_lock_shared(ifp);
1343 TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
1361 ifnet_lock_done(ifp);
1371 if ((ifp->if_flags & IFF_POINTOPOINT) != 0) {
1396 if ((ifp->if_flags & IFF_POINTOPOINT) != 0) {
1405 ifp, p);
1422 in_setrouter(struct ifnet *ifp, int enable)
1424 if (ifp->if_flags & IFF_LOOPBACK)
1427 ifnet_lock_exclusive(ifp);
1429 ifp->if_eflags |= IFEF_IPV4_ROUTER;
1430 ifp->if_eflags &= ~(IFEF_ARPLL | IFEF_AUTOCONFIGURING);
1432 ifp->if_eflags &= ~IFEF_IPV4_ROUTER;
1434 ifnet_lock_done(ifp);
1437 in_purgeaddrs(ifp);
1446 in_ifscrub(struct ifnet *ifp, struct in_ifaddr *ia, int locked)
1456 if (ifp->if_flags & (IFF_LOOPBACK|IFF_POINTOPOINT))
1566 struct ifnet *ifp,
1590 if ((ifp->if_flags & IFF_POINTOPOINT))
1604 ifa0 = ifa_ifpgetprimary(ifp, AF_INET);
1606 error = ifnet_ioctl(ifp, PF_INET, cmd, ia);
1623 error = ifnet_ioctl(ifp, PF_INET, SIOCSIFADDR, ifa0);
1638 if ((ifp->if_flags & IFF_POINTOPOINT))
1659 in_ifscrub(ifp, ia, 1);
1686 ia->ia_ifa.ifa_metric = ifp->if_metric;
1687 if (ifp->if_flags & IFF_BROADCAST) {
1692 } else if (ifp->if_flags & IFF_LOOPBACK) {
1695 } else if (ifp->if_flags & IFF_POINTOPOINT) {
1722 if (ifp->if_flags & IFF_MULTICAST) {
1725 lck_mtx_lock(&ifp->if_addrconfig_lock);
1727 if (ifp->if_allhostsinm == NULL) {
1729 inm = in_addmulti(&addr, ifp);
1736 ifp->if_allhostsinm = inm;
1738 printf("Failed to add membership to all-hosts multicast address on interface %s%d\n", ifp->if_name, ifp->if_unit);
1741 lck_mtx_unlock(&ifp->if_addrconfig_lock);
1754 in_broadcast(struct in_addr in, struct ifnet *ifp)
1761 if ((ifp->if_flags & IFF_BROADCAST) == 0)
1769 ifnet_lock_shared(ifp);
1770 TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
1786 ifnet_lock_done(ifp);
1791 ifnet_lock_done(ifp);
1797 in_purgeaddrs(struct ifnet *ifp)
1808 err = ifnet_get_address_list_family_internal(ifp, &ifap, AF_INET, 1,
1822 err = in_control(NULL, SIOCDIFADDR, (caddr_t)&ifr, ifp,
1843 printf("%s: SIOCDIFADDR ifp=%p ifa_addr=%s "
1844 "ifa_dstaddr=%s (err=%d)\n", __func__, ifp,
1851 "ifp=%p (err=%d)\n", __func__, ifp, err);