libcoap 4.3.5-develop-ea01661
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--2025 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#include "coap_internal.h"
21#include "coap_io.h"
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
34#if COAP_CLIENT_SUPPORT
52 const coap_address_t *local_if,
53 const coap_address_t *server,
54 int default_port,
55 coap_address_t *local_addr,
56 coap_address_t *remote_addr);
57#endif /* COAP_CLIENT_SUPPORT */
58
59#if COAP_SERVER_SUPPORT
74 const coap_address_t *listen_addr,
75 coap_address_t *bound_addr);
76#endif /* COAP_SERVER_SUPPORT */
77
78#ifdef WITH_LWIP
79ssize_t coap_socket_send_pdu(coap_socket_t *sock, coap_session_t *session,
80 coap_pdu_t *pdu);
81#endif
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
116
124
127#ifdef __cplusplus
128extern "C" {
129#endif
130
131#endif /* COAP_DGRM_INTERNAL_H_ */
Pulls together all the internal only header files.
Default network I/O functions.
int coap_socket_connect_udp(coap_socket_t *sock, const coap_address_t *local_if, const coap_address_t *server, int default_port, coap_address_t *local_addr, coap_address_t *remote_addr)
Create a new UDP socket and 'connect' it to the address tuple.
void coap_socket_close(coap_socket_t *sock)
Function interface to close off a socket (for both TCP and UDP).
Definition coap_io.c:395
ssize_t coap_socket_recv(coap_socket_t *sock, coap_packet_t *packet)
Function interface for reading data.
Definition coap_io.c:1070
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.
Definition coap_io.c:869
int coap_socket_bind_udp(coap_socket_t *sock, const coap_address_t *listen_addr, coap_address_t *bound_addr)
Create a new UDP socket and then listen for new incoming UDP sessions to the specified IP address and...
Multi-purpose address abstraction.
structure for CoAP PDUs
Abstraction of virtual session that can be attached to coap_context_t (client) or coap_endpoint_t (se...