48 #ifndef _ASTERISK_TCPTLS_H
49 #define _ASTERISK_TCPTLS_H
54 #if defined(HAVE_OPENSSL) && (defined(HAVE_FUNOPEN) || defined(HAVE_FOPENCOOKIE))
59 #include <openssl/ssl.h>
60 #include <openssl/err.h>
63 typedef struct {} SSL;
64 typedef struct {} SSL_CTX;
68 #define AST_CERTFILE "asterisk.pem"
133 void *(*accept_fn)(
void *);
135 void *(*worker_fn)(
void *);
221 #if defined(HAVE_FUNOPEN)
225 #define HOOK_T ssize_t
void ast_tcptls_server_start(struct ast_tcptls_session_args *desc)
This is a generic (re)start routine for a TCP server, which does the socket/bind/listen and starts a ...
void ast_ssl_teardown(struct ast_tls_config *cfg)
free resources used by an SSL server
int ast_ssl_setup(struct ast_tls_config *cfg)
Set up an SSL server.
struct timeval start
Start time from when an I/O sequence must complete by struct ast_tcptls_stream.timeout.
struct ast_str * overflow_buf
struct ast_tcptls_session_args * parent
arguments for the accepting thread
int timeout
Timeout in ms relative to struct ast_tcptls_stream.start to wait for an event on struct ast_tcptls_st...
Socket address structure.
void * ast_tcptls_server_root(void *)
struct ast_sockaddr remote_address
void ast_tcptls_stream_set_exclusive_input(struct ast_tcptls_stream *stream, int exclusive_input)
Set the TCP/TLS stream I/O if it can exclusively depend upon the set timeouts.
struct ast_tcptls_stream * stream_cookie
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
HOOK_T ast_tcptls_server_read(struct ast_tcptls_session_instance *ser, void *buf, size_t count)
void ast_tcptls_stream_set_timeout_inactivity(struct ast_tcptls_stream *stream, int timeout)
Set the TCP/TLS stream inactivity timeout timer.
struct ast_sockaddr old_address
Structure used to handle boolean flags.
HOOK_T ast_tcptls_server_write(struct ast_tcptls_session_instance *ser, const void *buf, size_t count)
void ast_tcptls_close_session_file(struct ast_tcptls_session_instance *tcptls_session)
Closes a tcptls session instance's file and/or file descriptor. The tcptls_session will be set to NUL...
struct ast_tcptls_session_instance * ast_tcptls_client_create(struct ast_tcptls_session_args *desc)
int ast_tls_read_conf(struct ast_tls_config *tls_cfg, struct ast_tcptls_session_args *tls_desc, const char *varname, const char *value)
Used to parse conf files containing tls/ssl options.
void ast_tcptls_stream_set_timeout_sequence(struct ast_tcptls_stream *stream, struct timeval start, int timeout)
Set the TCP/TLS stream I/O sequence timeout timer.
struct ast_tcptls_session_instance * ast_tcptls_client_start(struct ast_tcptls_session_instance *tcptls_session)
attempts to connect and start tcptls session, on error the tcptls_session's ref count is decremented...
void ast_tcptls_server_stop(struct ast_tcptls_session_args *desc)
Shutdown a running server if there is one.
struct ast_tls_config * tls_cfg
struct ast_sockaddr local_address
void(* periodic_fn)(void *)
void ast_tcptls_stream_set_timeout_disable(struct ast_tcptls_stream *stream)
Disable the TCP/TLS stream timeout timer.
Structure for mutex and tracking information.
char hostname[MAXHOSTNAMELEN]
struct ast_sockaddr remote_address