Skip to contentSkip to conversation

cmd: move command functions to src/cmd.c

PATCH New Pablo Neira Ayuso 1 participant 1 message Mar 10, 2023 netfilter

lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/1 cmd: move command functions to src/cmd.c

Move several command functions to src/cmd.c to debloat src/rule.c

---
 include/cmd.h  |   6 ++
 include/rule.h |   6 --
 src/cmd.c      | 206 +++++++++++++++++++++++++++++++++++++++++++++++++
 src/rule.c     | 206 -------------------------------------------------
 4 files changed, 212 insertions(+), 212 deletions(-)
include/cmd.h +6 -0
index 27fa60873427..92a4152bbaea 100644
@@ -1,7 +1,13 @@
 #ifndef _NFT_CMD_H_
 #define _NFT_CMD_H_
 
+void cmd_add_loc(struct cmd *cmd, uint16_t offset, const struct location *loc);
 void nft_cmd_error(struct netlink_ctx *ctx, struct cmd *cmd,
 		   struct mnl_err *err);
 
+void nft_cmd_expand(struct cmd *cmd);
+void nft_cmd_post_expand(struct cmd *cmd);
+bool nft_cmd_collapse(struct list_head *cmds);
+void nft_cmd_uncollapse(struct list_head *cmds);
+
 #endif
include/rule.h +0 -6
index f3db6aabf1ff..e1efbb819163 100644
@@ -735,17 +735,11 @@ struct cmd {
 extern struct cmd *cmd_alloc(enum cmd_ops op, enum cmd_obj obj,
 			     const struct handle *h, const struct location *loc,
 			     void *data);
-extern void nft_cmd_expand(struct cmd *cmd);
-extern void nft_cmd_post_expand(struct cmd *cmd);
-extern bool nft_cmd_collapse(struct list_head *cmds);
-extern void nft_cmd_uncollapse(struct list_head *cmds);
 extern struct cmd *cmd_alloc_obj_ct(enum cmd_ops op, int type,
 				    const struct handle *h,
 				    const struct location *loc, struct obj *obj);
 extern void cmd_free(struct cmd *cmd);
 
-void cmd_add_loc(struct cmd *cmd, uint16_t offset, const struct location *loc);
-
 #include <payload.h>
 #include <expression.h>
 
src/cmd.c +206 -0

215 lines not on this page · raw message

src/rule.c +0 -206

212 lines not on this page · raw message

Signature · 1 line
2.30.2