1a74702c6SGeorge Wang/* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */ 250aadb33SDmitri Tikhonov/* 350aadb33SDmitri Tikhonov * lsquic_rtt.h -- RTT calculation 450aadb33SDmitri Tikhonov */ 550aadb33SDmitri Tikhonov 650aadb33SDmitri Tikhonov#ifndef LSQUIC_RTT_H 750aadb33SDmitri Tikhonov#define LSQUIC_RTT_H 1 850aadb33SDmitri Tikhonov 950aadb33SDmitri Tikhonov 1050aadb33SDmitri Tikhonov/* This struct is initialized by setting it to zero */ 1150aadb33SDmitri Tikhonovstruct lsquic_rtt_stats { 1250aadb33SDmitri Tikhonov lsquic_time_t srtt; 1350aadb33SDmitri Tikhonov lsquic_time_t rttvar; 145392f7a3SLiteSpeed Tech lsquic_time_t min_rtt; 1550aadb33SDmitri Tikhonov}; 1650aadb33SDmitri Tikhonov 1750aadb33SDmitri Tikhonov 1850aadb33SDmitri Tikhonovvoid 1950aadb33SDmitri Tikhonovlsquic_rtt_stats_update (struct lsquic_rtt_stats *, lsquic_time_t send_delta, 2050aadb33SDmitri Tikhonov lsquic_time_t lack_delta); 2150aadb33SDmitri Tikhonov 2250aadb33SDmitri Tikhonov 2350aadb33SDmitri Tikhonov#define lsquic_rtt_stats_get_srtt(stats) ((stats)->srtt) 2450aadb33SDmitri Tikhonov 2550aadb33SDmitri Tikhonov#define lsquic_rtt_stats_get_rttvar(stats) ((stats)->rttvar) 2650aadb33SDmitri Tikhonov 275392f7a3SLiteSpeed Tech#define lsquic_rtt_stats_get_min_rtt(stats) (+(stats)->min_rtt) 285392f7a3SLiteSpeed Tech 2950aadb33SDmitri Tikhonov#endif 30