summaryrefslogtreecommitdiffstats
path: root/src/statement.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/statement.c')
-rw-r--r--src/statement.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/statement.c b/src/statement.c
index 0ae616a8..2587d275 100644
--- a/src/statement.c
+++ b/src/statement.c
@@ -348,3 +348,32 @@ struct stmt *masq_stmt_alloc(const struct location *loc)
{
return stmt_alloc(loc, &masq_stmt_ops);
}
+
+static void redir_stmt_print(const struct stmt *stmt)
+{
+ printf("redirect");
+
+ if (stmt->redir.proto) {
+ printf(" :");
+ expr_print(stmt->redir.proto);
+ }
+
+ print_nf_nat_flags(stmt->redir.flags);
+}
+
+static void redir_stmt_destroy(struct stmt *stmt)
+{
+ expr_free(stmt->redir.proto);
+}
+
+static const struct stmt_ops redir_stmt_ops = {
+ .type = STMT_REDIR,
+ .name = "redir",
+ .print = redir_stmt_print,
+ .destroy = redir_stmt_destroy,
+};
+
+struct stmt *redir_stmt_alloc(const struct location *loc)
+{
+ return stmt_alloc(loc, &redir_stmt_ops);
+}