LCOV - code coverage report
Current view: top level - disco/shred - fd_shred_cap.h (source / functions) Hit Total Coverage
Test: cov.lcov Lines: 0 2 0.0 %
Date: 2024-11-13 11:58:15 Functions: 0 0 -

          Line data    Source code
       1             : #ifndef HEADER_fd_src_disco_shred_fd_shredcap_h
       2             : #define HEADER_fd_src_disco_shred_fd_shredcap_h
       3             : 
       4             : #include "../../util/fd_util_base.h"
       5             : #include "../../disco/store/fd_store.h"
       6             : #include "../../ballet/shred/fd_shred.h"
       7             : 
       8           0 : #define FD_SHRED_CAP_OK    0
       9           0 : #define FD_SHRED_CAP_ERR   -1
      10             : 
      11             : // TODO: Could we add a ushort magic number here?  Could we also add a ushort sizeof(fd_shred_cap_hdr) here as well?
      12             : //       this will let us add things into the header without invalidating all previous packet captures
      13             : #define FD_SHRED_CAP_MAGIC 0xFDCB
      14             : struct __attribute__((packed)) fd_shred_cap_file_hdr {
      15             :   ushort magic;
      16             :   ushort shred_cap_hdr_sz;
      17             : };
      18             : typedef struct fd_shred_cap_file_hdr fd_shred_cap_file_hdr_t;
      19             : 
      20             : struct __attribute__((packed)) fd_shred_cap_hdr {
      21             :   ulong sz;
      22             :   uchar flags;
      23             : };
      24             : typedef struct fd_shred_cap_hdr fd_shred_cap_hdr_t;
      25             : 
      26             : struct fd_shred_cap_ctx {
      27             :   int   is_archive;
      28             :   int   shred_cap_fileno;
      29             :   ulong stable_slot_end;
      30             :   ulong stable_slot_start;
      31             : };
      32             : typedef struct fd_shred_cap_ctx fd_shred_cap_ctx_t;
      33             : 
      34             : #define FD_SHRED_CAP_FLAG_MARK_TURBINE(x) fd_uchar_set_bit(x, 1)      /* xxxxxxx1 */
      35             : #define FD_SHRED_CAP_FLAG_MARK_REPAIR(x)  fd_uchar_clear_bit(x, 1)    /* xxxxxxx0 */
      36             : 
      37             : #define FD_SHRED_CAP_FLAG_IS_TURBINE(x)   fd_uchar_extract_bit(x, 1)  /* xxxxxxx1 */
      38             : #define FD_SHRED_CAP_FLAG_IS_REPAIR(x)    !fd_uchar_extract_bit(x, 1) /* xxxxxxx0 */
      39             : 
      40             : // TODO: Lets properly document these on documentation day
      41             : 
      42             : int
      43             : fd_shred_cap_archive( fd_shred_cap_ctx_t * ctx,
      44             :                       fd_shred_t const *   shred,
      45             :                       uchar                flags);
      46             : int
      47             : fd_shred_cap_replay( const char *      shred_cap_fpath,
      48             :                      fd_store_t *      store );
      49             : #endif

Generated by: LCOV version 1.14