Limit C linkage to public symbols
Switched all internal functions to C++ linkage. This makes it harder to
accidentally call a function with a mismatched signature, and paves the
way to using C++ data structures internally.
This is the current list of symbols expoted by libnetd_resolv.so:
_resolv_delete_cache_for_net
_resolv_flush_cache_for_net
_resolv_set_nameservers_for_net
android_getaddrinfofornet
android_getaddrinfofornetcontext
android_gethostbyaddrfornet
android_gethostbyaddrfornetcontext
android_gethostbynamefornet
android_gethostbynamefornetcontext
android_net_res_stats_aggregate
android_net_res_stats_get_info_for_net
android_net_res_stats_get_usable_servers
A mass-renaming pass would improve consistency. Perhaps we could use
the prefix "netd_resolv_", or just "resolv_" for brevity. Once we begin
shipping netd binaries using this interface, we might have to live with
it for some time.
Test: atest netd_integration_test (after flashing with new netd binary)
Change-Id: I52f32add73fd908ad4a715ef8f8aff1f8d9733d0
diff --git a/resolv/resolv_params.h b/resolv/resolv_params.h
index e2c7e48..d2f058b 100644
--- a/resolv/resolv_params.h
+++ b/resolv/resolv_params.h
@@ -58,4 +58,6 @@
typedef res_sendhookact (*res_send_rhook)(const struct sockaddr*, const u_char*, int, u_char*, int,
int*);
+#define LIBNETD_RESOLV_PUBLIC extern "C" [[gnu::visibility("default")]]
+
#endif // _RESOLV_PARAMS_H