/usr/share/doc/uruk/contrib/fw2dot.xsl is in uruk 20120608.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | <?xml version="1.0" encoding="UTF-8"?>
<!--+
| MIT Licence
|
| Copyright (c) 2007 Fred Vos - Mokolo.org
|
| Permission is hereby granted, free of charge, to any person obtaining a
| copy of this software and associated documentation files (the "Software"),
| to deal in the Software without restriction, including without limitation
| the rights to use, copy, modify, merge, publish, distribute, sublicense,
| and/or sell copies of the Software, and to permit persons to whom the
| Software is furnished to do so, subject to the following conditions:
|
| The above copyright notice and this permission notice shall be included
| in all copies or substantial portions of the Software.
|
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
| OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
| FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
| DEALINGS IN THE SOFTWARE.
+-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fw="http://www.mokolo.org/fwxml">
<xsl:output method="text" media-type="text-plain" encoding="UTF-8"/>
<xsl:template match="/fw:firewall">
<xsl:text>digraph firewall {
rankdir=LR;
graph [bgcolor=transparent];
node [shape=ellipse style=filled fontname=Arial fontsize=12]; /* default */
edge [arrowhead=none]; /* default */
</xsl:text>
<!-- Ports: -->
<xsl:text> subgraph cluster_0 {
label="Ports";
node [color=green];
</xsl:text>
<xsl:for-each select="fw:services/fw:service/fw:ports/fw:port">
<xsl:text> port_</xsl:text><xsl:value-of select="@nr"/><xsl:text> [label="</xsl:text><xsl:value-of select="@nr"/><xsl:text>"];
</xsl:text>
</xsl:for-each>
<xsl:text>
}
</xsl:text>
<!-- Services: -->
<xsl:text> subgraph cluster_1 {
label="Services";
node [color=yellow];
</xsl:text>
<xsl:for-each select="fw:services/fw:service">
<xsl:text> service_</xsl:text><xsl:value-of select="@name"/><xsl:text> [label="</xsl:text><xsl:value-of select="@name"/><xsl:text>"];
</xsl:text>
</xsl:for-each>
<xsl:text>
}
</xsl:text>
<!-- Sources: -->
<xsl:text> subgraph cluster_2 {
label="Sources";
node [color=orange];
</xsl:text>
<xsl:for-each select="fw:sources/fw:source">
<xsl:text> source_</xsl:text><xsl:value-of select="@name"/><xsl:text> [label="</xsl:text><xsl:value-of select="@name"/><xsl:text>"];
</xsl:text>
</xsl:for-each>
<xsl:text>
}
</xsl:text>
<!-- Networks: -->
<xsl:text> subgraph cluster_3 {
label="Networks";
node [shape=record color=lightblue];
</xsl:text>
<xsl:for-each select="fw:networks/fw:network">
<xsl:text> network_</xsl:text><xsl:value-of select="@name"/><xsl:text> [label="</xsl:text><xsl:value-of select="@name"/><xsl:text>|{</xsl:text><xsl:value-of select="@ip-range"/><xsl:text>}"];
</xsl:text>
</xsl:for-each>
<xsl:text>
}
</xsl:text>
<!-- Ports - Services: -->
<xsl:for-each select="fw:services/fw:service/fw:ports/fw:port">
<xsl:text> port_</xsl:text>
<xsl:value-of select="@nr"/>
<xsl:text> -> </xsl:text>
<xsl:text>service_</xsl:text>
<xsl:value-of select="../../@name"/>
<xsl:text>;
</xsl:text>
</xsl:for-each>
<!-- Services - Sources: -->
<xsl:for-each select="fw:interfaces/fw:interface/fw:grants/fw:grant">
<xsl:text> service_</xsl:text>
<xsl:value-of select="@service-ref"/>
<xsl:text> -> </xsl:text>
<xsl:text>source_</xsl:text>
<xsl:value-of select="@source-ref"/>
<xsl:text> [taillabel=</xsl:text>
<xsl:value-of select="../../@name"/>
<xsl:text> headlabel=</xsl:text>
<xsl:value-of select="@protocol"/>
<xsl:text>];
</xsl:text>
</xsl:for-each>
<!-- Sources - Networks: -->
<xsl:for-each select="fw:sources/fw:source/fw:network-refs/fw:network-ref">
<xsl:text> source_</xsl:text>
<xsl:value-of select="../../@name"/>
<xsl:text> -> </xsl:text>
<xsl:text>network_</xsl:text>
<xsl:value-of select="@name"/>
<xsl:text>;
</xsl:text>
</xsl:for-each>
<xsl:text>
}
</xsl:text>
</xsl:template>
</xsl:stylesheet>
|