1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
4 #if ENABLE_DNS_OVER_TLS
9 typedef struct DnsServer DnsServer
;
10 typedef struct DnsStream DnsStream
;
11 typedef struct DnsTlsManagerData DnsTlsManagerData
;
12 typedef struct DnsTlsServerData DnsTlsServerData
;
13 typedef struct DnsTlsStreamData DnsTlsStreamData
;
14 typedef struct Manager Manager
;
16 #if DNS_OVER_TLS_USE_GNUTLS
17 #include "resolved-dnstls-gnutls.h"
18 #elif DNS_OVER_TLS_USE_OPENSSL
19 #include "resolved-dnstls-openssl.h"
21 #error Unknown dependency for supporting DNS-over-TLS
24 #define DNSTLS_STREAM_CLOSED 1
26 int dnstls_stream_connect_tls(DnsStream
*stream
, DnsServer
*server
);
27 void dnstls_stream_free(DnsStream
*stream
);
28 int dnstls_stream_on_io(DnsStream
*stream
, uint32_t revents
);
29 int dnstls_stream_shutdown(DnsStream
*stream
, int error
);
30 ssize_t
dnstls_stream_writev(DnsStream
*stream
, const struct iovec
*iov
, size_t iovcnt
);
31 ssize_t
dnstls_stream_read(DnsStream
*stream
, void *buf
, size_t count
);
33 void dnstls_server_free(DnsServer
*server
);
35 int dnstls_manager_init(Manager
*manager
);
36 void dnstls_manager_free(Manager
*manager
);
38 #endif /* ENABLE_DNS_OVER_TLS */