Add Support for VLAN interfaces
VLAN interfaces look like:
/xyz/openbmc_project/network/eth0_60
Modified the regexes to pick up VLAN interfaces and VLAN IPV4
interfaces.
To create a VLAN interface from the command line:
busctl call xyz.openbmc_project.Network \
/xyz/openbmc_project/network \
xyz.openbmc_project.Network.VLAN.Create VLAN su "eth0" 60
Tested: Set the Netmask, IP Address, and Gateway on a Witherspoon
VLAN IPV4 interface.
Change-Id: If5f3c042cc8b75e8d0e6f27d921c4347c5216bd2
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/app/common/services/api-utils.js b/app/common/services/api-utils.js
index 93b70e1..43d4772 100644
--- a/app/common/services/api-utils.js
+++ b/app/common/services/api-utils.js
@@ -109,7 +109,7 @@
var interfaceId = '', keyParts = [], interfaceHash = '',
interfaceType = '';
for (var key in content.data) {
- if (key.match(/network\/eth\d+$/ig)) {
+ if (key.match(/network\/eth\d+(_\d+)?$/ig)) {
interfaceId = key.split('/').pop();
if (data.interface_ids.indexOf(interfaceId) == -1) {
data.interface_ids.push(interfaceId);
@@ -133,7 +133,7 @@
}
} else if (
key.match(
- /network\/eth\d+\/ipv[4|6]\/[a-z0-9]+$/ig)) {
+ /network\/eth\d+(_\d+)?\/ipv[4|6]\/[a-z0-9]+$/ig)) {
keyParts = key.split('/');
interfaceHash = keyParts.pop();
interfaceType = keyParts.pop();