26#include <sys/socket.h>
28#include <netinet/in.h>
41 waitpid (chld, &
ret, 0);
78 const char *argv[] = {
"gnunet-gns",
82 (AF_INET6 == af) ?
"AAAA" :
"A",
89 (void) close (STDOUT_FILENO);
90 if ((0 != close (out[0])) ||
91 (STDOUT_FILENO != dup2 (out[1], STDOUT_FILENO)))
93 (void) execvp (
"gnunet-gns", (
char*
const*)argv);
96 (void) close (out[1]);
97 p = fdopen (out[0],
"r");
103 while (NULL != fgets (
line,
sizeof(
line),
p))
107 if (
line[strlen (
line) - 1] ==
'\n')
112 if (inet_pton (af,
line, &
u->data.ipv4[
u->count]))
125 else if (AF_INET6 == af)
127 if (inet_pton (af,
line, &
u->data.ipv6[
u->count]))
144 if (! WIFEXITED (
ret))
146 if (4 == WEXITSTATUS (
ret))
148 if (5 == WEXITSTATUS (
ret))
153 system (
"gnunet-arm -s");
156 if (3 == WEXITSTATUS (
ret))
158 if ((2 == WEXITSTATUS (
ret)) || (1 == WEXITSTATUS (
ret)))
static mp_limb_t u[(((256)+GMP_NUMB_BITS - 1)/GMP_NUMB_BITS)]
static int ret
Final status code.
static char * line
Desired phone line (string to be converted to a hash).
static char * name
Name (label) of the records to list.
static struct GNUNET_PeerIdentity pid
Identity of the peer we transmit to / connect to.
static struct GNUNET_OS_Process * p
Helper process we started.
int gns_resolve_name(int af, const char *name, struct userdata *u)
Wrapper function that uses gnunet-gns cli tool to resolve an IPv4/6 address.
static void kwait(pid_t chld)
#define MAX_ENTRIES
Parts taken from nss-mdns.