public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: passt-dev@passt.top, Stefano Brivio <sbrivio@redhat.com>
Cc: David Gibson <david@gibson.dropbear.id.au>
Subject: [PATCH 00/12] Rework option parsing in preparation for destination remapping
Date: Fri, 26 Jun 2026 17:09:51 +1000	[thread overview]
Message-ID: <20260626071003.3472194-1-david@gibson.dropbear.id.au> (raw)

This was... a bit of a nightmare.  It took way too long and went down
a bunch of blind alleys.  I'm not sure how much I like the final
result: it's pleasingly terse in some cases, but in others it feels
dangerously subtle, requiring a pretty careful understanding of the
sequencing rules of C's &&, || and , operators.

That said, while I was at many points ready to pack it in and hack my
around the problems limiting the parsing for destination remapping, I
couldn't really think of feasible way to do that either.  So, here we
are.

David Gibson (12):
  Makefile: Add missing PESTO_HEADERS variable
  conf: Use parameter instead of global in conf_nat()
  parse: Start splitting out parsing helpers
  conf: Remove duplicate parsing of -F option
  conf: Clean up conf_ip4_prefix()
  parse: Add helper to parse unsigned integer values
  parse: Move parse_port_range() to new parsing framework
  parse: Add helpers for parsing IP addresses
  conf: Move address configuration into helper function
  conf: Use new parsing tools to handle -a option
  fwd_rule: Allow "all" port specs to be combined with other options
  fwd_rule: Rewrite forward rule parsing using parse.c helpers

 Makefile   |  22 +--
 common.h   |   3 +
 conf.c     | 209 ++++++++++++++++------------
 conf.h     |   1 +
 fwd_rule.c | 392 +++++++++++++++++++++++------------------------------
 fwd_rule.h |   2 -
 inany.c    |  70 +---------
 inany.h    |   3 -
 parse.c    | 243 +++++++++++++++++++++++++++++++++
 parse.h    |  37 +++++
 util.c     |  12 +-
 11 files changed, 591 insertions(+), 403 deletions(-)
 create mode 100644 parse.c
 create mode 100644 parse.h

-- 
2.54.0


             reply	other threads:[~2026-06-26  7:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-26  7:09 David Gibson [this message]
2026-06-26  7:09 ` [PATCH 01/12] Makefile: Add missing PESTO_HEADERS variable David Gibson
2026-06-26  7:09 ` [PATCH 02/12] conf: Use parameter instead of global in conf_nat() David Gibson
2026-06-26  7:09 ` [PATCH 03/12] parse: Start splitting out parsing helpers David Gibson
2026-06-26  7:09 ` [PATCH 04/12] conf: Remove duplicate parsing of -F option David Gibson
2026-06-26  7:09 ` [PATCH 05/12] conf: Clean up conf_ip4_prefix() David Gibson
2026-06-26  7:09 ` [PATCH 06/12] parse: Add helper to parse unsigned integer values David Gibson
2026-06-26  7:09 ` [PATCH 07/12] parse: Move parse_port_range() to new parsing framework David Gibson
2026-06-26  7:09 ` [PATCH 08/12] parse: Add helpers for parsing IP addresses David Gibson
2026-06-26  7:10 ` [PATCH 09/12] conf: Move address configuration into helper function David Gibson
2026-06-26  7:10 ` [PATCH 10/12] conf: Use new parsing tools to handle -a option David Gibson
2026-06-26  7:10 ` [PATCH 11/12] fwd_rule: Allow "all" port specs to be combined with other options David Gibson
2026-06-26  7:10 ` [PATCH 12/12] fwd_rule: Rewrite forward rule parsing using parse.c helpers David Gibson

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=20260626071003.3472194-1-david@gibson.dropbear.id.au \
    --to=david@gibson.dropbear.id.au \
    --cc=passt-dev@passt.top \
    --cc=sbrivio@redhat.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

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 IMAP folder(s).