libcoap 4.3.4-develop-9f1418e
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-2024 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
22typedef enum {
28
52typedef ssize_t (*coap_layer_read_t)(coap_session_t *session,
53 uint8_t *data, size_t datalen);
54
77typedef ssize_t (*coap_layer_write_t)(coap_session_t *session,
78 const uint8_t *data, size_t datalen);
92typedef void (*coap_layer_establish_t)(coap_session_t *session);
93
104typedef void (*coap_layer_close_t)(coap_session_t *session);
105
106typedef struct {
107 coap_layer_read_t l_read; /* Get data from next layer (TCP) */
108 coap_layer_write_t l_write; /* Output data to next layer */
109 coap_layer_establish_t l_establish; /* Layer establish */
110 coap_layer_close_t l_close; /* Connection close */
112
114
115#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:320
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...