<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;"># NAME

Linux::NFTables - Perl interface to [libnftables](https://netfilter.org/projects/nftables/)

# SYNOPSIS

    my $nft = Linux::NFTables-&gt;new()-&gt;set_output_options('json');

    my $json = $nft-&gt;run_cmd("list tables");

# DESCRIPTION

This module provides a Perl interface to
[nftables](https://netfilter.org/projects/nftables/).

# CHARACTER\_ENCODING

Strings into &amp; out of this module are byte strings.

# METHODS

## $obj = _CLASS_-&gt;new()

Instantiates _CLASS_.

## $yn = _OBJ_-&gt;get\_dry\_run()

Returns a boolean that indicates whether _OBJ_ is set to dry-run mode.

## $obj = _OBJ_-&gt;set\_dry\_run( \[$yn\] )

Sets or unsets dry-run mode in _OBJ_. If the parameter is not given,
this defaults to **ON**.

## $output = _OBJ_-&gt;run\_cmd( $CMD )

Passes an arbitrary command string to nftables and returns its output.

## @opts = _OBJ_-&gt;get\_output\_options()

Returns a list of names, e.g., `json` or `guid`. Must be called
in list context.

Possible values are libnftables窶冱 various `NFT_CTX_OUTPUT_*` constants
(minus that prefix).

## $obj = _OBJ_-&gt;set\_output\_options( @NAMES )

A setter complement to `get_output_options()`.

## @opts = _OBJ_-&gt;get\_debug\_options()

Like `get_output_options()` but for debug options.

Possible values are libnftables窶冱 various `NFT_DEBUG_*` constants
(minux that prefix).

## $obj = _OBJ_-&gt;set\_debug\_options( @NAMES )

A setter complement to `get_debug_options()`.
</pre></body></html>