}
}
-__private_extern__ void
+__attribute__((__visibility__("hidden"))) void
_check_cache(sdns_handle_t *sdns)
{
int i, n, status, refresh, sc_dns_count;
return res_nquery_soa_min(pdns->res, name, class, type, (u_char *)buf, len, from, (int32_t *)fromlen, min);
}
-__private_extern__ int
+__attribute__((__visibility__("hidden"))) int
_pdns_search(sdns_handle_t *sdns, pdns_handle_t *pdns, const char *name, uint32_t class, uint32_t type, char *buf, uint32_t len, struct sockaddr *from, uint32_t *fromlen)
{
char *dot, *qname;
return n;
}
-__private_extern__ int
+__attribute__((__visibility__("hidden"))) int
_sdns_search(sdns_handle_t *sdns, const char *name, uint32_t class, uint32_t type, uint32_t fqdn, uint32_t recurse, char *buf, uint32_t len, struct sockaddr *from, uint32_t *fromlen, int *min)
{
pdns_handle_t *primary, **pdns;
#ifndef __DNS_PRIVATE_H__
#define __DNS_PRIVATE_H__
+#include <dns.h>
+#include <resolv.h>
#include <sys/cdefs.h>
#define MDNS_HANDLE_NAME "*MDNS*"
#define MAXPACKET 1024
-extern void res_client_close(res_state res);
-extern int __res_nquery(res_state statp, const char *name, int class, int type, u_char *answer, int anslen);
-extern int dns_res_send(res_state statp, const u_char *buf, int buflen, u_char *ans, int *anssiz, struct sockaddr *from, int *fromlen);
extern void _check_cache(sdns_handle_t *sdns);
extern int _sdns_search(sdns_handle_t *sdns, const char *name, uint32_t class, uint32_t type, uint32_t fqdn, uint32_t recurse, char *buf, uint32_t len, struct sockaddr *from, uint32_t *fromlen, int *min);
extern int _pdns_search(sdns_handle_t *sdns, pdns_handle_t *pdns, const char *name, uint32_t class, uint32_t type, char *buf, uint32_t len, struct sockaddr *from, uint32_t *fromlen);
return name;
}
+static
dns_resource_record_t *
_dns_parse_resource_record_internal(const char *p, char **x, int32_t *remaining)
{
return _dns_parse_resource_record_internal(buf, &x, &remaining);
}
+static
dns_question_t *
_dns_parse_question_internal(const char *p, char **x, int32_t *remaining)
{
}
}
-char *
-dns_build_reply(dns_reply_t *dnsr, uint16_t *rl)
-{
- uint16_t i, len;
- dns_header_t *h;
- char *s, *x;
-
- if (dnsr == NULL) return NULL;
-
- len = NS_HFIXEDSZ;
-
- s = malloc(len);
- x = s + len;
-
- memset(s, 0, len);
- *rl = len;
-
- h = (dns_header_t *)s;
-
- h->xid = htons(dnsr->header->xid);
- h->flags = htons(dnsr->header->flags);
- h->qdcount = htons(dnsr->header->qdcount);
- h->ancount = htons(dnsr->header->ancount);
- h->nscount = htons(dnsr->header->nscount);
- h->arcount = htons(dnsr->header->arcount);
-
- for (i = 0; i < dnsr->header->qdcount; i++)
- {
- _dns_append_question(dnsr->question[i], &s, rl);
- }
-
- for (i = 0; i < dnsr->header->ancount; i++)
- {
- _dns_append_resource_record(dnsr->answer[i], &s, rl);
- }
-
- for (i = 0; i < dnsr->header->nscount; i++)
- {
- _dns_append_resource_record(dnsr->authority[i], &s, rl);
- }
-
- for (i = 0; i < dnsr->header->arcount; i++)
- {
- _dns_append_resource_record(dnsr->additional[i], &s, rl);
- }
-
- return s;
-}
-
void
dns_free_question(dns_question_t *q)
{
return dns->recvsize;
}
+static
dns_reply_t *
dns_lookup_soa_min(dns_handle_t d, const char *name, uint32_t class, uint32_t type, int *min)
{
#include <netinet/in.h>
#include <arpa/inet.h>
#include <dns.h>
+#include <stdio.h>
/*
* Status returned in a dns_reply_t
#ifndef DST_H
#define DST_H
+#pragma GCC visibility push(hidden)
+
#ifndef HAS_DST_KEY
#define DST_KEY RES_9_DST_KEY
typedef struct dst_key {
#define MISSING_KEY_OR_SIGNATURE (-30)
#define UNSUPPORTED_KEYALG (-31)
+#pragma GCC visibility pop
+
#endif /* DST_H */
}
#else
+#include "dst_internal.h"
#define dst_hmac_md5_init res_9_dst_hmac_md5_init
int
dst_hmac_md5_init(){
return (0);
}
#endif
-
-
-
-
-
-
-
* WITH THE USE OR PERFORMANCE OF THE SOFTWARE.
*/
#include <limits.h>
+#include <stdio.h>
#include <sys/param.h>
#if (!defined(BSD)) || (BSD < 199306)
# include <sys/bitypes.h>
#include <isc/dst.h>
#endif
+#pragma GCC visibility push(hidden)
+
/*
* define what crypto systems are supported for RSA,
* BSAFE is prefered over RSAREF; only one can be set at any time
dst_s_dump(const int mode, const u_char *data, const int size,
const char *msg);
-
+#pragma GCC visibility pop
#endif /* DST_INTERNAL_H */
--- /dev/null
+#include <sys/cdefs.h>
+#include <mach/mach.h>
+#include <netdb.h>
+#include <resolv.h>
+
+// These are declared in Libinfo's headers. These declarations should eventually move into headers provided by libresolv.
+
+typedef void (*dns_async_callback)(int32_t status, char *buf, uint32_t len, struct sockaddr *from, int fromlen, void *context);
+int32_t dns_async_start(mach_port_t *p, const char *name, uint16_t dnsclass, uint16_t dnstype, uint32_t do_search, dns_async_callback callback, void *context);
+int32_t dns_async_send(mach_port_t *p, const char *name, uint16_t dnsclass, uint16_t dnstype, uint32_t do_search);
+int32_t dns_async_receive(mach_port_t p, char **buf, uint32_t *len, struct sockaddr **from, uint32_t *fromlen);
+int32_t dns_async_handle_reply(void *msg);
+void dns_async_cancel(mach_port_t p);
runOnlyForDeploymentPostprocessing = 1;
shellPath = /bin/sh;
shellScript = "sh \"$PROJECT_DIR\"/xcodescripts/headers.sh\nsh \"$PROJECT_DIR\"/xcodescripts/manpages.sh\nsh \"$PROJECT_DIR\"/xcodescripts/links.sh";
- showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
extern int __res_vinit(res_state, int);
+__attribute__((__visibility__("hidden")))
const char *__res_opcodes[] = {
"QUERY",
"IQUERY",
* that ns_c_any is a qclass but not a class. (You can ask for records of class
* ns_c_any, but you can't have any records of that class in the database.)
*/
+static
const struct res_sym __res_p_class_syms[] = {
{ns_c_in, "IN", (char *)0},
{ns_c_chaos, "CHAOS", (char *)0},
{0, (char *)0, (char *)0}
};
-const struct res_sym __res_p_key_syms[] = {
- {NS_ALG_MD5RSA, "RSA", "RSA KEY with MD5 hash"},
- {NS_ALG_DH, "DH", "Diffie Hellman"},
- {NS_ALG_DSA, "DSA", "Digital Signature Algorithm"},
- {NS_ALG_EXPIRE_ONLY, "EXPIREONLY", "No algorithm"},
- {NS_ALG_PRIVATE_OID, "PRIVATE", "Algorithm obtained from OID"},
- {0, NULL, NULL}
-};
-
-const struct res_sym __res_p_cert_syms[] = {
- {cert_t_pkix, "PKIX", "PKIX (X.509v3) Certificate"},
- {cert_t_spki, "SPKI", "SPKI certificate"},
- {cert_t_pgp, "PGP", "PGP certificate"},
- {cert_t_url, "URL", "URL Private"},
- {cert_t_oid, "OID", "OID Private"},
- {0, NULL, NULL}
-};
-
/*
* Names of RR types and qtypes. Types and qtypes are the same, except
* that T_ANY is a qtype but not a type. (You can ask for records of type
/*
* Names of DNS rcodes.
*/
+static
const struct res_sym __res_p_rcode_syms[] = {
{ns_r_noerror, "NOERROR", "no error"},
{ns_r_formerr, "FORMERR", "format error"},
* Resolver state default settings.
*/
+__attribute__((__visibility__("hidden")))
res_state
res_build_start(res_state x)
{
return res;
}
+__attribute__((__visibility__("hidden")))
int
res_build_finish(res_state res, uint32_t timeout, uint16_t port)
{
return 0;
}
+__attribute__((__visibility__("hidden")))
int
res_build_sortlist(res_state res, struct in_addr addr, struct in_addr mask)
{
return 0;
}
+__attribute__((__visibility__("hidden")))
char *
res_next_word(char **p)
{
return s;
}
+__attribute__((__visibility__("hidden")))
int
res_build(res_state res, uint16_t port, uint32_t *nsrch, char *key, char *val)
{
*
* Return 0 if completes successfully, -1 on error
*/
-
+static
int
res_vinit_from_file(res_state statp, int preinit, char *resconf_file)
{
#include <sys/time.h>
#include <stdint.h>
+#pragma GCC visibility push(hidden)
+
/*
* status codes from dns_res_xxx SPIs
* positive numbers are ns_rcode values.
void *res_init_interrupt_token(void);
void res_delete_interrupt_token(void *token);
+extern void res_client_close(res_state res);
+extern int __res_nquery(res_state statp, const char *name, int class, int type, u_char *answer, int anslen);
+extern int dns_res_send(res_state statp, const u_char *buf, int buflen, u_char *ans, int *anssiz, struct sockaddr *from, int *fromlen);
+
+#pragma GCC visibility pop
+
#endif
#endif
/* interrupt mechanism is implemented in res_send.c */
-__private_extern__ int interrupt_pipe_enabled;
-__private_extern__ pthread_key_t interrupt_pipe_key;
+extern int interrupt_pipe_enabled;
+extern pthread_key_t interrupt_pipe_key;
/* Options. Leave them on. */
#define DEBUG
*
* Caller must parse answer and determine whether it answers the question.
*/
-__private_extern__ int
+__attribute__((__visibility__("hidden"))) int
res_nquery_soa_min(res_state statp, const char *name, int class, int type, u_char *answer, int anslen, struct sockaddr *from, int *fromlen, int *min)
{
u_char buf[MAXPACKET];
return (n);
}
+__attribute__((__visibility__("hidden")))
int
res_nquery_2(res_state statp, const char *name, int class, int type, u_char *answer, int anslen, struct sockaddr *from, int *fromlen)
{
* Perform a call on res_query on the concatenation of name and domain,
* removing a trailing dot from name if domain is NULL.
*/
+__attribute__((__visibility__("hidden")))
int
res_nquerydomain_2(res_state statp, const char *name, const char *domain, int class, int type, u_char *answer, int anslen, struct sockaddr *from, int *fromlen)
{
* If enabled, implement search rules until answer or unrecoverable failure
* is detected. Error code, if any, is left in H_ERRNO.
*/
+__attribute__((__visibility__("hidden")))
int
res_nsearch_2(res_state statp, const char *name, int class, int type, u_char *answer, int anslen, struct sockaddr *from, int *fromlen)
{
return (-1);
}
+__attribute__((__visibility__("hidden")))
int
__res_nsearch_list_2(res_state statp, const char *name, int class, int type, u_char *answer, int anslen, struct sockaddr *from, int *fromlen, int nsearch, char **search)
{
static const int niflags = NI_NUMERICHOST | NI_NUMERICSERV;
/* interrupt mechanism is shared with res_query.c */
-int interrupt_pipe_enabled = 0;
-pthread_key_t interrupt_pipe_key;
+__attribute__((__visibility__("hidden"))) int interrupt_pipe_enabled = 0;
+__attribute__((__visibility__("hidden"))) pthread_key_t interrupt_pipe_key;
static int
bind_random(int sock, int family)
#endif
#include <resolv.h>
+#pragma GCC visibility push(hidden)
+
/*
* This RR-like structure is particular to UPDATE.
*/
int res_nmkupdate __P((res_state, ns_updrec *, u_char *, int));
int res_nupdate __P((res_state, ns_updrec *, ns_tsig_key *));
+#pragma GCC visibility pop
+
#endif /*_RES_UPDATE_H_*/
/* 0x00010000 */
/* Things involving an internal (static) resolver context. */
-#ifndef __BIND_NOSTATIC
+#if !defined(__BIND_NOSTATIC) && !defined(__BIND_INSTALLAPI)
extern struct __res_state _res;
#endif
*
*/
#define res_sym res_9_sym
-#define __p_key_syms __res_9_p_key_syms
-#define __p_cert_syms __res_9_p_cert_syms
-#define __p_class_syms __res_9_p_class_syms
#define __p_type_syms __res_9_p_type_syms
-#define __p_rcode_syms __res_9_p_rcode_syms
-
-extern const struct res_sym __p_key_syms[];
-extern const struct res_sym __p_cert_syms[];
-extern const struct res_sym __p_class_syms[];
extern const struct res_sym __p_type_syms[];
-extern const struct res_sym __p_rcode_syms[];
#endif /* SHARED_LIBBIND */
#define b64_ntop res_9_b64_ntop
int res_findzonecut2 __P((res_state, const char *, ns_class, int, char *, size_t, union res_sockaddr_union *, int));
void res_nclose __P((res_state));
int res_nopt __P((res_state, int, u_char *, int, int));
-void res_send_setqhook __P((res_send_qhook hook));
-void res_send_setrhook __P((res_send_rhook hook));
int __res_vinit __P((res_state, int));
void res_destroyservicelist __P((void));
const char * res_servicename __P((u_int16_t port, const char *proto));
#include "<DEVELOPER_DIR>/Makefiles/CoreOS/Xcode/BSD.xcconfig"
+VERSION_INFO_PREFIX=__attribute__((visibility("hidden")))
PRODUCT_NAME = $(TARGET_NAME).$(FRAMEWORK_VERSION)
DEBUG_INFORMATION_FORMAT = dwarf-with-dsym
CODE_SIGN_IDENTITY = -
GCC_WARN_UNUSED_VARIABLE = YES
GCC_ENABLE_OBJC_EXCEPTIONS = YES
INSTALLHDRS_SCRIPT_PHASE = YES
+IS_ZIPPERED = YES
+SUPPORTS_TEXT_BASED_API = YES
+TAPI_VERIFY_MODE = Pedantic
+OTHER_TAPI_FLAGS = -D__BIND_INSTALLAPI -extra-public-header $(SRCROOT)/installapi.h
if [ "$ACTION" = installhdrs ]; then exit 0; fi
LIBDIR="$DSTROOT"/usr/lib
+
+# installapi runs the script *before* calling tapi... sigh...
+mkdir -p "$LIBDIR"
+
+ln -s libresolv.9.tbd "$LIBDIR"/libresolv.tbd
+chown -h "$INSTALL_OWNER:$INSTALL_GROUP" "$LIBDIR"/libresolv.tbd
+
+# don't install man pages for installhdrs, installapi, or iOS builds
+if [ "$ACTION" = installapi ]; then exit 0; fi
+
ln -s libresolv.9.dylib "$LIBDIR"/libresolv.dylib
chown -h "$INSTALL_OWNER:$INSTALL_GROUP" "$LIBDIR"/libresolv.dylib
chmod -h 0755 "$LIBDIR"/libresolv.dylib
#!/bin/bash
set -e -x
-# don't install man pages for installhdrs or iOS builds
+# don't install man pages for installhdrs, installapi, or iOS builds
+if [ "$ACTION" = installapi ]; then exit 0; fi
if [ "$ACTION" = installhdrs ]; then exit 0; fi
if [ "${PLATFORM_NAME}" != "macosx" ]; then exit 0; fi