|
Compy 0.2.0
A lightweight RTSP 1.0 server library for embedded systems
|
RTSPS (RTSP over TLS) support. More...
#include <compy/writer.h>#include <stddef.h>#include <unistd.h>#include <compy/priv/compiler_attrs.h>
Go to the source code of this file.
Data Structures | |
| struct | Compy_TlsConfig |
| TLS configuration. More... | |
Typedefs | |
| typedef struct Compy_TlsContext | Compy_TlsContext |
| Opaque TLS context (holds loaded cert/key, shared across connections). | |
| typedef struct Compy_TlsConn | Compy_TlsConn |
| Opaque per-connection TLS state. | |
Functions | |
| Compy_TlsContext * | Compy_TlsContext_new (Compy_TlsConfig config) COMPY_PRIV_MUST_USE |
| Creates a new TLS context from configuration. | |
| void | Compy_TlsContext_free (Compy_TlsContext *ctx) |
| Frees a TLS context. | |
| Compy_TlsConn * | Compy_TlsConn_accept (Compy_TlsContext *ctx, int fd) COMPY_PRIV_MUST_USE |
Performs server-side TLS handshake on fd. | |
| Compy_Writer | compy_tls_writer (Compy_TlsConn *conn) COMPY_PRIV_MUST_USE |
| Creates a Compy_Writer backed by a TLS connection. | |
| ssize_t | compy_tls_read (Compy_TlsConn *conn, void *buf, size_t len) COMPY_PRIV_MUST_USE |
| Reads decrypted data from a TLS connection. | |
| int | compy_tls_shutdown (Compy_TlsConn *conn) |
| Shuts down the TLS connection gracefully. | |
| void | Compy_TlsConn_free (Compy_TlsConn *conn) |
| Frees per-connection TLS state. | |
RTSPS (RTSP over TLS) support.
Provides server-side TLS for encrypted RTSP signaling. The application creates a TLS context (loading cert/key), accepts TLS connections, and uses the TLS writer for encrypted I/O. The TLS reader decrypts incoming RTSP requests.
Requires a compiled TLS backend (wolfSSL, mbedTLS, OpenSSL, or BearSSL).
| ssize_t compy_tls_read | ( | Compy_TlsConn * | conn, |
| void * | buf, | ||
| size_t | len | ||
| ) |
Reads decrypted data from a TLS connection.
Used by the event-loop integration to read RTSP requests arriving over an encrypted connection.
| [in] | conn | The TLS connection. |
| [out] | buf | Buffer to read into. |
| [in] | len | Maximum bytes to read. |
conn != NULL buf != NULL| int compy_tls_shutdown | ( | Compy_TlsConn * | conn | ) |
Shuts down the TLS connection gracefully.
| Compy_Writer compy_tls_writer | ( | Compy_TlsConn * | conn | ) |
Creates a Compy_Writer backed by a TLS connection.
All data written through this writer is encrypted via TLS before being sent on the underlying socket.
| [in] | conn | The TLS connection. |
conn != NULL | Compy_TlsConn * Compy_TlsConn_accept | ( | Compy_TlsContext * | ctx, |
| int | fd | ||
| ) |
Performs server-side TLS handshake on fd.
This is a blocking call that completes the full TLS handshake.
| [in] | ctx | The TLS context with loaded cert/key. |
| [in] | fd | The connected socket file descriptor. |
ctx != NULL fd >= 0| Compy_TlsContext * Compy_TlsContext_new | ( | Compy_TlsConfig | config | ) |
Creates a new TLS context from configuration.
| [in] | config | Certificate and key file paths. |
config.cert_path != NULL config.key_path != NULL