libcoap
4.3.5
Toggle main menu visibility
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 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
16
17
#ifndef COAP_IO_H_
18
#define COAP_IO_H_
19
20
#include <sys/types.h>
21
22
#include "
coap_address.h
"
23
24
#ifdef RIOT_VERSION
25
#include "net/gnrc.h"
26
#endif
/* RIOT_VERSION */
27
28
#ifndef COAP_RXBUFFER_SIZE
29
#define COAP_RXBUFFER_SIZE 1472
30
#endif
/* COAP_RXBUFFER_SIZE */
31
32
/*
33
* It may may make sense to define this larger on busy systems
34
* (lots of sessions, large number of which are active), by using
35
* -DCOAP_MAX_EPOLL_EVENTS=nn at compile time.
36
*/
37
#ifndef COAP_MAX_EPOLL_EVENTS
38
#define COAP_MAX_EPOLL_EVENTS 10
39
#endif
/* COAP_MAX_EPOLL_EVENTS */
40
41
#ifdef _WIN32
42
typedef
SOCKET
coap_fd_t
;
43
#define coap_closesocket closesocket
44
#define COAP_SOCKET_ERROR SOCKET_ERROR
45
#define COAP_INVALID_SOCKET INVALID_SOCKET
46
#else
47
typedef
int
coap_fd_t
;
48
#define coap_closesocket close
49
#define COAP_SOCKET_ERROR (-1)
50
#define COAP_INVALID_SOCKET (-1)
51
#endif
52
53
typedef
uint16_t
coap_socket_flags_t
;
54
55
typedef
struct
coap_addr_tuple_t
{
56
coap_address_t
remote
;
57
coap_address_t
local
;
58
}
coap_addr_tuple_t
;
59
60
const
char
*
coap_socket_strerror
(
void
);
61
62
typedef
enum
{
63
COAP_NACK_TOO_MANY_RETRIES
,
64
COAP_NACK_NOT_DELIVERABLE
,
65
COAP_NACK_RST
,
66
COAP_NACK_TLS_FAILED
,
67
COAP_NACK_ICMP_ISSUE
,
68
COAP_NACK_BAD_RESPONSE
,
69
COAP_NACK_TLS_LAYER_FAILED
,
70
COAP_NACK_WS_LAYER_FAILED
,
71
COAP_NACK_WS_FAILED
72
}
coap_nack_reason_t
;
73
74
#endif
/* COAP_IO_H_ */
coap_address.h
Representation of network addresses.
coap_socket_flags_t
uint16_t coap_socket_flags_t
Definition
coap_io.h:53
coap_socket_strerror
const char * coap_socket_strerror(void)
Definition
coap_io.c:1900
coap_nack_reason_t
coap_nack_reason_t
Definition
coap_io.h:62
COAP_NACK_NOT_DELIVERABLE
@ COAP_NACK_NOT_DELIVERABLE
Definition
coap_io.h:64
COAP_NACK_WS_FAILED
@ COAP_NACK_WS_FAILED
Definition
coap_io.h:71
COAP_NACK_TOO_MANY_RETRIES
@ COAP_NACK_TOO_MANY_RETRIES
Definition
coap_io.h:63
COAP_NACK_TLS_FAILED
@ COAP_NACK_TLS_FAILED
Definition
coap_io.h:66
COAP_NACK_TLS_LAYER_FAILED
@ COAP_NACK_TLS_LAYER_FAILED
Definition
coap_io.h:69
COAP_NACK_ICMP_ISSUE
@ COAP_NACK_ICMP_ISSUE
Definition
coap_io.h:67
COAP_NACK_WS_LAYER_FAILED
@ COAP_NACK_WS_LAYER_FAILED
Definition
coap_io.h:70
COAP_NACK_RST
@ COAP_NACK_RST
Definition
coap_io.h:65
COAP_NACK_BAD_RESPONSE
@ COAP_NACK_BAD_RESPONSE
Definition
coap_io.h:68
coap_fd_t
int coap_fd_t
Definition
coap_io.h:47
coap_addr_tuple_t
Definition
coap_io.h:55
coap_addr_tuple_t::remote
coap_address_t remote
remote address and port
Definition
coap_io.h:56
coap_addr_tuple_t::local
coap_address_t local
local address and port
Definition
coap_io.h:57
coap_address_t
Multi-purpose address abstraction.
Definition
coap_address.h:148
include
coap3
coap_io.h
Generated on
for libcoap by
1.17.0