lsquic_rtt.h revision 5392f7a3
1/* Copyright (c) 2017 - 2019 LiteSpeed Technologies Inc. See LICENSE. */ 2/* 3 * lsquic_rtt.h -- RTT calculation 4 */ 5 6#ifndef LSQUIC_RTT_H 7#define LSQUIC_RTT_H 1 8 9 10/* This struct is initialized by setting it to zero */ 11struct lsquic_rtt_stats { 12 lsquic_time_t srtt; 13 lsquic_time_t rttvar; 14 lsquic_time_t min_rtt; 15}; 16 17 18void 19lsquic_rtt_stats_update (struct lsquic_rtt_stats *, lsquic_time_t send_delta, 20 lsquic_time_t lack_delta); 21 22 23#define lsquic_rtt_stats_get_srtt(stats) ((stats)->srtt) 24 25#define lsquic_rtt_stats_get_rttvar(stats) ((stats)->rttvar) 26 27#define lsquic_rtt_stats_get_min_rtt(stats) (+(stats)->min_rtt) 28 29#endif 30