-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathzenoh_commons.h
6463 lines (6463 loc) · 256 KB
/
zenoh_commons.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//
// Copyright (c) 2024 ZettaScale Technology
//
// This program and the accompanying materials are made available under the
// terms of the Eclipse Public License 2.0 which is available at
// http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
// which is available at https://www.apache.org/licenses/LICENSE-2.0.
//
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
//
// Contributors:
// ZettaScale Zenoh Team, <zenoh@zettascale.tech>
//
// clang-format off
#ifdef DOCS
#define ALIGN(n)
#define ZENOHC_API
#endif
typedef enum z_congestion_control_t {
/**
* Messages are not dropped in case of congestion.
*/
Z_CONGESTION_CONTROL_BLOCK,
/**
* Messages are dropped in case of congestion.
*/
Z_CONGESTION_CONTROL_DROP,
} z_congestion_control_t;
/**
* Consolidation mode values.
*/
typedef enum z_consolidation_mode_t {
/**
* Let Zenoh decide the best consolidation mode depending on the query selector.
* If the selector contains time range properties, consolidation mode `NONE` is used.
* Otherwise the `LATEST` consolidation mode is used.
*/
Z_CONSOLIDATION_MODE_AUTO = -1,
/**
* No consolidation is applied. Replies may come in any order and any number.
*/
Z_CONSOLIDATION_MODE_NONE = 0,
/**
* It guarantees that any reply for a given key expression will be monotonic in time
* w.r.t. the previous received replies for the same key expression. I.e., for the same key expression multiple
* replies may be received. It is guaranteed that two replies received at t1 and t2 will have timestamp
* ts2 > ts1. It optimizes latency.
*/
Z_CONSOLIDATION_MODE_MONOTONIC = 1,
/**
* It guarantees unicity of replies for the same key expression.
* It optimizes bandwidth.
*/
Z_CONSOLIDATION_MODE_LATEST = 2,
} z_consolidation_mode_t;
/**
* @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
* @brief Intersection level of 2 key expressions.
*/
#if defined(Z_FEATURE_UNSTABLE_API)
typedef enum z_keyexpr_intersection_level_t {
/**
* 2 key expressions do not intersect.
*/
Z_KEYEXPR_INTERSECTION_LEVEL_DISJOINT = 0,
/**
* 2 key expressions intersect, i.e. there exists at least one key expression that is included by both.
*/
Z_KEYEXPR_INTERSECTION_LEVEL_INTERSECTS = 1,
/**
* First key expression is the superset of second one.
*/
Z_KEYEXPR_INTERSECTION_LEVEL_INCLUDES = 2,
/**
* 2 key expressions are equal.
*/
Z_KEYEXPR_INTERSECTION_LEVEL_EQUALS = 3,
} z_keyexpr_intersection_level_t;
#endif
/**
* The priority of zenoh messages.
*/
typedef enum z_priority_t {
/**
* Priority for ``RealTime`` messages.
*/
Z_PRIORITY_REAL_TIME = 1,
/**
* Highest priority for ``Interactive`` messages.
*/
Z_PRIORITY_INTERACTIVE_HIGH = 2,
/**
* Lowest priority for ``Interactive`` messages.
*/
Z_PRIORITY_INTERACTIVE_LOW = 3,
/**
* Highest priority for ``Data`` messages.
*/
Z_PRIORITY_DATA_HIGH = 4,
/**
* Default priority for ``Data`` messages.
*/
Z_PRIORITY_DATA = 5,
/**
* Lowest priority for ``Data`` messages.
*/
Z_PRIORITY_DATA_LOW = 6,
/**
* Priority for ``Background traffic`` messages.
*/
Z_PRIORITY_BACKGROUND = 7,
} z_priority_t;
/**
* The Queryables that should be target of a `z_get()`.
*/
typedef enum z_query_target_t {
/**
* The nearest complete queryable if any else all matching queryables.
*/
Z_QUERY_TARGET_BEST_MATCHING,
/**
* All matching queryables.
*/
Z_QUERY_TARGET_ALL,
/**
* All complete queryables.
*/
Z_QUERY_TARGET_ALL_COMPLETE,
} z_query_target_t;
/**
* @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
* @brief The publisher reliability.
* @note Currently `reliability` does not trigger any data retransmission on the wire.
* It is rather used as a marker on the wire and it may be used to select the best link available (e.g. TCP for reliable data and UDP for best effort data).
*/
#if defined(Z_FEATURE_UNSTABLE_API)
typedef enum z_reliability_t {
/**
* Defines reliability as ``BEST_EFFORT``
*/
Z_RELIABILITY_BEST_EFFORT,
/**
* Defines reliability as ``RELIABLE``
*/
Z_RELIABILITY_RELIABLE,
} z_reliability_t;
#endif
typedef enum z_sample_kind_t {
/**
* The Sample was issued by a ``put`` operation.
*/
Z_SAMPLE_KIND_PUT = 0,
/**
* The Sample was issued by a ``delete`` operation.
*/
Z_SAMPLE_KIND_DELETE = 1,
} z_sample_kind_t;
typedef enum z_what_t {
Z_WHAT_ROUTER = 1,
Z_WHAT_PEER = 2,
Z_WHAT_CLIENT = 4,
Z_WHAT_ROUTER_PEER = (1 | 2),
Z_WHAT_ROUTER_CLIENT = (1 | 4),
Z_WHAT_PEER_CLIENT = (2 | 4),
Z_WHAT_ROUTER_PEER_CLIENT = ((1 | 2) | 4),
} z_what_t;
typedef enum z_whatami_t {
Z_WHATAMI_ROUTER = 1,
Z_WHATAMI_PEER = 2,
Z_WHATAMI_CLIENT = 4,
} z_whatami_t;
/**
* The locality of samples to be received by subscribers or targeted by publishers.
*/
typedef enum zc_locality_t {
/**
* Any
*/
ZC_LOCALITY_ANY = 0,
/**
* Only from local sessions.
*/
ZC_LOCALITY_SESSION_LOCAL = 1,
/**
* Only from remote sessions.
*/
ZC_LOCALITY_REMOTE = 2,
} zc_locality_t;
/**
* Severity level of Zenoh log message.
*/
typedef enum zc_log_severity_t {
/**
* The `trace` level.
*
* Designates very low priority, often extremely verbose, information.
*/
ZC_LOG_SEVERITY_TRACE = 0,
/**
* The "debug" level.
*
* Designates lower priority information.
*/
ZC_LOG_SEVERITY_DEBUG = 1,
/**
* The "info" level.
*
* Designates useful information.
*/
ZC_LOG_SEVERITY_INFO = 2,
/**
* The "warn" level.
*
* Designates hazardous situations.
*/
ZC_LOG_SEVERITY_WARN = 3,
/**
* The "error" level.
*
* Designates very serious errors.
*/
ZC_LOG_SEVERITY_ERROR = 4,
} zc_log_severity_t;
/**
* @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
* @brief Key expressions types to which Queryable should reply to.
*/
#if defined(Z_FEATURE_UNSTABLE_API)
typedef enum zc_reply_keyexpr_t {
/**
* Replies to any key expression queries.
*/
ZC_REPLY_KEYEXPR_ANY = 0,
/**
* Replies only to queries with intersecting key expressions.
*/
ZC_REPLY_KEYEXPR_MATCHING_QUERY = 1,
} zc_reply_keyexpr_t;
#endif
typedef struct z_moved_alloc_layout_t {
struct z_owned_alloc_layout_t _this;
} z_moved_alloc_layout_t;
typedef int8_t z_result_t;
typedef struct z_moved_bytes_t {
struct z_owned_bytes_t _this;
} z_moved_bytes_t;
typedef struct z_moved_shm_t {
struct z_owned_shm_t _this;
} z_moved_shm_t;
typedef struct z_moved_shm_mut_t {
struct z_owned_shm_mut_t _this;
} z_moved_shm_mut_t;
typedef struct z_moved_slice_t {
struct z_owned_slice_t _this;
} z_moved_slice_t;
typedef struct z_moved_string_t {
struct z_owned_string_t _this;
} z_moved_string_t;
/**
* An iterator over slices of serialized data.
*/
typedef struct ALIGN(8) z_bytes_slice_iterator_t {
uint8_t _0[24];
} z_bytes_slice_iterator_t;
typedef struct z_moved_bytes_writer_t {
struct z_owned_bytes_writer_t _this;
} z_moved_bytes_writer_t;
typedef struct z_moved_chunk_alloc_result_t {
struct z_owned_chunk_alloc_result_t _this;
} z_moved_chunk_alloc_result_t;
/**
* Monotonic clock
*/
typedef struct z_clock_t {
uint64_t t;
const void *t_base;
} z_clock_t;
/**
* Options passed to the `z_close()` function.
*/
typedef struct z_close_options_t {
#if defined(Z_FEATURE_UNSTABLE_API)
/**
* The timeout for close operation in milliseconds. 0 means default close timeout which is 10 seconds.
*/
uint32_t internal_timeout_ms;
#endif
#if defined(Z_FEATURE_UNSTABLE_API)
/**
* An optional uninitialized concurrent close handle. If set, the close operation will be executed
* concurrently in separate task, and this handle will be initialized to be used for controlling
* it's execution.
*/
struct zc_owned_concurrent_close_handle_t *internal_out_concurrent;
#endif
#if !defined(Z_FEATURE_UNSTABLE_API)
uint8_t _dummy;
#endif
} z_close_options_t;
/**
* @brief A hello message-processing closure.
*
* A closure is a structure that contains all the elements for stateful, memory-leak-free callbacks.
*/
typedef struct z_owned_closure_hello_t {
void *_context;
void (*_call)(struct z_loaned_hello_t *hello, void *context);
void (*_drop)(void *context);
} z_owned_closure_hello_t;
/**
* Moved closure.
*/
typedef struct z_moved_closure_hello_t {
struct z_owned_closure_hello_t _this;
} z_moved_closure_hello_t;
/**
* @brief A query-processing closure.
*
* A closure is a structure that contains all the elements for stateful, memory-leak-free callbacks.
*/
typedef struct z_owned_closure_query_t {
void *_context;
void (*_call)(struct z_loaned_query_t *reply, void *context);
void (*_drop)(void *context);
} z_owned_closure_query_t;
/**
* Moved closure.
*/
typedef struct z_moved_closure_query_t {
struct z_owned_closure_query_t _this;
} z_moved_closure_query_t;
/**
* @brief A reply-processing closure.
*
* A closure is a structure that contains all the elements for stateful, memory-leak-free callbacks.
*/
typedef struct z_owned_closure_reply_t {
void *_context;
void (*_call)(struct z_loaned_reply_t *reply, void *context);
void (*_drop)(void *context);
} z_owned_closure_reply_t;
/**
* Moved closure.
*/
typedef struct z_moved_closure_reply_t {
struct z_owned_closure_reply_t _this;
} z_moved_closure_reply_t;
/**
* @brief A sample-processing closure.
*
* A closure is a structure that contains all the elements for stateful, memory-leak-free callbacks.
*/
typedef struct z_owned_closure_sample_t {
void *_context;
void (*_call)(struct z_loaned_sample_t *sample, void *context);
void (*_drop)(void *context);
} z_owned_closure_sample_t;
/**
* Moved closure.
*/
typedef struct z_moved_closure_sample_t {
struct z_owned_closure_sample_t _this;
} z_moved_closure_sample_t;
/**
* @brief A zenoh id-processing closure.
*
* A closure is a structure that contains all the elements for stateful, memory-leak-free callbacks:
*/
typedef struct z_owned_closure_zid_t {
void *_context;
void (*_call)(const struct z_id_t *z_id, void *context);
void (*_drop)(void *context);
} z_owned_closure_zid_t;
/**
* @brief Moved closure.
*/
typedef struct z_moved_closure_zid_t {
struct z_owned_closure_zid_t _this;
} z_moved_closure_zid_t;
typedef struct z_moved_condvar_t {
struct z_owned_condvar_t _this;
} z_moved_condvar_t;
typedef struct z_moved_config_t {
struct z_owned_config_t _this;
} z_moved_config_t;
/**
* Options passed to the `z_declare_queryable()` function.
*/
typedef struct z_queryable_options_t {
/**
* The completeness of the Queryable.
*/
bool complete;
} z_queryable_options_t;
/**
* Options passed to the `z_declare_subscriber()` function.
*/
typedef struct z_subscriber_options_t {
#if !defined(Z_FEATURE_UNSTABLE_API)
/**
* Dummy field to avoid having fieldless struct
*/
uint8_t _0;
#endif
#if defined(Z_FEATURE_UNSTABLE_API)
/**
* Restricts the matching publications that will be received by this Subscribers to the ones
* that have the compatible allowed_destination.
*/
enum zc_locality_t allowed_origin;
#endif
} z_subscriber_options_t;
typedef struct z_moved_encoding_t {
struct z_owned_encoding_t _this;
} z_moved_encoding_t;
/**
* Options passed to the `z_declare_publisher()` function.
*/
typedef struct z_publisher_options_t {
/**
* Default encoding for messages put by this publisher.
*/
struct z_moved_encoding_t *encoding;
/**
* The congestion control to apply when routing messages from this publisher.
*/
enum z_congestion_control_t congestion_control;
/**
* The priority of messages from this publisher.
*/
enum z_priority_t priority;
/**
* If set to ``true``, this message will not be batched. This usually has a positive impact on latency but negative impact on throughput.
*/
bool is_express;
#if defined(Z_FEATURE_UNSTABLE_API)
/**
* @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
*
* The publisher reliability.
*/
enum z_reliability_t reliability;
#endif
#if defined(Z_FEATURE_UNSTABLE_API)
/**
* @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
*
* The allowed destination for this publisher.
*/
enum zc_locality_t allowed_destination;
#endif
} z_publisher_options_t;
/**
* The replies consolidation strategy to apply on replies to a `z_get()`.
*/
typedef struct z_query_consolidation_t {
enum z_consolidation_mode_t mode;
} z_query_consolidation_t;
/**
* @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
* @brief Options passed to the `z_declare_querier()` function.
*/
#if defined(Z_FEATURE_UNSTABLE_API)
typedef struct z_querier_options_t {
/**
* The Queryables that should be target of the querier queries.
*/
enum z_query_target_t target;
/**
* The replies consolidation strategy to apply on replies to the querier queries.
*/
struct z_query_consolidation_t consolidation;
/**
* The congestion control to apply when routing the querier queries.
*/
enum z_congestion_control_t congestion_control;
/**
* If set to ``true``, the querier queries will not be batched. This usually has a positive impact on latency but negative impact on throughput.
*/
bool is_express;
#if defined(Z_FEATURE_UNSTABLE_API)
/**
* @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
*
* The allowed destination for the querier queries.
*/
enum zc_locality_t allowed_destination;
#endif
#if defined(Z_FEATURE_UNSTABLE_API)
/**
* @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
*
* The accepted replies for the querier queries.
*/
enum zc_reply_keyexpr_t accept_replies;
#endif
/**
* The priority of the querier queries.
*/
enum z_priority_t priority;
/**
* The timeout for the querier queries in milliseconds. 0 means default query timeout from zenoh configuration.
*/
uint64_t timeout_ms;
} z_querier_options_t;
#endif
/**
* Options passed to the `z_delete()` function.
*/
typedef struct z_delete_options_t {
/**
* The congestion control to apply when routing this delete message.
*/
enum z_congestion_control_t congestion_control;
/**
* The priority of the delete message.
*/
enum z_priority_t priority;
/**
* If set to ``true``, this message will not be batched. This usually has a positive impact on latency but negative impact on throughput.
*/
bool is_express;
/**
* The timestamp of this message.
*/
struct z_timestamp_t *timestamp;
#if defined(Z_FEATURE_UNSTABLE_API)
/**
* @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
*
* The delete operation reliability.
*/
enum z_reliability_t reliability;
#endif
#if defined(Z_FEATURE_UNSTABLE_API)
/**
* @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
*
* The allowed destination of this message.
*/
enum zc_locality_t allowed_destination;
#endif
} z_delete_options_t;
typedef struct z_moved_fifo_handler_query_t {
struct z_owned_fifo_handler_query_t _this;
} z_moved_fifo_handler_query_t;
typedef struct z_moved_fifo_handler_reply_t {
struct z_owned_fifo_handler_reply_t _this;
} z_moved_fifo_handler_reply_t;
typedef struct z_moved_fifo_handler_sample_t {
struct z_owned_fifo_handler_sample_t _this;
} z_moved_fifo_handler_sample_t;
typedef struct z_moved_source_info_t {
struct z_owned_source_info_t _this;
} z_moved_source_info_t;
/**
* Options passed to the `z_get()` function.
*/
typedef struct z_get_options_t {
/**
* The Queryables that should be target of the query.
*/
enum z_query_target_t target;
/**
* The replies consolidation strategy to apply on replies to the query.
*/
struct z_query_consolidation_t consolidation;
/**
* An optional payload to attach to the query.
*/
struct z_moved_bytes_t *payload;
/**
* An optional encoding of the query payload and or attachment.
*/
struct z_moved_encoding_t *encoding;
/**
* The congestion control to apply when routing the query.
*/
enum z_congestion_control_t congestion_control;
/**
* If set to ``true``, this message will not be batched. This usually has a positive impact on latency but negative impact on throughput.
*/
bool is_express;
#if defined(Z_FEATURE_UNSTABLE_API)
/**
* @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
*
* The allowed destination for the query.
*/
enum zc_locality_t allowed_destination;
#endif
#if defined(Z_FEATURE_UNSTABLE_API)
/**
* @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
*
* The accepted replies for the query.
*/
enum zc_reply_keyexpr_t accept_replies;
#endif
/**
* The priority of the query.
*/
enum z_priority_t priority;
#if defined(Z_FEATURE_UNSTABLE_API)
/**
* @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
*
* The source info for the query.
*/
struct z_moved_source_info_t *source_info;
#endif
/**
* An optional attachment to attach to the query.
*/
struct z_moved_bytes_t *attachment;
/**
* The timeout for the query in milliseconds. 0 means default query timeout from zenoh configuration.
*/
uint64_t timeout_ms;
} z_get_options_t;
typedef struct z_moved_hello_t {
struct z_owned_hello_t _this;
} z_moved_hello_t;
typedef struct z_moved_keyexpr_t {
struct z_owned_keyexpr_t _this;
} z_moved_keyexpr_t;
/**
* @brief The options for `z_liveliness_declare_subscriber()`
*/
typedef struct z_liveliness_subscriber_options_t {
/**
* If true, subscriber will receive the state change notifications for liveliness tokens that were declared before its declaration.
*/
bool history;
} z_liveliness_subscriber_options_t;
/**
* @brief The options for `z_liveliness_declare_token()`.
*/
typedef struct z_liveliness_token_options_t {
uint8_t _dummy;
} z_liveliness_token_options_t;
/**
* @brief The options for `z_liveliness_get()`
*/
typedef struct z_liveliness_get_options_t {
/**
* The timeout for the liveliness query in milliseconds. 0 means default query timeout from zenoh configuration.
*/
uint32_t timeout_ms;
} z_liveliness_get_options_t;
typedef struct z_moved_liveliness_token_t {
struct z_owned_liveliness_token_t _this;
} z_moved_liveliness_token_t;
typedef struct z_moved_memory_layout_t {
struct z_owned_memory_layout_t _this;
} z_moved_memory_layout_t;
typedef struct z_moved_mutex_t {
struct z_owned_mutex_t _this;
} z_moved_mutex_t;
/**
* Options passed to the `z_open()` function.
*/
typedef struct z_open_options_t {
uint8_t _dummy;
} z_open_options_t;
/**
* Represents the set of options that can be applied to the delete operation by a previously declared publisher,
* whenever issued via `z_publisher_delete()`.
*/
typedef struct z_publisher_delete_options_t {
/**
* The timestamp of this message.
*/
const struct z_timestamp_t *timestamp;
} z_publisher_delete_options_t;
typedef struct z_moved_publisher_t {
struct z_owned_publisher_t _this;
} z_moved_publisher_t;
/**
* Options passed to the `z_publisher_put()` function.
*/
typedef struct z_publisher_put_options_t {
/**
* The encoding of the data to publish.
*/
struct z_moved_encoding_t *encoding;
/**
* The timestamp of the publication.
*/
const struct z_timestamp_t *timestamp;
#if defined(Z_FEATURE_UNSTABLE_API)
/**
* @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
*
* The source info for the publication.
*/
struct z_moved_source_info_t *source_info;
#endif
/**
* The attachment to attach to the publication.
*/
struct z_moved_bytes_t *attachment;
} z_publisher_put_options_t;
/**
* Options passed to the `z_put()` function.
*/
typedef struct z_put_options_t {
/**
* The encoding of the message.
*/
struct z_moved_encoding_t *encoding;
/**
* The congestion control to apply when routing this message.
*/
enum z_congestion_control_t congestion_control;
/**
* The priority of this message.
*/
enum z_priority_t priority;
/**
* If set to ``true``, this message will not be batched. This usually has a positive impact on latency but negative impact on throughput.
*/
bool is_express;
/**
* The timestamp of this message.
*/
struct z_timestamp_t *timestamp;
#if defined(Z_FEATURE_UNSTABLE_API)
/**
* @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
*
* The put operation reliability.
*/
enum z_reliability_t reliability;
#endif
#if defined(Z_FEATURE_UNSTABLE_API)
/**
* @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
*
* The allowed destination of this message.
*/
enum zc_locality_t allowed_destination;
#endif
#if defined(Z_FEATURE_UNSTABLE_API)
/**
* @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
*
* The source info for the message.
*/
struct z_moved_source_info_t *source_info;
#endif
/**
* The attachment to this message.
*/
struct z_moved_bytes_t *attachment;
} z_put_options_t;
typedef struct z_moved_querier_t {
struct z_owned_querier_t _this;
} z_moved_querier_t;
/**
* @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
* @brief Options passed to the `z_querier_get()` function.
*/
#if defined(Z_FEATURE_UNSTABLE_API)
typedef struct z_querier_get_options_t {
/**
* An optional payload to attach to the query.
*/
struct z_moved_bytes_t *payload;
/**
* An optional encoding of the query payload and or attachment.
*/
struct z_moved_encoding_t *encoding;
#if defined(Z_FEATURE_UNSTABLE_API)
/**
* @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
*
* The source info for the query.
*/
struct z_moved_source_info_t *source_info;
#endif
/**
* An optional attachment to attach to the query.
*/
struct z_moved_bytes_t *attachment;
} z_querier_get_options_t;
#endif
typedef struct z_moved_query_t {
struct z_owned_query_t _this;
} z_moved_query_t;
/**
* Represents the set of options that can be applied to a query reply,
* sent via `z_query_reply()`.
*/
typedef struct z_query_reply_options_t {
/**
* The encoding of the reply payload.
*/
struct z_moved_encoding_t *encoding;
/**
* The congestion control to apply when routing the reply.
*/
enum z_congestion_control_t congestion_control;
/**
* The priority of the reply.
*/
enum z_priority_t priority;
/**
* If set to ``true``, this reply will not be batched. This usually has a positive impact on latency but negative impact on throughput.
*/
bool is_express;
/**
* The timestamp of the reply.
*/
struct z_timestamp_t *timestamp;
#if defined(Z_FEATURE_UNSTABLE_API)
/**
* @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
*
* The source info for the reply.
*/
struct z_moved_source_info_t *source_info;
#endif
/**
* The attachment to this reply.
*/
struct z_moved_bytes_t *attachment;
} z_query_reply_options_t;
/**
* Represents the set of options that can be applied to a query delete reply,
* sent via `z_query_reply_del()`.
*/
typedef struct z_query_reply_del_options_t {
/**
* The congestion control to apply when routing the reply.
*/
enum z_congestion_control_t congestion_control;
/**
* The priority of the reply.
*/
enum z_priority_t priority;
/**
* If set to ``true``, this reply will not be batched. This usually has a positive impact on latency but negative impact on throughput.
*/
bool is_express;
/**
* The timestamp of the reply.
*/
struct z_timestamp_t *timestamp;
#if defined(Z_FEATURE_UNSTABLE_API)
/**
* @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
*
* The source info for the reply.
*/
struct z_moved_source_info_t *source_info;
#endif
/**
* The attachment to this reply.
*/
struct z_moved_bytes_t *attachment;
} z_query_reply_del_options_t;
/**
* Represents the set of options that can be applied to a query reply error,
* sent via `z_query_reply_err()`.
*/
typedef struct z_query_reply_err_options_t {
/**
* The encoding of the error payload.
*/
struct z_moved_encoding_t *encoding;
} z_query_reply_err_options_t;
typedef struct z_moved_queryable_t {
struct z_owned_queryable_t _this;
} z_moved_queryable_t;
typedef struct z_moved_reply_t {
struct z_owned_reply_t _this;
} z_moved_reply_t;
typedef struct z_moved_reply_err_t {
struct z_owned_reply_err_t _this;
} z_moved_reply_err_t;
typedef struct z_moved_ring_handler_query_t {
struct z_owned_ring_handler_query_t _this;
} z_moved_ring_handler_query_t;
typedef struct z_moved_ring_handler_reply_t {
struct z_owned_ring_handler_reply_t _this;
} z_moved_ring_handler_reply_t;
typedef struct z_moved_ring_handler_sample_t {
struct z_owned_ring_handler_sample_t _this;
} z_moved_ring_handler_sample_t;
typedef struct z_moved_sample_t {
struct z_owned_sample_t _this;
} z_moved_sample_t;
/**
* Options to pass to `z_scout()`.
*/
typedef struct z_scout_options_t {
/**
* The maximum duration in ms the scouting can take.
*/
uint64_t timeout_ms;
/**
* Type of entities to scout for.
*/
enum z_what_t what;
} z_scout_options_t;
typedef struct z_moved_session_t {
struct z_owned_session_t _this;
} z_moved_session_t;
typedef struct z_moved_shm_client_t {
struct z_owned_shm_client_t _this;
} z_moved_shm_client_t;
typedef struct z_moved_shm_client_storage_t {
struct z_owned_shm_client_storage_t _this;
} z_moved_shm_client_storage_t;
typedef struct z_moved_shm_provider_t {
struct z_owned_shm_provider_t _this;
} z_moved_shm_provider_t;
/**
* @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
* @brief Unique protocol identifier.
* Here is a contract: it is up to user to make sure that incompatible ShmClient
* and ShmProviderBackend implementations will never use the same ProtocolID.
*/
#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API))
typedef uint32_t z_protocol_id_t;
#endif
typedef struct z_moved_string_array_t {
struct z_owned_string_array_t _this;
} z_moved_string_array_t;
typedef struct z_moved_subscriber_t {
struct z_owned_subscriber_t _this;
} z_moved_subscriber_t;
typedef struct z_moved_task_t {
struct z_owned_task_t _this;
} z_moved_task_t;
typedef struct z_task_attr_t {
size_t _0;
} z_task_attr_t;
/**
* Returns system clock time point corresponding to the current time instant.
*/
typedef struct z_time_t {
uint64_t t;
} z_time_t;
/**
* @brief A log-processing closure.
*
* A closure is a structure that contains all the elements for stateful, memory-leak-free callbacks.
*/
typedef struct zc_owned_closure_log_t {
void *_context;
void (*_call)(enum zc_log_severity_t severity, const struct z_loaned_string_t *msg, void *context);
void (*_drop)(void *context);
} zc_owned_closure_log_t;
/**
* Moved closure.
*/
typedef struct zc_moved_closure_log_t {
struct zc_owned_closure_log_t _this;
} zc_moved_closure_log_t;
/**
* @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
* @brief A struct that indicates if there exist Subscribers matching the Publisher's key expression or Queryables matching Querier's key expression and target.
*/
#if defined(Z_FEATURE_UNSTABLE_API)
typedef struct zc_matching_status_t {
/**
* True if there exist matching Zenoh entities, false otherwise.
*/
bool matching;
} zc_matching_status_t;
#endif
/**
* @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
* @brief A matching status-processing closure.
*
* A closure is a structure that contains all the elements for stateful, memory-leak-free callbacks.
*/
#if defined(Z_FEATURE_UNSTABLE_API)
typedef struct zc_owned_closure_matching_status_t {
void *_context;
void (*_call)(const struct zc_matching_status_t *matching_status, void *context);
void (*_drop)(void *context);
} zc_owned_closure_matching_status_t;
#endif
/**
* @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
* @brief Moved closure.
*/
#if defined(Z_FEATURE_UNSTABLE_API)
typedef struct zc_moved_closure_matching_status_t {
struct zc_owned_closure_matching_status_t _this;
} zc_moved_closure_matching_status_t;
#endif
typedef struct zc_moved_concurrent_close_handle_t {
struct zc_owned_concurrent_close_handle_t _this;
} zc_moved_concurrent_close_handle_t;
typedef struct zc_moved_matching_listener_t {
struct zc_owned_matching_listener_t _this;