pmcf 2.10.2 → 2.10.3
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/host.mjs +8 -0
- package/src/services/dhcp.mjs +10 -5
- package/types/host.d.mts +2 -0
package/package.json
CHANGED
package/src/host.mjs
CHANGED
|
@@ -564,6 +564,14 @@ export class NetworkInterface extends Base {
|
|
|
564
564
|
return this.rawAddresses[0];
|
|
565
565
|
}
|
|
566
566
|
|
|
567
|
+
get rawIPv4Address() {
|
|
568
|
+
return this.rawAddresses.filter(a=>isIPv4Address(a))[0];
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
get rawIPv6Address() {
|
|
572
|
+
return this.rawAddresses.filter(a=>isIPv6Address(a))[0];
|
|
573
|
+
}
|
|
574
|
+
|
|
567
575
|
get rawAddresses() {
|
|
568
576
|
return [...this._ipAddresses].map(([address]) => address);
|
|
569
577
|
}
|
package/src/services/dhcp.mjs
CHANGED
|
@@ -60,11 +60,6 @@ export class DHCPService extends Service {
|
|
|
60
60
|
};
|
|
61
61
|
|
|
62
62
|
const commonConfig = {
|
|
63
|
-
"interfaces-config": {
|
|
64
|
-
interfaces: [...host.networkInterfaces.values()]
|
|
65
|
-
.filter(ni => ni.kind !== "loopback")
|
|
66
|
-
.map(ni => `${ni.name}/${ni.rawAddress}`)
|
|
67
|
-
},
|
|
68
63
|
"lease-database": {
|
|
69
64
|
type: "memfile",
|
|
70
65
|
"lfc-interval": 3600
|
|
@@ -179,6 +174,11 @@ export class DHCPService extends Service {
|
|
|
179
174
|
const dhcp4 = {
|
|
180
175
|
Dhcp4: {
|
|
181
176
|
...commonConfig,
|
|
177
|
+
"interfaces-config": {
|
|
178
|
+
interfaces: [...host.networkInterfaces.values()]
|
|
179
|
+
.filter(ni => ni.kind !== "loopback")
|
|
180
|
+
.map(ni => `${ni.name}/${ni.rawIPv4Address}`)
|
|
181
|
+
},
|
|
182
182
|
"multi-threading": {
|
|
183
183
|
"enable-multi-threading": false
|
|
184
184
|
},
|
|
@@ -218,6 +218,11 @@ export class DHCPService extends Service {
|
|
|
218
218
|
const dhcp6 = {
|
|
219
219
|
Dhcp6: {
|
|
220
220
|
...commonConfig,
|
|
221
|
+
"interfaces-config": {
|
|
222
|
+
interfaces: [...host.networkInterfaces.values()]
|
|
223
|
+
.filter(ni => ni.kind !== "loopback")
|
|
224
|
+
.map(ni => `${ni.name}/${ni.rawIPv6Address}`)
|
|
225
|
+
},
|
|
221
226
|
"control-socket": {
|
|
222
227
|
"socket-type": "unix",
|
|
223
228
|
"socket-name": "/run/kea/6-ctrl-socket"
|
package/types/host.d.mts
CHANGED
|
@@ -430,6 +430,8 @@ export class NetworkInterface extends Base {
|
|
|
430
430
|
set ipAddresses(value: Map<any, any>);
|
|
431
431
|
get ipAddresses(): Map<any, any>;
|
|
432
432
|
get rawAddress(): any;
|
|
433
|
+
get rawIPv4Address(): any;
|
|
434
|
+
get rawIPv6Address(): any;
|
|
433
435
|
get rawAddresses(): any[];
|
|
434
436
|
get cidrAddress(): any;
|
|
435
437
|
get cidrAddresses(): any[];
|