mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-04 17:02:56 +03:00
New demo client app. Update some of the memory sizes. New coap_lwip_dump_memory_pools() to dump LwIP memory pool usage. Add in logic to handle new client sessions. New coap_io_process() to handle LwIP which can invoke a callback handler to wait / timeout for the next input handler. New coap_lwip_set_input_wait_handler() to define this handler. Update coap_io_prepare_io() to handle LwIP. Support re-use of pbuf for PDU re-transmissions. Make sure that NSTART is correctly obeyed. Build the client with client only libcoap code. Build the server with server only libcoap code. Update LwIP source to latest stable release. Reserve memory for a response PDU. New coap_lwip(3) man page. Update directory structures for config files. Update files contained in "make dist" and check lwip rebuilds in the github workflows.
69 lines
1.8 KiB
C
69 lines
1.8 KiB
C
/*
|
|
* libcoap.h -- platform specific header file for CoAP stack
|
|
*
|
|
* Copyright (C) 2015 Carsten Schoenert <c.schoenert@t-online.de>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*
|
|
* This file is part of the CoAP library libcoap. Please see README for terms
|
|
* of use.
|
|
*/
|
|
|
|
/**
|
|
* @file libcoap.h
|
|
* @brief Platform specific header file for CoAP stack
|
|
*/
|
|
|
|
#ifndef COAP_LIBCOAP_H_
|
|
#define COAP_LIBCOAP_H_
|
|
|
|
/* The non posix embedded platforms like Contiki, TinyOS, RIOT, ... doesn't have
|
|
* a POSIX compatible header structure so we have to slightly do some platform
|
|
* related things. Currently there is only Contiki available so we check for a
|
|
* CONTIKI environment and do *not* include the POSIX related network stuff. If
|
|
* there are other platforms in future there need to be analogous environments.
|
|
*
|
|
* The CONTIKI variable is within the Contiki build environment! */
|
|
|
|
#if defined(_WIN32)
|
|
#pragma comment(lib,"Ws2_32.lib")
|
|
#include <ws2tcpip.h>
|
|
typedef SSIZE_T ssize_t;
|
|
typedef USHORT in_port_t;
|
|
#elif !defined (CONTIKI) && !defined (WITH_LWIP)
|
|
#include <netinet/in.h>
|
|
#include <sys/socket.h>
|
|
#endif /* ! CONTIKI && ! WITH_LWIP */
|
|
|
|
#ifndef COAP_STATIC_INLINE
|
|
# if defined(__cplusplus)
|
|
# define COAP_STATIC_INLINE inline
|
|
# else
|
|
# if defined(_MSC_VER)
|
|
# define COAP_STATIC_INLINE static __inline
|
|
# else
|
|
# define COAP_STATIC_INLINE static inline
|
|
# endif
|
|
# endif
|
|
#endif
|
|
#ifndef COAP_DEPRECATED
|
|
# if defined(_MSC_VER)
|
|
# define COAP_DEPRECATED __declspec(deprecated)
|
|
# else
|
|
# define COAP_DEPRECATED __attribute__ ((deprecated))
|
|
# endif
|
|
#endif
|
|
#ifndef COAP_UNUSED
|
|
# ifdef __GNUC__
|
|
# define COAP_UNUSED __attribute__((unused))
|
|
# else /* __GNUC__ */
|
|
# define COAP_UNUSED
|
|
# endif /* __GNUC__ */
|
|
#endif /* COAP_UNUSED */
|
|
|
|
void coap_startup(void);
|
|
|
|
void coap_cleanup(void);
|
|
|
|
#endif /* COAP_LIBCOAP_H_ */
|