pmcf 1.96.0 → 1.97.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/package.json +1 -1
- package/src/dhcp.mjs +30 -2
- package/src/owner.mjs +9 -4
package/package.json
CHANGED
package/src/dhcp.mjs
CHANGED
|
@@ -94,6 +94,34 @@ export class DHCPService extends Base {
|
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
96
|
|
|
97
|
+
// console.log(this.owner.name,this.owner.networks());
|
|
98
|
+
/*
|
|
99
|
+
const subnets = new Set();
|
|
100
|
+
|
|
101
|
+
for (const network of this.owner.networks()) {
|
|
102
|
+
for (const subnet of network.subnets()) {
|
|
103
|
+
subnets.add(subnet);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
console.log([...subnets].map(s => s.address));
|
|
108
|
+
*/
|
|
109
|
+
const reservations = [];
|
|
110
|
+
|
|
111
|
+
for await (const {
|
|
112
|
+
networkInterface,
|
|
113
|
+
address,
|
|
114
|
+
subnet,
|
|
115
|
+
domainNames
|
|
116
|
+
} of this.owner.networkAddresses()) {
|
|
117
|
+
if (networkInterface.hwaddr) {
|
|
118
|
+
reservations.push({
|
|
119
|
+
"hw-address": networkInterface.hwaddr,
|
|
120
|
+
"ip-address": networkInterface.rawAddress,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
97
125
|
const dhcp4 = {
|
|
98
126
|
Dhcp4: {
|
|
99
127
|
"interfaces-config": {
|
|
@@ -146,7 +174,7 @@ export class DHCPService extends Base {
|
|
|
146
174
|
data: "192.168.1.254"
|
|
147
175
|
}
|
|
148
176
|
],
|
|
149
|
-
reservations
|
|
177
|
+
reservations /*: [
|
|
150
178
|
{
|
|
151
179
|
"hw-address": "1a:1b:1c:1d:1e:1f",
|
|
152
180
|
"ip-address": "192.168.1.199"
|
|
@@ -156,7 +184,7 @@ export class DHCPService extends Base {
|
|
|
156
184
|
"ip-address": "192.168.1.198",
|
|
157
185
|
hostname: "special-snowflake"
|
|
158
186
|
}
|
|
159
|
-
]
|
|
187
|
+
]*/
|
|
160
188
|
}
|
|
161
189
|
],
|
|
162
190
|
loggers
|
package/src/owner.mjs
CHANGED
|
@@ -200,6 +200,10 @@ export class Owner extends Base {
|
|
|
200
200
|
yield* this.owner.subnets();
|
|
201
201
|
}
|
|
202
202
|
yield* this.typeList("subnet");
|
|
203
|
+
|
|
204
|
+
/* for (const network of this.networks()) {
|
|
205
|
+
yield* network.subnets();
|
|
206
|
+
}*/
|
|
203
207
|
}
|
|
204
208
|
|
|
205
209
|
addSubnet(address) {
|
|
@@ -416,17 +420,18 @@ export class Owner extends Base {
|
|
|
416
420
|
|
|
417
421
|
#architectures;
|
|
418
422
|
|
|
419
|
-
set architectures(value)
|
|
420
|
-
{
|
|
423
|
+
set architectures(value) {
|
|
421
424
|
if (value instanceof Set) {
|
|
422
|
-
this.#architectures = this.#architectures
|
|
425
|
+
this.#architectures = this.#architectures
|
|
426
|
+
? this.#architectures.union(value)
|
|
427
|
+
: value;
|
|
423
428
|
} else {
|
|
424
429
|
this.#architectures = new Set(value);
|
|
425
430
|
}
|
|
426
431
|
}
|
|
427
432
|
|
|
428
433
|
get architectures() {
|
|
429
|
-
if(this.#architectures) {
|
|
434
|
+
if (this.#architectures) {
|
|
430
435
|
return this.#architectures;
|
|
431
436
|
}
|
|
432
437
|
|