summaryrefslogtreecommitdiff
path: root/src/core/network.h
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-03-04 01:47:13 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-03-04 01:47:13 +0000
commit4c7b07ed3fb03528d8f9b62297fd5d8df30929bf (patch)
tree5bc71bbfdcd907636b6ff27cbfed3e5fb2b03617 /src/core/network.h
parent5afb3c14541ec328483813e0783969ecc266042a (diff)
downloadirssi-4c7b07ed3fb03528d8f9b62297fd5d8df30929bf.zip
IPv6 fixes. Everything now keeps both v4 and v6 addresses in memory and
at connect() time it's decided which one should be used. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1334 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core/network.h')
-rw-r--r--src/core/network.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/core/network.h b/src/core/network.h
index d8d1f9b7..f414beff 100644
--- a/src/core/network.h
+++ b/src/core/network.h
@@ -33,7 +33,7 @@ struct _IPADDR {
# define MAX_IP_LEN 20
#endif
-#define is_ipv6_addr(ip) ((ip)->family != AF_INET)
+#define IPADDR_IS_V6(ip) ((ip)->family != AF_INET)
/* returns 1 if IPADDRs are the same */
int net_ip_compare(IPADDR *ip1, IPADDR *ip2);
@@ -58,13 +58,10 @@ int net_receive(GIOChannel *handle, char *buf, int len);
/* Transmit data, return number of bytes sent, -1 = error */
int net_transmit(GIOChannel *handle, const char *data, int len);
-/* Get IP address for host. family specifies if we should prefer to
- IPv4 or IPv6 address (0 = default, AF_INET or AF_INET6).
- returns 0 = ok, others = error code for net_gethosterror() */
-int net_gethostbyname(const char *addr, IPADDR *ip, int family);
-/* Set the default address family to use with host resolving
- (AF_INET or AF_INET6) */
-void net_host_resolver_set_default_family(unsigned short family);
+/* Get IP addresses for host, both IPv4 and IPv6 if possible.
+ If ip->family is 0, the address wasn't found.
+ Returns 0 = ok, others = error code for net_gethosterror() */
+int net_gethostbyname(const char *addr, IPADDR *ip4, IPADDR *ip6);
/* Get name for host, *name should be g_free()'d unless it's NULL.
Return values are the same as with net_gethostbyname() */
int net_gethostbyaddr(IPADDR *ip, char **name);