pmcf 1.97.1 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "1.97.1",
3
+ "version": "1.98.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/dhcp.mjs CHANGED
@@ -116,12 +116,16 @@ export class DHCPService extends Base {
116
116
  domainNames
117
117
  } of this.owner.networkAddresses()) {
118
118
  if (networkInterface.hwaddr) {
119
- hwmap.set(networkInterface.hwaddr, networkInterface.rawAddress);
119
+ hwmap.set(networkInterface.hwaddr, networkInterface);
120
120
  }
121
121
  }
122
122
 
123
- const reservations = [...hwmap].map(([k, v]) => {
124
- return { "hw-address": k, "ip-address": v };
123
+ const reservations = [...hwmap].map(([k, networkInterface]) => {
124
+ return {
125
+ "hw-address": k,
126
+ "ip-address": networkInterface.rawAddress,
127
+ hostname: networkInterface.hostName
128
+ };
125
129
  });
126
130
 
127
131
  const dhcp4 = {
@@ -177,10 +181,6 @@ export class DHCPService extends Base {
177
181
  }
178
182
  ],
179
183
  reservations /*: [
180
- {
181
- "hw-address": "1a:1b:1c:1d:1e:1f",
182
- "ip-address": "192.168.1.199"
183
- },
184
184
  {
185
185
  "client-id": "01:11:22:33:44:55:66",
186
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(".")])
@@ -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 },
@@ -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 cidrAddresses {
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 cidrAddress {
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 rawAddresses {
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 rawAddress {
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
  }
@@ -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;