Compy 0.2.0
A lightweight RTSP 1.0 server library for embedded systems
Loading...
Searching...
No Matches
tls.h
Go to the documentation of this file.
1
13#pragma once
14
15#include <compy/writer.h>
16
17#include <stddef.h>
18
19#include <unistd.h>
20
21#include <compy/priv/compiler_attrs.h>
22
26typedef struct {
27 const char *cert_path;
28 const char *key_path;
30
35
47Compy_TlsContext_new(Compy_TlsConfig config) COMPY_PRIV_MUST_USE;
48
53
58
73Compy_TlsConn_accept(Compy_TlsContext *ctx, int fd) COMPY_PRIV_MUST_USE;
74
85Compy_Writer compy_tls_writer(Compy_TlsConn *conn) COMPY_PRIV_MUST_USE;
86
102ssize_t
103compy_tls_read(Compy_TlsConn *conn, void *buf, size_t len) COMPY_PRIV_MUST_USE;
104
111
TLS configuration.
Definition tls.h:26
const char * key_path
Path to PEM private key file.
Definition tls.h:28
const char * cert_path
Path to PEM certificate file.
Definition tls.h:27
Definition tls.c:46
Definition tls.c:13
Compy_Writer compy_tls_writer(Compy_TlsConn *conn) COMPY_PRIV_MUST_USE
Creates a Compy_Writer backed by a TLS connection.
Definition tls.c:139
void Compy_TlsConn_free(Compy_TlsConn *conn)
Frees per-connection TLS state.
Definition tls.c:83
ssize_t compy_tls_read(Compy_TlsConn *conn, void *buf, size_t len) COMPY_PRIV_MUST_USE
Reads decrypted data from a TLS connection.
Definition tls.c:70
Compy_TlsContext * Compy_TlsContext_new(Compy_TlsConfig config) COMPY_PRIV_MUST_USE
Creates a new TLS context from configuration.
Definition tls.c:17
void Compy_TlsContext_free(Compy_TlsContext *ctx)
Frees a TLS context.
Definition tls.c:37
Compy_TlsConn * Compy_TlsConn_accept(Compy_TlsContext *ctx, int fd) COMPY_PRIV_MUST_USE
Performs server-side TLS handshake on fd.
Definition tls.c:50
int compy_tls_shutdown(Compy_TlsConn *conn)
Shuts down the TLS connection gracefully.
Definition tls.c:76
The writer interface.