MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / queue_hdr_get

Function queue_hdr_get

bdb/queue.c:87–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85*/
86
87const uint8_t *queue_hdr_get(struct bdb_queue_header *p_queue_hdr,
88 const uint8_t *p_buf, const uint8_t *p_buf_end)
89{
90 if (p_buf_end < p_buf || QUEUE_HDR_LEN > (p_buf_end - p_buf))
91 return NULL;
92
93 p_buf = buf_get(&(p_queue_hdr->fragment_no),
94 sizeof(p_queue_hdr->fragment_no), p_buf, p_buf_end);
95 p_buf = buf_get(&(p_queue_hdr->num_fragments),
96 sizeof(p_queue_hdr->num_fragments), p_buf, p_buf_end);
97 p_buf = buf_get(&(p_queue_hdr->genid[0]), sizeof(p_queue_hdr->genid[0]),
98 p_buf, p_buf_end);
99 p_buf = buf_get(&(p_queue_hdr->genid[1]), sizeof(p_queue_hdr->genid[1]),
100 p_buf, p_buf_end);
101 p_buf = buf_get(&(p_queue_hdr->total_sz), sizeof(p_queue_hdr->total_sz),
102 p_buf, p_buf_end);
103 p_buf = buf_get(&(p_queue_hdr->fragment_sz),
104 sizeof(p_queue_hdr->fragment_sz), p_buf, p_buf_end);
105 p_buf =
106 buf_no_net_get(&(p_queue_hdr->consumer_mask),
107 sizeof(p_queue_hdr->consumer_mask), p_buf, p_buf_end);
108 p_buf = buf_get(&(p_queue_hdr->crc32), sizeof(p_queue_hdr->crc32), p_buf,
109 p_buf_end);
110 p_buf = buf_get(&(p_queue_hdr->reserved), sizeof(p_queue_hdr->reserved),
111 p_buf, p_buf_end);
112
113 return p_buf;
114}
115
116uint8_t *queue_hdr_put(const struct bdb_queue_header *p_queue_hdr,
117 uint8_t *p_buf, const uint8_t *p_buf_end)

Callers 6

bdb_queue_walk_intFunction · 0.85
bdb_queue_dump_intFunction · 0.85
bdb_queue_get_intFunction · 0.85
bdb_queue_consume_intFunction · 0.85

Calls 2

buf_getFunction · 0.85
buf_no_net_getFunction · 0.85

Tested by

no test coverage detected