Loading...
Searching...
No Matches
Priority packet queue for GNRC

Wrapper for priority_queue that holds gnrc_pktsnip_t*. More...

Detailed Description

Wrapper for priority_queue that holds gnrc_pktsnip_t*.

Files

file  priority_pktqueue.h
 gnrc priority packet queue API
 

Data Structures

struct  gnrc_priority_pktqueue_node
 data type for gnrc priority packet queue nodes More...
 

Macros

#define PRIORITY_PKTQUEUE_NODE_INIT(priority, pkt)   { NULL, priority, pkt }
 Static initializer for gnrc_priority_pktqueue_node_t.
 
#define PRIORITY_PKTQUEUE_INIT   { NULL }
 Static initializer for gnrc_priority_pktqueue_t.
 

Typedefs

typedef struct gnrc_priority_pktqueue_node gnrc_priority_pktqueue_node_t
 data type for gnrc priority packet queue nodes
 
typedef priority_queue_t gnrc_priority_pktqueue_t
 data type for gnrc priority packet queues
 

Functions

static void gnrc_priority_pktqueue_node_init (gnrc_priority_pktqueue_node_t *node, uint32_t priority, gnrc_pktsnip_t *pkt)
 Initialize a gnrc priority packet queue node object.
 
static void gnrc_priority_pktqueue_init (gnrc_priority_pktqueue_t *queue)
 Initialize a gnrc priority packet queue object.
 
uint32_t gnrc_priority_pktqueue_length (gnrc_priority_pktqueue_t *queue)
 Get the length information of a gnrc priority packet queue object.
 
void gnrc_priority_pktqueue_flush (gnrc_priority_pktqueue_t *queue)
 flush the gnrc priority packet queue
 
gnrc_pktsnip_tgnrc_priority_pktqueue_pop (gnrc_priority_pktqueue_t *queue)
 Get first element and remove it from queue.
 
gnrc_pktsnip_tgnrc_priority_pktqueue_head (gnrc_priority_pktqueue_t *queue)
 Get first element from queue without removing.
 
void gnrc_priority_pktqueue_push (gnrc_priority_pktqueue_t *queue, gnrc_priority_pktqueue_node_t *node)
 add node into queue based on its priority
 

Macro Definition Documentation

◆ PRIORITY_PKTQUEUE_INIT

#define PRIORITY_PKTQUEUE_INIT   { NULL }

Static initializer for gnrc_priority_pktqueue_t.

Definition at line 57 of file priority_pktqueue.h.

◆ PRIORITY_PKTQUEUE_NODE_INIT

#define PRIORITY_PKTQUEUE_NODE_INIT (   priority,
  pkt 
)    { NULL, priority, pkt }

Static initializer for gnrc_priority_pktqueue_node_t.

Definition at line 52 of file priority_pktqueue.h.

Typedef Documentation

◆ gnrc_priority_pktqueue_t

data type for gnrc priority packet queues

Definition at line 47 of file priority_pktqueue.h.

Function Documentation

◆ gnrc_priority_pktqueue_flush()

void gnrc_priority_pktqueue_flush ( gnrc_priority_pktqueue_t queue)

flush the gnrc priority packet queue

Parameters
[out]queuethe gnrc priority packet queue. Must not be NULL

◆ gnrc_priority_pktqueue_head()

gnrc_pktsnip_t * gnrc_priority_pktqueue_head ( gnrc_priority_pktqueue_t queue)

Get first element from queue without removing.

Parameters
[in]queuethe gnrc priority packet queue. Must not be NULL
Returns
the head of queue

◆ gnrc_priority_pktqueue_init()

static void gnrc_priority_pktqueue_init ( gnrc_priority_pktqueue_t queue)
inlinestatic

Initialize a gnrc priority packet queue object.

Parameters
[out]queuepre-allocated gnrc_priority_pktqueue_t object. Must not be NULL.

Definition at line 84 of file priority_pktqueue.h.

◆ gnrc_priority_pktqueue_length()

uint32_t gnrc_priority_pktqueue_length ( gnrc_priority_pktqueue_t queue)

Get the length information of a gnrc priority packet queue object.

Parameters
[in]queuepre-allocated gnrc_priority_pktqueue_t object. Must not be NULL.
Returns
the length of queue

◆ gnrc_priority_pktqueue_node_init()

static void gnrc_priority_pktqueue_node_init ( gnrc_priority_pktqueue_node_t node,
uint32_t  priority,
gnrc_pktsnip_t pkt 
)
inlinestatic

Initialize a gnrc priority packet queue node object.

Parameters
[out]nodepre-allocated gnrc_priority_pktqueue_node_t object. Must not be NULL.
[in]prioritythe priority of the gnrc packet snip
[in]pktthe gnrc packet snip

Definition at line 69 of file priority_pktqueue.h.

◆ gnrc_priority_pktqueue_pop()

gnrc_pktsnip_t * gnrc_priority_pktqueue_pop ( gnrc_priority_pktqueue_t queue)

Get first element and remove it from queue.

Parameters
[out]queuethe gnrc priority packet queue. Must not be NULL
Returns
the old head

◆ gnrc_priority_pktqueue_push()

void gnrc_priority_pktqueue_push ( gnrc_priority_pktqueue_t queue,
gnrc_priority_pktqueue_node_t node 
)

add node into queue based on its priority

Parameters
[in,out]queuethe gnrc priority packet queue. Must not be NULL
[in]nodethe node to add.