]> git.meshlink.io Git - utcp/blobdiff - utcp_priv.h
Fix potential segmentation fault when the receive callback is not set.
[utcp] / utcp_priv.h
index fe3fa6d799c84502ad97c5212f868ccf01da9126..58e2715a3c701cc392997b66c2bc85729f850336 100644 (file)
@@ -29,6 +29,7 @@
 #define ACK 2
 #define FIN 4
 #define RST 8
+#define MF 16
 
 #define AUX_INIT 1
 #define AUX_FRAME 2
@@ -41,6 +42,7 @@
 #define DEFAULT_RCVBUFSIZE 0
 #define DEFAULT_MAXRCVBUFSIZE 131072
 
+#define MAX_UNRELIABLE_SIZE 65536
 #define DEFAULT_MTU 1000
 
 #define USEC_PER_SEC 1000000L
@@ -144,6 +146,12 @@ struct utcp_connection {
        struct timespec rtt_start;
        uint32_t rtt_seq;
 
+       // RTT variables
+
+       uint32_t srtt; // usec
+       uint32_t rttvar; // usec
+       uint32_t rto; // usec
+
        // Buffers
 
        uint32_t prev_free;
@@ -182,12 +190,6 @@ struct utcp {
        uint16_t mss; // The maximum size of the payload of a UTCP packet.
        int timeout; // sec
 
-       // RTT variables
-
-       uint32_t srtt; // usec
-       uint32_t rttvar; // usec
-       uint32_t rto; // usec
-
        // Connection management
 
        struct utcp_connection **connections;