diff options
author | Robert James Kaes <rjkaes@users.sourceforge.net> | 2004-02-18 20:18:53 +0000 |
---|---|---|
committer | Robert James Kaes <rjkaes@users.sourceforge.net> | 2004-02-18 20:18:53 +0000 |
commit | 5ecd9157ce561d9a088b97cce3f1d131f33ee920 (patch) | |
tree | 5c6f79e7a0bae42bb15cbe64b6d7e25bdb033f74 /src/sock.h | |
parent | c21df1ea0f8e9e851e95c06481f093d5adb95f78 (diff) | |
download | tinyproxy-5ecd9157ce561d9a088b97cce3f1d131f33ee920.tar.gz tinyproxy-5ecd9157ce561d9a088b97cce3f1d131f33ee920.zip |
Converted the various socket functions to work with both IPv4 and IPv6
addresses.
Diffstat (limited to '')
-rw-r--r-- | src/sock.h | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -1,9 +1,9 @@ -/* $Id: sock.h,v 1.11 2003-01-27 18:45:25 rjkaes Exp $ +/* $Id: sock.h,v 1.12 2004-02-18 20:18:53 rjkaes Exp $ * * See 'sock.c' for a detailed description. * * Copyright (C) 1998 Steven Young - * Copyright (C) 1999 Robert James Kaes (rjkaes@flarenet.com) + * Copyright (C) 1999,2004 Robert James Kaes (rjkaes@users.sourceforge.net) * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -19,12 +19,13 @@ #ifndef TINYPROXY_SOCK_H #define TINYPROXY_SOCK_H -#define PEER_IP_LENGTH 16 -#define PEER_STRING_LENGTH 256 +/* The IP length is set to 48, since IPv6 can be that long */ +#define PEER_IP_LENGTH 48 +#define PEER_STRING_LENGTH 1024 #define MAXLINE (1024 * 4) -extern int opensock(char *ip_addr, uint16_t port); +extern int opensock(const char* host, int port); extern int listen_sock(uint16_t port, socklen_t* addrlen); extern int socket_nonblocking(int sock); |