congestvpn/congestion_control.hpp

29 lines
605 B
C++

#pragma once
#include <stdint.h>
class VpnPeer;
class CongestionController {
public:
struct LossBased {
uint64_t bandwidth; // bytes per second
};
CongestionController(const VpnPeer& peer);
const VpnPeer& get_peer() const { return _peer; }
void update_lossbased();
uint64_t get_bandwidth() const;
uint64_t get_lossbased_bandwidth() const {
return _loss_based.bandwidth; }
private:
const VpnPeer& _peer;
LossBased _loss_based;
uint32_t _last_seqno; // seqno at the last update time
};