[nft PATCH v4 03/32] src: move `byteorder_names` array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It's useful for debugging, so move it out of evaluate.c to make it
available elsewhere.

Signed-off-by: Jeremy Sowden <jeremy@xxxxxxxxxx>
---
 include/datatype.h | 6 ++++++
 src/evaluate.c     | 7 +------
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/include/datatype.h b/include/datatype.h
index 0b90a33e4e64..8d774a91e350 100644
--- a/include/datatype.h
+++ b/include/datatype.h
@@ -119,6 +119,12 @@ enum byteorder {
 	BYTEORDER_BIG_ENDIAN,
 };
 
+static const char *const byteorder_names[] = {
+	[BYTEORDER_INVALID]             = "invalid",
+	[BYTEORDER_HOST_ENDIAN]         = "host endian",
+	[BYTEORDER_BIG_ENDIAN]          = "big endian",
+};
+
 struct expr;
 
 /**
diff --git a/src/evaluate.c b/src/evaluate.c
index 04d42b800103..be493f85010c 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -27,6 +27,7 @@
 #include <net/if.h>
 #include <errno.h>
 
+#include <datatype.h>
 #include <expression.h>
 #include <statement.h>
 #include <netlink.h>
@@ -40,12 +41,6 @@
 
 static int expr_evaluate(struct eval_ctx *ctx, struct expr **expr);
 
-static const char * const byteorder_names[] = {
-	[BYTEORDER_INVALID]		= "invalid",
-	[BYTEORDER_HOST_ENDIAN]		= "host endian",
-	[BYTEORDER_BIG_ENDIAN]		= "big endian",
-};
-
 #define chain_error(ctx, s1, fmt, args...) \
 	__stmt_binary_error(ctx, &(s1)->location, NULL, fmt, ## args)
 #define monitor_error(ctx, s1, fmt, args...) \
-- 
2.35.1




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux