#ifndef _CONFIG_H_
#define _CONFIG_H_

#include <lwip/opt.h>
#include <lwip/debug.h>
#include <lwip/def.h> /* provide ntohs, htons */

#define WITH_LWIP 1

#ifndef COAP_CONSTRAINED_STACK
#define COAP_CONSTRAINED_STACK 1
#endif

#define PACKAGE_NAME "libcoap-lwip"
#define PACKAGE_VERSION "?"
#define PACKAGE_STRING PACKAGE_NAME PACKAGE_VERSION

//#define assert(x) LWIP_ASSERT("CoAP assert failed", x)  jem

/* it's just provided by libc. i hope we don't get too many of those, as
 * actually we'd need autotools again to find out what environment we're
 * building in */
#define HAVE_STRNLEN 1

// #define HAVE_LIMITS_H   jem - added below

#define HAVE_SNPRINTF 1    // jem - added, not in original coap_config.h. Not sure why, without it we get no timestamps on debug.

#define COAP_DEBUG_BUF_SIZE 256      // TODO jem - debug

/*
 *  jem - The following (to end of file) have been taken from coap_config.h in the home directory of libcoap.
 *  This header is not used when make is run from the examples/lwip directory.
 *
 *  A lot of these are relevant when ported to build in MCUXpresso and redlib so, ported them
 *  to here and set or commented out as necessary.
 */
/* Define to 1 if you have the <arpa/inet.h> header file. */
//#define HAVE_ARPA_INET_H 1     jem - we do have this but coap_debug.c won't build when this defined (coap_address_t #define not correct)

/* Define to 1 if you have the <assert.h> header file. */
#define HAVE_ASSERT_H 1

/* Define to 1 if you have the <dlfcn.h> header file. */
//#define HAVE_DLFCN_H 1

/* Define to 1 if you have the `getaddrinfo' function. */
#define HAVE_GETADDRINFO 1

/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1                                         //jem - don't have it??

/* Define if the system has libcunit */
/* #undef HAVE_LIBCUNIT */

/* Define if the system has libgnutls28 */
/* #undef HAVE_LIBGNUTLS */

/* Define if the system has libtinydtls */
/* #undef HAVE_LIBTINYDTLS */

/* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1

/* Define to 1 if you have the `malloc' function. */
#define HAVE_MALLOC 1

/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1

/* Define to 1 if you have the `memset' function. */
#define HAVE_MEMSET 1

/* Define to 1 if you have the <netdb.h> header file. */
//#define HAVE_NETDB_H 1

/* Define to 1 if you have the <netinet/in.h> header file. */
//#define HAVE_NETINET_IN_H 1

/* Define if the system has libssl1.1 */
/* #undef HAVE_OPENSSL */

/* Define to 1 if you have the `select' function. */
#define HAVE_SELECT 1

/* Define to 1 if you have the `socket' function. */
#define HAVE_SOCKET 1

/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1

/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1

/* Define to 1 if you have the `strcasecmp' function. */
#define HAVE_STRCASECMP 1

/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1

/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1

/* Define to 1 if you have the `strnlen' function. */
#define HAVE_STRNLEN 1

/* Define to 1 if you have the `strrchr' function. */
#define HAVE_STRRCHR 1

/* Define to 1 if the system has the type `struct cmsghdr'. */
#define HAVE_STRUCT_CMSGHDR 1

/* Define to 1 if you have the <syslog.h> header file. */
//#define HAVE_SYSLOG_H 1

/* Define to 1 if you have the <sys/ioctl.h> header file. */
#define HAVE_SYS_IOCTL_H 1

/* Define to 1 if you have the <sys/socket.h> header file. */
#define HAVE_SYS_SOCKET_H 1

/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1

/* Define to 1 if you have the <sys/time.h> header file. */
//#define HAVE_SYS_TIME_H 1                                          jem - don't have it

/* Define to 1 if you have the <sys/types.h> header file. */
// #define HAVE_SYS_TYPES_H 1                                        jem - don't have it

/* Define to 1 if you have the <sys/unistd.h> header file. */
//#define HAVE_SYS_UNISTD_H 1                                        jem - don't have it

/* Define to 1 if you have the <time.h> header file. */
//#define HAVE_TIME_H 1                                              jem - ?? dont have it?

/* Define to 1 if you have the <unistd.h> header file. */
//#define HAVE_UNISTD_H 1                                            jem - don't have it


#endif /* _CONFIG_H_ */
