From: Apple Date: Tue, 19 Jan 2010 22:53:00 +0000 (+0000) Subject: Libinfo-330.3.tar.gz X-Git-Tag: mac-os-x-1064^0 X-Git-Url: https://git.saurik.com/apple/libinfo.git/commitdiff_plain/4ffdd16407b59910d716427f4f70dd04bf5dd4d8 Libinfo-330.3.tar.gz --- diff --git a/dns.subproj/Makefile b/dns.subproj/Makefile index 356ebaf..2c168da 100644 --- a/dns.subproj/Makefile +++ b/dns.subproj/Makefile @@ -4,6 +4,9 @@ Install_Dir = /scratch BuildDebug = YES BuildProfile = YES +Install_Headers_Directory = /usr/include/arpa +Install_Headers = inet.h + CFILES = herror.c res_comp.c res_data.c res_debug.c\ res_init.c res_mkquery.c res_query.c res_send.c @@ -12,7 +15,3 @@ Extra_CC_Flags = -Wall -fno-common -I. \ -DUSE_OPTIONS_H -D__DARWIN_NON_CANCELABLE=1 include $(MAKEFILEPATH)/CoreOS/ReleaseControl/BSDCommon.make - -after_install: - $(INSTALL_DIRECTORY) "$(DSTROOT)"/usr/include/arpa - $(INSTALL_FILE) inet.h "$(DSTROOT)"/usr/include/arpa/inet.h diff --git a/lookup.subproj/file_module.c b/lookup.subproj/file_module.c index 1744e1d..28e38eb 100644 --- a/lookup.subproj/file_module.c +++ b/lookup.subproj/file_module.c @@ -1678,6 +1678,13 @@ file_mac_all(si_mod_t *si) return _fsi_get_ether(si, NULL, SEL_ALL); } +static si_list_t * +file_addrinfo(si_mod_t *si, const void *node, const void *serv, uint32_t family, uint32_t socktype, uint32_t proto, uint32_t flags, const char *interface, uint32_t *err) +{ + if (err != NULL) *err = SI_STATUS_NO_ERROR; + return _gai_simple(si, node, serv, family, socktype, proto, flags, interface, err); +} + __private_extern__ si_mod_t * si_module_static_file() { @@ -1747,9 +1754,8 @@ si_module_static_file() out->sim_mac_bymac = file_mac_bymac; out->sim_mac_all = file_mac_all; - /* no addrinfo support */ out->sim_wants_addrinfo = NULL; - out->sim_addrinfo = NULL; + out->sim_addrinfo = file_addrinfo; /* no nameinfo support */ out->sim_nameinfo = NULL; diff --git a/lookup.subproj/mdns_module.c b/lookup.subproj/mdns_module.c index 9b61a4e..a67ef54 100644 --- a/lookup.subproj/mdns_module.c +++ b/lookup.subproj/mdns_module.c @@ -961,8 +961,6 @@ _mdns_hostbyaddr(si_mod_t *si, const void *addr, int af, const char *interface, return out; } -// embedded does not do parallel A/AAAA -#if !TARGET_OS_EMBEDDED static si_list_t * _mdns_addrinfo(si_mod_t *si, const void *node, const void *serv, uint32_t family, uint32_t socktype, uint32_t proto, uint32_t flags, const char *interface, uint32_t *err) { @@ -1046,7 +1044,6 @@ _mdns_addrinfo(si_mod_t *si, const void *node, const void *serv, uint32_t family } return out; } -#endif // !TARGET_OS_EMBEDDED static si_list_t * _mdns_srv_byname(si_mod_t* si, const char *qname, const char *interface, uint32_t *err) @@ -1206,9 +1203,7 @@ si_module_static_mdns(void) out->sim_host_byname = _mdns_hostbyname; out->sim_host_byaddr = _mdns_hostbyaddr; out->sim_item_call = _mdns_item_call; -#if !TARGET_OS_EMBEDDED out->sim_addrinfo = _mdns_addrinfo; -#endif out->sim_srv_byname = _mdns_srv_byname; int res; @@ -1792,7 +1787,7 @@ _mdns_query_mDNSResponder(const char *name, int class, int type, const char *int #if TARGET_OS_EMBEDDED // log a warning for queries from the main thread if (pthread_main_np()) asl_log(NULL, NULL, ASL_LEVEL_WARNING, "Warning: Libinfo call to mDNSResponder on main thread"); -#endif // #if TARGET_OS_EMBEDDED +#endif // TARGET_OS_EMBEDDED // Timeout Logic // The kevent(2) API timeout parameter is used to enforce the total diff --git a/lookup.subproj/si_getaddrinfo.c b/lookup.subproj/si_getaddrinfo.c index 9bd03f4..a55af6b 100644 --- a/lookup.subproj/si_getaddrinfo.c +++ b/lookup.subproj/si_getaddrinfo.c @@ -576,7 +576,7 @@ si_addrinfo_list_from_hostent(si_mod_t *si, uint32_t socktype, uint32_t proto, u /* _gai_simple * Simple lookup via gethostbyname2(3) mechanism. */ -static si_list_t * +__private_extern__ si_list_t * _gai_simple(si_mod_t *si, const void *nodeptr, const void *servptr, uint32_t family, uint32_t socktype, uint32_t proto, uint32_t flags, const char *interface, uint32_t *err) { si_item_t *h4_item = NULL, *h6_item = NULL; diff --git a/lookup.subproj/si_module.h b/lookup.subproj/si_module.h index 16ea8f3..676c1f9 100644 --- a/lookup.subproj/si_module.h +++ b/lookup.subproj/si_module.h @@ -349,5 +349,6 @@ si_list_t *si_addrinfo_list(si_mod_t *si, int socktype, int proto, struct in_add si_list_t *si_addrinfo_list_from_hostent(si_mod_t *si, uint32_t socktype, uint32_t proto, uint16_t port, uint16_t scope, const struct hostent *h4, const struct hostent *h6); int _gai_serv_to_port(const char *serv, uint32_t proto, uint16_t *port); +si_list_t *_gai_simple(si_mod_t *si, const void *nodeptr, const void *servptr, uint32_t family, uint32_t socktype, uint32_t proto, uint32_t flags, const char *interface, uint32_t *err); #endif /* ! __SI_MODULE_H__ */