pmcf 1.96.0 → 1.97.1
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 +32 -2
- package/src/owner.mjs +9 -4
package/package.json
CHANGED
package/src/dhcp.mjs
CHANGED
|
@@ -94,6 +94,36 @@ 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
|
+
|
|
110
|
+
const hwmap = new Map();
|
|
111
|
+
|
|
112
|
+
for await (const {
|
|
113
|
+
networkInterface,
|
|
114
|
+
address,
|
|
115
|
+
subnet,
|
|
116
|
+
domainNames
|
|
117
|
+
} of this.owner.networkAddresses()) {
|
|
118
|
+
if (networkInterface.hwaddr) {
|
|
119
|
+
hwmap.set(networkInterface.hwaddr, networkInterface.rawAddress);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const reservations = [...hwmap].map(([k, v]) => {
|
|
124
|
+
return { "hw-address": k, "ip-address": v };
|
|
125
|
+
});
|
|
126
|
+
|
|
97
127
|
const dhcp4 = {
|
|
98
128
|
Dhcp4: {
|
|
99
129
|
"interfaces-config": {
|
|
@@ -146,7 +176,7 @@ export class DHCPService extends Base {
|
|
|
146
176
|
data: "192.168.1.254"
|
|
147
177
|
}
|
|
148
178
|
],
|
|
149
|
-
reservations
|
|
179
|
+
reservations /*: [
|
|
150
180
|
{
|
|
151
181
|
"hw-address": "1a:1b:1c:1d:1e:1f",
|
|
152
182
|
"ip-address": "192.168.1.199"
|
|
@@ -156,7 +186,7 @@ export class DHCPService extends Base {
|
|
|
156
186
|
"ip-address": "192.168.1.198",
|
|
157
187
|
hostname: "special-snowflake"
|
|
158
188
|
}
|
|
159
|
-
]
|
|
189
|
+
]*/
|
|
160
190
|
}
|
|
161
191
|
],
|
|
162
192
|
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
|
|