static ossl_inline void packet_forward(PACKET *pkt, size_t len)
{
    pkt->curr += len;
    pkt->remaining -= len;
}
['static int test_PACKET_get_net_3()\n{\n    unsigned long i;\n    PACKET pkt;\n    if (!TEST_true(PACKET_buf_init(&pkt, smbuf, BUF_LEN))\n            || !TEST_true(PACKET_get_net_3(&pkt, &i))\n            || !TEST_ulong_eq(i, 0x020406UL)\n            || !TEST_true(PACKET_forward(&pkt, BUF_LEN - 6))\n            || !TEST_true(PACKET_get_net_3(&pkt, &i))\n            || !TEST_ulong_eq(i, 0xfafcfeUL)\n            || !TEST_false(PACKET_get_net_3(&pkt, &i)))\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_get_net_3(PACKET *pkt, unsigned long *data)\n{\n    if (!PACKET_peek_net_3(pkt, data))\n        return 0;\n    packet_forward(pkt, 3);\n    return 1;\n}', 'static ossl_inline int PACKET_peek_net_3(const PACKET *pkt,\n                                                unsigned long *data)\n{\n    if (PACKET_remaining(pkt) < 3)\n        return 0;\n    *data = ((unsigned long)(*pkt->curr)) << 16;\n    *data |= ((unsigned long)(*(pkt->curr + 1))) << 8;\n    *data |= *(pkt->curr + 2);\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 void packet_forward(PACKET *pkt, size_t len)\n{\n    pkt->curr += len;\n    pkt->remaining -= len;\n}']