| 
									
										
										
										
											2022-06-28 20:52:48 +08:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2023-09-07 16:59:15 +08:00
										 |  |  |  * Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved. | 
					
						
							| 
									
										
										
										
											2022-06-28 20:52:48 +08:00
										 |  |  |  * | 
					
						
							|  |  |  |  * Licensed under the Apache License 2.0 (the "License").  You may not use | 
					
						
							|  |  |  |  * this file except in compliance with the License.  You can obtain a copy | 
					
						
							|  |  |  |  * in the file LICENSE in the source distribution or at | 
					
						
							|  |  |  |  * https://www.openssl.org/source/license.html
 | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef OSSL_QUIC_STATS_H
 | 
					
						
							|  |  |  | # define OSSL_QUIC_STATS_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # include <openssl/ssl.h>
 | 
					
						
							|  |  |  | # include "internal/time.h"
 | 
					
						
							| 
									
										
										
										
											2023-11-09 19:04:50 +08:00
										 |  |  | # include "internal/quic_predef.h"
 | 
					
						
							| 
									
										
										
										
											2022-06-28 20:52:48 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-11-18 00:03:00 +08:00
										 |  |  | # ifndef OPENSSL_NO_QUIC
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-09 19:04:50 +08:00
										 |  |  | struct ossl_statm_st { | 
					
						
							| 
									
										
										
										
											2023-07-03 22:45:25 +08:00
										 |  |  |     OSSL_TIME smoothed_rtt, latest_rtt, min_rtt, rtt_variance; | 
					
						
							| 
									
										
										
										
											2022-06-28 20:52:48 +08:00
										 |  |  |     char      have_first_sample; | 
					
						
							| 
									
										
										
										
											2023-11-09 19:04:50 +08:00
										 |  |  | }; | 
					
						
							| 
									
										
										
										
											2022-06-28 20:52:48 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | typedef struct ossl_rtt_info_st { | 
					
						
							|  |  |  |     /* As defined in RFC 9002. */ | 
					
						
							| 
									
										
										
										
											2023-07-03 22:45:25 +08:00
										 |  |  |     OSSL_TIME smoothed_rtt, latest_rtt, rtt_variance, min_rtt; | 
					
						
							| 
									
										
										
										
											2022-06-28 20:52:48 +08:00
										 |  |  | } OSSL_RTT_INFO; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | int ossl_statm_init(OSSL_STATM *statm); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void ossl_statm_destroy(OSSL_STATM *statm); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void ossl_statm_get_rtt_info(OSSL_STATM *statm, OSSL_RTT_INFO *rtt_info); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void ossl_statm_update_rtt(OSSL_STATM *statm, | 
					
						
							|  |  |  |                            OSSL_TIME ack_delay, | 
					
						
							|  |  |  |                            OSSL_TIME override_latest_rtt); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-11-18 00:03:00 +08:00
										 |  |  | # endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-06-28 20:52:48 +08:00
										 |  |  | #endif
 |