From b8e435c1d5593422349534c1cb356d11273ba1db Mon Sep 17 00:00:00 2001 From: Lorenzo Colitti Date: Tue, 2 Jul 2013 17:44:00 +0900 Subject: [PATCH] Expose dn_comp and dn_expand to system C code. This is needed to compile open-source code that wants to expand/compress domain names itself, such as ping6. Bug: 9469682 Change-Id: I339c6538936d05c031bc6fb0a8793aaf1429dea4 --- libc/include/resolv.h | 12 +++++++----- libc/private/resolv_private.h | 5 ++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/libc/include/resolv.h b/libc/include/resolv.h index 7c34012a1..36b93ee1e 100644 --- a/libc/include/resolv.h +++ b/libc/include/resolv.h @@ -43,12 +43,14 @@ struct res_state; extern struct __res_state *__res_state(void); #define _res (*__res_state()) -/* Base-64 functions - because some code expects it there */ +#define b64_ntop __b64_ntop +#define b64_pton __b64_pton +extern int b64_ntop(u_char const*, size_t, char*, size_t); +extern int b64_pton(char const*, u_char*, size_t); -#define b64_ntop __b64_ntop -#define b64_pton __b64_pton -extern int b64_ntop(u_char const *, size_t, char *, size_t); -extern int b64_pton(char const *, u_char *, size_t); +#define dn_comp __dn_comp +extern int dn_comp(const char*, u_char*, int, u_char**, u_char**); +extern int dn_expand(const u_char*, const u_char*, const u_char*, char*, int); __END_DECLS diff --git a/libc/private/resolv_private.h b/libc/private/resolv_private.h index 3b88f4932..37764fb8b 100644 --- a/libc/private/resolv_private.h +++ b/libc/private/resolv_private.h @@ -343,7 +343,9 @@ extern const struct res_sym __p_type_syms[]; extern const struct res_sym __p_rcode_syms[]; #endif /* SHARED_LIBBIND */ +#ifndef ANDROID_CHANGES #define dn_comp __dn_comp +#endif #define dn_count_labels __dn_count_labels #define dn_skipname __dn_skipname #define fp_resstat __fp_resstat @@ -438,9 +440,6 @@ const u_char * p_fqname(const u_char *, const u_char *, FILE *); const char * p_option(u_long); char * p_secstodate(u_long); int dn_count_labels(const char *); -int dn_comp(const char *, u_char *, int, u_char **, u_char **); -int dn_expand(const u_char *, const u_char *, const u_char *, - char *, int); u_int res_randomid(void); int res_nameinquery(const char *, int, int, const u_char *, const u_char *);