-/*-*- Mode: C; c-basic-offset: 8 -*-*/
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#ifndef foosocketutilhfoo
#define foosocketutilhfoo
#include "macro.h"
#include "util.h"
+union sockaddr_union {
+ struct sockaddr sa;
+ struct sockaddr_in in4;
+ struct sockaddr_in6 in6;
+ struct sockaddr_un un;
+ struct sockaddr_storage storage;
+};
+
typedef struct SocketAddress {
- union {
- struct sockaddr sa;
- struct sockaddr_in in4;
- struct sockaddr_in6 in6;
- struct sockaddr_un un;
- struct sockaddr_storage storage;
- } sockaddr;
+ union sockaddr_union sockaddr;
/* We store the size here explicitly due to the weird
* sockaddr_un semantics for abstract sockets */
bool free_bind,
mode_t directory_mode,
mode_t socket_mode,
+ const char *label,
int *ret);
bool socket_address_is(const SocketAddress *a, const char *s, int type);