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 SURICATA_PACKET_QUEUE_H
25#define SURICATA_PACKET_QUEUE_H
26
27#include "threads.h"
28
29/** \brief simple fifo queue for packets
30 *
31 * \note PacketQueueNoLock and PacketQueue need to keep identical
32 * layouts except for the mutex_q and cond_q fields.
33 */
34typedef struct PacketQueueNoLock_ {
35 struct Packet_ *top;
36 struct Packet_ *bot;
37 uint32_t len;
38#ifdef DBG_PERF
39 uint32_t dbg_maxlen;
40#endif /* DBG_PERF */
42
43/** \brief simple fifo queue for packets with mutex and cond
44 * Calling the mutex or triggering the cond is responsibility of the caller
45 *
46 * \note PacketQueueNoLock and PacketQueue need to keep identical
47 * layouts except for the mutex_q and cond_q fields.
48 */
49typedef struct PacketQueue_ {
50 struct Packet_ *top;
51 struct Packet_ *bot;
52 uint32_t len;
53#ifdef DBG_PERF
54 uint32_t dbg_maxlen;
55#endif /* DBG_PERF */
59
60
62void PacketEnqueue (PacketQueue *, struct Packet_ *);
63
66
69
70#endif /* SURICATA_PACKET_QUEUE_H */
struct PacketQueue_ PacketQueue
simple fifo queue for packets with mutex and cond Calling the mutex or triggering the cond is respons...
void PacketEnqueueNoLock(PacketQueueNoLock *qnl, struct Packet_ *p)
void PacketEnqueue(PacketQueue *, struct Packet_ *)
PacketQueue * PacketQueueAlloc(void)
struct Packet_ * PacketDequeueNoLock(PacketQueueNoLock *qnl)
void PacketQueueFree(PacketQueue *)
struct PacketQueueNoLock_ PacketQueueNoLock
simple fifo queue for packets
struct Packet_ * PacketDequeue(PacketQueue *)
simple fifo queue for packets
struct Packet_ * bot
struct Packet_ * top
simple fifo queue for packets with mutex and cond Calling the mutex or triggering the cond is respons...
uint32_t len
SCMutex mutex_q
struct Packet_ * bot
struct Packet_ * top
SCCondT cond_q
#define SCCondT
#define SCMutex