Go to the documentation of this file.
58 return (actions & a) != 0;
88 FlowDeReference(&
p->
flow);
99 #define CLEAR_ADDR(a) \
102 (a)->addr_data32[0] = 0; \
103 (a)->addr_data32[1] = 0; \
104 (a)->addr_data32[2] = 0; \
105 (a)->addr_data32[3] = 0; \
118 const uint32_t pflags =
p->
flags;
131 #define PACKET_RESET_ACTION(p) (p)->action = 0
143 #define RESET_PKT_LEN(p) ((p)->pktlen = 0)
225 return PacketGetIPProto(
p);
279 const IPV4Hdr *ip4h = PacketGetIPv4(
p);
281 return (
const uint8_t *)ip4h;
284 const IPV6Hdr *ip6h = PacketGetIPv6(
p);
286 return (
const uint8_t *)ip6h;
290 return (
const uint8_t *)PacketGetARP(
p);
302 return p == NULL ? NULL :
p->
flow;
#define PKT_IS_TOCLIENT(p)
bool PacketCheckAction(const Packet *p, const uint8_t a)
#define HostDeReference(src_h_ptr)
bool SCPacketIsToServer(const Packet *p)
Test whether the packet is marked as flowing to the server.
const uint8_t * SCPacketGetL3(const Packet *p, uint32_t *len)
Get the L3 packet data, starting at the L3 header.
uint16_t firewall_discarded
#define IPV6_GET_RAW_PLEN(ip6h)
void SCPacketSetLiveDevice(Packet *p, LiveDevice *device)
Set a packets live device.
void PacketRecycle(Packet *p)
PacketAlert * PacketAlertCreate(void)
Initialize PacketAlerts with dynamic alerts array size.
void PacketReleaseRefs(Packet *p)
#define ACTION_DROP_REJECT
void AppLayerDecoderEventsResetEvents(AppLayerDecoderEvents *events)
int(* BypassPacketsFlow)(struct Packet_ *)
AppLayerDecoderEvents * app_layer_events
PacketEngineEvents events
void PacketAlertFree(PacketAlert *pa_array)
void SCPacketSetSource(Packet *p, enum PktSrcEnum source)
Set packet source.
void PacketReinit(Packet *p)
Recycle a packet structure for reuse.
#define PKT_IS_TOSERVER(p)
@ PKT_DROP_REASON_NOT_SET
void PacketDestructor(Packet *p)
Cleanup a packet so that we can free it. No memset needed..
uint8_t SCPacketGetIPProto(const Packet *p)
Get IP proto regardless of IP version.
#define PACKET_RESET_ACTION(p)
#define PKT_ALERT_CTX_USED
uint16_t LiveDeviceGetId(const LiveDevice *dev)
void SCPacketSetTime(Packet *p, SCTime_t ts)
Set the timestamp for a packet.
void SCPacketGetTimeAsParts(const Packet *p, uint64_t *secs, uint64_t *usecs)
Get packet timestamp as individual values.
uint8_t nb_decoded_layers
bool SCPacketIsToClient(const Packet *p)
Test whether the packet is marked as flowing to the client.
#define PACKET_FREE_EXTDATA(p)
void(* ReleasePacket)(struct Packet_ *)
void PacketAlertDropReset(Packet *p)
Release the alert context the drop slot owns, then invalidate the slot. Not an alerts[] entry,...
@ PKT_DROP_REASON_INNER_PACKET
Flow * SCPacketGetFlow(const Packet *p)
Get the flow associated with the packet.
uint8_t app_update_direction
void SCPacketSetReleasePacket(Packet *p, void(*ReleasePacket)(Packet *p))
Set a packet release function.
uint8_t PacketGetAction(const Packet *p)
void SCAppLayerDecoderEventsFreeEvents(AppLayerDecoderEvents **events)
struct Packet_::@38 persistent
#define PACKET_PROFILING_RESET(p)
void PktVarFree(PktVar *pv)
void PacketDrop(Packet *p, const uint8_t action, enum PacketDropReason r)
issue drop action
void SCPacketSetDatalink(Packet *p, int datalink)
Set a packets data link type.
void PacketAlertRecycle(PacketAlert *pa_array, uint16_t cnt)
#define IPV4_GET_RAW_IPLEN(ip4h)
uint16_t vlan_id[VLAN_MAX_LAYERS]
bool PacketInit(Packet *p)
Initialize a packet structure for use.
#define DEBUG_VALIDATE_BUG_ON(exp)
enum PacketL3Types SCPacketGetL3Type(const Packet *p)
Get the type of the packet's L3 layer.