libcoap
4.3.5-develop-146e0bb
Loading...
Searching...
No Matches
coap_cache_internal.h
Go to the documentation of this file.
1
/*
2
* coap_cache_internal.h -- Cache 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_CACHE_INTERNAL_H_
18
#define COAP_CACHE_INTERNAL_H_
19
20
#include "coap_uthash_internal.h"
21
22
#ifdef __cplusplus
23
extern
"C"
{
24
#endif
25
26
#if COAP_SERVER_SUPPORT
34
/* Holds a digest in binary typically sha256 except for notls */
35
typedef
struct
coap_digest_t {
36
uint8_t key[32];
37
} coap_digest_t;
38
39
struct
coap_cache_key_t
{
40
uint8_t key[32];
41
};
42
43
struct
coap_cache_entry_t
{
44
UT_hash_handle hh;
45
coap_cache_key_t
*cache_key;
46
coap_session_t
*session;
47
coap_pdu_t
*pdu;
48
void
*app_data;
49
coap_tick_t
expire_ticks;
50
unsigned
int
idle_timeout;
51
coap_app_data_free_callback_t
app_cb;
52
};
53
61
void
coap_expire_cache_entries(
coap_context_t
*context);
62
75
coap_cache_entry_t
*coap_cache_get_by_key_lkd(
coap_context_t
*context,
76
const
coap_cache_key_t
*cache_key);
77
92
coap_cache_entry_t
*coap_cache_get_by_pdu_lkd(
coap_session_t
*session,
93
const
coap_pdu_t
*pdu,
94
coap_cache_session_based_t
session_based);
95
110
int
coap_cache_ignore_options_lkd(
coap_context_t
*context,
111
const
uint16_t *options,
size_t
count);
112
138
coap_cache_entry_t
*coap_new_cache_entry_lkd(
coap_session_t
*session,
139
const
coap_pdu_t
*pdu,
140
coap_cache_record_pdu_t
record_pdu,
141
coap_cache_session_based_t
session_based,
142
unsigned
int
idle_time);
143
162
void
*coap_cache_set_app_data2_lkd(
coap_cache_entry_t
*cache_entry,
163
void
*data,
164
coap_app_data_free_callback_t
callback);
165
166
typedef
void
coap_digest_ctx_t;
167
175
coap_digest_ctx_t *coap_digest_setup(
void
);
176
185
void
coap_digest_free(coap_digest_ctx_t *digest_ctx);
186
198
int
coap_digest_update(coap_digest_ctx_t *digest_ctx,
199
const
uint8_t *data,
200
size_t
data_len
201
);
202
214
int
coap_digest_final(coap_digest_ctx_t *digest_ctx,
215
coap_digest_t *digest_buffer);
216
219
#endif
/* COAP_SERVER_SUPPORT */
220
221
#ifdef __cplusplus
222
}
223
#endif
224
225
#endif
/* COAP_CACHE_INTERNAL_H_ */
coap_cache_key_t
struct coap_cache_key_t coap_cache_key_t
Definition
coap_forward_decls.h:64
coap_cache_entry_t
struct coap_cache_entry_t coap_cache_entry_t
Definition
coap_forward_decls.h:63
coap_cache_record_pdu_t
coap_cache_record_pdu_t
Definition
coap_cache.h:44
coap_cache_session_based_t
coap_cache_session_based_t
Definition
coap_cache.h:39
coap_tick_t
uint64_t coap_tick_t
This data type represents internal timer ticks with COAP_TICKS_PER_SECOND resolution.
Definition
coap_time.h:149
coap_app_data_free_callback_t
void(* coap_app_data_free_callback_t)(void *data)
Callback to free off the app data when the entry is being deleted / freed off.
Definition
coap_session.h:124
coap_context_t
The CoAP stack's global state is stored in a coap_context_t object.
Definition
coap_net_internal.h:54
coap_pdu_t
structure for CoAP PDUs
Definition
coap_pdu_internal.h:132
coap_session_t
Abstraction of virtual session that can be attached to coap_context_t (client) or coap_endpoint_t (se...
Definition
coap_session_internal.h:70
libcoap
include
coap3
coap_cache_internal.h
Generated on Tue Feb 17 2026 02:06:03 for libcoap by
1.9.8