From efd3104fd0c2cd5b0ba6ef781b36fddc7c7dcd68 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Sun, 13 May 2007 14:34:02 +0000 Subject: [PATCH] Fixed bug from patch #5865 by moving the defines for socket options (lwip_set/-getsockopt) used with level IPPROTO_TCP from tcp.h to sockets.h. --- CHANGELOG | 5 +++++ src/api/sockets.c | 5 ++++- src/include/lwip/sockets.h | 15 ++++++++++++--- src/include/lwip/tcp.h | 10 ---------- 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 7d033743..6eb1b09d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -153,6 +153,11 @@ HISTORY ++ Bug fixes: + 2007-05-13 Simon Goldschmidt + * tcp.h, sockets.h, sockets.c: Fixed bug from patch #5865 by moving the defines + for socket options (lwip_set/-getsockopt) used with level IPPROTO_TCP from + tcp.h to sockets.h. + 2007-05-07 Simon Goldschmidt * mem.c: Another attempt to fix bug #17922. diff --git a/src/api/sockets.c b/src/api/sockets.c index 03bb7ebd..06a78d3d 100644 --- a/src/api/sockets.c +++ b/src/api/sockets.c @@ -32,6 +32,8 @@ * */ +#include "lwip/sockets.h" + #include #include "lwip/opt.h" @@ -39,7 +41,8 @@ #include "lwip/arch.h" #include "lwip/sys.h" #include "lwip/igmp.h" -#include "lwip/sockets.h" +#include "lwip/inet.h" +#include "lwip/tcp.h" #define NUM_SOCKETS MEMP_NUM_NETCONN diff --git a/src/include/lwip/sockets.h b/src/include/lwip/sockets.h index a49a5cad..134d9c05 100644 --- a/src/include/lwip/sockets.h +++ b/src/include/lwip/sockets.h @@ -35,8 +35,7 @@ #define __LWIP_SOCKETS_H__ #include "lwip/ip_addr.h" -#include "opt.h" -#include "tcp.h" +#include "lwip/opt.h" #ifdef __cplusplus extern "C" { @@ -131,8 +130,18 @@ struct linger { #define IP_TOS 1 #define IP_TTL 2 +#if LWIP_TCP +/* + * Options for level IPPROTO_TCP + */ +#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */ +#define TCP_KEEPALIVE 0x02 /* send KEEPALIVE probes when idle for pcb->keep_idle milliseconds */ +#define TCP_KEEPIDLE 0x03 /* set pcb->keep_idle - Same as TCP_KEEPALIVE, but use seconds for get/setsockopt*/ +#define TCP_KEEPINTVL 0x04 /* set pcb->keep_intvl - Use seconds for get/setsockopt */ +#define TCP_KEEPCNT 0x05 /* set pcb->keep_cnt - Use number of probes sent for get/setsockopt */ +#endif /* LWIP_TCP */ -#ifdef LWIP_IGMP +#if LWIP_IGMP /* * Options and types for UDP multicast traffic handling */ diff --git a/src/include/lwip/tcp.h b/src/include/lwip/tcp.h index 76bbe254..61be588d 100644 --- a/src/include/lwip/tcp.h +++ b/src/include/lwip/tcp.h @@ -155,16 +155,6 @@ void tcp_rexmit_rto (struct tcp_pcb *pcb); #define TCP_MSL 60000U /* The maximum segment lifetime in microseconds */ -/* - * User-settable options (used with setsockopt). - */ -#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */ -#define TCP_KEEPALIVE 0x02 /* send KEEPALIVE probes when idle for pcb->keep_idle milliseconds */ - -#define TCP_KEEPIDLE 0x03 /* set pcb->keep_idle - Same as TCP_KEEPALIVE, but use seconds for get/setsockopt*/ -#define TCP_KEEPINTVL 0x04 /* set pcb->keep_intvl - Use seconds for get/setsockopt */ -#define TCP_KEEPCNT 0x05 /* set pcb->keep_cnt - Use number of probes sent for get/setsockopt */ - /* Keepalive values, compliant with RFC 1122. Don't change this unless you know what you're doing */ #ifndef TCP_KEEPIDLE_DEFAULT #define TCP_KEEPIDLE_DEFAULT 7200000UL /* Default KEEPALIVE timer in milliseconds */