From 1c136554d0e3c3fb89106c349e7613869d63ca2c Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Sun, 18 Oct 2015 20:21:06 +0200 Subject: [PATCH] Turn magic numbers into #defines. --- utcp.c | 4 ++-- utcp_priv.h | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) 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 -- 2.39.5