summaryrefslogtreecommitdiffstats
path: root/src/source-af-xdp.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 17:39:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 17:39:49 +0000
commita0aa2307322cd47bbf416810ac0292925e03be87 (patch)
tree37076262a026c4b48c8a0e84f44ff9187556ca35 /src/source-af-xdp.h
parentInitial commit. (diff)
downloadsuricata-a0aa2307322cd47bbf416810ac0292925e03be87.tar.xz
suricata-a0aa2307322cd47bbf416810ac0292925e03be87.zip
Adding upstream version 1:7.0.3.upstream/1%7.0.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/source-af-xdp.h')
-rw-r--r--src/source-af-xdp.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/src/source-af-xdp.h b/src/source-af-xdp.h
new file mode 100644
index 0000000..3c78a63
--- /dev/null
+++ b/src/source-af-xdp.h
@@ -0,0 +1,69 @@
+/* Copyright (C) 2022 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
+ * Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * version 2 along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+/**
+ * \file
+ *
+ * \author Richard McConnell <richard_mcconnell@rapid7.com>
+ */
+
+#ifndef __SOURCE_AFXDP_H__
+#define __SOURCE_AFXDP_H__
+
+#define AFXDP_IFACE_NAME_LENGTH 48
+
+typedef struct AFXDPIfaceConfig {
+ char iface[AFXDP_IFACE_NAME_LENGTH];
+ /* number of threads */
+ int threads;
+ int promisc;
+
+ /* misc use flags */
+ uint32_t mode;
+ uint32_t bind_flags;
+ int mem_alignment;
+ bool enable_busy_poll;
+ uint32_t busy_poll_time;
+ uint32_t busy_poll_budget;
+ uint32_t gro_flush_timeout;
+ uint32_t napi_defer_hard_irqs;
+
+ SC_ATOMIC_DECLARE(unsigned int, ref);
+ void (*DerefFunc)(void *);
+} AFXDPIfaceConfig;
+
+/**
+ * \brief per packet AF_XDP vars
+ *
+ * This structure is used by the release data system
+ */
+typedef struct AFXDPPacketVars_ {
+ /* Fill queue used by kernel for inbound packets */
+ void *fq;
+ /* Indexed location within queue to release */
+ uint32_t fq_idx;
+ /* Origin address of packet */
+ uint64_t orig;
+} AFXDPPacketVars;
+
+void TmModuleReceiveAFXDPRegister(void);
+void TmModuleDecodeAFXDPRegister(void);
+
+TmEcode AFXDPQueueProtectionInit(void);
+void AFXDPMutexClean(void);
+
+#endif /* __SOURCE_AFXDP_H__ */