chiark / gitweb /
socket-util: introduce in_addr_union similar to sockaddr_union and make use of it...
[elogind.git] / src / shared / socket-util.h
index 84ebc302feac10c649d6515c2c04050f85ae4ac7..d125fca83feea91526f85a7a68458876cbc31763 100644 (file)
@@ -24,7 +24,6 @@
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <sys/un.h>
-#include <net/if.h>
 #include <asm/types.h>
 #include <linux/netlink.h>
 #include <linux/if_packet.h>
@@ -42,6 +41,11 @@ union sockaddr_union {
         struct sockaddr_ll ll;
 };
 
+union in_addr_union {
+        struct in_addr in;
+        struct in6_addr in6;
+};
+
 typedef struct SocketAddress {
         union sockaddr_union sockaddr;
 
@@ -70,6 +74,7 @@ int socket_address_parse(SocketAddress *a, const char *s);
 int socket_address_parse_netlink(SocketAddress *a, const char *s);
 int socket_address_print(const SocketAddress *a, char **p);
 int socket_address_verify(const SocketAddress *a) _pure_;
+int socket_address_unlink(SocketAddress *a);
 
 bool socket_address_can_accept(const SocketAddress *a) _pure_;
 
@@ -84,6 +89,7 @@ int socket_address_listen(
                 mode_t directory_mode,
                 mode_t socket_mode,
                 const char *label);
+int make_socket_fd(int log_level, const char* address, int flags);
 
 bool socket_address_is(const SocketAddress *a, const char *s, int type);
 bool socket_address_is_netlink(const SocketAddress *a, const char *s);