aboutsummaryrefslogtreecommitdiff
path: root/sbin/ipf/ippool
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2022-09-21 15:33:11 +0000
committerCy Schubert <cy@FreeBSD.org>2022-09-22 22:38:11 +0000
commit7531c434a593b2f369d69c85551e7ad1ebb7499a (patch)
tree5fb66eb89bde795408c9cebfb002d1301bce1277 /sbin/ipf/ippool
parent7e58c8aa8245192176ac12961272bcb19dfaeb91 (diff)
downloadsrc-7531c434a593b2f369d69c85551e7ad1ebb7499a.tar.gz
src-7531c434a593b2f369d69c85551e7ad1ebb7499a.zip
ipfilter/ippool: Dump a copy of ippool in ippool.conf format
Add an ippool(8) option to dump a copy of the inm-memory ippool tables in an ippool(5) format so that it can be reloaded using ippool -f. MFC after: 2 weeks
Diffstat (limited to 'sbin/ipf/ippool')
-rw-r--r--sbin/ipf/ippool/ippool.86
-rw-r--r--sbin/ipf/ippool/ippool.c5
2 files changed, 9 insertions, 2 deletions
diff --git a/sbin/ipf/ippool/ippool.8 b/sbin/ipf/ippool/ippool.8
index bcc8f3cbd71d..358ece5a26ff 100644
--- a/sbin/ipf/ippool/ippool.8
+++ b/sbin/ipf/ippool/ippool.8
@@ -18,7 +18,7 @@ ippool \- user interface to the IPFilter pools
-F [-dv] [-o <role>] [-t <type>]
.br
.B ippool
--l [-dv] [-m <name>] [-t <type>] [-o <role>] [-M <core>] [-N <namelist>]
+-l [-dDv] [-m <name>] [-t <type>] [-o <role>] [-M <core>] [-N <namelist>]
.br
.B ippool
-r [-dnv] [-m <name>] [-o <role>] [-t <type>] -i <ipaddr>[/<netmask>]
@@ -121,6 +121,10 @@ as a number of seconds.
When parsing a configuration file, rather than load new pool data into the
kernel, unload it.
.TP
+.B -D
+When used in conjuction with -l, dump the ippool configuration to stdout in
+a format that can be subsequently used as input into ippool -f.
+.TP
.SH FILES
.br
/dev/iplookup
diff --git a/sbin/ipf/ippool/ippool.c b/sbin/ipf/ippool/ippool.c
index 3e8918e1fcfa..384146d729c9 100644
--- a/sbin/ipf/ippool/ippool.c
+++ b/sbin/ipf/ippool/ippool.c
@@ -670,12 +670,15 @@ poollist(int argc, char *argv[])
poolname = NULL;
role = IPL_LOGALL;
- while ((c = getopt(argc, argv, "dm:M:N:o:t:v")) != -1)
+ while ((c = getopt(argc, argv, "dDm:M:N:o:t:v")) != -1)
switch (c)
{
case 'd' :
opts |= OPT_DEBUG;
break;
+ case 'D' :
+ opts |= OPT_SAVEOUT;
+ break;
case 'm' :
poolname = optarg;
break;