pmcf 2.11.3 → 2.11.5
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/dhcp.mjs +9 -7
- package/src/utils.mjs +10 -5
- package/types/utils.d.mts +1 -1
package/package.json
CHANGED
package/src/services/dhcp.mjs
CHANGED
|
@@ -172,13 +172,15 @@ export class DHCPService extends Service {
|
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
const reservations = [...hwmap]
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
175
|
+
const reservations = [...hwmap]
|
|
176
|
+
.map(([k, networkInterface]) => {
|
|
177
|
+
return {
|
|
178
|
+
"hw-address": k,
|
|
179
|
+
"ip-address": networkInterface.rawIPv4Address,
|
|
180
|
+
hostname: networkInterface.hostName
|
|
181
|
+
};
|
|
182
|
+
})
|
|
183
|
+
.sort((a, b) => a.hostname.localeCompare(b.hostname));
|
|
182
184
|
|
|
183
185
|
const dhcp4 = {
|
|
184
186
|
Dhcp4: {
|
package/src/utils.mjs
CHANGED
|
@@ -87,12 +87,13 @@ export function isIPv4Address(address) {
|
|
|
87
87
|
return false;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
export function generateEU64(mac) {
|
|
91
|
-
//TODO
|
|
92
|
-
}
|
|
93
|
-
|
|
94
90
|
export function isIPv6Address(address) {
|
|
95
|
-
|
|
91
|
+
switch (typeof address) {
|
|
92
|
+
case "string":
|
|
93
|
+
return address.indexOf(":") >= 0;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return false;
|
|
96
97
|
}
|
|
97
98
|
|
|
98
99
|
export function isLinkLocal(address) {
|
|
@@ -107,6 +108,10 @@ export function isLinkLocal(address) {
|
|
|
107
108
|
return false;
|
|
108
109
|
}
|
|
109
110
|
|
|
111
|
+
export function generateEU64(mac) {
|
|
112
|
+
//TODO
|
|
113
|
+
}
|
|
114
|
+
|
|
110
115
|
export function isLocalhost(address) {
|
|
111
116
|
const eaddr = encodeIP(address);
|
|
112
117
|
return eaddr === IPV4_LOCALHOST || eaddr === IPV6_LOCALHOST;
|
package/types/utils.d.mts
CHANGED
|
@@ -6,9 +6,9 @@ export function bridgeToJSON(bridge: any): any[];
|
|
|
6
6
|
export function asArray(value: any): any[];
|
|
7
7
|
export function asIterator(value: any): any;
|
|
8
8
|
export function isIPv4Address(address: any): boolean;
|
|
9
|
-
export function generateEU64(mac: any): void;
|
|
10
9
|
export function isIPv6Address(address: any): boolean;
|
|
11
10
|
export function isLinkLocal(address: any): boolean;
|
|
11
|
+
export function generateEU64(mac: any): void;
|
|
12
12
|
export function isLocalhost(address: any): boolean;
|
|
13
13
|
export function normalizeIPAddress(address: any): any;
|
|
14
14
|
export function addressWithPrefixLength(address: any, prefixLength: any): string;
|