Use ssize_t for record sizes.
Add code to recalculate receive window size.
Use English language logic operators.
static_assert() for max_attachments invariant.
Cleanup in rx_attach_packet() handler.