Lines Matching refs:hints
649 const struct evutil_addrinfo *hints) in evutil_new_addrinfo() argument
652 EVUTIL_ASSERT(hints); in evutil_new_addrinfo()
654 if (hints->ai_socktype == 0 && hints->ai_protocol == 0) { in evutil_new_addrinfo()
658 memcpy(&tmp, hints, sizeof(tmp)); in evutil_new_addrinfo()
683 res->ai_socktype = hints->ai_socktype; in evutil_new_addrinfo()
684 res->ai_protocol = hints->ai_protocol; in evutil_new_addrinfo()
723 const struct evutil_addrinfo *hints) in evutil_parse_servname() argument
729 if (!(hints->ai_flags & EVUTIL_AI_NUMERICSERV)) { in evutil_parse_servname()
768 evutil_getaddrinfo_infer_protocols(struct evutil_addrinfo *hints) in evutil_getaddrinfo_infer_protocols() argument
771 if (!hints->ai_protocol && hints->ai_socktype) { in evutil_getaddrinfo_infer_protocols()
772 if (hints->ai_socktype == SOCK_DGRAM) in evutil_getaddrinfo_infer_protocols()
773 hints->ai_protocol = IPPROTO_UDP; in evutil_getaddrinfo_infer_protocols()
774 else if (hints->ai_socktype == SOCK_STREAM) in evutil_getaddrinfo_infer_protocols()
775 hints->ai_protocol = IPPROTO_TCP; in evutil_getaddrinfo_infer_protocols()
779 if (!hints->ai_socktype && hints->ai_protocol) { in evutil_getaddrinfo_infer_protocols()
780 if (hints->ai_protocol == IPPROTO_UDP) in evutil_getaddrinfo_infer_protocols()
781 hints->ai_socktype = SOCK_DGRAM; in evutil_getaddrinfo_infer_protocols()
782 else if (hints->ai_protocol == IPPROTO_TCP) in evutil_getaddrinfo_infer_protocols()
783 hints->ai_socktype = SOCK_STREAM; in evutil_getaddrinfo_infer_protocols()
785 else if (hints->ai_protocol == IPPROTO_SCTP) in evutil_getaddrinfo_infer_protocols()
786 hints->ai_socktype = SOCK_STREAM; in evutil_getaddrinfo_infer_protocols()
810 struct evutil_addrinfo *hints, struct evutil_addrinfo **res, int *portnum) in evutil_getaddrinfo_common() argument
819 if (hints->ai_family != PF_UNSPEC && hints->ai_family != PF_INET && in evutil_getaddrinfo_common()
820 hints->ai_family != PF_INET6) in evutil_getaddrinfo_common()
823 evutil_getaddrinfo_infer_protocols(hints); in evutil_getaddrinfo_common()
826 pname = evutil_unparse_protoname(hints->ai_protocol); in evutil_getaddrinfo_common()
830 port = evutil_parse_servname(servname, pname, hints); in evutil_getaddrinfo_common()
840 if (hints->ai_family != PF_INET) { /* INET6 or UNSPEC. */ in evutil_getaddrinfo_common()
845 if (hints->ai_flags & EVUTIL_AI_PASSIVE) { in evutil_getaddrinfo_common()
852 sizeof(sin6), hints); in evutil_getaddrinfo_common()
857 if (hints->ai_family != PF_INET6) { /* INET or UNSPEC */ in evutil_getaddrinfo_common()
862 if (hints->ai_flags & EVUTIL_AI_PASSIVE) { in evutil_getaddrinfo_common()
869 sizeof(sin), hints); in evutil_getaddrinfo_common()
883 if (hints->ai_family == PF_INET6 || hints->ai_family == PF_UNSPEC) { in evutil_getaddrinfo_common()
891 sizeof(sin6), hints); in evutil_getaddrinfo_common()
899 if (hints->ai_family == PF_INET || hints->ai_family == PF_UNSPEC) { in evutil_getaddrinfo_common()
907 sizeof(sin), hints); in evutil_getaddrinfo_common()
917 if ((hints->ai_flags & EVUTIL_AI_NUMERICHOST)) { in evutil_getaddrinfo_common()
987 int port, const struct evutil_addrinfo *hints) in addrinfo_from_hostent() argument
1024 ai = evutil_new_addrinfo(sa, socklen, hints); in addrinfo_from_hostent()
1032 if (res && ((hints->ai_flags & EVUTIL_AI_CANONNAME) && ent->h_name)) { in addrinfo_from_hostent()
1049 evutil_adjust_hints_for_addrconfig(struct evutil_addrinfo *hints) in evutil_adjust_hints_for_addrconfig() argument
1051 if (!(hints->ai_flags & EVUTIL_AI_ADDRCONFIG)) in evutil_adjust_hints_for_addrconfig()
1053 if (hints->ai_family != PF_UNSPEC) in evutil_adjust_hints_for_addrconfig()
1058 hints->ai_family = PF_INET; in evutil_adjust_hints_for_addrconfig()
1060 hints->ai_family = PF_INET6; in evutil_adjust_hints_for_addrconfig()
1093 struct evutil_addrinfo hints; in test_for_getaddrinfo_hacks() local
1095 memset(&hints,0,sizeof(hints)); in test_for_getaddrinfo_hacks()
1096 hints.ai_family = PF_UNSPEC; in test_for_getaddrinfo_hacks()
1097 hints.ai_flags = in test_for_getaddrinfo_hacks()
1105 r = getaddrinfo("1.2.3.4", "80", &hints, &ai); in test_for_getaddrinfo_hacks()
1106 hints.ai_socktype = SOCK_STREAM; in test_for_getaddrinfo_hacks()
1107 r2 = getaddrinfo("1.2.3.4", "80", &hints, &ai2); in test_for_getaddrinfo_hacks()
1191 struct evutil_addrinfo hints; in evutil_getaddrinfo() local
1195 memcpy(&hints, hints_in, sizeof(hints)); in evutil_getaddrinfo()
1197 memset(&hints, 0, sizeof(hints)); in evutil_getaddrinfo()
1198 hints.ai_family = PF_UNSPEC; in evutil_getaddrinfo()
1203 if (hints.ai_family == PF_UNSPEC && in evutil_getaddrinfo()
1204 (hints.ai_flags & EVUTIL_AI_ADDRCONFIG)) { in evutil_getaddrinfo()
1205 evutil_adjust_hints_for_addrconfig(&hints); in evutil_getaddrinfo()
1211 if (hints.ai_flags & EVUTIL_AI_NUMERICSERV) { in evutil_getaddrinfo()
1231 err = evutil_getaddrinfo_common(nodename,servname,&hints, in evutil_getaddrinfo()
1243 need_np_hack = need_numeric_port_hack() && servname && !hints.ai_socktype in evutil_getaddrinfo()
1248 NULL,servname,&hints, res, &portnum); in evutil_getaddrinfo()
1253 evutil_getaddrinfo_infer_protocols(&hints); in evutil_getaddrinfo()
1266 hints.ai_flags &= ~ALL_NONNATIVE_AI_FLAGS; in evutil_getaddrinfo()
1268 err = getaddrinfo(nodename, servname, &hints, res); in evutil_getaddrinfo()
1283 struct evutil_addrinfo hints; in evutil_getaddrinfo()
1286 memcpy(&hints, hints_in, sizeof(hints)); in evutil_getaddrinfo()
1288 memset(&hints, 0, sizeof(hints)); in evutil_getaddrinfo()
1289 hints.ai_family = PF_UNSPEC; in evutil_getaddrinfo()
1292 evutil_adjust_hints_for_addrconfig(&hints); in evutil_getaddrinfo()
1294 err = evutil_getaddrinfo_common(nodename, servname, &hints, res, &port); in evutil_getaddrinfo()
1351 if (ent->h_addrtype != hints.ai_family && in evutil_getaddrinfo()
1352 hints.ai_family != PF_UNSPEC) { in evutil_getaddrinfo()
1368 *res = addrinfo_from_hostent(ent, port, &hints); in evutil_getaddrinfo()