X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fsocket-util.h;h=4743c376867c21cb924ea7e2faf76148ab908b87;hp=841570f002ffc826a0e4b48c7d23a8fcdc767c11;hb=ead8e4788ee31bbdc38b4cd3c6e71c8a95bbc95a;hpb=7a58bfa4aef88c9ddead6668d83640f762938e72 diff --git a/src/socket-util.h b/src/socket-util.h index 841570f00..4743c3768 100644 --- a/src/socket-util.h +++ b/src/socket-util.h @@ -1,4 +1,4 @@ -/*-*- Mode: C; c-basic-offset: 8 -*-*/ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ #ifndef foosocketutilhfoo #define foosocketutilhfoo @@ -26,19 +26,20 @@ #include #include #include -#include #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 */ @@ -72,7 +73,7 @@ int socket_address_listen( bool free_bind, mode_t directory_mode, mode_t socket_mode, - security_context_t scon, + const char *label, int *ret); bool socket_address_is(const SocketAddress *a, const char *s, int type); @@ -84,4 +85,6 @@ bool socket_address_needs_mount(const SocketAddress *a, const char *prefix); const char* socket_address_bind_ipv6_only_to_string(SocketAddressBindIPv6Only b); SocketAddressBindIPv6Only socket_address_bind_ipv6_only_from_string(const char *s); +bool socket_ipv6_is_supported(void); + #endif