]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/systemd/sd-daemon.h
Add SPDX license identifiers to source files under the LGPL
[thirdparty/systemd.git] / src / systemd / sd-daemon.h
index 740b176903cb1dad509c88ff3039819d53da0999..61cfdd8e0a625dee800adf9f74e38179f65d1cda 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 #ifndef foosddaemonhfoo
 #define foosddaemonhfoo
 
@@ -22,6 +23,7 @@
 
 #include <inttypes.h>
 #include <sys/types.h>
+#include <sys/socket.h>
 
 #include "_sd-common.h"
 
@@ -130,6 +132,18 @@ int sd_is_socket(int fd, int family, int type, int listening);
 */
 int sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port);
 
+/*
+  Helper call for identifying a passed file descriptor. Returns 1 if the
+  file descriptor is an Internet socket of the specified type
+  (SOCK_DGRAM, SOCK_STREAM, ...), and if the address of the socket is
+  the same as the address specified by addr. The listening flag is used
+  the same way as in sd_is_socket(). Returns a negative errno style
+  error code on failure.
+
+  See sd_is_socket_sockaddr(3) for more information.
+*/
+int sd_is_socket_sockaddr(int fd, int type, const struct sockaddr* addr, unsigned addr_len, int listening);
+
 /*
   Helper call for identifying a passed file descriptor. Returns 1 if
   the file descriptor is an AF_UNIX socket of the specified type