2929
3030#include "eid.h"
3131
32+ #include <m-algo.h>
3233#include <m-deque.h>
3334#include <m-bptree.h>
3435
@@ -68,17 +69,28 @@ typedef struct
6869 */
6970typedef struct
7071{
72+ /// Block type code
7173 uint64_t blk_type ;
74+ /// Unique block number, with 0 reserved and 1 for payload
7275 uint64_t blk_num ;
76+ /// Block processing control flags
7377 uint64_t flags ;
78+ /// CRC type code
7479 uint64_t crc_type ;
7580
76- /// Pointer to memory managed by the BPA
81+ /// Pointer to memory managed by the BPA outside this struct
7782 void * btsd ;
7883 /// Known length of the #btsd
7984 size_t btsd_len ;
8085} MockBPA_CanonicalBlock_t ;
8186
87+ /** Block comparison which will order by block number in descending order.
88+ */
89+ int MockBPA_CanonicalBlock_cmp (const MockBPA_CanonicalBlock_t * block_a , const MockBPA_CanonicalBlock_t * block_b );
90+
91+ /// M*LIB OPLIST for ::MockBPA_CanonicalBlock_t
92+ #define M_OPL_MockBPA_CanonicalBlock_t () M_OPEXTEND(M_POD_OPLIST, CMP(API_6(MockBPA_CanonicalBlock_cmp)))
93+
8294/** @struct MockBPA_BlockList_t
8395 * An ordered list of ::MockBPA_CanonicalBlock_t storage
8496 * with fast size access.
@@ -89,15 +101,20 @@ typedef struct
89101 */
90102/// @cond Doxygen_Suppress
91103// GCOV_EXCL_START
92- M_DEQUE_DEF (MockBPA_BlockList , MockBPA_CanonicalBlock_t , M_POD_OPLIST )
104+ M_DEQUE_DEF (MockBPA_BlockList , MockBPA_CanonicalBlock_t , M_OPL_MockBPA_CanonicalBlock_t ())
105+ M_ALGO_DEF (MockBPA_BlockList , M_DEQUE_OPLIST (MockBPA_BlockList , M_OPL_MockBPA_CanonicalBlock_t ()))
93106M_BPTREE_DEF2 (MockBPA_BlockByNum , 4 , uint64_t , M_BASIC_OPLIST , MockBPA_CanonicalBlock_t * , M_PTR_OPLIST )
94107// GCOV_EXCL_STOP
95108/// @endcond
96109
97110typedef struct MockBPA_Bundle_s
98111{
99- uint64_t id ;
100- bool retain ;
112+ /** Explicit retention constraint.
113+ * When true, indicates to retain this bundle after forwarding or delivery.
114+ * This defaults to true.
115+ */
116+ bool retain ;
117+ /// Primary block contents
101118 MockBPA_PrimaryBlock_t primary_block ;
102119
103120 /// Storage for blocks in this bundle
0 commit comments