Skip to content

Commit

Permalink
packet: SCPacketSetLiveDevice function
Browse files Browse the repository at this point in the history
Set for a packets live device to avoid direct struct access.
  • Loading branch information
jasonish committed Oct 9, 2024
1 parent 7d3195f commit 23d7e0e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,8 @@ void SCPacketSetReleasePacket(Packet *p, void (*ReleasePacket)(Packet *p))
{
p->ReleasePacket = ReleasePacket;
}

void SCPacketSetLiveDevice(Packet *p, LiveDevice *device)
{
p->livedev = device;
}
4 changes: 4 additions & 0 deletions src/packet.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#define SURICATA_PACKET_H

#include "decode.h"
#include "util-device.h"

void PacketDrop(Packet *p, const uint8_t action, enum PacketDropReason r);
bool PacketCheckAction(const Packet *p, const uint8_t a);
Expand Down Expand Up @@ -46,4 +47,7 @@ void PacketDestructor(Packet *p);
*/
void SCPacketSetReleasePacket(Packet *p, void (*ReleasePacket)(Packet *p));

/** \brief Set a packets live device. */
void SCPacketSetLiveDevice(Packet *p, LiveDevice *device);

#endif

0 comments on commit 23d7e0e

Please sign in to comment.