suricata
packet-queue.h
Go to the documentation of this file.
1 /* Copyright (C) 2007-2019 Open Information Security Foundation
2  *
3  * You can copy, redistribute or modify this Program under the terms of
4  * the GNU General Public License version 2 as published by the Free
5  * Software Foundation.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * version 2 along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15  * 02110-1301, USA.
16  */
17 
18 /**
19  * \file
20  *
21  * \author Victor Julien <victor@inliniac.net>
22  */
23 
24 #ifndef __PACKET_QUEUE_H__
25 #define __PACKET_QUEUE_H__
26 
27 /** \brief simple fifo queue for packets
28  *
29  * \note PacketQueueNoLock and PacketQueue need to keep identical
30  * layouts except for the mutex_q and cond_q fields.
31  */
32 typedef struct PacketQueueNoLock_ {
33  struct Packet_ *top;
34  struct Packet_ *bot;
35  uint32_t len;
36 #ifdef DBG_PERF
37  uint32_t dbg_maxlen;
38 #endif /* DBG_PERF */
40 
41 /** \brief simple fifo queue for packets with mutex and cond
42  * Calling the mutex or triggering the cond is responsibility of the caller
43  *
44  * \note PacketQueueNoLock and PacketQueue need to keep identical
45  * layouts except for the mutex_q and cond_q fields.
46  */
47 typedef struct PacketQueue_ {
48  struct Packet_ *top;
49  struct Packet_ *bot;
50  uint32_t len;
51 #ifdef DBG_PERF
52  uint32_t dbg_maxlen;
53 #endif /* DBG_PERF */
57 
58 #include "decode.h"
59 
60 void PacketEnqueueNoLock(PacketQueueNoLock *qnl, struct Packet_ *p);
61 void PacketEnqueue (PacketQueue *, struct Packet_ *);
62 
65 
68 
69 #endif /* __PACKET_QUEUE_H__ */
70 
PacketEnqueueNoLock
void PacketEnqueueNoLock(PacketQueueNoLock *qnl, struct Packet_ *p)
Definition: packet-queue.c:167
PacketQueue_
simple fifo queue for packets with mutex and cond Calling the mutex or triggering the cond is respons...
Definition: packet-queue.h:47
PacketEnqueue
void PacketEnqueue(PacketQueue *, struct Packet_ *)
Definition: packet-queue.c:173
SCCondT
#define SCCondT
Definition: threads-debug.h:137
PacketQueueNoLock_
simple fifo queue for packets
Definition: packet-queue.h:32
PacketQueue_::mutex_q
SCMutex mutex_q
Definition: packet-queue.h:54
PacketQueueAlloc
PacketQueue * PacketQueueAlloc(void)
Definition: packet-queue.c:217
decode.h
PacketDequeue
struct Packet_ * PacketDequeue(PacketQueue *)
Definition: packet-queue.c:212
Packet_
Definition: decode.h:412
PacketQueue_::bot
struct Packet_ * bot
Definition: packet-queue.h:49
PacketQueueNoLock_::bot
struct Packet_ * bot
Definition: packet-queue.h:34
PacketQueue_::cond_q
SCCondT cond_q
Definition: packet-queue.h:55
PacketQueueNoLock_::top
struct Packet_ * top
Definition: packet-queue.h:33
PacketQueueNoLock
struct PacketQueueNoLock_ PacketQueueNoLock
simple fifo queue for packets
PacketQueue_::len
uint32_t len
Definition: packet-queue.h:50
PacketQueueNoLock_::len
uint32_t len
Definition: packet-queue.h:35
PacketQueue_::top
struct Packet_ * top
Definition: packet-queue.h:48
PacketQueue
struct PacketQueue_ PacketQueue
simple fifo queue for packets with mutex and cond Calling the mutex or triggering the cond is respons...
PacketQueueFree
void PacketQueueFree(PacketQueue *)
Definition: packet-queue.c:227
SCMutex
#define SCMutex
Definition: threads-debug.h:114
PacketDequeueNoLock
struct Packet_ * PacketDequeueNoLock(PacketQueueNoLock *qnl)
Definition: packet-queue.c:206