[LTP] [PATCH v3 3/4] lapi: Add tc_pedit.h fallback
Andrea Cervesato
andrea.cervesato@suse.de
Tue Jul 7 15:42:29 CEST 2026
From: Andrea Cervesato <andrea.cervesato@suse.com>
Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
---
configure.ac | 2 ++
include/lapi/tc_pedit.h | 52 +++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 54 insertions(+)
diff --git a/configure.ac b/configure.ac
index 3a1283ac3a30d85ca731ca54a281ed0c1d4bc06e..428a0096c5bab983dd78002980ab1c861e222e94 100644
--- a/configure.ac
+++ b/configure.ac
@@ -190,6 +190,8 @@ AC_CHECK_MEMBERS([struct utsname.domainname],,,[
])
AC_CHECK_TYPES([enum kcmp_type],,,[#include <linux/kcmp.h>])
+AC_CHECK_TYPES([enum pedit_header_type],,,[#include <linux/tc_act/tc_pedit.h>])
+AC_CHECK_TYPES([enum pedit_cmd],,,[#include <linux/tc_act/tc_pedit.h>])
AC_CHECK_TYPES([struct acct_v3],,,[#include <sys/acct.h>])
AC_CHECK_TYPES([struct af_alg_iv, struct sockaddr_alg],,,[# include <linux/if_alg.h>])
AC_CHECK_TYPES([struct clone_args],,,[#include <sched.h>])
diff --git a/include/lapi/tc_pedit.h b/include/lapi/tc_pedit.h
new file mode 100644
index 0000000000000000000000000000000000000000..811ce0cab49357e662c35fff49e8a08346ed82f4
--- /dev/null
+++ b/include/lapi/tc_pedit.h
@@ -0,0 +1,52 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2026 SUSE LLC <andrea.cervesato@suse.com>
+ */
+
+#ifndef LAPI_TC_PEDIT_H__
+#define LAPI_TC_PEDIT_H__
+
+#include "config.h"
+#include <linux/tc_act/tc_pedit.h>
+
+#ifndef TCA_PEDIT_PARMS_EX
+# define TCA_PEDIT_PARMS_EX 4
+#endif
+
+#ifndef TCA_PEDIT_KEYS_EX
+# define TCA_PEDIT_KEYS_EX 5
+#endif
+
+#ifndef TCA_PEDIT_KEY_EX
+# define TCA_PEDIT_KEY_EX 3
+#endif
+
+#ifndef TCA_PEDIT_KEY_EX_HTYPE
+# define TCA_PEDIT_KEY_EX_HTYPE 1
+#endif
+
+#ifndef TCA_PEDIT_KEY_EX_CMD
+# define TCA_PEDIT_KEY_EX_CMD 2
+#endif
+
+#ifndef HAVE_ENUM_PEDIT_HEADER_TYPE
+enum pedit_header_type {
+ TCA_PEDIT_KEY_EX_HDR_TYPE_NETWORK = 0,
+ TCA_PEDIT_KEY_EX_HDR_TYPE_ETH,
+ TCA_PEDIT_KEY_EX_HDR_TYPE_IP4,
+ TCA_PEDIT_KEY_EX_HDR_TYPE_IP6,
+ TCA_PEDIT_KEY_EX_HDR_TYPE_TCP,
+ TCA_PEDIT_KEY_EX_HDR_TYPE_UDP,
+ __PEDIT_HDR_TYPE_MAX,
+};
+#endif
+
+#ifndef HAVE_ENUM_PEDIT_CMD
+enum pedit_cmd {
+ TCA_PEDIT_KEY_EX_CMD_SET = 0,
+ TCA_PEDIT_KEY_EX_CMD_ADD,
+ __PEDIT_CMD_MAX,
+};
+#endif
+
+#endif /* LAPI_TC_PEDIT_H__ */
--
2.51.0
More information about the ltp
mailing list