pmcf 1.32.0 → 1.34.0
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-named-defs +8 -9
- package/package.json +1 -1
- package/src/owner.mjs +19 -5
- package/types/owner.d.mts +1 -0
package/bin/pmcf-named-defs
CHANGED
|
@@ -79,11 +79,10 @@ async function generateNamedDefs(owner, targetDir) {
|
|
|
79
79
|
|
|
80
80
|
for (const subnet of owner.subnets()) {
|
|
81
81
|
if (subnet.address) {
|
|
82
|
-
const reverse = reverseAddress(subnet.address);
|
|
83
82
|
const reverseArpa = reverseArpaAddress(subnet.address);
|
|
84
83
|
const zone = {
|
|
85
84
|
id: reverseArpa,
|
|
86
|
-
file: `${
|
|
85
|
+
file: `${reverseArpa}.zone`,
|
|
87
86
|
records: new Set([SOARecord, NSRecord])
|
|
88
87
|
};
|
|
89
88
|
zones.push(zone);
|
|
@@ -98,15 +97,15 @@ async function generateNamedDefs(owner, targetDir) {
|
|
|
98
97
|
networkInterface
|
|
99
98
|
} of owner.networkAddresses()) {
|
|
100
99
|
const host = networkInterface.host;
|
|
101
|
-
zone.records.add(
|
|
102
|
-
createRecord(
|
|
103
|
-
host.domainName + ".",
|
|
104
|
-
isIPv4Address(address) ? "A " : "AAAA",
|
|
105
|
-
normalizeIPAddress(address)
|
|
106
|
-
)
|
|
107
|
-
);
|
|
108
100
|
|
|
109
101
|
if (!hosts.has(host)) {
|
|
102
|
+
zone.records.add(
|
|
103
|
+
createRecord(
|
|
104
|
+
host.domainName + ".",
|
|
105
|
+
isIPv4Address(address) ? "A " : "AAAA",
|
|
106
|
+
normalizeIPAddress(address)
|
|
107
|
+
)
|
|
108
|
+
);
|
|
110
109
|
hosts.add(host);
|
|
111
110
|
for (const service of host.services()) {
|
|
112
111
|
//console.log(service.name);
|
package/package.json
CHANGED
package/src/owner.mjs
CHANGED
|
@@ -14,7 +14,7 @@ export class Owner extends Base {
|
|
|
14
14
|
return "owner";
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
constructor(owner, data={}) {
|
|
17
|
+
constructor(owner, data = {}) {
|
|
18
18
|
super(owner, data);
|
|
19
19
|
|
|
20
20
|
let dns;
|
|
@@ -83,7 +83,7 @@ export class Owner extends Base {
|
|
|
83
83
|
|
|
84
84
|
typeNamed(typeName, name) {
|
|
85
85
|
const typeSlot = this.#membersByType.get(typeName);
|
|
86
|
-
return typeSlot?.get(name);
|
|
86
|
+
return typeSlot?.get(name) || this.owner?.typeNamed(typeName, name);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
*typeList(typeName) {
|
|
@@ -296,8 +296,6 @@ export class Network extends Owner {
|
|
|
296
296
|
subnet.networks.add(this);
|
|
297
297
|
}
|
|
298
298
|
|
|
299
|
-
//owner.addObject(this);
|
|
300
|
-
|
|
301
299
|
this.bridge = owner.addBridge(this, bridge);
|
|
302
300
|
}
|
|
303
301
|
|
|
@@ -324,7 +322,7 @@ export class Network extends Owner {
|
|
|
324
322
|
}
|
|
325
323
|
}
|
|
326
324
|
|
|
327
|
-
this.error("no prefixLength",this.#ipAddresses);
|
|
325
|
+
this.error("no prefixLength", this.#ipAddresses);
|
|
328
326
|
}
|
|
329
327
|
|
|
330
328
|
get subnetAddress() {
|
|
@@ -342,6 +340,7 @@ export class Network extends Owner {
|
|
|
342
340
|
...super.propertyNames,
|
|
343
341
|
"kind",
|
|
344
342
|
"ipAddresses",
|
|
343
|
+
"subnet",
|
|
345
344
|
"prefixLength",
|
|
346
345
|
"scope",
|
|
347
346
|
"metric",
|
|
@@ -368,4 +367,19 @@ export class Subnet extends Base {
|
|
|
368
367
|
get address() {
|
|
369
368
|
return this.name;
|
|
370
369
|
}
|
|
370
|
+
|
|
371
|
+
get propertyNames() {
|
|
372
|
+
return [...super.propertyNames, "networks"];
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
_traverse(...args) {
|
|
376
|
+
if (super._traverse(...args)) {
|
|
377
|
+
for (const network of this.networks) {
|
|
378
|
+
network._traverse(...args);
|
|
379
|
+
}
|
|
380
|
+
return true;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
return false;
|
|
384
|
+
}
|
|
371
385
|
}
|
package/types/owner.d.mts
CHANGED