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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "4.25.16",
3
+ "version": "4.25.17",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -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 name= "ethernet";
9
- static extends= NetworkInterfaceTypeDefinition;
10
- static specializationOf= NetworkInterfaceTypeDefinition;
11
- static owners= NetworkInterfaceTypeDefinition.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 { NetworkInterfaceTypeDefinition } from "./network-interface.mjs";
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 = NetworkInterfaceTypeDefinition;
16
- static specializationOf = NetworkInterfaceTypeDefinition;
17
- static owners = NetworkInterfaceTypeDefinition.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 const NetworkInterfaceTypeDefinition = {
20
- name: "network_interface",
21
- owners: ["host"],
22
- extends: Base.typeDefinition,
23
- specializations: {},
24
- factoryFor(owner, value) {
25
- let t = NetworkInterfaceTypeDefinition.specializations[value.kind];
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(NetworkInterfaceTypeDefinition.specializations)) {
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 NetworkInterface;
43
- },
44
- key: "name",
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.typeDefinition
59
+ type: Network
60
60
  },
61
61
  destination: string_attribute_writable
62
- }
63
- };
62
+ };
64
63
 
65
- export class NetworkInterface extends SkeletonNetworkInterface {
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 = NetworkInterfaceTypeDefinition;
8
- static specializationOf = NetworkInterfaceTypeDefinition;
9
- static owners = NetworkInterfaceTypeDefinition.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 { NetworkInterfaceTypeDefinition } from "./network-interface.mjs";
3
+ import { NetworkInterface } from "./network-interface.mjs";
4
4
 
5
5
  export class WireguardNetworkInterface extends SkeletonNetworkInterface {
6
6
  static name = "wireguard";
7
- static extends = NetworkInterfaceTypeDefinition;
8
- static specializationOf = NetworkInterfaceTypeDefinition;
9
- static owners = NetworkInterfaceTypeDefinition.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 { NetworkInterfaceTypeDefinition } from "./network-interface.mjs";
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 = NetworkInterfaceTypeDefinition;
15
+ static specializationOf = NetworkInterface;
18
16
  static owners = EthernetNetworkInterface.owners;
19
17
  static key = "name";
20
18
  static attributes = {