pmcf 2.51.5 → 2.51.6

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "2.51.5",
3
+ "version": "2.51.6",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -24,7 +24,7 @@ const DHCPServiceTypeDefinition = {
24
24
 
25
25
  const controlAgentEndpoint = {
26
26
  type: "kea-control-agent",
27
- port: 8000,
27
+ port: 53002,
28
28
  path: "/",
29
29
  method: "get",
30
30
  protocol: "tcp",
@@ -183,6 +183,21 @@ export class DHCPService extends Service {
183
183
  "renew-timer": 900,
184
184
  "rebind-timer": 1800,
185
185
  "valid-lifetime": 3600,
186
+ "preferred-lifetime": 3000,
187
+
188
+ "option-data": [
189
+ {
190
+ name: "dns-servers",
191
+ data: dnsServerEndpoints
192
+ .filter(endpoint => endpoint.family === `IPv${family}`)
193
+ .map(endpoint => endpoint.address)
194
+ .join(",")
195
+ },
196
+ {
197
+ name: "domain-search",
198
+ data: [...this.domains].join(",")
199
+ }
200
+ ],
186
201
  "hooks-libraries": [
187
202
  {
188
203
  library: "/usr/lib/kea/hooks/libdhcp_lease_cmds.so"
@@ -308,26 +323,15 @@ export class DHCPService extends Service {
308
323
  const dhcp4 = {
309
324
  Dhcp4: {
310
325
  ...commonConfig("4"),
311
- "option-data": [
312
- {
313
- name: "domain-name-servers",
314
- data: dnsServerEndpoints
315
- .filter(endpoint => endpoint.family === "IPv4")
316
- .map(endpoint => endpoint.address)
317
- .join(",")
318
- },
319
- {
320
- name: "domain-search",
321
- data: [...this.domains].join(",")
322
- }
323
- ],
324
326
  subnet4: subnets
325
327
  .filter(s => s.family === "IPv4")
326
328
  .map((subnet, index) => {
327
329
  return {
328
330
  id: index + 1,
329
331
  subnet: subnet.longAddress,
330
- pools: [{ pool: subnet.dhcpUsableAddressRange.join(" - ") }],
332
+ pools: subnet.dhcpPools.map(range => {
333
+ return { pool: range.join(" - ") };
334
+ }),
331
335
  "option-data": [
332
336
  {
333
337
  name: "routers",
@@ -342,23 +346,15 @@ export class DHCPService extends Service {
342
346
  const dhcp6 = {
343
347
  Dhcp6: {
344
348
  ...commonConfig("6"),
345
- "preferred-lifetime": 3000,
346
- "option-data": [
347
- {
348
- name: "dns-servers",
349
- data: dnsServerEndpoints
350
- .filter(endpoint => endpoint.family === "IPv6")
351
- .map(endpoint => endpoint.address)
352
- .join(",")
353
- }
354
- ],
355
349
  subnet6: subnets
356
350
  .filter(s => s.family === "IPv6")
357
351
  .map((subnet, index) => {
358
352
  return {
359
353
  id: index + 1,
360
354
  subnet: subnet.longAddress,
361
- pools: [{ pool: subnet.addressRange.join(" - ") }],
355
+ pools: subnet.dhcpPools.map(range => {
356
+ return { pool: range.join(" - ") };
357
+ }),
362
358
 
363
359
  /*"pd-pools": [
364
360
  {
package/src/subnet.mjs CHANGED
@@ -64,10 +64,11 @@ export class Subnet extends Base {
64
64
  return rangeIP(this.prefix, this.prefixLength, 1, 1).map(a => decodeIP(a));
65
65
  }
66
66
 
67
- get dhcpUsableAddressRange()
68
- {
67
+ get dhcpPools() {
69
68
  /* TODO where to take values from ? */
70
- return rangeIP(this.prefix, this.prefixLength, 51, 6).map(a => decodeIP(a));
69
+ return [
70
+ rangeIP(this.prefix, this.prefixLength, 51, 6).map(a => decodeIP(a))
71
+ ];
71
72
  }
72
73
 
73
74
  get address() {
@@ -33,7 +33,7 @@ export class Subnet extends Base {
33
33
  matchesAddress(address: any): any;
34
34
  get isLinkLocal(): any;
35
35
  get addressRange(): any;
36
- get dhcpUsableAddressRange(): any;
36
+ get dhcpPools(): any[];
37
37
  get address(): string;
38
38
  get longAddress(): string;
39
39
  _traverse(...args: any[]): boolean;