/******************************************************************************
* Copyright (C) 2023 Advanced Micro Devices, Inc.  All rights reserved.
* SPDX-License-Identifier: MIT
******************************************************************************/
#ifndef __LWIPOPTS_H_
#define __LWIPOPTS_H_

#ifndef PROCESSOR_LITTLE_ENDIAN
#define PROCESSOR_LITTLE_ENDIAN
#endif

/* always use lightweight prot mechanism for critical regions */
#define SYS_LIGHTWEIGHT_PROT 1

#cmakedefine01 NO_SYS			@NO_SYS@
#cmakedefine01 LWIP_SOCKET 		@LWIP_SOCKET@
#cmakedefine01 LWIP_COMPAT_SOCKETS	@LWIP_COMPAT_SOCKETS@
#cmakedefine01 LWIP_NETCONN		@LWIP_NETCONN@

#cmakedefine01 NO_SYS_NO_TIMERS @NO_SYS_NO_TIMERS@
#cmakedefine01 LWIP_TCP_KEEPALIVE @LWIP_TCP_KEEPALIVE@

#cmakedefine SGMII_FIXED_LINK @SGMII_FIXED_LINK@
#define MEM_ALIGNMENT 64
#cmakedefine MEM_SIZE @MEM_SIZE@
#cmakedefine MEMP_NUM_PBUF @MEMP_NUM_PBUF@
#cmakedefine MEMP_NUM_UDP_PCB @MEMP_NUM_UDP_PCB@
#cmakedefine MEMP_NUM_TCP_PCB @MEMP_NUM_TCP_PCB@
#cmakedefine MEMP_NUM_TCP_PCB_LISTEN @MEMP_NUM_TCP_PCB_LISTEN@
#cmakedefine MEMP_NUM_TCP_SEG @MEMP_NUM_TCP_SEG@
#cmakedefine MEMP_NUM_SYS_TIMEOUT @MEMP_NUM_SYS_TIMEOUT@
#cmakedefine MEMP_NUM_NETBUF @MEMP_NUM_NETBUF@
#cmakedefine MEMP_NUM_NETCONN @MEMP_NUM_NETCONN@
#cmakedefine MEMP_NUM_TCPIP_MSG_API @MEMP_NUM_TCPIP_MSG_API@
#cmakedefine MEMP_NUM_TCPIP_MSG_INPKT @MEMP_NUM_TCPIP_MSG_INPKT@

#cmakedefine PBUF_POOL_SIZE @PBUF_POOL_SIZE@
#cmakedefine PBUF_POOL_BUFSIZE @PBUF_POOL_BUFSIZE@
#cmakedefine PBUF_LINK_HLEN @PBUF_LINK_HLEN@

#cmakedefine ARP_TABLE_SIZE @ARP_TABLE_SIZE@
#cmakedefine ARP_QUEUEING @ARP_QUEUEING@

#cmakedefine ICMP_TTL @ICMP_TTL@

#cmakedefine01 LWIP_IPV6 @LWIP_IPV6@
#cmakedefine LWIP_IGMP @LWIP_IGMP@

#cmakedefine IP_OPTIONS @IP_OPTIONS@
#cmakedefine IP_FORWARD @IP_FORWARD@
#cmakedefine IP_REASSEMBLY @IP_REASSEMBLY@
#cmakedefine IP_FRAG @IP_FRAG@
#cmakedefine IP_REASS_MAX_PBUFS @IP_REASS_MAX_PBUFS@
#cmakedefine IP_FRAG_MAX_MTU @IP_FRAG_MAX_MTU@
#cmakedefine IP_DEFAULT_TTL @IP_DEFAULT_TTL@
#define LWIP_CHKSUM_ALGORITHM 3

#cmakedefine LWIP_UDP @LWIP_UDP@
#cmakedefine UDP_TTL @UDP_TTL@

#cmakedefine LWIP_TCP @LWIP_TCP@
#cmakedefine TCP_MSS @TCP_MSS@
#cmakedefine TCP_SND_BUF @TCP_SND_BUF@
#cmakedefine TCP_WND @TCP_WND@
#cmakedefine TCP_TTL @TCP_TTL@
#cmakedefine TCP_MAXRTX @TCP_MAXRTX@
#cmakedefine TCP_SYNMAXRTX @TCP_SYNMAXRTX@
#cmakedefine TCP_QUEUE_OOSEQ @TCP_QUEUE_OOSEQ@
#define TCP_SND_QUEUELEN   16 * TCP_SND_BUF/TCP_MSS

