libcoap 4.3.5-develop-eafc023
Loading...
Searching...
No Matches
coap_dgrm_internal.h
Go to the documentation of this file.
1/*
2 * coap_dgrm_internal.h -- Datagram (UDP) functions for libcoap
3 *
4 * Copyright (C) 2019--2026 Olaf Bergmann <bergmann@tzi.org> and others
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_DGRM_INTERNAL_H_
18#define COAP_DGRM_INTERNAL_H_
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24typedef struct coap_icmp_info_t {
25 uint32_t length;
26 uint8_t cmsg_level;
27 uint8_t ee_origin;
28 uint8_t ee_type;
29 uint8_t ee_code;
31
38
39#if COAP_CLIENT_SUPPORT
56int coap_socket_connect_udp(coap_socket_t *sock,
57 const coap_address_t *local_if,
58 const coap_address_t *server,
59 int default_port,
60 coap_address_t *local_addr,
61 coap_address_t *remote_addr);
62#endif /* COAP_CLIENT_SUPPORT */
63
64#if COAP_SERVER_SUPPORT
78int coap_socket_bind_udp(coap_socket_t *sock,
79 const coap_address_t *listen_addr,
80 coap_address_t *bound_addr);
81#endif /* COAP_SERVER_SUPPORT */
82
97ssize_t coap_socket_send(coap_socket_t *sock, coap_session_t *session,
98 const uint8_t *data, size_t datalen);
99
114ssize_t coap_socket_recv(coap_socket_t *sock, coap_packet_t *packet);
115
125
127
128#ifdef __cplusplus
129}
130#endif
131
132#endif /* COAP_DGRM_INTERNAL_H_ */
ssize_t coap_socket_recv(coap_socket_t *sock, coap_packet_t *packet)
Function interface for reading data.
ssize_t coap_socket_send(coap_socket_t *sock, coap_session_t *session, const uint8_t *data, size_t datalen)
Function interface for data transmission.
void coap_socket_dgrm_close(coap_socket_t *sock)
Function interface to close off a datagram socket.
Multi-purpose address abstraction.
Abstraction of virtual session that can be attached to coap_context_t (client) or coap_endpoint_t (se...