diff options
author | Luiz Otavio O Souza <luiz@netgate.com> | 2015-11-27 12:02:22 -0600 |
---|---|---|
committer | Luiz Otavio O Souza <luiz@netgate.com> | 2015-11-27 12:02:22 -0600 |
commit | cc3454821b66efa87e72bed67cb2e23d698ed679 (patch) | |
tree | ca6c3b49daaff49179e1363a0b8cfc2efe414f7e /src/usr/local/www/interfaces_vlan_edit.php | |
parent | 329b8d92573ca6682b74b05f0feaaa8d5470108c (diff) | |
download | pfsense-cc3454821b66efa87e72bed67cb2e23d698ed679.zip pfsense-cc3454821b66efa87e72bed67cb2e23d698ed679.tar.gz |
Add support to set the VLAN PCP (priority code point) in GUI. Pull Request #1757. Ticket #4133
Diffstat (limited to 'src/usr/local/www/interfaces_vlan_edit.php')
-rw-r--r-- | src/usr/local/www/interfaces_vlan_edit.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/usr/local/www/interfaces_vlan_edit.php b/src/usr/local/www/interfaces_vlan_edit.php index a7b2cc6..3a87a47 100644 --- a/src/usr/local/www/interfaces_vlan_edit.php +++ b/src/usr/local/www/interfaces_vlan_edit.php @@ -93,6 +93,7 @@ if (isset($id) && $a_vlans[$id]) { $pconfig['if'] = $a_vlans[$id]['if']; $pconfig['vlanif'] = $a_vlans[$id]['vlanif']; $pconfig['tag'] = $a_vlans[$id]['tag']; + $pconfig['pcp'] = $a_vlans[$id]['pcp']; $pconfig['descr'] = $a_vlans[$id]['descr']; } @@ -110,6 +111,9 @@ if ($_POST) { if (isset($_POST['tag']) && (!is_numericint($_POST['tag']) || ($_POST['tag'] < '1') || ($_POST['tag'] > '4094'))) { $input_errors[] = gettext("The VLAN tag must be an integer between 1 and 4094."); } + if (isset($_POST['pcp']) && !empty($_POST['pcp']) && (!is_numericint($_POST['pcp']) || ($_POST['pcp'] < '0') || ($_POST['pcp'] > '7'))) { + $input_errors[] = gettext("The VLAN Priority must be an integer between 0 and 7."); + } if (!does_interface_exist($_POST['if'])) { $input_errors[] = gettext("Interface supplied as parent is invalid"); @@ -158,6 +162,7 @@ if ($_POST) { $vlan = array(); $vlan['if'] = $_POST['if']; $vlan['tag'] = $_POST['tag']; + $vlan['pcp'] = $_POST['pcp']; $vlan['descr'] = $_POST['descr']; $vlan['vlanif'] = "{$_POST['if']}_vlan{$_POST['tag']}"; $vlan['vlanif'] = interface_vlan_configure($vlan); @@ -221,6 +226,14 @@ $section->addInput(new Form_Input( ))->setWidth(6)->setHelp(gettext('802.1Q VLAN tag (between 1 and 4094).')); $section->addInput(new Form_Input( + 'pcp', + 'VLAN Priority', + 'text', + $pconfig['pcp'], + ['placeholder' => '0'] +))->setWidth(6)->setHelp(gettext('802.1Q VLAN Priority (between 0 and 7).')); + +$section->addInput(new Form_Input( 'descr', 'Description', 'text', |