Added two functions:

- get_ip_string() converts a binary network address into either a
   dotted-decimal IPv4 address, or a IPv6 hex-string
 - full_inet_pton() converts a numeric character string into an IPv6
   network address (binary form).  It's like the system inet_pton()
   function, but it will work with bot IPv4 and IPv6 character
   strings.

These functions are required for the conversion to Internet protocol
independence.  (Or to put it more clearly: allow tinyproxy to work in
an IPv6 network.)
This commit is contained in:
Robert James Kaes committed 2004-02-18 20:17:18 +00:00
1 parent 02893c3489
commit c21df1ea0f
2 files changed
+85 -4

No files matched your search

+5 -2
View File
@@ -1,8 +1,8 @@
/* $Id: network.h,v 1.1 2002-05-23 04:41:48 rjkaes Exp $
/* $Id: network.h,v 1.2 2004-02-18 20:17:18 rjkaes Exp $
*
* See 'network.c' for a detailed description.
*
* Copyright (C) 2002 Robert James Kaes (rjkaes@flarenet.com)
* Copyright (C) 2002,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
@@ -24,4 +24,7 @@ extern ssize_t safe_read(int fd, char *buffer, size_t count);
extern int write_message(int fd, const char *fmt, ...);
extern ssize_t readline(int fd, char **whole_buffer);
extern char* get_ip_string(struct sockaddr* sa, char* buf, size_t len);
extern int full_inet_pton(const char* ip, void* dst);
#endif