netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Subject: [PATCH nft 0/2] nft include path updates
Date: Sat, 15 Jun 2024 11:18:23 +0200	[thread overview]
Message-ID: <20240615091825.152372-1-pablo@netfilter.org> (raw)

Hi,

This patchset updates include path logic of nftables:

Patch #1 adds -f/--filename base directory as implicit include path,
         so users do not need to add a redundant -I/--includepath
         such as:

  # nft -I /path/to/files -f /path/to/files/ruleset.nft

Patch #2 searches for default include path last so users have a way
         to override the default include path either via -I/--includepath
         or the implicit include path added by Patch #1

  For instance, assuming you have:

  # cat /path/to/files/ruleset.nft
    include "file1.nft"
    include "file2.nft"
  # ls /path/to/files/
    file1.nft file2.nft

  then, make a copy of the ruleset:

  # mkdir update
  # cp -r /path/to/files/* update
  # vim update/file1.nft
  ...
      file edit goes here
  ...
  # nft -f copy/ruleset.nft

Comments welcome, thanks.

Pablo Neira Ayuso (2):
  libnftables: add base directory of -f/--filename to include path
  libnftables: search for default include path last

 doc/nft.txt       |  2 ++
 src/libnftables.c | 19 +++++++++++++-
 src/scanner.l     | 63 ++++++++++++++++++++++++++++++-----------------
 3 files changed, 61 insertions(+), 23 deletions(-)

--
2.30.2


             reply	other threads:[~2024-06-15  9:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-15  9:18 Pablo Neira Ayuso [this message]
2024-06-15  9:18 ` [PATCH nft 1/2] libnftables: add base directory of -f/--filename to include path Pablo Neira Ayuso
2024-06-15  9:18 ` [PATCH nft 2/2] libnftables: search for default include path last Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240615091825.152372-1-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).