libcoap  4.3.0rc2
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--2020 Olaf Bergmann <bergmann@tzi.org> and others
5  *
6  * This file is part of the CoAP library libcoap. Please see README for terms
7  * of use.
8  */
9 
15 #ifndef COAP_CACHE_INTERNAL_H_
16 #define COAP_CACHE_INTERNAL_H_
17 
18 #include "coap_io.h"
19 
27 /* Holds a digest in binary typically sha256 except for notls */
28 typedef struct coap_digest_t {
29  uint8_t key[32];
31 
33  uint8_t key[32];
34 };
35 
41  void* app_data;
43  unsigned int idle_timeout;
45 };
46 
55 
56 typedef void coap_digest_ctx_t;
57 
66 
75 void coap_digest_free(coap_digest_ctx_t *digest_ctx);
76 
89  const uint8_t *data,
90  size_t data_len
91  );
92 
104 int coap_digest_final(coap_digest_ctx_t *digest_ctx,
105  coap_digest_t *digest_buffer);
106 
109 #endif /* COAP_CACHE_INTERNAL_H_ */
void coap_digest_free(coap_digest_ctx_t *digest_ctx)
Free off coap_digest_ctx_t.
Definition: coap_notls.c:203
struct coap_digest_t coap_digest_t
coap_digest_ctx_t * coap_digest_setup(void)
Initialize a coap_digest.
Definition: coap_notls.c:192
int coap_digest_final(coap_digest_ctx_t *digest_ctx, coap_digest_t *digest_buffer)
Finalize the coap_digest information into the provided digest_buffer.
Definition: coap_notls.c:220
int coap_digest_update(coap_digest_ctx_t *digest_ctx, const uint8_t *data, size_t data_len)
Update the coap_digest information with the next chunk of data.
Definition: coap_notls.c:208
void coap_digest_ctx_t
void coap_expire_cache_entries(coap_context_t *context)
Expire coap_cache_entry_t entries.
Definition: coap_cache.c:241
void(* coap_cache_app_data_free_callback_t)(void *data)
Callback to free off the app data when the cache-entry is being deleted / freed off.
Definition: coap_cache.h:31
uint64_t coap_tick_t
This data type represents internal timer ticks with COAP_TICKS_PER_SECOND resolution.
Definition: coap_time.h:120
coap_session_t * session
coap_cache_app_data_free_callback_t callback
coap_tick_t expire_ticks
void * app_data
unsigned int idle_timeout
coap_cache_key_t * cache_key
coap_pdu_t * pdu
UT_hash_handle hh
The CoAP stack's global state is stored in a coap_context_t object.
structure for CoAP PDUs token, if any, follows the fixed size header, then options until payload mark...
Abstraction of virtual session that can be attached to coap_context_t (client) or coap_endpoint_t (se...