53{
54 int fd;
55
59 int af;
60
65
69 socklen_t addrlen;
70
74 struct sockaddr *addr;
75};
76
77
80{
81 static int cache_v4 = -1;
82 static int cache_v6 = -1;
83 static int cache_un = -1;
84 int s;
86
87 switch (pf)
88 {
89 case PF_INET:
90 if (-1 != cache_v4)
91 return cache_v4;
92 break;
93
94 case PF_INET6:
95 if (-1 != cache_v6)
96 return cache_v6;
97 break;
98
99#ifdef PF_UNIX
100 case PF_UNIX:
101 if (-1 != cache_un)
102 return cache_un;
103 break;
104#endif
105 }
106 s = socket (pf, SOCK_STREAM, 0);
107 if (-1 == s)
108 {
109 if (EAFNOSUPPORT != errno)
110 {
112 "socket");
114 }
116 }
117 else
118 {
121 }
122 switch (pf)
123 {
124 case PF_INET:
126 break;
127
128 case PF_INET6:
130 break;
131
132#ifdef PF_UNIX
133 case PF_UNIX:
135 break;
136#endif
137 }
139}
140
141
142char *
144{
145 struct sockaddr_un
dummy;
146 size_t slen;
150 size_t upm;
151
152 upm =
sizeof(
dummy.sun_path);
153 slen = strlen (unixpath);
154 if (slen < upm)
155 return unixpath;
157 while (16 + strlen (unixpath) >= upm)
158 {
159 if (NULL == (
end = strrchr (unixpath,
'/')))
160 {
163 "Unable to shorten unix path `%s' while keeping name unique\n"),
164 unixpath);
166 return NULL;
167 }
169 }
171 ae.encoding[16] = '\0';
172 strcat (unixpath, (char *) ae.encoding);
173 return unixpath;
174}
175
176
177void
179{
180 int s;
181 int eno;
182 struct stat sbuf;
184
185 s = socket (AF_UNIX, SOCK_STREAM, 0);
186 if (-1 == s)
187 {
189 "Failed to open AF_UNIX socket");
190 return;
191 }
193 (struct sockaddr *) un,
194 sizeof(struct sockaddr_un));
195 eno = errno;
198 return;
199 if (ECONNREFUSED != eno)
200 return;
201
202 if (0 != stat (un->sun_path,
203 &sbuf))
204 return;
205 if (S_IFSOCK != (S_IFMT & sbuf.st_mode))
206 return;
207
209 "Removing left-over `%s' from previous execution\n",
210 un->sun_path);
211 if (0 != unlink (un->sun_path))
213 "unlink",
214 un->sun_path);
215}
216
217
218#ifndef FD_COPY
219#define FD_COPY(s, d) do { GNUNET_memcpy ((d), (s), sizeof(fd_set)); } while (0)
220#endif
221
222
225 int doBlock)
226{
227 int flags = fcntl (fd->
fd, F_GETFL);
228
229 if (flags == -1)
230 {
232 "fcntl");
234 }
235 if (doBlock)
236 flags &= ~O_NONBLOCK;
237
238 else
239 flags |= O_NONBLOCK;
240 if (0 != fcntl (fd->
fd,
241 F_SETFL,
242 flags))
243
244 {
246 "fcntl");
248 }
250}
251
252
260static int
262{
263 int i;
264 i = fcntl (
h->fd, F_GETFD);
265 if (i < 0)
267 if (i == (i | FD_CLOEXEC))
269 i |= FD_CLOEXEC;
270 if (fcntl (
h->fd, F_SETFD, i) < 0)
272
274}
275
276
277#ifdef DARWIN
283static int
285{
286 int abs_value = 1;
287
288 if (0 !=
289 setsockopt (
h->fd, SOL_SOCKET, SO_NOSIGPIPE,
290 (const void *) &abs_value,
291 sizeof(abs_value)))
294}
295
296
297#endif
298
299
307static void
309{
311
312 if (0 !=
314 IPPROTO_TCP,
315 TCP_NODELAY,
318 "setsockopt");
319}
320
321
334static int
336 int af,
338{
339 int eno;
340
344 {
345 eno = errno;
347 errno = eno;
349 }
350
351 if (
h->fd >= FD_SETSIZE)
352 {
355 errno = EMFILE;
357 }
358
361 "socket_set_inheritable");
362
364 {
365 eno = errno;
368 errno = eno;
370 }
371#ifdef DARWIN
373 {
374 eno = errno;
377 errno = eno;
379 }
380#endif
381 if ((
type == SOCK_STREAM)
382#ifdef AF_UNIX
383 && (af != AF_UNIX)
384#endif
385 )
388}
389
390
394 socklen_t *address_len)
395{
397 int eno;
398
400#if DEBUG_NETWORK
401 {
402 struct sockaddr_storage
name;
403 socklen_t namelen =
sizeof(
name);
404
405 int gsn = getsockname (desc->
fd,
406 (
struct sockaddr *) &
name,
407 &namelen);
408
409 if (0 == gsn)
411 "Accepting connection on `%s'\n",
413 namelen));
414 }
415#endif
416 ret->fd = accept (desc->
fd,
418 address_len);
420 {
421 eno = errno;
423 errno = eno;
424 return NULL;
425 }
429 desc->af,
430 SOCK_STREAM))
431 {
432 return NULL;
433 }
435}
436
437
440 const struct sockaddr *
address,
441 socklen_t address_len)
442{
444
445#ifdef IPV6_V6ONLY
446#ifdef IPPROTO_IPV6
447 {
448 const int on = 1;
449
450 if (AF_INET6 == desc->
af)
451 if (setsockopt (desc->
fd,
452 IPPROTO_IPV6,
453 IPV6_V6ONLY,
454 (const void *) &on,
455 sizeof(on)))
457 "setsockopt");
458 }
459#endif
460#endif
461 if (AF_UNIX ==
address->sa_family)
463
464 {
465 const int on = 1;
466
467 if ( (SOCK_STREAM == desc->
type) &&
468 (0 != setsockopt (desc->
fd,
469 SOL_SOCKET,
470 SO_REUSEADDR,
471 &on, sizeof(on))) )
473 "setsockopt");
474 }
475 {
476
477
478 mode_t old_mask = 0;
479 const struct sockaddr_un *un = (
const struct sockaddr_un *)
address;
480 int not_abstract = 0;
481
482 if ((AF_UNIX ==
address->sa_family)
483 && ('\0' != un->sun_path[0]))
484 not_abstract = 1;
485 if (not_abstract)
486 old_mask = umask (S_IWGRP | S_IRGRP | S_IXGRP | S_IWOTH | S_IROTH
487 | S_IXOTH);
488
489 ret = bind (desc->
fd,
491 address_len);
492
493 if (not_abstract)
494 (void) umask (old_mask);
495 }
498
502
504}
505
506
509{
511 const struct sockaddr_un *un;
512
513 ret = close (desc->
fd);
514
515 un = (
const struct sockaddr_un *) desc->
addr;
516
517
518
519 if ((AF_UNIX == desc->
af) &&
520 (NULL != desc->
addr) &&
521 ('\0' != un->sun_path[0]))
522 {
524 sizeof(un->sun_path));
525
526 if (0 != unlink (dirname))
527 {
529 "unlink",
530 dirname);
531 }
532 else
533 {
534 size_t len;
535
536 len = strlen (dirname);
538 len--;
539 dirname[len] = '\0';
540 if ((0 != len) && (0 != rmdir (dirname)))
541 {
542 switch (errno)
543 {
544 case EACCES:
545 case ENOTEMPTY:
546 case EPERM:
547
548 break;
549
550 default:
552 "rmdir",
553 dirname);
554 break;
555 }
556 }
557 }
559 }
562}
563
564
565void
567{
570}
571
572
581{
583
584 if (fcntl (
fd, F_GETFD) < 0)
585 return NULL;
590}
591
592
603 const struct sockaddr *
address,
604 socklen_t address_len)
605{
607
608 ret = connect (desc->
fd,
610 address_len);
611
613}
614
615
628 int level,
629 int optname,
630 void *optval,
631 socklen_t *optlen)
632{
634
635 ret = getsockopt (desc->
fd,
636 level,
637 optname,
638 optval, optlen);
639
641}
642
643
653 int backlog)
654{
656
657 ret = listen (desc->
fd,
658 backlog);
659
661}
662
663
670ssize_t
672{
673 int error;
674
675
677
678 error = ioctl (desc->
fd,
679 FIONREAD,
681 if (0 == error)
684}
685
686
687ssize_t
689 void *buffer,
690 size_t length,
691 struct sockaddr *src_addr,
693{
694 int flags = 0;
695
696#ifdef MSG_DONTWAIT
697 flags |= MSG_DONTWAIT;
698#endif
699 return recvfrom (desc->
fd,
700 buffer,
701 length,
702 flags,
703 src_addr,
705}
706
707
716ssize_t
718 void *buffer,
719 size_t length)
720{
722 int flags;
723
724 flags = 0;
725
726#ifdef MSG_DONTWAIT
727 flags |= MSG_DONTWAIT;
728#endif
729 ret = recv (desc->
fd,
730 buffer,
731 length,
732 flags);
734}
735
736
737ssize_t
739 const void *buffer,
740 size_t length)
741{
743 int flags;
744
745 flags = 0;
746#ifdef MSG_DONTWAIT
747 flags |= MSG_DONTWAIT;
748#endif
749#ifdef MSG_NOSIGNAL
750 flags |= MSG_NOSIGNAL;
751#endif
752 ret = send (desc->
fd,
753 buffer,
754 length,
755 flags);
757}
758
759
771ssize_t
773 const void *message,
774 size_t length,
775 const struct sockaddr *dest_addr,
776 socklen_t dest_len)
777{
778 int flags = 0;
779
780#ifdef MSG_DONTWAIT
781 flags |= MSG_DONTWAIT;
782#endif
783#ifdef MSG_NOSIGNAL
784 flags |= MSG_NOSIGNAL;
785#endif
786 return sendto (desc->
fd,
787 message,
788 length,
789 flags,
790 dest_addr,
791 dest_len);
792}
793
794
805int
807 int level,
808 int option_name,
809 const void *option_value,
810 socklen_t option_len)
811{
812 return (0 == setsockopt (
fd->fd,
813 level,
814 option_name,
815 option_value,
816 option_len))
819}
820
821
835 int protocol)
836{
839
840 fd = socket (domain,
type, protocol);
842 return NULL;
847 domain,
849 return NULL;
851}
852
853
862 int how)
863{
865
866 ret = shutdown (desc->
fd, how);
867
869}
870
871
883{
885
886#ifdef __linux__
888
889 if (0 !=
891 setsockopt (desc->
fd,
892 SOL_SOCKET,
893 SO_SNDBUF,
897 "setsockopt");
898 if (0 !=
900 setsockopt (desc->
fd,
901 SOL_SOCKET,
902 SO_RCVBUF,
906 "setsockopt");
907#endif
909}
910
911
917void
919{
922}
923
924
931void
934{
939}
940
941
949int
952{
953 return FD_ISSET (desc->
fd,
955}
956
957
964void
967{
968 int nfds;
969
970 for (nfds = src->
nsds; nfds >= 0; nfds--)
971 if (FD_ISSET (nfds, &src->
sds))
972 FD_SET (nfds, &dst->
sds);
975}
976
977
984void
987{
991}
992
993
1000int
1002{
1004}
1005
1006
1013struct sockaddr*
1015{
1017}
1018
1019
1026socklen_t
1028{
1030}
1031
1032
1040void
1042 const fd_set *from,
1043 int nfds)
1044{
1048}
1049
1050
1057void
1059 int nfd)
1060{
1062 FD_SET (nfd, &to->
sds);
1065}
1066
1067
1075int
1077 int nfd)
1078{
1079 if ((-1 == nfd) ||
1080 (NULL == to))
1083}
1084
1085
1091void
1094{
1095 int fd;
1096
1099 FD_SET (fd,
1103}
1104
1105
1111void
1114{
1116}
1117
1118
1126int
1129{
1130 return FD_ISSET (
h->fd,
1132}
1133
1134
1142int
1145{
1146 int nfds;
1147
1150 while (nfds > 0)
1151 {
1152 nfds--;
1153 if ((FD_ISSET (nfds,
1155 (FD_ISSET (nfds,
1158 }
1160}
1161
1162
1170{
1172
1175 return fds;
1176}
1177
1178
1184void
1186{
1188}
1189
1190
1198int
1201{
1203 int bind_status;
1204 int socktype;
1205 char open_port_str[6];
1206 struct addrinfo hint;
1207 struct addrinfo *
ret;
1208 struct addrinfo *
ai;
1209
1211 sizeof(open_port_str),
1212 "%u",
1213 (
unsigned int)
port);
1214 socktype = (IPPROTO_TCP == ipproto) ? SOCK_STREAM : SOCK_DGRAM;
1216 memset (&hint, 0, sizeof(hint));
1217 hint.ai_family = AF_UNSPEC;
1218 hint.ai_socktype = socktype;
1219 hint.ai_protocol = ipproto;
1220 hint.ai_addrlen = 0;
1221 hint.ai_addr = NULL;
1222 hint.ai_canonname = NULL;
1223 hint.ai_next = NULL;
1226 open_port_str,
1227 &hint,
1231 {
1235 if (NULL == socket)
1236 continue;
1242 break;
1243 }
1245 return bind_status;
1246}
1247
1248
1258int
1263{
1264 int nfds;
1265 struct timeval tv;
1266
1267 if (NULL != rfds)
1269 else
1270 nfds = 0;
1271 if (NULL != wfds)
1274 if (NULL != efds)
1277 if ((0 == nfds) &&
1279 {
1283 "Fatal internal logic error, process hangs in `%s' (abort with CTRL-C)!\n"),
1284 "select");
1285 }
1287 long long)
1288 LONG_MAX)
1289 {
1290 tv.tv_sec = LONG_MAX;
1291 tv.tv_usec = 999999L;
1292 }
1293 else
1294 {
1297 tv.tv_usec =
1300 }
1301 return select (nfds,
1302 (NULL != rfds) ? &rfds->
sds : NULL,
1303 (NULL != wfds) ? &wfds->sds : NULL,
1304 (NULL != efds) ? &efds->sds : NULL,
1307}
1308
1309
1310
enum GNUNET_GenericReturnValue GNUNET_DISK_internal_file_handle_(const struct GNUNET_DISK_FileHandle *fh, int *dst)
Retrieve OS file handle.
static struct GNUNET_ARM_Handle * h
Connection with ARM.
static int ret
Final status code.
static struct GNUNET_TIME_Relative timeout
User defined timestamp for completing operations.
static int end
Set if we are to shutdown all services (including ARM).
static uint16_t port
Port number.
static struct GNUNET_TRANSPORT_AddressIdentifier * ai
Handle to the operation that publishes our address.
static char * address
GNS address for this phone.
static struct in_addr dummy
Target "dummy" address of the packet we pretend to respond to.
static struct GNUNET_IDENTITY_Handle * sh
Handle to IDENTITY service.
static char * name
Name (label) of the records to list.
static char * value
Value of the record to add/remove.
static uint32_t type
Type string converted to DNS type value.
static unsigned int pending
The number of DNS queries that are outstanding.
void GNUNET_CRYPTO_hash(const void *block, size_t size, struct GNUNET_HashCode *ret)
Compute hash of a given block.
void GNUNET_CRYPTO_hash_to_enc(const struct GNUNET_HashCode *block, struct GNUNET_CRYPTO_HashAsciiEncoded *result)
Convert hash to ASCII encoding.
#define GNUNET_log(kind,...)
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
GNUNET_GenericReturnValue
Named constants for return values.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
const char * GNUNET_a2s(const struct sockaddr *addr, socklen_t addrlen)
Convert a "struct sockaddr*" (IPv4 or IPv6 address) to a string (for printing debug messages).
#define GNUNET_log_strerror(level, cmd)
Log an error message at log-level 'level' that indicates a failure of the command 'cmd' with the mess...
#define GNUNET_log_strerror_file(level, cmd, filename)
Log an error message at log-level 'level' that indicates a failure of the command 'cmd' with the mess...
@ GNUNET_ERROR_TYPE_WARNING
@ GNUNET_ERROR_TYPE_ERROR
@ GNUNET_ERROR_TYPE_DEBUG
#define GNUNET_strndup(a, length)
Wrapper around GNUNET_xstrndup_.
int GNUNET_snprintf(char *buf, size_t size, const char *format,...) __attribute__((format(printf
Like snprintf, just aborts if the buffer is of insufficient size.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_malloc(size)
Wrapper around malloc.
#define GNUNET_free(ptr)
Wrapper around free.
struct sockaddr * GNUNET_NETWORK_get_addr(const struct GNUNET_NETWORK_Handle *desc)
Return sockaddr for this network handle.
void GNUNET_NETWORK_fdset_handle_set_first(struct GNUNET_NETWORK_FDSet *fds, const struct GNUNET_DISK_FileHandle *h)
Add a file handle to the fd set.
struct GNUNET_NETWORK_Handle * GNUNET_NETWORK_socket_accept(const struct GNUNET_NETWORK_Handle *desc, struct sockaddr *address, socklen_t *address_len)
Accept a new connection on a socket.
enum GNUNET_GenericReturnValue GNUNET_NETWORK_socket_getsockopt(const struct GNUNET_NETWORK_Handle *desc, int level, int optname, void *optval, socklen_t *optlen)
Get socket options.
void GNUNET_NETWORK_fdset_zero(struct GNUNET_NETWORK_FDSet *fds)
Reset FD set.
enum GNUNET_GenericReturnValue GNUNET_NETWORK_socket_close(struct GNUNET_NETWORK_Handle *desc)
Close a socket.
void GNUNET_NETWORK_fdset_destroy(struct GNUNET_NETWORK_FDSet *fds)
Releases the associated memory of an fd set.
socklen_t GNUNET_NETWORK_get_addrlen(const struct GNUNET_NETWORK_Handle *desc)
Return sockaddr length for this network handle.
int GNUNET_NETWORK_get_fd(const struct GNUNET_NETWORK_Handle *desc)
Return file descriptor for this network handle.
void GNUNET_NETWORK_fdset_copy_native(struct GNUNET_NETWORK_FDSet *to, const fd_set *from, int nfds)
Copy a native fd set.
int GNUNET_NETWORK_test_port_free(int ipproto, uint16_t port)
Test if the given port is available.
int GNUNET_NETWORK_fdset_overlap(const struct GNUNET_NETWORK_FDSet *fds1, const struct GNUNET_NETWORK_FDSet *fds2)
Checks if two fd sets overlap.
ssize_t GNUNET_NETWORK_socket_recv(const struct GNUNET_NETWORK_Handle *desc, void *buffer, size_t length)
Read data from a connected socket (always non-blocking).
char * GNUNET_NETWORK_shorten_unixpath(char *unixpath)
Given a unixpath that is too long (larger than UNIX_PATH_MAX), shorten it to an acceptable length whi...
ssize_t GNUNET_NETWORK_socket_recvfrom(const struct GNUNET_NETWORK_Handle *desc, void *buffer, size_t length, struct sockaddr *src_addr, socklen_t *addrlen)
Read data from a socket (always non-blocking).
struct GNUNET_NETWORK_FDSet * GNUNET_NETWORK_fdset_create()
Creates an fd set.
void GNUNET_NETWORK_fdset_add(struct GNUNET_NETWORK_FDSet *dst, const struct GNUNET_NETWORK_FDSet *src)
Add one fd set to another.
enum GNUNET_GenericReturnValue GNUNET_NETWORK_socket_set_blocking(struct GNUNET_NETWORK_Handle *fd, int doBlock)
Set if a socket should use blocking or non-blocking IO.
struct GNUNET_NETWORK_Handle * GNUNET_NETWORK_socket_box_native(int fd)
Box a native socket (and check that it is a socket).
void GNUNET_NETWORK_fdset_set_native(struct GNUNET_NETWORK_FDSet *to, int nfd)
Set a native fd in a set.
struct GNUNET_NETWORK_Handle * GNUNET_NETWORK_socket_create(int domain, int type, int protocol)
Create a new socket.
void GNUNET_NETWORK_fdset_copy(struct GNUNET_NETWORK_FDSet *to, const struct GNUNET_NETWORK_FDSet *from)
Copy one fd set to another.
enum GNUNET_GenericReturnValue GNUNET_NETWORK_socket_connect(const struct GNUNET_NETWORK_Handle *desc, const struct sockaddr *address, socklen_t address_len)
Connect a socket to some remote address.
ssize_t GNUNET_NETWORK_socket_recvfrom_amount(const struct GNUNET_NETWORK_Handle *desc)
How much data is available to be read on this descriptor?
int GNUNET_NETWORK_fdset_test_native(const struct GNUNET_NETWORK_FDSet *to, int nfd)
Test native fd in a set.
void GNUNET_NETWORK_fdset_set(struct GNUNET_NETWORK_FDSet *fds, const struct GNUNET_NETWORK_Handle *desc)
Add a socket to the FD set.
void GNUNET_NETWORK_socket_free_memory_only_(struct GNUNET_NETWORK_Handle *desc)
Only free memory of a socket, keep the file descriptor untouched.
ssize_t GNUNET_NETWORK_socket_send(const struct GNUNET_NETWORK_Handle *desc, const void *buffer, size_t length)
Send data (always non-blocking).
enum GNUNET_GenericReturnValue GNUNET_NETWORK_test_pf(int pf)
Test if the given protocol family is supported by this system.
enum GNUNET_GenericReturnValue GNUNET_NETWORK_socket_bind(struct GNUNET_NETWORK_Handle *desc, const struct sockaddr *address, socklen_t address_len)
Bind a socket to a particular address.
enum GNUNET_GenericReturnValue GNUNET_NETWORK_socket_listen(const struct GNUNET_NETWORK_Handle *desc, int backlog)
Listen on a socket.
void GNUNET_NETWORK_unix_precheck(const struct sockaddr_un *un)
If services crash, they can leave a unix domain socket file on the disk.
int GNUNET_NETWORK_fdset_handle_isset(const struct GNUNET_NETWORK_FDSet *fds, const struct GNUNET_DISK_FileHandle *h)
Check if a file handle is part of an fd set.
int GNUNET_NETWORK_socket_select(struct GNUNET_NETWORK_FDSet *rfds, struct GNUNET_NETWORK_FDSet *wfds, struct GNUNET_NETWORK_FDSet *efds, const struct GNUNET_TIME_Relative timeout)
Check if sockets or pipes meet certain conditions.
enum GNUNET_GenericReturnValue GNUNET_NETWORK_socket_shutdown(struct GNUNET_NETWORK_Handle *desc, int how)
Shut down socket operations.
int GNUNET_NETWORK_socket_setsockopt(struct GNUNET_NETWORK_Handle *fd, int level, int option_name, const void *option_value, socklen_t option_len)
Set socket option.
ssize_t GNUNET_NETWORK_socket_sendto(const struct GNUNET_NETWORK_Handle *desc, const void *message, size_t length, const struct sockaddr *dest_addr, socklen_t dest_len)
Send data to a particular destination (always non-blocking).
int GNUNET_NETWORK_fdset_isset(const struct GNUNET_NETWORK_FDSet *fds, const struct GNUNET_NETWORK_Handle *desc)
Check whether a socket is part of the fd set.
enum GNUNET_GenericReturnValue GNUNET_NETWORK_socket_disable_corking(struct GNUNET_NETWORK_Handle *desc)
Disable the "CORK" feature for communication with the given socket, forcing the OS to immediately flu...
void GNUNET_NETWORK_fdset_handle_set(struct GNUNET_NETWORK_FDSet *fds, const struct GNUNET_DISK_FileHandle *h)
Add a file handle to the fd set.
#define GNUNET_TIME_UNIT_FOREVER_REL
Constant used to specify "forever".
#define GNUNET_TIME_UNIT_SECONDS
One second.
static int initialize_network_handle(struct GNUNET_NETWORK_Handle *h, int af, int type)
Perform proper canonical initialization for a network handle.
static void socket_set_nodelay(const struct GNUNET_NETWORK_Handle *h)
Disable delays when sending data via the socket.
#define LOG_STRERROR_FILE(kind, syscall, filename)
#define LOG_STRERROR(kind, syscall)
static int socket_set_inheritable(const struct GNUNET_NETWORK_Handle *h)
Make a socket non-inheritable to child processes.
0-terminated ASCII encoding of a struct GNUNET_HashCode.
Handle used to access files (and pipes).
collection of IO descriptors
int nsds
Maximum number of any socket descriptor in the set (plus one)
fd_set sds
Bitset with the descriptors.
struct sockaddr * addr
Address we were bound to, or NULL.
int type
Type of the socket.
socklen_t addrlen
Number of bytes in addr.
int af
Address family / domain.
Time for relative time used by GNUnet, in microseconds.
uint64_t rel_value_us
The actual value.