diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/tcptls.h | 47 | ||||
-rw-r--r-- | include/asterisk/utils.h | 1 |
2 files changed, 48 insertions, 0 deletions
diff --git a/include/asterisk/tcptls.h b/include/asterisk/tcptls.h index 6364158de..17b532cda 100644 --- a/include/asterisk/tcptls.h +++ b/include/asterisk/tcptls.h @@ -144,6 +144,51 @@ struct ast_tcptls_session_args { const char *name; }; +struct ast_tcptls_stream; + +/*! + * \brief Disable the TCP/TLS stream timeout timer. + * + * \param stream TCP/TLS stream control data. + * + * \return Nothing + */ +void ast_tcptls_stream_set_timeout_disable(struct ast_tcptls_stream *stream); + +/*! + * \brief Set the TCP/TLS stream inactivity timeout timer. + * + * \param stream TCP/TLS stream control data. + * \param timeout Number of milliseconds to wait for data transfer with the peer. + * + * \details This is basically how much time we are willing to spend + * in an I/O call before we declare the peer unresponsive. + * + * \note Setting timeout to -1 disables the timeout. + * \note Setting this timeout replaces the I/O sequence timeout timer. + * + * \return Nothing + */ +void ast_tcptls_stream_set_timeout_inactivity(struct ast_tcptls_stream *stream, int timeout); + +/*! + * \brief Set the TCP/TLS stream I/O sequence timeout timer. + * + * \param stream TCP/TLS stream control data. + * \param start Time the I/O sequence timer starts. + * \param timeout Number of milliseconds from the start time before timeout. + * + * \details This is how much time are we willing to allow the peer + * to complete an operation that can take several I/O calls. The + * main use is as an authentication timer with us. + * + * \note Setting timeout to -1 disables the timeout. + * \note Setting this timeout replaces the inactivity timeout timer. + * + * \return Nothing + */ +void ast_tcptls_stream_set_timeout_sequence(struct ast_tcptls_stream *stream, struct timeval start, int timeout); + /*! \brief * describes a server instance */ @@ -161,6 +206,8 @@ struct ast_tcptls_session_instance { * extra data. */ struct ast_str *overflow_buf; + /*! ao2 FILE stream cookie object associated with f. */ + struct ast_tcptls_stream *stream_cookie; }; #if defined(HAVE_FUNOPEN) diff --git a/include/asterisk/utils.h b/include/asterisk/utils.h index e441ba055..47a438eb3 100644 --- a/include/asterisk/utils.h +++ b/include/asterisk/utils.h @@ -369,6 +369,7 @@ static force_inline void ast_slinear_saturated_divide(short *input, short *value int ast_utils_init(void); int ast_wait_for_input(int fd, int ms); +int ast_wait_for_output(int fd, int ms); /*! * \brief Try to write string, but wait no more than ms milliseconds |