priority_pktqueue.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Daniel Krebs
3  * 2016 INRIA
4  *
5  * This file is subject to the terms and conditions of the GNU Lesser
6  * General Public License v2.1. See the file LICENSE in the top level
7  * directory for more details.
8  */
9 
23 #ifndef NET_GNRC_PRIORITY_PKTQUEUE_H
24 #define NET_GNRC_PRIORITY_PKTQUEUE_H
25 
26 #include <stdint.h>
27 
28 #include "priority_queue.h"
29 #include "net/gnrc/pkt.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
40  uint32_t priority;
43 
48 
52 #define PRIORITY_PKTQUEUE_NODE_INIT(priority, pkt) { NULL, priority, pkt }
53 
57 #define PRIORITY_PKTQUEUE_INIT { NULL }
58 
70  uint32_t priority,
72 {
73  node->next = NULL;
74  node->priority = priority;
75  node->pkt = pkt;
76 }
77 
85 {
87 
88  *queue = qn;
89 }
90 
99 
106 
115 
124 
133 
134 #ifdef __cplusplus
135 }
136 #endif
137 
138 #endif /* NET_GNRC_PRIORITY_PKTQUEUE_H */
139 
gnrc_priority_pktqueue_init
static void gnrc_priority_pktqueue_init(gnrc_priority_pktqueue_t *queue)
Initialize a gnrc priority packet queue object.
Definition: priority_pktqueue.h:84
PRIORITY_PKTQUEUE_INIT
#define PRIORITY_PKTQUEUE_INIT
Static initializer for gnrc_priority_pktqueue_t.
Definition: priority_pktqueue.h:57
gnrc_priority_pktqueue_flush
void gnrc_priority_pktqueue_flush(gnrc_priority_pktqueue_t *queue)
flush the gnrc priority packet queue
gnrc_priority_pktqueue_node::next
struct gnrc_priority_pktqueue_node * next
next queue node
Definition: priority_pktqueue.h:39
priority_queue.h
A simple priority queue.
gnrc_priority_pktqueue_node::pkt
gnrc_pktsnip_t * pkt
queue node data
Definition: priority_pktqueue.h:41
gnrc_priority_pktqueue_pop
gnrc_pktsnip_t * gnrc_priority_pktqueue_pop(gnrc_priority_pktqueue_t *queue)
Get first element and remove it from queue.
gnrc_priority_pktqueue_node_t
struct gnrc_priority_pktqueue_node gnrc_priority_pktqueue_node_t
data type for gnrc priority packet queue nodes
pkt.h
General definitions for network packets and their helper functions.
gnrc_priority_pktqueue_head
gnrc_pktsnip_t * gnrc_priority_pktqueue_head(gnrc_priority_pktqueue_t *queue)
Get first element from queue without removing.
gnrc_priority_pktqueue_node::priority
uint32_t priority
queue node priority
Definition: priority_pktqueue.h:40
priority_queue_t
data type for priority queues
Definition: priority_queue.h:41
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)
Initialize a gnrc priority packet queue node object.
Definition: priority_pktqueue.h:69
gnrc_priority_pktqueue_t
priority_queue_t gnrc_priority_pktqueue_t
data type for gnrc priority packet queues
Definition: priority_pktqueue.h:47
gnrc_priority_pktqueue_node
data type for gnrc priority packet queue nodes
Definition: priority_pktqueue.h:38
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
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.
gnrc_pktsnip
Type to represent parts (either headers or payload) of a packet, called snips.
Definition: pkt.h:108