pmcf 1.97.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 +8 -6
package/package.json
CHANGED
package/src/dhcp.mjs
CHANGED
|
@@ -95,7 +95,7 @@ export class DHCPService extends Base {
|
|
|
95
95
|
};
|
|
96
96
|
|
|
97
97
|
// console.log(this.owner.name,this.owner.networks());
|
|
98
|
-
/*
|
|
98
|
+
/*
|
|
99
99
|
const subnets = new Set();
|
|
100
100
|
|
|
101
101
|
for (const network of this.owner.networks()) {
|
|
@@ -106,7 +106,8 @@ export class DHCPService extends Base {
|
|
|
106
106
|
|
|
107
107
|
console.log([...subnets].map(s => s.address));
|
|
108
108
|
*/
|
|
109
|
-
|
|
109
|
+
|
|
110
|
+
const hwmap = new Map();
|
|
110
111
|
|
|
111
112
|
for await (const {
|
|
112
113
|
networkInterface,
|
|
@@ -115,13 +116,14 @@ export class DHCPService extends Base {
|
|
|
115
116
|
domainNames
|
|
116
117
|
} of this.owner.networkAddresses()) {
|
|
117
118
|
if (networkInterface.hwaddr) {
|
|
118
|
-
|
|
119
|
-
"hw-address": networkInterface.hwaddr,
|
|
120
|
-
"ip-address": networkInterface.rawAddress,
|
|
121
|
-
});
|
|
119
|
+
hwmap.set(networkInterface.hwaddr, networkInterface.rawAddress);
|
|
122
120
|
}
|
|
123
121
|
}
|
|
124
122
|
|
|
123
|
+
const reservations = [...hwmap].map(([k, v]) => {
|
|
124
|
+
return { "hw-address": k, "ip-address": v };
|
|
125
|
+
});
|
|
126
|
+
|
|
125
127
|
const dhcp4 = {
|
|
126
128
|
Dhcp4: {
|
|
127
129
|
"interfaces-config": {
|