Lines Matching refs:intfAddr
625 mDNSlocal int SetupSocket(struct sockaddr *intfAddr, mDNSIPPort port, int interfaceIndex, int *sktPtr)
634 assert(intfAddr != NULL);
639 if (intfAddr->sa_family == AF_INET) *sktPtr = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
641 else if (intfAddr->sa_family == AF_INET6) *sktPtr = socket(PF_INET6, SOCK_DGRAM, IPPROTO_UDP);
645 if (*sktPtr < 0) { err = errno; perror((intfAddr->sa_family == AF_INET) ? "socket AF_INET" : "socket AF_INET6"); }
680 if (intfAddr->sa_family == AF_INET)
717 imr.imr_interface = ((struct sockaddr_in*)intfAddr)->sin_addr;
725 err = setsockopt(*sktPtr, IPPROTO_IP, IP_MULTICAST_IF, &((struct sockaddr_in*)intfAddr)->sin_addr, sizeof(struct in_addr));
755 } // endif (intfAddr->sa_family == AF_INET)
758 else if (intfAddr->sa_family == AF_INET6)
854 } // endif (intfAddr->sa_family == AF_INET6)
876 // intfAddr and whose name is intfName and registers it with mDNS core.
877 mDNSlocal int SetupOneInterface(mDNS *const m, struct sockaddr *intfAddr, struct sockaddr *intfMask, const char *intfName, int intfIndex)
884 assert(intfAddr != NULL);
902 SockAddrTomDNSAddr(intfAddr, &intf->coreIntf.ip, NULL);
929 if (alias->multicastSocket4 == -1 && intfAddr->sa_family == AF_INET)
930 err = SetupSocket(intfAddr, MulticastDNSPort, intf->index, &alias->multicastSocket4);
932 else if (alias->multicastSocket6 == -1 && intfAddr->sa_family == AF_INET6)
933 err = SetupSocket(intfAddr, MulticastDNSPort, intf->index, &alias->multicastSocket6);