2019-05-01 16:22:22 -04:00
|
|
|
#ifndef IRSSI_CORE_NET_NONBLOCK_H
|
|
|
|
#define IRSSI_CORE_NET_NONBLOCK_H
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2019-05-01 10:33:47 -04:00
|
|
|
#include <irssi/src/core/network.h>
|
2000-04-26 04:03:38 -04:00
|
|
|
|
|
|
|
typedef struct {
|
2015-09-22 15:59:17 -04:00
|
|
|
IPADDR ip4, ip6; /* resolved ip addresses */
|
2000-04-26 04:03:38 -04:00
|
|
|
int error; /* error, 0 = no error, -1 = error: */
|
|
|
|
int errlen; /* error text length */
|
|
|
|
char *errorstr; /* error string - dynamically allocated, you'll
|
|
|
|
need to free() it yourself unless it's NULL */
|
2015-09-22 15:59:17 -04:00
|
|
|
char *host4, *host6; /* dito */
|
2000-04-26 04:03:38 -04:00
|
|
|
} RESOLVED_IP_REC;
|
|
|
|
|
|
|
|
/* nonblocking gethostbyname(), PID of the resolver child is returned. */
|
2002-11-28 10:39:39 -05:00
|
|
|
int net_gethostbyname_nonblock(const char *addr, GIOChannel *pipe,
|
|
|
|
int reverse_lookup);
|
2014-11-08 17:26:53 -05:00
|
|
|
/* get the resolved IP address. returns -1 if some error occurred with read() */
|
2000-12-04 17:57:18 -05:00
|
|
|
int net_gethostbyname_return(GIOChannel *pipe, RESOLVED_IP_REC *rec);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
|
|
|
/* Kill the resolver child */
|
|
|
|
void net_disconnect_nonblock(int pid);
|
|
|
|
|
|
|
|
#endif
|