Add netd support for uid based routing for DNS

DNSProxyListener now supports bionic changes for marking DNS requests
for routing DNS requests with the uid routing rules

Change-Id: Iac9aa1bb14834be6da5e512405f23c6a72dc71ed
diff --git a/main.cpp b/main.cpp
index b466e42..104ebe1 100644
--- a/main.cpp
+++ b/main.cpp
@@ -34,6 +34,7 @@
 #include "NetlinkManager.h"
 #include "DnsProxyListener.h"
 #include "MDnsSdListener.h"
+#include "UidMarkMap.h"
 
 static void coldboot(const char *path);
 static void sigchld_handler(int sig);
@@ -56,8 +57,9 @@
         exit(1);
     };
 
+    UidMarkMap *rangeMap = new UidMarkMap();
 
-    cl = new CommandListener();
+    cl = new CommandListener(rangeMap);
     nm->setBroadcaster((SocketListener *) cl);
 
     if (nm->start()) {
@@ -68,7 +70,7 @@
     // Set local DNS mode, to prevent bionic from proxying
     // back to this service, recursively.
     setenv("ANDROID_DNS_MODE", "local", 1);
-    dpl = new DnsProxyListener();
+    dpl = new DnsProxyListener(rangeMap);
     if (dpl->startListener()) {
         ALOGE("Unable to start DnsProxyListener (%s)", strerror(errno));
         exit(1);