| /* |
| * |
| * Copyright (c) 2012-2013 Nest Labs, Inc. |
| * All rights reserved. |
| * |
| * Description: |
| * This file describes compile-time constants used for |
| * configuring LwIP. |
| * |
| */ |
| |
| /* |
| * Copyright 2012, Broadcom Corporation |
| * All Rights Reserved. |
| * |
| * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Broadcom Corporation; |
| * the contents of this file may not be disclosed to third parties, copied |
| * or duplicated in any form, in whole or in part, without the prior |
| * written permission of Broadcom Corporation. |
| */ |
| |
| /* |
| * Copyright (c) 2001-2003 Swedish Institute of Computer Science. |
| * All rights reserved. |
| * |
| * Redistribution and use in source and binary forms, with or without modification, |
| * are permitted provided that the following conditions are met: |
| * |
| * 1. Redistributions of source code must retain the above copyright notice, |
| * this list of conditions and the following disclaimer. |
| * 2. Redistributions in binary form must reproduce the above copyright notice, |
| * this list of conditions and the following disclaimer in the documentation |
| * and/or other materials provided with the distribution. |
| * 3. The name of the author may not be used to endorse or promote products |
| * derived from this software without specific prior written permission. |
| * |
| * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED |
| * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT |
| * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT |
| * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
| * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY |
| * OF SUCH DAMAGE. |
| * |
| * This file is part of the lwIP TCP/IP stack. |
| * |
| * Author: Adam Dunkels <adam@sics.se> |
| * |
| */ |
| #ifndef __LWIPOPTS_H__ |
| #define __LWIPOPTS_H__ |
| |
| #include <stdlib.h> |
| |
| /** |
| * Override values in common/lwipopts.h. |
| */ |
| #define LWIP_DNS (0) |
| #define LWIP_ICMP (0) |
| #define LWIP_IGMP (0) |
| |
| #define LWIP_ND6_NUM_NEIGHBORS (0) |
| #define LWIP_ND6_NUM_DESTINATIONS (0) |
| #define LWIP_ND6_NUM_PREFIXES (0) |
| #define LWIP_ND6_NUM_ROUTERS (0) |
| #define LWIP_ND6_MAX_MULTICAST_SOLICIT (0) |
| #define LWIP_ND6_MAX_UNICAST_SOLICIT (0) |
| #define LWIP_ND6_MAX_NEIGHBOR_ADVERTISEMENT (0) |
| #define LWIP_ND6_TCP_REACHABILITY_HINTS (0) |
| /** |
| * LWIP_DHCP==0: Disable DHCP module. |
| */ |
| #ifdef BUILD_FEATURE_NETWORK_MANAGER_DHCP_V4_CLIENT |
| #define LWIP_DHCP (1) |
| #else |
| #define LWIP_DHCP (0) |
| #endif |
| |
| |
| #include "common_lwipopts.h" |
| |
| #ifdef CUSTOM_LWIPOPTS |
| #include "custom_lwipopts.h" |
| #else /* ifdef CUSTOM_LWIPOPTS */ |
| |
| /** |
| * MEM_ALIGNMENT: should be set to the alignment of the CPU |
| * 4 byte alignment -> #define MEM_ALIGNMENT 4 |
| * 2 byte alignment -> #define MEM_ALIGNMENT 2 |
| */ |
| #define MEM_ALIGNMENT (4) |
| |
| /** |
| * MEMP_NUM_NETBUF: the number of struct netbufs. |
| * (only needed if you use the sequential API, like api_lib.c) |
| */ |
| #define MEMP_NUM_NETBUF (PBUF_POOL_SIZE_LARGE) |
| |
| /** |
| * MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments. |
| * (requires the LWIP_TCP option) |
| */ |
| #define MEMP_NUM_TCP_SEG (TCP_SND_QUEUELEN+1) |
| |
| /** |
| * MEMP_SEPARATE_POOLS: if defined to 1, each pool is placed in its own array. |
| * This can be used to individually change the location of each pool. |
| * Default is one big array for all pools |
| * |
| * Nest has enabled this flag to support pbuf allocation tracking. |
| */ |
| #define MEMP_SEPARATE_POOLS (1) |
| |
| /** |
| * LWIP_PBUF_FROM_CUSTOM_POOLS: Declare a set of custom mempools immediately following |
| * MEMP_PBUF_POOL. When allocating a pbuf, scan the custom pbuf pools and find the |
| * smallest free pbuf that will hold the requested payload and allocate from that pool. |
| * When using, set PBUF_POOL_SIZE and PBUF_POOL_BUFSIZE to 0 - they are not used. |
| */ |
| #define LWIP_PBUF_FROM_CUSTOM_POOLS (1) |
| |
| /** |
| * Include custom mempools from lwippools.h. Required for use with |
| * LWIP_PBUF_FROM_CUSTOM_POOLS |
| */ |
| #define MEMP_USE_CUSTOM_POOLS (1) |
| |
| /** |
| * PBUF_POOL_SIZE: the number of buffers in the default pbuf pool. |
| * Set to 0 here because we are using LWIP_PBUF_FROM_CUSTOM_POOLS. |
| */ |
| #ifndef PBUF_POOL_SIZE |
| #define PBUF_POOL_SIZE (0) |
| #endif |
| |
| /** |
| * PBUF_POOL_SIZE_LARGE: the number of buffers in the pool for large sized pbufs |
| */ |
| #define PBUF_POOL_SIZE_LARGE (3) |
| |
| /** |
| * PBUF_POOL_SIZE_MEDIUM: the number of buffers in the pool for medium sized pbufs |
| */ |
| #define PBUF_POOL_SIZE_MEDIUM (4) |
| |
| /** |
| * PBUF_POOL_SIZE_SMALL: the number of buffers in the pool for small sized pbufs |
| */ |
| #define PBUF_POOL_SIZE_SMALL (5) |
| |
| |
| /* |
| * IP_REASS_MAX_PBUFS: Total maximum amount of pbufs waiting to be reassembled. |
| * Since the received pbufs are enqueued, be sure to configure |
| * PBUF_POOL_SIZE > IP_REASS_MAX_PBUFS so that the stack is still able to receive |
| * packets even if the maximum amount of fragments is enqueued for reassembly! |
| * |
| */ |
| #define IP_REASS_MAX_PBUFS 0 |
| #define IP_REASSEMBLY 0 |
| |
| /** |
| * MEMP_NUM_REASSDATA: the number of IP packets simultaneously queued for |
| * reassembly (whole packets, not fragments!) |
| */ |
| #if IP_REASS_MAX_PBUFS > 1 |
| #ifndef MEMP_NUM_REASSDATA |
| #define MEMP_NUM_REASSDATA (IP_REASS_MAX_PBUFS - 1) |
| #endif |
| #else |
| #define MEMP_NUM_REASSDATA 0 |
| #endif |
| |
| /** |
| * PBUF_POOL_BUFSIZE_LARGE: the size of each pbuf in the pool for large pbufs |
| */ |
| #define PBUF_POOL_BUFSIZE_LARGE (1280) |
| |
| /** |
| * PBUF_POOL_BUFSIZE_MEDIUM: the size of each pbuf in the pool for medium pbufs |
| */ |
| #define PBUF_POOL_BUFSIZE_MEDIUM (640) |
| |
| /** |
| * PBUF_POOL_BUFSIZE_MEDIUM: the size of each pbuf in the pool for small pbufs |
| */ |
| #define PBUF_POOL_BUFSIZE_SMALL (256) |
| |
| |
| /** |
| * PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. The default is |
| * designed to accomodate single full size TCP frame in one pbuf, including |
| * TCP_MSS, IP header, and link header. |
| */ |
| #define PBUF_POOL_BUFSIZE (PBUF_POOL_BUFSIZE_LARGE) |
| |
| /** |
| * PBUF_CUSTOM_POOL_IDX_START: the pbuf pool index at which we start scanning when |
| * searching variable sized pbuf pools for one we can use. Scanning begins at |
| * PBUF_CUSTOM_POOL_IDX_START and stops when we reach PBUF_VARIABLE_POOL_END. Pools should be |
| * placed in descending order by size, immediately following the MEMP_PBUF_POOL. |
| * |
| * ie, |
| * MEMP_PBUF_POOL <---- default pool of pbufs, defined to be zero size |
| * CUSTOM_PBUF_POOL_0 <---- pool containing largest pbufs |
| * CUSTOM_PBUF_POOL_1 <---- pool containing second largest pbufs |
| * ... |
| * CUSTOM_PBUF_POOL_N-1 <---- pool containing second smallest pbufs |
| * CUSTOM_PBUF_POOL_N <---- pool containing smallest pbufs. |
| * |
| * PBUF_CUSTOM_POOL_IDX_START would be defined to CUSTOM_PBUF_POOL_N |
| * PBUF_CUSTOM_POOL_IDX_END would be defined to CUSTOM_PBUF_POOL_0 |
| */ |
| #define PBUF_CUSTOM_POOL_IDX_START (MEMP_PBUF_POOL_SMALL) |
| #define PBUF_CUSTOM_POOL_IDX_END (MEMP_PBUF_POOL_LARGE) |
| |
| |
| /** |
| * TCP_MSS: TCP Maximum segment size. (default is 536, a conservative default, |
| * you might want to increase this.) |
| * For the receive side, this MSS is advertised to the remote side |
| * when opening a connection. For the transmit size, this MSS sets |
| * an upper limit on the MSS advertised by the remote host. |
| */ |
| /* *** IMPORTANT *** |
| * |
| * DO NOT increase this beyond the point at which a TCP segement will fit within a single PBUF, otherwise |
| * the code in the WICED netif output function (host_hardware_output() in wiced-network.cpp) will fail. |
| * |
| * The limit is effectively WICED_LINK_MTU - (WICED_LINK_OVERHEAD_BELOW_ETHERNET_FRAME + WICED_ETHERNET_SIZE + 60) |
| */ |
| #define TCP_MSS (1152) |
| |
| |
| /** |
| * TCP_SND_BUF: TCP sender buffer space (bytes). |
| * must be at least as much as (2 * TCP_MSS) for things to work smoothly |
| */ |
| #define TCP_SND_BUF (2 * TCP_MSS) |
| |
| /** |
| * ETH_PAD_SIZE: the header space required preceeding the of each pbuf in the pbuf pool. The default is |
| * designed to accomodate single full size TCP frame in one pbuf, including |
| * TCP_MSS, IP header, and link header. |
| * |
| * This is zero since the role has been taken over by SUB_ETHERNET_HEADER_SPACE as ETH_PAD_SIZE was not always obeyed |
| */ |
| #define ETH_PAD_SIZE (0) |
| |
| /* TODO */ |
| #define SUB_ETHERNET_HEADER_SPACE (0) |
| |
| |
| /** |
| * PBUF_LINK_HLEN: the number of bytes that should be allocated for a |
| * link level header. The default is 14, the standard value for |
| * Ethernet. |
| */ |
| /* TODO */ |
| #define PBUF_LINK_HLEN (0) |
| |
| |
| /** |
| * TCPIP_THREAD_STACKSIZE: The stack size used by the main tcpip thread. |
| * The stack size value itself is platform-dependent, but is passed to |
| * sys_thread_new() when the thread is created. |
| */ |
| #define TCPIP_THREAD_STACKSIZE (1024) |
| |
| /** |
| * TCPIP_THREAD_PRIO: The priority assigned to the main tcpip thread. |
| * The priority value itself is platform-dependent, but is passed to |
| * sys_thread_new() when the thread is created. |
| */ |
| #define TCPIP_THREAD_PRIO (2) |
| |
| #define TCP_LISTEN_BACKLOG (1) |
| |
| |
| /** |
| * The WICED definition of PBUF_POOL_BUFSIZE includes a number of |
| * sizeof() instantiations which causes the C preprocessor to |
| * fail. Disable TCP configuration constant sanity checks to work |
| * around this. |
| */ |
| #define LWIP_DISABLE_TCP_SANITY_CHECKS (1) |
| |
| /** |
| * The maximum of all used hardware address lengths across all types |
| * of interfaces in use: |
| * |
| * - 802.11 : 6 |
| * - 802.15.4 : 8 |
| */ |
| #define NETIF_MAX_HWADDR_LEN 8U |
| |
| /** |
| * LWIP_IPV6_NUM_ADDRESSES: Number of IPv6 addresses per netif. |
| * Currently: |
| * Link-Local, Mesh-Local, Weave Legacy ULA, Weave Thread ULA |
| * |
| * TODO: If we ever need mesh local address added back, |
| * increase the number of IPV6 and unmap |
| * NL_WPAN_ADDR_THREAD_MESH to NL_WPAN_ADDR_INVALID |
| */ |
| #ifndef LWIP_IPV6_NUM_ADDRESSES |
| #define LWIP_IPV6_NUM_ADDRESSES 3 |
| #endif |
| |
| #define LWIP_NOASSERT 1 |
| |
| /** |
| * Disable 6LoWPAN/Thread debugging in LwIP |
| * TODO: move this into a more SiLabs centric location |
| */ |
| #define ZIP_DEBUG (LWIP_DBG_OFF) |
| |
| #endif /* ifdef CUSTOM_LWIPOPTS */ |
| |
| #endif /* __LWIPOPTS_H__ */ |