diff options
author | Gustavo Sverzut Barbieri <barbieri@profusion.mobi> | 2016-11-01 16:01:57 -0200 |
---|---|---|
committer | Gustavo Sverzut Barbieri <barbieri@profusion.mobi> | 2016-11-01 16:37:04 -0200 |
commit | c2630c829f45df5973582a4259d2a0b127cc7cae (patch) | |
tree | abe4cd1f4cd6d4235faf5e731b114ac039d62501 /src/lib/ecore_con/ecore_con_private.h | |
parent | 3ac1812a1f9915f4a8545e5db529bb8003ffdeaa (diff) | |
download | efl-c2630c829f45df5973582a4259d2a0b127cc7cae.tar.gz |
efl_net_server support systemd socket activation.
It includes extensive verifications to avoid mistakes and usage of
incorrect sockets.
Diffstat (limited to 'src/lib/ecore_con/ecore_con_private.h')
-rw-r--r-- | src/lib/ecore_con/ecore_con_private.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/lib/ecore_con/ecore_con_private.h b/src/lib/ecore_con/ecore_con_private.h index ec2fc21310..f222656ee2 100644 --- a/src/lib/ecore_con/ecore_con_private.h +++ b/src/lib/ecore_con/ecore_con_private.h @@ -411,6 +411,30 @@ Eina_Bool efl_net_unix_fmt(char *buf, size_t buflen, SOCKET fd, const struct soc #endif Eina_Bool efl_net_ip_port_fmt(char *buf, size_t buflen, const struct sockaddr *addr); +#ifdef HAVE_SYSTEMD +/** + * Checks if the next FD in the sd_fd_index:sd_fd_max is of the + * expected family, protocol and if it's listening. + * + * This is similar to sd_is_socket()/sd_is_socket_inet(), but will + * also parse address in our standard format "IP:PORT", including IPv6 + * within braces, and then will validate the address with + * getsockaddr() for INET. + * + * @param address the address to validate + * @param family AF_UNIX or AF_UNSPEC for INET, in that case AF_INET + * or AF_INET6 will be inferred from @a address. + * @param type SOCK_STREAM or SOCK_DGRAM + * @param[out] listening where to return listening state, should be + * NULL for @a type SOCK_DGRAM + * + * @return 0 on success, error otherwise. + * + * @internal + */ +Eina_Error efl_net_ip_socket_activate_check(const char *address, int family, int type, Eina_Bool *listening); +#endif + /** * @brief splits an address in the format "host:port" in two * null-terminated strings. |