|
1 | 1 | /* |
2 | 2 | * libcoap configure implementation for ESP32 platform. |
3 | 3 | * |
4 | | - * Uses libcoap software implementation for failover when concurrent |
5 | | - * configure operations are in use. |
6 | | - * |
7 | 4 | * coap.h -- main header file for CoAP stack of libcoap |
8 | 5 | * |
9 | | - * Copyright (C) 2010-2012,2015-2024 Olaf Bergmann <[email protected]> |
| 6 | + * Copyright (C) 2010-2012,2015-2025 Olaf Bergmann <[email protected]> |
10 | 7 | * 2015 Carsten Schoenert <[email protected]> |
11 | 8 | * |
12 | 9 | * Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD |
|
15 | 12 | * of use. |
16 | 13 | */ |
17 | 14 |
|
18 | | -#ifndef _CONFIG_H_ |
19 | | -#define _CONFIG_H_ |
| 15 | +#ifndef COAP_CONFIG_H_ |
| 16 | +#define COAP_CONFIG_H_ |
20 | 17 |
|
21 | 18 | /* Always enabled in ESP-IDF */ |
22 | 19 | #ifndef WITH_POSIX |
|
56 | 53 |
|
57 | 54 | #ifdef CONFIG_LWIP_IPV4 |
58 | 55 | #define COAP_IPV4_SUPPORT 1 |
59 | | -#endif /* CONFIG_LWIP_IPV4 */ |
| 56 | +#else /* ! CONFIG_LWIP_IPV4 */ |
| 57 | +struct sockaddr_in { |
| 58 | + u8_t sin_len; |
| 59 | + sa_family_t sin_family; |
| 60 | + in_port_t sin_port; |
| 61 | + struct in_addr sin_addr; |
| 62 | +}; |
| 63 | +#endif /* ! CONFIG_LWIP_IPV4 */ |
60 | 64 |
|
61 | 65 | #ifdef CONFIG_LWIP_IPV6 |
62 | 66 | #define COAP_IPV6_SUPPORT 1 |
63 | | -#endif /* CONFIG_LWIP_IPV6 */ |
| 67 | +#else /* ! CONFIG_LWIP_IPV6 */ |
| 68 | +struct sockaddr_in6 { |
| 69 | + u8_t sin6_len; |
| 70 | + sa_family_t sin6_family; |
| 71 | + in_port_t sin6_port; |
| 72 | + u32_t sin6_flowinfo; |
| 73 | + struct in_addr sin6_addr; |
| 74 | + u32_t sin6_scope_id; |
| 75 | +}; |
| 76 | +#ifndef INET6_ADDRSTRLEN |
| 77 | +#define INET6_ADDRSTRLEN 40 |
| 78 | +#endif /* INET6_ADDRSTRLEN */ |
| 79 | +#endif /* ! CONFIG_LWIP_IPV6 */ |
64 | 80 |
|
65 | 81 | #ifdef CONFIG_COAP_ASYNC_SUPPORT |
66 | 82 | #define COAP_ASYNC_SUPPORT 1 |
|
114 | 130 | #define COAP_MAX_LOGGING_LEVEL 0 |
115 | 131 | #endif /* ! CONFIG_COAP_DEBUGGING */ |
116 | 132 |
|
117 | | -#endif /* _CONFIG_H_ */ |
| 133 | +#endif /* COAP_CONFIG_H_ */ |
0 commit comments