pmcf 1.97.0 → 1.98.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 +12 -10
- package/src/host.mjs +9 -1
- package/src/network-support.mjs +1 -0
- package/types/cluster.d.mts +5 -0
- package/types/host.d.mts +7 -1
- package/types/network-support.d.mts +12 -4
- package/types/service.d.mts +5 -0
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,18 @@ 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);
|
|
122
120
|
}
|
|
123
121
|
}
|
|
124
122
|
|
|
123
|
+
const reservations = [...hwmap].map(([k, networkInterface]) => {
|
|
124
|
+
return {
|
|
125
|
+
"hw-address": k,
|
|
126
|
+
"ip-address": networkInterface.rawAddress,
|
|
127
|
+
hostname: networkInterface.hostName
|
|
128
|
+
};
|
|
129
|
+
});
|
|
130
|
+
|
|
125
131
|
const dhcp4 = {
|
|
126
132
|
Dhcp4: {
|
|
127
133
|
"interfaces-config": {
|
|
@@ -175,10 +181,6 @@ export class DHCPService extends Base {
|
|
|
175
181
|
}
|
|
176
182
|
],
|
|
177
183
|
reservations /*: [
|
|
178
|
-
{
|
|
179
|
-
"hw-address": "1a:1b:1c:1d:1e:1f",
|
|
180
|
-
"ip-address": "192.168.1.199"
|
|
181
|
-
},
|
|
182
184
|
{
|
|
183
185
|
"client-id": "01:11:22:33:44:55:66",
|
|
184
186
|
"ip-address": "192.168.1.198",
|
package/src/host.mjs
CHANGED
|
@@ -481,9 +481,9 @@ export class NetworkInterface extends Base {
|
|
|
481
481
|
#psk;
|
|
482
482
|
#network;
|
|
483
483
|
#kind;
|
|
484
|
+
#hostName;
|
|
484
485
|
arpbridge;
|
|
485
486
|
hwaddr;
|
|
486
|
-
hostName;
|
|
487
487
|
|
|
488
488
|
constructor(owner, data) {
|
|
489
489
|
super(owner, data);
|
|
@@ -562,6 +562,14 @@ export class NetworkInterface extends Base {
|
|
|
562
562
|
}
|
|
563
563
|
}
|
|
564
564
|
|
|
565
|
+
get hostName() {
|
|
566
|
+
return this.#hostName || this.host.hostName;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
set hostName(value) {
|
|
570
|
+
this.#hostName = value;
|
|
571
|
+
}
|
|
572
|
+
|
|
565
573
|
get domainNames() {
|
|
566
574
|
return this.hostName
|
|
567
575
|
? new Set([[this.hostName, this.host.domain].join(".")])
|
package/src/network-support.mjs
CHANGED
|
@@ -9,6 +9,7 @@ export const networkProperties = {
|
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export const networkAddressProperties = {
|
|
12
|
+
hostName: { type: "string", collection: false, writeable: true },
|
|
12
13
|
cidrAddresses: { type: "string", collection: true, writeable: false },
|
|
13
14
|
cidrAddress: { type: "string", collection: false, writeable: false },
|
|
14
15
|
rawAddresses: { type: "string", collection: true, writeable: false },
|
package/types/cluster.d.mts
CHANGED
|
@@ -383,6 +383,11 @@ export class Cluster extends Host {
|
|
|
383
383
|
collection: boolean;
|
|
384
384
|
writeable: boolean;
|
|
385
385
|
};
|
|
386
|
+
hostName: {
|
|
387
|
+
type: string;
|
|
388
|
+
collection: boolean;
|
|
389
|
+
writeable: boolean;
|
|
390
|
+
};
|
|
386
391
|
cidrAddresses: {
|
|
387
392
|
type: string;
|
|
388
393
|
collection: boolean;
|
package/types/host.d.mts
CHANGED
|
@@ -141,6 +141,11 @@ export class Host extends Base {
|
|
|
141
141
|
collection: boolean;
|
|
142
142
|
writeable: boolean;
|
|
143
143
|
};
|
|
144
|
+
hostName: {
|
|
145
|
+
type: string;
|
|
146
|
+
collection: boolean;
|
|
147
|
+
writeable: boolean;
|
|
148
|
+
};
|
|
144
149
|
cidrAddresses: {
|
|
145
150
|
type: string;
|
|
146
151
|
collection: boolean;
|
|
@@ -374,7 +379,6 @@ export class NetworkInterface extends Base {
|
|
|
374
379
|
};
|
|
375
380
|
arpbridge: any;
|
|
376
381
|
hwaddr: any;
|
|
377
|
-
hostName: any;
|
|
378
382
|
addSubnet(address: any): any;
|
|
379
383
|
set ipAddresses(value: Map<any, any>);
|
|
380
384
|
get ipAddresses(): Map<any, any>;
|
|
@@ -387,6 +391,8 @@ export class NetworkInterface extends Base {
|
|
|
387
391
|
subnetForAddress(address: any): any;
|
|
388
392
|
get gateway(): any;
|
|
389
393
|
get gatewayAddress(): any;
|
|
394
|
+
set hostName(value: any);
|
|
395
|
+
get hostName(): any;
|
|
390
396
|
get domainNames(): any;
|
|
391
397
|
get network_interface(): this;
|
|
392
398
|
set network(network: any);
|
|
@@ -54,7 +54,7 @@ export namespace networkProperties {
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
export namespace networkAddressProperties {
|
|
57
|
-
namespace
|
|
57
|
+
namespace hostName {
|
|
58
58
|
let type_7: string;
|
|
59
59
|
export { type_7 as type };
|
|
60
60
|
let collection_7: boolean;
|
|
@@ -62,7 +62,7 @@ export namespace networkAddressProperties {
|
|
|
62
62
|
let writeable_7: boolean;
|
|
63
63
|
export { writeable_7 as writeable };
|
|
64
64
|
}
|
|
65
|
-
namespace
|
|
65
|
+
namespace cidrAddresses {
|
|
66
66
|
let type_8: string;
|
|
67
67
|
export { type_8 as type };
|
|
68
68
|
let collection_8: boolean;
|
|
@@ -70,7 +70,7 @@ export namespace networkAddressProperties {
|
|
|
70
70
|
let writeable_8: boolean;
|
|
71
71
|
export { writeable_8 as writeable };
|
|
72
72
|
}
|
|
73
|
-
namespace
|
|
73
|
+
namespace cidrAddress {
|
|
74
74
|
let type_9: string;
|
|
75
75
|
export { type_9 as type };
|
|
76
76
|
let collection_9: boolean;
|
|
@@ -78,7 +78,7 @@ export namespace networkAddressProperties {
|
|
|
78
78
|
let writeable_9: boolean;
|
|
79
79
|
export { writeable_9 as writeable };
|
|
80
80
|
}
|
|
81
|
-
namespace
|
|
81
|
+
namespace rawAddresses {
|
|
82
82
|
let type_10: string;
|
|
83
83
|
export { type_10 as type };
|
|
84
84
|
let collection_10: boolean;
|
|
@@ -86,4 +86,12 @@ export namespace networkAddressProperties {
|
|
|
86
86
|
let writeable_10: boolean;
|
|
87
87
|
export { writeable_10 as writeable };
|
|
88
88
|
}
|
|
89
|
+
namespace rawAddress {
|
|
90
|
+
let type_11: string;
|
|
91
|
+
export { type_11 as type };
|
|
92
|
+
let collection_11: boolean;
|
|
93
|
+
export { collection_11 as collection };
|
|
94
|
+
let writeable_11: boolean;
|
|
95
|
+
export { writeable_11 as writeable };
|
|
96
|
+
}
|
|
89
97
|
}
|
package/types/service.d.mts
CHANGED
|
@@ -102,6 +102,11 @@ export class Service extends Base {
|
|
|
102
102
|
collection: boolean;
|
|
103
103
|
writeable: boolean;
|
|
104
104
|
};
|
|
105
|
+
hostName: {
|
|
106
|
+
type: string;
|
|
107
|
+
collection: boolean;
|
|
108
|
+
writeable: boolean;
|
|
109
|
+
};
|
|
105
110
|
cidrAddresses: {
|
|
106
111
|
type: string;
|
|
107
112
|
collection: boolean;
|