pmcf 3.8.13 → 3.8.14
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/services/kea.mjs +11 -8
- package/src/subnet.mjs +6 -2
- package/types/cluster.d.mts +14 -0
- package/types/location.d.mts +28 -0
- package/types/network.d.mts +14 -0
- package/types/owner.d.mts +14 -0
- package/types/root.d.mts +28 -0
- package/types/subnet.d.mts +14 -0
package/package.json
CHANGED
package/src/services/kea.mjs
CHANGED
|
@@ -415,6 +415,13 @@ export class KeaService extends Service {
|
|
|
415
415
|
const subnets = [...this.subnets].filter(
|
|
416
416
|
s => s !== SUBNET_LOCALHOST_IPV4 && s !== SUBNET_LOCALHOST_IPV6
|
|
417
417
|
);
|
|
418
|
+
|
|
419
|
+
const pools = (subnet) => {
|
|
420
|
+
return subnet.dhcpPools.map(pool => {
|
|
421
|
+
return { pool: Array.isArray(pool) ? pool.join(" - ") : pool };
|
|
422
|
+
});
|
|
423
|
+
};
|
|
424
|
+
|
|
418
425
|
const dhcp4 = {
|
|
419
426
|
Dhcp4: {
|
|
420
427
|
...(await commonConfig("4")),
|
|
@@ -424,16 +431,14 @@ export class KeaService extends Service {
|
|
|
424
431
|
return {
|
|
425
432
|
id: index + 1,
|
|
426
433
|
subnet: subnet.longAddress,
|
|
427
|
-
pools: subnet
|
|
428
|
-
|
|
429
|
-
}),
|
|
434
|
+
pools: pools(subnet),
|
|
435
|
+
reservations: reservations(subnet, "4"),
|
|
430
436
|
"option-data": [
|
|
431
437
|
{
|
|
432
438
|
name: "routers",
|
|
433
439
|
data: network.gateway.address
|
|
434
440
|
}
|
|
435
|
-
]
|
|
436
|
-
reservations: reservations(subnet, "4")
|
|
441
|
+
]
|
|
437
442
|
};
|
|
438
443
|
})
|
|
439
444
|
}
|
|
@@ -447,9 +452,7 @@ export class KeaService extends Service {
|
|
|
447
452
|
return {
|
|
448
453
|
id: index + 1,
|
|
449
454
|
subnet: subnet.longAddress,
|
|
450
|
-
pools: subnet
|
|
451
|
-
return { pool: range.join(" - ") };
|
|
452
|
-
}),
|
|
455
|
+
pools: pools(subnet),
|
|
453
456
|
reservations: reservations(subnet, "6")
|
|
454
457
|
};
|
|
455
458
|
})
|
package/src/subnet.mjs
CHANGED
|
@@ -21,7 +21,8 @@ const SubnetTypeDefinition = {
|
|
|
21
21
|
isKey: true
|
|
22
22
|
},
|
|
23
23
|
networks: { type: "network", collection: true, writable: true },
|
|
24
|
-
prefixLength: { ...number_attribute }
|
|
24
|
+
prefixLength: { ...number_attribute },
|
|
25
|
+
family: { ...string_attribute }
|
|
25
26
|
}
|
|
26
27
|
};
|
|
27
28
|
|
|
@@ -66,8 +67,11 @@ export class Subnet extends Base {
|
|
|
66
67
|
|
|
67
68
|
get dhcpPools() {
|
|
68
69
|
/* TODO where to take values from ? */
|
|
70
|
+
|
|
69
71
|
return [
|
|
70
|
-
|
|
72
|
+
this.family === "IPv6"
|
|
73
|
+
? this.prefix
|
|
74
|
+
: rangeIP(this.prefix, this.prefixLength, 51, 6).map(a => decodeIP(a))
|
|
71
75
|
];
|
|
72
76
|
}
|
|
73
77
|
|
package/types/cluster.d.mts
CHANGED
|
@@ -106,6 +106,20 @@ export class Cluster extends Host {
|
|
|
106
106
|
get?: Function;
|
|
107
107
|
env?: string[] | string;
|
|
108
108
|
};
|
|
109
|
+
family: {
|
|
110
|
+
type: string;
|
|
111
|
+
isKey: boolean;
|
|
112
|
+
writable: boolean;
|
|
113
|
+
mandatory: boolean;
|
|
114
|
+
collection: boolean;
|
|
115
|
+
private?: boolean;
|
|
116
|
+
depends?: string;
|
|
117
|
+
description?: string;
|
|
118
|
+
default?: any;
|
|
119
|
+
set?: Function;
|
|
120
|
+
get?: Function;
|
|
121
|
+
env?: string[] | string;
|
|
122
|
+
};
|
|
109
123
|
};
|
|
110
124
|
};
|
|
111
125
|
collection: boolean;
|
package/types/location.d.mts
CHANGED
|
@@ -106,6 +106,20 @@ export class Location extends Owner {
|
|
|
106
106
|
get?: Function;
|
|
107
107
|
env?: string[] | string;
|
|
108
108
|
};
|
|
109
|
+
family: {
|
|
110
|
+
type: string;
|
|
111
|
+
isKey: boolean;
|
|
112
|
+
writable: boolean;
|
|
113
|
+
mandatory: boolean;
|
|
114
|
+
collection: boolean;
|
|
115
|
+
private?: boolean;
|
|
116
|
+
depends?: string;
|
|
117
|
+
description?: string;
|
|
118
|
+
default?: any;
|
|
119
|
+
set?: Function;
|
|
120
|
+
get?: Function;
|
|
121
|
+
env?: string[] | string;
|
|
122
|
+
};
|
|
109
123
|
};
|
|
110
124
|
};
|
|
111
125
|
collection: boolean;
|
|
@@ -317,6 +331,20 @@ export class Location extends Owner {
|
|
|
317
331
|
get?: Function;
|
|
318
332
|
env?: string[] | string;
|
|
319
333
|
};
|
|
334
|
+
family: {
|
|
335
|
+
type: string;
|
|
336
|
+
isKey: boolean;
|
|
337
|
+
writable: boolean;
|
|
338
|
+
mandatory: boolean;
|
|
339
|
+
collection: boolean;
|
|
340
|
+
private?: boolean;
|
|
341
|
+
depends?: string;
|
|
342
|
+
description?: string;
|
|
343
|
+
default?: any;
|
|
344
|
+
set?: Function;
|
|
345
|
+
get?: Function;
|
|
346
|
+
env?: string[] | string;
|
|
347
|
+
};
|
|
320
348
|
};
|
|
321
349
|
};
|
|
322
350
|
collection: boolean;
|
package/types/network.d.mts
CHANGED
|
@@ -108,6 +108,20 @@ export class Network extends Owner {
|
|
|
108
108
|
get?: Function;
|
|
109
109
|
env?: string[] | string;
|
|
110
110
|
};
|
|
111
|
+
family: {
|
|
112
|
+
type: string;
|
|
113
|
+
isKey: boolean;
|
|
114
|
+
writable: boolean;
|
|
115
|
+
mandatory: boolean;
|
|
116
|
+
collection: boolean;
|
|
117
|
+
private?: boolean;
|
|
118
|
+
depends?: string;
|
|
119
|
+
description?: string;
|
|
120
|
+
default?: any;
|
|
121
|
+
set?: Function;
|
|
122
|
+
get?: Function;
|
|
123
|
+
env?: string[] | string;
|
|
124
|
+
};
|
|
111
125
|
};
|
|
112
126
|
};
|
|
113
127
|
collection: boolean;
|
package/types/owner.d.mts
CHANGED
|
@@ -104,6 +104,20 @@ export class Owner extends Base {
|
|
|
104
104
|
get?: Function;
|
|
105
105
|
env?: string[] | string;
|
|
106
106
|
};
|
|
107
|
+
family: {
|
|
108
|
+
type: string;
|
|
109
|
+
isKey: boolean;
|
|
110
|
+
writable: boolean;
|
|
111
|
+
mandatory: boolean;
|
|
112
|
+
collection: boolean;
|
|
113
|
+
private?: boolean;
|
|
114
|
+
depends?: string;
|
|
115
|
+
description?: string;
|
|
116
|
+
default?: any;
|
|
117
|
+
set?: Function;
|
|
118
|
+
get?: Function;
|
|
119
|
+
env?: string[] | string;
|
|
120
|
+
};
|
|
107
121
|
};
|
|
108
122
|
};
|
|
109
123
|
collection: boolean;
|
package/types/root.d.mts
CHANGED
|
@@ -110,6 +110,20 @@ export class Root extends Location {
|
|
|
110
110
|
get?: Function;
|
|
111
111
|
env?: string[] | string;
|
|
112
112
|
};
|
|
113
|
+
family: {
|
|
114
|
+
type: string;
|
|
115
|
+
isKey: boolean;
|
|
116
|
+
writable: boolean;
|
|
117
|
+
mandatory: boolean;
|
|
118
|
+
collection: boolean;
|
|
119
|
+
private?: boolean;
|
|
120
|
+
depends?: string;
|
|
121
|
+
description?: string;
|
|
122
|
+
default?: any;
|
|
123
|
+
set?: Function;
|
|
124
|
+
get?: Function;
|
|
125
|
+
env?: string[] | string;
|
|
126
|
+
};
|
|
113
127
|
};
|
|
114
128
|
};
|
|
115
129
|
collection: boolean;
|
|
@@ -321,6 +335,20 @@ export class Root extends Location {
|
|
|
321
335
|
get?: Function;
|
|
322
336
|
env?: string[] | string;
|
|
323
337
|
};
|
|
338
|
+
family: {
|
|
339
|
+
type: string;
|
|
340
|
+
isKey: boolean;
|
|
341
|
+
writable: boolean;
|
|
342
|
+
mandatory: boolean;
|
|
343
|
+
collection: boolean;
|
|
344
|
+
private?: boolean;
|
|
345
|
+
depends?: string;
|
|
346
|
+
description?: string;
|
|
347
|
+
default?: any;
|
|
348
|
+
set?: Function;
|
|
349
|
+
get?: Function;
|
|
350
|
+
env?: string[] | string;
|
|
351
|
+
};
|
|
324
352
|
};
|
|
325
353
|
};
|
|
326
354
|
collection: boolean;
|
package/types/subnet.d.mts
CHANGED
|
@@ -39,6 +39,20 @@ export class Subnet extends Base {
|
|
|
39
39
|
get?: Function;
|
|
40
40
|
env?: string[] | string;
|
|
41
41
|
};
|
|
42
|
+
family: {
|
|
43
|
+
type: string;
|
|
44
|
+
isKey: boolean;
|
|
45
|
+
writable: boolean;
|
|
46
|
+
mandatory: boolean;
|
|
47
|
+
collection: boolean;
|
|
48
|
+
private?: boolean;
|
|
49
|
+
depends?: string;
|
|
50
|
+
description?: string;
|
|
51
|
+
default?: any;
|
|
52
|
+
set?: Function;
|
|
53
|
+
get?: Function;
|
|
54
|
+
env?: string[] | string;
|
|
55
|
+
};
|
|
42
56
|
};
|
|
43
57
|
};
|
|
44
58
|
networks: Set<any>;
|