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