|
|
|
|
@ -122,17 +122,17 @@ TmEcode DecodeLib(ThreadVars *tv, Packet *p, void *data)
|
|
|
|
|
/** \brief process a single packet.
|
|
|
|
|
*
|
|
|
|
|
* \param tv Pointer to the per-thread structure.
|
|
|
|
|
* \param device Pionter to LiveDevice instance
|
|
|
|
|
* \param data Pointer to the raw packet.
|
|
|
|
|
* \param datalink Datalink type.
|
|
|
|
|
* \param ts Timeval structure.
|
|
|
|
|
* \param len Packet length.
|
|
|
|
|
* \param tenant_id Tenant id of the detection engine to use.
|
|
|
|
|
* \param flags Packet flags (packet checksum, rule profiling...).
|
|
|
|
|
* \param iface Sniffing interface this packet comes from (can be NULL).
|
|
|
|
|
* \return Error code.
|
|
|
|
|
*/
|
|
|
|
|
int TmModuleLibHandlePacket(ThreadVars *tv, const uint8_t *data, int datalink, struct timeval ts,
|
|
|
|
|
uint32_t len, uint32_t tenant_id, uint32_t flags, const char *iface)
|
|
|
|
|
int TmModuleLibHandlePacket(ThreadVars *tv, LiveDevice *device, const uint8_t *data, int datalink,
|
|
|
|
|
struct timeval ts, uint32_t len, uint32_t tenant_id, uint32_t flags)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
/* If the packet is NULL, consider it as a read timeout. */
|
|
|
|
|
@ -159,11 +159,7 @@ int TmModuleLibHandlePacket(ThreadVars *tv, const uint8_t *data, int datalink, s
|
|
|
|
|
p->datalink = datalink;
|
|
|
|
|
p->tenant_id = tenant_id;
|
|
|
|
|
p->flags |= flags;
|
|
|
|
|
|
|
|
|
|
/* Set the sniffing interface. */
|
|
|
|
|
if (iface) {
|
|
|
|
|
p->livedev = LiveGetDevice(iface);
|
|
|
|
|
}
|
|
|
|
|
p->livedev = device;
|
|
|
|
|
|
|
|
|
|
if (PacketSetData(p, data, len) == -1) {
|
|
|
|
|
TmqhOutputPacketpool(tv, p);
|
|
|
|
|
|