X-Git-Url: http://git.meshlink.io/?p=utcp;a=blobdiff_plain;f=utcp_priv.h;fp=utcp_priv.h;h=24f4158318ddccd8a4a586b72420fbe87de172c2;hp=3a119f16cf60a878e327e0b9ebe49efe3aff2f62;hb=e7e607d6d1b4e53f6f2a6094c02240e4fd8f59d4;hpb=1c136554d0e3c3fb89106c349e7613869d63ca2c diff --git a/utcp_priv.h b/utcp_priv.h index 3a119f1..24f4158 100644 --- a/utcp_priv.h +++ b/utcp_priv.h @@ -39,6 +39,9 @@ #define DEFAULT_MTU 1000 #define DEFAULT_USER_TIMEOUT 60 // s +#define CLOCK_GRANULARITY 1000 // us +#define START_RTO 1000000 // us +#define MAX_RTO 3000000 // us struct hdr { uint16_t src; // Source port @@ -129,6 +132,8 @@ struct utcp_connection { struct timeval conn_timeout; struct timeval rtrx_timeout; + struct timeval rtt_start; + uint32_t rtt_seq; // Buffers @@ -159,7 +164,13 @@ struct utcp { // Global socket options uint16_t mtu; - int timeout; + int timeout; // s + + // RTT variables + + uint32_t srtt; // us + uint32_t rttvar; // us + uint32_t rto; // us // Connection management