The Pedigree Project 0.1
lwipopts.h
1/*
2 * Copyright (c) 2008-2014, Pedigree Developers
3 *
4 * Please see the CONTRIB file in the root of the source tree for a full
5 * list of contributors.
6 *
7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
10 *
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 */
19
20
21#ifndef LWIP_LWIPOPTS_H
22#define LWIP_LWIPOPTS_H
23#include <config.h>
24
25#include <pedigree/kernel/utilities/utility.h>
26
27#define MEMCPY(dst, src, len) MemoryCopy(dst, src, len)
28#define SMEMCPY(dst, src, len) MemoryCopy(dst, src, len)
29
30#define MEM_LIBC_MALLOC 1
31#define MEMP_MEM_MALLOC 1
32
34#define MEM_ALIGNMENT 8
35
37#define IPV6_FRAG_COPYHEADER 1
38
39#define LWIP_RAW 1
40#define LWIP_IPV6 1
41#define LWIP_NETCONN 1
42
43#define LWIP_COMPAT_SOCKETS 1
44
45#define LWIP_PROVIDE_ERRNO 1
46
47// Keep protocol processing on the tcpip worker: some NIC workers must
48// finish receiving before they can service transmit completion.
49#define LWIP_TCPIP_CORE_LOCKING_INPUT 0
50
51#define LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS 1
52
53#define SO_REUSE 1
54#define IP_SOF_BROADCAST 1
55
56#define LWIP_DHCP 1
57#define DHCP_CREATE_RAND_XID 0
58#define LWIP_DNS 1
59
60// Keep pre-seed DHCP and transport initialization independent of DNS randomness.
61// Defining LWIP_RAND would also change those existing startup paths.
62#ifdef __cplusplus
63extern "C" {
64#endif
65int pedigree_dns_random_ready(void);
66uint32_t pedigree_dns_random(void);
67#ifdef __cplusplus
68}
69#endif
70#define DNS_RAND_READY() pedigree_dns_random_ready()
71#define DNS_RAND_TXID() pedigree_dns_random()
72
73#define LWIP_AUTOIP 1
74#define LWIP_DHCP_AUTOIP_COOP 1
75
76#define LWIP_TCP_TIMESTAMPS 1
77
78#define LWIP_NETIF_LOOPBACK 1
79
80#define LWIP_IPV6_DHCP6 1
81
82#define LWIP_NETIF_STATUS_CALLBACK 1
83#define LWIP_NETIF_LINK_CALLBACK 1
84#define LWIP_NETIF_HWADDRHINT 1
85
86#define LWIP_SO_RCVTIMEO 1
87
88// General tuning
89#define TCP_MSS 1400
90#define TCP_WND 32768
91#define TCP_SND_BUF 65536
92
93#define LWIP_WND_SCALE 1
94#define TCP_RCV_SCALE 4
95
96#if UTILITY_LINUX
97#define SA_FAMILY_T_DEFINED 1
98#endif
99
100#endif // LWIP_LWIPOPTS_H