iptables-xml.1 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. .TH IPTABLES-XML 8 "Jul 16, 2007" "" ""
  2. .\"
  3. .\" Man page written by Sam Liddicott <azez@ufomechanic.net>
  4. .\" It is based on the iptables-save man page.
  5. .\"
  6. .\" This program is free software; you can redistribute it and/or modify
  7. .\" it under the terms of the GNU General Public License as published by
  8. .\" the Free Software Foundation; either version 2 of the License, or
  9. .\" (at your option) any later version.
  10. .\"
  11. .\" This program is distributed in the hope that it will be useful,
  12. .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. .\" GNU General Public License for more details.
  15. .\"
  16. .\" You should have received a copy of the GNU General Public License
  17. .\" along with this program; if not, write to the Free Software
  18. .\" Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. .\"
  20. .\"
  21. .SH NAME
  22. iptables-xml \(em Convert iptables-save format to XML
  23. .SH SYNOPSIS
  24. \fBiptables\-xml\fP [\fB\-c\fP] [\fB\-v\fP]
  25. .SH DESCRIPTION
  26. .PP
  27. .B iptables-xml
  28. is used to convert the output of iptables-save into an easily manipulatable
  29. XML format to STDOUT. Use I/O-redirection provided by your shell to write to
  30. a file.
  31. .TP
  32. \fB\-c\fR, \fB\-\-combine\fR
  33. combine consecutive rules with the same matches but different targets. iptables
  34. does not currently support more than one target per match, so this simulates
  35. that by collecting the targets from consecutive iptables rules into one action
  36. tag, but only when the rule matches are identical. Terminating actions like
  37. RETURN, DROP, ACCEPT and QUEUE are not combined with subsequent targets.
  38. .TP
  39. \fB\-v\fR, \fB\-\-verbose\fR
  40. Output xml comments containing the iptables line from which the XML is derived
  41. .PP
  42. iptables-xml does a mechanistic conversion to a very expressive xml
  43. format; the only semantic considerations are for \-g and \-j targets in
  44. order to discriminate between <call> <goto> and <nane-of-target> as it
  45. helps xml processing scripts if they can tell the difference between a
  46. target like SNAT and another chain.
  47. Some sample output is:
  48. <iptables-rules>
  49. <table name="mangle">
  50. <chain name="PREROUTING" policy="ACCEPT" packet-count="63436"
  51. byte-count="7137573">
  52. <rule>
  53. <conditions>
  54. <match>
  55. <p>tcp</p>
  56. </match>
  57. <tcp>
  58. <sport>8443</sport>
  59. </tcp>
  60. </conditions>
  61. <actions>
  62. <call>
  63. <check_ip/>
  64. </call>
  65. <ACCEPT/>
  66. </actions>
  67. </rule>
  68. </chain>
  69. </table>
  70. </iptables-rules>
  71. .PP
  72. Conversion from XML to iptables-save format may be done using the
  73. iptables.xslt script and xsltproc, or a custom program using
  74. libxsltproc or similar; in this fashion:
  75. xsltproc iptables.xslt my-iptables.xml | iptables-restore
  76. .SH BUGS
  77. None known as of iptables-1.3.7 release
  78. .SH AUTHOR
  79. Sam Liddicott <azez@ufomechanic.net>
  80. .SH SEE ALSO
  81. \fBiptables\-save\fP(8), \fBiptables\-restore\fP(8), \fBiptables\fP(8)