The multitude of data structures for kernel communication aside, code for parsing/printing of DNAT and REDIRECT targets in both IPv4 and IPv6 are pretty similar. Stick them into a common source file and share as much code as possible. The first two patches are basically fallout from initial code-review. The next three patches optimize and prepare libipt_DNAT.c as it will serve as the source to merge into. Therefore patch 6 renames it to libxt_DNAT.c and finally patches 7 and 8 merge the code. As an extra, patch 9 "fixes" for service names in ranges by searching the longest match. Phil Sutter (9): man: DNAT: Describe shifted port range feature Revert "libipt_[SD]NAT: avoid false error about multiple destinations specified" extensions: ipt_DNAT: Merge v1 and v2 parsers extensions: ipt_DNAT: Merge v1/v2 print/save code extensions: ipt_DNAT: Combine xlate functions also extensions: DNAT: Rename from libipt to libxt extensions: Merge IPv4 and IPv6 DNAT targets extensions: Merge REDIRECT into DNAT extensions: DNAT: Support service names in all spots extensions/GNUmakefile.in | 4 +- extensions/libip6t_DNAT.c | 409 ----------------- extensions/libip6t_DNAT.txlate | 11 - extensions/libip6t_REDIRECT.c | 170 ------- extensions/libip6t_REDIRECT.t | 6 - extensions/libip6t_REDIRECT.txlate | 5 - extensions/libip6t_SNAT.c | 9 +- extensions/libipt_DNAT.c | 507 --------------------- extensions/libipt_DNAT.t | 6 + extensions/libipt_DNAT.txlate | 14 - extensions/libipt_REDIRECT.c | 174 -------- extensions/libipt_REDIRECT.t | 6 - extensions/libipt_REDIRECT.txlate | 5 - extensions/libipt_SNAT.c | 3 - extensions/libxt_DNAT.c | 685 +++++++++++++++++++++++++++++ extensions/libxt_DNAT.man | 5 +- extensions/libxt_DNAT.txlate | 35 ++ extensions/libxt_REDIRECT.t | 11 + extensions/libxt_REDIRECT.txlate | 17 + 19 files changed, 762 insertions(+), 1320 deletions(-) delete mode 100644 extensions/libip6t_DNAT.c delete mode 100644 extensions/libip6t_DNAT.txlate delete mode 100644 extensions/libip6t_REDIRECT.c delete mode 100644 extensions/libip6t_REDIRECT.t delete mode 100644 extensions/libip6t_REDIRECT.txlate delete mode 100644 extensions/libipt_DNAT.c delete mode 100644 extensions/libipt_DNAT.txlate delete mode 100644 extensions/libipt_REDIRECT.c delete mode 100644 extensions/libipt_REDIRECT.t delete mode 100644 extensions/libipt_REDIRECT.txlate create mode 100644 extensions/libxt_DNAT.c create mode 100644 extensions/libxt_DNAT.txlate create mode 100644 extensions/libxt_REDIRECT.t create mode 100644 extensions/libxt_REDIRECT.txlate -- 2.34.1