libcoap 4.3.5-develop-ea01661
Loading...
Searching...
No Matches
coap_layers_internal.h
Go to the documentation of this file.
1/*
2 * coap_layers_internal.h -- Internal layer functions for libcoap
3 *
4 * Copyright (C) 2023-2025 Jon Shallow <supjps-libcoap@jpshallow.com>
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_LAYERS_INTERNAL_H_
18#define COAP_LAYERS_INTERNAL_H_
19
20#include "coap_internal.h"
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
32
56typedef ssize_t (*coap_layer_read_t)(coap_session_t *session,
57 uint8_t *data, size_t datalen);
58
81typedef ssize_t (*coap_layer_write_t)(coap_session_t *session,
82 const uint8_t *data, size_t datalen);
96typedef void (*coap_layer_establish_t)(coap_session_t *session);
97
108typedef void (*coap_layer_close_t)(coap_session_t *session);
109
110typedef struct {
111 coap_layer_read_t l_read; /* Get data from next layer (TCP) */
112 coap_layer_write_t l_write; /* Output data to next layer */
113 coap_layer_establish_t l_establish; /* Layer establish */
114 coap_layer_close_t l_close; /* Connection close */
116
118
119#ifdef __cplusplus
120}
121#endif
122
123#endif /* COAP_LAYERS_INTERNAL_H_ */
Pulls together all the internal only header files.
void(* coap_layer_close_t)(coap_session_t *session)
Function close interface for layer closing.
ssize_t(* coap_layer_read_t)(coap_session_t *session, uint8_t *data, size_t datalen)
Function read interface for layer data receiving.
ssize_t(* coap_layer_write_t)(coap_session_t *session, const uint8_t *data, size_t datalen)
Function write interface for layer data sending.
coap_layer_func_t coap_layers_coap[COAP_PROTO_LAST][COAP_LAYER_LAST]
Definition coap_layers.c:39
void(* coap_layer_establish_t)(coap_session_t *session)
Function establish interface for layer establish handling.
@ COAP_LAYER_LAST
@ COAP_LAYER_SESSION
@ COAP_LAYER_WS
@ COAP_LAYER_TLS
@ COAP_PROTO_LAST
Definition coap_pdu.h:325
coap_layer_read_t l_read
coap_layer_write_t l_write
coap_layer_establish_t l_establish
coap_layer_close_t l_close
Abstraction of virtual session that can be attached to coap_context_t (client) or coap_endpoint_t (se...