resolved: add missing error code check when initializing DNS-over-TLS
[thirdparty/systemd.git] / src / resolve / resolved-dnstls.h
CommitLineData
6016fcb0
IT
1/* SPDX-License-Identifier: LGPL-2.1+ */
2#pragma once
3
4#if !ENABLE_DNS_OVER_TLS
5#error This source file requires DNS-over-TLS to be enabled
6#endif
7
e22c5b20 8typedef struct DnsTlsManagerData DnsTlsManagerData;
6016fcb0
IT
9typedef struct DnsTlsServerData DnsTlsServerData;
10typedef struct DnsTlsStreamData DnsTlsStreamData;
11
096cbdce 12#if DNS_OVER_TLS_USE_GNUTLS
6016fcb0 13#include "resolved-dnstls-gnutls.h"
096cbdce
IT
14#elif DNS_OVER_TLS_USE_OPENSSL
15#include "resolved-dnstls-openssl.h"
16#else
17#error Unknown dependency for supporting DNS-over-TLS
6016fcb0
IT
18#endif
19
20#include "resolved-dns-stream.h"
21#include "resolved-dns-transaction.h"
22
23#define DNSTLS_STREAM_CLOSED 1
24
25int dnstls_stream_connect_tls(DnsStream *stream, DnsServer *server);
26void dnstls_stream_free(DnsStream *stream);
04c4d919 27int dnstls_stream_on_io(DnsStream *stream, uint32_t revents);
6016fcb0
IT
28int dnstls_stream_shutdown(DnsStream *stream, int error);
29ssize_t dnstls_stream_write(DnsStream *stream, const char *buf, size_t count);
30ssize_t dnstls_stream_read(DnsStream *stream, void *buf, size_t count);
31
6016fcb0 32void dnstls_server_free(DnsServer *server);
e22c5b20 33
71a681ae 34int dnstls_manager_init(Manager *manager);
e22c5b20 35void dnstls_manager_free(Manager *manager);