Converted the various socket functions to work with both IPv4 and IPv6

addresses.
This commit is contained in:
Robert James Kaes committed 2004-02-18 20:18:53 +00:00
1 parent c21df1ea0f
commit 5ecd9157ce
2 files changed
+90 -91

No files matched your search

+6 -5
View File
@@ -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);