suricata
packet-bindgen.h
Go to the documentation of this file.
1 /* Copyright (C) 2026 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_BINDGEN_H
19 #define SURICATA_PACKET_BINDGEN_H
20 
21 typedef struct Packet_ Packet;
22 typedef struct Flow_ Flow;
23 
29 };
30 
31 uint8_t SCPacketGetIPProto(const Packet *p);
32 bool SCPacketIsToServer(const Packet *p);
33 bool SCPacketIsToClient(const Packet *p);
35 const uint8_t *SCPacketGetL3(const Packet *p, uint32_t *len);
36 Flow *SCPacketGetFlow(const Packet *p);
37 void SCPacketGetTimeAsParts(const Packet *p, uint64_t *secs, uint64_t *usecs);
38 
39 #endif /* !SURICATA_PACKET_BINDGEN_H */
len
uint8_t len
Definition: app-layer-dnp3.h:2
Flow_
Flow data structure.
Definition: flow.h:360
p
Packet * p
Definition: fuzz_dataset.c:30
PacketL3Types
PacketL3Types
Definition: packet-bindgen.h:24
PACKET_L3_UNKNOWN
@ PACKET_L3_UNKNOWN
Definition: packet-bindgen.h:25
Packet_
Definition: decode.h:528
SCPacketIsToServer
bool SCPacketIsToServer(const Packet *p)
Test whether the packet is marked as flowing to the server.
Definition: packet.c:233
SCPacketGetTimeAsParts
void SCPacketGetTimeAsParts(const Packet *p, uint64_t *secs, uint64_t *usecs)
Get packet timestamp as individual values.
Definition: packet.c:308
PACKET_L3_IPV4
@ PACKET_L3_IPV4
Definition: packet-bindgen.h:26
PACKET_L3_IPV6
@ PACKET_L3_IPV6
Definition: packet-bindgen.h:27
SCPacketGetIPProto
uint8_t SCPacketGetIPProto(const Packet *p)
Get IP proto regardless of IP version.
Definition: packet.c:223
SCPacketIsToClient
bool SCPacketIsToClient(const Packet *p)
Test whether the packet is marked as flowing to the client.
Definition: packet.c:243
PACKET_L3_ARP
@ PACKET_L3_ARP
Definition: packet-bindgen.h:28
SCPacketGetL3Type
enum PacketL3Types SCPacketGetL3Type(const Packet *p)
Get the type of the packet's L3 layer.
Definition: packet.c:253
SCPacketGetL3
const uint8_t * SCPacketGetL3(const Packet *p, uint32_t *len)
Get the L3 packet data, starting at the L3 header.
Definition: packet.c:271
SCPacketGetFlow
Flow * SCPacketGetFlow(const Packet *p)
Get the flow associated with the packet.
Definition: packet.c:300