Introduce netd_client, a dynamic library that talks to netd.

This library is dynamically loaded and used by bionic, to replace selected
standard socket syscalls with versions that talk to netd.

Implement connect() by requesting that the socket be marked with the netId of
the default network and then calling through to the actual syscall.

There are two escape hatches:

+ If the fwmark server is unavailable, it isn't an error; we proceed with the
  syscall. This might help at boot time (when the server isn't ready yet) and if
  we get rid of the fwmarkd socket entirely in future platform versions.

+ If the ANDROID_NO_USE_FWMARK_CLIENT environment variable is set, we don't
  attempt to use the fwmark server (even if it's available). This allows apps to
  sidestep unforseen issues in production at runtime.

Change-Id: Ib6198e19dbc306521a26fcecfdf6e8424d163fc9
5 files changed