static void iobuf_from_blk_data(struct iobuf *wbuf, struct blk *blk) { static char buf[CHECKSUM_LEN]; // FIX THIS: Check return of this - maybe should be done elsewhere. blk_md5_update(blk); // FIX THIS: consider endian-ness. memcpy(buf, &blk->fingerprint, FINGERPRINT_LEN); memcpy(buf+FINGERPRINT_LEN, blk->md5sum, MD5_DIGEST_LENGTH); iobuf_set(wbuf, CMD_SIG, buf, CHECKSUM_LEN); }
static int iobuf_from_blk_data(struct iobuf *wbuf, struct blk *blk) { if(blk_md5_update(blk)) return -1; blk_to_iobuf_sig(blk, wbuf); return 0; }