1 /*-*- Mode: C; c-basic-offset: 8 -*-*/
3 #ifndef foosocketutilhfoo
4 #define foosocketutilhfoo
6 #include <sys/socket.h>
7 #include <netinet/in.h>
13 typedef struct Address {
16 struct sockaddr_in in4;
17 struct sockaddr_in6 in6;
18 struct sockaddr_un un;
19 struct sockaddr_storage storage;
22 /* We store the size here explicitly due to the weird
23 * sockaddr_un semantics for abstract sockets */
26 /* Socket type, i.e. SOCK_STREAM, SOCK_DGRAM, ... */
29 /* Only for INET6 sockets: issue IPV6_V6ONLY sockopt */
33 #define address_family(a) ((a)->sockaddr.sa.sa_family)
35 int address_parse(Address *a, const char *s);
36 int address_print(const Address *a, char **p);
37 int address_verify(const Address *a);
38 int address_listen(const Address *a, int backlog);