suricata
packet.h
Go to the documentation of this file.
1 /* Copyright (C) 2007-2022 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 #ifndef SURICATA_PACKET_H
19 #define SURICATA_PACKET_H
20 
21 #include "decode.h"
22 
23 void PacketDrop(Packet *p, const uint8_t action, enum PacketDropReason r);
24 bool PacketCheckAction(const Packet *p, const uint8_t a);
25 
26 #ifdef UNITTESTS
27 static inline uint8_t PacketTestAction(const Packet *p, const uint8_t a)
28 {
29  return PacketCheckAction(p, a);
30 }
31 #endif
32 
33 void PacketInit(Packet *p);
34 void PacketReleaseRefs(Packet *p);
35 void PacketReinit(Packet *p);
36 void PacketRecycle(Packet *p);
37 void PacketDestructor(Packet *p);
38 
39 #endif
PacketCheckAction
bool PacketCheckAction(const Packet *p, const uint8_t a)
Definition: packet.c:48
PacketReleaseRefs
void PacketReleaseRefs(Packet *p)
Definition: packet.c:70
Packet_::action
uint8_t action
Definition: decode.h:591
PacketDropReason
PacketDropReason
Definition: decode.h:391
decode.h
PacketInit
void PacketInit(Packet *p)
Initialize a packet structure for use.
Definition: packet.c:62
PacketReinit
void PacketReinit(Packet *p)
Recycle a packet structure for reuse.
Definition: packet.c:80
Packet_
Definition: decode.h:437
PacketDestructor
void PacketDestructor(Packet *p)
Cleanup a packet so that we can free it. No memset needed..
Definition: packet.c:179
PacketRecycle
void PacketRecycle(Packet *p)
Definition: packet.c:170
PacketDrop
void PacketDrop(Packet *p, const uint8_t action, enum PacketDropReason r)
issue drop action
Definition: packet.c:32