libcoap 4.3.5-develop-ea01661
Loading...
Searching...
No Matches
coap_subscribe_internal.h
Go to the documentation of this file.
1/*
2 * coap_subscribe_internal.h -- Structures, Enums & Functions that are not
3 * exposed to application programming
4 *
5 * Copyright (C) 2010-2025 Olaf Bergmann <bergmann@tzi.org>
6 *
7 * SPDX-License-Identifier: BSD-2-Clause
8 *
9 * This file is part of the CoAP library libcoap. Please see README for terms
10 * of use.
11 */
12
18#ifndef COAP_SUBSCRIBE_INTERNAL_H_
19#define COAP_SUBSCRIBE_INTERNAL_H_
20
21#include "coap_internal.h"
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
34#if COAP_SERVER_SUPPORT
40#ifndef COAP_OBS_MAX_NON
41#define COAP_OBS_MAX_NON 5
42#endif /* COAP_OBS_MAX_NON */
43#if COAP_OBS_MAX_NON > 255
44#error COAP_OBS_MAX_NON is too large
45#endif /* COAP_OBS_MAX_NON > 255 */
46
52#ifndef COAP_OBS_MAX_FAIL
53#define COAP_OBS_MAX_FAIL 1
54#endif /* COAP_OBS_MAX_FAIL */
55#if COAP_OBS_MAX_FAIL > 255
56#error COAP_OBS_MAX_FAIL is too large
57#endif /* COAP_OBS_MAX_FAIL > 255 */
58
72
74
83 coap_session_t *session,
84 const coap_bin_const_t *token);
85
101 coap_session_t *session,
102 const coap_bin_const_t *token,
103 const coap_pdu_t *pdu);
104
116 coap_session_t *session,
117 const coap_bin_const_t *token);
118
128 coap_session_t *session,
129 const coap_bin_const_t *token);
130
144 coap_session_t *session,
145 const coap_bin_const_t *token);
146
162 coap_session_t *session,
163 const coap_bin_const_t *token,
164 coap_pdu_t *request);
165
173
183 coap_session_t *session,
184 coap_subscription_t *subscription);
185
198 const coap_string_t *query);
199
209
216
238 coap_proto_t e_proto,
239 const coap_address_t *e_listen_addr,
240 const coap_addr_tuple_t *s_addr_info,
241 const coap_bin_const_t *raw_packet,
242 const coap_bin_const_t *oscore_info);
243
264 const char *dyn_resource_save_file,
265 const char *observe_save_file,
266 const char *obs_cnt_save_file,
267 uint32_t save_freq);
268
284
285#endif /* COAP_SERVER_SUPPORT */
286
287#if COAP_CLIENT_SUPPORT
288
305 coap_pdu_type_t message_type);
306
307#endif /* COAP_CLIENT_SUPPORT */
308
311#ifdef __cplusplus
312extern "C" {
313#endif
314
315#endif /* COAP_SUBSCRIBE_INTERNAL_H_ */
Pulls together all the internal only header files.
coap_proto_t
CoAP protocol types.
Definition coap_pdu.h:317
coap_pdu_type_t
CoAP PDU message type definitions.
Definition coap_pdu.h:72
void coap_delete_observer_internal(coap_resource_t *resource, coap_session_t *session, coap_subscription_t *subscription)
Removes specific subscription for session for resource and releases the allocated storage.
void coap_check_notify_lkd(coap_context_t *context)
Checks all known resources to see if they are dirty and then notifies subscribed observers.
void coap_persist_stop_lkd(coap_context_t *context)
Stop tracking persist information, leaving the current persist information in the files defined in co...
int coap_delete_observer_request(coap_resource_t *resource, coap_session_t *session, const coap_bin_const_t *token, coap_pdu_t *request)
Removes any subscription for session observer from resource and releases the allocated storage.
void coap_persist_cleanup(coap_context_t *context)
Close down persist tracking, releasing any memory used.
int coap_delete_observer(coap_resource_t *resource, coap_session_t *session, const coap_bin_const_t *token)
Removes any subscription for session observer from resource and releases the allocated storage.
int coap_cancel_observe_lkd(coap_session_t *session, coap_binary_t *token, coap_pdu_type_t message_type)
Cancel an observe that is being tracked by the client large receive logic.
coap_subscription_t * coap_find_observer(coap_resource_t *resource, coap_session_t *session, const coap_bin_const_t *token)
Returns a subscription object for given peer.
void coap_delete_observers(coap_context_t *context, coap_session_t *session)
Removes any subscription for session and releases the allocated storage.
void coap_handle_failed_notify(coap_context_t *context, coap_session_t *session, const coap_bin_const_t *token)
Handles a failed observe notify.
coap_subscription_t * coap_persist_observe_add_lkd(coap_context_t *context, coap_proto_t e_proto, const coap_address_t *e_listen_addr, const coap_addr_tuple_t *s_addr_info, const coap_bin_const_t *raw_packet, const coap_bin_const_t *oscore_info)
Set up an active subscription for an observe that was previously active over a coap-server inadvertan...
int coap_resource_notify_observers_lkd(coap_resource_t *resource, const coap_string_t *query)
Initiate the sending of an Observe packet for all observers of resource, optionally matching query if...
void coap_subscription_init(coap_subscription_t *)
coap_subscription_t * coap_add_observer(coap_resource_t *resource, coap_session_t *session, const coap_bin_const_t *token, const coap_pdu_t *pdu)
Adds the specified peer as observer for resource.
void coap_touch_observer(coap_context_t *context, coap_session_t *session, const coap_bin_const_t *token)
Flags that data is ready to be sent to observers.
int coap_persist_startup_lkd(coap_context_t *context, const char *dyn_resource_save_file, const char *observe_save_file, const char *obs_cnt_save_file, uint32_t save_freq)
Start up persist tracking using the libcoap module.
Multi-purpose address abstraction.
CoAP binary data definition with const data.
Definition coap_str.h:67
CoAP binary data definition.
Definition coap_str.h:59
The CoAP stack's global state is stored in a coap_context_t object.
structure for CoAP PDUs
Abstraction of resource that can be attached to coap_context_t.
Abstraction of virtual session that can be attached to coap_context_t (client) or coap_endpoint_t (se...
coap_context_t * context
session's context
CoAP string data definition.
Definition coap_str.h:41
Number of notifications that may be sent non-confirmable before a confirmable message is sent to dete...
uint8_t dirty
set if the notification temporarily could not be sent (in that case, the resource's partially dirty f...
uint8_t non_cnt
up to 255 non-confirmable notifies allowed
coap_cache_key_t * cache_key
struct coap_session_t * session
subscriber session
uint8_t fail_cnt
up to 255 confirmable notifies can fail
struct coap_subscription_t * next
next element in linked list
coap_pdu_t * pdu
cache_key to identify requester