Promiscuous packet queue

File: csp/csp_promisc.h

Description: Promiscuous packet queue. This feature is used to enable promiscuous mode for incoming packets, e.g. router, bridge. If enabled, a copy of all incoming packets are cloned (using csp_buffer_clone()) and placed in a FIFO queue, that can be read using csp_promisc_read().

Interface Functions

int csp_promisc_enable(unsigned int queue_size)
[source]

Enable promiscuous packet queue.

Parameters:
  • queue_size: – Size (max length) of queue for incoming packets.

Returns:

#CSP_ERR_NONE on success, otherwise an error code.

void csp_promisc_disable(void)
[source]

Disable promiscuous mode.

csp_packet_t *csp_promisc_read(uint32_t timeout)
[source]

Get/dequeue packet from promiscuous packet queue.

Returns the first packet from the promiscuous packet queue.

Parameters:
  • timeout – Timeout in ms to wait for a packet.

Returns:

Packet (free with csp_buffer_free() or re-use packet), NULL on error or timeout.