From 0907c31db34713f0e74b90f725fabb5c91c5f45f Mon Sep 17 00:00:00 2001 From: Jozsef Kadlecsik Date: Wed, 23 May 2012 23:27:42 +0200 Subject: Allow saving to/restoring from a file without shell redirection Mathieu Bridon suggested that in some environments where there is no access to a full shell with input/output redirection, it'd be useful to read from/write to directly a file (bugzilla #788). The patch adds the new "-file" option to specify a filename to print into when listing/saving sets or read from when restoring sets. --- include/libipset/session.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/libipset/session.h b/include/libipset/session.h index 467bb2f..988233e 100644 --- a/include/libipset/session.h +++ b/include/libipset/session.h @@ -97,6 +97,8 @@ extern int ipset_cmd(struct ipset_session *session, enum ipset_cmd cmd, typedef int (*ipset_outfn)(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); +extern int ipset_session_outfn(struct ipset_session *session, + ipset_outfn outfn); extern struct ipset_session *ipset_session_init(ipset_outfn outfn); extern int ipset_session_fini(struct ipset_session *session); -- cgit v1.2.3