|
| 1 | +/* |
| 2 | + * libcoap configure implementation for ESP32 platform. |
| 3 | + * |
| 4 | + * Uses libcoap software implementation for failover when concurrent |
| 5 | + * configure operations are in use. |
| 6 | + * |
| 7 | + * coap.h -- main header file for CoAP stack of libcoap |
| 8 | + * |
| 9 | + * Copyright (C) 2010-2012,2015-2016 Olaf Bergmann <[email protected]> |
| 10 | + * 2015 Carsten Schoenert <[email protected]> |
| 11 | + * |
| 12 | + * Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD |
| 13 | + * |
| 14 | + * This file is part of the CoAP library libcoap. Please see README for terms |
| 15 | + * of use. |
| 16 | + */ |
| 17 | + |
| 18 | +#ifndef COAP_CONFIG_POSIX_H_ |
| 19 | +#define COAP_CONFIG_POSIX_H_ |
| 20 | + |
| 21 | +#ifdef WITH_POSIX |
| 22 | + |
| 23 | +#include <sys/socket.h> |
| 24 | +#include <net/if.h> |
| 25 | + |
| 26 | +#define HAVE_SYS_SOCKET_H |
| 27 | +#define HAVE_MALLOC |
| 28 | +#define HAVE_ARPA_INET_H |
| 29 | +#define HAVE_TIME_H |
| 30 | +#define HAVE_NETDB_H |
| 31 | +#define HAVE_NETINET_IN_H |
| 32 | +#define HAVE_STRUCT_CMSGHDR |
| 33 | +#define COAP_DISABLE_TCP 0 |
| 34 | + |
| 35 | +#define ipi_spec_dst ipi_addr |
| 36 | +struct in6_pktinfo { |
| 37 | + struct in6_addr ipi6_addr; /* src/dst IPv6 address */ |
| 38 | + unsigned int ipi6_ifindex; /* send/recv interface index */ |
| 39 | +}; |
| 40 | +#define IN6_IS_ADDR_V4MAPPED(a) \ |
| 41 | + ((((__const uint32_t *) (a))[0] == 0) \ |
| 42 | + && (((__const uint32_t *) (a))[1] == 0) \ |
| 43 | + && (((__const uint32_t *) (a))[2] == htonl (0xffff))) |
| 44 | + |
| 45 | +/* As not defined, just need to define is as something innocuous */ |
| 46 | +#define IPV6_PKTINFO IPV6_CHECKSUM |
| 47 | + |
| 48 | +#define PACKAGE_NAME "libcoap-posix" |
| 49 | +#define PACKAGE_VERSION "?" |
| 50 | + |
| 51 | +#ifdef CONFIG_MBEDTLS_TLS_ENABLED |
| 52 | +#define HAVE_MBEDTLS |
| 53 | +#endif /* CONFIG_MBEDTLS_TLS_ENABLED */ |
| 54 | +#define COAP_CONSTRAINED_STACK 1 |
| 55 | +#define ESPIDF_VERSION |
| 56 | + |
| 57 | +#define gai_strerror(x) "gai_strerror() not supported" |
| 58 | + |
| 59 | +#endif /* WITH_POSIX */ |
| 60 | +#endif /* COAP_CONFIG_POSIX_H_ */ |
0 commit comments