riot_sys

Function gnrc_pktbuf_realloc_data

Source
pub unsafe extern "C" fn gnrc_pktbuf_realloc_data(
    pkt: *mut gnrc_pktsnip_t,
    size: size_t,
) -> c_int
Expand description

@brief Reallocates gnrc_pktsnip_t::data of @p pkt in the packet buffer, without changing the content.

@pre pkt != NULL @pre (pkt->size > 0) <=> (pkt->data != NULL) @pre gnrc_pktsnip_t::data of @p pkt is in the packet buffer if it is not NULL.

@details If enough memory is available behind it or @p size is smaller than the original size of the packet then gnrc_pktsnip_t::data of @p pkt will not be moved. Otherwise, it will be moved. If no space is available nothing happens.

@param[in] pkt A packet part. @param[in] size The size for @p pkt.

@return 0, on success @return ENOMEM, if no space is left in the packet buffer.