@@ -91,6 +91,16 @@ extern "C" {
91
91
// Z Extensions if Z==1 then Zenoh extensions are present
92
92
#define _Z_FLAG_T_CLOSE_S 0x20 // 1 << 5
93
93
94
+ /*=============================*/
95
+ /* Patch */
96
+ /*=============================*/
97
+ /// Used to negotiate the patch version of the protocol
98
+ /// if not present (or 0), then protocol as released with 1.0.0
99
+ /// if >= 1, then fragmentation start/stop marker
100
+ #define _Z_NO_PATCH 0x00
101
+ #define _Z_CURRENT_PATCH 0x01
102
+ #define _Z_PATCH_HAS_FRAGMENT_MARKERS (patch ) (patch >= 1)
103
+
94
104
/*=============================*/
95
105
/* Transport Messages */
96
106
/*=============================*/
@@ -235,6 +245,9 @@ typedef struct {
235
245
uint8_t _req_id_res ;
236
246
uint8_t _seq_num_res ;
237
247
uint8_t _version ;
248
+ #if Z_FEATURE_FRAGMENTATION == 1
249
+ uint8_t _patch ;
250
+ #endif
238
251
} _z_t_msg_join_t ;
239
252
void _z_t_msg_join_clear (_z_t_msg_join_t * msg );
240
253
@@ -315,6 +328,9 @@ typedef struct {
315
328
uint8_t _req_id_res ;
316
329
uint8_t _seq_num_res ;
317
330
uint8_t _version ;
331
+ #if Z_FEATURE_FRAGMENTATION == 1
332
+ uint8_t _patch ;
333
+ #endif
318
334
} _z_t_msg_init_t ;
319
335
void _z_t_msg_init_clear (_z_t_msg_init_t * msg );
320
336
@@ -478,11 +494,11 @@ void _z_t_msg_frame_clear(_z_t_msg_frame_t *msg);
478
494
typedef struct {
479
495
_z_slice_t _payload ;
480
496
_z_zint_t _sn ;
497
+ bool first ;
498
+ bool drop ;
481
499
} _z_t_msg_fragment_t ;
482
500
void _z_t_msg_fragment_clear (_z_t_msg_fragment_t * msg );
483
501
484
- #define _Z_FRAGMENT_HEADER_SIZE 12
485
-
486
502
/*------------------ Transport Message ------------------*/
487
503
typedef union {
488
504
_z_t_msg_join_t _join ;
@@ -514,9 +530,10 @@ _z_transport_message_t _z_t_msg_make_keep_alive(void);
514
530
_z_transport_message_t _z_t_msg_make_frame (_z_zint_t sn , _z_network_message_vec_t messages ,
515
531
z_reliability_t reliability );
516
532
_z_transport_message_t _z_t_msg_make_frame_header (_z_zint_t sn , z_reliability_t reliability );
517
- _z_transport_message_t _z_t_msg_make_fragment_header (_z_zint_t sn , z_reliability_t reliability , bool is_last );
533
+ _z_transport_message_t _z_t_msg_make_fragment_header (_z_zint_t sn , z_reliability_t reliability , bool is_last ,
534
+ bool first , bool drop );
518
535
_z_transport_message_t _z_t_msg_make_fragment (_z_zint_t sn , _z_slice_t messages , z_reliability_t reliability ,
519
- bool is_last );
536
+ bool is_last , bool first , bool drop );
520
537
521
538
/*------------------ Copy ------------------*/
522
539
void _z_t_msg_copy (_z_transport_message_t * clone , _z_transport_message_t * msg );
0 commit comments