pmcf 1.17.1 → 1.18.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.
@@ -98,8 +98,8 @@ async function generateNetworkDefs(host, dir) {
98
98
  "",
99
99
  sectionLines("Route", {
100
100
  ...routeSectionExtra,
101
- Scope: network?.network.scope || "global",
102
- Metric: network?.network.metric || 1004,
101
+ Scope: network.scope,
102
+ Metric: network.metric,
103
103
  InitialCongestionWindow: 20,
104
104
  InitialAdvertisedReceiveWindow: 20
105
105
  }),
@@ -137,8 +137,8 @@ ctrl_interface=DIR=/run/wpa_supplicant GROUP=netdev
137
137
  update_config=1
138
138
  p2p_disabled=1
139
139
  network={
140
- ssid="${network.ssid || network.network?.ssid}"
141
- psk=${network.psk || network.network?.psk}
140
+ ssid="${network.ssid}"
141
+ psk=${network.psk}
142
142
  scan_ssid=1
143
143
  }`,
144
144
  "utf8"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "1.17.1",
3
+ "version": "1.18.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/model.mjs CHANGED
@@ -833,9 +833,34 @@ export class NetworkInterface extends Base {
833
833
  return "network_interface";
834
834
  }
835
835
 
836
+ #scope;
837
+ #metric;
838
+ #ssid;
839
+ #psk;
840
+ arpbridge;
841
+ hwaddr;
842
+ network;
843
+
836
844
  constructor(owner, data) {
837
845
  super(owner, data);
838
846
 
847
+ if (data.ssid) {
848
+ this.#ssid = data.ssid;
849
+ delete data.ssid;
850
+ }
851
+ if (data.psk) {
852
+ this.#psk = data.psk;
853
+ delete data.psk;
854
+ }
855
+ if (data.scope) {
856
+ this.#psk = data.scope;
857
+ delete data.scope;
858
+ }
859
+ if (data.metric) {
860
+ this.#metric = data.metric;
861
+ delete data.psmetric;
862
+ }
863
+
839
864
  if (data.network) {
840
865
  const network = owner.owner.network(data.network);
841
866
 
@@ -850,11 +875,42 @@ export class NetworkInterface extends Base {
850
875
  Object.assign(this, data);
851
876
 
852
877
  owner.addNetworkInterface(this);
878
+
879
+ //this.arpbridge = owner.addARPBridge(this, data.arpbridge);
853
880
  }
854
881
 
855
882
  get host() {
856
883
  return this.owner;
857
884
  }
885
+
886
+ get scope() {
887
+ return this.#scope || this.network?.scope || "global";
888
+ }
889
+
890
+ get metric() {
891
+ return this.#metric || this.network?.metric || 1004;
892
+ }
893
+
894
+ get ssid() {
895
+ return this.#ssid || this.network?.ssid;
896
+ }
897
+
898
+ get psk() {
899
+ return this.#psk || this.network?.psk;
900
+ }
901
+
902
+ get propertyNames() {
903
+ return [
904
+ ...super.propertyNames,
905
+ "arpbridge",
906
+ "hwaddr",
907
+ "network",
908
+ "ssid",
909
+ "psk",
910
+ "scope",
911
+ "metric"
912
+ ];
913
+ }
858
914
  }
859
915
 
860
916
  export class Subnet extends Base {
package/types/model.d.mts CHANGED
@@ -124,6 +124,14 @@ export class Host extends Base {
124
124
  #private;
125
125
  }
126
126
  export class NetworkInterface extends Base {
127
+ arpbridge: any;
128
+ hwaddr: any;
129
+ network: any;
130
+ get scope(): any;
131
+ get metric(): any;
132
+ get ssid(): any;
133
+ get psk(): any;
134
+ #private;
127
135
  }
128
136
  export class Subnet extends Base {
129
137
  networks: Set<any>;