pmcf 2.22.1 → 2.22.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/pmcf-diagram +25 -10
- package/package.json +1 -1
package/bin/pmcf-diagram
CHANGED
|
@@ -17,27 +17,42 @@ console.log("graph G {");
|
|
|
17
17
|
console.log(" node [shape=record];");
|
|
18
18
|
for await (const host of location.hosts()) {
|
|
19
19
|
console.log(
|
|
20
|
-
` ${id(host.name)} [label="${host.name}|{${
|
|
21
|
-
host.networkInterfaces.values()
|
|
22
|
-
|
|
20
|
+
` ${id(host.name)} [label="${host.name}|{${[
|
|
21
|
+
...host.networkInterfaces.values()
|
|
22
|
+
]
|
|
23
|
+
.filter(ni => !ni.isTemplate && ni.kind !== "loopback")
|
|
24
|
+
.map(ni => `<${id(ni.name)}> ${ni.name}`)
|
|
23
25
|
.join("|")}}"];`
|
|
24
26
|
);
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
for await (const network of location.networks()) {
|
|
28
30
|
console.log(
|
|
29
|
-
` ${id(network.name)} [label="${network.name}\\n${
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
` ${id(network.name)} [label="${network.name}\\n${[...network.subnets()]
|
|
32
|
+
.map(s => s.address)
|
|
33
|
+
.join(" ")}" shape=circle];`
|
|
32
34
|
);
|
|
33
35
|
|
|
34
|
-
|
|
35
|
-
for (const
|
|
36
|
-
if (
|
|
37
|
-
console.log(` ${id(network.name)} -- ${id(
|
|
36
|
+
if (network.bridge) {
|
|
37
|
+
for (const n of network.bridge) {
|
|
38
|
+
if (n !== network) {
|
|
39
|
+
console.log(` ${id(network.name)} -- ${id(n.name)};`);
|
|
38
40
|
}
|
|
39
41
|
}
|
|
40
42
|
}
|
|
43
|
+
|
|
44
|
+
for await (const na of network.networkAddresses(
|
|
45
|
+
na =>
|
|
46
|
+
na.networkInterface.network === network &&
|
|
47
|
+
!na.networkInterface.isTemplate &&
|
|
48
|
+
na.networkInterface.kind !== "loopback"
|
|
49
|
+
)) {
|
|
50
|
+
console.log(
|
|
51
|
+
` ${id(network.name)} -- ${id(na.networkInterface.host.name)}:${id(
|
|
52
|
+
na.networkInterface.name
|
|
53
|
+
)}[label="${na.address}"];`
|
|
54
|
+
);
|
|
55
|
+
}
|
|
41
56
|
}
|
|
42
57
|
|
|
43
58
|
console.log("}");
|