libcoap 4.3.5-develop-0bcd592
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
17#ifndef COAP_DGRM_INTERNAL_H_
18#define COAP_DGRM_INTERNAL_H_
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
31#if COAP_CLIENT_SUPPORT
48int coap_socket_connect_udp(coap_socket_t *sock,
49 const coap_address_t *local_if,
50 const coap_address_t *server,
51 int default_port,
52 coap_address_t *local_addr,
53 coap_address_t *remote_addr);
54#endif /* COAP_CLIENT_SUPPORT */
55
56#if COAP_SERVER_SUPPORT
70int coap_socket_bind_udp(coap_socket_t *sock,
71 const coap_address_t *listen_addr,
72 coap_address_t *bound_addr);
73#endif /* COAP_SERVER_SUPPORT */
74
89ssize_t coap_socket_send(coap_socket_t *sock, coap_session_t *session,
90 const uint8_t *data, size_t datalen);
91
106ssize_t coap_socket_recv(coap_socket_t *sock, coap_packet_t *packet);
107
117
120#ifdef __cplusplus
121}
122#endif
123
124#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...