mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-15 00:54:41 +00:00
interfaces: convert vlan assignments
This commit is contained in:
parent
b9bdf760b8
commit
56f8bae72a
@ -191,6 +191,23 @@ function core_devices()
|
||||
'type' => 'gre',
|
||||
];
|
||||
|
||||
$vlan_names = [];
|
||||
|
||||
foreach (config_read_array('vlans', 'vlan') as $dev) {
|
||||
$vlan_names[$dev['vlanif']] = [
|
||||
'descr' => sprintf(gettext('%s %s (Parent: %s, Tag: %s)'), $dev['vlanif'], $dev['descr'], $dev['if'], $dev['tag']),
|
||||
'ifdescr' => sprintf('%s', $dev['descr']),
|
||||
'name' => $dev['vlanif'],
|
||||
];
|
||||
}
|
||||
|
||||
$devices[] = [
|
||||
'pattern' => '_vlan|^vlan|^qinq',
|
||||
'names' => $vlan_names,
|
||||
'volatile' => true,
|
||||
'type' => 'vlan',
|
||||
];
|
||||
|
||||
$wlan_names = [];
|
||||
|
||||
foreach (config_read_array('wireless', 'clone') as $dev) {
|
||||
@ -245,7 +262,6 @@ function core_devices()
|
||||
$devices[] = array('pattern' => '^wg', 'volatile' => true);
|
||||
$devices[] = array('pattern' => '^zt', 'volatile' => true);
|
||||
$devices[] = array('pattern' => '_stf', 'volatile' => true);
|
||||
$devices[] = array('pattern' => '_vlan|^vlan|^qinq', 'volatile' => true);
|
||||
|
||||
return $devices;
|
||||
}
|
||||
|
||||
@ -62,7 +62,6 @@ function list_interfaces($devices)
|
||||
/* XXX suppose this should plug into plugins_devices() eventually */
|
||||
$config_sections['laggs.lagg'] = ['descr' => 'laggif,descr', 'key' => 'laggif', 'format' => '%s (%s)', 'fields' => 'members'];
|
||||
$config_sections['ppps.ppp'] = ['descr' => 'if,ports,descr,username', 'key' => 'if','format' => '%s (%s) - %s %s', 'fields' => 'type'];
|
||||
$config_sections['vlans.vlan'] = ['descr' => 'vlanif,descr,if,tag', 'key' => 'vlanif', 'format' => gettext('%s %s (Parent: %s, Tag: %s)')];
|
||||
|
||||
// add physical network interfaces
|
||||
foreach (get_interface_list() as $key => $intf_item) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user