24 #include <arpa/inet.h>
25 #include <sys/types.h>
26 #include <sys/socket.h>
28 #include <netinet/in.h>
41 waitpid (chld, &
ret, 0);
78 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", 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')
125 else if (AF_INET6 == af)
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 int ret
Return value of the commandline.
static char * line
Desired phone line (string to be converted to a hash).
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.