NAME
Linux::NFTables - Perl interface to libnftables
SYNOPSIS
my $nft = Linux::NFTables->new()->set_output_options('json');
my $json = $nft->run_cmd("list tables");
DESCRIPTION
This module provides a Perl interface to nftables.
CHARACTER_ENCODING
Strings into & out of this module are byte strings.
METHODS
$obj = CLASS->new()
Instantiates CLASS.
$yn = OBJ->get_dry_run()
Returns a boolean that indicates whether OBJ is set to dry-run mode.
$obj = OBJ->set_dry_run( [$yn] )
Sets or unsets dry-run mode in OBJ. If the parameter is not given, this defaults to ON.
$output = OBJ->run_cmd( $CMD )
Passes an arbitrary command string to nftables and returns its output.
@opts = OBJ->get_output_options()
Returns a list of names, e.g., json
or guid
. Must be called in list context.
Possible values are libnftables’s various NFT_CTX_OUTPUT_*
constants (minus that prefix).
$obj = OBJ->set_output_options( @NAMES )
A setter complement to get_output_options()
.
@opts = OBJ->get_debug_options()
Like get_output_options()
but for debug options.
Possible values are libnftables’s various NFT_DEBUG_*
constants (minux that prefix).
$obj = OBJ->set_debug_options( @NAMES )
A setter complement to get_debug_options()
.