summaryrefslogtreecommitdiff
path: root/redfish-core/lib/ethernet.hpp
diff options
context:
space:
mode:
authorJennifer Lee <jennifer1.lee@intel.com>2019-03-06 00:03:37 +0300
committerEd Tanous <ed.tanous@intel.com>2019-06-14 00:16:02 +0300
commitd24bfc7a855e9d209ada9452077f190971dae9cf (patch)
tree4f1daba2756187c9304ca784ce36f9babc1cdd7b /redfish-core/lib/ethernet.hpp
parentc5d03ff4737b1f4e4eb7e59f533d6c5a1faeeab5 (diff)
downloadbmcweb-d24bfc7a855e9d209ada9452077f190971dae9cf.tar.xz
[Redfish] Add FQDN and IPv6Address in NetworkProtocol and EthernetInterface
FQDN and IPv6Address are mandatory properties in OCP profile. Tested: GET /redfish/v1/Managers/bmc/NetworkProtocol HTTP/1.1 Response: { "@odata.context": "/redfish/v1/$metadata#ManagerNetworkProtocol.ManagerNetworkProtocol", "@odata.id": "/redfish/v1/Managers/bmc/NetworkProtocol", "@odata.type": "#ManagerNetworkProtocol.v1_4_0.ManagerNetworkProtocol", "Description": "Manager Network Service", "FQDN": <host name>.<domain name>, "HTTPS": { "Port": 443, "ProtocolEnabled": true }, "HostName": <host name>, ... } GET /redfish/v1/Managers/bmc/EthernetInterfaces/eth0 HTTP/1.1 Response: { "@odata.context": "/redfish/v1/$metadata#EthernetInterface.EthernetInterface", "@odata.id": "/redfish/v1/Managers/bmc/EthernetInterfaces/eth0", "@odata.type": "#EthernetInterface.v1_4_1.EthernetInterface", ... "FQDN": <host name>.<domain name>, "HostName": <host name>, ... "IPv6Addresses": [], ... } Signed-off-by: Jennifer Lee <jennifer1.lee@intel.com> Change-Id: I0ca8f98523cbcfc935e0ac3bbf93f87762ff183b
Diffstat (limited to 'redfish-core/lib/ethernet.hpp')
-rw-r--r--redfish-core/lib/ethernet.hpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/redfish-core/lib/ethernet.hpp b/redfish-core/lib/ethernet.hpp
index c4f60a9c96..2375d683e7 100644
--- a/redfish-core/lib/ethernet.hpp
+++ b/redfish-core/lib/ethernet.hpp
@@ -100,6 +100,7 @@ struct EthernetInterfaceData
std::string mac_address;
std::vector<std::uint32_t> vlan_id;
std::vector<std::string> nameservers;
+ std::vector<std::string> domainnames;
};
// Helper function that changes bits netmask notation (i.e. /24)
@@ -236,6 +237,17 @@ inline bool extractEthernetInterfaceData(const std::string &ethiface_id,
ethData.DHCPEnabled = *DHCPEnabled;
}
}
+ else if (propertyPair.first == "DomainName")
+ {
+ const std::vector<std::string> *domainNames =
+ sdbusplus::message::variant_ns::get_if<
+ std::vector<std::string>>(
+ &propertyPair.second);
+ if (domainNames != nullptr)
+ {
+ ethData.domainnames = std::move(*domainNames);
+ }
+ }
}
}
}
@@ -1498,6 +1510,11 @@ class EthernetInterface : public Node
if (!ethData.hostname.empty())
{
json_response["HostName"] = ethData.hostname;
+ if (!ethData.domainnames.empty())
+ {
+ json_response["FQDN"] =
+ ethData.hostname + "." + ethData.domainnames[0];
+ }
}
json_response["VLANs"] = {