diff options
author | Bernie Innocenti <codewiz@google.com> | 2018-09-13 16:00:42 +0900 |
---|---|---|
committer | Bernie Innocenti <codewiz@google.com> | 2018-09-28 19:51:29 +0900 |
commit | a8cfe09941e593b78767b79deb7749e03e6b9585 (patch) | |
tree | 4747773fa2f5e9347717eddf20ecf2aa1179532b | |
parent | c0be3ad61644baebcdf6a865b45f83a55557010c (diff) | |
download | netd-a8cfe09941e593b78767b79deb7749e03e6b9585.tar.gz |
Remove __LIBC_HIDDEN__
Now that we're hiding all symbols, there's no point in hand-picking
which ones to hide.
Test: atest netd_integration_test
Change-Id: Id88f10cb4c8e25635b6f4c94118a6b3a27b14cb5
-rw-r--r-- | resolv/gethnamaddr.cpp | 4 | ||||
-rw-r--r-- | resolv/res_data.cpp | 14 | ||||
-rw-r--r-- | resolv/res_send.cpp | 2 | ||||
-rw-r--r-- | resolv/res_state.cpp | 1 | ||||
-rw-r--r-- | resolv/resolv_cache.h | 18 | ||||
-rw-r--r-- | resolv/resolv_netid.h | 8 | ||||
-rw-r--r-- | resolv/resolv_private.h | 44 |
7 files changed, 35 insertions, 56 deletions
diff --git a/resolv/gethnamaddr.cpp b/resolv/gethnamaddr.cpp index 34df84d1..1257d02f 100644 --- a/resolv/gethnamaddr.cpp +++ b/resolv/gethnamaddr.cpp @@ -515,7 +515,7 @@ int gethostbyname2_r(const char* name, int af, struct hostent* hp, char* buf, si return h_errno_to_result(errorp); } -__LIBC_HIDDEN__ FILE* android_open_proxy() { +FILE* android_open_proxy() { const char* cache_mode = getenv("ANDROID_DNS_MODE"); bool use_proxy = (cache_mode == NULL || strcmp(cache_mode, "local") != 0); if (!use_proxy) { @@ -1109,7 +1109,7 @@ struct hostent* android_gethostbyaddrfornetcontext(const void* addr, socklen_t l return android_gethostbyaddrfornetcontext_proxy(addr, len, af, netcontext); } -__LIBC_HIDDEN__ struct hostent* android_gethostbyaddrfornetcontext_proxy( +struct hostent* android_gethostbyaddrfornetcontext_proxy( const void* addr, socklen_t len, int af, const struct android_net_context* netcontext) { struct res_static* rs = __res_get_static(); // For thread-safety. return android_gethostbyaddrfornetcontext_proxy_internal( diff --git a/resolv/res_data.cpp b/resolv/res_data.cpp index 45c311a1..80aa9080 100644 --- a/resolv/res_data.cpp +++ b/resolv/res_data.cpp @@ -35,7 +35,6 @@ #include "res_private.h" // res_ourserver_p() #include "resolv_private.h" -__LIBC_HIDDEN__ extern const char* const _res_opcodes[] = { "QUERY", "IQUERY", "CQUERYM", "CQUERYU", /* experimental */ "NOTIFY", /* experimental */ @@ -84,18 +83,17 @@ int res_init(void) { return rv; } -void p_query(const u_char* msg) { - fp_query(msg, stdout); +static void fp_nquery(const u_char* msg, int len, FILE* file) { + if (res_need_init() && res_init() == -1) return; + res_pquery(&_nres, msg, len, file); } -void fp_query(const u_char* msg, FILE* file) { +static void fp_query(const u_char* msg, FILE* file) { fp_nquery(msg, PACKETSZ, file); } -void fp_nquery(const u_char* msg, int len, FILE* file) { - if (res_need_init() && res_init() == -1) return; - - res_pquery(&_nres, msg, len, file); +void p_query(const u_char* msg) { + fp_query(msg, stdout); } int res_mkquery(int op, // opcode of query diff --git a/resolv/res_send.cpp b/resolv/res_send.cpp index ad655c9d..30304f2b 100644 --- a/resolv/res_send.cpp +++ b/resolv/res_send.cpp @@ -277,7 +277,7 @@ static int random_bind(int s, int family) { * author: * paul vixie, 29may94 */ -__LIBC_HIDDEN__ int res_ourserver_p(const res_state statp, const struct sockaddr* sa) { +int res_ourserver_p(const res_state statp, const struct sockaddr* sa) { const struct sockaddr_in *inp, *srv; const struct sockaddr_in6 *in6p, *srv6; int ns; diff --git a/resolv/res_state.cpp b/resolv/res_state.cpp index df1528c9..ca8d4246 100644 --- a/resolv/res_state.cpp +++ b/resolv/res_state.cpp @@ -117,7 +117,6 @@ static _res_thread* _res_thread_get(void) { return rt; } -__LIBC_HIDDEN__ struct __res_state _nres; #if 0 diff --git a/resolv/resolv_cache.h b/resolv/resolv_cache.h index 24fbf9b8..cc7b5b7f 100644 --- a/resolv/resolv_cache.h +++ b/resolv/resolv_cache.h @@ -29,15 +29,13 @@ #define _RESOLV_CACHE_H_ #include <stddef.h> -#include <sys/cdefs.h> struct __res_state; /* sets the name server addresses to the provided res_state structure. The * name servers are retrieved from the cache which is associated * with the network to which the res_state structure is associated */ -__LIBC_HIDDEN__ -extern void _resolv_populate_res_for_net(struct __res_state* statp); +void _resolv_populate_res_for_net(struct __res_state* statp); typedef enum { RESOLV_CACHE_UNSUPPORTED, /* the cache can't handle that kind of queries */ @@ -46,19 +44,17 @@ typedef enum { RESOLV_CACHE_FOUND /* the cache found the answer */ } ResolvCacheStatus; -__LIBC_HIDDEN__ -extern ResolvCacheStatus _resolv_cache_lookup(unsigned netid, const void* query, int querylen, - void* answer, int answersize, int* answerlen); +ResolvCacheStatus _resolv_cache_lookup(unsigned netid, const void* query, int querylen, + void* answer, int answersize, + int* answerlen); /* add a (query,answer) to the cache, only call if _resolv_cache_lookup * did return RESOLV_CACHE_NOTFOUND */ -__LIBC_HIDDEN__ -extern void _resolv_cache_add(unsigned netid, const void* query, int querylen, const void* answer, - int answerlen); +void _resolv_cache_add(unsigned netid, const void* query, int querylen, const void* answer, + int answerlen); /* Notify the cache a request failed */ -__LIBC_HIDDEN__ -extern void _resolv_cache_query_failed(unsigned netid, const void* query, int querylen); +void _resolv_cache_query_failed(unsigned netid, const void* query, int querylen); #endif /* _RESOLV_CACHE_H_ */ diff --git a/resolv/resolv_netid.h b/resolv/resolv_netid.h index c92c3740..213c3d90 100644 --- a/resolv/resolv_netid.h +++ b/resolv/resolv_netid.h @@ -34,7 +34,7 @@ */ #include <netinet/in.h> #include <stdio.h> -#include <sys/cdefs.h> + #include "resolv_params.h" /* @@ -111,10 +111,10 @@ extern void _resolv_delete_cache_for_net(unsigned netid) __used_in_netd; /* Internal use only. */ struct hostent* android_gethostbyaddrfornetcontext_proxy( - const void*, socklen_t, int, const struct android_net_context*) __LIBC_HIDDEN__; + const void*, socklen_t, int, const struct android_net_context*); int android_getnameinfofornet(const struct sockaddr*, socklen_t, char*, size_t, char*, size_t, int, - unsigned, unsigned) __LIBC_HIDDEN__; -FILE* android_open_proxy(void) __LIBC_HIDDEN__; + unsigned, unsigned); +FILE* android_open_proxy(void); __END_DECLS diff --git a/resolv/resolv_private.h b/resolv/resolv_private.h index f09f1eb3..25033955 100644 --- a/resolv/resolv_private.h +++ b/resolv/resolv_private.h @@ -54,8 +54,6 @@ #ifndef _RESOLV_PRIVATE_H_ #define _RESOLV_PRIVATE_H_ -#include <sys/cdefs.h> - #include <net/if.h> #include <resolv.h> #include <time.h> @@ -157,17 +155,14 @@ typedef struct __res_state* res_state; /* Retrieve a local copy of the stats for the given netid. The buffer must have space for * MAXNS __resolver_stats. Returns the revision id of the resolvers used. */ -__LIBC_HIDDEN__ -extern int _resolv_cache_get_resolver_stats(unsigned netid, struct __res_params* params, +int _resolv_cache_get_resolver_stats(unsigned netid, struct __res_params* params, struct __res_stats stats[MAXNS]); /* Add a sample to the shared struct for the given netid and server, provided that the * revision_id of the stored servers has not changed. */ -__LIBC_HIDDEN__ -extern void _resolv_cache_add_resolver_stats_sample(unsigned netid, int revision_id, int ns, - const struct __res_sample* sample, - int max_samples); +void _resolv_cache_add_resolver_stats_sample(unsigned netid, int revision_id, int ns, + const struct __res_sample* sample, int max_samples); /* End of stats related definitions */ @@ -255,8 +250,8 @@ union res_sockaddr_union { /* Things involving an internal (static) resolver context. */ __BEGIN_DECLS -__LIBC_HIDDEN__ extern struct __res_state* __res_get_state(void); -__LIBC_HIDDEN__ extern void __res_put_state(struct __res_state*); +struct __res_state* __res_get_state(void); +void __res_put_state(struct __res_state*); __END_DECLS @@ -272,13 +267,11 @@ __END_DECLS #define res_sendsigned __res_sendsigned __BEGIN_DECLS -void fp_nquery(const u_char*, int, FILE*); -void fp_query(const u_char*, FILE*); const char* hostalias(const char*); void p_query(const u_char*); void res_close(void); int res_init(void); -__LIBC_HIDDEN__ int res_opt(int, u_char*, int, int); +int res_opt(int, u_char*, int, int); int res_isourserver(const struct sockaddr_in*); int res_mkquery(int, const char*, int, int, const u_char*, int, const u_char*, u_char*, int); int res_query(const char*, int, int, u_char*, int); @@ -330,11 +323,7 @@ __END_DECLS #define res_setservers __res_setservers #define res_getservers __res_getservers #define res_buildprotolist __res_buildprotolist -#define res_destroyprotolist __res_destroyprotolist -#define res_destroyservicelist __res_destroyservicelist #define res_ourserver_p __res_ourserver_p -#define res_protocolname __res_protocolname -#define res_protocolnumber __res_protocolnumber #define res_send_setqhook __res_send_setqhook #define res_send_setrhook __res_send_setrhook #define res_servicename __res_servicename @@ -355,7 +344,7 @@ const char* p_class(int); const char* p_time(uint32_t); const char* p_type(int); const char* p_rcode(int); -__LIBC_HIDDEN__ const char* p_sockun(union res_sockaddr_union, char*, size_t); +const char* p_sockun(union res_sockaddr_union, char*, size_t); const u_char* p_cdnname(const u_char*, const u_char*, int, FILE*); const u_char* p_cdname(const u_char*, const u_char*, FILE*); const u_char* p_fqnname(const u_char*, const u_char*, int, char*, int); @@ -365,12 +354,12 @@ char* p_secstodate(u_long); int dn_count_labels(const char*); int res_nameinquery(const char*, int, int, const u_char*, const u_char*); int res_queriesmatch(const u_char*, const u_char*, const u_char*, const u_char*); -__LIBC_HIDDEN__ const char* p_section(int, int); +const char* p_section(int, int); /* Things involving a resolver context. */ int res_ninit(res_state); int res_nisourserver(const res_state, const struct sockaddr_in*); void fp_resstat(const res_state, FILE*); -__LIBC_HIDDEN__ void res_pquery(const res_state, const u_char*, int, FILE*); +void res_pquery(const res_state, const u_char*, int, FILE*); const char* res_hostalias(const res_state, const char*, char*, size_t); int res_nquery(res_state, const char*, int, int, u_char*, int); int res_nsearch(res_state, const char*, int, int, u_char*, int); @@ -383,21 +372,18 @@ int res_findzonecut(res_state, const char*, ns_class, int, char*, size_t, struct int res_findzonecut2(res_state, const char*, ns_class, int, char*, size_t, union res_sockaddr_union*, int); void res_nclose(res_state); -__LIBC_HIDDEN__ int res_nopt(res_state, int, u_char*, int, int); +int res_nopt(res_state, int, u_char*, int, int); void res_send_setqhook(res_send_qhook); void res_send_setrhook(res_send_rhook); -__LIBC_HIDDEN__ int __res_vinit(res_state, int); -void res_destroyservicelist(void); +int __res_vinit(res_state, int); const char* res_servicename(uint16_t, const char*); -const char* res_protocolname(int); -void res_destroyprotolist(void); void res_buildprotolist(void); -__LIBC_HIDDEN__ void res_ndestroy(res_state); -__LIBC_HIDDEN__ void res_setservers(res_state, const union res_sockaddr_union*, int); -__LIBC_HIDDEN__ int res_getservers(res_state, union res_sockaddr_union*, int); +void res_ndestroy(res_state); +void res_setservers(res_state, const union res_sockaddr_union*, int); +int res_getservers(res_state, union res_sockaddr_union*, int); struct android_net_context; /* forward */ -__LIBC_HIDDEN__ void res_setnetcontext(res_state, const struct android_net_context*); +void res_setnetcontext(res_state, const struct android_net_context*); u_int res_randomid(void); |