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 d42a2fee318d05e6a5050fa0bf95986ce89a0cdd..d125fca83feea91526f85a7a68458876cbc31763 100644 (file)
@@ -24,9 +24,9 @@
 #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>
 
 #include "macro.h"
 #include "util.h"
@@ -38,6 +38,12 @@ union sockaddr_union {
         struct sockaddr_un un;
         struct sockaddr_nl nl;
         struct sockaddr_storage storage;
+        struct sockaddr_ll ll;
+};
+
+union in_addr_union {
+        struct in_addr in;
+        struct in6_addr in6;
 };
 
 typedef struct SocketAddress {
@@ -68,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_;
 
@@ -82,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);