{
    "content": [
        {
            "type": "text",
            "text": "# iptables-xml(1) (man)\n\n**Summary:** iptables-xml — Convert iptables-save format to XML\n\n**Synopsis:** iptables-xml [-c] [-v]\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| -c | --combine | — | combine consecutive rules with the same matches but different targets. iptables does not currently support more than one |\n| -v | --verbose | — | Output xml comments containing the iptables line from which the XML is derived iptables-xml does a mechanistic conversio |\n\n## See Also\n\n- iptables-save(8)\n- iptables-restore(8)\n- iptables(8)\n- IPTABLES-XML(1)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (2 lines)\n- **DESCRIPTION** (3 lines) — 2 subsections\n  - -c --combine (6 lines)\n  - -v --verbose (39 lines)\n- **BUGS** (2 lines)\n- **AUTHOR** (2 lines)\n- **SEE ALSO** (5 lines)\n\n## Full Content\n\n### NAME\n\niptables-xml — Convert iptables-save format to XML\n\n### SYNOPSIS\n\niptables-xml [-c] [-v]\n\n### DESCRIPTION\n\niptables-xml  is used to convert the output of iptables-save into an easily manipulatable XML\nformat to STDOUT.  Use I/O-redirection provided by your shell to write to a file.\n\n#### -c --combine\n\ncombine consecutive rules with the same matches but different targets.  iptables  does\nnot  currently  support more than one target per match, so this simulates that by col‐\nlecting the targets from consecutive iptables rules into one action tag, but only when\nthe  rule  matches  are  identical.  Terminating actions like RETURN, DROP, ACCEPT and\nQUEUE are not combined with subsequent targets.\n\n#### -v --verbose\n\nOutput xml comments containing the iptables line from which the XML is derived\n\n\niptables-xml does a mechanistic conversion to a very expressive xml format; the only semantic\nconsiderations  are  for -g and -j targets in order to discriminate between <call> <goto> and\n<nane-of-target> as it helps xml processing scripts if they can tell the difference between a\ntarget like SNAT and another chain.\n\nSome sample output is:\n\n<iptables-rules>\n<table name=\"mangle\">\n<chain name=\"PREROUTING\" policy=\"ACCEPT\" packet-count=\"63436\" byte-count=\"7137573\">\n<rule>\n<conditions>\n<match>\n<p>tcp</p>\n</match>\n<tcp>\n<sport>8443</sport>\n</tcp>\n</conditions>\n<actions>\n<call>\n<checkip/>\n</call>\n<ACCEPT/>\n</actions>\n</rule>\n</chain>\n</table> </iptables-rules>\n\n\nConversion  from  XML  to iptables-save format may be done using the iptables.xslt script and\nxsltproc, or a custom program using libxsltproc or similar; in this fashion:\n\nxsltproc iptables.xslt my-iptables.xml | iptables-restore\n\n### BUGS\n\nNone known as of iptables-1.3.7 release\n\n### AUTHOR\n\nSam Liddicott <azez@ufomechanic.net>\n\n### SEE ALSO\n\niptables-save(8), iptables-restore(8), iptables(8)\n\n\n\niptables 1.8.7                                                                       IPTABLES-XML(1)\n\n"
        }
    ],
    "structuredContent": {
        "command": "iptables-xml",
        "section": "1",
        "mode": "man",
        "summary": "iptables-xml — Convert iptables-save format to XML",
        "synopsis": "iptables-xml [-c] [-v]",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [
            {
                "flag": "-c",
                "long": "--combine",
                "arg": null,
                "description": "combine consecutive rules with the same matches but different targets. iptables does not currently support more than one target per match, so this simulates that by col‐ lecting the targets from consecutive iptables rules into one action tag, but only when the rule matches are identical. Terminating actions like RETURN, DROP, ACCEPT and QUEUE are not combined with subsequent targets."
            },
            {
                "flag": "-v",
                "long": "--verbose",
                "arg": null,
                "description": "Output xml comments containing the iptables line from which the XML is derived iptables-xml does a mechanistic conversion to a very expressive xml format; the only semantic considerations are for -g and -j targets in order to discriminate between <call> <goto> and <nane-of-target> as it helps xml processing scripts if they can tell the difference between a target like SNAT and another chain. Some sample output is: <iptables-rules> <table name=\"mangle\"> <chain name=\"PREROUTING\" policy=\"ACCEPT\" packet-count=\"63436\" byte-count=\"7137573\"> <rule> <conditions> <match> <p>tcp</p> </match> <tcp> <sport>8443</sport> </tcp> </conditions> <actions> <call> <checkip/> </call> <ACCEPT/> </actions> </rule> </chain> </table> </iptables-rules> Conversion from XML to iptables-save format may be done using the iptables.xslt script and xsltproc, or a custom program using libxsltproc or similar; in this fashion: xsltproc iptables.xslt my-iptables.xml | iptables-restore"
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "iptables-save",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/iptables-save/8/json"
            },
            {
                "name": "iptables-restore",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/iptables-restore/8/json"
            },
            {
                "name": "iptables",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/iptables/8/json"
            },
            {
                "name": "IPTABLES-XML",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/IPTABLES-XML/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 3,
                "subsections": [
                    {
                        "name": "-c --combine",
                        "lines": 6,
                        "flag": "-c",
                        "long": "--combine"
                    },
                    {
                        "name": "-v --verbose",
                        "lines": 39,
                        "flag": "-v",
                        "long": "--verbose"
                    }
                ]
            },
            {
                "name": "BUGS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            }
        ]
    }
}