Annotate acked pkt_num
@@ -215,22 +215,36 @@ void print_frame(ngtcp2_dir dir, const ngtcp2_frame *fr) {
print_indent();
fprintf(outfile, "length=%zu\n", fr->padding.len);
break;
- case NGTCP2_FRAME_ACK:
+ case NGTCP2_FRAME_ACK: {
print_indent();
fprintf(outfile,
"num_blks=%zu num_ts=%zu largest_ack=%" PRIu64 " ack_delay=%u\n",
fr->ack.num_blks, fr->ack.num_ts, fr->ack.largest_ack,
fr->ack.ack_delay);
print_indent();
- fprintf(outfile, "first_ack_block_length=%" PRIu64 "\n",
- fr->ack.first_ack_blklen);
+ auto largest_ack = fr->ack.largest_ack;
+ auto min_ack = fr->ack.largest_ack - fr->ack.first_ack_blklen;
+ fprintf(outfile,
+ "first_ack_block_length=%" PRIu64 "; [%" PRIu64 "..%" PRIu64 "]\n",
+ fr->ack.first_ack_blklen, largest_ack, min_ack);
for (size_t i = 0; i < fr->ack.num_blks; ++i) {
auto blk = &fr->ack.blks[i];
+ largest_ack -= (uint64_t)blk->gap + 1;
+ if (blk->blklen == 0) {
print_indent();
fprintf(outfile, "gap=%u ack_block_length=%" PRIu64 "\n", blk->gap,
blk->blklen);
+ continue;
+ }
+ min_ack = largest_ack - (blk->blklen - 1);
+ print_indent();
+ fprintf(outfile, "gap=%u ack_block_length=%" PRIu64 "; [%" PRIu64
+ "..%" PRIu64 "]\n",
+ blk->gap, blk->blklen, largest_ack, min_ack);
+ largest_ack = min_ack;
}
break;
+ }
case NGTCP2_FRAME_RST_STREAM:
print_indent();
fprintf(outfile,
