Lines Matching refs:ep
299 endpt * ep; member
722 for (ifi.ep = ep_list; ifi.ep != NULL; ifi.ep = ifi.ep->elink) in interface_enumerate()
731 endpt *ep in init_interface() argument
734 ZERO(*ep); in init_interface()
735 ep->fd = INVALID_SOCKET; in init_interface()
736 ep->bfd = INVALID_SOCKET; in init_interface()
737 ep->phase = sys_interphase; in init_interface()
778 endpt *ep in delete_interface() argument
782 io_completion_port_remove_interface(ep); in delete_interface()
784 free(ep); in delete_interface()
793 endpt * ep in add_interface() argument
803 ep->addr_refid = addr2refid(&ep->sin); in add_interface()
805 if (IS_IPV6(&ep->sin)) { in add_interface()
806 ep->old_refid = BYTESWAP32(ep->addr_refid); in add_interface()
810 LINK_TAIL_SLIST(ep_list, ep, elink, endpt); in add_interface()
814 if (ep->ignore_packets || !(INT_MULTICAST & ep->flags) || in add_interface()
815 INT_LOOPBACK & ep->flags) in add_interface()
818 if (AF_INET6 == ep->family) in add_interface()
821 pmclisthead = (AF_INET == ep->family) in add_interface()
831 if ( ep->family != scan->family in add_interface()
832 || ep->ifindex != scan->ifindex) { in add_interface()
835 same_subnet = addr_samesubnet(&ep->sin, &ep->mask, in add_interface()
840 stoa(&ep->sin), stoa(&scan->sin))); in add_interface()
844 LINK_SLIST(*pmclisthead, ep, mclink); in add_interface()
845 if (INVALID_SOCKET == ep->fd) in add_interface()
851 switch (AF(&ep->sin)) { in add_interface()
854 rc = setsockopt(ep->fd, IPPROTO_IP, in add_interface()
856 (void *)&NSRCADR(&ep->sin), in add_interface()
857 sizeof(NSRCADR(&ep->sin))); in add_interface()
861 stoa(&ep->sin)); in add_interface()
866 rc = setsockopt(ep->fd, IPPROTO_IPV6, in add_interface()
868 (void *)&ep->ifindex, in add_interface()
869 sizeof(ep->ifindex)); in add_interface()
871 if (rc && ep->ifindex != SCOPE(&ep->sin)) in add_interface()
874 ep->ifindex, stoa(&ep->sin)); in add_interface()
888 endpt * ep in remove_interface() argument
896 UNLINK_SLIST(unlinked, ep_list, ep, elink, endpt); in remove_interface()
897 if (!ep->ignore_packets && INT_MULTICAST & ep->flags) { in remove_interface()
898 pmclisthead = (AF_INET == ep->family) in remove_interface()
901 UNLINK_SLIST(unlinked, *pmclisthead, ep, mclink, endpt); in remove_interface()
903 stoa(&ep->sin), in remove_interface()
907 (AF_INET == ep->family) in remove_interface()
911 delete_interface_from_list(ep); in remove_interface()
913 if (ep->fd != INVALID_SOCKET) { in remove_interface()
918 ep->ifnum, in remove_interface()
919 ep->name, in remove_interface()
920 stoa(&ep->sin), in remove_interface()
921 SRCPORT(&ep->sin), in remove_interface()
922 ep->received, in remove_interface()
923 ep->sent, in remove_interface()
924 ep->notsent, in remove_interface()
925 current_time - ep->starttime); in remove_interface()
926 close_and_delete_fd_from_list(ep->fd, ep); in remove_interface()
927 ep->fd = INVALID_SOCKET; in remove_interface()
930 if (ep->bfd != INVALID_SOCKET) { in remove_interface()
933 stoa(&ep->bcast), ep->ifnum, ep->name); in remove_interface()
934 close_and_delete_fd_from_list(ep->bfd, ep); in remove_interface()
935 ep->bfd = INVALID_SOCKET; in remove_interface()
938 io_completion_port_remove_interface(ep); in remove_interface()
942 mon_clearinterface(ep); in remove_interface()
945 SET_HOSTMASK(&resmask, AF(&ep->sin)); in remove_interface()
946 success = hack_restrict(RESTRICT_REMOVEIF, &ep->sin, &resmask, 0, in remove_interface()
951 stoa(&ep->sin)); in remove_interface()
959 endpt * ep in log_listen_address() argument
963 (ep->ignore_packets) in log_listen_address()
966 ep->ifnum, in log_listen_address()
967 ep->name, in log_listen_address()
968 sptoa(&ep->sin)); in log_listen_address()
1683 endpt * ep; in update_interfaces() local
1804 ep = getinterface(&enumep.sin, INT_WILDCARD); in update_interfaces()
1806 if (NULL == ep) { in update_interfaces()
1807 ep = emalloc(sizeof(*ep)); in update_interfaces()
1808 memcpy(ep, &enumep, sizeof(*ep)); in update_interfaces()
1810 newaddrs_tail->elink = ep; in update_interfaces()
1811 newaddrs_tail = ep; in update_interfaces()
1813 newaddrs_tail = newaddrs = ep; in update_interfaces()
1818 if (!refresh_interface(ep)) { in update_interfaces()
1831 if (ep->phase != sys_interphase) { in update_interfaces()
1840 strlcpy(ep->name, enumep.name, sizeof(ep->name)); in update_interfaces()
1841 ep->ignore_packets = enumep.ignore_packets; in update_interfaces()
1848 stoa(&ep->sin), ep->ifnum, ep->name); in update_interfaces()
1850 strlcpy(ep->name, "*multiple*", sizeof(ep->name)); in update_interfaces()
1853 DPRINT_INTERFACE(4, (ep, "updating ", " present\n")); in update_interfaces()
1855 if (ep->ignore_packets != enumep.ignore_packets) { in update_interfaces()
1874 enumep.name, ep->name, stoa(&enumep.sin)); in update_interfaces()
1876 ep->ignore_packets = TRUE; in update_interfaces()
1879 ep->phase = sys_interphase; in update_interfaces()
1882 ifi.ep = ep; in update_interfaces()
1893 for (ep = newaddrs; ep != NULL; ep = ep->elink) { in update_interfaces()
1894 if (IS_IPV6(&ep->sin) && is_linklocal(&ep->sin)) { in update_interfaces()
1897 && ep != ep2 in update_interfaces()
1900 ep->flags |= INT_LL_OF_GLOB; in update_interfaces()
1909 ep = create_interface(port, ep2); in update_interfaces()
1910 if (ep != NULL) { in update_interfaces()
1912 ifi.ep = ep; in update_interfaces()
1918 (ep, "updating ", " new - created\n")); in update_interfaces()
1926 stoa(&ep->sin)); in update_interfaces()
1935 for (ep = ep_list; ep != NULL; ep = next_ep) { in update_interfaces()
1936 next_ep = ep->elink; in update_interfaces()
1945 if (((INT_WILDCARD | INT_MCASTIF) & ep->flags) || in update_interfaces()
1946 ep->phase == sys_interphase) in update_interfaces()
1949 DPRINT_INTERFACE(3, (ep, "updating ", in update_interfaces()
1951 remove_interface(ep); in update_interfaces()
1954 ifi.ep = ep; in update_interfaces()
1959 while (ep->peers != NULL) { in update_interfaces()
1960 set_peerdstadr(ep->peers, NULL); in update_interfaces()
1966 if (ep == loopback_interface) { in update_interfaces()
1969 delete_interface(ep); in update_interfaces()
1988 for (ep = ep_list; ep != NULL; ep = ep->elink) { in update_interfaces()
1991 if (!(INT_MCASTIF & ep->flags) || (INT_MCASTOPEN & ep->flags)) { in update_interfaces()
1998 if (entry->ep == ep) { in update_interfaces()
1999 if (socket_multicast_enable(ep, &entry->addr)) { in update_interfaces()
2002 stoa(&ep->sin), in update_interfaces()
2284 endpt *ep; in set_reuseaddr() local
2286 for (ep = ep_list; ep != NULL; ep = ep->elink) { in set_reuseaddr()
2287 if (ep->flags & INT_WILDCARD) in set_reuseaddr()
2295 ep->name, stoa(&ep->sin), in set_reuseaddr()
2298 if (ep->fd != INVALID_SOCKET) { in set_reuseaddr()
2299 if (setsockopt(ep->fd, SOL_SOCKET, SO_REUSEADDR, in set_reuseaddr()
2302 stoa(&ep->sin), flag ? "on" : "off"); in set_reuseaddr()
2647 endpt * ep; in io_setbclient() local
2653 for (ep = ep_list; ep != NULL; ep = ep->elink) { in io_setbclient()
2657 if (AF_INET == ep->family) { in io_setbclient()
2661 if (ep->flags & (INT_WILDCARD | INT_LOOPBACK)) in io_setbclient()
2665 if (ep->ignore_packets) in io_setbclient()
2669 if (!(ep->flags & INT_BROADCAST)) in io_setbclient()
2673 REQUIRE(IS_IPV4(&ep->bcast)); in io_setbclient()
2676 if (ep->flags & INT_BCASTOPEN) { in io_setbclient()
2688 ep->family = AF_INET; in io_setbclient()
2689 ep->bfd = open_socket(&ep->bcast, 1, 0, ep); in io_setbclient()
2695 if (ep->bfd != INVALID_SOCKET) { in io_setbclient()
2697 ep->flags |= INT_BCASTOPEN; in io_setbclient()
2700 stoa(&ep->bcast), ep->ifnum, ep->name); in io_setbclient()
2714 if (ep->fd != INVALID_SOCKET) { in io_setbclient()
2715 ep->flags |= INT_BCASTOPEN; in io_setbclient()
2724 stoa(&ep->bcast), ep->ifnum, ep->name); in io_setbclient()
2756 endpt *ep; in io_unsetbclient() local
2758 for (ep = ep_list; ep != NULL; ep = ep->elink) { in io_unsetbclient()
2759 if (INT_WILDCARD & ep->flags) in io_unsetbclient()
2761 if (!(INT_BCASTOPEN & ep->flags)) in io_unsetbclient()
2764 if (ep->bfd != INVALID_SOCKET) { in io_unsetbclient()
2768 stoa(&ep->bcast), ep->ifnum, ep->name); in io_unsetbclient()
2769 close_and_delete_fd_from_list(ep->bfd, ep); in io_unsetbclient()
2770 ep->bfd = INVALID_SOCKET; in io_unsetbclient()
2772 ep->flags &= ~INT_BCASTOPEN; in io_unsetbclient()
2787 endpt * ep; local
2802 ep = new_interface(NULL);
2807 ep->sin = *addr;
2808 SET_PORT(&ep->sin, NTP_PORT);
2809 ep->family = AF(&ep->sin);
2810 AF(&ep->mask) = ep->family;
2811 SET_ONESMASK(&ep->mask);
2814 ep->bfd = INVALID_SOCKET;
2815 ep->fd = open_socket(&ep->sin, 0, 0, ep);
2816 if (ep->fd != INVALID_SOCKET) {
2817 ep->ignore_packets = ISC_FALSE;
2818 ep->flags |= INT_MCASTIF;
2819 ep->ifindex = SCOPE(addr);
2821 strlcpy(ep->name, "multicast", sizeof(ep->name));
2822 DPRINT_INTERFACE(2, (ep, "multicast add ", "\n"));
2823 add_interface(ep);
2824 log_listen_address(ep);
2827 delete_interface(ep);
2830 ep = wildipv4;
2832 ep = wildipv6;
2834 ep = NULL;
2836 if (ep != NULL) {
2839 ep->bcast = *addr;
2842 stoa(addr), ep->ifnum, ep->name);
2851 one_ep = ep;
2861 for (ep = ep_list; ep != NULL; ep = ep->elink) {
2862 if (ep->ignore_packets || AF(&ep->sin) != AF(addr) ||
2863 !(INT_MULTICAST & ep->flags) ||
2864 (INT_LOOPBACK | INT_WILDCARD) & ep->flags)
2866 one_ep = ep;
2868 if (socket_multicast_enable(ep, addr))
2871 stoa(&ep->sin),
3168 endpt * ep, argument
3184 src = ep;
3829 endpt * ep; local
3884 for (ep = ep_list; ep != NULL; ep = ep->elink) {
3887 fd = ep->fd;
3889 if (!(ep->flags & INT_BCASTOPEN))
3891 fd = ep->bfd;
3898 fd, ep, ts);
3960 endpt *ep; local
3975 ep = loopback_interface;
3978 ep = findbcastinter(srcadr);
3979 if (ep != NULL)
3981 stoa(&ep->sin), stoa(srcadr)));
3986 ep = dstadr;
3987 if (NULL == ep) {
3988 ep = wild;
3997 if (wild == ep) {
3998 ep = findinterface(srcadr);
4005 if (ep != NULL && (INT_WILDCARD & ep->flags)) {
4007 ep = NULL;
4011 ep = loopback_interface;
4014 return ep;
4166 endpt * ep; local
4174 for (ep = ep_list; ep != NULL; ep = ep->elink) {
4175 if (ep->ignore_packets ||
4176 AF(addr) != ep->family ||
4177 flags & ep->flags)
4180 calc_addr_distance(&addr_dist, addr, &ep->sin);
4184 winner = ep;
4566 endpt *ep /* req. if fd is in struct endpt */ argument
4581 if (ep != NULL) {
4582 io_completion_port_remove_socket(fd, ep);
4610 endpt * ep argument
4621 laddr->ep = ep;
4662 UNLINK_EXPR_SLIST_CURRENT()->ep, link,
4690 return entry->ep;
4717 && (entry->ep->flags & flags) == flags) {
4720 return entry->ep;