X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=utcp_priv.h;h=69f1b0da5347371649da4dbaa92973cfed0617eb;hb=dbf1826ad6a60a81c7e5962315c95228c5757ac7;hp=d8f65546dcd810f9d6fe33259dbda4578e5a89b9;hpb=f4c52312544ee99bcce46ebcfc0c8e6ac6356fd5;p=utcp diff --git a/utcp_priv.h b/utcp_priv.h index d8f6554..69f1b0d 100644 --- a/utcp_priv.h +++ b/utcp_priv.h @@ -30,8 +30,11 @@ #define FIN 4 #define RST 8 +#define NSACKS 4 #define DEFAULT_SNDBUFSIZE 4096 #define DEFAULT_MAXSNDBUFSIZE 131072 +#define DEFAULT_RCVBUFSIZE 0 +#define DEFAULT_MAXRCVBUFSIZE 131072 struct hdr { uint16_t src; // Source port @@ -71,6 +74,18 @@ static const char *strstate[] __attribute__((unused)) = { [TIME_WAIT] = "TIME_WAIT" }; +struct buffer { + char *data; + uint32_t used; + uint32_t size; + uint32_t maxsize; +}; + +struct sack { + uint32_t offset; + uint32_t len; +}; + struct utcp_connection { void *priv; struct utcp *utcp; @@ -80,6 +95,7 @@ struct utcp_connection { // Callbacks utcp_recv_t recv; + utcp_poll_t poll; // TCP State @@ -110,11 +126,11 @@ struct utcp_connection { struct timeval conn_timeout; struct timeval rtrx_timeout; - // Send buffer + // Buffers - char *sndbuf; - uint32_t sndbufsize; - uint32_t maxsndbufsize; + struct buffer sndbuf; + struct buffer rcvbuf; + struct sack sacks[NSACKS]; // Per-socket options