libcoap 4.3.5-develop-146e0bb
Loading...
Searching...
No Matches
coap_io.h
Go to the documentation of this file.
1/*
2 * coap_io.h -- Default network I/O functions for libcoap
3 *
4 * Copyright (C) 2012-2013,2024-2026 Olaf Bergmann <bergmann@tzi.org>
5 *
6 * SPDX-License-Identifier: BSD-2-Clause
7 *
8 * This file is part of the CoAP library libcoap. Please see README for terms
9 * of use.
10 */
11
17#ifndef COAP_IO_H_
18#define COAP_IO_H_
19
20#include "coap_address.h"
21
22#ifdef RIOT_VERSION
23#include "net/gnrc.h"
24#endif /* RIOT_VERSION */
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30#ifndef COAP_RXBUFFER_SIZE
31#define COAP_RXBUFFER_SIZE 1472
32#endif /* COAP_RXBUFFER_SIZE */
33
34/*
35 * It may may make sense to define this larger on busy systems
36 * (lots of sessions, large number of which are active), by using
37 * -DCOAP_MAX_EPOLL_EVENTS=nn at compile time.
38 */
39#ifndef COAP_MAX_EPOLL_EVENTS
40#define COAP_MAX_EPOLL_EVENTS 10
41#endif /* COAP_MAX_EPOLL_EVENTS */
42
43#ifdef _WIN32
44typedef SOCKET coap_fd_t;
45#define coap_closesocket closesocket
46#define COAP_SOCKET_ERROR SOCKET_ERROR
47#define COAP_INVALID_SOCKET INVALID_SOCKET
48#else
49typedef int coap_fd_t;
50#define coap_closesocket close
51#define COAP_SOCKET_ERROR (-1)
52#define COAP_INVALID_SOCKET (-1)
53#endif
54
55typedef uint16_t coap_socket_flags_t;
56
61
62const char *coap_socket_strerror(void);
63
75
76#ifdef __cplusplus
77}
78#endif
79
80#endif /* COAP_IO_H_ */
Representation of network addresses.
uint16_t coap_socket_flags_t
Definition coap_io.h:55
const char * coap_socket_strerror(void)
Definition coap_io.c:935
coap_nack_reason_t
Definition coap_io.h:64
@ COAP_NACK_NOT_DELIVERABLE
Definition coap_io.h:66
@ COAP_NACK_WS_FAILED
Definition coap_io.h:73
@ COAP_NACK_TOO_MANY_RETRIES
Definition coap_io.h:65
@ COAP_NACK_TLS_FAILED
Definition coap_io.h:68
@ COAP_NACK_TLS_LAYER_FAILED
Definition coap_io.h:71
@ COAP_NACK_ICMP_ISSUE
Definition coap_io.h:69
@ COAP_NACK_WS_LAYER_FAILED
Definition coap_io.h:72
@ COAP_NACK_RST
Definition coap_io.h:67
@ COAP_NACK_BAD_RESPONSE
Definition coap_io.h:70
int coap_fd_t
Definition coap_io.h:49
coap_address_t remote
remote address and port
Definition coap_io.h:58
coap_address_t local
local address and port
Definition coap_io.h:59
Multi-purpose address abstraction.