#cmakedefine01 CHECKSUM_GEN_TCP	  @CHECKSUM_GEN_TCP@
#cmakedefine01 CHECKSUM_GEN_UDP   @CHECKSUM_GEN_UDP@
#cmakedefine01 CHECKSUM_GEN_IP    @CHECKSUM_GEN_IP@
#cmakedefine01 CHECKSUM_CHECK_TCP @CHECKSUM_CHECK_TCP@
#cmakedefine01 CHECKSUM_CHECK_UDP @CHECKSUM_CHECK_UDP@
#cmakedefine01 CHECKSUM_CHECK_IP  @CHECKSUM_CHECK_IP@

#cmakedefine LWIP_FULL_CSUM_OFFLOAD_RX @LWIP_FULL_CSUM_OFFLOAD_RX@
#cmakedefine LWIP_FULL_CSUM_OFFLOAD_TX @LWIP_FULL_CSUM_OFFLOAD_TX@

#define MEMP_SEPARATE_POOLS 1
#define MEMP_NUM_FRAG_PBUF 256
#define IP_OPTIONS_ALLOWED 0

#cmakedefine TCP_OVERSIZE @TCP_OVERSIZE@
#cmakedefine USE_JUMBO_FRAMES @USE_JUMBO_FRAMES@

#cmakedefine01 LWIP_DHCP @LWIP_DHCP@
#cmakedefine01 DHCP_DOES_ARP_CHECK @DHCP_DOES_ARP_CHECK@

@linkspeed@

#cmakedefine LWIP_STATS @LWIP_STATS@
#cmakedefine LWIP_STATS_DISPLAY @LWIP_STATS_DISPLAY@

#cmakedefine LWIP_DEBUG @LWIP_DEBUG@
#cmakedefine DBG_TYPES_ON @DBG_TYPES_ON@
#cmakedefine IP_DEBUG @IP_DEBUG@
#cmakedefine TCP_DEBUG @TCP_DEBUG@
#cmakedefine TCP_INPUT_DEBUG @TCP_INPUT_DEBUG@
#cmakedefine TCP_OUTPUT_DEBUG @TCP_OUTPUT_DEBUG@
#cmakedefine TCPIP_DEBUG @TCPIP_DEBUG@
#cmakedefine UDP_DEBUG @UDP_DEBUG@
#cmakedefine ICMP_DEBUG @ICMP_DEBUG@
#cmakedefine IGMP_DEBUG @IGMP_DEBUG@
#cmakedefine NETIF_DEBUG @NETIF_DEBUG@
#cmakedefine SYS_DEBUG @SYS_DEBUG@
#cmakedefine API_MSG_DEBUG @API_MSG_DEBUG@
#cmakedefine PBUF_DEBUG @PBUF_DEBUG@
#cmakedefine MEMP_DEBUG @MEMP_DEBUG@
#cmakedefine OS_IS_FREERTOS @OS_IS_FREERTOS@
#cmakedefine LWIP_PROVIDE_ERRNO @LWIP_PROVIDE_ERRNO@
#cmakedefine DEFAULT_THREAD_PRIO @DEFAULT_THREAD_PRIO@
#cmakedefine TCPIP_THREAD_PRIO @TCPIP_THREAD_PRIO@
#cmakedefine DEFAULT_TCP_RECVMBOX_SIZE @DEFAULT_TCP_RECVMBOX_SIZE@
#cmakedefine DEFAULT_ACCEPTMBOX_SIZE @DEFAULT_ACCEPTMBOX_SIZE@
#cmakedefine TCPIP_MBOX_SIZE @TCPIP_MBOX_SIZE@
#cmakedefine DEFAULT_UDP_RECVMBOX_SIZE @DEFAULT_UDP_RECVMBOX_SIZE@
#cmakedefine DEFAULT_RAW_RECVMBOX_SIZE @DEFAULT_RAW_RECVMBOX_SIZE@
#cmakedefine LWIP_COMPAT_MUTEX @LWIP_COMPAT_MUTEX@
#cmakedefine LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT @LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT@
#cmakedefine LWIP_TCPIP_CORE_LOCKING_INPUT @LWIP_TCPIP_CORE_LOCKING_INPUT@
#cmakedefine TCPIP_THREAD_STACKSIZE @TCPIP_THREAD_STACKSIZE@

#endif
