shill: Add http_proxy class

The http_proxy adds a device/connection based proxy that guarantees
to the caller that its HTTP request will go out a particular device's
connection.  DNS requests occur through a bound socket to this device
and goes to DNS servers configured on this connection.  HTTP requests
will also be bound to this interface.  This facility will be used by
a number of peripheral bits including portal detection, activation and
cashew.

BUG=chromium-os:21664
TEST=New unit test.  New (disabled) functional test, against which I
can run "curl -x" and Chrome with manual proxy settings.

Change-Id: I0d59bf0ae27d3538ef359f786742f5c2f1d6fef9
Reviewed-on: https://gerrit.chromium.org/gerrit/10165
Reviewed-by: Thieu Le <thieule@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
diff --git a/mock_sockets.h b/mock_sockets.h
index 8d80269..b095ce9 100644
--- a/mock_sockets.h
+++ b/mock_sockets.h
@@ -17,10 +17,20 @@
   MockSockets();
   virtual ~MockSockets();
 
+  MOCK_METHOD3(Accept,
+               int(int sockfd, struct sockaddr *addr, socklen_t *addrlen));
   MOCK_METHOD3(Bind,
                int(int sockfd, const struct sockaddr *addr, socklen_t addrlen));
+  MOCK_METHOD2(BindToDevice, int(int sockfd, const std::string &device));
   MOCK_METHOD1(Close, int(int fd));
+  MOCK_METHOD3(Connect,
+               int(int sockfd, const struct sockaddr *addr, socklen_t addrlen));
+  MOCK_METHOD0(Error, int());
+  MOCK_METHOD3(GetSockName,
+               int(int sockfd, struct sockaddr *addr, socklen_t *addrlen));
+  MOCK_METHOD1(GetSocketError, int(int fd));
   MOCK_METHOD3(Ioctl, int(int d, int request, void *argp));
+  MOCK_METHOD2(Listen, int(int d, int backlog));
   MOCK_METHOD4(Send,
                ssize_t(int sockfd, const void *buf, size_t len, int flags));
   MOCK_METHOD6(SendTo, ssize_t(int sockfd,
@@ -29,6 +39,7 @@
                                int flags,
                                const struct sockaddr *dest_addr,
                                socklen_t addrlen));
+  MOCK_METHOD1(SetNonBlocking, int(int sockfd));
   MOCK_METHOD3(Socket, int(int domain, int type, int protocol));
 
  private: