pmcf 4.25.16 → 4.25.17
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/network-interfaces/ethernet.mjs +7 -10
- package/src/network-interfaces/loopback.mjs +4 -4
- package/src/network-interfaces/network-interface.mjs +15 -17
- package/src/network-interfaces/tun.mjs +3 -4
- package/src/network-interfaces/wireguard.mjs +4 -4
- package/src/network-interfaces/wlan.mjs +3 -5
package/package.json
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { default_attribute_writable, addType } from "pacc";
|
|
2
|
-
import {
|
|
3
|
-
NetworkInterface,
|
|
4
|
-
NetworkInterfaceTypeDefinition
|
|
5
|
-
} from "./network-interface.mjs";
|
|
2
|
+
import { NetworkInterface } from "./network-interface.mjs";
|
|
6
3
|
|
|
7
4
|
export class EthernetNetworkInterface extends NetworkInterface {
|
|
8
|
-
static
|
|
9
|
-
static extends=
|
|
10
|
-
static specializationOf=
|
|
11
|
-
static owners=
|
|
12
|
-
static key= "name";
|
|
13
|
-
static attributes= {
|
|
5
|
+
static name = "ethernet";
|
|
6
|
+
static extends = NetworkInterface;
|
|
7
|
+
static specializationOf = NetworkInterface;
|
|
8
|
+
static owners = NetworkInterface.owners;
|
|
9
|
+
static key = "name";
|
|
10
|
+
static attributes = {
|
|
14
11
|
arpbridge: {
|
|
15
12
|
...default_attribute_writable,
|
|
16
13
|
type: "network_interface",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { addType } from "pacc";
|
|
2
2
|
import { SUBNET_LOCALHOST_IPV4, SUBNET_LOCALHOST_IPV6 } from "pmcf";
|
|
3
3
|
import { SkeletonNetworkInterface } from "./skeleton.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { NetworkInterface } from "./network-interface.mjs";
|
|
5
5
|
|
|
6
6
|
const _localAddresses = new Map([
|
|
7
7
|
["127.0.0.1", SUBNET_LOCALHOST_IPV4],
|
|
@@ -12,9 +12,9 @@ const _localDomains = new Set(["localhost"]);
|
|
|
12
12
|
|
|
13
13
|
export class LoopbackNetworkInterface extends SkeletonNetworkInterface {
|
|
14
14
|
static name = "loopback";
|
|
15
|
-
static extends =
|
|
16
|
-
static specializationOf =
|
|
17
|
-
static owners =
|
|
15
|
+
static extends = NetworkInterface;
|
|
16
|
+
static specializationOf = NetworkInterface;
|
|
17
|
+
static owners = NetworkInterface.owners;
|
|
18
18
|
static key = "name";
|
|
19
19
|
|
|
20
20
|
static typeDefinition = this;
|
|
@@ -16,17 +16,17 @@ import { SkeletonNetworkInterface } from "./skeleton.mjs";
|
|
|
16
16
|
import { Network } from "../network.mjs";
|
|
17
17
|
import { yesno } from "../utils.mjs";
|
|
18
18
|
|
|
19
|
-
export
|
|
20
|
-
name
|
|
21
|
-
owners
|
|
22
|
-
extends
|
|
23
|
-
specializations
|
|
24
|
-
factoryFor(owner, value) {
|
|
25
|
-
let t =
|
|
19
|
+
export class NetworkInterface extends SkeletonNetworkInterface {
|
|
20
|
+
static name = "network_interface";
|
|
21
|
+
static owners = ["host"];
|
|
22
|
+
static extends = Base;
|
|
23
|
+
static specializations = {};
|
|
24
|
+
static factoryFor(owner, value) {
|
|
25
|
+
let t = this.specializations[value.kind];
|
|
26
26
|
|
|
27
27
|
//console.log("factoryFor", owner, value);
|
|
28
28
|
if (!t) {
|
|
29
|
-
for (t of Object.values(
|
|
29
|
+
for (t of Object.values(this.specializations)) {
|
|
30
30
|
if (t.clazz.isCommonName && t.clazz.isCommonName(value.name)) {
|
|
31
31
|
break;
|
|
32
32
|
}
|
|
@@ -39,10 +39,10 @@ export const NetworkInterfaceTypeDefinition = {
|
|
|
39
39
|
return t.clazz;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
return
|
|
43
|
-
}
|
|
44
|
-
key
|
|
45
|
-
attributes
|
|
42
|
+
return this;
|
|
43
|
+
}
|
|
44
|
+
static key = "name";
|
|
45
|
+
static attributes = {
|
|
46
46
|
...networkAttributes,
|
|
47
47
|
...networkAddressAttributes,
|
|
48
48
|
|
|
@@ -56,14 +56,12 @@ export const NetworkInterfaceTypeDefinition = {
|
|
|
56
56
|
hwaddr: string_attribute_writable,
|
|
57
57
|
network: {
|
|
58
58
|
...default_attribute_writable,
|
|
59
|
-
type: Network
|
|
59
|
+
type: Network
|
|
60
60
|
},
|
|
61
61
|
destination: string_attribute_writable
|
|
62
|
-
}
|
|
63
|
-
};
|
|
62
|
+
};
|
|
64
63
|
|
|
65
|
-
|
|
66
|
-
static typeDefinition = NetworkInterfaceTypeDefinition;
|
|
64
|
+
static typeDefinition = this;
|
|
67
65
|
|
|
68
66
|
static {
|
|
69
67
|
addType(this);
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { addType } from "pacc";
|
|
2
2
|
import { NetworkInterface } from "./network-interface.mjs";
|
|
3
|
-
import { NetworkInterfaceTypeDefinition } from "./network-interface.mjs";
|
|
4
3
|
|
|
5
4
|
export class TUNNetworkInterface extends NetworkInterface {
|
|
6
5
|
static name = "tun";
|
|
7
|
-
static extends =
|
|
8
|
-
static specializationOf =
|
|
9
|
-
static owners =
|
|
6
|
+
static extends = NetworkInterface;
|
|
7
|
+
static specializationOf = NetworkInterface;
|
|
8
|
+
static owners = NetworkInterface.owners;
|
|
10
9
|
static key = "name";
|
|
11
10
|
|
|
12
11
|
static typeDefinition = this;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { addType } from "pacc";
|
|
2
2
|
import { SkeletonNetworkInterface } from "./skeleton.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { NetworkInterface } from "./network-interface.mjs";
|
|
4
4
|
|
|
5
5
|
export class WireguardNetworkInterface extends SkeletonNetworkInterface {
|
|
6
6
|
static name = "wireguard";
|
|
7
|
-
static extends =
|
|
8
|
-
static specializationOf =
|
|
9
|
-
static owners =
|
|
7
|
+
static extends = NetworkInterface;
|
|
8
|
+
static specializationOf = NetworkInterface;
|
|
9
|
+
static owners = NetworkInterface.owners;
|
|
10
10
|
static key = "name";
|
|
11
11
|
|
|
12
12
|
static typeDefinition = this;
|
|
@@ -6,15 +6,13 @@ import {
|
|
|
6
6
|
addType
|
|
7
7
|
} from "pacc";
|
|
8
8
|
import { writeLines, sectionLines } from "../utils.mjs";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
EthernetNetworkInterface
|
|
12
|
-
} from "./ethernet.mjs";
|
|
9
|
+
import { NetworkInterface } from "./network-interface.mjs";
|
|
10
|
+
import { EthernetNetworkInterface } from "./ethernet.mjs";
|
|
13
11
|
|
|
14
12
|
export class WLANNetworkInterface extends EthernetNetworkInterface {
|
|
15
13
|
static name = "wlan";
|
|
16
14
|
static extends = EthernetNetworkInterface;
|
|
17
|
-
static specializationOf =
|
|
15
|
+
static specializationOf = NetworkInterface;
|
|
18
16
|
static owners = EthernetNetworkInterface.owners;
|
|
19
17
|
static key = "name";
|
|
20
18
|
static attributes = {
|