static ossl_inline void packet_forward(PACKET *pkt, size_t len)
{
    pkt->curr += len;
    pkt->remaining -= len;
}
['static int test_PACKET_get_net_4()\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_4(&pkt, &i))\n            || !TEST_ulong_eq(i, 0x02040608UL)\n            || !TEST_true(PACKET_forward(&pkt, BUF_LEN - 8))\n            || !TEST_true(PACKET_get_net_4(&pkt, &i))\n            || !TEST_ulong_eq(i, 0xf8fafcfeUL)\n            || !TEST_false(PACKET_get_net_4(&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_4(PACKET *pkt, unsigned long *data)\n{\n    if (!PACKET_peek_net_4(pkt, data))\n        return 0;\n    packet_forward(pkt, 4);\n    return 1;\n}', 'static ossl_inline int PACKET_peek_net_4(const PACKET *pkt,\n                                                unsigned long *data)\n{\n    if (PACKET_remaining(pkt) < 4)\n        return 0;\n    *data = ((unsigned long)(*pkt->curr)) << 24;\n    *data |= ((unsigned long)(*(pkt->curr + 1))) << 16;\n    *data |= ((unsigned long)(*(pkt->curr + 2))) << 8;\n    *data |= *(pkt->curr + 3);\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}']