static ossl_inline void packet_forward(PACKET *pkt, size_t len)
{
    pkt->curr += len;
    pkt->remaining -= len;
}
['static int test_PACKET_forward()\n{\n    const unsigned char *byte;\n    PACKET pkt;\n    if (!TEST_true(PACKET_buf_init(&pkt, smbuf, BUF_LEN))\n            || !TEST_true(PACKET_forward(&pkt, 1))\n            || !TEST_true(PACKET_get_bytes(&pkt, &byte, 1))\n            || !TEST_uchar_eq(byte[0], 4)\n            || !TEST_true(PACKET_forward(&pkt, BUF_LEN - 3))\n            || !TEST_true(PACKET_get_bytes(&pkt, &byte, 1))\n            || !TEST_uchar_eq(byte[0], 0xfe))\n        return 0;\n    return 1;\n}', 'static ossl_inline int PACKET_buf_init(PACKET *pkt,\n                                              const unsigned char *buf,\n                                              size_t len)\n{\n    if (len > (size_t)(SIZE_MAX / 2))\n        return 0;\n    pkt->curr = buf;\n    pkt->remaining = len;\n    return 1;\n}', 'static ossl_inline int PACKET_forward(PACKET *pkt, size_t len)\n{\n    if (PACKET_remaining(pkt) < len)\n        return 0;\n    packet_forward(pkt, len);\n    return 1;\n}', 'static ossl_inline int PACKET_get_bytes(PACKET *pkt,\n                                               const unsigned char **data,\n                                               size_t len)\n{\n    if (!PACKET_peek_bytes(pkt, data, len))\n        return 0;\n    packet_forward(pkt, len);\n    return 1;\n}', 'static ossl_inline int PACKET_peek_bytes(const PACKET *pkt,\n                                                const unsigned char **data,\n                                                size_t len)\n{\n    if (PACKET_remaining(pkt) < len)\n        return 0;\n    *data = pkt->curr;\n    return 1;\n}', 'static ossl_inline void packet_forward(PACKET *pkt, size_t len)\n{\n    pkt->curr += len;\n    pkt->remaining -= len;\n}']