summaryrefslogtreecommitdiffhomepage
path: root/src/sock.h
diff options
context:
space:
mode:
authorRobert James Kaes <rjkaes@users.sourceforge.net>2004-04-27 18:53:14 +0000
committerRobert James Kaes <rjkaes@users.sourceforge.net>2004-04-27 18:53:14 +0000
commit18df4910a43e8f1b0d9d10df37236fabf0ba8508 (patch)
treeac5ab56ac77e8c7325cbde33c2b7e7864ead25ea /src/sock.h
parent3b961ec66bdcf892c14045685f533febe3386ffb (diff)
Added the "BindSame" configure directive from Oswald Buddenhagen.
This allows tinyproxy to respond to a request bound to the same interface that the request came in on. As Oswald explains: "attached is a patch that adds the BindSame option. it causes binding an outgoing connection to the ip address of the respective incoming connection. that way one can simulate an entire proxy farm with a single instance of tinyproxy on a multi-homed machine." Cool.
Diffstat (limited to 'src/sock.h')
-rw-r--r--src/sock.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/sock.h b/src/sock.h
index 78191ea..b0c1a96 100644
--- a/src/sock.h
+++ b/src/sock.h
@@ -1,4 +1,4 @@
-/* $Id: sock.h,v 1.12 2004-02-18 20:18:53 rjkaes Exp $
+/* $Id: sock.h,v 1.13 2004-04-27 18:53:14 rjkaes Exp $
*
* See 'sock.c' for a detailed description.
*
@@ -20,17 +20,18 @@
#define TINYPROXY_SOCK_H
/* The IP length is set to 48, since IPv6 can be that long */
-#define PEER_IP_LENGTH 48
-#define PEER_STRING_LENGTH 1024
+#define IP_LENGTH 48
+#define HOSTNAME_LENGTH 1024
#define MAXLINE (1024 * 4)
-extern int opensock(const char* host, int port);
+extern int opensock(const char* host, int port, const char* bind_to);
extern int listen_sock(uint16_t port, socklen_t* addrlen);
extern int socket_nonblocking(int sock);
extern int socket_blocking(int sock);
+extern int getsock_ip(int fd, char* ipaddr);
extern int getpeer_information(int fd, char* ipaddr, char* string_addr);
#endif