pmcf 2.24.3 → 2.25.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/endpoint.mjs +9 -7
- package/src/service.mjs +2 -3
- package/src/services/dhcp.mjs +8 -9
- package/src/services/ntp.mjs +8 -4
- package/types/endpoint.d.mts +3 -2
package/package.json
CHANGED
package/src/endpoint.mjs
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { familyIP } from "ip-utilties";
|
|
2
|
-
|
|
3
1
|
export class Endpoint {
|
|
4
|
-
constructor(service,
|
|
2
|
+
constructor(service, networkAddress, data) {
|
|
5
3
|
this.service = service;
|
|
6
|
-
this.
|
|
4
|
+
this.networkAddress = networkAddress;
|
|
7
5
|
Object.assign(this, data);
|
|
8
6
|
}
|
|
9
7
|
|
|
@@ -16,13 +14,13 @@ export class Endpoint {
|
|
|
16
14
|
}
|
|
17
15
|
|
|
18
16
|
get hostName() {
|
|
19
|
-
return this.networkInterface.hostName;
|
|
17
|
+
return this.networkAddress.networkInterface.hostName;
|
|
20
18
|
}
|
|
21
19
|
|
|
22
20
|
#address;
|
|
23
21
|
|
|
24
22
|
get address() {
|
|
25
|
-
return this.#address ?? this.
|
|
23
|
+
return this.#address ?? this.networkAddress.address;
|
|
26
24
|
}
|
|
27
25
|
|
|
28
26
|
set address(value) {
|
|
@@ -30,6 +28,10 @@ export class Endpoint {
|
|
|
30
28
|
}
|
|
31
29
|
|
|
32
30
|
get family() {
|
|
33
|
-
return
|
|
31
|
+
return this.networkAddress.family;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
get networkInterface() {
|
|
35
|
+
return this.networkAddress.networkInterface;
|
|
34
36
|
}
|
|
35
37
|
}
|
package/src/service.mjs
CHANGED
|
@@ -189,12 +189,11 @@ export class Service extends Base {
|
|
|
189
189
|
];
|
|
190
190
|
|
|
191
191
|
const result = [...this.server.networkAddresses()]
|
|
192
|
-
.map(
|
|
192
|
+
.map(na =>
|
|
193
193
|
data.map(
|
|
194
194
|
d =>
|
|
195
|
-
new Endpoint(this,
|
|
195
|
+
new Endpoint(this, na, {
|
|
196
196
|
...d,
|
|
197
|
-
address: sa.address,
|
|
198
197
|
...local
|
|
199
198
|
})
|
|
200
199
|
)
|
package/src/services/dhcp.mjs
CHANGED
|
@@ -52,17 +52,16 @@ export class DHCPService extends Service {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
endpoints(filter) {
|
|
55
|
-
const
|
|
55
|
+
const endpoints = super.endpoints(filter);
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
];
|
|
57
|
+
for (const na of this.server.networkAddresses(
|
|
58
|
+
na => na.networkInterface.kind === "localhost"
|
|
59
|
+
)) {
|
|
60
|
+
endpoints.push(new Endpoint(this, na, controlAgentEndpoint));
|
|
61
|
+
endpoints.push(new Endpoint(this, na, ddnsEndpoint));
|
|
63
62
|
}
|
|
64
63
|
|
|
65
|
-
return
|
|
64
|
+
return endpoints;
|
|
66
65
|
}
|
|
67
66
|
|
|
68
67
|
async *preparePackages(dir) {
|
|
@@ -256,7 +255,7 @@ export class DHCPService extends Service {
|
|
|
256
255
|
}
|
|
257
256
|
],
|
|
258
257
|
subnet4: [...subnets]
|
|
259
|
-
.filter(s => s.family===
|
|
258
|
+
.filter(s => s.family === "IPv4")
|
|
260
259
|
.map((subnet, index) => {
|
|
261
260
|
return {
|
|
262
261
|
id: index + 1,
|
package/src/services/ntp.mjs
CHANGED
|
@@ -85,10 +85,14 @@ export class NTPService extends ExtraSourceService {
|
|
|
85
85
|
};
|
|
86
86
|
|
|
87
87
|
const lines = [
|
|
88
|
-
...serviceEndpoints(
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
88
|
+
...serviceEndpoints(
|
|
89
|
+
this,
|
|
90
|
+
{
|
|
91
|
+
...NTP_SERVICE_FILTER,
|
|
92
|
+
priority: ">=10"
|
|
93
|
+
},
|
|
94
|
+
e => e.family === 'IPv4' && e.networkInterface.kind !== "loopback"
|
|
95
|
+
).map(
|
|
92
96
|
endpoint =>
|
|
93
97
|
`${endpoint.service.isPool ? "pool" : "server"} ${
|
|
94
98
|
endpoint.address
|
package/types/endpoint.d.mts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
export class Endpoint {
|
|
2
|
-
constructor(service: any,
|
|
2
|
+
constructor(service: any, networkAddress: any, data: any);
|
|
3
3
|
service: any;
|
|
4
|
-
|
|
4
|
+
networkAddress: any;
|
|
5
5
|
toString(): string;
|
|
6
6
|
get socketAddress(): string;
|
|
7
7
|
get hostName(): any;
|
|
8
8
|
set address(value: any);
|
|
9
9
|
get address(): any;
|
|
10
10
|
get family(): any;
|
|
11
|
+
get networkInterface(): any;
|
|
11
12
|
#private;
|
|
12
13
|
}
|