summaryrefslogtreecommitdiffstats
path: root/src/util/sss_sockets.h
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2016-03-02 14:33:38 -0500
committerJakub Hrozek <jhrozek@redhat.com>2016-03-09 18:34:39 +0100
commit5dbf360f2d6b0281c32f1bba6ebf5cc834c1716e (patch)
tree76b6fa8bcd9d2f6ffaa055a0367432e6a7daa6eb /src/util/sss_sockets.h
parent991c9f47fcb24704b880f60ab8ee77cfda056e2c (diff)
downloadsssd-5dbf360f2d6b0281c32f1bba6ebf5cc834c1716e.tar.gz
sssd-5dbf360f2d6b0281c32f1bba6ebf5cc834c1716e.tar.xz
sssd-5dbf360f2d6b0281c32f1bba6ebf5cc834c1716e.zip
Util: Move socket setup in a common utility file
Other components may need to connect sockets, the code here is generic enough that with minimal modifications can be used for non-ldap connections too. So create a sss_sockets.c/h utility file with all the non-ldap specific socket setup functions and make them available for other uses. Resolves: https://fedorahosted.org/sssd/ticket/2968 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Diffstat (limited to 'src/util/sss_sockets.h')
-rw-r--r--src/util/sss_sockets.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/util/sss_sockets.h b/src/util/sss_sockets.h
new file mode 100644
index 000000000..ccb05cb84
--- /dev/null
+++ b/src/util/sss_sockets.h
@@ -0,0 +1,39 @@
+/*
+ SSSD
+
+ Socket utils
+
+ Copyright (C) Simo Sorce <ssorce@redhat.com> 2016
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __SSS_SOCKETS_H__
+#define __SSS_SOCKETS_H__
+
+struct tevent_req *sssd_async_connect_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ int fd,
+ const struct sockaddr *addr,
+ socklen_t addr_len);
+int sssd_async_connect_recv(struct tevent_req *req);
+
+
+struct tevent_req *sssd_async_socket_init_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct sockaddr_storage *addr,
+ socklen_t addr_len, int timeout);
+int sssd_async_socket_init_recv(struct tevent_req *req, int *sd);
+
+#endif /* __SSS_SOCKETS_H__ */