libcoap
4.3.5-develop-dfd5545
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-2026 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
17
18
#ifndef COAP_SUBSCRIBE_INTERNAL_H_
19
#define COAP_SUBSCRIBE_INTERNAL_H_
20
21
#ifdef __cplusplus
22
extern
"C"
{
23
#endif
24
31
32
#if COAP_SERVER_SUPPORT
38
#ifndef COAP_OBS_MAX_NON
39
#define COAP_OBS_MAX_NON 5
40
#endif
/* COAP_OBS_MAX_NON */
41
#if COAP_OBS_MAX_NON > 255
42
#error COAP_OBS_MAX_NON is too large
43
#endif
/* COAP_OBS_MAX_NON > 255 */
44
50
#ifndef COAP_OBS_MAX_FAIL
51
#define COAP_OBS_MAX_FAIL 1
52
#endif
/* COAP_OBS_MAX_FAIL */
53
#if COAP_OBS_MAX_FAIL > 255
54
#error COAP_OBS_MAX_FAIL is too large
55
#endif
/* COAP_OBS_MAX_FAIL > 255 */
56
58
struct
coap_subscription_t
{
59
struct
coap_subscription_t
*next;
60
struct
coap_session_t
*session;
61
62
uint8_t non_cnt;
63
uint8_t fail_cnt;
64
uint8_t dirty;
67
coap_cache_key_t
*cache_key;
68
coap_pdu_t
*pdu;
69
};
70
71
void
coap_subscription_init(
coap_subscription_t
*);
72
80
void
coap_handle_failed_notify(
coap_context_t
*
context
,
81
coap_session_t
*session,
82
const
coap_bin_const_t
*token);
83
98
coap_subscription_t
*coap_add_observer(
coap_resource_t
*resource,
99
coap_session_t
*session,
100
const
coap_bin_const_t
*token,
101
const
coap_pdu_t
*pdu);
102
113
coap_subscription_t
*coap_find_observer(
coap_resource_t
*resource,
114
coap_session_t
*session,
115
const
coap_bin_const_t
*token);
116
125
void
coap_touch_observer(
coap_context_t
*
context
,
126
coap_session_t
*session,
127
const
coap_bin_const_t
*token);
128
141
int
coap_delete_observer(
coap_resource_t
*resource,
142
coap_session_t
*session,
143
const
coap_bin_const_t
*token);
144
160
int
coap_delete_observer_request(
coap_resource_t
*resource,
161
coap_session_t
*session,
162
const
coap_bin_const_t
*token,
163
coap_pdu_t
*request,
164
int
large_fetch);
165
172
void
coap_delete_observers(
coap_context_t
*
context
,
coap_session_t
*session);
173
182
void
coap_delete_observer_internal(
coap_resource_t
*resource,
183
coap_session_t
*session,
184
coap_subscription_t
*subscription);
185
197
int
coap_resource_notify_observers_lkd(
coap_resource_t
*resource,
198
coap_deleting_resource_t deleting);
199
208
void
coap_check_notify_lkd(
coap_context_t
*
context
);
209
215
void
coap_persist_cleanup(
coap_context_t
*
context
);
216
237
coap_subscription_t
*coap_persist_observe_add_lkd(
coap_context_t
*
context
,
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
263
int
coap_persist_startup_lkd(
coap_context_t
*
context
,
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
283
void
coap_persist_stop_lkd(
coap_context_t
*
context
);
284
285
#endif
/* COAP_SERVER_SUPPORT */
286
287
#if COAP_CLIENT_SUPPORT
288
304
int
coap_cancel_observe_lkd(
coap_session_t
*session,
coap_binary_t
*token,
305
coap_pdu_type_t
message_type);
306
307
#endif
/* COAP_CLIENT_SUPPORT */
308
310
311
#ifdef __cplusplus
312
}
313
#endif
314
315
#endif
/* COAP_SUBSCRIBE_INTERNAL_H_ */
coap_cache_key_t
struct coap_cache_key_t coap_cache_key_t
Definition
coap_forward_decls.h:64
coap_pdu_t
struct coap_pdu_t coap_pdu_t
PDU information.
Definition
coap_forward_decls.h:96
coap_subscription_t
struct coap_subscription_t coap_subscription_t
Definition
coap_forward_decls.h:128
coap_resource_t
struct coap_resource_t coap_resource_t
Definition
coap_forward_decls.h:112
coap_session_t
struct coap_session_t coap_session_t
Definition
coap_forward_decls.h:121
coap_proto_t
coap_proto_t
CoAP protocol types Note: coap_layers_coap[] needs updating if extended.
Definition
coap_pdu.h:234
coap_pdu_type_t
coap_pdu_type_t
CoAP PDU message type definitions.
Definition
coap_pdu.h:70
coap_addr_tuple_t
Definition
coap_io.h:57
coap_address_t
Multi-purpose address abstraction.
Definition
coap_address.h:185
coap_bin_const_t
CoAP binary data definition with const data.
Definition
coap_str.h:65
coap_binary_t
CoAP binary data definition.
Definition
coap_str.h:57
coap_context_t
The CoAP stack's global state is stored in a coap_context_t object.
Definition
coap_net_internal.h:55
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:77
coap_session_t::context
coap_context_t * context
session's context
Definition
coap_session_internal.h:102
libcoap
include
coap3
coap_subscribe_internal.h
Generated on
for libcoap by
1.15.0