pmcf 1.17.1 → 1.19.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/bin/pmcf-host-defs +4 -4
- package/package.json +1 -1
- package/src/model.mjs +64 -2
- package/types/model.d.mts +8 -0
package/bin/pmcf-host-defs
CHANGED
|
@@ -98,8 +98,8 @@ async function generateNetworkDefs(host, dir) {
|
|
|
98
98
|
"",
|
|
99
99
|
sectionLines("Route", {
|
|
100
100
|
...routeSectionExtra,
|
|
101
|
-
Scope: network
|
|
102
|
-
Metric: network
|
|
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
|
|
141
|
-
psk=${network.psk
|
|
140
|
+
ssid="${network.ssid}"
|
|
141
|
+
psk=${network.psk}
|
|
142
142
|
scan_ssid=1
|
|
143
143
|
}`,
|
|
144
144
|
"utf8"
|
package/package.json
CHANGED
package/src/model.mjs
CHANGED
|
@@ -776,6 +776,10 @@ export class Host extends Base {
|
|
|
776
776
|
|
|
777
777
|
addNetworkInterface(networkInterface) {
|
|
778
778
|
this.networkInterfaces[networkInterface.name] = networkInterface;
|
|
779
|
+
|
|
780
|
+
if(networkInterface.network) {
|
|
781
|
+
networkInterface.network.addHost(this);
|
|
782
|
+
}
|
|
779
783
|
}
|
|
780
784
|
|
|
781
785
|
*networkAddresses() {
|
|
@@ -833,28 +837,86 @@ export class NetworkInterface extends Base {
|
|
|
833
837
|
return "network_interface";
|
|
834
838
|
}
|
|
835
839
|
|
|
840
|
+
#scope;
|
|
841
|
+
#metric;
|
|
842
|
+
#ssid;
|
|
843
|
+
#psk;
|
|
844
|
+
arpbridge;
|
|
845
|
+
hwaddr;
|
|
846
|
+
network;
|
|
847
|
+
|
|
836
848
|
constructor(owner, data) {
|
|
837
849
|
super(owner, data);
|
|
838
850
|
|
|
851
|
+
if (data.ssid) {
|
|
852
|
+
this.#ssid = data.ssid;
|
|
853
|
+
delete data.ssid;
|
|
854
|
+
}
|
|
855
|
+
if (data.psk) {
|
|
856
|
+
this.#psk = data.psk;
|
|
857
|
+
delete data.psk;
|
|
858
|
+
}
|
|
859
|
+
if (data.scope) {
|
|
860
|
+
this.#psk = data.scope;
|
|
861
|
+
delete data.scope;
|
|
862
|
+
}
|
|
863
|
+
if (data.metric) {
|
|
864
|
+
this.#metric = data.metric;
|
|
865
|
+
delete data.psmetric;
|
|
866
|
+
}
|
|
867
|
+
|
|
839
868
|
if (data.network) {
|
|
840
869
|
const network = owner.owner.network(data.network);
|
|
841
870
|
|
|
842
871
|
if (network) {
|
|
843
872
|
data.network = network;
|
|
844
|
-
network.addHost(owner);
|
|
845
873
|
} else {
|
|
846
874
|
this.error("Missing network", data.network);
|
|
847
875
|
}
|
|
848
876
|
}
|
|
849
|
-
|
|
877
|
+
else if(owner.owner instanceof Network) {
|
|
878
|
+
data.network = owner.owner;
|
|
879
|
+
}
|
|
880
|
+
|
|
850
881
|
Object.assign(this, data);
|
|
851
882
|
|
|
852
883
|
owner.addNetworkInterface(this);
|
|
884
|
+
|
|
885
|
+
//this.arpbridge = owner.addARPBridge(this, data.arpbridge);
|
|
853
886
|
}
|
|
854
887
|
|
|
855
888
|
get host() {
|
|
856
889
|
return this.owner;
|
|
857
890
|
}
|
|
891
|
+
|
|
892
|
+
get scope() {
|
|
893
|
+
return this.#scope || this.network?.scope || "global";
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
get metric() {
|
|
897
|
+
return this.#metric || this.network?.metric || 1004;
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
get ssid() {
|
|
901
|
+
return this.#ssid || this.network?.ssid;
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
get psk() {
|
|
905
|
+
return this.#psk || this.network?.psk;
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
get propertyNames() {
|
|
909
|
+
return [
|
|
910
|
+
...super.propertyNames,
|
|
911
|
+
"arpbridge",
|
|
912
|
+
"hwaddr",
|
|
913
|
+
"network",
|
|
914
|
+
"ssid",
|
|
915
|
+
"psk",
|
|
916
|
+
"scope",
|
|
917
|
+
"metric"
|
|
918
|
+
];
|
|
919
|
+
}
|
|
858
920
|
}
|
|
859
921
|
|
|
860
922
|
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>;
|