diff mbox series

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

Message ID 20220404121410.188509-4-jeremy@azazel.net
State Changes Requested
Delegated to: Pablo Neira
Headers show
Series Extend values assignable to packet marks and payload fields | expand

Commit Message

Jeremy Sowden April 4, 2022, 12:13 p.m. UTC
It's useful for debugging, so move it out of evaluate.c to make it
available elsewhere.

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

Patch

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...) \