1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

gnrc_pktbuf: drop gnrc_pktbuf_replace_snip()

The function was deprecated in e94aa40bf5
and is unused and untested in the current code base.
This commit is contained in:
Martine Lenders 2020-10-29 17:20:12 +01:00
parent 9e4dd8e451
commit 72821a502f
No known key found for this signature in database
GPG Key ID: CCD317364F63286F
2 changed files with 0 additions and 42 deletions

View File

@ -206,23 +206,6 @@ gnrc_pktsnip_t *gnrc_pktbuf_start_write(gnrc_pktsnip_t *pkt);
*/
gnrc_pktsnip_t *gnrc_pktbuf_remove_snip(gnrc_pktsnip_t *pkt, gnrc_pktsnip_t *snip);
/**
* @brief Replace a snip from a packet and the packet buffer by another snip.
*
* @deprecated Function is not used by anyone (not even tested, see
* https://github.com/RIOT-OS/RIOT/issues/5089). Will be removed
* after 2020.10 release.
*
* @param[in] pkt A packet
* @param[in] old snip currently in the packet
* @param[in] add snip which will replace old
*
* @return The new reference to @p pkt
*/
gnrc_pktsnip_t *gnrc_pktbuf_replace_snip(gnrc_pktsnip_t *pkt,
gnrc_pktsnip_t *old,
gnrc_pktsnip_t *add);
/**
* @brief Reverses snip order of a packet in a write-protected manner.
*

View File

@ -25,31 +25,6 @@ gnrc_pktsnip_t *gnrc_pktbuf_remove_snip(gnrc_pktsnip_t *pkt,
return pkt;
}
gnrc_pktsnip_t *gnrc_pktbuf_replace_snip(gnrc_pktsnip_t *pkt,
gnrc_pktsnip_t *old,
gnrc_pktsnip_t *add)
{
/* If add is a list we need to preserve its tail */
if (add->next != NULL) {
gnrc_pktsnip_t *tail = add->next;
/* find the last snip in tail */
gnrc_pktsnip_t *back = gnrc_pkt_prev_snip(tail, NULL);
/* Replace old */
LL_REPLACE_ELEM(pkt, old, add);
/* and wire in the tail between */
back->next = add->next;
add->next = tail;
}
else {
/* add is a single element, has no tail, simply replace */
LL_REPLACE_ELEM(pkt, old, add);
}
old->next = NULL;
gnrc_pktbuf_release(old);
return pkt;
}
gnrc_pktsnip_t *gnrc_pktbuf_reverse_snips(gnrc_pktsnip_t *pkt)
{
gnrc_pktsnip_t *reversed = NULL, *ptr = pkt;