* same with xv6
[mascara-docs.git] / i386 / MIT / course / src / src.lab / net / lwip / jos / lwipopts.h
blob58e805f39ec927ca7fc1ee78157fad34e3345c8e
1 #ifndef JOS_LWIP_LWIPOPTS_H
2 #define JOS_LWIP_LWIPOPTS_H
4 // Huge hack to include memcpy. Since this is the only file that is
5 // consistently included in all of lwip, a definition of memcpy can be added
6 // here to make it lwip visible. I am hiding lwip because JOS seems to want to
7 // do so. There is a declaration of memcpy in JOS but not a definition.
8 #include <inc/types.h>
9 void *memcpy(void *dst, const void *src, size_t n);
11 //#define NO_SYS 1
13 #define LWIP_STATS 0
14 #define LWIP_STATS_DISPLAY 0
15 #define LWIP_DHCP 1
16 #define LWIP_COMPAT_SOCKETS 0
17 //#define SYS_LIGHTWEIGHT_PROT 1
18 #define LWIP_PROVIDE_ERRNO 1
20 // Various tuning knobs, see:
21 // http://lists.gnu.org/archive/html/lwip-users/2006-11/msg00007.html
23 #define MEM_ALIGNMENT 4
25 #define MEMP_NUM_PBUF 64
26 #define MEMP_NUM_UDP_PCB 8
27 #define MEMP_NUM_TCP_PCB 32
28 #define MEMP_NUM_TCP_PCB_LISTEN 16
29 #define MEMP_NUM_TCP_SEG TCP_SND_QUEUELEN// at least as big as TCP_SND_QUEUELEN
30 #define MEMP_NUM_NETBUF 128
31 #define MEMP_NUM_NETCONN 32
32 #define MEMP_NUM_SYS_TIMEOUT 6
34 #define PER_TCP_PCB_BUFFER (16 * 4096)
35 #define MEM_SIZE (PER_TCP_PCB_BUFFER*MEMP_NUM_TCP_SEG + 4096*MEMP_NUM_TCP_SEG)
37 #define PBUF_POOL_SIZE 512
38 #define PBUF_POOL_BUFSIZE 2000
40 #define TCP_MSS 1460
41 #define TCP_WND 24000
42 #define TCP_SND_BUF (16 * TCP_MSS)
43 // lwip prints a warning if TCP_SND_QUEUELEN < (2 * TCP_SND_BUF/TCP_MSS),
44 // but 16 is faster..
45 #define TCP_SND_QUEUELEN (2 * TCP_SND_BUF/TCP_MSS)
46 //#define TCP_SND_QUEUELEN 16
48 // Print error messages when we run out of memory
49 #define LWIP_DEBUG 1
50 //#define TCP_DEBUG LWIP_DBG_ON
51 //#define MEMP_DEBUG LWIP_DBG_ON
52 //#define SOCKETS_DEBUG LWIP_DBG_ON
53 //#define DBG_TYPES_ON LWIP_DBG_ON
54 //#define PBUF_DEBUG LWIP_DBG_ON
55 //#define API_LIB_DEBUG LWIP_DBG_ON
57 #define DBG_MIN_LEVEL DBG_LEVEL_SERIOUS
58 #define LWIP_DBG_MIN_LEVEL 0
59 #define MEMP_SANITY_CHECK 0
61 #define ERRNO
63 #endif