suricata
packet.h File Reference
#include "decode.h"
Include dependency graph for packet.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void PacketDrop (Packet *p, const uint8_t action, enum PacketDropReason r)
 issue drop action More...
 
bool PacketCheckAction (const Packet *p, const uint8_t a)
 
void PacketInit (Packet *p)
 Initialize a packet structure for use. More...
 
void PacketReleaseRefs (Packet *p)
 
void PacketReinit (Packet *p)
 Recycle a packet structure for reuse. More...
 
void PacketRecycle (Packet *p)
 
void PacketDestructor (Packet *p)
 Cleanup a packet so that we can free it. No memset needed.. More...
 

Function Documentation

◆ PacketCheckAction()

bool PacketCheckAction ( const Packet p,
const uint8_t  a 
)

Definition at line 48 of file packet.c.

References Packet_::action, likely, and Packet_::root.

Referenced by AlertJsonHeader(), CaptureStatsUpdate(), EveAddVerdict(), RejectSendIPv4ICMP(), RejectSendIPv4TCP(), RejectSendIPv6ICMP(), and RejectSendIPv6TCP().

Here is the caller graph for this function:

◆ PacketDestructor()

void PacketDestructor ( Packet p)

Cleanup a packet so that we can free it. No memset needed..

Definition at line 179 of file packet.c.

References PacketAlerts_::alerts, Packet_::alerts, Packet_::app_layer_events, AppLayerDecoderEventsFreeEvents(), PACKET_FREE_EXTDATA, PACKET_PROFILING_RESET, PacketAlertFree(), PacketReleaseRefs(), Packet_::persistent, Packet_::pktvar, PktVarFree(), SCSpinDestroy, and Packet_::tunnel_lock.

Referenced by PacketFree().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PacketDrop()

void PacketDrop ( Packet p,
const uint8_t  action,
enum PacketDropReason  r 
)

issue drop action

Set drop (+reject) flags in both current and root packet.

Parameters
actionaction bit flags. Must be limited to ACTION_DROP_REJECT

Definition at line 32 of file packet.c.

References Packet_::action, ACTION_DROP_REJECT, DEBUG_VALIDATE_BUG_ON, Packet_::drop_reason, PKT_DROP_REASON_INNER_PACKET, PKT_DROP_REASON_NOT_SET, and Packet_::root.

Referenced by ExceptionPolicyParse().

Here is the caller graph for this function:

◆ PacketInit()

void PacketInit ( Packet p)

Initialize a packet structure for use.

Definition at line 62 of file packet.c.

References PacketAlerts_::alerts, Packet_::alerts, Packet_::livedev, PACKET_RESET_CHECKSUMS, PacketAlertCreate(), Packet_::persistent, SCSpinInit, and Packet_::tunnel_lock.

Referenced by PacketGetFromAlloc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PacketRecycle()

void PacketRecycle ( Packet p)

Definition at line 170 of file packet.c.

References PacketReinit(), and PacketReleaseRefs().

Here is the call graph for this function:

◆ PacketReinit()

void PacketReinit ( Packet p)

Recycle a packet structure for reuse.

Definition at line 80 of file packet.c.

References PacketAlert_::action, Packet_::alerts, Packet_::app_layer_events, Packet_::app_update_direction, AppLayerDecoderEventsResetEvents(), Packet_::BypassPacketsFlow, CLEAR_ADDR, CLEAR_ESP_PACKET, CLEAR_ICMPV4_PACKET, CLEAR_ICMPV6_PACKET, CLEAR_IPV4_PACKET, CLEAR_IPV6_PACKET, CLEAR_SCTP_PACKET, CLEAR_TCP_PACKET, CLEAR_UDP_PACKET, PacketAlerts_::cnt, PacketEngineEvents_::cnt, Packet_::datalink, PacketAlerts_::discarded, Packet_::dp, PacketAlerts_::drop, Packet_::drop_reason, Packet_::dst, Packet_::esph, Packet_::ethh, Packet_::events, Packet_::flags, Packet_::flowflags, Packet_::greh, Packet_::icmpv4h, Packet_::icmpv6h, Packet_::ip4h, Packet_::ip6h, Packet_::livedev, Packet_::nb_decoded_layers, Packet_::next, PACKET_FREE_EXTDATA, PACKET_PROFILING_RESET, PACKET_RESET_ACTION, PACKET_RESET_CHECKSUMS, PacketTunnelNone, Packet_::payload, Packet_::payload_len, Packet_::pcap_cnt, Packet_::pkt_src, Packet_::pktvar, PktVarFree(), Packet_::ppph, Packet_::pppoedh, Packet_::pppoesh, Packet_::prev, Packet_::proto, Packet_::recursion_level, RESET_PKT_LEN, Packet_::root, SCTIME_INIT, Packet_::sctph, Packet_::sp, Packet_::src, PacketAlerts_::suppressed, Packet_::tcph, Packet_::tenant_id, Packet_::ts, Packet_::ttype, Packet_::tunnel_rtv_cnt, Packet_::tunnel_tpr_cnt, Packet_::tunnel_verdicted, Packet_::udph, Packet_::vlan_id, and Packet_::vlan_idx.

Referenced by PacketRecycle().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PacketReleaseRefs()

void PacketReleaseRefs ( Packet p)

Definition at line 70 of file packet.c.

Referenced by PacketDestructor(), and PacketRecycle().

Here is the caller graph for this function: