1*e7be843bSPierre Pronchery=pod 2*e7be843bSPierre Pronchery 3*e7be843bSPierre Pronchery=head1 NAME 4*e7be843bSPierre Pronchery 5*e7be843bSPierre ProncheryDTLSv1_get_timeout - determine when a DTLS or QUIC SSL object next needs a 6*e7be843bSPierre Proncherytimeout event to be handled 7*e7be843bSPierre Pronchery 8*e7be843bSPierre Pronchery=head1 SYNOPSIS 9*e7be843bSPierre Pronchery 10*e7be843bSPierre Pronchery #include <openssl/ssl.h> 11*e7be843bSPierre Pronchery 12*e7be843bSPierre Pronchery int DTLSv1_get_timeout(SSL *s, struct timeval *tv); 13*e7be843bSPierre Pronchery 14*e7be843bSPierre Pronchery=head1 DESCRIPTION 15*e7be843bSPierre Pronchery 16*e7be843bSPierre ProncheryDTLSv1_get_timeout() can be used on a DTLS or QUIC SSL object to determine when 17*e7be843bSPierre Proncherythe SSL object next needs to perform internal processing due to the passage of 18*e7be843bSPierre Proncherytime. 19*e7be843bSPierre Pronchery 20*e7be843bSPierre ProncheryCalling DTLSv1_get_timeout() results in I<*tv> being written with an amount of 21*e7be843bSPierre Proncherytime left before the SSL object needs have DTLSv1_handle_timeout() called on it. 22*e7be843bSPierre ProncheryIf the SSL object needs to be ticked immediately, I<*tv> is zeroed and the 23*e7be843bSPierre Proncheryfunction succeeds, returning 1. If no timeout is currently active, this function 24*e7be843bSPierre Proncheryreturns 0. 25*e7be843bSPierre Pronchery 26*e7be843bSPierre ProncheryThis function is only applicable to DTLS and QUIC objects. It fails if called on 27*e7be843bSPierre Proncheryany other kind of SSL object. 28*e7be843bSPierre Pronchery 29*e7be843bSPierre ProncheryNote that the value output by a call to DTLSv1_get_timeout() may change as a 30*e7be843bSPierre Proncheryresult of other calls to the SSL object. 31*e7be843bSPierre Pronchery 32*e7be843bSPierre ProncheryOnce the timeout expires, DTLSv1_handle_timeout() should be called to handle any 33*e7be843bSPierre Proncheryinternal processing which is due; for more information, see 34*e7be843bSPierre ProncheryL<DTLSv1_handle_timeout(3)>. 35*e7be843bSPierre Pronchery 36*e7be843bSPierre ProncheryL<SSL_get_event_timeout(3)> supersedes all use cases for this this function and 37*e7be843bSPierre Proncherymay be used instead of it. 38*e7be843bSPierre Pronchery 39*e7be843bSPierre Pronchery=head1 RETURN VALUES 40*e7be843bSPierre Pronchery 41*e7be843bSPierre ProncheryOn success, writes a duration to I<*tv> and returns 1. 42*e7be843bSPierre Pronchery 43*e7be843bSPierre ProncheryReturns 0 on failure, or if no timeout is currently active. 44*e7be843bSPierre Pronchery 45*e7be843bSPierre Pronchery=head1 SEE ALSO 46*e7be843bSPierre Pronchery 47*e7be843bSPierre ProncheryL<DTLSv1_handle_timeout(3)>, L<SSL_get_event_timeout(3)>, L<ssl(7)> 48*e7be843bSPierre Pronchery 49*e7be843bSPierre Pronchery=head1 COPYRIGHT 50*e7be843bSPierre Pronchery 51*e7be843bSPierre ProncheryCopyright 2023 The OpenSSL Project Authors. All Rights Reserved. 52*e7be843bSPierre Pronchery 53*e7be843bSPierre ProncheryLicensed under the Apache License 2.0 (the "License"). You may not use 54*e7be843bSPierre Proncherythis file except in compliance with the License. You can obtain a copy 55*e7be843bSPierre Proncheryin the file LICENSE in the source distribution or at 56*e7be843bSPierre ProncheryL<https://www.openssl.org/source/license.html>. 57*e7be843bSPierre Pronchery 58*e7be843bSPierre Pronchery=cut 59