Where the first stage primarily aims to keep the legacy handling of gateways intact, this stage does the conversion to MVC.
As part of the migration strategy, configured gateways will not be touched if the migration fails. This allows users to repair the gateways in the new situation.
No change in behaviour yet, but funnily enough the channel list
build got easier and the previous code makes sense now...
Since we are dealing with a lot of duplicated channels now it
further points to restructuring this into a merged select for
mode, channel and width as this is how the driver operates.
Channels for "list chan" and "list txpower" may be in a side by side
2 column layout which makes the current parsing fail and miss half
the channels. Replace the parsing with "sturdy" regex to collect all
the results and also make sure that all modes and fallback modes have
the actual channel information. Also clean the templating in the
static PHP file a little in related areas.
This commit imports part of the changes from @swhite2 which will keep the legacy handling intact for the first stage of the migration. It should be backwards compatible with the previous (23.7.x) code.
Changes new in this commit which where not in the original PR:
1) dpinger_status() missed $gwitem which rendered gateways statusses down
2) Model version number set to 0.0.1 so we can use the migration later to step into 1.0.0
3) Gateways->gatewayIterator() do not yield MVC records ensuring we are still using legacy config data when being called.
This simplifies the call a little and allows us to do better recursion
away from config-based interfaces. We could just pass the device as
the interface and it would work but then we pass it down twice and it's
not very readable.
This requires to set up the VLAN priority field of the
DHCPv4 settings as well as removing the vlan-pcp option
which is redundant now. This way we have a simpler
approach to finding the correct value while not borrowing
from IPv6 or parsing the advanced options for vlan-pcp.
Leaving the old vlan-pcp in place should not matter.
The last value is ours and this one should be used.
PR: https://forum.opnsense.org/index.php?topic=33376.0
Media settings probe is suboptimal for hardware detection and
interfaces_hardware() already uses the function to decide where
to enforce hardware settings.
PR: https://forum.opnsense.org/index.php?topic=30923.0
Use the hardcoded _wlan0 append when we have the base interface already.
This only happens to "count" the number of existing clones.
We also get the opportunity to clean up get_real_interface() which was
a bit ironic calling interface_get_wireless_clone() three times and then
the other wireless code ignoring get_real_interface() in favour of
interface_get_wireless_clone().
Make the presence of <wireless/> node authoritative except
for the assignment page where we need to set this node in
the first place.
Now pivot away from a handrolled regex of devices names to
trust the output of the sysctl net.wlan.devices which is also
the prefix for our clones.
Some call flows require this, others don't and on 22.7 we seem to miss
one that did. Instead of adding more monitor reloads in the possible
spots move the ones that are shared into the general routing reload since
the two are almost always clustered together.
Also use the $interface argument to figure out which monitors require
reloading. This will avoid quite a few spurious reloads on larger
setups.
Boot is a little special, but easy enough to ensure we don't call monitor
reload twice.
The wireless code "integration" is horrible even by moderate standards
in our code base. In the future the best way would be to ditch all of
it and rebuild (parts) required by users.
* Wireless: Add EAP support for infrastructure mode
Add configuration for WPA2 Enterprise authentication for Wireless
infrastructure mode:
* EAP modes TLS, TTLS and PEAP
* Phase 2 modes MD5 and MSCHAPv2
* CA certificate for server verification
* Certificate for client authentication
* Wireless: dynamically show/hide relevant properties
For wireless interface configuration show/hide only currently
relevant settings to facilitate configuration.
* Show WEP settings only when WEP is enabled
* Show WPA settings only when WPA is enabled
* Show EAP settings only when EAP is enabled
* Show IEEE 802.1X settings only when relevant
* Hide AP-only/Adhoc-only settings when infrastructure mode
is selected
Since we also change the vlan names here for new devices to eventually
avoid overlong vlan interface names (#3222) we need to make sure the
rest of the system knows the new prefixes.
Some related style changes in code and text.
* Make it only react to PPP related lookups, no generic fallback
* Move the VLAN portion to a simplified dedicated function
* As a placeholder we shall see if bridges and LAGGs benefit from it
o move media detection to generic legacy_interfaces_details() parser
o hide options when not applicable (only auto-select means non physical it seems).