`libnetdude` Manual
Prev |  | Next

# libnd_packet_recycler

## Name

libnd_packet_recycler --

## Synopsis

    void        libnd_prec_init                 ();
    gboolean    libnd_prec_put                  (LND_Packet *packet);
    LND_Packet* libnd_prec_get                  (guint mem_needed);

## Description

## Details

### libnd_prec_init ()

    void        libnd_prec_init                 ();

### libnd_prec_put ()

    gboolean    libnd_prec_put                  (LND_Packet *packet);

NOTE: DO NOT USE THIS FUNCTION. Use `libnd_packet_free()`. The function puts a packet into the recycler. It cleans it up, looking at the amount of payload it can hold, and makes it available when someone needs a packet that can hold up to an equal amount.

`packet` :

  packet to recycle.

Returns :

  TRUE when the packet is recycled, FALSE if the recycler is full. In that case the packet is unused and needs to be handled differently, for example fully released.

### libnd_prec_get ()

    LND_Packet* libnd_prec_get                  (guint mem_needed);

NOTE: DO NOT USE THIS FUNCTION. Use `libnd_packet_new()`. The function returns a recycled packet that is able to hold `mem_needed` bytes of payload.

`mem_needed` :

  amount of memory that new packet will need to carry.

Returns :

  unused packet.

Prev | Home | Next
libnd_packet_iterator | Up | libnd_plugin