quic_statm.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
  3. *
  4. * Licensed under the Apache License 2.0 (the "License"). You may not use
  5. * this file except in compliance with the License. You can obtain a copy
  6. * in the file LICENSE in the source distribution or at
  7. * https://www.openssl.org/source/license.html
  8. */
  9. #ifndef OSSL_QUIC_STATS_H
  10. # define OSSL_QUIC_STATS_H
  11. # include <openssl/ssl.h>
  12. # include "internal/time.h"
  13. # include "internal/quic_predef.h"
  14. # ifndef OPENSSL_NO_QUIC
  15. struct ossl_statm_st {
  16. OSSL_TIME smoothed_rtt, latest_rtt, min_rtt, rtt_variance;
  17. char have_first_sample;
  18. };
  19. typedef struct ossl_rtt_info_st {
  20. /* As defined in RFC 9002. */
  21. OSSL_TIME smoothed_rtt, latest_rtt, rtt_variance, min_rtt;
  22. } OSSL_RTT_INFO;
  23. int ossl_statm_init(OSSL_STATM *statm);
  24. void ossl_statm_destroy(OSSL_STATM *statm);
  25. void ossl_statm_get_rtt_info(OSSL_STATM *statm, OSSL_RTT_INFO *rtt_info);
  26. void ossl_statm_update_rtt(OSSL_STATM *statm,
  27. OSSL_TIME ack_delay,
  28. OSSL_TIME override_latest_rtt);
  29. # endif
  30. #endif