#ifndef __LWIPOPTS_H__
#define __LWIPOPTS_H__

/* Enable OS support */
#define NO_SYS                  0

/* DHCP options */
#define LWIP_DHCP               1
#define LWIP_NETIF_HOSTNAME     1

/* Socket options */
#define LWIP_SOCKET             1
#define LWIP_NETCONN            1
#define SO_REUSE                1
#define LWIP_RAW                1
#define LWIP_SO_RCVTIMEO        1
#define LWIP_SO_SNDTIMEO        1

/* DNS options */
#define LWIP_DNS                1

/* Memory options */
#define MEM_ALIGNMENT           4
#define MEM_SIZE                (16 * 1024) /* 16KB Heap for LwIP */
#define MEMP_NUM_PBUF           16
#define MEMP_NUM_UDP_PCB        4
#define MEMP_NUM_TCP_PCB        5
#define MEMP_NUM_TCP_PCB_LISTEN 8
#define MEMP_NUM_TCP_SEG        16
#define MEMP_NUM_SYS_TIMEOUT    8

/* Pbuf options */
#define PBUF_POOL_SIZE          16
#define PBUF_POOL_BUFSIZE       1536

/* Thread options */
#define TCPIP_THREAD_NAME       "tcpip"
#define TCPIP_THREAD_STACKSIZE  2048
#define TCPIP_THREAD_PRIO       10
#define TCPIP_MBOX_SIZE         8
#define DEFAULT_THREAD_STACKSIZE 1024
#define DEFAULT_THREAD_PRIO     10
#define DEFAULT_RAW_RECVMBOX_SIZE 8
#define DEFAULT_UDP_RECVMBOX_SIZE 8
#define DEFAULT_TCP_RECVMBOX_SIZE 8
#define DEFAULT_ACCEPTMBOX_SIZE 8

/* OSAL provides malloc/free wrappers if needed, but LwIP has its own heap management.
   If you want LwIP to use OSAL's malloc:
*/
#define MEM_LIBC_MALLOC         1
#include "osal_mem.h"
#define mem_clib_malloc         osal_malloc
#define mem_clib_free           osal_free
#define mem_clib_calloc         osal_calloc

/* Debug options */
#define LWIP_DEBUG              1
#define LWIP_DBG_TYPES_ON       LWIP_DBG_OFF
#define ETHARP_DEBUG            LWIP_DBG_OFF
#define NETIF_DEBUG             LWIP_DBG_OFF
#define PBUF_DEBUG              LWIP_DBG_OFF
#define API_LIB_DEBUG           LWIP_DBG_OFF
#define API_MSG_DEBUG           LWIP_DBG_OFF
#define SOCKETS_DEBUG           LWIP_DBG_OFF
#define ICMP_DEBUG              LWIP_DBG_OFF
#define IGMP_DEBUG              LWIP_DBG_OFF
#define INET_DEBUG              LWIP_DBG_OFF
#define IP_DEBUG                LWIP_DBG_OFF
#define IP_REASS_DEBUG          LWIP_DBG_OFF
#define RAW_DEBUG               LWIP_DBG_OFF
#define MEM_DEBUG               LWIP_DBG_OFF
#define MEMP_DEBUG              LWIP_DBG_OFF
#define SYS_DEBUG               LWIP_DBG_OFF
#define TIMERS_DEBUG            LWIP_DBG_OFF
#define TCP_DEBUG               LWIP_DBG_OFF
#define TCP_INPUT_DEBUG         LWIP_DBG_OFF
#define TCP_FR_DEBUG            LWIP_DBG_OFF
#define TCP_RTO_DEBUG           LWIP_DBG_OFF
#define TCP_CWND_DEBUG          LWIP_DBG_OFF
#define TCP_WND_DEBUG           LWIP_DBG_OFF
#define TCP_OUTPUT_DEBUG        LWIP_DBG_OFF
#define TCP_RST_DEBUG           LWIP_DBG_OFF
#define TCP_QLEN_DEBUG          LWIP_DBG_OFF
#define UDP_DEBUG               LWIP_DBG_OFF
#define TCPIP_DEBUG             LWIP_DBG_OFF
#define PPP_DEBUG               LWIP_DBG_OFF
#define SLIP_DEBUG              LWIP_DBG_OFF
#define DHCP_DEBUG              LWIP_DBG_OFF
#define AUTOIP_DEBUG            LWIP_DBG_OFF
#define SNMP_MSG_DEBUG          LWIP_DBG_OFF
#define SNMP_MIB_DEBUG          LWIP_DBG_OFF
#define DNS_DEBUG               LWIP_DBG_OFF

/* Checksums - HW Checksum Enabled */
#define CHECKSUM_GEN_IP         0
#define CHECKSUM_GEN_UDP        0
#define CHECKSUM_GEN_TCP        0
#define CHECKSUM_GEN_ICMP       0
#define CHECKSUM_CHECK_IP       0
#define CHECKSUM_CHECK_UDP      0
#define CHECKSUM_CHECK_TCP      0
#define CHECKSUM_CHECK_ICMP     0

/* Link Callback */
#define LWIP_NETIF_LINK_CALLBACK 1

/* ICMP options */
#define LWIP_ICMP               1
#define LWIP_BROADCAST_PING     1
#define LWIP_MULTICAST_PING     1

/* Ethernet options */
#define LWIP_ARP                1
#define LWIP_ETHERNET           1

#endif /* __LWIPOPTS_H__ */
