From: Victor Julien Date: Wed, 20 Dec 2017 08:03:33 +0000 (+0100) Subject: pfring: minor code cleanups X-Git-Tag: suricata-4.1.0-beta1~421 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a8b0825c1847b4f680afc0a05046f665df9c8aea;p=thirdparty%2Fsuricata.git pfring: minor code cleanups --- diff --git a/src/source-pfring.c b/src/source-pfring.c index 6f2b90b309..e38546b1bb 100644 --- a/src/source-pfring.c +++ b/src/source-pfring.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2007-2014 Open Information Security Foundation +/* Copyright (C) 2007-2017 Open Information Security Foundation * * You can copy, redistribute or modify this Program under the terms of * the GNU General Public License version 2 as published by the Free @@ -46,18 +46,6 @@ #include "runmodes.h" #include "util-profiling.h" -#ifdef __SC_CUDA_SUPPORT__ - -#include "util-cuda.h" -#include "util-cuda-buffer.h" -#include "util-mpm-ac.h" -#include "util-cuda-handlers.h" -#include "detect-engine.h" -#include "detect-engine-mpm.h" -#include "util-cuda-vars.h" - -#endif /* __SC_CUDA_SUPPORT__ */ - TmEcode ReceivePfringLoop(ThreadVars *tv, void *data, void *slot); TmEcode PfringBreakLoop(ThreadVars *tv, void *data); TmEcode ReceivePfringThreadInit(ThreadVars *, const void *, void **); @@ -238,7 +226,6 @@ static inline void PfringDumpCounters(PfringThreadVars *ptv) */ static inline void PfringProcessPacket(void *user, struct pfring_pkthdr *h, Packet *p) { - PfringThreadVars *ptv = (PfringThreadVars *)user; ptv->bytes += h->caplen; @@ -419,7 +406,8 @@ TmEcode ReceivePfringLoop(ThreadVars *tv, void *data, void *slot) #ifdef HAVE_PF_RING_FLOW_OFFLOAD if (ptv->flags & PFRING_FLAGS_BYPASS) { - p->pfring_v.flow_id = hdr.extended_hdr.pkt_hash; /* pkt hash contains the flow id in this configuration */ + /* pkt hash contains the flow id in this configuration */ + p->pfring_v.flow_id = hdr.extended_hdr.pkt_hash; p->pfring_v.ptv = ptv; p->BypassPacketsFlow = PfringBypassCallback; } @@ -430,9 +418,6 @@ TmEcode ReceivePfringLoop(ThreadVars *tv, void *data, void *slot) PacketSetData(p, pkt_buffer, hdr.caplen); } - //printf("RecievePfring src %" PRIu32 " sport %" PRIu32 " dst %" PRIu32 " dstport %" PRIu32 "\n", - // hdr.parsed_pkt.ipv4_src,hdr.parsed_pkt.l4_src_port, hdr.parsed_pkt.ipv4_dst,hdr.parsed_pkt.l4_dst_port); - PfringProcessPacket(ptv, &hdr, p); if (TmThreadsSlotProcessPkt(ptv->tv, ptv->slot, p) != TM_ECODE_OK) { @@ -782,7 +767,6 @@ TmEcode DecodePfringThreadInit(ThreadVars *tv, const void *initdata, void **data DecodeThreadVars *dtv = NULL; dtv = DecodeThreadVarsAlloc(tv); - if (dtv == NULL) SCReturnInt(TM_ECODE_FAILED); @@ -790,11 +774,6 @@ TmEcode DecodePfringThreadInit(ThreadVars *tv, const void *initdata, void **data *data = (void *)dtv; -#ifdef __SC_CUDA_SUPPORT__ - if (CudaThreadVarsInit(&dtv->cuda_vars) < 0) - SCReturnInt(TM_ECODE_FAILED); -#endif - return TM_ECODE_OK; } @@ -805,6 +784,5 @@ TmEcode DecodePfringThreadDeinit(ThreadVars *tv, void *data) SCReturnInt(TM_ECODE_OK); } - #endif /* HAVE_PFRING */ /* eof */