From: Guus Sliepen Date: Sun, 18 Oct 2015 18:21:06 +0000 (+0200) Subject: Turn magic numbers into #defines. X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=1c136554d0e3c3fb89106c349e7613869d63ca2c;p=utcp Turn magic numbers into #defines. --- diff --git a/utcp.c b/utcp.c index 3d1c5f7..c026ce7 100644 --- a/utcp.c +++ b/utcp.c @@ -1321,8 +1321,8 @@ struct utcp *utcp_init(utcp_accept_t accept, utcp_pre_accept_t pre_accept, utcp_ utcp->pre_accept = pre_accept; utcp->send = send; utcp->priv = priv; - utcp->mtu = 1000; - utcp->timeout = 60; + utcp->mtu = DEFAULT_MTU; + utcp->timeout = DEFAULT_USER_TIMEOUT; // s return utcp; } diff --git a/utcp_priv.h b/utcp_priv.h index 69f1b0d..3a119f1 100644 --- a/utcp_priv.h +++ b/utcp_priv.h @@ -36,6 +36,10 @@ #define DEFAULT_RCVBUFSIZE 0 #define DEFAULT_MAXRCVBUFSIZE 131072 +#define DEFAULT_MTU 1000 + +#define DEFAULT_USER_TIMEOUT 60 // s + struct hdr { uint16_t src; // Source port uint16_t dst; // Destination port