directly loaded into other software. The following options are available:
+
* 'list' (default): Just lists all networks, one per line
+ * 'ipset': For ipset
* 'nftables': For nftables
* 'xt_geoip': Returns a list of networks to be loaded into the xt_geoip
kernel module
print(network)
+class IpsetOutputFormatter(OutputFormatter):
+ """
+ For nftables
+ """
+ def open(self):
+ print("create %s hash:net family inet hashsize 1024 maxelem 65536" % self.name)
+
+ def network(self, network):
+ print("add %s %s" % (self.name, network))
+
+
class NftablesOutputFormatter(OutputFormatter):
"""
For nftables
class CLI(object):
output_formats = {
+ "ipset" : IpsetOutputFormatter,
"list" : OutputFormatter,
"nftables" : NftablesOutputFormatter,
"xt_geoip" : XTGeoIPOutputFormatter,